wcd-5.3.4/ 0000755 0001755 0001001 00000000000 13033024047 011543 5 ustar waterlan Geen wcd-5.3.4/doc/ 0000755 0001755 0001001 00000000000 13033024045 012306 5 ustar waterlan Geen wcd-5.3.4/doc/copying.dj 0000644 0001755 0001001 00000003047 13033024045 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-5.3.4/doc/copying.txt 0000644 0001755 0001001 00000043305 13033024045 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-5.3.4/doc/dosdir.txt 0000644 0001755 0001001 00000005033 13033024045 014334 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-5.3.4/doc/faq.txt 0000644 0001755 0001001 00000003720 13033024045 013620 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-5.3.4/doc/GCC_DOS.txt 0000644 0001755 0001001 00000021544 13033024045 014156 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
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
gcc
===
DOS : DJGPP : http://www.delorie.com/djgpp/
Windows : MinGW : http://www.mingw.org/
Windows : MSYS2 : http://sourceforge.net/projects/msys2/
OS/2 : EMX :
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 5.3.0 runs out of memory for me.
Wcd compiles with mingw.org and mingw-w64. I recommend using 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 http://sourceforge.net/p/msys2/wiki/MSYS2%20installation/
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:
http://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.
DJGPP : http://www.delorie.com/pub/djgpp/current/v2gnu/
MSYS2 : http://sourceforge.net/projects/msys2/
perl
====
Perl packages are distributed with the DJGPP, MinGW, and EMX environment.
DJGPP : http://www.delorie.com/pub/djgpp/current/v2gnu/
MSYS2 : http://sourceforge.net/projects/msys2/
gettext (libintl) and libiconv
==============================
gettext and libiconv can be found as packages on the web site of the gcc compiler.
DJGPP : http://www.delorie.com/pub/djgpp/current/v2gnu/
MSYS2 : http://sourceforge.net/projects/msys2/
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 http://waterlan.home.xs4all.nl/libintl.html and
http://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.
PDCurses
========
To build wcd with PDCurses interface you need to have the PDCurses
library installed. Get PDCurses at http://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.
The DJGPP and MinGW project also provide ready-to-use binary PDCurses packages.
Ncurses
=======
You can also build the Windows version of wcd with Ncurses. It is best to take
the most recent version from http://invisible-island.net/ncurses/
See also whatsnew.txt for issues with Ncurses that have been solved.
To compile for ncurses add CURSES=ncursesw to the make command line.
* By default the Ncurses interface does not work in the Console2 console. Set
environment variable NCURSES_CONSOLE2 to 1 to make it work.
* The ncurses interface shows some trembling while moving around in the tree.
* 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 highlighted directory in tree
with true type CJK font, e.g. the Chinese Simsun font. (PDCurses has same
problem.)
Ncurses is still in active development, while PDCurses development is on hold.
groff and ghostscript
==========================
These packages are needed if you want to create PostScript and PDF versions of
the wcd manual page.
The manual pages are included in the wcd DOS source package, not in the Unix
source package.
Groff and ghostscript are available in the Cygwin environment (http://cygwin.com).
Problems on Windows VISTA and higher
====================================
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'.
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.
Change to the appropriate directory `dos32', `dos32bsh', `win32', `win32psh',
`win32zsh', `win64', `win64psh', `win64zsh', 'os2'.
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 enabled. To disable reset the ENABLE_NLS variable:
make ENABLE_NLS=
Curses interface
================
The default interface is curses.
win32* and win64* uses PDCurses with wide character support (CURSES=pdcursesw)
OS/2 uses NCurses (CURSES=ncurses)
To disable CURSES and compile with stdio interface, reset the CURSES variable:
make 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.
make ASCII_TREE=1
Conio interface (DOS only)
==========================
To enable the conio interface instead of curses add CONIO=1:
make CONIO=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
http://www.gnu.org/s/libunistring/
http://en.wikipedia.org/wiki/Unicode_normalization
Get libunistring packages via
http://waterlan.home.xs4all.nl/libunistring.html
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
distribution package
====================
After installation a ready-to-run binary distribution package can be created.
Type `make dist' to create the package.
wcd-5.3.4/doc/INSTALL.txt 0000644 0001755 0001001 00000000744 13033024045 014162 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.
RPM.txt : How to install wcd using an rpm package.
wcd-5.3.4/doc/INST_DOS.txt 0000644 0001755 0001001 00000016417 13033024045 014342 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 NT (NT/2000/XP/Vista/7)
- 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 NT (NT/2000/XP/Vista/7) =
======================================================================
- 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 http://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 http://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 http://www.mingw.org/
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
http://www.nabble.com/Accepting-standard-input-from-MSYS-with-native-Win32-programs-td19432889.html
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-5.3.4/doc/problems.txt 0000644 0001755 0001001 00000003062 13033024045 014673 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
http://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.
......................................................................
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-5.3.4/doc/README.txt 0000644 0001755 0001001 00000035624 13033024045 014016 0 ustar waterlan Geen File list
README.txt : This file.
SOURCE.txt : Notes about the source code.
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.
2.0 Copyright
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.
Visit
2.1 C3PO data structures
Data structures with dynamic memory allocation were created
with Ondrej Popp's C3PO ( Compiler Compiler Compiler Popp
Ondrej ).
http://sourceforge.net/projects/c3po/
email:
2.2 DOSDIR
Wcd uses DOSDIR for scanning the disk. Only the parts of DOSDIR
that are distributed under GNU General Public License are 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
http://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:
http://www.info-zip.org/
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
http://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
http://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
http://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.
http://www.mvps.org/win32/
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 http://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.
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 http://translationproject.org/domain/wcd.html
Chinese (simplified) Mingcong Bai (Jeff) and Version 5.3.1
Mingye Wang (Arthur)
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
Finnish Jari Aalto Version 5.1.0 - 5.2.4
Finnish Jorma Karvonen Version 5.2.5 - 5.3.3
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
Serbian Мирослав Николић Version 5.3.4
Spanish Julio A. Freyre-Gonzalez Version 5.0.4 - 5.2.4
Ukrainian Yuri Chornoivan Version 5.2.5 - 5.3.4
Vietnamese Trần Ngọc Quân Version 5.2.5 - 5.3.4
Translations of the manual:
See http://translationproject.org/domain/wcd-man.html
Dutch Erwin Waterlander Version 5.2.5 - 5.3.3
German Mario Blättermann Version 5.2.5 - 5.3.3
Ukrainian Yuri Chornoivan Version 5.2.5 - 5.3.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
Mark Adler, recmatch()
DJ Delorie _fixpath()
Borja Etxebarria & Olivier Sirol Ninux Czo Directory
Felix Kasza WIN32 API sample WNetOpenEnum()/WNetEnumResource()
MVPS.ORG http://www.mvps.org/win32/
Markus Kuhn wcwidth() and wcwidth_cjk()
http://www.cl.cam.ac.uk/~mgk25/unicode.html
Rugxulo query_con_codepage()
http://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:
http://waterlan.home.xs4all.nl/
--
SourceForge project page:
http://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
http://packages.debian.org/search?keywords=wcd
Ubuntu Linux
http://packages.ubuntu.com/
Fedora Linux
Gentoo Linux
Simtel.Net:
Search: wcd
SYSTEM UTILITIES > File management and conversion utils > wcd
Ibiblio (was Metalab (was SunSite)):
http://www.ibiblio.org/pub/Linux/utils/shell/
-- Erwin Waterlander
wcd-5.3.4/doc/RPM.txt 0000644 0001755 0001001 00000000355 13033024045 013510 0 ustar waterlan Geen
RedHat RPM package installation
===============================
Type:
rpm -Uhv
The wcd function for POSIX shells is defined in /etc/profile.d/wcd.sh, and an
alias in /etc/profile.d/wcd.csh for C alike shells.
wcd-5.3.4/doc/SOURCE.txt 0000644 0001755 0001001 00000007765 13033024045 014066 0 ustar waterlan Geen
1.0 Notes about the source code
1.1 Compiler support
In general the supported compilers are GCC, Open Watcom, and Visual
C++.
DOS 16 bit
The 16 bit DOS version is by default build with Open Watcom C.
The code probably also compiles with Borland C/C++ 4.02, and the
older Borland 3. Support for Borland was dropped in version 5.2.0
(Nov 11 2011), because Borland C is hard to get. The default
compiler for 16 bit DOS used by the FreeDOS community is
Open Watcom nowadays.
DOS 32 bit
The 32 bit dos versions are compiled with DJGPP (GCC for DOS) and
do not use DOSDIR. DJGPP is a mix of DOS/Unix compiler (both
MSDOS and 'unix' are defined). DOSDIR's dd_findfirst/dd_findnext
implementation for Unix is build with opendir/readdir. Using
DJGPP's implementation of opendir/readdir to scan a disk is about
a factor 100 slower than using findfirst/findnext (with DJGPP
2.01, gcc 2.7.2). Also using DOSDIR's dd_findfirst/dd_findnext
for DOS is very slow when it is compiled with DJGPP. It is about a
factor 35 slower than using DJGPP's findfirst/findnext.
Probably due to a slow stat() function in dd_initstruct().
Using DOSDIR in combination with DJGPP would make scanning
the disk very slow.
DJGPP gcc >= 4.6 seems to cause problems. Crashes of gcc itself,
or crashing wcd binaries. Use DJGPP gcc <= 4.5.3.
A 32 bit DOS wcd can also be build with the Open Watcom compiler.
Windows
The Windows versions are by default compiled with MinGW (GCC for
Windows).
Win32 versions can also be compiled with Open Watcom.
Support for Borland was dropped in version 5.2.0 (Nov 11 2011),
but it may still compile. Although Borland 4 can compile wcd with
conio interface for Windows console, it doesn't work well. The
screen gets garbled after exit.
Support for LCC was dropped in version 5.2.1 (Feb 2012), mainly
because lcc-make was not good. For instance it can't include
sub-makefiles (version.mk). I tried gnu-make with LCC but that did
not work well.
MS Visual C++ (VC) support was added in version 5.2.3. VC is the
most used compiler on Windows.
OS/2
Wcd can be build for OS/2 with GCC, using EMX, or the Watcom C compiler.
Unix
Wcd for Unix compiles with gcc. Native system C compilers such as
HP-UX cc or SunOS cc should also work but this not checked
anymore. Therefore also the makefiles for HP and Sun have been
removed. Gcc is general available on Unix or Unix like systems.
1.2 Curses support
Wcd can optionally have a curse-based interface. Wcd compiles
with curses, ncurses and pdcurses. Ncurses is preferred,
because of portability and it restores the screen
automatically after exit (if possible) and has better support
for resizing of the terminal.
The ncurses (new curses) library is a free software emulation
of curses in System V Release 4.0, and more. It uses terminfo
format, supports pads and color and multiple highlights and
forms characters and function-key mapping, and has all the
other SYSV-curses enhancements over BSD curses. The ncurses
distribution is available via anonymous FTP at the GNU
distribution site ftp://ftp.gnu.org/pub/gnu/ncurses. It is
also available at ftp://ftp.clark.net/pub/dickey/ncurses.
PDCurses is a port of System VR4 curses for multiple
platforms. PDCurses has been ported to DOS, OS/2, X11, WIN32
and Flexos. A directory containing the port-specific source
files exists for each of these platforms. Get it at
http://pdcurses.sourceforge.net/
wcd-5.3.4/doc/todo.txt 0000644 0001755 0001001 00000003757 13033024045 014030 0 ustar waterlan Geen
TO DO
=====
* Translate the program messages.
Translation of the messages for wcd is going via the Translation Project (TP).
See http://translationproject.org/domain/wcd.html
* Translate the manual.
Translation of the manual for wcd is going via the Translation Project (TP).
See http://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 ncurses development. PDCurses development is
on hold.
* 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 http://www.laurikari.net/tre/
wcd-5.3.4/doc/UNIX.txt 0000644 0001755 0001001 00000017441 13033024045 013641 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.
* gettext : Framework to help GNU packages produce multi-lingual messages.
* po4a : PO for anything.
* ncurses : CRT screen handling and optimization package.
* 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
http://www.gnu.org/s/libunistring/
http://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.
The manual pages in text and html format are by default only
created in English language. To create text and html manuals
for other languages type:
make txt
make html
Once the manuals in non-English languages have been created,
they will also be installed under share/doc/ when you type
'make install'
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
See also file SOURCE.txt.
--
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-5.3.4/doc/VISUALC.txt 0000644 0001755 0001001 00000010333 13033024045 014155 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
* perl : Practical Extraction and Report Language (perlpod)
Needed for building packages:
* zip : compressor-archiver http://www.info-zip.org/
Visual C++
==========
You can get a free express version via this web page:
http://www.microsoft.com/visualstudio/eng/downloads#d-2010-express
PDCurses
========
To build wcd with PDCurses interface you need to have the PDCurses
library installed. Get PDCurses at http://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".
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: http://strawberryperl.com/
Active Perl : http://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-5.3.4/doc/WATCOMC.txt 0000644 0001755 0001001 00000011124 13033024045 014143 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
* perl : Practical Extraction and Report Language (perlpod)
Needed for building packages:
* zip : compressor-archiver
Watcom C
========
There is a free version of the Watcom C compiler available
at http://www.openwatcom.org/
It includes cross compilation. From a Windows machine you
can also create DOS and OS/2 programs.
PDCurses
========
To build wcd with PDCurses interface you need to have the PDCurses
library installed. Get PDCurses at http://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: http://www.delorie.com/djgpp/
ftp://ftp.delorie.com/pub/djgpp/current/v2gnu/perl588b.zip
Windows:
Strawberry Perl: http://strawberryperl.com/
Active Perl : http://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-5.3.4/doc/whatsnew.txt 0000644 0001755 0001001 00000074143 13033024045 014720 0 ustar waterlan Geen 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 http://po4a.alioth.debian.org/
- Wcd is member of Translation Project for translation of
messages and manual. See
http://translationproject.org/domain/wcd.html
http://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 http://sourceforge.net/projects/msys2/
- 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 http://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 http://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 http://en.wikipedia.org/wiki/Unicode_normalization
Requires libunistring. http://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 http://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 http://www.mingw.org/
- 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 http://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
http://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-5.3.4/dos16/ 0000755 0001755 0001001 00000000000 13033024045 012475 5 ustar waterlan Geen wcd-5.3.4/dos16/makefile 0000644 0001755 0001001 00000002521 13033024045 014175 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 dosdir.obj wfixpath.obj intset.obj wcddir.obj command.obj matchl.obj querycp.obj
LOBJS = wcd.obj,match.obj,stack.obj,nameset.obj,error.obj,text.obj,WcdStack.obj,display.obj,dosdir.obj,wfixpath.obj,intset.obj,wcddir.obj,command.obj,matchl.obj,querycp.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-5.3.4/dos32/ 0000755 0001755 0001001 00000000000 13033024045 012473 5 ustar waterlan Geen wcd-5.3.4/dos32/Makefile 0000644 0001755 0001001 00000004177 13033024045 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-5.3.4/dos32/watcom/ 0000755 0001755 0001001 00000000000 13033024045 013765 5 ustar waterlan Geen wcd-5.3.4/dos32/watcom/makefile 0000644 0001755 0001001 00000002660 13033024045 015471 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 dosdir.obj wfixpath.obj intset.obj wcddir.obj command.obj matchl.obj querycp.obj
LOBJS = wcd.obj,match.obj,stack.obj,nameset.obj,error.obj,text.obj,WcdStack.obj,display.obj,dosdir.obj,wfixpath.obj,intset.obj,wcddir.obj,command.obj,matchl.obj,querycp.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-5.3.4/dos32bsh/ 0000755 0001755 0001001 00000000000 13033024045 013170 5 ustar waterlan Geen wcd-5.3.4/dos32bsh/Makefile 0000644 0001755 0001001 00000004163 13033024045 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-5.3.4/dos32bsh/watcom/ 0000755 0001755 0001001 00000000000 13033024045 014462 5 ustar waterlan Geen wcd-5.3.4/dos32bsh/watcom/makefile 0000644 0001755 0001001 00000002706 13033024045 016167 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 dosdir.obj wfixpath.obj intset.obj wcddir.obj command.obj matchl.obj querycp.obj
LOBJS = wcd.obj,match.obj,stack.obj,nameset.obj,error.obj,text.obj,WcdStack.obj,display.obj,dosdir.obj,wfixpath.obj,intset.obj,wcddir.obj,command.obj,matchl.obj,querycp.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-5.3.4/file_id.diz 0000644 0001755 0001001 00000003120 13033024045 013640 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: Chinese simplified, Dutch, English, Esperanto,
Finnish, German, Serbian, Spanish, Ukrainian, Vietnamese.
* Unicode Level 3 support (all UCS characters including double width and combining characters).
* Unix/Linux
* Cygwin-1.7.
* 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-5.3.4/Makefile 0000644 0001755 0001001 00000002134 13033024045 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-5.3.4/misc/ 0000755 0001755 0001001 00000000000 13033024045 012474 5 ustar waterlan Geen wcd-5.3.4/misc/bldwin32.sh 0000755 0001755 0001001 00000001462 13033024045 014462 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 UCS=
make mostlyclean all strip install dist ENABLE_NLS= UNINORM=1
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 UCS=
make mostlyclean all strip install dist ENABLE_NLS= UNINORM=1
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 UCS=
make mostlyclean all strip install dist ENABLE_NLS= UNINORM=1
make mostlyclean all strip install dist ENABLE_NLS=1 UNINORM=1
wcd-5.3.4/misc/bldwin64.sh 0000755 0001755 0001001 00000001460 13033024045 014465 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 UCS=
make mostlyclean all strip install dist ENABLE_NLS= UNINORM=1
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 UCS=
make mostlyclean all strip install dist ENABLE_NLS= UNINORM=1
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 UCS=
make mostlyclean all strip install dist ENABLE_NLS= UNINORM=1
make mostlyclean all strip install dist ENABLE_NLS=1 UNINORM=1
wcd-5.3.4/misc/unix2dos.mk 0000755 0001755 0001001 00000002042 13033024045 014601 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:
# http://waterlan.home.xs4all.nl/dos2unix.html
# http://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-5.3.4/os2/ 0000755 0001755 0001001 00000000000 13033024045 012244 5 ustar waterlan Geen wcd-5.3.4/os2/Makefile 0000644 0001755 0001001 00000003061 13033024045 013704 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 = -lcx
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}
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}
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-5.3.4/os2/watcom/ 0000755 0001755 0001001 00000000000 13033024045 013536 5 ustar waterlan Geen wcd-5.3.4/os2/watcom/makefile 0000644 0001755 0001001 00000002465 13033024045 015245 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 dosdir.obj wfixpath.obj intset.obj wcddir.obj command.obj matchl.obj querycp.obj
LOBJS = wcd.obj,match.obj,stack.obj,nameset.obj,error.obj,text.obj,WcdStack.obj,display.obj,dosdir.obj,wfixpath.obj,intset.obj,wcddir.obj,command.obj,matchl.obj,querycp.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-5.3.4/os2/wcd.cmd 0000755 0001755 0001001 00000000561 13033024045 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-5.3.4/README.txt 0000644 0001755 0001001 00000000051 13033024045 013233 0 ustar waterlan Geen
For documentation see directory `doc'.
wcd-5.3.4/src/ 0000755 0001755 0001001 00000000000 13033024072 012330 5 ustar waterlan Geen wcd-5.3.4/src/c3po/ 0000755 0001755 0001001 00000000000 13033024046 013175 5 ustar waterlan Geen wcd-5.3.4/src/c3po/Advance.h 0000644 0001755 0001001 00000013745 13033024045 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-5.3.4/src/c3po/Command.c 0000644 0001755 0001001 00000011210 13033024045 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-5.3.4/src/c3po/Command.h 0000644 0001755 0001001 00000002661 13033024045 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-5.3.4/src/c3po/Config.h 0000644 0001755 0001001 00000001565 13033024045 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-5.3.4/src/c3po/Constants.h 0000644 0001755 0001001 00000001535 13033024045 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-5.3.4/src/c3po/dirnode.c 0000644 0001755 0001001 00000027372 13033024046 015000 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-5.3.4/src/c3po/dirnode.h 0000644 0001755 0001001 00000007240 13033024046 014775 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-5.3.4/src/c3po/Error.c 0000644 0001755 0001001 00000002341 13033024045 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-5.3.4/src/c3po/Error.h 0000644 0001755 0001001 00000001631 13033024045 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-5.3.4/src/c3po/File.c 0000644 0001755 0001001 00000005357 13033024045 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-5.3.4/src/c3po/File.h 0000644 0001755 0001001 00000002345 13033024045 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-5.3.4/src/c3po/Generate 0000755 0001755 0001001 00000001057 13033024045 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-5.3.4/src/c3po/Imakefile 0000644 0001755 0001001 00000003102 13033024045 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-5.3.4/src/c3po/intset.c 0000644 0001755 0001001 00000014037 13033024046 014654 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-5.3.4/src/c3po/intset.h 0000644 0001755 0001001 00000003743 13033024046 014663 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-5.3.4/src/c3po/nameset.c 0000644 0001755 0001001 00000017014 13033024046 015000 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-5.3.4/src/c3po/nameset.h 0000644 0001755 0001001 00000004543 13033024046 015010 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-5.3.4/src/c3po/namesetw.c 0000644 0001755 0001001 00000016725 13033024046 015177 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-5.3.4/src/c3po/namesetw.h 0000644 0001755 0001001 00000004614 13033024046 015176 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-5.3.4/src/c3po/README 0000644 0001755 0001001 00000000452 13033024045 014055 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 http://sourceforge.net/projects/c3po/
wcd-5.3.4/src/c3po/std_macr.h 0000644 0001755 0001001 00000004725 13033024046 015152 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-5.3.4/src/c3po/structur.h 0000644 0001755 0001001 00000003451 13033024046 015244 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-5.3.4/src/c3po/Text.c 0000644 0001755 0001001 00000013011 13033024045 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-5.3.4/src/c3po/Text.h 0000644 0001755 0001001 00000003773 13033024045 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-5.3.4/src/c3po/Textw.c 0000644 0001755 0001001 00000013201 13033024045 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-5.3.4/src/c3po/Textw.h 0000644 0001755 0001001 00000004055 13033024045 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-5.3.4/src/c3po/Usage.c 0000644 0001755 0001001 00000002312 13033024045 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-5.3.4/src/c3po/Usage.h 0000644 0001755 0001001 00000001576 13033024045 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-5.3.4/src/c3po/wcd.G 0000644 0001755 0001001 00000002242 13033024046 014062 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-5.3.4/src/c3po/WcdStack.c 0000644 0001755 0001001 00000021560 13033024046 015050 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-5.3.4/src/c3po/WcdStack.h 0000644 0001755 0001001 00000005466 13033024046 015064 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-5.3.4/src/chk_loc.sh 0000755 0001755 0001001 00000000432 13033024046 014271 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-5.3.4/src/colors.c 0000644 0001755 0001001 00000004640 13033024046 014002 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-5.3.4/src/colors.h 0000644 0001755 0001001 00000002534 13033024046 014007 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-5.3.4/src/config.h 0000644 0001755 0001001 00000002062 13033024046 013747 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-5.3.4/src/display.c 0000644 0001755 0001001 00000132421 13033024046 014145 0 ustar waterlan Geen /*
Copyright (C) 1997-2016 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
#include
#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 "dosdir.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[DD_MAXPATH];
char buf[DD_MAXPATH];
# ifdef WCD_UTF16
char formatmbs[DD_MAXPATH];
wchar_t formatwcs[DD_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, DD_MAXPATH);
/* then convert the format string to UTF-8 */
WideCharToMultiByte(CP_UTF8, 0, formatwcs, -1, formatmbs, DD_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, DD_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, DD_MAXPATH) > 0 )
# endif
WriteConsoleW(stduit, wstr, 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[DD_MAXPATH];
size_t i;
/* convert to wide characters. i = nr. of characters */
i= MBSTOWCS(wstr,s,(size_t)DD_MAXPATH);
if ( i == (size_t)(-1))
return(strlen(s));
else
{
int j = wcd_wcswidth(wstr,(size_t)DD_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[DD_MAXPATH];
static wchar_t wstr_right[DD_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)DD_MAXPATH);
size_t len2 = MBSTOWCS(wstr_right,list->array[i],(size_t)DD_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()
{
/* end curses mode */
endwin();
refresh(); /* start curses */
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);
}
#if CAN_RESIZE
void signalSigwinchDisplay (int sig)
{
displayResize ();
signal(SIGWINCH,signalSigwinchDisplay);
}
#endif
void wcd_mvwaddstr(WINDOW *win, int x, int y, char *str)
{
#if defined(WCD_UNICODE) || defined(WCD_WINDOWS)
static wchar_t wstr[DD_MAXPATH];
size_t i;
/* convert to wide characters. i = nr. of characters */
i= mbstowcs(wstr,str,(size_t)DD_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[DD_MAXPATH];
size_t len = MBSTOWCS(wstr,(char *)s,(size_t)DD_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[DD_MAXPATH];
size_t len = MBSTOWCS(wstr,(char *)s,(size_t)DD_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 ;
#ifndef __PDCURSES__
SCREEN *sp;
#endif
#if CAN_RESIZE
signal (SIGWINCH, signalSigwinchDisplay);
#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 */
#if defined(__PDCURSES__) || (defined(_WIN32) && !defined(__CYGWIN__))
initscr();
#else
sp = newterm(NULL,stdout,stdin);
if (sp == NULL)
{
print_error("%s", _("Error opening terminal, falling back to stdout interface.\n"));
return WCD_ERR_CURSES;
}
#endif
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();
#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
return(WCD_ERR_LIST);
refresh();
wcd_display.scrollWin = newwin(wcd_display.scrollWinHeight,COLS,0,0);
if (wcd_display.scrollWin == NULL)
{
endwin();
#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)
{
endwin();
#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'):
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);
}
endwin();
#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-5.3.4/src/display.h 0000644 0001755 0001001 00000005551 13033024046 014155 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"
#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-5.3.4/src/dosdir.c 0000644 0001755 0001001 00000034146 13033024046 013771 0 ustar waterlan Geen /*
dosdir.c:
DOSDIR V2.1a: A Portable DOS/UNIX/VMS Directory Interface
Implementation of the DOS directory functions (findfirst and findnext)
on MS-DOS, UNIX and VMS platforms using the appropriate file & directory
structure.
Provides the DOS directory framework for MS-DOS/UNIX/VMS application
portability.
Supports MS-DOS with Borland C++, Turbo C, or Microsoft C V6.0/7.0,
Sun with GNU C compiler, DEC Alpha (OSF-1), VAX/VMS C,
and other comparable platforms.
Written by: Jason Mathews
---------------------------------------------------------------------------
Copyright (C) 1996 Jason Mathews
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
---------------------------------------------------------------------------
Modification history:
V1.0 02-May-91, Original version.
V2.0 13-May-94, Reimplemented findfirst/findnext with ffblk structure
to match MS-DOS externally, fixed wildcard evaluation
function.
V2.1 08-Jun-94, Replaced wildcard evaluation function with recursive
function provided by Info-ZIP's portable UnZip,
added dd_ prefix to most functions & constants,
added VMS functions + MSC/TURBOC macros.
V2.1a 16-Oct-96, Call lstat() instead of stat() to avoid expanding on
symbolic linked directories.
Jan 3 2000, Erwin Waterlander, update for Mingw32 compiler.
Apr 29 2002, Erwin Waterlander, update for LCC windows compiler.
Jul 14 2008, Erwin Waterlander, update for OS/2 using gcc.
Jul 28 2009, Erwin Waterlander, support UTF-16 Unicode on Windows.
UTF-16 wide character names are converted to UTF-8 multi-byte strings.
Aug 2012, Major cleanup macros:
* Use only C99 predefined macros.
* Use __MSDOS__ only when it's real for MS-DOS.
* UNIX is not defined on OS/2 EMX (fixed tailor.h, UNIX got defined,
because _BSD_SOURCE is defined with EMX (GCC on OS/2)).
* Make it compile with Watcom C for OS/2.
* Borland C and LCC may have been broken, because these are not supported
anymore.
Erwin Waterlander
*/
#include
#include "dosdir.h"
#include "config.h"
#ifdef WCD_UTF16
# include "display.h"
struct _stat dd_sstat;
#else
struct stat dd_sstat; /* global stat structure of last successful file
* returned by findfirst/findnext functions available
* to query for more detailed information.
*/
#endif
#ifdef UNIX
# define STAT lstat /* don't expand symbolic links */
#else /* ?MSDOS\VMS */
# ifdef WCD_UTF16
# define STAT _wstat
# else
# define STAT stat
# endif
#endif
#if defined(_WIN32) || (defined(__OS2__) && !defined(__EMX__))
# define FSTRUCT struct _finddata_t
# define FATTR _A_HIDDEN+_A_SYSTEM+_A_SUBDIR
# ifdef WCD_UTF16
# define FFIRST(n,d) _wfindfirst(n,d)
# define FNEXT(h,d) _wfindnext(h,d)
# else
# define FFIRST(n,d) _findfirst(n,d)
# define FNEXT(h,d) _findnext(h,d)
# endif
# define FNAME name
# define FATTRIB attrib
# define FSIZE size
#elif defined (__MSDOS__)
# ifdef __TURBOC__
# define FSTRUCT struct ffblk
# define FATTR FA_HIDDEN+FA_SYSTEM+FA_DIREC
# define FFIRST(n,d,a) findfirst(n,d,a)
# define FNEXT(d) findnext(d)
# define FNAME ff_name
# define FATTRIB ff_attrib
# define FSIZE ff_fsize
# define FDATE ff_fdate
# define FTIME ff_ftime
# else /* !__TURBOC__ */
# define FSTRUCT struct find_t
# define FATTR _A_HIDDEN+_A_SYSTEM+_A_SUBDIR
# define FFIRST(n,d,a) _dos_findfirst(n,a,d)
# define FNEXT(d) _dos_findnext(d)
# define FNAME name
# define FATTRIB attrib
# define FSIZE size
# define FDATE wr_date
# define FTIME wr_time
# endif /* ?__TURBOC__ */
#endif
/* 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
#if defined(__MSDOS__) || defined(_WIN32) || (defined(__OS2__) && !defined(__EMX__))
# if 0
/* function used if we want to fake stat info instead of failing the file,
* but I cannot find a case where stat fails after findfirst/findnext succeeds.
*/
/* fill stat structure given the DOS findfirst structure */
static void dd_fillstatbuf( FSTRUCT* fb )
{
struct date fdate;
struct time ftime;
/*
* convert struct ffblk date/time format -> dos format
*/
fdate.da_year = (fb->FDATE>>9) + 1980;
fdate.da_day = fb->FDATE & 0x1f;
fdate.da_mon = fb->FDATE>>5 & 0xf;
ftime.ti_hour = fb->FTIME>>11;
ftime.ti_min = fb->FTIME>>5 & 0x3f;
ftime.ti_sec = 2*(fb->FTIME & 0x1f);
ftime.ti_hund = 0;
/* convert dos time to t_time format */
dd_sstat->st_atime =
dd_sstat->st_mtime =
dd_sstat->st_ctime = dostounix (&fdate, &ftime);
/*
* set file mode flags
*/
dd_sstat->st_mode = S_IREAD;
if (fb->ff_attrib & DD_DIREC) dd_sstat->st_mode |= (S_IFDIR | S_IEXEC);
else if (fb->ff_attrib & DD_DEVICE) /* non-documented findfirst attribute */
dd_sstat->st_mode |= S_IFCHR;
else dd_sstat->st_mode |= S_IFREG;
if (!(fb->ff_attrib & DD_RDONLY)) dd_sstat->st_mode |= S_IWRITE;
/* other msdos stat fields not used by dosdir */
dd_sstat->st_uid = dd_sstat->st_gid = 0;
dd_sstat->st_size = fb->FSIZE;
dd_sstat->st_nlink = 1;
dd_sstat->st_ino = 0;
dd_sstat->st_rdev = dd_sstat->st_dev = fb->ff_attrib & DD_DEVICE ? -1 : 3;
}
# endif
static int dd_initstruct( dd_ffblk* fb )
{
#ifdef WCD_UTF16
/* Convert wide character name (UTF-16) to UTF-8. */
wcstoutf8(fb->dd_name,fb->dos_fb.FNAME,DD_MAXPATH);
#else
fb->dd_name = fb->dos_fb.FNAME;
#endif
/* ".." entry refers to the directory entry of the cwd and *NOT* the
* parent directory, so we use "." instead.
*/
#ifdef WCD_UTF16
if (STAT(!strcmp(fb->dd_name, "..") ? L"." : fb->dos_fb.FNAME, &dd_sstat))
return -1; /* stat failed! */
#else
if (STAT(!strcmp(fb->dd_name, "..") ? "." : fb->dd_name, &dd_sstat))
return -1; /* stat failed! */
#endif
fb->dd_time = dd_sstat.st_mtime;
fb->dd_size = fb->dos_fb.FSIZE;
fb->dd_mode = ((fb->dos_fb.FATTRIB & DD_DOSATTRIBS) |
(dd_sstat.st_mode & ~DD_DOSATTRIBS));
return 0;
}
# if defined(_WIN32) || (defined(__OS2__) && !defined(__EMX__))
wcd_intptr_t dd_findnext( dd_ffblk* fb )
{
wcd_intptr_t rc;
/* repeat until file info is initialized or no more files are left */
while ((rc=FNEXT(fb->nHandle,&fb->dos_fb)) == 0 && (rc=dd_initstruct(fb)) != 0);
if (rc != 0) /* no more files left */
_findclose(fb->nHandle);
return rc;
}
wcd_intptr_t dd_findfirst( const wcd_char *path, dd_ffblk *fb, int attrib )
{
wcd_intptr_t rc;
if ((rc = FFIRST( path, &fb->dos_fb)) != -1)
{
fb->nHandle = rc;
fb->dd_attribs = (char)attrib;
if ((rc = dd_initstruct(fb)) != 0) /* initialization failed? */
rc = dd_findnext( fb );
}
return rc;
}
# else
/*
* Function: dd_findnext
*
* Purpose: Use dd_findnext after dd_findfirst to find the remaining files
*
* Returns: zero if successful, otherwise, it returns a -1
* and sets errno either to the constant ENOENT indicating
* that the file could not be found, or to ENMFILE
* signifying that there are no more files.
*
* Parms:
* dd_ffblk* fb = structure to hold results of search
*/
int dd_findnext( dd_ffblk* fb )
{
int rc;
/* repeat until file info is initialized or no more files are left */
while ((rc=FNEXT(&fb->dos_fb)) == 0 && (rc=dd_initstruct(fb)) != 0);
return rc;
}
/*
* Function: dd_findfirst
*
* Purpose: Find file matching specification in specified directory
* given directory information
*
* Returns: zero if successful, otherwise, it returns a -1
* and sets errno either to the constant ENOENT indicating
* that the file could not be found, or to ENMFILE
* signifying that there are no more files.
*
* Parms:
* char *filespec = filename to search for including path
* dd_ ffblk* fb = structure to hold results of search
* int attrib = file attributes to match
*/
int dd_findfirst( const char *path, dd_ffblk *fb, int attrib )
{
int rc;
if ((rc = FFIRST( path, &fb->dos_fb, attrib & DD_DOSATTRIBS)) == 0)
{
if ((rc = dd_initstruct(fb)) != 0) /* initialization failed? */
rc = dd_findnext( fb );
}
return rc;
}
# endif
#elif defined (VMS)
# include "match.h"
int dd_findnext( dd_ffblk* fb )
{
int rc;
while ((rc = SYS$SEARCH(&fb->fab, 0, 0)) == RMS$_NORMAL)
{
char *s;
fb->rsa[fb->nam.nam$b_rsl] = '\0'; /* terminate filename */
if (STAT(fb->rsa, &dd_sstat)) /* if stat fails then we have no */
continue; /* priviledge to read file, so skip it */
if (dd_sstat.st_mode & S_IFDIR && !(fb->dd_attribs & DD_DIREC))
continue;
s = strchr(fb->rsa, DIR_END);
fb->dd_name = s ? s + 1 : fb->rsa;
if (dd_match(fb->dd_name, fb->filespec, 1))
{
fb->dd_size = dd_sstat.st_size;
fb->dd_time = dd_sstat.st_mtime;
fb->dd_mode = dd_sstat.st_mode;
return 0; /* OK: match found */
}
} /* while */
memset(fb, 0x0, sizeof(dd_ffblk)); /* Invalidate structure */
errno = ENOENT; /* No file found */
return -1; /* Search failed */
}
int dd_findfirst( const char *path, dd_ffblk *fb, int attrib )
{
char *s;
strcpy(fb->path, path);
s = strchr(fb->path, DIR_END);
if (!s)
s = strrchr(fb->path, ':'); /* check device/node */
if (s)
{
strncpy(fb->rms_filespec, fb->path, s - fb->path + 1);
strcat(fb->rms_filespec, "*.*");
fb->filespec = s + 1;
printf("filespec = %s\n", fb->rms_filespec);
}
else
{
strcpy(fb->rms_filespec, "*.*");
fb->filespec = fb->path;
}
/* if no version number specified then add one */
s = strchr(fb->path, ';');
if (!s) strcat(fb->path, ";*");
fb->fab = cc$rms_fab;
fb->nam = cc$rms_nam;
fb->fab.fab$l_dna = &fb->rms_filespec;
fb->fab.fab$b_dns = strlen(fb->rms_filespec);
fb->fab.fab$l_nam = &fb->nam;
fb->nam.nam$l_esa = &fb->esa;
fb->nam.nam$b_ess = DD_MAXPATH;
fb->nam.nam$l_rsa = &fb->rsa;
fb->nam.nam$b_rss = DD_MAXPATH;
fb->dd_attribs = attrib;
if (SYS$PARSE(&fb->fab, 0, 0) != RMS$_NORMAL)
{
memset(fb, 0x0, sizeof(dd_ffblk)); /* Invalidate structure */
errno = ENOENT; /* No file found */
return -1; /* Initialization failed */
}
return dd_findnext(fb);
}
#else /* ?UNIX or EMX */
# include "match.h"
int dd_findnext(dd_ffblk* fb)
{
if (!fb->dd_dirp) goto findnext_err;
while ((fb->dd_dp = readdir(fb->dd_dirp)) != NULL)
{
if (STAT(fb->dd_dp->d_name, &dd_sstat))
continue;
if (dd_sstat.st_mode & S_IFDIR && !(fb->dd_attribs & DD_DIREC))
continue;
if (dd_match(fb->dd_dp->d_name, fb->dd_filespec, 0))
{
/* fill in file info */
fb->dd_name = fb->dd_dp->d_name;
fb->dd_size = dd_sstat.st_size;
fb->dd_time = dd_sstat.st_mtime;
fb->dd_mode = dd_sstat.st_mode;
return 0; /* successful match */
}
} /* while */
/* Ignore readdir() errors. e.g. No such file or directory,
or Permission denied. */
if (closedir(fb->dd_dirp) != 0) {
print_error(_("Unable to close directory: %s\n"), strerror(errno));
}
findnext_err:
memset(fb, 0x0, sizeof(dd_ffblk)); /* invalidate structure */
errno = ENOENT; /* no file found */
return -1;
} /** dd_findnext **/
int dd_findfirst( const char *path,dd_ffblk* fb,int attrib)
{
char *s = strrchr(path, DIR_END);
char dir[DD_MAXDIR]; /* directory path */
if (s) {
size_t len = (size_t)(s - path);
wcd_strncpy(fb->dd_filespec, s+1,sizeof(fb->dd_filespec));
strncpy(dir, path, len);
dir[(int)len] = '\0';
} else {
wcd_strncpy(fb->dd_filespec, path,sizeof(fb->dd_filespec));
strcpy(dir, "."); /* use current directory */
}
fb->dd_filespec[sizeof(fb->dd_filespec)-1] = '\0';
fb->dd_attribs = (char)attrib;
fb->dd_dirp = opendir(dir);
if (fb->dd_dirp == NULL) {
print_error(_("Unable to open directory %s: %s\n"), dir, strerror(errno));
}
return dd_findnext(fb);
} /** dd_findfirst **/
#endif /* ?__MSDOS__ */
wcd-5.3.4/src/dosdir.h 0000644 0001755 0001001 00000020465 13033024046 013775 0 ustar waterlan Geen /* dosdir.h
Defines structures, macros, and functions for dealing with
directories and pathnames.
Copyright (C) 1994 Jason Mathews
This is free software; you can redistribute it and/or modify it under the
terms of the GNU General Public License, see the file COPYING.
Modification history:
V1.0 13-May-94, J Mathews Original version.
V1.1 8-Jun-94, J Mathews Added VMS definitions, added dd_
prefix to functions/constants.
Jun 23 1998, Erwin Waterlander, DJGPP compatibilty
Oct 28 1999, Erwin Waterlander, update for WIN32 console appl.
Jan 3 2000, Erwin Waterlander, update for Mingw32 compiler.
Jul 14 2008, Erwin Waterlander, update for OS/2.
Aug 2012, Major cleanup macros:
* Use only C99 predefined macros.
* Use __MSDOS__ only when it's real for MS-DOS.
* UNIX is not defined on OS/2 EMX (fixed tailor.h, UNIX got defined,
because _BSD_SOURCE is defined with EMX (GCC on OS/2)).
* Make it compile with Watcom C for OS/2.
* Borland C and LCC may have been broken, because these are not supported
anymore.
Erwin Waterlander
*/
#ifndef _DOSDIR_H
#define _DOSDIR_H
/* Set up portability */
#include
#include "tailor.h"
#include "wcd.h"
#ifdef _MSC_VER
typedef unsigned int mode_t;
#endif
/* intptr_t is new since C99. An integer type capable of holding a pointer.
When you use an older C standard your compiler may still support intptr_t.
Older compilers may not support it. */
#ifdef _WIN64
typedef intptr_t wcd_intptr_t;
#else
typedef int wcd_intptr_t;
#endif
#ifdef __MSDOS__
# include
# ifdef __TURBOC__
# include
# else
# include
# endif
# define ALL_FILES_MASK "*.*"
# define DIR_PARENT ".."
# define DIR_END '\\'
#elif defined(_WIN32)
# ifdef __WATCOMC__
# include /* Watcom C does not have _getdrives(). We use the dos functions. */
# endif
# include
# include
# ifdef WCD_UTF16
# define ALL_FILES_MASK L"*.*"
# else
# define ALL_FILES_MASK "*.*"
# endif
# define DIR_PARENT ".."
# define DIR_END '\\'
#elif (defined(__OS2__) && !defined(__EMX__))
# include
# include
# define INCL_DOSFILEMGR
# include
# define ALL_FILES_MASK "*"
# define DIR_PARENT ".."
# define DIR_END '\\'
#elif defined(VMS)
# include
# define ALL_FILES_MASK "*.*"
# define DIR_PARENT "[-]"
# define DIR_END ']'
#else /* ?UNIX or EMX */
# ifdef __OS2__
# define INCL_DOSFILEMGR
# include
# define ALL_FILES_MASK "*"
# define DIR_END '\\'
# else
# define ALL_FILES_MASK "*"
# define DIR_END '/'
# endif
# include
# include
# define DIR_PARENT ".."
#endif /* ?__TURBOC__ */
/* MS-DOS flags equivalent to "dos.h" file attribute definitions */
#define DD_NORMAL 0x00 /* Normal file, no attributes */
#define DD_RDONLY 0x01 /* Read only attribute */
#define DD_HIDDEN 0x02 /* Hidden file */
#define DD_SYSTEM 0x04 /* System file */
#define DD_LABEL 0x08 /* Volume label */
#define DD_DIREC 0x10 /* Directory */
#define DD_ARCH 0x20 /* Archive */
#define DD_DEVICE 0x40 /* Device */
#define DD_DOSATTRIBS 0x3f /* DOS ATTRIBUTE MASK */
/*
* note that all DOS file attributes defined above do not overlap the
* DOS stat definitions, but will conflict will non-DOS machines, so
* use following macros to access the flags instead.
*/
#define DD_ISNORMAL(m) ((m) & S_IFREG)
#if defined(__MSDOS__) || defined(_WIN32) || (defined(__OS2__) && !defined(__EMX__))
# define DD_ISRDONLY(m) ((m) & DD_RDONLY)
# define DD_ISHIDDEN(m) ((m) & DD_HIDDEN)
# define DD_ISSYSTEM(m) ((m) & DD_SYSTEM)
# define DD_ISLABEL(m) ((m) & DD_LABEL)
# define DD_ISDIREC(m) ((m) & (DD_DIREC | S_IFDIR))
# define DD_ISARCH(m) ((m) & DD_ARCH)
#else
# define DD_ISRDONLY(m) !((m) & S_IWRITE)
# define DD_ISHIDDEN(m) (0)
# define DD_ISSYSTEM(m) (0)
# define DD_ISLABEL(m) (0)
# define DD_ISDIREC(m) ((m) & S_IFDIR)
# define DD_ISARCH(m) (0)
#endif /* ?__MSDOS__ */
#if (defined(UNIX) || defined(VMS) || defined(__EMX__))
# include
# ifndef ENOENT
# define ENOENT -1
# endif
# ifndef ENMFILE
# define ENMFILE ENOENT
# endif
#endif /* ?UNIX/VMS */
/* flags used by fnsplit */
#ifndef __TURBOC__
# define WILDCARDS 0x01
# define EXTENSION 0x02
# define FILENAME 0x04
# define DIRECTORY 0x08
# define DRIVE 0x10
#endif
/* definitions and types corresponding to those in dir.h */
#include /* for time_t definition */
#if defined(__GO32__) || defined(_WIN32) || defined(__OS2__) || defined(__386__)
/* flat memory, _long_ directory names */
# define __FLAT__ 1
#endif
/*
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(__MSDOS__) || defined(_WIN32) || (defined(__OS2__) && !defined(__EMX__))
# define DD_MAXDRIVE 3
# ifndef __FLAT__
/* DOS 16 bit */
# define DD_MAXPATH 80
# define DD_MAXDIR 66
# define DD_MAXFILE 16
# define DD_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 DD_MAXPATH 1028
# define DD_MAXDIR 1024
# define DD_MAXFILE 256
# define DD_MAXEXT 256
# endif /* ?__FLAT__ */
# if defined(__TURBOC__) || defined(_MSC_VER)
typedef long off_t;
# endif
# ifdef __TURBOC__
typedef short mode_t;
# endif /* ?__TURBOC__ */
#elif defined(VMS)
# define DD_MAXPATH NAM$C_MAXRSS
# define DD_MAXDRIVE 1
# define DD_MAXDIR NAM$C_MAXRSS
# define DD_MAXFILE 80
# define DD_MAXEXT 32
typedef unsigned short mode_t;
#else /* ?unix or EMX */
/*
* DD_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 DD_MAXPATH 1024
# define DD_MAXDIR 1024
# define DD_MAXFILE 255
# ifdef __OS2__
# define DD_MAXDRIVE 3
# define DD_MAXEXT 256
# else
# define DD_MAXDRIVE 1
# define DD_MAXEXT 1
# endif
typedef struct dirent DIR_ENT;
#endif /* ?__MSDOS__ */
typedef struct {
#ifdef WCD_UTF16
/* We need a buffer, because we convert the UTF-16 wide character
* name to an UTF-8 multi-byte string. */
char dd_name[DD_MAXPATH]; /* File name */
#else
char* dd_name; /* File name */
#endif
time_t dd_time; /* File time stamp */
off_t dd_size; /* File length */
mode_t dd_mode; /* Attributes of file */
/* Below is private (machine specific) data, which should
* only be accessed by dosdir modules.
*/
#if defined(__MSDOS__) || defined(_WIN32) || (defined(__OS2__) && !defined(__EMX__))
# ifdef __TURBOC__
struct ffblk dos_fb;
# elif defined(_WIN32) || (defined(__OS2__) && !defined(__EMX__))
# ifdef WCD_UTF16
struct _wfinddata_t dos_fb;
# else
struct _finddata_t dos_fb;
# endif
wcd_intptr_t nHandle;
char dd_attribs;
# else /* ?MSC */
struct find_t dos_fb;
# endif /* ?TURBOC */
#elif defined (VMS)
struct FAB fab;
struct NAM nam;
char rms_filespec[DD_MAXPATH];
char esa[DD_MAXPATH];
char rsa[DD_MAXPATH];
char path[DD_MAXPATH];
char* filespec;
char dd_attribs;
#else /* ?unix */
DIR* dd_dirp; /* Directory ptr */
DIR_ENT* dd_dp; /* Directory entry */
char dd_attribs; /* File search attributes */
char dd_filespec[DD_MAXFILE]; /* File search mask */
#endif /* ?__MSDOS__ */
} dd_ffblk;
#ifdef __cplusplus
extern "C" {
#endif
wcd_intptr_t dd_findfirst(const wcd_char *path, dd_ffblk *fb, int attrib);
wcd_intptr_t dd_findnext(dd_ffblk *fb);
int dd_fnsplit(const char *path, char * drive, char * dir,
char * name, char * ext);
#ifndef __TURBOC__
int getdisk(void);
int setdisk(int drive);
#endif /* ?!__TURBOC__ */
#ifdef __cplusplus
}
#endif
#ifdef WCD_UTF16
extern struct _stat dd_sstat;
#else
extern struct stat dd_sstat;
#endif
#endif /* _DOSDIR_H */
wcd-5.3.4/src/etc/ 0000755 0001755 0001001 00000000000 13033024046 013104 5 ustar waterlan Geen wcd-5.3.4/src/etc/profile.d/ 0000755 0001755 0001001 00000000000 13033024046 014766 5 ustar waterlan Geen wcd-5.3.4/src/etc/profile.d/wcd.csh 0000755 0001755 0001001 00000002453 13033024046 016251 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-5.3.4/src/etc/profile.d/wcd.sh 0000755 0001755 0001001 00000002425 13033024046 016105 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-5.3.4/src/graphics.c 0000644 0001755 0001001 00000223236 13033024046 014305 0 ustar waterlan Geen /*
Copyright (C) 2000-2016 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
http://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
http://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
#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 "dosdir.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 */
#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 DD_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()
{
/* end curses mode */
endwin();
refresh(); /* start curses */
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);
}
#if CAN_RESIZE
void signalSigwinch (int sig)
{
ioResize ();
signal(SIGWINCH,signalSigwinch);
}
#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[DD_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[DD_MAXPATH];
static wchar_t wstr_right[DD_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)DD_MAXPATH);
size_t len2 = MBSTOWCS(wstr_right, t_right, (size_t)DD_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[DD_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(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[DD_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 DD_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)(DD_MAXPATH+1));
}
if (tline == NULL)
{
tline = textNewSize((size_t)(DD_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[DD_MAXPATH];
size_t len = MBSTOWCS(wstr,(char *)s,(size_t)DD_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)DD_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)DD_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 DD_MAXPATH */
strcat((char *)s, getNodeFullPath(wcd_cwin.curNode));
wcd_fixpath((char *)s, (size_t)DD_MAXPATH);
if (s != NULL)
{
#if defined(WCD_UNICODE) || defined(WCD_WINDOWS)
static wchar_t wstr[DD_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)DD_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, false, false);
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[DD_MAXPATH];
char *ptr, *ptr2;
#ifndef __PDCURSES__
SCREEN *sp;
#endif
#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)DD_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);
#if CAN_RESIZE
signal (SIGWINCH, signalSigwinch);
#endif
/* Older versions of PDCurses and ncurses < 5.9.20120922 do not
* support newterm() on Windows */
#if defined(__PDCURSES__) || (defined(_WIN32) && !defined(__CYGWIN__))
initscr();
#else
sp = newterm(NULL,stdout,stdin);
if (sp == NULL)
{
print_error("%s", _("Error opening terminal, falling back to stdout interface.\n"));
return NULL;
}
#endif
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);
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 */
}
if (wcd_cwin.scrollWin == NULL)
{
endwin();
#ifdef XCURSES
XCursesExit();
#endif
print_error("%s", _("error creating scroll window.\n"));
return NULL;
}
scrollok(wcd_cwin.scrollWin, TRUE);
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'):
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 DD_MAXPATH */
strcat(ptr,getNodeFullPath(wcd_cwin.curNode));
wcd_fixpath(ptr, (size_t)DD_MAXPATH);
break;
case 8: /* backspace */
case KEY_BACKSPACE:
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;
case 127: /* delete */
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)
{
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);
}
endwin();
#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 */
ptr++;
#endif
wcd_fixpath(ptr, (size_t)DD_MAXPATH);
return(ptr);
}
#endif /* WCD_USECURSES */
wcd-5.3.4/src/graphics.h 0000644 0001755 0001001 00000003502 13033024046 014302 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-5.3.4/src/Makefile 0000644 0001755 0001001 00000044275 13033024045 014004 0 ustar waterlan Geen #
# Copyright information
#
# Copyright (C) 2009-2016 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-doc dist dist-zip dist-tgz
.PHONY: 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)
INSTALL_OBJS_MAN1 = man/man1/wcd.1
HTMLEXT = htm
INSTALL_OBJS_DOC_INSTALL = \
../doc/INSTALL.txt \
../doc/UNIX.txt \
../doc/RPM.txt
INSTALL_OBJS_DOC_COPYING = \
../doc/copying.txt
# 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 \
$(INSTALL_OBJS_DOC_INSTALL) \
$(INSTALL_OBJS_DOC_COPYING) \
man/man1/$(PACKAGE).txt \
man/man1/$(PACKAGE).$(HTMLEXT)
ifdef ENABLE_NLS
POT = po/$(PACKAGE).pot
POFILES = $(wildcard po/*.po)
MOFILES = $(patsubst %.po,%.mo,$(POFILES))
NLSSUFFIX = -nls
endif
DOCFILES = man/man1/$(PACKAGE).txt man/man1/$(PACKAGE).$(HTMLEXT)
ifdef ENABLE_NLS
MANPOTFILE = po-man/wcd-man.pot
MANPOFILES = $(wildcard po-man/*.po)
PODFILES = $(patsubst po-man/%.po,man/%/man1/wcd.pod,$(MANPOFILES))
endif
PODFILES_ALL = man/man1/wcd.pod $(PODFILES)
MANFILES = $(patsubst %.pod,%.1,$(PODFILES))
TXTFILES = $(patsubst %.pod,%.txt,$(PODFILES_ALL))
HTMLFILES = $(patsubst %.pod,%.$(HTMLEXT),$(PODFILES_ALL))
PSFILES = $(patsubst %.pod,%.ps,$(PODFILES_ALL))
PDFFILES = $(patsubst %.pod,%.pdf,$(PODFILES_ALL))
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 = -lcx
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 =
CFLAGS ?= -O2
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)
ifeq ($(DEBUG), 1)
EXTRA_CFLAGS += -g
endif
ifdef STATIC
LDFLAG_STATIC = -static
endif
ifdef LFS
EXTRA_CFLAGS += -D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64
endif
ifdef ASCII_TREE
EXTRA_CFLAGS += -DASCII_TREE
endif
LDFLAGS_USER =
LDFLAGS = $(RPM_OPT_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 \
dosdir.o \
wfixpath.o \
wcddir.o \
matchl.o \
querycp.o \
$(EXTRA_OBJ)
ifneq (,$(CURSES))
OBJS1 += colors.o \
graphics.o
endif
all: $(BIN) $(DOCFILES) $(MOFILES) $(INSTALL_OBJS_MAN1) $(MANFILES) $(MANPOTFILE)
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/uk/man1/$(PACKAGE).$(HTMLEXT) : man/uk/man1/$(PACKAGE).pod
PERL_UNICODE=SDA pod2html --title="$(PACKAGE) $(VERSION) - довільна зміна каталогу (Wherever Change Directory)" $< > $@
man: man/man1/wcd.1 $(MANFILES) $(MANPOTFILE)
html: $(HTMLFILES)
txt: $(TXTFILES)
ps: $(PSFILES)
pdf: $(PDFFILES)
mofiles: $(MOFILES)
doc: $(DOCFILES)
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 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: $(DOCFILES)
@echo "-- target: install-doc"
$(MKDIR) -p -m 755 $(DESTDIR)$(docdir)
$(INSTALL_DATA) $(INSTALL_OBJS_DOC) $(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
# Install translated manuals when they have been generated.
$(foreach txtfile, $(wildcard man/*/man1/*.txt), $(MKDIR) -p -m 755 $(DESTDIR)$(docdir)/$(word 2,$(subst /, ,$(txtfile),)) ;)
$(foreach txtfile, $(wildcard man/*/man1/*.txt), $(INSTALL_DATA) $(txtfile) $(DESTDIR)$(docdir)/$(word 2,$(subst /, ,$(txtfile),)) ;)
$(foreach htmlfile, $(wildcard man/*/man1/*.$(HTMLEXT)), $(MKDIR) -p -m 755 $(DESTDIR)$(docdir)/$(word 2,$(subst /, ,$(htmlfile),)) ;)
$(foreach htmlfile, $(wildcard man/*/man1/*.$(HTMLEXT)), $(INSTALL_DATA) $(htmlfile) $(DESTDIR)$(docdir)/$(word 2,$(subst /, ,$(htmlfile),)) ;)
$(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: $(INSTALL_OBJS_MAN1) $(MANFILES) $(MANPOTFILE)
@echo "-- target: install-man"
$(MKDIR) -p -m 755 $(DESTDIR)$(man1dir)
$(INSTALL_DATA) $(INSTALL_OBJS_MAN1) $(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)
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-5.3.4/src/man/ 0000755 0001755 0001001 00000000000 13033024062 013102 5 ustar waterlan Geen wcd-5.3.4/src/man/de/ 0000755 0001755 0001001 00000000000 13033024061 013471 5 ustar waterlan Geen wcd-5.3.4/src/man/de/man1/ 0000755 0001755 0001001 00000000000 13033024072 014327 5 ustar waterlan Geen wcd-5.3.4/src/man/de/man1/wcd.1 0000644 0001755 0001001 00000171624 13033024062 015200 0 ustar waterlan Geen .\" Automatically generated by Pod::Man 2.28 (Pod::Simple 3.35)
.\"
.\" 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 turned on, 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 "2017-01-03" "wcd" "2017-01-03"
.\" 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 "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 \fIvim\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 \fIvim\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 \fIcd\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 ()
\& {
\& /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 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
.Vb 5
\& wcd ()
\& {
\& /wcd.exe "$@"
\& . ${WCDHOME:\-${HOME:\-"c:"}}/wcd.go
\& }
.Ve
.PP
Die WinZsh-Version von wcd ist auch etwas anders. Es gibt kein
\&\f(CW\*(C`bin\*(C'\fR\-Verzeichnis.
.PP
.Vb 5
\& wcd ()
\& {
\& /wcd.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 "/wcd.exe \e!* ; source $WCDHOME/bin/wcd.go"
\& else
\& alias wcd "/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.go\*(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
\& {
\& \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 \fIgettext\fR\|(1):
.
Auf Unix-Systemen können Sie den Befehl \fIlocale\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 »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
.
.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 \fIxterm\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 7
\& 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
\& 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: \ertdata.wcd
\& Unix: /.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 \fIxterm\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 \fIscreen\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 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"
\&\fIsh\fR\|(1), \fIbash\fR\|(1), \fIcsh\fR\|(1), \fIksh\fR\|(1), \fIzsh\fR\|(1), \fIlocale\fR\|(1), \fIncurses\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-5.3.4/src/man/de/man1/wcd.htm 0000644 0001755 0001001 00000200024 13033024070 015612 0 ustar waterlan Geen
wcd 5.3.4 - 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.
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 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.go 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
{
<PFAD>\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
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 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-5.3.4/src/man/de/man1/wcd.txt 0000644 0001755 0001001 00000156422 13033024067 015663 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.
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 ()
{
/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 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.
wcd ()
{
/wcd.exe "$@"
. ${WCDHOME:-${HOME:-"c:"}}/wcd.go
}
Die WinZsh-Version von wcd ist auch etwas anders. Es gibt kein
"bin"-Verzeichnis.
wcd ()
{
/wcd.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 "/wcd.exe \!* ; source $WCDHOME/bin/wcd.go"
else
alias wcd "/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.go" 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
{
\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
Unix: $HOME/bin/wcd.go
Datei für relative Baumansicht
Textdatei mit relativen Pfaden von *VERZEICHNIS*. Siehe die Optionen
+S, -n und +n.
DOS: \rtdata.wcd
Unix: /.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 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-5.3.4/src/man/man1/ 0000755 0001755 0001001 00000000000 13033024067 013743 5 ustar waterlan Geen wcd-5.3.4/src/man/man1/Makefile 0000644 0001755 0001001 00000004520 13033024046 015401 0 ustar waterlan Geen # pod2man.mk -- Makefile portion to convert *.pod files to manual pages
#
# Copyright information
#
# Copyright (C) 2008-2009 Jari Aalto
# Copyright (C) 2010-2016 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 at
# Visit .
#
# Description
#
# Convert *.pod files to manual pages.
ifneq (,)
This makefile requires GNU Make.
endif
.PRECIOUS: %.pod
# This variable *must* be set when calling
PACKAGE ?= wcd
# Optional variables to set
MANSECT ?= 1
PODCENTER ?= $$(date "+%Y-%m-%d")
# Directories
MANSRC =
MANDEST = $(MANSRC)
MANPOD = $(MANSRC)$(PACKAGE).pod
MANPAGE = $(MANDEST)$(PACKAGE).$(MANSECT)
POD2MAN = pod2man
POD2MAN_FLAGS =
POFILES = $(wildcard ../*/man1/wcd.po)
PODFILES = $(patsubst %.po,%.pod,$(POFILES))
MAN_OBJECTS = wcd.1 $(patsubst %.pod,%.1,$(PODFILES))
MKDIR = mkdir
all: $(MAN_OBJECTS) ../../po-man/wcd-man.pot
../../po-man/wcd-man.pot : wcd.pod
po4a-updatepo -f pod -m $< -p $@ --msgmerge-opt --no-wrap
%.po : wcd.pod
po4a-updatepo -f pod -m $< -p $@ --msgmerge-opt "--backup=numbered --no-wrap"
# change timestamp in case .po file was not updated.
touch $@
# Create pod files from po.
# Fix problem that =encoding is before =pod command.
../%/man1/wcd.pod : ../../po-man/%.po
$(MKDIR) -p $(dir $@)
po4a-translate -f pod -m wcd.pod -p $< > $@ -k 30
perl -ni.bak -e 'print unless /=encoding UTF-8/' $@
perl -pli.bak -e 's/=pod/=pod\n\n=encoding UTF-8/' $@
# An empty recipe for wcd.pod to break circular dependency.
wcd.pod : ;
%.1 : %.pod
# make target - create manual page from a *.pod page
podchecker $<
$(POD2MAN) $(POD2MAN_FLAGS) \
--utf8 \
--center="$(PODCENTER)" \
--name="$(PACKAGE)" \
--section="$(MANSECT)" \
$< \
| perl -p -e 's/[Pp]erl v[0-9.]+/$(PACKAGE)/;' \
> $@ && \
rm -f pod*.tmp
clean:
rm -f $(MAN_OBJECTS)
rm -f wcd-man.pot
rm -f $(PODFILES)
# End of of Makefile part
wcd-5.3.4/src/man/man1/wcd.1 0000644 0001755 0001001 00000151057 13033024056 014611 0 ustar waterlan Geen .\" Automatically generated by Pod::Man 2.28 (Pod::Simple 3.35)
.\"
.\" 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 turned on, 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 "2017-01-03" "wcd" "2017-01-03"
.\" For nroff, turn off justification. Always turn off hyphenation; it makes
.\" way too many mistakes in technical documents.
.if n .ad l
.nh
.SH "NAME"
wcd \- Wherever Change Directory
.PP
chdir for DOS and Unix
.SH "SYNOPSIS"
.IX Header "SYNOPSIS"
.Vb 1
\& wcd [options] [directory]
.Ve
.SH "DESCRIPTION"
.IX Header "DESCRIPTION"
.SS "Overview"
.IX Subsection "Overview"
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.
.PP
Wcd was modeled after Norton Change Directory (\s-1NCD\s0). \s-1NCD\s0 appeared first in
\&\fIThe Norton Utilities, Release 4\fR, for \s-1DOS\s0 in 1987, published by Peter Norton.
.PP
Wcd has been ported to different command-line shells: \s-1DOS\s0 command.com,
Windows cmd.exe and PowerShell, \s-1OS/2\s0 cmd.exe, and Unix shells such as Bourne
(sh), Bourne Again (bash), Korn (ksh), Z (zsh), and C (csh) shell and others
running on any operating system.
.PP
Wcd supports 8 bit character sets on all systems, and has optional
support for Unicode. See section \s-1LOCALIZATION.\s0
.PP
See section \s-1INSTALLATION\s0 how to setup wcd for personal use.
.SS "Basic use"
.IX Subsection "Basic use"
By default (if no wildcards are used) wcd searches for a directory with a
name that begins with the typed name.
.PP
For instance this command will change to directory to the current user's
\&\f(CW\*(C`/home/user/Desktop\*(C'\fR:
.PP
.Vb 1
\& wcd Desk
.Ve
.PP
When there are multiple matches, wcd will present the user a list of all
matches. The user can then make a selection with a few keystrokes (most of
the times only one).
.SS "Wildcards"
.IX Subsection "Wildcards"
Wcd supports following wildcards:
.PP
.Vb 4
\& * matches any sequence of characters (zero or more)
\& ? matches any character
\& [SET] matches any character in the specified set,
\& [!SET] or [^SET] matches any character not in the specified set.
.Ve
.PP
A set is composed of characters or ranges; a range looks like
\&\fIcharacter hyphen character\fR as in \f(CW\*(C`0\-9\*(C'\fR or \f(CW\*(C`A\-Z\*(C'\fR. The
\&\f(CW\*(C`[0\-9a\-zA\-Z_]\*(C'\fR is the minimal set of characters allowed in the
\&\f(CW\*(C`[..]\*(C'\fR pattern construct. International characters (i.e. 8 bit characters) are
allowed if the system supports them. To suppress the special syntactic
significance of any of \f(CW\*(C`[]*?!^\-\e\*(C'\fR inside or outside a \f(CW\*(C`[..]\*(C'\fR construct and
match the character exactly, precede the character with a backslash (\f(CW\*(C`\e\*(C'\fR)
marker.
.PP
Using wildcards makes powerful searching possible. For instance this
matches any directory name that ends with \*(L"top\*(R":
.PP
.Vb 1
\& wcd *top
.Ve
.PP
Match directories that have \*(L"top\*(R" anywhere in the name:
.PP
.Vb 1
\& wcd *top*
.Ve
.PP
Match any directory name that begins with \*(L"a\*(R", \*(L"b\*(R" or \*(L"c\*(R":
.PP
.Vb 1
\& wcd [a\-c]*
.Ve
.PP
It is also possible to give a part of a directory path. Here Wcd searches
for directory that begins with \*(L"Desk\*(R" and which path matches \fI*me/Desk*\fR.
.PP
.Vb 1
\& wcd me/Desk
.Ve
.PP
It is allowed to type any kind of expression with slashes and wildcards.
E.g.:
.PP
.Vb 1
\& wcd src*/*1?/a*2
.Ve
.SS "Other uses"
.IX Subsection "Other uses"
If no wildcards are used and wcd finds a perfect match, wcd will ignore all
wild matches by default. This behaviour can be changed with the \fB\-w\fR option.
.PP
The interactive directory tree browser can be started by using option \fB\-g\fR.
.PP
.Vb 1
\& wcd \-g
.Ve
.PP
Wcd generates a treedata file where it searches the directory. On Unix and
Windows systems wcd does add symbolic links to the treedata file while
scanning the disk, but does not follow them. While following links wcd could
end up scanning infinite loops, or scan very large portions of a network.
.PP
Wcd can also change to directories that are not in the treedata file. E.g.:
.PP
.Vb 1
\& wcd ..
.Ve
.PP
If wcd found a match but can't change to the directory it tries to remove
it from the default treedata file. Not from the extra treedata file. See
also option \fB\-k\fR.
.PP
Wcd keeps a directory stack which is stored on disk. The stack has a
default size of 10 and is cyclic. See options \fB\-z\fR, \fB\-\fR, \fB+\fR and
\&\fB=\fR.
.PP
In multi-user environments option \fB\-u\fR can be used to change to
directories of other users.
.PP
On \s-1DOS\s0 and Windows systems it does not matter if you use a slash \*(L"/\*(R" or a
backslash \*(L"\e\*(R" as a directory separator.
.PP
It is possible on \s-1DOS\s0 and Windows systems to change drive and directory in
one go by preceding the directory name with the drive name.
.PP
.Vb 1
\& wcd d:games
.Ve
.SS "Windows \s-1UNC\s0 paths"
.IX Subsection "Windows UNC paths"
The Windows versions (Command Prompt, PowerShell, \s-1MSYS,\s0 zsh, cygwin) support
Windows \s-1SMB LAN UNC\s0 paths without drive letter such as
\&\f(CW\*(C`\e\eservername\esharename\*(C'\fR. Wcd for Windows Command Prompt makes use of the \*(L"pushd\*(R"
command to automatically map a \s-1UNC\s0 path to a drive letter. In Windows
PowerShell, \s-1MSYS,\s0 zsh and Cygwin \s-1UNC\s0 paths are fully supported. The
current working directory can be a \s-1UNC\s0 path.
.SS "Interfaces"
.IX Subsection "Interfaces"
Wcd has three different interfaces to choose from a list of matches. The
interface can be chosen at compile time.
.PP
The first interface uses plain stdin/stdout. A numbered list is printed in
the terminal. The user has to choose from the list by typing a number
followed by . This interface does not provide scroll back
functionality in case of a long list. The scroll back capability of the
terminal/console has to be used. It is very small and portable.
.PP
The second interface is built with the conio library. It provides a builtin
scroll back capability. The user is presented a list numbered with letters.
Choosing from a list can be done by pressing just one letter. This
interface is fast because it saves keystrokes. If possible the screen
will be restored after exiting. One who prefers to type numbers can use the
\&\fB\-N\fR option.
.PP
The third interface is built with the curses library. It is similar to the
conio interface. The curses version of wcd has also an additional 'graphical'
interface. It lets the user select a directory via a full screen
interactive directory tree browser. It has a \fIvim\fR\|(1) like navigation and search
method. It can be activated with option \fB\-g\fR.
.PP
By using the \fB\-o\fR option one can always fall back to the stdin/stdout
interface.
.SH "OPTIONS"
.IX Header "OPTIONS"
.IP "\fB\-a\fR" 4
.IX Item "-a"
Add current path to the default treedata file.
.Sp
Use this option to quickly add the current path to the default treedata
file. Re-scanning the complete disk can take a long time in some cases.
.IP "\fB\-aa\fR" 4
.IX Item "-aa"
Add current and all parent paths to the default treedata file.
.IP "\fB\-A \s-1PATH\s0\fR" 4
.IX Item "-A PATH"
Scan directory tree from \fI\s-1PATH\s0\fR and append to the default treedata
file. Examples:
.Sp
.Vb 3
\& wcd \-A .
\& wcd \-A /home \-A /etc
\& wcd \-A d: \-A e: \-A \e\eserver\eshare
.Ve
.Sp
On Windows one can scan all shared directories of a Windows \s-1LAN\s0 server by
typing something like: \f(CW\*(C`wcd \-A \e\eservername\*(C'\fR.
.Sp
See also option \fB\-S\fR and \fB\-s\fR and \fB\-E\fR.
.IP "\fB\-b\fR" 4
.IX Item "-b"
Ban current path.
.Sp
Wcd places the current path in the ban file. This means that wcd ignores
all matches of this directory and its sub directories.
.Sp
The ban file can be edited with a text editor. Use of wildcards is
supported and names are matched against the absolute path.
.Sp
Banned paths are not excluded from scanning the disk. To do that use option
\&\fB\-xf\fR.
.IP "\fB\-c, \-\-direct\-cd\fR" 4
.IX Item "-c, --direct-cd"
Direct \s-1CD\s0 mode. By default wcd works as follows:
.Sp
.Vb 2
\& 1. Try to find a match in the treedata file(s)
\& 2. If no match, try to open the directory you typed.
.Ve
.Sp
In direct \s-1CD\s0 mode wcd works in reversed order.
.Sp
.Vb 2
\& 1. Try to open the directory you typed.
\& 2. If not, try to find a match in the treedata file(s).
.Ve
.IP "\fB\-d \s-1DRIVE\s0\fR" 4
.IX Item "-d DRIVE"
Set drive for stack and go file (\s-1DOS\s0 only).
.Sp
The stack file and the go-script are by default stored on drive C: if
environment variable \fI\s-1HOME\s0\fR is not set. Use this option if drive C: is a
read-only drive. This option must be used in front of the stack options \fB\-\fR,
\&\fB+\fR and \fB=\fR.
.IP "\fB\-e\fR" 4
.IX Item "-e"
Add current path to the extra treedata file.
.Sp
Use this option to quickly add the current path to the extra treedata file.
.IP "\fB\-ee\fR" 4
.IX Item "-ee"
Add current and all parent paths to extra treedata file.
.IP "\fB\-E \s-1PATH\s0\fR" 4
.IX Item "-E PATH"
Scan directory tree from \fI\s-1PATH\s0\fR and append to Extra treedata file. See
also options \fB\-A\fR and \fB\-S\fR.
.IP "\fB\-f \s-1FILE\s0\fR" 4
.IX Item "-f FILE"
Read treedata file \fI\s-1FILE\s0\fR. Do not read the default treedata file.
.IP "\fB+f \s-1FILE\s0\fR" 4
.IX Item "+f FILE"
Read treedata file \fI\s-1FILE\s0\fR in addition to the default treedata file.
.IP "\fB\-g\fR" 4
.IX Item "-g"
Graphical interface (only in version with curses interface).
.Sp
Wcd starts a textual curses based 'graphical' interface. The user can
select a directory via a full-screen interactive directory tree browser. It has
a \fIvim\fR\|(1) like navigation and search method.
.Sp
If no search string is given wcd presents the whole tree which is in the
default treedata file and the extra treedata files.
.Sp
If a search string is given the match list is presented as a directory
tree.
.Sp
The default tree layout is similar to the tree layout of the original \s-1NCD\s0 on
\&\s-1DOS.\s0 The difference in layout is that in \s-1NCD\s0 all directories of a same depth
level were vertically aligned over the whole tree. This was possible in \s-1NCD,\s0
because the maximum width of a directory name in \s-1DOS\s0 was 12 (8.3) characters. On
modern operating systems directory names can be very long, so also the
differences in length can be large. Therefore folders with a same depth are
not vertically aligned over the whole tree in wcd, but only in sub-branches.
So there is some sideways movement when moving straight up and down from one
sub-branch to another sub-branch.
.Sp
The navigation behaviour in Wcd is exactly the same as in the original \s-1NCD.\s0 For
instance if you push the Down key you go down to the next directory with the
same depth level, jumping over branches. This enables fast navigation through
the tree.
.Sp
See options \fB\-Ta\fR, \fB\-TC\fR, and \fB\-Tc\fR to change the navigation behaviour.
.IP "\fB\-gd\fR" 4
.IX Item "-gd"
Dump the treedata files as a tree to stdout.
.IP "\fB\-G \s-1PATH\s0\fR" 4
.IX Item "-G PATH"
Write go-script in directory \fI\s-1PATH\s0\fR. For instance on Unix, \f(CW\*(C`wcd \-G PATH\*(C'\fR will write
a go-script \fBPATH/wcd.go\fR.
.IP "\fB\-GN, \-\-no\-go\-script\fR" 4
.IX Item "-GN, --no-go-script"
Do not create go-script. This option can be used in combination with the
option \fB\-j\fR if one does not want wcd to create a go-script.
.IP "\fB\-h, \-\-help\fR" 4
.IX Item "-h, --help"
Show help and exit.
.IP "\fB\-i, \-\-ignore\-case\fR" 4
.IX Item "-i, --ignore-case"
Ignore case.
Dos and Windows versions of wcd ignore case default. Unix/Cygwin
versions regard case by default.
.IP "\fB+i, \-\-no\-ignore\-case\fR" 4
.IX Item "+i, --no-ignore-case"
Regard case. See also option \fB\-i\fR.
.IP "\fB\-I, \-\-ignore\-diacritics\fR" 4
.IX Item "-I, --ignore-diacritics"
Ignore diacritics for Latin-based scripts.
Letters with diacritical marks match their base letter without diacritical
mark. The following Latin encodings are supported:
\&\s-1CP437, CP850, CP852, CP1250, CP1252, ISO\-8859\-1, ISO\-8859\-2,\s0 and Unicode
Latin\-1, Latin Extended-A, and Latin Extended-B.
See also
.IP "\fB+I, \-\-no\-ignore\-diacritics\fR" 4
.IX Item "+I, --no-ignore-diacritics"
Regard diacritics (default). See also option \fB\-I\fR.
.IP "\fB\-j, \-\-just\-go\fR" 4
.IX Item "-j, --just-go"
Just go mode.
.Sp
In this mode wcd will not present a list when there is more than one
directory that matches the given directory. Wcd will just change to the
first option. When wcd is invoked again with the same arguments it will
change to the next option, and so on.
.Sp
Wcd will print the directory to go to to stdout. So a different
installation method can be used. One could make the following function for
a \s-1POSIX\s0 compatible shell:
.Sp
.Vb 4
\& wcd ()
\& {
\& cd "$($HOME/bin/wcd.exe \-j $@)"
\& }
.Ve
.Sp
When you are using an old shell that doesn't support \*(L"$()\*(R" command substitution
you have to use old style command substitution with back-quotes.
.Sp
.Vb 4
\& wcd ()
\& {
\& cd "\`$HOME/bin/wcd.exe \-j $@\`"
\& }
.Ve
.Sp
On Windows systems, if one is running 4NT shell, one could make the
following alias:
.Sp
.Vb 1
\& alias wcd \`cd %@execstr[wcdwin32.exe \-z 0 \-j %1]\`
.Ve
.Sp
This method eliminates the need of the go-script, so one can use option \fB\-GN\fR
in combination with \fB\-j\fR.
.IP "\fB\-k, \-\-keep\-paths\fR" 4
.IX Item "-k, --keep-paths"
Keep paths.
.Sp
Keep paths in the treedata file when wcd can't change to them. The default
behaviour of wcd is that it tries to remove paths from the treedata when
wcd can't change to them. With this option this behavior is turned off.
.IP "\fB\-K, \-\-color\fR" 4
.IX Item "-K, --color"
Use colors in graphical mode.
.IP "\fB\-l \s-1ALIAS\s0\fR" 4
.IX Item "-l ALIAS"
Name the current path with \fI\s-1ALIAS\s0\fR. Wcd places the current path with alias
\&\fI\s-1ALIAS\s0\fR in the alias file. Aliases are case sensitive.
.IP "\fB\-ls\fR" 4
.IX Item "-ls"
Show the name of the alias file, and list all the aliases.
.IP "\fB\-m \s-1DIR\s0\fR" 4
.IX Item "-m DIR"
Make directory and add to treedata file.
.IP "\fB\-L, \-\-license\fR" 4
.IX Item "-L, --license"
Print the distribution license.
.IP "\fB\-M \s-1DIR\s0\fR" 4
.IX Item "-M DIR"
Make directory and add to extra treedata file.
.IP "\fB\-n \s-1PATH\s0\fR" 4
.IX Item "-n PATH"
Read relative treedata file from \fI\s-1PATH\s0\fR.
.Sp
Do not read the default treedata file. The relative treedata file
should already have been created using the wcd \fB+S\fR option.
\&\fI\s-1PATH\s0\fR may also point to a file directly.
.Sp
An example. Suppose another system has been mounted to mount point
\&\f(CW\*(C`/mnt/network\*(C'\fR:
.Sp
.Vb 1
\& wcd \-n /mnt/network src
.Ve
.Sp
Wcd opens the relative treedata file in \f(CW\*(C`/mnt/network/\*(C'\fR. The file contains the paths
relative from that point.
.IP "\fB+n \s-1PATH\s0\fR" 4
.IX Item "+n PATH"
Read relative treedata file in addition to the default treedata file. See
option \fB\-n\fR.
.IP "\fB\-N, \-\-numbers\fR" 4
.IX Item "-N, --numbers"
Use numbers instead of letters.
.Sp
Wcd with a conio or curses based interface (see section Interfaces) presents
a match list by default numbered with letters. When the \fB\-N\fR option is used
the match list is numbered with numbers. Regardless of the \fB\-N\fR option one
can type a letter or numbers to make a selection from the list of matches.
.IP "\fB\-o\fR" 4
.IX Item "-o"
Use stdin/stdout interface.
.Sp
When for some kind of reason the conio or curses interface of wcd does not
work one can fall back to the stdin/stdout interface of wcd by using the
\&\fB\-o\fR option.
.IP "\fB\-od, \-\-to\-stdout\fR" 4
.IX Item "-od, --to-stdout"
Dump all matches to stdout.
.IP "\fB\-q, \-\-quiet\fR" 4
.IX Item "-q, --quiet"
Quieter operation. Printing of the final match is suppressed.
.IP "\fB\-r \s-1DIR\s0\fR" 4
.IX Item "-r DIR"
Remove directory and remove from the treedata file.
.Sp
If the directory is empty, wcd will remove it, and try to remove it from
the treedata file.
.IP "\fB\-rmtree \s-1DIR\s0\fR" 4
.IX Item "-rmtree DIR"
Recursively remove directory and remove from the treedata file.
.Sp
Wcd will remove the directory and all its sub directories and files, and
remove the directories from the treedata file.
.IP "\fB\-s\fR" 4
.IX Item "-s"
(re)Scan disk from \f(CW$HOME\fR directory. If \fI\s-1HOME\s0\fR is not defined the disk is
scanned from root directory /.
.Sp
The existing default treedata file is overwritten.
.Sp
The default scan directory can be overruled with environment variable
\&\f(CW\*(C`WCDSCAN\*(C'\fR. See section \s-1ENVIRONMENT VARIABLES.\s0
.IP "\fB\-S \s-1PATH\s0\fR" 4
.IX Item "-S PATH"
Scan directory tree from \fI\s-1PATH\s0\fR and overwrite the default treedata file.
See also options \fB\-A\fR, \fB\-s\fR and \fB\-E\fR. E.g. with option \fB\-A\fR you
can create a default treedata file of your choice. Examples:
.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
With the Windows versions one can scan all shared directories of a Windows
\&\s-1LAN\s0 server by typing something like: \f(CW\*(C`wcd \-S \e\eservername\*(C'\fR.
.IP "\fB+S \s-1PATH\s0\fR" 4
.IX Item "+S PATH"
Scan disk from \fI\s-1PATH\s0\fR and place relative paths in a relative treedata file.
This file is used by the \fB\-n\fR and \fB+n\fR options of wcd. E.g. \f(CW\*(C`wcd \-n PATH
src\*(C'\fR.
.IP "\fB\-t\fR" 4
.IX Item "-t"
Do not strip tmp mount dir \f(CW\*(C`/tmp_mnt\*(C'\fR (Unix only)
.Sp
Wcd strips by default \f(CW\*(C`/tmp_mnt/\*(C'\fR from the match. Directory
\&\f(CW\*(C`/tmp_mnt\*(C'\fR is used by the auto-mounter. This behaviour can be turned
off with the \fB\-t\fR option.
.IP "\fB\-T, \-\-ascii\-tree\fR" 4
.IX Item "-T, --ascii-tree"
Draw tree with \s-1ASCII\s0 characters. Use this option if line drawing characters
are not displayed properly in your terminal.
.IP "\fB\-Ta, \-\-alt\-tree\-nav\fR" 4
.IX Item "-Ta, --alt-tree-nav"
Alternative way of navigation in the graphical tree.
.Sp
In the default \s-1NCD\s0 style tree layout the \fB\-Ta\fR option disables
jumping to unrelated directories.
.Sp
In compact tree mode the alternative mode makes navigation similar to
navigation in \s-1GUI\s0 file managers such as Windows Explorer or Linux \s-1KDE\s0
Konqueror. Pressing Up and Down moves the selected folder one line up or
down. Pressing Left first folds the sub-folders and the next move left moves
really left.
.Sp
You can switch on-the-fly between default and alternative navigation
by pressing .
.Sp
When alternative navigation mode is on, you will see an \*(L"A\*(R" in the lower right corner.
.IP "\fB\-TC, \-\-center\-tree\fR" 4
.IX Item "-TC, --center-tree"
Centered view in the graphical tree. The selected directory stays in the middle
of the screen. The centered mode can also be switched on and off with key
in the graphical tree.
.Sp
The standard non-centered behaviour, which minimises tree movement, is the same
as in the original \s-1NCD.\s0
.IP "\fB\-Tc, \-\-compact\-tree\fR" 4
.IX Item "-Tc, --compact-tree"
By default the 'graphical' tree is drawn the same way as the original \s-1NCD\s0 on
\&\s-1DOS\s0 did it. On \s-1DOS\s0 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 \s-1GUI\s0 file
managers, with only one folder per line. Use option \fB\-Tc\fR or switch on-the-fly
with the key.
.IP "\fB\-Td, \-\-cjk\-width\fR" 4
.IX Item "-Td, --cjk-width"
Legacy East-Asian \s-1CJK \s0(Chinese, Japanese, and Korean) fonts have certain
characters and line drawing symbols with a column width of 2, while the normal
Unicode width for these characters is 1 column. For instance the Chinese \s-1CP936\s0
raster font on Windows and the Simsun font. Use this option for a correct
outlining of the graphical tree when a legacy \s-1CJK\s0 font is used.
.Sp
When \s-1CJK\s0 mode is on, you will see a \*(L"C\*(R" in the lower right corner.
.IP "\fB\-u \s-1USER\s0\fR" 4
.IX Item "-u USER"
Scan treedata file of another user based on \fI\s-1USER\s0\fR, do not scan your own default
treedata file. See also section \s-1ENVIRONMENT VARIABLES\s0 for \fI\s-1WCDUSERSHOME\s0\fR.
.Sp
On Unix/Cygwin the base directory
for user home directories is assumed to be \f(CW\*(C`/home\*(C'\fR. Wcd will look for
\&\f(CW\*(C`/home/USER/.treedata.wcd\*(C'\fR and \f(CW\*(C`/home/USER/.wcd/.treedata.wcd\*(C'\fR, in that
order, and read the first one that exists and is readable.
On DOS/Windows the base directory for user
home directories is assumed to be \f(CW\*(C`\e\eusers\*(C'\fR, so wcd tries to read
\&\f(CW\*(C`\e\eusers\eUSER\etreedata.wcd\*(C'\fR and \f(CW\*(C`\e\eusers\eUSER\e.wcd\etreedata.wcd\*(C'\fR.
.IP "\fB+u \s-1USER\s0\fR" 4
.IX Item "+u USER"
Read default treedata file of \s-1USER\s0 in addition to your own treedata
file.
.IP "\fB\-v, \-\-verbose\fR" 4
.IX Item "-v, --verbose"
Display verbose messages. With this option wcd prints all filters, bans and
excludes.
.IP "\fB\-V, \-\-version\fR" 4
.IX Item "-V, --version"
Print version information and exit.
.IP "\fB\-w, \-\-wild\-match\-only\fR" 4
.IX Item "-w, --wild-match-only"
Wild matching only. Treat all matches as wild matches.
.IP "\fB\-x \s-1PATH\s0\fR" 4
.IX Item "-x PATH"
Exclude \fI\s-1PATH\s0\fR from scanning.
.Sp
When this option is used wcd will exclude \fI\s-1PATH\s0\fR and all its subdirectories
when wcd is scanning a disk. Wildcards are supported and matched against
absolute paths. Option \fB\-x\fR can be used multiple times.
.Sp
.Vb 1
\& wcd \-x \-x \-s
.Ve
.Sp
Option \fB\-x\fR must be used in front of any scan option (\fB\-s\fR, \fB\-S\fR, \fB+S\fR,
\&\fB\-A\fR, \fB\-E\fR).
.Sp
On DOS/Windows systems one must specify the drive letter depending on if
environment variable \fI\s-1HOME\s0\fR or \fI\s-1WCDHOME\s0\fR is set. If \fI\s-1HOME\s0\fR or \fI\s-1WCDHOME\s0\fR
is set one needs to specify the drive letter. An example:
.Sp
.Vb 1
\& wcd \-x c:/temp \-S c:
.Ve
.Sp
Otherwise do not specify drive letter.
.Sp
.Vb 1
\& wcd \-x /temp \-s
.Ve
.IP "\fB\-xf \s-1FILE\s0\fR" 4
.IX Item "-xf FILE"
Exclude all paths listed in \fI\s-1FILE\s0\fR from scanning.
.Sp
When this option is used wcd will exclude all paths listed in \fI\s-1FILE\s0\fR and all
their subdirectories when wcd is scanning a disk. Wildcards are supported
and they are matched against absolute paths; one path per line. Be aware
that wcd will not ignore leading or trailing blanks on a line, because they
are legal characters in a directory name. Option \fB\-xf\fR can be used multiple
times. When one wants to exclude all banned paths from scanning one can do
the following (example for wcd on unix):
.Sp
.Vb 1
\& wcd \-xf ~/.ban.wcd \-s
.Ve
.Sp
Wildcards are supported. For instance to exclude all your Subversion directories
with administrative files add a line with \f(CW\*(C`*/.svn\*(C'\fR.
.Sp
Option \fB\-xf\fR must be used in front of any scan option (\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"
Assume Yes on all queries.
.Sp
Wcd will not prompt the user with yes/no questions, but assumes the user
answers yes on all questions. This can be used in combination with option
\&\fB\-rmtree\fR. This option must be used in front of options that can lead
to yes/no questions.
.IP "\fB\-z \s-1NUMBER\s0\fR" 4
.IX Item "-z NUMBER"
Set maximum stack size to \s-1NUMBER.\s0
.Sp
The default size of the stack is 10. Stack operation can be turned off by
setting the size to 0. This option must be used in front of any other stack
operations (\fB\-\fR,\fB+\fR,\fB=\fR). Otherwise the size of the stack will be set
back to the default 10.
.Sp
A correct command is:
.Sp
.Vb 1
\& wcd \-z 50 \-
.Ve
.Sp
The new stack size will be 50, wcd will go one directory back. A wrong
command is:
.Sp
.Vb 1
\& wcd \- \-z 50
.Ve
.Sp
Wcd goes one directory back, the stack gets the default size 10. The \fB\-z
50\fR is ignored.
.Sp
Add this option as the first option to your wcd alias or function. E.g.
for the a \s-1POSIX\s0 compatible shell this would be:
.Sp
.Vb 5
\& wcd ()
\& {
\& wcd.exe \-z 50 "$@"
\& . ${WCDHOME:\-${HOME}}/bin/wcd.go
\& }
.Ve
.IP "\fB\-[\s-1NUMBER\s0]\fR" 4
.IX Item "-[NUMBER]"
Push dir \s-1NUMBER\s0 of times. Default is one.
.Sp
Go back a directory. Command \f(CW\*(C`wcd \-\*(C'\fR goes one directory back. To go more
directories back add a number to it. E.g. command \f(CW\*(C`wcd \-3\*(C'\fR. The stack is
cyclic.
.IP "\fB+[\s-1NUMBER\s0]\fR" 4
.IX Item "+[NUMBER]"
Pop dir \s-1NUMBER\s0 of times. Default is one.
.Sp
Go forward a directory. Command \f(CW\*(C`wcd +\*(C'\fR goes one directory forward. To go
more directories forward add a number to it. E.g. command \f(CW\*(C`wcd +2\*(C'\fR. The
stack is cyclic.
.IP "\fB=\fR" 4
.IX Item "="
Show stack.
.Sp
Use this option if you do not know anymore how many times to push or pop.
The stack is printed and you can choose a number. The current place in
the stack is marked with an asterisk \f(CW\*(C`*\*(C'\fR.
.SH "INSTALLATION"
.IX Header "INSTALLATION"
The current working directory of a Unix shell can only be
changed by the builtin \fIcd\fR\|(1) command. Therefore the program is always called
by a function or an alias. The function or alias sources a shell script
(go-script) which is generated by the wcd program. Wcd can only work after
the function or alias is defined.
.PP
Another important influence on your installation is the definition of
environment variables \fI\s-1HOME\s0\fR and \fI\s-1WCDHOME\s0\fR. See section \s-1ENVIRONMENT
VARIABLES.\s0
.SS "Install for \s-1POSIX\s0 type shells"
.IX Subsection "Install for POSIX type shells"
For a \s-1POSIX\s0 shell (ksh, bash, zsh, etc.) on Unix, Linux, Cygwin, or native \s-1MSYS\s0
add the following function to the shell startup file (e.g. Bash uses
\&\f(CW\*(C`$HOME/.bashrc\*(C'\fR):
.PP
.Vb 5
\& wcd ()
\& {
\& /wcd.exe "$@"
\& . ${WCDHOME:\-${HOME}}/bin/wcd.go
\& }
.Ve
.PP
Replace \fI\s-1PATH\s0\fR with the location where the wcd executable has been
installed. Reload the shell initialization files or start new shell.
.PP
The location of the go-script \f(CW\*(C`wcd.go\*(C'\fR differs per shell.
.PP
Wcd for \s-1DJGPP DOS\s0 bash requires a different function. The go script is not
written in a directory \f(CW\*(C`bin\*(C'\fR, and if \fI\s-1WCDHOME\s0\fR and \fI\s-1HOME\s0\fR are both not defined the
go-script is written on c:/.
.PP
.Vb 5
\& wcd ()
\& {
\& /wcd.exe "$@"
\& . ${WCDHOME:\-${HOME:\-"c:"}}/wcd.go
\& }
.Ve
.PP
The WinZsh version of wcd is also a bit different. No \f(CW\*(C`bin\*(C'\fR directory.
.PP
.Vb 5
\& wcd ()
\& {
\& /wcd.exe "$@"
\& . ${WCDHOME:\-${HOME}}/wcd.go
\& }
.Ve
.PP
See section \s-1FILES\s0 for more information.
.SS "Install for C\-alike shells (csh, tcsh)"
.IX Subsection "Install for C-alike shells (csh, tcsh)"
Add the following alias to the shell startup file \f(CW\*(C`$HOME/.cshrc\*(C'\fR or
\&\f(CW\*(C`$HOME/.tcshrc\*(C'\fR :
.PP
.Vb 5
\& if ( ${?WCDHOME} ) then
\& alias wcd "/wcd.exe \e!* ; source $WCDHOME/bin/wcd.go"
\& else
\& alias wcd "/wcd.exe \e!* ; source $HOME/bin/wcd.go"
\& endif
.Ve
.PP
Replace \fI\s-1PATH\s0\fR with the location where the wcd executable has been installed.
Reload the shell initialization files or start a new shell.
.SS "Windows Command Prompt version"
.IX Subsection "Windows Command Prompt version"
Unpack the zip file and add directory \f(CW\*(C`bin\*(C'\fR to your environment
variable \fI\s-1PATH\s0\fR.
.PP
In Windows Command Prompt a Windows program cannot change the current work
directory, but a .bat file can. The batch scrip \f(CW\*(C`wcd.bat\*(C'\fR runs the wcd program
which generates a new batch script \f(CW\*(C`wcdgo.bat\*(C'\fR. Then \f(CW\*(C`wcd.bat\*(C'\fR runs \f(CW\*(C`wcdgo.bat\*(C'\fR
which actually changes the directory.
.SS "Windows \s-1VISTA\s0 and higher"
.IX Subsection "Windows VISTA and higher"
In a Windows \s-1VISTA\s0 and higher Command Prompt you may have limited access to
directories. To get access to more directories you need administrator
rights. You can get a Command Prompt with administrator rights if you right
click on the Command Prompt icon and select \fIRun as administrator\fR.
.SS "Windows PowerShell version"
.IX Subsection "Windows PowerShell version"
Add the following function to your PowerShell user profile. The location of
this profile is stored in the \f(CW$profile\fR variable. It is required that
one of the environment variables \fI\s-1HOME\s0\fR or \fI\s-1WCDHOME\s0\fR is defined.
.PP
.Vb 5
\& function wcd
\& {
\& \ewcdwin32psh.exe $args
\& & $env:HOME\ewcdgo.ps1
\& }
.Ve
.PP
Replace \fI\s-1PATH\s0\fR with the location where the wcd executable has been installed.
Start a new PowerShell. Wcd for PowerShell supports only the file system
provider. No other providers.
.SS "\s-1OS/2\s0 Command Prompt version"
.IX Subsection "OS/2 Command Prompt version"
In an \s-1OS/2\s0 Command Prompt (cmd.exe) an OS/2\-program can't change the current
work directory. That is why wcd generates a command script \f(CW\*(C`wcdgo.cmd\*(C'\fR which
must be executed in the current shell. The script \f(CW\*(C`wcd.cmd\*(C'\fR first executes
\&\f(CW\*(C`wcdos2.exe\*(C'\fR, which creates the \f(CW\*(C`wcdgo.cmd\*(C'\fR script. Then \f(CW\*(C`wcd.cmd\*(C'\fR executes
the \f(CW\*(C`wcdgo.cmd\*(C'\fR script.
.SH "LOCALIZATION"
.IX Header "LOCALIZATION"
.IP "\fB\s-1LANG\s0\fR" 4
.IX Item "LANG"
The primary language is selected with the environment variable \fI\s-1LANG\s0\fR. The
\&\fI\s-1LANG\s0\fR variable consists out of several parts. The first part is in small
letters the language code. The second one is optional and is the country code
in capital letters, preceded with an underscore. There is also an
optional third part: character encoding, preceded with a dot. A few
examples for \s-1POSIX\s0 standard type shells:
.Sp
.Vb 6
\& export LANG=nl Dutch
\& export LANG=nl_NL Dutch, The Netherlands
\& export LANG=nl_BE Dutch, Belgium
\& export LANG=es_ES Spanish, Spain
\& export LANG=es_MX Spanish, Mexico
\& export LANG=en_US.iso88591 English, USA, Latin\-1 encoding
.Ve
.Sp
For a complete list of language and country codes see the \fIgettext\fR\|(1)
manual:
On Unix systems you can use to command \fIlocale\fR\|(1) to get locale
specific information.
.IP "\fB\s-1LANGUAGE\s0\fR" 4
.IX Item "LANGUAGE"
With the \fI\s-1LANGUAGE\s0\fR environment variable you can specify a priority list
of languages, separated by colons. Wcd gives preference to \fI\s-1LANGUAGE\s0\fR over
\&\fI\s-1LANG\s0\fR. For instance, first Dutch and then German: \f(CW\*(C`LANGUAGE=nl:de\*(C'\fR. You
have to first enable localization, by setting \fI\s-1LANG\s0\fR or \fI\s-1LC_ALL\s0\fR to a
value other than \fIC\fR, before you can use a language priority list through
the \fI\s-1LANGUAGE\s0\fR variable. See also the \fIgettext\fR\|(1) manual:
.Sp
If you select a language which is not available you will get the standard
English messages.
.IP "\fB\s-1WCDLOCALEDIR\s0\fR" 4
.IX Item "WCDLOCALEDIR"
With the environment variable \fI\s-1WCDLOCALEDIR\s0\fR the \fI\s-1LOCALEDIR\s0\fR used during
compilation and installation of wcd can be overruled. \fI\s-1LOCALEDIR\s0\fR is used by
wcd with native language support to find the language files. The \s-1GNU\s0
default value is \f(CW\*(C`/usr/local/share/locale\*(C'\fR. By typing \f(CW\*(C`wcd \-V\*(C'\fR wcd will print
the \fI\s-1LOCALEDIR\s0\fR that is used.
.Sp
If you have installed wcd in a different directory than the default
directory you may need to set the environment variable \fI\s-1WCDLOCALEDIR\s0\fR to
point to the locale directory.
.Sp
An example for Windows cmd:
.Sp
.Vb 1
\& set WCDLOCALEDIR=c:/my_prefix/share/locale
.Ve
.Sp
An example for a \s-1POSIX\s0 shell:
.Sp
.Vb 1
\& export WCDLOCALEDIR=$HOME/share/locale
.Ve
.IP "\fB\s-1LC_COLLATE\s0\fR" 4
.IX Item "LC_COLLATE"
When there are multiple directory matches wcd presents a sorted list. The
sorting depends on the locale settings. If the environment \fI\s-1LANG\s0\fR has been
set the matches are sorted like dictionaries or phone books are sorted in
that language. For instance dots and dashes are ignored, or letters e with
and without accent are equal, or upper and lower case is ignored.
.Sp
The sorting gives preference to environment variable \fI\s-1LC_COLLATE\s0\fR
over \fI\s-1LANG\s0\fR. If you make \fI\s-1LC_COLLATE\s0\fR equal to \f(CW\*(C`C\*(C'\fR or \f(CW\*(C`POSIX\*(C'\fR,
locale sorting is turned off. For instance if you want Dutch language,
but not Dutch sorting, you can do something like this:
.Sp
.Vb 2
\& export LANG=nl_NL
\& export LC_COLLATE=C
.Ve
.IP "\fB\s-1LC_CTYPE\s0\fR" 4
.IX Item "LC_CTYPE"
With regard to character encoding Wcd will give preference to variable
\&\fI\s-1LC_CTYPE\s0\fR over \fI\s-1LANG\s0\fR. For instance to set character encoding to
\&\s-1UTF\-8\s0 the following environment setting can be done.
.Sp
.Vb 1
\& export LC_CTYPE=en_US.UTF\-8
.Ve
.IP "\fB\s-1LC_ALL\s0\fR" 4
.IX Item "LC_ALL"
All locale environment variables that start with \fI\s-1LC_\s0\fR are overruled by
the environment variable \fI\s-1LC_ALL\s0\fR if it is defined. Wcd gives preference to
\&\fI\s-1LC_ALL\s0\fR over \fI\s-1LC_COLLATE\s0\fR and \fI\s-1LC_CTYPE\s0\fR.
.SS "\s-1WINDOWS CODE PAGES\s0"
.IX Subsection "WINDOWS CODE PAGES"
There are two groups of code pages: \s-1DOS\s0 code pages (\s-1OEM\s0) and Windows code pages
(\s-1ANSI\s0). The default encoding for Windows, when configured with Western regional
settings, is \s-1ANSI CP1252.\s0 Windows programs, for instance notepad, use this
default system \s-1ANSI\s0 code page. The Windows console uses by default an \s-1OEM\s0 code
page (\s-1CP437\s0 or \s-1CP850\s0) for compatibility with \s-1DOS\s0 programs. If you use a \s-1DOS\s0
version of wcd in a Windows console it will work, because of the \s-1DOS\s0 code page.
But the \s-1DOS\s0 version of wcd lacks support for long directory names and network
drives on Windows.
.PP
The Windows version of wcd is a native Windows program and will use the Windows
system \s-1ANSI\s0 code page. So on a Western regional Windows it will use code page
\&\s-1CP1252\s0 for directory names and messages. In order to get consistent output,
independent of the active code page, all Windows versions of Wcd translate \s-1ANSI\s0
output to Unicode output in the Command Prompt and PowerShell.
.PP
The console raster font only supports the original \s-1OEM\s0 code page installed with
Windows, so you have to change the console's font to true type Lucida
Console to make Unicode (and \s-1ANSI\s0) letters appear correctly.
.PP
Non-Unicode versions of Wcd \fIprior to version 5.2.0\fR use plain \s-1ANSI\s0 output.
For these older versions the code page of the console has to be made equal to
the system code page (changed to 1252) to make wcd for Windows work properly
with special characters such as accented characters or the Euro symbol.
.PP
The Windows system code page can be changed via the Control Panel regional
options. The Windows console code page is changed with the \f(CW\*(C`chcp\*(C'\fR command.
.PP
When you type \f(CW\*(C`wcd \-V\*(C'\fR, the actual character encoding used by wcd is
shown. Type the command \f(CW\*(C`chcp\*(C'\fR to display the active code page of the Windows
console.
.SS "\s-1UNICODE\s0"
.IX Subsection "UNICODE"
Wcd has optional support for Unicode. To see if wcd was built with Unicode support
type \f(CW\*(C`wcd \-V\*(C'\fR. If your terminal/console and font supports it, you
should see the Euro symbol and Chinese characters (meaning:
\&\*(L"Chinese\*(R").
.PP
Wcd has been \fIsoft\fR converted to Unicode. In its core wcd handles all data
as a stream of bytes. Only the lines printed to screen are on the fly
converted to Unicode wide characters. Wcd fully relies on libc functions
and has no \s-1UTF\-8\s0 specific code. See also
.PP
Wcd has optional support for Unicode matching with normalisation. To find
out whether Wcd has normalisation support type \f(CW\*(C`wcd \-V\*(C'\fR.
Wcd with Unicode normalization support will match Unicode names based on \fIcompatible\fR
equivalence. Without Unicode normalization support, names are matched
when they are binary equivalent.
See also
.PP
\fI\s-1UTF\-8\s0 on Unix/Linux\fR
.IX Subsection "UTF-8 on Unix/Linux"
.PP
In order to view \s-1UTF\-8\s0 characters your console/terminal also needs to
support \s-1UTF\-8.\s0 The xterm version that comes with XFree86 4.0 or higher
includes \s-1UTF\-8\s0 support. To activate it, start \fIxterm\fR\|(1) in a \s-1UTF\-8\s0
locale and use a font with iso10646\-1 encoding, for instance with
.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
Modern distributions of GNU/Linux support \s-1UTF\-8\s0 by default. Other multi-byte
character encodings should also work, but that has not been tested.
.PP
Wcd assumes that the treedata files are encoded in the locale character
encoding. There are no Byte Order Marks written to treedata files.
.PP
\fI\s-1UTF\-16\s0 on Windows\fR
.IX Subsection "UTF-16 on Windows"
.PP
On Windows Unicode is supported in all versions of PowerShell, and in Windows
Command Prompt on Windows 7 (or higher). Unicode also works in Take Command
or \s-1TCC/LE\s0 made by \s-1JP\s0 Software, which can be used on older Windows versions
(XP/Vista).
.PP
On Windows all the directory names on disk are encoded in \s-1UTF\-16\s0 Unicode.
For non-Unicode Windows programs the Unicode characters are
translated to the default \s-1ANSI\s0 code page. For characters that are not part of the
regional setting this translation is not possible and non-Unicode programs
print a question mark or a wrong character instead.
.PP
Wcd with Unicode support will read the \s-1UTF\-16\s0 encoded directory names and
converts them internally to \s-1UTF\-8.\s0 All treedata files are encoded in \s-1UTF\-8\s0
and not compatible with the non-Unicode version of Wcd. Wcd will create a
go-script encoded in \s-1UTF\-8.\s0
.PP
All versions of Windows PowerShell are able to run scripts encoded in \s-1UTF\-8,\s0
provided there is an \s-1UTF\-8 BOM\s0 in the script.
.PP
Since Windows 7 it is possible in Windows Command Prompt to change directory
with a batch script to a directory with Unicode letters in the name. The
directory name needs to be encoded in \s-1UTF\-8,\s0 and the batch script must \fInot\fR
have a \s-1BOM.\s0 The active code page of the Command Prompt needs to be set to 65001
(\s-1UTF\-8\s0) prior to the cd command. Wcd for Command Prompt will create such a go
script \f(CW\*(C`wcdgo.bat\*(C'\fR. It first changes the code page to 65001, then changes
directory, and finally sets the code page back to the original code page.
.PP
You need to set the font to True Type Lucida Console (not raster font) when
letters don't appear correctly.
.PP
The non-Unicode Windows version of Wcd can read Unicode treedata files since
version 5.2.0, provided there is a Byte Order Mark (\s-1BOM\s0) in the file
(see ), but it can't change
to directories with Unicode letters in the name that are not part of the
default system \s-1ANSI\s0 code page. The Unicode Windows version of wcd writes
a \s-1BOM\s0 in the \s-1UTF\-8\s0 encoded treedata files since version 5.2.0, which makes
them also readable by notepad.
.PP
\fI\s-1UTF\-8\s0 on Cygwin\fR
.IX Subsection "UTF-8 on Cygwin"
.PP
Cygwin supports Unicode since version 1.7. The Cygwin layer takes care
that the Windows \s-1UTF\-16\s0 Unicode names are converted to \s-1UTF\-8.\s0 So
programs, like wcd, do not need to be aware of this and can operate
using \s-1UTF\-8\s0 encoding as on Unix/Linux. Set character encoding to \s-1UTF\-8\s0
with the \fI\s-1LANG\s0\fR or \fI\s-1LC_CTYPE\s0\fR environment variable. You may need to
rescan your drives. You need to set the font to True Type Lucida
Console (not raster font) if you use the default Cygwin console.
.PP
The Cygwin version behaves exactly as the Unix version of wcd.
There is no \s-1BOM\s0 written in the treedata files, and it is assumed
they are encoded in the \fBCygwin\fR locale character encoding.
.SH "FILES"
.IX Header "FILES"
If the environment variable \fI\s-1WCDHOME\s0\fR is set wcd will use \fI\s-1WCDHOME\s0\fR
instead of \fI\s-1HOME\s0\fR. All \f(CW\*(C`*.wcd\*(C'\fR files are text files. They can be
edited with a text editor.
The Windows Command Prompt version of wcd behaves as
the \s-1DOS\s0 version. The Cygwin version of wcd behaves as the Unix
version.
.IP "\fBwcd.exe\fR" 4
.IX Item "wcd.exe"
The program. In Unix shells the program is always called by a
function or alias, because the current working directory of a Unix
shell can only be changed by the builtin cd command. See also section
\&\s-1INSTALLATION.\s0
.IP "\fBdefault treedata file\fR" 4
.IX Item "default treedata file"
This is the default treedata file where wcd searches for matches. If it is
not readable wcd will create a new one.
.Sp
.Vb 2
\& DOS: \etreedata.wcd or %HOME%\etreedata.wcd
\& Unix: $HOME/.treedata.wcd
.Ve
.IP "\fBextra treedata file\fR" 4
.IX Item "extra treedata file"
An optional extra treedata file. If it exists and is readable wcd will try
to find matches in this file also.
.Sp
.Vb 2
\& DOS: \eextra.wcd or %HOME%\eextra.wcd
\& Unix: $HOME/.extra.wcd
.Ve
.IP "\fBban file\fR" 4
.IX Item "ban file"
In this optional file wcd places banned paths. See option \fB\-b\fR. Wildcards are
supported.
.Sp
.Vb 2
\& DOS: \eban.wcd or %HOME%\eban.wcd
\& Unix: $HOME/.ban.wcd
.Ve
.IP "\fBalias file\fR" 4
.IX Item "alias file"
Optional file with wcd aliases. See option \fB\-l\fR.
.Sp
.Vb 2
\& DOS: \ealias.wcd or %HOME%\ealias.wcd
\& Unix: $HOME/.alias.wcd
.Ve
.IP "\fBstack file\fR" 4
.IX Item "stack file"
In this file wcd stores its stack. The drive letter can be changed with
the \fB\-d\fR option.
.Sp
.Vb 2
\& DOS: c:\estack.wcd or %HOME%\estack.wcd
\& Unix: $HOME/.stack.wcd
.Ve
.Sp
The name of the stack file can be changed with environment variable \fI\s-1WCDSTACKFILE\s0\fR.
See section \s-1ENVIRONMENT VARIABLES.\s0
.IP "\fBgo-script\fR" 4
.IX Item "go-script"
This is the shell script which wcd.exe creates each time. It is sourced via
a function or an alias. The drive letter can be changed with the \fB\-d\fR option.
For history reasons it is placed by default in \f(CW\*(C`$HOME/bin\*(C'\fR on Unix
systems. The directory of this file can be changed with the option \fB\-G\fR.
.Sp
.Vb 7
\& DOS bash: c:/wcd.go or $HOME/wcd.go
\& Windows Command Prompt: c:\ewcdgo.bat or %HOME%\ewcdgo.bat
\& Windows PowerShell: $env:HOME\ewcdgo.ps1
\& WinZsh: $HOME/wcd.go
\& Cygwin/MSYS: $HOME/bin/wcd.go
\& OS/2 Command Prompt: c:\ewcdgo.cmd or %HOME%\ewcdgo.cmd
\& Unix: $HOME/bin/wcd.go
.Ve
.IP "\fBrelative treedata file\fR" 4
.IX Item "relative treedata file"
Text file with relative paths from \fI\s-1DIR\s0\fR. See options \fB+S\fR, \fB\-n\fR and
\&\fB+n\fR.
.Sp
.Vb 2
\& DOS: \ertdata.wcd
\& Unix: /.rtdata.wcd
.Ve
.SH "ENVIRONMENT VARIABLES"
.IX Header "ENVIRONMENT VARIABLES"
.IP "\fB\s-1HOME\s0\fR" 4
.IX Item "HOME"
Wcd uses by default environment variable \fI\s-1HOME\s0\fR to determine where to store
its files. See also section \s-1FILES.\s0 This can be overruled with environment
variable \fI\s-1WCDHOME\s0\fR.
.Sp
\&\fI\s-1HOME\s0\fR also defines where to start scanning the disk when option \fB\-s\fR is
used. This can be overruled with the environment variable \fI\s-1WCDSCAN\s0\fR.
.Sp
For the Unix, Cygwin, Windows PowerShell, WinZsh and \s-1MSYS\s0 version
it is required that \fI\s-1HOME\s0\fR or \fI\s-1WCDHOME\s0\fR is set. For the other
versions of wcd the use of these variables is optional.
.Sp
If \fI\s-1HOME\s0\fR is set on DOS/Windows, wcd will place all its files
(treedata.wcd, extra.wcd, alias.wcd, ban.wcd, wcd.go) in directory
\&\fI\s-1HOME\s0\fR. The behaviour of wcd is then equal to the Unix version of
wcd. Wcd will scan the disk default from \fI\s-1HOME\s0\fR. Drives will not be
automatically scanned by changing to them. You need to tell wcd
explicitly. E.g.:
.Sp
.Vb 1
\& wcd \-S c: \-A d: \-A e:
.Ve
.Sp
Matching of directories is now global over all scanned drives.
.IP "\fB\s-1WCDHOME\s0\fR" 4
.IX Item "WCDHOME"
Environment variable \fI\s-1WCDHOME\s0\fR can be used to change the location of wcd's
files. If both \fI\s-1HOME\s0\fR and \fI\s-1WCDHOME\s0\fR are set, \fI\s-1WCDHOME\s0\fR will be used instead
of \fI\s-1HOME\s0\fR.
.Sp
In wcd versions prior to 5.1.5 \fI\s-1WCDHOME\s0\fR also changed the default scan directory.
This has changed. Since version 5.1.5 \fI\s-1WCDHOME\s0\fR does not change the default scan
directory. See option \fB\-s\fR. From version 5.1.5, use environment \fI\s-1WCDSCAN\s0\fR to
overrule the default scan directory.
.Sp
Example for \s-1DOS,\s0 Windows, \s-1OS/2\s0 Command Prompt:
.Sp
.Vb 1
\& set WCDHOME=C:\eUsers\eerwin\ewcd
.Ve
.Sp
An example for \s-1POSIX\s0 type shells:
.Sp
.Vb 1
\& export WCDHOME="$HOME/.wcd"
.Ve
.Sp
An example for Csh type shells:
.Sp
.Vb 1
\& setenv WCDHOME "$HOME/.wcd"
.Ve
.IP "\fB\s-1WCDSCAN\s0\fR" 4
.IX Item "WCDSCAN"
Use environment variable \fI\s-1WCDSCAN\s0\fR to overrule the default scan
directory \fI\s-1HOME\s0\fR. Define a colon separated list (Unix) to define more
than one directory.
On DOS/Windows make the list semi-colon separated.
.Sp
Examples for \s-1DOS,\s0 Windows, \s-1OS/2\s0 Command Prompt:
.Sp
.Vb 1
\& set WCDSCAN=C:\eUsers\eerwin;D:\edata
\&
\& set WCDSCAN=%HOMEDRIVE%%HOMEPATH%;\e\eprojectdrive\eprojectX
.Ve
.Sp
An example for \s-1POSIX\s0 type shells:
.Sp
.Vb 1
\& export WCDSCAN="$HOME:/projectdisk/projectX"
.Ve
.Sp
An example for Csh type shells:
.Sp
.Vb 1
\& setenv WCDSCAN "$HOME:/projectdisk/projectX"
.Ve
.IP "\fB\s-1WCDFILTER\s0\fR" 4
.IX Item "WCDFILTER"
Specify filters with environment variable \fI\s-1WCDFILTER\s0\fR. All
directories that do not match the filter(s) are ignored. A list can be
specified by separating filters by the shell path
separator. Similar as specifying the \fI\s-1PATH\s0\fR variable.
The case sensitivity is mandated by the Operating system.
.Sp
An example for \s-1DOS,\s0 Windows, \s-1OS/2\s0 Command Prompt:
.Sp
.Vb 1
\& set WCDFILTER=projects;doc
.Ve
.Sp
An example for \s-1POSIX\s0 type shells:
.Sp
.Vb 1
\& export WCDFILTER="projects:doc"
.Ve
.Sp
An example for Csh type shells:
.Sp
.Vb 1
\& setenv WCDFILTER "projects:doc"
.Ve
.IP "\fB\s-1WCDBAN\s0\fR" 4
.IX Item "WCDBAN"
The paths specified with environment \fI\s-1WCDBAN\s0\fR will be banned by wcd.
See also option \fB\-b\fR. Specify a list of paths separated by shell
\&\fI\s-1PATH\s0\fR separator.
.IP "\fB\s-1WCDEXCLUDE\s0\fR" 4
.IX Item "WCDEXCLUDE"
The paths specified with environment \fI\s-1WCDEXCLUDE\s0\fR will be excluded by
wcd. See also options \fB\-x\fR and \fB\-xf\fR. Specify a list of paths
separated by shell \fI\s-1PATH\s0\fR separator.
.Sp
An example for \s-1DOS,\s0 Windows, \s-1OS/2\s0 Command Prompt:
.Sp
.Vb 1
\& set WCDEXCLUDE=*/windows;*/temp;*CVS
.Ve
.Sp
An example for \s-1POSIX\s0 type shells:
.Sp
.Vb 1
\& export WCDEXCLUDE="/dev:/tmp:*CVS"
.Ve
.Sp
An example for Csh type shells:
.Sp
.Vb 1
\& setenv WCDEXCLUDE "/dev:/tmp:*CVS"
.Ve
.IP "\fB\s-1WCDUSERSHOME\s0\fR" 4
.IX Item "WCDUSERSHOME"
Set the base of user's home directories.
On DOS/Windows the default value is \f(CW\*(C`\e\eusers\*(C'\fR.
On Unix/Cygwin the default value is \f(CW\*(C`/home\*(C'\fR.
This variable is used to scan treedata files of other users. See also
options \fB\-u\fR and \fB+u\fR. In verbose mode wcd will print all filters,
bans and excludes. See option \fB\-v\fR.
.IP "\fB\s-1WCDSTACKFILE\s0\fR" 4
.IX Item "WCDSTACKFILE"
Wcd gives preference to \fI\s-1WCDSTACKFILE\s0\fR over the default stack file name (see
section \s-1FILES\s0). With this variable each shell (or used terminal emulator) can
have its private stack of used directories.
.Sp
To use a unique time based YYYYMMDD-HHMMSS file for each opened
interactive shell.
.Sp
.Vb 1
\& export WCDSTACKFILE=$HOME/.wcd/stack.$(date +%Y%m%d\-%H%M%S)
.Ve
.Sp
For a stack per \fIxterm\fR\|(1), use the xterm \fI\s-1WINDOWID\s0\fR environment variable:
.Sp
.Vb 1
\& export WCDSTACKFILE=$HOME/.wcd/stack.$WINDOWID
.Ve
.Sp
For \s-1GNU\s0 \fIscreen\fR\|(1), to use stack per screen:
.Sp
.Vb 1
\& export WCDSTACKFILE=$HOME/.wcd/stack.$WINDOW
.Ve
.IP "\fB\s-1TERMINFO\s0\fR" 4
.IX Item "TERMINFO"
If the environment variable \fI\s-1TERMINFO\s0\fR is defined, wcd with ncurses
interface checks for a local terminal definition before checking in
the standard place. This is useful if terminal definitions are not on
a standard place. Often used standard places are \f(CW\*(C`/usr/lib/terminfo\*(C'\fR
and \f(CW\*(C`/usr/share/terminfo\*(C'\fR.
.IP "\fB\s-1PDC_RESTORE_SCREEN\s0\fR" 4
.IX Item "PDC_RESTORE_SCREEN"
Wcd with PDCurses interface recognizes the environment variable
\&\fI\s-1PDC_RESTORE_SCREEN\s0\fR. If this environment variable is set, PDCurses
will take a copy of the contents of the screen at the time that wcd is
started; when wcd exits, the screen will be restored.
An example for Windows Command Prompt:
.Sp
.Vb 1
\& set PDC_RESTORE_SCREEN=1
.Ve
.Sp
Windows allows only a small buffer to be saved. So it is not always
possible to restore everything. Some garbage data may be printed in
the console after wcd exists if you have set a large buffer width.
.IP "\fB\s-1SHELL\s0\fR" 4
.IX Item "SHELL"
Printing of \f(CW\*(C`#!$SHELL\*(C'\fR on the first line of the go-script for \s-1POSIX\s0
type shell or C shell is needed for 8 bit characters. Some shells
otherwise think that the go-script is a binary file and will not
source it. In Cygwin Bash the variable \fI\s-1SHELL\s0\fR must be set in
environment using the \f(CW\*(C`export\*(C'\fR command, otherwise wcd can't read the
variable.
.IP "\fB\s-1BASH\s0\fR" 4
.IX Item "BASH"
Wcd for \s-1DOS\s0 bash uses \f(CW$BASH\fR instead of \f(CW$SHELL\fR, because \f(CW$SHELL\fR
points to the \s-1DOS\s0 command shell. One may need to define \f(CW$BASH\fR with
an \f(CW\*(C`export\*(C'\fR command, otherwise wcd can't read the variable.
.SH "SEE ALSO"
.IX Header "SEE ALSO"
\&\fIsh\fR\|(1),
\&\fIbash\fR\|(1),
\&\fIcsh\fR\|(1),
\&\fIksh\fR\|(1),
\&\fIzsh\fR\|(1),
\&\fIlocale\fR\|(1),
\&\fIncurses\fR\|(1),
.SH "AUTHORS"
.IX Header "AUTHORS"
Wcd was written by Erwin Waterlander
.PP
Project homepage:
.PP
SourceForge:
.PP
The manual page formatting was provided by Jari Aalto
.
.PP
\&\s-1NCD\s0 was originally written by Brad Kingsbury for Peter Norton's
\&\*(L"Norton Utilities\*(R" around 1987. See also
wcd-5.3.4/src/man/man1/wcd.htm 0000644 0001755 0001001 00000152255 13033024067 015244 0 ustar waterlan Geen
wcd 5.3.4 - Wherever Change Directory
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.
Wcd was modeled after Norton Change Directory (NCD). NCD appeared first in The Norton Utilities, Release 4, for DOS in 1987, published by Peter Norton.
Wcd has been ported to different command-line shells: DOS command.com, Windows cmd.exe and PowerShell, OS/2 cmd.exe, and Unix shells such as Bourne (sh), Bourne Again (bash), Korn (ksh), Z (zsh), and C (csh) shell and others running on any operating system.
Wcd supports 8 bit character sets on all systems, and has optional support for Unicode. See section LOCALIZATION.
See section INSTALLATION how to setup wcd for personal use.
Basic use
By default (if no wildcards are used) wcd searches for a directory with a name that begins with the typed name.
For instance this command will change to directory to the current user's /home/user/Desktop:
wcd Desk
When there are multiple matches, wcd will present the user a list of all matches. The user can then make a selection with a few keystrokes (most of the times only one).
Wildcards
Wcd supports following wildcards:
* matches any sequence of characters (zero or more)
? matches any character
[SET] matches any character in the specified set,
[!SET] or [^SET] matches any character not in the specified set.
A set is composed of characters or ranges; a range looks like character hyphen character as in 0-9 or A-Z. The [0-9a-zA-Z_] is the minimal set of characters allowed in the [..] pattern construct. International characters (i.e. 8 bit characters) are allowed if the system supports them. To suppress the special syntactic significance of any of []*?!^-\ inside or outside a [..] construct and match the character exactly, precede the character with a backslash (\) marker.
Using wildcards makes powerful searching possible. For instance this matches any directory name that ends with "top":
wcd *top
Match directories that have "top" anywhere in the name:
wcd *top*
Match any directory name that begins with "a", "b" or "c":
wcd [a-c]*
It is also possible to give a part of a directory path. Here Wcd searches for directory that begins with "Desk" and which path matches *me/Desk*.
wcd me/Desk
It is allowed to type any kind of expression with slashes and wildcards. E.g.:
wcd src*/*1?/a*2
Other uses
If no wildcards are used and wcd finds a perfect match, wcd will ignore all wild matches by default. This behaviour can be changed with the -w option.
The interactive directory tree browser can be started by using option -g.
wcd -g
Wcd generates a treedata file where it searches the directory. On Unix and Windows systems wcd does add symbolic links to the treedata file while scanning the disk, but does not follow them. While following links wcd could end up scanning infinite loops, or scan very large portions of a network.
Wcd can also change to directories that are not in the treedata file. E.g.:
wcd ..
If wcd found a match but can't change to the directory it tries to remove it from the default treedata file. Not from the extra treedata file. See also option -k.
Wcd keeps a directory stack which is stored on disk. The stack has a default size of 10 and is cyclic. See options -z, -, + and =.
In multi-user environments option -u can be used to change to directories of other users.
On DOS and Windows systems it does not matter if you use a slash "/" or a backslash "\" as a directory separator.
It is possible on DOS and Windows systems to change drive and directory in one go by preceding the directory name with the drive name.
wcd d:games
Windows UNC paths
The Windows versions (Command Prompt, PowerShell, MSYS, zsh, cygwin) support Windows SMB LAN UNC paths without drive letter such as \\servername\sharename. Wcd for Windows Command Prompt makes use of the "pushd" command to automatically map a UNC path to a drive letter. In Windows PowerShell, MSYS, zsh and Cygwin UNC paths are fully supported. The current working directory can be a UNC path.
Interfaces
Wcd has three different interfaces to choose from a list of matches. The interface can be chosen at compile time.
The first interface uses plain stdin/stdout. A numbered list is printed in the terminal. The user has to choose from the list by typing a number followed by <Enter>. This interface does not provide scroll back functionality in case of a long list. The scroll back capability of the terminal/console has to be used. It is very small and portable.
The second interface is built with the conio library. It provides a builtin scroll back capability. The user is presented a list numbered with letters. Choosing from a list can be done by pressing just one letter. This interface is fast because it saves keystrokes. If possible the screen will be restored after exiting. One who prefers to type numbers can use the -N option.
The third interface is built with the curses library. It is similar to the conio interface. The curses version of wcd has also an additional 'graphical' interface. It lets the user select a directory via a full screen interactive directory tree browser. It has a vim(1) like navigation and search method. It can be activated with option -g.
By using the -o option one can always fall back to the stdin/stdout interface.
OPTIONS
-a
Add current path to the default treedata file.
Use this option to quickly add the current path to the default treedata file. Re-scanning the complete disk can take a long time in some cases.
-aa
Add current and all parent paths to the default treedata file.
-A PATH
Scan directory tree from PATH and append to the default treedata file. Examples:
wcd -A .
wcd -A /home -A /etc
wcd -A d: -A e: -A \\server\share
On Windows one can scan all shared directories of a Windows LAN server by typing something like: wcd -A \\servername.
See also option -S and -s and -E.
-b
Ban current path.
Wcd places the current path in the ban file. This means that wcd ignores all matches of this directory and its sub directories.
The ban file can be edited with a text editor. Use of wildcards is supported and names are matched against the absolute path.
Banned paths are not excluded from scanning the disk. To do that use option -xf.
-c, --direct-cd
Direct CD mode. By default wcd works as follows:
1. Try to find a match in the treedata file(s)
2. If no match, try to open the directory you typed.
In direct CD mode wcd works in reversed order.
1. Try to open the directory you typed.
2. If not, try to find a match in the treedata file(s).
-d DRIVE
Set drive for stack and go file (DOS only).
The stack file and the go-script are by default stored on drive C: if environment variable HOME is not set. Use this option if drive C: is a read-only drive. This option must be used in front of the stack options -, + and =.
-e
Add current path to the extra treedata file.
Use this option to quickly add the current path to the extra treedata file.
-ee
Add current and all parent paths to extra treedata file.
-E PATH
Scan directory tree from PATH and append to Extra treedata file. See also options -A and -S.
-f FILE
Read treedata file FILE. Do not read the default treedata file.
+f FILE
Read treedata file FILE in addition to the default treedata file.
-g
Graphical interface (only in version with curses interface).
Wcd starts a textual curses based 'graphical' interface. The user can select a directory via a full-screen interactive directory tree browser. It has a vim(1) like navigation and search method.
If no search string is given wcd presents the whole tree which is in the default treedata file and the extra treedata files.
If a search string is given the match list is presented as a directory tree.
The default tree layout is similar to the tree layout of the original NCD on DOS. The difference in layout is that in NCD all directories of a same depth level were vertically aligned over the whole tree. This was possible in NCD, because the maximum width of a directory name in DOS was 12 (8.3) characters. On modern operating systems directory names can be very long, so also the differences in length can be large. Therefore folders with a same depth are not vertically aligned over the whole tree in wcd, but only in sub-branches. So there is some sideways movement when moving straight up and down from one sub-branch to another sub-branch.
The navigation behaviour in Wcd is exactly the same as in the original NCD. For instance if you push the Down key you go down to the next directory with the same depth level, jumping over branches. This enables fast navigation through the tree.
See options -Ta, -TC, and -Tc to change the navigation behaviour.
-gd
Dump the treedata files as a tree to stdout.
-G PATH
Write go-script in directory PATH. For instance on Unix, wcd -G PATH will write a go-script PATH/wcd.go.
-GN, --no-go-script
Do not create go-script. This option can be used in combination with the option -j if one does not want wcd to create a go-script.
-h, --help
Show help and exit.
-i, --ignore-case
Ignore case. Dos and Windows versions of wcd ignore case default. Unix/Cygwin versions regard case by default.
+i, --no-ignore-case
Regard case. See also option -i.
-I, --ignore-diacritics
Ignore diacritics for Latin-based scripts. Letters with diacritical marks match their base letter without diacritical mark. 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. See also http://en.wikipedia.org/wiki/Diacritic
+I, --no-ignore-diacritics
Regard diacritics (default). See also option -I.
-j, --just-go
Just go mode.
In this mode wcd will not present a list when there is more than one directory that matches the given directory. Wcd will just change to the first option. When wcd is invoked again with the same arguments it will change to the next option, and so on.
Wcd will print the directory to go to to stdout. So a different installation method can be used. One could make the following function for a POSIX compatible shell:
wcd ()
{
cd "$($HOME/bin/wcd.exe -j $@)"
}
When you are using an old shell that doesn't support "$()" command substitution you have to use old style command substitution with back-quotes.
wcd ()
{
cd "`$HOME/bin/wcd.exe -j $@`"
}
On Windows systems, if one is running 4NT shell, one could make the following alias:
alias wcd `cd %@execstr[wcdwin32.exe -z 0 -j %1]`
This method eliminates the need of the go-script, so one can use option -GN in combination with -j.
-k, --keep-paths
Keep paths.
Keep paths in the treedata file when wcd can't change to them. The default behaviour of wcd is that it tries to remove paths from the treedata when wcd can't change to them. With this option this behavior is turned off.
-K, --color
Use colors in graphical mode.
-l ALIAS
Name the current path with ALIAS. Wcd places the current path with alias ALIAS in the alias file. Aliases are case sensitive.
-ls
Show the name of the alias file, and list all the aliases.
-m DIR
Make directory and add to treedata file.
-L, --license
Print the distribution license.
-M DIR
Make directory and add to extra treedata file.
-n PATH
Read relative treedata file from PATH.
Do not read the default treedata file. The relative treedata file should already have been created using the wcd +S option. PATH may also point to a file directly.
An example. Suppose another system has been mounted to mount point /mnt/network:
wcd -n /mnt/network src
Wcd opens the relative treedata file in /mnt/network/. The file contains the paths relative from that point.
+n PATH
Read relative treedata file in addition to the default treedata file. See option -n.
-N, --numbers
Use numbers instead of letters.
Wcd with a conio or curses based interface (see section Interfaces) presents a match list by default numbered with letters. When the -N option is used the match list is numbered with numbers. Regardless of the -N option one can type a letter or numbers to make a selection from the list of matches.
-o
Use stdin/stdout interface.
When for some kind of reason the conio or curses interface of wcd does not work one can fall back to the stdin/stdout interface of wcd by using the -o option.
-od, --to-stdout
Dump all matches to stdout.
-q, --quiet
Quieter operation. Printing of the final match is suppressed.
-r DIR
Remove directory and remove from the treedata file.
If the directory is empty, wcd will remove it, and try to remove it from the treedata file.
-rmtree DIR
Recursively remove directory and remove from the treedata file.
Wcd will remove the directory and all its sub directories and files, and remove the directories from the treedata file.
-s
(re)Scan disk from $HOME directory. If HOME is not defined the disk is scanned from root directory /.
The existing default treedata file is overwritten.
The default scan directory can be overruled with environment variable WCDSCAN. See section ENVIRONMENT VARIABLES.
-S PATH
Scan directory tree from PATH and overwrite the default treedata file. See also options -A, -s and -E. E.g. with option -A you can create a default treedata file of your choice. Examples:
Unix:
wcd -S /
wcd -S /home -A /etc -A /usr
DOS/Windows:
wcd -S c:/
wcd -S c: -A d: -A \\server\share
With the Windows versions one can scan all shared directories of a Windows LAN server by typing something like: wcd -S \\servername.
+S PATH
Scan disk from PATH and place relative paths in a relative treedata file. This file is used by the -n and +n options of wcd. E.g. wcd -n PATH src.
-t
Do not strip tmp mount dir /tmp_mnt (Unix only)
Wcd strips by default /tmp_mnt/ from the match. Directory /tmp_mnt is used by the auto-mounter. This behaviour can be turned off with the -t option.
-T, --ascii-tree
Draw tree with ASCII characters. Use this option if line drawing characters are not displayed properly in your terminal.
-Ta, --alt-tree-nav
Alternative way of navigation in the graphical tree.
In the default NCD style tree layout the -Ta option disables jumping to unrelated directories.
In compact tree mode the alternative mode makes navigation similar to navigation in GUI file managers such as Windows Explorer or Linux KDE Konqueror. Pressing Up and Down moves the selected folder one line up or down. Pressing Left first folds the sub-folders and the next move left moves really left.
You can switch on-the-fly between default and alternative navigation by pressing <Shift-A>.
When alternative navigation mode is on, you will see an "A" in the lower right corner.
-TC, --center-tree
Centered view in the graphical tree. The selected directory stays in the middle of the screen. The centered mode can also be switched on and off with key <t> in the graphical tree.
The standard non-centered behaviour, which minimises tree movement, is the same as in the original NCD.
-Tc, --compact-tree
By default the 'graphical' tree is drawn the same way as the original NCD on DOS 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 option -Tc or switch on-the-fly with the <m> key.
-Td, --cjk-width
Legacy East-Asian CJK (Chinese, Japanese, and Korean) fonts have certain characters and line drawing symbols with a column width of 2, while the normal Unicode width for these characters is 1 column. For instance the Chinese CP936 raster font on Windows and the Simsun font. Use this option for a correct outlining of the graphical tree when a legacy CJK font is used.
When CJK mode is on, you will see a "C" in the lower right corner.
-u USER
Scan treedata file of another user based on USER, do not scan your own default treedata file. See also section ENVIRONMENT VARIABLES for WCDUSERSHOME.
On Unix/Cygwin the base directory for user home directories is assumed to be /home. Wcd will look for /home/USER/.treedata.wcd and /home/USER/.wcd/.treedata.wcd, in that order, and read the first one that exists and is readable. On DOS/Windows the base directory for user home directories is assumed to be \\users, so wcd tries to read \\users\USER\treedata.wcd and \\users\USER\.wcd\treedata.wcd.
+u USER
Read default treedata file of USER in addition to your own treedata file.
-v, --verbose
Display verbose messages. With this option wcd prints all filters, bans and excludes.
-V, --version
Print version information and exit.
-w, --wild-match-only
Wild matching only. Treat all matches as wild matches.
-x PATH
Exclude PATH from scanning.
When this option is used wcd will exclude PATH and all its subdirectories when wcd is scanning a disk. Wildcards are supported and matched against absolute paths. Option -x can be used multiple times.
wcd -x <path1> -x <path2> -s
Option -x must be used in front of any scan option (-s, -S, +S, -A, -E).
On DOS/Windows systems one must specify the drive letter depending on if environment variable HOME or WCDHOME is set. If HOME or WCDHOME is set one needs to specify the drive letter. An example:
wcd -x c:/temp -S c:
Otherwise do not specify drive letter.
wcd -x /temp -s
-xf FILE
Exclude all paths listed in FILE from scanning.
When this option is used wcd will exclude all paths listed in FILE and all their subdirectories when wcd is scanning a disk. Wildcards are supported and they are matched against absolute paths; one path per line. Be aware that wcd will not ignore leading or trailing blanks on a line, because they are legal characters in a directory name. Option -xf can be used multiple times. When one wants to exclude all banned paths from scanning one can do the following (example for wcd on unix):
wcd -xf ~/.ban.wcd -s
Wildcards are supported. For instance to exclude all your Subversion directories with administrative files add a line with */.svn.
Option -xf must be used in front of any scan option (-s, -S, +S, -A, -E).
-y, --assume-yes
Assume Yes on all queries.
Wcd will not prompt the user with yes/no questions, but assumes the user answers yes on all questions. This can be used in combination with option -rmtree. This option must be used in front of options that can lead to yes/no questions.
-z NUMBER
Set maximum stack size to NUMBER.
The default size of the stack is 10. Stack operation can be turned off by setting the size to 0. This option must be used in front of any other stack operations (-,+,=). Otherwise the size of the stack will be set back to the default 10.
A correct command is:
wcd -z 50 -
The new stack size will be 50, wcd will go one directory back. A wrong command is:
wcd - -z 50
Wcd goes one directory back, the stack gets the default size 10. The -z 50 is ignored.
Add this option as the first option to your wcd alias or function. E.g. for the a POSIX compatible shell this would be:
Go back a directory. Command wcd - goes one directory back. To go more directories back add a number to it. E.g. command wcd -3. The stack is cyclic.
+[NUMBER]
Pop dir NUMBER of times. Default is one.
Go forward a directory. Command wcd + goes one directory forward. To go more directories forward add a number to it. E.g. command wcd +2. The stack is cyclic.
=
Show stack.
Use this option if you do not know anymore how many times to push or pop. The stack is printed and you can choose a number. The current place in the stack is marked with an asterisk *.
INSTALLATION
The current working directory of a Unix shell can only be changed by the builtin cd(1) command. Therefore the program is always called by a function or an alias. The function or alias sources a shell script (go-script) which is generated by the wcd program. Wcd can only work after the function or alias is defined.
Another important influence on your installation is the definition of environment variables HOME and WCDHOME. See section ENVIRONMENT VARIABLES.
Install for POSIX type shells
For a POSIX shell (ksh, bash, zsh, etc.) on Unix, Linux, Cygwin, or native MSYS add the following function to the shell startup file (e.g. Bash uses $HOME/.bashrc):
Replace PATH with the location where the wcd executable has been installed. Reload the shell initialization files or start new shell.
The location of the go-script wcd.go differs per shell.
Wcd for DJGPP DOS bash requires a different function. The go script is not written in a directory bin, and if WCDHOME and HOME are both not defined the go-script is written on c:/.
Add the following alias to the shell startup file $HOME/.cshrc or $HOME/.tcshrc :
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
Replace PATH with the location where the wcd executable has been installed. Reload the shell initialization files or start a new shell.
Windows Command Prompt version
Unpack the zip file and add directory bin to your environment variable 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.
Windows VISTA and higher
In a Windows VISTA and higher Command Prompt you may have limited access to directories. To get access to more directories you need administrator 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 version
Add the following function to your PowerShell user profile. The location of this profile is stored in the $profile variable. It is required that one of the environment variables HOME or WCDHOME is defined.
function wcd
{
<PATH>\wcdwin32psh.exe $args
& $env:HOME\wcdgo.ps1
}
Replace PATH with the location where the wcd executable has been installed. Start a new PowerShell. Wcd for PowerShell supports only the file system provider. No other providers.
OS/2 Command Prompt version
In an OS/2 Command Prompt (cmd.exe) an OS/2-program can't change the current work directory. That is why wcd generates a command script wcdgo.cmd which must be executed in the current shell. The script wcd.cmd first executes wcdos2.exe, which creates the wcdgo.cmd script. Then wcd.cmd executes the wcdgo.cmd script.
LOCALIZATION
LANG
The primary language is selected with the environment variable LANG. The LANG variable consists out of several parts. The first part is in small letters the language code. The second one is optional and is the country code in capital letters, preceded with an underscore. There is also an optional third part: character encoding, preceded with a dot. A few examples for POSIX standard type shells:
With the LANGUAGE environment variable you can specify a priority list of languages, separated by colons. Wcd gives preference to LANGUAGE over LANG. For instance, first Dutch and then German: LANGUAGE=nl:de. You have to first enable localization, by setting LANG or LC_ALL to a value other than C, before you can use a language priority list through the LANGUAGE variable. See also the gettext(1) manual: http://www.gnu.org/software/gettext/manual/gettext.html#The-LANGUAGE-variable
If you select a language which is not available you will get the standard English messages.
WCDLOCALEDIR
With the environment variable WCDLOCALEDIR the LOCALEDIR used during compilation and installation of wcd can be overruled. LOCALEDIR is used by wcd with native language support to find the language files. The GNU default value is /usr/local/share/locale. By typing wcd -V wcd will print the LOCALEDIR that is used.
If you have installed wcd in a different directory than the default directory you may need to set the environment variable WCDLOCALEDIR to point to the locale directory.
An example for Windows cmd:
set WCDLOCALEDIR=c:/my_prefix/share/locale
An example for a POSIX shell:
export WCDLOCALEDIR=$HOME/share/locale
LC_COLLATE
When there are multiple directory matches wcd presents a sorted list. The sorting depends on the locale settings. If the environment LANG has been set the matches are sorted like dictionaries or phone books are sorted in that language. For instance dots and dashes are ignored, or letters e with and without accent are equal, or upper and lower case is ignored.
The sorting gives preference to environment variable LC_COLLATE over LANG. If you make LC_COLLATE equal to C or POSIX, locale sorting is turned off. For instance if you want Dutch language, but not Dutch sorting, you can do something like this:
export LANG=nl_NL
export LC_COLLATE=C
LC_CTYPE
With regard to character encoding Wcd will give preference to variable LC_CTYPE over LANG. For instance to set character encoding to UTF-8 the following environment setting can be done.
export LC_CTYPE=en_US.UTF-8
LC_ALL
All locale environment variables that start with LC_ are overruled by the environment variable LC_ALL if it is defined. Wcd gives preference to LC_ALL over LC_COLLATE and LC_CTYPE.
WINDOWS CODE PAGES
There are two groups of code pages: DOS code pages (OEM) and Windows code pages (ANSI). The default encoding for Windows, when configured with Western regional settings, is ANSI CP1252. Windows programs, for instance notepad, use this default system ANSI code page. The Windows console uses by default an OEM code page (CP437 or CP850) for compatibility with DOS programs. If you use a DOS version of wcd in a Windows console it will work, because of the DOS code page. But the DOS version of wcd lacks support for long directory names and network drives on Windows.
The Windows version of wcd is a native Windows program and will use the Windows system ANSI code page. So on a Western regional Windows it will use code page CP1252 for directory names and messages. In order to get consistent output, independent of the active code page, all Windows versions of Wcd translate ANSI output to Unicode output in the Command Prompt and PowerShell.
The console raster font only supports the original OEM code page installed with Windows, so you have to change the console's font to true type Lucida Console to make Unicode (and ANSI) letters appear correctly.
Non-Unicode versions of Wcd prior to version 5.2.0 use plain ANSI output. For these older versions the code page of the console has to be made equal to the system code page (changed to 1252) to make wcd for Windows work properly with special characters such as accented characters or the Euro symbol.
The Windows system code page can be changed via the Control Panel regional options. The Windows console code page is changed with the chcp command.
When you type wcd -V, the actual character encoding used by wcd is shown. Type the command chcp to display the active code page of the Windows console.
UNICODE
Wcd has optional support for Unicode. To see if wcd was built with Unicode support type wcd -V. If your terminal/console and font supports it, you should see the Euro symbol and Chinese characters (meaning: "Chinese").
Wcd has been soft converted to Unicode. In its core wcd handles all data as a stream of bytes. Only the lines printed to screen are on the fly converted to Unicode wide characters. Wcd fully relies on libc functions and has no UTF-8 specific code. See also http://www.cl.cam.ac.uk/~mgk25/unicode.html
Wcd has optional support for Unicode matching with normalisation. To find out whether Wcd has normalisation support type wcd -V. Wcd with Unicode normalization support will match Unicode names based on compatible equivalence. Without Unicode normalization support, names are matched when they are binary equivalent. See also http://en.wikipedia.org/wiki/Unicode_normalization
UTF-8 on Unix/Linux
In order to view UTF-8 characters your console/terminal also needs to support UTF-8. The xterm version that comes with XFree86 4.0 or higher includes UTF-8 support. To activate it, start xterm(1) in a UTF-8 locale and use a font with iso10646-1 encoding, for instance with
Modern distributions of GNU/Linux support UTF-8 by default. Other multi-byte character encodings should also work, but that has not been tested.
Wcd assumes that the treedata files are encoded in the locale character encoding. There are no Byte Order Marks written to treedata files.
UTF-16 on Windows
On Windows Unicode is supported in all versions of PowerShell, and in Windows Command Prompt on Windows 7 (or higher). Unicode also works in Take Command or TCC/LE made by JP Software, which can be used on older Windows versions (XP/Vista).
On Windows all the directory names on disk are encoded in UTF-16 Unicode. For non-Unicode Windows programs the Unicode characters are translated to the default ANSI code page. For characters that are not part of the regional setting this translation is not possible and non-Unicode programs print a question mark or a wrong character instead.
Wcd with Unicode support will read the UTF-16 encoded directory names and converts them internally to UTF-8. All treedata files are encoded in UTF-8 and not compatible with the non-Unicode version of Wcd. Wcd will create a go-script encoded in UTF-8.
All versions of Windows PowerShell are able to run scripts encoded in UTF-8, provided there is an UTF-8 BOM in the script.
Since Windows 7 it is possible in Windows Command Prompt to change directory with a batch script to a directory with Unicode letters in the name. The directory name needs to be encoded in UTF-8, and the batch script must not have a BOM. The active code page of the Command Prompt needs to be set to 65001 (UTF-8) prior to the cd command. Wcd for Command Prompt will create such a go script wcdgo.bat. It first changes the code page to 65001, then changes directory, and finally sets the code page back to the original code page.
You need to set the font to True Type Lucida Console (not raster font) when letters don't appear correctly.
The non-Unicode Windows version of Wcd can read Unicode treedata files since version 5.2.0, provided there is a Byte Order Mark (BOM) in the file (see http://en.wikipedia.org/wiki/Byte_order_mark), but it can't change to directories with Unicode letters in the name that are not part of the default system ANSI code page. The Unicode Windows version of wcd writes a BOM in the UTF-8 encoded treedata files since version 5.2.0, which makes them also readable by notepad.
UTF-8 on Cygwin
Cygwin supports Unicode since version 1.7. The Cygwin layer takes care that the Windows UTF-16 Unicode names are converted to UTF-8. So programs, like wcd, do not need to be aware of this and can operate using UTF-8 encoding as on Unix/Linux. Set character encoding to UTF-8 with the LANG or LC_CTYPE environment variable. You may need to rescan your drives. You need to set the font to True Type Lucida Console (not raster font) if you use the default Cygwin console.
The Cygwin version behaves exactly as the Unix version of wcd. There is no BOM written in the treedata files, and it is assumed they are encoded in the Cygwin locale character encoding.
FILES
If the environment variable WCDHOME is set wcd will use WCDHOME instead of HOME. All *.wcd files are text files. They can be edited with a text editor. The Windows Command Prompt version of wcd behaves as the DOS version. The Cygwin version of wcd behaves as the Unix version.
wcd.exe
The program. In Unix shells the program is always called by a function or alias, because the current working directory of a Unix shell can only be changed by the builtin cd command. See also section INSTALLATION.
default treedata file
This is the default treedata file where wcd searches for matches. If it is not readable wcd will create a new one.
DOS: \treedata.wcd or %HOME%\treedata.wcd
Unix: $HOME/.treedata.wcd
extra treedata file
An optional extra treedata file. If it exists and is readable wcd will try to find matches in this file also.
DOS: \extra.wcd or %HOME%\extra.wcd
Unix: $HOME/.extra.wcd
ban file
In this optional file wcd places banned paths. See option -b. Wildcards are supported.
DOS: \ban.wcd or %HOME%\ban.wcd
Unix: $HOME/.ban.wcd
alias file
Optional file with wcd aliases. See option -l.
DOS: \alias.wcd or %HOME%\alias.wcd
Unix: $HOME/.alias.wcd
stack file
In this file wcd stores its stack. The drive letter can be changed with the -d option.
DOS: c:\stack.wcd or %HOME%\stack.wcd
Unix: $HOME/.stack.wcd
The name of the stack file can be changed with environment variable WCDSTACKFILE. See section ENVIRONMENT VARIABLES.
go-script
This is the shell script which wcd.exe creates each time. It is sourced via a function or an alias. The drive letter can be changed with the -d option. For history reasons it is placed by default in $HOME/bin on Unix systems. The directory of this file can be changed with the option -G.
DOS bash: c:/wcd.go or $HOME/wcd.go
Windows Command Prompt: c:\wcdgo.bat or %HOME%\wcdgo.bat
Windows PowerShell: $env:HOME\wcdgo.ps1
WinZsh: $HOME/wcd.go
Cygwin/MSYS: $HOME/bin/wcd.go
OS/2 Command Prompt: c:\wcdgo.cmd or %HOME%\wcdgo.cmd
Unix: $HOME/bin/wcd.go
relative treedata file
Text file with relative paths from DIR. See options +S, -n and +n.
DOS: <path>\rtdata.wcd
Unix: <path>/.rtdata.wcd
ENVIRONMENT VARIABLES
HOME
Wcd uses by default environment variable HOME to determine where to store its files. See also section FILES. This can be overruled with environment variable WCDHOME.
HOME also defines where to start scanning the disk when option -s is used. This can be overruled with the environment variable WCDSCAN.
For the Unix, Cygwin, Windows PowerShell, WinZsh and MSYS version it is required that HOME or WCDHOME is set. For the other versions of wcd the use of these variables is optional.
If HOME is set on DOS/Windows, wcd will place all its files (treedata.wcd, extra.wcd, alias.wcd, ban.wcd, wcd.go) in directory HOME. The behaviour of wcd is then equal to the Unix version of wcd. Wcd will scan the disk default from HOME. Drives will not be automatically scanned by changing to them. You need to tell wcd explicitly. E.g.:
wcd -S c: -A d: -A e:
Matching of directories is now global over all scanned drives.
WCDHOME
Environment variable WCDHOME can be used to change the location of wcd's files. If both HOME and WCDHOME are set, WCDHOME will be used instead of HOME.
In wcd versions prior to 5.1.5 WCDHOME also changed the default scan directory. This has changed. Since version 5.1.5 WCDHOME does not change the default scan directory. See option -s. From version 5.1.5, use environment WCDSCAN to overrule the default scan directory.
Example for DOS, Windows, OS/2 Command Prompt:
set WCDHOME=C:\Users\erwin\wcd
An example for POSIX type shells:
export WCDHOME="$HOME/.wcd"
An example for Csh type shells:
setenv WCDHOME "$HOME/.wcd"
WCDSCAN
Use environment variable WCDSCAN to overrule the default scan directory HOME. Define a colon separated list (Unix) to define more than one directory. On DOS/Windows make the list semi-colon separated.
Examples for DOS, Windows, OS/2 Command Prompt:
set WCDSCAN=C:\Users\erwin;D:\data
set WCDSCAN=%HOMEDRIVE%%HOMEPATH%;\\projectdrive\projectX
An example for POSIX type shells:
export WCDSCAN="$HOME:/projectdisk/projectX"
An example for Csh type shells:
setenv WCDSCAN "$HOME:/projectdisk/projectX"
WCDFILTER
Specify filters with environment variable WCDFILTER. All directories that do not match the filter(s) are ignored. A list can be specified by separating filters by the shell path separator. Similar as specifying the PATH variable. The case sensitivity is mandated by the Operating system.
An example for DOS, Windows, OS/2 Command Prompt:
set WCDFILTER=projects;doc
An example for POSIX type shells:
export WCDFILTER="projects:doc"
An example for Csh type shells:
setenv WCDFILTER "projects:doc"
WCDBAN
The paths specified with environment WCDBAN will be banned by wcd. See also option -b. Specify a list of paths separated by shell PATH separator.
WCDEXCLUDE
The paths specified with environment WCDEXCLUDE will be excluded by wcd. See also options -x and -xf. Specify a list of paths separated by shell PATH separator.
An example for DOS, Windows, OS/2 Command Prompt:
set WCDEXCLUDE=*/windows;*/temp;*CVS
An example for POSIX type shells:
export WCDEXCLUDE="/dev:/tmp:*CVS"
An example for Csh type shells:
setenv WCDEXCLUDE "/dev:/tmp:*CVS"
WCDUSERSHOME
Set the base of user's home directories. On DOS/Windows the default value is \\users. On Unix/Cygwin the default value is /home. This variable is used to scan treedata files of other users. See also options -u and +u. In verbose mode wcd will print all filters, bans and excludes. See option -v.
WCDSTACKFILE
Wcd gives preference to WCDSTACKFILE over the default stack file name (see section FILES). With this variable each shell (or used terminal emulator) can have its private stack of used directories.
To use a unique time based YYYYMMDD-HHMMSS file for each opened interactive shell.
For a stack per xterm(1), use the xterm WINDOWID environment variable:
export WCDSTACKFILE=$HOME/.wcd/stack.$WINDOWID
For GNU screen(1), to use stack per screen:
export WCDSTACKFILE=$HOME/.wcd/stack.$WINDOW
TERMINFO
If the environment variable TERMINFO is defined, wcd with ncurses interface checks for a local terminal definition before checking in the standard place. This is useful if terminal definitions are not on a standard place. Often used standard places are /usr/lib/terminfo and /usr/share/terminfo.
PDC_RESTORE_SCREEN
Wcd with PDCurses interface recognizes the environment variable PDC_RESTORE_SCREEN. If this environment variable is set, PDCurses will take a copy of the contents of the screen at the time that wcd is started; when wcd exits, the screen will be restored. An example for Windows Command Prompt:
set PDC_RESTORE_SCREEN=1
Windows allows only a small buffer to be saved. So it is not always possible to restore everything. Some garbage data may be printed in the console after wcd exists if you have set a large buffer width.
SHELL
Printing of #!$SHELL on the first line of the go-script for POSIX type shell or C shell is needed for 8 bit characters. Some shells otherwise think that the go-script is a binary file and will not source it. In Cygwin Bash the variable SHELL must be set in environment using the export command, otherwise wcd can't read the variable.
BASH
Wcd for DOS bash uses $BASH instead of $SHELL, because $SHELL points to the DOS command shell. One may need to define $BASH with an export command, otherwise wcd can't read the variable.
wcd-5.3.4/src/man/man1/wcd.pod 0000644 0001755 0001001 00000126756 13033024046 015242 0 ustar waterlan Geen # Copyright and License
#
# Copyright (C) 1997-2016 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.
#
# Visit
#
# Description
#
# To learn what TOP LEVEL section to use in manual pages,
# see POSIX/Susv standard and "Utility Description Defaults" at
# http://www.opengroup.org/onlinepubs/009695399/utilities/xcu_chap01.html#tag_01_11
#
# This is manual page in Perl POD format. Read more at
# http://perldoc.perl.org/perlpod.html or run command:
#
# perldoc perlpod | less
#
# To check the syntax:
#
# podchecker *.pod
#
# Create manual page with command:
#
# pod2man PAGE.N.pod > PAGE.N
=pod
=encoding UTF-8
=head1 NAME
wcd - Wherever Change Directory
chdir for DOS and Unix
=head1 SYNOPSIS
wcd [options] [directory]
=head1 DESCRIPTION
=head2 Overview
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.
Wcd was modeled after Norton Change Directory (NCD). NCD appeared first in
I, for DOS in 1987, published by Peter Norton.
Wcd has been ported to different command-line shells: DOS command.com,
Windows cmd.exe and PowerShell, OS/2 cmd.exe, and Unix shells such as Bourne
(sh), Bourne Again (bash), Korn (ksh), Z (zsh), and C (csh) shell and others
running on any operating system.
Wcd supports 8 bit character sets on all systems, and has optional
support for Unicode. See section LOCALIZATION.
See section INSTALLATION how to setup wcd for personal use.
=head2 Basic use
By default (if no wildcards are used) wcd searches for a directory with a
name that begins with the typed name.
For instance this command will change to directory to the current user's
C:
wcd Desk
When there are multiple matches, wcd will present the user a list of all
matches. The user can then make a selection with a few keystrokes (most of
the times only one).
=head2 Wildcards
Wcd supports following wildcards:
* matches any sequence of characters (zero or more)
? matches any character
[SET] matches any character in the specified set,
[!SET] or [^SET] matches any character not in the specified set.
A set is composed of characters or ranges; a range looks like
I as in C<0-9> or C. The
C<[0-9a-zA-Z_]> is the minimal set of characters allowed in the
C<[..]> pattern construct. International characters (i.e. 8 bit characters) are
allowed if the system supports them. To suppress the special syntactic
significance of any of C<[]*?!^-\> inside or outside a C<[..]> construct and
match the character exactly, precede the character with a backslash (C<\>)
marker.
Using wildcards makes powerful searching possible. For instance this
matches any directory name that ends with "top":
wcd *top
Match directories that have "top" anywhere in the name:
wcd *top*
Match any directory name that begins with "a", "b" or "c":
wcd [a-c]*
It is also possible to give a part of a directory path. Here Wcd searches
for directory that begins with "Desk" and which path matches I<*me/Desk*>.
wcd me/Desk
It is allowed to type any kind of expression with slashes and wildcards.
E.g.:
wcd src*/*1?/a*2
=head2 Other uses
If no wildcards are used and wcd finds a perfect match, wcd will ignore all
wild matches by default. This behaviour can be changed with the B<-w> option.
The interactive directory tree browser can be started by using option B<-g>.
wcd -g
Wcd generates a treedata file where it searches the directory. On Unix and
Windows systems wcd does add symbolic links to the treedata file while
scanning the disk, but does not follow them. While following links wcd could
end up scanning infinite loops, or scan very large portions of a network.
Wcd can also change to directories that are not in the treedata file. E.g.:
wcd ..
If wcd found a match but can't change to the directory it tries to remove
it from the default treedata file. Not from the extra treedata file. See
also option B<-k>.
Wcd keeps a directory stack which is stored on disk. The stack has a
default size of 10 and is cyclic. See options B<-z>, B<->, B<+> and
B<=>.
In multi-user environments option B<-u> can be used to change to
directories of other users.
On DOS and Windows systems it does not matter if you use a slash "/" or a
backslash "\" as a directory separator.
It is possible on DOS and Windows systems to change drive and directory in
one go by preceding the directory name with the drive name.
wcd d:games
=head2 Windows UNC paths
The Windows versions (Command Prompt, PowerShell, MSYS, zsh, cygwin) support
Windows SMB LAN UNC paths without drive letter such as
C<\\servername\sharename>. Wcd for Windows Command Prompt makes use of the "pushd"
command to automatically map a UNC path to a drive letter. In Windows
PowerShell, MSYS, zsh and Cygwin UNC paths are fully supported. The
current working directory can be a UNC path.
=head2 Interfaces
Wcd has three different interfaces to choose from a list of matches. The
interface can be chosen at compile time.
The first interface uses plain stdin/stdout. A numbered list is printed in
the terminal. The user has to choose from the list by typing a number
followed by . This interface does not provide scroll back
functionality in case of a long list. The scroll back capability of the
terminal/console has to be used. It is very small and portable.
The second interface is built with the conio library. It provides a builtin
scroll back capability. The user is presented a list numbered with letters.
Choosing from a list can be done by pressing just one letter. This
interface is fast because it saves keystrokes. If possible the screen
will be restored after exiting. One who prefers to type numbers can use the
B<-N> option.
The third interface is built with the curses library. It is similar to the
conio interface. The curses version of wcd has also an additional 'graphical'
interface. It lets the user select a directory via a full screen
interactive directory tree browser. It has a vim(1) like navigation and search
method. It can be activated with option B<-g>.
By using the B<-o> option one can always fall back to the stdin/stdout
interface.
=head1 OPTIONS
=over 4
=item B<-a>
Add current path to the default treedata file.
Use this option to quickly add the current path to the default treedata
file. Re-scanning the complete disk can take a long time in some cases.
=item B<-aa>
Add current and all parent paths to the default treedata file.
=item B<-A PATH>
Scan directory tree from I and append to the default treedata
file. Examples:
wcd -A .
wcd -A /home -A /etc
wcd -A d: -A e: -A \\server\share
On Windows one can scan all shared directories of a Windows LAN server by
typing something like: C.
See also option B<-S> and B<-s> and B<-E>.
=item B<-b>
Ban current path.
Wcd places the current path in the ban file. This means that wcd ignores
all matches of this directory and its sub directories.
The ban file can be edited with a text editor. Use of wildcards is
supported and names are matched against the absolute path.
Banned paths are not excluded from scanning the disk. To do that use option
B<-xf>.
=item B<-c, --direct-cd>
Direct CD mode. By default wcd works as follows:
1. Try to find a match in the treedata file(s)
2. If no match, try to open the directory you typed.
In direct CD mode wcd works in reversed order.
1. Try to open the directory you typed.
2. If not, try to find a match in the treedata file(s).
=item B<-d DRIVE>
Set drive for stack and go file (DOS only).
The stack file and the go-script are by default stored on drive C: if
environment variable I is not set. Use this option if drive C: is a
read-only drive. This option must be used in front of the stack options B<->,
B<+> and B<=>.
=item B<-e>
Add current path to the extra treedata file.
Use this option to quickly add the current path to the extra treedata file.
=item B<-ee>
Add current and all parent paths to extra treedata file.
=item B<-E PATH>
Scan directory tree from I and append to Extra treedata file. See
also options B<-A> and B<-S>.
=item B<-f FILE>
Read treedata file I. Do not read the default treedata file.
=item B<+f FILE>
Read treedata file I in addition to the default treedata file.
=item B<-g>
Graphical interface (only in version with curses interface).
Wcd starts a textual curses based 'graphical' interface. The user can
select a directory via a full-screen interactive directory tree browser. It has
a vim(1) like navigation and search method.
If no search string is given wcd presents the whole tree which is in the
default treedata file and the extra treedata files.
If a search string is given the match list is presented as a directory
tree.
The default tree layout is similar to the tree layout of the original NCD on
DOS. The difference in layout is that in NCD all directories of a same depth
level were vertically aligned over the whole tree. This was possible in NCD,
because the maximum width of a directory name in DOS was 12 (8.3) characters. On
modern operating systems directory names can be very long, so also the
differences in length can be large. Therefore folders with a same depth are
not vertically aligned over the whole tree in wcd, but only in sub-branches.
So there is some sideways movement when moving straight up and down from one
sub-branch to another sub-branch.
The navigation behaviour in Wcd is exactly the same as in the original NCD. For
instance if you push the Down key you go down to the next directory with the
same depth level, jumping over branches. This enables fast navigation through
the tree.
See options B<-Ta>, B<-TC>, and B<-Tc> to change the navigation behaviour.
=item B<-gd>
Dump the treedata files as a tree to stdout.
=item B<-G PATH>
Write go-script in directory I. For instance on Unix, C will write
a go-script B.
=item B<-GN, --no-go-script>
Do not create go-script. This option can be used in combination with the
option B<-j> if one does not want wcd to create a go-script.
=item B<-h, --help>
Show help and exit.
=item B<-i, --ignore-case>
Ignore case.
Dos and Windows versions of wcd ignore case default. Unix/Cygwin
versions regard case by default.
=item B<+i, --no-ignore-case>
Regard case. See also option B<-i>.
=item B<-I, --ignore-diacritics>
Ignore diacritics for Latin-based scripts.
Letters with diacritical marks match their base letter without diacritical
mark. 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.
See also L
=item B<+I, --no-ignore-diacritics>
Regard diacritics (default). See also option B<-I>.
=item B<-j, --just-go>
Just go mode.
In this mode wcd will not present a list when there is more than one
directory that matches the given directory. Wcd will just change to the
first option. When wcd is invoked again with the same arguments it will
change to the next option, and so on.
Wcd will print the directory to go to to stdout. So a different
installation method can be used. One could make the following function for
a POSIX compatible shell:
wcd ()
{
cd "$($HOME/bin/wcd.exe -j $@)"
}
When you are using an old shell that doesn't support "$()" command substitution
you have to use old style command substitution with back-quotes.
wcd ()
{
cd "`$HOME/bin/wcd.exe -j $@`"
}
On Windows systems, if one is running 4NT shell, one could make the
following alias:
alias wcd `cd %@execstr[wcdwin32.exe -z 0 -j %1]`
This method eliminates the need of the go-script, so one can use option B<-GN>
in combination with B<-j>.
=item B<-k, --keep-paths>
Keep paths.
Keep paths in the treedata file when wcd can't change to them. The default
behaviour of wcd is that it tries to remove paths from the treedata when
wcd can't change to them. With this option this behavior is turned off.
=item B<-K, --color>
Use colors in graphical mode.
=item B<-l ALIAS>
Name the current path with I. Wcd places the current path with alias
I in the alias file. Aliases are case sensitive.
=item B<-ls>
Show the name of the alias file, and list all the aliases.
=item B<-m DIR>
Make directory and add to treedata file.
=item B<-L, --license>
Print the distribution license.
=item B<-M DIR>
Make directory and add to extra treedata file.
=item B<-n PATH>
Read relative treedata file from I.
Do not read the default treedata file. The relative treedata file
should already have been created using the wcd B<+S> option.
I may also point to a file directly.
An example. Suppose another system has been mounted to mount point
C:
wcd -n /mnt/network src
Wcd opens the relative treedata file in C. The file contains the paths
relative from that point.
=item B<+n PATH>
Read relative treedata file in addition to the default treedata file. See
option B<-n>.
=item B<-N, --numbers>
Use numbers instead of letters.
Wcd with a conio or curses based interface (see section Interfaces) presents
a match list by default numbered with letters. When the B<-N> option is used
the match list is numbered with numbers. Regardless of the B<-N> option one
can type a letter or numbers to make a selection from the list of matches.
=item B<-o>
Use stdin/stdout interface.
When for some kind of reason the conio or curses interface of wcd does not
work one can fall back to the stdin/stdout interface of wcd by using the
B<-o> option.
=item B<-od, --to-stdout>
Dump all matches to stdout.
=item B<-q, --quiet>
Quieter operation. Printing of the final match is suppressed.
=item B<-r DIR>
Remove directory and remove from the treedata file.
If the directory is empty, wcd will remove it, and try to remove it from
the treedata file.
=item B<-rmtree DIR>
Recursively remove directory and remove from the treedata file.
Wcd will remove the directory and all its sub directories and files, and
remove the directories from the treedata file.
=item B<-s>
(re)Scan disk from C<$HOME> directory. If I is not defined the disk is
scanned from root directory /.
The existing default treedata file is overwritten.
The default scan directory can be overruled with environment variable
C. See section ENVIRONMENT VARIABLES.
=item B<-S PATH>
Scan directory tree from I and overwrite the default treedata file.
See also options B<-A>, B<-s> and B<-E>. E.g. with option B<-A> you
can create a default treedata file of your choice. Examples:
Unix:
wcd -S /
wcd -S /home -A /etc -A /usr
DOS/Windows:
wcd -S c:/
wcd -S c: -A d: -A \\server\share
With the Windows versions one can scan all shared directories of a Windows
LAN server by typing something like: C.
=item B<+S PATH>
Scan disk from I and place relative paths in a relative treedata file.
This file is used by the B<-n> and B<+n> options of wcd. E.g. C.
=item B<-t>
Do not strip tmp mount dir C (Unix only)
Wcd strips by default C from the match. Directory
C is used by the auto-mounter. This behaviour can be turned
off with the B<-t> option.
=item B<-T, --ascii-tree>
Draw tree with ASCII characters. Use this option if line drawing characters
are not displayed properly in your terminal.
=item B<-Ta, --alt-tree-nav>
Alternative way of navigation in the graphical tree.
In the default NCD style tree layout the B<-Ta> option disables
jumping to unrelated directories.
In compact tree mode the alternative mode makes navigation similar to
navigation in GUI file managers such as Windows Explorer or Linux KDE
Konqueror. Pressing Up and Down moves the selected folder one line up or
down. Pressing Left first folds the sub-folders and the next move left moves
really left.
You can switch on-the-fly between default and alternative navigation
by pressing .
When alternative navigation mode is on, you will see an "A" in the lower right corner.
=item B<-TC, --center-tree>
Centered view in the graphical tree. The selected directory stays in the middle
of the screen. The centered mode can also be switched on and off with key
in the graphical tree.
The standard non-centered behaviour, which minimises tree movement, is the same
as in the original NCD.
=item B<-Tc, --compact-tree>
By default the 'graphical' tree is drawn the same way as the original NCD on
DOS 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 option B<-Tc> or switch on-the-fly
with the key.
=item B<-Td, --cjk-width>
Legacy East-Asian CJK (Chinese, Japanese, and Korean) fonts have certain
characters and line drawing symbols with a column width of 2, while the normal
Unicode width for these characters is 1 column. For instance the Chinese CP936
raster font on Windows and the Simsun font. Use this option for a correct
outlining of the graphical tree when a legacy CJK font is used.
When CJK mode is on, you will see a "C" in the lower right corner.
=item B<-u USER>
Scan treedata file of another user based on I, do not scan your own default
treedata file. See also section ENVIRONMENT VARIABLES for I.
On Unix/Cygwin the base directory
for user home directories is assumed to be C. Wcd will look for
C and C, in that
order, and read the first one that exists and is readable.
On DOS/Windows the base directory for user
home directories is assumed to be C<\\users>, so wcd tries to read
C<\\users\USER\treedata.wcd> and C<\\users\USER\.wcd\treedata.wcd>.
=item B<+u USER>
Read default treedata file of USER in addition to your own treedata
file.
=item B<-v, --verbose>
Display verbose messages. With this option wcd prints all filters, bans and
excludes.
=item B<-V, --version>
Print version information and exit.
=item B<-w, --wild-match-only>
Wild matching only. Treat all matches as wild matches.
=item B<-x PATH>
Exclude I from scanning.
When this option is used wcd will exclude I and all its subdirectories
when wcd is scanning a disk. Wildcards are supported and matched against
absolute paths. Option B<-x> can be used multiple times.
wcd -x -x -s
Option B<-x> must be used in front of any scan option (B<-s>, B<-S>, B<+S>,
B<-A>, B<-E>).
On DOS/Windows systems one must specify the drive letter depending on if
environment variable I or I is set. If I or I
is set one needs to specify the drive letter. An example:
wcd -x c:/temp -S c:
Otherwise do not specify drive letter.
wcd -x /temp -s
=item B<-xf FILE>
Exclude all paths listed in I from scanning.
When this option is used wcd will exclude all paths listed in I and all
their subdirectories when wcd is scanning a disk. Wildcards are supported
and they are matched against absolute paths; one path per line. Be aware
that wcd will not ignore leading or trailing blanks on a line, because they
are legal characters in a directory name. Option B<-xf> can be used multiple
times. When one wants to exclude all banned paths from scanning one can do
the following (example for wcd on unix):
wcd -xf ~/.ban.wcd -s
Wildcards are supported. For instance to exclude all your Subversion directories
with administrative files add a line with C<*/.svn>.
Option B<-xf> must be used in front of any scan option (B<-s>, B<-S>, B<+S>,
B<-A>, B<-E>).
=item B<-y, --assume-yes>
Assume Yes on all queries.
Wcd will not prompt the user with yes/no questions, but assumes the user
answers yes on all questions. This can be used in combination with option
B<-rmtree>. This option must be used in front of options that can lead
to yes/no questions.
=item B<-z NUMBER>
Set maximum stack size to NUMBER.
The default size of the stack is 10. Stack operation can be turned off by
setting the size to 0. This option must be used in front of any other stack
operations (B<->,B<+>,B<=>). Otherwise the size of the stack will be set
back to the default 10.
A correct command is:
wcd -z 50 -
The new stack size will be 50, wcd will go one directory back. A wrong
command is:
wcd - -z 50
Wcd goes one directory back, the stack gets the default size 10. The B<-z
50> is ignored.
Add this option as the first option to your wcd alias or function. E.g.
for the a POSIX compatible shell this would be:
wcd ()
{
wcd.exe -z 50 "$@"
. ${WCDHOME:-${HOME}}/bin/wcd.go
}
=item B<-[NUMBER]>
Push dir NUMBER of times. Default is one.
Go back a directory. Command C goes one directory back. To go more
directories back add a number to it. E.g. command C. The stack is
cyclic.
=item B<+[NUMBER]>
Pop dir NUMBER of times. Default is one.
Go forward a directory. Command C goes one directory forward. To go
more directories forward add a number to it. E.g. command C. The
stack is cyclic.
=item B<=>
Show stack.
Use this option if you do not know anymore how many times to push or pop.
The stack is printed and you can choose a number. The current place in
the stack is marked with an asterisk C<*>.
=back
=head1 INSTALLATION
The current working directory of a Unix shell can only be
changed by the builtin cd(1) command. Therefore the program is always called
by a function or an alias. The function or alias sources a shell script
(go-script) which is generated by the wcd program. Wcd can only work after
the function or alias is defined.
Another important influence on your installation is the definition of
environment variables I and I. See section ENVIRONMENT
VARIABLES.
=head2 Install for POSIX type shells
For a POSIX shell (ksh, bash, zsh, etc.) on Unix, Linux, Cygwin, or native MSYS
add the following function to the shell startup file (e.g. Bash uses
C<$HOME/.bashrc>):
wcd ()
{
/wcd.exe "$@"
. ${WCDHOME:-${HOME}}/bin/wcd.go
}
Replace I with the location where the wcd executable has been
installed. Reload the shell initialization files or start new shell.
The location of the go-script C differs per shell.
Wcd for DJGPP DOS bash requires a different function. The go script is not
written in a directory C, and if I and I are both not defined the
go-script is written on c:/.
wcd ()
{
/wcd.exe "$@"
. ${WCDHOME:-${HOME:-"c:"}}/wcd.go
}
The WinZsh version of wcd is also a bit different. No C directory.
wcd ()
{
/wcd.exe "$@"
. ${WCDHOME:-${HOME}}/wcd.go
}
See section FILES for more information.
=head2 Install for C-alike shells (csh, tcsh)
Add the following alias to the shell startup file C<$HOME/.cshrc> or
C<$HOME/.tcshrc> :
if ( ${?WCDHOME} ) then
alias wcd "/wcd.exe \!* ; source $WCDHOME/bin/wcd.go"
else
alias wcd "/wcd.exe \!* ; source $HOME/bin/wcd.go"
endif
Replace I with the location where the wcd executable has been installed.
Reload the shell initialization files or start a new shell.
=head2 Windows Command Prompt version
Unpack the zip file and add directory C to your environment
variable I.
In Windows Command Prompt a Windows program cannot change the current work
directory, but a .bat file can. The batch scrip C runs the wcd program
which generates a new batch script C. Then C runs C
which actually changes the directory.
=head2 Windows VISTA and higher
In a Windows VISTA and higher Command Prompt you may have limited access to
directories. To get access to more directories you need administrator
rights. You can get a Command Prompt with administrator rights if you right
click on the Command Prompt icon and select I.
=head2 Windows PowerShell version
Add the following function to your PowerShell user profile. The location of
this profile is stored in the $profile variable. It is required that
one of the environment variables I or I is defined.
function wcd
{
\wcdwin32psh.exe $args
& $env:HOME\wcdgo.ps1
}
Replace I with the location where the wcd executable has been installed.
Start a new PowerShell. Wcd for PowerShell supports only the file system
provider. No other providers.
=head2 OS/2 Command Prompt version
In an OS/2 Command Prompt (cmd.exe) an OS/2-program can't change the current
work directory. That is why wcd generates a command script C which
must be executed in the current shell. The script C first executes
C, which creates the C script. Then C executes
the C script.
=head1 LOCALIZATION
=over 4
=item B
The primary language is selected with the environment variable I. The
I variable consists out of several parts. The first part is in small
letters the language code. The second one is optional and is the country code
in capital letters, preceded with an underscore. There is also an
optional third part: character encoding, preceded with a dot. A few
examples for POSIX standard type shells:
export LANG=nl Dutch
export LANG=nl_NL Dutch, The Netherlands
export LANG=nl_BE Dutch, Belgium
export LANG=es_ES Spanish, Spain
export LANG=es_MX Spanish, Mexico
export LANG=en_US.iso88591 English, USA, Latin-1 encoding
For a complete list of language and country codes see the gettext(1)
manual:
L
On Unix systems you can use to command locale(1) to get locale
specific information.
=item B
With the I environment variable you can specify a priority list
of languages, separated by colons. Wcd gives preference to I over
I. For instance, first Dutch and then German: C. You
have to first enable localization, by setting I or I to a
value other than I, before you can use a language priority list through
the I variable. See also the gettext(1) manual:
L
If you select a language which is not available you will get the standard
English messages.
=item B
With the environment variable I the I used during
compilation and installation of wcd can be overruled. I is used by
wcd with native language support to find the language files. The GNU
default value is C. By typing C wcd will print
the I that is used.
If you have installed wcd in a different directory than the default
directory you may need to set the environment variable I to
point to the locale directory.
An example for Windows cmd:
set WCDLOCALEDIR=c:/my_prefix/share/locale
An example for a POSIX shell:
export WCDLOCALEDIR=$HOME/share/locale
=item B
When there are multiple directory matches wcd presents a sorted list. The
sorting depends on the locale settings. If the environment I has been
set the matches are sorted like dictionaries or phone books are sorted in
that language. For instance dots and dashes are ignored, or letters e with
and without accent are equal, or upper and lower case is ignored.
The sorting gives preference to environment variable I
over I. If you make I equal to C or C,
locale sorting is turned off. For instance if you want Dutch language,
but not Dutch sorting, you can do something like this:
export LANG=nl_NL
export LC_COLLATE=C
=item B
With regard to character encoding Wcd will give preference to variable
I over I. For instance to set character encoding to
UTF-8 the following environment setting can be done.
export LC_CTYPE=en_US.UTF-8
=item B
All locale environment variables that start with I are overruled by
the environment variable I if it is defined. Wcd gives preference to
I over I and I.
=back
=head2 WINDOWS CODE PAGES
There are two groups of code pages: DOS code pages (OEM) and Windows code pages
(ANSI). The default encoding for Windows, when configured with Western regional
settings, is ANSI CP1252. Windows programs, for instance notepad, use this
default system ANSI code page. The Windows console uses by default an OEM code
page (CP437 or CP850) for compatibility with DOS programs. If you use a DOS
version of wcd in a Windows console it will work, because of the DOS code page.
But the DOS version of wcd lacks support for long directory names and network
drives on Windows.
The Windows version of wcd is a native Windows program and will use the Windows
system ANSI code page. So on a Western regional Windows it will use code page
CP1252 for directory names and messages. In order to get consistent output,
independent of the active code page, all Windows versions of Wcd translate ANSI
output to Unicode output in the Command Prompt and PowerShell.
The console raster font only supports the original OEM code page installed with
Windows, so you have to change the console's font to true type Lucida
Console to make Unicode (and ANSI) letters appear correctly.
Non-Unicode versions of Wcd I use plain ANSI output.
For these older versions the code page of the console has to be made equal to
the system code page (changed to 1252) to make wcd for Windows work properly
with special characters such as accented characters or the Euro symbol.
The Windows system code page can be changed via the Control Panel regional
options. The Windows console code page is changed with the C command.
When you type C, the actual character encoding used by wcd is
shown. Type the command C to display the active code page of the Windows
console.
=head2 UNICODE
Wcd has optional support for Unicode. To see if wcd was built with Unicode support
type C. If your terminal/console and font supports it, you
should see the Euro symbol and Chinese characters (meaning:
"Chinese").
Wcd has been I converted to Unicode. In its core wcd handles all data
as a stream of bytes. Only the lines printed to screen are on the fly
converted to Unicode wide characters. Wcd fully relies on libc functions
and has no UTF-8 specific code. See also
L
Wcd has optional support for Unicode matching with normalisation. To find
out whether Wcd has normalisation support type C.
Wcd with Unicode normalization support will match Unicode names based on I
equivalence. Without Unicode normalization support, names are matched
when they are binary equivalent.
See also L
=head3 UTF-8 on Unix/Linux
In order to view UTF-8 characters your console/terminal also needs to
support UTF-8. The xterm version that comes with XFree86 4.0 or higher
includes UTF-8 support. To activate it, start xterm(1) in a UTF-8
locale and use a font with iso10646-1 encoding, for instance with
LC_CTYPE=en_GB.UTF-8 xterm -u8 -fn '-Misc-Fixed-Medium-R-SemiCondensed--13-120-75-75-C-60-ISO10646-1'
Modern distributions of GNU/Linux support UTF-8 by default. Other multi-byte
character encodings should also work, but that has not been tested.
Wcd assumes that the treedata files are encoded in the locale character
encoding. There are no Byte Order Marks written to treedata files.
=head3 UTF-16 on Windows
On Windows Unicode is supported in all versions of PowerShell, and in Windows
Command Prompt on Windows 7 (or higher). Unicode also works in Take Command
or TCC/LE made by JP Software, which can be used on older Windows versions
(XP/Vista).
On Windows all the directory names on disk are encoded in UTF-16 Unicode.
For non-Unicode Windows programs the Unicode characters are
translated to the default ANSI code page. For characters that are not part of the
regional setting this translation is not possible and non-Unicode programs
print a question mark or a wrong character instead.
Wcd with Unicode support will read the UTF-16 encoded directory names and
converts them internally to UTF-8. All treedata files are encoded in UTF-8
and not compatible with the non-Unicode version of Wcd. Wcd will create a
go-script encoded in UTF-8.
All versions of Windows PowerShell are able to run scripts encoded in UTF-8,
provided there is an UTF-8 BOM in the script.
Since Windows 7 it is possible in Windows Command Prompt to change directory
with a batch script to a directory with Unicode letters in the name. The
directory name needs to be encoded in UTF-8, and the batch script must I
have a BOM. The active code page of the Command Prompt needs to be set to 65001
(UTF-8) prior to the cd command. Wcd for Command Prompt will create such a go
script C. It first changes the code page to 65001, then changes
directory, and finally sets the code page back to the original code page.
You need to set the font to True Type Lucida Console (not raster font) when
letters don't appear correctly.
The non-Unicode Windows version of Wcd can read Unicode treedata files since
version 5.2.0, provided there is a Byte Order Mark (BOM) in the file
(see L), but it can't change
to directories with Unicode letters in the name that are not part of the
default system ANSI code page. The Unicode Windows version of wcd writes
a BOM in the UTF-8 encoded treedata files since version 5.2.0, which makes
them also readable by notepad.
=head3 UTF-8 on Cygwin
Cygwin supports Unicode since version 1.7. The Cygwin layer takes care
that the Windows UTF-16 Unicode names are converted to UTF-8. So
programs, like wcd, do not need to be aware of this and can operate
using UTF-8 encoding as on Unix/Linux. Set character encoding to UTF-8
with the I or I environment variable. You may need to
rescan your drives. You need to set the font to True Type Lucida
Console (not raster font) if you use the default Cygwin console.
The Cygwin version behaves exactly as the Unix version of wcd.
There is no BOM written in the treedata files, and it is assumed
they are encoded in the B locale character encoding.
=head1 FILES
If the environment variable I is set wcd will use I
instead of I. All C<*.wcd> files are text files. They can be
edited with a text editor.
The Windows Command Prompt version of wcd behaves as
the DOS version. The Cygwin version of wcd behaves as the Unix
version.
=over 4
=item B
The program. In Unix shells the program is always called by a
function or alias, because the current working directory of a Unix
shell can only be changed by the builtin cd command. See also section
INSTALLATION.
=item B
This is the default treedata file where wcd searches for matches. If it is
not readable wcd will create a new one.
DOS: \treedata.wcd or %HOME%\treedata.wcd
Unix: $HOME/.treedata.wcd
=item B
An optional extra treedata file. If it exists and is readable wcd will try
to find matches in this file also.
DOS: \extra.wcd or %HOME%\extra.wcd
Unix: $HOME/.extra.wcd
=item B
In this optional file wcd places banned paths. See option B<-b>. Wildcards are
supported.
DOS: \ban.wcd or %HOME%\ban.wcd
Unix: $HOME/.ban.wcd
=item B
Optional file with wcd aliases. See option B<-l>.
DOS: \alias.wcd or %HOME%\alias.wcd
Unix: $HOME/.alias.wcd
=item B
In this file wcd stores its stack. The drive letter can be changed with
the B<-d> option.
DOS: c:\stack.wcd or %HOME%\stack.wcd
Unix: $HOME/.stack.wcd
The name of the stack file can be changed with environment variable I.
See section ENVIRONMENT VARIABLES.
=item B
This is the shell script which wcd.exe creates each time. It is sourced via
a function or an alias. The drive letter can be changed with the B<-d> option.
For history reasons it is placed by default in C<$HOME/bin> on Unix
systems. The directory of this file can be changed with the option B<-G>.
DOS bash: c:/wcd.go or $HOME/wcd.go
Windows Command Prompt: c:\wcdgo.bat or %HOME%\wcdgo.bat
Windows PowerShell: $env:HOME\wcdgo.ps1
WinZsh: $HOME/wcd.go
Cygwin/MSYS: $HOME/bin/wcd.go
OS/2 Command Prompt: c:\wcdgo.cmd or %HOME%\wcdgo.cmd
Unix: $HOME/bin/wcd.go
=item B
Text file with relative paths from I. See options B<+S>, B<-n> and
B<+n>.
DOS: \rtdata.wcd
Unix: /.rtdata.wcd
=back
=head1 ENVIRONMENT VARIABLES
=over 4
=item B
Wcd uses by default environment variable I to determine where to store
its files. See also section FILES. This can be overruled with environment
variable I.
I also defines where to start scanning the disk when option B<-s> is
used. This can be overruled with the environment variable I.
For the Unix, Cygwin, Windows PowerShell, WinZsh and MSYS version
it is required that I or I is set. For the other
versions of wcd the use of these variables is optional.
If I is set on DOS/Windows, wcd will place all its files
(treedata.wcd, extra.wcd, alias.wcd, ban.wcd, wcd.go) in directory
I. The behaviour of wcd is then equal to the Unix version of
wcd. Wcd will scan the disk default from I. Drives will not be
automatically scanned by changing to them. You need to tell wcd
explicitly. E.g.:
wcd -S c: -A d: -A e:
Matching of directories is now global over all scanned drives.
=item B
Environment variable I can be used to change the location of wcd's
files. If both I and I are set, I will be used instead
of I.
In wcd versions prior to 5.1.5 I also changed the default scan directory.
This has changed. Since version 5.1.5 I does not change the default scan
directory. See option B<-s>. From version 5.1.5, use environment I to
overrule the default scan directory.
Example for DOS, Windows, OS/2 Command Prompt:
set WCDHOME=C:\Users\erwin\wcd
An example for POSIX type shells:
export WCDHOME="$HOME/.wcd"
An example for Csh type shells:
setenv WCDHOME "$HOME/.wcd"
=item B
Use environment variable I to overrule the default scan
directory I. Define a colon separated list (Unix) to define more
than one directory.
On DOS/Windows make the list semi-colon separated.
Examples for DOS, Windows, OS/2 Command Prompt:
set WCDSCAN=C:\Users\erwin;D:\data
set WCDSCAN=%HOMEDRIVE%%HOMEPATH%;\\projectdrive\projectX
An example for POSIX type shells:
export WCDSCAN="$HOME:/projectdisk/projectX"
An example for Csh type shells:
setenv WCDSCAN "$HOME:/projectdisk/projectX"
=item B
Specify filters with environment variable I. All
directories that do not match the filter(s) are ignored. A list can be
specified by separating filters by the shell path
separator. Similar as specifying the I variable.
The case sensitivity is mandated by the Operating system.
An example for DOS, Windows, OS/2 Command Prompt:
set WCDFILTER=projects;doc
An example for POSIX type shells:
export WCDFILTER="projects:doc"
An example for Csh type shells:
setenv WCDFILTER "projects:doc"
=item B
The paths specified with environment I will be banned by wcd.
See also option B<-b>. Specify a list of paths separated by shell
I separator.
=item B
The paths specified with environment I will be excluded by
wcd. See also options B<-x> and B<-xf>. Specify a list of paths
separated by shell I separator.
An example for DOS, Windows, OS/2 Command Prompt:
set WCDEXCLUDE=*/windows;*/temp;*CVS
An example for POSIX type shells:
export WCDEXCLUDE="/dev:/tmp:*CVS"
An example for Csh type shells:
setenv WCDEXCLUDE "/dev:/tmp:*CVS"
=item B
Set the base of user's home directories.
On DOS/Windows the default value is C<\\users>.
On Unix/Cygwin the default value is C.
This variable is used to scan treedata files of other users. See also
options B<-u> and B<+u>. In verbose mode wcd will print all filters,
bans and excludes. See option B<-v>.
=item B
Wcd gives preference to I over the default stack file name (see
section FILES). With this variable each shell (or used terminal emulator) can
have its private stack of used directories.
To use a unique time based YYYYMMDD-HHMMSS file for each opened
interactive shell.
export WCDSTACKFILE=$HOME/.wcd/stack.$(date +%Y%m%d-%H%M%S)
For a stack per xterm(1), use the xterm I environment variable:
export WCDSTACKFILE=$HOME/.wcd/stack.$WINDOWID
For GNU screen(1), to use stack per screen:
export WCDSTACKFILE=$HOME/.wcd/stack.$WINDOW
=item B
If the environment variable I is defined, wcd with ncurses
interface checks for a local terminal definition before checking in
the standard place. This is useful if terminal definitions are not on
a standard place. Often used standard places are C
and C.
=item B
Wcd with PDCurses interface recognizes the environment variable
I. If this environment variable is set, PDCurses
will take a copy of the contents of the screen at the time that wcd is
started; when wcd exits, the screen will be restored.
An example for Windows Command Prompt:
set PDC_RESTORE_SCREEN=1
Windows allows only a small buffer to be saved. So it is not always
possible to restore everything. Some garbage data may be printed in
the console after wcd exists if you have set a large buffer width.
=item B
Printing of C<#!$SHELL> on the first line of the go-script for POSIX
type shell or C shell is needed for 8 bit characters. Some shells
otherwise think that the go-script is a binary file and will not
source it. In Cygwin Bash the variable I must be set in
environment using the C command, otherwise wcd can't read the
variable.
=item B
Wcd for DOS bash uses C<$BASH> instead of C<$SHELL>, because C<$SHELL>
points to the DOS command shell. One may need to define C<$BASH> with
an C command, otherwise wcd can't read the variable.
=back
=head1 SEE ALSO
sh(1),
bash(1),
csh(1),
ksh(1),
zsh(1),
locale(1),
ncurses(1),
=head1 AUTHORS
Wcd was written by Erwin Waterlander
Project homepage:
L
SourceForge:
L
The manual page formatting was provided by Jari Aalto
.
NCD was originally written by Brad Kingsbury for Peter Norton's
"Norton Utilities" around 1987. See also
L
=cut
wcd-5.3.4/src/man/man1/wcd.txt 0000644 0001755 0001001 00000133552 13033024066 015271 0 ustar waterlan Geen NAME
wcd - Wherever Change Directory
chdir for DOS and Unix
SYNOPSIS
wcd [options] [directory]
DESCRIPTION
Overview
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.
Wcd was modeled after Norton Change Directory (NCD). NCD appeared first
in *The Norton Utilities, Release 4*, for DOS in 1987, published by
Peter Norton.
Wcd has been ported to different command-line shells: DOS command.com,
Windows cmd.exe and PowerShell, OS/2 cmd.exe, and Unix shells such as
Bourne (sh), Bourne Again (bash), Korn (ksh), Z (zsh), and C (csh) shell
and others running on any operating system.
Wcd supports 8 bit character sets on all systems, and has optional
support for Unicode. See section LOCALIZATION.
See section INSTALLATION how to setup wcd for personal use.
Basic use
By default (if no wildcards are used) wcd searches for a directory with
a name that begins with the typed name.
For instance this command will change to directory to the current user's
"/home/user/Desktop":
wcd Desk
When there are multiple matches, wcd will present the user a list of all
matches. The user can then make a selection with a few keystrokes (most
of the times only one).
Wildcards
Wcd supports following wildcards:
* matches any sequence of characters (zero or more)
? matches any character
[SET] matches any character in the specified set,
[!SET] or [^SET] matches any character not in the specified set.
A set is composed of characters or ranges; a range looks like *character
hyphen character* as in "0-9" or "A-Z". The "[0-9a-zA-Z_]" is the
minimal set of characters allowed in the "[..]" pattern construct.
International characters (i.e. 8 bit characters) are allowed if the
system supports them. To suppress the special syntactic significance of
any of "[]*?!^-\" inside or outside a "[..]" construct and match the
character exactly, precede the character with a backslash ("\") marker.
Using wildcards makes powerful searching possible. For instance this
matches any directory name that ends with "top":
wcd *top
Match directories that have "top" anywhere in the name:
wcd *top*
Match any directory name that begins with "a", "b" or "c":
wcd [a-c]*
It is also possible to give a part of a directory path. Here Wcd
searches for directory that begins with "Desk" and which path matches
**me/Desk**.
wcd me/Desk
It is allowed to type any kind of expression with slashes and wildcards.
E.g.:
wcd src*/*1?/a*2
Other uses
If no wildcards are used and wcd finds a perfect match, wcd will ignore
all wild matches by default. This behaviour can be changed with the -w
option.
The interactive directory tree browser can be started by using option
-g.
wcd -g
Wcd generates a treedata file where it searches the directory. On Unix
and Windows systems wcd does add symbolic links to the treedata file
while scanning the disk, but does not follow them. While following links
wcd could end up scanning infinite loops, or scan very large portions of
a network.
Wcd can also change to directories that are not in the treedata file.
E.g.:
wcd ..
If wcd found a match but can't change to the directory it tries to
remove it from the default treedata file. Not from the extra treedata
file. See also option -k.
Wcd keeps a directory stack which is stored on disk. The stack has a
default size of 10 and is cyclic. See options -z, -, + and =.
In multi-user environments option -u can be used to change to
directories of other users.
On DOS and Windows systems it does not matter if you use a slash "/" or
a backslash "\" as a directory separator.
It is possible on DOS and Windows systems to change drive and directory
in one go by preceding the directory name with the drive name.
wcd d:games
Windows UNC paths
The Windows versions (Command Prompt, PowerShell, MSYS, zsh, cygwin)
support Windows SMB LAN UNC paths without drive letter such as
"\\servername\sharename". Wcd for Windows Command Prompt makes use of
the "pushd" command to automatically map a UNC path to a drive letter.
In Windows PowerShell, MSYS, zsh and Cygwin UNC paths are fully
supported. The current working directory can be a UNC path.
Interfaces
Wcd has three different interfaces to choose from a list of matches. The
interface can be chosen at compile time.
The first interface uses plain stdin/stdout. A numbered list is printed
in the terminal. The user has to choose from the list by typing a number
followed by . This interface does not provide scroll back
functionality in case of a long list. The scroll back capability of the
terminal/console has to be used. It is very small and portable.
The second interface is built with the conio library. It provides a
builtin scroll back capability. The user is presented a list numbered
with letters. Choosing from a list can be done by pressing just one
letter. This interface is fast because it saves keystrokes. If possible
the screen will be restored after exiting. One who prefers to type
numbers can use the -N option.
The third interface is built with the curses library. It is similar to
the conio interface. The curses version of wcd has also an additional
'graphical' interface. It lets the user select a directory via a full
screen interactive directory tree browser. It has a vim(1) like
navigation and search method. It can be activated with option -g.
By using the -o option one can always fall back to the stdin/stdout
interface.
OPTIONS
-a Add current path to the default treedata file.
Use this option to quickly add the current path to the default
treedata file. Re-scanning the complete disk can take a long time in
some cases.
-aa Add current and all parent paths to the default treedata file.
-A PATH
Scan directory tree from *PATH* and append to the default treedata
file. Examples:
wcd -A .
wcd -A /home -A /etc
wcd -A d: -A e: -A \\server\share
On Windows one can scan all shared directories of a Windows LAN
server by typing something like: "wcd -A \\servername".
See also option -S and -s and -E.
-b Ban current path.
Wcd places the current path in the ban file. This means that wcd
ignores all matches of this directory and its sub directories.
The ban file can be edited with a text editor. Use of wildcards is
supported and names are matched against the absolute path.
Banned paths are not excluded from scanning the disk. To do that use
option -xf.
-c, --direct-cd
Direct CD mode. By default wcd works as follows:
1. Try to find a match in the treedata file(s)
2. If no match, try to open the directory you typed.
In direct CD mode wcd works in reversed order.
1. Try to open the directory you typed.
2. If not, try to find a match in the treedata file(s).
-d DRIVE
Set drive for stack and go file (DOS only).
The stack file and the go-script are by default stored on drive C:
if environment variable *HOME* is not set. Use this option if drive
C: is a read-only drive. This option must be used in front of the
stack options -, + and =.
-e Add current path to the extra treedata file.
Use this option to quickly add the current path to the extra
treedata file.
-ee Add current and all parent paths to extra treedata file.
-E PATH
Scan directory tree from *PATH* and append to Extra treedata file.
See also options -A and -S.
-f FILE
Read treedata file *FILE*. Do not read the default treedata file.
+f FILE
Read treedata file *FILE* in addition to the default treedata file.
-g Graphical interface (only in version with curses interface).
Wcd starts a textual curses based 'graphical' interface. The user
can select a directory via a full-screen interactive directory tree
browser. It has a vim(1) like navigation and search method.
If no search string is given wcd presents the whole tree which is in
the default treedata file and the extra treedata files.
If a search string is given the match list is presented as a
directory tree.
The default tree layout is similar to the tree layout of the
original NCD on DOS. The difference in layout is that in NCD all
directories of a same depth level were vertically aligned over the
whole tree. This was possible in NCD, because the maximum width of a
directory name in DOS was 12 (8.3) characters. On modern operating
systems directory names can be very long, so also the differences in
length can be large. Therefore folders with a same depth are not
vertically aligned over the whole tree in wcd, but only in
sub-branches. So there is some sideways movement when moving
straight up and down from one sub-branch to another sub-branch.
The navigation behaviour in Wcd is exactly the same as in the
original NCD. For instance if you push the Down key you go down to
the next directory with the same depth level, jumping over branches.
This enables fast navigation through the tree.
See options -Ta, -TC, and -Tc to change the navigation behaviour.
-gd Dump the treedata files as a tree to stdout.
-G PATH
Write go-script in directory *PATH*. For instance on Unix, "wcd -G
PATH" will write a go-script PATH/wcd.go.
-GN, --no-go-script
Do not create go-script. This option can be used in combination with
the option -j if one does not want wcd to create a go-script.
-h, --help
Show help and exit.
-i, --ignore-case
Ignore case. Dos and Windows versions of wcd ignore case default.
Unix/Cygwin versions regard case by default.
+i, --no-ignore-case
Regard case. See also option -i.
-I, --ignore-diacritics
Ignore diacritics for Latin-based scripts. Letters with diacritical
marks match their base letter without diacritical mark. 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. See also
+I, --no-ignore-diacritics
Regard diacritics (default). See also option -I.
-j, --just-go
Just go mode.
In this mode wcd will not present a list when there is more than one
directory that matches the given directory. Wcd will just change to
the first option. When wcd is invoked again with the same arguments
it will change to the next option, and so on.
Wcd will print the directory to go to to stdout. So a different
installation method can be used. One could make the following
function for a POSIX compatible shell:
wcd ()
{
cd "$($HOME/bin/wcd.exe -j $@)"
}
When you are using an old shell that doesn't support "$()" command
substitution you have to use old style command substitution with
back-quotes.
wcd ()
{
cd "`$HOME/bin/wcd.exe -j $@`"
}
On Windows systems, if one is running 4NT shell, one could make the
following alias:
alias wcd `cd %@execstr[wcdwin32.exe -z 0 -j %1]`
This method eliminates the need of the go-script, so one can use
option -GN in combination with -j.
-k, --keep-paths
Keep paths.
Keep paths in the treedata file when wcd can't change to them. The
default behaviour of wcd is that it tries to remove paths from the
treedata when wcd can't change to them. With this option this
behavior is turned off.
-K, --color
Use colors in graphical mode.
-l ALIAS
Name the current path with *ALIAS*. Wcd places the current path with
alias *ALIAS* in the alias file. Aliases are case sensitive.
-ls Show the name of the alias file, and list all the aliases.
-m DIR
Make directory and add to treedata file.
-L, --license
Print the distribution license.
-M DIR
Make directory and add to extra treedata file.
-n PATH
Read relative treedata file from *PATH*.
Do not read the default treedata file. The relative treedata file
should already have been created using the wcd +S option. *PATH* may
also point to a file directly.
An example. Suppose another system has been mounted to mount point
"/mnt/network":
wcd -n /mnt/network src
Wcd opens the relative treedata file in "/mnt/network/". The file
contains the paths relative from that point.
+n PATH
Read relative treedata file in addition to the default treedata
file. See option -n.
-N, --numbers
Use numbers instead of letters.
Wcd with a conio or curses based interface (see section Interfaces)
presents a match list by default numbered with letters. When the -N
option is used the match list is numbered with numbers. Regardless
of the -N option one can type a letter or numbers to make a
selection from the list of matches.
-o Use stdin/stdout interface.
When for some kind of reason the conio or curses interface of wcd
does not work one can fall back to the stdin/stdout interface of wcd
by using the -o option.
-od, --to-stdout
Dump all matches to stdout.
-q, --quiet
Quieter operation. Printing of the final match is suppressed.
-r DIR
Remove directory and remove from the treedata file.
If the directory is empty, wcd will remove it, and try to remove it
from the treedata file.
-rmtree DIR
Recursively remove directory and remove from the treedata file.
Wcd will remove the directory and all its sub directories and files,
and remove the directories from the treedata file.
-s (re)Scan disk from $HOME directory. If *HOME* is not defined the
disk is scanned from root directory /.
The existing default treedata file is overwritten.
The default scan directory can be overruled with environment
variable "WCDSCAN". See section ENVIRONMENT VARIABLES.
-S PATH
Scan directory tree from *PATH* and overwrite the default treedata
file. See also options -A, -s and -E. E.g. with option -A you can
create a default treedata file of your choice. Examples:
Unix:
wcd -S /
wcd -S /home -A /etc -A /usr
DOS/Windows:
wcd -S c:/
wcd -S c: -A d: -A \\server\share
With the Windows versions one can scan all shared directories of a
Windows LAN server by typing something like: "wcd -S \\servername".
+S PATH
Scan disk from *PATH* and place relative paths in a relative
treedata file. This file is used by the -n and +n options of wcd.
E.g. "wcd -n PATH src".
-t Do not strip tmp mount dir "/tmp_mnt" (Unix only)
Wcd strips by default "/tmp_mnt/" from the match. Directory
"/tmp_mnt" is used by the auto-mounter. This behaviour can be turned
off with the -t option.
-T, --ascii-tree
Draw tree with ASCII characters. Use this option if line drawing
characters are not displayed properly in your terminal.
-Ta, --alt-tree-nav
Alternative way of navigation in the graphical tree.
In the default NCD style tree layout the -Ta option disables jumping
to unrelated directories.
In compact tree mode the alternative mode makes navigation similar
to navigation in GUI file managers such as Windows Explorer or Linux
KDE Konqueror. Pressing Up and Down moves the selected folder one
line up or down. Pressing Left first folds the sub-folders and the
next move left moves really left.
You can switch on-the-fly between default and alternative navigation
by pressing .
When alternative navigation mode is on, you will see an "A" in the
lower right corner.
-TC, --center-tree
Centered view in the graphical tree. The selected directory stays in
the middle of the screen. The centered mode can also be switched on
and off with key in the graphical tree.
The standard non-centered behaviour, which minimises tree movement,
is the same as in the original NCD.
-Tc, --compact-tree
By default the 'graphical' tree is drawn the same way as the
original NCD on DOS 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 option -Tc or switch on-the-fly with the
key.
-Td, --cjk-width
Legacy East-Asian CJK (Chinese, Japanese, and Korean) fonts have
certain characters and line drawing symbols with a column width of
2, while the normal Unicode width for these characters is 1 column.
For instance the Chinese CP936 raster font on Windows and the Simsun
font. Use this option for a correct outlining of the graphical tree
when a legacy CJK font is used.
When CJK mode is on, you will see a "C" in the lower right corner.
-u USER
Scan treedata file of another user based on *USER*, do not scan your
own default treedata file. See also section ENVIRONMENT VARIABLES
for *WCDUSERSHOME*.
On Unix/Cygwin the base directory for user home directories is
assumed to be "/home". Wcd will look for "/home/USER/.treedata.wcd"
and "/home/USER/.wcd/.treedata.wcd", in that order, and read the
first one that exists and is readable. On DOS/Windows the base
directory for user home directories is assumed to be "\\users", so
wcd tries to read "\\users\USER\treedata.wcd" and
"\\users\USER\.wcd\treedata.wcd".
+u USER
Read default treedata file of USER in addition to your own treedata
file.
-v, --verbose
Display verbose messages. With this option wcd prints all filters,
bans and excludes.
-V, --version
Print version information and exit.
-w, --wild-match-only
Wild matching only. Treat all matches as wild matches.
-x PATH
Exclude *PATH* from scanning.
When this option is used wcd will exclude *PATH* and all its
subdirectories when wcd is scanning a disk. Wildcards are supported
and matched against absolute paths. Option -x can be used multiple
times.
wcd -x -x -s
Option -x must be used in front of any scan option (-s, -S, +S, -A,
-E).
On DOS/Windows systems one must specify the drive letter depending
on if environment variable *HOME* or *WCDHOME* is set. If *HOME* or
*WCDHOME* is set one needs to specify the drive letter. An example:
wcd -x c:/temp -S c:
Otherwise do not specify drive letter.
wcd -x /temp -s
-xf FILE
Exclude all paths listed in *FILE* from scanning.
When this option is used wcd will exclude all paths listed in *FILE*
and all their subdirectories when wcd is scanning a disk. Wildcards
are supported and they are matched against absolute paths; one path
per line. Be aware that wcd will not ignore leading or trailing
blanks on a line, because they are legal characters in a directory
name. Option -xf can be used multiple times. When one wants to
exclude all banned paths from scanning one can do the following
(example for wcd on unix):
wcd -xf ~/.ban.wcd -s
Wildcards are supported. For instance to exclude all your Subversion
directories with administrative files add a line with "*/.svn".
Option -xf must be used in front of any scan option (-s, -S, +S, -A,
-E).
-y, --assume-yes
Assume Yes on all queries.
Wcd will not prompt the user with yes/no questions, but assumes the
user answers yes on all questions. This can be used in combination
with option -rmtree. This option must be used in front of options
that can lead to yes/no questions.
-z NUMBER
Set maximum stack size to NUMBER.
The default size of the stack is 10. Stack operation can be turned
off by setting the size to 0. This option must be used in front of
any other stack operations (-,+,=). Otherwise the size of the stack
will be set back to the default 10.
A correct command is:
wcd -z 50 -
The new stack size will be 50, wcd will go one directory back. A
wrong command is:
wcd - -z 50
Wcd goes one directory back, the stack gets the default size 10. The
-z 50 is ignored.
Add this option as the first option to your wcd alias or function.
E.g. for the a POSIX compatible shell this would be:
wcd ()
{
wcd.exe -z 50 "$@"
. ${WCDHOME:-${HOME}}/bin/wcd.go
}
-[NUMBER]
Push dir NUMBER of times. Default is one.
Go back a directory. Command "wcd -" goes one directory back. To go
more directories back add a number to it. E.g. command "wcd -3". The
stack is cyclic.
+[NUMBER]
Pop dir NUMBER of times. Default is one.
Go forward a directory. Command "wcd +" goes one directory forward.
To go more directories forward add a number to it. E.g. command "wcd
+2". The stack is cyclic.
= Show stack.
Use this option if you do not know anymore how many times to push or
pop. The stack is printed and you can choose a number. The current
place in the stack is marked with an asterisk "*".
INSTALLATION
The current working directory of a Unix shell can only be changed by the
builtin cd(1) command. Therefore the program is always called by a
function or an alias. The function or alias sources a shell script
(go-script) which is generated by the wcd program. Wcd can only work
after the function or alias is defined.
Another important influence on your installation is the definition of
environment variables *HOME* and *WCDHOME*. See section ENVIRONMENT
VARIABLES.
Install for POSIX type shells
For a POSIX shell (ksh, bash, zsh, etc.) on Unix, Linux, Cygwin, or
native MSYS add the following function to the shell startup file (e.g.
Bash uses "$HOME/.bashrc"):
wcd ()
{
/wcd.exe "$@"
. ${WCDHOME:-${HOME}}/bin/wcd.go
}
Replace *PATH* with the location where the wcd executable has been
installed. Reload the shell initialization files or start new shell.
The location of the go-script "wcd.go" differs per shell.
Wcd for DJGPP DOS bash requires a different function. The go script is
not written in a directory "bin", and if *WCDHOME* and *HOME* are both
not defined the go-script is written on c:/.
wcd ()
{
/wcd.exe "$@"
. ${WCDHOME:-${HOME:-"c:"}}/wcd.go
}
The WinZsh version of wcd is also a bit different. No "bin" directory.
wcd ()
{
/wcd.exe "$@"
. ${WCDHOME:-${HOME}}/wcd.go
}
See section FILES for more information.
Install for C-alike shells (csh, tcsh)
Add the following alias to the shell startup file "$HOME/.cshrc" or
"$HOME/.tcshrc" :
if ( ${?WCDHOME} ) then
alias wcd "/wcd.exe \!* ; source $WCDHOME/bin/wcd.go"
else
alias wcd "/wcd.exe \!* ; source $HOME/bin/wcd.go"
endif
Replace *PATH* with the location where the wcd executable has been
installed. Reload the shell initialization files or start a new shell.
Windows Command Prompt version
Unpack the zip file and add directory "bin" to your environment variable
*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.
Windows VISTA and higher
In a Windows VISTA and higher Command Prompt you may have limited access
to directories. To get access to more directories you need administrator
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 version
Add the following function to your PowerShell user profile. The location
of this profile is stored in the $profile variable. It is required that
one of the environment variables *HOME* or *WCDHOME* is defined.
function wcd
{