wcd-6.0.5/ 0000755 0001755 0001001 00000000000 14421240062 011541 5 ustar waterlan Geen wcd-6.0.5/doc/ 0000755 0001755 0001001 00000000000 14421240062 012306 5 ustar waterlan Geen wcd-6.0.5/doc/copying.dj 0000644 0001755 0001001 00000003047 14421240062 014301 0 ustar waterlan Geen This is the file "copying.dj". It does not apply to any sources or
binaries copyrighted by UCB Berkeley or the Free Software Foundation.
Copyright Information for sources and executables that are marked
Copyright (C) DJ Delorie
24 Kirsten Ave
Rochester NH 03867-2954
This document is Copyright (C) DJ Delorie and may be distributed
verbatim, but changing it is not allowed.
Source code copyright DJ Delorie is distributed under the terms of the
GNU General Public Licence, with the following exceptions:
* Any existing copyright or authorship information in any given source
file must remain intact. If you modify a source file, a notice to that
effect must be added to the authorship information in the source file.
* binaries provided in djgpp may be distributed without sources ONLY if
the recipient is given sufficient information to obtain a copy of djgpp
themselves. This primarily applies to go32.exe, emu387, stub.exe, and
the graphics drivers.
* modified versions of the binaries provided in djgpp must be
distributed under the terms of the GPL.
* objects and libraries linked into an application may be distributed
without sources.
-----
Changes to source code copyright BSD or FSF by DJ Delorie fall under
the terms of the original copyright.
A copy of the file "COPYING" is included with this document. If you did not
receive a copy of "COPYING", you may obtain one from whence this document
was obtained, or by writing:
Free Software Foundation
675 Mass Ave
Cambridge, MA 02139
USA
wcd-6.0.5/doc/copying.txt 0000644 0001755 0001001 00000043305 14421240062 014524 0 ustar waterlan Geen ------------------------------------------------------------------------
Table of Contents
* GNU GENERAL PUBLIC LICENSE
o Preamble
o TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION
o How to Apply These Terms to Your New Programs
------------------------------------------------------------------------
GNU GENERAL PUBLIC LICENSE
Version 2, June 1991
Copyright (C) 1989, 1991 Free Software Foundation, Inc.,
51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
Everyone is permitted to copy and distribute verbatim copies
of this license document, but changing it is not allowed.
Preamble
The licenses for most software are designed to take away your freedom to
share and change it. By contrast, the GNU General Public License is
intended to guarantee your freedom to share and change free software--to
make sure the software is free for all its users. This General Public
License applies to most of the Free Software Foundation's software and to
any other program whose authors commit to using it. (Some other Free
Software Foundation software is covered by the GNU Library General Public
License instead.) You can apply it to your programs, too.
When we speak of free software, we are referring to freedom, not price. Our
General Public Licenses are designed to make sure that you have the freedom
to distribute copies of free software (and charge for this service if you
wish), that you receive source code or can get it if you want it, that you
can change the software or use pieces of it in new free programs; and that
you know you can do these things.
To protect your rights, we need to make restrictions that forbid anyone to
deny you these rights or to ask you to surrender the rights. These
restrictions translate to certain responsibilities for you if you
distribute copies of the software, or if you modify it.
For example, if you distribute copies of such a program, whether gratis or
for a fee, you must give the recipients all the rights that you have. You
must make sure that they, too, receive or can get the source code. And you
must show them these terms so they know their rights.
We protect your rights with two steps: (1) copyright the software, and (2)
offer you this license which gives you legal permission to copy, distribute
and/or modify the software.
Also, for each author's protection and ours, we want to make certain that
everyone understands that there is no warranty for this free software. If
the software is modified by someone else and passed on, we want its
recipients to know that what they have is not the original, so that any
problems introduced by others will not reflect on the original authors'
reputations.
Finally, any free program is threatened constantly by software patents. We
wish to avoid the danger that redistributors of a free program will
individually obtain patent licenses, in effect making the program
proprietary. To prevent this, we have made it clear that any patent must be
licensed for everyone's free use or not licensed at all.
The precise terms and conditions for copying, distribution and modification
follow.
TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION
0. This License applies to any program or other work which contains a
notice placed by the copyright holder saying it may be distributed under
the terms of this General Public License. The "Program", below, refers to
any such program or work, and a "work based on the Program" means either
the Program or any derivative work under copyright law: that is to say, a
work containing the Program or a portion of it, either verbatim or with
modifications and/or translated into another language. (Hereinafter,
translation is included without limitation in the term "modification".)
Each licensee is addressed as "you".
Activities other than copying, distribution and modification are not
covered by this License; they are outside its scope. The act of running the
Program is not restricted, and the output from the Program is covered only
if its contents constitute a work based on the Program (independent of
having been made by running the Program). Whether that is true depends on
what the Program does.
1. You may copy and distribute verbatim copies of the Program's source code
as you receive it, in any medium, provided that you conspicuously and
appropriately publish on each copy an appropriate copyright notice and
disclaimer of warranty; keep intact all the notices that refer to this
License and to the absence of any warranty; and give any other recipients
of the Program a copy of this License along with the Program.
You may charge a fee for the physical act of transferring a copy, and you
may at your option offer warranty protection in exchange for a fee.
2. You may modify your copy or copies of the Program or any portion of it,
thus forming a work based on the Program, and copy and distribute such
modifications or work under the terms of Section 1 above, provided that you
also meet all of these conditions:
* a) You must cause the modified files to carry prominent notices
stating that you changed the files and the date of any change.
* b) You must cause any work that you distribute or publish, that in
whole or in part contains or is derived from the Program or any part
thereof, to be licensed as a whole at no charge to all third parties
under the terms of this License.
* c) If the modified program normally reads commands interactively when
run, you must cause it, when started running for such interactive use
in the most ordinary way, to print or display an announcement
including an appropriate copyright notice and a notice that there is
no warranty (or else, saying that you provide a warranty) and that
users may redistribute the program under these conditions, and telling
the user how to view a copy of this License. (Exception: if the
Program itself is interactive but does not normally print such an
announcement, your work based on the Program is not required to print
an announcement.)
These requirements apply to the modified work as a whole. If identifiable
sections of that work are not derived from the Program, and can be
reasonably considered independent and separate works in themselves, then
this License, and its terms, do not apply to those sections when you
distribute them as separate works. But when you distribute the same
sections as part of a whole which is a work based on the Program, the
distribution of the whole must be on the terms of this License, whose
permissions for other licensees extend to the entire whole, and thus to
each and every part regardless of who wrote it.
Thus, it is not the intent of this section to claim rights or contest your
rights to work written entirely by you; rather, the intent is to exercise
the right to control the distribution of derivative or collective works
based on the Program.
In addition, mere aggregation of another work not based on the Program with
the Program (or with a work based on the Program) on a volume of a storage
or distribution medium does not bring the other work under the scope of
this License.
3. You may copy and distribute the Program (or a work based on it, under
Section 2) in object code or executable form under the terms of Sections 1
and 2 above provided that you also do one of the following:
* a) Accompany it with the complete corresponding machine-readable
source code, which must be distributed under the terms of Sections 1
and 2 above on a medium customarily used for software interchange; or,
* b) Accompany it with a written offer, valid for at least three years,
to give any third party, for a charge no more than your cost of
physically performing source distribution, a complete machine-readable
copy of the corresponding source code, to be distributed under the
terms of Sections 1 and 2 above on a medium customarily used for
software interchange; or,
* c) Accompany it with the information you received as to the offer to
distribute corresponding source code. (This alternative is allowed
only for noncommercial distribution and only if you received the
program in object code or executable form with such an offer, in
accord with Subsection b above.)
The source code for a work means the preferred form of the work for making
modifications to it. For an executable work, complete source code means all
the source code for all modules it contains, plus any associated interface
definition files, plus the scripts used to control compilation and
installation of the executable. However, as a special exception, the source
code distributed need not include anything that is normally distributed (in
either source or binary form) with the major components (compiler, kernel,
and so on) of the operating system on which the executable runs, unless
that component itself accompanies the executable.
If distribution of executable or object code is made by offering access to
copy from a designated place, then offering equivalent access to copy the
source code from the same place counts as distribution of the source code,
even though third parties are not compelled to copy the source along with
the object code.
4. You may not copy, modify, sublicense, or distribute the Program except
as expressly provided under this License. Any attempt otherwise to copy,
modify, sublicense or distribute the Program is void, and will
automatically terminate your rights under this License. However, parties
who have received copies, or rights, from you under this License will not
have their licenses terminated so long as such parties remain in full
compliance.
5. You are not required to accept this License, since you have not signed
it. However, nothing else grants you permission to modify or distribute the
Program or its derivative works. These actions are prohibited by law if you
do not accept this License. Therefore, by modifying or distributing the
Program (or any work based on the Program), you indicate your acceptance of
this License to do so, and all its terms and conditions for copying,
distributing or modifying the Program or works based on it.
6. Each time you redistribute the Program (or any work based on the
Program), the recipient automatically receives a license from the original
licensor to copy, distribute or modify the Program subject to these terms
and conditions. You may not impose any further restrictions on the
recipients' exercise of the rights granted herein. You are not responsible
for enforcing compliance by third parties to this License.
7. If, as a consequence of a court judgment or allegation of patent
infringement or for any other reason (not limited to patent issues),
conditions are imposed on you (whether by court order, agreement or
otherwise) that contradict the conditions of this License, they do not
excuse you from the conditions of this License. If you cannot distribute so
as to satisfy simultaneously your obligations under this License and any
other pertinent obligations, then as a consequence you may not distribute
the Program at all. For example, if a patent license would not permit
royalty-free redistribution of the Program by all those who receive copies
directly or indirectly through you, then the only way you could satisfy
both it and this License would be to refrain entirely from distribution of
the Program.
If any portion of this section is held invalid or unenforceable under any
particular circumstance, the balance of the section is intended to apply
and the section as a whole is intended to apply in other circumstances.
It is not the purpose of this section to induce you to infringe any patents
or other property right claims or to contest validity of any such claims;
this section has the sole purpose of protecting the integrity of the free
software distribution system, which is implemented by public license
practices. Many people have made generous contributions to the wide range
of software distributed through that system in reliance on consistent
application of that system; it is up to the author/donor to decide if he or
she is willing to distribute software through any other system and a
licensee cannot impose that choice.
This section is intended to make thoroughly clear what is believed to be a
consequence of the rest of this License.
8. If the distribution and/or use of the Program is restricted in certain
countries either by patents or by copyrighted interfaces, the original
copyright holder who places the Program under this License may add an
explicit geographical distribution limitation excluding those countries, so
that distribution is permitted only in or among countries not thus
excluded. In such case, this License incorporates the limitation as if
written in the body of this License.
9. The Free Software Foundation may publish revised and/or new versions of
the General Public License from time to time. Such new versions will be
similar in spirit to the present version, but may differ in detail to
address new problems or concerns.
Each version is given a distinguishing version number. If the Program
specifies a version number of this License which applies to it and "any
later version", you have the option of following the terms and conditions
either of that version or of any later version published by the Free
Software Foundation. If the Program does not specify a version number of
this License, you may choose any version ever published by the Free
Software Foundation.
10. If you wish to incorporate parts of the Program into other free
programs whose distribution conditions are different, write to the author
to ask for permission. For software which is copyrighted by the Free
Software Foundation, write to the Free Software Foundation; we sometimes
make exceptions for this. Our decision will be guided by the two goals of
preserving the free status of all derivatives of our free software and of
promoting the sharing and reuse of software generally.
NO WARRANTY
11. BECAUSE THE PROGRAM IS LICENSED FREE OF CHARGE, THERE IS NO WARRANTY
FOR THE PROGRAM, TO THE EXTENT PERMITTED BY APPLICABLE LAW. EXCEPT WHEN
OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR OTHER PARTIES
PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED
OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE ENTIRE RISK AS TO
THE QUALITY AND PERFORMANCE OF THE PROGRAM IS WITH YOU. SHOULD THE PROGRAM
PROVE DEFECTIVE, YOU ASSUME THE COST OF ALL NECESSARY SERVICING, REPAIR OR
CORRECTION.
12. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING
WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY AND/OR
REDISTRIBUTE THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES,
INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING
OUT OF THE USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED
TO LOSS OF DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY
YOU OR THIRD PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER
PROGRAMS), EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE
POSSIBILITY OF SUCH DAMAGES.
END OF TERMS AND CONDITIONS
How to Apply These Terms to Your New Programs
If you develop a new program, and you want it to be of the greatest
possible use to the public, the best way to achieve this is to make it free
software which everyone can redistribute and change under these terms.
To do so, attach the following notices to the program. It is safest to
attach them to the start of each source file to most effectively convey the
exclusion of warranty; and each file should have at least the "copyright"
line and a pointer to where the full notice is found.
one line to give the program's name and an idea of what it does.
Copyright (C) 19yy name of author
This program is free software; you can redistribute it and/or
modify it under the terms of the GNU General Public License
as published by the Free Software Foundation; either version 2
of the License, or (at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software
Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
Also add information on how to contact you by electronic and paper mail.
If the program is interactive, make it output a short notice like this when
it starts in an interactive mode:
Gnomovision version 69, Copyright (C) 19yy name of author
Gnomovision comes with ABSOLUTELY NO WARRANTY; for details
type `show w'. This is free software, and you are welcome
to redistribute it under certain conditions; type `show c'
for details.
The hypothetical commands `show w' and `show c' should show the appropriate
parts of the General Public License. Of course, the commands you use may be
called something other than `show w' and `show c'; they could even be
mouse-clicks or menu items--whatever suits your program.
You should also get your employer (if you work as a programmer) or your
school, if any, to sign a "copyright disclaimer" for the program, if
necessary. Here is a sample; alter the names:
Yoyodyne, Inc., hereby disclaims all copyright
interest in the program `Gnomovision'
(which makes passes at compilers) written
by James Hacker.
signature of Ty Coon, 1 April 1989
Ty Coon, President of Vice
This General Public License does not permit incorporating your program into
proprietary programs. If your program is a subroutine library, you may
consider it more useful to permit linking proprietary applications with the
library. If this is what you want to do, use the GNU Library General Public
License instead of this License.
wcd-6.0.5/doc/dosdir.txt 0000644 0001755 0001001 00000005032 14421240062 014333 0 ustar waterlan Geen DOSDIR: A Portable DOS/UNIX/VMS Directory Interface
version 2.1a
-----------------------------------------------
DOSDIR is an implementation of the MS-DOS directory functions (findfirst,
findnext, and fnsplit) on MS-DOS, UNIX, and VMS platforms using the
appropriate file & directory structure.
It uses the DOS directory framework to provide a portable interface
for MS-DOS/UNIX/VMS application programmers. DOSDIR minimizes the OS-
specific directory access code for applications allowing programmers to
concentrate on the application itself and not on the low-level directory
and file structure. DOSDIR applications will run on their native operating
systems with the appropriate file syntax and handling, which is expected
for that platform.
An alternative mechanism, the POSIX opendir/readdir directory functions,
provides low-level directory access with all of the file handling in
the application. Findfirst/findnext filter files matching a filemask
and returns file information, such as whether the entry is directory or a
regular file or the entry is read-only. However, readdir() returns only the
filenames of files in the opened directory stream.
The package includes the following files:
COPYING - GNU license and copying conditions.
dosdir.c - DOSDIR findfirst/findnext functions
dirent.c - C/C++ Run Time Library opendir/readdir functions
fnsplit.c - C/C++ Run Time Library fnsplit function
match.c - Info-ZIP regular expression evaluator
*.h - DOSDIR header files
dirtree.c - Example graphically displays directory structure
filelist.c - Example program using dosdir directory functions
example2.c - Another example program
example3.c - An example program for opendir functions
makefile.bor - Makefile for MS-DOS with Borland C++
makefile.unx - Makefile for UNIX with gcc or cc
vaxmake.com - Script to compile examples for VAX/VMS
DOSDIR supports and has been tested under the following systems:
MS-DOS 3.3/5.0 with Borland C++ V3.x/4.0, Turbo C, or Microsoft C V6.0/7.0,
SunOS 4.1 with SUN or GNU C compilers, SGI IRIX 4.05 and 5.x, DEC Alpha OSF/1,
and VMS 5.5 with VAX C. Other comparable ANSI C compilers should work as well.
Jason Mathews
The MITRE Coporation
202 Burlington Road
Bedford, MA 01730-1420
Email: mathews@mitre.org, mathews@computer.org
DOSDIR is free software, you can redistribute it and/or modify it under
the terms of the GNU General Public License, a copy of which is
provided under the name COPYING.
wcd-6.0.5/doc/faq.txt 0000644 0001755 0001001 00000003717 14421240062 013626 0 ustar waterlan Geen
sh/bash/zsh/csh:
Q: I have installed wcd. It looks like it works, but the
directory is actually not changed.
A: The directory can only be changed by the shell builtin cd
command. You need to define a wcd function or alias.
See the manual or the installation documentation.
bash:
Q: I have wcd.exe installed and defined the function
in ~/.bashrc but the shell returns: "command not found".
A: The problem is that ~/.bashrc is not executed because
the bash is started as an interactive login shell.
The bash only executes the commands in ~/.bashrc if it
is started as an interactive shell that is not a login
shell.
If the bash is started as an interactive login shell it
first reads and executes commands from the file
/etc/profile, if that file exists. After reading that
file, it looks for ~/.bash_profile, ~/.bash_login, and
~/.profile, in that order, and reads and executes commands
from the first one that exists and is readable.
The solution is to define the wcd function in one of these
files.
Windows
Q: How do I automatically start the explorer after wcd?
A: If you use the DOS 32 bit version on windows 95/98/ME this batch script will work:
@echo off
wcd.exe %1 %2 %3 %4 %5 %6
explorer.exe .
If you use the win32 console version add an extra line to your wcd.bat
script (on windows NT/2000/XP/Vista/7).
@echo off
wcdwin32.exe %*
echo explorer.exe . >> c:\wcdgo.bat
c:\wcdgo.bat
Windows NT/2000/XP/Vista/7
Q: The system administrator has set environment variable HOME,
but I want the behaviour of wcd as if HOME and WCDHOME were
not set (as I was used to on DOS/Windows 9x).
A: In the wcd.bat file you have to copy HOME into another
variable, unset HOME, run wcd, and copy HOME back to its original
value. An example follows:
@echo off
set HOMETEMP=%HOME%
set HOME=
wcdwin32.exe %*
set HOME=%HOMETEMP%
c:\wcdgo.bat
You may need to rescan your drives after this.
wcd-6.0.5/doc/GCC_DOS.txt 0000644 0001755 0001001 00000025560 14421240062 014160 0 ustar waterlan Geen This file explains how to compile wcd for DOS, Windows, and OS/2
with GNU C compiler (GCC, DJGPP/MinGW/EMX).
For Unix/Linux/Cygwin compile instructions see file UNIX.txt
For how to install the program on DOS, Windows, OS/2 see file INST_DOS.txt.
Prerequisites
=============
* gcc : GNU C compiler
* make : GNU make
* sh : POSIX type shell
* coreutils : GNU core utilities package
Optional:
* perl : Practical Extraction and Report Language (perlpod)
* gettext : Framework to help GNU packages produce multi-lingual messages.
* libiconv : Character set conversion library.
* pdcurses : CRT screen handling and optimization package
* ncurses : A free software emulation of curses in System V Release 4.0 (SVr4), and more.
* libunistring : Library with functions for manipulating Unicode strings.
If you want to generate PostScript or PDF versions of the manual:
* groff : GNU troff text formatting system.
* ghostscript : An interpreter for the PostScript language and for PDF (ps2pdf)
Needed for building packages:
* zip : compressor-archiver https://sourceforge.net/projects/infozip/
gcc
===
DOS : DJGPP : https://www.delorie.com/djgpp/
Windows : MinGW : https://osdn.net/projects/mingw/
Windows : MinGW-w64 : https://mingw-w64.org/
Windows : MSYS2 : https://www.msys2.org/
OS/2 : EMX : http://www.edm2.com/index.php/The_EMX_Project
DJGPP 2.03 gcc >= 4.6 seems to cause problems. Crashes of gcc itself, or crashing
wcd binaries. Use DJGPP 2.03 gcc <= 4.5.3.
DJGPP 2.05 gcc seems to work OK (I tried gcc 5.3.0).
Wcd compiles with mingw.org and mingw-w64. I recommend using mingw-w64 in the MSYS2 project.
The MSYS2 project includes the MinGW-w64 compiler
for both 32 and 64 bit. Plus it includes a complete building environment. A
POSIX shell, and many libraries and utilities.
See also https://www.msys2.org/
On OS/2 don't add gcc flag -Zargs-wild, because we want wcd to see the literal
arguments. Wild argument expansion may lead to unexpected behaviour when an
argument matches a file in the current directory.
sh
==
A POSIX type shell. A copy of Bash or Zsh will do.
GNU make may not work as expected if you don't have a proper shell installed.
You can choose a shell for GNU Make by setting the environment variable SHELL.
See also the GNU make manual:
https://www.gnu.org/software/make/manual/make.html#Choosing-the-Shell
DJGPP : Includes bash
MinGW-w64 : Use MSYS2
In DJGPP it is certain that you get problems if you don't make the SHELL
variable point to bash (c:/djgpp/bin/bash.exe).
make, coreutils
===============
make and coreutils can be found as packages on the web site of the gcc compiler.
Coreutiles is needed for `chmod', `install', `mkdir', `mv', `rm', and `uname'.
install : copy files and set their attributes (part of GNU `coreutils' package).
For DJGPP compiler use package `fileutils' instead of `coreutils'. Coreutils is
not (yet) available for DJGPP.
perl
====
Perl packages are distributed with the DJGPP, MinGW, MSYS2, and EMX environment.
gettext (libintl) and libiconv
==============================
gettext and libiconv can be found as packages on the web site of the gcc compiler.
Until wcd version 5.1.1 I used GnuWin32's gettext/libiconv instead of MinGW's,
because the GnuWin32 port of libintl (part of gettext) has builtin relocation
support. From wcd version 5.1.2 I use MinGW's gettext/libiconv. Wcd win32
binaries are packed with a patched version of MinGW's libintl-8.dll that also
supports relocation. See also https://waterlan.home.xs4all.nl/libintl.html and
https://sourceforge.net/p/mingw/bugs/1808/
The patch was not accepted by MinGW.org, but the MSYS2 project has included
the patch for both 32 and 64 bit.
groff and ghostscript
=====================
These packages are needed if you want to create PostScript and PDF versions of
the wcd manual page.
Groff and ghostscript are available in the Cygwin environment (https://cygwin.com).
Problems on Windows VISTA and higher
====================================
DOS programs can only run on 32 bit versions of Windows,
not on 64 bit Windows versions.
Permissions
-----------
To be able to run `gmake install' you may need adminstrator rights. You
can get a Command Prompt with administrator rights if you right click on
the Command Prompt icon and select `run as administrator'.
DJGPP Out of memory
-------------------
Since Windows Vista SP1 DOS programs are by default limited by Windows to
use a maximum amount of 32 MB memory. When you compile wcd with DJGPP
2.05 gcc will run out of memory with this message:
cc1.exe: out of memory allocating 39408 bytes after a total of 9774416 bytes
Use a registry editor (such as REGEDIT) to create the new (REG_DWORD)
registry value DpmiLimit under the key
Computer\HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\WOW
Now edit the value to reflect the maximum amount of memory (in bytes)
that you wish to make available to console applications (DOS command boxes).
E.g. 8000000 (hexadecimal) to make 128 MB available.
See also https://www.trnicely.net/misc/vista.html
DJGPP on Windows 8.1 and higher
-------------------------------
DJGPP is not running anymore on the latest 32 bit Windows 8.1 and 10.
The last 32 bit Windows version on which DJGPP runs OK is Windows 7.
My solution for Windows 8.1 and higher is to run DJGPP in DOSBox.
Basic Installation
==================
dos32 : DOS 32 bit
dos32bsh : DOS 32 bit for BASH
win32 : Windows 32 bit console version.
win32psh : Windows 32 bit PowerShell version.
win32zsh : Windows 32 bit MSYS and ZSH version.
win64 : Windows 64 bit console version.
win64psh : Windows 64 bit PowerShell version.
win64zsh : Windows 64 bit MSYS and ZSH version.
os2 : OS/2 32 bit console version.
os2bash : OS/2 32 bit bash version.
Change to the appropriate directory `dos32', `dos32bsh', `win32', `win32psh',
`win32zsh', `win64', `win64psh', `win64zsh', `os2', `os2bash'.
Build wcd:
Type `make' to compile the package.
Install wcd:
Type `make install' to install the package.
`make install' will also compile the package if it wasn't done yet.
To start clean:
Type `make clean'
Native Language Support (NLS)
=============================
NLS is by default disabled. To enable NLS set the ENABLE_NLS variable to 1:
make ENABLE_NLS=1
Curses interface
================
The default interface is curses.
To disable CURSES and compile with stdio interface, reset the CURSES variable:
make CURSES=
PDCurses
--------
The DOS and Windows versions of Wcd use by default PDCurses.
To build wcd with PDCurses interface you need to have the PDCurses
library installed. Get PDCurses at https://sourceforge.net/projects/pdcurses/
Compile it and copy the library file into the \lib directory of your
compiler and the curses.h file in the \include directory.
Build PDCurses for Windows with wide-character (Unicode) support (WIDE=Y),
and install it as libpdcursesw.a. Also the non-Unicode version of wcd requires
PDCurses with wide-character support.
Support for resizing of ConEmu or Windows 10 console requires PDCurses version
3.7 or higher.
The DJGPP and MinGW project also provide ready-to-use binary PDCurses packages.
The DOS versions use the library with narrow character support (CURSES=pdcurses).
The Windows versions (Wcd with and without Unicode support) use the library with
wide (Unicode) character support (CURSES=pdcursesw).
Ncurses
-------
The OS/2 EMX (gcc) versions of Wcd use by default ncurses (CURSES=ncurses).
You can also build the Windows version of wcd with Ncurses. Mingw.org and MSYS2
provide ncurses(w) libraries.
See also whatsnew.txt for issues with Ncurses that have been solved.
To compile for ncurses add CURSES=ncursesw (wide Unicode characters support)
to the make command line for Windows.
* By default the Ncurses interface does not work in Console (also known as
Console2) and ConsoleZ
. Set environment variable
NCURSES_CONSOLE2 to 1 to make it work.
* The ncurses interface vibrates while moving around in the tree.
It is very visible in a standard Windows Command Prompt. In ConEmu
there is less vibration.
The vibration can be solved by using werase() instead of wclear(), but when werase()
is used, the screen gets filled with garbage when an East-Asian CJK legacy font
is used.
* The ncurses interface has better support for Unicode than PDCurses, because Ncurses
supports combining characters, while PDCurses doesn't.
Both Ncurses and PDCurses have misalignment at the highlighted directory in the
graphical tree with true type CJK font. E.g. the Chinese Simsun font.
PDCurses is still the default on Windows, because it gives a more stable screen.
Conio interface (DOS only)
==========================
To enable the conio interface instead of curses add CONIO=1:
make CONIO=1
Graphical tree
==============
By default the graphical tree is drawn with line drawing
characters. If these are not available on your system you
can set ASCII_TREE=1 so that ASCII characters are used instead.
make ASCII_TREE=1
Unicode support
===============
Unicode support is by default enabled on Windows and disabled on DOS
and OS/2. To disable add UCS= to the make command:
make UCS=
Unicode support requires a (pd/n)curses installation with wide character support.
Not supported for DOS versions of wcd.
Unicode works only in Windows PowerShell, and Command Prompt
on Windows 7 or higher. On older versions of Windows you need
Take Command or TCC/LE made by JP Software be able to change to
Unicode paths.
Enable Unicode normalization with UNINORM=1. This implies UCS=1.
make UNINORM=1
Unicode normalization requires libunistring, see
https://www.gnu.org/s/libunistring/
https://en.wikipedia.org/wiki/Unicode_normalization
libunistring packages are provided by Mingw.org and MSYS2.
Installation Names
==================
By default `make install' will install the program in /usr/bin, the
language files in /usr/share/locale and the man file in
/usr/share/man. You can specify an installation prefix other than
`/usr' by giving `make' the option `prefix=PATH'.
Example:
make clean
make prefix=c:/Users/waterlan
make install prefix=c:/Users/waterlan
dos32 : The default PREFIX is c:/dos32
dos32bsh : The default PREFIX is c:/dos32
win32 : The default PREFIX is c:/usr/local
win32psh : The default PREFIX is c:/usr/local
win32zsh : The default PREFIX is c:/usr/local
win64 : The default PREFIX is c:/usr/local64
win64psh : The default PREFIX is c:/usr/local64
win64zsh : The default PREFIX is c:/usr/local64
os2 : The default PREFIX is c:/usr
os2bash : The default PREFIX is c:/usr
distribution package
====================
After installation a ready-to-run binary distribution package can be created.
Type `make dist' to create the package.
wcd-6.0.5/doc/INSTALL.txt 0000644 0001755 0001001 00000000646 14421240062 014163 0 ustar waterlan Geen For building and installation see the following files:
GCC_DOS.txt : How to build wcd for DOS, Windows, and OS/2 with GCC.
WATCOMC.txt : How to build wcd for DOS, Windows, and OS/2 with Watcom C.
VISUALC.txt : How to build wcd for Windows with Microsoft Visual C++.
INST_DOS.txt : How to install wcd on DOS, Windows, and OS/2.
UNIX.txt : How to build and install wcd on Unix/Linux/Cygwin.
wcd-6.0.5/doc/INST_DOS.txt 0000644 0001755 0001001 00000016501 14421240062 014334 0 ustar waterlan Geen Install wcd on DOS, Windows, and OS/2.
For installation on Unix/Linux/Cygwin see UNIX.txt.
Contents
========
Basic installation
1 Installation on DOS and Windows 9x/ME
- DOS 16 bit
- DOS 32 bit
- DOS Bourne Again Shell (bash)
2 Installation on Windows (XP and later)
- Windows Command Prompt (cmd.exe)
- Windows VISTA/7
- Windows PowerShell
- WinZsh (zsh) and MSYS (bash)
- Native MSYS (bash)
- UNC support
3 Installation on OS/2
Basic installation
==================
Unpack the zip file in a directory of your choice which we will call PREFIX.
You will get the following directories:
bin/ Program and run-time libraries.
share/ Documentation and language files.
Add directory 'bin' to your PATH environment variable:
set PATH=%PATH%;PREFIX\bin
Replace PREFIX with the directory path where you unpacked the zip file.
======================================================================
= 1 Installation on DOS and Windows 9x/ME =
======================================================================
- DOS 16 bit version:
Make sure that wcd.exe is in your path.
......................................................................
- DOS 32 bit version:
Make sure that wcd.exe and cwsdpmi.exe are in your path.
......................................................................
- DOS Bourne Again Shell (bash):
Add the following function to your ~/_bashrc
file. Notice that under Windows 95/NT the ~/.bashrc
file overrides the ~/_bashrc file. In that case place
the function in ~/.bashrc
function wcd
{
PREFIX/bin/wcdbash.exe $*
. ${WCDHOME:-${HOME:-"c:"}}/wcd.go
}
Replace PREFIX with the prefix used during package installation.
Start a new bash
...
If HOME is set, DJGPP bash will read '_bashrc' from %HOME%.
Your wcd function could now look like:
function wcd
{
PREFIX/bin/wcd.exe $*
. ${WCDHOME:-${HOME}}/wcd.go
}
If the environment variable WCDHOME is set wcd will use
WCDHOME instead of HOME.
======================================================================
= 2 Installation on Windows (XP and later) =
======================================================================
- Windows Command Prompt (cmd.exe)
Add the 'bin' folder to PATH.
In Windows Command Prompt a Windows program cannot change the current work
directory, but a .bat file can.
The batch scrip "wcd.bat" runs the wcd program which generates a new batch
script "wcdgo.bat". Then wcd.bat runs wcdgo.bat which actually changes the
directory.
- Console2
If you use the Console2 Windows console (https://sourceforge.net/projects/console/)
and wcd has an "ncurses" interface, you need to set the NCURSES_CONSOLE2 environment
variable to 1.
set NCURSES_CONSOLE2=1
......................................................................
- Windows VISTA/7
In a Windows VISTA/7 Command Prompt you may have limited access to directories.
To get access to more directories you need adminstrator rights. You can get
a Command Prompt with administrator rights if you right click on the Command
Prompt icon and select `Run as administrator'.
......................................................................
- Windows PowerShell
See https://en.wikipedia.org/wiki/Windows_PowerShell
It is required that environment variable HOME or WCDHOME is set. A function
in your PowerShell user profile must be defined. The location of this profile
is stored in the $profile variable.
function wcd
{
PREFIX\bin\wcdwin32psh.exe $args
& $env:HOME\wcdgo.ps1
}
Replace PREFIX with the prefix used during package installation.
Start a new PowerShell
......................................................................
- WinZsh (zsh) and MSYS (bash)
A native Windows port of Z shell has been made by Amol Deshpande.
See https://waterlan.home.xs4all.nl/#ZSH
An updated version is available at:
http://zsh-nt.sourceforge.net/
MSYS, a contraction of "Minimal SYStem", is a Bourne Shell command line
interpreter system. Offered as an alternative to Microsoft's cmd.exe, this
provides a general purpose command line environment, which is particularly
suited to use with MinGW, for porting of many Open Source applications to the
MS-Windows platform. See also https://osdn.net/projects/mingw/ and
https://mingw.osdn.io/
It is required that environment variable HOME or WCDHOME is set. A function
must be defined like this:
function wcd
{
PREFIX/bin/wcdwin32zsh.exe $*
. ${WCDHOME:-${HOME}}/wcd.go
}
MSYS bash: put this function e.g. in $HOME/.bashrc
Z Shell : put this function e.g. in $HOME/.zshenv
Replace PREFIX with the prefix used during package installation.
You have to start MSYS like this: msys.bat --norxvt , because the default rxvt
terminal doesn't accept standard input from native Windows programs. See also
https://sourceforge.net/p/mingw/mailman/mingw-users/thread/20080911113208.c7imlwsuksbcws8g%40mail.progw.org/#msg20318652
You need a recent version of msys.bat that supports option --norxvt.
......................................................................
- Native MSYS (bash)
The native MSYS version of wcd is linked against the MSYS runtime DLL.
This version uses MSYS style directory paths: E.g. in MSYS the path
"C:\Program Files" maps to "/c/Program Files"
Define a function like this:
function wcd
{
PREFIX/bin/wcdmsys.exe $*
. ${WCDHOME:-${HOME}}/bin/wcd.go
}
The native MSYS version behaves exactly as the Unix version of wcd:
o) regards case by default.
- Use option -i to ignore case.
o) does not use drive letters.
o) Uses the same filenames for treedata files etc.
......................................................................
- UNC support
UNC stands for Universal Naming Convention.
It is a Windows 9x/NT way of accessing network drives without
using a drive letter.
It's from Windows SMB LAN manager networking.
A UNC path looks like: \\servername\sharename
In Windows networking, you can map a drive letter to a UNC:
net use G: \\gui_fileserv\apps
The Windows Command Prompt version of wcd supports UNC paths since version 3.1.0.
To change to the UNC path wcd makes use of the 'pushd' command in the
wcdgo.bat script.
Quote from John Savill's Windows NT/2000 FAQ (http://www.windows2000faq.com):
"The 'pushd' command automatically maps a drive and navigates to it. If you
run the 'net use' command after you run pushd, you'll see a new drive mapping.
After you're done working in the UNC location, use the 'popd' command to
navigate back to your original network location before you ran 'pushd'."
Options -S, -A and -E can also work on servernames. For instance:
wcd -S \\servername
will search for shared directories on the server and scan them all.
The Windows PowerShell and MSYS/ZSH version of wcd have full support of UNC paths.
One can change directly to UNC paths, without mapping to a drive letter.
======================================================================
= 3 Installation on OS/2 =
======================================================================
- OS/2 Command Prompt (cmd.exe)
Add the 'bin' folder to PATH.
In OS/2 Command Prompt an OS/2 program cannot change the current work
directory, but a .cmd file can.
The command scrip "wcd.cmd" runs the wcd program which generates a new command
script "wcdgo.cmd". Then wcd.cmd runs wcdgo.cmd which actually changes the
directory.
wcd-6.0.5/doc/problems.txt 0000644 0001755 0001001 00000004027 14421240062 014675 0 ustar waterlan Geen Known problems
==============
1 Unix shells (bash, ksh, sh, csh):
Strange behaviour when the argument has a wildcard and matches a
file or directory in the current directory.
This is the result of the filename expansion of the shell.
The work-around is to 'single quote' the argument.
2 Option -rmtree doesn't remove directories.
This only happens with Windows versions
when wcd has been build with Borland 5.x. The problem is not
there when wcd has been build with any other compiler.
3 Garbage printed on screen after exit.
Occurs in Windows NT/2000/XP console with large buffer
with wcd for win32 when PDC_RESTORE_SCREEN is set.
Windows only allows a relatively small buffer size to save.
4 `gmake install' may fail on Windows or OS/2.
When you build wcd on Windows without the MSYS environment you may run into
problems during `make install', because the GnuWin32 ports of `mkdir' and
`install' of the coreutils package have problems. See
https://sourceforge.net/tracker/?func=detail&aid=2115584&group_id=23617&atid=379173
Better use the MSYS environment.
This problem is also seen on OS/2. Try an older version of coreutils package.
5 A DOS 32 bit version built with OpenWatcom C stops scanning the disk when it
encounters on a Windows drive a path longer than 66 characters. The problem is that
after chdir() fails to change to a path longer than 66 characters, getcwd() returns
a wrong path, namely the path chdir() could not change to chopped at 66 characters. I
think this is a bug in OpenWatcom. getcwd() should return the path of the last
successful chdir(). This was seen on Windows Vista 32 bit.
......................................................................
If you think you found a bug do the following.
First check that you have the latest version of WCD. The bug
may already have been solved. If it has not been solved than
send me an e-mail . Describe the bug and
tell me what version of WCD you use and under what operating
system.
Also ideas to improve wcd are welcome.
wcd-6.0.5/doc/README.txt 0000644 0001755 0001001 00000040426 14421240062 014012 0 ustar waterlan Geen File list
README.txt : This file.
INSTALL.txt : Installation documentation.
../src/man/man1/wcd.txt : Manual, text format.
../src/man/man1/wcd.htm : Manual, HTML format.
whatsnew.txt : Change log.
faq.txt : Frequently Asked Questions.
copying.txt : distribution license.
problems.txt : Known problems.
todo.txt : Things to do.
Table of Contents
1.0 History
2.0 Copyright
2.1 C3PO data structures
2.2 DOSDIR
2.3 Recmatch
2.4 Ninux Czo Directory
2.5 Miscellaneous bits and pieces
3.0 Acknowledgements
3.1 Translators
3.2 Works of others used in the program
4.0 Contact and Download information
1.0 History
In 1995 I started working for Philips Research in Eindhoven. I
had to do all my work on HP Unix (HP-UX). I was missing an
application like Norton Change Directory (NCD). I didn't know
of any other NCD like program so in 1996 I decided to make it
myself. On the internet I found Jason Mathew's DOSDIR package
in the Simtel archives. DOSDIR was my starting point. Because
DOSDIR was portable I could make wcd at home with Borland-C
3.1 on my PC (intel 80486, 80 MHz) on DOS 6.2. I mailed the
source code to work and there I build a version for HP-UX. I
made wcd for myself, but was happy to share it with others.
Some colleagues started using wcd.
In 1997, I found the DJGPP compiler and used that as my main
development environment. Now I was able to create a 32 bit DOS
version, and it supported long directory names under Windows
95.
In Dec 1997 I put wcd on the internet. I was amazed that
already 7 people downloaded it in the first month. From then
on development was driven a lot by feedback I got via the
internet. In March 1998 the GNU distribution license was
attached to version 2.0.0.
Later I installed Linux (RedHat 5.0) on my PC at home and
that became my main development platform.
Because eventually most DOS users will migrate to Windows I
ported wcd to Windows NT. I started with Borland C 4.0, but
changed soon to the MinGW compiler. The first Win32 port was
ready in November 1999.
The DOS 32 bit version still stayed the most popular version for
a long time. In 2003 the Windows NT port became most popular.
In April 2000 (version 2.3.0) a curses based interface was added
to have a consistent interface on all platforms. And a year later
the 'graphical tree' curses interface was added (version 3.0.0).
I used wcd mainly in an ASCII (C) environment. Only since version 3.2.0
in Dec 2005 eight bit characters sets were properly supported.
After a development pause of two years, version 4.0.0 (Sep 2008) was
the first which supported internationalization by message translations
via gettext.
Since version 5.0.0 (Mar 2009) wcd supports Unicode, to enable
internationalization for all languages. In the beginning this
development was done on Linux, and later on Cygwin which supports
Unicode since version 1.7.
In version 6.0.0 (Feb 2017) the DOSDIR directory interface layer was
removed from Wcd. The amount of directories can be huge these days,
so scanning a disk can take a long time. Removal of DOSDIR resulted in
faster disk scanning on Windows and Unix.
2.0 Copyright
Copyright (C) 1996-2023 Erwin Waterlander
This program is free software; you can redistribute it and/or
modify it under the terms of the GNU General Public License
as published by the Free Software Foundation; either version 2
of the License, or (at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
Visit
2.1 C3PO data structures
Data structures with dynamic memory allocation were created
with Ondrej Popp's C3PO ( Compiler Compiler Compiler Popp
Ondrej ).
https://sourceforge.net/projects/c3po/
email:
2.2 DOSDIR
Wcd used DOSDIR for scanning the disk until Wcd version 5.3.4. Only
the parts of DOSDIR that are distributed under GNU General Public
License were used in WCD.
DOSDIR: A Portable DOS/UNIX/VMS Directory Interface
DOSDIR minimizes the OS-specific directory access code for
applications allowing programmers to concentrate on the
application itself and not on the low-level directory and file
structure. DOSDIR applications will run on their native
operating systems with the appropriate file syntax and
handling, which is expected for that platform.
Copyright (C) 1994 Jason Mathews.
Jason Mathews
The MITRE Corporation
202 Burlington Road
Bedford, MA 01730-1420
Email: mathews@mitre.org, mathews@computer.org
DOSDIR can be download from my own homepage
https://waterlan.home.xs4all.nl/
2.3 Recmatch
I used the regular matching algorithm, recmatch(), of
Info-Zip's unzip program.
recmatch() was written by Mark Adler.
Copyright (C) 1990-1992 Mark Adler, Richard B. Wales, Jean-loup Gailly,
Kai Uwe Rommel and Igor Mandrichenko.
Mark Adler (original Zip author; UnZip decompression; writer
of recmatch() ) and Greg Roelofs (former UnZip
maintainer/co-author) have given permission to me to
distribute recmatch() (match.c,match.h) under the GNU General
Public License conditions as long as there's some sort of
comment included that indicates it came from Info-ZIP's
UnZip/Zip and was written by Mark Adler.
Info-ZIP's home WWW site is at:
https://sourceforge.net/projects/infozip/
2.4 Ninux Czo Directory
Ideas and source code of NCD (Ninux Czo Directory) have been
used in the WCD graphical interface.
Ninux Change Directory
Copyright (C) 1995 Borja Etxebarria
or
https://www.ibiblio.org/pub/Linux/utils/shell/ncd-0.9.8.tgz
Additions on NCD were made by Olivier Sirol (Czo)
Ninux Czo Directory
Copyright (C) 1995 Borja Etxebarria
Copyright (C) 1996 Olivier Sirol
Olivier Sirol
https://www.ibiblio.org/pub/Linux/utils/file/managers/ncd1_205.tgz
2.5 Miscellaneous bits and pieces
wcd_fixpath() is a modified version of _fixpath() Copyright
(C) 1995-1996 DJ Delorie, see COPYING.DJ for details
_fixpath() is a library function of libc for DJGPP. See also
https://www.delorie.com/djgpp/
Source code to scan Windows LAN was originally written and
placed in the Public Domain by Felix Kasza. Copied from Felix
Kasza's Win32 Samples page at MVPS.ORG.
https://www.mvps.org/
Source code for colours in curses interface was copied from
the PDCurses demo program 'tui'. The 'tui' demo program was
originally written by P.J. Kunst and placed in the Public
Domain.
Markus Kuhn's free wcwidth() and wcwidth_cjk() implementation is used.
See also https://www.cl.cam.ac.uk/~mgk25/unicode.html
Rugxulo is the original autor of query_con_codepage(),
which is in the public domain.
3.0 Acknowledgements
Thanks to the following people for giving ideas and/or
reporting/solving bugs:
Leo Sevat (First user)
Paul Lippens (? I forgot. ew)
Ondrej Popp (relative treefiles)
Ad Vaassen (subdirectories)
Michael Magan (interface)
Christopher Drexler (bugfix on SGI IRIX64)
Richard Tietjen (HOME on DOS/Windows)
Howard Schwartz (interface: use letters, WCDHOME)
Ajit J. Thakkar (zsh on windows)
Christian Mondrup (man page)
Gary R. Johnson (graphical tree mode)
Peter Gutmann (just go mode)
Etienne Joarlette (SunOS makefile)
Edwin Rijpkema (zoom in graphical tree mode)
Juhapekka Tolvanen (man page)
Andre vd Avoird (Keep paths, -k)
Kevin M. Rosenberg (patch for compile problems w.r.t. gcc and
, man page)
Zoltan Varady (fix compile problems on Mac OS X/Darwin)
Eric Auer (default makefile for DOS 16 bit (compact
memory model) works again)
Val Vakar (WCDFILTER)
Jari Aalto (man page improvements)
Jari Aalto (option -l takes alias directly)
Jari Aalto (in match list key z does page down.)
Jari Aalto (Swap options -v and -V.)
Jari Aalto (Unix: Replace volume manager path of HOME dir by "$HOME")
Jari Aalto (Makefile improvements)
Jari Aalto (Updated installation documentation)
Jari Aalto (Code cleanup)
Jari Aalto (Generate manual from Perl POD file)
Jari Aalto (Reformat README file.)
Jari Aalto (Fix compilation on Solaris)
Jari Aalto (Version date in ISO 8601 format)
Gabor Grothendieck (UNC paths support)
Gabor Grothendieck (automatically set PDC_RESTORE_SCREEN)
Gabor Grothendieck (original console colours on windows)
Mark Hessling (original console colours on windows)
Mark Hessling (fix: scroll away problem on Windows NT/2000/XP)
Ken Zinnato (alternative tree navigation)
Scott D Friedemann (fix: curses interface writes uninitialised data to screen)
Richard Boss (dump matches to stdout)
Richard Boss (8-bit characters)
Richard Boss (print match list at bottom of console)
Roland Messier Shell script to compile wcd for QNX 4.25 systems.
Elbert Pol Port to OS/2 Warp
Billy Chen Optional colours in graphical mode (option -K)
Billy Chen Less screen movement when navigating in graphical mode.
anonymous Alternate stack file support.
Laurence Errington Simpler installation instructions for Windows Command Prompt
anonymous Support user names with spaces on Windows.
Justin Lecher Makefile improvements.
Eli Zaretskii Don't follow symbolic links on Windows.
Thomas Dickey Use of ncurses on Windows.
Misty De Meo Fix: Compilation on OS X/FreeBSD.
David Binderman Fixed a dangerous string usage.
Benno Schulenberg Cleanup user interface messages.
Andreas Schwab Fix: etc/profile.d/wcd.sh: wcd function was overwriting shell's $go variable.
Erik Rijshouwer Idea for option -ls, list the aliases.
Martin Report bug that wcd DRIVE:DIR was broken in 6.0.0.
3.1 Translators
Thanks to the following translators:
Since verion 5.2.5 wcd is part of the Translation Project (TP).
All translations of the messages go via the Translation Project.
see https://translationproject.org/domain/wcd.html
Brazilian Portuguese Rafael Fontenelle Version 6.0.1
Chinese (simplified) Mingcong Bai (Jeff) and Version 5.3.1
Mingye Wang (Arthur)
Danish Joe Hansen Version 6.0.0
Dutch Erwin Waterlander Version 4.0.0 - 5.2.4
Dutch Benno Schulenberg Version 5.2.5 - 5.3.3
Esperanto Benno Schulenberg Version 5.2.5 - 5.3.3
Esperanto Felipe Castro Version 6.0.4
Finnish Jari Aalto Version 5.1.0 - 5.2.4
Finnish Jorma Karvonen Version 5.2.5 - 5.3.3
French Grégoire Scano Version 6.0.3 - 6.0.4
Friulian Fabio Tomat Version 6.0.2
German Philipp Thomas Version 5.1.3 - 5.2.3,
5.3.3 - 5.3.4
German Lars Wendler Version 5.2.4
German Mario Blättermann Version 5.2.5 - 5.2.6
Romanian Remus-Gabriel Chelu Version 6.0.5
Serbian Мирослав Николић Version 5.3.4
Spanish Julio A. Freyre-Gonzalez Version 5.0.4 - 5.2.4
Spanish Francisco Javier Serrador Version 6.0.2
Swedish Josef Andersson Version 6.0.5
Ukrainian Yuri Chornoivan Version 5.2.5 - 6.0.0
Vietnamese Trần Ngọc Quân Version 5.2.5 - 6.0.0
Translations of the manual:
See https://translationproject.org/domain/wcd-man.html
Brazilian Portuguese Rafael Fontenelle Version 6.0.1 - 6.0.3
Dutch Erwin Waterlander Version 5.2.5 - 6.0.3
German Mario Blättermann Version 5.2.5 - 6.0.3
French Grégoire Scano Version 6.0.3 - 6.0.4
Romanian Remus-Gabriel Chelu Version 6.0.5
Serbian Мирослав Николић Version 6.0.4
Swedish Josef Andersson Version 6.0.5
Ukrainian Yuri Chornoivan Version 5.2.5 - 6.0.3
3.2 Works of others used in the program
Thanks to the following people for using their Free software:
Ondrej Popp, C3PO
Jason Mathews, dosdir (until version 5.3.4)
Mark Adler, recmatch()
DJ Delorie _fixpath()
Borja Etxebarria & Olivier Sirol Ninux Czo Directory
Felix Kasza WIN32 API sample WNetOpenEnum()/WNetEnumResource()
MVPS.ORG https://www.mvps.org/
Markus Kuhn wcwidth() and wcwidth_cjk()
https://www.cl.cam.ac.uk/~mgk25/unicode.html
Rugxulo query_con_codepage()
https://sites.google.com/site/rugxulo/
4.0 Contact and Download information
I can be contacted via E-mail: waterlan@xs4all.nl
--
Latest development source code is maintained in
SourceForge Git repository:
git clone git://git.code.sf.net/p/wcd/wcd
The latest WCD packages, executables and sources, can be downloaded from
this internet-page:
https://waterlan.home.xs4all.nl/
--
SourceForge project page:
https://sourceforge.net/projects/wcd/
--
For each release of wcd there are two source packages
(the question marks indicate the version number):
wcd-?.?.?.tar.gz : source package
Source code in unix text.
wcd???.zip : source package
Source code in DOS text.
--
Wcd is also distributed by:
Debian Linux
https://packages.debian.org/search?keywords=wcd
Ubuntu Linux
https://packages.ubuntu.com/
Fedora Linux
openSuse Linux
Gentoo Linux
Simtel.Net:
Search: wcd
SYSTEM UTILITIES > File management and conversion utils > wcd
Ibiblio (was Metalab (was SunSite)):
https://www.ibiblio.org/pub/Linux/utils/shell/
-- Erwin Waterlander
wcd-6.0.5/doc/todo.txt 0000644 0001755 0001001 00000003725 14421240062 014023 0 ustar waterlan Geen TO DO
=====
* Translate the program messages.
Translation of the messages for wcd is going via the Translation Project (TP).
See https://translationproject.org/domain/wcd.html
* Translate the manual.
Translation of the manual for wcd is going via the Translation Project (TP).
See https://translationproject.org/domain/wcd-man.html
* Improve interface for East Asian double width CJK fonts (Chinese, Japanese, Korean)
in a Windows console. This depends on PDCurses/ncurses development.
* Support scripts that write from right to left like Arabic, Persian or Hebrew.
I always kept this in mind while developing wcd:
* keep it simple.
Usable without knowing all the options.
* wcd is a directory changer.
The main goal is to change directory with a minimal amount of keystrokes.
Don't change wcd into a directory/file manager.
* low requirements.
A minimal wcd version can be build with just an ansi-C compiler.
The graphical tree can be drawn with ascii characters and colours
are not required. This way wcd runs also on very old systems.
* portable
So I can use wcd everywhere.
* backwards compatible
Don't bother users.
In a multi-user environment, old and new versions can be used together.
NOT TO DO
=========
Things I deliberately not implemented. (This may change in the future.)
* Extended regular expressions support.
Full regular expressions are too powerful for file and directory name
matching. All normal shell commands like `ls' and `cp' use glob style
matching and that is what users are used to. Full regular expressions
are not really needed.
* Approximate (fuzzy) matching.
I have made in the past a wcd version with full regular expressions and fuzzy
matching support. My experience was that when the number of directories is
very large the fuzzy matching often causes unexpected behaviour. That is why
I removed it again. I used the TRE regexp matching library, made by Ville
Laurikari. See https://www.laurikari.net/tre/
wcd-6.0.5/doc/UNIX.txt 0000644 0001755 0001001 00000017501 14421240062 013636 0 ustar waterlan Geen PREREQUISITES
Required
* gcc : GNU C compiler
* make : GNU make
* sh : POSIX type shell
* coreutils : GNU core utilities package (chmod, install, mkdir, mv, rm, uname)
* sed : Stream editor
Optional (depending on build targets):
* perl : Practical Extraction and Report Language (perlpod)
perl >= 5.10.1 is required for rebuilding the
manual pages with pod2man.
perl >= 5.18 is required for rebuilding the
international manual pages correctly in HTML with pod2html.
* gettext : Framework to help GNU packages produce multi-lingual messages.
* po4a : PO for anything.
* ncurses : CRT screen handling and optimization package.
* libunistring : Library with functions for manipulating Unicode strings.
* groff : GNU troff text formatting system.
* ghostscript : An interpreter for the PostScript language and for PDF (ps2pdf)
Check if you have GNU make(1) and GNU gcc(1) installed on your
system. On some systems GNU make may be installed as 'gmake' command.
make --version
gcc --version
BASIC INSTALLATION
Change to directory src/
To compile using GNU make:
make all
Options that can be enabled during compiling
UCS= Disable Unicode (UTF8) support
The default value is 1.
UNINORM=1 Enable Unicode normalization.
The default value is empty.
On Cygwin the default value is 1.
Requires libunistring, see
https://www.gnu.org/s/libunistring/
https://en.wikipedia.org/wiki/Unicode_normalization
ENABLE_NLS=1
Enable native language support.
That is, use locale files.
The default value is 1.
STATIC=1 Enable static linking. Make a
standalone wcd binary.
The default value is empty.
DEBUG=1 A debug enabled build can be made by
adding DEBUG=1 to the make command.
DEBUGMSG=1 DEBUGMSG=1 makes wcd print verbose messages
about accessing the file system.
LFS=
Large File Support (LFS) is by default enabled. This
enables the use of 64 bit file system interface on 32
bit systems. This makes it possible to open files
larger than 2GB on 32 bit systems, provided the OS
has LFS support builtin. To disable LFS make the LFS
variable empty. Example:
Disable LFS:
make clean install LFS=
CURSES=
Select curses library.
The default value is 'ncurses'.
Only an expert should change this.
NCURSES_DEBUG=1
Link with ncurses debug enabled library by
adding NCURSES_DEBUG=1 to the make command.
ASCII_TREE=1
Draw graphical tree with
ASCII characters.
The default value is empty.
EXT=.exe Set executable extension
The default value is '.exe' to
make a distinction between the binary
and the function/alias.
HMTLEXT=html
Set HTML manual file extension.
The default value is 'htm' to
support all platforms.
An example to disable unicode support.
make clean all UCS=
To disable Native Language Support,
reset the ENABLE_NLS variable:
make ENABLE_NLS=
To disable curses and compile with plain stdin/stdout
interface type, reset the CURSES variable:
make CURSES=
To install:
make all strip install
Now go to section SHELL INTEGRATION below.
INSTALLATION NAMES
By default the 'install' target will install the program in
/usr/bin, the language files in /usr/share/locale
and the man page in /usr/share/man. You can specify an
installation prefix other than /usr by modifying the
'prefix' variable. An Example:
make prefix=$HOME clean all
make prefix=$HOME strip install
SHELL INTEGRATION
See manual page section "INSTALLATION" how to manually configure the
shell to use the program. It is required to configure your shell,
otherwise wcd cannot work.
Alternatively you can use the shell scripts that are provided to
install the wcd function (sh) or alias (csh) under /etc/profile.d/.
To install these scripts type:
make install-profile
If you wish that Wcd stores its files under $HOME/.wcd instead of
$HOME, add DOTWCD=1. This will add a definition of WCDHOME=$HOME/.wcd
(see manual).
make install-profile DOTWCD=1
Under Cygwin these shell scripts are always installed.
INTERNATIONAL MAN PAGES
All man pages are encoded in UTF-8, because even Western-European man pages
may contain Unicode characters not supported by the Latin-1 (ISO-8859-1)
character set.
Originally the Unix man system supported only man pages in Latin1 format.
Although the world is moving to Unicode format (UTF-8) there is still a lot
of Latin1 legacy around.
The English man page is a pure ASCII file and is readable on all platforms.
Non-English man pages are encoded in UTF-8. These do not show properly on
old systems. Man pages in UTF-8 format are shown properly on Linux. Not
all roff implementations support UTF-8.
In order to show UTF-8 man pages properly on Cygwin you need to do the
following when you use classic man:
In /etc/man.conf, change the NROFF definition to use 'preconv'.
NROFF /usr/bin/preconv | /usr/bin/nroff -c -mandoc 2>/dev/null
To view the man page set the correct locale. E.g. for Ukrainian:
export LANG=uk_UA.UTF-8
man dos2unix
When you use man-db all pages are shown correctly automatically.
DOCUMENTATION
Manual pages are generated from Perl POD files.
To rebuild the man pages from POD type:
make maintainer-clean
make man
Manuals in PDF format are by default not created.
To create manuals in PDF format type:
make pdf
PDF generation requires GhostScript to be installed.
BINARY DISTRIBUTION PACKAGE CREATION
After installation, a package can be created that contains
a ready-to-run wcd binary.
Type `make dist' to create a .tar.gz file.
Type `make dist-zip' to create a .zip file.
PORTABILITY
A compile error occurs when you use gcc < 3.0 and
is included somewhere (e.g. in curses.h).
Thanks to Kevin M. Rosenberg, apply the following patch:
patch -p1 < patch/wcd_bool.diff
--
Conflicting curses.h ncurses.h
On some systems curses.h is conflicting with ncurses.h. To
compile wcd you can solve this by creating a symbolic link
curses.h in the wcd source directory pointing to the ncurses.h
file and adding -I. to CFLAGS in old/Makefile.ncurses.gcc.
This problem was seen on a BSDI BSD/OS 4.0 system.
/usr/local/include/ncurses.h
End of file
wcd-6.0.5/doc/VISUALC.txt 0000644 0001755 0001001 00000010553 14421240062 014161 0 ustar waterlan Geen This file explains how to compile wcd for Windows
with the Microsoft Visual C++ compiler.
For Unix/Linux/Cygwin compile instructions see file UNIX.txt
For DJGPP/MinGW/EMX compile instructions see file GCC_DOS.txt
For Watcom C compile instructions see file WATCOMC.txt
For how to install the program on DOS, Windows, OS/2 see file INST_DOS.txt.
Prerequisites
=============
* Visual C++ compiler.
* pdcurses : CRT screen handling and optimization package
Optional
========
For rebuilding the documenation.
* perl : Practical Extraction and Report Language (perlpod)
Needed for building packages:
* zip : compressor-archiver https://sourceforge.net/projects/infozip/
Visual C++
==========
You can get a free community version via this web page:
https://www.visualstudio.com/vs/community/
PDCurses
========
To build wcd with PDCurses interface you need to have the PDCurses
library installed. Get PDCurses at https://sourceforge.net/projects/pdcurses/
Compile it and copy the library file into the proper VC\lib directory
and the curses.h file in the VC\include directory.
Build PDCurses width wide character support (WIDE=Y), also when you build a wcd
version without Unicode support. A non-Unicode Windows version of wcd will
still use Unicode for the interface. Name the library "pdcursesw.lib".
Support for resizing of ConEmu or Windows 10 console requires PDCurses version
3.7 or higher.
Perl
====
Perl is required for the generation of the manual in text and html format. The
wcd source package includes all documentation files. When you want to recreate
the manuals, you need a 'perl' installation.
There exist ready-to-run perl packages.
Windows:
Strawberry Perl: https://strawberryperl.com/
Active Perl : https://www.activestate.com/activeperl
Problems on Windows VISTA and higher
====================================
To be able to run `nmake install' you may need adminstrator rights. You can get
a Command Prompt with administrator rights if you right click on the Command
Prompt icon and select `run as administrator'.
Basic Installation
==================
win32 : Windows 32 bit console version.
win32psh : Windows 32 bit PowerShell version.
win32zsh : Windows 32 bit for WinZsh or MSYS.
win64 : Windows 64 bit console version.
win64psh : Windows 64 bit PowerShell version.
win64zsh : Windows 64 bit for WinZsh or MSYS.
Change to the appropriate directory `win32', `win32psh', `win32zsh',
`win64', `win64psh', or `win64zsh' directory. Then change to the `vc'
subdirectory.
Build wcd:
Type `nmake' to compile the package.
Install wcd:
Type `nmake install' to install the package.
`nmake install' will also compile the package if it wasn't done yet.
To start clean:
Type `nmake clean'
Curses interface
================
The default interface is pdcurses.
Wcd uses PDCurses with wide character support (CURSES=pdcursesw)
To disable CURSES and compile with stdio interface, reset the CURSES variable:
nmake CURSES=
Graphical tree
==============
By default the graphical tree is drawn with line drawing
characters. If these are not available on your system you
can set ASCII_TREE=1 so that ASCII characters are used instead.
nmake ASCII_TREE=1
Unicode support
===============
Unicode support is by default enabled.
To disable add UCS= to the make command:
nmake UCS=
Installation Names
==================
By default `nmake install' will install the program in /usr/bin, the
language files in /usr/share/locale and the man file in
/usr/share/man. You can specify an installation prefix other than
`/usr' by giving `nmake' the option `prefix=PATH'.
Example:
nmake mostlyclean
nmake
nmake install prefix=c:\Users\waterlan
The default prefixes are the same for as for GCC.
win32 : The default PREFIX is c:\usr\local
win32zsh : The default PREFIX is c:\usr\local
win32psh : The default PREFIX is c:\usr\local
win64 : The default PREFIX is c:\usr\local64
win64psh : The default PREFIX is c:\usr\local64
win64zsh : The default PREFIX is c:\usr\local64
manual pages in html and text format
====================================
To create the manuals in txt and html format type:
nmake doc
To install the manuals in txt and html format type:
nmake install-doc
distribution package
====================
After installation a ready-to-run binary distribution package can be created.
Type `nmake dist' to create the package.
wcd-6.0.5/doc/WATCOMC.txt 0000644 0001755 0001001 00000012007 14421240062 014144 0 ustar waterlan Geen This file explains how to compile wcd for DOS, Windows, and OS/2
with the Open Watcom C compiler.
For Unix/Linux/Cygwin compile instructions see file UNIX.txt
For DJGPP/MinGW/EMX compile instructions see file GCC_DOS.txt
For MS Visual C++ compile instructions see file VISUALC.txt
For how to install the program on DOS, Windows, OS/2 see file INST_DOS.txt.
Prerequisites
=============
* Watcom C compiler.
* pdcurses : CRT screen handling and optimization package
Optional
========
For rebuilding the documenation.
* perl : Practical Extraction and Report Language (perlpod)
Needed for building packages:
* zip : compressor-archiver https://sourceforge.net/projects/infozip/
Watcom C
========
There is a free version of the Watcom C compiler available
at https://sourceforge.net/projects/openwatcom/
https://github.com/open-watcom/open-watcom-1.9
https://github.com/open-watcom/open-watcom-v2
It includes cross compilation. From a Windows machine you
can also create DOS and OS/2 programs.
Open Watcom V2 : https://github.com/open-watcom/open-watcom-v2
https://sourceforge.net/projects/openwatcom/
Note there is an issue with the DOS 32 bit version built with Watcom C. See problems.txt.
PDCurses
========
To build wcd with PDCurses interface you need to have the PDCurses
library installed. Get PDCurses at https://sourceforge.net/projects/pdcurses/
Compile it and copy the library file into the proper \lib directory
and the curses.h file in the \watcom\h directory.
The Windows versions of wcd require PDCurses with wide character support,
also if you build a non-Unicode version of wcd for Windows.
Perl
====
Perl is required for the generation of the manual in text and html format. The
wcd source package includes all documentation files. When you want to recreate
the manuals, you need a 'perl' installation.
There exist ready-to-run perl packages.
DOS:
DJGPP project: https://www.delorie.com/djgpp/
ftp://ftp.delorie.com/pub/djgpp/current/v2gnu/perl588b.zip
Windows:
Strawberry Perl: https://strawberryperl.com/
Active Perl : https://www.activestate.com/activeperl
Problems on Windows VISTA and higher
====================================
To be able to run `wmake install' you may need adminstrator rights. You can get
a Command Prompt with administrator rights if you right click on the Command
Prompt icon and select `run as administrator'.
Basic Installation
==================
dos16 : DOS 16 bit
dos32 : DOS 32 bit
dos32bsh : DOS 32 bit for BASH
win32 : Windows 32 bit console version.
win32zsh : Windows 32 bit for WinZsh or MSYS.
win32psh : Windows 32 bit PowerShell version.
os2 : OS/2 32 bit console version.
Change to the appropriate directory `dos16', `dos32', `dos32bsh', `win32',
`win32zsh', `win32psh', 'os2'. Then change to the `watcom' subdirectory when
it is present.
Build wcd:
Type `wmake' to compile the package.
Install wcd:
Type `wmake install' to install the package.
`wmake install' will also compile the package if it wasn't done yet.
To start clean:
Type `wmake clean'
Curses interface
================
The default interface is pdcurses.
win32* uses PDCurses with wide character support (CURSES=pdcursesw)
To disable CURSES and compile with stdio interface, reset the CURSES variable:
wmake CURSES=
Graphical tree
==============
By default the graphical tree is drawn with line drawing
characters. If these are not available on your system you
can set ASCII_TREE=1 so that ASCII characters are used instead.
wmake ASCII_TREE=1
Unicode support
===============
Unicode support is by default enabled on Windows and disabled on DOS
and OS/2. To disable add UCS= to the make command:
wmake UCS=
Unicode support requires a (pd/n)curses installation with wide character support.
Unicode is not supported for DOS and OS/2 versions of wcd.
Unicode is only supported in Windows PowerShell, and Command Prompt
on Windows 7 or higher.
Installation Names
==================
By default `wmake install' will install the program in /usr/bin, the
language files in /usr/share/locale and the man file in
/usr/share/man. You can specify an installation prefix other than
`/usr' by giving `wmake' the option `prefix=PATH'.
Example:
wmake clean
wmake
wmake install prefix=c:\Users\waterlan
The default prefixes are the same for Watcom C as for GCC.
dos16 : The default PREFIX is c:\dos
dos32 : The default PREFIX is c:\dos32
dos32bsh : The default PREFIX is c:\dos32
win32 : The default PREFIX is c:\usr\local
win32zsh : The default PREFIX is c:\usr\local
win32psh : The default PREFIX is c:\usr\local
os2 : The default PREFIX is c:\usr
manual pages in html and text format
====================================
To create the manuals in txt and html format type:
wmake doc
To install the manuals in txt and html format type:
wmake install-doc
distribution package
====================
After installation a ready-to-run binary distribution package can be created.
Type `wmake dist' to create the package.
wcd-6.0.5/doc/whatsnew.txt 0000644 0001755 0001001 00000101411 14421240062 014705 0 ustar waterlan Geen 6.0.5 2023-04-23
- New Romanian translation of the UI and the manual.
Thanks to Remus-Gabriel Chelu.
- New Swedish translation of the UI and the manual.
Thanks to Josef Andersson.
- Updated Friulian translation of the UI. Thanks to Fabio Tomat.
6.0.4 2021-10-31
- New Serbian translation of the manual.
Thanks to Мирослав Николић.
- Updated French translations of messages and manual.
Thanks to Grégoire Scano.
- Updated Esperanto translation. Thanks to Felipe Castro.
- Updated information about building wcd with DJGPP on Windows 8.1
and higher.
- Windows version: Upgrade to PDCurses 3.9.
6.0.3 2019-08-14
- New French translations of the messages and the manual.
Thanks to Grégoire Scano.
- Support resizing in ConEmu and Windows 10 command console.
If it doesn't work in a Windows 10 console make sure the console is not
in legacy mode (see properties). The screen may not refresh when the
console Layout property "Wrap text output on resize" is disabled.
The screen can be refreshed manually by pressing the F5 key.
- Upgrade to PDCurses 3.8. Required for console resize support on Windows.
- Code cleanup.
6.0.2 2018-05-10
- New Friulian translation of the messages. Thanks to Fabio Tomat.
- Updated Spanish translation. Thanks to Francisco Javier Serrador.
- Makefile: Fix: Add RPM_LD_FLAGS instead of RPM_OPT_FLAGS to LDFLAGS.
- Code cleanup.
6.0.1 2017-08-28
- wcd.c: Fix. DOS, OS2, and Windows versions. When user gives drive
plus directory name (e.g. wcd d:games), wcd did not find the directory.
This was broken since wcd 5.3.3. Thanks to Martin for reporting this issue.
https://sourceforge.net/p/wcd/feature-requests/14/
- GCC_DOS.txt: Document problems and solutions for building wcd with DJGPP
on Windows Vista and higher.
- src/Makefile: Build all text and html manual files when ENABLE_NLS=1.
- Minor cleanup of the manual.
- New Brazilian Portuguese translation of the messages. Thanks to Rafael Fontenelle.
- New Brazilian Portuguese translation of the manual. Thanks to Rafael Fontenelle.
6.0.0 2017-02-21
- Faster disk scanning on Windows and Unix and on OS/2 with Watcom C
built version.
This was achieved by removing the DOSDIR directory interface
layer and replacing it with system specific functions.
Disk scanning speed depends on external factors, like disk
caching and other processes accessing the disk at the same time.
The speed increasement you experience may vary.
- Fixed -rmtree for unicode file names on Windows.
- Support EMX symbolic links on OS/2.
- Support bash on OS/2.
- New Danish translation of the messages. Thanks to Joe Hansen.
5.3.4 2017-01-03
- New Serbian translation. Thanks to Мирослав Николић.
- src/Makefile: Fixed for compilation on OS/2.
- Code cleanup.
5.3.3 2016-10-15
- Support Unicode aliases on Windows.
Wcd for Windows with Unicode support stores the aliases now in UTF-8
format (like the paths). Old aliases with non-ASCII characters are
not compatible anymore. You need to create new aliases.
- New option -ls: List the aliases. Thanks to Erik Rijshouwer.
- Code cleanup.
- Fixed makefiles for DJGPP, targets install and dist.
5.3.2 2016-02-18
- Fixed printing of East-Asian text on Windows with an East-Asian regional
setting.
- src/Makefile:
* Split DEBUG=1 into DEBUG=1 and DEBUGMSG=1. DEBUG=1 will add option -g
to CFLAGS for debugging with gdb. DEBUGMSG=1 makes wcd print extra
messages about accessing the file system.
* Use GNU standard variables INSTALL_PROGRAM and INSTALL_DATA for
installation.
* Update for msys1/2 to avoid need for msys specifc makefiles.
* Don't install international man pages when ENABLE_NLS is empty.
- msys/Makefile: Deleted.
- msys2/Makefile: Deleted.
- win64*/Makefile: Use normal 'gcc' instead of cross-compiler
(x86_64-w64-mingw32-gcc).
- man/*/man1/dos2unix.po: Moved all manual .po file to directory
po-man/. The .po files now have their original name.
- Makefile, man/man1/Makefile: Build international manuals from
the .po files in folder po-man/.
2015-12-21
- Moved wcd source repository from Subversion to Git. To clone type:
git clone git://git.code.sf.net/p/wcd/wcd
5.3.1 2015-12-02
- src/po/zh_CN.po: New simplified Chinese translation of the messages.
Thanks to Mingcong Bai (Jeff) and Mingye Wang (Arthur).
- src/Makefile, */vc/Makefile, */watcom/Makefile: Unicode support is by
default enabled for Windows and Unix.
- src/Makefile, src/chk_logc.sh: Automatically detect if we are in MSYS
1 or 2, and disable Unicode for MSYS 1.
5.3.0 2015-09-23
- Faster loading of the graphical tree, in about one third less time.
- Fix reading UTF-16 treedata files.
- Fix: Check for file I/O errors while reading files. These can happen
after a file was opened without problems.
5.2.7 2015-04-19
- c3po/structur.h: Fix compilation error: unknown type name wchar_t.
Happens on some systems when wcd is compiled with Unicode support.
- Makefile, man/man1/Makefile: add option --no-wrap to xgettext and
msgmerge. Translation Project standard is not to wrap.
5.2.6 2015-01-18
- graphics.c,display.c: Use wclear again on Windows iso werase (werase was
introduced in wcd 5.2.4), because wclear gives a cleaner screen in a
Windows Command Prompt in an East Asian locale with double width font. E.g.
Chinese locale CP936 with raster or Simsun font. wclear gives some screen
flickering when used with ncurses on Windows.
- New keys in match list and graphical tree mode: F5 or CRTL-l
to redraw the screen.
- win*/Makefile:
* Add libiconv-2.dll when compiled with Unicode normalization.
* Add libwinpthread-1.dll when compiled with ncurses.
* Replaced libuninstring-0.dll with libunistring-2.dll.
- msys2/Makefile: New makefile for building for native msys2.
- wcd.c, Makefile: Updated for msys2.
- Bugfix: etc/profile.d/wcd.sh: wcd function was overwriting shell's
$go variable. Thanks to Andreas Schwab.
- Bugfix: wcddir.c: Fix in replacing volume manager path with $HOME for other
users. Introduced in version 5.1.0.
5.2.5 2014-06-10
- Translations of UI messages:
* Updated Dutch translation. Thanks to Benno Schulenberg.
* Updated Finnish translation. Thanks to Jorma Karvonen.
* New Esperanto translation. Thanks to Benno Schulenberg.
* New Ukrainian translation. Thanks to Yuri Chornoivan.
* New Vietnamese translation. Thanks to Trần Ngọc Quân.
- Translations of the manual:
* New Dutch translation.
* New German translation. Thanks to Mario Blättermann.
* New Ukrainian translation. Thanks to Yuri Chornoivan.
- Use po4a to create international man pages.
See https://po4a.org/
- Wcd is member of Translation Project for translation of
messages and manual. See
https://translationproject.org/domain/wcd.html
https://translationproject.org/domain/wcd-man.html
- Makefile: Include generated manuals in the source package. Adding man
files to the source package, which have been generated with a high version
of perl/pod2man, is a favour to users, because newer perl/pod2man versions
produce better output (also for old systems). Tip from pod2man maintainer
Russ Allbery. When you want to generate man pages yourself just run first
'make maintainer-clean'.
- Switch to MinGW-w64 compiler for Windows 32 bit.
- Makefile: Wcd compiles in MSYS2/MinGW-w64 environment.
See https://www.msys2.org/
- New makefiles for Microsoft Visual C++ (MS VC) 64 bit.
- New makefiles for Zsh/MSYS 64 bit (win64zsh).
- Watcom and VC makefiles support DEBUG=1.
- dosdir.h, dosdir.c: Fixed disk scanning when built with MS VC 64 bit.
- display.c, graphics.c: Don't use newterm() on Windows when ncurses
is used. Newterm() in old ncurses versions (<5.9.20120922)
is not working on Windows.
- wcd.c: Fixed a dangerous string usage. Thanks to David Binderman.
- wcd.c, display.c: Fixed compilation for stdio interface (no curses).
- Split help text in small pieces to make it easier for translators, and
cleanup messages. Thanks to Benno Schulenberg.
- Switch back to DJGPP gcc 4.5.3. Binaries built with DJGPP gcc >= 4.6
crash in DOSEMU and DosBOX.
5.2.4 2013-08-28
- Support user names with a space in the name in cmd.exe.
Thanks to anonymous.
- Show an "A" when alternative navigation mode is on.
- Improved printing of surrogate pairs on border.
- New option -Td, --cjk-width. Support double width line drawing symbols
and ambiguous characters when double-width CJK (Chinese, Japanese,
and Korean) font is used. Analog to xterm -cjk_width.
- Added a test treedata file.
- Print system error when writing to disk fails.
- Makefile:
* CC can be overridden by environment.
* CFLAGS optimization flags can be overridden by environment.
* Separate LIBS from LDFLAGS.
Thanks to Justin Lecher
- Makefile: NCURSES_DEBUG=1 enables linking with the ncurses libraries
with debug information. The ncurses *_g libraries.
- In verbose mode environment variables HOME, WCDHOME, WCDSCAN,
and go-script are printed.
- Wcd prints debug information when compiled with DEBUG=1.
- Windows versions don't follow symbolic links while scanning
disks (like Unix versions). Thanks to Eli Zaretskii.
- Fix: Option --just-go did not work. --no-ignore-diacritics did set
just go mode.
- Fix: Compilation on OS X/FreeBSD. Thanks to Misty De Meo .
- New option -y, --assume-yes: Assume yes on all queries. Handy in
combination with -rmtree.
- Preparing to use Ncurses instead of PDcurses for wcd on Windows.
PDcurses has no new version since Sep 2008. Many thanks to Ncurses
maintainer Thomas Dickey.
* Reduced flicker in graphical tree interface by using werase() i.s.o.
wclear(). Flicker was mainly noticeable in Windows port of ncurses.
* Unset environment variable TERM on Windows when ncurses is used. A
wrong value makes ncurses exit right away.
* Ncurses MinGW port fixes by Thomas Dickey:
- Failing newterm() fixed (ncurses 5.9.20120922)
- Correct display of double width characters (ncurses 5.9.20121215).
- Freezes on input fixed (ncurses 5.9.20130302).
* Pending issues:
- Ncurses does not work in Console2.
- Misalignment at highlighted directory in tree with true type CJK
font, e.g. the Chinese Simsun font. (PDCurses has same problem.)
5.2.3 2012-10-29
- New compact tree mode. By default the 'graphical' tree is drawn the same
way as the original NCD did it. On DOS a directory path could only be 66
characters in total. With the deep directory structures of today the tree
can become very wide. To overcome this wcd can draw the tree in a compact
way, similar to most GUI file managers, with only one folder per line.
Use the new option -Tc or switch on-the-fly with the 'm' key.
- Alternative navigation in compact tree mode works the same as in GUI
file explorers such as Windows Explorer and KDE Konqueror.
- Removed option -ga. Instead add the new option -Ta to your wcd alias,
function or batch file if you prefer alternative navigation by default.
Use shift-A in the tree to switch on-the-fly.
- Removed option -gc. Instead add the new option -TC to your wcd alias,
function or batch file if you prefer centered view by default.
- Wcd compiles with Microsoft Visual C++.
- Makefile uses $(sysconfdir) i.s.o. hardcoded /etc.
- Added several GNU standard long command-line options.
Thanks to Jari Aalto.
- RPM spec file complies to Fedora packaging standards. Moved spec
file to folder misc.
- Fix: PowerShell version created files named "null". The problem
was introduced in version 5.2.0.
- Fix: Stdio mode on Windows prints Unicode characters correctly.
- Fix: Match c with cedilla when ignoring diacritics (CP1252, CP28591,
ISO-8859-1, and Unicode).
5.2.2 2012-09-01
- Turn off wildcard globbing for DJGPP (DOS32) and MinGW (Windows).
This fixes some unexpected behaviour when a wcd argument matches a file
in the current directory. In Unix shells you still need to quote the
arguments to disable expansion.
- Better error reporting when lines in treedata files are too long.
- wcd.c: Support UTF-16 surrogate pairs when a Unix version reads
UTF-16 tree files.
- Cleanup for Watcom C:
* Fixed compilation for Windows.
* Single makefile for each system.
* Common parts in central makefile.
* Support compilation for Windows PowerShell.
* Support compilation for Unicode version on Windows.
* Support compilation for OS/2. Thanks to Elbert Pol.
* Makefiles can do installation and create zip packages.
- Cleanup macros:
* Use only C99 compliant predefined macros.
* Makefiles for Windows and OS/2 don't need to define MSDOS anymore.
* Use __MSDOS__ macro only when it's real for MS-DOS.
* UNIX does not get defined with OS/2 EMX anymore.
- src/Makefile:
* Target 'clean' renamed to 'mostlyclean', because it preserves the built
manual files. New target 'clean' that removes all files that were not
present in the original source package. Thanks to Jari Aalto.
* New variable HTMLEXT to override the default 'htm' extension for the
manual in HTML format. Thanks to Jari Aalto.
* Support CFLAGS_USER, LDFLAGS_USER, and DEFS_USER for Debian Linux.
Thanks to Jari Aalto.
5.2.1 2012-02-28
- Windows Command Prompt: wcd.bat defines WCDHOME when HOME and WCDHOME both
are not defined, because users can't write files in the root of the system
partition on Windows Vista and up.
- Simplified installation instructions for Windows Command Prompt.
Thanks to Laurence Errington.
- Makefile: Print value of UNINORM.
- Makefile: Support DEBUG=1
- Makefile: Better test for ncurses curses.h include file.
- Man page: Update sections UNICODE and ENVIRONMENT VARIABLES.
- win32/lcc: Removed. Drop support for Windows LCC compiler.
- querycp.c/matchl.c : Fix Code Page number for ISO-8859-1 and ISO-8859-2.
ISO-88592-1 = CP28591, ISO-8859-2 = CP28592
- querycp.c: Support WatcomC for DOS32.
5.2.0 2011-11-12
- URL home page changed to https://waterlan.home.xs4all.nl/
- New option -I: Ignore diacritics.
Ignore diacritics for Latin-based scripts.
Letters with diacritical marks match their base letter without
diacritical mark. See also https://en.wikipedia.org/wiki/Diacritic
The following Latin encodings are supported:
CP437, CP850, CP852, CP1250, CP1252, ISO-8859-1,
ISO-8859-2, and Unicode Latin-1, Latin Extended-A, and Latin Extended-B.
- New option +I: Regard diacritics (default).
- Matching with Unicode normalisation (compatible equivalence).
Compile with UNINORM=1.
See also https://en.wikipedia.org/wiki/Unicode_normalization
Requires libunistring. https://www.gnu.org/s/libunistring/
- Unicode support in Windows Command Prompt (cmd.exe). Requires Windows 7.
- All Windows versions of Wcd write their output in the console in Unicode format.
This gives consistent output, independent of the active code page.
- Wcd for Windows with Unicode writes tree-data file with BOM (Byte Order Mark).
The file is now readable by notepad.
See https://en.wikipedia.org/wiki/Byte_order_mark
- Wcd can read UTF-8 and UTF-16 encoded tree-data files with BOM.
- Makefile use RPM_OPT_FLAGS.
- Enable Large File Support.
- Code cleanup for -Wextra -Wconversion.
- Drop support for Borland C compiler, because it's hard to get
now and not developed any more since a long time. Default to
OpenWatcom for DOS 16 bit.
- Removed Imakefile, because imake is deprecated.
- Removed old makefiles for native HP-UX and Solaris C compiler.
I'm not able to test these compilers.
5.1.5 2011-06-06
- Default scan directory is $HOME, even when WCDHOME is defined.
WCDHOME is only to change location of wcd's files.
- Environment variable WCDSCAN can be used to overrule the default scan
directory.
- Option -u tries to read /home/USER/TREEFILE, and /home/USER/.wcd/TREEFILE.
- Automatically create directory for tree-file and go-script.
- New key in graphical mode: 'T' toggle between line drawing and ASCII
characters.
- Improved error reporting.
- Installation of PDF and PostScript manual is optional.
- Default installation prefix for Unix is '/usr' i.s.o. '/usr/local'.
- Removed directory 'cygwin'. Install on Cygwin from directory 'src'.
- Added shell functions for /etc/profile.d to define the wcd function
or alias. Type 'make install-profile' to install. See also UNIX.txt.
(thanks to Jari Aalto)
- Smarter wcd function for Unix.
- Enable Unicode by default on Cygwin.
5.1.4 2010-11-19
- Use line drawing characters for graphical tree.
- New option -T. Draw tree with ASCII characters.
- Option -gd in combination with a search pattern will dump
the tree of matches.
- Minor updates translations.
- Minor updates man page.
- Version number is only defined in version.mk. (also thanks to Jari Aalto)
- LCC-WIN32 makefiles replaced by GNUmakefile, because lcc make
doesn't support the 'include' directive.
- Don't include generated documentation files in Unix source package.
5.1.3 2010-08-29
- Added German language file (thanks to Philipp Thomas)
- Match window supports terminal resize (on systems that support it).
- New command-line option -gc: Graphical mode with centered view
(like it was in wcd 3.2.1 and before).
- New key in graphical mode: 't' switch centered mode on/off.
- Fix: List separators for WCDFILTER, WCDBAN, and WCDEXCLUDE back to
semicolon ';' (like in wcd 5.0.4 and before) for DOS-bash and WinZsh.
These shells use Windows style paths with colons like c:/windows.
- Don't ship po/*.mo files in source package.
- Port for native MSYS. See also https://osdn.net/projects/mingw/
- Windows 64 bit port.
5.1.2 2010-05-23
- Cleanup Makefiles
- Fix compiler warnings "format not a string literal and no format arguments".
- Fixed compilation on Darwin OS.
- Support compilation in DOSBox (8.3 filenames where needed).
- Dos32 version by default without Native Language Support.
- Renamed Dos32 BASH version to wcdbash.exe.
- Win32 binary packages use patched MinGW's libintl, with builtin
relocation support. See https://waterlan.home.xs4all.nl/libintl.html
5.1.1 2010-01-07
- Alternate stack file support with environment variable WCDSTACKFILE (thanks to anonymous).
- Minor documentation updates.
- Standard GNU make target 'dist' in all makefiles for distribution package creation.
Replaces 'tgzpackage' and 'zippackage'.
- Version date in ISO 8601 format (thanks to Jari Aalto).
5.1.0 Oct 22 2009
- UTF-16 Unicode support for Windows PowerShell.
- Added Finnish language file (thanks to Jari Aalto).
- Update manual, section Unicode.
- Unix: Replace volume manager path of HOME dir by "$HOME" (thanks to Jari Aalto).
- Fix compilation on Solaris (gcc) (thanks to Jari Aalto).
- Fix compilation on HP-UX (cc and curses).
- Fix compilation with Open Watcom C Compiler.
- Updated makefiles. (thanks to Jari Aalto).
- Updated installation documentation. (thanks to Jari Aalto).
- Code cleanup (thanks to Jari Aalto).
- Fix: Graphics mode, non-Unicode version: key q did "select" instead of "quit".
- Man page generation from Perl POD file instead of ROFF. (thanks to Jari Aalto).
- Man page in HTML format.
- Reformat README file (thanks to Jari Aalto).
- List separators for WCDFILTER, WCDBAN, and WCDEXCLUDE depend on shell type, not on DOS vs Unix.
- Conditional text in manual. DOS or Unix specific text can be stripped out. (thanks to Jari Aalto).
5.0.4 Jul 21 2009
- Added Spanish language file (thanks to Julio Augusto Freyre-Gonzalez).
- Improved display of match list for different languages.
- Changed makefile variable WCD_UTF8 to UCS (Universal Character Set).
- Option -V prints the actual used character encoding.
- Update manual. New section WINDOWS CODE PAGES.
- Use Keith Marshall's nl_langinfo() implementation in
Wcd for DOS/Windows/OS2 with native language support.
Taken from package mingw-catgets.
5.0.3 Jul 4 2009
- Fixed wcd_isdir() (UNIX/DOS/Cygwin/OS2 version). Possible false positive
test on non-existing path. Win32 version is not affected.
5.0.2 Jun 8 2009
- Improved horizontal scrolling with Unicode combining and
double width characters in match list and graphical tree.
- Update manual, section LOCALIZATION.
- Man page uses ASCII quotes (grave accent, apostrophe quote) for
readability on old systems.
- src/Makefile supports DESTDIR variable.
- dos16/GNUmakefile: New gnu makefile for dos16 installation and zip
package creation. Replaces misc/Makefile.dist.
5.0.1 May 2 2009
- Fix RPM spec file.
- Update manual w.r.t. MSYS.
- Check environment for UTF-8 character encoding.
- problems.txt: Document problem during `gmake install' on Windows.
5.0.0 Mar 28 2009
- UTF-8 Unicode support for Unix/Linux.
- Resolved a few signedness issues.
- Update manual page.
- Option -l takes alias directly: wcd -l (thanks to Jari Aalto)
- Swapped command line options -v and -V. (thanks to Jari Aalto)
Option -v is now verbose and -V is verion info. This is more
common practice in GNU programs.
- Added GNU standard long command line options --help, --version and --verbose.
- Changed option for quiet operation from -Q to -q (GNU common practice).
- In match list key 'z' does page down (like less) (thanks to Jari Aalto).
- Improvements manual page (thanks to Jari Aalto)
o) The URLs are too long for nroff. Those are now fixed with correct formatting code
o) The /path/names are best not to be hyphenated. Those are now fixed with
correct formatting code
o) The order of sections is changed to follow de facto section order
https://www.opengroup.org/onlinepubs/009695399/utilities/xcu_chap01.html#tag_01_11
o) The quotes `` '' are escaped to make clean output.
o) The top-level INSTALL sections are not made subsections for more clearer layout.
4.1.0 Nov 4 2008
- Wcd version for Windows PowerShell, with full UNC paths support.
- win32: Use GnuWin32 port of gettext. This version detects language
automatically and can find the locale directory if it is relocated.
- Sorting with locale support.
- Less screen movement when navigating in graphical mode.
- Cleanup documentation.
- New make target `uninstall' for deinstallation.
- Renamed Win32 ZSH version to wcdwin32zsh.exe.
- Renamed DOS source directories.
4.0.0 Sep 6 2008
- Enabled native language support, using GNU gettext.
- Added Dutch language.
- One source package for DOS, Windows and Unix.
- Shell script to compile wcd for QNX 4.25 systems. (Thanks to Roland Messier)
- Cleanup documentation.
- Port to OS/2 Warp (Thanks to Elbert Pol)
- Optional colours in graphical mode (option -K) (Thanks to Billy Chen)
- Less screen movement when navigating in graphical mode. (Thanks to Billy Chen)
3.2.1 Apr 5 2006
- Fix : initialise first line in graphical interface to prevent
occasional error message 'line too long'.
- Suport Watcom C compiler.
- Horizontal scrolling added to conio interface.
- Some source code cleanup.
3.2.0 Dec 1 2005
- Support 8 bit characters (non-ASCII characters). (Thanks to Richard Boss)
- Reorganised source zip package.
- Bugfix Curses interface: uninitialised data was written to screen.
This problem showed up with wcd with PDCurses interface on some
Windows 2000/XP systems by printing a lot of garbage in the console
(many small rectangles) when environment variable PDC_RESTORE_SCREEN was
set. (Thanks to Scott D Friedemann)
- Don't set variable PDC_RESTORE_SCREEN automatically.
- Curses interface: Print match list at bottom of console. (Thanks to Richard Boss)
- Use reverse colours to highlight.
- Bugfix PDCurses 1144353 : When PDC_RESTORE_SCREEN was set and the console
buffer was too big wcd scrolled away. (thanks to Mark Hessling )
- DOS and Windows version can use option -u.
- Set base directory for users home directories with environment variable
WCDUSERSHOME.
3.1.6 Sep 29 2005
- Support UNC paths in Cygwin version, including scanning
of servers (wcd -S //servername).
- Cygwin and Win32 ZSH version: Select correct directory
in graphical tree mode if current working directory is a UNC path.
- Try to create directory for go-script when it doesn't exist
3.1.5 Aug 27 2005
- win32 console with PDCurses: use original colours
(thanks to Gabor Grothendieck and Mark Hessling )
- wcd with PDCurses: restore screen by default, no need to set enviroment
variable PDC_RESTORE_SCREEN.(thanks to Gabor Grothendieck)
- New option -ga : Alternative way of navigating in graphics mode. Don't
jump to unrelated directories (thanks to Ken Zinnato).
- New option -od : dump matches to stdout.(Thanks to Richard Boss)
- Updated makefiles for windows compilers. Added makefile for Borland C
with PDCurses.
- Fix for disk scanning problem for Borland CPP 5.x.
3.1.4 Jun 29 2004
- Don't print "-> " when can't change to directory.
- Update man page.
3.1.3 Oct 23 2003
- bugfix: fixed bufferoverflow, introduced in wcd 3.1.2 when environment
variable WCDBAN or WCDEXCLUDE was used.
3.1.2 Oct 19 2003
- Specify filters with environment variable WCDFILTER.
All directories that don't match the filter(s) are ignored.
(thanks to Val Vakar).
- Add bans with environment variable WCDBAN
- Add excludes with environment variable WCDEXCLUDE
- New option: -V Verbose operation.
- Removed option -q
- Removed duplicate wcd.c file for DJGPP.
3.1.1 May 20 2003
- patch for compile problems w.r.t. gcc and (thanks Kevin M. Rosenberg)
See INSTALL.
- fix compile problems on Mac OS X/Darwin (thanks Zoltan Varady).
- default makefile for DOS 16 bit (compact memory model) works again
(thanks to Eric Auer).
- smaller 16 bit DOS binaries (stripped).
3.1.0 Nov 13 2002
- Windows console version supports Windows LAN UNC paths.
- Option -gd will dump all treefiles that are read.
3.0.7 Oct 17 2002
- minor updates in documentation: manpage, wcd.txt and INSTALL
- fixed a memory leak which could cause unix versions of wcd to
generate incorrect treedata files during disk scan with paths
excluded.
3.0.6 Sep 4 2002
- bugfix option -x when used multiple times.
- minor updates manpage
- support longer paths on unix (1024 chars)
3.0.5 Jul 8 2002
- bugfix: compile errors
3.0.4 Jul 6 2002
- Graphical tree mode: Terminal resize (on systems that support it).
- Update manpage.
- wildcards support in banfile
- Exclude paths from scanning: options -x and -xf
- Compiles now with LCC windows C compiler.
- Improved sideways scrolling of matchlist (curses).
- Arrow keys work in matchlist in win32 version (curses).
- Option -k : Keep paths in treedata when wcd cannot change to them.
3.0.3 Nov 25 2001
- Zoom, fold and condense in graphical tree mode.
3.0.2 Oct 17 2001
- bugfix: path quoting in go-script:
win32: paths with ampersand (&) or percent (%)
unix, dos bash, win zsh: paths with grave accent (`)
unix: path with backslash (\)
- update manpage section DESCRIPTION
3.0.1 Jul 6 2001
- update to compile 16 bit dos version with PDCurses.
- minor update manpage
- makefile for SunOS curses
- rpm .spec file update for Redhat 7.1
3.0.0 Apr 12 2001
-g Curses version only:
Full screen interactive directory browser.
`Graphical' match list.
Vi(m) like tree navigation and search,
with wildcard and subdir support
-gd Curses verion only:
dump tree to stdout
-j justgo mode
-G set path for go-script
-GN Don't create go-script
2.3.3 Oct 15 2000
- fall back from curses to stdout
- new option: -N use numbers instead of letters
- new option: -o use stdout instead of curses or conio
- scroll back stack for conio version
2.3.2 Jun 10 2000
- update for curses and PDCurses
2.3.1 May 28 2000
- bug fix in ncurses interface (array bounds read/write)
- update manpage
- minor changes
2.3.0 Apr 27 2000
- Optional ncurses based interface for unix versions.
2.2.9 Jan 16 2000
- new option -w: Wild matching only.
- made wcd compile with MINGW32 compiler.
- win32 version for Amol Deshpande's Win32 port
of zsh (ftp://ftp.blarg.net/users/amol/zsh).
- bug fix: read long paths from stack file (dos 32 bit)
2.2.8 Nov 19 1999
- option -i now also for dos versions
- new option: +i regard case
- minor update interface dos versions
- win32 console port
2.2.7 Sep 30 1999
- environment variable WCDHOME overrides HOME.
- improved choosing from list (DOS versions).
- improved manpage
- mode bits for new directory created with -m option
are now only defined by umask.
2.2.6 May 12 1999
new options:
-aa Add current and all parent paths to treedata
-ee add current and all parent paths to Extra treedata
2.2.5 Apr 15 1999
- bug fix path fixing
2.2.4 Apr 14 1999
-DOS versions can use environment variable HOME
-path fixing
-options -S, +S, -A, -E, -m, -M, -r, and -rmtree can be repeated.
2.2.3 Mar 21 1999
-All versions can read DOS and UNIX text files.
-INSTALLATION section in manpage
2.2.2 Feb 24 1999
bug fix on automounted directories (Unix).
2.2.1 Jan 29 1999
bug fix +S,-n,+n options on directory /
2.2.0 Jan 29 1999
- changed name to Wherever Change Directory
- automaticly remove directories from treedata to which cannot be changed.
- links support (unix only)
- restore text screen after list (dos only)
new options:
-m make directory and add to treedata file
-M make directory and add to extra treedata file
-r remove directory and remove from treedata
-rmtree remove directory recursive and remove from treedata
-n +n use relative treefile
+S make relative treefile
-t don't skip mount string before /home (unix only)
changed options: -u, +u, -f, +f
- some minor changes.
2.1.7 Sep 2 1998
- bug fix: give warning if cannot change to directory
that is in database.
2.1.6 Jul 22 1998
- removed "dangerous" gets() function.
(In the way gets() was used in wcd it was
not dangerous. gets() has been removed to
avoid warnings some compilers or systems give
(e.g. gcc or FreeBSD).)
2.1.5 Jul 15 1998
- Sort match lists
2.1.4 - quiet option default ON (Unix)
2.1.3 - Bug fix: command line parsing (DOS 32 bit)
2.1.2 - Bug fix: backspace in long match list (DOS)
2.1.1 Jun 29 1998
- Bug fix: alias, ban and stack could not deal with
paths with spaces.
2.1.0 Jun 18 1998
- Directory stack
- Data structures with dynamic memory allocation
- ignore case option (unix)
- go $HOME when no directory is given
- man page
2.0.5 - Bug solved. Endless loop on 64 bit Unix system (SGI IRIX64)
2.0.4 Mar 12 1998
- More scanning options: -S , -A , -E
- check for double matches
- source Ansi C compliant
- ending '/' allowed in database
2.0.0 Mar 9 1998
- Changed distribution conditions to GNU General
Public License.
V1.8.3 Feb 26 1998
- Bug fix. Dos version crashed on read-only drive if
TEMP environment variable was not set.
V1.8.0 Feb 9 1998
- Change drive and dir in one go (Dos).
- Ban paths
- Alias directories
V1.7e Dec 9 1997
- Add directories without scanning.
- Improved choosing from a list.
- quiet option default ON in DOS versions.
- changed MAX_LIST and MAX_WILD_LIST to 22
- no drive in treedata (DOS)
- direct CD mode
V1.6 Nov 11 1997
Added Unix bash support
Added a DOS bash version
V1.5a Nov 10 1997
Bug fix dos32 bit version long dir names support
in Windows 95 dos-box
V1.5 Oct 28 1997
More options: -Q -f -u
Dos versions can work on read-only drives if
TEMP environment variable is set.
C shell support.
V1.4b Sep 12 1997
Small bug fix perfect match list.
Quiet option added.
V1.4 Aug 18 1997
Added 32 bit DOS version. Changed source code
for DJGPP compiler.
This version is faster but needs a 80386 CPU
or higher.
V1.4 Jun 18 1997
Search with subdirectory definition
(E.g. wcd adir1/adir2).
V1.3a May 2 1997
The Unix version can now also deal with
directory names with spaces, dollars,
backslashes, single quotes and double quotes.
V1.2c Feb 11 1997.
Many bugs have been solved.
V1.0 Nov 14 1996. Always let the user choose
in case of multiple match.
V1.0 beta Oct-1996 Original version.
wcd-6.0.5/dos16/ 0000755 0001755 0001001 00000000000 14421240062 012475 5 ustar waterlan Geen wcd-6.0.5/dos16/makefile 0000644 0001755 0001001 00000002525 14421240062 014201 0 ustar waterlan Geen SRCDIR = ..\src
!include $(SRCDIR)\version.mk
CC = wcc
PROGRAM = wcd.exe
DEFINES =
CURSES = pdcurses
!ifneq CURSES
DEFINES += -dWCD_USECURSES
!endif
CFLAGS = $(DEFINES) -i=$(SRCDIR) -i=$(SRCDIR)\c3po -w4 -e25 -zq -od -d2 -bt=dos -ml
CFLAGS_VERSION = -DVERSION="$(VERSION)" -DVERSION_DATE="$(VERSION_DATE)"
OBJS = wcd.obj match.obj stack.obj nameset.obj error.obj text.obj WcdStack.obj display.obj wfixpath.obj intset.obj wcddir.obj command.obj matchl.obj querycp.obj finddirs.obj
LOBJS = wcd.obj,match.obj,stack.obj,nameset.obj,error.obj,text.obj,WcdStack.obj,display.obj,wfixpath.obj,intset.obj,wcddir.obj,command.obj,matchl.obj,querycp.obj,finddirs.obj
!ifneq CURSES
OBJS += dirnode.obj colors.obj graphics.obj
LOBJS +=,dirnode.obj,colors.obj,graphics.obj
!endif
docsubdir = wcd
VERSIONSUFFIX = b
ZIPFILE = $(PACKAGE)$(VERSION_SHORT)$(VERSIONSUFFIX).zip
ZIPFILEDIR = ..\..
HTMLEXT = htm
DOCFILES = $(SRCDIR)\man\man1\wcd.txt $(SRCDIR)\man\man1\wcd.$(HTMLEXT)
prefix = c:\dos
TARGET = dos
all: $(PROGRAM) $(DOCFILES) .SYMBOLIC
$(PROGRAM): $(OBJS)
@%create wcd.lnk
@%append wcd.lnk FIL $(LOBJS)
!ifneq CURSES
@%append wcd.lnk library $(CURSES).lib
!endif
wlink name wcd d all SYS $(TARGET) op m op st=32k op maxe=25 op q op symf @wcd.lnk
del wcd.lnk
!include $(SRCDIR)\watcom.mif
wcd-6.0.5/dos32/ 0000755 0001755 0001001 00000000000 14421240062 012473 5 ustar waterlan Geen wcd-6.0.5/dos32/Makefile 0000644 0001755 0001001 00000004177 14421240062 014144 0 ustar waterlan Geen include ../src/version.mk
PREFIX = c:/dos32
prefix = $(PREFIX)
MKDIR = mkdir
CFLAGS = -O2 -Wall -Wextra -Wconversion
CURSES = pdcurses
ENABLE_NLS =
DEFS =
ifdef CONIO
CURSES=
DEFS += -DWCD_USECONIO
endif
ifdef CURSES
LIB_CURSES = -l${CURSES}
DEFS += -DWCD_USECURSES
endif
PROGRAM = wcd.exe
VERSIONSUFFIX = pm
ZIPFILE = wcd${VERSION_SHORT}${VERSIONSUFFIX}.zip
ZIPOBJ_EXTRA = bin/cwsdpmi.exe
docsubdir = wcd-${VERSION_SHORT}
ifdef ENABLE_NLS
LIBS_EXTRA = -lintl -liconv
ZIPFILE = wcd${VERSION_SHORT}pm-nls.zip
endif
# The install and dist targets can be run in MSYS. The OS variable must be
# forced to msdos, otherwise extra targets will get build in MSYS.
# On DOS we need to set SHELL to sh.exe or bash.exe, otherwise targets may fail
# (targets install and dist fail certainly). SHELL can't be overridden in this
# make level. It sticks to command.com (at least with DJGPP 2.03 make 3.79.1).
# SHELL has to be set in a parent process, so we pass it to the sub make instances.
D2U_MAKESHELL=$(shell which sh)
all :
${MAKE} -C ../src all PROGRAM=${PROGRAM} CFLAGS="${CFLAGS}" CURSES=${CURSES} LIB_CURSES=${LIB_CURSES} DEFS="${DEFS}" LIBS_EXTRA="${LIBS_EXTRA}" prefix=${prefix} ENABLE_NLS=${ENABLE_NLS} docsubdir=$(docsubdir) OS=msdos SHELL=$(D2U_MAKESHELL)
install :
${MAKE} -C ../src install PROGRAM=${PROGRAM} CFLAGS="${CFLAGS}" CURSES=${CURSES} LIB_CURSES=${LIB_CURSES} DEFS="${DEFS}" LIBS_EXTRA="${LIBS_EXTRA}" prefix=${prefix} MKDIR=${MKDIR} INSTALL_OBJS_DOC_INSTALL="../doc/INST_DOS.txt ../doc/INSTALL.txt" ENABLE_NLS=${ENABLE_NLS} docsubdir=$(docsubdir) OS=msdos SHELL=$(D2U_MAKESHELL)
uninstall :
${MAKE} -C ../src uninstall PROGRAM=${PROGRAM} prefix=${prefix} ENABLE_NLS=${ENABLE_NLS} docsubdir=$(docsubdir) OS=msdos SHELL=$(D2U_MAKESHELL)
dist :
${MAKE} -C ../src dist-zip ZIPOBJ_EXTRA="${ZIPOBJ_EXTRA}" PROGRAM=${PROGRAM} prefix=${prefix} ZIPFILE=${ZIPFILE} ENABLE_NLS=${ENABLE_NLS} docsubdir=$(docsubdir) OS=msdos SHELL=$(D2U_MAKESHELL)
strip:
${MAKE} -C ../src strip PROGRAM=${PROGRAM} SHELL=$(D2U_MAKESHELL)
mostlyclean :
${MAKE} -C ../src mostlyclean SHELL=$(D2U_MAKESHELL)
clean :
${MAKE} -C ../src clean SHELL=$(D2U_MAKESHELL)
wcd-6.0.5/dos32/watcom/ 0000755 0001755 0001001 00000000000 14421240062 013765 5 ustar waterlan Geen wcd-6.0.5/dos32/watcom/makefile 0000644 0001755 0001001 00000002664 14421240062 015475 0 ustar waterlan Geen SRCDIR = ..\..\src
!include $(SRCDIR)\version.mk
CC = wcc386
PROGRAM = wcd.exe
DEFINES =
CURSES = pdcurses
!ifneq CURSES
DEFINES += -dWCD_USECURSES
!endif
CFLAGS = $(DEFINES) -i=$(SRCDIR) -i=$(SRCDIR)\c3po -w4 -e25 -zq -od -d2 -5r -bt=dos -mf
CFLAGS_VERSION = -DVERSION="$(VERSION)" -DVERSION_DATE="$(VERSION_DATE)"
OBJS = wcd.obj match.obj stack.obj nameset.obj error.obj text.obj WcdStack.obj display.obj wfixpath.obj intset.obj wcddir.obj command.obj matchl.obj querycp.obj finddirs.obj
LOBJS = wcd.obj,match.obj,stack.obj,nameset.obj,error.obj,text.obj,WcdStack.obj,display.obj,wfixpath.obj,intset.obj,wcddir.obj,command.obj,matchl.obj,querycp.obj,finddirs.obj
!ifneq CURSES
OBJS += dirnode.obj colors.obj graphics.obj
LOBJS +=,dirnode.obj,colors.obj,graphics.obj
!endif
docsubdir = wcd-$(VERSION_SHORT)
VERSIONSUFFIX = pm
ZIPFILE = wcd$(VERSION_SHORT)$(VERSIONSUFFIX).zip
HTMLEXT = htm
DOCFILES = $(SRCDIR)\man\man1\wcd.txt $(SRCDIR)\man\man1\wcd.$(HTMLEXT)
ZIPOBJ_EXTRA = bin\cwstub.exe
#ZIPOBJ_EXTRA = bin\dos4gw.exe
prefix = c:\dos32
TARGET = causeway
#TARGET = dos4g
all: $(PROGRAM) $(DOCFILES) .SYMBOLIC
$(PROGRAM): $(OBJS)
@%create wcd.lnk
@%append wcd.lnk FIL $(LOBJS)
!ifneq CURSES
@%append wcd.lnk library $(CURSES).lib
!endif
wlink name wcd d all SYS $(TARGET) op inc op m op st=64k op maxe=25 op q op symf @wcd.lnk
del wcd.lnk
!include $(SRCDIR)\watcom.mif
wcd-6.0.5/dos32bsh/ 0000755 0001755 0001001 00000000000 14421240062 013170 5 ustar waterlan Geen wcd-6.0.5/dos32bsh/Makefile 0000644 0001755 0001001 00000004163 14421240062 014634 0 ustar waterlan Geen include ../src/version.mk
PREFIX = c:/dos32
prefix = $(PREFIX)
MKDIR = mkdir
CFLAGS = -O2 -Wall -Wextra -Wconversion
CURSES = pdcurses
ENABLE_NLS =
DEFS = -DWCD_DOSBASH
ifdef CONIO
CURSES=
DEFS += -DWCD_USECONIO
endif
ifdef CURSES
LIB_CURSES = -l${CURSES}
DEFS += -DWCD_USECURSES
endif
PROGRAM = wcdbash.exe
VERSIONSUFFIX = bh
ZIPFILE = wcd${VERSION_SHORT}${VERSIONSUFFIX}.zip
docsubdir = wcd-${VERSION_SHORT}
ifdef ENABLE_NLS
LIBS_EXTRA = -lintl -liconv
ZIPFILE = wcd${VERSION_SHORT}bh-nls.zip
endif
# The install and dist targets can be run in MSYS. The OS variable must be
# forced to msdos, otherwise extra targets will get build in MSYS.
# On DOS we need to set SHELL to sh.exe or bash.exe, otherwise targets may fail
# (targets install and dist fail certainly). SHELL can't be overridden in this
# make level. It sticks to command.com (at least with DJGPP 2.03 make 3.79.1).
# SHELL has to be set in a parent process, so we pass it to the sub make instances.
D2U_MAKESHELL=$(shell which sh)
all :
${MAKE} -C ../src all PROGRAM=${PROGRAM} CFLAGS="${CFLAGS}" CURSES=${CURSES} LIB_CURSES=${LIB_CURSES} DEFS="${DEFS}" LIBS_EXTRA="${LIBS_EXTRA}" prefix=${prefix} ENABLE_NLS=${ENABLE_NLS} docsubdir=$(docsubdir) OS=msdos SHELL=$(D2U_MAKESHELL)
install :
${MAKE} -C ../src install PROGRAM=${PROGRAM} CFLAGS="${CFLAGS}" CURSES=${CURSES} LIB_CURSES=${LIB_CURSES} DEFS="${DEFS}" LIBS_EXTRA="${LIBS_EXTRA}" prefix=${prefix} MKDIR=${MKDIR} INSTALL_OBJS_DOC_INSTALL="../doc/INST_DOS.txt ../doc/INSTALL.txt" ENABLE_NLS=${ENABLE_NLS} docsubdir=$(docsubdir) OS=msdos SHELL=$(D2U_MAKESHELL)
uninstall :
${MAKE} -C ../src uninstall PROGRAM=${PROGRAM} prefix=${prefix} ENABLE_NLS=${ENABLE_NLS} docsubdir=$(docsubdir) OS=msdos SHELL=$(D2U_MAKESHELL)
dist :
${MAKE} -C ../src dist-zip ZIPOBJ_EXTRA="${ZIPOBJ_EXTRA}" PROGRAM=${PROGRAM} prefix=${prefix} ZIPFILE=${ZIPFILE} ENABLE_NLS=${ENABLE_NLS} docsubdir=$(docsubdir) OS=msdos SHELL=$(D2U_MAKESHELL)
strip:
${MAKE} -C ../src strip PROGRAM=${PROGRAM} SHELL=$(D2U_MAKESHELL)
mostlyclean :
${MAKE} -C ../src mostlyclean SHELL=$(D2U_MAKESHELL)
clean :
${MAKE} -C ../src clean SHELL=$(D2U_MAKESHELL)
wcd-6.0.5/dos32bsh/watcom/ 0000755 0001755 0001001 00000000000 14421240062 014462 5 ustar waterlan Geen wcd-6.0.5/dos32bsh/watcom/makefile 0000644 0001755 0001001 00000002712 14421240062 016164 0 ustar waterlan Geen SRCDIR = ..\..\src
!include $(SRCDIR)\version.mk
CC = wcc386
PROGRAM = wcdbash.exe
DEFINES = -dWCD_DOSBASH
CURSES = pdcurses
!ifneq CURSES
DEFINES += -dWCD_USECURSES
!endif
CFLAGS = $(DEFINES) -i=$(SRCDIR) -i=$(SRCDIR)\c3po -w4 -e25 -zq -od -d2 -5r -bt=dos -mf
CFLAGS_VERSION = -DVERSION="$(VERSION)" -DVERSION_DATE="$(VERSION_DATE)"
OBJS = wcd.obj match.obj stack.obj nameset.obj error.obj text.obj WcdStack.obj display.obj wfixpath.obj intset.obj wcddir.obj command.obj matchl.obj querycp.obj finddirs.obj
LOBJS = wcd.obj,match.obj,stack.obj,nameset.obj,error.obj,text.obj,WcdStack.obj,display.obj,wfixpath.obj,intset.obj,wcddir.obj,command.obj,matchl.obj,querycp.obj,finddirs.obj
!ifneq CURSES
OBJS += dirnode.obj colors.obj graphics.obj
LOBJS +=,dirnode.obj,colors.obj,graphics.obj
!endif
docsubdir = wcd-$(VERSION_SHORT)
VERSIONSUFFIX = bh
ZIPFILE = wcd$(VERSION_SHORT)$(VERSIONSUFFIX).zip
HTMLEXT = htm
DOCFILES = $(SRCDIR)\man\man1\wcd.txt $(SRCDIR)\man\man1\wcd.$(HTMLEXT)
ZIPOBJ_EXTRA = bin\cwstub.exe
#ZIPOBJ_EXTRA = bin\dos4gw.exe
prefix = c:\dos32
TARGET = causeway
#TARGET = dos4g
all: $(PROGRAM) $(DOCFILES) .SYMBOLIC
$(PROGRAM): $(OBJS)
@%create wcd.lnk
@%append wcd.lnk FIL $(LOBJS)
!ifneq CURSES
@%append wcd.lnk library $(CURSES).lib
!endif
wlink name wcdbash d all SYS $(TARGET) op inc op m op st=64k op maxe=25 op q op symf @wcd.lnk
del wcd.lnk
!include $(SRCDIR)\watcom.mif
wcd-6.0.5/file_id.diz 0000644 0001755 0001001 00000003216 14421240062 013646 0 ustar waterlan Geen WCD - Directory changer for DOS and Unix. w/ C src.
Wcd is a command-line program to change directory fast. It saves time typing at
the keyboard. One needs to type only a part of a directory name and wcd will
jump to it. Wcd has a fast selection method in case of multiple matches and
allows aliasing and banning of directories. Wcd also includes a full screen
interactive directory tree browser with speed search.
* Full screen interactive directory tree browser with speed search and
zoom in/out.
* Present the user a list in case of multiple matches.
* Wildcards *, ? and [SET] supported.
* Directory stack, push pop.
* Subdir definition possible. E.g. wcd subdira/subdirb
* Long directory names support in Win95/98/NT DOS-box
* Windows LAN UNC paths supported.
* Change drive and directory at once.
* Alias directories.
* Ban directories.
* Exclude directories.
* Alternate stack per shell or terminal.
* Multi user: Jump to folders of your colleagues.
* Multi platform:
* DOS 16 bit, DOS 32 bit, DOS bash
* Windows Command Prompt, Windows PowerShell, Windows ZSH, MSYS, Cygwin
* Unix/Linux: all Bourne and C type shells
* OS/2 Warp
* Native language support: Brazilian Portuguese, Chinese simplified, Danish,
Dutch, English, Esperanto, Finnish, French, Friulian, German, Romanian, Serbian, Spanish,
Swedish, Ukrainian, Vietnamese.
* Unicode Level 3 support (all UCS characters including double width and combining characters).
* Unix/Linux
* Cygwin.
* Windows PowerShell.
* Windows Command Prompt (cmd.exe) on Windows 7 and up.
* Unicode matching with normalization (compatible equivalence).
* Option to ignore diacritics for Latin-based scripts.
wcd-6.0.5/Makefile 0000644 0001755 0001001 00000002134 14421240062 013201 0 ustar waterlan Geen # Copyright (C) 2009-2011 Erwin Waterlander
# Copyright (C) 2009 Jari Aalto
#
# This program is free software; you can redistribute it and/or
# modify it under the terms of the GNU General Public License as
# published by the Free Software Foundation; either version 2 of the
# License, or (at your option) any later version
#
# This program is distributed in the hope that it will be useful, but
# WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
# General Public License for more details.
#
# Visit
# This makefile is intended only for Unix/Linux.
# See also documentation in directory `doc'.
ifneq (,)
This makefile requires GNU Make.
endif
OBJDIR = src
all:
$(MAKE) -C $(OBJDIR)
clean:
$(MAKE) -C $(OBJDIR) clean
distclean:
$(MAKE) -C $(OBJDIR) distclean
maintainer-clean:
$(MAKE) -C $(OBJDIR) maintainer-clean
realclean: maintainer-clean
install:
$(MAKE) -C $(OBJDIR) install
uninstall:
$(MAKE) -C $(OBJDIR) uninstall
.PHONY: clean distclean realclean install
# End of file
wcd-6.0.5/misc/ 0000755 0001755 0001001 00000000000 14421240062 012474 5 ustar waterlan Geen wcd-6.0.5/misc/bldwin32.sh 0000755 0001755 0001001 00000000675 14421240062 014467 0 ustar waterlan Geen #!/bin/sh
set -e
set -x
cd ../win32
make mostlyclean all strip install dist ENABLE_NLS= UCS=
make mostlyclean all strip install dist ENABLE_NLS=1 UNINORM=1
cd ../win32psh
make mostlyclean all strip install dist ENABLE_NLS= UCS=
make mostlyclean all strip install dist ENABLE_NLS=1 UNINORM=1
cd ../win32zsh
make mostlyclean all strip install dist ENABLE_NLS= UCS=
make mostlyclean all strip install dist ENABLE_NLS=1 UNINORM=1
wcd-6.0.5/misc/bldwin64.sh 0000755 0001755 0001001 00000000675 14421240062 014474 0 ustar waterlan Geen #!/bin/sh
set -e
set -x
cd ../win64
make mostlyclean all strip install dist ENABLE_NLS= UCS=
make mostlyclean all strip install dist ENABLE_NLS=1 UNINORM=1
cd ../win64psh
make mostlyclean all strip install dist ENABLE_NLS= UCS=
make mostlyclean all strip install dist ENABLE_NLS=1 UNINORM=1
cd ../win64zsh
make mostlyclean all strip install dist ENABLE_NLS= UCS=
make mostlyclean all strip install dist ENABLE_NLS=1 UNINORM=1
wcd-6.0.5/misc/unix2dos.mk 0000755 0001755 0001001 00000002044 14421240062 014603 0 ustar waterlan Geen include ../src/version.mk
UNIXVERSION=wcd-${VERSION}
DOSVERSION=wcd${VERSION_SHORT}
# Keep dates so that no make target is out of date.
#
# This Makefile requires 'dos2unix' with --keepdate option:
# https://waterlan.home.xs4all.nl/dos2unix.html
# https://sourceforge.net/projects/dos2unix/
unix2dos:
cd ../.. ; cp -Rp ${UNIXVERSION} ${DOSVERSION}
cd ../../${DOSVERSION}/src ; unix2dos --keepdate *.h *.c *.mk
cd ../../${DOSVERSION} ; unix2dos --keepdate */Makefile
cd ../../${DOSVERSION}/src/c3po ; unix2dos --keepdate *
cd ../../${DOSVERSION}/src/patch ; unix2dos --keepdate *.*
cd ../../${DOSVERSION} ; unix2dos --keepdate *.txt
cd ../../${DOSVERSION}/doc ; unix2dos --keepdate *.txt
cd ../../${DOSVERSION}/doc ; unix2dos --keepdate --add-bom README.txt whatsnew.txt
cd ../../${DOSVERSION} ; unix2dos --keepdate file_id.diz
cd ../../${DOSVERSION}/src/man ; unix2dos --keepdate man1/*.txt
cd ../../${DOSVERSION}/src/man ; unix2dos --keepdate --add-bom */man1/*.txt
cd ../../${DOSVERSION}/src/man ; unix2dos --keepdate man1/*.htm */man1/*.htm
wcd-6.0.5/os2/ 0000755 0001755 0001001 00000000000 14421240062 012244 5 ustar waterlan Geen wcd-6.0.5/os2/Makefile 0000644 0001755 0001001 00000003074 14421240062 013710 0 ustar waterlan Geen
PREFIX = c:/usr
prefix = $(PREFIX)
exec_prefix = $(prefix)
MKDIR = mkdir
LDFLAGS_EXTRA = -Zhigh-mem -Zomf -Zargs-resp
CFLAGS = -O2 -Wall
# PDcurses
#CURSES = pdcurses
# Ncurses
CURSES = ncurses
ENABLE_NLS =
DEFS =
ifeq ($(CURSES),pdcurses)
LIB_CURSES = pdcurses.a
DEFS += -DWCD_USECURSES
endif
ifeq ($(CURSES),ncurses)
LIB_CURSES = -lncurses -ltinfo
DEFS += -DWCD_USECURSES
endif
LIBS_EXTRA =
ifdef ENABLE_NLS
LIBS_EXTRA += -lintl
endif
bindir = ${exec_prefix}/bin
PROGRAM = wcdos2.exe
VERSIONSUFFIX = -os2
ZIPOBJ_EXTRA=bin/wcd.cmd
all :
${MAKE} -C ../src all PROGRAM=${PROGRAM} CFLAGS="${CFLAGS}" CURSES=${CURSES} LIB_CURSES="${LIB_CURSES}" DEFS="${DEFS}" LIBS_EXTRA="${LIBS_EXTRA}" LDFLAGS_EXTRA="${LDFLAGS_EXTRA}" prefix=${prefix} ENABLE_NLS=${ENABLE_NLS} OS=os/2
install :
${MAKE} -C ../src install PROGRAM=${PROGRAM} CFLAGS="${CFLAGS}" CURSES=${CURSES} LIB_CURSES="${LIB_CURSES}" DEFS="${DEFS}" LIBS_EXTRA="${LIBS_EXTRA}" LDFLAGS_EXTRA="${LDFLAGS_EXTRA}" prefix=${prefix} MKDIR=${MKDIR} INSTALL_OBJS_DOC_INSTALL="../doc/INST_DOS.txt ../doc/INSTALL.txt" ENABLE_NLS=${ENABLE_NLS} OS=os/2
install -m 755 wcd.cmd $(DESTDIR)${bindir}/wcd.cmd
uninstall :
${MAKE} -C ../src uninstall PROGRAM=${PROGRAM} prefix=${prefix} ENABLE_NLS=${ENABLE_NLS}
-rm -f $(DESTDIR)${bindir}/wcd.cmd
dist :
${MAKE} -C ../src dist-zip ZIPOBJ_EXTRA="${ZIPOBJ_EXTRA}" PROGRAM=${PROGRAM} prefix=${prefix} VERSIONSUFFIX=${VERSIONSUFFIX} ENABLE_NLS=${ENABLE_NLS}
strip:
${MAKE} -C ../src strip PROGRAM=${PROGRAM}
mostlyclean :
${MAKE} -C ../src mostlyclean
clean :
${MAKE} -C ../src clean
wcd-6.0.5/os2/watcom/ 0000755 0001755 0001001 00000000000 14421240062 013536 5 ustar waterlan Geen wcd-6.0.5/os2/watcom/makefile 0000644 0001755 0001001 00000002471 14421240062 015242 0 ustar waterlan Geen SRCDIR = ..\..\src
!include $(SRCDIR)\version.mk
CC = wcc386
PROGRAM = wcdos2.exe
DEFINES =
CURSES = pdcurses
!ifneq CURSES
DEFINES += -dWCD_USECURSES
!endif
CFLAGS = $(DEFINES) -i=$(SRCDIR) -i=$(SRCDIR)\c3po -i$(%WATCOM)\h\os2 -w4 -e25 -zq -od -d2 -6r -bt=os2 -mf
CFLAGS_VERSION = -DVERSION="$(VERSION)" -DVERSION_DATE="$(VERSION_DATE)"
OBJS = wcd.obj match.obj stack.obj nameset.obj error.obj text.obj WcdStack.obj display.obj wfixpath.obj intset.obj wcddir.obj command.obj matchl.obj querycp.obj finddirs.obj
LOBJS = wcd.obj,match.obj,stack.obj,nameset.obj,error.obj,text.obj,WcdStack.obj,display.obj,wfixpath.obj,intset.obj,wcddir.obj,command.obj,matchl.obj,querycp.obj,finddirs.obj
!ifneq CURSES
OBJS += dirnode.obj colors.obj graphics.obj
LOBJS +=,dirnode.obj,colors.obj,graphics.obj
!endif
VERSIONSUFFIX = -os2
HTMLEXT = htm
DOCFILES = $(SRCDIR)\man\man1\wcd.txt $(SRCDIR)\man\man1\wcd.$(HTMLEXT)
ZIPOBJ_EXTRA=bin\wcd.cmd
prefix = c:\usr
TARGET = os2
all: $(PROGRAM) $(DOCFILES) .SYMBOLIC
$(PROGRAM): $(OBJS)
@%create wcd.lnk
@%append wcd.lnk FIL $(LOBJS)
!ifneq CURSES
@%append wcd.lnk library $(CURSES).lib
!endif
wlink name wcdos2 d all SYS os2v2 op inc op m op st=64k op maxe=25 op q op symf @wcd.lnk
del wcd.lnk
!include $(SRCDIR)\watcom.mif
wcd-6.0.5/os2/wcd.cmd 0000755 0001755 0001001 00000000561 14421240062 013513 0 ustar waterlan Geen @echo off
set PDC_RESTORE_SCREEN=1
rem set LANG=nl_NL
rem set LANGUAGE=nl
rem set WCDLOCALEDIR=c:/Program Files/wcd/share/locale
wcdos2.exe %1 %2 %3 %4 %5 %6 %7 %8 %9
IF NOT "%WCDHOME%" == "" GOTO WCDHOME
IF NOT "%HOME%" == "" GOTO HOME
c:\wcdgo.cmd
GOTO END
:WCDHOME
%WCDHOME%\wcdgo.cmd
GOTO END
:HOME
%HOME%\wcdgo.cmd
GOTO END
:END
wcd-6.0.5/os2bash/ 0000755 0001755 0001001 00000000000 14421240062 013102 5 ustar waterlan Geen wcd-6.0.5/os2bash/Makefile 0000644 0001755 0001001 00000002741 14421240062 014546 0 ustar waterlan Geen
PREFIX = c:/usr
prefix = $(PREFIX)
exec_prefix = $(prefix)
MKDIR = mkdir
LDFLAGS_EXTRA = -Zhigh-mem -Zomf -Zargs-resp
CFLAGS = -O2 -Wall
# PDcurses
#CURSES = pdcurses
# Ncurses
CURSES = ncurses
ENABLE_NLS =
DEFS = -DWCD_OS2BASH
ifeq ($(CURSES),pdcurses)
LIB_CURSES = pdcurses.a
DEFS += -DWCD_USECURSES
endif
ifeq ($(CURSES),ncurses)
LIB_CURSES = -lncurses -ltinfo
DEFS += -DWCD_USECURSES
endif
LIBS_EXTRA =
ifdef ENABLE_NLS
LIBS_EXTRA += -lintl
endif
bindir = ${exec_prefix}/bin
PROGRAM = wcdos2bash.exe
VERSIONSUFFIX = -os2bash
all :
${MAKE} -C ../src all PROGRAM=${PROGRAM} CFLAGS="${CFLAGS}" CURSES=${CURSES} LIB_CURSES="${LIB_CURSES}" DEFS="${DEFS}" LIBS_EXTRA="${LIBS_EXTRA}" LDFLAGS_EXTRA="${LDFLAGS_EXTRA}" prefix=${prefix} ENABLE_NLS=${ENABLE_NLS} OS=os/2
install :
${MAKE} -C ../src install PROGRAM=${PROGRAM} CFLAGS="${CFLAGS}" CURSES=${CURSES} LIB_CURSES="${LIB_CURSES}" DEFS="${DEFS}" LIBS_EXTRA="${LIBS_EXTRA}" LDFLAGS_EXTRA="${LDFLAGS_EXTRA}" prefix=${prefix} MKDIR=${MKDIR} INSTALL_OBJS_DOC_INSTALL="../doc/INST_DOS.txt ../doc/INSTALL.txt" ENABLE_NLS=${ENABLE_NLS} OS=os/2
uninstall :
${MAKE} -C ../src uninstall PROGRAM=${PROGRAM} prefix=${prefix} ENABLE_NLS=${ENABLE_NLS}
dist :
${MAKE} -C ../src dist-zip ZIPOBJ_EXTRA="${ZIPOBJ_EXTRA}" PROGRAM=${PROGRAM} prefix=${prefix} VERSIONSUFFIX=${VERSIONSUFFIX} ENABLE_NLS=${ENABLE_NLS}
strip:
${MAKE} -C ../src strip PROGRAM=${PROGRAM}
mostlyclean :
${MAKE} -C ../src mostlyclean
clean :
${MAKE} -C ../src clean
wcd-6.0.5/README.txt 0000644 0001755 0001001 00000000051 14421240062 013233 0 ustar waterlan Geen
For documentation see directory `doc'.
wcd-6.0.5/src/ 0000755 0001755 0001001 00000000000 14421240120 012323 5 ustar waterlan Geen wcd-6.0.5/src/c3po/ 0000755 0001755 0001001 00000000000 14421240062 013174 5 ustar waterlan Geen wcd-6.0.5/src/c3po/Advance.h 0000644 0001755 0001001 00000013745 14421240062 014720 0 ustar waterlan Geen #ifndef ADVANCE_INCLUDED
#define ADVANCE_INCLUDED
/*
Copyright (C) 1997-2000 Ondrej Popp
This code is generated with Ondrej Popp's C3PO.
This program is free software; you can redistribute it and/or
modify it under the terms of the GNU General Public License
as published by the Free Software Foundation; either version 2
of the License, or (at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software
Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
*/
template static void advanceHookWcdStack(WcdStack w,
text Offset,
ARGS);
template static void advanceWcdStack(WcdStack w,
text Offset,
ARGS);
template static void advanceHookDirnode(dirnode d,
text Offset,
ARGS);
template static void advanceDirnode(dirnode d,
text Offset,
ARGS);
template static void advanceHookNameset(nameset n,
text Offset,
ARGS);
template static void advanceNameset(nameset n,
text Offset,
ARGS);
template static void advanceHookIntset(intset i,
text Offset,
ARGS);
template static void advanceIntset(intset i,
text Offset,
ARGS);
template static void advanceHookWcdStack(WcdStack w,
text Offset,
ARGS)
{
int index;
index = 0;
while(index < w->getSizeOfWcdStackDir)
{
index = index + 1;
}
}
template static void advanceWcdStack(WcdStack w,
text Offset,
ARGS)
{
text increment = " ";
text new_Offset = (text) malloc(sizeof(char) * (strlen(Offset) + strlen(increment) + 1));
sprintf(new_Offset, "%s%s", Offset, increment);
TRACE(fprintf(stdout, "%sAdvance : WcdStack\n", Offset);)
TRACE(fprintf(stdout, "%s{\n", Offset);)
if (w ne NULL)
advanceHookWcdStack(w, new_Offset, ARGSREF);
TRACE(fprintf(stdout, "%s} <- end Advance WcdStack\n", Offset);)
free(new_Offset);
}
template static void advanceHookDirnode(dirnode d,
text Offset,
ARGS)
{
int index;
index = 0;
while(index < d->getSizeOfDirnode)
{
advanceDirnode(d->subdirs[index], Offset, ARGSREF);
index = index + 1;
}
}
template static void advanceDirnode(dirnode d,
text Offset,
ARGS)
{
text increment = " ";
text new_Offset = (text) malloc(sizeof(char) * (strlen(Offset) + strlen(increment) + 1));
sprintf(new_Offset, "%s%s", Offset, increment);
TRACE(fprintf(stdout, "%sAdvance : dirnode\n", Offset);)
TRACE(fprintf(stdout, "%s{\n", Offset);)
if (d ne NULL)
advanceHookDirnode(d, new_Offset, ARGSREF);
TRACE(fprintf(stdout, "%s} <- end Advance dirnode\n", Offset);)
free(new_Offset);
}
template static void advanceHookNameset(nameset n,
text Offset,
ARGS)
{
int index;
index = 0;
while(index < n->getSizeOfNamesetArray)
{
index = index + 1;
}
}
template static void advanceNameset(nameset n,
text Offset,
ARGS)
{
text increment = " ";
text new_Offset = (text) malloc(sizeof(char) * (strlen(Offset) + strlen(increment) + 1));
sprintf(new_Offset, "%s%s", Offset, increment);
TRACE(fprintf(stdout, "%sAdvance : nameset\n", Offset);)
TRACE(fprintf(stdout, "%s{\n", Offset);)
if (n ne NULL)
advanceHookNameset(n, new_Offset, ARGSREF);
TRACE(fprintf(stdout, "%s} <- end Advance nameset\n", Offset);)
free(new_Offset);
}
template static void advanceHookIntset(intset i,
text Offset,
ARGS)
{
int index;
index = 0;
while(index < i->getSizeOfIntset)
{
index = index + 1;
}
}
template static void advanceIntset(intset i,
text Offset,
ARGS)
{
text increment = " ";
text new_Offset = (text) malloc(sizeof(char) * (strlen(Offset) + strlen(increment) + 1));
sprintf(new_Offset, "%s%s", Offset, increment);
TRACE(fprintf(stdout, "%sAdvance : intset\n", Offset);)
TRACE(fprintf(stdout, "%s{\n", Offset);)
if (i ne NULL)
advanceHookIntset(i, new_Offset, ARGSREF);
TRACE(fprintf(stdout, "%s} <- end Advance intset\n", Offset);)
free(new_Offset);
}
#endif
wcd-6.0.5/src/c3po/Command.c 0000644 0001755 0001001 00000011210 14421240062 014711 0 ustar waterlan Geen /*
Copyright (C) 1997-2000 Ondrej Popp
This code is generated with Ondrej Popp's C3PO.
This program is free software; you can redistribute it and/or
modify it under the terms of the GNU General Public License
as published by the Free Software Foundation; either version 2
of the License, or (at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software
Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
*/
#include
#include
#include
#include
#include "std_macr.h"
#include "structur.h"
#include "Error.h"
#include "nameset.h"
expfun text getBasename(text input_file)
{
static char base[200];
int i;
strcpy(base, input_file);
i = (int)strlen(base) - 1;
while(i >= 0)
{
if (base[i] eq '/')
return base + i + 1;
i = i - 1;
}
return base;
}
expfun text getCore(text input_file)
{
static char core[200];
int i;
strcpy(core, getBasename(input_file));
i = (int)strlen(core) - 1;
while(i >= 0)
{
if (core[i] eq '.')
core[i] = '\0';
i = i - 1;
}
return core;
}
expfun c3po_bool inArgList(text name,
int argc,
char** argv)
{
c3po_bool found = false;
int index = 1;
while(index < argc)
{
text arg;
arg = *(argv + index);
if (strcmp(name, arg) eq 0)
{
found = true;
break;
}
index = index + 1;
}
return found;
}
expfun text getArg(text name,
int argc,
char** argv)
{
int index = 1;
text arg = NULL;
text current_arg;
c3po_bool found = false;
while(index < argc)
{
current_arg = *(argv + index);
if (strcmp(name, current_arg) eq 0)
{
found = true;
break;
}
index = index + 1;
}
if (found eq true)
{
index = index + 1;
if (index < argc)
{
current_arg = *(argv + index);
if ( *current_arg ne '-')
arg = current_arg;
}
}
return arg;
}
expfun nameset getArgs(text name,
int argc,
char** argv)
{
int index = 0;
nameset args = NULL;
c3po_bool found = false;
while(index < argc)
{
text arg;
arg = *(argv + index);
if (strcmp(name, arg) eq 0)
{
index = index + 1;
if (index < argc)
{
args = namesetNew();
found = true;
}
else
return NULL;
}
if (found eq true)
{
arg = *(argv + index);
if ( *arg eq '-')
{
if (args->size eq 0)
{
free((void *) args);
args = NULL;
}
break;
}
else
addToNamesetArray(arg, args);
}
index = index + 1;
}
return args;
}
expfun c3po_bool isInt(text string)
{
unsigned int index = 0;
c3po_bool is_int = true;
while(index < strlen(string))
{
if (isdigit(string[index]) ne 0)
index = index + 1;
else if ((index eq 0) and (string[0] eq '-'))
index = index + 1;
else
{
is_int = false;
break;
}
}
return is_int;
}
expfun c3po_bool isFloat(text string)
{
unsigned int index = 0;
c3po_bool digits = true;
c3po_bool found_point = false;
while(index < strlen(string))
{
if (isdigit(string[index]) ne 0)
index = index + 1;
else if (string[index] eq '.')
{
index = index + 1;
found_point = true;
}
else
{
digits = false;
break;
}
}
if (found_point eq true)
{
if (digits eq true)
return true;
else
return false;
}
else
return false;
}
expfun void dumpCommandline(text file,
int argc,
char** argv)
{
FILE *fp;
fp = fopen(file, "a");
if (fp ne NULL)
{
int index = 0;
fprintf(stderr, "\n- appending commandline to '%s'\n", file);
while(index < argc)
{
fprintf(fp, "%s ", argv[index]);
index = index + 1;
}
fprintf(fp, "\n");
fclose(fp);
}
else
{
c3po_beep(1);
fprintf(stderr, "- couldn't append commandline to '%s'\n", file);
}
}
wcd-6.0.5/src/c3po/Command.h 0000644 0001755 0001001 00000002661 14421240062 014730 0 ustar waterlan Geen #ifndef COMMAND_INCLUDED
#define COMMAND_INCLUDED
/*
Copyright (C) 1997-2000 Ondrej Popp
This code is generated with Ondrej Popp's C3PO.
This program is free software; you can redistribute it and/or
modify it under the terms of the GNU General Public License
as published by the Free Software Foundation; either version 2
of the License, or (at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software
Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
*/
extern text getBasename(text input_file);
extern text getCore(text input_file);
extern c3po_bool inArgList(text name,
int argc,
char** argv);
extern text getArg(text name,
int argc,
char** argv);
extern nameset getArgs(text name,
int argc,
char** argv);
extern c3po_bool isInt(text string);
extern c3po_bool isFloat(text string);
extern void dumpCommandline(text file,
int argc,
char** argv);
#endif
wcd-6.0.5/src/c3po/Config.h 0000644 0001755 0001001 00000001565 14421240062 014561 0 ustar waterlan Geen /*
Copyright (C) 1997-2000 Ondrej Popp
This code is generated with Ondrej Popp's C3PO.
This program is free software; you can redistribute it and/or
modify it under the terms of the GNU General Public License
as published by the Free Software Foundation; either version 2
of the License, or (at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software
Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
*/
OBJDIR = .
#define PassCDebugFlags 'CDEBUGFLAGS=$(CDEBUGFLAGS)'
CDEBUGFLAGS = -g
CCOPTIONS = -Wall -z
CC = gcc
wcd-6.0.5/src/c3po/Constants.h 0000644 0001755 0001001 00000001535 14421240062 015325 0 ustar waterlan Geen #ifndef CONSTANTS_INCLUDED
#define CONSTANTS_INCLUDED
/*
Copyright (C) 1997-2000 Ondrej Popp
This code is generated with Ondrej Popp's C3PO.
This program is free software; you can redistribute it and/or
modify it under the terms of the GNU General Public License
as published by the Free Software Foundation; either version 2
of the License, or (at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software
Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
*/
#define STRING_SIZE 1024
#endif
wcd-6.0.5/src/c3po/dirnode.c 0000644 0001755 0001001 00000027372 14421240062 014777 0 ustar waterlan Geen #include
#include
#include
#include "std_macr.h"
#include "structur.h"
#include "Error.h"
#include "Text.h"
#include "dirnode.h"
/*
Copyright (C) 1997-2000 Ondrej Popp
This code is generated with Ondrej Popp's C3PO.
This program is free software; you can redistribute it and/or
modify it under the terms of the GNU General Public License
as published by the Free Software Foundation; either version 2
of the License, or (at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software
Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
*/
expfun dirnode dirnodeNew(dirnode parent,
dirnode up,
dirnode down)
{
dirnode d = (dirnode) malloc (sizeof(dirnode_struct));
if (d != NULL)
{
d->parent = parent;
d->up = up;
d->down = down;
d->name = NULL;
d->x = 0;
d->y = 0;
d->fold = false;
d->subdirs = NULL;
d->size = 0;
}
else
malloc_error("dirnodeNew()");
return d;
}
expfun dirnode copyDirnode(dirnode src,
c3po_bool Deep)
{
if (src == NULL)
return NULL;
else
{
dirnode d;
d = (dirnode) malloc (sizeof(dirnode_struct));
if (d != NULL)
{
if (Deep == true)
{
d->name = textNew(src->name);
d->x = src->x;
d->y = src->y;
d->parent = src->parent;
d->up = src->up;
d->down = src->down;
d->fold = src->fold;
}
else
{
d->name = src->name;
d->x = src->x;
d->y = src->y;
d->parent = src->parent;
d->up = src->up;
d->down = src->down;
d->fold = src->fold;
}
d->subdirs = NULL;
d->size = 0;
if (Deep == true)
deepExtendDirnode(src, d);
else
extendDirnode(src, d);
}
else
malloc_error("copyDirnode()");
return d;
}
}
expfun text dirnodeGetName(dirnode d)
{
if (d != NULL)
return d->name;
else
return NULL;
}
expfun int dirnodeGetX(dirnode d)
{
if (d != NULL)
return d->x;
else
return 0;
}
expfun int dirnodeGetY(dirnode d)
{
if (d != NULL)
return d->y;
else
return 0;
}
expfun dirnode dirnodeGetParent(dirnode d)
{
if (d != NULL)
return d->parent;
else
return NULL;
}
expfun dirnode* dirnodeGetSubdirs(dirnode d)
{
if (d != NULL)
return d->subdirs;
else
return NULL;
}
expfun dirnode dirnodeGetUp(dirnode d)
{
if (d != NULL)
return d->up;
else
return NULL;
}
expfun dirnode dirnodeGetDown(dirnode d)
{
if (d != NULL)
return d->down;
else
return NULL;
}
expfun c3po_bool dirnodeFold(dirnode d)
{
if (d != NULL)
return d->fold;
else
return false;
}
expfun dirnode dirnodeSetName(text name,
dirnode d)
{
if (d != NULL)
d->name = name;
return d;
}
expfun dirnode dirnodeSetX(int x,
dirnode d)
{
if (d != NULL)
d->x = x;
return d;
}
expfun dirnode dirnodeSetY(int y,
dirnode d)
{
if (d != NULL)
d->y = y;
return d;
}
expfun dirnode dirnodeSetParent(dirnode parent,
dirnode d)
{
if (d != NULL)
d->parent = parent;
return d;
}
expfun dirnode dirnodeSetUp(dirnode up,
dirnode d)
{
if (d != NULL)
d->up = up;
return d;
}
expfun dirnode dirnodeSetDown(dirnode down,
dirnode d)
{
if (d != NULL)
d->down = down;
return d;
}
expfun dirnode dirnodeSetFold(c3po_bool fold,
dirnode d)
{
if (d != NULL)
d->fold = fold;
return d;
}
expfun c3po_bool dirnodeHasName(dirnode d)
{
if (dirnodeGetName(d) != NULL)
return true;
else
return false;
}
expfun c3po_bool dirnodeHasParent(dirnode d)
{
if (dirnodeGetParent(d) != NULL)
return true;
else
return false;
}
expfun c3po_bool dirnodeHasSubdirs(dirnode d)
{
if (isEmptyDirnode(d) == false)
return true;
else
return false;
}
expfun c3po_bool dirnodeHasUp(dirnode d)
{
if (dirnodeGetUp(d) != NULL)
return true;
else
return false;
}
expfun c3po_bool dirnodeHasDown(dirnode d)
{
if (dirnodeGetDown(d) != NULL)
return true;
else
return false;
}
expfun dirnode endOfRecursionOfDirnodeParent(dirnode d)
{
if (dirnodeHasParent(d) == true)
return endOfRecursionOfDirnodeParent(dirnodeGetParent(d));
else
return d;
}
expfun dirnode endOfRecursionOfDirnodeUp(dirnode d)
{
if (dirnodeHasUp(d) == true)
return endOfRecursionOfDirnodeUp(dirnodeGetUp(d));
else
return d;
}
expfun dirnode endOfRecursionOfDirnodeDown(dirnode d)
{
if (dirnodeHasDown(d) == true)
return endOfRecursionOfDirnodeDown(dirnodeGetDown(d));
else
return d;
}
expfun size_t getSizeOfDirnode(dirnode d)
{
if (d != NULL)
return d->size;
else
return 0;
}
expfun void setSizeOfDirnode(dirnode d,
size_t size)
{
if (d != NULL)
{
if (size == 0)
{
if (isEmptyDirnode(d) eq false)
{
free((void *) d->subdirs);
d->subdirs = NULL;
d->size = 0;
}
}
else if (size ne d->size)
{
if (isEmptyDirnode(d) eq true)
d->subdirs = (dirnode*) malloc(sizeof(dirnode) * size);
else
d->subdirs = (dirnode*) realloc((void *) d->subdirs, sizeof(dirnode) * size);
if (d->subdirs ne NULL)
{
size_t index = d->size;
while(index < size)
{
d->subdirs[index] = NULL;
index = index + 1;
}
d->size = size;
}
else
{
d->size = 0;
malloc_error("setSizeOfDirnode(d, size)");
}
}
}
}
expfun c3po_bool isEmptyDirnode(dirnode d)
{
if (getSizeOfDirnode(d) > 0)
return false;
else
return true;
}
expfun void addToDirnode(dirnode d,
dirnode set)
{
if (set != NULL)
{
setSizeOfDirnode(set, set->size + 1);
if (set->subdirs != NULL)
set->subdirs[set->size - 1] = d;
else
malloc_error("addToDirnode()");
}
}
expfun void putElementAtDirnode(dirnode d,
size_t position,
dirnode set)
{
if (set != NULL)
{
if (position >= set->size)
setSizeOfDirnode(set, position + 1);
if (set->subdirs != NULL)
set->subdirs[position] = d;
else
malloc_error("putElementAtDirnode(d, position, set)");
}
}
expfun void insertElementAtDirnode(dirnode d,
size_t position,
dirnode set)
{
if (set != NULL)
{
size_t index = set->size;
while(index > position)
{
putElementAtDirnode(set->subdirs[index-1], index, set);
index = index - 1;
}
putElementAtDirnode(d, position, set);
}
}
expfun void removeElementAtDirnode(size_t position,
dirnode set,
c3po_bool FreeAtPos,
c3po_bool Deep)
{
if (set != NULL)
{
if (position < set->size)
{
size_t index = position + 1;
if (FreeAtPos eq true)
freeDirnode(set->subdirs[position], Deep);
while(index < set->size)
{
putElementAtDirnode(set->subdirs[index], index - 1, set);
index = index + 1;
}
setSizeOfDirnode(set, set->size - 1);
}
}
}
expfun dirnode elementAtDirnode(size_t position,
dirnode set)
{
if (set != NULL)
{
if (position < set->size)
return set->subdirs[position];
}
return NULL;
}
expfun void extendDirnode(dirnode src,
dirnode dest)
{
if (src != NULL)
{
size_t index = 0;
while(index < src->size)
{
addToDirnode(elementAtDirnode(index, src), dest);
index = index + 1;
}
}
}
expfun void deepExtendDirnode(dirnode src,
dirnode dest)
{
if (src != NULL)
{
size_t index = 0;
while(index < src->size)
{
addToDirnode(copyDirnode(elementAtDirnode(index, src), true), dest);
index = index + 1;
}
}
}
expfun void printDirnode(text Offset,
dirnode d,
FILE* fp,
c3po_bool showEmpty)
{
text increment = " ";
text new_Offset = (text) malloc(sizeof(char) * (strlen(Offset) + strlen(increment) + 1));
if (new_Offset == NULL) {
fprintf(fp, "NULL\n");
return;
}
sprintf(new_Offset, "%s%s", Offset, increment);
if (d == NULL)
{
if (showEmpty == true)
{
fprintf(fp, "%s{\n", Offset);
fprintf(fp, "%sNULL\n", new_Offset);
fprintf(fp, "%s}\n", Offset);
}
}
else
{
fprintf(fp, "%s{\n", Offset);
if ((dirnodeHasName(d) == true) || (showEmpty == true))
{
if (d->name ne NULL)
fprintf(fp, "%stext name : %s\n", new_Offset, d->name);
else if (showEmpty == true)
fprintf(fp, "%stext name : NULL\n", new_Offset);
}
fprintf(fp, "%sint x : %d\n", new_Offset, d->x);
fprintf(fp, "%sint y : %d\n", new_Offset, d->y);
if ((dirnodeHasParent(d) == true) || (showEmpty == true))
fprintf(fp, "%sdirnode parent : %lu (reference)\n", new_Offset, (unsigned long) d->parent);
if ((dirnodeHasUp(d) == true) || (showEmpty == true))
fprintf(fp, "%sdirnode up : %lu (reference)\n", new_Offset, (unsigned long) d->up);
if ((dirnodeHasDown(d) == true) || (showEmpty == true))
fprintf(fp, "%sdirnode down : %lu (reference)\n", new_Offset, (unsigned long) d->down);
fprintf(fp, "%sc3po_bool fold : %d\n", new_Offset, d->fold);
if (d->subdirs == NULL)
{
if (showEmpty == true)
fprintf(fp, "%sdirnode subdirs : NULL\n", new_Offset);
}
else
{
if ((isEmptyDirnode(d) == false) || (showEmpty == true))
{
size_t index = 0;
fprintf(fp, "%sint size : %lu\n", new_Offset, (unsigned long)d->size);
while(index < d->size)
{
fprintf(fp, "%sdirnode subdirs[%lu],\n", new_Offset, (unsigned long)index);
printDirnode(new_Offset, d->subdirs[index], fp, showEmpty);
fprintf(fp, "%s\\end dirnode[%lu]\n", new_Offset, (unsigned long)index);
index = index + 1;
}
}
}
fprintf(fp, "%s}\n", Offset);
}
free(new_Offset);
}
expfun void freeDirnode(dirnode d,
c3po_bool Deep)
{
if (d ne NULL)
{
if (Deep eq true)
{
size_t index = 0;
if (d->name ne NULL)
{
free((void *) d->name);
d->name = NULL;
}
while(index < d->size)
{
freeDirnode(d->subdirs[index], Deep);
index = index + 1;
}
}
if (d->subdirs ne NULL)
{
free((void *) d->subdirs);
d->subdirs = NULL;
d->size = 0;
}
free((void *) d);
}
}
wcd-6.0.5/src/c3po/dirnode.h 0000644 0001755 0001001 00000007240 14421240062 014774 0 ustar waterlan Geen #ifndef DIRNODE_INCLUDED
#define DIRNODE_INCLUDED
/*
Copyright (C) 1997-2000 Ondrej Popp
This code is generated with Ondrej Popp's C3PO.
This program is free software; you can redistribute it and/or
modify it under the terms of the GNU General Public License
as published by the Free Software Foundation; either version 2
of the License, or (at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software
Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
*/
extern dirnode dirnodeNew(dirnode parent,
dirnode up,
dirnode down);
extern dirnode copyDirnode(dirnode src,
c3po_bool Deep);
extern text dirnodeGetName(dirnode d);
extern int dirnodeGetX(dirnode d);
extern int dirnodeGetY(dirnode d);
extern dirnode dirnodeGetParent(dirnode d);
extern dirnode* dirnodeGetSubdirs(dirnode d);
extern dirnode dirnodeGetUp(dirnode d);
extern dirnode dirnodeGetDown(dirnode d);
extern c3po_bool dirnodeFold(dirnode d);
extern dirnode dirnodeSetName(text name,
dirnode d);
extern dirnode dirnodeSetX(int x,
dirnode d);
extern dirnode dirnodeSetY(int y,
dirnode d);
extern dirnode dirnodeSetParent(dirnode parent,
dirnode d);
extern dirnode dirnodeSetUp(dirnode up,
dirnode d);
extern dirnode dirnodeSetDown(dirnode down,
dirnode d);
extern dirnode dirnodeSetFold(c3po_bool fold,
dirnode d);
extern c3po_bool dirnodeHasName(dirnode d);
extern c3po_bool dirnodeHasParent(dirnode d);
extern c3po_bool dirnodeHasSubdirs(dirnode d);
extern c3po_bool dirnodeHasUp(dirnode d);
extern c3po_bool dirnodeHasDown(dirnode d);
extern dirnode endOfRecursionOfDirnodeParent(dirnode d);
extern dirnode endOfRecursionOfDirnodeUp(dirnode d);
extern dirnode endOfRecursionOfDirnodeDown(dirnode d);
extern size_t getSizeOfDirnode(dirnode d);
extern void setSizeOfDirnode(dirnode d,
size_t size);
extern c3po_bool isEmptyDirnode(dirnode d);
extern void addToDirnode(dirnode d,
dirnode set);
extern void putElementAtDirnode(dirnode d,
size_t position,
dirnode set);
extern void insertElementAtDirnode(dirnode d,
size_t position,
dirnode set);
extern void removeElementAtDirnode(size_t position,
dirnode set,
c3po_bool FreeAtPos,
c3po_bool Deep);
extern dirnode elementAtDirnode(size_t position,
dirnode set);
extern void extendDirnode(dirnode src,
dirnode dest);
extern void deepExtendDirnode(dirnode src,
dirnode dest);
extern void printDirnode(text Offset,
dirnode d,
FILE* fp,
c3po_bool showEmpty);
extern void freeDirnode(dirnode d,
c3po_bool Deep);
#endif
wcd-6.0.5/src/c3po/Error.c 0000644 0001755 0001001 00000002341 14421240062 014431 0 ustar waterlan Geen /*
Copyright (C) 1997-2000 Ondrej Popp
This code is generated with Ondrej Popp's C3PO.
This program is free software; you can redistribute it and/or
modify it under the terms of the GNU General Public License
as published by the Free Software Foundation; either version 2
of the License, or (at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software
Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
*/
#include
#include
#include
#include "std_macr.h"
#include "structur.h"
#include "../config.h"
#include "../wcd.h"
expfun void c3po_beep(int number_times)
{
int counter = 0;
while (counter < number_times)
{
fprintf(stderr, "\007");
counter = counter + 1;
}
}
expfun void malloc_error(text function_name)
{
c3po_beep(1);
print_error(_("in '%s', insufficient memory for allocation\n"), function_name);
exit(1);
}
wcd-6.0.5/src/c3po/Error.h 0000644 0001755 0001001 00000001631 14421240062 014437 0 ustar waterlan Geen #ifndef ERROR_INCLUDED
#define ERROR_INCLUDED
/*
Copyright (C) 1997-2000 Ondrej Popp
This code is generated with Ondrej Popp's C3PO.
This program is free software; you can redistribute it and/or
modify it under the terms of the GNU General Public License
as published by the Free Software Foundation; either version 2
of the License, or (at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software
Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
*/
extern void c3po_beep(int number_times);
extern void malloc_error(text function_name);
#endif
wcd-6.0.5/src/c3po/File.c 0000644 0001755 0001001 00000005357 14421240062 014231 0 ustar waterlan Geen /*
Copyright (C) 1997-2000 Ondrej Popp
This code is generated with Ondrej Popp's C3PO.
This program is free software; you can redistribute it and/or
modify it under the terms of the GNU General Public License
as published by the Free Software Foundation; either version 2
of the License, or (at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software
Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
*/
#include
#include
#include
#include
#include "std_macr.h"
#include "structur.h"
#include "Constants.h"
expfun FILE * openR(text filename)
{
FILE *fi = fopen(filename, "r");
return fi;
}
expfun FILE * openRwarn(text filename,
c3po_bool Warn)
{
FILE *fi = fopen(filename, "r");
if ((fi == NULL) && (Warn == true))
fprintf(stderr, "\n** WARNING : couldn't open '%s', (ignored) ...\n", filename);
return fi;
}
expfun c3po_bool existsFile(text filename)
{
FILE *fp = openR(filename);
if (fp != NULL)
{
fclose(fp);
return true;
}
else
return false;
}
expfun FILE * openW(text filename)
{
FILE *fo = fopen(filename, "w");
if (fo != NULL)
fprintf(stderr, "\n- generating '%s'\n", filename);
else
{
fprintf(stderr, "\n- couldn't open '%s', using stdout...\n", filename);
fo = stdout;
}
return fo;
}
expfun FILE * openWBackup(text filename,
c3po_bool Backup)
{
if ((existsFile(filename) == true) &&
(Backup == true))
{
char moveName[STRING_SIZE];
sprintf(moveName, "%s.tmp", filename);
int index = 1;
while(existsFile(moveName) == true)
{
sprintf(moveName, "%s.tmp%d", filename, index);
index = index + 1;
}
fprintf(stderr, "\n- existing file '%s' has been moved to '%s',", filename, moveName);
rename(filename, moveName);
}
return openW(filename);
}
expfun FILE * Append(text filename)
{
FILE *fo = fopen(filename, "a");
if (fo == NULL)
{
fprintf(stderr, "\n- couldn't append to '%s', using stdout...\n", filename);
fo = stdout;
}
return fo;
}
expfun void Close(FILE* fp)
{
if ((fp != NULL) &&
(fp != stdout) &&
(fp != stderr))
fclose(fp);
}
expfun unsigned long getFileSize(text filename)
{
struct stat s;
if (stat(filename, &s) == 0)
return (unsigned long) s.st_size;
else
return 0;
}
wcd-6.0.5/src/c3po/File.h 0000644 0001755 0001001 00000002345 14421240062 014230 0 ustar waterlan Geen #ifndef FILE_INCLUDED
#define FILE_INCLUDED
/*
Copyright (C) 1997-2000 Ondrej Popp
This code is generated with Ondrej Popp's C3PO.
This program is free software; you can redistribute it and/or
modify it under the terms of the GNU General Public License
as published by the Free Software Foundation; either version 2
of the License, or (at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software
Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
*/
extern FILE * openR(text filename);
extern FILE * openRwarn(text filename,
c3po_bool Warn);
extern c3po_bool existsFile(text filename);
extern FILE * openW(text filename);
extern FILE * openWBackup(text filename,
c3po_bool Backup);
extern FILE * Append(text filename);
extern void Close(FILE* fp);
extern unsigned long getFileSize(text filename);
#endif
wcd-6.0.5/src/c3po/Generate 0000755 0001755 0001001 00000001057 14421240062 014657 0 ustar waterlan Geen #c3po-latest wcd.G
c3po-0.19.5 wcd.G
# Solve conflicts with other definitions of type 'bool'. E.g. in (n)curses.
# Create 8.3 DOS filenames.
export list=`ls *.[chly]`
for i in $list
do
sed -e s/bool/c3po_bool/g -e s/beep/c3po_beep/g -e s/strings.h/string.h/ -e s/structures.h/structur.h/ -e s/std_macro.h/std_macr.h $i > $i.tmp
/bin/mv $i.tmp $i
done
/bin/rm *.tmp
/bin/mv structures.h structur.h
/bin/mv std_macro.h std_macr.h
sed -e s/structures.h/structur.h/ -e s/std_macro.h/std_macr.h Imakefile > Imakefile.tmp
/bin/mv Imakefile.tmp Imakefile
wcd-6.0.5/src/c3po/Imakefile 0000644 0001755 0001001 00000003102 14421240062 015001 0 ustar waterlan Geen /*
Copyright (C) 1997-2000 Ondrej Popp
This code is generated with Ondrej Popp's C3PO.
This program is free software; you can redistribute it and/or
modify it under the terms of the GNU General Public License
as published by the Free Software Foundation; either version 2
of the License, or (at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software
Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
*/
#define CONFIG_TOP
#include "Config.h"
#undef CONFIG_TOP
GEN_SRCS= \
Error.c \
Text.c \
Command.c \
File.c \
WcdStack.c \
dirnode.c \
nameset.c \
intset.c \
main.c
PROTECTED_SRCS= \
Usage.c
SRCS = $(GEN_SRCS) $(PROTECTED_SRCS) $(EXTRA_SRCS)
OBJS = $(SRCS:.c=.o)
GEN_HDRS = \
structur.h \
std_macr.h \
Error.h \
Text.h \
Command.h \
File.h \
WcdStack.h \
dirnode.h \
nameset.h \
intset.h \
Advance.h
PROTECTED_HDRS = \
Constants.h \
Usage.h \
Config.h
INCLUDE_FILES = $(GEN_HDRS) $(PROTECTED_HDRS)
TGTPATH = $(OBJDIR)
vpath %.o $(TGTPATH)
ComplexProgramTarget(wcd)
clean ::
rm -f wcd.y
rm -f wcd.l
rm -f $(GEN_SRCS) $(GEN_HDRS)
rm -f Imakefile
rm -f wcd_y.c wcd.output y.tab.c y.output
rm -f wcd_l.c wcd.h y.tab.h lex.yy.c
rm -f *.tmp* makefile Makefile
#define CONFIG_BOT
#include "Config.h"
#undef CONFIG_BOT
wcd-6.0.5/src/c3po/intset.c 0000644 0001755 0001001 00000014037 14421240062 014653 0 ustar waterlan Geen #include
#include
#include
#include "std_macr.h"
#include "structur.h"
#include "Error.h"
#include "intset.h"
/*
Copyright (C) 1997-2000 Ondrej Popp
This code is generated with Ondrej Popp's C3PO.
This program is free software; you can redistribute it and/or
modify it under the terms of the GNU General Public License
as published by the Free Software Foundation; either version 2
of the License, or (at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software
Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
*/
expfun intset intsetNew(void)
{
intset i = (intset) malloc (sizeof(intset_struct));
if (i != NULL)
{
i->array = NULL;
i->size = 0;
}
else
malloc_error("intsetNew()");
return i;
}
expfun intset copyIntset(intset src)
{
if (src == NULL)
return NULL;
else
{
intset i;
i = (intset) malloc (sizeof(intset_struct));
if (i != NULL)
{
i->array = NULL;
i->size = 0;
extendIntset(src, i);
}
else
malloc_error("copyIntset()");
return i;
}
}
expfun size_t* intsetGetArray(intset i)
{
if (i != NULL)
return i->array;
else
return NULL;
}
expfun c3po_bool intsetHasArray(intset i)
{
if (isEmptyIntset(i) == false)
return true;
else
return false;
}
expfun size_t getSizeOfIntset(intset i)
{
if (i != NULL)
return i->size;
else
return 0;
}
expfun void setSizeOfIntset(intset i,
size_t size)
{
if (i != NULL)
{
if (size == 0)
{
if (isEmptyIntset(i) eq false)
{
free((void *) i->array);
i->array = NULL;
i->size = 0;
}
}
else if (size ne i->size)
{
if (isEmptyIntset(i) eq true)
i->array = (size_t*) malloc(sizeof(size_t) * size);
else
i->array = (size_t*) realloc((void *) i->array, sizeof(size_t) * size);
if (i->array ne NULL)
{
size_t index = i->size;
while(index < size)
{
i->array[index] = 0;
index = index + 1;
}
i->size = size;
}
else
{
i->size = 0;
malloc_error("setSizeOfIntset(i, size)");
}
}
}
}
expfun c3po_bool isEmptyIntset(intset i)
{
if (getSizeOfIntset(i) > 0)
return false;
else
return true;
}
expfun void addToIntset(size_t i,
intset set)
{
if (set != NULL)
{
setSizeOfIntset(set, set->size + 1);
if (set->array != NULL)
set->array[set->size - 1] = i;
else
malloc_error("addToIntset()");
}
}
expfun void putElementAtIntset(size_t i,
size_t position,
intset set)
{
if (set != NULL)
{
if (position >= set->size)
setSizeOfIntset(set, position + 1);
if (set->array != NULL)
set->array[position] = i;
else
malloc_error("putElementAtIntset(i, position, set)");
}
}
expfun void insertElementAtIntset(size_t i,
size_t position,
intset set)
{
if (set != NULL)
{
size_t index = set->size;
while(index > position)
{
putElementAtIntset(set->array[index-1], index, set);
index = index - 1;
}
putElementAtIntset(i, position, set);
}
}
expfun void removeElementAtIntset(size_t position,
intset set)
{
if (set != NULL)
{
if (position < set->size)
{
size_t index = position + 1;
while(index < set->size)
{
putElementAtIntset(set->array[index], index - 1, set);
index = index + 1;
}
setSizeOfIntset(set, set->size - 1);
}
}
}
expfun size_t elementAtIntset(size_t position,
intset set)
{
if (set != NULL)
{
if (position < set->size)
return set->array[position];
}
return 0;
}
expfun void extendIntset(intset src,
intset dest)
{
if (src != NULL)
{
size_t index = 0;
while(index < src->size)
{
addToIntset(elementAtIntset(index, src), dest);
index = index + 1;
}
}
}
expfun void printIntset(text Offset,
intset i,
FILE* fp,
c3po_bool showEmpty)
{
text increment = " ";
text new_Offset = (text) malloc(sizeof(char) * (strlen(Offset) + strlen(increment) + 1));
if (new_Offset == NULL) {
fprintf(fp, "NULL\n");
return;
}
sprintf(new_Offset, "%s%s", Offset, increment);
if (i == NULL)
{
if (showEmpty == true)
{
fprintf(fp, "%s{\n", Offset);
fprintf(fp, "%sNULL\n", new_Offset);
fprintf(fp, "%s}\n", Offset);
}
}
else
{
fprintf(fp, "%s{\n", Offset);
if (i->array == NULL)
{
if (showEmpty == true)
fprintf(fp, "%sint array : NULL\n", new_Offset);
}
else
{
if ((isEmptyIntset(i) == false) || (showEmpty == true))
{
size_t index = 0;
fprintf(fp, "%sint size : %lu\n", new_Offset, (unsigned long)i->size);
while(index < i->size)
{
fprintf(fp, "%sint array[%lu] : %lu\n", new_Offset, (unsigned long)index, (unsigned long)i->array[index]);
index = index + 1;
}
}
}
fprintf(fp, "%s}\n", Offset);
}
free(new_Offset);
}
expfun void freeIntset(intset i)
{
if (i ne NULL)
{
free((void *) i);
}
}
wcd-6.0.5/src/c3po/intset.h 0000644 0001755 0001001 00000003743 14421240062 014662 0 ustar waterlan Geen #ifndef INTSET_INCLUDED
#define INTSET_INCLUDED
/*
Copyright (C) 1997-2000 Ondrej Popp
This code is generated with Ondrej Popp's C3PO.
This program is free software; you can redistribute it and/or
modify it under the terms of the GNU General Public License
as published by the Free Software Foundation; either version 2
of the License, or (at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software
Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
*/
extern intset intsetNew(void);
extern intset copyIntset(intset src);
extern size_t* intsetGetArray(intset i);
extern c3po_bool intsetHasArray(intset i);
extern size_t getSizeOfIntset(intset i);
extern void setSizeOfIntset(intset i,
size_t size);
extern c3po_bool isEmptyIntset(intset i);
extern void addToIntset(size_t i,
intset set);
extern void putElementAtIntset(size_t i,
size_t position,
intset set);
extern void insertElementAtIntset(size_t i,
size_t position,
intset set);
extern void removeElementAtIntset(size_t position,
intset set);
extern size_t elementAtIntset(size_t position,
intset set);
extern void extendIntset(intset src,
intset dest);
extern void printIntset(text Offset,
intset i,
FILE* fp,
c3po_bool showEmpty);
extern void freeIntset(intset i);
#endif
wcd-6.0.5/src/c3po/nameset.c 0000644 0001755 0001001 00000017014 14421240062 014777 0 ustar waterlan Geen #include
#include
#include
#include "std_macr.h"
#include "structur.h"
#include "Error.h"
#include "Text.h"
#include "nameset.h"
/*
Copyright (C) 1997-2000 Ondrej Popp
This code is generated with Ondrej Popp's C3PO.
This program is free software; you can redistribute it and/or
modify it under the terms of the GNU General Public License
as published by the Free Software Foundation; either version 2
of the License, or (at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software
Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
*/
expfun nameset namesetNew(void)
{
nameset n = (nameset) malloc (sizeof(nameset_struct));
if (n != NULL)
{
n->array = NULL;
n->size = 0;
}
else
malloc_error("namesetNew()");
return n;
}
expfun nameset copyNameset(nameset src,
c3po_bool Deep)
{
if (src == NULL)
return NULL;
else
{
nameset n;
n = (nameset) malloc (sizeof(nameset_struct));
if (n != NULL)
{
n->array = NULL;
n->size = 0;
if (Deep == true)
deepExtendNamesetArray(src, n);
else
extendNamesetArray(src, n);
}
else
malloc_error("copyNameset()");
return n;
}
}
expfun text* namesetGetArray(nameset n)
{
if (n != NULL)
return n->array;
else
return NULL;
}
expfun c3po_bool namesetHasArray(nameset n)
{
if (isEmptyNamesetArray(n) == false)
return true;
else
return false;
}
expfun size_t getSizeOfNamesetArray(nameset n)
{
if (n != NULL)
return n->size;
else
return 0;
}
expfun void setSizeOfNamesetArray(nameset n,
size_t size)
{
if (n != NULL)
{
if (size == 0)
{
if (isEmptyNamesetArray(n) eq false)
{
free((void *) n->array);
n->array = NULL;
n->size = 0;
}
}
else if (size ne n->size)
{
if (isEmptyNamesetArray(n) eq true)
n->array = (text*) malloc(sizeof(text) * size);
else
n->array = (text*) realloc((void *) n->array, sizeof(text) * size);
if (n->array ne NULL)
{
size_t index = n->size;
while(index < size)
{
n->array[index] = NULL;
index = index + 1;
}
n->size = size;
}
else
{
n->size = 0;
malloc_error("setSizeOfNamesetArray(n, size)");
}
}
}
}
expfun c3po_bool isEmptyNamesetArray(nameset n)
{
if (getSizeOfNamesetArray(n) > 0)
return false;
else
return true;
}
expfun void addToNamesetArray(text t,
nameset set)
{
if (set != NULL)
{
setSizeOfNamesetArray(set, set->size + 1);
if (set->array != NULL)
set->array[set->size - 1] = t;
else
malloc_error("addToNamesetArray()");
}
}
expfun void putElementAtNamesetArray(text t,
size_t position,
nameset set)
{
if (set != NULL)
{
if (position >= set->size)
setSizeOfNamesetArray(set, position + 1);
if (set->array != NULL)
set->array[position] = t;
else
malloc_error("putElementAtNamesetArray(t, position, set)");
}
}
expfun void insertElementAtNamesetArray(text t,
size_t position,
nameset set)
{
if (set != NULL)
{
size_t index = set->size;
while(index > position)
{
putElementAtNamesetArray(set->array[index-1], index, set);
index = index - 1;
}
putElementAtNamesetArray(t, position, set);
}
}
expfun void removeElementAtNamesetArray(size_t position,
nameset set,
c3po_bool FreeAtPos)
{
if (set != NULL)
{
if (position < set->size)
{
size_t index;
if (FreeAtPos eq true)
{
if (set->array[position] ne NULL)
free((void *) set->array[position]);
}
index = position + 1;
while(index < set->size)
{
putElementAtNamesetArray(set->array[index], index - 1, set);
index = index + 1;
}
setSizeOfNamesetArray(set, set->size - 1);
}
}
}
expfun text elementAtNamesetArray(size_t position,
nameset set)
{
if (set != NULL)
{
if (position < set->size)
return set->array[position];
}
return NULL;
}
expfun void extendNamesetArray(nameset src,
nameset dest)
{
if (src != NULL)
{
size_t index = 0;
while(index < src->size)
{
addToNamesetArray(elementAtNamesetArray(index, src), dest);
index = index + 1;
}
}
}
expfun void deepExtendNamesetArray(nameset src,
nameset dest)
{
if (src != NULL)
{
size_t index = 0;
while(index < src->size)
{
addToNamesetArray(textNew(elementAtNamesetArray(index, src)), dest);
index = index + 1;
}
}
}
expfun void printNameset(text Offset,
nameset n,
FILE* fp,
c3po_bool showEmpty)
{
text increment = " ";
text new_Offset = (text) malloc(sizeof(char) * (strlen(Offset) + strlen(increment) + 1));
if (new_Offset == NULL) {
fprintf(fp, "NULL\n");
return;
}
sprintf(new_Offset, "%s%s", Offset, increment);
if (n == NULL)
{
if (showEmpty == true)
{
fprintf(fp, "%s{\n", Offset);
fprintf(fp, "%sNULL\n", new_Offset);
fprintf(fp, "%s}\n", Offset);
}
}
else
{
fprintf(fp, "%s{\n", Offset);
if (n->array == NULL)
{
if (showEmpty == true)
fprintf(fp, "%stext array : NULL\n", new_Offset);
}
else
{
if ((isEmptyNamesetArray(n) == false) || (showEmpty == true))
{
size_t index;
fprintf(fp, "%sint size : %lu\n", new_Offset, (unsigned long)n->size);
index = 0;
while(index < n->size)
{
if (n->array[index] ne NULL)
fprintf(fp, "%stext array[%lu] : %s\n", new_Offset, (unsigned long)index, n->array[index]);
else if (showEmpty == true)
fprintf(fp, "%stext array[%lu] : NULL\n", new_Offset, (unsigned long)index);
index = index + 1;
}
}
}
fprintf(fp, "%s}\n", Offset);
}
free(new_Offset);
}
expfun void freeNameset(nameset n,
c3po_bool Deep)
{
if (n ne NULL)
{
if (Deep eq true)
{
size_t index = 0;
while(index < n->size)
{
if (n->array[index] ne NULL)
free((void *) n->array[index]);
index = index + 1;
}
}
if (n->array ne NULL)
{
free((void *) n->array);
n->array = NULL;
n->size = 0;
}
free((void *) n);
}
}
wcd-6.0.5/src/c3po/nameset.h 0000644 0001755 0001001 00000004543 14421240062 015007 0 ustar waterlan Geen #ifndef NAMESET_INCLUDED
#define NAMESET_INCLUDED
/*
Copyright (C) 1997-2000 Ondrej Popp
This code is generated with Ondrej Popp's C3PO.
This program is free software; you can redistribute it and/or
modify it under the terms of the GNU General Public License
as published by the Free Software Foundation; either version 2
of the License, or (at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software
Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
*/
extern nameset namesetNew(void);
extern nameset copyNameset(nameset src,
c3po_bool Deep);
extern text* namesetGetArray(nameset n);
extern c3po_bool namesetHasArray(nameset n);
extern size_t getSizeOfNamesetArray(nameset n);
extern void setSizeOfNamesetArray(nameset n,
size_t size);
extern c3po_bool isEmptyNamesetArray(nameset n);
extern void addToNamesetArray(text t,
nameset set);
extern void putElementAtNamesetArray(text t,
size_t position,
nameset set);
extern void insertElementAtNamesetArray(text t,
size_t position,
nameset set);
extern void removeElementAtNamesetArray(size_t position,
nameset set,
c3po_bool FreeAtPos);
extern text elementAtNamesetArray(size_t position,
nameset set);
extern void extendNamesetArray(nameset src,
nameset dest);
extern void deepExtendNamesetArray(nameset src,
nameset dest);
extern void printNameset(text Offset,
nameset n,
FILE* fp,
c3po_bool showEmpty);
extern void freeNameset(nameset n,
c3po_bool Deep);
#endif
wcd-6.0.5/src/c3po/namesetw.c 0000644 0001755 0001001 00000016725 14421240062 015176 0 ustar waterlan Geen #include
#include
#include
#include "std_macr.h"
#include "structur.h"
#include "Error.h"
#include "Textw.h"
#include "namesetw.h"
/*
Copyright (C) 1997-2000 Ondrej Popp
This code is generated with Ondrej Popp's C3PO.
This program is free software; you can redistribute it and/or
modify it under the terms of the GNU General Public License
as published by the Free Software Foundation; either version 2
of the License, or (at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software
Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
*/
expfun namesetw namesetwNew(void)
{
namesetw n = (namesetw) malloc (sizeof(namesetw_struct));
if (n != NULL)
{
n->array = NULL;
n->size = 0;
}
else
malloc_error("namesetwNew()");
return n;
}
expfun namesetw copyNamesetw(namesetw src,
c3po_bool Deep)
{
if (src == NULL)
return NULL;
else
{
namesetw n;
n = (namesetw) malloc (sizeof(namesetw_struct));
if (n != NULL)
{
n->array = NULL;
n->size = 0;
if (Deep == true)
deepExtendNamesetwArray(src, n);
else
extendNamesetwArray(src, n);
}
else
malloc_error("copyNamesetw()");
return n;
}
}
expfun textw* namesetwGetArray(namesetw n)
{
if (n != NULL)
return n->array;
else
return NULL;
}
expfun c3po_bool namesetwHasArray(namesetw n)
{
if (isEmptyNamesetwArray(n) == false)
return true;
else
return false;
}
expfun size_t getSizeOfNamesetwArray(namesetw n)
{
if (n != NULL)
return n->size;
else
return 0;
}
expfun void setSizeOfNamesetwArray(namesetw n,
size_t size)
{
if (n != NULL)
{
if (size == 0)
{
if (isEmptyNamesetwArray(n) eq false)
{
free((void *) n->array);
n->array = NULL;
n->size = 0;
}
}
else if (size ne n->size)
{
if (isEmptyNamesetwArray(n) eq true)
n->array = (textw*) malloc(sizeof(textw) * size);
else
n->array = (textw*) realloc((void *) n->array, sizeof(textw) * size);
if (n->array ne NULL)
{
size_t index = n->size;
while(index < size)
{
n->array[index] = NULL;
index = index + 1;
}
n->size = size;
}
else
{
n->size = 0;
malloc_error("setSizeOfNamesetwArray(n, size)");
}
}
}
}
expfun c3po_bool isEmptyNamesetwArray(namesetw n)
{
if (getSizeOfNamesetwArray(n) > 0)
return false;
else
return true;
}
expfun void addToNamesetwArray(textw t,
namesetw set)
{
if (set != NULL)
{
setSizeOfNamesetwArray(set, set->size + 1);
if (set->array != NULL)
set->array[set->size - 1] = t;
else
malloc_error("addToNamesetwArray()");
}
}
expfun void putElementAtNamesetwArray(textw t,
size_t position,
namesetw set)
{
if (set != NULL)
{
if (position >= set->size)
setSizeOfNamesetwArray(set, position + 1);
if (set->array != NULL)
set->array[position] = t;
else
malloc_error("putElementAtNamesetwArray(t, position, set)");
}
}
expfun void insertElementAtNamesetwArray(textw t,
size_t position,
namesetw set)
{
if (set != NULL)
{
size_t index = set->size;
while(index > position)
{
putElementAtNamesetwArray(set->array[index-1], index, set);
index = index - 1;
}
putElementAtNamesetwArray(t, position, set);
}
}
expfun void removeElementAtNamesetwArray(size_t position,
namesetw set,
c3po_bool FreeAtPos)
{
if (set != NULL)
{
if (position < set->size)
{
if (FreeAtPos eq true)
{
if (set->array[position] ne NULL)
free((void *) set->array[position]);
}
size_t index = position + 1;
while(index < set->size)
{
putElementAtNamesetwArray(set->array[index], index - 1, set);
index = index + 1;
}
setSizeOfNamesetwArray(set, set->size - 1);
}
}
}
expfun textw elementAtNamesetwArray(size_t position,
namesetw set)
{
if (set != NULL)
{
if (position < set->size)
return set->array[position];
}
return NULL;
}
expfun void extendNamesetwArray(namesetw src,
namesetw dest)
{
if (src != NULL)
{
size_t index = 0;
while(index < src->size)
{
addToNamesetwArray(elementAtNamesetwArray(index, src), dest);
index = index + 1;
}
}
}
expfun void deepExtendNamesetwArray(namesetw src,
namesetw dest)
{
if (src != NULL)
{
size_t index = 0;
while(index < src->size)
{
addToNamesetwArray(textwNew(elementAtNamesetwArray(index, src)), dest);
index = index + 1;
}
}
}
expfun void printNamesetw(textw Offset,
namesetw n,
FILE* fp,
c3po_bool showEmpty)
{
textw increment = L" ";
textw new_Offset = (textw) malloc(sizeof(char) * (wcslen(Offset) + wcslen(increment) + 1));
swprintf(new_Offset, L"%s%s", Offset, increment);
if (n == NULL)
{
if (showEmpty == true)
{
fwprintf(fp, L"%s{\n", Offset);
fwprintf(fp, L"%sNULL\n", new_Offset);
fwprintf(fp, L"%s}\n", Offset);
}
}
else
{
fwprintf(fp, L"%s{\n", Offset);
if (n->array == NULL)
{
if (showEmpty == true)
fwprintf(fp, L"%stextw array : NULL\n", new_Offset);
}
else
{
if ((isEmptyNamesetwArray(n) == false) || (showEmpty == true))
{
fwprintf(fp, L"%sint size : %zu\n", new_Offset, n->size);
size_t index = 0;
while(index < n->size)
{
if (n->array[index] ne NULL)
fwprintf(fp, L"%stextw array[%zu] : %s\n", new_Offset, index, n->array[index]);
else if (showEmpty == true)
fwprintf(fp, L"%stextw array[%zu] : NULL\n", new_Offset, index);
index = index + 1;
}
}
}
fwprintf(fp, L"%s}\n", Offset);
}
free(new_Offset);
}
expfun void freeNamesetw(namesetw n,
c3po_bool Deep)
{
if (n ne NULL)
{
if (Deep eq true)
{
size_t index = 0;
while(index < n->size)
{
if (n->array[index] ne NULL)
free((void *) n->array[index]);
index = index + 1;
}
}
if (n->array ne NULL)
{
free((void *) n->array);
n->array = NULL;
n->size = 0;
}
free((void *) n);
}
}
wcd-6.0.5/src/c3po/namesetw.h 0000644 0001755 0001001 00000004614 14421240062 015175 0 ustar waterlan Geen #ifndef NAMESET_INCLUDED
#define NAMESET_INCLUDED
/*
Copyright (C) 1997-2000 Ondrej Popp
This code is generated with Ondrej Popp's C3PO.
This program is free software; you can redistribute it and/or
modify it under the terms of the GNU General Public License
as published by the Free Software Foundation; either version 2
of the License, or (at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software
Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
*/
extern namesetw namesetwNew(void);
extern namesetw copyNamesetw(namesetw src,
c3po_bool Deep);
extern textw* namesetwGetArray(namesetw n);
extern c3po_bool namesetwHasArray(namesetw n);
extern size_t getSizeOfNamesetwArray(namesetw n);
extern void setSizeOfNamesetwArray(namesetw n,
size_t size);
extern c3po_bool isEmptyNamesetwArray(namesetw n);
extern void addToNamesetwArray(textw t,
namesetw set);
extern void putElementAtNamesetwArray(textw t,
size_t position,
namesetw set);
extern void insertElementAtNamesetwArray(textw t,
size_t position,
namesetw set);
extern void removeElementAtNamesetwArray(size_t position,
namesetw set,
c3po_bool FreeAtPos);
extern textw elementAtNamesetwArray(size_t position,
namesetw set);
extern void extendNamesetwArray(namesetw src,
namesetw dest);
extern void deepExtendNamesetwArray(namesetw src,
namesetw dest);
extern void printNamesetw(textw Offset,
namesetw n,
FILE* fp,
c3po_bool showEmpty);
extern void freeNamesetw(namesetw n,
c3po_bool Deep);
#endif
wcd-6.0.5/src/c3po/README 0000644 0001755 0001001 00000000453 14421240062 014056 0 ustar waterlan Geen All source files in this directory have been generated with C3PO 0.19.5 from grammar input
file 'wcd.G'.
Only datastructures and APIs for it are generated.
No parser generated.
Shell script 'Generate' is used to run C3PO.
More information about C3PO is at https://sourceforge.net/projects/c3po/
wcd-6.0.5/src/c3po/std_macr.h 0000644 0001755 0001001 00000004725 14421240062 015151 0 ustar waterlan Geen #ifndef STD_MACRO_INCLUDED
#define STD_MACRO_INCLUDED
/*
Copyright (C) 1997-2000 Ondrej Popp
This code is generated with Ondrej Popp's C3PO.
This program is free software; you can redistribute it and/or
modify it under the terms of the GNU General Public License
as published by the Free Software Foundation; either version 2
of the License, or (at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software
Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
*/
#define eq == /* Logical 'equals' */
#define ne != /* Logical inequality */
#define not ! /* Logical 'NOT' */
#define bnot ~ /* Bitwise 'NOT' (one's complement) */
#define cand && /* Conditional 'AND' */
#define and && /* Logical 'AND' */
#define band & /* Bitwise 'AND' */
#define cor || /* Conditional 'OR' */
#define or || /* Logical 'OR' */
#define bor | /* Bitwise 'OR' */
#define bxor ^ /* Bitwise exclusive 'OR' */
/* Definition of 'mod' gives problems with WinBase.h (MS Visual C++) */
/*#define mod % Remainder operator */
#ifndef NULL
#define NULL 0 /* Null pointer */
#endif
#ifndef EOF
#define EOF -1 /* end of file */
#endif
#define true 1
#define false 0
#define expvar /* export variable */
#define expfun /* export function */
#ifdef __cplusplus
#define c3po_bool _c3po_bool
#endif
typedef int c3po_bool; /* pseudo c3po_boolean */
#ifdef SETTRACE
#define TRACE(x) x
#else
#define TRACE(x)
#endif
#endif
wcd-6.0.5/src/c3po/structur.h 0000644 0001755 0001001 00000003451 14421240062 015243 0 ustar waterlan Geen #ifndef STRUCTURES_INCLUDED
#define STRUCTURES_INCLUDED
/*
Copyright (C) 1997-2000 Ondrej Popp
This code is generated with Ondrej Popp's C3PO.
This program is free software; you can redistribute it and/or
modify it under the terms of the GNU General Public License
as published by the Free Software Foundation; either version 2
of the License, or (at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software
Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
*/
#ifdef WCD_UNICODE
#include
#endif
#ifndef C3PO_BASIC_TYPES_INCLUDED
#define C3PO_BASIC_TYPES_INCLUDED
typedef char *text;
typedef struct nameset_struct
{
text *array;
size_t size;
} nameset_struct, *nameset;
typedef struct intset_struct
{
size_t *array;
size_t size;
} intset_struct, *intset;
#endif
typedef struct WcdStack_struct
{
int maxsize;
int lastadded;
int current;
text *dir;
size_t size;
} WcdStack_struct, *WcdStack;
typedef struct dirnode_struct
{
text name;
int x;
int y;
struct dirnode_struct *parent;
struct dirnode_struct **subdirs;
size_t size;
struct dirnode_struct *up;
struct dirnode_struct *down;
c3po_bool fold;
} dirnode_struct, *dirnode;
#ifdef WCD_UNICODE
typedef wchar_t *textw;
typedef struct namesetw_struct
{
textw *array;
size_t size;
} namesetw_struct, *namesetw;
#endif
#endif
wcd-6.0.5/src/c3po/Text.c 0000644 0001755 0001001 00000013011 14421240062 014260 0 ustar waterlan Geen /*
Copyright (C) 1997-2000 Ondrej Popp
This code is generated with Ondrej Popp's C3PO.
This program is free software; you can redistribute it and/or
modify it under the terms of the GNU General Public License
as published by the Free Software Foundation; either version 2
of the License, or (at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software
Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
*/
#include
#include
#include
#include "std_macr.h"
#include "structur.h"
#include "Error.h"
#include "nameset.h"
#include "intset.h"
expfun text textNewSize(size_t size)
{
text t = NULL;
if (size > 0)
{
t = (text) malloc (sizeof(char) * size);
if (t eq NULL)
malloc_error("textNewSize(size)");
}
return t;
}
expfun text textNew(text string)
{
text t = NULL;
if (string ne NULL)
{
t = textNewSize(strlen(string) + 1);
if (t ne NULL)
strcpy(t, string);
else
malloc_error("textNew(text)");
}
return t;
}
expfun c3po_bool eqText(text a,
text b)
{
if ((a eq NULL) or (b eq NULL))
return false;
else if (strcmp(a, b) eq 0)
return true;
else
return false;
}
expfun size_t inNameset(text name,
nameset set)
{
if (isEmptyNamesetArray(set) eq false)
{
size_t index = 0;
while(index < getSizeOfNamesetArray(set))
{
if (eqText(name, elementAtNamesetArray(index, set)) eq true)
return index;
index = index + 1;
}
}
return (size_t)-1;
}
expfun intset matchNameset(text name,
nameset set)
{
static intset i_set = NULL;
if (i_set eq NULL)
i_set = intsetNew();
else
setSizeOfIntset(i_set, (size_t)0);
if (isEmptyNamesetArray(set) eq false)
{
size_t index = 0;
while(index < getSizeOfNamesetArray(set))
{
if (eqText(name, elementAtNamesetArray(index, set)) eq true)
addToIntset(index, i_set);
index = index + 1;
}
}
return i_set;
}
expfun size_t matchCountNameset(text name,
nameset set)
{
size_t count = 0;
if (isEmptyNamesetArray(set) eq false)
{
size_t index = 0;
while(index < getSizeOfNamesetArray(set))
{
if (eqText(name, elementAtNamesetArray(index, set)) eq true)
count = count + 1;
index = index + 1;
}
}
return count;
}
expfun text concat(text a,
text b)
{
text res = (text) malloc(sizeof(char) * (strlen(a) + strlen(b) + 1));
if (res ne NULL)
{
strcpy(res, a);
strcpy(res + strlen(res), b);
}
else
malloc_error("concat()");
return res;
}
expfun text concat3(text a,
text b,
text c)
{
text res = (text) malloc(sizeof(char) * (strlen(a) + strlen(b) + strlen(c) + 1));
if (res ne NULL)
{
strcpy(res, a);
strcpy(res + strlen(res), b);
strcpy(res + strlen(res), c);
}
else
malloc_error("concat3()");
return res;
}
expfun text concat4(text a,
text b,
text c,
text d)
{
text res = (text) malloc(sizeof(char) * (strlen(a) + strlen(b) + strlen(c) + strlen(d) + 1));
if (res ne NULL)
{
strcpy(res, a);
strcpy(res + strlen(res), b);
strcpy(res + strlen(res), c);
strcpy(res + strlen(res), d);
}
else
malloc_error("concat4()");
return res;
}
expfun text repeatOnBuffer(text pattern,
size_t amount,
size_t bufferNr)
{
size_t count = 0;
static nameset buffers = NULL;
text buffer;
if (buffers eq NULL)
buffers = namesetNew();
buffer = elementAtNamesetArray(bufferNr, buffers);
if (buffer eq NULL)
buffer = textNewSize(strlen(pattern) * amount + 1);
else {
text new_buffer = (text) realloc((void *) buffer, sizeof(char) * (strlen(pattern) * amount + 1));
if (new_buffer != NULL)
buffer = new_buffer;
else {
malloc_error("repeatOnBuffer()");
buffer = NULL;
}
}
if (buffer == NULL)
return NULL;
putElementAtNamesetArray(buffer, bufferNr, buffers);
buffer[0] = '\0';
while(count < amount)
{
strcpy(buffer + strlen(buffer), pattern);
count = count + 1;
}
return buffer;
}
expfun text repeat(text pattern,
size_t amount)
{
return repeatOnBuffer(pattern, amount, (size_t)0);
}
expfun text spacesOnBuffer(size_t amount,
size_t bufferNr)
{
return repeatOnBuffer(" ", amount, bufferNr);
}
expfun text spaces(size_t amount)
{
return spacesOnBuffer(amount, (size_t)0);
}
expfun text TabOnBuffer(size_t amount,
size_t bufferNr)
{
size_t tabSize = 3;
return spacesOnBuffer(tabSize*amount, bufferNr);
}
expfun text Tab(size_t amount)
{
return TabOnBuffer(amount, (size_t)0);
}
expfun text intToString(int i)
{
char buffer[100];
sprintf(buffer, "%d", i);
return textNew(buffer);
}
expfun text doubleToString(double d)
{
char buffer[100];
sprintf(buffer, "%g", d);
return textNew(buffer);
}
wcd-6.0.5/src/c3po/Text.h 0000644 0001755 0001001 00000003773 14421240062 014303 0 ustar waterlan Geen #ifndef TEXT_INCLUDED
#define TEXT_INCLUDED
/*
Copyright (C) 1997-2000 Ondrej Popp
This code is generated with Ondrej Popp's C3PO.
This program is free software; you can redistribute it and/or
modify it under the terms of the GNU General Public License
as published by the Free Software Foundation; either version 2
of the License, or (at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software
Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
*/
extern text textNewSize(size_t size);
extern text textNew(text string);
extern c3po_bool eqText(text a,
text b);
extern size_t inNameset(text name,
nameset set);
extern intset matchNameset(text name,
nameset set);
extern size_t matchCountNameset(text name,
nameset set);
extern text concat(text a,
text b);
extern text concat3(text a,
text b,
text c);
extern text concat4(text a,
text b,
text c,
text d);
extern text repeatOnBuffer(text pattern,
size_t amount,
size_t bufferNr);
extern text repeat(text pattern,
size_t amount);
extern text spacesOnBuffer(size_t amount,
size_t bufferNr);
extern text spaces(size_t amount);
extern text TabOnBuffer(size_t amount,
size_t bufferNr);
extern text Tab(size_t amount);
extern text intToString(int i);
extern text doubleToString(double d);
#endif
wcd-6.0.5/src/c3po/Textw.c 0000644 0001755 0001001 00000013201 14421240062 014450 0 ustar waterlan Geen /*
Copyright (C) 1997-2000 Ondrej Popp
This code is generated with Ondrej Popp's C3PO.
This program is free software; you can redistribute it and/or
modify it under the terms of the GNU General Public License
as published by the Free Software Foundation; either version 2
of the License, or (at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software
Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
*/
#include
#include
#include
#include "std_macr.h"
#include "structur.h"
#include "Error.h"
#include "namesetw.h"
#include "intset.h"
expfun textw textwNewSize(size_t size)
{
textw t = NULL;
if (size > 0)
{
t = (textw) malloc (sizeof(wchar_t) * size);
if (t eq NULL)
malloc_error("textwNewSize(size)");
}
return t;
}
expfun textw textwNew(textw string)
{
textw t = NULL;
if (string ne NULL)
{
t = textwNewSize(wcslen(string) + 1);
if (t ne NULL)
wcscpy(t, string);
else
malloc_error("textwNew(textw)");
}
return t;
}
expfun c3po_bool eqTextw(textw a,
textw b)
{
if ((a eq NULL) or (b eq NULL))
return false;
else if (wcscmp(a, b) eq 0)
return true;
else
return false;
}
expfun size_t inNamesetw(textw name,
namesetw set)
{
if (isEmptyNamesetwArray(set) eq false)
{
size_t index = 0;
while(index < getSizeOfNamesetwArray(set))
{
if (eqTextw(name, elementAtNamesetwArray(index, set)) eq true)
return index;
index = index + 1;
}
}
return (size_t)-1;
}
expfun intset matchNamesetw(textw name,
namesetw set)
{
static intset i_set = NULL;
if (i_set eq NULL)
i_set = intsetNew();
else
setSizeOfIntset(i_set, (size_t)0);
if (isEmptyNamesetwArray(set) eq false)
{
size_t index = 0;
while(index < getSizeOfNamesetwArray(set))
{
if (eqTextw(name, elementAtNamesetwArray(index, set)) eq true)
addToIntset(index, i_set);
index = index + 1;
}
}
return i_set;
}
expfun size_t matchCountNamesetw(textw name,
namesetw set)
{
size_t count = 0;
if (isEmptyNamesetwArray(set) eq false)
{
size_t index = 0;
while(index < getSizeOfNamesetwArray(set))
{
if (eqTextw(name, elementAtNamesetwArray(index, set)) eq true)
count = count + 1;
index = index + 1;
}
}
return count;
}
expfun textw concatw(textw a,
textw b)
{
textw res = (textw) malloc(sizeof(wchar_t) * (wcslen(a) + wcslen(b) + 1));
if (res ne NULL)
{
wcscpy(res, a);
wcscpy(res + wcslen(res), b);
}
else
malloc_error("concatw()");
return res;
}
expfun textw concatw3(textw a,
textw b,
textw c)
{
textw res = (textw) malloc(sizeof(wchar_t) * (wcslen(a) + wcslen(b) + wcslen(c) + 1));
if (res ne NULL)
{
wcscpy(res, a);
wcscpy(res + wcslen(res), b);
wcscpy(res + wcslen(res), c);
}
else
malloc_error("concatw3()");
return res;
}
expfun textw concatw4(textw a,
textw b,
textw c,
textw d)
{
textw res = (textw) malloc(sizeof(wchar_t) * (wcslen(a) + wcslen(b) + wcslen(c) + wcslen(d) + 1));
if (res ne NULL)
{
wcscpy(res, a);
wcscpy(res + wcslen(res), b);
wcscpy(res + wcslen(res), c);
wcscpy(res + wcslen(res), d);
}
else
malloc_error("concatw4()");
return res;
}
expfun textw repeatOnBufferw(textw pattern,
size_t amount,
size_t bufferNr)
{
size_t count = 0;
static namesetw buffers = NULL;
textw buffer;
if (buffers eq NULL)
buffers = namesetwNew();
buffer = elementAtNamesetwArray(bufferNr, buffers);
if (buffer eq NULL)
buffer = textwNewSize(wcslen(pattern) * amount + 1);
else {
textw new_buffer = (textw) realloc((void *) buffer, sizeof(wchar_t) * (wcslen(pattern) * amount + 1));
if (new_buffer != NULL)
buffer = new_buffer;
else {
malloc_error("repeatOnBufferw()");
buffer = NULL;
}
}
if (buffer == NULL)
return NULL;
putElementAtNamesetwArray(buffer, bufferNr, buffers);
buffer[0] = '\0';
while(count < amount)
{
wcscpy(buffer + wcslen(buffer), pattern);
count = count + 1;
}
return buffer;
}
expfun textw repeatw(textw pattern,
size_t amount)
{
return repeatOnBufferw(pattern, amount, (size_t)0);
}
expfun textw spacesOnBufferw(size_t amount,
size_t bufferNr)
{
return repeatOnBufferw(L" ", amount, bufferNr);
}
expfun textw spacesw(size_t amount)
{
return spacesOnBufferw(amount, (size_t)0);
}
expfun textw TabOnBufferw(size_t amount,
size_t bufferNr)
{
size_t tabSize = 3;
return spacesOnBufferw(tabSize*amount, bufferNr);
}
expfun textw Tabw(size_t amount)
{
return TabOnBufferw(amount, (size_t)0);
}
expfun textw intToStringw(int i)
{
wchar_t buffer[100];
swprintf(buffer, L"%d", i);
return textwNew(buffer);
}
expfun textw doubleToStringw(double d)
{
wchar_t buffer[100];
swprintf(buffer, L"%g", d);
return textwNew(buffer);
}
wcd-6.0.5/src/c3po/Textw.h 0000644 0001755 0001001 00000004055 14421240062 014464 0 ustar waterlan Geen #ifndef TEXT_INCLUDED
#define TEXT_INCLUDED
/*
Copyright (C) 1997-2000 Ondrej Popp
This code is generated with Ondrej Popp's C3PO.
This program is free software; you can redistribute it and/or
modify it under the terms of the GNU General Public License
as published by the Free Software Foundation; either version 2
of the License, or (at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software
Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
*/
extern textw textwNewSize(size_t size);
extern textw textwNew(textw string);
extern c3po_bool eqTextw(textw a,
textw b);
extern size_t inNamesetw(textw name,
namesetw set);
extern intset matchNamesetw(textw name,
namesetw set);
extern size_t matchCountNamesetw(textw name,
namesetw set);
extern textw concatw(textw a,
textw b);
extern textw concatw3(textw a,
textw b,
textw c);
extern textw concatw4(textw a,
textw b,
textw c,
textw d);
extern textw repeatOnBufferw(textw pattern,
size_t amount,
size_t bufferNr);
extern textw repeatw(textw pattern,
size_t amount);
extern textw spacesOnBufferw(size_t amount,
size_t bufferNr);
extern textw spacesw(size_t amount);
extern textw TabOnBufferw(size_t amount,
size_t bufferNr);
extern textw Tabw(size_t amount);
extern textw intToStringw(int i);
extern textw doubleToStringw(double d);
#endif
wcd-6.0.5/src/c3po/Usage.c 0000644 0001755 0001001 00000002312 14421240062 014402 0 ustar waterlan Geen /*
Copyright (C) 1997-2000 Ondrej Popp
This code is generated with Ondrej Popp's C3PO.
This program is free software; you can redistribute it and/or
modify it under the terms of the GNU General Public License
as published by the Free Software Foundation; either version 2
of the License, or (at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software
Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
*/
#include
#include
#include
#include "std_macr.h"
#include "structur.h"
#include "Text.h"
expfun void Usage(int argc,
char** argv)
{
fprintf(stderr, "Usage : %s options\n", argv[0]);
fprintf(stderr, " %s [options]\n", argv[0]);
fprintf(stderr, "Options,\n");
fprintf(stderr, "%s-d (debug)\n", Tab(1));
fprintf(stderr, "%s-showEmpty (show empty fields)\n", Tab(1));
}
wcd-6.0.5/src/c3po/Usage.h 0000644 0001755 0001001 00000001576 14421240062 014422 0 ustar waterlan Geen #ifndef USAGE_INCLUDED
#define USAGE_INCLUDED
/*
Copyright (C) 1997-2000 Ondrej Popp
This code is generated with Ondrej Popp's C3PO.
This program is free software; you can redistribute it and/or
modify it under the terms of the GNU General Public License
as published by the Free Software Foundation; either version 2
of the License, or (at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software
Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
*/
extern void Usage(int argc,
char** argv);
#endif
wcd-6.0.5/src/c3po/wcd.G 0000644 0001755 0001001 00000002242 14421240062 014061 0 ustar waterlan Geen include
{
prepend '/*\
Copyright (C) 1997-2000 Ondrej Popp\
This code is generated with Ondrej Popp\'s C3PO.\
\
This program is free software; you can redistribute it and/or\
modify it under the terms of the GNU General Public License\
as published by the Free Software Foundation; either version 2\
of the License, or (at your option) any later version.\
\
This program is distributed in the hope that it will be useful,\
but WITHOUT ANY WARRANTY; without even the implied warranty of\
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\
GNU General Public License for more details.\
\
You should have received a copy of the GNU General Public License\
along with this program; if not, write to the Free Software\
Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.\
\
*/'
}
maxsize
(int)->lastadded
(int)->current
((text)->dir)+
>;
/* recursive directory tree structure */
name
(int)->x
(int)->y
dirnode->parent &
(dirnode->subdirs)+
dirnode->up &
dirnode->down &
(bool)->fold
>;
wcd-6.0.5/src/c3po/WcdStack.c 0000644 0001755 0001001 00000021560 14421240062 015047 0 ustar waterlan Geen #include
#include
#include
#include "std_macr.h"
#include "structur.h"
#include "Error.h"
#include "Text.h"
#include "WcdStack.h"
/*
Copyright (C) 1997-2000 Ondrej Popp
This code is generated with Ondrej Popp's C3PO.
This program is free software; you can redistribute it and/or
modify it under the terms of the GNU General Public License
as published by the Free Software Foundation; either version 2
of the License, or (at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software
Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
*/
expfun WcdStack WcdStackNew(int maxsize)
{
WcdStack w = (WcdStack) malloc (sizeof(WcdStack_struct));
if (w != NULL)
{
w->maxsize = maxsize;
w->lastadded = 0;
w->current = 0;
w->dir = NULL;
w->size = 0;
}
else
malloc_error("WcdStackNew()");
return w;
}
expfun WcdStack copyWcdStack(WcdStack src,
c3po_bool Deep)
{
if (src == NULL)
return NULL;
else
{
WcdStack w;
w = (WcdStack) malloc (sizeof(WcdStack_struct));
if (w != NULL)
{
if (Deep == true)
{
w->maxsize = src->maxsize;
w->lastadded = src->lastadded;
w->current = src->current;
}
else
{
w->maxsize = src->maxsize;
w->lastadded = src->lastadded;
w->current = src->current;
}
w->dir = NULL;
w->size = 0;
if (Deep == true)
deepExtendWcdStackDir(src, w);
else
extendWcdStackDir(src, w);
}
else
malloc_error("copyWcdStack()");
return w;
}
}
expfun int WcdStackGetMaxsize(WcdStack w)
{
if (w != NULL)
return w->maxsize;
else
return 0;
}
expfun int WcdStackGetLastadded(WcdStack w)
{
if (w != NULL)
return w->lastadded;
else
return 0;
}
expfun int WcdStackGetCurrent(WcdStack w)
{
if (w != NULL)
return w->current;
else
return 0;
}
expfun text* WcdStackGetDir(WcdStack w)
{
if (w != NULL)
return w->dir;
else
return NULL;
}
expfun WcdStack WcdStackSetMaxsize(int maxsize,
WcdStack w)
{
if (w != NULL)
w->maxsize = maxsize;
return w;
}
expfun WcdStack WcdStackSetLastadded(int lastadded,
WcdStack w)
{
if (w != NULL)
w->lastadded = lastadded;
return w;
}
expfun WcdStack WcdStackSetCurrent(int current,
WcdStack w)
{
if (w != NULL)
w->current = current;
return w;
}
expfun c3po_bool WcdStackHasDir(WcdStack w)
{
if (isEmptyWcdStackDir(w) == false)
return true;
else
return false;
}
expfun size_t getSizeOfWcdStackDir(WcdStack w)
{
if (w != NULL)
return w->size;
else
return 0;
}
expfun void setSizeOfWcdStackDir(WcdStack w,
size_t size)
{
if (w != NULL)
{
if (size == 0)
{
if (isEmptyWcdStackDir(w) eq false)
{
free((void *) w->dir);
w->dir = NULL;
w->size = 0;
}
}
else if (size ne w->size)
{
if (isEmptyWcdStackDir(w) eq true)
w->dir = (text*) malloc(sizeof(text) * size);
else
w->dir = (text*) realloc((void *) w->dir, sizeof(text) * size);
if (w->dir ne NULL)
{
size_t index = w->size;
while(index < size)
{
w->dir[index] = NULL;
index = index + 1;
}
w->size = size;
}
else
{
w->size = 0;
malloc_error("setSizeOfWcdStackDir(w, size)");
}
}
}
}
expfun c3po_bool isEmptyWcdStackDir(WcdStack w)
{
if (getSizeOfWcdStackDir(w) > 0)
return false;
else
return true;
}
expfun void addToWcdStackDir(text t,
WcdStack set)
{
if (set != NULL)
{
setSizeOfWcdStackDir(set, set->size + 1);
if (set->dir != NULL)
set->dir[set->size - 1] = t;
else
malloc_error("addToWcdStackDir()");
}
}
expfun void putElementAtWcdStackDir(text t,
size_t position,
WcdStack set)
{
if (set != NULL)
{
if (position >= set->size)
setSizeOfWcdStackDir(set, position + 1);
if (set->dir != NULL)
set->dir[position] = t;
else
malloc_error("putElementAtWcdStackDir(t, position, set)");
}
}
expfun void insertElementAtWcdStackDir(text t,
size_t position,
WcdStack set)
{
if (set != NULL)
{
size_t index = set->size;
while(index > position)
{
putElementAtWcdStackDir(set->dir[index-1], index, set);
index = index - 1;
}
putElementAtWcdStackDir(t, position, set);
}
}
expfun void removeElementAtWcdStackDir(size_t position,
WcdStack set,
c3po_bool FreeAtPos)
{
if (set != NULL)
{
if (position < set->size)
{
size_t index;
if (FreeAtPos eq true)
{
if (set->dir[position] ne NULL)
free((void *) set->dir[position]);
}
index = position + 1;
while(index < set->size)
{
putElementAtWcdStackDir(set->dir[index], index - 1, set);
index = index + 1;
}
setSizeOfWcdStackDir(set, set->size - 1);
}
}
}
expfun text elementAtWcdStackDir(size_t position,
WcdStack set)
{
if (set != NULL)
{
if (position < set->size)
return set->dir[position];
}
return NULL;
}
expfun void extendWcdStackDir(WcdStack src,
WcdStack dest)
{
if (src != NULL)
{
size_t index = 0;
while(index < src->size)
{
addToWcdStackDir(elementAtWcdStackDir(index, src), dest);
index = index + 1;
}
}
}
expfun void deepExtendWcdStackDir(WcdStack src,
WcdStack dest)
{
if (src != NULL)
{
size_t index = 0;
while(index < src->size)
{
addToWcdStackDir(textNew(elementAtWcdStackDir(index, src)), dest);
index = index + 1;
}
}
}
expfun void printWcdStack(text Offset,
WcdStack w,
FILE* fp,
c3po_bool showEmpty)
{
text increment = " ";
text new_Offset = (text) malloc(sizeof(char) * (strlen(Offset) + strlen(increment) + 1));
if (new_Offset == NULL) {
fprintf(fp, "NULL\n");
return;
}
sprintf(new_Offset, "%s%s", Offset, increment);
if (w == NULL)
{
if (showEmpty == true)
{
fprintf(fp, "%s{\n", Offset);
fprintf(fp, "%sNULL\n", new_Offset);
fprintf(fp, "%s}\n", Offset);
}
}
else
{
fprintf(fp, "%s{\n", Offset);
fprintf(fp, "%sint maxsize : %d\n", new_Offset, w->maxsize);
fprintf(fp, "%sint lastadded : %d\n", new_Offset, w->lastadded);
fprintf(fp, "%sint current : %d\n", new_Offset, w->current);
if (w->dir == NULL)
{
if (showEmpty == true)
fprintf(fp, "%stext dir : NULL\n", new_Offset);
}
else
{
if ((isEmptyWcdStackDir(w) == false) || (showEmpty == true))
{
size_t index;
fprintf(fp, "%sint size : %lu\n", new_Offset, (unsigned long)w->size);
index = 0;
while(index < w->size)
{
if (w->dir[index] ne NULL)
fprintf(fp, "%stext dir[%lu] : %s\n", new_Offset, (unsigned long)index, w->dir[index]);
else if (showEmpty == true)
fprintf(fp, "%stext dir[%lu] : NULL\n", new_Offset, (unsigned long)index);
index = index + 1;
}
}
}
fprintf(fp, "%s}\n", Offset);
}
free(new_Offset);
}
expfun void freeWcdStack(WcdStack w,
c3po_bool Deep)
{
if (w ne NULL)
{
if (Deep eq true)
{
size_t index = 0;
while(index < w->size)
{
if (w->dir[index] ne NULL)
free((void *) w->dir[index]);
index = index + 1;
}
}
if (w->dir ne NULL)
{
free((void *) w->dir);
w->dir = NULL;
w->size = 0;
}
free((void *) w);
}
}
wcd-6.0.5/src/c3po/WcdStack.h 0000644 0001755 0001001 00000005466 14421240062 015063 0 ustar waterlan Geen #ifndef WCDSTACK_INCLUDED
#define WCDSTACK_INCLUDED
/*
Copyright (C) 1997-2000 Ondrej Popp
This code is generated with Ondrej Popp's C3PO.
This program is free software; you can redistribute it and/or
modify it under the terms of the GNU General Public License
as published by the Free Software Foundation; either version 2
of the License, or (at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software
Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
*/
extern WcdStack WcdStackNew(int maxsize);
extern WcdStack copyWcdStack(WcdStack src,
c3po_bool Deep);
extern int WcdStackGetMaxsize(WcdStack w);
extern int WcdStackGetLastadded(WcdStack w);
extern int WcdStackGetCurrent(WcdStack w);
extern text* WcdStackGetDir(WcdStack w);
extern WcdStack WcdStackSetMaxsize(int maxsize,
WcdStack w);
extern WcdStack WcdStackSetLastadded(int lastadded,
WcdStack w);
extern WcdStack WcdStackSetCurrent(int current,
WcdStack w);
extern c3po_bool WcdStackHasDir(WcdStack w);
extern size_t getSizeOfWcdStackDir(WcdStack w);
extern void setSizeOfWcdStackDir(WcdStack w,
size_t size);
extern c3po_bool isEmptyWcdStackDir(WcdStack w);
extern void addToWcdStackDir(text t,
WcdStack set);
extern void putElementAtWcdStackDir(text t,
size_t position,
WcdStack set);
extern void insertElementAtWcdStackDir(text t,
size_t position,
WcdStack set);
extern void removeElementAtWcdStackDir(size_t position,
WcdStack set,
c3po_bool FreeAtPos);
extern text elementAtWcdStackDir(size_t position,
WcdStack set);
extern void extendWcdStackDir(WcdStack src,
WcdStack dest);
extern void deepExtendWcdStackDir(WcdStack src,
WcdStack dest);
extern void printWcdStack(text Offset,
WcdStack w,
FILE* fp,
c3po_bool showEmpty);
extern void freeWcdStack(WcdStack w,
c3po_bool Deep);
#endif
wcd-6.0.5/src/chk_loc.sh 0000755 0001755 0001001 00000000432 14421240062 014270 0 ustar waterlan Geen #!/bin/sh
if [ ! "$1" ]; then
echo "ERROR argument missing." >&2
echo "Usage: chk_loc.sh " >&2
exit 1
fi
LOC=`echo $1 | sed 's/-//g'`
locale -a | sed 's/-//g' | grep -i "^${LOC}$" 2>&1 > /dev/null
if [ "$?" = "0" ]
then
echo "yes"
else
echo "no"
fi
wcd-6.0.5/src/colors.c 0000644 0001755 0001001 00000004640 14421240062 014001 0 ustar waterlan Geen /*------------------------------------------------------------------*\
| This source code is copied from PDCurses 3.1 demos\tui.c and tui.h |
| |
| Author : P.J. Kunst |
| Date : 25-02-93 |
| colors.c is in the public domain |
| |
| |
| Billy Chen 12:49 Monday, 4 June, 2007 |
\*------------------------------------------------------------------*/
#ifdef WCD_USECURSES
#include
/* MOUSE_MOVED in PDCurses' curses.h conflicts with MOUSE_MOVED in wincon.h */
#ifdef MOUSE_MOVED
# undef MOUSE_MOVED
#endif
#include "colors.h"
#include "display.h"
void initcolor(void)
{
#ifdef A_COLOR
if (has_colors())
start_color();
/* foreground, background */
#if 1
init_pair((short)(MENU_COLOR & ~A_ATTR), (short)COLOR_WHITE, (short)COLOR_BLUE);
init_pair((short)(BODY_COLOR & ~A_ATTR), (short)COLOR_WHITE, (short)COLOR_RED);
#else
init_pair((short)(MENU_COLOR & ~A_ATTR), (short)COLOR_WHITE, (short)COLOR_RED);
init_pair((short)(BODY_COLOR & ~A_ATTR), (short)COLOR_CYAN, (short)COLOR_BLUE);
#endif
#endif
}
void setcolor(WINDOW *win, chtype color)
{
chtype attr = color & A_ATTR; /* extract Bold, Reverse, Blink bits */
#ifdef A_COLOR
attr &= ~A_REVERSE; /* ignore reverse, use colors instead! */
wattrset(win, COLOR_PAIR(color & A_CHARTEXT) | attr);
#else
attr &= ~A_BOLD; /* ignore bold, gives messy display on HP-UX */
wattrset(win, attr);
#endif
}
void colorbox(WINDOW *win, chtype color, int hasbox)
{
int maxy;
#ifndef PDCURSES
int maxx;
#endif
#ifdef A_COLOR
chtype attr;
#endif
setcolor(win, color);
#ifdef A_COLOR
attr = color & A_ATTR; /* extract Bold, Reverse, Blink bits */
if (has_colors())
wbkgd(win,
COLOR_PAIR(color & A_CHARTEXT) | (attr & ~A_REVERSE));
else
#endif
wbkgd(win, color);
WCD_WCLEAR(win);
#ifdef PDCURSES
maxy = getmaxy(win);
#else
getmaxyx(win, maxy, maxx);
#endif
if (hasbox && (maxy > 2))
box(win, (chtype)0, (chtype)0);
touchwin(win);
wrefresh(win);
}
#endif /* WCD_USECURSES */
wcd-6.0.5/src/colors.h 0000644 0001755 0001001 00000002534 14421240062 014006 0 ustar waterlan Geen /*------------------------------------------------------------------*\
| This source code is copied from PDCurses 3.1 demos\tui.c and tui.h |
| |
| Author : P.J. Kunst |
| Date : 25-02-93 |
| colors.h is in the public domain |
| |
| |
| Billy Chen 12:49 Monday, 4 June, 2007 |
\*------------------------------------------------------------------*/
#ifndef _WCD_COLORS_H
#define _WCD_COLORS_H
#ifdef A_COLOR
# define MENU_COLOR (2 | A_BOLD)
# define MENU_SELECT (4 | A_BOLD)
# define BODY_COLOR 6
#else
# define MENU_COLOR (A_BOLD)
# define MENU_SELECT (A_BOLD)
# define BODY_COLOR 0
#endif
#ifdef A_COLOR
#define A_ATTR (A_ATTRIBUTES ^ A_COLOR) /* A_BLINK, A_REVERSE, A_BOLD */
#else
#define A_ATTR (A_ATTRIBUTES) /* standard UNIX attributes */
#endif
#define MAXSTRLEN 256
#define KEY_ESC 0x1b /* Escape */
void initcolor (void);
void setcolor (WINDOW *, chtype color);
void colorbox (WINDOW *, chtype color, int hasbox);
#endif
wcd-6.0.5/src/config.h 0000644 0001755 0001001 00000002062 14421240062 013746 0 ustar waterlan Geen /*
Copyright (C) 1997-2012 Erwin Waterlander
This program is free software; you can redistribute it and/or
modify it under the terms of the GNU General Public License
as published by the Free Software Foundation; either version 2
of the License, or (at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software
Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
*/
#ifndef _WCD_CONFIG_H
#define _WCD_CONFIG_H
#ifdef ENABLE_NLS
#include
#define _(String) gettext (String)
#define gettext_noop(String) String
#define N_(String) gettext_noop (String)
#else
#define _(String) (String)
#define N_(String) String
#define textdomain(Domain)
#define bindtextdomain(Package, Directory)
#endif
#endif
wcd-6.0.5/src/display.c 0000644 0001755 0001001 00000134014 14421240062 014144 0 ustar waterlan Geen /*
Copyright (C) 1997-2019 Erwin Waterlander
This program is free software; you can redistribute it and/or
modify it under the terms of the GNU General Public License
as published by the Free Software Foundation; either version 2
of the License, or (at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software
Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
*/
#include
#include
#include
#ifndef KEY_RESIZE
#include
#endif
#include
#include "wcd.h"
#if defined(WCD_UNICODE) || defined(WCD_WINDOWS)
#ifndef __USE_XOPEN
#define __USE_XOPEN
#endif
#include
#endif
#include "display.h"
#include "std_macr.h"
#include "structur.h"
#include "nameset.h"
#include "config.h"
#include "finddirs.h"
#include "graphics.h"
#include
#if defined(WCD_WINDOWS)
#include
#endif
#ifdef WCD_ANSI
/* wide char to ANSI */
size_t wcstoansi(char *mbstr, const wchar_t *wcstr, int len)
{
return((size_t)(WideCharToMultiByte(CP_ACP, 0, wcstr, -1, mbstr, len, NULL, NULL) -1));
}
size_t ansitowcs(wchar_t *wcstr, const char *mbstr, int len)
{
return((size_t)(MultiByteToWideChar(CP_ACP, 0, mbstr, -1, wcstr, len) -1));
}
#endif
#ifdef WCD_UTF16
/* wide char to UTF-8 */
size_t wcstoutf8(char *mbstr, const wchar_t *wcstr, int len)
{
return((size_t)(WideCharToMultiByte(CP_UTF8, 0, wcstr, -1, mbstr, len, NULL, NULL) -1));
}
size_t utf8towcs(wchar_t *wcstr, const char *mbstr, int len)
{
return((size_t)(MultiByteToWideChar(CP_UTF8, 0, mbstr, -1, wcstr, len) -1));
}
#endif
/*
* wcd_printf() : printf wrapper, print in Windows Console in Unicode mode,
* to have consistent output. Regardless of active code page.
*
* Windows Unicode: Print Windows ANSI encoded format with UTF-8 encoded arguments.
* Windows ANSI : Print Windows ANSI encoded format and arguments.
* All others : Use standard printf.
*
* On Windows the file system uses always Unicode UTF-16 encoding,
* regardless of the system default code page. This means
* that files and directories can have names that
* can't be encoded in the default system Windows ANSI code page.
*
* The Windows console supports printing of any UTF-16 wide character,
* regardless of code page, via WriteConsoleW().
*
* Wcd for Windows with Unicode support translates all UTF-16 directory
* names to UTF-8, to be able to work with char type strings.
* This is done to keep the code portable.
*
* Wcd's messages are encoded in the default Windows ANSI code page,
* which can be translated with gettext. Gettext/libintl recodes
* messages (format) to the system default ANSI code page.
*/
void wcd_printf( const char* format, ... ) {
va_list args;
#if defined(_WIN32) && !defined(__CYGWIN__) /* Windows, not Cygwin */
wchar_t wstr[WCD_MAXPATH];
char buf[WCD_MAXPATH];
# ifdef WCD_UTF16
char formatmbs[WCD_MAXPATH];
wchar_t formatwcs[WCD_MAXPATH];
# endif
HANDLE stduit;
va_start(args, format);
stduit =GetStdHandle(STD_OUTPUT_HANDLE);
# ifdef WCD_UTF16 /* Wcd for Windows with Unicode support */
/* The format string is encoded in the system default
* Windows ANSI code page. May have been translated
* by gettext. Convert it to wide characters. */
MultiByteToWideChar(CP_ACP,0, format, -1, formatwcs, WCD_MAXPATH);
/* then convert the format string to UTF-8 */
WideCharToMultiByte(CP_UTF8, 0, formatwcs, -1, formatmbs, WCD_MAXPATH, NULL, NULL);
/* Assume the arguments (directory names) are in UTF-8 encoding, because
* in Windows Unicode mode all treedata files are written in UTF-8 format.
* Print to buffer (UTF-8) */
vsnprintf( buf, sizeof(buf), formatmbs, args);
buf[sizeof(buf)-1] = '\0';
/* Convert UTF-8 buffer to wide characters, and print to console. */
if (MultiByteToWideChar(CP_UTF8,0, buf, -1, wstr, WCD_MAXPATH) > 0 )
# else
/* Everything is in ANSI code page */
vsnprintf( buf, sizeof(buf), format, args);
buf[sizeof(buf)-1] = '\0';
if (MultiByteToWideChar(CP_ACP,0, buf, -1, wstr, WCD_MAXPATH) > 0 )
# endif
WriteConsoleW(stduit, wstr, (DWORD)wcslen(wstr), NULL, NULL);
else
{
/* An error occured. */
printf("A:");
vprintf( format, args );
}
#else
va_start(args, format);
vprintf( format, args );
#endif
va_end( args );
}
/*
* size_t str_columns (char *s)
*
* Return number of colums a string takes. In case
* of erroneous multi-byte sequence, return number of
* 8 bit characters.
*/
#if (defined(WCD_USECONIO) || defined(WCD_USECURSES))
size_t str_columns (char *s)
{
assert(s);
#if defined(WCD_UNICODE) || defined(WCD_WINDOWS)
static wchar_t wstr[WCD_MAXPATH];
size_t i;
/* convert to wide characters. i = nr. of characters */
i= MBSTOWCS(wstr,s,(size_t)WCD_MAXPATH);
if ( i == (size_t)(-1))
return(strlen(s));
else
{
int j = wcd_wcswidth(wstr,(size_t)WCD_MAXPATH);
/* j = nr. of columns */
if ( j < 0)
return(strlen(s));
else
return((size_t)j);
}
#else
return(strlen(s));
#endif
}
#endif
/************************************************************************
*
* swap(), ssort() and sort_list()
*
* Sort a nameset list alphabeticly
*
************************************************************************/
void swap(nameset list, int i, int j)
{ text temp;
temp = list->array[i];
list->array[i] = list->array[j];
list->array[j] = temp;
}
void ssort (nameset list, int left, int right)
{
int i, last;
#if defined(WCD_UNICODE) || defined(WCD_WINDOWS)
static wchar_t wstr_left[WCD_MAXPATH];
static wchar_t wstr_right[WCD_MAXPATH];
#endif
if (left >= right) return; /* fewer than 2 elements */
swap(list, left, (left + right)/2);
last = left;
for (i = left+1; i <=right; i++)
{
#if defined(WCD_UNICODE) || defined(WCD_WINDOWS)
size_t len1 = MBSTOWCS(wstr_left, list->array[left],(size_t)WCD_MAXPATH);
size_t len2 = MBSTOWCS(wstr_right,list->array[i],(size_t)WCD_MAXPATH);
if ((len1 == (size_t)(-1)) || (len2 == (size_t)(-1)))
{
/* Erroneous multi-byte sequence */
/* Try 8 bit characters */
# ifdef ENABLE_NLS
if (strcoll(list->array[i],list->array[left])<0)
# else
if (strcmp(list->array[i],list->array[left])<0)
# endif
swap(list, ++last, i);
} else {
if (wcscoll(wstr_right,wstr_left)<0)
swap(list, ++last, i);
}
#else
# ifdef ENABLE_NLS
if (strcoll(list->array[i],list->array[left])<0)
# else
if (strcmp(list->array[i],list->array[left])<0)
# endif
swap(list, ++last, i);
#endif
}
swap(list, left, last);
ssort(list, left, last-1);
ssort(list, last+1, right);
}
void sort_list(nameset list)
{
ssort(list,0,(int)(list->size)-1);
}
/************************************************************************
*
* maxLength()
* Get the longest string in a nameset list.
*
************************************************************************/
#if (defined(WCD_USECONIO) || defined(WCD_USECURSES))
size_t maxLength(nameset list)
{
size_t i, maxlen = 0;
if (list == NULL)
{
print_error("%s", _("internal error in maxLength(), list == NULL\n"));
return 32 ;
}
for (i=0;isize;i++)
{
size_t len;
if( (len=str_columns(list->array[i])) > maxlen)
maxlen=len;
}
if (maxlen > 32)
return(maxlen);
else
return 32 ; /* minimal width for help screen */
}
size_t maxLengthStack(WcdStack s)
{
size_t i, maxlen = 0;
if (s == NULL)
{
print_error("%s", _("internal error in maxLengthStack(), s == NULL\n"));
return 32 ;
}
for (i=0;isize;i++)
{
size_t len;
if( (len=str_columns(s->dir[i])) > maxlen)
maxlen=len;
}
if (maxlen > 32)
return(maxlen);
else
return 32 ; /* minimal width for help screen */
}
#endif
/************************************************************************
*
* display_list(nameset list)
*
* Display a match list on screen.
*
* There are three versions of the function:
*
* 1) stdout version
* This version will work on any platform. Default for Unix and Windows.
* Has to make use of the scroll-back capability of the terminal.
*
* 2) CONIO version
* Default used for DOS, optional for Windows NT.
* Scroll back is programmed in.
*
* 3) CURSES version
* Optional for Unix, DOS or Windows.
* Scroll back is programmed in.
*
************************************************************************/
#ifdef WCD_USECONIO
void printLine(nameset n, int i, int y, int xoffset, int *use_numbers, int screenWidth)
{
wcd_uchar *s;
s = n->array[i];
if (s != NULL)
{
int len = strlen(s);
int nr_offset;
if (*use_numbers == 0)
nr_offset = 2;
else
nr_offset = 3;
for(int j=xoffset;(jdir[i];
if (s != NULL)
{
int len = strlen(s);
int nr_offset;
if (*use_numbers == 0)
nr_offset = 2;
else
nr_offset = 3;
int j;
for(j=xoffset;(jcurrent) && ((nr_offset+j-xoffset+2)<(screenWidth-1)))
cprintf(" *");
}
}
void print_list_normal(int lines_per_page, int line, nameset list, int top, int bottom, int use_numbers, int xoffset, int screenWidth)
{
int i;
for (i=top;i<=bottom;i++)
{
gotoxy(1,line);
if (use_numbers == 0)
cprintf("%c ",(char)(((i-top)%lines_per_page) + 'a'));
else
cprintf("%2d ",((i-top)%lines_per_page) + 1);
printLine(list, i, line, xoffset, &use_numbers, screenWidth);
line++;
}
}
/**************************************************/
void print_list_stack(int lines_per_page, int line, WcdStack ws, int start, int top, int bottom, int use_numbers, int xoffset, int screenWidth)
{
int i,j;
if (use_numbers == 0)
{
for (i=top;i<=bottom;i++)
{
j = (i + start)%(ws->size);
gotoxy(1,line);
cprintf("%c ",(char)(((i-top)%lines_per_page) + 'a'));
printStackLine(ws, j, line, xoffset, &use_numbers, screenWidth);
line++;
}
}
else
{
for (i=top;i<=bottom;i++)
{
j = (i + start)%(ws->size);
gotoxy(1,line);
cprintf("%2d ",(i-top)%lines_per_page + 1);
printStackLine(ws, j, line, xoffset, &use_numbers, screenWidth);
line++;
}
}
}
void print_list(int lines_per_page,int line, nameset list, WcdStack ws, int start, int top, int bottom, int use_numbers, int xoffset, int screenWidth)
{
clrscr();
if (list != NULL)
print_list_normal(lines_per_page,line,list,top,bottom,use_numbers,xoffset,screenWidth);
else
if (ws != NULL)
print_list_stack(lines_per_page,line,ws,start,top,bottom,use_numbers,xoffset,screenWidth);
}
/****************************************************************************/
/* upper left corner is (1,1) */
int display_list_conio(nameset list,WcdStack ws, int perfect,int use_numbers)
{
int i, n=0, line, top, bottom, c=0, extended, gtxt=0;
int start=0, size;
int scrollWinHeight, page, len, shift=0 ;
int lines_per_page ; /* number of lines to print per page */
char number_str[WCD_MAX_INPSTR];
char *buffer;
struct text_info ti;
int pageoffset;
char buf[WCD_MAX_INPSTR];
gettextinfo(&ti);
buffer = (char *) malloc(ti.screenwidth * ti.screenheight * 2);
if (buffer!=NULL) /* get total screen */
gtxt = gettext(1,1,ti.screenwidth,ti.screenheight,buffer);
if (list != NULL) /* normal list */
{
sort_list(list);
size = list->size;
}
else
if (ws != NULL) /* stack */
{
if( ((ws->size) <= 0) || ((ws->size) > ws->maxsize) )
return(WCD_ERR_LIST); /* in case stack file was corrupt */
else
{
size = ws->size;
if (ws->size < ws->maxsize)
start = 0;
else
start = ws->lastadded + 1;
if (ws->lastadded >= ws->maxsize)
start = 0;
}
}
else
return(WCD_ERR_LIST); /* no list or stack */
i= WCD_ERR_LIST;
number_str[n] = '\0';
scrollWinHeight = ti.screenheight - INPUT_WIN_HEIGHT;
lines_per_page = scrollWinHeight ;
if (use_numbers == 0)
{
if (scrollWinHeight > SCROLL_WIN_HEIGHT)
lines_per_page = SCROLL_WIN_HEIGHT;
}
else
{
if (scrollWinHeight > 99)
lines_per_page = 99; /* stay below 3 digits */
}
if (list != NULL)
len = maxLength(list);
else
if (ws != NULL)
len = maxLengthStack(ws);
else
return(WCD_ERR_LIST);
bottom = size -1;
top = size - lines_per_page;
if (top < 0)
top = 0;
if (bottom < (lines_per_page -1) )
line = scrollWinHeight - bottom; /* screen line nr. where to start printing */
else
line = scrollWinHeight - lines_per_page + 1;
window(1,1,ti.screenwidth,scrollWinHeight);
print_list(lines_per_page,line,list, ws, start, top, bottom, use_numbers,shift,ti.screenwidth);
page = bottom / lines_per_page + 1 ;
window (1,scrollWinHeight+1,ti.screenwidth,ti.screenheight);
clrscr();
cprintf("\r\n");
if (list != NULL)
{
if(perfect)
cprintf(_("Perfect match for %d directories."),size);
else
cprintf(_("Wild match for %d directories."),size);
}
cprintf("\r\n");
cprintf(_("Please choose one ( to abort): "));
fflush(stdout);
sprintf(buf,_(" w=up x=down ?=help Page %d/%d "),page,(size -1)/lines_per_page +1);
pageoffset = ti.screenwidth - (int)strlen(buf);
if (pageoffset < 0)
pageoffset = 0;
gotoxy (pageoffset, 2);
cprintf("%s",buf);
gotoxy (OFFSET + n, 3);
while ((c != 13 )&&(( c < 'a' ) || ( c > ('a'+scrollWinHeight-1) || ( c > 'v' ) )))
{
c = getch();
switch(c)
{
case 'x':
case 'w':
case 'z':
case ',': /* 1 left */
case '.': /* 1 right */
case 1 : /* Ctrl-A, Home */
case 5 : /* Ctrl-E, End */
case '?': /* Help */
case 0: /* extended key */
if(c==0)
extended = getch();
else
{
switch (c)
{
case 'w': extended = 73; /* Page Up */
break;
case 'x': extended = 81; /* Page Down */
break;
case 'z': extended = 81; /* Page Down */
break;
case ',': extended = 75; /* Key Left */
break;
case '.': extended = 77; /* Key Right */
break;
case 1 : extended = 71; /* Home */
break;
case 5 : extended = 79; /* End */
break;
case '?': extended = 59; /* F1, Help */
break;
default : extended = 0;
break;
}
}
if ((extended == 73) || /* Page Up */
(extended == 72)) /* Arrow Up */
{
window(1,1,ti.screenwidth,scrollWinHeight);
if(bottom > (lines_per_page -1))
{
bottom = bottom - lines_per_page ;
top = top - lines_per_page ;
}
if (top<0) top = 0;
if (bottom < (lines_per_page -1) )
line = scrollWinHeight - bottom;
else
line = scrollWinHeight - lines_per_page + 1;
print_list(lines_per_page,line,list, ws, start, top, bottom, use_numbers,shift,ti.screenwidth);
page = bottom / lines_per_page + 1 ;
window (1,scrollWinHeight+1,ti.screenwidth,ti.screenheight);
sprintf(buf,_(" w=up x=down ?=help Page %d/%d "),page,(size -1)/lines_per_page +1);
pageoffset = ti.screenwidth - (int)strlen(buf);
if (pageoffset < 0)
pageoffset = 0;
gotoxy (pageoffset, 2);
cprintf("%s",buf);
gotoxy (OFFSET + n, 3);
} /* Page Up */
if ((extended == 81) || /* Page down */
(extended == 80)) /* Arrow down */
{
window(1,1,ti.screenwidth,scrollWinHeight);
if(bottom < (size - 1))
{
bottom = bottom + lines_per_page ;
top = bottom - lines_per_page + 1;
}
if (bottom < (lines_per_page -1) )
line = scrollWinHeight - bottom;
else
line = scrollWinHeight - lines_per_page + 1;
print_list(lines_per_page,line,list, ws, start, top, bottom, use_numbers,shift,ti.screenwidth);
page = bottom / lines_per_page + 1 ;
window (1,scrollWinHeight+1,ti.screenwidth,ti.screenheight);
sprintf(buf,_(" w=up x=down ?=help Page %d/%d "),page,(size -1)/lines_per_page +1);
pageoffset = ti.screenwidth - (int)strlen(buf);
if (pageoffset < 0)
pageoffset = 0;
gotoxy (pageoffset, 2);
cprintf("%s",buf);
gotoxy (OFFSET + n, 3);
}/* Page down */
if (extended == 75) /* Key Left */
{
if (shift > 0)
shift--;
window(1,1,ti.screenwidth,scrollWinHeight);
print_list(lines_per_page,line,list, ws, start, top, bottom, use_numbers,shift,ti.screenwidth);
}
if (extended == 77) /* Key Right */
{
if (shift < len)
shift++;
window(1,1,ti.screenwidth,scrollWinHeight);
print_list(lines_per_page,line,list, ws, start, top, bottom, use_numbers,shift,ti.screenwidth);
}
if (extended == 71) /* Home */
{
shift = 0;
window(1,1,ti.screenwidth,scrollWinHeight);
print_list(lines_per_page,line,list, ws, start, top, bottom, use_numbers,shift,ti.screenwidth);
}
if (extended == 79) /* End */
{
shift = len - ti.screenwidth/2;
if (shift < 0)
shift=0;
window(1,1,ti.screenwidth,scrollWinHeight);
print_list(lines_per_page,line,list, ws, start, top, bottom, use_numbers,shift,ti.screenwidth);
}
if (extended == 59) /* Help */
{
window(1,1,ti.screenwidth,scrollWinHeight);
clrscr();
if (scrollWinHeight < 17)
{
gotoxy(1,1);
cprintf(_("Screenheight must be > 20 for help."));
}
else
{
gotoxy(1,1);
cprintf(_("w or page up")); cprintf("\r\n");
cprintf(_("x or z or page down")); cprintf("\r\n");
cprintf(_(", or scroll 1 left")); cprintf("\r\n");
cprintf(_(". or scroll 1 right")); cprintf("\r\n");
cprintf(_("< or [ scroll 10 left")); cprintf("\r\n");
cprintf(_("> or ] scroll 10 right")); cprintf("\r\n");
cprintf(_("CTRL-a or scroll to beginning")); cprintf("\r\n");
cprintf(_("CTRL-e or scroll to end")); cprintf("\r\n");
cprintf(_("CTRL-c or abort")); cprintf("\r\n");
cprintf(_(" abort")); cprintf("\r\n");
cprintf(_("Type w or x to quit help.")); cprintf("\r\n");
}
}
window (1,scrollWinHeight+1,ti.screenwidth,ti.screenheight);
gotoxy (OFFSET + n, 3);
break;
case '<':
case '[':
shift -=10;
if (shift < 0)
shift=0;
window(1,1,ti.screenwidth,scrollWinHeight);
print_list(lines_per_page,line,list, ws, start, top, bottom, use_numbers,shift,ti.screenwidth);
window (1,scrollWinHeight+1,ti.screenwidth,ti.screenheight);
gotoxy (OFFSET + n, 3);
break;
case ']':
case '>':
shift +=10;
if (shift > len)
shift=len;
window(1,1,ti.screenwidth,scrollWinHeight);
print_list(lines_per_page,line,list, ws, start, top, bottom, use_numbers,shift,ti.screenwidth);
window (1,scrollWinHeight+1,ti.screenwidth,ti.screenheight);
gotoxy (OFFSET + n, 3);
break;
case 8: /* backspace */
window (1,scrollWinHeight+1,ti.screenwidth,ti.screenheight);
if(n>0) n--;
number_str[n] = '\0';
gotoxy(OFFSET + n, 3);
cprintf(" ");
gotoxy(OFFSET + n, 3);
break;
case 3: /* Control-C */
case 27: /* Escape */
c = 13;
i = WCD_ERR_LIST;
number_str[0] = '\0';
break;
case 13: /* Enter */
c = 13;
i = WCD_ERR_LIST;
break;
default:
if (( c >= '0') && ( c <= '9') && (n < WCD_MAX_INPSTR)) /* numbers */
{
number_str[n] = (char)c;
window (1,scrollWinHeight+1,ti.screenwidth,ti.screenheight);
gotoxy (OFFSET + n++, 3);
cprintf("%c",(char)c);
number_str[n] = '\0';
/* Notice that one has to choose a number from 1 to max 22 */
if (((bottom - top) < 9) /* displayed list is 9 or less matches */
|| (n == 2) /* second number typed */
|| (c >= '3') /* 3-9 is typed */
|| ((c == '2')&&((bottom - top) < 19)) /* displayed list is 19 or less matches */
)
c = 13; /* do an */
}
else
i=c+top-'a'+1;
break;
}
}
window (1,1,ti.screenwidth,ti.screenheight);
gotoxy (ti.curx, ti.cury);
printf("\n");
if (gtxt ==1)
puttext(1,1,ti.screenwidth,ti.screenheight,buffer);
if (buffer!=NULL)
free(buffer);
/*
cprintf("window left %2d\r\n",ti.winleft);
cprintf("window top %2d\r\n",ti.wintop);
cprintf("window right %2d\r\n",ti.winright);
cprintf("window bottom %2d\r\n",ti.winbottom);
cprintf("attribute %2d\r\n",ti.attribute);
cprintf("normal attribute %2d\r\n",ti.normattr);
cprintf("current mode %2d\r\n",ti.currmode);
cprintf("screen height %2d\r\n",ti.screenheight);
cprintf("screen width %2d\r\n",ti.screenwidth);
cprintf("current x %2d\r\n",ti.curx);
cprintf("current y %2d\r\n",ti.cury); */
if (strcmp(number_str,"") != 0) /* a number was typed */
i=atoi(number_str) + top;
if((ws != NULL)&&(list == NULL)) /* stack */
{
if (( i <=0)||(i > ws->size)) /* fail */
{
return(WCD_ERR_LIST);
}
else /* succes */
{
i = ( i - 1 + start)%(ws->size);
ws->current = i;
}
}
return i;
}
#endif
#ifdef WCD_USECURSES
struct wcddisplay /* structure with window information */
{
WINDOW *scrollWin;
int scrollWinHeight;
int scrollWinLen;
int use_numbers ;
int lines_per_page ; /* number of matches to print per page */
int size; /* total number of elements in the list */
int line; /* screen line nr. where to start printing */
int top; /* top match to print */
int bottom; /* bottom match to print */
int shift; /* number of colums horizontal panning */
int start; /* start line in stack, first to print */
int perfect;
WINDOW *inputWin;
int inputWinLen;
char number_str[WCD_MAX_INPSTR];
nameset list; /* normal match list */
WcdStack ws; /* wcd stack list */
} ;
struct wcddisplay wcd_display; /*global variable wcd curses windows */
void displayRefresh(int init);
#if defined(SIGWINCH)
# define CAN_RESIZE 1
#else
# define CAN_RESIZE 0
#endif
/* The most portable way of resizing seems to be
* to just rebuild the windows from scratch */
void displayResize()
{
#ifdef __PDCURSES__
/* Correct resizing on Windows (ConEmu and Windows 10 console) requires a
recent PDCurses version ( >= 3.7 ). */
resize_term(0,0);
#else
/* resize_term() is not working properly with old versions of curses.
(e.g. seen with ncurses 5.6.20080804). There are still a lot of old
curses library installations around. Stopping and restarting curses
does the job too with old curses libraries. */
endwin(); /* end curses mode */
refresh(); /* start curses */
#endif
wcd_display.scrollWinHeight = LINES - INPUT_WIN_HEIGHT;
wcd_display.lines_per_page = wcd_display.scrollWinHeight;
wcd_display.scrollWinLen = COLS;
if (wcd_display.use_numbers == 0)
{
if (wcd_display.scrollWinHeight > SCROLL_WIN_HEIGHT)
wcd_display.lines_per_page = SCROLL_WIN_HEIGHT;
}
else
{
if (wcd_display.scrollWinHeight > 99)
wcd_display.lines_per_page = 99; /* stay below 3 digits */
}
/* free resources */
delwin(wcd_display.scrollWin);
delwin(wcd_display.inputWin);
/* create new windows */
wcd_display.scrollWin = newwin(wcd_display.scrollWinHeight,COLS,0,0);
wcd_display.inputWin = newwin(INPUT_WIN_HEIGHT,COLS,wcd_display.scrollWinHeight,0);
scrollok(wcd_display.scrollWin, TRUE);
refresh();
displayRefresh(1);
}
#ifndef KEY_RESIZE
#if CAN_RESIZE
void signalSigwinchDisplay (int sig)
{
displayResize ();
signal(SIGWINCH,signalSigwinchDisplay);
}
#endif
#endif
void wcd_mvwaddstr(WINDOW *win, int x, int y, char *str)
{
#if defined(WCD_UNICODE) || defined(WCD_WINDOWS)
static wchar_t wstr[WCD_MAXPATH];
size_t i;
/* convert to wide characters. i = nr. of characters */
i= mbstowcs(wstr,str,(size_t)WCD_MAXPATH);
if ( i == (size_t)(-1))
{
/* Erroneous multi-byte sequence */
/* Try 8 bit characters */
mvwaddstr(win, x, y, str);
} else {
mvwaddwstr(win, x, y, wstr);
}
#else
mvwaddstr(win, x, y, str);
#endif
}
void printLine(WINDOW *win, nameset n, int i, int y, int xoffset, int *use_numbers)
{
wcd_uchar *s;
s = (wcd_uchar *)n->array[i];
if (s != NULL)
{
#if defined(WCD_UNICODE) || defined(WCD_WINDOWS)
static wchar_t wstr[WCD_MAXPATH];
size_t len = MBSTOWCS(wstr,(char *)s,(size_t)WCD_MAXPATH); /* number of wide characters */
#else
size_t len = strlen((char *)s);
int j;
#endif
int nr_offset;
if (*use_numbers == 0)
nr_offset = 2;
else
nr_offset = 3;
wmove(win,y,(int)nr_offset);
#if defined(WCD_UNICODE) || defined(WCD_WINDOWS)
if (len == (size_t)(-1))
{
/* Erroneous multi-byte sequence */
/* Try 8 bit characters */
int j;
len = strlen((char *)s);
for(j=xoffset;(j<(int)len)&&((nr_offset+j-xoffset)<(COLS-1));j++)
{
waddch(win,(chtype)s[j]);
}
} else {
int width, c, j = 0;
c = 0; /* count characters with width > 0 from beginning of string. */
while ((j<(int)len)&&(c= 0xdc00) && (wstr[j] < 0xe000))
wstr[j] = ' ';
#endif
while ((j<(int)len)&&(wcd_wcwidth(wstr[j]) == 0 )) /* Skip combining characters */
j++;
width = wcd_wcwidth(wstr[j]);
while ((j<(int)len)&&((nr_offset+width)<(COLS-1)))
{
waddnwstr(win,wstr+j,1);
j++;
width = width + wcd_wcwidth(wstr[j]);
}
}
#else
for(j=xoffset;(j<(int)len)&&((nr_offset+j-xoffset)<(COLS-1));j++)
{
waddch(win,(chtype)s[j]);
}
#endif
}
}
void printStackLine(WINDOW *win, WcdStack ws, int i, int y, int xoffset, int *use_numbers)
{
wcd_uchar *s;
s = (wcd_uchar *)ws->dir[i];
if (s != NULL)
{
#if defined(WCD_UNICODE) || defined(WCD_WINDOWS)
static wchar_t wstr[WCD_MAXPATH];
size_t len = MBSTOWCS(wstr,(char *)s,(size_t)WCD_MAXPATH); /* number of wide characters */
#else
size_t len = strlen((char *)s);
int j;
#endif
int nr_offset;
if (*use_numbers == 0)
nr_offset = 2;
else
nr_offset = 3;
wmove(win,y,nr_offset);
#if defined(WCD_UNICODE) || defined(WCD_WINDOWS)
if (len == (size_t)(-1))
{
/* Erroneous multi-byte sequence */
/* Try 8 bit characters */
int j;
len = strlen((char *)s);
for(j=xoffset;(j<(int)len)&&((nr_offset+j-xoffset)<(COLS-1));j++)
{
waddch(win,(chtype)s[j]);
}
if ((i == ws->current) && ((nr_offset+j-xoffset+2)<(COLS-1)))
wprintw(win," *");
} else {
int width, c, j = 0;
c = 0; /* count characters with width > 0 from beginning of string. */
while ((j<(int)len)&&(c= 0xdc00) && (wstr[j] < 0xe000))
wstr[j] = ' ';
#endif
while ((j<(int)len)&&(wcd_wcwidth(wstr[j]) == 0 )) /* Skip combining characters */
j++;
width = wcd_wcwidth(wstr[j]);
while ((j<(int)len)&&((nr_offset+width)<(COLS-1)))
{
waddnwstr(win,wstr+j,1);
j++;
width = width + wcd_wcwidth(wstr[j]);
}
if ((i == ws->current) && ((nr_offset+width-wcd_wcwidth(wstr[j])+2)<(COLS-1)))
wprintw(win," *");
}
#else
for(j=xoffset;(j<(int)len)&&((nr_offset+j-xoffset)<(COLS-1));j++)
{
waddch(win,(chtype)s[j]);
}
if ((i == ws->current) && ((nr_offset+j-xoffset+2)<(COLS-1)))
wprintw(win," *");
#endif
}
}
/**************************************************/
void print_list_normal(WINDOW *scrollWin, int lines_per_page,int line, nameset list, int top, int bottom, int use_numbers, int xoffset)
{
int i;
for (i=top;i<=bottom;i++)
{
if (use_numbers == 0)
mvwprintw(scrollWin,line,0,"%c ",(char)(((i-top)%lines_per_page) + 'a'));
else
mvwprintw(scrollWin,line,0,"%2d ",((i-top)%lines_per_page) + 1);
printLine(scrollWin, list, i, line, xoffset, &use_numbers);
line++;
}
}
/**************************************************/
void print_list_stack(WINDOW *scrollWin, int lines_per_page,int line, WcdStack ws, int start, int top, int bottom, int use_numbers, int xoffset)
{
int i,j;
if (use_numbers == 0)
{
for (i=top;i<=bottom;i++)
{
j = (i + start)%(int)(ws->size);
mvwprintw(scrollWin,line,0,"%c ",(char)(((i-top)%lines_per_page) + 'a'));
printStackLine(scrollWin, ws, j, line, xoffset, &use_numbers);
line++;
}
}
else
{
for (i=top;i<=bottom;i++)
{
j = (i + start)%(int)(ws->size);
/* mvwprintw(scrollWin,line,0,"%d %s",i + 1,ws->dir[j]); */
mvwprintw(scrollWin,line,0,"%2d ",(i-top)%lines_per_page + 1);
printStackLine(scrollWin, ws, j, line, xoffset, &use_numbers);
line++;
}
}
}
void print_list(WINDOW *scrollWin, int lines_per_page,int line, nameset list, WcdStack ws, int start, int top, int bottom, int use_numbers, int xoffset)
{
WCD_WCLEAR(scrollWin);
if (list != NULL)
print_list_normal(scrollWin,lines_per_page,line,list,top,bottom,use_numbers,xoffset);
else
if (ws != NULL)
print_list_stack(scrollWin,lines_per_page,line,ws,start,top,bottom,use_numbers,xoffset);
}
/* ****************************************************************** */
/* upper left corner is (0,0) */
/* ****************************************************************** */
void displayRefresh(int init)
{
int page, pageoffset, offset, n;
char buf[WCD_MAX_INPSTR];
WCD_WCLEAR(wcd_display.scrollWin);
WCD_WCLEAR(wcd_display.inputWin);
if (init || (wcd_display.bottom >= wcd_display.size) || (wcd_display.size <= wcd_display.lines_per_page)) {
/* initialise bottom only first time || bottom overshoots || complete list fits in page. */
if ( (wcd_display.bottom < 0) || (wcd_display.bottom >= wcd_display.size) || (wcd_display.size <= wcd_display.lines_per_page))
wcd_display.bottom = wcd_display.size -1; /* lowest match to print */
wcd_display.top = wcd_display.bottom - wcd_display.lines_per_page + 1; /* top match to print */
if (wcd_display.top < 0)
wcd_display.top = 0;
if (wcd_display.bottom < (wcd_display.lines_per_page -1) )
wcd_display.line = wcd_display.scrollWinHeight - wcd_display.bottom - 1; /* screen line nr. where to start printing */
else
wcd_display.line = wcd_display.scrollWinHeight - wcd_display.lines_per_page;
}
print_list(wcd_display.scrollWin,wcd_display.lines_per_page,wcd_display.line,wcd_display.list,wcd_display.ws,wcd_display.start,wcd_display.top,wcd_display.bottom,wcd_display.use_numbers,wcd_display.shift);
if (wcd_display.list != NULL)
{
wmove (wcd_display.inputWin, 1, 0);
if(wcd_display.perfect)
wprintw(wcd_display.inputWin,_("Perfect match for %d directories."),wcd_display.size);
else
wprintw(wcd_display.inputWin,_("Wild match for %d directories."),wcd_display.size);
}
page = wcd_display.bottom / wcd_display.lines_per_page + 1 ;
sprintf(buf,_(" w=up x=down ?=help Page %d/%d "),page,(wcd_display.size -1)/wcd_display.lines_per_page +1);
pageoffset = COLS - (int)str_columns(buf);
if (pageoffset < 0)
pageoffset = 0;
wmove (wcd_display.inputWin, 0, pageoffset);
wprintw(wcd_display.inputWin,"%s",buf);
sprintf(buf,_("Please choose one ( to abort): "));
wcd_mvwaddstr(wcd_display.inputWin,2,0,buf);
offset = (int)str_columns(buf) ;
wmove (wcd_display.inputWin, 2, offset);
waddstr(wcd_display.inputWin, wcd_display.number_str);
n = (int)str_columns(wcd_display.number_str) ;
wmove (wcd_display.inputWin, 2, offset + n);
wrefresh(wcd_display.scrollWin);
wrefresh(wcd_display.inputWin);
}
void displayHelp(WINDOW *win, int height)
{
WCD_WCLEAR(win);
if (height < 17)
wcd_mvwaddstr(win,0,0,_("Screenheight must be > 20 for help."));
else
{
wcd_mvwaddstr(win, 0,0,_("w or page up"));
wcd_mvwaddstr(win, 1,0,_("x or z or page down"));
wcd_mvwaddstr(win, 2,0,_(", or scroll 1 left"));
wcd_mvwaddstr(win, 3,0,_(". or scroll 1 right"));
wcd_mvwaddstr(win, 4,0,_("< or [ scroll 10 left"));
wcd_mvwaddstr(win, 5,0,_("> or ] scroll 10 right"));
wcd_mvwaddstr(win, 6,0,_("CTRL-a or scroll to beginning"));
wcd_mvwaddstr(win, 7,0,_("CTRL-e or scroll to end"));
wcd_mvwaddstr(win, 8,0,_("CTRL-l or F5 redraw screen"));
wcd_mvwaddstr(win, 9,0,_("CTRL-c or abort"));
wcd_mvwaddstr(win,10,0,_(" abort"));
wcd_mvwaddstr(win,12,0,_("Press any key."));
}
wrefresh(win);
getch();
}
#define Key_CTRL(x) ((x) & 31)
int display_list_curses(nameset list, WcdStack ws, int perfect,int use_numbers)
{
int i, n=0, c=0;
int displayed_list;
size_t len ;
SCREEN *sp;
#ifndef KEY_RESIZE
#if CAN_RESIZE
signal (SIGWINCH, signalSigwinchDisplay);
#endif
#endif
/* Notice that list->size > 1 when this function is called. */
wcd_display.shift = 0;
wcd_display.start = 0;
wcd_display.perfect = perfect;
wcd_display.bottom = -1;
if (list != NULL) /* normal list */
{
sort_list(list);
wcd_display.size = (int)list->size;
}
else
if (ws != NULL) /* stack */
{
if( ((int)(ws->size) == 0) || ((int)(ws->size) > ws->maxsize) )
return(WCD_ERR_LIST); /* in case stack file was corrupt */
else
{
wcd_display.size = (int)ws->size;
if ((int)ws->size < ws->maxsize)
wcd_display.start = 0;
else
wcd_display.start = ws->lastadded + 1;
if (ws->lastadded >= ws->maxsize)
wcd_display.start = 0;
}
}
else
return(WCD_ERR_LIST); /* no list or stack */
i= WCD_ERR_LIST;
wcd_display.number_str[n] = '\0';
/* Older versions of PDCurses and ncurses < 5.9.20120922 do not
* support newterm() on Windows */
sp = newterm(NULL,stdout,stdin);
if (sp == NULL)
{
print_error("%s", _("Error opening terminal, falling back to stdout interface.\n"));
return WCD_ERR_CURSES;
}
keypad(stdscr, TRUE);
intrflush(stdscr, FALSE);
cbreak();
noecho();
nonl();
scrollok(stdscr, TRUE); /* enable scrolling */
wcd_display.use_numbers = use_numbers;
wcd_display.list = list;
wcd_display.ws = ws;
if (LINES < 4)
{
endwin();
delscreen(sp);
#ifdef XCURSES
XCursesExit();
#endif
print_error("%s", _("screen height must be larger than 3 lines.\n"));
return WCD_ERR_CURSES;
}
wcd_display.scrollWinHeight = LINES - INPUT_WIN_HEIGHT;
wcd_display.lines_per_page = wcd_display.scrollWinHeight;
if (wcd_display.use_numbers == 0)
{
if (wcd_display.scrollWinHeight > SCROLL_WIN_HEIGHT)
wcd_display.lines_per_page = SCROLL_WIN_HEIGHT;
}
else
{
if (wcd_display.scrollWinHeight > 99)
wcd_display.lines_per_page = 99; /* stay below 3 digits */
}
if (list != NULL)
len = maxLength(list);
else
if (ws != NULL)
len = maxLengthStack(ws);
else {
endwin();
delscreen(sp);
#ifdef XCURSES
XCursesExit();
#endif
return(WCD_ERR_LIST);
}
refresh();
wcd_display.scrollWin = newwin(wcd_display.scrollWinHeight,COLS,0,0);
if (wcd_display.scrollWin == NULL)
{
endwin();
delscreen(sp);
#ifdef XCURSES
XCursesExit();
#endif
print_error("%s", _("error creating scroll window.\n"));
return WCD_ERR_CURSES;
}
scrollok(wcd_display.scrollWin, TRUE);
wcd_display.inputWin = newwin(INPUT_WIN_HEIGHT,COLS,wcd_display.scrollWinHeight,0);
if (wcd_display.inputWin == NULL)
{
delwin(wcd_display.scrollWin);
endwin();
delscreen(sp);
#ifdef XCURSES
XCursesExit();
#endif
print_error("%s", _("error creating input window.\n"));
return WCD_ERR_CURSES;
}
scrollok(wcd_display.inputWin, TRUE);
displayRefresh(1);
while ((c != 13 )&&(( c < 'a' ) || ( c > ('a'+wcd_display.scrollWinHeight-1) || ( c > 'v' ) )))
{
c = getch();
switch(c)
{
case 'w':
case KEY_UP: /* Arrow Up */
case KEY_PPAGE: /* Page Up */
if(wcd_display.bottom > (wcd_display.lines_per_page -1))
{
wcd_display.bottom = wcd_display.bottom - wcd_display.lines_per_page ;
wcd_display.top = wcd_display.top - wcd_display.lines_per_page ;
}
if (wcd_display.top<0) wcd_display.top = 0;
if (wcd_display.bottom < (wcd_display.lines_per_page -1) )
wcd_display.line = wcd_display.scrollWinHeight - wcd_display.bottom - 1;
else
wcd_display.line = wcd_display.scrollWinHeight - wcd_display.lines_per_page;
break;
case 'x':
case 'z':
case KEY_DOWN: /* Arrow down */
case KEY_NPAGE: /* Page down */
if(wcd_display.bottom < (wcd_display.size - 1))
{
wcd_display.bottom = wcd_display.bottom + wcd_display.lines_per_page ;
wcd_display.top = wcd_display.bottom - wcd_display.lines_per_page + 1;
}
if (wcd_display.bottom < (wcd_display.lines_per_page -1) )
wcd_display.line = wcd_display.scrollWinHeight - wcd_display.bottom - 1;
else
wcd_display.line = wcd_display.scrollWinHeight - wcd_display.lines_per_page;
break;
case ',':
case KEY_LEFT:
if (wcd_display.shift > 0)
wcd_display.shift--;
break;
case '.':
case KEY_RIGHT:
if (wcd_display.shift < (int)len)
wcd_display.shift++;
break;
case '<':
case '[':
wcd_display.shift -=10;
if (wcd_display.shift < 0)
wcd_display.shift=0;
break;
case ']':
case '>':
wcd_display.shift +=10;
if (wcd_display.shift > (int)len)
wcd_display.shift=(int)len;
break;
case Key_CTRL ('a'):
case KEY_HOME:
wcd_display.shift = 0;
break;
case Key_CTRL ('e'):
#ifdef KEY_END
case KEY_END:
#endif
wcd_display.shift = (int)len - COLS/2;
if (wcd_display.shift < 0)
wcd_display.shift=0;
break;
case KEY_F (1):
case '?':
displayHelp(wcd_display.scrollWin, wcd_display.scrollWinHeight);
break;
case KEY_F (5):
case Key_CTRL ('l'):
#ifdef KEY_RESIZE
case KEY_RESIZE:
#endif
displayResize ();
break;
case 3: /* Control-C */
case 27: /* Escape */
c = 13;
i = WCD_ERR_LIST;
wcd_display.number_str[0] = '\0';
break;
case 13: /* Enter */
case KEY_ENTER:
c = 13;
i = WCD_ERR_LIST;
break;
case 8: /* backspace */
case KEY_BACKSPACE:
case 127: /* delete */
if(n>0) n--;
wcd_display.number_str[n] = '\0';
break;
default:
if (( c >= '0') && ( c <= '9') && (n < (WCD_MAX_INPSTR -1))) /* numbers */
{
wcd_display.number_str[n] = (char)c;
n++;
wcd_display.number_str[n] = '\0';
displayed_list = wcd_display.bottom - wcd_display.top;
/* Notice that one has to choose a number from 1 to max 99 */
if ((displayed_list < 9) /* displayed list is 9 or less matches */
|| (n == 2) /* second number typed */
|| ((c == '2')&&( displayed_list < 19)) /* displayed list is 19 or less matches */
|| ((c == '3')&&( displayed_list < 29)) /* displayed list is 29 or less matches */
|| ((c == '4')&&( displayed_list < 39)) /* displayed list is 39 or less matches */
|| ((c == '5')&&( displayed_list < 49)) /* displayed list is 49 or less matches */
|| ((c == '6')&&( displayed_list < 59)) /* displayed list is 59 or less matches */
|| ((c == '7')&&( displayed_list < 69)) /* displayed list is 69 or less matches */
|| ((c == '8')&&( displayed_list < 79)) /* displayed list is 79 or less matches */
|| ((c == '9')&&( displayed_list < 89)) /* displayed list is 89 or less matches */
)
c = 13; /* do an */
}
else
i=c+wcd_display.top-'a'+1;
break;
}
displayRefresh(0);
}
delwin(wcd_display.scrollWin);
delwin(wcd_display.inputWin);
endwin();
delscreen(sp);
#ifdef XCURSES
XCursesExit();
#endif
if (strcmp(wcd_display.number_str,"") != 0) /* a number was typed */
i=atoi(wcd_display.number_str) + wcd_display.top;
printf("\n"); /* Extra newline for curses, pdcurses and when ncurses doesn't restore screen */
if ((ws != NULL)&&(list == NULL)) /* stack */
{
if (( i <=0)||(i > (int)ws->size)) /* fail */
{
return(WCD_ERR_LIST);
}
else /* succes */
{
i = ( i - 1 + wcd_display.start)%(int)(ws->size);
ws->current = i;
}
}
return i;
}
#endif
/* stdout version */
int display_list_stdout(nameset list,WcdStack ws, int perfect, int use_stdout)
{
int i;
int k, start, j;
if (list != NULL) /* normal list */
{
sort_list(list);
if ( use_stdout & WCD_STDOUT_DUMP )
{
size_t ii;
for (ii=0;iisize;ii++)
wcd_printf("%s\n", list->array[ii]);
}
else
{
size_t ii;
for (ii=0;iisize;ii++)
wcd_printf("%lu %s\n",(unsigned long)(ii+1),list->array[ii]);
}
if ( use_stdout & WCD_STDOUT_DUMP )
return(WCD_ERR_LIST);
else
{
printf("\n");
if(perfect)
printf(_("Perfect match for %d directories."),(int)list->size);
else
printf(_("Wild match for %d directories."),(int)list->size);
printf("\n");
printf(_("Please choose one ( to abort): "));
}
return wcd_get_int();
}
else
if (ws != NULL) /* stack */
{
/* printWcdStack("XXX ", ws, stdout); */
if(ws->maxsize <= 0)
return (WCD_ERR_LIST);
else
if( ((ws->size) == 0) || ((ws->size) > (size_t)ws->maxsize) )
return (WCD_ERR_LIST);
else
{
if (ws->size < (size_t)ws->maxsize)
start = 0;
else
start = ws->lastadded + 1;
if (ws->lastadded >= ws->maxsize)
start = 0;
k=1;
for(i=0; i < (int)(ws->size) ; i++)
{
j = (i + start)%(int)(ws->size);
if ( !(use_stdout & WCD_STDOUT_DUMP) )
printf("%2d ",k);
k++;
wcd_printf("%s",ws->dir[j]);
if (j == ws->current)
printf(" *");
printf("\n");
}
if ( use_stdout & WCD_STDOUT_DUMP )
return(WCD_ERR_LIST);
printf("\n");
printf(_("Please choose one ( to abort): "));
i = wcd_get_int();
if (( i <=0)||(i > (int)ws->size)) /* fail */
{
return(WCD_ERR_LIST);
}
else /* succes */
{
i = ( i - 1 + start)%(int)(ws->size);
ws->current = i;
return(i);
}
}
}
else
return WCD_ERR_LIST;
}
int display_list(nameset list,int perfect, int use_numbers, int use_stdout)
{
#ifdef WCD_USECONIO
if (use_stdout == WCD_STDOUT_NO)
return display_list_conio(list,NULL,perfect,use_numbers);
else
return display_list_stdout(list,NULL,perfect, use_stdout);
#else
# ifdef WCD_USECURSES
int i;
if ((use_stdout == WCD_STDOUT_NO) && ((i = display_list_curses(list,NULL,perfect,use_numbers)) != WCD_ERR_CURSES))
return i;
else
return display_list_stdout(list,NULL,perfect, use_stdout);
# else
return display_list_stdout(list,NULL,perfect, use_stdout);
# endif
#endif
}
wcd-6.0.5/src/display.h 0000644 0001755 0001001 00000005572 14421240062 014157 0 ustar waterlan Geen /*
Copyright (C) 1997-2015 Erwin Waterlander
This program is free software; you can redistribute it and/or
modify it under the terms of the GNU General Public License
as published by the Free Software Foundation; either version 2
of the License, or (at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software
Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
*/
#ifndef _WCD_DISPLAY_H
#define _WCD_DISPLAY_H
#ifdef WCD_USECONIO
# include
#endif
#ifdef WCD_USECURSES
# include
/* MOUSE_MOVED in PDCurses' curses.h conflicts with MOUSE_MOVED in wincon.h */
# ifdef MOUSE_MOVED
# undef MOUSE_MOVED
# endif
#endif
#if (defined(WCD_ANSI) || defined(WCD_UTF16))
#include
#endif
#include "std_macr.h"
#include "structur.h"
#include "wcd.h"
#ifdef WCD_ANSI
size_t wcstoansi(char *mbstr, const wchar_t *wcstr, int len);
size_t ansitowcs(wchar_t *wcstr, const char *mbstr, int len);
#endif
#ifdef WCD_UTF16
size_t wcstoutf8(char *mbstr, const wchar_t *wcstr, int len);
size_t utf8towcs(wchar_t *wcstr, const char *mbstr, int len);
#endif
void wcd_printf( const char* format, ... );
#if (defined(WCD_USECONIO) || defined(WCD_USECURSES))
size_t str_columns (char *s);
#endif
void sort_list(nameset list);
int display_list(nameset list,int perfect, int use_numbers, int use_stdout);
#ifdef WCD_USECONIO
int display_list_conio(nameset list,WcdStack ws, int perfect,int use_numbers);
#endif
#ifdef WCD_USECURSES
int display_list_curses(nameset list, WcdStack ws, int perfect,int use_numbers);
void wcd_mvwaddstr(WINDOW *win, int x, int y, char *str);
#endif
int display_list_stdout(nameset list,WcdStack ws, int perfect, int use_stdout);
#define OFFSET 39
#define WCD_MAX_INPSTR 256
#define PAGEOFFSET 38
#define SCROLL_WIN_HEIGHT 22
#define INPUT_WIN_HEIGHT 3
#define WCD_ERR_LIST -1 /* No choice is made from list of matches */
#define WCD_ERR_CURSES -2 /* Curses can't open terminal */
#define WCD_STDOUT_NO 0 /* no stdout */
#define WCD_STDOUT_NORMAL 1 /* stdout mode */
#define WCD_STDOUT_DUMP 2 /* dump to stdout */
#if defined(_WIN32) && !defined(__CYGWIN__) /* Windows, not Cygwin */
/* On Windows we use wclear, because wclear gives a cleaner screen in a Windows
* Command Prompt in an East Asian locale with double width font. E.g. Chinese
* locale CP936 with raster or Simsun font. wclear gives some screen
* flickering when used with ncurses on Windows. */
#define WCD_WCLEAR wclear
#else
/* We prefer werase, because it gives a steadier screen. Less flickering. */
#define WCD_WCLEAR werase
#endif
#endif
wcd-6.0.5/src/etc/ 0000755 0001755 0001001 00000000000 14421240062 013103 5 ustar waterlan Geen wcd-6.0.5/src/etc/profile.d/ 0000755 0001755 0001001 00000000000 14421240062 014765 5 ustar waterlan Geen wcd-6.0.5/src/etc/profile.d/wcd.csh 0000755 0001755 0001001 00000002453 14421240062 016250 0 ustar waterlan Geen # Copyright
#
# Copyright (C) 2011 Erwin Waterlander
#
# License
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation; either version 2 of the License, or
# (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program. If not, see .
#
# Description
#
# Define a shell alias for wcd(1), which itself change
# directories, so it must be done in a shell alias.
#
# This file is in /etc/profile.d/ and it should be sourced from
# a shell startup file: ~/.rc
##if ( ! ${?WCDHOME} ) then
## setenv WCDHOME "$HOME/.wcd"
##endif
if ( ${?WCDHOME} ) then
alias wcd "rm -f $WCDHOME/bin/wcd.go ; BINDIR/PROGRAM \!* ; source $WCDHOME/bin/wcd.go"
else
alias wcd "rm -f $HOME/bin/wcd.go ; BINDIR/PROGRAM \!* ; source $HOME/bin/wcd.go"
endif
# End of file
wcd-6.0.5/src/etc/profile.d/wcd.sh 0000755 0001755 0001001 00000002425 14421240062 016104 0 ustar waterlan Geen # Copyright
#
# Copyright (C) 2011-2014 Erwin Waterlander
# Copyright (C) 2009-2011 Jari Aalto
#
# License
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation; either version 2 of the License, or
# (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program. If not, see .
#
# Description
#
# Define a shell alias for wcd(1), which itself change
# directories, so it must be done in a shell alias.
#
# This file is in /etc/profile.d/ and it should be sourced from
# a shell startup file: ~/.rc
##if [ -z "$WCDHOME" ]
##then
## export WCDHOME="$HOME/.wcd"
##fi
wcd ()
{
typeset go="${WCDHOME:-${HOME}}/bin/wcd.go"
rm -f "$go" 2> /dev/null
BINDIR/PROGRAM "$@"
[ -f "$go" ] && . "$go"
}
# End of file
wcd-6.0.5/src/finddirs.c 0000644 0001755 0001001 00000033035 14421240062 014302 0 ustar waterlan Geen /*
Copyright (C) 1996-2017 Erwin Waterlander
This program is free software; you can redistribute it and/or
modify it under the terms of the GNU General Public License
as published by the Free Software Foundation; either version 2
of the License, or (at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software
Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
*/
#include "tailor.h"
#if defined(_WIN32) && !defined(__CYGWIN__)
# ifdef WCD_UNICODE
# define UNICODE
# define _UNICODE
# define WCD_FINDFIRSTFILE FindFirstFileW
# define WCD_FINDNEXTFILE FindNextFileW
# include "display.h" /* for wcstoutf8() */
# else
# define WCD_FINDFIRSTFILE FindFirstFileA
# define WCD_FINDNEXTFILE FindNextFileA
# endif
# include
# include
# ifdef __WATCOMC__
# include /* Watcom C does not have _getdrives(). We use the dos functions. */
# endif
#elif defined(__MSDOS__) || (defined(__OS2__) && !defined(__EMX__))
# ifdef __DJGPP__
# include
# include
# define WCD_FB_NAME fb.ff_name
# define WCD_FB_MODE fb.ff_attrib
# define WCD_FINDNEXT findnext
# define WCD_ISDIREC(m) ((m) & FA_DIREC)
# else /* Watcom C */
# include
# define WCD_FB_NAME fb.name
# define WCD_FB_MODE fb.attrib
# define WCD_FINDNEXT _dos_findnext
# define WCD_ISDIREC(m) ((m) & _A_SUBDIR)
# endif
#else
# define _GNU_SOURCE /* Required for DT_DIR and DT_LNK */
# include
# include
# include
# include
#endif
#ifdef __OS2__
# include
#endif
#include
#include
#include "wcddir.h"
#include "wcd.h"
#include "wfixpath.h"
#include "nameset.h"
#include "config.h"
#include "finddirs.h"
const wcd_char *default_mask = ALL_FILES_MASK;
/* Various implementations of setdisk/getdisk */
#if defined(__MSDOS__) || (defined(__WATCOMC__) && defined(__NT__))
# ifndef __TURBOC__
/*
* getdisk
*
* Returns: -1 if error, otherwise: 0=drive A, 1=drive B, and so on.
*/
int getdisk()
{
unsigned d;
_dos_getdrive(&d);
return ((int)d - 1);
}
/*
* setdisk: 0=drive A, 1=drive B, and so on.
*
* Returns: total number of drive available
*
*/
int setdisk( int drive )
{
unsigned numdrives;
_dos_setdrive((unsigned) (drive + 1), &numdrives);
return numdrives;
}
# endif /* ?!__TURBOC__ */
#elif defined(__OS2__)
/* OS/2 implementation of getdisk and setdisk for EMX */
/*
* getdisk
*
* Returns: -1 if error, otherwise: 0=drive A, 1=drive B, and so on.
*/
int getdisk()
{
ULONG ulDrive;
ULONG ulLogical;
/* APIRET rc; */
int d;
/* rc= */ DosQueryCurrentDisk(&ulDrive, &ulLogical); /* Get current drive */
d = (int)ulDrive;
return(d-1);
}
/*
* setdisk: 0=drive A, 1=drive B, and so on.
*
* Returns: total number of drive available
*
*/
int setdisk( int drive )
{
int d;
ULONG ulDrive;
ulDrive = (ULONG)(drive+1);
if(DosSetDefaultDisk(ulDrive)) /* Set default drive, 1=A, 2=B, 3=C, 4=D */
{
/* printf("Wcd: error: Can not change default drive to %d\n",drive); */
return(-1);
}
d = getdisk();
return(d);
}
#elif defined(_WIN32)
int getdisk(void)
{
int d;
d = _getdrive();
return(d-1);
}
int setdisk (int drive)
{
unsigned long numdrives;
_chdrive(drive+1);
numdrives = _getdrives();
return ((int)numdrives);
}
#else
/* stub functions for get/set disk
* fake MS-DOS functions that do not apply to unix or vms:
*/
int getdisk()
{
return 0;
}
int setdisk( int drive )
{
return 0;
}
#endif
/****************************************************************/
/* Function: SpecialDir
*
* Purpose: Test for special directories
*
* Returns: 1 if path = "." or ".."
* 0 otherwise.
*/
int SpecialDir(const char *path)
{
if (*path != '.') return 0;
if (*(++path) == '.') path++;
return (*path=='/' || *path=='\0');
}
/********************************************************************
*
* rmTree(dir)
*
* Recursively delete directory: *dir
*
********************************************************************/
void rmTree(char *dir)
{
#if defined(_WIN32) && !defined(__CYGWIN__)
WIN32_FIND_DATA FindFileData;
HANDLE hFind;
#elif defined(__MSDOS__) || (defined(__OS2__) && !defined(__EMX__))
# ifdef __DJGPP__
struct ffblk fb; /* file block structure */
int rc; /* error code */
# else
struct _find_t fb; /* file block structure */
unsigned rc; /* error code */
# endif
#else /* Unix, Cygwin, MSYS, EMX */
DIR *dirp;
struct dirent *dp;
#endif
if (dir) {
if (wcd_chdir(dir,0)) return; /* Go to the dir, else return */
} else
return ; /* dir == NULL */
#if defined(_WIN32) && !defined(__CYGWIN__)
hFind = WCD_FINDFIRSTFILE(ALL_FILES_MASK, &FindFileData);
while (hFind != INVALID_HANDLE_VALUE) {
char directory[WCD_MAXPATH];
# ifdef WCD_UNICODE
wcstoutf8(directory, FindFileData.cFileName, sizeof(directory));
# else
wcd_strncpy(directory,FindFileData.cFileName,sizeof(directory));
# endif
if (FindFileData.dwFileAttributes & FILE_ATTRIBUTE_DIRECTORY) {
if (!SpecialDir(directory)) {
if(wcd_islink(directory,0)) {
if (wcd_unlink(directory) != 0)
print_error(_("Unable to remove file %s: %s\n"), directory, strerror(errno));
} else {
rmTree(directory);
wcd_rmdir(directory,0);
}
}
} else { /* not a directory */
if (wcd_unlink(directory) != 0)
print_error(_("Unable to remove file %s: %s\n"), directory, strerror(errno));
}
if (!WCD_FINDNEXTFILE(hFind, &FindFileData)) {
FindClose(hFind);
hFind = INVALID_HANDLE_VALUE;
}
}
#elif defined(__MSDOS__) || (defined(__OS2__) && !defined(__EMX__))
# ifdef __DJGPP__
rc = findfirst(default_mask, &fb, FA_DIREC|FA_RDONLY|FA_HIDDEN|FA_SYSTEM|FA_ARCH|FA_LABEL);
# else
rc = _dos_findfirst(default_mask, _A_SUBDIR|_A_RDONLY|_A_HIDDEN|_A_SYSTEM|_A_ARCH, &fb);
# endif
while (rc==0) { /* go through all the files in the current dir */
if (WCD_ISDIREC(WCD_FB_MODE)) {
if (!SpecialDir(WCD_FB_NAME)) {
rmTree(WCD_FB_NAME);
wcd_rmdir(WCD_FB_NAME,0);
}
} else { /* not a directory */
if (wcd_unlink(WCD_FB_NAME) != 0) {
print_error(_("Unable to remove file %s: %s\n"), WCD_FB_NAME, strerror(errno));
}
}
rc = WCD_FINDNEXT(&fb);
} /* while !rc */
# if defined(__OS2__)
_dos_findclose( &fb );
# endif
#else /* Unix, Cygwin, MSYS, EMX */
dirp = opendir(".");
if (dirp == NULL) {
wcd_chdir(DIR_PARENT,1); /* go to parent directory */
return;
}
dp = readdir(dirp);
while (dp) {
#ifdef _DIRENT_HAVE_D_TYPE
if (dp->d_type == DT_DIR) {
if (!SpecialDir(dp->d_name)) {
rmTree(dp->d_name);
wcd_rmdir(dp->d_name,0);
}
} else { /* not a directory */
if (wcd_unlink(dp->d_name) != 0) {
print_error(_("Unable to remove file %s: %s\n"), dp->d_name, strerror(errno));
}
}
#else
/* Not all systems have d_type. */
static struct stat buf ;
if (lstat(dp->d_name, &buf) == 0) {
if (S_ISDIR(buf.st_mode)) {
if (!SpecialDir(dp->d_name)) {
rmTree(dp->d_name);
wcd_rmdir(dp->d_name,0);
}
} else { /* not a directory */
if (wcd_unlink(dp->d_name) != 0) {
print_error(_("Unable to remove file %s: %s\n"), dp->d_name, strerror(errno));
}
}
}
#endif
dp = readdir(dirp);
}
if (closedir(dirp))
print_error(_("Unable to close directory %s: %s\n"), dir, strerror(errno));
#endif
wcd_chdir(DIR_PARENT,1); /* go to parent directory */
}
/********************************************************************
*
* finddirs(char *dir, size_t *offset, FILE *outfile, int *use_HOME, int quiet)
*
********************************************************************/
void finddirs(char *dir, size_t *offset, FILE *outfile, int *use_HOME, nameset exclude, int quiet)
{
char curdir[WCD_MAXPATH];
char *tmp_ptr ;
size_t len ;
#if defined(_WIN32) && !defined(__CYGWIN__)
WIN32_FIND_DATA FindFileData;
HANDLE hFind;
#elif defined(__MSDOS__) || (defined(__OS2__) && !defined(__EMX__))
# ifdef __DJGPP__
struct ffblk fb; /* file block structure */
int rc; /* error code */
# else
struct _find_t fb; /* file block structure */
unsigned rc; /* handle and error code */
# endif
#else /* Unix, Cygwin, MSYS, EMX */
DIR *dirp;
struct dirent *dp;
#endif
if (dir) {
if (wcd_chdir(dir,quiet)) return; /* Go to the dir, else return */
}
else
return ; /* dir == NULL */
if (wcd_getcwd(curdir, sizeof(curdir)) == NULL) {
print_error(_("finddirs(): can't determine path in directory %s\n"),dir);
print_error(_("path probably too long.\n"));
wcd_chdir(DIR_PARENT,1); /* go to parent directory */
return;
};
#ifdef _WCD_DOSFS
wcd_fixpath(curdir,sizeof(curdir));
rmDriveLetter(curdir,use_HOME);
#endif
if (pathInNameset(curdir,exclude) != (size_t)-1) {
wcd_chdir(DIR_PARENT,1); /* go to parent directory */
return;
}
len = strlen(curdir);
if(*offset < len)
tmp_ptr = curdir + *offset ;
else
tmp_ptr = curdir + len; /* tmp_ptr points to ending '\0' of curdir */
if (wcd_fprintf(outfile,"%s\n", tmp_ptr) < 0) {
wcd_chdir(DIR_PARENT,1); /* go to parent directory */
return; /* Quit when we can't write path to disk */
}
#if defined(_WIN32) && !defined(__CYGWIN__)
hFind = WCD_FINDFIRSTFILE(ALL_FILES_MASK, &FindFileData);
while (hFind != INVALID_HANDLE_VALUE) {
if (FindFileData.dwFileAttributes & FILE_ATTRIBUTE_DIRECTORY) {
char directory[WCD_MAXPATH];
# ifdef WCD_UNICODE
wcstoutf8(directory, FindFileData.cFileName, sizeof(directory));
# else
wcd_strncpy(directory,FindFileData.cFileName,sizeof(directory));
# endif
if (!SpecialDir(directory)) {
if(wcd_islink(directory,quiet))
wcd_fprintf(outfile,"%s/%s\n", tmp_ptr, directory);
else
finddirs(directory,offset, outfile, use_HOME, exclude, 1);
}
}
if (!WCD_FINDNEXTFILE(hFind, &FindFileData)) {
FindClose(hFind);
hFind = INVALID_HANDLE_VALUE;
}
}
#elif defined(__MSDOS__) || (defined(__OS2__) && !defined(__EMX__))
/* Only DJGPP and Watcom C are supported. */
# ifdef __DJGPP__
rc = findfirst(default_mask, &fb, FA_DIREC|FA_RDONLY|FA_HIDDEN|FA_SYSTEM|FA_ARCH|FA_LABEL);
# else
rc = _dos_findfirst(default_mask, _A_SUBDIR|_A_RDONLY|_A_HIDDEN|_A_SYSTEM|_A_ARCH, &fb);
# endif
while (rc==0) { /* go through all the files in the current dir */
if (WCD_ISDIREC(WCD_FB_MODE)) {
if (!SpecialDir(WCD_FB_NAME))
finddirs(WCD_FB_NAME,offset, outfile, use_HOME, exclude, 1);
}
rc = WCD_FINDNEXT(&fb);
} /* while !rc */
# if defined(__OS2__)
_dos_findclose( &fb );
# endif
#else /* Unix, Cygwin, MSYS, EMX */
dirp = opendir(curdir);
if (dirp == NULL) {
wcd_chdir(DIR_PARENT,1); /* go to parent directory */
return;
}
dp = readdir(dirp);
while (dp) {
#ifdef _DIRENT_HAVE_D_TYPE
if (dp->d_type == DT_DIR) {
if (!SpecialDir(dp->d_name))
finddirs(dp->d_name,offset, outfile, use_HOME, exclude, 1);
} else if (dp->d_type == DT_LNK) { /* Is it a symbolic link? */
static struct stat buf ;
if ((stat(dp->d_name, &buf) == 0) && S_ISDIR(buf.st_mode)) /* does the link point to a dir */
wcd_fprintf(outfile,"%s/%s\n", tmp_ptr, dp->d_name);
} else if (dp->d_type == DT_UNKNOWN) {
/* File type is not supported by all file systems.
On Cygwin DT_LNK only works for Windows native links. Cygwin links return DT_UNKNOWN. */
static struct stat buf ;
if (lstat(dp->d_name, &buf) == 0) {
if (S_ISDIR(buf.st_mode)) {
if (!SpecialDir(dp->d_name))
finddirs(dp->d_name,offset, outfile, use_HOME, exclude, 1);
} else if (S_ISLNK(buf.st_mode)) { /* Is it a symbolic link? */
if ((stat(dp->d_name, &buf) == 0) && S_ISDIR(buf.st_mode)) /* does the link point to a dir */
wcd_fprintf(outfile,"%s/%s\n", tmp_ptr, dp->d_name);
}
}
}
#else
/* Not all systems have d_type. */
static struct stat buf ;
if (lstat(dp->d_name, &buf) == 0) {
if (S_ISDIR(buf.st_mode)) {
if (!SpecialDir(dp->d_name))
finddirs(dp->d_name,offset, outfile, use_HOME, exclude, 1);
} else if (S_ISLNK(buf.st_mode)) { /* Is it a symbolic link? */
if ((stat(dp->d_name, &buf) == 0) && S_ISDIR(buf.st_mode)) /* does the link point to a dir */
wcd_fprintf(outfile,"%s/%s\n", tmp_ptr, dp->d_name);
}
}
#endif
dp = readdir(dirp);
}
if (closedir(dirp))
print_error(_("Unable to close directory %s: %s\n"), curdir, strerror(errno));
#endif
wcd_chdir(DIR_PARENT,1); /* go to parent directory */
}
wcd-6.0.5/src/finddirs.h 0000644 0001755 0001001 00000006022 14421240062 014303 0 ustar waterlan Geen /*
Copyright (C) 1996-2017 Erwin Waterlander
This program is free software; you can redistribute it and/or
modify it under the terms of the GNU General Public License
as published by the Free Software Foundation; either version 2
of the License, or (at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software
Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
*/
#ifndef _WCD_FINDDIRS_H
#define _WCD_FINDDIRS_H
#include "tailor.h"
#include "wcd.h"
/*
MAXPATH MAXDIR MAXFILE MAXEXT
Borland DOS16 80 66 9 5
Watcom DOS16 144 130 9 5
Watcom DOS32 144 130 9 5
DJGPP DOS32 260 256 256 256
* WIN32 260 256 256 256
*/
#if defined(__GO32__) || defined(_WIN32) || defined(__OS2__) || defined(__386__)
/* flat memory, _long_ directory names */
# define __FLAT__ 1
#endif
#if defined(__MSDOS__) || defined(_WIN32) || (defined(__OS2__) && !defined(__EMX__))
# define WCD_MAXDRIVE 3
# ifndef __FLAT__
/* DOS 16 bit */
# define WCD_MAXPATH 80
# define WCD_MAXDIR 66
# define WCD_MAXFILE 16
# define WCD_MAXEXT 10 /* allow for wildcards .[ch]*, .etc */
# else
/* DOS 32 bit or Windows */
/* Big values to be able to read treedata files of Unix network drives */
# define WCD_MAXPATH 1028
# define WCD_MAXDIR 1024
# define WCD_MAXFILE 256
# define WCD_MAXEXT 256
# endif /* ?__FLAT__ */
#else /* ?unix or EMX */
/*
* WCD_MAXPATH defines the longest permissable path length,
* including the terminating null. It should be set high
* enough to allow all legitimate uses, but halt infinite loops
* reasonably quickly.
*/
# define WCD_MAXPATH 1024
# define WCD_MAXDIR 1024
# define WCD_MAXFILE 255
# ifdef __OS2__
# define WCD_MAXDRIVE 3
# define WCD_MAXEXT 256
# else
# define WCD_MAXDRIVE 1
# define WCD_MAXEXT 1
# endif
#endif /* ?__MSDOS__ */
#ifdef __MSDOS__
# define ALL_FILES_MASK "*.*"
# define DIR_END '\\'
#elif defined(_WIN32)
# ifdef WCD_UTF16
# define ALL_FILES_MASK L"*.*"
# else
# define ALL_FILES_MASK "*.*"
# endif
# define DIR_END '\\'
#elif (defined(__OS2__) && !defined(__EMX__))
# define ALL_FILES_MASK "*"
# define DIR_END '\\'
#else /* ?UNIX or EMX */
# ifdef __OS2__
# define ALL_FILES_MASK "*"
# define DIR_END '\\'
# else
# define ALL_FILES_MASK "*"
# define DIR_END '/'
# endif
#endif /* ?__TURBOC__ */
#define DIR_PARENT ".."
#ifndef __TURBOC__
int getdisk(void);
int setdisk(int drive);
#endif /* ?!__TURBOC__ */
void rmTree(char *dir);
void finddirs(char *dir, size_t *offset, FILE *outfile, int *use_HOME, nameset exclude, int quiet);
#endif
wcd-6.0.5/src/graphics.c 0000644 0001755 0001001 00000225163 14421240062 014305 0 ustar waterlan Geen /*
Copyright (C) 2000-2019 Erwin Waterlander
Ideas and source code of NCD (Ninux Czo Directory) have been
used in the WCD graphical interface.
Ninux Change Directory
Copyright (C) 1995 Borja Etxebarria
or
https://www.ibiblio.org/pub/Linux/utils/shell/ncd-0.9.8.tgz
Additions on NCD were made by Olivier Sirol (Czo)
Ninux Czo Directory
Copyright (C) 1995 Borja Etxebarria
Copyright (C) 1996 Olivier Sirol
Olivier Sirol
https://www.ibiblio.org/pub/Linux/utils/file/managers/ncd1_205.tgz
This program is free software; you can redistribute it and/or
modify it under the terms of the GNU General Public License
as published by the Free Software Foundation; either version 2
of the License, or (at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software
Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
*/
#include
#include
#if defined(WCD_UNICODE) || (defined(_WIN32) && !defined(__CYGWIN__))
#ifndef __USE_XOPEN
#define __USE_XOPEN
#endif
#include
#include "wcwidth.h" /* Marcus Kuhn's wcwidth implementation */
#endif
#include "std_macr.h"
#include "structur.h"
#include "nameset.h"
#include "Text.h"
#include "Error.h"
#include "dirnode.h"
#include "graphics.h"
#include "wcd.h"
#include "finddirs.h"
#include "display.h"
#include "wfixpath.h"
#include "match.h"
#ifdef WCD_UNICODE
# include "matchw.h"
#else
# include "matchl.h"
#endif
#include "config.h"
#ifdef WCD_USECURSES
#include "colors.h" /* add colors for the tree on MS platform */
#ifndef KEY_RESIZE
#include
#endif
#endif
/*
* The following codes are below 20 and don't interfere with 8 bit normal
* characters. They will also not interfere with UTF-8 encoded characters,
* because All UCS characters >U+007F are encoded as a sequence of several
* bytes, each of which has the most significant bit set. No ASCII byte
* (0x00-0x7F) can appear as part of any other UTF-8 encode character.
*/
# define WCD_ACS_HL 1 /* line art codes */
# define WCD_ACS_VL 2
# define WCD_ACS_LT 3
# define WCD_ACS_LLC 4
# define WCD_ACS_TT 5
# define WCD_SEL_ON 6 /* selection on/off codes */
# define WCD_SEL_OFF 7
# define WCD_SPACE 8 /* double width space in CJK mode */
#ifdef ASCII_TREE
static const char WCD_ONESUBDIR[] = "---" ;
static const char WCD_SPLITDIR[] = "-+-" ;
static const char WCD_SUBDIR[] = " |-" ;
static const char WCD_MOREDIR[] = " | " ;
static const char WCD_ENDDIR[] = " `-" ;
static const char WCD_OVERDIR[] = " " ;
static const char WCD_COMPACT_SUBDIR[] = " |--" ;
static const char WCD_COMPACT_MOREDIR[] = " | " ;
static const char WCD_COMPACT_ENDDIR[] = " `--" ;
#else
static const char WCD_ONESUBDIR[] = { WCD_ACS_HL, WCD_ACS_HL, WCD_ACS_HL, 0} ;
static const char WCD_SPLITDIR[] = { WCD_ACS_HL, WCD_ACS_TT, WCD_ACS_HL, 0} ;
static const char WCD_SUBDIR[] = { 32, WCD_SPACE, WCD_ACS_LT, WCD_ACS_HL, 0} ;
static const char WCD_MOREDIR[] = { 32, WCD_SPACE, WCD_ACS_VL, WCD_SPACE, 32, 0} ;
static const char WCD_ENDDIR[] = { 32, WCD_SPACE, WCD_ACS_LLC, WCD_ACS_HL, 0} ;
static const char WCD_OVERDIR[] = { 32, WCD_SPACE, WCD_SPACE, WCD_SPACE, 32, 0} ;
static const char WCD_COMPACT_SUBDIR[] = { 32, WCD_ACS_LT, WCD_ACS_HL, WCD_ACS_HL, 0} ;
static const char WCD_COMPACT_MOREDIR[] = { 32, WCD_ACS_VL, WCD_SPACE, WCD_SPACE, 0} ;
static const char WCD_COMPACT_ENDDIR[] = { 32, WCD_ACS_LLC, WCD_ACS_HL, WCD_ACS_HL, 0} ;
#endif
#define WCD_GRAPH_MAX_LINE_LENGTH WCD_MAXPATH * 2
#ifdef WCD_USECURSES
struct wcdwin /* structure with window information */
{
WINDOW *scrollWin;
int scrollWinHeight;
WINDOW *inputWin;
dirnode curNode;
char str[WCD_MAX_INPSTR];
#if defined(WCD_UNICODE) || defined(WCD_WINDOWS)
wchar_t wstr[WCD_MAX_INPSTR];
#endif
int mode;
int graphics_mode;
dirnode zoomStack;
} ;
struct wcdwin wcd_cwin; /*global variable wcd curses windows */
void dataRefresh(int ydiff, int init);
#if defined(SIGWINCH)
# define CAN_RESIZE 1
#else
# define CAN_RESIZE 0
#endif
/* The most portable way of resizing seems to be
* to just rebuild the windows from scratch */
void ioResize()
{
#ifdef __PDCURSES__
/* Correct resizing on Windows (ConEmu and Windows 10 console) requires a
recent PDCurses version ( >= 3.7 ). */
resize_term(0,0);
#else
/* resize_term() is not working properly with old versions of curses.
(e.g. seen with ncurses 5.6.20080804). There are still a lot of old
curses library installations around. Stopping and restarting curses
does the job too with old curses libraries. */
endwin(); /* end curses mode */
refresh(); /* start curses */
#endif
wcd_cwin.scrollWinHeight = LINES - INPUT_WIN_HEIGHT;
/* free resources */
delwin(wcd_cwin.scrollWin);
delwin(wcd_cwin.inputWin);
/* create new windows */
wcd_cwin.scrollWin = newwin(wcd_cwin.scrollWinHeight,COLS,0,0);
wcd_cwin.inputWin = newwin(INPUT_WIN_HEIGHT,COLS,wcd_cwin.scrollWinHeight,0);
if (wcd_cwin.graphics_mode & WCD_GRAPH_COLOR)
{
colorbox (wcd_cwin.scrollWin, MENU_COLOR, 0); /* BillyC add colors */
colorbox (wcd_cwin.inputWin, BODY_COLOR, 0); /* BillyC add colors */
}
scrollok(wcd_cwin.scrollWin, TRUE);
refresh();
dataRefresh(0, 1);
}
#ifndef KEY_RESIZE
#if CAN_RESIZE
void signalSigwinch (int sig)
{
ioResize ();
signal(SIGWINCH,signalSigwinch);
}
#endif
#endif
#endif /* WCD_USECURSES */
/*****************************************************************
*
* dirHasSubdirs()
* Wrapper for API dirnodeHasSubdirs()
* When directory is folded it looks like there are no subdirectories.
*
*************************************************************** */
c3po_bool dirHasSubdirs(dirnode d)
{
if (dirnodeFold(d) eq true)
return false;
else
return dirnodeHasSubdirs(d);
}
char* getCompactTreeLine(dirnode d, int y, int *y_orig, char *line, char *tline)
{
dirnode n;
if (dirnodeHasParent(d) eq false)
return(line);
if (y == *y_orig)
{
if (dirnodeGetDown(d) == NULL)
strcpy(tline,WCD_COMPACT_ENDDIR);
else
strcpy(tline,WCD_COMPACT_SUBDIR);
if (d->fold eq true)
tline[strlen(tline)-1] = '+';
}
else
{
if (dirnodeGetDown(d) == NULL)
strcpy(tline," ");
else
strcpy(tline,WCD_COMPACT_MOREDIR);
}
strcat(tline,line);
strcpy(line,tline);
n = dirnodeGetParent(d);
return(getCompactTreeLine(n,dirnodeGetY(n),y_orig, line, tline));
}
/* this function is called by other functions only on directories that are last
* on a line */
char* getTreeLine(dirnode d, int y, int *y_orig, dirnode curNode, c3po_bool fold, const int *graphics_mode)
{
static text line = NULL;
static text tline = NULL;
dirnode n;
size_t len,clen;
if (d == NULL)
return(NULL);
len = strlen(dirnodeGetName(d)); /* nr. of bytes */
clen = str_columns(dirnodeGetName(d)); /* nr. of columns */
if (line == NULL)
{
line = textNewSize((size_t)WCD_GRAPH_MAX_LINE_LENGTH);
line[0] = '\0';
}
if (tline == NULL)
{
tline = textNewSize((size_t)WCD_GRAPH_MAX_LINE_LENGTH);
tline[0] = '\0';
}
if (*graphics_mode & WCD_GRAPH_COMPACT) /* compact tree */
{
strcpy(tline," ");
if (d == curNode)
tline[strlen (tline) - 1] = WCD_SEL_ON;
strcat(tline,dirnodeGetName(d));
strcat(tline," ");
if (d == curNode)
tline[strlen (tline) - 1] = WCD_SEL_OFF;
strcpy(line,tline);
getCompactTreeLine(d,dirnodeGetY(d),y_orig, line, tline);
return line;
}
/* buffer overflow prevention:
*
* The max length of `line' and `tline' is the length of `line' increased
* by the namelength of the dirnode and at most 8 characters
*/
if ((strlen(line) + len + 8) > WCD_GRAPH_MAX_LINE_LENGTH)
{
sprintf(line,_("Wcd: error: path too long"));
return(line);
}
if (dirHasSubdirs(d) eq true)
{
if(getSizeOfDirnode(d) == 1)
{
if (dirnodeGetY(d) == *y_orig)
{
strcpy(tline," ");
if (d == curNode)
tline[strlen (tline) - 1] = WCD_SEL_ON;
strcat(tline,dirnodeGetName(d));
strcat(tline," ");
if (d == curNode)
tline[strlen (tline) - 1] = WCD_SEL_OFF;
strcat(tline,WCD_ONESUBDIR);
n = elementAtDirnode((size_t)0,d);
if (fold eq true)
tline[strlen(tline)-1] = '+';
}
else
{
size_t i;
for (i=0;ifold, graphics_mode));
}
if (*y_orig != 0)
{
strcpy(tline," ");
strcat(tline,line);
strcpy(line,tline);
}
return line;
}
void dumpTreeLine(dirnode d, const int *graphics_mode)
{
int y;
char *l;
y = dirnodeGetY(d);
l = getTreeLine(d,y,&y,NULL,false, graphics_mode);
if (l == NULL)
return;
while ( *l != '\0')
{
switch(*l)
{
case WCD_ACS_HL:
putc('-', stdout);
break;
case WCD_ACS_VL:
putc('|', stdout);
break;
case WCD_ACS_LT:
putc('|', stdout);
break;
case WCD_ACS_LLC:
putc('`', stdout);
break;
case WCD_ACS_TT:
putc('+', stdout);
break;
case WCD_SEL_ON:
putc('<', stdout);
break;
case WCD_SEL_OFF:
putc('>', stdout);
break;
case WCD_SPACE:
putc(' ', stdout);
break;
default:
putc(*l, stdout);
}
l++;
}
printf("\n");
}
void dumpTree(dirnode d, const int *graphics_mode)
{
size_t index, size;
dirnode n;
index = 0;
if (*graphics_mode & WCD_GRAPH_COMPACT)
{
dumpTreeLine(d, graphics_mode);
size = getSizeOfDirnode(d);
while(index < size)
{
n = elementAtDirnode(index,d);
dumpTree(n, graphics_mode);
index++;
}
}
else if (isEmptyDirnode(d) eq false)
{
size = getSizeOfDirnode(d);
while(index < size)
{
n = elementAtDirnode(index,d);
dumpTree(n, graphics_mode);
index++;
}
}
else
{
dumpTreeLine(d, graphics_mode);
}
}
/*
* Set the x,y values of the dirnodes
* in the tree
*/
void setXYTree(dirnode d, const int *graphics_mode)
{
if(dirHasSubdirs(d) eq true)
{
int x;
static int y;
size_t index, len, size;
dirnode n;
if (*graphics_mode & WCD_GRAPH_COMPACT) /* compact tree */
{
len = str_columns(dirnodeGetName(d));
y = dirnodeGetY(d);
index = 0;
size = getSizeOfDirnode(d);
while(index < size)
{
y = y + 1;
n = elementAtDirnode(index,d);
#ifndef ASCII_TREE
if ((*graphics_mode & WCD_GRAPH_CJK) && !(*graphics_mode & WCD_GRAPH_ASCII)) /* double width line drawing symbols. */
x = dirnodeGetX(d) + 7;
else
#endif
x = dirnodeGetX(d) + 4;
dirnodeSetX(x,n);
dirnodeSetY(y,n);
setXYTree(n, graphics_mode);
index++;
}
}
else
{
len = str_columns(dirnodeGetName(d));
y = dirnodeGetY(d);
index = 0;
size = getSizeOfDirnode(d);
while(index < size)
{
n = elementAtDirnode(index,d);
#ifndef ASCII_TREE
if ((*graphics_mode & WCD_GRAPH_CJK) && !(*graphics_mode & WCD_GRAPH_ASCII)) /* double width line drawing symbols. */
x = dirnodeGetX(d) + (int)len + 8;
else
#endif
x = dirnodeGetX(d) + (int)len + 5;
dirnodeSetX(x,n);
dirnodeSetY(y,n);
setXYTree(n, graphics_mode);
index++;
y = y + 1;
}
/* y is 1 too large */
y = y - 1;
}
}
}
c3po_bool eqTextDirnode(text t, dirnode d)
{
return(eqText(t,dirnodeGetName(d)));
}
size_t inDirnode(text t, dirnode d)
{
size_t index;
index = 0;
while(index < d->size)
{
if (strcmp(t,(d->subdirs[index])->name) == 0)
return index;
++index;
}
return (size_t) -1;
}
/*
* A lot of time is spend in addPath(). addPath() has been made faster by
* using pointers directly instead of the dirnode API functions in addPath()
* and inDirnode(). This removes overhead due to pointer checks.
*/
void addPath(text path, dirnode d)
{
char *s;
dirnode n,n_up;
text t;
#if (defined(_WIN32) || defined(__CYGWIN__))
static char buf[WCD_MAXPATH] = "//" ;
if ( (path != NULL) &&
(*path == '/') &&
(*(path+1) == '/') )
{
s = strtok(path,"/");
if (s != NULL)
{
buf[2] = '\0';
strcat(buf, s);
s = buf;
}
}
else
#endif
s = strtok(path,"/");
if (s != NULL)
{
size_t index = inDirnode(s,d);
if (index == (size_t) -1)
{
n = dirnodeNew(d,NULL,NULL);
t = textNew(s);
dirnodeSetName(t,n);
if (d->size > 0)
{
n_up = d->subdirs[d->size -1];
n_up->down = n;
n->up = n_up;
}
addToDirnode(n,d);
}
else
{
n = d->subdirs[index];
}
addPath(NULL,n);
}
}
/************************************************************************
*
* swap_dirnodes(), ssort_dirnode() and sort_dirnode()
*
* Sort the sub dirnodes of a dirnode alphabeticly
*
************************************************************************/
void swap_dirnodes(dirnode* subdirs, int i, int j)
{ dirnode temp, parent;
parent = (subdirs[i])->parent;
temp = subdirs[i];
subdirs[i] = subdirs[j];
subdirs[j] = temp;
if (i==0)
(subdirs[i])->up = NULL;
else {
(subdirs[i])->up = subdirs[i-1];
(subdirs[i-1])->down = subdirs[i];
}
if (i== (int)parent->size -1)
(subdirs[i])->down = NULL;
else {
(subdirs[i])->down = subdirs[i+1];
(subdirs[i+1])->up = subdirs[i];
}
if (j==0)
(subdirs[j])->up = NULL;
else {
(subdirs[j])->up = subdirs[j-1];
(subdirs[j-1])->down = subdirs[j];
}
if (j== (int)parent->size -1)
(subdirs[j])->down = NULL;
else {
(subdirs[j])->down = subdirs[j+1];
(subdirs[j+1])->up = subdirs[j];
}
}
void ssort_dirnode (dirnode* subdirs, int left, int right)
{
int i, last;
#if defined(WCD_UNICODE) || defined(WCD_WINDOWS)
static wchar_t wstr_left[WCD_MAXPATH];
static wchar_t wstr_right[WCD_MAXPATH];
#endif
text t_left, t_right;
if (left >= right) return; /* fewer than 2 elements */
swap_dirnodes(subdirs, left, (left + right)/2);
last = left;
for (i = left+1; i <=right; i++)
{
t_left = (subdirs[left])->name;
t_right = (subdirs[i])->name;
#if defined(WCD_UNICODE) || defined(WCD_WINDOWS)
size_t len1 = MBSTOWCS(wstr_left, t_left, (size_t)WCD_MAXPATH);
size_t len2 = MBSTOWCS(wstr_right, t_right, (size_t)WCD_MAXPATH);
if ((len1 == (size_t)(-1)) || (len2 == (size_t)(-1)))
{
/* Erroneous multi-byte sequence */
/* Try 8 bit characters */
# ifdef ENABLE_NLS
if (strcoll(t_right,t_left)<0)
# else
if (strcmp(t_right,t_left)<0)
# endif
swap_dirnodes(subdirs, ++last, i);
} else {
if (wcscoll(wstr_right,wstr_left)<0)
swap_dirnodes(subdirs, ++last, i);
}
#else
# ifdef ENABLE_NLS
if (strcoll(t_right,t_left)<0)
# else
if (strcmp(t_right,t_left)<0)
# endif
swap_dirnodes(subdirs, ++last, i);
#endif
}
swap_dirnodes(subdirs, left, last);
ssort_dirnode(subdirs, left, last-1);
ssort_dirnode(subdirs, last+1, right);
}
void sort_subdirs(dirnode d)
{
ssort_dirnode(d->subdirs,0,(int)(d->size)-1);
}
/*
* Sort the tree alphabeticly
*/
void sortTree(dirnode d)
{
size_t index;
dirnode n;
sort_subdirs(d);
index = 0;
while(index < d->size)
{
n = d->subdirs[index];
sortTree(n);
++index;
}
}
/*****************************************************/
void buildTreeFromNameset(nameset set, dirnode d)
{
size_t i;
if ((set == NULL)||(d == NULL))
return;
sort_list(set);
for (i=0;i < set->size;i++)
{
addPath(set->array[i],d);
}
}
/**********************************************************
*
* NCD (Ninux Czo Directory) can read a tree and build
* a data structure faster than WCD because:
* - NCD has a more compact treefile, optimised for graphical tree.
* - NCD just adds all dirs. No checking for duplicates.
*
* WCD is slower because:
* - WCD has larger treefile, optimised for string matching.
* - WCD has to split every path in directories.
* - WCD searches every path in data structure.
*
* WCD takes slower speed for granted because:
* - no extra file needed for graphical interface.
* - string matching is more important feature.
* - duplicates are skipped
* - These functions can be used on all WCD treefiles
* and match lists. This enables a graphical match list.
*
***********************************************************/
/*****************************************************/
/*
* When reading complete tree files, it is faster to build the
* dirnode tree directly from file, instead of reading the tree files
* in a nameset first. Building the nameset costs a lot of reallocs.
*
* Each time this function is called the file is appended to the dirnode.
*
* Also sorting a dirnode tree is faster, because we only need to compare
* directory names instead of whole paths.
*
* Most time is spend in addPath(). addPath() has been made faster by
* using pointers directly instead of the dirnode API functions.
*
*/
void buildTreeFromFile(char* filename, dirnode d, int quiet)
{
FILE *infile;
int bomtype, line_nr=1;
if ((filename == NULL)||(d == NULL))
return;
/* open treedata-file */
if ((infile = wcd_fopen_bom(filename,"rb", quiet, &bomtype)) != NULL)
{
while (!feof(infile) && !ferror(infile)) /* parse the file */
{
int len;
char line[WCD_MAXPATH];
len = read_treefile_line(line,infile,filename,&line_nr, bomtype);
if (ferror(infile)) {
wcd_read_error(filename);
wcd_fclose(infile, filename, "r", "buildTreeFromFile: ");
return;
}
++line_nr;
if (len > 0 )
{
wcd_fixpath(line,sizeof(line));
addPath(line,d);
}
}
wcd_fclose(infile, filename, "r", "buildTreeFromFile: ");
} else {
if (!quiet) {
wcd_read_error(filename);
}
}
}
/*****************************************************/
dirnode createRootNode()
{
dirnode rootNode;
rootNode = dirnodeNew(NULL,NULL,NULL);
if (rootNode != NULL)
{
dirnodeSetName(textNew(ROOTDIR),rootNode);
dirnodeSetX(0,rootNode);
dirnodeSetY(0,rootNode);
}
return(rootNode);
}
/************************************************
*
* Search for dirnode with with path `path'.
* If dirnode is not found return closest parent
* dirnode.
*
************************************************/
dirnode searchNodeForDir(text path, dirnode d, dirnode rNode)
{
char *s;
dirnode n;
dirnode rootnode;
#if (defined(_WIN32) || defined(__CYGWIN__))
static char buf[WCD_MAXPATH] = "//" ;
#endif
if (d == NULL)
return(NULL);
if (rNode == NULL)
{
rootnode = endOfRecursionOfDirnodeParent(d);
return searchNodeForDir(path, rootnode, rootnode); /* start on top of tree */
}
#if (defined(_WIN32) || defined(__CYGWIN__))
if ( (path != NULL) &&
(*path == '/') &&
(*(path+1) == '/') )
{
s = strtok(path,"/");
if (s != NULL)
{
buf[2] = '\0';
strcat(buf, s);
s = buf;
}
}
else
#endif
s = strtok(path,"/");
if (s != NULL)
{
size_t index = inDirnode(s,d);
if (index == (size_t) -1)
{
return(d);
}
else
{
n = elementAtDirnode(index,d);
return(searchNodeForDir(NULL,n,rNode));
}
}
return(d);
}
/*****************************************************/
dirnode locatePathOrSo(text path, dirnode d)
{
return(searchNodeForDir(path,d,NULL));
}
/*****************************************************/
char *getNodeFullPath(dirnode node)
{
static text line = NULL;
static text tline = NULL;
dirnode n;
/* The reconstructed path will not be longer than
* it was original in the treedata file. The max length
* is WCD_MAXPATH. See also function `read_treefile()'
*
* The reconstructed path has only an extra slash "/"
* in the beginning on DOS/Windows if environment
* variable HOME or WCDHOME is set
* */
if (line == NULL)
{
line = textNewSize((size_t)(WCD_MAXPATH+1));
}
if (tline == NULL)
{
tline = textNewSize((size_t)(WCD_MAXPATH+1));
}
line[0] = '\0';
n = node;
if (dirnodeHasParent(n) eq false)
strcpy(line,"/");
else
{
while (dirnodeHasParent(n) eq true)
{
strcpy(tline,"/");
strcat(tline,dirnodeGetName(n));
strcat(tline,line);
strcpy(line,tline);
n = dirnodeGetParent(n);
}
}
return(line);
}
/*****************************************************
*
* dirnode Left()
*
* Return Left node, which is parent node
*****************************************************/
dirnode Left(dirnode node)
{
return dirnodeGetParent(node);
}
/*****************************************************
*
* dirnode Down()
*
* Return node Down, which is next node in parent directory
*****************************************************/
dirnode Down(dirnode node)
{
return node->down;
}
/*****************************************************
*
* dirnode Right()
*
* Return Right node, which is first sub node
*****************************************************/
dirnode Right(dirnode node)
{
if(dirnodeFold(node) eq false)
return elementAtDirnode((size_t)0,node);
else
return(NULL);
}
/*****************************************************
*
* dirnode Up()
*
* Return node Up, which is previous node in parent directory
*****************************************************/
dirnode Up(dirnode node)
{
return node->up;
}
/******************************************************
*
* return first node in a certain level
*
******************************************************/
dirnode getAnyNodeInLevel(dirnode node, int level)
{
dirnode n, ndown;
dirnode rootnode;
if (node == NULL)
return(NULL);
rootnode = endOfRecursionOfDirnodeParent(node);
n = rootnode; /* start on top of tree */
while(n != NULL)
{
ndown = Down(n);
while ((ndown != NULL) && (dirnodeGetY(ndown)<=level))
{
n = ndown;
ndown=Down(ndown);
}
if (dirnodeGetY(n) == level)
return(n);
n = Right(n);
}
return(NULL); /* level is larger than tree or <0 */
}
/******************************************************
*
* return first node in a certain level
*
******************************************************/
dirnode getFirstNodeInLevel(dirnode node, int level)
{
return getAnyNodeInLevel(node, level);
}
/******************************************************/
/* get last node (most right side) on a line */
dirnode getLastNodeInSameLevel(dirnode node)
{
if (node == NULL)
return(NULL);
/* In compact mode there is only one node per line */
if (wcd_cwin.graphics_mode & WCD_GRAPH_COMPACT)
return(node);
if (dirHasSubdirs(node) eq false)
return(node);
else
return getLastNodeInSameLevel(elementAtDirnode((size_t)0,node));
}
/******************************************************/
dirnode getLastNodeInLevel(dirnode node, int level)
{
return getLastNodeInSameLevel(getAnyNodeInLevel(node,level));
}
/******************************************************
*
* getNodeCursUp(dirnode curNode)
*
* Get node up in the tree.
* If node is a valid pointer to a node this function
* will return always a node.
******************************************************/
dirnode getNodeCursUp(dirnode curNode)
{
dirnode node;
if ((node = Up(curNode)) == NULL) /* there is no Up node, try left node */
{
if ((node = Left(curNode)) == NULL)
return(curNode); /* there is no Up or Left node, return same node */
}
return(node);
}
/******************************************************
*
* getNodeCursDown(dirnode curNode)
*
* Get node down in the tree.
* If node is a valid pointer to a node this function
* will return always a node.
******************************************************/
dirnode getNodeCursDown(dirnode curNode)
{
dirnode node;
if ((node = Down(curNode)) == NULL)
{
if ((node = Right(curNode)) == NULL)
{
node = getFirstNodeInLevel(curNode,dirnodeGetY(curNode)+1);
if (node == NULL)
return(curNode);
}
}
return(node);
}
/******************************************************
*
* getNodeCursLeft(dirnode curNode)
*
* Get node left in the tree.
* If node is a valid pointer to a node this function
* will return always a node.
******************************************************/
dirnode getNodeCursLeft(dirnode curNode, int *ymax)
{
dirnode node;
if ((wcd_cwin.graphics_mode & WCD_GRAPH_COMPACT) && (wcd_cwin.graphics_mode & WCD_GRAPH_ALT))
{
if((dirnodeHasSubdirs(curNode) eq true) && (curNode->fold eq false))
{
setFold(wcd_cwin.curNode,true,ymax); /* fold */
return(curNode);
}
}
if ((node = Left(curNode)) == NULL)
return(curNode); /* there is no Left node, return same node */
return(node);
}
/******************************************************
*
* getNodeCursRight(dirnode curNode)
*
* Get node right in the tree.
* If node is a valid pointer to a node this function
* will return always a node.
******************************************************/
dirnode getNodeCursRight(dirnode curNode, int graphics_mode)
{
dirnode node;
if ((node = Right(curNode)) == NULL)
{
if (graphics_mode & WCD_GRAPH_ALT) /* stop at end of line */
return(curNode);
if ((node = Down(curNode)) == NULL) /* try to go one down */
{
/* try to go one up and one down */
node = Left(curNode);
while (node != NULL)
{
if(Down(node) != NULL)
return(Down(node));
else
node = Left(node);
}
/* node == NULL */
return(curNode);
}
}
return(node);
}
/******************************************************/
dirnode getNodeLnUp(dirnode curNode)
{
dirnode dn;
dn = getLastNodeInLevel(curNode, dirnodeGetY(curNode)-1);
if(dn == NULL)
{
return(curNode);
}
else
{
return(dn);
}
}
/******************************************************/
dirnode getNodeLnDn(dirnode curNode)
{
dirnode dn;
dn = getFirstNodeInLevel(curNode,dirnodeGetY(curNode)+1);
if(dn == NULL)
return(curNode);
else
return(dn);
}
/******************************************************/
dirnode getNodePrev(dirnode curNode)
{
dirnode node;
if (curNode == NULL)
return(NULL);
node = Left(curNode);
if ((node != NULL) && (dirnodeGetY(node)==dirnodeGetY(curNode)))
{
return(node);
}
return(getNodeLnUp(curNode));
}
/******************************************************/
dirnode getLastDescendant(dirnode node)
{
dirnode n;
dirnode rootnode;
if (node == NULL)
return(NULL);
rootnode = endOfRecursionOfDirnodeParent(node);
n = rootnode; /* start on top of tree */
while(n != NULL)
{
while (Down(n) != NULL)
n=Down(n);
if (Right(n) == NULL)
return(n);
n = Right(n);
}
return(NULL);
}
/******************************************************/
dirnode prevNodeCiclic(dirnode curNode)
{
dirnode rootnode;
if (curNode == NULL)
return NULL;
rootnode = endOfRecursionOfDirnodeParent(curNode);
if (curNode == rootnode)
return(getLastDescendant(curNode));
return(getNodePrev(curNode));
}
/******************************************************/
dirnode nextNodeCiclic(dirnode curNode)
{
dirnode node;
dirnode rootnode;
if (curNode == NULL)
return NULL;
rootnode = endOfRecursionOfDirnodeParent(curNode);
node = getNodeCursRight(curNode, WCD_GRAPH_NORMAL);
if (node == curNode)
return(rootnode);
else
return(node);
}
/******************************************************/
int getNodeDepth(dirnode curNode)
{
dirnode node;
int thisdepth = 0;
node = curNode;
while ((node = Left(node)) != NULL)
thisdepth++;
return(thisdepth);
}
/******************************************************/
dirnode getNodeCursDownNatural(dirnode curNode, int graphics_mode)
{
dirnode node,oldnode;
int thisdepth;
if(Down(curNode) != NULL)
return(Down(curNode)); /* go down */
if (graphics_mode & WCD_GRAPH_ALT)
return(curNode); /* stop */
thisdepth = getNodeDepth(curNode);
oldnode = curNode;
node = getNodeCursRight(curNode, graphics_mode);
/* There was no direct down node, try to find down node on same level */
while ( (node != NULL) &&
(node !=oldnode) &&
(getNodeDepth(node) != thisdepth))
{
oldnode = node;
node = getNodeCursRight(node, WCD_GRAPH_NORMAL);
}
/* node==NULL or
* node==oldnode or
* dept node == dept oldnode */
if (node != NULL)
{
if (oldnode != node)
return(node);
else
return getNodeCursRight(curNode, WCD_GRAPH_NORMAL);
}
else
return(curNode);
}
/******************************************************/
dirnode getNodeCursUpNatural(dirnode curNode, int graphics_mode)
{
dirnode node,oldnode;
int thisdepth;
if(Up(curNode) != NULL)
return(Up(curNode)); /* go up */
if (graphics_mode & WCD_GRAPH_ALT)
return(curNode); /* stop */
thisdepth = getNodeDepth(curNode);
oldnode = curNode;
node = getNodePrev(curNode);
while ( (node != NULL) &&
(node !=oldnode) &&
(getNodeDepth(node) != thisdepth))
{
oldnode = node;
node = getNodePrev(node);
}
/* node==NULL or
* node==oldnode or
* dept node == dept oldnode */
if (node != NULL)
{
if(oldnode != node)
return(node);
else
return(getNodePrev(curNode));
}
else
return(curNode);
}
/******************************************************/
int validSearchDir(char *dir, dirnode curNode, int exact, int ignore_case, int ignore_diacritics)
{
char path[WCD_MAX_INPSTR+2];
char *name;
if ((dir == NULL)||(curNode == NULL))
return(0);
/* The string length of *dir is guaranteed <= WCD_MAX_INPSTR
* *path is max two characters longer
* */
strcpy(path,"*");
wcd_strncat(path,dir,sizeof(path));
if (exact == 0)
strcat(path,"*");
if( (name = strrchr(path,DIR_SEPARATOR)) != NULL)
name++;
else
name = path + 1;
/* matching with wildcard support !!! */
if (
#ifdef WCD_UNICODE
(dd_matchmbs(dirnodeGetName(curNode),name,ignore_case,ignore_diacritics)) &&
(dd_matchmbs(getNodeFullPath(curNode),path,ignore_case,ignore_diacritics))
#else
(dd_matchl(dirnodeGetName(curNode),name,ignore_case,ignore_diacritics)) &&
(dd_matchl(getNodeFullPath(curNode),path,ignore_case,ignore_diacritics))
#endif
)
return(1);
else
return(0);
}
/******************************************************/
dirnode findDirInCiclePrev(char *dir, dirnode curNode, int exact, int ignore_case, int ignore_diacritics)
{
dirnode node;
int valid;
if (curNode == NULL)
return NULL;
node = curNode;
do{
node = prevNodeCiclic(node);
valid = validSearchDir(dir,node,exact,ignore_case,ignore_diacritics);
} while((!valid)&&(node!=curNode));
return(node);
}
/******************************************************/
dirnode findDirInCicle(char *dir, dirnode curNode, int exact, int ignore_case, int ignore_diacritics)
{
dirnode node;
int valid;
if (curNode == NULL)
return NULL;
node = curNode;
do{
node = nextNodeCiclic(node);
valid = validSearchDir(dir,node,exact,ignore_case,ignore_diacritics);
} while((!valid)&&(node!=curNode));
return(node);
}
/************************************************************
*
* updateLine()
* i = nodelevel
* y = screen level
*
* **********************************************************/
#if defined(WCD_UNICODE) || defined(WCD_WINDOWS)
int wcd_wcwidth(wchar_t c)
{
switch(c)
{
case WCD_ACS_HL:
case WCD_ACS_VL:
case WCD_ACS_LT:
case WCD_ACS_LLC:
case WCD_ACS_TT:
case WCD_SPACE:
#ifndef ASCII_TREE
if ((wcd_cwin.graphics_mode & WCD_GRAPH_CJK) && !(wcd_cwin.graphics_mode & WCD_GRAPH_ASCII))
return(2);
else
#endif
return(1);
break;
case WCD_SEL_ON:
case WCD_SEL_OFF:
return(1);
break;
default:
if (wcd_cwin.graphics_mode & WCD_GRAPH_CJK)
return(mk_wcwidth_cjk(c));
else
return(wcwidth(c));
}
}
int wcd_wcswidth(const wchar_t *pwcs, size_t n)
{
if (wcd_cwin.graphics_mode & WCD_GRAPH_CJK)
return(mk_wcswidth_cjk(pwcs, n));
else
return(wcswidth(pwcs, n));
}
#endif
#ifdef WCD_USECURSES
void updateLine(WINDOW *win, dirnode n, int i, int y, dirnode curNode, int xoffset)
{
wcd_uchar *s;
s = (wcd_uchar *)getTreeLine(getLastNodeInLevel(n,i),i,&i,curNode,false, &wcd_cwin.graphics_mode);
if (s != NULL)
{
int j;
#if defined(WCD_UNICODE) || defined(WCD_WINDOWS)
static wchar_t wstr[WCD_MAXPATH];
size_t len = MBSTOWCS(wstr,(char *)s,(size_t)WCD_MAXPATH); /* number of wide characters */
#else
size_t len = strlen((char *)s);
#endif
wmove(win,y,0);
/* if (len == (size_t) -1 )
{
fprintf(stderr,"len = %d\n",len);
fprintf(stderr,"s = %s\n",s);
} */
#if defined(WCD_UNICODE) || defined(WCD_WINDOWS)
/* xoffset is horizontal offset measured in nr. of columns. */
if (len == (size_t) -1)
{
/* Erroneous multi-byte sequence */
/* Try 8 bit characters */
len = strlen((char *)s);
for(j=xoffset;(j<(int)len)&&((j-xoffset)<(COLS-1));j++)
{
switch(s[j])
{
case WCD_ACS_HL:
if (wcd_cwin.graphics_mode & WCD_GRAPH_ASCII)
waddch(win, (chtype)'-');
else
waddch(win,ACS_HLINE);
break;
case WCD_ACS_VL:
if (wcd_cwin.graphics_mode & WCD_GRAPH_ASCII)
waddch(win, (chtype)'|');
else
waddch (win,ACS_VLINE);
break;
case WCD_ACS_LT:
if (wcd_cwin.graphics_mode & WCD_GRAPH_ASCII)
waddch(win, (chtype)'|');
else
waddch (win,ACS_LTEE);
break;
case WCD_ACS_LLC:
if (wcd_cwin.graphics_mode & WCD_GRAPH_ASCII)
waddch(win, (chtype)'`');
else
waddch (win,ACS_LLCORNER);
break;
case WCD_ACS_TT:
if (wcd_cwin.graphics_mode & WCD_GRAPH_ASCII)
waddch(win, (chtype)'+');
else
waddch (win,ACS_TTEE);
break;
case WCD_SPACE:
waddch(win, (chtype)' ');
#ifndef ASCII_TREE
if ((wcd_cwin.graphics_mode & WCD_GRAPH_CJK) && !(wcd_cwin.graphics_mode & WCD_GRAPH_ASCII))
waddch(win, (chtype)' ');
#endif
break;
case WCD_SEL_ON:
wattron(win,A_REVERSE);
waddch(win,(chtype)'['); /* square brackets indicate there was an error. */
break;
case WCD_SEL_OFF:
waddch(win,(chtype)']');
wattroff(win,A_REVERSE);
break;
default:
waddch(win,(chtype)s[j]);
}
}
}
else
{
int width, c;
c = 0; /* count width from beginning of string. */
j = 0;
while ((j<(int)len)&&(c xoffset ) && (j>0) && ( wcd_wcwidth(wstr[j-1]) == 2))
{
/* Last character skipped was a double width character.
* Insert a space. */
j--;
wstr[j] = ' ';
}
#if defined(_WIN32) || defined(__CYGWIN__)
/* xoffset is horizontal offset measured in nr. of columns.
* This may be at the middle of a surrogate pair. */
if ((wstr[j] >= 0xdc00) && (wstr[j] < 0xe000))
{
/* Last character skipped was a surrogate lead.
* First character is a surrogate trail.
* Insert a space. */
wstr[j] = ' ';
}
#endif
while ((j<(int)len)&&(wcd_wcwidth(wstr[j]) == 0 )) /* Skip combining characters */
j++;
width = 0;
if (j<(int)len)
width = wcd_wcwidth(wstr[j]);
while ((j<(int)len)&&(width');
wattroff(win,A_REVERSE);
break;
default:
waddnwstr(win,wstr+j,1);
}
j++;
width = width + wcd_wcwidth(wstr[j]);
}
}
#else
for(j=xoffset;(j<(int)len)&&((j-xoffset)<(COLS-1));j++)
{
switch(s[j])
{
case WCD_ACS_HL:
if (wcd_cwin.graphics_mode & WCD_GRAPH_ASCII)
waddch(win, (chtype)'-');
else
waddch(win,ACS_HLINE);
break;
case WCD_ACS_VL:
if (wcd_cwin.graphics_mode & WCD_GRAPH_ASCII)
waddch(win, (chtype)'|');
else
waddch (win,ACS_VLINE);
break;
case WCD_ACS_LT:
if (wcd_cwin.graphics_mode & WCD_GRAPH_ASCII)
waddch(win, (chtype)'|');
else
waddch (win,ACS_LTEE);
break;
case WCD_ACS_LLC:
if (wcd_cwin.graphics_mode & WCD_GRAPH_ASCII)
waddch(win, (chtype)'`');
else
waddch (win,ACS_LLCORNER);
break;
case WCD_ACS_TT:
if (wcd_cwin.graphics_mode & WCD_GRAPH_ASCII)
waddch(win, (chtype)'+');
else
waddch (win,ACS_TTEE);
break;
case WCD_SPACE:
waddch(win, (chtype)' ');
#ifndef ASCII_TREE
if ((wcd_cwin.graphics_mode & WCD_GRAPH_CJK) && !(wcd_cwin.graphics_mode & WCD_GRAPH_ASCII))
waddch(win, (chtype)' ');
#endif
break;
case WCD_SEL_ON:
wattron(win,A_REVERSE);
waddch(win,(chtype)'<');
break;
case WCD_SEL_OFF:
waddch(win,(chtype)'>');
wattroff(win,A_REVERSE);
break;
default:
waddch(win,(chtype)s[j]);
}
}
#endif
}
}
#define WCD_NAV 0
#define WCD_SEARCH 1
/************************************************************/
char *getZoomStackPath(dirnode stack)
{
static text line = NULL;
size_t i, size;
text name;
if (line == NULL)
{
line = textNewSize((size_t)WCD_MAXPATH);
}
line[0] = '\0';
size = getSizeOfDirnode(stack);
for (i = 0; i < size ; i++)
{
if(i != 0)
strcat(line,"/");
name = dirnodeGetName(elementAtDirnode(i,stack));
if((strlen(line)+strlen(name)) < (size_t)WCD_MAXPATH)
strcat(line,name);
}
return(line);
}
/************************************************************/
void dataRefresh(int ydiff, int init)
{
int i, yoffset, len;
static int xoffset = 0; /* Horizontal offset in number of columns */
static int yposition = -1; /* -1 : not initialized */
wcd_uchar *s;
/*
yoffset is the y-offset in the whole tree of the current node.
ydiff is the y-difference in the whole tree with the previous node.
yposition is the y-offset in the window (0 .. scrollWinHeight-1)
*/
if ((yposition < 0)|| init)
yposition = (wcd_cwin.scrollWinHeight /2);
WCD_WCLEAR(wcd_cwin.scrollWin);
WCD_WCLEAR(wcd_cwin.inputWin);
if (ydiff < 0 )
{
/* going down */
if( yposition-ydiff < (wcd_cwin.scrollWinHeight-1) )
yposition -= ydiff;
else
yposition = (wcd_cwin.scrollWinHeight -2);
}
else
{
/* going up */
if( (yposition-ydiff) > 0 )
yposition -= ydiff;
else
yposition = 1;
}
yoffset = dirnodeGetY(wcd_cwin.curNode) - yposition;
if (yoffset < 0) yoffset = 0;
len=dirnodeGetX(wcd_cwin.curNode)+(int)str_columns(dirnodeGetName(wcd_cwin.curNode))+3;
/* len is total nr of colums of current node plus 3 */
if (len > COLS)
{
int xo = len - COLS;
if ((xo > xoffset) || (xoffset > (dirnodeGetX(wcd_cwin.curNode)-1)))
{
xoffset = xo;
}
}
else
xoffset = 0;
for (i = 0; i < wcd_cwin.scrollWinHeight; i++)
updateLine(wcd_cwin.scrollWin, wcd_cwin.curNode, i+yoffset, i,
wcd_cwin.curNode, xoffset);
for (i = 0; i < COLS; i++)
{
wmove(wcd_cwin.inputWin, 0, i);
waddch(wcd_cwin.inputWin, (chtype)'-');
}
/* mvwprintw(inputWin, 1,0,"%s",getNodeFullPath(curNode)); */
s = (wcd_uchar *)getZoomStackPath(wcd_cwin.zoomStack); /* s has size WCD_MAXPATH */
strcat((char *)s, getNodeFullPath(wcd_cwin.curNode));
wcd_fixpath((char *)s, (size_t)WCD_MAXPATH);
if (s != NULL)
{
#if defined(WCD_UNICODE) || defined(WCD_WINDOWS)
static wchar_t wstr[WCD_MAXPATH]; /* Declarations at beginning of scope for Watcom C */
int width;
#endif
wmove(wcd_cwin.inputWin, 1, 0);
#if defined(WCD_UNICODE) || defined(WCD_WINDOWS)
len = (int)MBSTOWCS(wstr,(char *)s,(size_t)WCD_MAXPATH); /* number of wide characters */
if (len < 0)
{
/* Erroneous multi-byte sequence */
/* Try 8 bit characters */
len = (int)strlen((char *)s);
for (i = 0; (i < len) && (i < (COLS - 1)); i++)
waddch(wcd_cwin.inputWin, (chtype)s[i]);
} else {
i = 0;
width = wcd_wcwidth(wstr[i]);
while ((i 21)
{
wcd_mvwaddstr(win, 0,0,_("NAVIGATION MODE (1/2):"));
wcd_mvwaddstr(win, 1,0,_("h or go left"));
wcd_mvwaddstr(win, 2,0,_("j or go down"));
wcd_mvwaddstr(win, 3,0,_("k or go up"));
wcd_mvwaddstr(win, 4,0,_("l or go right"));
wcd_mvwaddstr(win, 5,0,_("* or v or go forward to dir with same name"));
wcd_mvwaddstr(win, 6,0,_("# or p or go backward to dir with same name"));
wcd_mvwaddstr(win, 7,0,_("^ or a go to beginning of line"));
wcd_mvwaddstr(win, 8,0,_("$ or e go to end of line"));
wcd_mvwaddstr(win, 9,0,_("1 go to root dir"));
wcd_mvwaddstr(win,10,0,_("g or G go to last dir"));
wcd_mvwaddstr(win,11,0,_("f go page forward"));
wcd_mvwaddstr(win,12,0,_("b go page backward"));
wcd_mvwaddstr(win,13,0,_("u go half page up"));
wcd_mvwaddstr(win,14,0,_("d go half page down"));
wcd_mvwaddstr(win,16,0,_("Press any key."));
wrefresh(win);
getch();
WCD_WCLEAR(win);
wcd_mvwaddstr(win, 0,0,_("NAVIGATION MODE (2/2):"));
wcd_mvwaddstr(win, 1,0,_("A switch alternative tree navigation on/off"));
wcd_mvwaddstr(win, 2,0,_("t switch centered mode on/off"));
wcd_mvwaddstr(win, 3,0,_("T toggle between line drawing and ASCII characters"));
wcd_mvwaddstr(win, 4,0,_("m toggle between compact and wide tree"));
wcd_mvwaddstr(win, 5,0,_(" or q abort"));
wcd_mvwaddstr(win, 6,0,_("/ search forward"));
wcd_mvwaddstr(win, 7,0,_("? search backward"));
wcd_mvwaddstr(win, 8,0,_("n repeat last / or ? search"));
wcd_mvwaddstr(win, 9,0,_("CTRL-l or F5 redraw screen"));
wcd_mvwaddstr(win,10,0,_(" select directory"));
wcd_mvwaddstr(win,12,0,_("Press any key."));
wrefresh(win);
getch();
WCD_WCLEAR(win);
wcd_mvwaddstr(win, 0,0,_("SEARCH MODE with wildcard and subdir support:"));
wcd_mvwaddstr(win, 1,0,_(" go left"));
wcd_mvwaddstr(win, 2,0,_(" go down"));
wcd_mvwaddstr(win, 3,0,_(" go up"));
wcd_mvwaddstr(win, 4,0,_(" go right"));
wcd_mvwaddstr(win, 5,0,_("CTRL-v go forward to dir with same name"));
wcd_mvwaddstr(win, 6,0,_("CTRL-p go backward to dir with same name"));
wcd_mvwaddstr(win, 7,0,_("CTRL-a go to beginning of line"));
wcd_mvwaddstr(win, 8,0,_("CTRL-e go to end of line"));
wcd_mvwaddstr(win, 9,0,_("CTRL-g go to last dir"));
wcd_mvwaddstr(win,10,0,_("CTRL-f go page forward"));
wcd_mvwaddstr(win,11,0,_("CTRL-b go page backward"));
wcd_mvwaddstr(win,12,0,_("CTRL-u go half page up"));
wcd_mvwaddstr(win,13,0,_("CTRL-d go half page down"));
wcd_mvwaddstr(win,14,0,_(" or CTRL-x abort SEARCH MODE"));
wcd_mvwaddstr(win,15,0,_("CTRL-n repeat last / or ? search"));
wcd_mvwaddstr(win,16,0,_(" select directory"));
wcd_mvwaddstr(win,18,0,_("Press any key."));
wrefresh(win);
getch();
WCD_WCLEAR(win);
wcd_mvwaddstr(win, 0,0,_("ZOOMING:"));
wcd_mvwaddstr(win, 1,0,_("z or i or CTRL-i zoom in"));
wcd_mvwaddstr(win, 2,0,_("Z or o or CTRL-o zoom out"));
wcd_mvwaddstr(win, 3,0,_("c condense: fold current level"));
wcd_mvwaddstr(win, 4,0,_("C condense: fold subdir level"));
wcd_mvwaddstr(win, 5,0,_("w condense: fold current and subdir levels"));
wcd_mvwaddstr(win, 6,0,_("y or CTRL-y uncondense: unfold current and subdir levels"));
wcd_mvwaddstr(win, 7,0,_("r or CTRL-r uncondense: unfold all directories"));
wcd_mvwaddstr(win, 8,0,_("- fold directory"));
wcd_mvwaddstr(win, 9,0,_("+ or = unfold directory"));
wcd_mvwaddstr(win,10,0,_("l or unfold and go right"));
wcd_mvwaddstr(win,11,0,_("Press any key."));
}
else
wcd_mvwaddstr(win, 0,0,_("Screenheight must be > 21 for help."));
wrefresh(win);
getch();
}
/************************************************************/
dirnode pushZoom(dirnode zoomStack, dirnode curNode, int *ymax)
{
dirnode znew; /* new element on zoom stack */
dirnode top;
if ((zoomStack == NULL)||(curNode == NULL))
return(NULL);
top = endOfRecursionOfDirnodeParent(curNode);
if (curNode == top) /* we are at the top */
return(curNode);
/* store Parent, Up and Down pointers in znew */
znew = dirnodeNew(dirnodeGetParent(curNode),dirnodeGetUp(curNode),dirnodeGetDown(curNode));
dirnodeSetName(textNew(getNodeFullPath(curNode)),znew);
addToDirnode (znew,zoomStack);
/* curNode will be the new top node */
dirnodeSetParent(NULL,curNode);
dirnodeSetUp(NULL,curNode);
dirnodeSetDown(NULL,curNode);
dirnodeSetX(0,curNode);
dirnodeSetY(0,curNode);
setXYTree(curNode, &wcd_cwin.graphics_mode);
*ymax = dirnodeGetY(getLastDescendant(curNode));
return(curNode);
}
/************************************************************/
dirnode popZoom(dirnode zoomStack, dirnode curNode, int *ymax)
{
dirnode zlast; /* element on zoom stack */
dirnode top; /* the current top node */
dirnode newtop; /* the new top node */
size_t size;
if ((zoomStack == NULL)||(curNode == NULL))
return(NULL);
size = getSizeOfDirnode(zoomStack);
if( size == 0)
return(NULL); /* stack is empty */
else
zlast = elementAtDirnode(size - 1,zoomStack); /* get last element on stack */
top = endOfRecursionOfDirnodeParent(curNode);
/* restore pointers on top node */
dirnodeSetParent(dirnodeGetParent(zlast),top);
dirnodeSetUp(dirnodeGetUp(zlast),top);
dirnodeSetDown(dirnodeGetDown(zlast),top);
/* remove last element from stack */
removeElementAtDirnode(size - 1, zoomStack, true, true);
newtop = endOfRecursionOfDirnodeParent(top);
dirnodeSetX(0,newtop);
dirnodeSetY(0,newtop);
setXYTree(newtop, &wcd_cwin.graphics_mode);
*ymax = dirnodeGetY(getLastDescendant(newtop));
return(newtop);
}
/****************************************************************
* setFold()
* Unfold or fold a dirnode
*
****************************************************************/
void setFold(dirnode n, c3po_bool f, int *ymax)
{
dirnode d;
if (n == NULL)
return;
else
{
if (n->size > 0) /* only (un)fold directories that have subdirs */
{
dirnodeSetFold(f,n);
d = endOfRecursionOfDirnodeParent(n);
setXYTree(d, &wcd_cwin.graphics_mode);
*ymax = dirnodeGetY(getLastDescendant(d));
}
}
return;
}
/****************************************************************
* setfold_tree()
* Fold or unfold all dirnodes in tree
*
****************************************************************/
void setFold_tree(dirnode d, c3po_bool *f)
{
dirnode n;
if(dirnodeHasSubdirs(d) eq true) /* only (un)fold directories that have subdirs */
{
size_t index = 0;
size_t size = getSizeOfDirnode(d);
d->fold = *f;
while(index < size)
{
n = elementAtDirnode(index,d);
setFold_tree(n,f);
index++;
}
}
return;
}
/*****************************************************************
* setfold_sub()
* Fold or unfold all dirnode from a sub dirnode
*****************************************************************/
void setFold_sub(dirnode d, c3po_bool f, int *ymax)
{
dirnode top;
if (d == NULL)
return;
else
{
setFold_tree(d,&f);
d->fold = false;
top = endOfRecursionOfDirnodeParent(d);
setXYTree(top, &wcd_cwin.graphics_mode);
*ymax = dirnodeGetY(getLastDescendant(top));
return;
}
}
/*****************************************************************
* setfold_all()
* Fold or unfold all dirnode from top dirnode
*****************************************************************/
void setFold_all(dirnode n, c3po_bool f, int *ymax)
{
dirnode top;
if (n == NULL)
return;
else
{
top = endOfRecursionOfDirnodeParent(n);
setFold_sub(top,f,ymax);
return;
}
}
/****************************************************************
*
* condenseSubdirs()
* This function folds all subdirectories of a dirnode.
*
*****************************************************************/
void condenseSubdirs(dirnode n, int *ymax)
{
size_t i;
dirnode d;
if ((n == NULL)||(dirHasSubdirs(n) eq false))
return;
for(i=0;isize;i++)
{
d = elementAtDirnode(i,n);
if (d-> size > 0)
d->fold = true;
}
d = endOfRecursionOfDirnodeParent(n);
setXYTree(d, &wcd_cwin.graphics_mode);
*ymax = dirnodeGetY(getLastDescendant(d));
return;
}
/***************************************************************/
void condense(dirnode n, int *ymax)
{
if((n == NULL) || (dirnodeHasParent(n) eq false))
return;
condenseSubdirs(dirnodeGetParent(n),ymax);
}
/***************************************************************/
#define Key_CTRL(x) ((x) & 31)
char *selectANode(dirnode tree, int *use_HOME, int ignore_case, int graphics_mode,int ignore_diacritics)
{
int c = 0, n =0, y, ymax;
int ydiff;
char curPath[WCD_MAXPATH];
char *ptr, *ptr2;
SCREEN *sp;
#if defined(WCD_UNICODE) || defined(WCD_WINDOWS)
wint_t ch;
#endif
wcd_cwin.mode = WCD_NAV;
wcd_cwin.graphics_mode = graphics_mode;
ydiff = 0;
if (tree == NULL)
return NULL;
ptr=NULL;
if (getCurPath(curPath, (size_t)WCD_MAXPATH, use_HOME) == NULL)
return NULL;
wcd_cwin.curNode = locatePathOrSo(curPath,tree);
if (wcd_cwin.curNode == NULL)
{
print_error(_("Cannot find the current path %s in the directory tree.\n"), curPath);
return NULL;
}
wcd_cwin.zoomStack = dirnodeNew(NULL,NULL,NULL);
#ifndef KEY_RESIZE
#if CAN_RESIZE
signal (SIGWINCH, signalSigwinch);
#endif
#endif
/* Older versions of PDCurses and ncurses < 5.9.20120922 do not
* support newterm() on Windows */
sp = newterm(NULL,stdout,stdin);
if (sp == NULL)
{
freeDirnode(wcd_cwin.zoomStack,true);
print_error("%s", _("Error opening terminal, falling back to stdout interface.\n"));
return NULL;
}
if (wcd_cwin.graphics_mode & WCD_GRAPH_COLOR)
initcolor();
keypad(stdscr, TRUE);
intrflush(stdscr, FALSE);
cbreak();
noecho();
nonl();
scrollok(stdscr, TRUE); /* enable scrolling */
wcd_cwin.scrollWinHeight = LINES - INPUT_WIN_HEIGHT;
wcd_cwin.scrollWin = newwin(wcd_cwin.scrollWinHeight,COLS,0,0);
if (wcd_cwin.scrollWin == NULL)
{
endwin();
delscreen(sp);
freeDirnode(wcd_cwin.zoomStack,true);
#ifdef XCURSES
XCursesExit();
#endif
print_error("%s", _("error creating scroll window.\n"));
return NULL;
}
scrollok(wcd_cwin.scrollWin, TRUE);
wcd_cwin.inputWin = newwin(INPUT_WIN_HEIGHT,COLS,wcd_cwin.scrollWinHeight,0);
if (wcd_cwin.inputWin == NULL)
{
delwin(wcd_cwin.scrollWin);
endwin();
delscreen(sp);
freeDirnode(wcd_cwin.zoomStack,true);
#ifdef XCURSES
XCursesExit();
#endif
print_error("%s", _("error creating input window.\n"));
return NULL;
}
if (wcd_cwin.graphics_mode & WCD_GRAPH_COLOR)
{
colorbox (wcd_cwin.scrollWin, MENU_COLOR, 0); /* BillyC add colors */
colorbox (wcd_cwin.inputWin, BODY_COLOR, 0); /* BillyC add colors */
}
wcd_cwin.str[n] = '\0';
refresh();
dataRefresh(0, 1);
ymax = dirnodeGetY(getLastDescendant(wcd_cwin.curNode));
while (c != 13 )
{
#if defined(WCD_UNICODE) || defined(WCD_WINDOWS)
c = get_wch(&ch);
#else
c = getch();
#endif
ydiff = wcd_cwin.curNode->y;
if (wcd_cwin.mode == WCD_NAV)
#if defined(WCD_UNICODE) || defined(WCD_WINDOWS)
switch(ch)
#else
switch(c)
#endif
{
case 'y':
if (dirnodeHasParent(wcd_cwin.curNode) eq false)
setFold_sub(wcd_cwin.curNode,false,&ymax); /* unfold tree from current dirnode */
else
setFold_sub(dirnodeGetParent(wcd_cwin.curNode),false,&ymax); /* unfold tree from parent dirnode */
break;
case 'r':
setFold_all(wcd_cwin.curNode,false,&ymax); /* unfold complete tree */
break;
case '-':
setFold(wcd_cwin.curNode,true,&ymax); /* fold */
break;
case '+':
case '=':
setFold(wcd_cwin.curNode,false,&ymax); /* unfold */
break;
case 'c':
condense(wcd_cwin.curNode,&ymax); /* condense */
break;
case 'C':
condenseSubdirs(wcd_cwin.curNode,&ymax); /* condense */
break;
case 'w':
if (dirnodeHasParent(wcd_cwin.curNode) eq false)
setFold_sub(wcd_cwin.curNode,true,&ymax); /* fold tree from current dirnode */
else
setFold_sub(dirnodeGetParent(wcd_cwin.curNode),true,&ymax); /* fold tree from parent dirnode */
break;
case 'b':
y = dirnodeGetY(wcd_cwin.curNode) - wcd_cwin.scrollWinHeight;
if (y < 0)
y = 0;
wcd_cwin.curNode = getFirstNodeInLevel(wcd_cwin.curNode,y);
break;
case 'f':
y = dirnodeGetY(wcd_cwin.curNode) + wcd_cwin.scrollWinHeight;
if (y > ymax)
y = ymax;
wcd_cwin.curNode = getFirstNodeInLevel(wcd_cwin.curNode,y);
break;
case 'u':
y = dirnodeGetY(wcd_cwin.curNode) - (wcd_cwin.scrollWinHeight/2);
if (y < 0)
y = 0;
wcd_cwin.curNode = getFirstNodeInLevel(wcd_cwin.curNode,y);
break;
case 'd':
y = dirnodeGetY(wcd_cwin.curNode) + (wcd_cwin.scrollWinHeight/2);
if (y > ymax)
y = ymax;
wcd_cwin.curNode = getFirstNodeInLevel(wcd_cwin.curNode,y);
break;
case '$':
case 'e':
wcd_cwin.curNode = getLastNodeInSameLevel(wcd_cwin.curNode);
break;
case '^':
case 'a':
wcd_cwin.curNode = getFirstNodeInLevel(wcd_cwin.curNode,dirnodeGetY(wcd_cwin.curNode));
break;
case 'k':
if ((wcd_cwin.graphics_mode & WCD_GRAPH_COMPACT) && (wcd_cwin.graphics_mode & WCD_GRAPH_ALT))
{
y = dirnodeGetY(wcd_cwin.curNode) - 1;
if (y < 0)
y = 0;
wcd_cwin.curNode = getFirstNodeInLevel(wcd_cwin.curNode,y);
}
else
wcd_cwin.curNode = getNodeCursUpNatural(wcd_cwin.curNode, wcd_cwin.graphics_mode);
break;
case 'j':
if ((wcd_cwin.graphics_mode & WCD_GRAPH_COMPACT) && (wcd_cwin.graphics_mode & WCD_GRAPH_ALT))
{
y = dirnodeGetY(wcd_cwin.curNode) + 1;
if (y > ymax)
y = ymax;
wcd_cwin.curNode = getFirstNodeInLevel(wcd_cwin.curNode,y);
}
else
wcd_cwin.curNode = getNodeCursDownNatural(wcd_cwin.curNode, wcd_cwin.graphics_mode);
break;
case ',':
case 'h':
wcd_cwin.curNode = getNodeCursLeft(wcd_cwin.curNode, &ymax);
break;
case '.':
case 'l':
if(dirnodeFold(wcd_cwin.curNode) eq true)
{
setFold(wcd_cwin.curNode,false,&ymax);
}
wcd_cwin.curNode = getNodeCursRight(wcd_cwin.curNode, wcd_cwin.graphics_mode);
break;
case '1': /* goto rootnode */
wcd_cwin.curNode = endOfRecursionOfDirnodeParent(wcd_cwin.curNode);
break;
case 'G': /* goto last node */
case 'g':
wcd_cwin.curNode = getLastDescendant(wcd_cwin.curNode);
break;
case 'p':
case '#':
wcd_cwin.curNode = findDirInCiclePrev(dirnodeGetName(wcd_cwin.curNode),wcd_cwin.curNode,1,ignore_case,ignore_diacritics);
break;
case ' ':
case 'v':
case '*':
wcd_cwin.curNode = findDirInCicle(dirnodeGetName(wcd_cwin.curNode),wcd_cwin.curNode,1,ignore_case,ignore_diacritics);
break;
case '/':
wcd_cwin.mode = WCD_SEARCH;
wcd_cwin.str[0] = '\0';
n = 0;
break;
case '?':
wcd_cwin.mode = WCD_SEARCH;
wcd_cwin.str[0] = '\0';
n = 0;
break;
case 'n':
ptr2 = wcd_cwin.str + 1;
if (n>1)
{
if (wcd_cwin.str[0] == '/')
wcd_cwin.curNode = findDirInCicle(ptr2,wcd_cwin.curNode,0,ignore_case,ignore_diacritics);
else
wcd_cwin.curNode = findDirInCiclePrev(ptr2,wcd_cwin.curNode,0,ignore_case,ignore_diacritics);
}
break;
case ':':
showHelp(wcd_cwin.scrollWin,wcd_cwin.scrollWinHeight);
break;
case 'q':
#if defined(WCD_UNICODE) || defined(WCD_WINDOWS)
ch = 3; /* 3 = Control-C */
#else
c = 3; /* 3 = Control-C */
#endif
break;
case 'i':
case 'z':
pushZoom(wcd_cwin.zoomStack,wcd_cwin.curNode,&ymax);
break;
case 'o':
case 'Z':
popZoom(wcd_cwin.zoomStack,wcd_cwin.curNode,&ymax);
break;
case 8: /* backspace */
case KEY_BACKSPACE:
wcd_cwin.curNode = findDirInCiclePrev(dirnodeGetName(wcd_cwin.curNode),wcd_cwin.curNode,1,ignore_case,ignore_diacritics);
break;
case 't':
wcd_cwin.graphics_mode ^= WCD_GRAPH_CENTER ;
break;
case 'T':
wcd_cwin.graphics_mode ^= WCD_GRAPH_ASCII ;
if (wcd_cwin.graphics_mode & WCD_GRAPH_CJK)
setXYTree(endOfRecursionOfDirnodeParent(wcd_cwin.curNode),&wcd_cwin.graphics_mode);
break;
case 'A':
wcd_cwin.graphics_mode ^= WCD_GRAPH_ALT ;
break;
case 'm':
wcd_cwin.graphics_mode ^= WCD_GRAPH_COMPACT ;
setXYTree(endOfRecursionOfDirnodeParent(wcd_cwin.curNode),&wcd_cwin.graphics_mode);
ymax = dirnodeGetY(getLastDescendant(wcd_cwin.curNode));
break;
default:
break;
}
#if defined(WCD_UNICODE) || defined(WCD_WINDOWS)
switch(ch)
#else
switch(c)
#endif
{
case Key_CTRL ('y'):
if (dirnodeHasParent(wcd_cwin.curNode) eq false)
setFold_sub(wcd_cwin.curNode,false,&ymax); /* unfold tree from current dirnode */
else
setFold_sub(dirnodeGetParent(wcd_cwin.curNode),false,&ymax); /* unfold tree from parent dirnode */
break;
case Key_CTRL('r'):
setFold_all(wcd_cwin.curNode,false,&ymax); /* unfold complete tree */
break;
#ifdef PADMINUS
case PADMINUS:
setFold(wcd_cwin.curNode,true,&ymax); /* fold */
break;
#endif
#ifdef PADPLUS
case PADPLUS:
setFold(wcd_cwin.curNode,false,&ymax); /* unfold */
break;
#endif
case Key_CTRL ('b'):
case KEY_PPAGE: /* Page Up */
#ifdef KEY_A3
case KEY_A3: /* Num-pad Page Up */
#endif
y = dirnodeGetY(wcd_cwin.curNode) - wcd_cwin.scrollWinHeight;
if (y < 0)
y = 0;
wcd_cwin.curNode = getFirstNodeInLevel(wcd_cwin.curNode,y);
break;
case Key_CTRL ('f'):
case KEY_NPAGE: /* Page down */
#ifdef KEY_C3
case KEY_C3: /* Num-pad page down */
#endif
y = dirnodeGetY(wcd_cwin.curNode) + wcd_cwin.scrollWinHeight;
if (y > ymax)
y = ymax;
wcd_cwin.curNode = getFirstNodeInLevel(wcd_cwin.curNode,y);
break;
case Key_CTRL ('u'):
y = dirnodeGetY(wcd_cwin.curNode) - (wcd_cwin.scrollWinHeight/2);
if (y < 0)
y = 0;
wcd_cwin.curNode = getFirstNodeInLevel(wcd_cwin.curNode,y);
break;
case Key_CTRL ('d'):
y = dirnodeGetY(wcd_cwin.curNode) + (wcd_cwin.scrollWinHeight/2);
if (y > ymax)
y = ymax;
wcd_cwin.curNode = getFirstNodeInLevel(wcd_cwin.curNode,y);
break;
case Key_CTRL ('e'):
#ifdef KEY_END
case KEY_END:
#endif
#ifdef KEY_C1
case KEY_C1: /* Num-pad END */
#endif
wcd_cwin.curNode = getLastNodeInSameLevel(wcd_cwin.curNode);
break;
case Key_CTRL ('a'):
case KEY_HOME:
#ifdef KEY_A1
case KEY_A1: /* Num-pad HOME */
#endif
wcd_cwin.curNode = getFirstNodeInLevel(wcd_cwin.curNode,dirnodeGetY(wcd_cwin.curNode));
break;
case KEY_UP: /* Arrow Up */
#ifdef KEY_A2
case KEY_A2: /* Num-pad ARROW UP */
#endif
if ((wcd_cwin.graphics_mode & WCD_GRAPH_COMPACT) && (wcd_cwin.graphics_mode & WCD_GRAPH_ALT))
{
y = dirnodeGetY(wcd_cwin.curNode) - 1;
if (y < 0)
y = 0;
wcd_cwin.curNode = getFirstNodeInLevel(wcd_cwin.curNode,y);
}
else
wcd_cwin.curNode = getNodeCursUpNatural(wcd_cwin.curNode, wcd_cwin.graphics_mode);
break;
case KEY_DOWN: /* Arrow down */
#ifdef KEY_C2
case KEY_C2: /* Num-pad Arrow down */
#endif
if ((wcd_cwin.graphics_mode & WCD_GRAPH_COMPACT) && (wcd_cwin.graphics_mode & WCD_GRAPH_ALT))
{
y = dirnodeGetY(wcd_cwin.curNode) + 1;
if (y > ymax)
y = ymax;
wcd_cwin.curNode = getFirstNodeInLevel(wcd_cwin.curNode,y);
}
else
wcd_cwin.curNode = getNodeCursDownNatural(wcd_cwin.curNode, wcd_cwin.graphics_mode);
break;
case KEY_LEFT:
#ifdef KEY_B1
case KEY_B1: /* Num-pad Arrow left */
#endif
wcd_cwin.curNode = getNodeCursLeft(wcd_cwin.curNode, &ymax);
break;
case KEY_RIGHT:
#ifdef KEY_B3
case KEY_B3: /* Num-pad key_right */
#endif
if(dirnodeFold(wcd_cwin.curNode) eq true)
{
setFold(wcd_cwin.curNode,false,&ymax);
}
wcd_cwin.curNode = getNodeCursRight(wcd_cwin.curNode, wcd_cwin.graphics_mode);
break;
case Key_CTRL ('g'):
wcd_cwin.curNode = getLastDescendant(wcd_cwin.curNode);
break;
case Key_CTRL ('p'):
wcd_cwin.curNode = findDirInCiclePrev(dirnodeGetName(wcd_cwin.curNode),wcd_cwin.curNode,1,ignore_case,ignore_diacritics);
break;
case Key_CTRL ('v'):
wcd_cwin.curNode = findDirInCicle(dirnodeGetName(wcd_cwin.curNode),wcd_cwin.curNode,1,ignore_case,ignore_diacritics);
break;
case Key_CTRL ('n'):
ptr2 = wcd_cwin.str + 1;
if (n>1)
{
if (wcd_cwin.str[0] == '/')
wcd_cwin.curNode = findDirInCicle(ptr2,wcd_cwin.curNode,0,ignore_case,ignore_diacritics);
else
wcd_cwin.curNode = findDirInCiclePrev(ptr2,wcd_cwin.curNode,0,ignore_case,ignore_diacritics);
}
break;
case KEY_F (1):
showHelp(wcd_cwin.scrollWin,wcd_cwin.scrollWinHeight);
break;
case KEY_F (5):
case Key_CTRL ('l'):
#ifdef KEY_RESIZE
case KEY_RESIZE:
#endif
ioResize();
break;
case Key_CTRL ('i'):
pushZoom(wcd_cwin.zoomStack,wcd_cwin.curNode,&ymax);
break;
case Key_CTRL ('o'):
popZoom(wcd_cwin.zoomStack,wcd_cwin.curNode,&ymax);
break;
case 3: /* Control-C */
case 27: /* Escape */
case Key_CTRL (']'):
case Key_CTRL ('x'):
case Key_CTRL ('q'):
if (wcd_cwin.mode == WCD_SEARCH)
wcd_cwin.mode = WCD_NAV;
else
c = 13;
break;
case 13: /* Enter */
case KEY_ENTER:
c = 13;
ptr = getZoomStackPath(wcd_cwin.zoomStack); /* s has size WCD_MAXPATH */
strcat(ptr,getNodeFullPath(wcd_cwin.curNode));
wcd_fixpath(ptr, (size_t)WCD_MAXPATH);
break;
case 8: /* backspace */
case 127: /* delete */
case KEY_BACKSPACE:
case KEY_DC:
if(n==1)
wcd_cwin.mode = WCD_NAV;
if(n>1) n--;
wcd_cwin.str[n] = '\0';
#if defined(WCD_UNICODE) || defined(WCD_WINDOWS)
wcd_cwin.wstr[n] = '\0';
#endif
break;
default:
if ((wcd_cwin.mode == WCD_SEARCH) && (n < (WCD_MAX_INPSTR -1)))
{
#if defined(WCD_UNICODE) || defined(WCD_WINDOWS)
wcd_cwin.wstr[n] = (wchar_t)ch;
n++;
wcd_cwin.wstr[n] = '\0';
/* Convert wide-character input string to byte string. Needed for searching. */
if (WCSTOMBS(wcd_cwin.str, wcd_cwin.wstr, (size_t)WCD_MAX_INPSTR) == (size_t)(-1))
{
n=1;
wcd_cwin.str[n] = '\0';
}
#else
wcd_cwin.str[n] = (char)c;
n++;
wcd_cwin.str[n] = '\0';
#endif
ptr2 = wcd_cwin.str + 1;
if (n>1)
{
if (wcd_cwin.str[0] == '/')
wcd_cwin.curNode = findDirInCicle(ptr2,wcd_cwin.curNode,0,ignore_case,ignore_diacritics);
else
wcd_cwin.curNode = findDirInCiclePrev(ptr2,wcd_cwin.curNode,0,ignore_case,ignore_diacritics);
}
}
break;
}
if (wcd_cwin.curNode == NULL)
{
delwin(wcd_cwin.scrollWin);
delwin(wcd_cwin.inputWin);
endwin();
delscreen(sp);
freeDirnode(wcd_cwin.zoomStack,true);
#ifdef XCURSES
XCursesExit();
#endif
print_error(_("Cannot find the current path %s in the directory tree.\n"), curPath);
return NULL;
}
ydiff -= (wcd_cwin.curNode->y);
if (wcd_cwin.graphics_mode & WCD_GRAPH_CENTER)
dataRefresh(0, 1);
else
dataRefresh(ydiff, 0);
}
delwin(wcd_cwin.scrollWin);
delwin(wcd_cwin.inputWin);
endwin();
delscreen(sp);
freeDirnode(wcd_cwin.zoomStack,true);
#ifdef XCURSES
XCursesExit();
#endif
printf("\n"); /* Extra newline for curses, pdcurses and when ncurses doesn't restore screen */
#ifdef _WCD_DOSFS
/* remove '/' before drive letter */
if ((ptr != NULL)&&(*use_HOME)&&
(*(ptr+1) != '/')) /* UNC path */
trimPath(ptr,1);
#endif
wcd_fixpath(ptr, (size_t)WCD_MAXPATH);
return(ptr);
}
#endif /* WCD_USECURSES */
wcd-6.0.5/src/graphics.h 0000644 0001755 0001001 00000003502 14421240062 014301 0 ustar waterlan Geen /*
Copyright (C) 2000-2013 Erwin Waterlander
This program is free software; you can redistribute it and/or
modify it under the terms of the GNU General Public License
as published by the Free Software Foundation; either version 2
of the License, or (at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software
Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
*/
#ifndef _WCD_GRAPHICS_H
#define _WCD_GRAPHICS_H
dirnode createRootNode(void);
void buildTreeFromFile(char *filename, dirnode d, int quiet);
void buildTreeFromNameset(nameset set, dirnode d);
void sortTree(dirnode d);
void setXYTree(dirnode d, const int *graphics_mode);
void dumpTree(dirnode d, const int *graphics_mode);
char *selectANode(dirnode tree, int *use_HOME, int ignore_case, int graphics_mode,int ignore_diacritics);
void setFold(dirnode n, c3po_bool f, int *ymax);
#define WCD_GRAPH_NO 0 /* no graphics */
#define WCD_GRAPH_NORMAL 1 /* graphics mode */
#define WCD_GRAPH_DUMP 2 /* dump graphics */
#define WCD_GRAPH_ALT 4 /* alternative navigating */
#define WCD_GRAPH_COLOR 8 /* colors */
#define WCD_GRAPH_CENTER 16 /* center current directory */
#define WCD_GRAPH_ASCII 32 /* draw tree with ASCII characters */
#define WCD_GRAPH_COMPACT 64 /* draw compact tree */
#define WCD_GRAPH_CJK 128 /* East-Asian CJK font with double width line drawing symbols */
#if defined(WCD_UNICODE) || defined(WCD_WINDOWS)
int wcd_wcwidth(wchar_t c);
int wcd_wcswidth(const wchar_t *pwcs, size_t n);
#endif
#endif
wcd-6.0.5/src/Makefile 0000644 0001755 0001001 00000050160 14421240062 013772 0 ustar waterlan Geen # Copyright information
#
# Copyright (C) 2009-2022 Erwin Waterlander
# Copyright (C) 2009 Jari Aalto
#
# License
#
# This program is free software; you can redistribute it and/or
# modify it under the terms of the GNU General Public License as
# published by the Free Software Foundation; either version 2 of the
# License, or (at your option) any later version
#
# This program is distributed in the hope that it will be useful, but
# WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
# General Public License for more details at
# Visit .
#
# Description
#
# This is a GNU Makefile that uses GNU compilers, linkers and cpp. The
# platform specific issues are determined by the various OS teets that
# rely on the uname(1) command and directory locations.
#
# Developer notes
#
# In order to clean generated POD files and manuals:
#
# make maintainer-clean
#
# Set additional flags for the build with variables CFLAGS_USER,
# DEFS_USER and LDFLAGS_USER.
ifneq (,)
This makefile requires GNU Make.
endif
include version.mk
.PHONY: status uninstall install install-man install-doc install-pdf dist dist-zip dist-tgz
.PHONY: doc man txt html ps pdf mofiles tags merge
.PRECIOUS: %.1 %.pod
CC ?= gcc
STATIC =
STRIP = strip
ENABLE_NLS = 1
PACKAGE = wcd
EXT = .exe
PROGRAM = $(PACKAGE)$(EXT)
BIN = $(PROGRAM)
PREFIX = /usr
prefix = $(PREFIX)
exec_prefix = $(prefix)
bindir = $(exec_prefix)/bin
datarootdir = $(prefix)/share
datadir = $(datarootdir)
docsubdir = $(PACKAGE)-$(VERSION)
docdir = $(datarootdir)/doc/$(docsubdir)
localedir = $(datarootdir)/locale
sysconfdir = /etc
# 1 = regular, 5 = conf, 6 = games, 8 = daemons
mandir = $(datarootdir)/man
man1dir = $(mandir)/man1
# On some systems (e.g. FreeBSD 4.10) GNU install is installed as `ginstall'.
INSTALL = install
# On some systems (e.g. GNU Win32) GNU mkdir is installed as `gmkdir'.
MKDIR = mkdir
INSTALL_PROGRAM = $(INSTALL) -m 755
INSTALL_DATA = $(INSTALL) -m 644
INSTALL_SUID = $(INSTALL) -m 4755
INSTALL_OBJS_BIN = $(BIN)
HTMLEXT = htm
# English manual
MANFILES_EN = man/man1/wcd.1
TXTFILES_EN = man/man1/wcd.txt
HTMLFILES_EN = man/man1/wcd.$(HTMLEXT)
PSFILES_EN = man/man1/wcd.ps
PDFFILES_EN = man/man1/wcd.pdf
# Documents for end users, not for developers:
INSTALL_OBJS_DOC = \
../doc/faq.txt \
../doc/whatsnew.txt \
../doc/README.txt \
../doc/problems.txt \
../doc/todo.txt \
../doc/INSTALL.txt \
../doc/UNIX.txt \
../doc/copying.txt
ifdef ENABLE_NLS
POT = po/$(PACKAGE).pot
POFILES = $(wildcard po/*.po)
MOFILES = $(patsubst %.po,%.mo,$(POFILES))
NLSSUFFIX = -nls
endif
# International manuals
ifdef ENABLE_NLS
MANPOTFILE = po-man/wcd-man.pot
MANPOFILES = $(wildcard po-man/*.po)
MANPODFILES = $(patsubst po-man/%.po,man/%/man1/wcd.pod,$(MANPOFILES))
endif
MANFILES = $(patsubst %.pod,%.1,$(MANPODFILES))
TXTFILES = $(patsubst %.pod,%.txt,$(MANPODFILES))
HTMLFILES = $(patsubst %.pod,%.$(HTMLEXT),$(MANPODFILES))
PSFILES = $(patsubst %.pod,%.ps,$(MANPODFILES))
PDFFILES = $(patsubst %.pod,%.pdf,$(MANPODFILES))
CPP = cpp
CFLAGS_VERSION = -DVERSION=\"$(VERSION)\" -DVERSION_DATE=\"$(VERSION_DATE)\"
DEF_UNIX = -DUNIX
EXTRA_DEFS =
VERSIONSUFFIX = -bin
# Large File Support (LFS)
LFS = 1
# DEBUG=1 adds the -g option to CFLAGS, for adding debug symbols.
DEBUG = 0
# DEBUGMSG=1 adds -DDEBUG=1 to CFLAGS, for extra verbose messages.
DEBUGMSG = 0
wcd_os := $(shell uname)
# Enble Unicode
UCS = 1
ifdef WCD_UTF8
# WCD_UTF8 was used in older versions.
UCS=1
endif
ifdef UNINORM
UCS = 1
endif
ZIPOBJ = bin/$(BIN) \
share/man/man1/$(PACKAGE).1 \
share/doc/$(docsubdir)/*.* \
$(ZIPOBJ_EXTRA)
INSTALL_TARGETS = install-bin install-man install-doc
ifdef ENABLE_NLS
INSTALL_TARGETS += install-mo
ZIPOBJ += share/locale/*/LC_MESSAGES/$(PACKAGE).mo
ZIPOBJ += share/man/*/man1/$(PACKAGE).1
ZIPOBJ += share/doc/$(docsubdir)/*/*
endif
ifdef ENABLE_NLS
NLSDEFS = -DENABLE_NLS -DLOCALEDIR=\"$(localedir)\" -DPACKAGE=\"$(PACKAGE)\"
endif
# ......................................................... OS flags ...
OS =
ifndef OS
ifeq ($(findstring CYGWIN,$(wcd_os)),CYGWIN)
OS = cygwin
endif
endif
ifndef OS
ifeq ($(findstring MSYS,$(wcd_os)),MSYS)
OS = msys
# MSYS 1 does not support locales and no Unicode.
ifeq ($(shell ./chk_loc.sh en_US.utf8),no)
MSYS_VERSION=1
else
MSYS_VERSION=2
endif
endif
endif
ifndef OS
ifeq ($(findstring MINGW,$(wcd_os)),MINGW)
OS = mingw
endif
endif
ifndef OS
ifneq ($(DJGPP),)
OS = msdos
endif
endif
ifndef OS
ifneq (, $(wildcard /opt/csw))
OS = sun
endif
endif
ifndef OS
OS=$(shell echo $(wcd_os) | tr '[A-Z]' '[a-z]')
endif
ifeq (cygwin,$(OS))
ifdef ENABLE_NLS
LIBS_EXTRA = -lintl -liconv -lmpr
else
LIBS_EXTRA = -lmpr
endif
UNINORM = 1
LDFLAGS_EXTRA = -Wl,--enable-auto-import
INSTALL_TARGETS += install-profile
docsubdir = $(PACKAGE)
MACHINE := $(subst -pc-cygwin,,$(shell gcc -dumpmachine))
VERSIONSUFFIX = -cygwin-$(MACHINE)
endif
ifeq (os/2,$(OS))
prefix = c:/usr
PROGRAM = wcdos2.exe
DEF_UNIX =
UCS =
UNINORM =
LDFLAGS_EXTRA = -Zhigh-mem -Zomf -Zargs-resp
ZIPOBJ_EXTRA=bin/wcd.cmd
VERSIONSUFFIX = -os2
LIBS_EXTRA =
ifdef ENABLE_NLS
LIBS_EXTRA += -lintl
endif
endif
ifeq (mingw,$(OS))
CC = gcc
DEF_UNIX =
LIBS_EXTRA = -lkernel32 -luser32 -lmpr
ifdef ENABLE_NLS
LIBS_EXTRA += -lintl -liconv
endif
endif
ifeq (msdos,$(OS))
CC = gcc
DEF_UNIX =
UCS =
UNINORM =
endif
ifeq (msys,$(OS))
CC = gcc
CFLAGS_OS = -DWCD_MSYS
PROGRAM = wcdmsys.exe
LIBS_EXTRA = -lkernel32 -luser32 -lmpr
MACHINE := $(subst -pc-msys,,$(shell gcc -dumpmachine))
ifeq ($(MSYS_VERSION),1)
UCS =
UNINORM =
VERSIONSUFFIX = -msys1-$(MACHINE)-$(CURSES)
else
UCS = 1
UNINORM = 1
VERSIONSUFFIX = -msys2-$(MACHINE)
endif
ifdef ENABLE_NLS
LIBS_EXTRA += -lintl -liconv
endif
endif
ifeq (freebsd,$(OS))
# Running under FreeBSD
ifdef ENABLE_NLS
CFLAGS_OS = -I/usr/local/include
LDFLAGS_EXTRA = -L/usr/local/lib
LIBS_EXTRA = -lintl
endif
endif
ifeq (darwin, $(OS))
ifdef ENABLE_NLS
CFLAGS_OS = -I/usr/local/include
LDFLAGS_EXTRA = -L/usr/local/lib
LIBS_EXTRA = -lintl
endif
endif
ifeq (sun,$(OS))
# Running under SunOS/Solaris
LIBS_EXTRA = -lintl
endif
ifeq (hp-ux,$(OS))
# Running under HP-UX
EXTRA_DEFS += -Dhpux -D_HPUX_SOURCE -D_XOPEN_SOURCE_EXTENDED
# These flags were for native HP compiler
# CFLAGS_OS = -O -Aa
endif
# .......................................................... unicode ...
ifdef UCS
CFLAGS_UCS = -std=gnu99
WDEFS = -DWCD_UNICODE
endif
ifdef UNINORM
CFLAGS_UCS = -std=gnu99
WDEFS = -DWCD_UNICODE -DWCD_UNINORM
LIB_UNISTRING = -lunistring
endif
ifdef UCS
UCSSUFFIX = -ucs
EXTRA_OBJ += matchw.o
endif
# ........................................................... curses ...
# possible values: ncurses, curses, pdcurses, pdcursesw or
ifdef UCS
CURSES = ncursesw
else
CURSES = ncurses
endif
# The default console for msys1 is the cmd.exe console. rxvt and mintty are
# available for msys1, but I guess most people use cmd, console, or conemu for
# msys1. Therefore we use pdcurses for msys1. msys2's default console is
# mintty. For msys2 we use ncurses.
ifeq (msys,$(OS))
ifeq ($(MSYS_VERSION),1)
CURSES = pdcurses
endif
endif
# The native Windows versions use PDCurses, because there are problems
# with the ncurses mingw port.
# All native Windows versions (with and without Unicode support) use wide
# (Unicode) curses functions.
ifeq (mingw,$(OS))
CURSES = pdcursesw
endif
ifdef CURSES
ifdef UCS
EXTRA_OBJ += wcwidth.o
endif
endif
ifneq (,$(CURSES))
DEFS_CURSES = -DWCD_USECURSES
LIB_CURSES = -l$(CURSES)
ifeq (os/2,$(OS))
LIB_CURSES += -ltinfo
endif
endif
INCPREFIX=/usr
ifeq ($(findstring MINGW,$(wcd_os)),MINGW)
ifeq ($(shell gcc -dumpmachine),i686-w64-mingw32)
INCPREFIX=/mingw32
CFLAGS_COMPILER = -DWCD_MINGW32_W64=1
else
ifeq ($(shell gcc -dumpmachine),x86_64-w64-mingw32)
INCPREFIX=/mingw64
else
INCPREFIX=/mingw
endif
endif
endif
# Each ncurses variant has its own include directory
# ncurses (normal)/ncursesw (wide char)/ncursest (threads)
ifeq ($(findstring ncurses,$(CURSES)),ncurses)
ifneq ($(wildcard $(INCPREFIX)/include/$(CURSES)/curses.h),)
INCFLAGS = -I$(INCPREFIX)/include/$(CURSES) -I$(INCPREFIX)/include
endif
ifeq ($(NCURSES_DEBUG), 1)
LIB_CURSES = -l$(CURSES)_g
endif
else
INCFLAGS = -I$(INCPREFIX)/include
endif
ifeq ($(CURSES),ncursesw)
EXTRA_DEFS += -D_XOPEN_SOURCE -D_XOPEN_SOURCE_EXTENDED
endif
ifeq ($(CURSES),pdcursesw)
EXTRA_DEFS += -DPDC_STATIC_BUILD -DPDC_WIDE
endif
# Local installation prefix of ncurses.
#LOCAL_NCURSES = $(HOME)
#
#ifneq (, $(wildcard $(LOCAL_NCURSES)/include/ncurses.h))
# NCFLAG = -I$(LOCAL_NCURSES)/include
# NLFLAG = -L$(LOCAL_NCURSES)/lib
#endif
# ............................................................ flags ...
# Statically linking of a specific library can be done by linking
# to a lib*.a library file instead a lib*.s* library file.
# To link ncurses statically (if your system links by default
# dynamically) comment the LDFLAGS line and add the 'libncurses.a' file
# (often found as /usr/lib/libncurses.a) to the OBJS1 list.
CFLAGS_USER =
ifeq ($(DEBUG), 1)
CFLAGS_OPT = -O0
else
CFLAGS_OPT = -O2
endif
CFLAGS ?=
CFLAGS += $(CFLAGS_OPT)
ifeq ($(DEBUG), 1)
CFLAGS += -g
endif
CFLAGS += -Wall -Wextra -Wno-unused-parameter -Wconversion $(RPM_OPT_FLAGS) $(CPPFLAGS) $(CFLAGS_USER)
EXTRA_CFLAGS = -Ic3po \
$(CFLAGS_VERSION) \
$(CFLAGS_OS) \
$(CFLAGS_UCS) \
$(CFLAGS_COMPILER) \
$(WDEFS) \
$(NLSDEFS) \
$(NCFLAG) \
$(INCFLAGS) \
-DDEBUG=$(DEBUGMSG)
ifdef LFS
EXTRA_CFLAGS += -D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64
endif
ifdef ASCII_TREE
EXTRA_CFLAGS += -DASCII_TREE
endif
ifdef STATIC
LDFLAG_STATIC = -static
endif
LDFLAGS_USER =
LDFLAGS ?=
LDFLAGS += $(RPM_LD_FLAGS) \
$(LDFLAGS_EXTRA) \
$(NLFLAG) \
$(LDFLAG_STATIC) \
$(LDFLAGS_USER)
LIBS = $(LIB_CURSES) \
$(LIB_UNISTRING) \
$(LIBS_EXTRA)
DEFS_USER =
DEFS = $(DEF_UNIX) $(DEFS_CURSES) $(EXTRA_DEFS) $(DEFS_USER)
# .......................................................... targets ...
OBJS1 = \
wcd.o \
match.o \
stack.o \
nameset.o \
intset.o \
Error.o \
Text.o \
WcdStack.o \
dirnode.o \
display.o \
wfixpath.o \
wcddir.o \
matchl.o \
querycp.o \
finddirs.o \
$(EXTRA_OBJ)
ifneq (,$(CURSES))
OBJS1 += colors.o \
graphics.o
endif
all: $(BIN) doc mofiles man
status:
@echo "-- $(PACKAGE) Makefile settings begin --"
@echo "OS = $(OS)"
@echo "prefix = $(prefix)"
@echo "EXT = $(EXT)"
@echo "UNINORM = $(UNINORM)"
@echo "STATIC = $(STATIC)"
@echo "UCS = $(UCS)"
@echo "ENABLE_NLS = $(ENABLE_NLS)"
@echo "CURSES = $(CURSES)"
@echo "DEFS = $(DEFS)"
@echo "DEFS_CURSES = $(DEFS_CURSES)"
@echo "EXTRA_DEFS = $(EXTRA_DEFS)"
@echo "LDFLAGS = $(LDFLAGS)"
@echo "LDFLAGS_EXTRA = $(LDFLAGS_EXTRA)"
@echo "LIBS = $(LIBS)"
@echo "CFLAGS = $(CFLAGS)"
@echo "CFLAGS_OS = $(CFLAGS_OS)"
@echo "EXTRA_CFLAGS = $(EXTRA_CFLAGS)"
@echo "DEBUG = $(DEBUG)"
@echo "DEBUGMSG = $(DEBUGMSG)"
@echo "-- $(PACKAGE) Makefile settings end --"
$(BIN): $(OBJS1)
$(MAKE) status
$(CC) $(OBJS1) $(LDFLAGS) $(LIBS) -o $@
%.o: %.c
$(CC) $(CFLAGS) $(EXTRA_CFLAGS) $(DEFS) -c $< -o $@
wcd.o: wcd.c wcd.h version.mk
$(CC) $(CFLAGS) $(EXTRA_CFLAGS) $(DEFS) -c $< -o $@
%.o: c3po/%.c
$(CC) $(CFLAGS) $(EXTRA_CFLAGS) $(DEFS) -c $< -o $@
%.pdf: %.ps
ps2pdf $< $@
$(MANPOTFILE) : man/man1/wcd.pod
$(MAKE) -C man/man1 ../../po-man/$(notdir $@)
# WARNING: Backward-incompatibility since GNU make 3.82.
# The pattern-specific variables and pattern rules are now applied in the
# shortest stem first order instead of the definition order (variables
# and rules with the same stem length are still applied in the definition
# order).
# In order to stay compatible with GNU make < 3.82 we put the rule with
# the shortest stem first.
po/%.po : $(POT)
msgmerge --no-wrap -U $@ $(POT) --backup=numbered
# change timestamp in case .po file was not updated.
touch $@
%.po : man/man1/wcd.pod
$(MAKE) -C man/man1 $(subst po-man/,../../po-man/,$@)
man/%/man1/wcd.pod : po-man/%.po
$(MAKE) -C man/man1 $(subst man/,../,$@)
# Empty recipe to break circular dependency.
man/man1/wcd.pod : ;
%.1 : %.pod
$(MAKE) -C man/man1 PODCENTER=$(VERSION_DATE) $(subst man/,../,$@)
%.txt : %.pod
pod2text $< > $@
%.ps : %.1
groff -man $< -T ps > $@
%.$(HTMLEXT) : %.pod
PERL_UNICODE=SDA pod2html --title="$(PACKAGE) $(VERSION) - Wherever Change Directory" $< > $@
man/ro/man1/$(PACKAGE).$(HTMLEXT) : man/ro/man1/$(PACKAGE).pod
PERL_UNICODE=SDA pod2html --title="$(PACKAGE) $(VERSION) - Schimbă oriunde directorul (Wherever Change Directory)" $< > $@
man/sr/man1/$(PACKAGE).$(HTMLEXT) : man/sr/man1/$(PACKAGE).pod
PERL_UNICODE=SDA pod2html --title="$(PACKAGE) $(VERSION) - Промени директоријум било где (Wherever Change Directory)" $< > $@
man/uk/man1/$(PACKAGE).$(HTMLEXT) : man/uk/man1/$(PACKAGE).pod
PERL_UNICODE=SDA pod2html --title="$(PACKAGE) $(VERSION) - довільна зміна каталогу (Wherever Change Directory)" $< > $@
man: $(MANFILES_EN) $(MANFILES) $(MANPOTFILE)
html: $(HTMLFILES_EN) $(HTMLFILES)
txt: $(TXTFILES_EN) $(TXTFILES)
ps: $(PSFILES_EN) $(PSFILES)
pdf: $(PDFFILES_EN) $(PDFFILES)
mofiles: $(MOFILES)
doc: txt html
tags: $(POT)
merge: $(POFILES)
# Get new po files from the Translation Project.
getpo:
rsync -Lrtvz translationproject.org::tp/latest/wcd/ po/incoming/
getpoman:
rsync -Lrtvz translationproject.org::tp/latest/wcd-man/ po-man/incoming/
%.mo : %.po
msgfmt -c $< -o $@
$(POT) : wcd.c wcddir.c stack.c display.c graphics.c wfixpath.c finddirs.c c3po/Error.c
xgettext --no-wrap -C --keyword=_ $+ -o $(POT)
ZIPFILE = $(PACKAGE)-$(VERSION)$(VERSIONSUFFIX)$(NLSSUFFIX)$(UCSSUFFIX).zip
TGZFILE = $(PACKAGE)-$(VERSION)$(VERSIONSUFFIX)$(NLSSUFFIX)$(UCSSUFFIX).tar.gz
dist-zip:
rm -f $(prefix)/$(ZIPFILE)
cd $(prefix) ; zip -r $(ZIPFILE) $(ZIPOBJ)
mv -f $(prefix)/$(ZIPFILE) ../..
dist-tgz:
cd $(prefix) ; tar cvzf $(TGZFILE) $(ZIPOBJ)
mv -f $(prefix)/$(TGZFILE) ../..
dist: dist-tgz
strip:
@echo "-- target: strip"
$(STRIP) $(BIN)
mostlyclean:
@echo "-- target: mostlyclean"
-rm -f \
$(BIN) \
*.exe \
*.o \
*.tmp \
*/*.o \
po/*.mo \
../*/*.bck \
../*/*.bak \
../*/*[#~] \
*.\#* \
*/*.bak \
*/*.bck \
*/*~ \
*/*/*.bak \
*/*/*~ \
*/*/*/*.bak \
*/*/*/*~ \
*.stackdump
clean: mostlyclean
@echo "-- target: clean"
rm -f man/man1/*.ps
rm -f man/man1/*.pdf
rm -f man/*/man1/*.ps
rm -f man/*/man1/*.pdf
distclean: clean
@echo "-- target: distclean"
maintainer-clean: distclean
@echo "-- target: maintainer-clean:"
rm -f man/man1/*.1
rm -f man/man1/*.txt
rm -f man/man1/*.$(HTMLEXT)
rm -f po-man/wcd-man.pot
rm -f man/*/man1/*.1
rm -f man/*/man1/*.txt
rm -f man/*/man1/*.pod
rm -f man/*/man1/*.$(HTMLEXT)
# 'maintainer-clean' was 'realclean' in old GNU standards.
realclean: maintainer-clean
# Install shell function (sh) and alias (csh).
# If DOTWCD=1, the shell scripts define WCDHOME=$HOME/.wcd
install-profile:
@echo "-- target: install-profile"
mkdir -p $(DESTDIR)$(sysconfdir)/profile.d
ifdef DOTWCD
sed -e "s#BINDIR#$(bindir)#" -e "s/PROGRAM/$(BIN)/" -e 's/##//' etc/profile.d/wcd.sh > $(DESTDIR)$(sysconfdir)/profile.d/wcd.sh
sed -e "s#BINDIR#$(bindir)#" -e "s/PROGRAM/$(BIN)/" -e 's/##//' etc/profile.d/wcd.csh > $(DESTDIR)$(sysconfdir)/profile.d/wcd.csh
else
sed -e "s#BINDIR#$(bindir)#" -e "s/PROGRAM/$(BIN)/" etc/profile.d/wcd.sh > $(DESTDIR)$(sysconfdir)/profile.d/wcd.sh
sed -e "s#BINDIR#$(bindir)#" -e "s/PROGRAM/$(BIN)/" etc/profile.d/wcd.csh > $(DESTDIR)$(sysconfdir)/profile.d/wcd.csh
endif
# Old versions of install(1) don't support option -D. Use
# mkdir instead. Was seen on HP-UX 11 and DOS DJGPP.
install-mo: mofiles
@echo "-- target: install-mo"
$(foreach mofile, $(MOFILES), $(MKDIR) -p -m 755 $(DESTDIR)$(localedir)/$(basename $(notdir $(mofile)))/LC_MESSAGES ;)
$(foreach mofile, $(MOFILES), $(INSTALL_DATA) $(mofile) $(DESTDIR)$(localedir)/$(basename $(notdir $(mofile)))/LC_MESSAGES/$(PACKAGE).mo ;)
install-doc: doc
@echo "-- target: install-doc"
$(MKDIR) -p -m 755 $(DESTDIR)$(docdir)
$(INSTALL_DATA) $(INSTALL_OBJS_DOC) $(DESTDIR)$(docdir)
$(INSTALL_DATA) $(TXTFILES_EN) $(DESTDIR)$(docdir)
$(INSTALL_DATA) $(HTMLFILES_EN) $(DESTDIR)$(docdir)
ifdef ENABLE_NLS
$(foreach txtfile, $(TXTFILES), $(MKDIR) -p -m 755 $(DESTDIR)$(docdir)/$(word 2,$(subst /, ,$(txtfile),)) ;)
$(foreach txtfile, $(TXTFILES), $(INSTALL_DATA) $(txtfile) $(DESTDIR)$(docdir)/$(word 2,$(subst /, ,$(txtfile),)) ;)
$(foreach htmlfile, $(HTMLFILES), $(MKDIR) -p -m 755 $(DESTDIR)$(docdir)/$(word 2,$(subst /, ,$(htmlfile),)) ;)
$(foreach htmlfile, $(HTMLFILES), $(INSTALL_DATA) $(htmlfile) $(DESTDIR)$(docdir)/$(word 2,$(subst /, ,$(htmlfile),)) ;)
endif
# No dependency. Install pdf/ps only when they have been manually generated.
install-pdf:
@echo "-- target: install-pdf"
$(MKDIR) -p -m 755 $(DESTDIR)$(docdir)
$(foreach pdffile, $(wildcard man/man1/*.pdf), $(INSTALL_DATA) $(pdffile) $(DESTDIR)$(docdir) ;)
$(foreach psfile, $(wildcard man/man1/*.ps), $(INSTALL_DATA) $(psfile) $(DESTDIR)$(docdir) ;)
ifdef ENABLE_NLS
$(foreach pdffile, $(wildcard man/*/man1/*.pdf), $(MKDIR) -p -m 755 $(DESTDIR)$(docdir)/$(word 2,$(subst /, ,$(pdffile),)) ;)
$(foreach pdffile, $(wildcard man/*/man1/*.pdf), $(INSTALL_DATA) $(pdffile) $(DESTDIR)$(docdir)/$(word 2,$(subst /, ,$(pdffile),)) ;)
$(foreach psfile, $(wildcard man/*/man1/*.ps), $(MKDIR) -p -m 755 $(DESTDIR)$(docdir)/$(word 2,$(subst /, ,$(psfile),)) ;)
$(foreach psfile, $(wildcard man/*/man1/*.ps), $(INSTALL_DATA) $(psfile) $(DESTDIR)$(docdir)/$(word 2,$(subst /, ,$(psfile),)) ;)
endif
install-man: man
@echo "-- target: install-man"
$(MKDIR) -p -m 755 $(DESTDIR)$(man1dir)
$(INSTALL_DATA) $(MANFILES_EN) $(DESTDIR)$(man1dir)
ifdef ENABLE_NLS
$(foreach manfile, $(MANFILES), $(MKDIR) -p -m 755 $(DESTDIR)$(datarootdir)/$(dir $(manfile)) ;)
$(foreach manfile, $(MANFILES), $(INSTALL_DATA) $(manfile) $(DESTDIR)$(datarootdir)/$(dir $(manfile)) ;)
endif
install-bin: $(BIN)
@echo "-- target: install-bin"
$(MKDIR) -p -m 755 $(DESTDIR)$(bindir)
$(INSTALL_PROGRAM) $(INSTALL_OBJS_BIN) $(DESTDIR)$(bindir)
ifeq (os/2,$(OS))
$(INSTALL_PROGRAM) ../os2/$(PACKAGE).cmd $(DESTDIR)$(bindir)
endif
install: $(INSTALL_TARGETS)
# Run a new instance of 'make' otherwise the $$(wildcard ) function my not have been expanded,
# because the files may not have been there when make was started.
$(MAKE) install-pdf
uninstall:
@echo "-- target: uninstall"
-rm -f $(DESTDIR)$(bindir)/$(BIN)
-rm -f $(DESTDIR)$(mandir)/man1/$(PACKAGE).1
-rm -rf $(DESTDIR)$(docdir)
ifdef ENABLE_NLS
$(foreach mofile, $(MOFILES), rm -f $(DESTDIR)$(localedir)/$(basename $(notdir $(mofile)))/LC_MESSAGES/$(PACKAGE).mo ;)
$(foreach manfile, $(MANFILES), rm -f $(DESTDIR)$(datarootdir)/$(manfile) ;)
endif
# End of file
wcd-6.0.5/src/man/ 0000755 0001755 0001001 00000000000 14421240103 013077 5 ustar waterlan Geen wcd-6.0.5/src/man/de/ 0000755 0001755 0001001 00000000000 14421240066 013477 5 ustar waterlan Geen wcd-6.0.5/src/man/de/man1/ 0000755 0001755 0001001 00000000000 14421240120 014322 5 ustar waterlan Geen wcd-6.0.5/src/man/de/man1/wcd.1 0000644 0001755 0001001 00000173107 14421240071 015177 0 ustar waterlan Geen .\" Automatically generated by Pod::Man 4.14 (Pod::Simple 3.40)
.\"
.\" Standard preamble:
.\" ========================================================================
.de Sp \" Vertical space (when we can't use .PP)
.if t .sp .5v
.if n .sp
..
.de Vb \" Begin verbatim text
.ft CW
.nf
.ne \\$1
..
.de Ve \" End verbatim text
.ft R
.fi
..
.\" Set up some character translations and predefined strings. \*(-- will
.\" give an unbreakable dash, \*(PI will give pi, \*(L" will give a left
.\" double quote, and \*(R" will give a right double quote. \*(C+ will
.\" give a nicer C++. Capital omega is used to do unbreakable dashes and
.\" therefore won't be available. \*(C` and \*(C' expand to `' in nroff,
.\" nothing in troff, for use with C<>.
.tr \(*W-
.ds C+ C\v'-.1v'\h'-1p'\s-2+\h'-1p'+\s0\v'.1v'\h'-1p'
.ie n \{\
. ds -- \(*W-
. ds PI pi
. if (\n(.H=4u)&(1m=24u) .ds -- \(*W\h'-12u'\(*W\h'-12u'-\" diablo 10 pitch
. if (\n(.H=4u)&(1m=20u) .ds -- \(*W\h'-12u'\(*W\h'-8u'-\" diablo 12 pitch
. ds L" ""
. ds R" ""
. ds C` ""
. ds C' ""
'br\}
.el\{\
. ds -- \|\(em\|
. ds PI \(*p
. ds L" ``
. ds R" ''
. ds C`
. ds C'
'br\}
.\"
.\" Escape single quotes in literal strings from groff's Unicode transform.
.ie \n(.g .ds Aq \(aq
.el .ds Aq '
.\"
.\" If the F register is >0, we'll generate index entries on stderr for
.\" titles (.TH), headers (.SH), subsections (.SS), items (.Ip), and index
.\" entries marked with X<> in POD. Of course, you'll have to process the
.\" output yourself in some meaningful fashion.
.\"
.\" Avoid warning from groff about undefined register 'F'.
.de IX
..
.nr rF 0
.if \n(.g .if rF .nr rF 1
.if (\n(rF:(\n(.g==0)) \{\
. if \nF \{\
. de IX
. tm Index:\\$1\t\\n%\t"\\$2"
..
. if !\nF==2 \{\
. nr % 0
. nr F 2
. \}
. \}
.\}
.rr rF
.\" ========================================================================
.\"
.IX Title "wcd 1"
.TH wcd 1 "2023-04-23" "wcd" "2023-04-23"
.\" For nroff, turn off justification. Always turn off hyphenation; it makes
.\" way too many mistakes in technical documents.
.if n .ad l
.nh
.SH "BEZEICHNUNG"
.IX Header "BEZEICHNUNG"
wcd \- Wherever Change Directory
.PP
chdir für \s-1DOS\s0 und Unix
.SH "ÜBERSICHT"
.IX Header "ÜBERSICHT"
.Vb 1
\& wcd [Optionen] [Verzeichnis]
.Ve
.SH "BESCHREIBUNG"
.IX Header "BESCHREIBUNG"
.SS "Übersicht"
.IX Subsection "Übersicht"
Wcd ist ein Befehlszeilenprogramm zum schnellen Verzeichniswechsel. Es spart Zeit bei Tastatureingaben. Sie brauchen nur den Teil eines Verzeichnisnamens einzugeben, und wcd wechselt dorthin. Im Falle mehrerer Treffer verfügt wcd über eine Methode zur Schnellauswahl und ermöglicht die Definition von Aliasen und das Verbannen von Verzeichnissen. Außerdem beinhaltet wcd einen interaktiven Verzeichnisbaumbrowser im Vollbildmodus mit schneller Suche.
.PP
Wcd wurde nach dem Vorbild des Norton Change Directory (\s-1NCD\s0) entworfen. \s-1NCD\s0 erschien zuerst 1987 in \fIThe Norton Utilities, Release 4\fR für \s-1DOS,\s0 veröffentlicht von Peter Norton.
.PP
Wcd wurde auf verschiedene Befehlszeileninterpreter portiert: \s-1DOS\s0 (command.com), Windows (cmd.exe und PowerShell), \s-1OS/2\s0 (cmd.exe) sowie Unix-Shells wie Bourne\- (sh), Bourne\-Again\- (bash), Korn\- (ksh), Z\- (zsh) und die C\- (csh) Shell und weitere auf verschiedenen Betriebssystemen ausführbare Shells.
.PP
Wcd unterstützt 8\-Bit\-Zeichensätze auf allen Systemen und verfügt über optionale Unterstützung für Unicode. Weitere Informationen hierzu finden Sie im Abschnitt \s-1LOKALISIERUNG.\s0
.PP
Im Abschnitt \s-1INSTALLATION\s0 finden Sie Anweisungen, wie Sie wcd an Ihre persönlichen Wünsche anpassen können.
.SS "Grundlegende Verwendung"
.IX Subsection "Grundlegende Verwendung"
Per Vorgabe (wenn keine Platzhalter verwendet werden) sucht wcd nach einem Verzeichnis, dessen Name mit dem eingegebenen Namen beginnt.
.PP
Beispielsweise wechselt dieser Befehl in das Verzeichnis \f(CW\*(C`/home/user/Desktop\*(C'\fR des aktuellen Benutzers:
.PP
.Vb 1
\& wcd Desk
.Ve
.PP
Bei mehreren möglichen Übereinstimungen zeigt wcd eine Liste aller Möglichkeiten an. Der Benutzer kann dann mit einigen Tastenkürzeln seine Auswahl treffen (meist nur mit einem).
.SS "Platzhalter"
.IX Subsection "Platzhalter"
Wcd unterstützt die folgenden Platzhalter:
.PP
.Vb 5
\& * findet jede Zeichensequenz (kein oder mehr Zeichen)
\& ? findet jedes einzelne Zeichen
\& [GRUPPE] findet jedes Zeichen in der angegebenen Gruppe,
\& [!GRUPPE] oder [^GRUPPE] findet jedes Zeichen, das in der angegebenen
\& GRUPPE nicht enthalten ist.
.Ve
.PP
Eine Gruppe wird als Zeichen oder Bereich angegeben. Ein Bereich folgt der Form \fIZeichen minus Zeichen\fR, zum Beispiel \f(CW\*(C`0\-9\*(C'\fR oder \f(CW\*(C`A\-Z\*(C'\fR. Dabei ist \f(CW\*(C`[0\-9a\-zA\-Z_]\*(C'\fR die minimal mögliche Gruppe nach dem Muster \f(CW\*(C`[..]\*(C'\fR. Internationale Zeichen (zum Beispiel 8\-Bit\-Zeichen) sind erlaubt, falls das System diese unterstützt. Um die besondere syntaktische Bedeutung der Zeichen \f(CW\*(C`[]*?!^\-\e\*(C'\fR innerhalb oder außerhalb des Musters \f(CW\*(C`[..]\*(C'\fR zu berücksichtigen, so dass das exakte Zeichen gefunden wird, stellen Sie dem Zeichen einen Rückschrägstrich (\f(CW\*(C`\e\*(C'\fR) voran, um es zu maskieren.
.PP
Die Verwendung von Platzhaltern ermöglicht eine leistungsfähige Suche. Beispielsweise findet folgende Anfrage alle Verzeichnisse, deren Name auf »top« endet:
.PP
.Vb 1
\& wcd *top
.Ve
.PP
Nach Verzeichnissen suchen, deren Name an einer beliebigen Stelle »top« enthält:
.PP
.Vb 1
\& wcd *top*
.Ve
.PP
Nach Verzeichnissen suchen, deren Name mit »a«, »b«, oder »c« beginnt:
.PP
.Vb 1
\& wcd [a\-c]*
.Ve
.PP
Es ist auch möglich, einen Teil eines Verzeichnispfades anzugeben. Hier sucht Wcd nach Verzeichnissen, die mit »Desk« beginnen und der Pfad auf \fI*me/Desk*\fR passt.
.PP
.Vb 1
\& wcd me/Desk
.Ve
.PP
Es ist möglich, jede Art von Ausdruck mit Schrägstrichen und Platzhaltern einzugeben, zum Beispiel:
.PP
.Vb 1
\& wcd src*/*1?/a*2
.Ve
.SS "Weitere Anwendungsfälle"
.IX Subsection "Weitere Anwendungsfälle"
Falls keine Platzhalter verwendet werden und wcd eine perfekte Übereinstimmung findet, werden alle »unscharfen« Übereinstimmungen per Vorgabe ignoriert. Dieses Verhalten kann mit der Option \fB\-w\fR geändert werden.
.PP
Der interaktive Verzeichnisbaumbrowser kann mit der Option \fB\-g\fR gestartet werden.
.PP
.Vb 1
\& wcd \-g
.Ve
.PP
Wcd generiert eine Baumdatei, in der nach dem Verzeichnis gesucht wird. Auf Unix\- und Windows-Systemen fügt wcd beim Einlesen des Laufwerksinhalts symbolische Links zur Baumdatei hinzu, folgt diesen aber nicht. Dies wird deshalb unterdrückt, weil das Einlesen in einer Endlosschleife enden könnte oder größere Teile eines Netzwerks eingelesen werden müssten.
.PP
Wcd kann auch in Verzeichnisse wechseln, die nicht in der Baumdatei enthalten sind, zum Beispiel:
.PP
.Vb 1
\& wcd ..
.Ve
.PP
Falls wcd einen Treffer findet, aber nicht in das Verzeichnis wechseln kann, versucht es, dieses Verzeichnis aus der Baumdatei zu entfernen, jedoch nicht aus der zusätzlichen Baumdatei. Siehe auch die Option \fB\-k\fR.
.PP
Wcd erstellt einen Verzeichnisstapel, der auf dem Laufwerk gespeichert wird. Der Stapel hat die vorgegebene Größe 10 und ist zyklisch. Siehe die Optionen \fB\-z\fR, \fB\-\fR, \fB+\fR und \fB=\fR.
.PP
In Umgebungen mit mehreren Benutzern kann mit der Option \fB\-u\fR in die Verzeichnisse anderer Benutzer gewechselt werden.
.PP
Auf \s-1DOS\-\s0 und Windows-Systemen ist es nicht von Bedeutung, ob Sie einen Schrägstrich »/« oder einen Rückschrägstrich »\e« als Verzeichnistrenner verwenden.
.PP
Auf \s-1DOS\-\s0 und Windows-Systemen ist es möglich, gleichzeitig das Laufwerk und das Verzeichnis zu wechseln, indem Sie dem Verzeichnisnamen den Laufwerksnamen voranstellen.
.PP
.Vb 1
\& wcd d:games
.Ve
.SS "UNC-Pfade unter Windows"
.IX Subsection "UNC-Pfade unter Windows"
Die Windows-Versionen (Befehlszeileninterpreter, PowerShell, \s-1MSYS,\s0 zsh, cygwin) unterstützen SMB-LAN-UNC-Pfade ohne Laufwerksbuchstaben wie \f(CW\*(C`\e\eServername\eFreigabename\*(C'\fR. Wcd für den Windows-Befehlszeileninterpreter benutzt den »pushd«\-Befehl, um einem UNC-Pfad automatisch einen Laufwerksbuchstaben zuzuordnen. In der Windows PowerShell, \s-1MSYS,\s0 zsh und Cygwin werden UNC-Pfade vollständig unterstützt. Das aktuelle Arbeitsverzeichnis kann ein UNC-Pfad sein.
.SS "Größenänderung der Konsole unter Windows"
.IX Subsection "Größenänderung der Konsole unter Windows"
Wcd unterstützt seit Version 6.0.3 die Größenänderung der Konsole unter Windows 10 und ConEmu (siehe ). Die Windows\-10\-Konsole darf nicht im Legacy-Modus sein (prüfen sie das in den Einstellungen der Konsole). Der Bildschirm darf nicht aktualisiert werden, wenn »Wrap text output on resize« deaktiviert ist. Der Bildschirm kann manuell durch Drücken von F5 aktualisiert werden.
.SS "Schnittstellen"
.IX Subsection "Schnittstellen"
Wcd verfügt über drei verschiedene Schnittstellen, um aus einer Übereinstimmungsliste zu wählen. Die Schnittstelle wird bei der Kompilierung ausgewählt.
.PP
Die erste Schnittstelle verwendet die Standardeingabe und \-ausgabe (stdin/stdout). Eine nummerierte Liste wird im Terminal ausgegeben. Sie können aus dieser Liste wählen, indem Sie eine Zahl eingeben und die drücken. Diese Liste kann nicht zurückgerollt werden, wenn sie für die Bildschirmausgabe zu lang ist. Dafür muss die Zurückrollfunktion des Terminals oder der Konsole verwendet werden. Diese Schnittstelle ist sehr klein und portabel.
.PP
Die zweite Schnittstelle setzt auf der Conio-Bibliothek auf. Hier ist eine Zurückrollfunktion bereits eingebaut. Wiederum wird eine Liste angezeigt, die aber hier Buchstaben als Aufzählungszeichen verwendet. Zur Auswahl eines Listeneintrags drücken Sie einfach die entsprechende Buchstabentaste. Wenn möglich, wird der Bildschirminhalt nach dem Beenden wiederhergestellt. Wenn Sie Zahlen anstatt Buchstaben bevorzugen, können Sie die Option \fB\-N\fR verwenden.
.PP
Die dritte Schnittstelle verwendet die Curses-Bibliothek und ist ähnlich der Conio-Schnittstelle. Die Curses-Schnittstelle von wcd hat zusätzlich auch eine »grafische« Oberfläche. Sie können ein Verzeichnis in einem interaktiven Verzeichnisbaumbrowser im Vollbildmodus auswählen. Die Navigation und Suchmethoden sind ähnlich wie in \fBvim\fR\|(1). Diese Schnittstelle kann mit der Option \fB\-g\fR aktiviert werden.
.PP
Mit der Option \fB\-o\fR ist es jederzeit möglich, auf die stdin/stdout\-Schnittstelle (Standardeingabe/Standardausgabe) auszuweichen.
.SH "OPTIONEN"
.IX Header "OPTIONEN"
.IP "\fB\-a\fR" 4
.IX Item "-a"
fügt den aktuellen Pfad zur vorgegebenen Baumdatei hinzu.
.Sp
Verwenden Sie diese Option, um schnell den aktuellen Pfad zur Baumdatei hinzuzufügen. Das erneute Einlesen des kompletten Laufwerks kann in manchen Fällen recht lange dauern.
.IP "\fB\-aa\fR" 4
.IX Item "-aa"
fügt den aktuellen und alle übergeordneten Pfade zur vorgegebenen Baumdatei hinzu.
.IP "\fB\-A \s-1PFAD\s0\fR" 4
.IX Item "-A PFAD"
liest den Verzeichnisbaum aus \fI\s-1PFAD\s0\fR und fügt ihn zur vorgegebenen Baumdatei hinzu. Beispiele:
.Sp
.Vb 3
\& wcd \-A .
\& wcd \-A /home \-A /etc
\& wcd \-A d: \-A e: \-A \e\eserver\eshare
.Ve
.Sp
Unter Windows können Sie alle freigegebenen Verzeichnisse eines Windows-LAN-Servers einlesen, indem Sie etwa Folgendes eingeben: \f(CW\*(C`wcd \-A \e\eServername\*(C'\fR.
.Sp
Siehe auch die Optionen \fB\-S\fR, \fB\-s\fR und \fB\-E\fR.
.IP "\fB\-b\fR" 4
.IX Item "-b"
verbannt den aktuellen Pfad.
.Sp
Wcd speichert den aktuellen Pfad in der Bann-Datei. Das bedeutet, dass zukünftig alle Übereinstimmungen ignoriert werden, die sich auf dieses Verzeichnis und dessen Unterverzeichnisse beziehen.
.Sp
Die Bann-Datei kann mit einem Texteditor bearbeitet werden. Die Verwendung von Platzhaltern ist möglich, außerdem werden Namensübereinstimmungen auf den absoluten Pfad bezogen.
.Sp
Verbannte Pfade werden beim Einlesen des Laufwerks nicht ausgeschlossen. Um dies zu tun, verwenden Sie die Option \fB\-xf\fR.
.IP "\fB\-c, \-\-direct\-cd\fR" 4
.IX Item "-c, --direct-cd"
Direkter CD-Modus. Per Vorgabe arbeitet wcd wie folgt:
.Sp
.Vb 4
\& 1. Es wird versucht, einen Treffer in der oder den Baumdatei(en)
\& zu finden.
\& 2. Wird nichts gefunden, wird versucht, das eingegebene
\& Verzeichnis zu öffnen.
.Ve
.Sp
Im direkten CD-Modus arbeitet wcd in umgekehrter Reihenfolge.
.Sp
.Vb 3
\& 1. Es wird versucht, das eingegebene Verzeichnis zu öffnen.
\& 2. Wird nichts gefunden, wird nach einem Treffer in der oder
\& den Baumdatei(en) gesucht.
.Ve
.IP "\fB\-d \s-1LAUFWERK\s0\fR" 4
.IX Item "-d LAUFWERK"
legt das Laufwerk für den Verzeichnisstapel und die Go-Datei fest (nur \s-1DOS\s0).
.Sp
Die Stapeldatei und das Go-Skript werden per Vorgabe im Laufwerk »C:« gespeichert, wenn die Umgebungsvariable \fI\s-1HOME\s0\fR nicht gesetzt ist. Verwenden Sie diese Option, wenn »C:« ein schreibgeschütztes Laufwerk ist. Diese Option muss vor den Stapeloptionen \fB\-\fR, \fB+\fR und \fB=\fR stehen.
.IP "\fB\-e\fR" 4
.IX Item "-e"
fügt den aktuellen Pfad zur zusätzlichen Baumdatei hinzu.
.Sp
Verwenden Sie diese Option, um schnell den aktuellen Pfad zur zusätzlichen Baumdatei hinzuzufügen.
.IP "\fB\-ee\fR" 4
.IX Item "-ee"
fügt den aktuellen Pfad und alle übergeordneten Pfade zur zusätzlichen Baumdatei hinzu.
.IP "\fB\-E \s-1PFAD\s0\fR" 4
.IX Item "-E PFAD"
liest den Verzeichnisbaum aus \fI\s-1PFAD\s0\fR und fügt ihn zur zusätzlichen Baumdatei hinzu. Siehe auch die Optionen \fB\-A\fR und \fB\-S\fR.
.IP "\fB\-f \s-1DATEI\s0\fR" 4
.IX Item "-f DATEI"
liest die Baumdatei \fI\s-1DATEI\s0\fR. Die vorgegebene Baumdatei wird nicht gelesen.
.IP "\fB+f \s-1DATEI\s0\fR" 4
.IX Item "+f DATEI"
liest die Baumdatei \fI\s-1DATEI\s0\fR zusätzlich zur vorgegebenen Baumdatei.
.IP "\fB\-g\fR" 4
.IX Item "-g"
verwendet die grafische Benutzeroberfläche (nur in Versionen mit curses-Schnittstelle).
.Sp
Wcd startet eine textbasierte, auf der Curses-Bibliothek aufsetzende »grafische« Schnittstelle. Sie können ein Verzeichnis in einem interaktiven Verzeichnisbaumbrowser im Vollbildmodus auswählen. Die Navigation und Suchmethoden sind ähnlich wie in \fBvim\fR\|(1).
.Sp
Wenn keine Suchzeichenkette angegeben ist, stellt wcd den gesamten Baum aus den Inhalten der vorgegebenen und der zusätzlichen Baumdatei dar.
.Sp
Wenn eine Suchzeichenkette angegeben ist, wird die Trefferliste als Verzeichnisbaum angezeigt.
.Sp
Die vorgegebene Ansicht des Baums ähnelt der Ansicht im originalen \s-1NCD\s0 unter \s-1DOS.\s0 Der Unterschied besteht darin, dass in \s-1NCD\s0 alle Verzeichnisse der gleichen Pfadtiefe im gesamten Baum vertikal angeordnet werden. Das war in \s-1NCD\s0 möglich, da ein Verzeichnisname in \s-1DOS\s0 nicht länger als 12 Zeichen (8.3) sein durfte. Auf modernen Betriebssystemen können Verzeichnisnamen sehr lang sein, außerdem sind große Unterschiede bei den Längen der Namen der verschiedenen Verzeichnisse möglich. Deswegen werden Verzeichnisse der gleichen Pfadtiefe in wcd nicht im gesamten Baum vertikal ausgerichtet, sondern nur in Verzweigungen. Daher kann es zu Seitenbewegungen kommen, wenn Sie eigentlich in der Hierarchie direkt nach oben oder von einer Verzweigung zu einer anderen navigieren wollen.
.Sp
Das Navigationsverhalten in Wcd ist exakt das gleiche wie im originalen \s-1NCD.\s0 Wenn Sie beispielsweise die Pfeil-ab-Taste drücken, gehen Sie damit zum nächsten Verzeichnis der gleichen Tiefe in der Verzeichnishierarchie, wobei Verzweigungen übersprungen werden. Dies ermöglicht die schnelle Navigation durch den Baum.
.Sp
Siehe die Optionen \fB\-Ta\fR, \fB\-TC\fR und \fB\-Tc\fR zum Ändern des Navigationsverhaltens.
.IP "\fB\-gd\fR" 4
.IX Item "-gd"
gibt die Baumdateien als Baum in die Standardausgabe aus.
.IP "\fB\-G \s-1PFAD\s0\fR" 4
.IX Item "-G PFAD"
schreibt das Go-Skript in das Verzeichnis \fI\s-1PFAD\s0\fR. Unter Unix beispielsweise schreibt \f(CW\*(C`wcd \-G PFAD\*(C'\fR ein Go-Skript in \fBPFAD/wcd.go\fR.
.IP "\fB\-GN, \-\-no\-go\-script\fR" 4
.IX Item "-GN, --no-go-script"
verhindert die Erstellung eines Go-Skripts. Diese Option kann zusammen mit \fB\-j\fR verwendet werden, wenn Sie wcd kein Go-Skript schreiben lassen wollen.
.IP "\fB\-h, \-\-help\fR" 4
.IX Item "-h, --help"
zeigt eine Hilfe an und beendet das Programm.
.IP "\fB\-i, \-\-ignore\-case\fR" 4
.IX Item "-i, --ignore-case"
ignoriert Groß\-/Kleinschreibung. In den \s-1DOS\-\s0 und Windows-Versionen ist dies der Standard. In den Unix\- und Cygwin-Versionen wird per Vorgabe die Groß\-/Kleinschreibung berücksichtigt.
.IP "\fB+i, \-\-no\-ignore\-case\fR" 4
.IX Item "+i, --no-ignore-case"
berücksichtigt Groß\-/Kleinschreibung. Siehe auch Option \fB\-i\fR.
.IP "\fB\-I, \-\-ignore\-diacritics\fR" 4
.IX Item "-I, --ignore-diacritics"
ignoriert diakritische Zeichen des lateinischen Alphabets. Buchstaben mit diakritischen Zeichen werden wie die deren Basisbuchstaben behandelt. Die folgenden Latin-Zeichenkodierungen werden unterstützt: \s-1CP437, CP850, CP852, CP1250, CP1252, ISO\-8859\-1, ISO\-8859\-2,\s0 sowie Unicode Latin\-1, Latin Extended-A, und Latin Extended-B. Siehe auch
.IP "\fB+I, \-\-no\-ignore\-diacritics\fR" 4
.IX Item "+I, --no-ignore-diacritics"
berücksichtigt diakritische Zeichen (Vorgabe). Siehe auch Option \fB\-I\fR.
.IP "\fB\-j, \-\-just\-go\fR" 4
.IX Item "-j, --just-go"
Geh-einfach-Modus.
.Sp
In diesem Modus zeigt wcd keine Liste an, wenn mehr als ein Verzeichnis auf das angegebene Verzeichnis passt. Wcd wechselt nur einfach zum ersten Treffer. Beim erneuten Aufruf von wcd mit den gleichen Argumenten wird zum Verzeichnis im nächsten Treffer gewechselt, und so weiter.
.Sp
Wcd gibt das Verzeichnis, in das gewechselt wird, in die Standardausgabe aus. So kann eine andere Installationsmethode verwendet werden. Sie könnten die folgende Funktion für eine POSIX-kompatible Shell erstellen:
.Sp
.Vb 4
\& wcd ()
\& {
\& cd "$($HOME/bin/wcd.exe \-j $@)"
\& }
.Ve
.Sp
Wenn Sie mit einer älteren Shell arbeiten, die nicht über Unterstützung für die Befehlsersetzung mit »$()« verfügt, müssen Sie die auch die ältere Befehlsersetzung mit Gravis-Zeichen (Backtick, »`«) verwenden.
.Sp
.Vb 4
\& wcd ()
\& {
\& cd "\`$HOME/bin/wcd.exe \-j $@\`"
\& }
.Ve
.Sp
Auf Windows-Systemen mit einer NT4\-Shell können Sie den folgenden Alias anlegen:
.Sp
.Vb 1
\& alias wcd \`cd %@execstr[wcdwin32.exe \-z 0 \-j %1]\`
.Ve
.Sp
Diese Methode macht ein Go-Skript überflüssig, daher können Sie die Option \fB\-GN\fR zusammen mit \fB\-j\fR verwenden.
.IP "\fB\-k, \-\-keep\-paths\fR" 4
.IX Item "-k, --keep-paths"
erhält Pfade.
.Sp
Die Pfade werden in der Baumdatei weiter vorgehalten, wenn wcd nicht dorthin wechseln kann. Das Vorgabeverhalten in diesem Fall ist, dass wcd versucht, diese Pfade aus der Baumdatei zu entfernen. Mit dieser Option wird das Vorgabeverhalten deaktiviert.
.IP "\fB\-K, \-\-color\fR" 4
.IX Item "-K, --color"
verwendet Farben im grafischen Modus.
.IP "\fB\-l \s-1ALIAS\s0\fR" 4
.IX Item "-l ALIAS"
benennt den aktuellen Pfad mit \fI\s-1ALIAS\s0\fR. Wcd speichert den aktuellen Pfad mit dem \fI\s-1ALIAS\s0\fR in der Alias-Datei. Bei Aliasen wird Groß\-/Kleinschreibung berücksichtigt.
.IP "\fB\-ls\fR" 4
.IX Item "-ls"
zeigt den Namen der Alias-Datei an und listet alle Aliase auf.
.IP "\fB\-m \s-1VERZEICHNIS\s0\fR" 4
.IX Item "-m VERZEICHNIS"
erstellt ein Verzeichnis und fügt es zur Baumdatei hinzu.
.IP "\fB\-L, \-\-license\fR" 4
.IX Item "-L, --license"
zeigt die Lizenz des Programms an.
.IP "\fB\-M \s-1VERZEICHNIS\s0\fR" 4
.IX Item "-M VERZEICHNIS"
erstellt ein Verzeichnis und fügt es zur zusätzlichen Baumdatei hinzu.
.IP "\fB\-n \s-1PFAD\s0\fR" 4
.IX Item "-n PFAD"
liest die relative Baumdatei aus \fI\s-1PFAD\s0\fR.
.Sp
Die Datei für die vorgegebene Baumansicht wird nicht gelesen. Die Datei für die relative Baumansicht sollte schon von wcd mit der Option \fB+S\fR angelegt worden sein. \fI\s-1PFAD\s0\fR kann auch direkt auf eine Datei verweisen.
.Sp
Ein Beispiel. Nehmen wir an, ein anderes System wurde in \f(CW\*(C`/mnt/network\*(C'\fR eingehängt:
.Sp
.Vb 1
\& wcd \-n /mnt/network src
.Ve
.Sp
Wcd öffnet die Datei der relativen Baumansicht in \f(CW\*(C`/mnt/network/\*(C'\fR. Die Datei enthält die Pfade relativ von diesem Punkt aus betrachtet.
.IP "\fB+n \s-1PFAD\s0\fR" 4
.IX Item "+n PFAD"
liest die Datei der relativen Baumansicht zusätzlich zur vorgegebenen Datei. Siehe Option \fB\-n\fR.
.IP "\fB\-N, \-\-numbers\fR" 4
.IX Item "-N, --numbers"
verwendet Zahlen anstelle von Buchstaben.
.Sp
Wcd mit einer Conio\- oder Curses-basierten Benutzeroberfläche (siehe Abschnitt »Schnittstellen«) stellt eine Trefferliste mit Buchstaben als Aufzählungszeichen dar. Wenn Sie die Option \fB\-N\fR angeben, wird die Trefferliste mit Zahlen nummeriert. Ungeachtet der Option \fB\-N\fR können Sie einen Buchstaben oder Zahlen eingeben, um aus der Trefferliste zu wählen.
.IP "\fB\-o\fR" 4
.IX Item "-o"
verwendet die stdin/stdout\-Schnittstelle (Standardeingabe/Standardausgabe).
.Sp
Falls aus verschiedenen Gründen die conio\- oder curses-Schnittstelle von wcd nicht funktioniert, können Sie mit der Option \fB\-o\fR auf die stdin/stdout\-Schnittstelle ausweichen.
.IP "\fB\-od, \-\-to\-stdout\fR" 4
.IX Item "-od, --to-stdout"
gibt alle Übereinstimmungen in die Standardausgabe aus.
.IP "\fB\-q, \-\-quiet\fR" 4
.IX Item "-q, --quiet"
Stiller Modus. Die Ausgabe des endgültigen Treffers wird unterdrückt.
.IP "\fB\-r \s-1VERZEICHNIS\s0\fR" 4
.IX Item "-r VERZEICHNIS"
entfernt ein Verzeichnis und entfernt es auch aus der Baumdatei.
.Sp
Wenn das Verzeichnis leer ist, wird wcd es entfernen, und versuchen, es aus der Baumdatei zu entfernen.
.IP "\fB\-rmtree \s-1VERZEICHNIS\s0\fR" 4
.IX Item "-rmtree VERZEICHNIS"
entfernt ein Verzeichnis rekursiv und entfernt es auch aus der Baumdatei.
.Sp
Wcd entfernt das Verzeichnis und dessen Untervezeichnisse und Dateien, außerdem werden die Verzeichnisse aus der Baumdatei entfernt.
.IP "\fB\-s\fR" 4
.IX Item "-s"
liest den Laufwerksinhalt (evtl. erneut) aus dem Verzeichnis \f(CW$HOME\fR ein. Falls \fI\s-1HOME\s0\fR nicht definiert ist, wird das Wurzelverzeichnis »/« des Laufwerks eingelesen.
.Sp
Die existierende vorgegebene Baumdatei wird dabei überschrieben.
.Sp
Das vorgegebene einzulesende Verzeichnis kann mit der Umgebungsvariable \f(CW\*(C`WCDSCAN\*(C'\fR außer Kraft gesetzt werden. Weitere Informationen finden Sie im Abschnitt \s-1UMGEBUNGSVARIABLEN.\s0
.IP "\fB\-S \s-1PFAD\s0\fR" 4
.IX Item "-S PFAD"
liest den Verzeichnisbaum aus \fI\s-1PFAD\s0\fR und überschreibt die vorgegebene Baumdatei. Siehe auch die Optionen \fB\-A\fR, \fB\-s\fR und \fB\-E\fR. Zum Beispiel können Sie mit der Option \fB\-A\fR eine Vorgabe-Baumdatei Ihrer Wahl erzeugen. Beispiele:
.Sp
Unix:
.Sp
.Vb 2
\& wcd \-S /
\& wcd \-S /home \-A /etc \-A /usr
.Ve
.Sp
DOS/Windows:
.Sp
.Vb 2
\& wcd \-S c:/
\& wcd \-S c: \-A d: \-A \e\eserver\eshare
.Ve
.Sp
Mit den Windows-Versionen können Sie alle freigegebenen Verzeichnisse eines Windows-LAN-Servers einlesen. Geben Sie etwa Folgendes ein: \f(CW\*(C`wcd \-S \e\eServername\*(C'\fR.
.IP "\fB\-S \s-1PFAD\s0\fR" 4
.IX Item "-S PFAD"
liest das Laufwerk aus \fI\s-1PFAD\s0\fR ein und platziert relative Pfade in der Datei der relativen Baumansicht. Diese Datei wird in wcd von den Optionen \fB\-n\fR und \fB+n\fR verwendet. Beispiel \f(CW\*(C`wcd \-n PFAD src\*(C'\fR.
.IP "\fB\-t\fR" 4
.IX Item "-t"
entfernt das temporäre Einhängeverzeichnis \f(CW\*(C`/tmp_mnt\*(C'\fR nicht (nur Unix).
.Sp
Wcd entfernt per Vorgabe \f(CW\*(C`/tmp_mnt/\*(C'\fR aus den Treffern. Dieses Verzeichnis wird vom Auto-Mounter verwendet. Sie können dieses Verhalten mit der Option \fB\-t\fR abschalten.
.IP "\fB\-T, \-\-ascii\-tree\fR" 4
.IX Item "-T, --ascii-tree"
zeichnet die Baumansicht mit ASCII-Zeichen. Verwenden Sie diese Option, wenn die Zeichen zum Darstellen von Linien in Ihrem Terminal nicht korrekt angezeigt werden.
.IP "\fB\-Ta, \-\-alt\-tree\-nav\fR" 4
.IX Item "-Ta, --alt-tree-nav"
verwendet einen alternativen Weg zur Navigation in der grafischen Baumansicht.
.Sp
In der vorgegebenen Baumansicht im NCD-Stil verhindert die Option \fB\-Ta\fR das Springen in beziehungslose Verzeichnisse.
.Sp
In der kompakten Baumansicht funktioniert die Navigation im alternativen Modus ähnlich wie in Dateimanagern mit grafischer Benutzeroberfläche, wie dem Windows Explorer oder dem \s-1KDE\s0 Konqueror. Durch Drücken der Pfeiltasten nach oben und nach unten verschieben Sie das ausgewählte Verzeichnis eine Zeile nach oben oder unten. Die linke Pfeiltaste klappt die Unterverzeichnisse ein, wiederholtes Drücken der linken Pfeiltaste springt dann tatsächlich nach links.
.Sp
Sie können direkt zwischen dem Vorgabe\- und dem Alternativmodus wechseln, indem Sie drücken.
.Sp
Wenn der alternative Navigationsmodus eingeschaltet ist, sehen Sie ein »A« in der unteren rechten Ecke.
.IP "\fB\-TC, \-\-center\-tree\fR" 4
.IX Item "-TC, --center-tree"
zentriert die Ansicht im grafischen Baum. Das ausgewählte Verzeichnis steht in der Mitte des Bildschirms. Der zentrierte Modus kann mit der Taste im grafischen Baum an\- und abgeschaltet werden.
.Sp
Die vorgegebene nicht-zentrierte Ansicht, welche die Baumbewegungen minimiert, entspricht derjenigen im originalen \s-1NCD.\s0
.IP "\fB\-Tc, \-\-compact\-tree\fR" 4
.IX Item "-Tc, --compact-tree"
Per Vorgabe wird die »grafische« Baumansicht auf die gleiche Art gezeichnet wie im originalen \s-1NCD\s0 unter \s-1DOS.\s0 Dort darf ein Verzeichnispfad nicht länger als 66 Zeichen sein. Mit den heute üblichen tiefen Verzeichnisstrukturen kann der Baum sehr breit werden. Um dies zu vermeiden, kann wcd den Baum in einer Kompaktansicht darstellen, mit einem Verzeichnis pro Zeile, wie in den meisten grafischen Dateimanagern. Verwenden Sie die Option \fB\-Tc\fR oder schalten Sie direkt mit der Taste um.
.IP "\fB\-Td, \-\-cjk\-width\fR" 4
.IX Item "-Td, --cjk-width"
Veraltete ostasiatische CJK-Schriften (Chinesisch, Japanisch und Koreanisch) haben bestimmte Zeichen und Symbole zum Zeichnen von Linien mit einer Breite von zwei Spalten, während die Zeichenbreite in normalem Unicode eine Spalte beträgt. Beispielsweise sind das die chinesische CP936\-Rasterschrift unter Windows und die Simsun-Schrift. Verwenden Sie diese Option zur korrekten Ausrichtung der grafischen Baumansicht, wenn eine veraltete CJK-Schrift verwendet wird.
.Sp
Wenn der CJK-Modus eingeschaltet ist, wird ein »C« in der unteren rechten Ecke angezeigt.
.IP "\fB\-u \s-1BENUTZER\s0\fR" 4
.IX Item "-u BENUTZER"
liest die Daten eines anderen Benutzers für die Baumansicht basierend auf \fI\s-1BENUTZER\s0\fR ein. Ihre eigene Datei für die Baumansicht wird nicht eingelesen. Siehe auch \fI\s-1WCDUSERSHOME\s0\fR im Abschnitt \s-1UMGEBUNGSVARIABLEN.\s0
.Sp
Unter Unix/Cygwin wird \f(CW\*(C`/home\*(C'\fR als Wurzel für die Benutzerverzeichnisse angenommen. Wcd schaut nach \f(CW\*(C`/home/BENUTZER/.treedata.wcd\*(C'\fR und \f(CW\*(C`/home/BENUTZER/.wcd/.treedata.wcd\*(C'\fR, in dieser Reihenfolge. Davon wird die erste existierende und lesbare Datei gelesen. Unter DOS/Windows wird \f(CW\*(C`\e\eusers\*(C'\fR als Wurzelverzeichnis der Benutzer angenommen, daher versucht wcd \f(CW\*(C`\e\eusers\eBENUTZER\etreedata.wcd\*(C'\fR und \f(CW\*(C`\e\eusers\eBENUTZER\e.wcd\etreedata.wcd\*(C'\fR zu lesen.
.IP "\fB+u \s-1BENUTZER\s0\fR" 4
.IX Item "+u BENUTZER"
liest die vorgegebene Baumansicht-Datei von \s-1BENUTZER\s0 zusätzlich zu Ihrer eigenen Baumansicht-Datei ein.
.IP "\fB\-v, \-\-verbose\fR" 4
.IX Item "-v, --verbose"
zeigt ausführliche Meldungen an. Mit dieser Option zeigt wcd alle Filter, Verbannungen und Ausschlüsse an.
.IP "\fB\-V, \-\-version\fR" 4
.IX Item "-V, --version"
zeigt Versionsinformationen an und beendet das Programm.
.IP "\fB\-w, \-\-wild\-match\-only\fR" 4
.IX Item "-w, --wild-match-only"
zeigt nur Übereinstimmungen von Platzhaltern an. Alle Treffer werden als Platzhalter-Treffer angenommen.
.IP "\fB\-x \s-1PFAD\s0\fR" 4
.IX Item "-x PFAD"
schließt \fI\s-1PFAD\s0\fR vom Einlesen aus.
.Sp
Mit dieser Option schließt wcd \fI\s-1PFAD\s0\fR und dessen Unterverzeichnisse aller Ebenen beim Einlesen eines Laufwerks aus. Platzhalter werden unterstützt und auf absolute Pfade angewendet. Die Option \fB\-x\fR kann mehrfach angegeben werden.
.Sp
.Vb 1
\& wcd \-x \-x \-s
.Ve
.Sp
Die Option \fB\-x\fR muss vor jeder anderen Einleseoption angegeben werden (\fB\-s\fR, \fB\-S\fR, \fB+S\fR, \fB\-A\fR, \fB\-E\fR).
.Sp
Unter DOS/Windows müssen Sie den Laufwerksbuchstaben angeben, je nachdem, ob eine der Variablen \fI\s-1HOME\s0\fR oder \fI\s-1WCDHOME\s0\fR gesetzt ist. Falls \fI\s-1HOME\s0\fR oder \fI\s-1WCDHOME\s0\fR gesetzt ist, müssen Sie den Laufwerksbuchstaben angeben. Ein Beispiel:
.Sp
.Vb 1
\& wcd \-x c:/temp \-S c:
.Ve
.Sp
Anderenfalls geben Sie keinen Laufwerksbuchstaben an.
.Sp
.Vb 1
\& wcd \-x /temp \-s
.Ve
.IP "\fB\-xf \s-1DATEI\s0\fR" 4
.IX Item "-xf DATEI"
schließt alle in \fI\s-1DATEI\s0\fR aufgelisteten Pfade vom Einlesen aus.
.Sp
Wenn diese Option ausgewählt ist, schließt wcd alle in \fI\s-1DATEI\s0\fR aufgelisteten Pfade und sämtliche derer Unterverzeichnisse beim Einlesen eines Laufwerks aus. Platzhalter werden unterstützt und Namensübereinstimmungen werden auf den absoluten Pfad bezogen. Beachten Sie, dass wcd führende und angehängte Leerzeichen in einer Zeile nicht ignoriert, da sie als Zeichen in einem Verzeichnisnamen zulässig sind. Die Option \fB\-xf\fR kann mehrfach angegeben werden. Mit folgendem Befehl schließen Sie alle verbannten Pfade vom Einlesen aus (Beispiel für wcd unter Unix):
.Sp
.Vb 1
\& wcd \-xf ~/.ban.wcd \-s
.Ve
.Sp
Platzhalter werden unterstützt. Um beispielsweise alle Ihre Subversion-Verzeichnisse mit administrativen Dateien auszuschließen, fügen Sie eine Zeile mit \f(CW\*(C`*/.svn\*(C'\fR hinzu.
.Sp
Die Option \fB\-xf\fR muss vor jeder anderen Einleseoption angegeben werden (\fB\-s\fR, \fB\-S\fR, \fB+S\fR, \fB\-A\fR, \fB\-E\fR).
.IP "\fB\-y, \-\-assume\-yes\fR" 4
.IX Item "-y, --assume-yes"
beantwortet alle Abfragen automatisch mit »ja«.
.Sp
Wcd gibt keine Ja\-/Nein\-Abfragen an den Benutzer aus, nimmt aber an, dass der Benutzer stets auf alle Fragen mit Ja antworten würde. Dies kann in Verbindung mit der Option \fB\-rmtree\fR verwendet werden. Diese Option muss vor allen Optionen angegeben werden, die zu Ja\-/Nein\-Abfragen führen könnten.
.IP "\fB\-z \s-1ZAHL\s0\fR" 4
.IX Item "-z ZAHL"
setzt die maximale Stapelgröße auf \s-1ZAHL.\s0
.Sp
Die vorgegebene Größe des Stapels ist 10. Stapeloperationen können deaktiviert werden, indem die Größe auf 0 gesetzt wird. Diese Option muss stets vor anderen Stapeloperationen angegeben werden (\fB\-\fR,\fB+\fR,\fB=\fR). Anderenfalls wird die Stapelgröße wieder auf den Vorgabewert 10 zurückgesetzt.
.Sp
Ein korrekter Befehl ist:
.Sp
.Vb 1
\& wcd \-z 50 \-
.Ve
.Sp
Die neue Stapelgröße ist 50 und wcd geht ein Verzeichnis zurück. Ein falscher Befehl wäre:
.Sp
.Vb 1
\& wcd \- \-z 50
.Ve
.Sp
Wcd geht ein Verzeichnis zurück und der Stapel erhält die Vorgabegröße 10. Das Argument \fB\-z 50\fR wird ignoriert.
.Sp
Fügen Sie dies als erste Option zu Ihrem wcd-Alias oder Ihrer wcd-Funktion hinzu. Für eine POSIX-kompatible Shell wäre das:
.Sp
.Vb 5
\& wcd ()
\& {
\& wcd.exe \-z 50 "$@"
\& . ${WCDHOME:\-${HOME}}/bin/wcd.go
\& }
.Ve
.IP "\fB\-[\s-1ZAHL\s0]\fR" 4
.IX Item "-[ZAHL]"
legt ein Verzeichnis auf den Stapel (\s-1ZAHL\s0 mal). Vorgabe ist 1.
.Sp
Geht ein Verzeichnis zurück. Der Befehl \f(CW\*(C`wcd \-\*(C'\fR geht ein Verzeichnis zurück. Um mehrere Verzeichnisse zurückzugehen, fügen Sie eine Zahl hinzu, zum Beispiel in Form des Befehls \f(CW\*(C`wcd \-3\*(C'\fR. Der Stapel ist zyklisch.
.IP "\fB+[\s-1ZAHL\s0]\fR" 4
.IX Item "+[ZAHL]"
nimmt ein Verzeichnis vom Stapel (\s-1ZAHL\s0 mal). Vorgabe ist 1.
.Sp
Geht ein Verzeichnis vor. Der Befehl \f(CW\*(C`wcd +\*(C'\fR geht ein Verzeichnis vor. Um mehrere Verzeichnisse vorzugehen, fügen Sie eine Zahl hinzu, zum Beispiel in Form des Befehls \f(CW\*(C`wcd +2\*(C'\fR. Der Stapel ist zyklisch.
.IP "\fB=\fR" 4
.IX Item "="
zeigt den Stapel an.
.Sp
Verwenden Sie diese Option, wenn Sie nicht mehr wissen, wie oft Sie im Stapel die Ebene gewechselt haben. Der Stapel wird ausgegeben und Sie können eine Zahl wählen. Die aktuelle Position im Stapel ist mit einem Asterisk \f(CW\*(C`*\*(C'\fR markiert.
.SH "INSTALLATION"
.IX Header "INSTALLATION"
Das aktuelle Arbeitsverzeichnis einer Unix-Shell kann nur über den eingebauten \fBcd\fR\|(1)\-Befehl gewechselt werden. Daher wird das Programm stets über eine Funktion oder einen Alias ausgeführt. Die Funktion oder der Alias verwenden ein Shell-Skript (das Go-Skript), welches von wcd erzeugt wird. Wcd funktioniert erst dann, wenn die Funktion oder der Alias definiert wurde.
.PP
Weiteren wichtigen Einfluss auf Ihre Installation nimmt die Definition der Umgebungsvariablen \fI\s-1HOME\s0\fR und \fI\s-1WCDHOME\s0\fR. Siehe den Abschnitt \s-1UMGEBUNGSVARIABLEN.\s0
.SS "Installation für POSIX-Shells"
.IX Subsection "Installation für POSIX-Shells"
Für eine POSIX-Shell (ksh, bash, zsh, etc.) unter Unix, Linux, Cygwin oder nativem \s-1MSYS\s0 fügen Sie die folgende Funktion zur Shell-Startdatei hinzu (die Bash verwendet zum Beispiel \f(CW\*(C`$HOME/.bashrc\*(C'\fR):
.PP
.Vb 5
\& wcd ()
\& {
\& PATH/wcd.exe "$@"
\& . ${WCDHOME:\-${HOME}}/bin/wcd.go
\& }
.Ve
.PP
\&\fI\s-1PFAD\s0\fR wird durch den Ort ersetzt, in dem das ausführbare wcd-Programm gespeichert ist. Laden Sie die Initialisierungsdateien der Shell neu oder starten Sie eine neue Shell.
.PP
Der Ort des Go-Skripts \f(CW\*(C`wcd.go\*(C'\fR ist abhängig von der Shell selbst.
.PP
Wcd für die auf \s-1DJGPP\s0 basierende DOS-Bash und die OS/2\-Bash erfordert eine andere Funktionalität. Das Go-Skript wird nicht in einem Verzeichnis \f(CW\*(C`bin\*(C'\fR gespeichert, und falls weder \fI\s-1WCDHOME\s0\fR noch \fI\s-1HOME\s0\fR definiert sind, wird das Go-Skript nach c:/ geschrieben.
.PP
DOS-Bash:
.PP
.Vb 5
\& wcd ()
\& {
\& PATH/wcdbash.exe "$@"
\& . ${WCDHOME:\-${HOME:\-"c:"}}/wcd.go
\& }
.Ve
.PP
OS/2\-Bash:
.PP
.Vb 5
\& wcd ()
\& {
\& PATH/wcdos2bash.exe "$@"
\& . ${WCDHOME:\-${HOME:\-"c:"}}/wcd.go
\& }
.Ve
.PP
Die WinZsh-Version von wcd erfordert eine etwas andere Funktion. Das Go-Skript wird niemals in c:/ gespeichert.
.PP
.Vb 5
\& wcd ()
\& {
\& PATH/wcdwin32zsh.exe "$@"
\& . ${WCDHOME:\-${HOME}}/wcd.go
\& }
.Ve
.PP
Weitere Informationen finden Sie im Abschnitt \s-1DATEIEN.\s0
.SS "Installation für C\-ähnliche Shells (csh, tcsh)"
.IX Subsection "Installation für C-ähnliche Shells (csh, tcsh)"
Fügen Sie den folgenden Alias zur Shell-Startdatei \f(CW\*(C`$HOME/.cshrc\*(C'\fR oder \f(CW\*(C`$HOME/.tcshrc\*(C'\fR hinzu:
.PP
.Vb 5
\& if ( ${?WCDHOME} ) then
\& alias wcd "PATH/wcd.exe \e!* ; source $WCDHOME/bin/wcd.go"
\& else
\& alias wcd "PATH/wcd.exe \e!* ; source $HOME/bin/wcd.go"
\& endif
.Ve
.PP
\&\fI\s-1PFAD\s0\fR wird durch den Ort ersetzt, in dem das ausführbare wcd-Programm gespeichert ist. Laden Sie die Initialisierungsdateien der Shell neu oder starten Sie eine neue Shell.
.SS "Version für den Windows-Befehlszeileninterpreter"
.IX Subsection "Version für den Windows-Befehlszeileninterpreter"
Entpacken Sie die Zip-Datei und fügen Sie den Ordner \f(CW\*(C`bin\*(C'\fR zu Ihrer Umgebungsvariable \fI\s-1PATH\s0\fR hinzu.
.PP
Im Windows-Befehlszeileninterpreter kann ein Windows-Programm das aktuelle Arbeitsverzeichnis nicht wechseln, das ist aber mit einer .bat\-Datei möglich. Das Batch-Skript \f(CW\*(C`wcd.bat\*(C'\fR ruft das wcd-Programm auf, welches seinerseits das neue Batch-Skript \f(CW\*(C`wcdgo.bat\*(C'\fR erzeugt. Dann führt \f(CW\*(C`wcd.bat\*(C'\fR wiederum \f(CW\*(C`wcdgo.bat\*(C'\fR aus, welches tatsächlich das Verzeichnis wechselt.
.SS "Windows \s-1VISTA\s0 und neuer"
.IX Subsection "Windows VISTA und neuer"
Im Befehlszeileninterpreter in Windows \s-1VISTA\s0 oder neueren Versionen ist der Zugriff auf Verzeichnisse eingeschränkt. Um Zugriff auf weitere Verzeichnisse zu erhalten, benötigen Sie Administratorrechte. Einen Befehlszeileninterpreter mit Administratorrechten erhalten Sie, wenn Sie mit der rechten Maustaste auf das Programmsymbol des Befehlszeileninterpreters klicken und \fIAls Administrator ausführen\fR wählen.
.SS "Version für die Windows PowerShell"
.IX Subsection "Version für die Windows PowerShell"
Fügen Sie die folgende Funktion zu Ihrem PowerShell-Benutzerprofil hinzu. Der Ort dieses Profils wird durch die Variable \f(CW$profile\fR bestimmt. Es ist erforderlich, dass eine der Umgebungsvariablen \fI\s-1HOME\s0\fR oder \fI\s-1WCDHOME\s0\fR definiert ist.
.PP
.Vb 5
\& function wcd
\& {
\& PATH\ewcdwin32psh.exe $args
\& & $env:HOME\ewcdgo.ps1
\& }
.Ve
.PP
\&\fI\s-1PFAD\s0\fR wird durch den Ort ersetzt, in dem das ausführbare wcd-Programm gespeichert ist. Starten Sie eine neue PowerShell. Wcd für die PowerShell unterstützt nur den Dateisystemtreiber und keine weiteren Treiber.
.SS "Version für den Befehlszeileninterpreter von \s-1OS/2\s0"
.IX Subsection "Version für den Befehlszeileninterpreter von OS/2"
Im Befehlszeileninterpreter von \s-1OS/2\s0 (cmd.exe) kann ein OS/2\-Programm das aktuelle Arbeitsverzeichnis nicht wechseln. Daher erzeugt wcd ein Befehlsskript \f(CW\*(C`wcdgo.cmd\*(C'\fR, das in der aktuellen Shell ausgeführt werden muss. Das Skript \f(CW\*(C`wcd.cmd\*(C'\fR führt zuerst \f(CW\*(C`wcdos2.exe\*(C'\fR aus, welches seinerseits das Skript \f(CW\*(C`wcdgo.cmd\*(C'\fR erzeugt. Danach führt \f(CW\*(C`wcd.cmd\*(C'\fR das Skript \f(CW\*(C`wcdgo.cmd\*(C'\fR aus.
.SH "LOKALISIERUNG"
.IX Header "LOKALISIERUNG"
.IP "\fB\s-1LANG\s0\fR" 4
.IX Item "LANG"
Die primäre Sprache wird durch die Umgebungsvariable \fI\s-1LANG\s0\fR festgelegt. Diese Variable besteht aus mehreren Teilen: Den ersten Teil bilden zwei Kleinbuchstaben, die den Sprachcode angeben. Der zweite Teil ist optional und bezeichnet den Ländercode in Großbuchstaben, vom davor stehenden Sprachcode durch einen Unterstrich getrennt. Der dritte Teil ist ebenfalls optional und gibt die Zeichenkodierung an, vom Ländercode durch einen Punkt getrennt. Einige Beispiele für Standard-POSIX-Shells:
.Sp
.Vb 6
\& export LANG=de Deutsch
\& export LANG=de_DE Deutsch, Deutschland
\& export LANG=de_CH Deutsch, Schweiz
\& export LANG=es_ES Spanisch, Spanien
\& export LANG=es_MX Spanisch, Mexiko
\& export LANG=en_US.iso88591 English, USA, Latin\-1\-Zeichenkodierung
.Ve
.Sp
Eine vollständige Liste der Sprachen und Ländercodes finden Sie im Handbuch zu \fBgettext\fR\|(1): . Auf Unix-Systemen können Sie den Befehl \fBlocale\fR\|(1) verwenden, um spezifische Informationen zur Spracheinstellung zu erhalten.
.IP "\fB\s-1LANGUAGE\s0\fR" 4
.IX Item "LANGUAGE"
Mit der Umgebungsvariable \fI\s-1LANGUAGE\s0\fR können Sie eine Prioritätenliste für Sprachen übergeben, die Sie durch Doppelpunkte voneinander trennen. Dos2unix gibt \fI\s-1LANGUAGE\s0\fR vor \fI\s-1LANG\s0\fR den Vorzug, zum Beispiel bei Deutsch vor Niederländisch: \f(CW\*(C`LANGUAGE=de:nl\*(C'\fR. Sie müssen zunächst die Lokalisierung aktivieren, indem Sie die Variable \fI\s-1LANG\s0\fR oder \fI\s-1LC_ALL\s0\fR auf einen anderen Wert als \fIC\fR setzen, bevor Sie die Liste der Sprachprioritäten nutzen können. Weitere Informationen finden Sie im Gettext-Handbuch:
.Sp
Falls Sie eine Sprache auswählen, die nicht verfügbar ist, erhalten Sie die Standardmeldungen in englischer Sprache.
.IP "\fB\s-1WCDLOCALEDIR\s0\fR" 4
.IX Item "WCDLOCALEDIR"
Mit der Umgebungsvariable \fI\s-1WCDLOCALEDIR\s0\fR kann die während der Kompilierung und Installation verwendete Variable \fI\s-1LOCALEDIR\s0\fR außer Kraft gesetzt werden. \fI\s-1LOCALEDIR\s0\fR wird von wcd mit vorhandener nativer Sprachunterstützung verwendet, um die Sprachdateien zu finden. Der GNU-Vorgabewert ist \f(CW\*(C`/usr/local/share/locale\*(C'\fR. Nach Eingabe von \f(CW\*(C`wcd \-V\*(C'\fR wird das von wcd verwendete \fI\s-1LOCALEDIR\s0\fR angezeigt.
.Sp
Falls Sie wcd in einem anderen als dem Vorgabeverzeichnis installiert haben, müssen Sie die Umgebungsvariable \fI\s-1WCDLOCALEDIR\s0\fR setzen, die auf das Verzeichnis mit den Sprachdateien zeigt.
.Sp
Ein Beispiel für den Windows-Befehlszeileninterpreter:
.Sp
.Vb 1
\& set WCDLOCALEDIR=c:/my_prefix/share/locale
.Ve
.Sp
Ein Beispiel für eine POSIX-Shell:
.Sp
.Vb 1
\& export WCDLOCALEDIR=$HOME/share/locale
.Ve
.IP "\fB\s-1LC_COLLATE\s0\fR" 4
.IX Item "LC_COLLATE"
Wenn mehrere Treffer für Verzeichnisse gefunden werden, zeigt wcd eine sortierte Liste an. Die Art der Sortierung hängt von der Spracheinstellung ab. Falls die Umgebungsvariable \fI\s-1LANG\s0\fR gesetzt ist, werden die Treffer wie in Wörterbüchern oder Telefonbüchern in dieser Sprache sortiert. Beispielsweise werden Punkte und Bindestriche ignoriert. Buchstaben mit oder ohne Akzentzeichen werden nicht unterschiedlich behandelt, und Groß\-/Kleinschreibung wird nicht berücksichtigt.
.Sp
Die Sortierung bevorzugt die Umgebungsvariable \fI\s-1LC_COLLATE\s0\fR vor \fI\s-1LANG\s0\fR. Falls Sie \fI\s-1LC_COLLATE\s0\fR auf \f(CW\*(C`C\*(C'\fR oder \f(CW\*(C`POSIX\*(C'\fR setzen, wird die sprachbezogene Sortierung abgeschaltet. Wenn Sie beispielsweise Deutsch bevorzugen, dies aber nicht für die Sortierung gelten soll, verwenden Sie Folgendes:
.Sp
.Vb 2
\& export LANG=de_DE
\& export LC_COLLATE=C
.Ve
.IP "\fB\s-1LC_CTYPE\s0\fR" 4
.IX Item "LC_CTYPE"
Hinsichtlich Zeichenkodierung bevorzugt Wcd die Variable \fI\s-1LC_CTYPE\s0\fR vor \fI\s-1LANG\s0\fR. Um beispielsweise die Zeichenkodierung auf \s-1UTF\-8\s0 zu setzen, können Sie Folgendes ausführen:
.Sp
.Vb 1
\& export LC_CTYPE=en_US.UTF\-8
.Ve
.IP "\fB\s-1LC_ALL\s0\fR" 4
.IX Item "LC_ALL"
Alle lokalen Umgebungsvariablen, die mit \fI\s-1LC_\s0\fR beginnen, werden durch die Umgebungsvariable \fI\s-1LC_ALL\s0\fR außer Kraft gesetzt, sofern diese definiert ist. Wcd bevorzugt \fI\s-1LC_ALL\s0\fR vor \fI\s-1LC_COLLATE\s0\fR und \fI\s-1LC_CTYPE\s0\fR.
.SS "\s-1WINDOWS CODE PAGES\s0"
.IX Subsection "WINDOWS CODE PAGES"
Es gibt zwei Gruppen von Codepages, die \s-1DOS\s0 Codepages (\s-1OEM\s0) und die Windows Codepages (\s-1ANSI\s0). Die vorgegebene Zeichenkodierung für Windows ist \s-1ANSI CP1252,\s0 wenn westeuropäische Regionaleinstellungen konfiguriert sind. Windows-Programme, wie beispielsweise Notepad, benutzen diese durch das System vorgegebene ANSI-Codepage. Die Windows-Konsole verwendet standardmäßig eine OEM-Codepage (\s-1CP437\s0 oder \s-1CP850\s0), um Abwärtskompatibilität zu DOS-Programmen zu gewährleisten. Wenn Sie eine DOS-Version von wcd in der Windows-Konsole verwenden, wird dies aufgrund der DOS-Codepage funktionieren, allerdings fehlt der DOS-Version von wcd unter Windows die Unterstützung für lange Verzeichnisnamen und Netzlaufwerke.
.PP
Die Windows-Version von wcd ist ein natives Windows-Programm, das die ANSI-Codepage des Windows-Systems verwendet. Auf einem Windows mit westeuropäischen Regionaleinstellungen wird so die Codepage \s-1CP1252\s0 für Verzeichnisnamen und Meldungen verwendet. Um konsistente, von der aktiven Codepage unabhängige Ausgaben zu erzielen, übersetzen alle Windows-Versionen von wcd die ANSI-Ausgaben im Befehlszeileninterpreter und der PowerShell in Unicode-Ausgaben.
.PP
Die Rasterschrift der Konsole unterstützt nur die originale OEM-Codepage, die mit Windows installiert wurde, daher müssen Sie die Schriftart der Konsole auf die TrueType-Schrift »Lucida Console« ändern, damit Unicode\- und ANSI-Zeichen korrekt angezeigt werden.
.PP
Die Nicht-Unicode-Versionen von Wcd \fIvor Version 5.2.0\fR verwenden die gewöhnliche ANSI-Ausgabe. Für diese älteren Versionen muss die Codepage der Konsole der System-Codepage angeglichen werden (auf 1252), damit wcd unter Windows spezielle Zeichen wie Akzentzeichen oder das Euro-Symbol korrekt anzeigen kann.
.PP
Die Windows-System-Codepage kann in den Regionaleinstellungen der Systemsteuerung geändert werden. Die Codepage der Windows-Konsole wird mit dem Befehl \f(CW\*(C`chcp\*(C'\fR geändert.
.PP
Wenn Sie \f(CW\*(C`wcd \-V\*(C'\fR eingeben, wird die gegenwärtige von wcd verwendete Zeichenkodierung angezeigt. Geben Sie den Befehl \f(CW\*(C`chcp\*(C'\fR ein, um die aktive Codepage für die Windows-Konsole anzuzeigen.
.SS "\s-1UNICODE\s0"
.IX Subsection "UNICODE"
Wcd verfügt über optionale Unterstützung für Unicode. Um zu sehen, ob wcd mit Unicode\-Unterstützung erstellt wurde, geben Sie \f(CW\*(C`wcd \-V\*(C'\fR ein. Sofern Ihr Terminal oder Ihre Konsole sowie die Schriftart es unterstützt, sollten Sie das Euro-Symbol und chinesische Zeichen sehen (echte chinesische Zeichen, keinen chinesisch aussehenden Zeichensalat).
.PP
Wcd wurde \fIweich\fR auf Unicode migriert. In dessen Kern werden alle Daten als Byte-Datenstrom verarbeitet. Nur die auf dem Bildschirm ausgegebenen Zeilen werden unmittelbar in Unicode-Zeichen umgewandelt. Wcd verwendet vollständig libc-Funktionen und enthält keinen UTF\-8\-spezifischen Code. Siehe auch .
.PP
Wcd verfügt über optionale Unterstützung für Unicode-Suche mit Normalisierung. Um zu ermitteln, ob wcd mit Unterstützung für Normalisierung erstellt wurde, geben Sie \f(CW\*(C`wcd \-V\*(C'\fR ein. Wcd mit Unicode-Normalisierung findet Treffer mittels \fIkompatiblen\fR Entsprechungen. Ohne diese Unterstützung werden Verzeichnisse nur gefunden, wenn Sie kanonisch äquivalent sind. Siehe auch .
.PP
\fI\s-1UTF\-8\s0 unter Unix/Linux\fR
.IX Subsection "UTF-8 unter Unix/Linux"
.PP
Um UTF\-8\-Zeichen in Ihrer Konsole oder Ihrem Terminal anzeigen zu lassen, muss dieses auch \s-1UTF\-8\s0 unterstützen. Die mit XFree86 4.0 oder neuer gelieferte Version von xterm bringt UTF\-8\-Unterstützung bereits mit. Um dies zu aktivieren, starten Sie \fBxterm\fR\|(1) mit einer UTF\-8\-Spracheinstellung und verwenden Sie eine Schriftart mit der Zeichenkodierung iso10646\-1, zum Beispiel mit
.PP
.Vb 1
\& LC_CTYPE=en_GB.UTF\-8 xterm \-u8 \-fn \*(Aq\-Misc\-Fixed\-Medium\-R\-SemiCondensed\-\-13\-120\-75\-75\-C\-60\-ISO10646\-1\*(Aq
.Ve
.PP
Moderne GNU-Linux-Distributionen unterstützen \s-1UTF\-8\s0 per Vorgabe. Andere Multibyte-Zeichenkodierungen sollten auch funktionieren, allerdings wurde dies nicht getestet.
.PP
Wcd nimmt an, dass die Baumdateien in der lokalen Zeichenkodierung vorliegen. In die Baumdateien werden keine Bytereihenfolge-Markierungen geschrieben.
.PP
\fI\s-1UTF\-16\s0 unter Windows\fR
.IX Subsection "UTF-16 unter Windows"
.PP
Unter Windows wird Unicode in allen Versionen der PowerShell sowie im Befehlszeileninterpreter von Windows 7 (oder neuer) unterstützt. Unicode funktioniert auch in Take Command oder \s-1TCC/LE\s0 von \s-1JP\s0 Software, welches in älteren Windows-Versionen verwendet werden kann (XP/Vista).
.PP
Unter Windows sind alle Verzeichnisnamen in Unicode \s-1UTF\-16\s0 kodiert. Für Nicht-Unicode-Windows-Programme werden die Unicode-Zeichen in die vorgegebene ANSI-Codepage übersetzt. Bei Zeichen, die nicht Teil der Regionaleinstellung sind, ist diese Übersetzung nicht möglich. Daher geben Nicht-Unicode-Programme stattdessen ein Fragezeichen oder ein falsches Zeichen aus.
.PP
Wcd mit Unicode\-Unterstützung liest die in \s-1UTF\-16\s0 kodierten Verzeichnisnamen und wandelt diese intern in \s-1UTF\-8\s0 um. Alle Baumdateien sind in \s-1UTF\-8\s0 kodiert und nicht zu den Nicht-Unicode-Versionen von wcd kompatibel. Wcd erstellt ein in \s-1UTF\-8\s0 kodiertes Go-Skript.
.PP
Alle Versionen der Windows Powershell können in \s-1UTF\-8\s0 kodierte Skripte ausführen, sofern sich im Skript eine \s-1BOM\s0 (Bytereihenfolge-Markierung) für \s-1UTF\-8\s0 befindet.
.PP
Seit Windows 7 ist es möglich, im Windows-Befehlszeileninterpreter mit einem Batch-Skript in ein Verzeichnis zu wechseln, dessen Name Unicode-Zeichen enthält. Der Verzeichnisname muss in \s-1UTF\-8\s0 kodiert sein, und das Batch-Skript \fIdarf keine \s-1BOM\s0 enthalten\fR (Markierung der Bytereihenfolge). Die aktive Codepage des Befehlszeileninterpreters muss vor dem cd-Befehl auf 65001 (\s-1UTF\-8\s0) gesetzt werden. Wcd für den Befehlszeileninterpreter erstellt ein solches Go-Skript \f(CW\*(C`wcdgo.bat\*(C'\fR. Es ändert zuerst die Codepage in 65001, wechselt dann das Verzeichnis und setzt zum Schluss die Codepage auf die ursprüngliche Einstellung zurück.
.PP
Sie müssen die Schrift auf die TrueType-Schriftart »Lucida Console« setzen (nicht auf die Rasterschrift), falls Zeichen nicht korrekt angezeigt werden.
.PP
Die Nicht-Unicode-Version von wcd für Windows liest Unicode-Baumdateien seit Version 5.2.0, sofern sich eine \s-1BOM\s0 (Markierung der Bytereihenfolge) in der Datei befindet (siehe ). Allerdings ist es nicht möglich, in Verzeichnisse zu wechseln, deren Namen Unicode-Zeichen enthalten, die nicht Teil der vorgegebenen ANSI-Codepage des Systems sind. Die Unicode-Version von wcd für Windows schreibt seit Version 5.2.0 eine \s-1BOM\s0 in die in \s-1UTF\-8\s0 kodierten Baumdateien, wodurch diese auch in Notepad lesbar sind.
.PP
\fI\s-1UTF\-8\s0 unter Cygwin\fR
.IX Subsection "UTF-8 unter Cygwin"
.PP
Cygwin unterstützt Unicode seit Version 1.7. Die Cygwin-Zwischenschicht achtet darauf, dass die UTF\-16\-Namen unter Windows in \s-1UTF\-8\s0 umgewandelt werden. Daher brauchen Programme, wie beispielsweise wcd, darauf keine Rücksicht zu nehmen und können mit einer UTF\-8\-Zeichenkodierung wie unter Unix/Linux arbeiten. Setzen Sie die Zeichenkodierung mit der Umgebungsvariable \fI\s-1LANG\s0\fR oder \fI\s-1LC_CTYPE\s0\fR auf \s-1UTF\-8.\s0 Es wird nötig sein, dass Sie Ihre Laufwerke neu einlesen. Sie müssen die Schrift auf die TrueType-Schriftart »Lucida Console« setzen (nicht auf die Rasterschrift), falls Sie die Cygwin-Standardkonsole verwenden.
.PP
Die Cygwin-Version verhält sich exakt genauso wie die Unix-Version von wcd. Es wird keine Markierung der Bytereihenfolge (\s-1BOM\s0) in die Baumdateien geschrieben, und es wird angenommen, dass die Dateien in der Zeichenkodierung vorliegen, die von der Spracheinstellung in \fBCygwin\fR vorgegeben ist.
.SH "DATEIEN"
.IX Header "DATEIEN"
Falls die Umgebungsvariable \fI\s-1WCDHOME\s0\fR gesetzt ist, verwendet wcd \fI\s-1WCDHOME\s0\fR anstelle von \fI\s-1HOME\s0\fR. Alle \f(CW\*(C`*.wcd\*(C'\fR\-Dateien sind Textdateien, die mit einem Texteditor bearbeitet werden können. Die Wcd-Version für den Windows-Befehlszeileninterpreter verhält sich wie die DOS-Version, und die Cygwin-Version verhält sich wie die Unix-Version.
.IP "\fBwcd.exe\fR" 4
.IX Item "wcd.exe"
Das Programm. In Unix-Shells wird das Programm stets durch eine Funktion oder einen Alias aufgerufen, da das aktuelle Arbeitsverzeichnis einer Unix-Shell nur mit dem eingebauten cd-Befehl gewechselt werden kann. Siehe auch Abschnitt \s-1INSTALLATION.\s0
.IP "\fBvorgegebene Baumdatei\fR" 4
.IX Item "vorgegebene Baumdatei"
Dies ist die vorgegebene Baumdatei, in der wcd nach Treffern sucht. Falls diese nicht lesbar ist, erstellt wcd eine neue Datei.
.Sp
.Vb 2
\& DOS: \etreedata.wcd or %HOME%\etreedata.wcd
\& Unix: $HOME/.treedata.wcd
.Ve
.IP "\fBzusätzliche Baumdatei\fR" 4
.IX Item "zusätzliche Baumdatei"
Eine optionale zusätzliche Baumdatei. Falls diese existiert und lesbar ist, sucht wcd auch in dieser Datei nach Treffern.
.Sp
.Vb 2
\& DOS: \eextra.wcd or %HOME%\eextra.wcd
\& Unix: $HOME/.extra.wcd
.Ve
.IP "\fBBann-Datei\fR" 4
.IX Item "Bann-Datei"
In dieser optionalen Datei speichert wcd die verbannten Pfade. Siehe Option \fB\-b\fR. Platzhalter werden unterstützt.
.Sp
.Vb 2
\& DOS: \eban.wcd or %HOME%\eban.wcd
\& Unix: $HOME/.ban.wcd
.Ve
.IP "\fBAlias-Datei\fR" 4
.IX Item "Alias-Datei"
Optionale Datei mit Aliasen für wcd. Siehe Option \fB\-l\fR.
.Sp
.Vb 2
\& DOS: \ealias.wcd or %HOME%\ealias.wcd
\& Unix: $HOME/.alias.wcd
.Ve
.IP "\fBStapeldatei\fR" 4
.IX Item "Stapeldatei"
In dieser Datei speichert wcd den Stapel. Der Laufwerksbuchstabe kann mit der Option \fB\-d\fR geändert werden.
.Sp
.Vb 2
\& DOS: c:\estack.wcd or %HOME%\estack.wcd
\& Unix: $HOME/.stack.wcd
.Ve
.Sp
Der Name der Stapeldatei kann mit der Umgebungsvariable \fI\s-1WCDSTACKFILE\s0\fR geändert werden. Siehe Abschnitt \s-1UMGEBUNGSVARIABLEN.\s0
.IP "\fBGo-Skript\fR" 4
.IX Item "Go-Skript"
Dies ist das Shell-Skript, welches wcd.exe jedes Mal erzeugt. Es wird über eine Funktion oder einen Alias eingelesen. Der Laufwerksbuchstabe kann mit der Option \fB\-d\fR geändert werden. Aus historischen Gründen ist es per Vorgabe auf Unix-Systemen in \f(CW\*(C`$HOME/bin\*(C'\fR gespeichert. Das Verzeichnis für diese Datei kann mit der Option \fB\-G\fR geändert werden.
.Sp
.Vb 8
\& DOS\-Bash: c:/wcd.go oder $HOME/wcd.go
\& Windows Befehlszeileninterpreter: c:\ewcdgo.bat oder %HOME%\ewcdgo.bat
\& Windows PowerShell: $env:HOME\ewcdgo.ps1
\& WinZsh: $HOME/wcd.go
\& Cygwin/MSYS: $HOME/bin/wcd.go
\& OS/2\-Befehlszeileninterpreter: c:\ewcdgo.cmd oder %HOME%\ewcdgo.cmd
\& OS/2\-Bash: c:/wcd.go oder $HOME/wcd.go
\& Unix: $HOME/bin/wcd.go
.Ve
.IP "\fBDatei für relative Baumansicht\fR" 4
.IX Item "Datei für relative Baumansicht"
Textdatei mit relativen Pfaden von \fI\s-1VERZEICHNIS\s0\fR. Siehe die Optionen \fB+S\fR, \fB\-n\fR und \fB+n\fR.
.Sp
.Vb 2
\& DOS: PATH\ertdata.wcd
\& Unix: PATH/.rtdata.wcd
.Ve
.SH "UMGEBUNGSVARIABLEN"
.IX Header "UMGEBUNGSVARIABLEN"
.IP "\fB\s-1HOME\s0\fR" 4
.IX Item "HOME"
Wcd verwendet per Vorgabe die Umgebungsvariable \fI\s-1HOME\s0\fR, um zu ermitteln, wo Dateien gespeichert werden sollen. Siehe auch den Abschnitt \s-1DATEIEN.\s0 Dies kann mit der Umgebungsvariable \fI\s-1WCDHOME\s0\fR außer Kraft gesetzt werden.
.Sp
\&\fI\s-1HOME\s0\fR legt außerdem fest, wo mit dem Einlesen des Laufwerks begonnen wird, wenn die Option \fB\-s\fR verwendet wird. Dies kann mit der Umgebungsvariable \fI\s-1WCDSCAN\s0\fR außer Kraft gesetzt werden.
.Sp
In den Versionen für Unix, Cygwin, Windows PowerShell, WinZsh und \s-1MSYS\s0 ist es erforderlich, dass \fI\s-1HOME\s0\fR oder \fI\s-1WCDHOME\s0\fR gesetzt ist. Für die anderen Versionen von wcd ist die Benutzung dieser Variablen optional.
.Sp
Falls \fI\s-1HOME\s0\fR unter DOS/Windows gesetzt ist, platziert wcd alle seine Dateien (treedata.wcd, extra.wcd, alias.wcd, ban.wcd, wcd.go) im Verzeichnis \fI\s-1HOME\s0\fR. Das Verhalten von wcd gleicht dann dem der Unix-Versionen. Wcd liest die Daten dann per Vorgabe aus \fI\s-1HOME\s0\fR ein. Laufwerke werden nicht automatisch eingelesen, wenn Sie dorthin wechseln. Sie müssen wcd explizit dazu anweisen, zum Beispiel:
.Sp
.Vb 1
\& wcd \-S c: \-A d: \-A e:
.Ve
.Sp
Die Verzeichnissuche wird nun global in allen eingelesenen Laufwerken ausgeführt.
.IP "\fB\s-1WCDHOME\s0\fR" 4
.IX Item "WCDHOME"
Mit der Umgebungsvariable \fI\s-1WCDHOME\s0\fR können Sie den Ort der Dateien von wcd ändern. Falls sowohl \fI\s-1HOME\s0\fR als auch \fI\s-1WCDHOME\s0\fR gesetzt ist, wird \fI\s-1WCDHOME\s0\fR anstelle von \fI\s-1HOME\s0\fR verwendet.
.Sp
In Wcd-Versionen vor 5.1.5 wurde durch \fI\s-1WCDHOME\s0\fR auch das vorgegebene Einleseverzeichnis geändert. Seit Version ist dies nicht mehr der Fall, siehe Option \fB\-s\fR. Verwenden Sie ab Version 5.1.5 die Umgebungsvariable \fI\s-1WCDSCAN\s0\fR, um die Einstellung des vorgegebenen Einleseverzeichnisses außer Kraft zu setzen.
.Sp
Beispiel für die Befehlszeileninterpreter in \s-1DOS,\s0 Windows, \s-1OS/2:\s0
.Sp
.Vb 1
\& set WCDHOME=C:\eUsers\eerwin\ewcd
.Ve
.Sp
Ein Beispiel für POSIX-Shells:
.Sp
.Vb 1
\& export WCDHOME="$HOME/.wcd"
.Ve
.Sp
Ein Beispiel für Csh-Shells:
.Sp
.Vb 1
\& setenv WCDHOME "$HOME/.wcd"
.Ve
.IP "\fB\s-1WCDSCAN\s0\fR" 4
.IX Item "WCDSCAN"
Verwenden Sie die Umgebungsvariable \fI\s-1WCDSCAN\s0\fR, um die Einstellung des vorgegebenen Einleseverzeichnisses \fI\s-1HOME\s0\fR außer Kraft zu setzen. Geben Sie eine durch Doppelpunkte getrennte Liste an (für Unix), wenn Sie mehr als ein Verzeichnis angeben wollen. Unter DOS/Windows verwenden Sie Semikola als Trennzeichen.
.Sp
Beispiel für die Befehlszeileninterpreter von \s-1DOS,\s0 Windows und \s-1OS/2:\s0
.Sp
.Vb 1
\& set WCDSCAN=C:\eUsers\eerwin;D:\edata
\&
\& set WCDSCAN=%HOMEDRIVE%%HOMEPATH%;\e\eprojectdrive\eprojectX
.Ve
.Sp
Ein Beispiel für POSIX-Shells:
.Sp
.Vb 1
\& export WCDSCAN="$HOME:/projectdisk/projectX"
.Ve
.Sp
Ein Beispiel für Csh-Shells:
.Sp
.Vb 1
\& setenv WCDSCAN "$HOME:/projectdisk/projectX"
.Ve
.IP "\fB\s-1WCDFILTER\s0\fR" 4
.IX Item "WCDFILTER"
Geben Sie Filter mit der Umgebungsvariable \fI\s-1WCDFILTER\s0\fR an. Alle Verzeichnisse, die nicht auf diese(n) Filter passen, werden ignoriert. Sie können eine Liste angeben, in der Sie die einzelnen Filter aneinanderreihen und dazwischen das Pfad-Trennzeichen Ihrer Shell setzen. Dies funktioniert ähnlich wie die Angabe der Variable \fI\s-1PATH\s0\fR. Ob dabei Groß\-/Kleinschreibung berücksichtigt wird, hängt vom jeweiligen Betriebssystem ab.
.Sp
Beispiel für die Befehlszeileninterpreter in \s-1DOS,\s0 Windows, \s-1OS/2:\s0
.Sp
.Vb 1
\& set WCDFILTER=projects;doc
.Ve
.Sp
Ein Beispiel für POSIX-Shells:
.Sp
.Vb 1
\& export WCDFILTER="projects:doc"
.Ve
.Sp
Ein Beispiel für Csh-Shells:
.Sp
.Vb 1
\& setenv WCDFILTER "projects:doc"
.Ve
.IP "\fB\s-1WCDBAN\s0\fR" 4
.IX Item "WCDBAN"
Die in der Umgebungsvariable \fI\s-1WCDBAN\s0\fR angegebenen Pfade werden gebannt, siehe auch die Option \fB\-b\fR. Geben Sie eine Liste der Pfade an, durch das \fI\s-1PATH\s0\fR\-Trennzeichen der Shell getrennt.
.IP "\fB\s-1WCDEXCLUDE\s0\fR" 4
.IX Item "WCDEXCLUDE"
Die in der Umgebungsvariable \fI\s-1WCDEXCLUDE\s0\fR angegebenen Pfade werden von wcd ausgeschlossen, siehe auch die Optionen \fB\-x\fR und \fB\-xf\fR. Geben Sie eine Liste der Pfade an, durch das \fI\s-1PATH\s0\fR\-Trennzeichen der Shell getrennt.
.Sp
Beispiel für die Befehlszeileninterpreter in \s-1DOS,\s0 Windows, \s-1OS/2:\s0
.Sp
.Vb 1
\& set WCDEXCLUDE=*/windows;*/temp;*CVS
.Ve
.Sp
Ein Beispiel für POSIX-Shells:
.Sp
.Vb 1
\& export WCDEXCLUDE="/dev:/tmp:*CVS"
.Ve
.Sp
Ein Beispiel für Csh-Shells:
.Sp
.Vb 1
\& setenv WCDEXCLUDE "/dev:/tmp:*CVS"
.Ve
.IP "\fB\s-1WCDUSERSHOME\s0\fR" 4
.IX Item "WCDUSERSHOME"
Dies legt das übergeordnete Verzeichnis der Home-Verzeichnisse der Benutzer fest. Unter DOS/Windows ist der Standardwert \f(CW\*(C`\e\eusers\*(C'\fR. Unter Unix/Cygwin ist \f(CW\*(C`/home\*(C'\fR die Vorgabe. Die Variable wird verwendet, um die Baumdateien anderer Benutzer einzulesen. Siehe auch die Optionen \fB\-u\fR und \fB+u\fR. Im ausführlichen Modus gibt wcd alle Filter sowie gebannte und auszuschließende Verzeichnisse aus. Siehe Option \fB\-v\fR.
.IP "\fB\s-1WCDSTACKFILE\s0\fR" 4
.IX Item "WCDSTACKFILE"
Wcd bevorzugt \fI\s-1WCDSTACKFILE\s0\fR gegenüber dem vorgegebenen Namen der Stapeldatei (siehe Abschnitt \s-1DATEIEN\s0). Mit dieser Variable kann jede Shell oder jede Terminalemulation ihren eigenen Verzeichnisstapel haben.
.Sp
So verwenden Sie eine eindeutige zeitbasierte Datei (JJJJMMTT-HHMMSS) für jede geöffnete interaktive Shell:
.Sp
.Vb 1
\& export WCDSTACKFILE=$HOME/.wcd/stack.$(date +%Y%m%d\-%H%M%S)
.Ve
.Sp
Für einen Stapel pro \fBxterm\fR\|(1) verwenden Sie die Umgebungsvariable \fI\s-1WINDOWID\s0\fR:
.Sp
.Vb 1
\& export WCDSTACKFILE=$HOME/.wcd/stack.$WINDOWID
.Ve
.Sp
Einen Stapel pro Bildschirm erreichen Sie für \s-1GNU\s0 \fBscreen\fR\|(1) so:
.Sp
.Vb 1
\& export WCDSTACKFILE=$HOME/.wcd/stack.$WINDOW
.Ve
.IP "\fB\s-1TERMINFO\s0\fR" 4
.IX Item "TERMINFO"
Wenn die Umgebungsvariable \fI\s-1TERMINFO\s0\fR, sucht wcd mit ncurses-Schnittstelle nach einer lokalen Teminaldefinition, bevor am Standardort gesucht wird. Dies ist sinnvoll für Terminaldefinitionen, die sich nicht an einem vorgegebenen Ort befinden. Oft verwendete Standardorte sind \f(CW\*(C`/usr/lib/terminfo\*(C'\fR und \f(CW\*(C`/usr/share/terminfo\*(C'\fR.
.IP "\fB\s-1PDC_RESTORE_SCREEN\s0\fR" 4
.IX Item "PDC_RESTORE_SCREEN"
Wcd mit PDCurses-Schnittstelle berücksichtigt die Umgebungsvariable \fI\s-1PDC_RESTORE_SCREEN\s0\fR. Falls diese Umgebungsvariable gesetzt ist, erzeugt PDCurses eine Kopie des Bildschirminhalts zur Startzeit von wcd. Beim Abbruch von wcd wird der Bildschirm wiederhergestellt. Ein Beispiel für den Windows-Befehlszeileninterpreter:
.Sp
.Vb 1
\& set PDC_RESTORE_SCREEN=1
.Ve
.Sp
Windows kann nur einen kleinen Puffer speichern. Es ist daher nicht immer möglich, alles wiederherzustellen. Andererseits kann in der Konsole nach dem Beenden von wcd Datenmüll ausgegeben werden, falls Sie den Puffer größer gewählt haben.
.IP "\fB\s-1SHELL\s0\fR" 4
.IX Item "SHELL"
Die Angabe von \f(CW\*(C`#!$SHELL\*(C'\fR in der ersten Zeile des Go-Skripts (für \s-1POSIX\-\s0 oder C\-Shells) ist für 8\-Bit\-Zeichen nötig. Einige Shells könnten sonst annehmen, dass es sich bei dem Go-Skript um eine Binärdatei handelt und diese nicht einlesen. In der Cygwin-Bash muss die Variable \fI\s-1SHELL\s0\fR mit dem Befehl \f(CW\*(C`export\*(C'\fR gesetzt werden, sonst kann wcd diese Variable nicht lesen.
.IP "\fB\s-1BASH\s0\fR" 4
.IX Item "BASH"
Wcd für die DOS-Bash verwendet \f(CW$BASH\fR anstelle von \f(CW$SHELL\fR, weil \f(CW$SHELL\fR auf die DOS-Befehlsshell zeigt. \f(CW$BASH\fR muss mit einem \f(CW\*(C`export\*(C'\fR\-Befehl definiert werden, anderenfalls kann wcd die Variable nicht lesen.
.SH "SIEHE AUCH"
.IX Header "SIEHE AUCH"
\&\fBsh\fR\|(1), \fBbash\fR\|(1), \fBcsh\fR\|(1), \fBksh\fR\|(1), \fBzsh\fR\|(1), \fBlocale\fR\|(1), \fBncurses\fR\|(1),
.SH "AUTOREN"
.IX Header "AUTOREN"
Wcd wurde von Erwin Waterlander geschrieben.
.PP
Projektseite:
.PP
SourceForge:
.PP
Die Formatierung der Handbuchseite wurde von Jari Aalto bereitgestellt.
.PP
\&\s-1NCD\s0 wurde ursprünglich von Brad Kingsbury für Peter Nortons »Norton Utilities« etwa 1987 geschrieben. Siehe auch
wcd-6.0.5/src/man/de/man1/wcd.htm 0000644 0001755 0001001 00000201717 14421240112 015622 0 ustar waterlan Geen
wcd 6.0.5 - Wherever Change Directory
Wcd ist ein Befehlszeilenprogramm zum schnellen Verzeichniswechsel. Es spart Zeit bei Tastatureingaben. Sie brauchen nur den Teil eines Verzeichnisnamens einzugeben, und wcd wechselt dorthin. Im Falle mehrerer Treffer verfügt wcd über eine Methode zur Schnellauswahl und ermöglicht die Definition von Aliasen und das Verbannen von Verzeichnissen. Außerdem beinhaltet wcd einen interaktiven Verzeichnisbaumbrowser im Vollbildmodus mit schneller Suche.
Wcd wurde nach dem Vorbild des Norton Change Directory (NCD) entworfen. NCD erschien zuerst 1987 in The Norton Utilities, Release 4 für DOS, veröffentlicht von Peter Norton.
Wcd wurde auf verschiedene Befehlszeileninterpreter portiert: DOS (command.com), Windows (cmd.exe und PowerShell), OS/2 (cmd.exe) sowie Unix-Shells wie Bourne- (sh), Bourne-Again- (bash), Korn- (ksh), Z- (zsh) und die C- (csh) Shell und weitere auf verschiedenen Betriebssystemen ausführbare Shells.
Wcd unterstützt 8-Bit-Zeichensätze auf allen Systemen und verfügt über optionale Unterstützung für Unicode. Weitere Informationen hierzu finden Sie im Abschnitt LOKALISIERUNG.
Im Abschnitt INSTALLATION finden Sie Anweisungen, wie Sie wcd an Ihre persönlichen Wünsche anpassen können.
Grundlegende Verwendung
Per Vorgabe (wenn keine Platzhalter verwendet werden) sucht wcd nach einem Verzeichnis, dessen Name mit dem eingegebenen Namen beginnt.
Beispielsweise wechselt dieser Befehl in das Verzeichnis /home/user/Desktop des aktuellen Benutzers:
wcd Desk
Bei mehreren möglichen Übereinstimungen zeigt wcd eine Liste aller Möglichkeiten an. Der Benutzer kann dann mit einigen Tastenkürzeln seine Auswahl treffen (meist nur mit einem).
Platzhalter
Wcd unterstützt die folgenden Platzhalter:
* findet jede Zeichensequenz (kein oder mehr Zeichen)
? findet jedes einzelne Zeichen
[GRUPPE] findet jedes Zeichen in der angegebenen Gruppe,
[!GRUPPE] oder [^GRUPPE] findet jedes Zeichen, das in der angegebenen
GRUPPE nicht enthalten ist.
Eine Gruppe wird als Zeichen oder Bereich angegeben. Ein Bereich folgt der Form Zeichen minus Zeichen, zum Beispiel 0-9 oder A-Z. Dabei ist [0-9a-zA-Z_] die minimal mögliche Gruppe nach dem Muster [..]. Internationale Zeichen (zum Beispiel 8-Bit-Zeichen) sind erlaubt, falls das System diese unterstützt. Um die besondere syntaktische Bedeutung der Zeichen []*?!^-\ innerhalb oder außerhalb des Musters [..] zu berücksichtigen, so dass das exakte Zeichen gefunden wird, stellen Sie dem Zeichen einen Rückschrägstrich (\) voran, um es zu maskieren.
Die Verwendung von Platzhaltern ermöglicht eine leistungsfähige Suche. Beispielsweise findet folgende Anfrage alle Verzeichnisse, deren Name auf »top« endet:
wcd *top
Nach Verzeichnissen suchen, deren Name an einer beliebigen Stelle »top« enthält:
wcd *top*
Nach Verzeichnissen suchen, deren Name mit »a«, »b«, oder »c« beginnt:
wcd [a-c]*
Es ist auch möglich, einen Teil eines Verzeichnispfades anzugeben. Hier sucht Wcd nach Verzeichnissen, die mit »Desk« beginnen und der Pfad auf *me/Desk* passt.
wcd me/Desk
Es ist möglich, jede Art von Ausdruck mit Schrägstrichen und Platzhaltern einzugeben, zum Beispiel:
wcd src*/*1?/a*2
Weitere Anwendungsfälle
Falls keine Platzhalter verwendet werden und wcd eine perfekte Übereinstimmung findet, werden alle »unscharfen« Übereinstimmungen per Vorgabe ignoriert. Dieses Verhalten kann mit der Option -w geändert werden.
Der interaktive Verzeichnisbaumbrowser kann mit der Option -g gestartet werden.
wcd -g
Wcd generiert eine Baumdatei, in der nach dem Verzeichnis gesucht wird. Auf Unix- und Windows-Systemen fügt wcd beim Einlesen des Laufwerksinhalts symbolische Links zur Baumdatei hinzu, folgt diesen aber nicht. Dies wird deshalb unterdrückt, weil das Einlesen in einer Endlosschleife enden könnte oder größere Teile eines Netzwerks eingelesen werden müssten.
Wcd kann auch in Verzeichnisse wechseln, die nicht in der Baumdatei enthalten sind, zum Beispiel:
wcd ..
Falls wcd einen Treffer findet, aber nicht in das Verzeichnis wechseln kann, versucht es, dieses Verzeichnis aus der Baumdatei zu entfernen, jedoch nicht aus der zusätzlichen Baumdatei. Siehe auch die Option -k.
Wcd erstellt einen Verzeichnisstapel, der auf dem Laufwerk gespeichert wird. Der Stapel hat die vorgegebene Größe 10 und ist zyklisch. Siehe die Optionen -z, -, + und =.
In Umgebungen mit mehreren Benutzern kann mit der Option -u in die Verzeichnisse anderer Benutzer gewechselt werden.
Auf DOS- und Windows-Systemen ist es nicht von Bedeutung, ob Sie einen Schrägstrich »/« oder einen Rückschrägstrich »\« als Verzeichnistrenner verwenden.
Auf DOS- und Windows-Systemen ist es möglich, gleichzeitig das Laufwerk und das Verzeichnis zu wechseln, indem Sie dem Verzeichnisnamen den Laufwerksnamen voranstellen.
wcd d:games
UNC-Pfade unter Windows
Die Windows-Versionen (Befehlszeileninterpreter, PowerShell, MSYS, zsh, cygwin) unterstützen SMB-LAN-UNC-Pfade ohne Laufwerksbuchstaben wie \\Servername\Freigabename. Wcd für den Windows-Befehlszeileninterpreter benutzt den »pushd«-Befehl, um einem UNC-Pfad automatisch einen Laufwerksbuchstaben zuzuordnen. In der Windows PowerShell, MSYS, zsh und Cygwin werden UNC-Pfade vollständig unterstützt. Das aktuelle Arbeitsverzeichnis kann ein UNC-Pfad sein.
Größenänderung der Konsole unter Windows
Wcd unterstützt seit Version 6.0.3 die Größenänderung der Konsole unter Windows 10 und ConEmu (siehe https://conemu.github.io/). Die Windows-10-Konsole darf nicht im Legacy-Modus sein (prüfen sie das in den Einstellungen der Konsole). Der Bildschirm darf nicht aktualisiert werden, wenn »Wrap text output on resize« deaktiviert ist. Der Bildschirm kann manuell durch Drücken von F5 aktualisiert werden.
Schnittstellen
Wcd verfügt über drei verschiedene Schnittstellen, um aus einer Übereinstimmungsliste zu wählen. Die Schnittstelle wird bei der Kompilierung ausgewählt.
Die erste Schnittstelle verwendet die Standardeingabe und -ausgabe (stdin/stdout). Eine nummerierte Liste wird im Terminal ausgegeben. Sie können aus dieser Liste wählen, indem Sie eine Zahl eingeben und die <Eingabetaste> drücken. Diese Liste kann nicht zurückgerollt werden, wenn sie für die Bildschirmausgabe zu lang ist. Dafür muss die Zurückrollfunktion des Terminals oder der Konsole verwendet werden. Diese Schnittstelle ist sehr klein und portabel.
Die zweite Schnittstelle setzt auf der Conio-Bibliothek auf. Hier ist eine Zurückrollfunktion bereits eingebaut. Wiederum wird eine Liste angezeigt, die aber hier Buchstaben als Aufzählungszeichen verwendet. Zur Auswahl eines Listeneintrags drücken Sie einfach die entsprechende Buchstabentaste. Wenn möglich, wird der Bildschirminhalt nach dem Beenden wiederhergestellt. Wenn Sie Zahlen anstatt Buchstaben bevorzugen, können Sie die Option -N verwenden.
Die dritte Schnittstelle verwendet die Curses-Bibliothek und ist ähnlich der Conio-Schnittstelle. Die Curses-Schnittstelle von wcd hat zusätzlich auch eine »grafische« Oberfläche. Sie können ein Verzeichnis in einem interaktiven Verzeichnisbaumbrowser im Vollbildmodus auswählen. Die Navigation und Suchmethoden sind ähnlich wie in vim(1). Diese Schnittstelle kann mit der Option -g aktiviert werden.
Mit der Option -o ist es jederzeit möglich, auf die stdin/stdout-Schnittstelle (Standardeingabe/Standardausgabe) auszuweichen.
OPTIONEN
-a
fügt den aktuellen Pfad zur vorgegebenen Baumdatei hinzu.
Verwenden Sie diese Option, um schnell den aktuellen Pfad zur Baumdatei hinzuzufügen. Das erneute Einlesen des kompletten Laufwerks kann in manchen Fällen recht lange dauern.
-aa
fügt den aktuellen und alle übergeordneten Pfade zur vorgegebenen Baumdatei hinzu.
-A PFAD
liest den Verzeichnisbaum aus PFAD und fügt ihn zur vorgegebenen Baumdatei hinzu. Beispiele:
wcd -A .
wcd -A /home -A /etc
wcd -A d: -A e: -A \\server\share
Unter Windows können Sie alle freigegebenen Verzeichnisse eines Windows-LAN-Servers einlesen, indem Sie etwa Folgendes eingeben: wcd -A \\Servername.
Siehe auch die Optionen -S, -s und -E.
-b
verbannt den aktuellen Pfad.
Wcd speichert den aktuellen Pfad in der Bann-Datei. Das bedeutet, dass zukünftig alle Übereinstimmungen ignoriert werden, die sich auf dieses Verzeichnis und dessen Unterverzeichnisse beziehen.
Die Bann-Datei kann mit einem Texteditor bearbeitet werden. Die Verwendung von Platzhaltern ist möglich, außerdem werden Namensübereinstimmungen auf den absoluten Pfad bezogen.
Verbannte Pfade werden beim Einlesen des Laufwerks nicht ausgeschlossen. Um dies zu tun, verwenden Sie die Option -xf.
-c, --direct-cd
Direkter CD-Modus. Per Vorgabe arbeitet wcd wie folgt:
1. Es wird versucht, einen Treffer in der oder den Baumdatei(en)
zu finden.
2. Wird nichts gefunden, wird versucht, das eingegebene
Verzeichnis zu öffnen.
Im direkten CD-Modus arbeitet wcd in umgekehrter Reihenfolge.
1. Es wird versucht, das eingegebene Verzeichnis zu öffnen.
2. Wird nichts gefunden, wird nach einem Treffer in der oder
den Baumdatei(en) gesucht.
-d LAUFWERK
legt das Laufwerk für den Verzeichnisstapel und die Go-Datei fest (nur DOS).
Die Stapeldatei und das Go-Skript werden per Vorgabe im Laufwerk »C:« gespeichert, wenn die Umgebungsvariable HOME nicht gesetzt ist. Verwenden Sie diese Option, wenn »C:« ein schreibgeschütztes Laufwerk ist. Diese Option muss vor den Stapeloptionen -, + und = stehen.
-e
fügt den aktuellen Pfad zur zusätzlichen Baumdatei hinzu.
Verwenden Sie diese Option, um schnell den aktuellen Pfad zur zusätzlichen Baumdatei hinzuzufügen.
-ee
fügt den aktuellen Pfad und alle übergeordneten Pfade zur zusätzlichen Baumdatei hinzu.
-E PFAD
liest den Verzeichnisbaum aus PFAD und fügt ihn zur zusätzlichen Baumdatei hinzu. Siehe auch die Optionen -A und -S.
-f DATEI
liest die Baumdatei DATEI. Die vorgegebene Baumdatei wird nicht gelesen.
+f DATEI
liest die Baumdatei DATEI zusätzlich zur vorgegebenen Baumdatei.
-g
verwendet die grafische Benutzeroberfläche (nur in Versionen mit curses-Schnittstelle).
Wcd startet eine textbasierte, auf der Curses-Bibliothek aufsetzende »grafische« Schnittstelle. Sie können ein Verzeichnis in einem interaktiven Verzeichnisbaumbrowser im Vollbildmodus auswählen. Die Navigation und Suchmethoden sind ähnlich wie in vim(1).
Wenn keine Suchzeichenkette angegeben ist, stellt wcd den gesamten Baum aus den Inhalten der vorgegebenen und der zusätzlichen Baumdatei dar.
Wenn eine Suchzeichenkette angegeben ist, wird die Trefferliste als Verzeichnisbaum angezeigt.
Die vorgegebene Ansicht des Baums ähnelt der Ansicht im originalen NCD unter DOS. Der Unterschied besteht darin, dass in NCD alle Verzeichnisse der gleichen Pfadtiefe im gesamten Baum vertikal angeordnet werden. Das war in NCD möglich, da ein Verzeichnisname in DOS nicht länger als 12 Zeichen (8.3) sein durfte. Auf modernen Betriebssystemen können Verzeichnisnamen sehr lang sein, außerdem sind große Unterschiede bei den Längen der Namen der verschiedenen Verzeichnisse möglich. Deswegen werden Verzeichnisse der gleichen Pfadtiefe in wcd nicht im gesamten Baum vertikal ausgerichtet, sondern nur in Verzweigungen. Daher kann es zu Seitenbewegungen kommen, wenn Sie eigentlich in der Hierarchie direkt nach oben oder von einer Verzweigung zu einer anderen navigieren wollen.
Das Navigationsverhalten in Wcd ist exakt das gleiche wie im originalen NCD. Wenn Sie beispielsweise die Pfeil-ab-Taste drücken, gehen Sie damit zum nächsten Verzeichnis der gleichen Tiefe in der Verzeichnishierarchie, wobei Verzweigungen übersprungen werden. Dies ermöglicht die schnelle Navigation durch den Baum.
Siehe die Optionen -Ta, -TC und -Tc zum Ändern des Navigationsverhaltens.
-gd
gibt die Baumdateien als Baum in die Standardausgabe aus.
-G PFAD
schreibt das Go-Skript in das Verzeichnis PFAD. Unter Unix beispielsweise schreibt wcd -G PFAD ein Go-Skript in PFAD/wcd.go.
-GN, --no-go-script
verhindert die Erstellung eines Go-Skripts. Diese Option kann zusammen mit -j verwendet werden, wenn Sie wcd kein Go-Skript schreiben lassen wollen.
-h, --help
zeigt eine Hilfe an und beendet das Programm.
-i, --ignore-case
ignoriert Groß-/Kleinschreibung. In den DOS- und Windows-Versionen ist dies der Standard. In den Unix- und Cygwin-Versionen wird per Vorgabe die Groß-/Kleinschreibung berücksichtigt.
+i, --no-ignore-case
berücksichtigt Groß-/Kleinschreibung. Siehe auch Option -i.
-I, --ignore-diacritics
ignoriert diakritische Zeichen des lateinischen Alphabets. Buchstaben mit diakritischen Zeichen werden wie die deren Basisbuchstaben behandelt. Die folgenden Latin-Zeichenkodierungen werden unterstützt: CP437, CP850, CP852, CP1250, CP1252, ISO-8859-1, ISO-8859-2, sowie Unicode Latin-1, Latin Extended-A, und Latin Extended-B. Siehe auch http://de.wikipedia.org/wiki/Diakritisches_Zeichen
+I, --no-ignore-diacritics
berücksichtigt diakritische Zeichen (Vorgabe). Siehe auch Option -I.
-j, --just-go
Geh-einfach-Modus.
In diesem Modus zeigt wcd keine Liste an, wenn mehr als ein Verzeichnis auf das angegebene Verzeichnis passt. Wcd wechselt nur einfach zum ersten Treffer. Beim erneuten Aufruf von wcd mit den gleichen Argumenten wird zum Verzeichnis im nächsten Treffer gewechselt, und so weiter.
Wcd gibt das Verzeichnis, in das gewechselt wird, in die Standardausgabe aus. So kann eine andere Installationsmethode verwendet werden. Sie könnten die folgende Funktion für eine POSIX-kompatible Shell erstellen:
wcd ()
{
cd "$($HOME/bin/wcd.exe -j $@)"
}
Wenn Sie mit einer älteren Shell arbeiten, die nicht über Unterstützung für die Befehlsersetzung mit »$()« verfügt, müssen Sie die auch die ältere Befehlsersetzung mit Gravis-Zeichen (Backtick, »`«) verwenden.
wcd ()
{
cd "`$HOME/bin/wcd.exe -j $@`"
}
Auf Windows-Systemen mit einer NT4-Shell können Sie den folgenden Alias anlegen:
alias wcd `cd %@execstr[wcdwin32.exe -z 0 -j %1]`
Diese Methode macht ein Go-Skript überflüssig, daher können Sie die Option -GN zusammen mit -j verwenden.
-k, --keep-paths
erhält Pfade.
Die Pfade werden in der Baumdatei weiter vorgehalten, wenn wcd nicht dorthin wechseln kann. Das Vorgabeverhalten in diesem Fall ist, dass wcd versucht, diese Pfade aus der Baumdatei zu entfernen. Mit dieser Option wird das Vorgabeverhalten deaktiviert.
-K, --color
verwendet Farben im grafischen Modus.
-l ALIAS
benennt den aktuellen Pfad mit ALIAS. Wcd speichert den aktuellen Pfad mit dem ALIAS in der Alias-Datei. Bei Aliasen wird Groß-/Kleinschreibung berücksichtigt.
-ls
zeigt den Namen der Alias-Datei an und listet alle Aliase auf.
-m VERZEICHNIS
erstellt ein Verzeichnis und fügt es zur Baumdatei hinzu.
-L, --license
zeigt die Lizenz des Programms an.
-M VERZEICHNIS
erstellt ein Verzeichnis und fügt es zur zusätzlichen Baumdatei hinzu.
-n PFAD
liest die relative Baumdatei aus PFAD.
Die Datei für die vorgegebene Baumansicht wird nicht gelesen. Die Datei für die relative Baumansicht sollte schon von wcd mit der Option +S angelegt worden sein. PFAD kann auch direkt auf eine Datei verweisen.
Ein Beispiel. Nehmen wir an, ein anderes System wurde in /mnt/network eingehängt:
wcd -n /mnt/network src
Wcd öffnet die Datei der relativen Baumansicht in /mnt/network/. Die Datei enthält die Pfade relativ von diesem Punkt aus betrachtet.
+n PFAD
liest die Datei der relativen Baumansicht zusätzlich zur vorgegebenen Datei. Siehe Option -n.
-N, --numbers
verwendet Zahlen anstelle von Buchstaben.
Wcd mit einer Conio- oder Curses-basierten Benutzeroberfläche (siehe Abschnitt »Schnittstellen«) stellt eine Trefferliste mit Buchstaben als Aufzählungszeichen dar. Wenn Sie die Option -N angeben, wird die Trefferliste mit Zahlen nummeriert. Ungeachtet der Option -N können Sie einen Buchstaben oder Zahlen eingeben, um aus der Trefferliste zu wählen.
-o
verwendet die stdin/stdout-Schnittstelle (Standardeingabe/Standardausgabe).
Falls aus verschiedenen Gründen die conio- oder curses-Schnittstelle von wcd nicht funktioniert, können Sie mit der Option -o auf die stdin/stdout-Schnittstelle ausweichen.
-od, --to-stdout
gibt alle Übereinstimmungen in die Standardausgabe aus.
-q, --quiet
Stiller Modus. Die Ausgabe des endgültigen Treffers wird unterdrückt.
-r VERZEICHNIS
entfernt ein Verzeichnis und entfernt es auch aus der Baumdatei.
Wenn das Verzeichnis leer ist, wird wcd es entfernen, und versuchen, es aus der Baumdatei zu entfernen.
-rmtree VERZEICHNIS
entfernt ein Verzeichnis rekursiv und entfernt es auch aus der Baumdatei.
Wcd entfernt das Verzeichnis und dessen Untervezeichnisse und Dateien, außerdem werden die Verzeichnisse aus der Baumdatei entfernt.
-s
liest den Laufwerksinhalt (evtl. erneut) aus dem Verzeichnis $HOME ein. Falls HOME nicht definiert ist, wird das Wurzelverzeichnis »/« des Laufwerks eingelesen.
Die existierende vorgegebene Baumdatei wird dabei überschrieben.
Das vorgegebene einzulesende Verzeichnis kann mit der Umgebungsvariable WCDSCAN außer Kraft gesetzt werden. Weitere Informationen finden Sie im Abschnitt UMGEBUNGSVARIABLEN.
-S PFAD
liest den Verzeichnisbaum aus PFAD und überschreibt die vorgegebene Baumdatei. Siehe auch die Optionen -A, -s und -E. Zum Beispiel können Sie mit der Option -A eine Vorgabe-Baumdatei Ihrer Wahl erzeugen. Beispiele:
Unix:
wcd -S /
wcd -S /home -A /etc -A /usr
DOS/Windows:
wcd -S c:/
wcd -S c: -A d: -A \\server\share
Mit den Windows-Versionen können Sie alle freigegebenen Verzeichnisse eines Windows-LAN-Servers einlesen. Geben Sie etwa Folgendes ein: wcd -S \\Servername.
-S PFAD
liest das Laufwerk aus PFAD ein und platziert relative Pfade in der Datei der relativen Baumansicht. Diese Datei wird in wcd von den Optionen -n und +n verwendet. Beispiel wcd -n PFAD src.
-t
entfernt das temporäre Einhängeverzeichnis /tmp_mnt nicht (nur Unix).
Wcd entfernt per Vorgabe /tmp_mnt/ aus den Treffern. Dieses Verzeichnis wird vom Auto-Mounter verwendet. Sie können dieses Verhalten mit der Option -t abschalten.
-T, --ascii-tree
zeichnet die Baumansicht mit ASCII-Zeichen. Verwenden Sie diese Option, wenn die Zeichen zum Darstellen von Linien in Ihrem Terminal nicht korrekt angezeigt werden.
-Ta, --alt-tree-nav
verwendet einen alternativen Weg zur Navigation in der grafischen Baumansicht.
In der vorgegebenen Baumansicht im NCD-Stil verhindert die Option -Ta das Springen in beziehungslose Verzeichnisse.
In der kompakten Baumansicht funktioniert die Navigation im alternativen Modus ähnlich wie in Dateimanagern mit grafischer Benutzeroberfläche, wie dem Windows Explorer oder dem KDE Konqueror. Durch Drücken der Pfeiltasten nach oben und nach unten verschieben Sie das ausgewählte Verzeichnis eine Zeile nach oben oder unten. Die linke Pfeiltaste klappt die Unterverzeichnisse ein, wiederholtes Drücken der linken Pfeiltaste springt dann tatsächlich nach links.
Sie können direkt zwischen dem Vorgabe- und dem Alternativmodus wechseln, indem Sie <Umschalt-A> drücken.
Wenn der alternative Navigationsmodus eingeschaltet ist, sehen Sie ein »A« in der unteren rechten Ecke.
-TC, --center-tree
zentriert die Ansicht im grafischen Baum. Das ausgewählte Verzeichnis steht in der Mitte des Bildschirms. Der zentrierte Modus kann mit der Taste <t> im grafischen Baum an- und abgeschaltet werden.
Die vorgegebene nicht-zentrierte Ansicht, welche die Baumbewegungen minimiert, entspricht derjenigen im originalen NCD.
-Tc, --compact-tree
Per Vorgabe wird die »grafische« Baumansicht auf die gleiche Art gezeichnet wie im originalen NCD unter DOS. Dort darf ein Verzeichnispfad nicht länger als 66 Zeichen sein. Mit den heute üblichen tiefen Verzeichnisstrukturen kann der Baum sehr breit werden. Um dies zu vermeiden, kann wcd den Baum in einer Kompaktansicht darstellen, mit einem Verzeichnis pro Zeile, wie in den meisten grafischen Dateimanagern. Verwenden Sie die Option -Tc oder schalten Sie direkt mit der Taste <m> um.
-Td, --cjk-width
Veraltete ostasiatische CJK-Schriften (Chinesisch, Japanisch und Koreanisch) haben bestimmte Zeichen und Symbole zum Zeichnen von Linien mit einer Breite von zwei Spalten, während die Zeichenbreite in normalem Unicode eine Spalte beträgt. Beispielsweise sind das die chinesische CP936-Rasterschrift unter Windows und die Simsun-Schrift. Verwenden Sie diese Option zur korrekten Ausrichtung der grafischen Baumansicht, wenn eine veraltete CJK-Schrift verwendet wird.
Wenn der CJK-Modus eingeschaltet ist, wird ein »C« in der unteren rechten Ecke angezeigt.
-u BENUTZER
liest die Daten eines anderen Benutzers für die Baumansicht basierend auf BENUTZER ein. Ihre eigene Datei für die Baumansicht wird nicht eingelesen. Siehe auch WCDUSERSHOME im Abschnitt UMGEBUNGSVARIABLEN.
Unter Unix/Cygwin wird /home als Wurzel für die Benutzerverzeichnisse angenommen. Wcd schaut nach /home/BENUTZER/.treedata.wcd und /home/BENUTZER/.wcd/.treedata.wcd, in dieser Reihenfolge. Davon wird die erste existierende und lesbare Datei gelesen. Unter DOS/Windows wird \\users als Wurzelverzeichnis der Benutzer angenommen, daher versucht wcd \\users\BENUTZER\treedata.wcd und \\users\BENUTZER\.wcd\treedata.wcd zu lesen.
+u BENUTZER
liest die vorgegebene Baumansicht-Datei von BENUTZER zusätzlich zu Ihrer eigenen Baumansicht-Datei ein.
-v, --verbose
zeigt ausführliche Meldungen an. Mit dieser Option zeigt wcd alle Filter, Verbannungen und Ausschlüsse an.
-V, --version
zeigt Versionsinformationen an und beendet das Programm.
-w, --wild-match-only
zeigt nur Übereinstimmungen von Platzhaltern an. Alle Treffer werden als Platzhalter-Treffer angenommen.
-x PFAD
schließt PFAD vom Einlesen aus.
Mit dieser Option schließt wcd PFAD und dessen Unterverzeichnisse aller Ebenen beim Einlesen eines Laufwerks aus. Platzhalter werden unterstützt und auf absolute Pfade angewendet. Die Option -x kann mehrfach angegeben werden.
wcd -x <Pfad1> -x <Pfad2> -s
Die Option -x muss vor jeder anderen Einleseoption angegeben werden (-s, -S, +S, -A, -E).
Unter DOS/Windows müssen Sie den Laufwerksbuchstaben angeben, je nachdem, ob eine der Variablen HOME oder WCDHOME gesetzt ist. Falls HOME oder WCDHOME gesetzt ist, müssen Sie den Laufwerksbuchstaben angeben. Ein Beispiel:
wcd -x c:/temp -S c:
Anderenfalls geben Sie keinen Laufwerksbuchstaben an.
wcd -x /temp -s
-xf DATEI
schließt alle in DATEI aufgelisteten Pfade vom Einlesen aus.
Wenn diese Option ausgewählt ist, schließt wcd alle in DATEI aufgelisteten Pfade und sämtliche derer Unterverzeichnisse beim Einlesen eines Laufwerks aus. Platzhalter werden unterstützt und Namensübereinstimmungen werden auf den absoluten Pfad bezogen. Beachten Sie, dass wcd führende und angehängte Leerzeichen in einer Zeile nicht ignoriert, da sie als Zeichen in einem Verzeichnisnamen zulässig sind. Die Option -xf kann mehrfach angegeben werden. Mit folgendem Befehl schließen Sie alle verbannten Pfade vom Einlesen aus (Beispiel für wcd unter Unix):
wcd -xf ~/.ban.wcd -s
Platzhalter werden unterstützt. Um beispielsweise alle Ihre Subversion-Verzeichnisse mit administrativen Dateien auszuschließen, fügen Sie eine Zeile mit */.svn hinzu.
Die Option -xf muss vor jeder anderen Einleseoption angegeben werden (-s, -S, +S, -A, -E).
-y, --assume-yes
beantwortet alle Abfragen automatisch mit »ja«.
Wcd gibt keine Ja-/Nein-Abfragen an den Benutzer aus, nimmt aber an, dass der Benutzer stets auf alle Fragen mit Ja antworten würde. Dies kann in Verbindung mit der Option -rmtree verwendet werden. Diese Option muss vor allen Optionen angegeben werden, die zu Ja-/Nein-Abfragen führen könnten.
-z ZAHL
setzt die maximale Stapelgröße auf ZAHL.
Die vorgegebene Größe des Stapels ist 10. Stapeloperationen können deaktiviert werden, indem die Größe auf 0 gesetzt wird. Diese Option muss stets vor anderen Stapeloperationen angegeben werden (-,+,=). Anderenfalls wird die Stapelgröße wieder auf den Vorgabewert 10 zurückgesetzt.
Ein korrekter Befehl ist:
wcd -z 50 -
Die neue Stapelgröße ist 50 und wcd geht ein Verzeichnis zurück. Ein falscher Befehl wäre:
wcd - -z 50
Wcd geht ein Verzeichnis zurück und der Stapel erhält die Vorgabegröße 10. Das Argument -z 50 wird ignoriert.
Fügen Sie dies als erste Option zu Ihrem wcd-Alias oder Ihrer wcd-Funktion hinzu. Für eine POSIX-kompatible Shell wäre das:
legt ein Verzeichnis auf den Stapel (ZAHL mal). Vorgabe ist 1.
Geht ein Verzeichnis zurück. Der Befehl wcd - geht ein Verzeichnis zurück. Um mehrere Verzeichnisse zurückzugehen, fügen Sie eine Zahl hinzu, zum Beispiel in Form des Befehls wcd -3. Der Stapel ist zyklisch.
+[ZAHL]
nimmt ein Verzeichnis vom Stapel (ZAHL mal). Vorgabe ist 1.
Geht ein Verzeichnis vor. Der Befehl wcd + geht ein Verzeichnis vor. Um mehrere Verzeichnisse vorzugehen, fügen Sie eine Zahl hinzu, zum Beispiel in Form des Befehls wcd +2. Der Stapel ist zyklisch.
=
zeigt den Stapel an.
Verwenden Sie diese Option, wenn Sie nicht mehr wissen, wie oft Sie im Stapel die Ebene gewechselt haben. Der Stapel wird ausgegeben und Sie können eine Zahl wählen. Die aktuelle Position im Stapel ist mit einem Asterisk * markiert.
INSTALLATION
Das aktuelle Arbeitsverzeichnis einer Unix-Shell kann nur über den eingebauten cd(1)-Befehl gewechselt werden. Daher wird das Programm stets über eine Funktion oder einen Alias ausgeführt. Die Funktion oder der Alias verwenden ein Shell-Skript (das Go-Skript), welches von wcd erzeugt wird. Wcd funktioniert erst dann, wenn die Funktion oder der Alias definiert wurde.
Weiteren wichtigen Einfluss auf Ihre Installation nimmt die Definition der Umgebungsvariablen HOME und WCDHOME. Siehe den Abschnitt UMGEBUNGSVARIABLEN.
Installation für POSIX-Shells
Für eine POSIX-Shell (ksh, bash, zsh, etc.) unter Unix, Linux, Cygwin oder nativem MSYS fügen Sie die folgende Funktion zur Shell-Startdatei hinzu (die Bash verwendet zum Beispiel $HOME/.bashrc):
PFAD wird durch den Ort ersetzt, in dem das ausführbare wcd-Programm gespeichert ist. Laden Sie die Initialisierungsdateien der Shell neu oder starten Sie eine neue Shell.
Der Ort des Go-Skripts wcd.go ist abhängig von der Shell selbst.
Wcd für die auf DJGPP basierende DOS-Bash und die OS/2-Bash erfordert eine andere Funktionalität. Das Go-Skript wird nicht in einem Verzeichnis bin gespeichert, und falls weder WCDHOME noch HOME definiert sind, wird das Go-Skript nach c:/ geschrieben.
Weitere Informationen finden Sie im Abschnitt DATEIEN.
Installation für C-ähnliche Shells (csh, tcsh)
Fügen Sie den folgenden Alias zur Shell-Startdatei $HOME/.cshrc oder $HOME/.tcshrc hinzu:
if ( ${?WCDHOME} ) then
alias wcd "PATH/wcd.exe \!* ; source $WCDHOME/bin/wcd.go"
else
alias wcd "PATH/wcd.exe \!* ; source $HOME/bin/wcd.go"
endif
PFAD wird durch den Ort ersetzt, in dem das ausführbare wcd-Programm gespeichert ist. Laden Sie die Initialisierungsdateien der Shell neu oder starten Sie eine neue Shell.
Version für den Windows-Befehlszeileninterpreter
Entpacken Sie die Zip-Datei und fügen Sie den Ordner bin zu Ihrer Umgebungsvariable PATH hinzu.
Im Windows-Befehlszeileninterpreter kann ein Windows-Programm das aktuelle Arbeitsverzeichnis nicht wechseln, das ist aber mit einer .bat-Datei möglich. Das Batch-Skript wcd.bat ruft das wcd-Programm auf, welches seinerseits das neue Batch-Skript wcdgo.bat erzeugt. Dann führt wcd.bat wiederum wcdgo.bat aus, welches tatsächlich das Verzeichnis wechselt.
Windows VISTA und neuer
Im Befehlszeileninterpreter in Windows VISTA oder neueren Versionen ist der Zugriff auf Verzeichnisse eingeschränkt. Um Zugriff auf weitere Verzeichnisse zu erhalten, benötigen Sie Administratorrechte. Einen Befehlszeileninterpreter mit Administratorrechten erhalten Sie, wenn Sie mit der rechten Maustaste auf das Programmsymbol des Befehlszeileninterpreters klicken und Als Administrator ausführen wählen.
Version für die Windows PowerShell
Fügen Sie die folgende Funktion zu Ihrem PowerShell-Benutzerprofil hinzu. Der Ort dieses Profils wird durch die Variable $profile bestimmt. Es ist erforderlich, dass eine der Umgebungsvariablen HOME oder WCDHOME definiert ist.
function wcd
{
PATH\wcdwin32psh.exe $args
& $env:HOME\wcdgo.ps1
}
PFAD wird durch den Ort ersetzt, in dem das ausführbare wcd-Programm gespeichert ist. Starten Sie eine neue PowerShell. Wcd für die PowerShell unterstützt nur den Dateisystemtreiber und keine weiteren Treiber.
Version für den Befehlszeileninterpreter von OS/2
Im Befehlszeileninterpreter von OS/2 (cmd.exe) kann ein OS/2-Programm das aktuelle Arbeitsverzeichnis nicht wechseln. Daher erzeugt wcd ein Befehlsskript wcdgo.cmd, das in der aktuellen Shell ausgeführt werden muss. Das Skript wcd.cmd führt zuerst wcdos2.exe aus, welches seinerseits das Skript wcdgo.cmd erzeugt. Danach führt wcd.cmd das Skript wcdgo.cmd aus.
LOKALISIERUNG
LANG
Die primäre Sprache wird durch die Umgebungsvariable LANG festgelegt. Diese Variable besteht aus mehreren Teilen: Den ersten Teil bilden zwei Kleinbuchstaben, die den Sprachcode angeben. Der zweite Teil ist optional und bezeichnet den Ländercode in Großbuchstaben, vom davor stehenden Sprachcode durch einen Unterstrich getrennt. Der dritte Teil ist ebenfalls optional und gibt die Zeichenkodierung an, vom Ländercode durch einen Punkt getrennt. Einige Beispiele für Standard-POSIX-Shells:
Eine vollständige Liste der Sprachen und Ländercodes finden Sie im Handbuch zu gettext(1): http://www.gnu.org/software/gettext/manual/gettext.html#Language-Codes. Auf Unix-Systemen können Sie den Befehl locale(1) verwenden, um spezifische Informationen zur Spracheinstellung zu erhalten.
LANGUAGE
Mit der Umgebungsvariable LANGUAGE können Sie eine Prioritätenliste für Sprachen übergeben, die Sie durch Doppelpunkte voneinander trennen. Dos2unix gibt LANGUAGE vor LANG den Vorzug, zum Beispiel bei Deutsch vor Niederländisch: LANGUAGE=de:nl. Sie müssen zunächst die Lokalisierung aktivieren, indem Sie die Variable LANG oder LC_ALL auf einen anderen Wert als C setzen, bevor Sie die Liste der Sprachprioritäten nutzen können. Weitere Informationen finden Sie im Gettext-Handbuch: http://www.gnu.org/software/gettext/manual/gettext.html#The-LANGUAGE-variable
Falls Sie eine Sprache auswählen, die nicht verfügbar ist, erhalten Sie die Standardmeldungen in englischer Sprache.
WCDLOCALEDIR
Mit der Umgebungsvariable WCDLOCALEDIR kann die während der Kompilierung und Installation verwendete Variable LOCALEDIR außer Kraft gesetzt werden. LOCALEDIR wird von wcd mit vorhandener nativer Sprachunterstützung verwendet, um die Sprachdateien zu finden. Der GNU-Vorgabewert ist /usr/local/share/locale. Nach Eingabe von wcd -V wird das von wcd verwendete LOCALEDIR angezeigt.
Falls Sie wcd in einem anderen als dem Vorgabeverzeichnis installiert haben, müssen Sie die Umgebungsvariable WCDLOCALEDIR setzen, die auf das Verzeichnis mit den Sprachdateien zeigt.
Ein Beispiel für den Windows-Befehlszeileninterpreter:
set WCDLOCALEDIR=c:/my_prefix/share/locale
Ein Beispiel für eine POSIX-Shell:
export WCDLOCALEDIR=$HOME/share/locale
LC_COLLATE
Wenn mehrere Treffer für Verzeichnisse gefunden werden, zeigt wcd eine sortierte Liste an. Die Art der Sortierung hängt von der Spracheinstellung ab. Falls die Umgebungsvariable LANG gesetzt ist, werden die Treffer wie in Wörterbüchern oder Telefonbüchern in dieser Sprache sortiert. Beispielsweise werden Punkte und Bindestriche ignoriert. Buchstaben mit oder ohne Akzentzeichen werden nicht unterschiedlich behandelt, und Groß-/Kleinschreibung wird nicht berücksichtigt.
Die Sortierung bevorzugt die Umgebungsvariable LC_COLLATE vor LANG. Falls Sie LC_COLLATE auf C oder POSIX setzen, wird die sprachbezogene Sortierung abgeschaltet. Wenn Sie beispielsweise Deutsch bevorzugen, dies aber nicht für die Sortierung gelten soll, verwenden Sie Folgendes:
export LANG=de_DE
export LC_COLLATE=C
LC_CTYPE
Hinsichtlich Zeichenkodierung bevorzugt Wcd die Variable LC_CTYPE vor LANG. Um beispielsweise die Zeichenkodierung auf UTF-8 zu setzen, können Sie Folgendes ausführen:
export LC_CTYPE=en_US.UTF-8
LC_ALL
Alle lokalen Umgebungsvariablen, die mit LC_ beginnen, werden durch die Umgebungsvariable LC_ALL außer Kraft gesetzt, sofern diese definiert ist. Wcd bevorzugt LC_ALL vor LC_COLLATE und LC_CTYPE.
WINDOWS CODE PAGES
Es gibt zwei Gruppen von Codepages, die DOS Codepages (OEM) und die Windows Codepages (ANSI). Die vorgegebene Zeichenkodierung für Windows ist ANSI CP1252, wenn westeuropäische Regionaleinstellungen konfiguriert sind. Windows-Programme, wie beispielsweise Notepad, benutzen diese durch das System vorgegebene ANSI-Codepage. Die Windows-Konsole verwendet standardmäßig eine OEM-Codepage (CP437 oder CP850), um Abwärtskompatibilität zu DOS-Programmen zu gewährleisten. Wenn Sie eine DOS-Version von wcd in der Windows-Konsole verwenden, wird dies aufgrund der DOS-Codepage funktionieren, allerdings fehlt der DOS-Version von wcd unter Windows die Unterstützung für lange Verzeichnisnamen und Netzlaufwerke.
Die Windows-Version von wcd ist ein natives Windows-Programm, das die ANSI-Codepage des Windows-Systems verwendet. Auf einem Windows mit westeuropäischen Regionaleinstellungen wird so die Codepage CP1252 für Verzeichnisnamen und Meldungen verwendet. Um konsistente, von der aktiven Codepage unabhängige Ausgaben zu erzielen, übersetzen alle Windows-Versionen von wcd die ANSI-Ausgaben im Befehlszeileninterpreter und der PowerShell in Unicode-Ausgaben.
Die Rasterschrift der Konsole unterstützt nur die originale OEM-Codepage, die mit Windows installiert wurde, daher müssen Sie die Schriftart der Konsole auf die TrueType-Schrift »Lucida Console« ändern, damit Unicode- und ANSI-Zeichen korrekt angezeigt werden.
Die Nicht-Unicode-Versionen von Wcd vor Version 5.2.0 verwenden die gewöhnliche ANSI-Ausgabe. Für diese älteren Versionen muss die Codepage der Konsole der System-Codepage angeglichen werden (auf 1252), damit wcd unter Windows spezielle Zeichen wie Akzentzeichen oder das Euro-Symbol korrekt anzeigen kann.
Die Windows-System-Codepage kann in den Regionaleinstellungen der Systemsteuerung geändert werden. Die Codepage der Windows-Konsole wird mit dem Befehl chcp geändert.
Wenn Sie wcd -V eingeben, wird die gegenwärtige von wcd verwendete Zeichenkodierung angezeigt. Geben Sie den Befehl chcp ein, um die aktive Codepage für die Windows-Konsole anzuzeigen.
UNICODE
Wcd verfügt über optionale Unterstützung für Unicode. Um zu sehen, ob wcd mit Unicode-Unterstützung erstellt wurde, geben Sie wcd -V ein. Sofern Ihr Terminal oder Ihre Konsole sowie die Schriftart es unterstützt, sollten Sie das Euro-Symbol und chinesische Zeichen sehen (echte chinesische Zeichen, keinen chinesisch aussehenden Zeichensalat).
Wcd wurde weich auf Unicode migriert. In dessen Kern werden alle Daten als Byte-Datenstrom verarbeitet. Nur die auf dem Bildschirm ausgegebenen Zeilen werden unmittelbar in Unicode-Zeichen umgewandelt. Wcd verwendet vollständig libc-Funktionen und enthält keinen UTF-8-spezifischen Code. Siehe auch http://www.cl.cam.ac.uk/~mgk25/unicode.html.
Wcd verfügt über optionale Unterstützung für Unicode-Suche mit Normalisierung. Um zu ermitteln, ob wcd mit Unterstützung für Normalisierung erstellt wurde, geben Sie wcd -V ein. Wcd mit Unicode-Normalisierung findet Treffer mittels kompatiblen Entsprechungen. Ohne diese Unterstützung werden Verzeichnisse nur gefunden, wenn Sie kanonisch äquivalent sind. Siehe auch http://de.wikipedia.org/wiki/Normalisierung_%28Unicode%29.
UTF-8 unter Unix/Linux
Um UTF-8-Zeichen in Ihrer Konsole oder Ihrem Terminal anzeigen zu lassen, muss dieses auch UTF-8 unterstützen. Die mit XFree86 4.0 oder neuer gelieferte Version von xterm bringt UTF-8-Unterstützung bereits mit. Um dies zu aktivieren, starten Sie xterm(1) mit einer UTF-8-Spracheinstellung und verwenden Sie eine Schriftart mit der Zeichenkodierung iso10646-1, zum Beispiel mit
Moderne GNU-Linux-Distributionen unterstützen UTF-8 per Vorgabe. Andere Multibyte-Zeichenkodierungen sollten auch funktionieren, allerdings wurde dies nicht getestet.
Wcd nimmt an, dass die Baumdateien in der lokalen Zeichenkodierung vorliegen. In die Baumdateien werden keine Bytereihenfolge-Markierungen geschrieben.
UTF-16 unter Windows
Unter Windows wird Unicode in allen Versionen der PowerShell sowie im Befehlszeileninterpreter von Windows 7 (oder neuer) unterstützt. Unicode funktioniert auch in Take Command oder TCC/LE von JP Software, welches in älteren Windows-Versionen verwendet werden kann (XP/Vista).
Unter Windows sind alle Verzeichnisnamen in Unicode UTF-16 kodiert. Für Nicht-Unicode-Windows-Programme werden die Unicode-Zeichen in die vorgegebene ANSI-Codepage übersetzt. Bei Zeichen, die nicht Teil der Regionaleinstellung sind, ist diese Übersetzung nicht möglich. Daher geben Nicht-Unicode-Programme stattdessen ein Fragezeichen oder ein falsches Zeichen aus.
Wcd mit Unicode-Unterstützung liest die in UTF-16 kodierten Verzeichnisnamen und wandelt diese intern in UTF-8 um. Alle Baumdateien sind in UTF-8 kodiert und nicht zu den Nicht-Unicode-Versionen von wcd kompatibel. Wcd erstellt ein in UTF-8 kodiertes Go-Skript.
Alle Versionen der Windows Powershell können in UTF-8 kodierte Skripte ausführen, sofern sich im Skript eine BOM (Bytereihenfolge-Markierung) für UTF-8 befindet.
Seit Windows 7 ist es möglich, im Windows-Befehlszeileninterpreter mit einem Batch-Skript in ein Verzeichnis zu wechseln, dessen Name Unicode-Zeichen enthält. Der Verzeichnisname muss in UTF-8 kodiert sein, und das Batch-Skript darf keine BOM enthalten (Markierung der Bytereihenfolge). Die aktive Codepage des Befehlszeileninterpreters muss vor dem cd-Befehl auf 65001 (UTF-8) gesetzt werden. Wcd für den Befehlszeileninterpreter erstellt ein solches Go-Skript wcdgo.bat. Es ändert zuerst die Codepage in 65001, wechselt dann das Verzeichnis und setzt zum Schluss die Codepage auf die ursprüngliche Einstellung zurück.
Sie müssen die Schrift auf die TrueType-Schriftart »Lucida Console« setzen (nicht auf die Rasterschrift), falls Zeichen nicht korrekt angezeigt werden.
Die Nicht-Unicode-Version von wcd für Windows liest Unicode-Baumdateien seit Version 5.2.0, sofern sich eine BOM (Markierung der Bytereihenfolge) in der Datei befindet (siehe http://de.wikipedia.org/wiki/Byte_Order_Mark). Allerdings ist es nicht möglich, in Verzeichnisse zu wechseln, deren Namen Unicode-Zeichen enthalten, die nicht Teil der vorgegebenen ANSI-Codepage des Systems sind. Die Unicode-Version von wcd für Windows schreibt seit Version 5.2.0 eine BOM in die in UTF-8 kodierten Baumdateien, wodurch diese auch in Notepad lesbar sind.
UTF-8 unter Cygwin
Cygwin unterstützt Unicode seit Version 1.7. Die Cygwin-Zwischenschicht achtet darauf, dass die UTF-16-Namen unter Windows in UTF-8 umgewandelt werden. Daher brauchen Programme, wie beispielsweise wcd, darauf keine Rücksicht zu nehmen und können mit einer UTF-8-Zeichenkodierung wie unter Unix/Linux arbeiten. Setzen Sie die Zeichenkodierung mit der Umgebungsvariable LANG oder LC_CTYPE auf UTF-8. Es wird nötig sein, dass Sie Ihre Laufwerke neu einlesen. Sie müssen die Schrift auf die TrueType-Schriftart »Lucida Console« setzen (nicht auf die Rasterschrift), falls Sie die Cygwin-Standardkonsole verwenden.
Die Cygwin-Version verhält sich exakt genauso wie die Unix-Version von wcd. Es wird keine Markierung der Bytereihenfolge (BOM) in die Baumdateien geschrieben, und es wird angenommen, dass die Dateien in der Zeichenkodierung vorliegen, die von der Spracheinstellung in Cygwin vorgegeben ist.
DATEIEN
Falls die Umgebungsvariable WCDHOME gesetzt ist, verwendet wcd WCDHOME anstelle von HOME. Alle *.wcd-Dateien sind Textdateien, die mit einem Texteditor bearbeitet werden können. Die Wcd-Version für den Windows-Befehlszeileninterpreter verhält sich wie die DOS-Version, und die Cygwin-Version verhält sich wie die Unix-Version.
wcd.exe
Das Programm. In Unix-Shells wird das Programm stets durch eine Funktion oder einen Alias aufgerufen, da das aktuelle Arbeitsverzeichnis einer Unix-Shell nur mit dem eingebauten cd-Befehl gewechselt werden kann. Siehe auch Abschnitt INSTALLATION.
vorgegebene Baumdatei
Dies ist die vorgegebene Baumdatei, in der wcd nach Treffern sucht. Falls diese nicht lesbar ist, erstellt wcd eine neue Datei.
DOS: \treedata.wcd or %HOME%\treedata.wcd
Unix: $HOME/.treedata.wcd
zusätzliche Baumdatei
Eine optionale zusätzliche Baumdatei. Falls diese existiert und lesbar ist, sucht wcd auch in dieser Datei nach Treffern.
DOS: \extra.wcd or %HOME%\extra.wcd
Unix: $HOME/.extra.wcd
Bann-Datei
In dieser optionalen Datei speichert wcd die verbannten Pfade. Siehe Option -b. Platzhalter werden unterstützt.
DOS: \ban.wcd or %HOME%\ban.wcd
Unix: $HOME/.ban.wcd
Alias-Datei
Optionale Datei mit Aliasen für wcd. Siehe Option -l.
DOS: \alias.wcd or %HOME%\alias.wcd
Unix: $HOME/.alias.wcd
Stapeldatei
In dieser Datei speichert wcd den Stapel. Der Laufwerksbuchstabe kann mit der Option -d geändert werden.
DOS: c:\stack.wcd or %HOME%\stack.wcd
Unix: $HOME/.stack.wcd
Der Name der Stapeldatei kann mit der Umgebungsvariable WCDSTACKFILE geändert werden. Siehe Abschnitt UMGEBUNGSVARIABLEN.
Go-Skript
Dies ist das Shell-Skript, welches wcd.exe jedes Mal erzeugt. Es wird über eine Funktion oder einen Alias eingelesen. Der Laufwerksbuchstabe kann mit der Option -d geändert werden. Aus historischen Gründen ist es per Vorgabe auf Unix-Systemen in $HOME/bin gespeichert. Das Verzeichnis für diese Datei kann mit der Option -G geändert werden.
DOS-Bash: c:/wcd.go oder $HOME/wcd.go
Windows Befehlszeileninterpreter: c:\wcdgo.bat oder %HOME%\wcdgo.bat
Windows PowerShell: $env:HOME\wcdgo.ps1
WinZsh: $HOME/wcd.go
Cygwin/MSYS: $HOME/bin/wcd.go
OS/2-Befehlszeileninterpreter: c:\wcdgo.cmd oder %HOME%\wcdgo.cmd
OS/2-Bash: c:/wcd.go oder $HOME/wcd.go
Unix: $HOME/bin/wcd.go
Datei für relative Baumansicht
Textdatei mit relativen Pfaden von VERZEICHNIS. Siehe die Optionen +S, -n und +n.
DOS: PATH\rtdata.wcd
Unix: PATH/.rtdata.wcd
UMGEBUNGSVARIABLEN
HOME
Wcd verwendet per Vorgabe die Umgebungsvariable HOME, um zu ermitteln, wo Dateien gespeichert werden sollen. Siehe auch den Abschnitt DATEIEN. Dies kann mit der Umgebungsvariable WCDHOME außer Kraft gesetzt werden.
HOME legt außerdem fest, wo mit dem Einlesen des Laufwerks begonnen wird, wenn die Option -s verwendet wird. Dies kann mit der Umgebungsvariable WCDSCAN außer Kraft gesetzt werden.
In den Versionen für Unix, Cygwin, Windows PowerShell, WinZsh und MSYS ist es erforderlich, dass HOME oder WCDHOME gesetzt ist. Für die anderen Versionen von wcd ist die Benutzung dieser Variablen optional.
Falls HOME unter DOS/Windows gesetzt ist, platziert wcd alle seine Dateien (treedata.wcd, extra.wcd, alias.wcd, ban.wcd, wcd.go) im Verzeichnis HOME. Das Verhalten von wcd gleicht dann dem der Unix-Versionen. Wcd liest die Daten dann per Vorgabe aus HOME ein. Laufwerke werden nicht automatisch eingelesen, wenn Sie dorthin wechseln. Sie müssen wcd explizit dazu anweisen, zum Beispiel:
wcd -S c: -A d: -A e:
Die Verzeichnissuche wird nun global in allen eingelesenen Laufwerken ausgeführt.
WCDHOME
Mit der Umgebungsvariable WCDHOME können Sie den Ort der Dateien von wcd ändern. Falls sowohl HOME als auch WCDHOME gesetzt ist, wird WCDHOME anstelle von HOME verwendet.
In Wcd-Versionen vor 5.1.5 wurde durch WCDHOME auch das vorgegebene Einleseverzeichnis geändert. Seit Version ist dies nicht mehr der Fall, siehe Option -s. Verwenden Sie ab Version 5.1.5 die Umgebungsvariable WCDSCAN, um die Einstellung des vorgegebenen Einleseverzeichnisses außer Kraft zu setzen.
Beispiel für die Befehlszeileninterpreter in DOS, Windows, OS/2:
set WCDHOME=C:\Users\erwin\wcd
Ein Beispiel für POSIX-Shells:
export WCDHOME="$HOME/.wcd"
Ein Beispiel für Csh-Shells:
setenv WCDHOME "$HOME/.wcd"
WCDSCAN
Verwenden Sie die Umgebungsvariable WCDSCAN, um die Einstellung des vorgegebenen Einleseverzeichnisses HOME außer Kraft zu setzen. Geben Sie eine durch Doppelpunkte getrennte Liste an (für Unix), wenn Sie mehr als ein Verzeichnis angeben wollen. Unter DOS/Windows verwenden Sie Semikola als Trennzeichen.
Beispiel für die Befehlszeileninterpreter von DOS, Windows und OS/2:
set WCDSCAN=C:\Users\erwin;D:\data
set WCDSCAN=%HOMEDRIVE%%HOMEPATH%;\\projectdrive\projectX
Ein Beispiel für POSIX-Shells:
export WCDSCAN="$HOME:/projectdisk/projectX"
Ein Beispiel für Csh-Shells:
setenv WCDSCAN "$HOME:/projectdisk/projectX"
WCDFILTER
Geben Sie Filter mit der Umgebungsvariable WCDFILTER an. Alle Verzeichnisse, die nicht auf diese(n) Filter passen, werden ignoriert. Sie können eine Liste angeben, in der Sie die einzelnen Filter aneinanderreihen und dazwischen das Pfad-Trennzeichen Ihrer Shell setzen. Dies funktioniert ähnlich wie die Angabe der Variable PATH. Ob dabei Groß-/Kleinschreibung berücksichtigt wird, hängt vom jeweiligen Betriebssystem ab.
Beispiel für die Befehlszeileninterpreter in DOS, Windows, OS/2:
set WCDFILTER=projects;doc
Ein Beispiel für POSIX-Shells:
export WCDFILTER="projects:doc"
Ein Beispiel für Csh-Shells:
setenv WCDFILTER "projects:doc"
WCDBAN
Die in der Umgebungsvariable WCDBAN angegebenen Pfade werden gebannt, siehe auch die Option -b. Geben Sie eine Liste der Pfade an, durch das PATH-Trennzeichen der Shell getrennt.
WCDEXCLUDE
Die in der Umgebungsvariable WCDEXCLUDE angegebenen Pfade werden von wcd ausgeschlossen, siehe auch die Optionen -x und -xf. Geben Sie eine Liste der Pfade an, durch das PATH-Trennzeichen der Shell getrennt.
Beispiel für die Befehlszeileninterpreter in DOS, Windows, OS/2:
set WCDEXCLUDE=*/windows;*/temp;*CVS
Ein Beispiel für POSIX-Shells:
export WCDEXCLUDE="/dev:/tmp:*CVS"
Ein Beispiel für Csh-Shells:
setenv WCDEXCLUDE "/dev:/tmp:*CVS"
WCDUSERSHOME
Dies legt das übergeordnete Verzeichnis der Home-Verzeichnisse der Benutzer fest. Unter DOS/Windows ist der Standardwert \\users. Unter Unix/Cygwin ist /home die Vorgabe. Die Variable wird verwendet, um die Baumdateien anderer Benutzer einzulesen. Siehe auch die Optionen -u und +u. Im ausführlichen Modus gibt wcd alle Filter sowie gebannte und auszuschließende Verzeichnisse aus. Siehe Option -v.
WCDSTACKFILE
Wcd bevorzugt WCDSTACKFILE gegenüber dem vorgegebenen Namen der Stapeldatei (siehe Abschnitt DATEIEN). Mit dieser Variable kann jede Shell oder jede Terminalemulation ihren eigenen Verzeichnisstapel haben.
So verwenden Sie eine eindeutige zeitbasierte Datei (JJJJMMTT-HHMMSS) für jede geöffnete interaktive Shell:
Für einen Stapel pro xterm(1) verwenden Sie die Umgebungsvariable WINDOWID:
export WCDSTACKFILE=$HOME/.wcd/stack.$WINDOWID
Einen Stapel pro Bildschirm erreichen Sie für GNU screen(1) so:
export WCDSTACKFILE=$HOME/.wcd/stack.$WINDOW
TERMINFO
Wenn die Umgebungsvariable TERMINFO, sucht wcd mit ncurses-Schnittstelle nach einer lokalen Teminaldefinition, bevor am Standardort gesucht wird. Dies ist sinnvoll für Terminaldefinitionen, die sich nicht an einem vorgegebenen Ort befinden. Oft verwendete Standardorte sind /usr/lib/terminfo und /usr/share/terminfo.
PDC_RESTORE_SCREEN
Wcd mit PDCurses-Schnittstelle berücksichtigt die Umgebungsvariable PDC_RESTORE_SCREEN. Falls diese Umgebungsvariable gesetzt ist, erzeugt PDCurses eine Kopie des Bildschirminhalts zur Startzeit von wcd. Beim Abbruch von wcd wird der Bildschirm wiederhergestellt. Ein Beispiel für den Windows-Befehlszeileninterpreter:
set PDC_RESTORE_SCREEN=1
Windows kann nur einen kleinen Puffer speichern. Es ist daher nicht immer möglich, alles wiederherzustellen. Andererseits kann in der Konsole nach dem Beenden von wcd Datenmüll ausgegeben werden, falls Sie den Puffer größer gewählt haben.
SHELL
Die Angabe von #!$SHELL in der ersten Zeile des Go-Skripts (für POSIX- oder C-Shells) ist für 8-Bit-Zeichen nötig. Einige Shells könnten sonst annehmen, dass es sich bei dem Go-Skript um eine Binärdatei handelt und diese nicht einlesen. In der Cygwin-Bash muss die Variable SHELL mit dem Befehl export gesetzt werden, sonst kann wcd diese Variable nicht lesen.
BASH
Wcd für die DOS-Bash verwendet $BASH anstelle von $SHELL, weil $SHELL auf die DOS-Befehlsshell zeigt. $BASH muss mit einem export-Befehl definiert werden, anderenfalls kann wcd die Variable nicht lesen.
wcd-6.0.5/src/man/de/man1/wcd.txt 0000644 0001755 0001001 00000157773 14421240107 015671 0 ustar waterlan Geen BEZEICHNUNG
wcd - Wherever Change Directory
chdir für DOS und Unix
ÜBERSICHT
wcd [Optionen] [Verzeichnis]
BESCHREIBUNG
Übersicht
Wcd ist ein Befehlszeilenprogramm zum schnellen Verzeichniswechsel. Es
spart Zeit bei Tastatureingaben. Sie brauchen nur den Teil eines
Verzeichnisnamens einzugeben, und wcd wechselt dorthin. Im Falle
mehrerer Treffer verfügt wcd über eine Methode zur Schnellauswahl und
ermöglicht die Definition von Aliasen und das Verbannen von
Verzeichnissen. Außerdem beinhaltet wcd einen interaktiven
Verzeichnisbaumbrowser im Vollbildmodus mit schneller Suche.
Wcd wurde nach dem Vorbild des Norton Change Directory (NCD) entworfen.
NCD erschien zuerst 1987 in *The Norton Utilities, Release 4* für DOS,
veröffentlicht von Peter Norton.
Wcd wurde auf verschiedene Befehlszeileninterpreter portiert: DOS
(command.com), Windows (cmd.exe und PowerShell), OS/2 (cmd.exe) sowie
Unix-Shells wie Bourne- (sh), Bourne-Again- (bash), Korn- (ksh), Z-
(zsh) und die C- (csh) Shell und weitere auf verschiedenen
Betriebssystemen ausführbare Shells.
Wcd unterstützt 8-Bit-Zeichensätze auf allen Systemen und verfügt über
optionale Unterstützung für Unicode. Weitere Informationen hierzu finden
Sie im Abschnitt LOKALISIERUNG.
Im Abschnitt INSTALLATION finden Sie Anweisungen, wie Sie wcd an Ihre
persönlichen Wünsche anpassen können.
Grundlegende Verwendung
Per Vorgabe (wenn keine Platzhalter verwendet werden) sucht wcd nach
einem Verzeichnis, dessen Name mit dem eingegebenen Namen beginnt.
Beispielsweise wechselt dieser Befehl in das Verzeichnis
"/home/user/Desktop" des aktuellen Benutzers:
wcd Desk
Bei mehreren möglichen Übereinstimungen zeigt wcd eine Liste aller
Möglichkeiten an. Der Benutzer kann dann mit einigen Tastenkürzeln seine
Auswahl treffen (meist nur mit einem).
Platzhalter
Wcd unterstützt die folgenden Platzhalter:
* findet jede Zeichensequenz (kein oder mehr Zeichen)
? findet jedes einzelne Zeichen
[GRUPPE] findet jedes Zeichen in der angegebenen Gruppe,
[!GRUPPE] oder [^GRUPPE] findet jedes Zeichen, das in der angegebenen
GRUPPE nicht enthalten ist.
Eine Gruppe wird als Zeichen oder Bereich angegeben. Ein Bereich folgt
der Form *Zeichen minus Zeichen*, zum Beispiel "0-9" oder "A-Z". Dabei
ist "[0-9a-zA-Z_]" die minimal mögliche Gruppe nach dem Muster "[..]".
Internationale Zeichen (zum Beispiel 8-Bit-Zeichen) sind erlaubt, falls
das System diese unterstützt. Um die besondere syntaktische Bedeutung
der Zeichen "[]*?!^-\" innerhalb oder außerhalb des Musters "[..]" zu
berücksichtigen, so dass das exakte Zeichen gefunden wird, stellen Sie
dem Zeichen einen Rückschrägstrich ("\") voran, um es zu maskieren.
Die Verwendung von Platzhaltern ermöglicht eine leistungsfähige Suche.
Beispielsweise findet folgende Anfrage alle Verzeichnisse, deren Name
auf »top« endet:
wcd *top
Nach Verzeichnissen suchen, deren Name an einer beliebigen Stelle »top«
enthält:
wcd *top*
Nach Verzeichnissen suchen, deren Name mit »a«, »b«, oder »c« beginnt:
wcd [a-c]*
Es ist auch möglich, einen Teil eines Verzeichnispfades anzugeben. Hier
sucht Wcd nach Verzeichnissen, die mit »Desk« beginnen und der Pfad auf
**me/Desk** passt.
wcd me/Desk
Es ist möglich, jede Art von Ausdruck mit Schrägstrichen und
Platzhaltern einzugeben, zum Beispiel:
wcd src*/*1?/a*2
Weitere Anwendungsfälle
Falls keine Platzhalter verwendet werden und wcd eine perfekte
Übereinstimmung findet, werden alle »unscharfen« Übereinstimmungen per
Vorgabe ignoriert. Dieses Verhalten kann mit der Option -w geändert
werden.
Der interaktive Verzeichnisbaumbrowser kann mit der Option -g gestartet
werden.
wcd -g
Wcd generiert eine Baumdatei, in der nach dem Verzeichnis gesucht wird.
Auf Unix- und Windows-Systemen fügt wcd beim Einlesen des
Laufwerksinhalts symbolische Links zur Baumdatei hinzu, folgt diesen
aber nicht. Dies wird deshalb unterdrückt, weil das Einlesen in einer
Endlosschleife enden könnte oder größere Teile eines Netzwerks
eingelesen werden müssten.
Wcd kann auch in Verzeichnisse wechseln, die nicht in der Baumdatei
enthalten sind, zum Beispiel:
wcd ..
Falls wcd einen Treffer findet, aber nicht in das Verzeichnis wechseln
kann, versucht es, dieses Verzeichnis aus der Baumdatei zu entfernen,
jedoch nicht aus der zusätzlichen Baumdatei. Siehe auch die Option -k.
Wcd erstellt einen Verzeichnisstapel, der auf dem Laufwerk gespeichert
wird. Der Stapel hat die vorgegebene Größe 10 und ist zyklisch. Siehe
die Optionen -z, -, + und =.
In Umgebungen mit mehreren Benutzern kann mit der Option -u in die
Verzeichnisse anderer Benutzer gewechselt werden.
Auf DOS- und Windows-Systemen ist es nicht von Bedeutung, ob Sie einen
Schrägstrich »/« oder einen Rückschrägstrich »\« als Verzeichnistrenner
verwenden.
Auf DOS- und Windows-Systemen ist es möglich, gleichzeitig das Laufwerk
und das Verzeichnis zu wechseln, indem Sie dem Verzeichnisnamen den
Laufwerksnamen voranstellen.
wcd d:games
UNC-Pfade unter Windows
Die Windows-Versionen (Befehlszeileninterpreter, PowerShell, MSYS, zsh,
cygwin) unterstützen SMB-LAN-UNC-Pfade ohne Laufwerksbuchstaben wie
"\\Servername\Freigabename". Wcd für den
Windows-Befehlszeileninterpreter benutzt den »pushd«-Befehl, um einem
UNC-Pfad automatisch einen Laufwerksbuchstaben zuzuordnen. In der
Windows PowerShell, MSYS, zsh und Cygwin werden UNC-Pfade vollständig
unterstützt. Das aktuelle Arbeitsverzeichnis kann ein UNC-Pfad sein.
Größenänderung der Konsole unter Windows
Wcd unterstützt seit Version 6.0.3 die Größenänderung der Konsole unter
Windows 10 und ConEmu (siehe ). Die
Windows-10-Konsole darf nicht im Legacy-Modus sein (prüfen sie das in
den Einstellungen der Konsole). Der Bildschirm darf nicht aktualisiert
werden, wenn »Wrap text output on resize« deaktiviert ist. Der
Bildschirm kann manuell durch Drücken von F5 aktualisiert werden.
Schnittstellen
Wcd verfügt über drei verschiedene Schnittstellen, um aus einer
Übereinstimmungsliste zu wählen. Die Schnittstelle wird bei der
Kompilierung ausgewählt.
Die erste Schnittstelle verwendet die Standardeingabe und -ausgabe
(stdin/stdout). Eine nummerierte Liste wird im Terminal ausgegeben. Sie
können aus dieser Liste wählen, indem Sie eine Zahl eingeben und die
drücken. Diese Liste kann nicht zurückgerollt werden,
wenn sie für die Bildschirmausgabe zu lang ist. Dafür muss die
Zurückrollfunktion des Terminals oder der Konsole verwendet werden.
Diese Schnittstelle ist sehr klein und portabel.
Die zweite Schnittstelle setzt auf der Conio-Bibliothek auf. Hier ist
eine Zurückrollfunktion bereits eingebaut. Wiederum wird eine Liste
angezeigt, die aber hier Buchstaben als Aufzählungszeichen verwendet.
Zur Auswahl eines Listeneintrags drücken Sie einfach die entsprechende
Buchstabentaste. Wenn möglich, wird der Bildschirminhalt nach dem
Beenden wiederhergestellt. Wenn Sie Zahlen anstatt Buchstaben
bevorzugen, können Sie die Option -N verwenden.
Die dritte Schnittstelle verwendet die Curses-Bibliothek und ist ähnlich
der Conio-Schnittstelle. Die Curses-Schnittstelle von wcd hat zusätzlich
auch eine »grafische« Oberfläche. Sie können ein Verzeichnis in einem
interaktiven Verzeichnisbaumbrowser im Vollbildmodus auswählen. Die
Navigation und Suchmethoden sind ähnlich wie in vim(1). Diese
Schnittstelle kann mit der Option -g aktiviert werden.
Mit der Option -o ist es jederzeit möglich, auf die
stdin/stdout-Schnittstelle (Standardeingabe/Standardausgabe)
auszuweichen.
OPTIONEN
-a fügt den aktuellen Pfad zur vorgegebenen Baumdatei hinzu.
Verwenden Sie diese Option, um schnell den aktuellen Pfad zur
Baumdatei hinzuzufügen. Das erneute Einlesen des kompletten
Laufwerks kann in manchen Fällen recht lange dauern.
-aa fügt den aktuellen und alle übergeordneten Pfade zur vorgegebenen
Baumdatei hinzu.
-A PFAD
liest den Verzeichnisbaum aus *PFAD* und fügt ihn zur vorgegebenen
Baumdatei hinzu. Beispiele:
wcd -A .
wcd -A /home -A /etc
wcd -A d: -A e: -A \\server\share
Unter Windows können Sie alle freigegebenen Verzeichnisse eines
Windows-LAN-Servers einlesen, indem Sie etwa Folgendes eingeben:
"wcd -A \\Servername".
Siehe auch die Optionen -S, -s und -E.
-b verbannt den aktuellen Pfad.
Wcd speichert den aktuellen Pfad in der Bann-Datei. Das bedeutet,
dass zukünftig alle Übereinstimmungen ignoriert werden, die sich auf
dieses Verzeichnis und dessen Unterverzeichnisse beziehen.
Die Bann-Datei kann mit einem Texteditor bearbeitet werden. Die
Verwendung von Platzhaltern ist möglich, außerdem werden
Namensübereinstimmungen auf den absoluten Pfad bezogen.
Verbannte Pfade werden beim Einlesen des Laufwerks nicht
ausgeschlossen. Um dies zu tun, verwenden Sie die Option -xf.
-c, --direct-cd
Direkter CD-Modus. Per Vorgabe arbeitet wcd wie folgt:
1. Es wird versucht, einen Treffer in der oder den Baumdatei(en)
zu finden.
2. Wird nichts gefunden, wird versucht, das eingegebene
Verzeichnis zu öffnen.
Im direkten CD-Modus arbeitet wcd in umgekehrter Reihenfolge.
1. Es wird versucht, das eingegebene Verzeichnis zu öffnen.
2. Wird nichts gefunden, wird nach einem Treffer in der oder
den Baumdatei(en) gesucht.
-d LAUFWERK
legt das Laufwerk für den Verzeichnisstapel und die Go-Datei fest
(nur DOS).
Die Stapeldatei und das Go-Skript werden per Vorgabe im Laufwerk
»C:« gespeichert, wenn die Umgebungsvariable *HOME* nicht gesetzt
ist. Verwenden Sie diese Option, wenn »C:« ein schreibgeschütztes
Laufwerk ist. Diese Option muss vor den Stapeloptionen -, + und =
stehen.
-e fügt den aktuellen Pfad zur zusätzlichen Baumdatei hinzu.
Verwenden Sie diese Option, um schnell den aktuellen Pfad zur
zusätzlichen Baumdatei hinzuzufügen.
-ee fügt den aktuellen Pfad und alle übergeordneten Pfade zur
zusätzlichen Baumdatei hinzu.
-E PFAD
liest den Verzeichnisbaum aus *PFAD* und fügt ihn zur zusätzlichen
Baumdatei hinzu. Siehe auch die Optionen -A und -S.
-f DATEI
liest die Baumdatei *DATEI*. Die vorgegebene Baumdatei wird nicht
gelesen.
+f DATEI
liest die Baumdatei *DATEI* zusätzlich zur vorgegebenen Baumdatei.
-g verwendet die grafische Benutzeroberfläche (nur in Versionen mit
curses-Schnittstelle).
Wcd startet eine textbasierte, auf der Curses-Bibliothek aufsetzende
»grafische« Schnittstelle. Sie können ein Verzeichnis in einem
interaktiven Verzeichnisbaumbrowser im Vollbildmodus auswählen. Die
Navigation und Suchmethoden sind ähnlich wie in vim(1).
Wenn keine Suchzeichenkette angegeben ist, stellt wcd den gesamten
Baum aus den Inhalten der vorgegebenen und der zusätzlichen
Baumdatei dar.
Wenn eine Suchzeichenkette angegeben ist, wird die Trefferliste als
Verzeichnisbaum angezeigt.
Die vorgegebene Ansicht des Baums ähnelt der Ansicht im originalen
NCD unter DOS. Der Unterschied besteht darin, dass in NCD alle
Verzeichnisse der gleichen Pfadtiefe im gesamten Baum vertikal
angeordnet werden. Das war in NCD möglich, da ein Verzeichnisname in
DOS nicht länger als 12 Zeichen (8.3) sein durfte. Auf modernen
Betriebssystemen können Verzeichnisnamen sehr lang sein, außerdem
sind große Unterschiede bei den Längen der Namen der verschiedenen
Verzeichnisse möglich. Deswegen werden Verzeichnisse der gleichen
Pfadtiefe in wcd nicht im gesamten Baum vertikal ausgerichtet,
sondern nur in Verzweigungen. Daher kann es zu Seitenbewegungen
kommen, wenn Sie eigentlich in der Hierarchie direkt nach oben oder
von einer Verzweigung zu einer anderen navigieren wollen.
Das Navigationsverhalten in Wcd ist exakt das gleiche wie im
originalen NCD. Wenn Sie beispielsweise die Pfeil-ab-Taste drücken,
gehen Sie damit zum nächsten Verzeichnis der gleichen Tiefe in der
Verzeichnishierarchie, wobei Verzweigungen übersprungen werden. Dies
ermöglicht die schnelle Navigation durch den Baum.
Siehe die Optionen -Ta, -TC und -Tc zum Ändern des
Navigationsverhaltens.
-gd gibt die Baumdateien als Baum in die Standardausgabe aus.
-G PFAD
schreibt das Go-Skript in das Verzeichnis *PFAD*. Unter Unix
beispielsweise schreibt "wcd -G PFAD" ein Go-Skript in PFAD/wcd.go.
-GN, --no-go-script
verhindert die Erstellung eines Go-Skripts. Diese Option kann
zusammen mit -j verwendet werden, wenn Sie wcd kein Go-Skript
schreiben lassen wollen.
-h, --help
zeigt eine Hilfe an und beendet das Programm.
-i, --ignore-case
ignoriert Groß-/Kleinschreibung. In den DOS- und Windows-Versionen
ist dies der Standard. In den Unix- und Cygwin-Versionen wird per
Vorgabe die Groß-/Kleinschreibung berücksichtigt.
+i, --no-ignore-case
berücksichtigt Groß-/Kleinschreibung. Siehe auch Option -i.
-I, --ignore-diacritics
ignoriert diakritische Zeichen des lateinischen Alphabets.
Buchstaben mit diakritischen Zeichen werden wie die deren
Basisbuchstaben behandelt. Die folgenden Latin-Zeichenkodierungen
werden unterstützt: CP437, CP850, CP852, CP1250, CP1252, ISO-8859-1,
ISO-8859-2, sowie Unicode Latin-1, Latin Extended-A, und Latin
Extended-B. Siehe auch
+I, --no-ignore-diacritics
berücksichtigt diakritische Zeichen (Vorgabe). Siehe auch Option -I.
-j, --just-go
Geh-einfach-Modus.
In diesem Modus zeigt wcd keine Liste an, wenn mehr als ein
Verzeichnis auf das angegebene Verzeichnis passt. Wcd wechselt nur
einfach zum ersten Treffer. Beim erneuten Aufruf von wcd mit den
gleichen Argumenten wird zum Verzeichnis im nächsten Treffer
gewechselt, und so weiter.
Wcd gibt das Verzeichnis, in das gewechselt wird, in die
Standardausgabe aus. So kann eine andere Installationsmethode
verwendet werden. Sie könnten die folgende Funktion für eine
POSIX-kompatible Shell erstellen:
wcd ()
{
cd "$($HOME/bin/wcd.exe -j $@)"
}
Wenn Sie mit einer älteren Shell arbeiten, die nicht über
Unterstützung für die Befehlsersetzung mit »$()« verfügt, müssen Sie
die auch die ältere Befehlsersetzung mit Gravis-Zeichen (Backtick,
»`«) verwenden.
wcd ()
{
cd "`$HOME/bin/wcd.exe -j $@`"
}
Auf Windows-Systemen mit einer NT4-Shell können Sie den folgenden
Alias anlegen:
alias wcd `cd %@execstr[wcdwin32.exe -z 0 -j %1]`
Diese Methode macht ein Go-Skript überflüssig, daher können Sie die
Option -GN zusammen mit -j verwenden.
-k, --keep-paths
erhält Pfade.
Die Pfade werden in der Baumdatei weiter vorgehalten, wenn wcd nicht
dorthin wechseln kann. Das Vorgabeverhalten in diesem Fall ist, dass
wcd versucht, diese Pfade aus der Baumdatei zu entfernen. Mit dieser
Option wird das Vorgabeverhalten deaktiviert.
-K, --color
verwendet Farben im grafischen Modus.
-l ALIAS
benennt den aktuellen Pfad mit *ALIAS*. Wcd speichert den aktuellen
Pfad mit dem *ALIAS* in der Alias-Datei. Bei Aliasen wird
Groß-/Kleinschreibung berücksichtigt.
-ls zeigt den Namen der Alias-Datei an und listet alle Aliase auf.
-m VERZEICHNIS
erstellt ein Verzeichnis und fügt es zur Baumdatei hinzu.
-L, --license
zeigt die Lizenz des Programms an.
-M VERZEICHNIS
erstellt ein Verzeichnis und fügt es zur zusätzlichen Baumdatei
hinzu.
-n PFAD
liest die relative Baumdatei aus *PFAD*.
Die Datei für die vorgegebene Baumansicht wird nicht gelesen. Die
Datei für die relative Baumansicht sollte schon von wcd mit der
Option +S angelegt worden sein. *PFAD* kann auch direkt auf eine
Datei verweisen.
Ein Beispiel. Nehmen wir an, ein anderes System wurde in
"/mnt/network" eingehängt:
wcd -n /mnt/network src
Wcd öffnet die Datei der relativen Baumansicht in "/mnt/network/".
Die Datei enthält die Pfade relativ von diesem Punkt aus betrachtet.
+n PFAD
liest die Datei der relativen Baumansicht zusätzlich zur
vorgegebenen Datei. Siehe Option -n.
-N, --numbers
verwendet Zahlen anstelle von Buchstaben.
Wcd mit einer Conio- oder Curses-basierten Benutzeroberfläche (siehe
Abschnitt »Schnittstellen«) stellt eine Trefferliste mit Buchstaben
als Aufzählungszeichen dar. Wenn Sie die Option -N angeben, wird die
Trefferliste mit Zahlen nummeriert. Ungeachtet der Option -N können
Sie einen Buchstaben oder Zahlen eingeben, um aus der Trefferliste
zu wählen.
-o verwendet die stdin/stdout-Schnittstelle
(Standardeingabe/Standardausgabe).
Falls aus verschiedenen Gründen die conio- oder curses-Schnittstelle
von wcd nicht funktioniert, können Sie mit der Option -o auf die
stdin/stdout-Schnittstelle ausweichen.
-od, --to-stdout
gibt alle Übereinstimmungen in die Standardausgabe aus.
-q, --quiet
Stiller Modus. Die Ausgabe des endgültigen Treffers wird
unterdrückt.
-r VERZEICHNIS
entfernt ein Verzeichnis und entfernt es auch aus der Baumdatei.
Wenn das Verzeichnis leer ist, wird wcd es entfernen, und versuchen,
es aus der Baumdatei zu entfernen.
-rmtree VERZEICHNIS
entfernt ein Verzeichnis rekursiv und entfernt es auch aus der
Baumdatei.
Wcd entfernt das Verzeichnis und dessen Untervezeichnisse und
Dateien, außerdem werden die Verzeichnisse aus der Baumdatei
entfernt.
-s liest den Laufwerksinhalt (evtl. erneut) aus dem Verzeichnis $HOME
ein. Falls *HOME* nicht definiert ist, wird das Wurzelverzeichnis
»/« des Laufwerks eingelesen.
Die existierende vorgegebene Baumdatei wird dabei überschrieben.
Das vorgegebene einzulesende Verzeichnis kann mit der
Umgebungsvariable "WCDSCAN" außer Kraft gesetzt werden. Weitere
Informationen finden Sie im Abschnitt UMGEBUNGSVARIABLEN.
-S PFAD
liest den Verzeichnisbaum aus *PFAD* und überschreibt die
vorgegebene Baumdatei. Siehe auch die Optionen -A, -s und -E. Zum
Beispiel können Sie mit der Option -A eine Vorgabe-Baumdatei Ihrer
Wahl erzeugen. Beispiele:
Unix:
wcd -S /
wcd -S /home -A /etc -A /usr
DOS/Windows:
wcd -S c:/
wcd -S c: -A d: -A \\server\share
Mit den Windows-Versionen können Sie alle freigegebenen
Verzeichnisse eines Windows-LAN-Servers einlesen. Geben Sie etwa
Folgendes ein: "wcd -S \\Servername".
-S PFAD
liest das Laufwerk aus *PFAD* ein und platziert relative Pfade in
der Datei der relativen Baumansicht. Diese Datei wird in wcd von den
Optionen -n und +n verwendet. Beispiel "wcd -n PFAD src".
-t entfernt das temporäre Einhängeverzeichnis "/tmp_mnt" nicht (nur
Unix).
Wcd entfernt per Vorgabe "/tmp_mnt/" aus den Treffern. Dieses
Verzeichnis wird vom Auto-Mounter verwendet. Sie können dieses
Verhalten mit der Option -t abschalten.
-T, --ascii-tree
zeichnet die Baumansicht mit ASCII-Zeichen. Verwenden Sie diese
Option, wenn die Zeichen zum Darstellen von Linien in Ihrem Terminal
nicht korrekt angezeigt werden.
-Ta, --alt-tree-nav
verwendet einen alternativen Weg zur Navigation in der grafischen
Baumansicht.
In der vorgegebenen Baumansicht im NCD-Stil verhindert die Option
-Ta das Springen in beziehungslose Verzeichnisse.
In der kompakten Baumansicht funktioniert die Navigation im
alternativen Modus ähnlich wie in Dateimanagern mit grafischer
Benutzeroberfläche, wie dem Windows Explorer oder dem KDE Konqueror.
Durch Drücken der Pfeiltasten nach oben und nach unten verschieben
Sie das ausgewählte Verzeichnis eine Zeile nach oben oder unten. Die
linke Pfeiltaste klappt die Unterverzeichnisse ein, wiederholtes
Drücken der linken Pfeiltaste springt dann tatsächlich nach links.
Sie können direkt zwischen dem Vorgabe- und dem Alternativmodus
wechseln, indem Sie drücken.
Wenn der alternative Navigationsmodus eingeschaltet ist, sehen Sie
ein »A« in der unteren rechten Ecke.
-TC, --center-tree
zentriert die Ansicht im grafischen Baum. Das ausgewählte
Verzeichnis steht in der Mitte des Bildschirms. Der zentrierte Modus
kann mit der Taste im grafischen Baum an- und abgeschaltet
werden.
Die vorgegebene nicht-zentrierte Ansicht, welche die Baumbewegungen
minimiert, entspricht derjenigen im originalen NCD.
-Tc, --compact-tree
Per Vorgabe wird die »grafische« Baumansicht auf die gleiche Art
gezeichnet wie im originalen NCD unter DOS. Dort darf ein
Verzeichnispfad nicht länger als 66 Zeichen sein. Mit den heute
üblichen tiefen Verzeichnisstrukturen kann der Baum sehr breit
werden. Um dies zu vermeiden, kann wcd den Baum in einer
Kompaktansicht darstellen, mit einem Verzeichnis pro Zeile, wie in
den meisten grafischen Dateimanagern. Verwenden Sie die Option -Tc
oder schalten Sie direkt mit der Taste um.
-Td, --cjk-width
Veraltete ostasiatische CJK-Schriften (Chinesisch, Japanisch und
Koreanisch) haben bestimmte Zeichen und Symbole zum Zeichnen von
Linien mit einer Breite von zwei Spalten, während die Zeichenbreite
in normalem Unicode eine Spalte beträgt. Beispielsweise sind das die
chinesische CP936-Rasterschrift unter Windows und die
Simsun-Schrift. Verwenden Sie diese Option zur korrekten Ausrichtung
der grafischen Baumansicht, wenn eine veraltete CJK-Schrift
verwendet wird.
Wenn der CJK-Modus eingeschaltet ist, wird ein »C« in der unteren
rechten Ecke angezeigt.
-u BENUTZER
liest die Daten eines anderen Benutzers für die Baumansicht
basierend auf *BENUTZER* ein. Ihre eigene Datei für die Baumansicht
wird nicht eingelesen. Siehe auch *WCDUSERSHOME* im Abschnitt
UMGEBUNGSVARIABLEN.
Unter Unix/Cygwin wird "/home" als Wurzel für die
Benutzerverzeichnisse angenommen. Wcd schaut nach
"/home/BENUTZER/.treedata.wcd" und
"/home/BENUTZER/.wcd/.treedata.wcd", in dieser Reihenfolge. Davon
wird die erste existierende und lesbare Datei gelesen. Unter
DOS/Windows wird "\\users" als Wurzelverzeichnis der Benutzer
angenommen, daher versucht wcd "\\users\BENUTZER\treedata.wcd" und
"\\users\BENUTZER\.wcd\treedata.wcd" zu lesen.
+u BENUTZER
liest die vorgegebene Baumansicht-Datei von BENUTZER zusätzlich zu
Ihrer eigenen Baumansicht-Datei ein.
-v, --verbose
zeigt ausführliche Meldungen an. Mit dieser Option zeigt wcd alle
Filter, Verbannungen und Ausschlüsse an.
-V, --version
zeigt Versionsinformationen an und beendet das Programm.
-w, --wild-match-only
zeigt nur Übereinstimmungen von Platzhaltern an. Alle Treffer werden
als Platzhalter-Treffer angenommen.
-x PFAD
schließt *PFAD* vom Einlesen aus.
Mit dieser Option schließt wcd *PFAD* und dessen Unterverzeichnisse
aller Ebenen beim Einlesen eines Laufwerks aus. Platzhalter werden
unterstützt und auf absolute Pfade angewendet. Die Option -x kann
mehrfach angegeben werden.
wcd -x -x -s
Die Option -x muss vor jeder anderen Einleseoption angegeben werden
(-s, -S, +S, -A, -E).
Unter DOS/Windows müssen Sie den Laufwerksbuchstaben angeben, je
nachdem, ob eine der Variablen *HOME* oder *WCDHOME* gesetzt ist.
Falls *HOME* oder *WCDHOME* gesetzt ist, müssen Sie den
Laufwerksbuchstaben angeben. Ein Beispiel:
wcd -x c:/temp -S c:
Anderenfalls geben Sie keinen Laufwerksbuchstaben an.
wcd -x /temp -s
-xf DATEI
schließt alle in *DATEI* aufgelisteten Pfade vom Einlesen aus.
Wenn diese Option ausgewählt ist, schließt wcd alle in *DATEI*
aufgelisteten Pfade und sämtliche derer Unterverzeichnisse beim
Einlesen eines Laufwerks aus. Platzhalter werden unterstützt und
Namensübereinstimmungen werden auf den absoluten Pfad bezogen.
Beachten Sie, dass wcd führende und angehängte Leerzeichen in einer
Zeile nicht ignoriert, da sie als Zeichen in einem Verzeichnisnamen
zulässig sind. Die Option -xf kann mehrfach angegeben werden. Mit
folgendem Befehl schließen Sie alle verbannten Pfade vom Einlesen
aus (Beispiel für wcd unter Unix):
wcd -xf ~/.ban.wcd -s
Platzhalter werden unterstützt. Um beispielsweise alle Ihre
Subversion-Verzeichnisse mit administrativen Dateien auszuschließen,
fügen Sie eine Zeile mit "*/.svn" hinzu.
Die Option -xf muss vor jeder anderen Einleseoption angegeben werden
(-s, -S, +S, -A, -E).
-y, --assume-yes
beantwortet alle Abfragen automatisch mit »ja«.
Wcd gibt keine Ja-/Nein-Abfragen an den Benutzer aus, nimmt aber an,
dass der Benutzer stets auf alle Fragen mit Ja antworten würde. Dies
kann in Verbindung mit der Option -rmtree verwendet werden. Diese
Option muss vor allen Optionen angegeben werden, die zu
Ja-/Nein-Abfragen führen könnten.
-z ZAHL
setzt die maximale Stapelgröße auf ZAHL.
Die vorgegebene Größe des Stapels ist 10. Stapeloperationen können
deaktiviert werden, indem die Größe auf 0 gesetzt wird. Diese Option
muss stets vor anderen Stapeloperationen angegeben werden (-,+,=).
Anderenfalls wird die Stapelgröße wieder auf den Vorgabewert 10
zurückgesetzt.
Ein korrekter Befehl ist:
wcd -z 50 -
Die neue Stapelgröße ist 50 und wcd geht ein Verzeichnis zurück. Ein
falscher Befehl wäre:
wcd - -z 50
Wcd geht ein Verzeichnis zurück und der Stapel erhält die
Vorgabegröße 10. Das Argument -z 50 wird ignoriert.
Fügen Sie dies als erste Option zu Ihrem wcd-Alias oder Ihrer
wcd-Funktion hinzu. Für eine POSIX-kompatible Shell wäre das:
wcd ()
{
wcd.exe -z 50 "$@"
. ${WCDHOME:-${HOME}}/bin/wcd.go
}
-[ZAHL]
legt ein Verzeichnis auf den Stapel (ZAHL mal). Vorgabe ist 1.
Geht ein Verzeichnis zurück. Der Befehl "wcd -" geht ein Verzeichnis
zurück. Um mehrere Verzeichnisse zurückzugehen, fügen Sie eine Zahl
hinzu, zum Beispiel in Form des Befehls "wcd -3". Der Stapel ist
zyklisch.
+[ZAHL]
nimmt ein Verzeichnis vom Stapel (ZAHL mal). Vorgabe ist 1.
Geht ein Verzeichnis vor. Der Befehl "wcd +" geht ein Verzeichnis
vor. Um mehrere Verzeichnisse vorzugehen, fügen Sie eine Zahl hinzu,
zum Beispiel in Form des Befehls "wcd +2". Der Stapel ist zyklisch.
= zeigt den Stapel an.
Verwenden Sie diese Option, wenn Sie nicht mehr wissen, wie oft Sie
im Stapel die Ebene gewechselt haben. Der Stapel wird ausgegeben und
Sie können eine Zahl wählen. Die aktuelle Position im Stapel ist mit
einem Asterisk "*" markiert.
INSTALLATION
Das aktuelle Arbeitsverzeichnis einer Unix-Shell kann nur über den
eingebauten cd(1)-Befehl gewechselt werden. Daher wird das Programm
stets über eine Funktion oder einen Alias ausgeführt. Die Funktion oder
der Alias verwenden ein Shell-Skript (das Go-Skript), welches von wcd
erzeugt wird. Wcd funktioniert erst dann, wenn die Funktion oder der
Alias definiert wurde.
Weiteren wichtigen Einfluss auf Ihre Installation nimmt die Definition
der Umgebungsvariablen *HOME* und *WCDHOME*. Siehe den Abschnitt
UMGEBUNGSVARIABLEN.
Installation für POSIX-Shells
Für eine POSIX-Shell (ksh, bash, zsh, etc.) unter Unix, Linux, Cygwin
oder nativem MSYS fügen Sie die folgende Funktion zur Shell-Startdatei
hinzu (die Bash verwendet zum Beispiel "$HOME/.bashrc"):
wcd ()
{
PATH/wcd.exe "$@"
. ${WCDHOME:-${HOME}}/bin/wcd.go
}
*PFAD* wird durch den Ort ersetzt, in dem das ausführbare wcd-Programm
gespeichert ist. Laden Sie die Initialisierungsdateien der Shell neu
oder starten Sie eine neue Shell.
Der Ort des Go-Skripts "wcd.go" ist abhängig von der Shell selbst.
Wcd für die auf DJGPP basierende DOS-Bash und die OS/2-Bash erfordert
eine andere Funktionalität. Das Go-Skript wird nicht in einem
Verzeichnis "bin" gespeichert, und falls weder *WCDHOME* noch *HOME*
definiert sind, wird das Go-Skript nach c:/ geschrieben.
DOS-Bash:
wcd ()
{
PATH/wcdbash.exe "$@"
. ${WCDHOME:-${HOME:-"c:"}}/wcd.go
}
OS/2-Bash:
wcd ()
{
PATH/wcdos2bash.exe "$@"
. ${WCDHOME:-${HOME:-"c:"}}/wcd.go
}
Die WinZsh-Version von wcd erfordert eine etwas andere Funktion. Das
Go-Skript wird niemals in c:/ gespeichert.
wcd ()
{
PATH/wcdwin32zsh.exe "$@"
. ${WCDHOME:-${HOME}}/wcd.go
}
Weitere Informationen finden Sie im Abschnitt DATEIEN.
Installation für C-ähnliche Shells (csh, tcsh)
Fügen Sie den folgenden Alias zur Shell-Startdatei "$HOME/.cshrc" oder
"$HOME/.tcshrc" hinzu:
if ( ${?WCDHOME} ) then
alias wcd "PATH/wcd.exe \!* ; source $WCDHOME/bin/wcd.go"
else
alias wcd "PATH/wcd.exe \!* ; source $HOME/bin/wcd.go"
endif
*PFAD* wird durch den Ort ersetzt, in dem das ausführbare wcd-Programm
gespeichert ist. Laden Sie die Initialisierungsdateien der Shell neu
oder starten Sie eine neue Shell.
Version für den Windows-Befehlszeileninterpreter
Entpacken Sie die Zip-Datei und fügen Sie den Ordner "bin" zu Ihrer
Umgebungsvariable *PATH* hinzu.
Im Windows-Befehlszeileninterpreter kann ein Windows-Programm das
aktuelle Arbeitsverzeichnis nicht wechseln, das ist aber mit einer
.bat-Datei möglich. Das Batch-Skript "wcd.bat" ruft das wcd-Programm
auf, welches seinerseits das neue Batch-Skript "wcdgo.bat" erzeugt. Dann
führt "wcd.bat" wiederum "wcdgo.bat" aus, welches tatsächlich das
Verzeichnis wechselt.
Windows VISTA und neuer
Im Befehlszeileninterpreter in Windows VISTA oder neueren Versionen ist
der Zugriff auf Verzeichnisse eingeschränkt. Um Zugriff auf weitere
Verzeichnisse zu erhalten, benötigen Sie Administratorrechte. Einen
Befehlszeileninterpreter mit Administratorrechten erhalten Sie, wenn Sie
mit der rechten Maustaste auf das Programmsymbol des
Befehlszeileninterpreters klicken und *Als Administrator ausführen*
wählen.
Version für die Windows PowerShell
Fügen Sie die folgende Funktion zu Ihrem PowerShell-Benutzerprofil
hinzu. Der Ort dieses Profils wird durch die Variable $profile bestimmt.
Es ist erforderlich, dass eine der Umgebungsvariablen *HOME* oder
*WCDHOME* definiert ist.
function wcd
{
PATH\wcdwin32psh.exe $args
& $env:HOME\wcdgo.ps1
}
*PFAD* wird durch den Ort ersetzt, in dem das ausführbare wcd-Programm
gespeichert ist. Starten Sie eine neue PowerShell. Wcd für die
PowerShell unterstützt nur den Dateisystemtreiber und keine weiteren
Treiber.
Version für den Befehlszeileninterpreter von OS/2
Im Befehlszeileninterpreter von OS/2 (cmd.exe) kann ein OS/2-Programm
das aktuelle Arbeitsverzeichnis nicht wechseln. Daher erzeugt wcd ein
Befehlsskript "wcdgo.cmd", das in der aktuellen Shell ausgeführt werden
muss. Das Skript "wcd.cmd" führt zuerst "wcdos2.exe" aus, welches
seinerseits das Skript "wcdgo.cmd" erzeugt. Danach führt "wcd.cmd" das
Skript "wcdgo.cmd" aus.
LOKALISIERUNG
LANG
Die primäre Sprache wird durch die Umgebungsvariable *LANG*
festgelegt. Diese Variable besteht aus mehreren Teilen: Den ersten
Teil bilden zwei Kleinbuchstaben, die den Sprachcode angeben. Der
zweite Teil ist optional und bezeichnet den Ländercode in
Großbuchstaben, vom davor stehenden Sprachcode durch einen
Unterstrich getrennt. Der dritte Teil ist ebenfalls optional und
gibt die Zeichenkodierung an, vom Ländercode durch einen Punkt
getrennt. Einige Beispiele für Standard-POSIX-Shells:
export LANG=de Deutsch
export LANG=de_DE Deutsch, Deutschland
export LANG=de_CH Deutsch, Schweiz
export LANG=es_ES Spanisch, Spanien
export LANG=es_MX Spanisch, Mexiko
export LANG=en_US.iso88591 English, USA, Latin-1-Zeichenkodierung
Eine vollständige Liste der Sprachen und Ländercodes finden Sie im
Handbuch zu gettext(1):
. Auf Unix-Systemen können Sie den Befehl locale(1) verwenden,
um spezifische Informationen zur Spracheinstellung zu erhalten.
LANGUAGE
Mit der Umgebungsvariable *LANGUAGE* können Sie eine
Prioritätenliste für Sprachen übergeben, die Sie durch Doppelpunkte
voneinander trennen. Dos2unix gibt *LANGUAGE* vor *LANG* den Vorzug,
zum Beispiel bei Deutsch vor Niederländisch: "LANGUAGE=de:nl". Sie
müssen zunächst die Lokalisierung aktivieren, indem Sie die Variable
*LANG* oder *LC_ALL* auf einen anderen Wert als *C* setzen, bevor
Sie die Liste der Sprachprioritäten nutzen können. Weitere
Informationen finden Sie im Gettext-Handbuch:
Falls Sie eine Sprache auswählen, die nicht verfügbar ist, erhalten
Sie die Standardmeldungen in englischer Sprache.
WCDLOCALEDIR
Mit der Umgebungsvariable *WCDLOCALEDIR* kann die während der
Kompilierung und Installation verwendete Variable *LOCALEDIR* außer
Kraft gesetzt werden. *LOCALEDIR* wird von wcd mit vorhandener
nativer Sprachunterstützung verwendet, um die Sprachdateien zu
finden. Der GNU-Vorgabewert ist "/usr/local/share/locale". Nach
Eingabe von "wcd -V" wird das von wcd verwendete *LOCALEDIR*
angezeigt.
Falls Sie wcd in einem anderen als dem Vorgabeverzeichnis
installiert haben, müssen Sie die Umgebungsvariable *WCDLOCALEDIR*
setzen, die auf das Verzeichnis mit den Sprachdateien zeigt.
Ein Beispiel für den Windows-Befehlszeileninterpreter:
set WCDLOCALEDIR=c:/my_prefix/share/locale
Ein Beispiel für eine POSIX-Shell:
export WCDLOCALEDIR=$HOME/share/locale
LC_COLLATE
Wenn mehrere Treffer für Verzeichnisse gefunden werden, zeigt wcd
eine sortierte Liste an. Die Art der Sortierung hängt von der
Spracheinstellung ab. Falls die Umgebungsvariable *LANG* gesetzt
ist, werden die Treffer wie in Wörterbüchern oder Telefonbüchern in
dieser Sprache sortiert. Beispielsweise werden Punkte und
Bindestriche ignoriert. Buchstaben mit oder ohne Akzentzeichen
werden nicht unterschiedlich behandelt, und Groß-/Kleinschreibung
wird nicht berücksichtigt.
Die Sortierung bevorzugt die Umgebungsvariable *LC_COLLATE* vor
*LANG*. Falls Sie *LC_COLLATE* auf "C" oder "POSIX" setzen, wird die
sprachbezogene Sortierung abgeschaltet. Wenn Sie beispielsweise
Deutsch bevorzugen, dies aber nicht für die Sortierung gelten soll,
verwenden Sie Folgendes:
export LANG=de_DE
export LC_COLLATE=C
LC_CTYPE
Hinsichtlich Zeichenkodierung bevorzugt Wcd die Variable *LC_CTYPE*
vor *LANG*. Um beispielsweise die Zeichenkodierung auf UTF-8 zu
setzen, können Sie Folgendes ausführen:
export LC_CTYPE=en_US.UTF-8
LC_ALL
Alle lokalen Umgebungsvariablen, die mit *LC_* beginnen, werden
durch die Umgebungsvariable *LC_ALL* außer Kraft gesetzt, sofern
diese definiert ist. Wcd bevorzugt *LC_ALL* vor *LC_COLLATE* und
*LC_CTYPE*.
WINDOWS CODE PAGES
Es gibt zwei Gruppen von Codepages, die DOS Codepages (OEM) und die
Windows Codepages (ANSI). Die vorgegebene Zeichenkodierung für Windows
ist ANSI CP1252, wenn westeuropäische Regionaleinstellungen konfiguriert
sind. Windows-Programme, wie beispielsweise Notepad, benutzen diese
durch das System vorgegebene ANSI-Codepage. Die Windows-Konsole
verwendet standardmäßig eine OEM-Codepage (CP437 oder CP850), um
Abwärtskompatibilität zu DOS-Programmen zu gewährleisten. Wenn Sie eine
DOS-Version von wcd in der Windows-Konsole verwenden, wird dies aufgrund
der DOS-Codepage funktionieren, allerdings fehlt der DOS-Version von wcd
unter Windows die Unterstützung für lange Verzeichnisnamen und
Netzlaufwerke.
Die Windows-Version von wcd ist ein natives Windows-Programm, das die
ANSI-Codepage des Windows-Systems verwendet. Auf einem Windows mit
westeuropäischen Regionaleinstellungen wird so die Codepage CP1252 für
Verzeichnisnamen und Meldungen verwendet. Um konsistente, von der
aktiven Codepage unabhängige Ausgaben zu erzielen, übersetzen alle
Windows-Versionen von wcd die ANSI-Ausgaben im Befehlszeileninterpreter
und der PowerShell in Unicode-Ausgaben.
Die Rasterschrift der Konsole unterstützt nur die originale
OEM-Codepage, die mit Windows installiert wurde, daher müssen Sie die
Schriftart der Konsole auf die TrueType-Schrift »Lucida Console« ändern,
damit Unicode- und ANSI-Zeichen korrekt angezeigt werden.
Die Nicht-Unicode-Versionen von Wcd *vor Version 5.2.0* verwenden die
gewöhnliche ANSI-Ausgabe. Für diese älteren Versionen muss die Codepage
der Konsole der System-Codepage angeglichen werden (auf 1252), damit wcd
unter Windows spezielle Zeichen wie Akzentzeichen oder das Euro-Symbol
korrekt anzeigen kann.
Die Windows-System-Codepage kann in den Regionaleinstellungen der
Systemsteuerung geändert werden. Die Codepage der Windows-Konsole wird
mit dem Befehl "chcp" geändert.
Wenn Sie "wcd -V" eingeben, wird die gegenwärtige von wcd verwendete
Zeichenkodierung angezeigt. Geben Sie den Befehl "chcp" ein, um die
aktive Codepage für die Windows-Konsole anzuzeigen.
UNICODE
Wcd verfügt über optionale Unterstützung für Unicode. Um zu sehen, ob
wcd mit Unicode-Unterstützung erstellt wurde, geben Sie "wcd -V" ein.
Sofern Ihr Terminal oder Ihre Konsole sowie die Schriftart es
unterstützt, sollten Sie das Euro-Symbol und chinesische Zeichen sehen
(echte chinesische Zeichen, keinen chinesisch aussehenden Zeichensalat).
Wcd wurde *weich* auf Unicode migriert. In dessen Kern werden alle Daten
als Byte-Datenstrom verarbeitet. Nur die auf dem Bildschirm ausgegebenen
Zeilen werden unmittelbar in Unicode-Zeichen umgewandelt. Wcd verwendet
vollständig libc-Funktionen und enthält keinen UTF-8-spezifischen Code.
Siehe auch .
Wcd verfügt über optionale Unterstützung für Unicode-Suche mit
Normalisierung. Um zu ermitteln, ob wcd mit Unterstützung für
Normalisierung erstellt wurde, geben Sie "wcd -V" ein. Wcd mit
Unicode-Normalisierung findet Treffer mittels *kompatiblen*
Entsprechungen. Ohne diese Unterstützung werden Verzeichnisse nur
gefunden, wenn Sie kanonisch äquivalent sind. Siehe auch
.
UTF-8 unter Unix/Linux
Um UTF-8-Zeichen in Ihrer Konsole oder Ihrem Terminal anzeigen zu
lassen, muss dieses auch UTF-8 unterstützen. Die mit XFree86 4.0 oder
neuer gelieferte Version von xterm bringt UTF-8-Unterstützung bereits
mit. Um dies zu aktivieren, starten Sie xterm(1) mit einer
UTF-8-Spracheinstellung und verwenden Sie eine Schriftart mit der
Zeichenkodierung iso10646-1, zum Beispiel mit
LC_CTYPE=en_GB.UTF-8 xterm -u8 -fn '-Misc-Fixed-Medium-R-SemiCondensed--13-120-75-75-C-60-ISO10646-1'
Moderne GNU-Linux-Distributionen unterstützen UTF-8 per Vorgabe. Andere
Multibyte-Zeichenkodierungen sollten auch funktionieren, allerdings
wurde dies nicht getestet.
Wcd nimmt an, dass die Baumdateien in der lokalen Zeichenkodierung
vorliegen. In die Baumdateien werden keine Bytereihenfolge-Markierungen
geschrieben.
UTF-16 unter Windows
Unter Windows wird Unicode in allen Versionen der PowerShell sowie im
Befehlszeileninterpreter von Windows 7 (oder neuer) unterstützt. Unicode
funktioniert auch in Take Command oder TCC/LE von JP Software, welches
in älteren Windows-Versionen verwendet werden kann (XP/Vista).
Unter Windows sind alle Verzeichnisnamen in Unicode UTF-16 kodiert. Für
Nicht-Unicode-Windows-Programme werden die Unicode-Zeichen in die
vorgegebene ANSI-Codepage übersetzt. Bei Zeichen, die nicht Teil der
Regionaleinstellung sind, ist diese Übersetzung nicht möglich. Daher
geben Nicht-Unicode-Programme stattdessen ein Fragezeichen oder ein
falsches Zeichen aus.
Wcd mit Unicode-Unterstützung liest die in UTF-16 kodierten
Verzeichnisnamen und wandelt diese intern in UTF-8 um. Alle Baumdateien
sind in UTF-8 kodiert und nicht zu den Nicht-Unicode-Versionen von wcd
kompatibel. Wcd erstellt ein in UTF-8 kodiertes Go-Skript.
Alle Versionen der Windows Powershell können in UTF-8 kodierte Skripte
ausführen, sofern sich im Skript eine BOM (Bytereihenfolge-Markierung)
für UTF-8 befindet.
Seit Windows 7 ist es möglich, im Windows-Befehlszeileninterpreter mit
einem Batch-Skript in ein Verzeichnis zu wechseln, dessen Name
Unicode-Zeichen enthält. Der Verzeichnisname muss in UTF-8 kodiert sein,
und das Batch-Skript *darf keine BOM enthalten* (Markierung der
Bytereihenfolge). Die aktive Codepage des Befehlszeileninterpreters muss
vor dem cd-Befehl auf 65001 (UTF-8) gesetzt werden. Wcd für den
Befehlszeileninterpreter erstellt ein solches Go-Skript "wcdgo.bat". Es
ändert zuerst die Codepage in 65001, wechselt dann das Verzeichnis und
setzt zum Schluss die Codepage auf die ursprüngliche Einstellung zurück.
Sie müssen die Schrift auf die TrueType-Schriftart »Lucida Console«
setzen (nicht auf die Rasterschrift), falls Zeichen nicht korrekt
angezeigt werden.
Die Nicht-Unicode-Version von wcd für Windows liest Unicode-Baumdateien
seit Version 5.2.0, sofern sich eine BOM (Markierung der
Bytereihenfolge) in der Datei befindet (siehe
). Allerdings ist es nicht
möglich, in Verzeichnisse zu wechseln, deren Namen Unicode-Zeichen
enthalten, die nicht Teil der vorgegebenen ANSI-Codepage des Systems
sind. Die Unicode-Version von wcd für Windows schreibt seit Version
5.2.0 eine BOM in die in UTF-8 kodierten Baumdateien, wodurch diese auch
in Notepad lesbar sind.
UTF-8 unter Cygwin
Cygwin unterstützt Unicode seit Version 1.7. Die Cygwin-Zwischenschicht
achtet darauf, dass die UTF-16-Namen unter Windows in UTF-8 umgewandelt
werden. Daher brauchen Programme, wie beispielsweise wcd, darauf keine
Rücksicht zu nehmen und können mit einer UTF-8-Zeichenkodierung wie
unter Unix/Linux arbeiten. Setzen Sie die Zeichenkodierung mit der
Umgebungsvariable *LANG* oder *LC_CTYPE* auf UTF-8. Es wird nötig sein,
dass Sie Ihre Laufwerke neu einlesen. Sie müssen die Schrift auf die
TrueType-Schriftart »Lucida Console« setzen (nicht auf die
Rasterschrift), falls Sie die Cygwin-Standardkonsole verwenden.
Die Cygwin-Version verhält sich exakt genauso wie die Unix-Version von
wcd. Es wird keine Markierung der Bytereihenfolge (BOM) in die
Baumdateien geschrieben, und es wird angenommen, dass die Dateien in der
Zeichenkodierung vorliegen, die von der Spracheinstellung in Cygwin
vorgegeben ist.
DATEIEN
Falls die Umgebungsvariable *WCDHOME* gesetzt ist, verwendet wcd
*WCDHOME* anstelle von *HOME*. Alle "*.wcd"-Dateien sind Textdateien,
die mit einem Texteditor bearbeitet werden können. Die Wcd-Version für
den Windows-Befehlszeileninterpreter verhält sich wie die DOS-Version,
und die Cygwin-Version verhält sich wie die Unix-Version.
wcd.exe
Das Programm. In Unix-Shells wird das Programm stets durch eine
Funktion oder einen Alias aufgerufen, da das aktuelle
Arbeitsverzeichnis einer Unix-Shell nur mit dem eingebauten
cd-Befehl gewechselt werden kann. Siehe auch Abschnitt INSTALLATION.
vorgegebene Baumdatei
Dies ist die vorgegebene Baumdatei, in der wcd nach Treffern sucht.
Falls diese nicht lesbar ist, erstellt wcd eine neue Datei.
DOS: \treedata.wcd or %HOME%\treedata.wcd
Unix: $HOME/.treedata.wcd
zusätzliche Baumdatei
Eine optionale zusätzliche Baumdatei. Falls diese existiert und
lesbar ist, sucht wcd auch in dieser Datei nach Treffern.
DOS: \extra.wcd or %HOME%\extra.wcd
Unix: $HOME/.extra.wcd
Bann-Datei
In dieser optionalen Datei speichert wcd die verbannten Pfade. Siehe
Option -b. Platzhalter werden unterstützt.
DOS: \ban.wcd or %HOME%\ban.wcd
Unix: $HOME/.ban.wcd
Alias-Datei
Optionale Datei mit Aliasen für wcd. Siehe Option -l.
DOS: \alias.wcd or %HOME%\alias.wcd
Unix: $HOME/.alias.wcd
Stapeldatei
In dieser Datei speichert wcd den Stapel. Der Laufwerksbuchstabe
kann mit der Option -d geändert werden.
DOS: c:\stack.wcd or %HOME%\stack.wcd
Unix: $HOME/.stack.wcd
Der Name der Stapeldatei kann mit der Umgebungsvariable
*WCDSTACKFILE* geändert werden. Siehe Abschnitt UMGEBUNGSVARIABLEN.
Go-Skript
Dies ist das Shell-Skript, welches wcd.exe jedes Mal erzeugt. Es
wird über eine Funktion oder einen Alias eingelesen. Der
Laufwerksbuchstabe kann mit der Option -d geändert werden. Aus
historischen Gründen ist es per Vorgabe auf Unix-Systemen in
"$HOME/bin" gespeichert. Das Verzeichnis für diese Datei kann mit
der Option -G geändert werden.
DOS-Bash: c:/wcd.go oder $HOME/wcd.go
Windows Befehlszeileninterpreter: c:\wcdgo.bat oder %HOME%\wcdgo.bat
Windows PowerShell: $env:HOME\wcdgo.ps1
WinZsh: $HOME/wcd.go
Cygwin/MSYS: $HOME/bin/wcd.go
OS/2-Befehlszeileninterpreter: c:\wcdgo.cmd oder %HOME%\wcdgo.cmd
OS/2-Bash: c:/wcd.go oder $HOME/wcd.go
Unix: $HOME/bin/wcd.go
Datei für relative Baumansicht
Textdatei mit relativen Pfaden von *VERZEICHNIS*. Siehe die Optionen
+S, -n und +n.
DOS: PATH\rtdata.wcd
Unix: PATH/.rtdata.wcd
UMGEBUNGSVARIABLEN
HOME
Wcd verwendet per Vorgabe die Umgebungsvariable *HOME*, um zu
ermitteln, wo Dateien gespeichert werden sollen. Siehe auch den
Abschnitt DATEIEN. Dies kann mit der Umgebungsvariable *WCDHOME*
außer Kraft gesetzt werden.
*HOME* legt außerdem fest, wo mit dem Einlesen des Laufwerks
begonnen wird, wenn die Option -s verwendet wird. Dies kann mit der
Umgebungsvariable *WCDSCAN* außer Kraft gesetzt werden.
In den Versionen für Unix, Cygwin, Windows PowerShell, WinZsh und
MSYS ist es erforderlich, dass *HOME* oder *WCDHOME* gesetzt ist.
Für die anderen Versionen von wcd ist die Benutzung dieser Variablen
optional.
Falls *HOME* unter DOS/Windows gesetzt ist, platziert wcd alle seine
Dateien (treedata.wcd, extra.wcd, alias.wcd, ban.wcd, wcd.go) im
Verzeichnis *HOME*. Das Verhalten von wcd gleicht dann dem der
Unix-Versionen. Wcd liest die Daten dann per Vorgabe aus *HOME* ein.
Laufwerke werden nicht automatisch eingelesen, wenn Sie dorthin
wechseln. Sie müssen wcd explizit dazu anweisen, zum Beispiel:
wcd -S c: -A d: -A e:
Die Verzeichnissuche wird nun global in allen eingelesenen
Laufwerken ausgeführt.
WCDHOME
Mit der Umgebungsvariable *WCDHOME* können Sie den Ort der Dateien
von wcd ändern. Falls sowohl *HOME* als auch *WCDHOME* gesetzt ist,
wird *WCDHOME* anstelle von *HOME* verwendet.
In Wcd-Versionen vor 5.1.5 wurde durch *WCDHOME* auch das
vorgegebene Einleseverzeichnis geändert. Seit Version ist dies nicht
mehr der Fall, siehe Option -s. Verwenden Sie ab Version 5.1.5 die
Umgebungsvariable *WCDSCAN*, um die Einstellung des vorgegebenen
Einleseverzeichnisses außer Kraft zu setzen.
Beispiel für die Befehlszeileninterpreter in DOS, Windows, OS/2:
set WCDHOME=C:\Users\erwin\wcd
Ein Beispiel für POSIX-Shells:
export WCDHOME="$HOME/.wcd"
Ein Beispiel für Csh-Shells:
setenv WCDHOME "$HOME/.wcd"
WCDSCAN
Verwenden Sie die Umgebungsvariable *WCDSCAN*, um die Einstellung
des vorgegebenen Einleseverzeichnisses *HOME* außer Kraft zu setzen.
Geben Sie eine durch Doppelpunkte getrennte Liste an (für Unix),
wenn Sie mehr als ein Verzeichnis angeben wollen. Unter DOS/Windows
verwenden Sie Semikola als Trennzeichen.
Beispiel für die Befehlszeileninterpreter von DOS, Windows und OS/2:
set WCDSCAN=C:\Users\erwin;D:\data
set WCDSCAN=%HOMEDRIVE%%HOMEPATH%;\\projectdrive\projectX
Ein Beispiel für POSIX-Shells:
export WCDSCAN="$HOME:/projectdisk/projectX"
Ein Beispiel für Csh-Shells:
setenv WCDSCAN "$HOME:/projectdisk/projectX"
WCDFILTER
Geben Sie Filter mit der Umgebungsvariable *WCDFILTER* an. Alle
Verzeichnisse, die nicht auf diese(n) Filter passen, werden
ignoriert. Sie können eine Liste angeben, in der Sie die einzelnen
Filter aneinanderreihen und dazwischen das Pfad-Trennzeichen Ihrer
Shell setzen. Dies funktioniert ähnlich wie die Angabe der Variable
*PATH*. Ob dabei Groß-/Kleinschreibung berücksichtigt wird, hängt
vom jeweiligen Betriebssystem ab.
Beispiel für die Befehlszeileninterpreter in DOS, Windows, OS/2:
set WCDFILTER=projects;doc
Ein Beispiel für POSIX-Shells:
export WCDFILTER="projects:doc"
Ein Beispiel für Csh-Shells:
setenv WCDFILTER "projects:doc"
WCDBAN
Die in der Umgebungsvariable *WCDBAN* angegebenen Pfade werden
gebannt, siehe auch die Option -b. Geben Sie eine Liste der Pfade
an, durch das *PATH*-Trennzeichen der Shell getrennt.
WCDEXCLUDE
Die in der Umgebungsvariable *WCDEXCLUDE* angegebenen Pfade werden
von wcd ausgeschlossen, siehe auch die Optionen -x und -xf. Geben
Sie eine Liste der Pfade an, durch das *PATH*-Trennzeichen der Shell
getrennt.
Beispiel für die Befehlszeileninterpreter in DOS, Windows, OS/2:
set WCDEXCLUDE=*/windows;*/temp;*CVS
Ein Beispiel für POSIX-Shells:
export WCDEXCLUDE="/dev:/tmp:*CVS"
Ein Beispiel für Csh-Shells:
setenv WCDEXCLUDE "/dev:/tmp:*CVS"
WCDUSERSHOME
Dies legt das übergeordnete Verzeichnis der Home-Verzeichnisse der
Benutzer fest. Unter DOS/Windows ist der Standardwert "\\users".
Unter Unix/Cygwin ist "/home" die Vorgabe. Die Variable wird
verwendet, um die Baumdateien anderer Benutzer einzulesen. Siehe
auch die Optionen -u und +u. Im ausführlichen Modus gibt wcd alle
Filter sowie gebannte und auszuschließende Verzeichnisse aus. Siehe
Option -v.
WCDSTACKFILE
Wcd bevorzugt *WCDSTACKFILE* gegenüber dem vorgegebenen Namen der
Stapeldatei (siehe Abschnitt DATEIEN). Mit dieser Variable kann jede
Shell oder jede Terminalemulation ihren eigenen Verzeichnisstapel
haben.
So verwenden Sie eine eindeutige zeitbasierte Datei
(JJJJMMTT-HHMMSS) für jede geöffnete interaktive Shell:
export WCDSTACKFILE=$HOME/.wcd/stack.$(date +%Y%m%d-%H%M%S)
Für einen Stapel pro xterm(1) verwenden Sie die Umgebungsvariable
*WINDOWID*:
export WCDSTACKFILE=$HOME/.wcd/stack.$WINDOWID
Einen Stapel pro Bildschirm erreichen Sie für GNU screen(1) so:
export WCDSTACKFILE=$HOME/.wcd/stack.$WINDOW
TERMINFO
Wenn die Umgebungsvariable *TERMINFO*, sucht wcd mit
ncurses-Schnittstelle nach einer lokalen Teminaldefinition, bevor am
Standardort gesucht wird. Dies ist sinnvoll für
Terminaldefinitionen, die sich nicht an einem vorgegebenen Ort
befinden. Oft verwendete Standardorte sind "/usr/lib/terminfo" und
"/usr/share/terminfo".
PDC_RESTORE_SCREEN
Wcd mit PDCurses-Schnittstelle berücksichtigt die Umgebungsvariable
*PDC_RESTORE_SCREEN*. Falls diese Umgebungsvariable gesetzt ist,
erzeugt PDCurses eine Kopie des Bildschirminhalts zur Startzeit von
wcd. Beim Abbruch von wcd wird der Bildschirm wiederhergestellt. Ein
Beispiel für den Windows-Befehlszeileninterpreter:
set PDC_RESTORE_SCREEN=1
Windows kann nur einen kleinen Puffer speichern. Es ist daher nicht
immer möglich, alles wiederherzustellen. Andererseits kann in der
Konsole nach dem Beenden von wcd Datenmüll ausgegeben werden, falls
Sie den Puffer größer gewählt haben.
SHELL
Die Angabe von "#!$SHELL" in der ersten Zeile des Go-Skripts (für
POSIX- oder C-Shells) ist für 8-Bit-Zeichen nötig. Einige Shells
könnten sonst annehmen, dass es sich bei dem Go-Skript um eine
Binärdatei handelt und diese nicht einlesen. In der Cygwin-Bash muss
die Variable *SHELL* mit dem Befehl "export" gesetzt werden, sonst
kann wcd diese Variable nicht lesen.
BASH
Wcd für die DOS-Bash verwendet $BASH anstelle von $SHELL, weil
$SHELL auf die DOS-Befehlsshell zeigt. $BASH muss mit einem
"export"-Befehl definiert werden, anderenfalls kann wcd die Variable
nicht lesen.
SIEHE AUCH
sh(1), bash(1), csh(1), ksh(1), zsh(1), locale(1), ncurses(1),
AUTOREN
Wcd wurde von Erwin Waterlander geschrieben.
Projektseite:
SourceForge:
Die Formatierung der Handbuchseite wurde von Jari Aalto
bereitgestellt.
NCD wurde ursprünglich von Brad Kingsbury für Peter Nortons »Norton
Utilities« etwa 1987 geschrieben. Siehe auch
wcd-6.0.5/src/man/fr/ 0000755 0001755 0001001 00000000000 14421240072 013513 5 ustar waterlan Geen wcd-6.0.5/src/man/fr/man1/ 0000755 0001755 0001001 00000000000 14421240120 014341 5 ustar waterlan Geen wcd-6.0.5/src/man/fr/man1/wcd.1 0000644 0001755 0001001 00000176142 14421240073 015222 0 ustar waterlan Geen .\" Automatically generated by Pod::Man 4.14 (Pod::Simple 3.40)
.\"
.\" Standard preamble:
.\" ========================================================================
.de Sp \" Vertical space (when we can't use .PP)
.if t .sp .5v
.if n .sp
..
.de Vb \" Begin verbatim text
.ft CW
.nf
.ne \\$1
..
.de Ve \" End verbatim text
.ft R
.fi
..
.\" Set up some character translations and predefined strings. \*(-- will
.\" give an unbreakable dash, \*(PI will give pi, \*(L" will give a left
.\" double quote, and \*(R" will give a right double quote. \*(C+ will
.\" give a nicer C++. Capital omega is used to do unbreakable dashes and
.\" therefore won't be available. \*(C` and \*(C' expand to `' in nroff,
.\" nothing in troff, for use with C<>.
.tr \(*W-
.ds C+ C\v'-.1v'\h'-1p'\s-2+\h'-1p'+\s0\v'.1v'\h'-1p'
.ie n \{\
. ds -- \(*W-
. ds PI pi
. if (\n(.H=4u)&(1m=24u) .ds -- \(*W\h'-12u'\(*W\h'-12u'-\" diablo 10 pitch
. if (\n(.H=4u)&(1m=20u) .ds -- \(*W\h'-12u'\(*W\h'-8u'-\" diablo 12 pitch
. ds L" ""
. ds R" ""
. ds C` ""
. ds C' ""
'br\}
.el\{\
. ds -- \|\(em\|
. ds PI \(*p
. ds L" ``
. ds R" ''
. ds C`
. ds C'
'br\}
.\"
.\" Escape single quotes in literal strings from groff's Unicode transform.
.ie \n(.g .ds Aq \(aq
.el .ds Aq '
.\"
.\" If the F register is >0, we'll generate index entries on stderr for
.\" titles (.TH), headers (.SH), subsections (.SS), items (.Ip), and index
.\" entries marked with X<> in POD. Of course, you'll have to process the
.\" output yourself in some meaningful fashion.
.\"
.\" Avoid warning from groff about undefined register 'F'.
.de IX
..
.nr rF 0
.if \n(.g .if rF .nr rF 1
.if (\n(rF:(\n(.g==0)) \{\
. if \nF \{\
. de IX
. tm Index:\\$1\t\\n%\t"\\$2"
..
. if !\nF==2 \{\
. nr % 0
. nr F 2
. \}
. \}
.\}
.rr rF
.\" ========================================================================
.\"
.IX Title "wcd 1"
.TH wcd 1 "2023-04-23" "wcd" "2023-04-23"
.\" For nroff, turn off justification. Always turn off hyphenation; it makes
.\" way too many mistakes in technical documents.
.if n .ad l
.nh
.SH "NOM"
.IX Header "NOM"
wcd \- Wherever Change Directory
.PP
chdir pour \s-1DOS\s0 et Unix.
.SH "SYNOPSIS"
.IX Header "SYNOPSIS"
.Vb 1
\& wcd [options] [répertoire]
.Ve
.SH "DESCRIPTION"
.IX Header "DESCRIPTION"
.SS "Présentation"
.IX Subsection "Présentation"
Wcd est un logiciel en ligne de commande permettant de changer de répertoire rapidement. Il permet de gagner du temps d'écriture au clavier. Un utilisateur n'a besoin de taper qu'une partie du nom d'un répertoire et wcd s'y déplacera. Wcd a une méthode de sélection rapide lors de multiples correspondances et permet l'alias et le bannissement de répertoires. Wcd inclus également un navigateur d'arborescence de fichiers intéractif en mode plein écran et avec recherche rapide.
.PP
Wcd a été construit sur le modèle du Norton Change Directory (\s-1NCD\s0). \s-1NCD\s0 est apparu pour la première fois dans \fIThe Norton Utilities, Release 4\fR, pour \s-1DOS\s0 en 1987 et publié par Peter Norton.
.PP
Wcd a été adapté à différentes interfaces système en ligne de commande : \s-1DOS\s0 command.com, Windows cmd.exe et PowerShell, \s-1OS/2\s0 cmd.exe, et aux interfaces système Unix telles que Bourne (sh), Bourne Again (bash), Korn (ksh), Z (zsh), et C (csh) ainsi qu'à d'autres fonctionnant sur tout système d'exploitation.
.PP
Wcd prend en charge les ensemble de caractères 8 bits sur tous les systèmes, et prend en charge l'Unicode de façon optionnelle. Voir la section \s-1LOCALISATION.\s0
.PP
Voir la section \s-1INSTALLATION\s0 pour mettre en place wcd dans le cas d'un usage personnel.
.SS "Utilisation basique"
.IX Subsection "Utilisation basique"
Par défaut (si aucun caractère générique n'est utilisé) wcd cherche un répertoire avec un nom commençant par le nom entré.
.PP
Par exemple, cette commande changera vers le répertoire de l'utlisateur courant \f(CW\*(C`/home/user/Desktop\*(C'\fR :
.PP
.Vb 1
\& wcd Desk
.Ve
.PP
Lorsqu'il y a plusieurs correspondances, wcd affichera à l'utilisateur une liste les contenant toutes. L'utilisateur pourra alors faire un choix avec quelques de frappes clavier (une seule la plus part du temps).
.SS "Caractères génériques"
.IX Subsection "Caractères génériques"
Wcd prend en charge les caractères génériques suivant :
.PP
.Vb 4
\& * correspond à toute séquence de caractères (zéro ou plus)
\& ? correspond à n\*(Aqimporte quel caractère
\& [ENSEMBLE] correspond à n\*(Aqimporte quel caractère dans l\*(Aqensemble donné,
\& [!ENSEMBLE] ou [^ENSEMBLE] correspond à n\*(Aqimporte quel caractère qui n\*(Aqest pas dans l\*(Aqensemble donné.
.Ve
.PP
Un ensemble est composé de caractères ou d'intervalles ; un intervalle s'écrit \fIcaractère tiret caractère\fR comme dans \f(CW\*(C`0\-9\*(C'\fR ou \f(CW\*(C`A\-Z\*(C'\fR. \f(CW\*(C`[0\-9a\-zA\-Z_]\*(C'\fR est l'ensemble minimal de caractères autorisés dans la construction du motif \f(CW\*(C`[...]\*(C'\fR. Les caractères internationaux (à savoir des caractères de 8 bits) sont autorisés si le système les prend en charge. Pour supprimer le sens syntaxique spécial de n'importe quel caractère \f(CW\*(C`[]*?!^\-\e\*(C'\fR à l'intérieur ou à l'extérieur d'une construction \f(CW\*(C`[..]\*(C'\fR et ainsi indiquer une correspondance envers le caractère lui\-même, il faut le faire précéder d'une barre oblique inversée (\f(CW\*(C`\e\*(C'\fR).
.PP
L'utilisation de caractères génériques rend possible des recherches complexes. Par exemple, ceci correspond à n'importe quel nom de répertoire se terminant par « top » :
.PP
.Vb 1
\& wcd *eau
.Ve
.PP
Fait correspondre les répertoires qui ont « eau » quelque part dans leur nom :
.PP
.Vb 1
\& wcd *eau*
.Ve
.PP
Fait correspondre n'importe quel nom de répertoire commençant par « a », « b » ou « c » :
.PP
.Vb 1
\& wcd [a\-c]*
.Ve
.PP
Il est également possible de donner une partie du chemin d'un répertoire. Ici Wcd cherche les répertoires dont le nom commence par « Bur » et qui dont le chemin correspond à \fI*moi/Bur*\fR.
.PP
.Vb 1
\& wcd moi/Bur
.Ve
.PP
Il est possible d'entrer n'importe quel type d'expression avec des barres obliques et des caractères génériques. Par exemple :
.PP
.Vb 1
\& wcd src*/*1?/a*2
.Ve
.SS "Autres utilisations"
.IX Subsection "Autres utilisations"
Si aucun caractère générique n'est utilisé et que wcd trouve une correspondance parfaite, wcd ignorera toutes les correspondances génériques par défaut. Ce comportement peut être modifié par l'option \fB\-w\fR.
.PP
Le navigateur d'arborescence de répertoire intéractif peut être démarré en utilisant l'option \fB\-g\fR.
.PP
.Vb 1
\& wcd \-g
.Ve
.PP
Wcd génère un fichier d'arborescence à l'emplacement de la recherche du répertoire. Sur les systèmes Unix et Windows, wcd ajoute des liens symboliques vers le fichier d'arborescence lors de l'examem du disque, mais ne les suit pas. S'il suivait les liens, wcd pourrait en venir à examiner une boucle infinie, ou de très grandes portions d'un réseau.
.PP
Wcd peut également changer vers des répertoires qui ne sont pas dans le fichier d'arborescence. Par exemple :
.PP
.Vb 1
\& wcd ..
.Ve
.PP
Si wcd trouve une correspondance mais ne peut pas aller au répertoire, il tente alors de le supprimer du fichier d'arborescence par défaut. Pas du fichier d'arborescence supplémentaire. Voir également l'option \fB\-k\fR.
.PP
Wcd conserve une pile de répertoires stockée sur le disque. La pile à une taille par défaut de 10 et est cyclique. Voir les options \fB\-z\fR, \fB\-\fR, \fB+\fR et \fB=\fR.
.PP
Dans un environnement multi-utilisateurs, l'option \fB\-i\fR peut être utilisée pour se déplacer dans des répertoires d'autres utilisateurs.
.PP
Sur les systèmes \s-1DOS\s0 et Windows, peut importe si vous utilisez la barre oblique « / » ou la barre oblique inversée « \e » comme séparateur de répertoires.
.PP
Sur les systèmes \s-1DOS\s0 et Windows, il est possible de changer de lecteur et de répertoire d'un seul coup en faisant précéder le nom du répertoire par le nom du lecteur.
.PP
.Vb 1
\& wcd d:jeux
.Ve
.SS "chemins Windows \s-1UNC\s0"
.IX Subsection "chemins Windows UNC"
Les versions Windows (Command Prompt, PowerShell, \s-1MSYS,\s0 zsh, cygwin) prennent en charge les chemins Windows \s-1SMB LAN UNC\s0 sans lettre de lecteur tels que \f(CW\*(C`\e\eservername\esharename\*(C'\fR. Wcd pour Windows Command Prompt utilise la commande « pushd » pour faire correspondre un chemin \s-1UNC\s0 à une lettre de lecteur. Dans Windows PowerShell, \s-1MSYS,\s0 zsh et Cygwin, les chemins \s-1UNC\s0 sont pris en charge. Le répertoire de travail courant peut être un chemin \s-1UNC.\s0
.SS "Redimensionnement de console sous Windows"
.IX Subsection "Redimensionnement de console sous Windows"
Wcd prend en charge le redimensionnement de console dans les consoles Windows 10 et ConEmu (void ) depuis la version 6.0.3. La console Windows 10 ne doit pas être dans le mode hérité (vérifier les propriétés de la console). L'écran peut ne pas être rafraîchi lorsque la Configuration « Renvoyer automatiquemet à la ligne le texte en cas de redimensionnement » de la console est désactivée. L'écran peut être rafraîchi manuellement en pressant la touche F5.
.SS "Interfaces"
.IX Subsection "Interfaces"
Wcd a trois interfaces pour choisir parmi une liste de correspondances. L'interface peut être choisie à la compilation.
.PP
La première interface utilise simplement stdin/stdout. Une liste numérotée est affichée dans le terminal. L'utilisateur doit choisir parmi cette liste en entrant un nombre suivi de la touche . Cette interface ne fournit pas la fonctionnalité de défilement arrière lorsque la liste est longue. La fonctionnalité de défilement arrière du terminal ou de la console doit être utilisée. C'est très petit et portable.
.PP
La seconde interface est basée sur la bibliothèque conio. Elle fournit une capacité de défilement arrière intégrée. L'utilisateur voit affichée une liste ordonnée par des lettres. La sélection dans cette liste peut se faire en pressant une seule lettre. Cette interface est rapide car elle économise les frappes. Si possible, l'écran sera restauré après sortie. Utiliser l'option \fB\-N\fR si l'utilisation de nombres est préférrée.
.PP
La troisième interface est construite avec la bibliothèque curses. Elle est similaire à l'interface conio. La version curses de wcd a une interface « graphique » supplémentaire. Elle laisse l'utilisateur choisir un répertoire via un navigateur plein écran et intéractif d'arbre de répertoires. Elle a une navigation et une méthode de recherche similaire à celle de \fBvim\fR\|(1). Elle peut être activée avec l'option \fB\-g\fR.
.PP
En utilisant l'option \fB\-o\fR il est toujours possible de revenir à l'interface stdin/stdout.
.SH "OPTIONS"
.IX Header "OPTIONS"
.IP "\fB\-a\fR" 4
.IX Item "-a"
Ajouter le chemin courant au fichier d'arborescence par défaut.
.Sp
Utiliser cette option pour ajouter de façon rapide le chemin courant au fichier d'arborescence par défaut. Le réexamen complet du disque peut parfois pendre beaucoup de temps.
.IP "\fB\-aa\fR" 4
.IX Item "-aa"
Ajouter le chemin courant et tous les chemins parents au fichier d'arborescence par défaut.
.IP "\fB\-A \s-1CHEMIN\s0\fR" 4
.IX Item "-A CHEMIN"
Examiner l'arborescence de répertoires depuis \fI\s-1CHEMIN\s0\fR et l'ajouter au fichier d'arborescence par défaut. Exemples :
.Sp
.Vb 3
\& wcd \-A .
\& wcd \-A /home \-A /etc
\& wcd \-A d: \-A e: \-A \e\eserveur\epartage
.Ve
.Sp
Sur Windows, il est possible d'examiner tous les répertoires partagés d'un serveur \s-1LAN\s0 Windows en entrant quelque chose comme :
.Sp
Voir également les options \fB\-S\fR et \fB\-s\fR et \fB\-E\fR.
.IP "\fB\-b\fR" 4
.IX Item "-b"
Bannir le chemin courant.
.Sp
Wcd met le chemin courant dans le fichier de bannissements. Cela signifie que wcd ignore toutes les correspondances de ce répertoire et de ses sous\-répertoires.
.Sp
Le fichier de bannissements peut être modifié avec un éditeur de texte. L'utilisation de caractères génériques est prise en charge et les noms sont mis en correspondance avec le chemin absolu.
.Sp
Les chemins bannis ne sont pas exclus de l'examen du disque. Pour cela utiliser l'option \fB\-xf\fR.
.IP "\fB\-c, \-\-direct\-cd\fR" 4
.IX Item "-c, --direct-cd"
Mode \s-1CD\s0 direct. Par défaut wcd marche de la façon suivante :
.Sp
.Vb 2
\& 1. Essaie de trouver une correspondance dans le(s) fichier(s) d\*(Aqarborescence
\& 2. S\*(Aqil n\*(Aqy a pas de correspondance, essaie d\*(Aqouvrir le répertoire que vous avez entré.
.Ve
.Sp
En mode \s-1CD\s0 direct wcd marche en ordre inverse.
.Sp
.Vb 2
\& 1. Essaie d\*(Aqouvrir le répertoire que vous avez entré.
\& 2. Sinon, essaie de trouver une correspondance dans le(s) fichier(s) d\*(Aqarborescence.
.Ve
.IP "\fB\-d \s-1LECTEUR\s0\fR" 4
.IX Item "-d LECTEUR"
Choisir le lecteur pour le fichier de pile et de « go » (\s-1DOS\s0 uniquement).
.Sp
Les fichiers de pile et de script « go » sont stockés sur le lecteur C: par défaut si la variable d'environnement \fI\s-1HOME\s0\fR n'est pas définie. Utiliser cette option si le lecteur C: est un lecteur en lecture seule. Cette option doit être utilisée devant les options de pile \fB\-\fR, \fB+\fR and \fB=\fR.
.IP "\fB\-e\fR" 4
.IX Item "-e"
Ajouter le chemin courant au fichier d'arborescence supplémentaire.
.Sp
Utiliser cette option pour ajouter rapidement le chemin courant au fichier d'arborescence supplémentaire.
.IP "\fB\-ee\fR" 4
.IX Item "-ee"
Ajouter le chemin courant et tous les chemins parents au fichier d'arborescence supplémentaire.
.IP "\fB\-E \s-1CHEMIN\s0\fR" 4
.IX Item "-E CHEMIN"
Examiner l'arborescence de répertoires depuis \fI\s-1CHEMIN\s0\fR et l'ajouter au fichier d'arborescence supplémentaire. Voir aussi les options \fB\-A\fR et \fB\-S\fR.
.IP "\fB\-f \s-1FICHIER\s0\fR" 4
.IX Item "-f FICHIER"
Lire le fichier d'arborescence \fI\s-1FICHIER\s0\fR. Ne pas lire le fichier d'arborescence par défaut.
.IP "\fB+f \s-1FICHIER\s0\fR" 4
.IX Item "+f FICHIER"
Lire le fichier d'arborescence \fI\s-1FICHIER\s0\fR en plus du fichier d'arborescence par défaut.
.IP "\fB\-g\fR" 4
.IX Item "-g"
Interface graphique (uniquement pour les versions avec l'interface curses).
.Sp
Wcd démarre une interface « graphique » textuelle basée sur curses. L'utilisateur peut choisir un répertoire via le navigateur d'arbre de répertoires intéractif en plein écran. Il possède une méthode de navigation et de recherche similaire à celle de \fBvim\fR\|(1).
.Sp
Si aucune chaîne de recherche n'est donnée, wcd affiche l'arbre entier qui se trouve dans le fichier d'arborescence par défaut ainsi que dans les fichiers d'arborescence supplémentaires.
.Sp
Si une chaîne de recherche est donnée, la liste des correspondances est affichée comme un arbre de répertoires.
.Sp
La disposition par défaut de l'arbre est similaire à celle du \s-1NCD\s0 initial sur \s-1DOS.\s0 La différence de disposition réside dans le fait que pour \s-1NCD,\s0 tous les répertoires de profondeur identique étaient alignés verticalement sur toute la hauteur de l'arbre. Cela était possible sous \s-1NCD\s0 parce que la longueur maximale d'un nom de répertoire sous \s-1DOS\s0 était de 12 (8.3) caractères. Les noms de répertoire pouvant être très longs sur les systèmes d'exploitation modernes, la différence de longeur peut être importante. De fait, les dossiers de même profondeur ne sont pas alignés verticalement sur la totalité de l'arbre dans wcd, mais seulement dans les sous-branches. Il y a donc des mouvements latéraux lors d'un déplacement direct vers le haut ou vers le bas depuis une sous-branche vers une autre sous-branche.
.Sp
Le comportement de navigation de Wcd est exactement identique à celui du \s-1NCD\s0 initial. Par exemple, l'appui sur la touche Bas du clavier amène au répertoire suivant avec la même profondeur, passant outre les branches. Cela permet une navigation rapide dans l'arbre.
.Sp
Voir les options \fB\-Ta\fR, \fB\-TC\fR, et \fB\-Tc\fR pour modifier le comportement de la navigation.
.IP "\fB\-gd\fR" 4
.IX Item "-gd"
Décharger les fichiers d'arborescence sous forme d'arbre sur la sortie standard.
.IP "\fB\-G \s-1CHEMIN\s0\fR" 4
.IX Item "-G CHEMIN"
Ecrire le script « go » dans le répertoire \fI\s-1CHEMIN\s0\fR. Par exemple sur Unix, \f(CW\*(C`wcd \-G CHEMIN\*(C'\fR va écrire un fichier de script « go » \fBCHEMIN/wcd.go\fR.
.IP "\fB\-GN, \-\-no\-go\-script\fR" 4
.IX Item "-GN, --no-go-script"
Ne pas créer un script « go ». Cette option peut être utilisée en association avec l'option \fB\-j\fR si la création d'un script « go » n'est pas désirée.
.IP "\fB\-h, \-\-help\fR" 4
.IX Item "-h, --help"
Afficher l'aide et quitter.
.IP "\fB\-i, \-\-ignore\-case\fR" 4
.IX Item "-i, --ignore-case"
Ignorer la casse. Les versions Dos et Windows de wcd ignorent la casse par défaut. Les versions Unix/Cygwin respectent la casse par défaut.
.IP "\fB+i, \-\-no\-ignore\-case\fR" 4
.IX Item "+i, --no-ignore-case"
Respecter la casse. Voir aussi l'option \fB\-i\fR.
.IP "\fB\-I, \-\-ignore\-diacritics\fR" 4
.IX Item "-I, --ignore-diacritics"
Ignorer les caractères diacritiques pour les scripts en Latin. Les lettres avec des symboles diacritiques correspondent à leur lettre de base sans ces symboles diacritiques. Les encodages Latin suivant sont pris en charge : \s-1CP437, CP850, CP852, CP1250, CP1252, ISO\-8859\-1, ISO\-8859\-2,\s0 et Unicode Latin\-1, Latin Extended-A, et Latin Extended-B. Voir aussi
.IP "\fB+I, \-\-no\-ignore\-diacritics\fR" 4
.IX Item "+I, --no-ignore-diacritics"
Prendre en compte les diacritiques (défaut). Voir aussi l'option \fB\-I\fR.
.IP "\fB\-j, \-\-just\-go\fR" 4
.IX Item "-j, --just-go"
Mode à accès direct.
.Sp
Dans ce mode, wcd ne présentera pas de liste lorsqu'il y a plusieurs répertoires correspondant au répertoire donné. Wcd changera vers la première option. Lorsque wcd est appelé une nouvelle fois avec les même arguments, il changera vers l'option suivante et ainsi de suite.
.Sp
Wcd affichera le répertoire vers lequel aller sur la sortie standard. Une méthode d'installation différente peut être utilisée. On pourra écrire la fonction suivante pour une interface système compatible \s-1POSIX :\s0
.Sp
.Vb 4
\& wcd ()
\& {
\& cd "$($HOME/bin/wcd.exe \-j $@)"
\& }
.Ve
.Sp
Lors de l'utilisation d'une interface système ancienne ne prenant pas en charge la substitution de commande « $() », il faut recourir à la substitution de commande ancienne utilisant l'accent grave.
.Sp
.Vb 4
\& wcd ()
\& {
\& cd "\`$HOME/bin/wcd.exe \-j $@\`"
\& }
.Ve
.Sp
Sur les systèmes Windows, si l'interface système 4NT est utilisée, il est alors possible de faire l'alias suivant :
.Sp
.Vb 1
\& alias wcd \`cd %@execstr[wcdwin32.exe \-z 0 \-j %1]\`
.Ve
.Sp
Cette méthode supprime la nécessité d'un script « go », et il est donc possible de combiner l'option \fB\-GN\fR avec l'option \fB\-j\fR.
.IP "\fB\-k, \-\-keep\-paths\fR" 4
.IX Item "-k, --keep-paths"
Garder les chemins.
.Sp
Conserver les chemins dans le fichier d'arborescence lorsque wcd ne peut s'y déplacer. Le comportement par défaut de wcd est d'essayer de supprimer les chemins du fichier d'arborescence lorsque wcd ne peut s'y rendre. Cette option désactive ce comportement.
.IP "\fB\-K, \-\-color\fR" 4
.IX Item "-K, --color"
Utiliser les couleurs en mode graphique.
.IP "\fB\-l \s-1ALIAS\s0\fR" 4
.IX Item "-l ALIAS"
Nommer le chemin courant avec \fI\s-1ALIAS\s0\fR. Wcd ajoute le chemin courant avec \fI\s-1ALIAS\s0\fR pour alias dans le fichier d'alias. Les alias sont sensibles à la casse.
.IP "\fB\-ls\fR" 4
.IX Item "-ls"
Afficher le nom du fichier d'alias et lister tous les alias.
.IP "\fB\-m \s-1REP\s0\fR" 4
.IX Item "-m REP"
Créer un répertoire et l'ajouter au fichier d'arborescence.
.IP "\fB\-L, \-\-license\fR" 4
.IX Item "-L, --license"
Afficher la license de distribution.
.IP "\fB\-M \s-1REP\s0\fR" 4
.IX Item "-M REP"
Créer un répertoire et l'ajouter au fichier d'arborescence supplémentaire.
.IP "\fB\-n \s-1CHEMIN\s0\fR" 4
.IX Item "-n CHEMIN"
Lire le fichier d'arborescence relative depuis \fI\s-1CHEMIN\s0\fR.
.Sp
Ne pas lire le fichier d'arborescence par défaut. Le fichier d'arborescence relative doit avoir été créé en utilisant l'option \fB+S\fR de wcd. \fI\s-1CHEMIN\s0\fR peut également référencer directement un fichier.
.Sp
Un exemple. Supposons qu'un autre système ait été monté au point de montage \f(CW\*(C`/mnt/network\*(C'\fR :
.Sp
.Vb 1
\& wcd \-n /mnt/network src
.Ve
.Sp
Wcd ouvre le ficher d'arborescence relative dans \f(CW\*(C`/mnt/network/\*(C'\fR. Le fichier contient les chemins relatifs depuis cet endroit.
.IP "\fB+n \s-1CHEMIN\s0\fR" 4
.IX Item "+n CHEMIN"
Lire le ficher d'arborescence relative en plus du fichier d'arborescence par défaut. Voir l'option \fB\-n\fR.
.IP "\fB\-N, \-\-numbers\fR" 4
.IX Item "-N, --numbers"
Utiliser des nombres à la place de lettres.
.Sp
Wcd avec une interface basée sur conio ou curses (voir la section Interfaces) affiche une liste de correspondances indexées par des lettres par défaut. Lorsque l'option \fB\-N\fR est utilisée, la liste de correspondances est indexée par des nombres. Indépendamment de l'option \fB\-N\fR, il est possible d'entrer une lettre ou un nombre pour effectuer une sélection dans la liste de correspondances.
.IP "\fB\-o\fR" 4
.IX Item "-o"
Utiliser l'interface stdin/stdout.
.Sp
Lorsque l'interface conio ou curses de wcd ne fonctionne pas pour quelque raison que ce soit, il est possible de se rabattre sur l'interface stdin/stdout de wcd en utilisant l'option \fB\-o\fR.
.IP "\fB\-od, \-\-to\-stdout\fR" 4
.IX Item "-od, --to-stdout"
Décharger l'ensemble des correspondances dans stdout.
.IP "\fB\-q, \-\-quiet\fR" 4
.IX Item "-q, --quiet"
Fonctionnement plus silencieux. L'affichage de la dernière correspondance est supprimé.
.IP "\fB\-r \s-1REP\s0\fR" 4
.IX Item "-r REP"
Supprimer un répertoire et le supprimer du fichier d'arborescence.
.Sp
Si le répertoire est vide, wcd le supprimera et tentera de le supprimer du fichier d'arborescence.
.IP "\fB\-rmtree \s-1REP\s0\fR" 4
.IX Item "-rmtree REP"
Supprimer un répertoire de façon récursive et le supprimer du fichier d'arborescence.
.Sp
Wcd supprimera le répertoire ainsi que tous ses sous\-répertoires et fichiers et supprimera ces répertoires du fichier d'arborescence.
.IP "\fB\-s\fR" 4
.IX Item "-s"
(ré)Examiner le disque depuis le répertoire \f(CW\*(C`HOME\*(C'\fR. Si \fI\s-1HOME\s0\fR n'est pas défini, le disque est examiné depuis le répertoire racine /.
.Sp
Le fichier d'arborescence par défaut existant est écrasé.
.Sp
Le répertoire d'examen par défaut peut être renversé par la variable d'enrivonnement \f(CW\*(C`WCDSCAN\*(C'\fR. Voir la section \s-1VARIABLES D\s0'\s-1ENVIRONNEMENT .\s0
.IP "\fB\-S \s-1CHEMIN\s0\fR" 4
.IX Item "-S CHEMIN"
Examiner l'arbre de répertoires depuis \fI\s-1CHEMIN\s0\fR et écraser le fichier d'arborescence par défaut. Voir aussi les options \fB\-A\fR, \fB\-s\fR et \fB\-E\fR. Par exemple, avec l'option \fB\-A\fR il est possible de créer un fichier d'arborescence par défaut de votre choix. Exemples :
.Sp
Unix :
.Sp
.Vb 2
\& wcd \-S /
\& wcd \-S /home \-A /etc \-A /usr
.Ve
.Sp
\&\s-1DOS /\s0 Windows :
.Sp
.Vb 2
\& wcd \-S c:/
\& wcd \-S c: \-A d: \-A \e\eserveur\epartage
.Ve
.Sp
Avec les versions Windows, il est possible d'examiner tous les répertoires partagés d'un serveur \s-1LAN\s0 Windows en entrant une commande similaire à : \f(CW\*(C`wcd \-S \e\enomserveur\*(C'\fR.
.IP "\fB+S \s-1CHEMIN\s0\fR" 4
.IX Item "+S CHEMIN"
Examiner le disque depuis \fI\s-1CHEMIN\s0\fR et placer les chemins relatifs dans un fichier d'arborescence relative. Ce fichier est utilisé par les options \fB\-n\fR et \fB+n\fR de wcd. Par exemple \f(CW\*(C`wcd \-n CHEMIN src\*(C'\fR.
.IP "\fB\-t\fR" 4
.IX Item "-t"
Ne pas éviter le dossier de montage temporaire \f(CW\*(C`/tmp_mnt\*(C'\fR (Unix uniquement).
.Sp
Par défaut, wcd retire \f(CW\*(C`/tmp_mnt/\*(C'\fR des correpondances. Le répertoire \f(CW\*(C`/tmp_mnt\*(C'\fR est utilisé par le montage automatique. Ce comportement peut être évité avec l'option \fB\-t\fR.
.IP "\fB\-T, \-\-ascii\-tree\fR" 4
.IX Item "-T, --ascii-tree"
Dessiner l'arbre avec des caractères \s-1ASCII.\s0 Utiliser cette option si les caractères de dessin de ligne ne s'affichent pas correctement dans le terminal.
.IP "\fB\-Ta, \-\-alt\-tree\-nav\fR" 4
.IX Item "-Ta, --alt-tree-nav"
Navigation alternative dans l'arbre graphique.
.Sp
Dans la disposition d'arbre du style par défaut du \s-1NCD,\s0 l'option \fB\-Ta\fR désactive le saut vers des répertoires sans liens.
.Sp
Dans le mode d'arbre compact, le mode alternatif rend la navigation similaire à celle de gestionnaires de fichiers graphiques tels que Windows Explorer ou Linux \s-1KDE\s0 Konqueror. L'appui sur les touches Haut et Bas déplace le dossier sélectionné d'une ligne vers le haut ou le bas. Le premier appui sur la touche Gauche replie les sous-dossiers, le second se déplace réellement à gauche.
.Sp
Il est possible de basculer à la volée entre une navigation par défaut et alternative en pressant .
.Sp
Lorsque le mode de navigation alternative est activé, un « A » est visible dans l'angle inférieur droit.
.IP "\fB\-TC, \-\-center\-tree\fR" 4
.IX Item "-TC, --center-tree"
Vue centrée dans l'arbre graphique. Le répertoire choisi reste au centre de l'écran. Le mode centré peut aussi être activé/désactivé avec la clef dans l'arbre graphique.
.Sp
Le comportement non centré standard, qui minimise le mouvement d'arbre, est identique à celui du \s-1NCD\s0 original.
.IP "\fB\-Tc, \-\-compact\-tree\fR" 4
.IX Item "-Tc, --compact-tree"
Par défaut l'arbre « graphique » est dessiné de la même façon que le faisait le \s-1NCD\s0 original sur \s-1DOS.\s0 Sur \s-1DOS,\s0 un chemin de répertoire ne pouvait faire que 66 caractères au total. Avec les structures de répertoire profondes comtemporaines, l'arbre peut devenir très large. Pour surmonter cela, wcd peut dessiner l'arbre d'une façon compacte, de façon similaire à la plus part des gestionnaires de fichier graphiques, avec un seul fichier par ligne. Utiliser l'option \fB\-Tc\fR ou basculer à la volée avec la clef .
.IP "\fB\-Td, \-\-cjk\-width\fR" 4
.IX Item "-Td, --cjk-width"
Les polices \s-1CJK\s0 d'Asie de l'Est (Chine, Japon et Corée) possèdent certains caractères et symboles de tracé de ligne avec une largeur de colonne de 2, alors que la largeur Unicode normale pour ces caractères est de 1 colonne. Par exemple, la police de trame \s-1CP936\s0 chinoise sur Windows et la police Simsun. Utiliser cette option lorsqu'une police de type \s-1CJK\s0 est utilisée pour obtenir un contour de l'arbre graphique correct.
.Sp
Lorsque le mode \s-1CJK\s0 est actif, un « C » est affiché dans le coin inférieur droit.
.IP "\fB\-u \s-1UTILISATEUR\s0\fR" 4
.IX Item "-u UTILISATEUR"
Examiner le fichier d'arborescence d'un autre utilisateur en se basant sur \fI\s-1UTILISATEUR\s0\fR et ne pas examiner votre propre fichier d'arborescence. Voir aussi \fI\s-1WCDUSERHOME\s0\fR dans la section \s-1VARIABLES D\s0'\s-1ENVIRONNEMENT.\s0
.Sp
Sur Unix/Cygwin le répertoire racine pour les répertoires utilisateur est supposé être \f(CW\*(C`/home\*(C'\fR. Wcd recherchera \f(CW\*(C`/home/UTILISATEUR/.treedata.wcd\*(C'\fR et \f(CW\*(C`/home/UTILISATEUR/.wcd/.treedata.wcd\*(C'\fR, dans cet ordre, lira le premier fichier existant et lisible. Sur DOS/Windows le répertoire racine pour les répertoires utilisateur est supposé être \f(CW\*(C`\e\eusers\*(C'\fR, donc wcd tentera de lire\f(CW\*(C`\e\eusers\eUTILISATEUR\etreedata.wcd\*(C'\fR et \f(CW\*(C`\e\eusers\eUTILISATEUR\e.wcd\etreedata.wcd\*(C'\fR.
.IP "\fB+u \s-1UTILISATEUR\s0\fR" 4
.IX Item "+u UTILISATEUR"
Lire le fichier d'arborescence par défaut de l'\s-1UTILISATEUR\s0 en plus de votre fichier d'arborescence.
.IP "\fB\-v, \-\-verbose\fR" 4
.IX Item "-v, --verbose"
Afficher les messages verbeux. Avec cette option wcd affiche tous les filtres, les bannissements et les exclusions.
.IP "\fB\-V, \-\-version\fR" 4
.IX Item "-V, --version"
Afficher les informations de version et sortir.
.IP "\fB\-w, \-\-wild\-match\-only\fR" 4
.IX Item "-w, --wild-match-only"
Correspondance générique seulement. Traiter toutes les correspondances comme des correspondances génériques.
.IP "\fB\-x \s-1CHEMIN\s0\fR" 4
.IX Item "-x CHEMIN"
Exclure \fI\s-1CHEMIN\s0\fR de l'examen.
.Sp
Lorsque cette option est utilisée, wcd exclu le \fI\s-1CHEMIN\s0\fR et tous ses sous\-répertoires lors de l'examen d'un disque. Les caractères génériques sont pris en charge et mis en correspondance avec les chemins absolus. L'option \fB\-x\fR peut être utilisée plusieurs fois.
.Sp
.Vb 1
\& wcd \-x \-x \-s
.Ve
.Sp
L'option \fB\-x\fR doit être utilisée avant toute option d'examen (\fB\-s\fR, \fB\-S\fR, \fB+S\fR, \fB\-A\fR, \fB\-E\fR).
.Sp
Sur les systèmes DOS/Windows la précision de la lettre de lecteur dépend de l'utilisation ou non des variables d'environnement \fI\s-1HOME\s0\fR ou \fI\s-1WCDHOME\s0\fR. Si \fI\s-1HOME\s0\fR ou \fI\s-1WCDHOME\s0\fR sont fixées alors il faut préciser la lettre du lecteur. Par exemple :
.Sp
.Vb 1
\& wcd \-x c:/temp \-S c:
.Ve
.Sp
Sinon, il n'est pas nécessaire de préciser la lettre de lecteur.
.Sp
.Vb 1
\& wcd \-x /temp \-s
.Ve
.IP "\fB\-xf \s-1FICHIER\s0\fR" 4
.IX Item "-xf FICHIER"
Exclure de l'examen tous les chemins listés dans \fI\s-1FICHIER\s0\fR.
.Sp
Lorsque cette option est utilisée, wcd excluera tous les chemins listés dans \fI\s-1FICHIER\s0\fR et tous leurs sous\-répertoires durant l'examen d'un disque. Les caractères génériques sont pris en charge et ils sont mis en correspondance de chemins absolus ; un chemin par ligne. Il faut être attentif au fait que wcd n'ignore pas les espaces commençant et terminant une ligne parce qu'il s'agit de caractères légaux pour un nom de répertoire. L'option \fB\-xf\fR peut être utilisée plusieurs fois. Lorsque l'exclusion de tous les chemins bannis est souhaitée, il est possible de faire de la sorte (exemple pour wcd sur unix) :
.Sp
.Vb 1
\& wcd \-xf ~/.ban.wcd \-s
.Ve
.Sp
Les caractères génériques sont pris en charge. Par exemple, pour exclure tous les répertoires Subversion contenant des fichiers d'administration, ajoutez une ligne avec \f(CW\*(C`*/.svn\*(C'\fR.
.Sp
L'option \fB\-xf\fR doit être utilisée avant toute option d'examen (\fB\-s\fR, \fB\-S\fR, \fB+S\fR, \fB\-A\fR, \fB\-E\fR).
.IP "\fB\-y, \-\-assume\-yes\fR" 4
.IX Item "-y, --assume-yes"
Supposer Oui pour toutes les requêtes.
.Sp
Wcd ne posera pas de questions oui/non à l'utilisateur, mais suppose qu'il répondra oui à toutes les questions. Cela peut être utilisé en combinaison de l'option \fB\-rmtree\fR. Cette option doit être utilisée avant les options qui peuvent déboucher à des questions oui/non.
.IP "\fB\-z \s-1NOMBRE\s0\fR" 4
.IX Item "-z NOMBRE"
Fixer la taille maximale de la pile à \s-1NOMBRE.\s0
.Sp
La taille par défaut de la pile est de 10. Les opérations sur la pile peuvent être désactivées en paramètrant la taille à 0. Cette option doit être utilisée avant toute autre option d'opération sur la pile (\fB\-\fR,\fB+\fR,\fB=\fR). Autrement, la taille de la pile sera remise à sa valeur par défaut, 10.
.Sp
Une commande correcte est :
.Sp
.Vb 1
\& wcd \-z 50 \-
.Ve
.Sp
La nouvelle taille de pile sera de 50, wcd ira un répertoire en arrière. Un commande erronée est :
.Sp
.Vb 1
\& wcd \- \-z 50
.Ve
.Sp
Wcd va en arrière d'un répertoire, la pile à une valeur par défaut de 10. Le \fB\-z 50\fR est ignoré.
.Sp
Ajouter cette option en première option de votre alias ou fonction wcd. Un exemple pour l'interface d'administration compatible \s-1POSIX\s0 serait :
.Sp
.Vb 5
\& wcd ()
\& {
\& wcd.exe \-z 50 "$@"
\& . ${WCDHOME:\-${HOME}}/bin/wcd.go
\& }
.Ve
.IP "\fB\-[\s-1NOMBRE\s0]\fR" 4
.IX Item "-[NOMBRE]"
Empiler les répertoires \s-1NOMBRE\s0 de fois. La valeur par défaut étant de un.
.Sp
Retourner en arrière d'un répertoire. La commande retourne en arrière d'un répertoire. Y ajouter un nombre pour retourner en arrière de plusieurs répertoires. Exemple : \f(CW\*(C`wcd \-3\*(C'\fR. La pile est cyclique.
.IP "\fB+[\s-1NOMBRE\s0]\fR" 4
.IX Item "+[NOMBRE]"
Dépiler les répertoires \s-1NOMBRE\s0 fois. Un par défaut.
.Sp
Avancer d'un répertoire. La commande \f(CW\*(C`wcd +\*(C'\fR avance d'un répertoire. Y ajouter un nombre pour avancer de plusieurs répertoires. Par exemple : \f(CW\*(C`wcd +2\*(C'\fR. La pile est cyclique.
.IP "\fB=\fR" 4
.IX Item "="
Afficher la pile.
.Sp
Utiliser cette option si vous ne savez plus de combien de fois empiler ou dépiler. La pile est affichée et il est possible de choisir un nombre. La position courante de la pile est désignée par une astérisque \f(CW\*(C`*\*(C'\fR.
.SH "INSTALLATION"
.IX Header "INSTALLATION"
Le répertoire de travail courant d'une interface système Unix ne peut être changé que par la commande intégrée \fBcd\fR\|(1). Le programme est donc toujours appelé par une fonction ou un alias. La fonction ou l'alias incluent un script d'interface système (script « go ») qui est généré par le programme wcd. Wcd ne peut fonctionner qu'après que la fonction ou l'alias aient été définis.
.PP
Un autre impact important de votre installation est la définition des variables d'environnement \fI\s-1HOME\s0\fR and \fI\s-1WCDHOME\s0\fR. Voir la section \s-1VARIABLES D\s0'\s-1ENVIRONNEMENT.\s0
.SS "Installation pour les interfaces système de type \s-1POSIX\s0"
.IX Subsection "Installation pour les interfaces système de type POSIX"
Pour les interfaces système \s-1POSIX\s0 (ksh, bash, zsh, etc.) sur Unix, Linux, Cygwin ou \s-1MSYS\s0 natif, ajouter la fonction suivante au fichier de démarrage de l'interface système (Bash utilise par exemple \f(CW\*(C`$HOME/.bashrc\*(C'\fR) :
.PP
.Vb 5
\& wcd ()
\& {
\& CHEMIN/wcd.exe "$@"
\& . ${WCDHOME:\-${HOME}}/bin/wcd.go
\& }
.Ve
.PP
Remplacer \fI\s-1CHEMIN\s0\fR par l'emplacement où l'exécutable de wcd a été installé. Recharger le fichier d'initialisation de l'interface système ou démarrer une nouvelle interface système.
.PP
L'emplacement du script « go » \f(CW\*(C`wcd.go\*(C'\fR diffère par interface système.
.PP
Wcd pour les interfaces système \s-1DOS DJGPP\s0 et \s-1OS/2\s0 exige une fonction différente. Le script « go » n'est pas écrit dans un répertoire \f(CW\*(C`bin\*(C'\fR, et si \fI\s-1WCDHOME\s0\fR et \fI\s-1HOME\s0\fR sont toutes deux non définies, le script « go » est écrit sur c:/.
.PP
bash \s-1DOS :\s0
.PP
.Vb 5
\& wcd ()
\& {
\& CHEMIN/wcdbash.exe "$@"
\& . ${WCDHOME:\-${HOME:\-"c:"}}/wcd.go
\& }
.Ve
.PP
bash \s-1OS/2 :\s0
.PP
.Vb 5
\& wcd ()
\& {
\& CHEMIN/wcdos2bash.exe "$@"
\& . ${WCDHOME:\-${HOME:\-"c:"}}/wcd.go
\& }
.Ve
.PP
La version WinZsh de wcd exige une fonction légèrement différente. Le script « go » ne sera jamais écrit dans c:/.
.PP
.Vb 5
\& wcd ()
\& {
\& CHEMIN/wcdwin32zsh.exe "$@"
\& . ${WCDHOME:\-${HOME}}/wcd.go
\& }
.Ve
.PP
Voir la section \s-1FICHIERS\s0 pour plus d'informations.
.SS "Installation pour les interfaces système de type C (csh, tcsh)"
.IX Subsection "Installation pour les interfaces système de type C (csh, tcsh)"
Ajouter les alias suivants au fichier de démarrage de l'interface système \f(CW\*(C`$HOME/.cshrc\*(C'\fR ou \f(CW\*(C`$HOME/.tcshrc\*(C'\fR :
.PP
.Vb 5
\& if ( ${?WCDHOME} ) then
\& alias wcd "PATH/wcd.exe \e!* ; source $WCDHOME/bin/wcd.go"
\& else
\& alias wcd "CHEMIN/wcd.exe \e!* ; source $HOME/bin/wcd.go"
\& endif
.Ve
.PP
Remplacer \fI\s-1CHEMIN\s0\fR par l'emplacement où l'exécutable de wcd a été installé. Recharger le fichier d'initialisation de l'interface système ou démarrer une nouvelle interface système.
.SS "Version de l'Invite de Commande Windows"
.IX Subsection "Version de l'Invite de Commande Windows"
Dépaqueter le fichier zip et ajouter le répertoire \f(CW\*(C`bin\*(C'\fR à votre variable d'environnement \fI\s-1PATH\s0\fR.
.PP
Dans Windows Command Prompt, un programme Windows ne peut pas changer de répertoire de travail courant, mais un fichier .bat le peut. Le script de commande \f(CW\*(C`wcd.bat\*(C'\fR exécute le programme wcd qui génère un nouveau fichier de commande \f(CW\*(C`wcdgo.bat\*(C'\fR. \f(CW\*(C`wcd.bat\*(C'\fR et exécute ensuite \f(CW\*(C`wcdgo.bat\*(C'\fR qui change effectivement de répertoire.
.SS "Windows \s-1VISTA\s0 et ultérieur"
.IX Subsection "Windows VISTA et ultérieur"
Dans un Commande Prompt Windows Vista ou de niveau plus haut, l'accès aux répertoires peut être limité. Pour avoir accès à plus de répertoires des droits administrateurs sont requis. Il est possible d'obtenir un Commande Prompt avec des droits administrateurs en cliquant avec le bouton droit sur l'icône du Commande Prompt puis en choisissant \fIExécuter en tant qu'administrateur\fR.
.SS "Version Windows PowerShell"
.IX Subsection "Version Windows PowerShell"
Ajouter la fonction suivante à votre profil utilisateur PowerShell. L'emplacement de ce profil est stocké dans la variable \f(CW$profile\fR. Il est requis que l'une des deux variables d'environnement \fI\s-1HOME\s0\fR et \fI\s-1WCDHOME\s0\fR soit définie.
.PP
.Vb 5
\& function wcd
\& {
\& CHEMIN\ewcdwin32psh.exe $args
\& & $env:HOME\ewcdgo.ps1
\& }
.Ve
.PP
Remplacer \fI\s-1CHEMIN\s0\fR avec l'emplacement où l'exécutable de wcd a été installé. Démarrer un nouveau PowerShell. Wcd pour PowerShell prend uniquement en charge le fournisseur de système de fichier. Pas d'autres fournisseurs.
.SS "Version \s-1OS/2\s0 Command Prompt"
.IX Subsection "Version OS/2 Command Prompt"
Dans un \s-1OS/2\s0 Command Prompt (cmd.exe) un programme \s-1OS/2\s0 ne peut pas changer de répertoire de travail courant. C'est pourquoi wcd génère un script de commande \f(CW\*(C`wcdgo.cmd\*(C'\fR qui doit être exécuté dans l'interface système actuelle. Le script \f(CW\*(C`wcd.cmd\*(C'\fR exécute dans un premier temps \f(CW\*(C`wcdos2.exe\*(C'\fR qui crée le script \f(CW\*(C`wcdgo.cmd\*(C'\fR. Ensuite \f(CW\*(C`wcd.cmd\*(C'\fR exécute le script \f(CW\*(C`wcdgo.cmd\*(C'\fR.
.SH "LOCALISATION"
.IX Header "LOCALISATION"
.IP "\fB\s-1LANG\s0\fR" 4
.IX Item "LANG"
Le langage principal est sélectionné avec la variable d'environnement \fI\s-1LANG\s0\fR. Cette variable est composée de plusieurs parties. La première partie, en lettres minuscules, est le code de la langue. La seconde, optionnelle et en lettres majuscules, est le code du pays précédé d'un tiret bas. Il y a également une troisième partie optionnelle : l'encodage des caractères, précédé par un point. Quelques exemples pour les interfaces système conforme au standard \s-1POSIX :\s0
.Sp
.Vb 6
\& export LANG=fr Français
\& export LANG=fr_FR Français, France
\& export LANG=fr_BE Français, Belgique
\& export LANG=es_ES Espagnol, Espagne
\& export LANG=es_MX Espagnol, Mexique
\& export LANG=en_US.iso88591 Anglais, USA, encodage Latin\-1
.Ve
.Sp
Pour une liste complète des codes de langue et de pays voir le manuel de \fBgettext\fR\|(1) : Sur les systèmes Unix, la commande \fBlocale\fR\|(1) peut être utilisée pour voir les informations précises de localisation.
.IP "\fB\s-1LANGAGE\s0\fR" 4
.IX Item "LANGAGE"
Avec la variable d'environnement \fI\s-1LANG\s0\fR, il est possible de spécifier une liste de priorité de langues séparées par des virgules. Wcd donne une préférence à \fI\s-1LANGUAGE\s0\fR sur \fI\s-1LANG\s0\fR. Par exemple, d'abord néerlandais puis allemand : \f(CW\*(C`LANGUAGE=nl:de\*(C'\fR. Il faut d'abord activer la localisation en fixant \fI\s-1LANG\s0\fR ou \fI\s-1LC_ALL\s0\fR à une valeur autre que \fIC\fR avant de pouvoir utiliser un liste de priorités de langue avec la variable \fI\s-1LANGUAGE\s0\fR. Voir aussi le manuel de \fBgettext\fR\|(1) :
.Sp
Si vous sélectionnez un langage qui n'est pas disponible, les messages seront affichés en anglais standard.
.IP "\fB\s-1WCDLOCALEDIR\s0\fR" 4
.IX Item "WCDLOCALEDIR"
La variable d'environnement \fI\s-1WCDLOCALEDIR\s0\fR prévaut sur la variable \fI\s-1LOCALEDIR\s0\fR utilisée pendant la compilation et l'installation de wcd. \fI\s-1LOCALEDIR\s0\fR est utilisée par wcd avec prise en chage de langage natif pour trouver les fichiers de langue. La valeur par défaut pour \s-1GNU\s0 est \f(CW\*(C`/usr/local/share/locale\*(C'\fR. En tapant \f(CW\*(C`wcd \-V\*(C'\fR, wcd affichera la variable \fI\s-1LOCALEDIR\s0\fR utilisée.
.Sp
Si vous avez installé wcd dans un répertoire différent du répertoire par défaut, il vous faut peut être définir la variable d'environnement \fI\s-1WCDLOCALEDIR\s0\fR pour pointer vers le répertoire de locales.
.Sp
Un exemple pour le cmd Windows :
.Sp
.Vb 1
\& set WCDLOCALEDIR=c:/my_prefix/share/locale
.Ve
.Sp
Un example pour une interface système \s-1POSIX :\s0
.Sp
.Vb 1
\& export WCDLOCALEDIR=$HOME/share/locale
.Ve
.IP "\fB\s-1LC_COLLATE\s0\fR" 4
.IX Item "LC_COLLATE"
Lorsque plusieurs répertoires correspondent, wcd affiche une liste triée. L'ordre dépend des paramètres de locale. Si la variable d'environnement \fI\s-1LANG\s0\fR a été définie, les correspondances sont triées comme les sont les dictionnaires ou les annuaires téléphonique dans cette langue. Par exemple, les points et les tirets sont ignorés, ou bien les lettres e avec ou sans accent sont identiques, ou bien la casse est ignorée.
.Sp
Le tri donne préférence à la variable d'environnement \fI\s-1LC_COLLATE\s0\fR devant \fI\s-1LANG\s0\fR. Si vous rendez \fI\s-1LC_COLLATE\s0\fR égal à \f(CW\*(C`C\*(C'\fR ou \f(CW\*(C`POSIX\*(C'\fR, le tri selon la locale est désactivé. Par exemple, si vous voulez du néerlandais mais un tri que n'est pas néerlandais, vous pouvez faire de la sorte :
.Sp
.Vb 2
\& export LANG=fr_FR
\& export LC_COLLATE=C
.Ve
.IP "\fB\s-1LC_CTYPE\s0\fR" 4
.IX Item "LC_CTYPE"
En ce qui concerne l'encodage de caractères, wcd donnera une préférence à la variable \fI\s-1LC_CTYPE\s0\fR sur la variable \fI\s-1LANG\s0\fR. Par exemple, pour fixer l'encodage de caractères en \s-1UTF\-8,\s0 le paramètrage de l'environnement suivant peut être appliqué.
.Sp
.Vb 1
\& export LC_CTYPE=fr_FR.UTF\-8
.Ve
.IP "\fB\s-1LC_ALL\s0\fR" 4
.IX Item "LC_ALL"
La variable d'environnement \fI\s-1LC_ALL\s0\fR si elle est définie, prévaut sur toutes les variables d'environnement de locales qui commencent par \fI\s-1LC_\s0\fR. Wcd donnera une préférence à \fI\s-1LC_ALL\s0\fR sur \fI\s-1LC_COLLATE\s0\fR et \fI\s-1LC_CTYPE\s0\fR.
.SS "\s-1PAGES DE CODES WINDOWS\s0"
.IX Subsection "PAGES DE CODES WINDOWS"
Il y a deux groupes de page de code : les pages de code \s-1DOS\s0 (\s-1OEM\s0) et les pages de code Windows (\s-1ANSI\s0). L'encodage par défaut de Windows, lorsqu'il est configuré avec les paramètres de régions occidentales, est \s-1ANSI CP1252.\s0 Les programmes Windows, par exemple le bloc-notes, utilisent cette page de code \s-1ANSI\s0 par défaut. La console Windows utilise par défaut une page de code \s-1OEM\s0 (\s-1CP437\s0 ou \s-1CP850\s0) pour compatibilité avec les programmes \s-1DOS.\s0 Si vous utilisez une version \s-1DOS\s0 de wcd dans une console Windows, cela marchera grâce à la page de code \s-1DOS.\s0 Cependant la version \s-1DOS\s0 de wcd ne prend pas en charge de longs noms de répertoire et de lecteur réseau sur Windows.
.PP
La version Windows de wcd est un programme Windows natif et utilise la page de code \s-1ANSI\s0 du système Windows. Donc sur un Windows configuré pour une région occidentale la page de code \s-1CP1252\s0 est utilisée pour les noms de répertoire et les messages. Dans le but d'obtenir des sorties uniformes, indépendantes des pages de code actives, toutes les versions de Wcd pour Windows traduisent les sorties \s-1ANSI\s0 en sorties Unicode dans le Command Prompt et le PowerShell.
.PP
La police de trame de la console ne prend en charge que la page de code \s-1OEM\s0 installée avec Windows, et il faut donc changer la page de code de la console à Lucidia Console correctement typé pour faire apparaître les lettres Unicode (et \s-1ANSI\s0) correctement.
.PP
Les versions non-Unicode de Wcd \fIavant la version 5.2.0\fR utilisent une sortie entièrement \s-1ANSI.\s0 Pour ces anciennes versions, la page de code de la console a été faite pour être identique à la page de code du système (changé à 1252) dans le but de faire fonctionner wcd pour Windows correctement avec des caractères spéciaux tels que les caractères avec accent ou le symbole de l'Euro.
.PP
La page de code Windows peut être changée via les options de région du Panneau de Contrôle. La page de code de la console Windows est changée avec la commande \f(CW\*(C`chcp\*(C'\fR.
.PP
Lorsque vous tapez \f(CW\*(C`wcd \-V\*(C'\fR, l'encodage de caractères effectif utilisé par wcd est affiché. Tapez la commande \f(CW\*(C`chcp\*(C'\fR pour afficher la page de codes active de la console Windows.
.SS "\s-1UNICODE\s0"
.IX Subsection "UNICODE"
Wcd a une prise en charge optionnelle de l'Unicode. Pour voir si wcd a été empaqueté avec la prise en charge de l'Unicode, tapez \f(CW\*(C`wcd \-V\*(C'\fR. Si votre terminal/console et la police le prend en charge, vous devriez voir le symbole de l'Euro ainsi que des caractères chinois (voulant dire : « chinois »).
.PP
Wcd a été converti de façon \fIlogicielle\fR à l'Unicode. En son coeur, Wcd traite toutes les données comme un flux d'octets. Seules les lignes affichées à l'écran sont converties à la volée en caractères Unicode larges. Wcd s'appuie entièrement sur des fonctions de la libc et n'a pas de code \s-1UTF\-8\s0 spécifique. Voir aussi .
.PP
Wcd a une prise en charge optionnelle de mise en correspondance avec de l'Unicode normalisé. Pour déterminer si Wcd prend en charge la normalisation, tapez \f(CW\*(C`wcd \-V\*(C'\fR. Wcd avec une prise en charge de la normalisation Unicode fera correspondre les noms Unicode en se basant sur une équivalence \fIcompatible\fR. Sans prise en charge de la normalisation Unicode, les noms sont mis en correspondance lorsque leur binaires sont équivalents. Voir aussi
.PP
\fI\s-1UTF\-8\s0 sur Unix/Linux\fR
.IX Subsection "UTF-8 sur Unix/Linux"
.PP
Pour voir les caractères \s-1UTF\-8,\s0 votre console/terminal doit également prendre en charge l'\s-1UTF\-8.\s0 La version xterm empaquetée avec XFree86 4.0 ou supérieur inclue une prise en charge de l'\s-1UTF\-8.\s0 Pour l'activer, démarez \fBxterm\fR\|(1) dans une locale \s-1UTF\-8\s0 et utilisez une police avec un encodage iso10646\-1, par exemple avec
.PP
.Vb 1
\& LC_CTYPE=en_GB.UTF\-8 xterm \-u8 \-fn \*(Aq\-Misc\-Fixed\-Medium\-R\-SemiCondensed\-\-13\-120\-75\-75\-C\-60\-ISO10646\-1\*(Aq
.Ve
.PP
Les distributions modernes de GNU/Linux prennent en charge l'\s-1UTF\-8\s0 par défaut. D'autres encodages de caractères sur plusieurs octets devraient également fonctionner, mais cela n'a pas été testé.
.PP
Wcd suppose que les fichiers d'arborescence sont encodés dans l'encodage de caractères local. Il n'y a pas d'Indicateur d'Ordre des Octets écrit dans les fichiers d'arborescence.
.PP
\fI\s-1UTF\-16\s0 sur Windows\fR
.IX Subsection "UTF-16 sur Windows"
.PP
Sur Windows, l'Unicode est pris en charge pour toutes les versions de PowerShell, et dans le Windows Command Prompt sur Windows 7 (ou ultérieur). Unicode fonctionne également dans Take Command ou \s-1TCC/LE\s0 édités par \s-1JP\s0 Software, et pouvant être utilisés sur des version de Windows plus anciennes (XP/Vista).
.PP
Sur Windows, tous les noms de répertoire sur le disque sont encodés en Unicode \s-1UTF\-16.\s0 Pour des programmes Windows non Unicode, les caractères Unicode sont traduits vers la page de code \s-1ANSI\s0 par défaut. Cette traduction de caractères ne faisant pas partis du paramètrage régional n'est pas possible et les programmes non Unicode affichent un point d'intérogation ou bien un mauvais caractères.
.PP
Wcd avec prise en charge de l'Unicode lit les noms de répertoire encodé en \s-1UTF\-16\s0 et les convertis de façon interne en \s-1UTF\-8.\s0 Tous les fichiers d'arborescence sont encodés en \s-1UTF\-8\s0 et ne sont pas compatibles avec la version non Unicode de Wcd. Wcd créera un script « go » en \s-1UTF\-8.\s0
.PP
Toutes les versions de Windows PowerShell sont capable d'exécuter des scripts encodés en \s-1UTF\-8\s0 s'il y a un \s-1BOM UTF\-8\s0 dans le script.
.PP
Depuis Windows 7 il est possible de changer de répertoire avec un script batch dans Windows Command Prompt vers un répertoire avec une lettre Unicode dans le nom. Le nom du répertoire doit être encodé en \s-1UTF\-8,\s0 et le script batch ne doit \fIpas\fR avoir de \s-1BOM.\s0 La page de code active du Command Prompt doit être fixée à 65001 (\s-1UTF\-8\s0) avant la commande cd. Wcd pour Command Prompt créera un script « go » \f(CW\*(C`wcdgo.bat\*(C'\fR. Dans un premier temps, il change la page de code à 65001 puis change de répertoire et enfin fixe la page de code à sa valeur initiale.
.PP
Vous devez fixer la police à True Type Lucida Console (et non une police de trame) lorsque les lettres n'apparaîssent pas correctement.
.PP
La version pour Windows non Unicode de Wcd peut lire des fichiers d'arborescence Unicode depuis la version 5.2.0 s'il y a un Indicateur d'Ordre des Octets (\s-1BOM\s0) dans le fichier (voir ), mais il ne peut se déplacer vers des répertoires dont le nom contient des lettres Unicodes et qui ne font pas parties de la page de code \s-1ANSI\s0 par défaut du système. La version pour Windows non Unicode écrit un \s-1BOM\s0 dans les fichiers d'arborescence encodés en \s-1UTF\-8\s0 depuis la version 5.2.0, ce qui les rend également lisible par le bloc-notes.
.PP
\fI\s-1UTF\-8\s0 sur Cygwin\fR
.IX Subsection "UTF-8 sur Cygwin"
.PP
Cygwin prend en charge l'Unicode depuis la version 1.7. La couche Cygwin s'occupe de la conversion des noms Unicode \s-1UTF\-16\s0 Windows en \s-1UTF\-8.\s0 Donc des programmes tels que Wcd n'ont pas besoin de savoir cela et peuvent fonctionner en utilisant l'encodage \s-1UTF\-8\s0 sur Unix/Linux. Fixez l'encodage de caractères à \s-1UTF\-8\s0 avec les variables d'environnement \fI\s-1LANG\s0\fR ou \fI\s-1LC_CTYPE\s0\fR. Il peut être nécessaire de réexaminer les disques. Il faut fixer la police à True Type Lucida Console (et non à une police de trame) si vous utilisez la console Cygwin par défaut.
.PP
La version Cygwin se comporte de la même façon que la version Unix de wcd. Il n'y a pas de \s-1BOM\s0 écrit dans les fichiers d'arborescence, et il est supposé qu'ils sont encodés dans l'encodage de caractères de la locale \fBCygwin\fR.
.SH "FICHIERS"
.IX Header "FICHIERS"
Si la variable d'environnement \fI\s-1WCDHOME\s0\fR est définie, wcd utilisera \fI\s-1WCDHOME\s0\fR au lieu de \fI\s-1HOME\s0\fR. Tous les fichiers \f(CW\*(C`*.wcd\*(C'\fR sont des fichiers texte. Ils peuvent être modifiés avec un éditeur de texte. La version Windows Command Prompt de wcd se comporte comme la version \s-1DOS.\s0 La version Cygwin de wcd se comporte comme la version Unix.
.IP "\fBwcd.exe\fR" 4
.IX Item "wcd.exe"
Le programme. Dans les interfaces système Unix, le programme est toujours appelé par une fonction ou un alias parce que le répertoire courant de travail d'une interface système Unix ne peut être changé que par la commande cd intégrée. Voir également la section \s-1INSTALLATION.\s0
.IP "\fBfichier d'arborescence par défaut\fR" 4
.IX Item "fichier d'arborescence par défaut"
C'est le fichier d'arborescence par défaut où wcd cherche les correspondances. S'il n'est pas lisible, wcd en créera un nouveau.
.Sp
.Vb 2
\& S \etreedata.wcd ou %HOME%\etreedata.wcd
\& S $HOME/.treedata.wcd
.Ve
.IP "\fBfichier d'arborescence supplémentaire\fR" 4
.IX Item "fichier d'arborescence supplémentaire"
Un fichier d'arborescence supplémentaire optionel. S'il existe et est lisible, wcd tentera de trouver des correspondances depuis ce fichier également.
.Sp
.Vb 2
\& S \eextra.wcd ou %HOME%\eextra.wcd
\& S $HOME/.extra.wcd
.Ve
.IP "\fBfichier de bannissement\fR" 4
.IX Item "fichier de bannissement"
Wcd place dans ce fichier optionnel les chemins bannis. Voir l'option \fB\-b\fR. Les caractères génériques sont pris en charge.
.Sp
.Vb 2
\& S \eban.wcd ou %HOME%\eban.wcd
\& S $HOME/.ban.wcd
.Ve
.IP "\fBfichier d'alias\fR" 4
.IX Item "fichier d'alias"
Fichier optionnel avec les alias wcd. Voir l'option \fB\-l\fR.
.Sp
.Vb 2
\& S \ealias.wcd ou %HOME%\ealias.wcd
\& S $HOME/.alias.wcd
.Ve
.IP "\fBfichier de pile\fR" 4
.IX Item "fichier de pile"
Wcd stocke sa pile dans ce fichier. La lettre de lecteur peut être changée avec l'option \fB\-d\fR.
.Sp
.Vb 2
\& S c:\estack.wcd ou %HOME%\estack.wcd
\& S $HOME/.stack.wcd
.Ve
.Sp
Le nom du fichier de pile peut être changé avec la variable d'environnement \fI\s-1WCDSTACKFILE\s0\fR. Voir la section \s-1VARIABLES D\s0'\s-1ENVIRONNEMENT.\s0
.IP "\fBscript « go »\fR" 4
.IX Item "script « go »"
C'est le script d'interface système que wcd.exe crée à chaque fois. Il est inclus par une function ou un alias. La lettre de lecteur peut être changée avec l'option \fB\-d\fR. Pour des raisons historiques, il est placé dans \f(CW\*(C`$HOME/bin\*(C'\fR par défaut sur les systèmes Unix. Le répertoire de ce fichier peut être changé avec l'option \fB\-G\fR.
.Sp
.Vb 8
\& interface système S c:/wcd.go or $HOME/wcd.go
\& Windows Command S c:\ewcdgo.bat or %HOME%\ewcdgo.bat
\& Windows S $env:HOME\ewcdgo.ps1
\& S $HOME/wcd.go
\& S $HOME/bin/wcd.go
\& OS/2 Command S c:\ewcdgo.cmd or %HOME%\ewcdgo.cmd
\& interface système S c:/wcd.go or $HOME/wcd.go
\& S $HOME/bin/wcd.go
.Ve
.IP "\fBfichier d'arborescence relative\fR" 4
.IX Item "fichier d'arborescence relative"
Fichier texte avec les chemins relatifs à \fI\s-1REP\s0\fR. Voir les options \fB+S\fR, \fB\-n\fR et \fB+n\fR.
.Sp
.Vb 2
\& S CHEMIN\ertdata.wcd
\& S CHEMIN/.rtdata.wcd
.Ve
.SH "VARIABLES D'ENVIRONNEMENT"
.IX Header "VARIABLES D'ENVIRONNEMENT"
.IP "\fB\s-1HOME\s0\fR" 4
.IX Item "HOME"
Wcd utilise par défaut la variable d'environnement \fI\s-1HOME\s0\fR pour déterminer où stocker ses fichiers. Voir également la section \s-1FICHIERS.\s0 Cela peut être modifié avec la variable d'environnement \fI\s-1WCDHOME\s0\fR.
.Sp
\&\fI\s-1HOME\s0\fR définit également où commencer l'examen du disque lorsque l'option \fB\-s\fR est utilisée. Ceci peut être modifié avec la variable d'environnement \fI\s-1WCDSCAN\s0\fR.
.Sp
Pour la version Unix, Cygwin, Windows PowerShell, WinZsh et \s-1MSYS,\s0 il est nécessaire que \fI\s-1HOME\s0\fR ou \fI\s-1WCDHOME\s0\fR soient définies. L'utilisation de ces variables est optionnelle pour les autres versions de wcd.
.Sp
Si \fI\s-1HOME\s0\fR est défini sur DOS/Windows, wcd placera tous ses fichiers (treedata.wcd, extra.wcd, alias.wcd, ban.wcd, wcd.go) dans le répertoire \fI\s-1HOME\s0\fR. Le comportement de wcd est alors identique à celui de la version Unix de wcd. Wcd examinera le disque depuis \fI\s-1HOME\s0\fR par défaut. Les lecteurs ne seront pas automatiquement examinés lors d'un basculement. Vous devez explicitement le demander à wcd. Par exemple :
.Sp
.Vb 1
\& wcd \-S c: \-A d: \-A e:
.Ve
.Sp
La correspondance des répertoires est maintenant globale à tous les lecteurs examinés.
.IP "\fB\s-1WCDHOME\s0\fR" 4
.IX Item "WCDHOME"
La variable d'environnement \fI\s-1WCDHOME\s0\fR peut être utilisée pour changer l'emplacement des fichiers de wcd. Si \fI\s-1HOME\s0\fR et \fI\s-1WCDHOME\s0\fR sont toutes deux définies, \fI\s-1WCDHOME\s0\fR sera utilisée à la place de \fI\s-1HOME\s0\fR.
.Sp
Dans les versions antérieures à la version 5.1.5, \fI\s-1WCDHOME\s0\fR changeait également le répertoire d'examen par défaut. Cela a été modifié. Depuis la version 5.1.5, \fI\s-1WCDHOME\s0\fR ne modifie pas le répertoire d'examen par défaut. Voir l'option \fB\-s\fR. Depuis la version 5.1.5, la variable d'environnement \fI\s-1WCDSCAN\s0\fR peut être utilisée pour modifier le répertoire d'examen par défaut.
.Sp
Exemple pour \s-1DOS,\s0 Windows, \s-1OS/2\s0 Command Prompt :
.Sp
.Vb 1
\& set WCDHOME=C:\eUtilisateurs\eerwin\ewcd
.Ve
.Sp
Un exemple pour les interfaces système \s-1POSIX :\s0
.Sp
.Vb 1
\& export WCDHOME="$HOME/.wcd"
.Ve
.Sp
Un exemple pour les interfaces système Csh :
.Sp
.Vb 1
\& setenv WCDHOME "$HOME/.wcd"
.Ve
.IP "\fB\s-1WCDSCAN\s0\fR" 4
.IX Item "WCDSCAN"
Utilisez la variable d'environnement \fI\s-1WCDSCAN\s0\fR pour modifier le répertoire d'examen par défaut \fI\s-1HOME\s0\fR. Une liste séparée par des virgules (Unix) peut être utilisée pour spécifier plusieurs répertoires. Sur DOS/Windows, la liste doit être séparée par des point-virgules.
.Sp
Exemples pour \s-1DOS,\s0 Windows, \s-1OS/2\s0 Commande Prompt :
.Sp
.Vb 1
\& set WCDSCAN=C:\eUtilisateurs\eerwin;D:\edonnees
\&
\& set WCDSCAN=%HOMELECTEUR%%HOMECHEMIN%;\e\electeurprojet\eprojetX
.Ve
.Sp
Un exemple pour les interfaces système \s-1POSIX :\s0
.Sp
.Vb 1
\& export WCDSCAN="$HOME:/disqueprojet/projetX"
.Ve
.Sp
Un exemple pour les interfaces système Csh :
.Sp
.Vb 1
\& setenv WCDSCAN "$HOME:/disqueprojet/projetX"
.Ve
.IP "\fB\s-1WCDFILTER\s0\fR" 4
.IX Item "WCDFILTER"
Spécifiez des filtres avec la variable d'environnment \fI\s-1WCDFILTER\s0\fR. Tous les répertoires qui ne correspondent pas au(x) filtre(s) sont ignorés. Une liste peut être données en séparant les filtres avec le séparateur de chemin de l'interface système, de façon similaire à la définition de la variable \fI\s-1PATH\s0\fR. La sensibilité à la casse est dictée par le système d'exploitation.
.Sp
Un exemple pour \s-1DOS,\s0 Windows, \s-1OS/2\s0 Commande Prompt :
.Sp
.Vb 1
\& set WCDFILTER=projets;doc
.Ve
.Sp
Un exemple pour les interfaces système \s-1POSIX :\s0
.Sp
.Vb 1
\& export WCDFILTER="projets:doc"
.Ve
.Sp
Un exemple pour les interfaces système Csh :
.Sp
.Vb 1
\& setenv WCDFILTER "projets:doc"
.Ve
.IP "\fB\s-1WCDBAN\s0\fR" 4
.IX Item "WCDBAN"
Les chemins spécifiés par la variable d'environnement \fI\s-1WCDBAN\s0\fR seront bannis par wcd. Voir aussi l'option \fB\-b\fR. Donnez une liste de chemins séparés par le séparateur de l'interface système utilisé pour \fI\s-1PATH\s0\fR.
.IP "\fB\s-1WCDEXCLUDE\s0\fR" 4
.IX Item "WCDEXCLUDE"
Les chemins spécifiés par la variables d'environnement \fI\s-1WCDEXCLUDE\s0\fR seront exlus par wcd. Voir aussi les options \fB\-x\fR et \fB\-xf\fR. Donnez une liste de chemins séparés par le séparateur de l'interface système utilisé pour \fI\s-1PATH\s0\fR.
.Sp
Un exemple pour \s-1DOS,\s0 Windows, \s-1OS/2\s0 Commande Prompt :
.Sp
.Vb 1
\& set WCDEXCLUDE=*/windows;*/temp;*CVS
.Ve
.Sp
Un exemple pour les interfaces système \s-1POSIX :\s0
.Sp
.Vb 1
\& export WCDEXCLUDE="/dev:/tmp:*CVS"
.Ve
.Sp
Un exemple pour les interfaces système Csh :
.Sp
.Vb 1
\& setenv WCDEXCLUDE "/dev:/tmp:*CVS"
.Ve
.IP "\fB\s-1WCDUSERSHOME\s0\fR" 4
.IX Item "WCDUSERSHOME"
Défini la racine des répertoires d'utilisateur. Sur DOS/Windows, la valeur par défaut est \f(CW\*(C`\e\eusers\*(C'\fR. Sur Unix/Cygwin, la valeur par défaut est \f(CW\*(C`/home\*(C'\fR. Cette variable est utilisée pour examiner les fichiers d'arborescence d'autres utilisateurs. Voir les options \fB\-u\fR et \fB+u\fR. En mode verbeux, wcd imprimera tous les filtres, bannissements et exclusions. Voir l'option \fB\-v\fR.
.IP "\fB\s-1WCDSTACKFILE\s0\fR" 4
.IX Item "WCDSTACKFILE"
Wcd donne une préférence à \fI\s-1WCDSTACKFILE\s0\fR sur le nom du fichier de pile par défaut (voir la section \s-1FICHIERS\s0). Avec cette variable, chaque interface système (ou émulateur de terminal) peut avoir sa pile privée de répertoires utilisés.
.Sp
Pour utiliser un fichier YYYYMMDD-HHMMSS unique basé sur le temps pour chaque interface système intéractive ouverte.
.Sp
.Vb 1
\& export WCDSTACKFILE=$HOME/.wcd/stack.$(date +%Y%m%d\-%H%M%S)
.Ve
.Sp
Pour une pile par \fBxterm\fR\|(1), utiliser la variable d'environnement xterm \fI\s-1WINDOWID\s0\fR :
.Sp
.Vb 1
\& export WCDSTACKFILE=$HOME/.wcd/stack.$WINDOWID
.Ve
.Sp
Pour \s-1GNU\s0 \fBscreen\fR\|(1), pour utiliser une pile par écran :
.Sp
.Vb 1
\& export WCDSTACKFILE=$HOME/.wcd/stack.$WINDOW
.Ve
.IP "\fB\s-1TERMINFO\s0\fR" 4
.IX Item "TERMINFO"
Si la variable d'environnement \fI\s-1TERMINFO\s0\fR est définie, wcd avec l'interface ncurses recherche une définition de terminal localement avant de le faire à l'emplacement standard. Cela est utile si les définitions du terminal ne sont pas dans un emplacement standard. Les emplacements couramment utilisés sont \f(CW\*(C`/usr/lib/terminfo\*(C'\fR et \f(CW\*(C`/usr/share/terminfo\*(C'\fR.
.IP "\fB\s-1PDC_RESTORE_SCREEN\s0\fR" 4
.IX Item "PDC_RESTORE_SCREEN"
Wcd avec l'interface PDCurses reconnaît la variable d'environnement \fI\s-1PDC_RESTORE_SCREEN\s0\fR. Si cette variable d'environnement est définie, PDCurses fera une copie du contenu de l'écran au moment au wcd est démarré ; lorsque wcd quitte, l'écran sera restauré. Un exemple pour Windows Command Prompt :
.Sp
.Vb 1
\& set PDC_RESTORE_SCREEN=1
.Ve
.Sp
Windows n'autorise la sauvegarde que d'un petit tampon. Il n'est donc pas toujours possible de tout restaurer. Des données inutiles peuvent être affichées dans la console après que wcd ait terminé si vous avez défini une largeur de tampon importante.
.IP "\fB\s-1SHELL\s0\fR" 4
.IX Item "SHELL"
L'impression de \f(CW\*(C`#!$SHELL\*(C'\fR sur la première ligne du script « go » est nécessaire pour une interface système de type \s-1POSIX\s0 pour les caractères de 8 bits. Certaines interfaces système considèrent autrement que le script « go » est un fichier binaire et ne l'incluerons pas. Dans Cygwin bash, la variable \fI\s-1SHELL\s0\fR doit être définie dans l'environnement en utilisant la commande \f(CW\*(C`export\*(C'\fR, sinon wcd ne peut pas lire cette variable.
.IP "\fB\s-1BASH\s0\fR" 4
.IX Item "BASH"
Wcd pour l'interface système \s-1DOS\s0 utilise \f(CW$BASH\fR à la place de \f(CW$SHELL\fR parce que \f(CW$SHELL\fR pointe vers l'interface de commandes système. Il est potentiellement requis de définir \f(CW$BASH\fR avec une commande \f(CW\*(C`export\*(C'\fR, autrement wcd ne peut pas lire la variable.
.SH "VOIR AUSSI"
.IX Header "VOIR AUSSI"
\&\fBsh\fR\|(1), \fBbash\fR\|(1), \fBcsh\fR\|(1), \fBksh\fR\|(1), \fBzsh\fR\|(1), \fBlocale\fR\|(1), \fBncurses\fR\|(1),
.SH "AUTEURS"
.IX Header "AUTEURS"
Wcd a été écrit par Erwin Waterlander
.PP
Project homepage :
.PP
SourceForge :
.PP
La mise en page du manuel a été faite par Jari Aalto .
.PP
\&\s-1NCD\s0 fut initialement écrit par Brad Kingsbury pour « Norton Utilities » de Peter Norton aux environs de 1987. Voir aussi
wcd-6.0.5/src/man/fr/man1/wcd.htm 0000644 0001755 0001001 00000227455 14421240112 015650 0 ustar waterlan Geen
wcd 6.0.5 - Wherever Change Directory
Wcd est un logiciel en ligne de commande permettant de changer de répertoire rapidement. Il permet de gagner du temps d'écriture au clavier. Un utilisateur n'a besoin de taper qu'une partie du nom d'un répertoire et wcd s'y déplacera. Wcd a une méthode de sélection rapide lors de multiples correspondances et permet l'alias et le bannissement de répertoires. Wcd inclus également un navigateur d'arborescence de fichiers intéractif en mode plein écran et avec recherche rapide.
Wcd a été construit sur le modèle du Norton Change Directory (NCD). NCD est apparu pour la première fois dans The Norton Utilities, Release 4, pour DOS en 1987 et publié par Peter Norton.
Wcd a été adapté à différentes interfaces système en ligne de commande : DOS command.com, Windows cmd.exe et PowerShell, OS/2 cmd.exe, et aux interfaces système Unix telles que Bourne (sh), Bourne Again (bash), Korn (ksh), Z (zsh), et C (csh) ainsi qu'à d'autres fonctionnant sur tout système d'exploitation.
Wcd prend en charge les ensemble de caractères 8 bits sur tous les systèmes, et prend en charge l'Unicode de façon optionnelle. Voir la section LOCALISATION.
Voir la section INSTALLATION pour mettre en place wcd dans le cas d'un usage personnel.
Utilisation basique
Par défaut (si aucun caractère générique n'est utilisé) wcd cherche un répertoire avec un nom commençant par le nom entré.
Par exemple, cette commande changera vers le répertoire de l'utlisateur courant /home/user/Desktop :
wcd Desk
Lorsqu'il y a plusieurs correspondances, wcd affichera à l'utilisateur une liste les contenant toutes. L'utilisateur pourra alors faire un choix avec quelques de frappes clavier (une seule la plus part du temps).
Caractères génériques
Wcd prend en charge les caractères génériques suivant :
* correspond à toute séquence de caractères (zéro ou plus)
? correspond à n'importe quel caractère
[ENSEMBLE] correspond à n'importe quel caractère dans l'ensemble donné,
[!ENSEMBLE] ou [^ENSEMBLE] correspond à n'importe quel caractère qui n'est pas dans l'ensemble donné.
Un ensemble est composé de caractères ou d'intervalles ; un intervalle s'écrit caractère tiret caractère comme dans 0-9 ou A-Z. [0-9a-zA-Z_] est l'ensemble minimal de caractères autorisés dans la construction du motif [...]. Les caractères internationaux (à savoir des caractères de 8 bits) sont autorisés si le système les prend en charge. Pour supprimer le sens syntaxique spécial de n'importe quel caractère []*?!^-\ à l'intérieur ou à l'extérieur d'une construction [..] et ainsi indiquer une correspondance envers le caractère lui-même, il faut le faire précéder d'une barre oblique inversée (\).
L'utilisation de caractères génériques rend possible des recherches complexes. Par exemple, ceci correspond à n'importe quel nom de répertoire se terminant par « top » :
wcd *eau
Fait correspondre les répertoires qui ont « eau » quelque part dans leur nom :
wcd *eau*
Fait correspondre n'importe quel nom de répertoire commençant par « a »,« b » ou « c » :
wcd [a-c]*
Il est également possible de donner une partie du chemin d'un répertoire. Ici Wcd cherche les répertoires dont le nom commence par « Bur » et qui dont le chemin correspond à *moi/Bur*.
wcd moi/Bur
Il est possible d'entrer n'importe quel type d'expression avec des barres obliques et des caractères génériques. Par exemple :
wcd src*/*1?/a*2
Autres utilisations
Si aucun caractère générique n'est utilisé et que wcd trouve une correspondance parfaite, wcd ignorera toutes les correspondances génériques par défaut. Ce comportement peut être modifié par l'option -w.
Le navigateur d'arborescence de répertoire intéractif peut être démarré en utilisant l'option -g.
wcd -g
Wcd génère un fichier d'arborescence à l'emplacement de la recherche du répertoire. Sur les systèmes Unix et Windows, wcd ajoute des liens symboliques vers le fichier d'arborescence lors de l'examem du disque, mais ne les suit pas. S'il suivait les liens, wcd pourrait en venir à examiner une boucle infinie, ou de très grandes portions d'un réseau.
Wcd peut également changer vers des répertoires qui ne sont pas dans le fichier d'arborescence. Par exemple :
wcd ..
Si wcd trouve une correspondance mais ne peut pas aller au répertoire, il tente alors de le supprimer du fichier d'arborescence par défaut. Pas du fichier d'arborescence supplémentaire. Voir également l'option -k.
Wcd conserve une pile de répertoires stockée sur le disque. La pile à une taille par défaut de 10 et est cyclique. Voir les options -z, -, + et =.
Dans un environnement multi-utilisateurs, l'option -i peut être utilisée pour se déplacer dans des répertoires d'autres utilisateurs.
Sur les systèmes DOS et Windows, peut importe si vous utilisez la barre oblique « / » ou la barre oblique inversée « \ » comme séparateur de répertoires.
Sur les systèmes DOS et Windows, il est possible de changer de lecteur et de répertoire d'un seul coup en faisant précéder le nom du répertoire par le nom du lecteur.
wcd d:jeux
chemins Windows UNC
Les versions Windows (Command Prompt, PowerShell, MSYS, zsh, cygwin) prennent en charge les chemins Windows SMB LAN UNC sans lettre de lecteur tels que \\servername\sharename. Wcd pour Windows Command Prompt utilise la commande « pushd » pour faire correspondre un chemin UNC à une lettre de lecteur. Dans Windows PowerShell, MSYS, zsh et Cygwin, les chemins UNC sont pris en charge. Le répertoire de travail courant peut être un chemin UNC.
Redimensionnement de console sous Windows
Wcd prend en charge le redimensionnement de console dans les consoles Windows 10 et ConEmu (void https://conemu.github.io/) depuis la version 6.0.3. La console Windows 10 ne doit pas être dans le mode hérité (vérifier les propriétés de la console). L'écran peut ne pas être rafraîchi lorsque la Configuration « Renvoyer automatiquemet à la ligne le texte en cas de redimensionnement » de la console est désactivée. L'écran peut être rafraîchi manuellement en pressant la touche F5.
Interfaces
Wcd a trois interfaces pour choisir parmi une liste de correspondances. L'interface peut être choisie à la compilation.
La première interface utilise simplement stdin/stdout. Une liste numérotée est affichée dans le terminal. L'utilisateur doit choisir parmi cette liste en entrant un nombre suivi de la touche <Entrer>. Cette interface ne fournit pas la fonctionnalité de défilement arrière lorsque la liste est longue. La fonctionnalité de défilement arrière du terminal ou de la console doit être utilisée. C'est très petit et portable.
La seconde interface est basée sur la bibliothèque conio. Elle fournit une capacité de défilement arrière intégrée. L'utilisateur voit affichée une liste ordonnée par des lettres. La sélection dans cette liste peut se faire en pressant une seule lettre. Cette interface est rapide car elle économise les frappes. Si possible, l'écran sera restauré après sortie. Utiliser l'option -N si l'utilisation de nombres est préférrée.
La troisième interface est construite avec la bibliothèque curses. Elle est similaire à l'interface conio. La version curses de wcd a une interface « graphique » supplémentaire. Elle laisse l'utilisateur choisir un répertoire via un navigateur plein écran et intéractif d'arbre de répertoires. Elle a une navigation et une méthode de recherche similaire à celle de vim(1). Elle peut être activée avec l'option -g.
En utilisant l'option -o il est toujours possible de revenir à l'interface stdin/stdout.
OPTIONS
-a
Ajouter le chemin courant au fichier d'arborescence par défaut.
Utiliser cette option pour ajouter de façon rapide le chemin courant au fichier d'arborescence par défaut. Le réexamen complet du disque peut parfois pendre beaucoup de temps.
-aa
Ajouter le chemin courant et tous les chemins parents au fichier d'arborescence par défaut.
-A CHEMIN
Examiner l'arborescence de répertoires depuis CHEMIN et l'ajouter au fichier d'arborescence par défaut. Exemples :
wcd -A .
wcd -A /home -A /etc
wcd -A d: -A e: -A \\serveur\partage
Sur Windows, il est possible d'examiner tous les répertoires partagés d'un serveur LAN Windows en entrant quelque chose comme : <wcd -A \\nomdeserver>
Voir également les options -S et -s et -E.
-b
Bannir le chemin courant.
Wcd met le chemin courant dans le fichier de bannissements. Cela signifie que wcd ignore toutes les correspondances de ce répertoire et de ses sous-répertoires.
Le fichier de bannissements peut être modifié avec un éditeur de texte. L'utilisation de caractères génériques est prise en charge et les noms sont mis en correspondance avec le chemin absolu.
Les chemins bannis ne sont pas exclus de l'examen du disque. Pour cela utiliser l'option -xf.
-c, --direct-cd
Mode CD direct. Par défaut wcd marche de la façon suivante :
1. Essaie de trouver une correspondance dans le(s) fichier(s) d'arborescence
2. S'il n'y a pas de correspondance, essaie d'ouvrir le répertoire que vous avez entré.
En mode CD direct wcd marche en ordre inverse.
1. Essaie d'ouvrir le répertoire que vous avez entré.
2. Sinon, essaie de trouver une correspondance dans le(s) fichier(s) d'arborescence.
-d LECTEUR
Choisir le lecteur pour le fichier de pile et de « go » (DOS uniquement).
Les fichiers de pile et de script « go » sont stockés sur le lecteur C: par défaut si la variable d'environnement HOME n'est pas définie. Utiliser cette option si le lecteur C: est un lecteur en lecture seule. Cette option doit être utilisée devant les options de pile -, + and =.
-e
Ajouter le chemin courant au fichier d'arborescence supplémentaire.
Utiliser cette option pour ajouter rapidement le chemin courant au fichier d'arborescence supplémentaire.
-ee
Ajouter le chemin courant et tous les chemins parents au fichier d'arborescence supplémentaire.
-E CHEMIN
Examiner l'arborescence de répertoires depuis CHEMIN et l'ajouter au fichier d'arborescence supplémentaire. Voir aussi les options -A et -S.
-f FICHIER
Lire le fichier d'arborescence FICHIER. Ne pas lire le fichier d'arborescence par défaut.
+f FICHIER
Lire le fichier d'arborescence FICHIER en plus du fichier d'arborescence par défaut.
-g
Interface graphique (uniquement pour les versions avec l'interface curses).
Wcd démarre une interface « graphique » textuelle basée sur curses. L'utilisateur peut choisir un répertoire via le navigateur d'arbre de répertoires intéractif en plein écran. Il possède une méthode de navigation et de recherche similaire à celle de vim(1).
Si aucune chaîne de recherche n'est donnée, wcd affiche l'arbre entier qui se trouve dans le fichier d'arborescence par défaut ainsi que dans les fichiers d'arborescence supplémentaires.
Si une chaîne de recherche est donnée, la liste des correspondances est affichée comme un arbre de répertoires.
La disposition par défaut de l'arbre est similaire à celle du NCD initial sur DOS. La différence de disposition réside dans le fait que pour NCD, tous les répertoires de profondeur identique étaient alignés verticalement sur toute la hauteur de l'arbre. Cela était possible sous NCD parce que la longueur maximale d'un nom de répertoire sous DOS était de 12 (8.3) caractères. Les noms de répertoire pouvant être très longs sur les systèmes d'exploitation modernes, la différence de longeur peut être importante. De fait, les dossiers de même profondeur ne sont pas alignés verticalement sur la totalité de l'arbre dans wcd, mais seulement dans les sous-branches. Il y a donc des mouvements latéraux lors d'un déplacement direct vers le haut ou vers le bas depuis une sous-branche vers une autre sous-branche.
Le comportement de navigation de Wcd est exactement identique à celui du NCD initial. Par exemple, l'appui sur la touche Bas du clavier amène au répertoire suivant avec la même profondeur, passant outre les branches. Cela permet une navigation rapide dans l'arbre.
Voir les options -Ta, -TC, et -Tc pour modifier le comportement de la navigation.
-gd
Décharger les fichiers d'arborescence sous forme d'arbre sur la sortie standard.
-G CHEMIN
Ecrire le script « go » dans le répertoire CHEMIN. Par exemple sur Unix, wcd -G CHEMIN va écrire un fichier de script « go »CHEMIN/wcd.go.
-GN, --no-go-script
Ne pas créer un script « go ». Cette option peut être utilisée en association avec l'option -j si la création d'un script « go » n'est pas désirée.
-h, --help
Afficher l'aide et quitter.
-i, --ignore-case
Ignorer la casse. Les versions Dos et Windows de wcd ignorent la casse par défaut. Les versions Unix/Cygwin respectent la casse par défaut.
+i, --no-ignore-case
Respecter la casse. Voir aussi l'option -i.
-I, --ignore-diacritics
Ignorer les caractères diacritiques pour les scripts en Latin. Les lettres avec des symboles diacritiques correspondent à leur lettre de base sans ces symboles diacritiques. Les encodages Latin suivant sont pris en charge : CP437, CP850, CP852, CP1250, CP1252, ISO-8859-1, ISO-8859-2, et Unicode Latin-1, Latin Extended-A, et Latin Extended-B. Voir aussi http://en.wikipedia.org/wiki/Diacritic
+I, --no-ignore-diacritics
Prendre en compte les diacritiques (défaut). Voir aussi l'option -I.
-j, --just-go
Mode à accès direct.
Dans ce mode, wcd ne présentera pas de liste lorsqu'il y a plusieurs répertoires correspondant au répertoire donné. Wcd changera vers la première option. Lorsque wcd est appelé une nouvelle fois avec les même arguments, il changera vers l'option suivante et ainsi de suite.
Wcd affichera le répertoire vers lequel aller sur la sortie standard. Une méthode d'installation différente peut être utilisée. On pourra écrire la fonction suivante pour une interface système compatible POSIX :
wcd ()
{
cd "$($HOME/bin/wcd.exe -j $@)"
}
Lors de l'utilisation d'une interface système ancienne ne prenant pas en charge la substitution de commande « $() », il faut recourir à la substitution de commande ancienne utilisant l'accent grave.
wcd ()
{
cd "`$HOME/bin/wcd.exe -j $@`"
}
Sur les systèmes Windows, si l'interface système 4NT est utilisée, il est alors possible de faire l'alias suivant :
alias wcd `cd %@execstr[wcdwin32.exe -z 0 -j %1]`
Cette méthode supprime la nécessité d'un script « go », et il est donc possible de combiner l'option -GN avec l'option -j.
-k, --keep-paths
Garder les chemins.
Conserver les chemins dans le fichier d'arborescence lorsque wcd ne peut s'y déplacer. Le comportement par défaut de wcd est d'essayer de supprimer les chemins du fichier d'arborescence lorsque wcd ne peut s'y rendre. Cette option désactive ce comportement.
-K, --color
Utiliser les couleurs en mode graphique.
-l ALIAS
Nommer le chemin courant avec ALIAS. Wcd ajoute le chemin courant avec ALIAS pour alias dans le fichier d'alias. Les alias sont sensibles à la casse.
-ls
Afficher le nom du fichier d'alias et lister tous les alias.
-m REP
Créer un répertoire et l'ajouter au fichier d'arborescence.
-L, --license
Afficher la license de distribution.
-M REP
Créer un répertoire et l'ajouter au fichier d'arborescence supplémentaire.
-n CHEMIN
Lire le fichier d'arborescence relative depuis CHEMIN.
Ne pas lire le fichier d'arborescence par défaut. Le fichier d'arborescence relative doit avoir été créé en utilisant l'option +S de wcd. CHEMIN peut également référencer directement un fichier.
Un exemple. Supposons qu'un autre système ait été monté au point de montage /mnt/network :
wcd -n /mnt/network src
Wcd ouvre le ficher d'arborescence relative dans /mnt/network/. Le fichier contient les chemins relatifs depuis cet endroit.
+n CHEMIN
Lire le ficher d'arborescence relative en plus du fichier d'arborescence par défaut. Voir l'option -n.
-N, --numbers
Utiliser des nombres à la place de lettres.
Wcd avec une interface basée sur conio ou curses (voir la section Interfaces) affiche une liste de correspondances indexées par des lettres par défaut. Lorsque l'option -N est utilisée, la liste de correspondances est indexée par des nombres. Indépendamment de l'option -N, il est possible d'entrer une lettre ou un nombre pour effectuer une sélection dans la liste de correspondances.
-o
Utiliser l'interface stdin/stdout.
Lorsque l'interface conio ou curses de wcd ne fonctionne pas pour quelque raison que ce soit, il est possible de se rabattre sur l'interface stdin/stdout de wcd en utilisant l'option -o.
-od, --to-stdout
Décharger l'ensemble des correspondances dans stdout.
-q, --quiet
Fonctionnement plus silencieux. L'affichage de la dernière correspondance est supprimé.
-r REP
Supprimer un répertoire et le supprimer du fichier d'arborescence.
Si le répertoire est vide, wcd le supprimera et tentera de le supprimer du fichier d'arborescence.
-rmtree REP
Supprimer un répertoire de façon récursive et le supprimer du fichier d'arborescence.
Wcd supprimera le répertoire ainsi que tous ses sous-répertoires et fichiers et supprimera ces répertoires du fichier d'arborescence.
-s
(ré)Examiner le disque depuis le répertoire HOME. Si HOME n'est pas défini, le disque est examiné depuis le répertoire racine /.
Le fichier d'arborescence par défaut existant est écrasé.
Le répertoire d'examen par défaut peut être renversé par la variable d'enrivonnement WCDSCAN. Voir la section VARIABLES D'ENVIRONNEMENT .
-S CHEMIN
Examiner l'arbre de répertoires depuis CHEMIN et écraser le fichier d'arborescence par défaut. Voir aussi les options -A, -s et -E. Par exemple, avec l'option -A il est possible de créer un fichier d'arborescence par défaut de votre choix. Exemples :
Unix :
wcd -S /
wcd -S /home -A /etc -A /usr
DOS / Windows :
wcd -S c:/
wcd -S c: -A d: -A \\serveur\partage
Avec les versions Windows, il est possible d'examiner tous les répertoires partagés d'un serveur LAN Windows en entrant une commande similaire à :wcd -S \\nomserveur.
+S CHEMIN
Examiner le disque depuis CHEMIN et placer les chemins relatifs dans un fichier d'arborescence relative. Ce fichier est utilisé par les options -n et +n de wcd. Par exemple wcd -n CHEMIN src.
-t
Ne pas éviter le dossier de montage temporaire /tmp_mnt (Unix uniquement).
Par défaut, wcd retire /tmp_mnt/ des correpondances. Le répertoire /tmp_mnt est utilisé par le montage automatique. Ce comportement peut être évité avec l'option -t.
-T, --ascii-tree
Dessiner l'arbre avec des caractères ASCII. Utiliser cette option si les caractères de dessin de ligne ne s'affichent pas correctement dans le terminal.
-Ta, --alt-tree-nav
Navigation alternative dans l'arbre graphique.
Dans la disposition d'arbre du style par défaut du NCD, l'option -Ta désactive le saut vers des répertoires sans liens.
Dans le mode d'arbre compact, le mode alternatif rend la navigation similaire à celle de gestionnaires de fichiers graphiques tels que Windows Explorer ou Linux KDE Konqueror. L'appui sur les touches Haut et Bas déplace le dossier sélectionné d'une ligne vers le haut ou le bas. Le premier appui sur la touche Gauche replie les sous-dossiers, le second se déplace réellement à gauche.
Il est possible de basculer à la volée entre une navigation par défaut et alternative en pressant <Shift-A>.
Lorsque le mode de navigation alternative est activé, un « A » est visible dans l'angle inférieur droit.
-TC, --center-tree
Vue centrée dans l'arbre graphique. Le répertoire choisi reste au centre de l'écran. Le mode centré peut aussi être activé/désactivé avec la clef <t> dans l'arbre graphique.
Le comportement non centré standard, qui minimise le mouvement d'arbre, est identique à celui du NCD original.
-Tc, --compact-tree
Par défaut l'arbre « graphique » est dessiné de la même façon que le faisait le NCD original sur DOS. Sur DOS, un chemin de répertoire ne pouvait faire que 66 caractères au total. Avec les structures de répertoire profondes comtemporaines, l'arbre peut devenir très large. Pour surmonter cela, wcd peut dessiner l'arbre d'une façon compacte, de façon similaire à la plus part des gestionnaires de fichier graphiques, avec un seul fichier par ligne. Utiliser l'option -Tc ou basculer à la volée avec la clef <m>.
-Td, --cjk-width
Les polices CJK d'Asie de l'Est (Chine, Japon et Corée) possèdent certains caractères et symboles de tracé de ligne avec une largeur de colonne de 2, alors que la largeur Unicode normale pour ces caractères est de 1 colonne. Par exemple, la police de trame CP936 chinoise sur Windows et la police Simsun. Utiliser cette option lorsqu'une police de type CJK est utilisée pour obtenir un contour de l'arbre graphique correct.
Lorsque le mode CJK est actif, un « C » est affiché dans le coin inférieur droit.
-u UTILISATEUR
Examiner le fichier d'arborescence d'un autre utilisateur en se basant sur UTILISATEUR et ne pas examiner votre propre fichier d'arborescence. Voir aussi WCDUSERHOME dans la section VARIABLES D'ENVIRONNEMENT.
Sur Unix/Cygwin le répertoire racine pour les répertoires utilisateur est supposé être /home. Wcd recherchera /home/UTILISATEUR/.treedata.wcd et /home/UTILISATEUR/.wcd/.treedata.wcd, dans cet ordre, lira le premier fichier existant et lisible. Sur DOS/Windows le répertoire racine pour les répertoires utilisateur est supposé être \\users, donc wcd tentera de lire\\users\UTILISATEUR\treedata.wcd et \\users\UTILISATEUR\.wcd\treedata.wcd.
+u UTILISATEUR
Lire le fichier d'arborescence par défaut de l'UTILISATEUR en plus de votre fichier d'arborescence.
-v, --verbose
Afficher les messages verbeux. Avec cette option wcd affiche tous les filtres, les bannissements et les exclusions.
-V, --version
Afficher les informations de version et sortir.
-w, --wild-match-only
Correspondance générique seulement. Traiter toutes les correspondances comme des correspondances génériques.
-x CHEMIN
Exclure CHEMIN de l'examen.
Lorsque cette option est utilisée, wcd exclu le CHEMIN et tous ses sous-répertoires lors de l'examen d'un disque. Les caractères génériques sont pris en charge et mis en correspondance avec les chemins absolus. L'option -x peut être utilisée plusieurs fois.
wcd -x <chemin1> -x <chemin2> -s
L'option -x doit être utilisée avant toute option d'examen (-s, -S, +S, -A, -E).
Sur les systèmes DOS/Windows la précision de la lettre de lecteur dépend de l'utilisation ou non des variables d'environnement HOME ou WCDHOME. Si HOME ou WCDHOME sont fixées alors il faut préciser la lettre du lecteur. Par exemple :
wcd -x c:/temp -S c:
Sinon, il n'est pas nécessaire de préciser la lettre de lecteur.
wcd -x /temp -s
-xf FICHIER
Exclure de l'examen tous les chemins listés dans FICHIER.
Lorsque cette option est utilisée, wcd excluera tous les chemins listés dans FICHIER et tous leurs sous-répertoires durant l'examen d'un disque. Les caractères génériques sont pris en charge et ils sont mis en correspondance de chemins absolus ; un chemin par ligne. Il faut être attentif au fait que wcd n'ignore pas les espaces commençant et terminant une ligne parce qu'il s'agit de caractères légaux pour un nom de répertoire. L'option -xf peut être utilisée plusieurs fois. Lorsque l'exclusion de tous les chemins bannis est souhaitée, il est possible de faire de la sorte (exemple pour wcd sur unix) :
wcd -xf ~/.ban.wcd -s
Les caractères génériques sont pris en charge. Par exemple, pour exclure tous les répertoires Subversion contenant des fichiers d'administration, ajoutez une ligne avec */.svn.
L'option -xf doit être utilisée avant toute option d'examen (-s, -S, +S, -A, -E).
-y, --assume-yes
Supposer Oui pour toutes les requêtes.
Wcd ne posera pas de questions oui/non à l'utilisateur, mais suppose qu'il répondra oui à toutes les questions. Cela peut être utilisé en combinaison de l'option -rmtree. Cette option doit être utilisée avant les options qui peuvent déboucher à des questions oui/non.
-z NOMBRE
Fixer la taille maximale de la pile à NOMBRE.
La taille par défaut de la pile est de 10. Les opérations sur la pile peuvent être désactivées en paramètrant la taille à 0. Cette option doit être utilisée avant toute autre option d'opération sur la pile (-,+,=). Autrement, la taille de la pile sera remise à sa valeur par défaut, 10.
Une commande correcte est :
wcd -z 50 -
La nouvelle taille de pile sera de 50, wcd ira un répertoire en arrière. Un commande erronée est :
wcd - -z 50
Wcd va en arrière d'un répertoire, la pile à une valeur par défaut de 10. Le -z 50 est ignoré.
Ajouter cette option en première option de votre alias ou fonction wcd. Un exemple pour l'interface d'administration compatible POSIX serait :
Empiler les répertoires NOMBRE de fois. La valeur par défaut étant de un.
Retourner en arrière d'un répertoire. La commande <wcd -> retourne en arrière d'un répertoire. Y ajouter un nombre pour retourner en arrière de plusieurs répertoires. Exemple :wcd -3. La pile est cyclique.
+[NOMBRE]
Dépiler les répertoires NOMBRE fois. Un par défaut.
Avancer d'un répertoire. La commande wcd + avance d'un répertoire. Y ajouter un nombre pour avancer de plusieurs répertoires. Par exemple :wcd +2. La pile est cyclique.
=
Afficher la pile.
Utiliser cette option si vous ne savez plus de combien de fois empiler ou dépiler. La pile est affichée et il est possible de choisir un nombre. La position courante de la pile est désignée par une astérisque *.
INSTALLATION
Le répertoire de travail courant d'une interface système Unix ne peut être changé que par la commande intégrée cd(1). Le programme est donc toujours appelé par une fonction ou un alias. La fonction ou l'alias incluent un script d'interface système (script « go ») qui est généré par le programme wcd. Wcd ne peut fonctionner qu'après que la fonction ou l'alias aient été définis.
Un autre impact important de votre installation est la définition des variables d'environnement HOME and WCDHOME. Voir la section VARIABLES D'ENVIRONNEMENT.
Installation pour les interfaces système de type POSIX
Pour les interfaces système POSIX (ksh, bash, zsh, etc.) sur Unix, Linux, Cygwin ou MSYS natif, ajouter la fonction suivante au fichier de démarrage de l'interface système (Bash utilise par exemple $HOME/.bashrc) :
Remplacer CHEMIN par l'emplacement où l'exécutable de wcd a été installé. Recharger le fichier d'initialisation de l'interface système ou démarrer une nouvelle interface système.
L'emplacement du script « go »wcd.go diffère par interface système.
Wcd pour les interfaces système DOS DJGPP et OS/2 exige une fonction différente. Le script « go » n'est pas écrit dans un répertoire bin, et si WCDHOME et HOME sont toutes deux non définies, le script « go » est écrit sur c:/.
Voir la section FICHIERS pour plus d'informations.
Installation pour les interfaces système de type C (csh, tcsh)
Ajouter les alias suivants au fichier de démarrage de l'interface système $HOME/.cshrc ou $HOME/.tcshrc :
if ( ${?WCDHOME} ) then
alias wcd "PATH/wcd.exe \!* ; source $WCDHOME/bin/wcd.go"
else
alias wcd "CHEMIN/wcd.exe \!* ; source $HOME/bin/wcd.go"
endif
Remplacer CHEMIN par l'emplacement où l'exécutable de wcd a été installé. Recharger le fichier d'initialisation de l'interface système ou démarrer une nouvelle interface système.
Version de l'Invite de Commande Windows
Dépaqueter le fichier zip et ajouter le répertoire bin à votre variable d'environnement PATH.
Dans Windows Command Prompt, un programme Windows ne peut pas changer de répertoire de travail courant, mais un fichier .bat le peut. Le script de commande wcd.bat exécute le programme wcd qui génère un nouveau fichier de commande wcdgo.bat. wcd.bat et exécute ensuite wcdgo.bat qui change effectivement de répertoire.
Windows VISTA et ultérieur
Dans un Commande Prompt Windows Vista ou de niveau plus haut, l'accès aux répertoires peut être limité. Pour avoir accès à plus de répertoires des droits administrateurs sont requis. Il est possible d'obtenir un Commande Prompt avec des droits administrateurs en cliquant avec le bouton droit sur l'icône du Commande Prompt puis en choisissant Exécuter en tant qu'administrateur.
Version Windows PowerShell
Ajouter la fonction suivante à votre profil utilisateur PowerShell. L'emplacement de ce profil est stocké dans la variable $profile. Il est requis que l'une des deux variables d'environnement HOME et WCDHOME soit définie.
function wcd
{
CHEMIN\wcdwin32psh.exe $args
& $env:HOME\wcdgo.ps1
}
Remplacer CHEMIN avec l'emplacement où l'exécutable de wcd a été installé. Démarrer un nouveau PowerShell. Wcd pour PowerShell prend uniquement en charge le fournisseur de système de fichier. Pas d'autres fournisseurs.
Version OS/2 Command Prompt
Dans un OS/2 Command Prompt (cmd.exe) un programme OS/2 ne peut pas changer de répertoire de travail courant. C'est pourquoi wcd génère un script de commande wcdgo.cmd qui doit être exécuté dans l'interface système actuelle. Le script wcd.cmd exécute dans un premier temps wcdos2.exe qui crée le script wcdgo.cmd. Ensuite wcd.cmd exécute le script wcdgo.cmd.
LOCALISATION
LANG
Le langage principal est sélectionné avec la variable d'environnement LANG. Cette variable est composée de plusieurs parties. La première partie, en lettres minuscules, est le code de la langue. La seconde, optionnelle et en lettres majuscules, est le code du pays précédé d'un tiret bas. Il y a également une troisième partie optionnelle : l'encodage des caractères, précédé par un point. Quelques exemples pour les interfaces système conforme au standard POSIX :
export LANG=fr Français
export LANG=fr_FR Français, France
export LANG=fr_BE Français, Belgique
export LANG=es_ES Espagnol, Espagne
export LANG=es_MX Espagnol, Mexique
export LANG=en_US.iso88591 Anglais, USA, encodage Latin-1
Avec la variable d'environnement LANG, il est possible de spécifier une liste de priorité de langues séparées par des virgules. Wcd donne une préférence à LANGUAGE sur LANG. Par exemple, d'abord néerlandais puis allemand :LANGUAGE=nl:de. Il faut d'abord activer la localisation en fixant LANG ou LC_ALL à une valeur autre que C avant de pouvoir utiliser un liste de priorités de langue avec la variable LANGUAGE. Voir aussi le manuel de gettext(1) :http://www.gnu.org/software/gettext/manual/gettext.html#The-LANGUAGE-variable
Si vous sélectionnez un langage qui n'est pas disponible, les messages seront affichés en anglais standard.
WCDLOCALEDIR
La variable d'environnement WCDLOCALEDIR prévaut sur la variable LOCALEDIR utilisée pendant la compilation et l'installation de wcd. LOCALEDIR est utilisée par wcd avec prise en chage de langage natif pour trouver les fichiers de langue. La valeur par défaut pour GNU est /usr/local/share/locale. En tapant wcd -V, wcd affichera la variable LOCALEDIR utilisée.
Si vous avez installé wcd dans un répertoire différent du répertoire par défaut, il vous faut peut être définir la variable d'environnement WCDLOCALEDIR pour pointer vers le répertoire de locales.
Un exemple pour le cmd Windows :
set WCDLOCALEDIR=c:/my_prefix/share/locale
Un example pour une interface système POSIX :
export WCDLOCALEDIR=$HOME/share/locale
LC_COLLATE
Lorsque plusieurs répertoires correspondent, wcd affiche une liste triée. L'ordre dépend des paramètres de locale. Si la variable d'environnement LANG a été définie, les correspondances sont triées comme les sont les dictionnaires ou les annuaires téléphonique dans cette langue. Par exemple, les points et les tirets sont ignorés, ou bien les lettres e avec ou sans accent sont identiques, ou bien la casse est ignorée.
Le tri donne préférence à la variable d'environnement LC_COLLATE devant LANG. Si vous rendez LC_COLLATE égal à C ou POSIX, le tri selon la locale est désactivé. Par exemple, si vous voulez du néerlandais mais un tri que n'est pas néerlandais, vous pouvez faire de la sorte :
export LANG=fr_FR
export LC_COLLATE=C
LC_CTYPE
En ce qui concerne l'encodage de caractères, wcd donnera une préférence à la variable LC_CTYPE sur la variable LANG. Par exemple, pour fixer l'encodage de caractères en UTF-8, le paramètrage de l'environnement suivant peut être appliqué.
export LC_CTYPE=fr_FR.UTF-8
LC_ALL
La variable d'environnement LC_ALL si elle est définie, prévaut sur toutes les variables d'environnement de locales qui commencent par LC_. Wcd donnera une préférence à LC_ALL sur LC_COLLATE et LC_CTYPE.
PAGES DE CODES WINDOWS
Il y a deux groupes de page de code : les pages de code DOS (OEM) et les pages de code Windows (ANSI). L'encodage par défaut de Windows, lorsqu'il est configuré avec les paramètres de régions occidentales, est ANSI CP1252. Les programmes Windows, par exemple le bloc-notes, utilisent cette page de code ANSI par défaut. La console Windows utilise par défaut une page de code OEM (CP437 ou CP850) pour compatibilité avec les programmes DOS. Si vous utilisez une version DOS de wcd dans une console Windows, cela marchera grâce à la page de code DOS. Cependant la version DOS de wcd ne prend pas en charge de longs noms de répertoire et de lecteur réseau sur Windows.
La version Windows de wcd est un programme Windows natif et utilise la page de code ANSI du système Windows. Donc sur un Windows configuré pour une région occidentale la page de code CP1252 est utilisée pour les noms de répertoire et les messages. Dans le but d'obtenir des sorties uniformes, indépendantes des pages de code actives, toutes les versions de Wcd pour Windows traduisent les sorties ANSI en sorties Unicode dans le Command Prompt et le PowerShell.
La police de trame de la console ne prend en charge que la page de code OEM installée avec Windows, et il faut donc changer la page de code de la console à Lucidia Console correctement typé pour faire apparaître les lettres Unicode (et ANSI) correctement.
Les versions non-Unicode de Wcd avant la version 5.2.0 utilisent une sortie entièrement ANSI. Pour ces anciennes versions, la page de code de la console a été faite pour être identique à la page de code du système (changé à 1252) dans le but de faire fonctionner wcd pour Windows correctement avec des caractères spéciaux tels que les caractères avec accent ou le symbole de l'Euro.
La page de code Windows peut être changée via les options de région du Panneau de Contrôle. La page de code de la console Windows est changée avec la commande chcp.
Lorsque vous tapez wcd -V, l'encodage de caractères effectif utilisé par wcd est affiché. Tapez la commande chcp pour afficher la page de codes active de la console Windows.
UNICODE
Wcd a une prise en charge optionnelle de l'Unicode. Pour voir si wcd a été empaqueté avec la prise en charge de l'Unicode, tapez wcd -V. Si votre terminal/console et la police le prend en charge, vous devriez voir le symbole de l'Euro ainsi que des caractères chinois (voulant dire :« chinois »).
Wcd a été converti de façon logicielle à l'Unicode. En son coeur, Wcd traite toutes les données comme un flux d'octets. Seules les lignes affichées à l'écran sont converties à la volée en caractères Unicode larges. Wcd s'appuie entièrement sur des fonctions de la libc et n'a pas de code UTF-8 spécifique. Voir aussi http://www.cl.cam.ac.uk/~mgk25/unicode.html.
Wcd a une prise en charge optionnelle de mise en correspondance avec de l'Unicode normalisé. Pour déterminer si Wcd prend en charge la normalisation, tapez wcd -V. Wcd avec une prise en charge de la normalisation Unicode fera correspondre les noms Unicode en se basant sur une équivalence compatible. Sans prise en charge de la normalisation Unicode, les noms sont mis en correspondance lorsque leur binaires sont équivalents. Voir aussi http://en.wikipedia.org/wiki/Unicode_normalization
UTF-8 sur Unix/Linux
Pour voir les caractères UTF-8, votre console/terminal doit également prendre en charge l'UTF-8. La version xterm empaquetée avec XFree86 4.0 ou supérieur inclue une prise en charge de l'UTF-8. Pour l'activer, démarez xterm(1) dans une locale UTF-8 et utilisez une police avec un encodage iso10646-1, par exemple avec
Les distributions modernes de GNU/Linux prennent en charge l'UTF-8 par défaut. D'autres encodages de caractères sur plusieurs octets devraient également fonctionner, mais cela n'a pas été testé.
Wcd suppose que les fichiers d'arborescence sont encodés dans l'encodage de caractères local. Il n'y a pas d'Indicateur d'Ordre des Octets écrit dans les fichiers d'arborescence.
UTF-16 sur Windows
Sur Windows, l'Unicode est pris en charge pour toutes les versions de PowerShell, et dans le Windows Command Prompt sur Windows 7 (ou ultérieur). Unicode fonctionne également dans Take Command ou TCC/LE édités par JP Software, et pouvant être utilisés sur des version de Windows plus anciennes (XP/Vista).
Sur Windows, tous les noms de répertoire sur le disque sont encodés en Unicode UTF-16. Pour des programmes Windows non Unicode, les caractères Unicode sont traduits vers la page de code ANSI par défaut. Cette traduction de caractères ne faisant pas partis du paramètrage régional n'est pas possible et les programmes non Unicode affichent un point d'intérogation ou bien un mauvais caractères.
Wcd avec prise en charge de l'Unicode lit les noms de répertoire encodé en UTF-16 et les convertis de façon interne en UTF-8. Tous les fichiers d'arborescence sont encodés en UTF-8 et ne sont pas compatibles avec la version non Unicode de Wcd. Wcd créera un script « go » en UTF-8.
Toutes les versions de Windows PowerShell sont capable d'exécuter des scripts encodés en UTF-8 s'il y a un BOM UTF-8 dans le script.
Depuis Windows 7 il est possible de changer de répertoire avec un script batch dans Windows Command Prompt vers un répertoire avec une lettre Unicode dans le nom. Le nom du répertoire doit être encodé en UTF-8, et le script batch ne doit pas avoir de BOM. La page de code active du Command Prompt doit être fixée à 65001 (UTF-8) avant la commande cd. Wcd pour Command Prompt créera un script « go »wcdgo.bat. Dans un premier temps, il change la page de code à 65001 puis change de répertoire et enfin fixe la page de code à sa valeur initiale.
Vous devez fixer la police à True Type Lucida Console (et non une police de trame) lorsque les lettres n'apparaîssent pas correctement.
La version pour Windows non Unicode de Wcd peut lire des fichiers d'arborescence Unicode depuis la version 5.2.0 s'il y a un Indicateur d'Ordre des Octets (BOM) dans le fichier (voir https://fr.wikipedia.org/wiki/Indicateur_d%27ordre_des_octets), mais il ne peut se déplacer vers des répertoires dont le nom contient des lettres Unicodes et qui ne font pas parties de la page de code ANSI par défaut du système. La version pour Windows non Unicode écrit un BOM dans les fichiers d'arborescence encodés en UTF-8 depuis la version 5.2.0, ce qui les rend également lisible par le bloc-notes.
UTF-8 sur Cygwin
Cygwin prend en charge l'Unicode depuis la version 1.7. La couche Cygwin s'occupe de la conversion des noms Unicode UTF-16 Windows en UTF-8. Donc des programmes tels que Wcd n'ont pas besoin de savoir cela et peuvent fonctionner en utilisant l'encodage UTF-8 sur Unix/Linux. Fixez l'encodage de caractères à UTF-8 avec les variables d'environnement LANG ou LC_CTYPE. Il peut être nécessaire de réexaminer les disques. Il faut fixer la police à True Type Lucida Console (et non à une police de trame) si vous utilisez la console Cygwin par défaut.
La version Cygwin se comporte de la même façon que la version Unix de wcd. Il n'y a pas de BOM écrit dans les fichiers d'arborescence, et il est supposé qu'ils sont encodés dans l'encodage de caractères de la locale Cygwin.
FICHIERS
Si la variable d'environnement WCDHOME est définie, wcd utilisera WCDHOME au lieu de HOME. Tous les fichiers *.wcd sont des fichiers texte. Ils peuvent être modifiés avec un éditeur de texte. La version Windows Command Prompt de wcd se comporte comme la version DOS. La version Cygwin de wcd se comporte comme la version Unix.
wcd.exe
Le programme. Dans les interfaces système Unix, le programme est toujours appelé par une fonction ou un alias parce que le répertoire courant de travail d'une interface système Unix ne peut être changé que par la commande cd intégrée. Voir également la section INSTALLATION.
fichier d'arborescence par défaut
C'est le fichier d'arborescence par défaut où wcd cherche les correspondances. S'il n'est pas lisible, wcd en créera un nouveau.
S<DOS :> \treedata.wcd ou %HOME%\treedata.wcd
S<Unix :> $HOME/.treedata.wcd
fichier d'arborescence supplémentaire
Un fichier d'arborescence supplémentaire optionel. S'il existe et est lisible, wcd tentera de trouver des correspondances depuis ce fichier également.
S<DOS :> \extra.wcd ou %HOME%\extra.wcd
S<Unix :> $HOME/.extra.wcd
fichier de bannissement
Wcd place dans ce fichier optionnel les chemins bannis. Voir l'option -b. Les caractères génériques sont pris en charge.
S<DOS :> \ban.wcd ou %HOME%\ban.wcd
S<Unix :> $HOME/.ban.wcd
fichier d'alias
Fichier optionnel avec les alias wcd. Voir l'option -l.
S<DOS :> \alias.wcd ou %HOME%\alias.wcd
S<Unix :> $HOME/.alias.wcd
fichier de pile
Wcd stocke sa pile dans ce fichier. La lettre de lecteur peut être changée avec l'option -d.
S<DOS :> c:\stack.wcd ou %HOME%\stack.wcd
S<Unix :> $HOME/.stack.wcd
Le nom du fichier de pile peut être changé avec la variable d'environnement WCDSTACKFILE. Voir la section VARIABLES D'ENVIRONNEMENT.
script « go »
C'est le script d'interface système que wcd.exe crée à chaque fois. Il est inclus par une function ou un alias. La lettre de lecteur peut être changée avec l'option -d. Pour des raisons historiques, il est placé dans $HOME/bin par défaut sur les systèmes Unix. Le répertoire de ce fichier peut être changé avec l'option -G.
interface système S<DOS :> c:/wcd.go or $HOME/wcd.go
Windows Command S<Prompt :> c:\wcdgo.bat or %HOME%\wcdgo.bat
Windows S<PowerShell :> $env:HOME\wcdgo.ps1
S<WinZsh :> $HOME/wcd.go
S<Cygwin/MSYS :> $HOME/bin/wcd.go
OS/2 Command S<Prompt :> c:\wcdgo.cmd or %HOME%\wcdgo.cmd
interface système S<OS/2 :> c:/wcd.go or $HOME/wcd.go
S<Unix :> $HOME/bin/wcd.go
fichier d'arborescence relative
Fichier texte avec les chemins relatifs à REP. Voir les options +S, -n et +n.
Wcd utilise par défaut la variable d'environnement HOME pour déterminer où stocker ses fichiers. Voir également la section FICHIERS. Cela peut être modifié avec la variable d'environnement WCDHOME.
HOME définit également où commencer l'examen du disque lorsque l'option -s est utilisée. Ceci peut être modifié avec la variable d'environnement WCDSCAN.
Pour la version Unix, Cygwin, Windows PowerShell, WinZsh et MSYS, il est nécessaire que HOME ou WCDHOME soient définies. L'utilisation de ces variables est optionnelle pour les autres versions de wcd.
Si HOME est défini sur DOS/Windows, wcd placera tous ses fichiers (treedata.wcd, extra.wcd, alias.wcd, ban.wcd, wcd.go) dans le répertoire HOME. Le comportement de wcd est alors identique à celui de la version Unix de wcd. Wcd examinera le disque depuis HOME par défaut. Les lecteurs ne seront pas automatiquement examinés lors d'un basculement. Vous devez explicitement le demander à wcd. Par exemple :
wcd -S c: -A d: -A e:
La correspondance des répertoires est maintenant globale à tous les lecteurs examinés.
WCDHOME
La variable d'environnement WCDHOME peut être utilisée pour changer l'emplacement des fichiers de wcd. Si HOME et WCDHOME sont toutes deux définies, WCDHOME sera utilisée à la place de HOME.
Dans les versions antérieures à la version 5.1.5, WCDHOME changeait également le répertoire d'examen par défaut. Cela a été modifié. Depuis la version 5.1.5, WCDHOME ne modifie pas le répertoire d'examen par défaut. Voir l'option -s. Depuis la version 5.1.5, la variable d'environnement WCDSCAN peut être utilisée pour modifier le répertoire d'examen par défaut.
Exemple pour DOS, Windows, OS/2 Command Prompt :
set WCDHOME=C:\Utilisateurs\erwin\wcd
Un exemple pour les interfaces système POSIX :
export WCDHOME="$HOME/.wcd"
Un exemple pour les interfaces système Csh :
setenv WCDHOME "$HOME/.wcd"
WCDSCAN
Utilisez la variable d'environnement WCDSCAN pour modifier le répertoire d'examen par défaut HOME. Une liste séparée par des virgules (Unix) peut être utilisée pour spécifier plusieurs répertoires. Sur DOS/Windows, la liste doit être séparée par des point-virgules.
Exemples pour DOS, Windows, OS/2 Commande Prompt :
set WCDSCAN=C:\Utilisateurs\erwin;D:\donnees
set WCDSCAN=%HOMELECTEUR%%HOMECHEMIN%;\\lecteurprojet\projetX
Un exemple pour les interfaces système POSIX :
export WCDSCAN="$HOME:/disqueprojet/projetX"
Un exemple pour les interfaces système Csh :
setenv WCDSCAN "$HOME:/disqueprojet/projetX"
WCDFILTER
Spécifiez des filtres avec la variable d'environnment WCDFILTER. Tous les répertoires qui ne correspondent pas au(x) filtre(s) sont ignorés. Une liste peut être données en séparant les filtres avec le séparateur de chemin de l'interface système, de façon similaire à la définition de la variable PATH. La sensibilité à la casse est dictée par le système d'exploitation.
Un exemple pour DOS, Windows, OS/2 Commande Prompt :
set WCDFILTER=projets;doc
Un exemple pour les interfaces système POSIX :
export WCDFILTER="projets:doc"
Un exemple pour les interfaces système Csh :
setenv WCDFILTER "projets:doc"
WCDBAN
Les chemins spécifiés par la variable d'environnement WCDBAN seront bannis par wcd. Voir aussi l'option -b. Donnez une liste de chemins séparés par le séparateur de l'interface système utilisé pour PATH.
WCDEXCLUDE
Les chemins spécifiés par la variables d'environnement WCDEXCLUDE seront exlus par wcd. Voir aussi les options -x et -xf. Donnez une liste de chemins séparés par le séparateur de l'interface système utilisé pour PATH.
Un exemple pour DOS, Windows, OS/2 Commande Prompt :
set WCDEXCLUDE=*/windows;*/temp;*CVS
Un exemple pour les interfaces système POSIX :
export WCDEXCLUDE="/dev:/tmp:*CVS"
Un exemple pour les interfaces système Csh :
setenv WCDEXCLUDE "/dev:/tmp:*CVS"
WCDUSERSHOME
Défini la racine des répertoires d'utilisateur. Sur DOS/Windows, la valeur par défaut est \\users. Sur Unix/Cygwin, la valeur par défaut est /home. Cette variable est utilisée pour examiner les fichiers d'arborescence d'autres utilisateurs. Voir les options -u et +u. En mode verbeux, wcd imprimera tous les filtres, bannissements et exclusions. Voir l'option -v.
WCDSTACKFILE
Wcd donne une préférence à WCDSTACKFILE sur le nom du fichier de pile par défaut (voir la section FICHIERS). Avec cette variable, chaque interface système (ou émulateur de terminal) peut avoir sa pile privée de répertoires utilisés.
Pour utiliser un fichier YYYYMMDD-HHMMSS unique basé sur le temps pour chaque interface système intéractive ouverte.
Pour une pile par xterm(1), utiliser la variable d'environnement xterm WINDOWID :
export WCDSTACKFILE=$HOME/.wcd/stack.$WINDOWID
Pour GNU screen(1), pour utiliser une pile par écran :
export WCDSTACKFILE=$HOME/.wcd/stack.$WINDOW
TERMINFO
Si la variable d'environnement TERMINFO est définie, wcd avec l'interface ncurses recherche une définition de terminal localement avant de le faire à l'emplacement standard. Cela est utile si les définitions du terminal ne sont pas dans un emplacement standard. Les emplacements couramment utilisés sont /usr/lib/terminfo et /usr/share/terminfo.
PDC_RESTORE_SCREEN
Wcd avec l'interface PDCurses reconnaît la variable d'environnement PDC_RESTORE_SCREEN. Si cette variable d'environnement est définie, PDCurses fera une copie du contenu de l'écran au moment au wcd est démarré ; lorsque wcd quitte, l'écran sera restauré. Un exemple pour Windows Command Prompt :
set PDC_RESTORE_SCREEN=1
Windows n'autorise la sauvegarde que d'un petit tampon. Il n'est donc pas toujours possible de tout restaurer. Des données inutiles peuvent être affichées dans la console après que wcd ait terminé si vous avez défini une largeur de tampon importante.
SHELL
L'impression de #!$SHELL sur la première ligne du script « go » est nécessaire pour une interface système de type POSIX pour les caractères de 8 bits. Certaines interfaces système considèrent autrement que le script « go » est un fichier binaire et ne l'incluerons pas. Dans Cygwin bash, la variable SHELL doit être définie dans l'environnement en utilisant la commande export, sinon wcd ne peut pas lire cette variable.
BASH
Wcd pour l'interface système DOS utilise $BASH à la place de $SHELL parce que $SHELL pointe vers l'interface de commandes système. Il est potentiellement requis de définir $BASH avec une commande export, autrement wcd ne peut pas lire la variable.
wcd-6.0.5/src/man/fr/man1/wcd.txt 0000644 0001755 0001001 00000161675 14421240107 015704 0 ustar waterlan Geen NOM
wcd - Wherever Change Directory
chdir pour DOS et Unix.
SYNOPSIS
wcd [options] [répertoire]
DESCRIPTION
Présentation
Wcd est un logiciel en ligne de commande permettant de changer de
répertoire rapidement. Il permet de gagner du temps d'écriture au
clavier. Un utilisateur n'a besoin de taper qu'une partie du nom d'un
répertoire et wcd s'y déplacera. Wcd a une méthode de sélection rapide
lors de multiples correspondances et permet l'alias et le bannissement
de répertoires. Wcd inclus également un navigateur d'arborescence de
fichiers intéractif en mode plein écran et avec recherche rapide.
Wcd a été construit sur le modèle du Norton Change Directory (NCD). NCD
est apparu pour la première fois dans *The Norton Utilities, Release 4*,
pour DOS en 1987 et publié par Peter Norton.
Wcd a été adapté à différentes interfaces système en ligne de commande :
DOS command.com, Windows cmd.exe et PowerShell, OS/2 cmd.exe, et aux
interfaces système Unix telles que Bourne (sh), Bourne Again (bash),
Korn (ksh), Z (zsh), et C (csh) ainsi qu'à d'autres fonctionnant sur
tout système d'exploitation.
Wcd prend en charge les ensemble de caractères 8 bits sur tous les
systèmes, et prend en charge l'Unicode de façon optionnelle. Voir la
section LOCALISATION.
Voir la section INSTALLATION pour mettre en place wcd dans le cas d'un
usage personnel.
Utilisation basique
Par défaut (si aucun caractère générique n'est utilisé) wcd cherche un
répertoire avec un nom commençant par le nom entré.
Par exemple, cette commande changera vers le répertoire de l'utlisateur
courant "/home/user/Desktop" :
wcd Desk
Lorsqu'il y a plusieurs correspondances, wcd affichera à l'utilisateur
une liste les contenant toutes. L'utilisateur pourra alors faire un
choix avec quelques de frappes clavier (une seule la plus part du
temps).
Caractères génériques
Wcd prend en charge les caractères génériques suivant :
* correspond à toute séquence de caractères (zéro ou plus)
? correspond à n'importe quel caractère
[ENSEMBLE] correspond à n'importe quel caractère dans l'ensemble donné,
[!ENSEMBLE] ou [^ENSEMBLE] correspond à n'importe quel caractère qui n'est pas dans l'ensemble donné.
Un ensemble est composé de caractères ou d'intervalles ; un intervalle
s'écrit *caractère tiret caractère* comme dans "0-9" ou "A-Z".
"[0-9a-zA-Z_]" est l'ensemble minimal de caractères autorisés dans la
construction du motif "[...]". Les caractères internationaux (à savoir
des caractères de 8 bits) sont autorisés si le système les prend en
charge. Pour supprimer le sens syntaxique spécial de n'importe quel
caractère "[]*?!^-\" à l'intérieur ou à l'extérieur d'une construction
"[..]" et ainsi indiquer une correspondance envers le caractère
lui-même, il faut le faire précéder d'une barre oblique inversée ("\").
L'utilisation de caractères génériques rend possible des recherches
complexes. Par exemple, ceci correspond à n'importe quel nom de
répertoire se terminant par « top » :
wcd *eau
Fait correspondre les répertoires qui ont « eau » quelque part dans leur
nom :
wcd *eau*
Fait correspondre n'importe quel nom de répertoire commençant par « a »,
« b » ou « c » :
wcd [a-c]*
Il est également possible de donner une partie du chemin d'un
répertoire. Ici Wcd cherche les répertoires dont le nom commence par
« Bur » et qui dont le chemin correspond à **moi/Bur**.
wcd moi/Bur
Il est possible d'entrer n'importe quel type d'expression avec des
barres obliques et des caractères génériques. Par exemple :
wcd src*/*1?/a*2
Autres utilisations
Si aucun caractère générique n'est utilisé et que wcd trouve une
correspondance parfaite, wcd ignorera toutes les correspondances
génériques par défaut. Ce comportement peut être modifié par l'option
-w.
Le navigateur d'arborescence de répertoire intéractif peut être démarré
en utilisant l'option -g.
wcd -g
Wcd génère un fichier d'arborescence à l'emplacement de la recherche du
répertoire. Sur les systèmes Unix et Windows, wcd ajoute des liens
symboliques vers le fichier d'arborescence lors de l'examem du disque,
mais ne les suit pas. S'il suivait les liens, wcd pourrait en venir à
examiner une boucle infinie, ou de très grandes portions d'un réseau.
Wcd peut également changer vers des répertoires qui ne sont pas dans le
fichier d'arborescence. Par exemple :
wcd ..
Si wcd trouve une correspondance mais ne peut pas aller au répertoire,
il tente alors de le supprimer du fichier d'arborescence par défaut. Pas
du fichier d'arborescence supplémentaire. Voir également l'option -k.
Wcd conserve une pile de répertoires stockée sur le disque. La pile à
une taille par défaut de 10 et est cyclique. Voir les options -z, -, +
et =.
Dans un environnement multi-utilisateurs, l'option -i peut être utilisée
pour se déplacer dans des répertoires d'autres utilisateurs.
Sur les systèmes DOS et Windows, peut importe si vous utilisez la barre
oblique « / » ou la barre oblique inversée « \ » comme séparateur de
répertoires.
Sur les systèmes DOS et Windows, il est possible de changer de lecteur
et de répertoire d'un seul coup en faisant précéder le nom du répertoire
par le nom du lecteur.
wcd d:jeux
chemins Windows UNC
Les versions Windows (Command Prompt, PowerShell, MSYS, zsh, cygwin)
prennent en charge les chemins Windows SMB LAN UNC sans lettre de
lecteur tels que "\\servername\sharename". Wcd pour Windows Command
Prompt utilise la commande « pushd » pour faire correspondre un chemin
UNC à une lettre de lecteur. Dans Windows PowerShell, MSYS, zsh et
Cygwin, les chemins UNC sont pris en charge. Le répertoire de travail
courant peut être un chemin UNC.
Redimensionnement de console sous Windows
Wcd prend en charge le redimensionnement de console dans les consoles
Windows 10 et ConEmu (void ) depuis la
version 6.0.3. La console Windows 10 ne doit pas être dans le mode
hérité (vérifier les propriétés de la console). L'écran peut ne pas être
rafraîchi lorsque la Configuration « Renvoyer automatiquemet à la ligne
le texte en cas de redimensionnement » de la console est désactivée.
L'écran peut être rafraîchi manuellement en pressant la touche F5.
Interfaces
Wcd a trois interfaces pour choisir parmi une liste de correspondances.
L'interface peut être choisie à la compilation.
La première interface utilise simplement stdin/stdout. Une liste
numérotée est affichée dans le terminal. L'utilisateur doit choisir
parmi cette liste en entrant un nombre suivi de la touche .
Cette interface ne fournit pas la fonctionnalité de défilement arrière
lorsque la liste est longue. La fonctionnalité de défilement arrière du
terminal ou de la console doit être utilisée. C'est très petit et
portable.
La seconde interface est basée sur la bibliothèque conio. Elle fournit
une capacité de défilement arrière intégrée. L'utilisateur voit affichée
une liste ordonnée par des lettres. La sélection dans cette liste peut
se faire en pressant une seule lettre. Cette interface est rapide car
elle économise les frappes. Si possible, l'écran sera restauré après
sortie. Utiliser l'option -N si l'utilisation de nombres est préférrée.
La troisième interface est construite avec la bibliothèque curses. Elle
est similaire à l'interface conio. La version curses de wcd a une
interface « graphique » supplémentaire. Elle laisse l'utilisateur
choisir un répertoire via un navigateur plein écran et intéractif
d'arbre de répertoires. Elle a une navigation et une méthode de
recherche similaire à celle de vim(1). Elle peut être activée avec
l'option -g.
En utilisant l'option -o il est toujours possible de revenir à
l'interface stdin/stdout.
OPTIONS
-a Ajouter le chemin courant au fichier d'arborescence par défaut.
Utiliser cette option pour ajouter de façon rapide le chemin courant
au fichier d'arborescence par défaut. Le réexamen complet du disque
peut parfois pendre beaucoup de temps.
-aa Ajouter le chemin courant et tous les chemins parents au fichier
d'arborescence par défaut.
-A CHEMIN
Examiner l'arborescence de répertoires depuis *CHEMIN* et l'ajouter
au fichier d'arborescence par défaut. Exemples :
wcd -A .
wcd -A /home -A /etc
wcd -A d: -A e: -A \\serveur\partage
Sur Windows, il est possible d'examiner tous les répertoires
partagés d'un serveur LAN Windows en entrant quelque chose comme :
Voir également les options -S et -s et -E.
-b Bannir le chemin courant.
Wcd met le chemin courant dans le fichier de bannissements. Cela
signifie que wcd ignore toutes les correspondances de ce répertoire
et de ses sous-répertoires.
Le fichier de bannissements peut être modifié avec un éditeur de
texte. L'utilisation de caractères génériques est prise en charge et
les noms sont mis en correspondance avec le chemin absolu.
Les chemins bannis ne sont pas exclus de l'examen du disque. Pour
cela utiliser l'option -xf.
-c, --direct-cd
Mode CD direct. Par défaut wcd marche de la façon suivante :
1. Essaie de trouver une correspondance dans le(s) fichier(s) d'arborescence
2. S'il n'y a pas de correspondance, essaie d'ouvrir le répertoire que vous avez entré.
En mode CD direct wcd marche en ordre inverse.
1. Essaie d'ouvrir le répertoire que vous avez entré.
2. Sinon, essaie de trouver une correspondance dans le(s) fichier(s) d'arborescence.
-d LECTEUR
Choisir le lecteur pour le fichier de pile et de « go » (DOS
uniquement).
Les fichiers de pile et de script « go » sont stockés sur le lecteur
C: par défaut si la variable d'environnement *HOME* n'est pas
définie. Utiliser cette option si le lecteur C: est un lecteur en
lecture seule. Cette option doit être utilisée devant les options de
pile -, + and =.
-e Ajouter le chemin courant au fichier d'arborescence supplémentaire.
Utiliser cette option pour ajouter rapidement le chemin courant au
fichier d'arborescence supplémentaire.
-ee Ajouter le chemin courant et tous les chemins parents au fichier
d'arborescence supplémentaire.
-E CHEMIN
Examiner l'arborescence de répertoires depuis *CHEMIN* et l'ajouter
au fichier d'arborescence supplémentaire. Voir aussi les options -A
et -S.
-f FICHIER
Lire le fichier d'arborescence *FICHIER*. Ne pas lire le fichier
d'arborescence par défaut.
+f FICHIER
Lire le fichier d'arborescence *FICHIER* en plus du fichier
d'arborescence par défaut.
-g Interface graphique (uniquement pour les versions avec l'interface
curses).
Wcd démarre une interface « graphique » textuelle basée sur curses.
L'utilisateur peut choisir un répertoire via le navigateur d'arbre
de répertoires intéractif en plein écran. Il possède une méthode de
navigation et de recherche similaire à celle de vim(1).
Si aucune chaîne de recherche n'est donnée, wcd affiche l'arbre
entier qui se trouve dans le fichier d'arborescence par défaut ainsi
que dans les fichiers d'arborescence supplémentaires.
Si une chaîne de recherche est donnée, la liste des correspondances
est affichée comme un arbre de répertoires.
La disposition par défaut de l'arbre est similaire à celle du NCD
initial sur DOS. La différence de disposition réside dans le fait
que pour NCD, tous les répertoires de profondeur identique étaient
alignés verticalement sur toute la hauteur de l'arbre. Cela était
possible sous NCD parce que la longueur maximale d'un nom de
répertoire sous DOS était de 12 (8.3) caractères. Les noms de
répertoire pouvant être très longs sur les systèmes d'exploitation
modernes, la différence de longeur peut être importante. De fait,
les dossiers de même profondeur ne sont pas alignés verticalement
sur la totalité de l'arbre dans wcd, mais seulement dans les
sous-branches. Il y a donc des mouvements latéraux lors d'un
déplacement direct vers le haut ou vers le bas depuis une
sous-branche vers une autre sous-branche.
Le comportement de navigation de Wcd est exactement identique à
celui du NCD initial. Par exemple, l'appui sur la touche Bas du
clavier amène au répertoire suivant avec la même profondeur, passant
outre les branches. Cela permet une navigation rapide dans l'arbre.
Voir les options -Ta, -TC, et -Tc pour modifier le comportement de
la navigation.
-gd Décharger les fichiers d'arborescence sous forme d'arbre sur la
sortie standard.
-G CHEMIN
Ecrire le script « go » dans le répertoire *CHEMIN*. Par exemple sur
Unix, "wcd -G CHEMIN" va écrire un fichier de script « go »
CHEMIN/wcd.go.
-GN, --no-go-script
Ne pas créer un script « go ». Cette option peut être utilisée en
association avec l'option -j si la création d'un script « go » n'est
pas désirée.
-h, --help
Afficher l'aide et quitter.
-i, --ignore-case
Ignorer la casse. Les versions Dos et Windows de wcd ignorent la
casse par défaut. Les versions Unix/Cygwin respectent la casse par
défaut.
+i, --no-ignore-case
Respecter la casse. Voir aussi l'option -i.
-I, --ignore-diacritics
Ignorer les caractères diacritiques pour les scripts en Latin. Les
lettres avec des symboles diacritiques correspondent à leur lettre
de base sans ces symboles diacritiques. Les encodages Latin suivant
sont pris en charge : CP437, CP850, CP852, CP1250, CP1252,
ISO-8859-1, ISO-8859-2, et Unicode Latin-1, Latin Extended-A, et
Latin Extended-B. Voir aussi
+I, --no-ignore-diacritics
Prendre en compte les diacritiques (défaut). Voir aussi l'option -I.
-j, --just-go
Mode à accès direct.
Dans ce mode, wcd ne présentera pas de liste lorsqu'il y a plusieurs
répertoires correspondant au répertoire donné. Wcd changera vers la
première option. Lorsque wcd est appelé une nouvelle fois avec les
même arguments, il changera vers l'option suivante et ainsi de
suite.
Wcd affichera le répertoire vers lequel aller sur la sortie
standard. Une méthode d'installation différente peut être utilisée.
On pourra écrire la fonction suivante pour une interface système
compatible POSIX :
wcd ()
{
cd "$($HOME/bin/wcd.exe -j $@)"
}
Lors de l'utilisation d'une interface système ancienne ne prenant
pas en charge la substitution de commande « $() », il faut recourir
à la substitution de commande ancienne utilisant l'accent grave.
wcd ()
{
cd "`$HOME/bin/wcd.exe -j $@`"
}
Sur les systèmes Windows, si l'interface système 4NT est utilisée,
il est alors possible de faire l'alias suivant :
alias wcd `cd %@execstr[wcdwin32.exe -z 0 -j %1]`
Cette méthode supprime la nécessité d'un script « go », et il est
donc possible de combiner l'option -GN avec l'option -j.
-k, --keep-paths
Garder les chemins.
Conserver les chemins dans le fichier d'arborescence lorsque wcd ne
peut s'y déplacer. Le comportement par défaut de wcd est d'essayer
de supprimer les chemins du fichier d'arborescence lorsque wcd ne
peut s'y rendre. Cette option désactive ce comportement.
-K, --color
Utiliser les couleurs en mode graphique.
-l ALIAS
Nommer le chemin courant avec *ALIAS*. Wcd ajoute le chemin courant
avec *ALIAS* pour alias dans le fichier d'alias. Les alias sont
sensibles à la casse.
-ls Afficher le nom du fichier d'alias et lister tous les alias.
-m REP
Créer un répertoire et l'ajouter au fichier d'arborescence.
-L, --license
Afficher la license de distribution.
-M REP
Créer un répertoire et l'ajouter au fichier d'arborescence
supplémentaire.
-n CHEMIN
Lire le fichier d'arborescence relative depuis *CHEMIN*.
Ne pas lire le fichier d'arborescence par défaut. Le fichier
d'arborescence relative doit avoir été créé en utilisant l'option +S
de wcd. *CHEMIN* peut également référencer directement un fichier.
Un exemple. Supposons qu'un autre système ait été monté au point de
montage "/mnt/network" :
wcd -n /mnt/network src
Wcd ouvre le ficher d'arborescence relative dans "/mnt/network/". Le
fichier contient les chemins relatifs depuis cet endroit.
+n CHEMIN
Lire le ficher d'arborescence relative en plus du fichier
d'arborescence par défaut. Voir l'option -n.
-N, --numbers
Utiliser des nombres à la place de lettres.
Wcd avec une interface basée sur conio ou curses (voir la section
Interfaces) affiche une liste de correspondances indexées par des
lettres par défaut. Lorsque l'option -N est utilisée, la liste de
correspondances est indexée par des nombres. Indépendamment de
l'option -N, il est possible d'entrer une lettre ou un nombre pour
effectuer une sélection dans la liste de correspondances.
-o Utiliser l'interface stdin/stdout.
Lorsque l'interface conio ou curses de wcd ne fonctionne pas pour
quelque raison que ce soit, il est possible de se rabattre sur
l'interface stdin/stdout de wcd en utilisant l'option -o.
-od, --to-stdout
Décharger l'ensemble des correspondances dans stdout.
-q, --quiet
Fonctionnement plus silencieux. L'affichage de la dernière
correspondance est supprimé.
-r REP
Supprimer un répertoire et le supprimer du fichier d'arborescence.
Si le répertoire est vide, wcd le supprimera et tentera de le
supprimer du fichier d'arborescence.
-rmtree REP
Supprimer un répertoire de façon récursive et le supprimer du
fichier d'arborescence.
Wcd supprimera le répertoire ainsi que tous ses sous-répertoires et
fichiers et supprimera ces répertoires du fichier d'arborescence.
-s (ré)Examiner le disque depuis le répertoire "HOME". Si *HOME* n'est
pas défini, le disque est examiné depuis le répertoire racine /.
Le fichier d'arborescence par défaut existant est écrasé.
Le répertoire d'examen par défaut peut être renversé par la variable
d'enrivonnement "WCDSCAN". Voir la section VARIABLES D'ENVIRONNEMENT
.
-S CHEMIN
Examiner l'arbre de répertoires depuis *CHEMIN* et écraser le
fichier d'arborescence par défaut. Voir aussi les options -A, -s et
-E. Par exemple, avec l'option -A il est possible de créer un
fichier d'arborescence par défaut de votre choix. Exemples :
Unix :
wcd -S /
wcd -S /home -A /etc -A /usr
DOS / Windows :
wcd -S c:/
wcd -S c: -A d: -A \\serveur\partage
Avec les versions Windows, il est possible d'examiner tous les
répertoires partagés d'un serveur LAN Windows en entrant une
commande similaire à : "wcd -S \\nomserveur".
+S CHEMIN
Examiner le disque depuis *CHEMIN* et placer les chemins relatifs
dans un fichier d'arborescence relative. Ce fichier est utilisé par
les options -n et +n de wcd. Par exemple "wcd -n CHEMIN src".
-t Ne pas éviter le dossier de montage temporaire "/tmp_mnt" (Unix
uniquement).
Par défaut, wcd retire "/tmp_mnt/" des correpondances. Le répertoire
"/tmp_mnt" est utilisé par le montage automatique. Ce comportement
peut être évité avec l'option -t.
-T, --ascii-tree
Dessiner l'arbre avec des caractères ASCII. Utiliser cette option si
les caractères de dessin de ligne ne s'affichent pas correctement
dans le terminal.
-Ta, --alt-tree-nav
Navigation alternative dans l'arbre graphique.
Dans la disposition d'arbre du style par défaut du NCD, l'option -Ta
désactive le saut vers des répertoires sans liens.
Dans le mode d'arbre compact, le mode alternatif rend la navigation
similaire à celle de gestionnaires de fichiers graphiques tels que
Windows Explorer ou Linux KDE Konqueror. L'appui sur les touches
Haut et Bas déplace le dossier sélectionné d'une ligne vers le haut
ou le bas. Le premier appui sur la touche Gauche replie les
sous-dossiers, le second se déplace réellement à gauche.
Il est possible de basculer à la volée entre une navigation par
défaut et alternative en pressant .
Lorsque le mode de navigation alternative est activé, un « A » est
visible dans l'angle inférieur droit.
-TC, --center-tree
Vue centrée dans l'arbre graphique. Le répertoire choisi reste au
centre de l'écran. Le mode centré peut aussi être activé/désactivé
avec la clef dans l'arbre graphique.
Le comportement non centré standard, qui minimise le mouvement
d'arbre, est identique à celui du NCD original.
-Tc, --compact-tree
Par défaut l'arbre « graphique » est dessiné de la même façon que le
faisait le NCD original sur DOS. Sur DOS, un chemin de répertoire ne
pouvait faire que 66 caractères au total. Avec les structures de
répertoire profondes comtemporaines, l'arbre peut devenir très
large. Pour surmonter cela, wcd peut dessiner l'arbre d'une façon
compacte, de façon similaire à la plus part des gestionnaires de
fichier graphiques, avec un seul fichier par ligne. Utiliser
l'option -Tc ou basculer à la volée avec la clef .
-Td, --cjk-width
Les polices CJK d'Asie de l'Est (Chine, Japon et Corée) possèdent
certains caractères et symboles de tracé de ligne avec une largeur
de colonne de 2, alors que la largeur Unicode normale pour ces
caractères est de 1 colonne. Par exemple, la police de trame CP936
chinoise sur Windows et la police Simsun. Utiliser cette option
lorsqu'une police de type CJK est utilisée pour obtenir un contour
de l'arbre graphique correct.
Lorsque le mode CJK est actif, un « C » est affiché dans le coin
inférieur droit.
-u UTILISATEUR
Examiner le fichier d'arborescence d'un autre utilisateur en se
basant sur *UTILISATEUR* et ne pas examiner votre propre fichier
d'arborescence. Voir aussi *WCDUSERHOME* dans la section VARIABLES
D'ENVIRONNEMENT.
Sur Unix/Cygwin le répertoire racine pour les répertoires
utilisateur est supposé être "/home". Wcd recherchera
"/home/UTILISATEUR/.treedata.wcd" et
"/home/UTILISATEUR/.wcd/.treedata.wcd", dans cet ordre, lira le
premier fichier existant et lisible. Sur DOS/Windows le répertoire
racine pour les répertoires utilisateur est supposé être "\\users",
donc wcd tentera de lire"\\users\UTILISATEUR\treedata.wcd" et
"\\users\UTILISATEUR\.wcd\treedata.wcd".
+u UTILISATEUR
Lire le fichier d'arborescence par défaut de l'UTILISATEUR en plus
de votre fichier d'arborescence.
-v, --verbose
Afficher les messages verbeux. Avec cette option wcd affiche tous
les filtres, les bannissements et les exclusions.
-V, --version
Afficher les informations de version et sortir.
-w, --wild-match-only
Correspondance générique seulement. Traiter toutes les
correspondances comme des correspondances génériques.
-x CHEMIN
Exclure *CHEMIN* de l'examen.
Lorsque cette option est utilisée, wcd exclu le *CHEMIN* et tous ses
sous-répertoires lors de l'examen d'un disque. Les caractères
génériques sont pris en charge et mis en correspondance avec les
chemins absolus. L'option -x peut être utilisée plusieurs fois.
wcd -x -x -s
L'option -x doit être utilisée avant toute option d'examen (-s, -S,
+S, -A, -E).
Sur les systèmes DOS/Windows la précision de la lettre de lecteur
dépend de l'utilisation ou non des variables d'environnement *HOME*
ou *WCDHOME*. Si *HOME* ou *WCDHOME* sont fixées alors il faut
préciser la lettre du lecteur. Par exemple :
wcd -x c:/temp -S c:
Sinon, il n'est pas nécessaire de préciser la lettre de lecteur.
wcd -x /temp -s
-xf FICHIER
Exclure de l'examen tous les chemins listés dans *FICHIER*.
Lorsque cette option est utilisée, wcd excluera tous les chemins
listés dans *FICHIER* et tous leurs sous-répertoires durant l'examen
d'un disque. Les caractères génériques sont pris en charge et ils
sont mis en correspondance de chemins absolus ; un chemin par ligne.
Il faut être attentif au fait que wcd n'ignore pas les espaces
commençant et terminant une ligne parce qu'il s'agit de caractères
légaux pour un nom de répertoire. L'option -xf peut être utilisée
plusieurs fois. Lorsque l'exclusion de tous les chemins bannis est
souhaitée, il est possible de faire de la sorte (exemple pour wcd
sur unix) :
wcd -xf ~/.ban.wcd -s
Les caractères génériques sont pris en charge. Par exemple, pour
exclure tous les répertoires Subversion contenant des fichiers
d'administration, ajoutez une ligne avec "*/.svn".
L'option -xf doit être utilisée avant toute option d'examen (-s, -S,
+S, -A, -E).
-y, --assume-yes
Supposer Oui pour toutes les requêtes.
Wcd ne posera pas de questions oui/non à l'utilisateur, mais suppose
qu'il répondra oui à toutes les questions. Cela peut être utilisé en
combinaison de l'option -rmtree. Cette option doit être utilisée
avant les options qui peuvent déboucher à des questions oui/non.
-z NOMBRE
Fixer la taille maximale de la pile à NOMBRE.
La taille par défaut de la pile est de 10. Les opérations sur la
pile peuvent être désactivées en paramètrant la taille à 0. Cette
option doit être utilisée avant toute autre option d'opération sur
la pile (-,+,=). Autrement, la taille de la pile sera remise à sa
valeur par défaut, 10.
Une commande correcte est :
wcd -z 50 -
La nouvelle taille de pile sera de 50, wcd ira un répertoire en
arrière. Un commande erronée est :
wcd - -z 50
Wcd va en arrière d'un répertoire, la pile à une valeur par défaut
de 10. Le -z 50 est ignoré.
Ajouter cette option en première option de votre alias ou fonction
wcd. Un exemple pour l'interface d'administration compatible POSIX
serait :
wcd ()
{
wcd.exe -z 50 "$@"
. ${WCDHOME:-${HOME}}/bin/wcd.go
}
-[NOMBRE]
Empiler les répertoires NOMBRE de fois. La valeur par défaut étant
de un.
Retourner en arrière d'un répertoire. La commande retourne
en arrière d'un répertoire. Y ajouter un nombre pour retourner en
arrière de plusieurs répertoires. Exemple : "wcd -3". La pile est
cyclique.
+[NOMBRE]
Dépiler les répertoires NOMBRE fois. Un par défaut.
Avancer d'un répertoire. La commande "wcd +" avance d'un répertoire.
Y ajouter un nombre pour avancer de plusieurs répertoires. Par
exemple : "wcd +2". La pile est cyclique.
= Afficher la pile.
Utiliser cette option si vous ne savez plus de combien de fois
empiler ou dépiler. La pile est affichée et il est possible de
choisir un nombre. La position courante de la pile est désignée par
une astérisque "*".
INSTALLATION
Le répertoire de travail courant d'une interface système Unix ne peut
être changé que par la commande intégrée cd(1). Le programme est donc
toujours appelé par une fonction ou un alias. La fonction ou l'alias
incluent un script d'interface système (script « go ») qui est généré
par le programme wcd. Wcd ne peut fonctionner qu'après que la fonction
ou l'alias aient été définis.
Un autre impact important de votre installation est la définition des
variables d'environnement *HOME* and *WCDHOME*. Voir la section
VARIABLES D'ENVIRONNEMENT.
Installation pour les interfaces système de type POSIX
Pour les interfaces système POSIX (ksh, bash, zsh, etc.) sur Unix,
Linux, Cygwin ou MSYS natif, ajouter la fonction suivante au fichier de
démarrage de l'interface système (Bash utilise par exemple
"$HOME/.bashrc") :
wcd ()
{
CHEMIN/wcd.exe "$@"
. ${WCDHOME:-${HOME}}/bin/wcd.go
}
Remplacer *CHEMIN* par l'emplacement où l'exécutable de wcd a été
installé. Recharger le fichier d'initialisation de l'interface système
ou démarrer une nouvelle interface système.
L'emplacement du script « go » "wcd.go" diffère par interface système.
Wcd pour les interfaces système DOS DJGPP et OS/2 exige une fonction
différente. Le script « go » n'est pas écrit dans un répertoire "bin",
et si *WCDHOME* et *HOME* sont toutes deux non définies, le script
« go » est écrit sur c:/.
bash DOS :
wcd ()
{
CHEMIN/wcdbash.exe "$@"
. ${WCDHOME:-${HOME:-"c:"}}/wcd.go
}
bash OS/2 :
wcd ()
{
CHEMIN/wcdos2bash.exe "$@"
. ${WCDHOME:-${HOME:-"c:"}}/wcd.go
}
La version WinZsh de wcd exige une fonction légèrement différente. Le
script « go » ne sera jamais écrit dans c:/.
wcd ()
{
CHEMIN/wcdwin32zsh.exe "$@"
. ${WCDHOME:-${HOME}}/wcd.go
}
Voir la section FICHIERS pour plus d'informations.
Installation pour les interfaces système de type C (csh, tcsh)
Ajouter les alias suivants au fichier de démarrage de l'interface
système "$HOME/.cshrc" ou "$HOME/.tcshrc" :
if ( ${?WCDHOME} ) then
alias wcd "PATH/wcd.exe \!* ; source $WCDHOME/bin/wcd.go"
else
alias wcd "CHEMIN/wcd.exe \!* ; source $HOME/bin/wcd.go"
endif
Remplacer *CHEMIN* par l'emplacement où l'exécutable de wcd a été
installé. Recharger le fichier d'initialisation de l'interface système
ou démarrer une nouvelle interface système.
Version de l'Invite de Commande Windows
Dépaqueter le fichier zip et ajouter le répertoire "bin" à votre
variable d'environnement *PATH*.
Dans Windows Command Prompt, un programme Windows ne peut pas changer de
répertoire de travail courant, mais un fichier .bat le peut. Le script
de commande "wcd.bat" exécute le programme wcd qui génère un nouveau
fichier de commande "wcdgo.bat". "wcd.bat" et exécute ensuite
"wcdgo.bat" qui change effectivement de répertoire.
Windows VISTA et ultérieur
Dans un Commande Prompt Windows Vista ou de niveau plus haut, l'accès
aux répertoires peut être limité. Pour avoir accès à plus de répertoires
des droits administrateurs sont requis. Il est possible d'obtenir un
Commande Prompt avec des droits administrateurs en cliquant avec le
bouton droit sur l'icône du Commande Prompt puis en choisissant
*Exécuter en tant qu'administrateur*.
Version Windows PowerShell
Ajouter la fonction suivante à votre profil utilisateur PowerShell.
L'emplacement de ce profil est stocké dans la variable $profile. Il est
requis que l'une des deux variables d'environnement *HOME* et *WCDHOME*
soit définie.
function wcd
{
CHEMIN\wcdwin32psh.exe $args
& $env:HOME\wcdgo.ps1
}
Remplacer *CHEMIN* avec l'emplacement où l'exécutable de wcd a été
installé. Démarrer un nouveau PowerShell. Wcd pour PowerShell prend
uniquement en charge le fournisseur de système de fichier. Pas d'autres
fournisseurs.
Version OS/2 Command Prompt
Dans un OS/2 Command Prompt (cmd.exe) un programme OS/2 ne peut pas
changer de répertoire de travail courant. C'est pourquoi wcd génère un
script de commande "wcdgo.cmd" qui doit être exécuté dans l'interface
système actuelle. Le script "wcd.cmd" exécute dans un premier temps
"wcdos2.exe" qui crée le script "wcdgo.cmd". Ensuite "wcd.cmd" exécute
le script "wcdgo.cmd".
LOCALISATION
LANG
Le langage principal est sélectionné avec la variable
d'environnement *LANG*. Cette variable est composée de plusieurs
parties. La première partie, en lettres minuscules, est le code de
la langue. La seconde, optionnelle et en lettres majuscules, est le
code du pays précédé d'un tiret bas. Il y a également une troisième
partie optionnelle : l'encodage des caractères, précédé par un
point. Quelques exemples pour les interfaces système conforme au
standard POSIX :
export LANG=fr Français
export LANG=fr_FR Français, France
export LANG=fr_BE Français, Belgique
export LANG=es_ES Espagnol, Espagne
export LANG=es_MX Espagnol, Mexique
export LANG=en_US.iso88591 Anglais, USA, encodage Latin-1
Pour une liste complète des codes de langue et de pays voir le
manuel de gettext(1) :
Sur les systèmes Unix, la commande locale(1) peut être utilisée
pour voir les informations précises de localisation.
LANGAGE
Avec la variable d'environnement *LANG*, il est possible de
spécifier une liste de priorité de langues séparées par des
virgules. Wcd donne une préférence à *LANGUAGE* sur *LANG*. Par
exemple, d'abord néerlandais puis allemand : "LANGUAGE=nl:de". Il
faut d'abord activer la localisation en fixant *LANG* ou *LC_ALL* à
une valeur autre que *C* avant de pouvoir utiliser un liste de
priorités de langue avec la variable *LANGUAGE*. Voir aussi le
manuel de gettext(1) :
Si vous sélectionnez un langage qui n'est pas disponible, les
messages seront affichés en anglais standard.
WCDLOCALEDIR
La variable d'environnement *WCDLOCALEDIR* prévaut sur la variable
*LOCALEDIR* utilisée pendant la compilation et l'installation de
wcd. *LOCALEDIR* est utilisée par wcd avec prise en chage de langage
natif pour trouver les fichiers de langue. La valeur par défaut pour
GNU est "/usr/local/share/locale". En tapant "wcd -V", wcd affichera
la variable *LOCALEDIR* utilisée.
Si vous avez installé wcd dans un répertoire différent du répertoire
par défaut, il vous faut peut être définir la variable
d'environnement *WCDLOCALEDIR* pour pointer vers le répertoire de
locales.
Un exemple pour le cmd Windows :
set WCDLOCALEDIR=c:/my_prefix/share/locale
Un example pour une interface système POSIX :
export WCDLOCALEDIR=$HOME/share/locale
LC_COLLATE
Lorsque plusieurs répertoires correspondent, wcd affiche une liste
triée. L'ordre dépend des paramètres de locale. Si la variable
d'environnement *LANG* a été définie, les correspondances sont
triées comme les sont les dictionnaires ou les annuaires
téléphonique dans cette langue. Par exemple, les points et les
tirets sont ignorés, ou bien les lettres e avec ou sans accent sont
identiques, ou bien la casse est ignorée.
Le tri donne préférence à la variable d'environnement *LC_COLLATE*
devant *LANG*. Si vous rendez *LC_COLLATE* égal à "C" ou "POSIX", le
tri selon la locale est désactivé. Par exemple, si vous voulez du
néerlandais mais un tri que n'est pas néerlandais, vous pouvez faire
de la sorte :
export LANG=fr_FR
export LC_COLLATE=C
LC_CTYPE
En ce qui concerne l'encodage de caractères, wcd donnera une
préférence à la variable *LC_CTYPE* sur la variable *LANG*. Par
exemple, pour fixer l'encodage de caractères en UTF-8, le
paramètrage de l'environnement suivant peut être appliqué.
export LC_CTYPE=fr_FR.UTF-8
LC_ALL
La variable d'environnement *LC_ALL* si elle est définie, prévaut
sur toutes les variables d'environnement de locales qui commencent
par *LC_*. Wcd donnera une préférence à *LC_ALL* sur *LC_COLLATE* et
*LC_CTYPE*.
PAGES DE CODES WINDOWS
Il y a deux groupes de page de code : les pages de code DOS (OEM) et les
pages de code Windows (ANSI). L'encodage par défaut de Windows,
lorsqu'il est configuré avec les paramètres de régions occidentales, est
ANSI CP1252. Les programmes Windows, par exemple le bloc-notes,
utilisent cette page de code ANSI par défaut. La console Windows utilise
par défaut une page de code OEM (CP437 ou CP850) pour compatibilité avec
les programmes DOS. Si vous utilisez une version DOS de wcd dans une
console Windows, cela marchera grâce à la page de code DOS. Cependant la
version DOS de wcd ne prend pas en charge de longs noms de répertoire et
de lecteur réseau sur Windows.
La version Windows de wcd est un programme Windows natif et utilise la
page de code ANSI du système Windows. Donc sur un Windows configuré pour
une région occidentale la page de code CP1252 est utilisée pour les noms
de répertoire et les messages. Dans le but d'obtenir des sorties
uniformes, indépendantes des pages de code actives, toutes les versions
de Wcd pour Windows traduisent les sorties ANSI en sorties Unicode dans
le Command Prompt et le PowerShell.
La police de trame de la console ne prend en charge que la page de code
OEM installée avec Windows, et il faut donc changer la page de code de
la console à Lucidia Console correctement typé pour faire apparaître les
lettres Unicode (et ANSI) correctement.
Les versions non-Unicode de Wcd *avant la version 5.2.0* utilisent une
sortie entièrement ANSI. Pour ces anciennes versions, la page de code de
la console a été faite pour être identique à la page de code du système
(changé à 1252) dans le but de faire fonctionner wcd pour Windows
correctement avec des caractères spéciaux tels que les caractères avec
accent ou le symbole de l'Euro.
La page de code Windows peut être changée via les options de région du
Panneau de Contrôle. La page de code de la console Windows est changée
avec la commande "chcp".
Lorsque vous tapez "wcd -V", l'encodage de caractères effectif utilisé
par wcd est affiché. Tapez la commande "chcp" pour afficher la page de
codes active de la console Windows.
UNICODE
Wcd a une prise en charge optionnelle de l'Unicode. Pour voir si wcd a
été empaqueté avec la prise en charge de l'Unicode, tapez "wcd -V". Si
votre terminal/console et la police le prend en charge, vous devriez
voir le symbole de l'Euro ainsi que des caractères chinois (voulant
dire : « chinois »).
Wcd a été converti de façon *logicielle* à l'Unicode. En son coeur, Wcd
traite toutes les données comme un flux d'octets. Seules les lignes
affichées à l'écran sont converties à la volée en caractères Unicode
larges. Wcd s'appuie entièrement sur des fonctions de la libc et n'a pas
de code UTF-8 spécifique. Voir aussi
.
Wcd a une prise en charge optionnelle de mise en correspondance avec de
l'Unicode normalisé. Pour déterminer si Wcd prend en charge la
normalisation, tapez "wcd -V". Wcd avec une prise en charge de la
normalisation Unicode fera correspondre les noms Unicode en se basant
sur une équivalence *compatible*. Sans prise en charge de la
normalisation Unicode, les noms sont mis en correspondance lorsque leur
binaires sont équivalents. Voir aussi
UTF-8 sur Unix/Linux
Pour voir les caractères UTF-8, votre console/terminal doit également
prendre en charge l'UTF-8. La version xterm empaquetée avec XFree86 4.0
ou supérieur inclue une prise en charge de l'UTF-8. Pour l'activer,
démarez xterm(1) dans une locale UTF-8 et utilisez une police avec un
encodage iso10646-1, par exemple avec
LC_CTYPE=en_GB.UTF-8 xterm -u8 -fn '-Misc-Fixed-Medium-R-SemiCondensed--13-120-75-75-C-60-ISO10646-1'
Les distributions modernes de GNU/Linux prennent en charge l'UTF-8 par
défaut. D'autres encodages de caractères sur plusieurs octets devraient
également fonctionner, mais cela n'a pas été testé.
Wcd suppose que les fichiers d'arborescence sont encodés dans l'encodage
de caractères local. Il n'y a pas d'Indicateur d'Ordre des Octets écrit
dans les fichiers d'arborescence.
UTF-16 sur Windows
Sur Windows, l'Unicode est pris en charge pour toutes les versions de
PowerShell, et dans le Windows Command Prompt sur Windows 7 (ou
ultérieur). Unicode fonctionne également dans Take Command ou TCC/LE
édités par JP Software, et pouvant être utilisés sur des version de
Windows plus anciennes (XP/Vista).
Sur Windows, tous les noms de répertoire sur le disque sont encodés en
Unicode UTF-16. Pour des programmes Windows non Unicode, les caractères
Unicode sont traduits vers la page de code ANSI par défaut. Cette
traduction de caractères ne faisant pas partis du paramètrage régional
n'est pas possible et les programmes non Unicode affichent un point
d'intérogation ou bien un mauvais caractères.
Wcd avec prise en charge de l'Unicode lit les noms de répertoire encodé
en UTF-16 et les convertis de façon interne en UTF-8. Tous les fichiers
d'arborescence sont encodés en UTF-8 et ne sont pas compatibles avec la
version non Unicode de Wcd. Wcd créera un script « go » en UTF-8.
Toutes les versions de Windows PowerShell sont capable d'exécuter des
scripts encodés en UTF-8 s'il y a un BOM UTF-8 dans le script.
Depuis Windows 7 il est possible de changer de répertoire avec un script
batch dans Windows Command Prompt vers un répertoire avec une lettre
Unicode dans le nom. Le nom du répertoire doit être encodé en UTF-8, et
le script batch ne doit *pas* avoir de BOM. La page de code active du
Command Prompt doit être fixée à 65001 (UTF-8) avant la commande cd. Wcd
pour Command Prompt créera un script « go » "wcdgo.bat". Dans un premier
temps, il change la page de code à 65001 puis change de répertoire et
enfin fixe la page de code à sa valeur initiale.
Vous devez fixer la police à True Type Lucida Console (et non une police
de trame) lorsque les lettres n'apparaîssent pas correctement.
La version pour Windows non Unicode de Wcd peut lire des fichiers
d'arborescence Unicode depuis la version 5.2.0 s'il y a un Indicateur
d'Ordre des Octets (BOM) dans le fichier (voir
), mais
il ne peut se déplacer vers des répertoires dont le nom contient des
lettres Unicodes et qui ne font pas parties de la page de code ANSI par
défaut du système. La version pour Windows non Unicode écrit un BOM dans
les fichiers d'arborescence encodés en UTF-8 depuis la version 5.2.0, ce
qui les rend également lisible par le bloc-notes.
UTF-8 sur Cygwin
Cygwin prend en charge l'Unicode depuis la version 1.7. La couche Cygwin
s'occupe de la conversion des noms Unicode UTF-16 Windows en UTF-8. Donc
des programmes tels que Wcd n'ont pas besoin de savoir cela et peuvent
fonctionner en utilisant l'encodage UTF-8 sur Unix/Linux. Fixez
l'encodage de caractères à UTF-8 avec les variables d'environnement
*LANG* ou *LC_CTYPE*. Il peut être nécessaire de réexaminer les disques.
Il faut fixer la police à True Type Lucida Console (et non à une police
de trame) si vous utilisez la console Cygwin par défaut.
La version Cygwin se comporte de la même façon que la version Unix de
wcd. Il n'y a pas de BOM écrit dans les fichiers d'arborescence, et il
est supposé qu'ils sont encodés dans l'encodage de caractères de la
locale Cygwin.
FICHIERS
Si la variable d'environnement *WCDHOME* est définie, wcd utilisera
*WCDHOME* au lieu de *HOME*. Tous les fichiers "*.wcd" sont des fichiers
texte. Ils peuvent être modifiés avec un éditeur de texte. La version
Windows Command Prompt de wcd se comporte comme la version DOS. La
version Cygwin de wcd se comporte comme la version Unix.
wcd.exe
Le programme. Dans les interfaces système Unix, le programme est
toujours appelé par une fonction ou un alias parce que le répertoire
courant de travail d'une interface système Unix ne peut être changé
que par la commande cd intégrée. Voir également la section
INSTALLATION.
fichier d'arborescence par défaut
C'est le fichier d'arborescence par défaut où wcd cherche les
correspondances. S'il n'est pas lisible, wcd en créera un nouveau.
S \treedata.wcd ou %HOME%\treedata.wcd
S $HOME/.treedata.wcd
fichier d'arborescence supplémentaire
Un fichier d'arborescence supplémentaire optionel. S'il existe et
est lisible, wcd tentera de trouver des correspondances depuis ce
fichier également.
S \extra.wcd ou %HOME%\extra.wcd
S $HOME/.extra.wcd
fichier de bannissement
Wcd place dans ce fichier optionnel les chemins bannis. Voir
l'option -b. Les caractères génériques sont pris en charge.
S \ban.wcd ou %HOME%\ban.wcd
S $HOME/.ban.wcd
fichier d'alias
Fichier optionnel avec les alias wcd. Voir l'option -l.
S \alias.wcd ou %HOME%\alias.wcd
S $HOME/.alias.wcd
fichier de pile
Wcd stocke sa pile dans ce fichier. La lettre de lecteur peut être
changée avec l'option -d.
S c:\stack.wcd ou %HOME%\stack.wcd
S $HOME/.stack.wcd
Le nom du fichier de pile peut être changé avec la variable
d'environnement *WCDSTACKFILE*. Voir la section VARIABLES
D'ENVIRONNEMENT.
script « go »
C'est le script d'interface système que wcd.exe crée à chaque fois.
Il est inclus par une function ou un alias. La lettre de lecteur
peut être changée avec l'option -d. Pour des raisons historiques, il
est placé dans "$HOME/bin" par défaut sur les systèmes Unix. Le
répertoire de ce fichier peut être changé avec l'option -G.
interface système S c:/wcd.go or $HOME/wcd.go
Windows Command S c:\wcdgo.bat or %HOME%\wcdgo.bat
Windows S