wcd-5.2.4/0000755000175000010010000000000012207427076011571 5ustar waterlanNonewcd-5.2.4/doc/0000755000175000010010000000000012207427121012325 5ustar waterlanNonewcd-5.2.4/doc/copying.dj0000644000175000010010000000304711324023155014316 0ustar waterlanNoneThis 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.2.4/doc/copying.txt0000644000175000010010000004330511273517352014553 0ustar waterlanNone ------------------------------------------------------------------------ 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.2.4/doc/dosdir.txt0000644000175000010010000000503311074472234014361 0ustar waterlanNone 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.2.4/doc/faq.txt0000644000175000010010000000372011365065350013645 0ustar waterlanNone 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.2.4/doc/GCC_DOS.txt0000644000175000010010000001653712025724165014211 0ustar waterlanNoneThis 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 * sed : Stream editor * perl : Practical Extraction and Report Language (perlpod) Optional: * 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 64 bit : MinGW-w64 : http://mingw-w64.sourceforge.net/ OS/2 : EMX : MinGW-w64 provides a cross-compiler that you can run on 32 bit Windows. MinGW-w64 can produce programs for 32 and 64 bit Windows. 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 : Includes bash in the MSYS environment. MinGW-w64 : You can use MinGW's MSYS 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/ MinGW : http://sourceforge.net/projects/mingw/files/ For MinGW(-w64) use MSYS-make in the MSYS environment. perl ==== Perl packages are distributed with the DJGPP, MinGW, and EMX environment. DJGPP : http://www.delorie.com/pub/djgpp/current/v2gnu/ MinGW : http://sourceforge.net/projects/mingw/files/ 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/ MinGW : http://sourceforge.net/projects/mingw/files/ MinGW-w64 : http://sourceforge.net/projects/mingw-w64/files/ 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/tracker/?func=detail&atid=302435&aid=3003879&group_id=2435 MinGW-w64 may not have all packages available yet. 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. 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/7 =========================== 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. win32zsh : Windows 32 bit MSYS and ZSH version. win32psh : Windows 32 bit PowerShell version. win64 : Windows 64 bit console version. win64psh : Windows 64 bit PowerShell version. msys : Native MSYS version. os2 : OS/2 32 bit console version. Change to the appropriate directory `dos32', `dos32bsh', `win32', `win32zsh', `win32psh', 'msys', '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* 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 =============== To activate Unicode support add UCS=1 to the make command: make UCS=1 This requires a (pd/n)curses installation with wide character support. Not supported for DOS versions of wcd. Unicode is only supported in Windows PowerShell, and Command Prompt on Windows 7 or higher. 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 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 msys : The default PREFIX is /usr 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.2.4/doc/INSTALL.txt0000644000175000010010000000074412026665041014205 0ustar waterlanNoneFor 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.2.4/doc/INST_DOS.txt0000644000175000010010000001606212014453577014367 0ustar waterlanNoneInstall 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. ...................................................................... - 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.2.4/doc/problems.txt0000644000175000010010000000306211754256124014723 0ustar waterlanNoneKnown 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.2.4/doc/README.txt0000644000175000010010000003240612207205256014033 0ustar waterlanNoneFile list README.txt : This file. SOURCE.txt : Notes about the source code. INSTALL.txt : Installation documentation. wcd.txt : Manual, text format. wcd.ps : Manual, PostScript format. wcd.pdf : Manual, PDF format. wcd.htm : Manual, HTML format. whatsnew.txt : Change log. faq.txt : Frequently Asked Questions. translat.txt : How to translate wcd. 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) 1997-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. 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() implementation is used in Wcd for Windows. 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. 3.1 Translators Thanks to the following translators: Jari Aalto (Finnish) Julio Augusto Freyre-Gonzalez (Spanish) Philipp Thomas (German) Lars Wendler (German) 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(), used in Windows version of Wcd. 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 Subversion repository: svn checkout svn://svn.code.sf.net/p/wcd/code/trunk wcd-code 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/ Freecode project page: http://freecode.com/projects/wcd/ -- For each release of wcd there are two source packages (the question marks indicate the version number): wcd-?.?.?-src.tar.gz : source package Source code in unix text. wcd???s.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.2.4/doc/RPM.txt0000644000175000010010000000035511566546501013542 0ustar waterlanNone 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.2.4/doc/SOURCE.txt0000644000175000010010000001124312030563415014070 0ustar waterlanNone 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. 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/ 1.3 DOS DJGPP support DJGPP is a project to port the GNU C/C++ compiler to DOS. It includes a shell (bash) and many ported unix utilities. For more information about DJGPP take a look at this internet homepage: http://www.delorie.com/djgpp/ 1.4 Cygwin support Cygwin is a project to port the GNU C/C++ compiler to Windows. It includes a shell (bash) and many ported unix utilities. For more information about Cygwin take a look at this internet homepage: http://cygwin.com/ 1.5 MingW support MinGW is a project to port GNU C/C++ compiler to Windows. internet homepage: http://www.mingw.org/ 1.6 LCC suport LCC is a free C compiler for windows. internet homepage: http://www.cs.virginia.edu/~lcc-win32/ wcd-5.2.4/doc/todo.txt0000644000175000010010000000330711644315670014047 0ustar waterlanNone TO DO ===== * Translate the program messages. Translate wcd's messages into more languages. Contact Erwin Waterlander if you want to help (waterlan@xs4all.nl). Programming skills are not required. * Translate the manual. * 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.2.4/doc/translat.txt0000644000175000010010000000352512200010764014715 0ustar waterlanNoneContact Erwin Waterlander if you want to help (waterlan@xs4all.nl). Programming skills are not required. I will send you a language file that you can use to translate. Translators. ============ Dutch Erwin Waterlander Finnish Jari Aalto German Philipp Thomas German Lars Wendler version 5.2.4. Spanish Julio Augusto Freyre-Gonzalez Technical information. ====================== If you want to create a language file yourself see information below. Starting with release 4.0.0 wcd uses the translation package "GNU gettext". Information about gettext and a manual can be found at: http://www.gnu.org/software/gettext/gettext.html Prerequisites. ============== Get the wcd source package. To add a new language you need to have the gettext tools installed on your system. Linux: Gettext is available on almost all Linux distributions. Windows: * The simplest way to use gettext on Windows is in the Cygwin environment. See http://cygwin.com/ * The MinGW/MSYS environment also has gettext available (http://www.mingw.org/). * You can get a ready-to-run native Windows gettext package for Windows Console at the GnuWin32 project at http://gnuwin32.sourceforge.net/ DOS: The DJGPP project has a gettext package, but it is quite old. http://www.delorie.com/djggp/ Add a new language. =================== Change to the sub directory 'po' in the wcd source directory. Set the LANG environment variable to your local language. Type 'msginit' to create an initial .po file of your language. Update existing language file. ============================== Edit the .po file in the 'po' subdirectory. Go back to the source directory and type 'make mofiles'. This will convert the .po file in a .mo file. wcd-5.2.4/doc/UNIX.txt0000644000175000010010000001477112117717236013674 0ustar waterlanNonePREREQUISITES 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 * perl : Practical Extraction and Report Language (perlpod) Optional (depending on build targets): * gettext : Framework to help GNU packages produce multi-lingual messages. * 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 If you are not able to generate the documentation files, download the documentation package wcd--doc.tar.gz with the generated documentation files and unpack it over the source package. BASIC INSTALLATION Change to directory src/ To compile using GNU make: make all Options that can be enabled during compiling UCS=1 Enable Unicode (UTF8) support The default value is empty. On Cygwin 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. 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 enable unicode support, provided that the library libncursesw is also available: make UCS=1 clean all 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. DOCUMENTATION Manual pages are generated from Perl POD files. By default the manual pages are are created in text and html format. To create a manual 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.2.4/doc/VISUALC.txt0000644000175000010010000001007512074560646014213 0ustar waterlanNoneThis 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 in DOS text format includes all documentation files. When you have the Unix package, which does not include the manuals, or just want to recreate the manuals, then 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/7 =========================== 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. win32zsh : Windows 32 bit for WinZsh or MSYS. win32psh : Windows 32 bit PowerShell version. Change to the appropriate directory `win32', `win32zsh', `win32psh', 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' Mostly clean: The target `mostlyclean' will preserve the documentation files. Type `nmake mostlyclean' 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: 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 =============== To activate Unicode support add UCS=1 to the nmake command: nmake UCS=1 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 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.2.4/doc/WATCOMC.txt0000644000175000010010000001127212074560646014202 0ustar waterlanNoneThis 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 in DOS text format includes all documentation files. When you have the Unix package, which does not include the manuals, or just want to recreate the manuals, then 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/7 =========================== 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' Mostly clean: The target `mostlyclean' will preserve the documentation files. Type `wmake mostlyclean' 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 =============== To activate Unicode support add UCS=1 to the wmake command: wmake UCS=1 This requires a (pd/n)curses installation with wide character support. 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.2.4/doc/whatsnew.txt0000644000175000010010000006102012207427053014731 0ustar waterlanNone5.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 depreciated. - 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.2.4/dos16/0000755000175000010010000000000012207427075012524 5ustar waterlanNonewcd-5.2.4/dos16/makefile0000644000175000010010000000251512020071355014214 0ustar waterlanNoneSRCDIR = ..\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)\..\doc\wcd.txt $(SRCDIR)\..\doc\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.2.4/dos32/0000755000175000010010000000000012207427075012522 5ustar waterlanNonewcd-5.2.4/dos32/Makefile0000644000175000010010000000271012101167345014154 0ustar waterlanNoneinclude ../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 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) 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) uninstall : ${MAKE} -C ../src uninstall PROGRAM=${PROGRAM} prefix=${prefix} ENABLE_NLS=${ENABLE_NLS} docsubdir=$(docsubdir) dist : ${MAKE} -C ../src dist-zip ZIPOBJ_EXTRA="${ZIPOBJ_EXTRA}" PROGRAM=${PROGRAM} prefix=${prefix} ZIPFILE=${ZIPFILE} ENABLE_NLS=${ENABLE_NLS} docsubdir=$(docsubdir) strip: ${MAKE} -C ../src strip PROGRAM=${PROGRAM} mostlyclean : ${MAKE} -C ../src mostlyclean clean : ${MAKE} -C ../src clean wcd-5.2.4/dos32/watcom/0000755000175000010010000000000012207427075014014 5ustar waterlanNonewcd-5.2.4/dos32/watcom/makefile0000755000175000010010000000265412017463766015534 0ustar waterlanNoneSRCDIR = ..\..\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)\..\doc\wcd.txt $(SRCDIR)\..\doc\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.2.4/dos32bsh/0000755000175000010010000000000012207427073013215 5ustar waterlanNonewcd-5.2.4/dos32bsh/Makefile0000644000175000010010000000267312101167345014661 0ustar waterlanNoneinclude ../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 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) 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) uninstall : ${MAKE} -C ../src uninstall PROGRAM=${PROGRAM} prefix=${prefix} ENABLE_NLS=${ENABLE_NLS} docsubdir=$(docsubdir) dist : ${MAKE} -C ../src dist-zip ZIPOBJ_EXTRA="${ZIPOBJ_EXTRA}" PROGRAM=${PROGRAM} prefix=${prefix} ZIPFILE=${ZIPFILE} ENABLE_NLS=${ENABLE_NLS} docsubdir=$(docsubdir) strip: ${MAKE} -C ../src strip PROGRAM=${PROGRAM} mostlyclean : ${MAKE} -C ../src mostlyclean clean : ${MAKE} -C ../src clean wcd-5.2.4/dos32bsh/watcom/0000755000175000010010000000000012207427073014507 5ustar waterlanNonewcd-5.2.4/dos32bsh/watcom/makefile0000755000175000010010000000270212017463766016223 0ustar waterlanNoneSRCDIR = ..\..\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)\..\doc\wcd.txt $(SRCDIR)\..\doc\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.2.4/file_id.diz0000755000175000010010000000301411654260161013670 0ustar waterlanNoneWCD - 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: Dutch, English, Finnish, German, Spanish * 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.2.4/Makefile0000644000175000010010000000213411567227054013233 0ustar waterlanNone# # 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.2.4/misc/0000755000175000010010000000000012207427075012523 5ustar waterlanNonewcd-5.2.4/misc/buildwin.sh0000755000175000010010000000115612207212065014671 0ustar waterlanNone#!/bin/sh set -e set -x cd ../win32 make mostlyclean all strip install dist UNINORM=1 make mostlyclean all strip install dist make mostlyclean all strip install dist ENABLE_NLS= cd ../win32psh make mostlyclean all strip install dist UNINORM=1 make mostlyclean all strip install dist make mostlyclean all strip install dist ENABLE_NLS= cd ../win32zsh make mostlyclean all strip install dist cd ../win64 make mostlyclean all strip install dist UNINORM=1 make mostlyclean all strip install dist cd ../win64psh make mostlyclean all strip install dist UNINORM=1 make mostlyclean all strip install dist wcd-5.2.4/misc/unix2dos.mk0000755000175000010010000000154712014527207014633 0ustar waterlanNoneinclude ../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}/src/po ; unix2dos --keepdate *.pot cd ../../${DOSVERSION}/src/po ; unix2dos --keepdate *.po cd ../../${DOSVERSION} ; unix2dos --keepdate *.txt cd ../../${DOSVERSION}/doc ; unix2dos --keepdate *.txt cd ../../${DOSVERSION} ; unix2dos --keepdate file_id.diz wcd-5.2.4/msys/0000755000175000010010000000000012207427075012563 5ustar waterlanNonewcd-5.2.4/msys/Makefile0000644000175000010010000000310712101167345014216 0ustar waterlanNone PREFIX = /usr prefix = $(PREFIX) exec_prefix = $(prefix) MKDIR = mkdir LIBS_EXTRA = -lkernel32 -luser32 -lmpr CFLAGS = -O2 -Wall -I. CURSES = pdcurses ENABLE_NLS = 1 DEFS = -DUNIX -DWCD_MSYS ifdef CURSES LIB_CURSES = -l${CURSES} DEFS += -DWCD_USECURSES -DPDC_STATIC_BUILD endif ifdef ENABLE_NLS LIBS_EXTRA += -lintl -liconv endif ifdef WCD_UTF8 # WCD_UTF8 was used in older versions. UCS=1 endif ifdef UCS ifdef CURSES DEFS += -DPDC_WIDE endif EXTRA_OBJ += wcwidth.o endif bindir = ${exec_prefix}/bin PROGRAM = wcdmsys.exe VERSIONSUFFIX = -msys all : ${MAKE} -C ../src all PROGRAM=${PROGRAM} CFLAGS="${CFLAGS}" CURSES=${CURSES} LIB_CURSES=${LIB_CURSES} DEFS="${DEFS}" LIBS_EXTRA="${LIBS_EXTRA}" prefix=${prefix} EXTRA_OBJ="${EXTRA_OBJ}" 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}" prefix=${prefix} MKDIR=${MKDIR} EXTRA_OBJ="${EXTRA_OBJ}" INSTALL_OBJS_DOC_INSTALL="../doc/INST_DOS.txt ../doc/INSTALL.txt" ENABLE_NLS=${ENABLE_NLS} uninstall : ${MAKE} -C ../src uninstall PROGRAM=${PROGRAM} prefix=${prefix} ENABLE_NLS=${ENABLE_NLS} dist-zip : ${MAKE} -C ../src dist-zip PROGRAM=${PROGRAM} prefix=${prefix} VERSIONSUFFIX=${VERSIONSUFFIX} ENABLE_NLS=${ENABLE_NLS} dist-tgz : ${MAKE} -C ../src dist-tgz PROGRAM=${PROGRAM} prefix=${prefix} VERSIONSUFFIX=${VERSIONSUFFIX} ENABLE_NLS=${ENABLE_NLS} dist : dist-tgz strip: ${MAKE} -C ../src strip PROGRAM=${PROGRAM} mostlyclean : ${MAKE} -C ../src mostlyclean clean : ${MAKE} -C ../src clean wcd-5.2.4/os2/0000755000175000010010000000000012207427075012273 5ustar waterlanNonewcd-5.2.4/os2/Makefile0000644000175000010010000000276112015702232013725 0ustar waterlanNone PREFIX = c:/usr prefix = $(PREFIX) exec_prefix = $(prefix) MKDIR = mkdir LDFLAGS_EXTRA = -lOS2term -Zomf CFLAGS = -O2 -Wall # PDcurses #CURSES = pdcurses # Ncurses CURSES = ncurses ENABLE_NLS = 1 DEFS = ifeq ($(CURSES),pdcurses) LIB_CURSES = pdcurses.a DEFS += -DWCD_USECURSES endif ifeq ($(CURSES),ncurses) LIB_CURSES = -lncurses -lOS2term -Zomf DEFS += -DWCD_USECURSES endif ifdef ENABLE_NLS LDFLAGS_EXTRA += -lintl -liconv 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}" 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}" 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.2.4/os2/watcom/0000755000175000010010000000000012207427075013565 5ustar waterlanNonewcd-5.2.4/os2/watcom/makefile0000755000175000010010000000246112017463766015301 0ustar waterlanNoneSRCDIR = ..\..\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)\..\doc\wcd.txt $(SRCDIR)\..\doc\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.2.4/os2/wcd.cmd0000755000175000010010000000056111227272030013530 0ustar waterlanNone@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.2.4/README.txt0000644000175000010010000000005111253401345013252 0ustar waterlanNone For documentation see directory `doc'. wcd-5.2.4/src/0000755000175000010010000000000012207427111012346 5ustar waterlanNonewcd-5.2.4/src/c3po/0000755000175000010010000000000012207427075013223 5ustar waterlanNonewcd-5.2.4/src/c3po/Advance.h0000644000175000010010000001374511273517352014747 0ustar waterlanNone#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.2.4/src/c3po/Command.c0000644000175000010010000001116511273517352014751 0ustar waterlanNone/* 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 = 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 = 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) { text arg; c3po_bool found = false; int index = 1; while(index < argc) { 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; text arg; nameset args = NULL; c3po_bool found = false; while(index < argc) { 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; int index = 0; fp = fopen(file, "a"); if (fp ne NULL) { 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.2.4/src/c3po/Command.h0000644000175000010010000000266111273517352014757 0ustar waterlanNone#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.2.4/src/c3po/Config.h0000644000175000010010000000156511273517352014610 0ustar waterlanNone/* 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.2.4/src/c3po/Constants.h0000644000175000010010000000153511273517352015354 0ustar waterlanNone#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.2.4/src/c3po/dirnode.c0000644000175000010010000002731111637722771015026 0ustar waterlanNone#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) { dirnode d; if (src == NULL) return NULL; else { 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) { size_t index; 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) { 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) { size_t index; if (set != NULL) { 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) { size_t index; if (set != NULL) { if (position < set->size) { if (FreeAtPos eq true) freeDirnode(set->subdirs[position], Deep); index = position + 1; 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) { size_t index; text increment = " "; text new_Offset = (text) malloc(sizeof(char) * (strlen(Offset) + strlen(increment) + 1)); 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)) { fprintf(fp, "%sint size : %lu\n", new_Offset, (unsigned long)d->size); index = 0; 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); } } expfun void freeDirnode(dirnode d, c3po_bool Deep) { size_t index; if (d ne NULL) { if (Deep eq true) { if (d->name ne NULL) { free((void *) d->name); d->name = NULL; } index = 0; 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.2.4/src/c3po/dirnode.h0000644000175000010010000000724011635724443015026 0ustar waterlanNone#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.2.4/src/c3po/Error.c0000644000175000010010000000236011273517352014461 0ustar waterlanNone/* 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" 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); fprintf (stderr, _("Wcd: error in '%s', no space left for allocation\nWcd: Insufficient memory\n"), function_name); exit(1); } wcd-5.2.4/src/c3po/Error.h0000644000175000010010000000163111273517352014466 0ustar waterlanNone#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.2.4/src/c3po/File.c0000644000175000010010000000536611273517352014260 0ustar waterlanNone/* 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) { int index; char moveName[STRING_SIZE]; if ((existsFile(filename) == true) && (Backup == true)) { sprintf(moveName, "%s.tmp", filename); 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.2.4/src/c3po/File.h0000644000175000010010000000234511273517352014257 0ustar waterlanNone#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.2.4/src/c3po/Generate0000755000175000010010000000105711324023155014674 0ustar waterlanNone#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.2.4/src/c3po/Imakefile0000644000175000010010000000310211273517352015030 0ustar waterlanNone/* 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.2.4/src/c3po/intset.c0000644000175000010010000001374311637722771014714 0ustar waterlanNone#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) { intset i; if (src == NULL) return NULL; else { 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) { size_t index; 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) { 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) { size_t index; if (set != NULL) { 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) { size_t index; if (set != NULL) { if (position < set->size) { 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) { size_t index; text increment = " "; text new_Offset = (text) malloc(sizeof(char) * (strlen(Offset) + strlen(increment) + 1)); 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)) { fprintf(fp, "%sint size : %lu\n", new_Offset, (unsigned long)i->size); index = 0; 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); } } expfun void freeIntset(intset i) { if (i ne NULL) { free((void *) i); } } wcd-5.2.4/src/c3po/intset.h0000644000175000010010000000374311635724443014714 0ustar waterlanNone#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.2.4/src/c3po/main.c0000644000175000010010000000215111273517352014312 0ustar waterlanNone#include #include #include #include "std_macr.h" #include "structur.h" #include "Error.h" #include "Command.h" #include "Usage.h" #include "Driver.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. */ int main(int argc, char** argv) { /*************** CODE FROM APPEND SECTION *************/ /*************** END APPEND SECTION *************/ } exit(0); } wcd-5.2.4/src/c3po/nameset.c0000644000175000010010000001667011637722771015044 0ustar waterlanNone#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) { nameset n; if (src == NULL) return NULL; else { 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) { size_t index; 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) { 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) { size_t index; if (set != NULL) { 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) { size_t index; if (set != NULL) { if (position < set->size) { 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) { size_t index; text increment = " "; text new_Offset = (text) malloc(sizeof(char) * (strlen(Offset) + strlen(increment) + 1)); 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)) { 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); } } expfun void freeNameset(nameset n, c3po_bool Deep) { size_t index; if (n ne NULL) { if (Deep eq true) { 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.2.4/src/c3po/nameset.h0000644000175000010010000000454311635724443015041 0ustar waterlanNone#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.2.4/src/c3po/namesetw.c0000755000175000010010000001676111637722771015237 0ustar waterlanNone#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) { namesetw n; if (src == NULL) return NULL; else { 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) { size_t index; 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) { 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) { size_t index; if (set != NULL) { 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) { size_t index; if (set != NULL) { if (position < set->size) { if (FreeAtPos eq true) { if (set->array[position] ne NULL) free((void *) set->array[position]); } 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) { size_t index; 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); 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); } } expfun void freeNamesetw(namesetw n, c3po_bool Deep) { size_t index; if (n ne NULL) { if (Deep eq true) { 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.2.4/src/c3po/namesetw.h0000755000175000010010000000461411635724443015232 0ustar waterlanNone#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.2.4/src/c3po/README0000644000175000010010000000045211074472234014102 0ustar waterlanNoneAll 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.2.4/src/c3po/std_macr.h0000644000175000010010000000472512025724165015176 0ustar waterlanNone#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.2.4/src/c3po/structur.h0000644000175000010010000000337311635724443015300 0ustar waterlanNone#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. */ #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.2.4/src/c3po/Text.c0000644000175000010010000001253211636446624014324 0ustar waterlanNone/* 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) { size_t index; if (isEmptyNamesetArray(set) eq false) { 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) { size_t index; 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) { 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; size_t index; if (isEmptyNamesetArray(set) eq false) { 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 buffer = (text) realloc((void *) buffer, sizeof(char) * (strlen(pattern) * amount + 1)); 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.2.4/src/c3po/Text.h0000644000175000010010000000377311635724443014335 0ustar waterlanNone#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.2.4/src/c3po/Textw.c0000755000175000010010000001272011636446624014515 0ustar waterlanNone/* 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) { size_t index; if (isEmptyNamesetwArray(set) eq false) { 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) { size_t index; 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) { 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; size_t index; if (isEmptyNamesetwArray(set) eq false) { 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 buffer = (textw) realloc((void *) buffer, sizeof(wchar_t) * (wcslen(pattern) * amount + 1)); 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.2.4/src/c3po/Textw.h0000755000175000010010000000405511635724443014521 0ustar waterlanNone#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.2.4/src/c3po/Usage.c0000644000175000010010000000231211273517352014431 0ustar waterlanNone/* 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.2.4/src/c3po/Usage.h0000644000175000010010000000157611273517352014451 0ustar waterlanNone#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.2.4/src/c3po/wcd.G0000644000175000010010000000224212032140545014076 0ustar waterlanNoneinclude { 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.2.4/src/c3po/WcdStack.c0000644000175000010010000002143411637722771015105 0ustar waterlanNone#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) { WcdStack w; if (src == NULL) return NULL; else { 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) { size_t index; 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) { 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) { size_t index; if (set != NULL) { 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) { size_t index; if (set != NULL) { if (position < set->size) { 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) { size_t index; text increment = " "; text new_Offset = (text) malloc(sizeof(char) * (strlen(Offset) + strlen(increment) + 1)); 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)) { 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); } } expfun void freeWcdStack(WcdStack w, c3po_bool Deep) { size_t index; if (w ne NULL) { if (Deep eq true) { 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.2.4/src/c3po/WcdStack.h0000644000175000010010000000546611635724443015115 0ustar waterlanNone#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.2.4/src/colors.c0000644000175000010010000000454712066325113014027 0ustar waterlanNone/*------------------------------------------------------------------*\ | 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" 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 chtype attr = color & A_ATTR; /* extract Bold, Reverse, Blink bits */ setcolor(win, color); #ifdef A_COLOR if (has_colors()) wbkgd(win, COLOR_PAIR(color & A_CHARTEXT) | (attr & ~A_REVERSE)); else #endif wbkgd(win, color); werase(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.2.4/src/colors.h0000644000175000010010000000245012066325113014023 0ustar waterlanNone/*------------------------------------------------------------------*\ | 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 | \*------------------------------------------------------------------*/ #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); wcd-5.2.4/src/config.h0000644000175000010010000000177612062172105013776 0ustar waterlanNone/* 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. */ #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 wcd-5.2.4/src/display.c0000644000175000010010000013105512114704264014170 0ustar waterlanNone/* Copyright (C) 1997-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 */ #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 UTF-8 */ 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); /* 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); 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. */ size_t str_columns (char *s) { #if defined(WCD_UNICODE) || defined(WCD_WINDOWS) static wchar_t wstr[DD_MAXPATH]; size_t i; int j; /* 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 { 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 } /************************************************************************ * * 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]; size_t len1,len2; #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) len1 = MBSTOWCS(wstr_left, list->array[left],(size_t)DD_MAXPATH); 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, len, maxlen = 0; if (list == NULL) { fprintf(stderr, "%s", _("Wcd: error in maxLength(), list == NULL\n")); return 32 ; } for (i=0;isize;i++) { 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, len,maxlen = 0; if (s == NULL) { fprintf(stderr, "%s", _("Wcd: error in maxLengthStack(), s == NULL\n")); return 32 ; } for (i=0;isize;i++) { 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; int len, j, nr_offset; s = n->array[i]; if (s != NULL) { len = strlen(s); if (*use_numbers == 0) nr_offset = 2; else nr_offset = 3; for(j=xoffset;(jdir[i]; if (s != NULL) { len = strlen(s); if (*use_numbers == 0) nr_offset = 2; else nr_offset = 3; 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; 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) || ((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); top = 0; 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("\n\r"); if (list != NULL) { if(perfect) cprintf("Perfect "); else cprintf("Wild "); cprintf("match for %d directories.\n\r",size); } else cprintf("\n\r"); cprintf("Please choose one ( to abort): "); fflush(stdout); gotoxy (PAGEOFFSET, 2); cprintf("w=up x=down ?=help Page %d/%d ",page,(size -1)/lines_per_page +1); 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); gotoxy (PAGEOFFSET, 2); cprintf("w=up x=down ?=help Page %d/%d ",page,(size -1)/lines_per_page +1); 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); gotoxy (PAGEOFFSET, 2); cprintf("w=up x=down ?=help Page %d/%d ",page,(size -1)/lines_per_page +1); 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.\r\n"); cprintf("x or z or Page Down.\r\n"); cprintf(", or Scroll 1 left.\r\n"); cprintf(". or Scroll 1 right.\r\n"); cprintf("< or [ Scroll 10 left.\r\n"); cprintf("> or ] Scroll 10 right.\r\n"); cprintf("CTRL-a or Scroll to beginning.\r\n"); cprintf("CTRL-e or Scroll to end.\r\n"); cprintf("CTRL-c or Abort.\r\n"); cprintf(" Abort.\r\n"); cprintf("Type w or x to quit help.\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 #if CAN_RESIZE /* 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 = newpad(wcd_display.scrollWinHeight,COLS); if (COLS < INPUT_WIN_LEN) wcd_display.inputWinLen = INPUT_WIN_LEN; else wcd_display.inputWinLen = COLS; wcd_display.inputWin = newpad(INPUT_WIN_HEIGHT,wcd_display.inputWinLen); scrollok(wcd_display.scrollWin, TRUE); refresh(); displayRefresh(1); } 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; size_t len; int j, nr_offset; #if defined(WCD_UNICODE) || defined(WCD_WINDOWS) static wchar_t wstr[DD_MAXPATH]; int width, c; #endif s = (wcd_uchar *)n->array[i]; if (s != NULL) { #if defined(WCD_UNICODE) || defined(WCD_WINDOWS) len = MBSTOWCS(wstr,(char *)s,(size_t)DD_MAXPATH); /* number of wide characters */ #else len = strlen((char *)s); #endif 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 */ len = strlen((char *)s); for(j=xoffset;(j<(int)len)&&((nr_offset+j-xoffset)<(COLS-1));j++) { waddch(win,(chtype)s[j]); } } else { c = 0; /* count characters with width > 0 from beginning of string. */ j = 0; 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; size_t len; int j, nr_offset; #if defined(WCD_UNICODE) || defined(WCD_WINDOWS) static wchar_t wstr[DD_MAXPATH]; int width, c; #endif s = (wcd_uchar *)ws->dir[i]; if (s != NULL) { #if defined(WCD_UNICODE) || defined(WCD_WINDOWS) len = MBSTOWCS(wstr,(char *)s,(size_t)DD_MAXPATH); /* number of wide characters */ #else len = strlen((char *)s); #endif 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 */ 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 { c = 0; /* count characters with width > 0 from beginning of string. */ j = 0; 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) { werase(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]; werase(wcd_display.scrollWin); werase(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) { if(wcd_display.perfect) wcd_mvwaddstr(wcd_display.inputWin,1,0,_("Perfect ")); else wcd_mvwaddstr(wcd_display.inputWin,1,0,_("Wild ")); wprintw(wcd_display.inputWin,_("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); prefresh(wcd_display.scrollWin,0,0,0,0,wcd_display.scrollWinHeight-1,COLS-1); prefresh(wcd_display.inputWin,0,0,wcd_display.scrollWinHeight,0,wcd_display.scrollWinHeight+INPUT_WIN_HEIGHT-1,COLS-1); } void displayHelp(WINDOW *win, int height) { werase(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-c or Abort.")); wcd_mvwaddstr(win, 9,0,_(" Abort.")); wcd_mvwaddstr(win,11,0,_("Press any key.")); } prefresh(win,0,0,0,0,height-1,COLS-1); 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'; #ifdef __PDCURSES__ initscr(); #else sp = newterm(NULL,stdout,stdin); if (sp == NULL) { fprintf(stderr, "%s", _("Wcd: warning: 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 fprintf(stderr, "%s", _("Wcd: error: 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 = newpad(wcd_display.scrollWinHeight,COLS); if (wcd_display.scrollWin == NULL) { endwin(); #ifdef XCURSES XCursesExit(); #endif fprintf(stderr, "%s", _("Wcd: error creating scroll window.\n")); return WCD_ERR_CURSES; } scrollok(wcd_display.scrollWin, TRUE); if (COLS < INPUT_WIN_LEN) wcd_display.inputWinLen = INPUT_WIN_LEN; else wcd_display.inputWinLen = COLS; wcd_display.inputWin = newpad(INPUT_WIN_HEIGHT,wcd_display.inputWinLen); if (wcd_display.inputWin == NULL) { endwin(); #ifdef XCURSES XCursesExit(); #endif fprintf(stderr, "%s", _("Wcd: 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 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)) /* 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; size_t ii; int k, start, j; if (list != NULL) /* normal list */ { sort_list(list); if ( use_stdout & WCD_STDOUT_DUMP ) { for (ii=0;iisize;ii++) wcd_printf("%s\n", list->array[ii]); } else { 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 { if(perfect) printf(_("\nPerfect ")); else printf(_("\nWild ")); printf(_("match for %lu directories.\n"),(unsigned long)list->size); 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(_("\nPlease 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.2.4/src/display.h0000644000175000010010000000430412005577542014177 0ustar waterlanNone/* Copyright (C) 1997-2005 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 _DISPLAY_H #define _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 size_t wcstoansi(char *mbstr, const wchar_t *wcstr, int len); size_t ansitowcs(wchar_t *wcstr, const char *mbstr, int len); size_t wcstoutf8(char *mbstr, const wchar_t *wcstr, int len); size_t utf8towcs(wchar_t *wcstr, const char *mbstr, int len); void wcd_printf( const char* format, ... ); void wcd_wprintf( const wchar_t* format, ... ); size_t str_columns (char *s); void sort_list(nameset list); int display_list(nameset list,int perfect, int use_numbers, int use_stdout); int display_list_conio(nameset list,WcdStack ws, int perfect,int use_numbers); int display_list_curses(nameset list, WcdStack ws, int perfect,int use_numbers); int display_list_stdout(nameset list,WcdStack ws, int perfect, int use_stdout); #define OFFSET 39 #define WCD_MAX_INPSTR 256 #ifdef WCD_USECURSES void wcd_mvwaddstr(WINDOW *win, int x, int y, char *str); # define INPUT_WIN_LEN 80 #endif #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 */ #endif wcd-5.2.4/src/dosdir.c0000644000175000010010000003311112025724165014004 0ustar waterlanNone/* 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" #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() { 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__)) int dd_findnext( dd_ffblk* fb ) { int 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; } int dd_findfirst( const wcd_char *path, dd_ffblk *fb, int attrib ) { int rc; if ((rc = FFIRST( path, &fb->dos_fb)) != -1) { fb->nHandle = rc; fb->dd_attribs = 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 */ closedir(fb->dd_dirp); 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) { strcpy(fb->dd_filespec, s+1); strncpy(dir, path, (size_t)(s-path)); } else { strcpy(dir, "."); /* use current directory */ strcpy(fb->dd_filespec, path); } fb->dd_attribs = (char)attrib; fb->dd_dirp = opendir(dir); return dd_findnext(fb); } /** dd_findfirst **/ #endif /* ?__MSDOS__ */ wcd-5.2.4/src/dosdir.h0000644000175000010010000002000112025724165014003 0ustar waterlanNone/* 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 #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 int 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 int dd_findfirst(const wcd_char *path, dd_ffblk *fb, int attrib); int 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.2.4/src/etc/0000755000175000010010000000000012207427075013132 5ustar waterlanNonewcd-5.2.4/src/etc/profile.d/0000755000175000010010000000000012207427075015014 5ustar waterlanNonewcd-5.2.4/src/etc/profile.d/wcd.csh0000755000175000010010000000245311573237124016276 0ustar waterlanNone# 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.2.4/src/etc/profile.d/wcd.sh0000755000175000010010000000243311573330052016123 0ustar waterlanNone# Copyright # # Copyright (C) 2011 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 () { go="${WCDHOME:-${HOME}}/bin/wcd.go" rm -f "$go" 2> /dev/null BINDIR/PROGRAM "$@" [ -f "$go" ] && . "$go" unset go } # End of file wcd-5.2.4/src/graphics.c0000644000175000010010000021223612151203455014321 0ustar waterlanNone/* Copyright (C) 2000-2013 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; int scrollWinLen; 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 #if CAN_RESIZE /* 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; wcd_cwin.scrollWinLen = COLS; /* free resources */ delwin(wcd_cwin.scrollWin); delwin(wcd_cwin.inputWin); /* create new windows */ wcd_cwin.scrollWin = newpad(wcd_cwin.scrollWinHeight,COLS); wcd_cwin.inputWin = newpad(INPUT_WIN_HEIGHT,COLS); 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); } 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 i,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: line too long in function getTreeLine()")); 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 { 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); 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) { size_t index, len, size; int x; static int y; dirnode n; if(dirHasSubdirs(d) eq true) { 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, size; index = 0; if(dirHasSubdirs(d) eq true) { size = getSizeOfDirnode(d); while(index < size) { if (eqTextDirnode(t,elementAtDirnode(index,d)) eq true) return index; index++; } } return (size_t) -1; } void addPath(text path, dirnode d) { char *s; dirnode n,n_up; text t; size_t index; #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) { 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 = elementAtDirnode(index,d); } addPath(NULL,n); } } 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. * ***********************************************************/ void buildTreeFromFile(char *filename, dirnode d) { nameset dirs; dirs = namesetNew(); if(dirs != NULL) read_treefile(filename,dirs,0); else return; if (d == NULL) return; buildTreeFromNameset(dirs,d); freeNameset(dirs, 1); } /*****************************************************/ 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; size_t index; 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) { 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,"*"); strcat(path,dir); 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; 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; 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; size_t len; int j; #if defined(WCD_UNICODE) || defined(WCD_WINDOWS) static wchar_t wstr[DD_MAXPATH]; int width, c; #endif s = (wcd_uchar *)getTreeLine(getLastNodeInLevel(n,i),i,&i,curNode,false, &wcd_cwin.graphics_mode); if (s != NULL) { #if defined(WCD_UNICODE) || defined(WCD_WINDOWS) len = MBSTOWCS(wstr,(char *)s,(size_t)DD_MAXPATH); /* number of wide characters */ #else 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 { c = 0; /* count width from beginning of string. */ j = 0; while ((j<(int)len)&&(c xoffset ) && ( 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, xo, len; static int xoffset = 0; /* Horizontal offset in number of columns */ static int yposition = -1; /* -1 : not initialized */ wcd_uchar *s; #if defined(WCD_UNICODE) || defined(WCD_WINDOWS) static wchar_t wstr[DD_MAXPATH]; int width; #endif /* 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); werase(wcd_cwin.scrollWin); werase(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) { 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) { 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,_("NAVIGATE 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.")); prefresh(win,0,0,0,0,height-1,COLS-1); getch(); werase(win); wcd_mvwaddstr(win, 0,0,_("NAVIGATE 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 latest / or ? search.")); wcd_mvwaddstr(win, 9,0,_(" Select directory.")); wcd_mvwaddstr(win,11,0,_("Press any key.")); prefresh(win,0,0,0,0,height-1,COLS-1); getch(); werase(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 latest / or ? search.")); wcd_mvwaddstr(win,16,0,_(" Select directory.")); wcd_mvwaddstr(win,18,0,_("Press any key.")); prefresh(win,0,0,0,0,height-1,COLS-1); getch(); werase(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 sub levels.")); wcd_mvwaddstr(win, 6,0,_("y or CTRL-y uncondense: unfold current and sub 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")); prefresh(win,0,0,0,0,height-1,COLS-1); 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) { size_t index,size; dirnode n; if(dirnodeHasSubdirs(d) eq true) /* only (un)fold directories that have subdirs */ { d->fold = *f; index = 0; size = getSizeOfDirnode(d); 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; getCurPath(curPath, (size_t)DD_MAXPATH, use_HOME); wcd_cwin.curNode = locatePathOrSo(curPath,tree); wcd_cwin.zoomStack = dirnodeNew(NULL,NULL,NULL); #if CAN_RESIZE signal (SIGWINCH, signalSigwinch); #endif #ifdef __PDCURSES__ initscr(); #else sp = newterm(NULL,stdout,stdin); if (sp == NULL) { fprintf(stderr, "%s", _("Wcd: warning: 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.scrollWinLen = COLS; wcd_cwin.scrollWin = newpad(wcd_cwin.scrollWinHeight,COLS); wcd_cwin.inputWin = newpad(INPUT_WIN_HEIGHT,COLS); 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 fprintf(stderr, "%s", _("Wcd: 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_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)) { #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; } 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.2.4/src/graphics.h0000644000175000010010000000343612106261435014330 0ustar waterlanNone/* 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); void buildTreeFromNameset(nameset set, 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.2.4/src/Makefile0000644000175000010010000003244212151203455014014 0ustar waterlanNone# # Copyright information # # Copyright (C) 2009-2013 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 # # The documentation default is set for DOS and Unix. # # In order to generate documentation for Unix only, use: # # make CPP_FLAGS_POD="-Dunix" man # # In order to generate documentation for DOS/Windows only, use: # # make CPP_FLAGS_POD="-Ddos" man # # In order to clean but preserve generated POD file: # # make mostlyclean # # 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 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_BIN = $(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 \ ../doc/translat.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) \ ../doc/$(PACKAGE).txt \ ../doc/$(PACKAGE).$(HTMLEXT) ifdef ENABLE_NLS POT = po/$(PACKAGE).pot POFILES = $(wildcard po/*.po) MOFILES = $(patsubst %.po,%.mo,$(POFILES)) NLSSUFFIX = -nls endif DOCFILES = ../doc/$(PACKAGE).txt ../doc/$(PACKAGE).$(HTMLEXT) CPP = cpp CPP_FLAGS_POD = -Dunix -Ddos CFLAGS_VERSION = -DVERSION=\"$(VERSION)\" -DVERSION_DATE=\"$(VERSION_DATE)\" DEF_UNIX = -DUNIX EXTRA_DEFS = VERSIONSUFFIX = -bin # Large File Support (LFS) LFS = 1 DEBUG = 0 # Enble Unicode for Cygwin ifeq ($(findstring CYGWIN,$(shell uname)),CYGWIN) UCS = 1 UNINORM = 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 endif # .......................................................... unicode ... ifdef WCD_UTF8 # WCD_UTF8 was used in older versions. UCS=1 endif ifdef UCS CFLAGS_UCS = -std=gnu99 WDEFS = -DWCD_UNICODE endif ifdef UNINORM UCS = 1 CFLAGS_UCS = -std=gnu99 WDEFS = -DWCD_UNICODE -DWCD_UNINORM LIB_UNISTRING = -lunistring endif ifdef UCS UCSSUFFIX = -ucs EXTRA_OBJ += matchw.o endif ZIPFILE = $(PACKAGE)-$(VERSION)$(VERSIONSUFFIX)$(NLSSUFFIX)$(UCSSUFFIX).zip TGZFILE = $(PACKAGE)-$(VERSION)$(VERSIONSUFFIX)$(NLSSUFFIX)$(UCSSUFFIX).tar.gz ifdef ENABLE_NLS NLSDEFS = -DENABLE_NLS -DLOCALEDIR=\"$(localedir)\" -DPACKAGE=\"$(PACKAGE)\" endif # ........................................................... curses ... # possible values: ncurses, curses, pdcurses, pdcursesw or ifdef UCS CURSES = ncursesw else CURSES = ncurses endif ifdef CURSES ifdef UCS EXTRA_OBJ += wcwidth.o endif endif ifneq (,$(CURSES)) DEFS_CURSES = -DWCD_USECURSES LIB_CURSES = -l$(CURSES) endif INCPREFIX=/usr ifeq ($(findstring MINGW,$(shell uname)),MINGW) INCPREFIX=/mingw 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) endif ifeq ($(NCURSES_DEBUG), 1) LIB_CURSES = -l$(CURSES)_g endif 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 # ......................................................... OS flags ... OS = ifndef OS ifeq (Linux, $(shell uname -s)) OS = linux endif endif ifndef OS ifeq ($(findstring CYGWIN,$(shell uname)),CYGWIN) OS = cygwin endif endif ifeq (cygwin,$(OS)) ifdef ENABLE_NLS LIBS_EXTRA = -lintl -liconv -lmpr else LIBS_EXTRA = -lmpr endif LDFLAGS_EXTRA = -Wl,--enable-auto-import INSTALL_TARGETS += install-profile endif ifndef OS ifneq ($(DJGPP),) DEF_UNIX = OS = msdos endif endif ifndef OS ifeq ($(shell uname),OS/2) DEF_UNIX = OS = os/2 endif endif ifndef OS ifeq ($(findstring MINGW32,$(shell uname)),MINGW32) DEF_UNIX = OS = mingw32 endif endif ifndef OS ifeq ($(findstring MSYS,$(shell uname)),MSYS) CC = gcc DEF_UNIX = OS = msys endif endif ifndef OS ifeq (FreeBSD, $(shell uname -s)) OS = freebsd 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, $(shell uname -s)) OS = Darwin ifdef ENABLE_NLS CFLAGS_OS = -I/usr/local/include LDFLAGS_EXTRA = -L/usr/local/lib LIBS_EXTRA = -lintl endif endif ifndef OS ifneq (, $(wildcard /opt/csw)) OS = sun endif endif ifeq (sun,$(OS)) # Running under SunOS/Solaris LIBS_EXTRA = -lintl endif ifndef OS ifeq (HP-UX, $(shell uname -s)) OS = hpux endif endif ifeq (hpux,$(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 ifndef OS OS = $(shell uname -s) 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) \ $(WDEFS) \ $(NLSDEFS) \ $(NCFLAG) \ $(INCFLAGS) \ -DDEBUG=$(DEBUG) 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) status: @echo "-- $(PACKAGE) Makefile settings begin --" @echo "OS = $(OS)" @echo "prefix = $(prefix)" @echo "EXT = $(EXT)" @echo "CPP_FLAGS_POD = $(CPP_FLAGS_POD)" @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 "-- $(PACKAGE) Makefile settings end --" $(BIN): $(OBJS1) $(MAKE) status $(CC) $(OBJS1) $(LDFLAGS) $(LIBS) -o $@ %.o: %.c $(CC) $(CFLAGS) $(EXTRA_CFLAGS) $(DEFS) -c $< -o $@ %.o: c3po/%.c $(CC) $(CFLAGS) $(EXTRA_CFLAGS) $(DEFS) -c $< -o $@ %.pdf: %.ps ps2pdf $< $@ %.po : $(POT) msgmerge -U $@ $(POT) --backup=numbered # change timestamp in case .po file was not updated. touch $@ %.mo : %.po msgfmt -c $< -o $@ $(POT) : wcd.c wcddir.c stack.c display.c graphics.c wfixpath.c c3po/Error.c xgettext -C --keyword=_ $+ -o $(POT) man/man1/wcd1.pod : man/man1/wcd1pod.in $(CPP) -traditional-cpp -P -fno-show-column $(CPP_FLAGS_POD) $< > $@ man/man1/wcd.1 : man/man1/wcd1.pod $(MAKE) -C man/man1 ../doc/$(PACKAGE).txt : man/man1/wcd1.pod LC_CTYPE=C pod2text $< > $@ ../doc/$(PACKAGE).ps : man/man1/wcd.1 groff -man $< -T ps > $@ ../doc/$(PACKAGE).$(HTMLEXT) : man/man1/wcd1.pod pod2html --title="$(PACKAGE) $(VERSION) - Wherever Change Directory" $< > $@ pod: man/man1/wcd1.pod man: man/man1/wcd.1 html: ../doc/$(PACKAGE).$(HTMLEXT) txt: ../doc/$(PACKAGE).txt ps: ../doc/$(PACKAGE).ps pdf: ../doc/$(PACKAGE).pdf mofiles: $(MOFILES) doc: $(DOCFILES) tags: $(POT) merge: $(POFILES) 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 \ */*/*~ \ *.stackdump clean: mostlyclean @echo "-- target: clean" rm -f \ man/man1/wcd1.pod \ man/man1/wcd.1 \ $(DOCFILES) ../doc/$(PACKAGE).ps ../doc/$(PACKAGE).pdf distclean: clean @echo "-- target: distclean" maintainer-clean: distclean @echo "-- target: maintainer-clean:" # '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) -m 644 $(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) $(wildcard ../doc/$(PACKAGE).ps) $(wildcard ../doc/$(PACKAGE).pdf) $(DESTDIR)$(docdir) install-man: $(INSTALL_OBJS_MAN1) @echo "-- target: install-man" $(MKDIR) -p -m 755 $(DESTDIR)$(man1dir) $(INSTALL_DATA) $(INSTALL_OBJS_MAN1) $(DESTDIR)$(man1dir) install-bin: $(BIN) @echo "-- target: install-bin" $(MKDIR) -p -m 755 $(DESTDIR)$(bindir) $(INSTALL_BIN) $(INSTALL_OBJS_BIN) $(DESTDIR)$(bindir) install: $(INSTALL_TARGETS) uninstall: @echo "-- target: uninstall" -rm -f $(DESTDIR)$(bindir)/$(BIN) ifdef ENABLE_NLS $(foreach mofile, $(MOFILES), rm -f $(DESTDIR)$(localedir)/$(basename $(notdir $(mofile)))/LC_MESSAGES/$(PACKAGE).mo ;) endif -rm -f $(DESTDIR)$(mandir)/man1/$(PACKAGE).1 -rm -rf $(DESTDIR)$(docdir) .PHONY: status uninstall install install-doc dist dist-zip dist-tgz .PHONY: man pod ps txt html pdf # End of file wcd-5.2.4/src/man/0000755000175000010010000000000012207427075013132 5ustar waterlanNonewcd-5.2.4/src/man/man1/0000755000175000010010000000000012207427121013756 5ustar waterlanNonewcd-5.2.4/src/man/man1/Makefile0000644000175000010010000000271112026665041015423 0ustar waterlanNone# pod2man.mk -- Makefile portion to convert *.pod files to manual pages # # Copyright information # # Copyright (C) 2008-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 # # Convert *.pod files to manual pages. ifneq (,) This makefile requires GNU Make. endif # 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)$(MANSECT).pod MANPAGE = $(MANDEST)$(PACKAGE).$(MANSECT) POD2MAN = pod2man POD2MAN_FLAGS = all: $(MANPAGE) $(MANPAGE): $(MANPOD) # make target - create manual page from a *.pod page podchecker $(MANPOD) LC_CTYPE=C $(POD2MAN) $(POD2MAN_FLAGS) \ --center="$(PODCENTER)" \ --name="$(PACKAGE)" \ --section="$(MANSECT)" \ $(MANPOD) \ | perl -p -e 's/[Pp]erl v[0-9.]+/$(PACKAGE)/;' \ > $(MANPAGE) && \ rm -f pod*.tmp # End of of Makefile part wcd-5.2.4/src/man/man1/wcd1pod.in0000644000175000010010000012775512207427053015674 0ustar waterlanNone/* # Copyright and License # # Copyright (C) 1997-2013 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 =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 matched any directory name that ends with "top". wcd *top Match any directory that has contain "top" anywhere: 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.: /* Break the statement, to not interpret "/ *" as comment start */ #define srcWILDSTAR() src* #define WILDSTAR() * wcd srcWILDSTAR()/WILDSTAR()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 were 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. #ifdef dos 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 #endif #ifdef dos =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. #endif =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 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 default treedata. =item B<-A PATH> Scan directory tree from PATH and append to the default treedata file. Examples: wcd -A . wcd -A /home -A /etc #ifdef dos 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. #endif 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 are supported and it is matched against 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). #ifdef dos =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<=>. #endif =item B<-e> Add current path to 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 PATH and append to Extra treedata file. See also options B<-A> and B<-S>. =item B<-f FILE> Read treedata FILE. Do not read the default treedata file. =item B<+f FILE> Read treedata FILE 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 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 PATH. For instance on Unix, C will write a go-script PATH/wcd.go. =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> Print help and exit. =item B<-i, --ignore-case> Ignore case. #ifdef dos Dos and Windows versions of wcd ignore case default. Unix/Cygwin versions regard case by default. #endif =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 $@`" } #ifdef dos 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]` #endif 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 treedata 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 behaviour is turned off. =item B<-K, --color> Use colors in graphical mode. =item B<-l ALIAS> Name the current path with ALIAS. Wcd places the current path with alias ALIAS in the alias file. Aliases are case sensitive. =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 PATH. Do not read the default treedata file. The relative treedata file should already have been created using the wcd B<+S> option. PATH 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 INTERFACE) presents a match list 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 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 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 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 C. See section ENVIRONMENT VARIABLES. =item B<-S PATH> Scan directory tree from PATH 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 #ifdef dos 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. #endif =item B<+S PATH> Scan disk from PATH and place relative paths in a relative treedata file. This file is used by the B<-n> and +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 -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. Moving up and down moves just one line up or down. Moving 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 a "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 't' in the graphical tree. The standard non-centered behaviour, which minimises tree movement, is the same as 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 -Tc or switch on-the-fly with the 'm' 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 USER, 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. #ifdef dos 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>. #endif =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 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 (B<-s>, B<-S>, B<+S>, B<-A>, B<-E>). #ifdef dos 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 #endif =item B<-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 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 CVS directories with administrative files add a line with C<*/CVS>. 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 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 command. Therefore the program is always called by a function or 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 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. #ifdef dos Wcd for DJGPP DOS bash requires a different function. The go script is not written in a directory C, 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 C directory. wcd () { /wcd.exe "$@" . ${WCDHOME:-${HOME}}/wcd.go } #endif 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 with the location where wcd executable have been installed. Reload the shell initialization files or start new shell. #ifdef dos =head2 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. =head2 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 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 environment variable I or I is defined. function wcd { \wcdwin32psh.exe $args & $env:HOME\wcdgo.ps1 } Replace with the location where wcd executable have 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 (wcdgo.cmd) which must be executed in the current shell. The script C first executes C, which creates the C script. Then C executes the wcdgo.cmd script. #endif =head1 LOCALIZATION =over 4 =item B 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 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 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 "C", before you can use a language priority list through the LANGUAGE variable. See also the gettext 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 /usr/local/share/locale. 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. #ifdef dos An example for Windows cmd: set WCDLOCALEDIR=c:/my_prefix/share/locale #endif 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 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 I over I. If you make I 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 =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 "LC_" are overruled by environment variable I if it is defined. Wcd gives preference to I over I and I. =back #ifdef dos =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 command C to display the active code page of the Windows console. #endif =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 I 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. #ifdef dos =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 (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 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. #endif =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. #ifdef dos The Windows Command Prompt version of wcd behaves as the DOS version. The Cygwin version of wcd behaves as the Unix version. #endif =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. #ifdef dos DOS: \treedata.wcd or %HOME%\treedata.wcd #endif #ifdef unix Unix: $HOME/.treedata.wcd #endif =item B An optional extra treedata file. If it exists and is readable wcd will try to find matches in this file also. #ifdef dos DOS: \extra.wcd or %HOME%\extra.wcd #endif #ifdef unix Unix: $HOME/.extra.wcd #endif =item B In this optional file wcd places banned paths. See option B<-b>. Wildcards are supported. #ifdef dos DOS: \ban.wcd or %HOME%\ban.wcd #endif #ifdef unix Unix: $HOME/.ban.wcd #endif =item B Optional file with wcd aliases. See option B<-l>. #ifdef dos DOS: \alias.wcd or %HOME%\alias.wcd #endif #ifdef unix Unix: $HOME/.alias.wcd #endif =item B In this file wcd stores its stack. The drive letter can be changed with the B<-d> option. #ifdef dos DOS: c:\stack.wcd or %HOME%\stack.wcd #endif #ifdef unix Unix: $HOME/.stack.wcd #endif 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>. #ifdef dos 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 #endif #ifdef unix Unix: $HOME/bin/wcd.go #endif =item B Text file with relative paths from DIR>. See options B<+S>, B<-n> and B<+n>. #ifdef dos DOS: \rtdata.wcd #endif #ifdef unix Unix: /.rtdata.wcd #endif =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 C<-s> is used. This can be overruled with environment variable I. #ifdef dos 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 HOME 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. #endif =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 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 I to overrule the default scan directory. #ifdef dos Example for DOS, Windows, OS/2 Command Prompt: set WCDHOME=C:\Users\erwin\wcd #endif 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. #ifdef dos On DOS/Windows make the list semi-colon separated. #endif #ifdef dos Examples for DOS, Windows, OS/2 Command Prompt: set WCDSCAN=C:\Users\erwin;D:\data set WCDSCAN=%HOMEDRIVE%%HOMEPATH%;\\projectdrive\projectX #endif 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 PATH variable. The case sensitivity is mandated by the Operating system. #ifdef dos An example for DOS, Windows, OS/2 Command Prompt: set WCDFILTER=projects;doc #endif 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 PATH 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 PATH separator #ifdef dos An example for DOS, Windows, OS/2 Command Prompt: set WCDEXCLUDE=*/windows;*/temp;*CVS #endif 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. #ifdef dos On DOS/Windows the default value is C<\\users>. #endif On Unix/Cygwin the default value is C. This variable is used to scan treedata files of other users. See also options B<-u> an 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 WINDOWID 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. #ifdef dos 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. #endif =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. #ifdef dos =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. #endif =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 Freecode: 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.2.4/src/match.c0000644000175000010010000002355012011306227013610 0ustar waterlanNone/*--------------------------------------------------------------------------- match.c The match() routine recursively compares a string to a "pattern" (regular expression), returning TRUE if a match is found or FALSE if not. This version is specifically for use with unzip.c: as did the previous match() routines from SEA and J. Kercheval, it leaves the case (upper, lower, or mixed) of the string alone, but converts any uppercase characters in the pattern to lowercase if indicated by the global var pInfo->lcflag (which is to say, string is assumed to have been converted to lowercase already, if such was necessary). GRR: reversed order of text, pattern in matche() (now same as match()); added ignore_case/ic flags, Case() macro. PK: replaced matche() with recmatch() from Zip, modified to have an ignore_case argument; replaced test frame with simpler one. --------------------------------------------------------------------------- Copyright on recmatch() from Zip's util.c (although recmatch() was almost certainly written by Mark Adler...ask me how I can tell :-) ): Copyright (C) 1990-1992 Mark Adler, Richard B. Wales, Jean-loup Gailly, Kai Uwe Rommel and Igor Mandrichenko. 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 --------------------------------------------------------------------------- Info-ZIP's home WWW site is listed on Yahoo and is at: http://www.cdrom.com/pub/infozip/ e-mail : Zip-Bugs@lists.wku.edu --------------------------------------------------------------------------- Match the pattern (wildcard) against the string (fixed): match(string, pattern, ignore_case); returns TRUE if string matches pattern, FALSE otherwise. In the pattern: `*' 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). [0-9a-zA-Z_] is the minimal set of characters allowed in the [..] pattern construct. Other characters are allowed (ie. 8 bit characters) if your system will support them. To suppress the special syntactic significance of any of ``[]*?!^-\'', in- side or outside a [..] construct and match the character exactly, precede it with a ``\'' (backslash). Note that "*.*" and "*." are treated specially under MS-DOS if DOSWILD is defined. See the DOSWILD section below for an explanation. ---------------------------------------------------------------------------*/ #include #include #include "match.h" /* define ToLower() in here (for Unix, define ToLower * to be macro (using isupper()); otherwise just use * tolower() */ #define Case(x) (ic? tolower(x) : (int)(x)) /* dd_match() is a shell to recmatch() to return only Boolean values. */ static int recmatch(uch *pattern, uch *string, int ignore_case); int dd_match(const char *string,const char *pattern,int ignore_case) { #if (defined(__MSDOS__) && defined(DOSWILD)) char *dospattern; int j = strlen(pattern); /*--------------------------------------------------------------------------- Optional MS-DOS preprocessing section: compare last three chars of the wildcard to "*.*" and translate to "*" if found; else compare the last two characters to "*." and, if found, scan the non-wild string for dots. If in the latter case a dot is found, return failure; else translate the "*." to "*". In either case, continue with the normal (Unix-like) match procedure after translation. (If not enough memory, default to normal match.) This causes "a*.*" and "a*." to behave as MS-DOS users expect. ---------------------------------------------------------------------------*/ if ((dospattern = (char *)malloc(j+1)) != NULL) { strcpy(dospattern, pattern); if (!strcmp(dospattern+j-3, "*.*")) { dospattern[j-2] = '\0'; /* nuke the ".*" */ } else if (!strcmp(dospattern+j-2, "*.")) { char *p = strchr(string, '.'); if (p) { /* found a dot: match fails */ free(dospattern); return 0; } dospattern[j-1] = '\0'; /* nuke the end "." */ } j = recmatch((uch *)dospattern, (uch *)string, ignore_case); free(dospattern); return j == 1; } else #endif /* __MSDOS__ && DOSWILD */ return recmatch((uch *)pattern, (uch *)string, ignore_case) == 1; } static int recmatch(uch *p,uch *s,int ic) /* uch *p; sh pattern to match */ /* uch *s; string to which to match it */ /* int ic; true for case insensitivity */ /* Recursively compare the sh pattern p with the string s and return 1 if * they match, and 0 or 2 if they don't or if there is a syntax error in the * pattern. This routine recurses on itself no more deeply than the number * of characters in the pattern. */ { int c; /* pattern char or start of range in [-] loop */ /* Get first character, the pattern for new recmatch calls follows */ c = *p++; /* If that was the end of the pattern, match if string empty too */ if (c == 0) return *s == 0; /* '?' (or '%') matches any character (but not an empty string) */ #ifdef VMS if (c == '%') /* GRR: make this conditional, too? */ #else /* !VMS */ if (c == '?') #endif /* ?VMS */ return *s ? recmatch(p, s + 1, ic) : 0; /* '*' matches any number of characters, including zero */ #ifdef AMIGA if (c == '#' && *p == '?') /* "#?" is Amiga-ese for "*" */ c = '*', p++; #endif /* AMIGA */ if (c == '*') { if (*p == 0) return 1; for (; *s; s++) if ((c = recmatch(p, s, ic)) != 0) return (int)c; return 2; /* 2 means give up--match will return false */ } #ifndef VMS /* No bracket matching in VMS */ /* Parse and process the list of characters and ranges in brackets */ if (c == '[') { int e; /* flag true if next char to be taken literally */ uch *q; /* pointer to end of [-] group */ int r; /* flag true to match anything but the range */ if (*s == 0) /* need a character to match */ return 0; p += (r = (*p == '!' || *p == '^')); /* see if reverse */ for (q = p, e = 0; *q; q++) /* find closing bracket */ if (e) e = 0; else if (*q == '\\') /* GRR: change to ^ for MS-DOS, OS/2? */ e = 1; else if (*q == ']') break; if (*q != ']') /* nothing matches if bad syntax */ return 0; for (c = 0, e = *p == '-'; p < q; p++) { /* go through the list */ if (e == 0 && *p == '\\') /* set escape flag if \ */ e = 1; else if (e == 0 && *p == '-') /* set start of range if - */ c = *(p-1); else { int cc = Case(*s); if (*(p+1) != '-') for (c = c ? c : *p; c <= *p; c++) /* compare range */ if (Case(c) == cc) return r ? 0 : recmatch(q + 1, s + 1, ic); c = e = 0; /* clear range, escape flags */ } } return r ? recmatch(q + 1, s + 1, ic) : 0; /* bracket match failed */ } #endif /* !VMS */ /* if escape ('\'), just compare next character */ if (c == '\\' && (c = *p++) == 0) /* if \ at end, then syntax error */ return 0; /* just a character--compare it */ return Case((uch)c) == Case(*s) ? recmatch(p, ++s, ic) : 0; } /* end function recmatch() */ #ifdef WILD_STAT_BUG /* Turbo/Borland C, Watcom C, VAX C, Atari MiNT libs */ int dd_iswild(const char *p) { for (; *p; ++p) if (*p == '\\' && *(p+1)) ++p; #ifdef VMS else if (*p == '%' || *p == '*') #else /* !VMS */ #ifdef AMIGA else if (*p == '?' || *p == '*' || (*p=='#' && p[1]=='?') || *p == '[') #else /* !AMIGA */ else if (*p == '?' || *p == '*' || *p == '[') #endif /* ?AMIGA */ #endif /* ?VMS */ return 1; return 0; } /* end function dd_iswild() */ #endif /* WILD_STAT_BUG */ #ifdef TEST_MATCH /* replaced gets() with fgets(). gets() can be dangerous, has known to give security problems, because it does not check for bufferoverflow. Erwin Waterlander, Jul 22 1998 */ #define put(s) { fputs(s, stdout); fflush(stdout); } void main(void) { char pat[256], str[256]; for (;;) { put("Pattern (return to exit): "); fgets(pat,100,stdin); if (!pat[0]) break; for (;;) { put("String (return for new pattern): "); fgets(str,100,stdin); if (!str[0]) break; printf("Case sensitive: %s insensitive: %s\n", dd_match(str, pat, 0) ? "YES" : "NO", dd_match(str, pat, 1) ? "YES" : "NO"); } } exit(0); } #endif /* TEST_MATCH */ wcd-5.2.4/src/match.h0000644000175000010010000000201411640707270013617 0ustar waterlanNone/* match.h Copyright (C) 1990-1992 Mark Adler, Richard B. Wales, Jean-loup Gailly, Kai Uwe Rommel and Igor Mandrichenko. 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. */ #ifndef _MATCH_H #define _MATCH_H /* Set up portability */ #include "tailor.h" /* stat() bug for Borland, Watcom, and Atari ST MiNT on * TOS filesystems: returns 0 for wildcards! (returns 0xffffffff on Minix * filesystem or U: drive under Atari MiNT) */ #define WILD_STAT_BUG /**************/ /* Typedefs */ /**************/ typedef unsigned char uch; /* code assumes unsigned bytes; these type- */ typedef unsigned short ush; /* defs replace byte/UWORD/ULONG (which are */ typedef unsigned long ulg; /* predefined on some systems) & match zip */ #ifdef __cplusplus extern "C" { #endif int dd_match(const char *string, const char *pattern, int ignore_case); int dd_iswild(const char *p); #ifdef __cplusplus } #endif #endif /* _MATCH_H */ wcd-5.2.4/src/matchl.c0000644000175000010010000005762212035632042013776 0ustar waterlanNone/*--------------------------------------------------------------------------- match.c The match() routine recursively compares a string to a "pattern" (regular expression), returning TRUE if a match is found or FALSE if not. This version is specifically for use with unzip.c: as did the previous match() routines from SEA and J. Kercheval, it leaves the case (upper, lower, or mixed) of the string alone, but converts any uppercase characters in the pattern to lowercase if indicated by the global var pInfo->lcflag (which is to say, string is assumed to have been converted to lowercase already, if such was necessary). GRR: reversed order of text, pattern in matche() (now same as match()); added ignore_case/ic flags, Case() macro. PK: replaced matche() with recmatch() from Zip, modified to have an ignore_case argument; replaced test frame with simpler one. --------------------------------------------------------------------------- matchl.c : A modified version of match.c. EW: * Option to ignore diacritics. --------------------------------------------------------------------------- Copyright on recmatch() from Zip's util.c (although recmatch() was almost certainly written by Mark Adler...ask me how I can tell :-) ): Copyright (C) 1990-1992 Mark Adler, Richard B. Wales, Jean-loup Gailly, Kai Uwe Rommel and Igor Mandrichenko. Copyright (C) 2011 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 --------------------------------------------------------------------------- Info-ZIP's home WWW site is listed on Yahoo and is at: http://www.cdrom.com/pub/infozip/ e-mail : Zip-Bugs@lists.wku.edu --------------------------------------------------------------------------- Match the pattern (wildcard) against the string (fixed): match(string, pattern, ignore_case); returns TRUE if string matches pattern, FALSE otherwise. In the pattern: `*' 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). [0-9a-zA-Z_] is the minimal set of characters allowed in the [..] pattern construct. Other characters are allowed (ie. 8 bit characters) if your system will support them. To suppress the special syntactic significance of any of ``[]*?!^-\'', in- side or outside a [..] construct and match the character exactly, precede it with a ``\'' (backslash). Note that "*.*" and "*." are treated specially under MS-DOS if DOSWILD is defined. See the DOSWILD section below for an explanation. ---------------------------------------------------------------------------*/ #include #include #include "querycp.h" #include "matchl.h" /* define ToLower() in here (for Unix, define ToLower * to be macro (using isupper()); otherwise just use * tolower() */ #define Case(x) (ic? tolower(x) : (int)(x)) static uch match_C[256] = { 0x00, 0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07, 0x08, 0x09, 0x0a, 0x0b, 0x0c, 0x0d, 0x0e, 0x0f, 0x10, 0x11, 0x12, 0x13, 0x14, 0x15, 0x16, 0x17, 0x18, 0x19, 0x1a, 0x1b, 0x1c, 0x1d, 0x1e, 0x1f, 0x20, 0x21, 0x22, 0x23, 0x24, 0x25, 0x26, 0x27, 0x28, 0x29, 0x2a, 0x2b, 0x2c, 0x2d, 0x2e, 0x2f, 0x30, 0x31, 0x32, 0x33, 0x34, 0x35, 0x36, 0x37, 0x38, 0x39, 0x3a, 0x3b, 0x3c, 0x3d, 0x3e, 0x3f, 0x40, 0x41, 0x42, 0x43, 0x44, 0x45, 0x46, 0x47, 0x48, 0x49, 0x4a, 0x4b, 0x4c, 0x4d, 0x4e, 0x4f, 0x50, 0x51, 0x52, 0x53, 0x54, 0x55, 0x56, 0x57, 0x58, 0x59, 0x5a, 0x5b, 0x5c, 0x5d, 0x5e, 0x5f, 0x60, 0x61, 0x62, 0x63, 0x64, 0x65, 0x66, 0x67, 0x68, 0x69, 0x6a, 0x6b, 0x6c, 0x6d, 0x6e, 0x6f, 0x70, 0x71, 0x72, 0x73, 0x74, 0x75, 0x76, 0x77, 0x78, 0x79, 0x7a, 0x7b, 0x7c, 0x7d, 0x7e, 0x7f, 0x80, 0x81, 0x82, 0x83, 0x84, 0x85, 0x86, 0x87, 0x88, 0x89, 0x8a, 0x8b, 0x8c, 0x8d, 0x8e, 0x8f, 0x90, 0x91, 0x92, 0x93, 0x94, 0x95, 0x96, 0x97, 0x98, 0x99, 0x9a, 0x9b, 0x9c, 0x9d, 0x9e, 0x9f, 0xa0, 0xa1, 0xa2, 0xa3, 0xa4, 0xa5, 0xa6, 0xa7, 0xa8, 0xa9, 0xaa, 0xab, 0xac, 0xad, 0xae, 0xaf, 0xb0, 0xb1, 0xb2, 0xb3, 0xb4, 0xb5, 0xb6, 0xb7, 0xb8, 0xb9, 0xba, 0xbb, 0xbc, 0xbd, 0xbe, 0xbf, 0xc0, 0xc1, 0xc2, 0xc3, 0xc4, 0xc5, 0xc6, 0xc7, 0xc8, 0xc9, 0xca, 0xcb, 0xcc, 0xcd, 0xce, 0xcf, 0xd0, 0xd1, 0xd2, 0xd3, 0xd4, 0xd5, 0xd6, 0xd7, 0xd8, 0xd9, 0xda, 0xdb, 0xdc, 0xdd, 0xde, 0xdf, 0xe0, 0xe1, 0xe2, 0xe3, 0xe4, 0xe5, 0xe6, 0xe7, 0xe8, 0xe9, 0xea, 0xeb, 0xec, 0xed, 0xee, 0xef, 0xf0, 0xf1, 0xf2, 0xf3, 0xf4, 0xf5, 0xf6, 0xf7, 0xf8, 0xf9, 0xfa, 0xfb, 0xfc, 0xfd, 0xfe, 0xff }; static uch match_CP437[256] = { 0x00, 0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07, 0x08, 0x09, 0x0a, 0x0b, 0x0c, 0x0d, 0x0e, 0x0f, 0x10, 0x11, 0x12, 0x13, 0x14, 0x15, 0x16, 0x17, 0x18, 0x19, 0x1a, 0x1b, 0x1c, 0x1d, 0x1e, 0x1f, 0x20, 0x21, 0x22, 0x23, 0x24, 0x25, 0x26, 0x27, 0x28, 0x29, 0x2a, 0x2b, 0x2c, 0x2d, 0x2e, 0x2f, 0x30, 0x31, 0x32, 0x33, 0x34, 0x35, 0x36, 0x37, 0x38, 0x39, 0x3a, 0x3b, 0x3c, 0x3d, 0x3e, 0x3f, 0x40, 0x41, 0x42, 0x43, 0x44, 0x45, 0x46, 0x47, 0x48, 0x49, 0x4a, 0x4b, 0x4c, 0x4d, 0x4e, 0x4f, 0x50, 0x51, 0x52, 0x53, 0x54, 0x55, 0x56, 0x57, 0x58, 0x59, 0x5a, 0x5b, 0x5c, 0x5d, 0x5e, 0x5f, 0x60, 0x61, 0x62, 0x63, 0x64, 0x65, 0x66, 0x67, 0x68, 0x69, 0x6a, 0x6b, 0x6c, 0x6d, 0x6e, 0x6f, 0x70, 0x71, 0x72, 0x73, 0x74, 0x75, 0x76, 0x77, 0x78, 0x79, 0x7a, 0x7b, 0x7c, 0x7d, 0x7e, 0x7f, 0x43, 0x75, 0x65, 0x61, 0x61, 0x61, 0x61, 0x63, 0x65, 0x65, 0x65, 0x69, 0x69, 0x69, 0x41, 0x41, 0x45, 0x91, 0x92, 0x6f, 0x6f, 0x6f, 0x75, 0x75, 0x79, 0x47, 0x55, 0x63, 0x9c, 0x9d, 0x9e, 0x9f, 0x61, 0x69, 0x6f, 0x75, 0x6e, 0x4e, 0xa6, 0xa7, 0xa8, 0xa9, 0xaa, 0xab, 0xac, 0xad, 0xae, 0xaf, 0xb0, 0xb1, 0xb2, 0xb3, 0xb4, 0xb5, 0xb6, 0xb7, 0xb8, 0xb9, 0xba, 0xbb, 0xbc, 0xbd, 0xbe, 0xbf, 0xc0, 0xc1, 0xc2, 0xc3, 0xc4, 0xc5, 0xc6, 0xc7, 0xc8, 0xc9, 0xca, 0xcb, 0xcc, 0xcd, 0xce, 0xcf, 0xd0, 0xd1, 0xd2, 0xd3, 0xd4, 0xd5, 0xd6, 0xd7, 0xd8, 0xd9, 0xda, 0xdb, 0xdc, 0xdd, 0xde, 0xdf, 0xe0, 0xe1, 0xe2, 0xe3, 0xe4, 0xe5, 0xe6, 0xe7, 0xe8, 0xe9, 0xea, 0xeb, 0xec, 0xed, 0xee, 0xef, 0xf0, 0xf1, 0xf2, 0xf3, 0xf4, 0xf5, 0xf6, 0xf7, 0xf8, 0xf9, 0xfa, 0xfb, 0xfc, 0xfd, 0xfe, 0xff }; static uch match_CP850[256] = { 0x00, 0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07, 0x08, 0x09, 0x0a, 0x0b, 0x0c, 0x0d, 0x0e, 0x0f, 0x10, 0x11, 0x12, 0x13, 0x14, 0x15, 0x16, 0x17, 0x18, 0x19, 0x1a, 0x1b, 0x1c, 0x1d, 0x1e, 0x1f, 0x20, 0x21, 0x22, 0x23, 0x24, 0x25, 0x26, 0x27, 0x28, 0x29, 0x2a, 0x2b, 0x2c, 0x2d, 0x2e, 0x2f, 0x30, 0x31, 0x32, 0x33, 0x34, 0x35, 0x36, 0x37, 0x38, 0x39, 0x3a, 0x3b, 0x3c, 0x3d, 0x3e, 0x3f, 0x40, 0x41, 0x42, 0x43, 0x44, 0x45, 0x46, 0x47, 0x48, 0x49, 0x4a, 0x4b, 0x4c, 0x4d, 0x4e, 0x4f, 0x50, 0x51, 0x52, 0x53, 0x54, 0x55, 0x56, 0x57, 0x58, 0x59, 0x5a, 0x5b, 0x5c, 0x5d, 0x5e, 0x5f, 0x60, 0x61, 0x62, 0x63, 0x64, 0x65, 0x66, 0x67, 0x68, 0x69, 0x6a, 0x6b, 0x6c, 0x6d, 0x6e, 0x6f, 0x70, 0x71, 0x72, 0x73, 0x74, 0x75, 0x76, 0x77, 0x78, 0x79, 0x7a, 0x7b, 0x7c, 0x7d, 0x7e, 0x7f, 0x43, 0x75, 0x65, 0x61, 0x61, 0x61, 0x61, 0x63, 0x65, 0x65, 0x65, 0x69, 0x69, 0x69, 0x41, 0x41, 0x45, 0x91, 0x92, 0x6f, 0x6f, 0x6f, 0x75, 0x75, 0x79, 0x4f, 0x55, 0x6f, 0x9c, 0x4f, 0x9e, 0x9f, 0x61, 0x69, 0x6f, 0x75, 0x6e, 0x4e, 0xa6, 0xa7, 0xa8, 0xa9, 0xaa, 0xab, 0xac, 0xad, 0xae, 0xaf, 0xb0, 0xb1, 0xb2, 0xb3, 0xb4, 0x41, 0x41, 0x41, 0xb8, 0xb9, 0xba, 0xbb, 0xbc, 0xbd, 0xbe, 0xbf, 0xc0, 0xc1, 0xc2, 0xc3, 0xc4, 0xc5, 0x61, 0x41, 0xc8, 0xc9, 0xca, 0xcb, 0xcc, 0xcd, 0xce, 0xcf, 0xd0, 0xd1, 0x45, 0x45, 0x45, 0x69, 0x49, 0x49, 0x49, 0xd9, 0xda, 0xdb, 0xdc, 0xdd, 0x49, 0xdf, 0x4f, 0xe1, 0x4f, 0x4f, 0x6f, 0x4f, 0xe6, 0xe7, 0xe8, 0x55, 0x55, 0x55, 0x79, 0x59, 0xee, 0xef, 0xf0, 0xf1, 0xf2, 0xf3, 0xf4, 0xf5, 0xf6, 0xf7, 0xf8, 0xf9, 0xfa, 0xfb, 0xfc, 0xfd, 0xfe, 0xff }; static uch match_CP852[256] = { 0x00, 0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07, 0x08, 0x09, 0x0a, 0x0b, 0x0c, 0x0d, 0x0e, 0x0f, 0x10, 0x11, 0x12, 0x13, 0x14, 0x15, 0x16, 0x17, 0x18, 0x19, 0x1a, 0x1b, 0x1c, 0x1d, 0x1e, 0x1f, 0x20, 0x21, 0x22, 0x23, 0x24, 0x25, 0x26, 0x27, 0x28, 0x29, 0x2a, 0x2b, 0x2c, 0x2d, 0x2e, 0x2f, 0x30, 0x31, 0x32, 0x33, 0x34, 0x35, 0x36, 0x37, 0x38, 0x39, 0x3a, 0x3b, 0x3c, 0x3d, 0x3e, 0x3f, 0x40, 0x41, 0x42, 0x43, 0x44, 0x45, 0x46, 0x47, 0x48, 0x49, 0x4a, 0x4b, 0x4c, 0x4d, 0x4e, 0x4f, 0x50, 0x51, 0x52, 0x53, 0x54, 0x55, 0x56, 0x57, 0x58, 0x59, 0x5a, 0x5b, 0x5c, 0x5d, 0x5e, 0x5f, 0x60, 0x61, 0x62, 0x63, 0x64, 0x65, 0x66, 0x67, 0x68, 0x69, 0x6a, 0x6b, 0x6c, 0x6d, 0x6e, 0x6f, 0x70, 0x71, 0x72, 0x73, 0x74, 0x75, 0x76, 0x77, 0x78, 0x79, 0x7a, 0x7b, 0x7c, 0x7d, 0x7e, 0x7f, 0x43, 0x75, 0x65, 0x61, 0x61, 0x75, 0x63, 0x63, 0x88, 0x65, 0x4f, 0x6f, 0x69, 0x5a, 0x41, 0x43, 0x45, 0x4c, 0x6c, 0x6f, 0x6f, 0x4c, 0x6c, 0x53, 0x73, 0x4f, 0x55, 0x54, 0x74, 0x9d, 0x9e, 0x63, 0x61, 0x69, 0x6f, 0x75, 0x41, 0x61, 0x5a, 0x7a, 0x45, 0x65, 0xaa, 0x7a, 0x43, 0x73, 0xae, 0xaf, 0xb0, 0xb1, 0xb2, 0xb3, 0xb4, 0x41, 0x41, 0x45, 0x53, 0xb9, 0xba, 0xbb, 0xbc, 0x5a, 0x7a, 0xbf, 0xc0, 0xc1, 0xc2, 0xc3, 0xc4, 0xc5, 0x41, 0x61, 0xc8, 0xc9, 0xca, 0xcb, 0xcc, 0xcd, 0xce, 0xcf, 0x64, 0x44, 0x44, 0x45, 0x64, 0x4e, 0x49, 0x49, 0x65, 0xd9, 0xda, 0xdb, 0xdc, 0xdd, 0x55, 0xdf, 0x4f, 0xe1, 0x4f, 0x4e, 0x6e, 0x6e, 0x53, 0x73, 0x52, 0x55, 0x72, 0x55, 0x79, 0x59, 0xee, 0xef, 0xf0, 0xf1, 0xf2, 0xf3, 0xf4, 0xf5, 0xf6, 0xf7, 0xf8, 0xf9, 0xfa, 0x75, 0x52, 0x72, 0xfe, 0xff }; static uch match_CP1250[256] = { 0x00, 0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07, 0x08, 0x09, 0x0a, 0x0b, 0x0c, 0x0d, 0x0e, 0x0f, 0x10, 0x11, 0x12, 0x13, 0x14, 0x15, 0x16, 0x17, 0x18, 0x19, 0x1a, 0x1b, 0x1c, 0x1d, 0x1e, 0x1f, 0x20, 0x21, 0x22, 0x23, 0x24, 0x25, 0x26, 0x27, 0x28, 0x29, 0x2a, 0x2b, 0x2c, 0x2d, 0x2e, 0x2f, 0x30, 0x31, 0x32, 0x33, 0x34, 0x35, 0x36, 0x37, 0x38, 0x39, 0x3a, 0x3b, 0x3c, 0x3d, 0x3e, 0x3f, 0x40, 0x41, 0x42, 0x43, 0x44, 0x45, 0x46, 0x47, 0x48, 0x49, 0x4a, 0x4b, 0x4c, 0x4d, 0x4e, 0x4f, 0x50, 0x51, 0x52, 0x53, 0x54, 0x55, 0x56, 0x57, 0x58, 0x59, 0x5a, 0x5b, 0x5c, 0x5d, 0x5e, 0x5f, 0x60, 0x61, 0x62, 0x63, 0x64, 0x65, 0x66, 0x67, 0x68, 0x69, 0x6a, 0x6b, 0x6c, 0x6d, 0x6e, 0x6f, 0x70, 0x71, 0x72, 0x73, 0x74, 0x75, 0x76, 0x77, 0x78, 0x79, 0x7a, 0x7b, 0x7c, 0x7d, 0x7e, 0x7f, 0x80, 0x81, 0x82, 0x83, 0x84, 0x85, 0x86, 0x87, 0x88, 0x89, 0x53, 0x8b, 0x53, 0x54, 0x5a, 0x5a, 0x90, 0x91, 0x92, 0x93, 0x94, 0x95, 0x96, 0x97, 0x98, 0x99, 0x73, 0x9b, 0x73, 0x74, 0x7a, 0x7a, 0xa0, 0xa1, 0xa2, 0xa3, 0xa4, 0x41, 0xa6, 0xa7, 0xa8, 0xa9, 0x53, 0xab, 0xac, 0xad, 0xae, 0x5a, 0xb0, 0xb1, 0xb2, 0xb3, 0xb4, 0xb5, 0xb6, 0xb7, 0xb8, 0x61, 0x73, 0xbb, 0x4c, 0xbd, 0x6c, 0x7a, 0x52, 0x41, 0x41, 0x41, 0x41, 0x4c, 0x43, 0x43, 0x43, 0x45, 0x45, 0x45, 0x45, 0x49, 0x49, 0x44, 0x44, 0x4e, 0x4e, 0x4f, 0x4f, 0x4f, 0x4f, 0xd7, 0x52, 0x55, 0x55, 0x55, 0x55, 0x59, 0xde, 0xdf, 0x72, 0x61, 0x61, 0x61, 0x61, 0x6c, 0x63, 0x63, 0x63, 0x65, 0x65, 0x65, 0x65, 0x69, 0x69, 0x64, 0x64, 0x6e, 0x6e, 0x6f, 0x6f, 0x6f, 0x6f, 0xf7, 0x72, 0x75, 0x75, 0x75, 0x75, 0x79, 0xfe, 0xff }; static uch match_CP1252[256] = { 0x00, 0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07, 0x08, 0x09, 0x0a, 0x0b, 0x0c, 0x0d, 0x0e, 0x0f, 0x10, 0x11, 0x12, 0x13, 0x14, 0x15, 0x16, 0x17, 0x18, 0x19, 0x1a, 0x1b, 0x1c, 0x1d, 0x1e, 0x1f, 0x20, 0x21, 0x22, 0x23, 0x24, 0x25, 0x26, 0x27, 0x28, 0x29, 0x2a, 0x2b, 0x2c, 0x2d, 0x2e, 0x2f, 0x30, 0x31, 0x32, 0x33, 0x34, 0x35, 0x36, 0x37, 0x38, 0x39, 0x3a, 0x3b, 0x3c, 0x3d, 0x3e, 0x3f, 0x40, 0x41, 0x42, 0x43, 0x44, 0x45, 0x46, 0x47, 0x48, 0x49, 0x4a, 0x4b, 0x4c, 0x4d, 0x4e, 0x4f, 0x50, 0x51, 0x52, 0x53, 0x54, 0x55, 0x56, 0x57, 0x58, 0x59, 0x5a, 0x5b, 0x5c, 0x5d, 0x5e, 0x5f, 0x60, 0x61, 0x62, 0x63, 0x64, 0x65, 0x66, 0x67, 0x68, 0x69, 0x6a, 0x6b, 0x6c, 0x6d, 0x6e, 0x6f, 0x70, 0x71, 0x72, 0x73, 0x74, 0x75, 0x76, 0x77, 0x78, 0x79, 0x7a, 0x7b, 0x7c, 0x7d, 0x7e, 0x7f, 0x80, 0x81, 0x82, 0x83, 0x84, 0x85, 0x86, 0x87, 0x88, 0x89, 0x53, 0x8b, 0x8c, 0x8d, 0x5a, 0x8f, 0x90, 0x91, 0x92, 0x93, 0x94, 0x95, 0x96, 0x97, 0x98, 0x99, 0x73, 0x9b, 0x9c, 0x9d, 0x7a, 0x9f, 0xa0, 0xa1, 0xa2, 0xa3, 0xa4, 0xa5, 0xa6, 0xa7, 0xa8, 0xa9, 0xaa, 0xab, 0xac, 0xad, 0xae, 0xaf, 0xb0, 0xb1, 0xb2, 0xb3, 0xb4, 0xb5, 0xb6, 0xb7, 0xb8, 0xb9, 0xba, 0xbb, 0xbc, 0xbd, 0xbe, 0xbf, 0x41, 0x41, 0x41, 0x41, 0x41, 0x41, 0xc6, 0x43, 0x45, 0x45, 0x45, 0x45, 0x49, 0x49, 0x49, 0x49, 0x44, 0x4e, 0x4f, 0x4f, 0x4f, 0x4f, 0x4f, 0xd7, 0x4f, 0x55, 0x55, 0x55, 0x55, 0x59, 0xde, 0xdf, 0x61, 0x61, 0x61, 0x61, 0x61, 0x61, 0xe6, 0x63, 0x65, 0x65, 0x65, 0x65, 0x69, 0x69, 0x69, 0x69, 0xf0, 0x6e, 0x6f, 0x6f, 0x6f, 0x6f, 0x6f, 0xf7, 0x6f, 0x75, 0x75, 0x75, 0x75, 0x79, 0xfe, 0x79 }; static uch match_CP28591[256] = /* ISO-8859-1 */ { 0x00, 0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07, 0x08, 0x09, 0x0a, 0x0b, 0x0c, 0x0d, 0x0e, 0x0f, 0x10, 0x11, 0x12, 0x13, 0x14, 0x15, 0x16, 0x17, 0x18, 0x19, 0x1a, 0x1b, 0x1c, 0x1d, 0x1e, 0x1f, 0x20, 0x21, 0x22, 0x23, 0x24, 0x25, 0x26, 0x27, 0x28, 0x29, 0x2a, 0x2b, 0x2c, 0x2d, 0x2e, 0x2f, 0x30, 0x31, 0x32, 0x33, 0x34, 0x35, 0x36, 0x37, 0x38, 0x39, 0x3a, 0x3b, 0x3c, 0x3d, 0x3e, 0x3f, 0x40, 0x41, 0x42, 0x43, 0x44, 0x45, 0x46, 0x47, 0x48, 0x49, 0x4a, 0x4b, 0x4c, 0x4d, 0x4e, 0x4f, 0x50, 0x51, 0x52, 0x53, 0x54, 0x55, 0x56, 0x57, 0x58, 0x59, 0x5a, 0x5b, 0x5c, 0x5d, 0x5e, 0x5f, 0x60, 0x61, 0x62, 0x63, 0x64, 0x65, 0x66, 0x67, 0x68, 0x69, 0x6a, 0x6b, 0x6c, 0x6d, 0x6e, 0x6f, 0x70, 0x71, 0x72, 0x73, 0x74, 0x75, 0x76, 0x77, 0x78, 0x79, 0x7a, 0x7b, 0x7c, 0x7d, 0x7e, 0x7f, 0x80, 0x81, 0x82, 0x83, 0x84, 0x85, 0x86, 0x87, 0x88, 0x89, 0x8a, 0x8b, 0x8c, 0x8d, 0x8e, 0x8f, 0x90, 0x91, 0x92, 0x93, 0x94, 0x95, 0x96, 0x97, 0x98, 0x99, 0x9a, 0x9b, 0x9c, 0x9d, 0x9e, 0x9f, 0xa0, 0xa1, 0xa2, 0xa3, 0xa4, 0xa5, 0xa6, 0xa7, 0xa8, 0xa9, 0xaa, 0xab, 0xac, 0xad, 0xae, 0xaf, 0xb0, 0xb1, 0xb2, 0xb3, 0xb4, 0xb5, 0xb6, 0xb7, 0xb8, 0xb9, 0xba, 0xbb, 0xbc, 0xbd, 0xbe, 0xbf, 0x41, 0x41, 0x41, 0x41, 0x41, 0x41, 0xc6, 0x43, 0x45, 0x45, 0x45, 0x45, 0x49, 0x49, 0x49, 0x49, 0x44, 0x4e, 0x4f, 0x4f, 0x4f, 0x4f, 0x4f, 0xd7, 0x4f, 0x55, 0x55, 0x55, 0x55, 0x59, 0xde, 0xdf, 0x61, 0x61, 0x61, 0x61, 0x61, 0x61, 0xe6, 0x63, 0x65, 0x65, 0x65, 0x65, 0x69, 0x69, 0x69, 0x69, 0xf0, 0x6e, 0x6f, 0x6f, 0x6f, 0x6f, 0x6f, 0xf7, 0x6f, 0x75, 0x75, 0x75, 0x75, 0x79, 0xfe, 0x79 }; static uch match_CP28592[256] = /* ISO-8859-2 */ { 0x00, 0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07, 0x08, 0x09, 0x0a, 0x0b, 0x0c, 0x0d, 0x0e, 0x0f, 0x10, 0x11, 0x12, 0x13, 0x14, 0x15, 0x16, 0x17, 0x18, 0x19, 0x1a, 0x1b, 0x1c, 0x1d, 0x1e, 0x1f, 0x20, 0x21, 0x22, 0x23, 0x24, 0x25, 0x26, 0x27, 0x28, 0x29, 0x2a, 0x2b, 0x2c, 0x2d, 0x2e, 0x2f, 0x30, 0x31, 0x32, 0x33, 0x34, 0x35, 0x36, 0x37, 0x38, 0x39, 0x3a, 0x3b, 0x3c, 0x3d, 0x3e, 0x3f, 0x40, 0x41, 0x42, 0x43, 0x44, 0x45, 0x46, 0x47, 0x48, 0x49, 0x4a, 0x4b, 0x4c, 0x4d, 0x4e, 0x4f, 0x50, 0x51, 0x52, 0x53, 0x54, 0x55, 0x56, 0x57, 0x58, 0x59, 0x5a, 0x5b, 0x5c, 0x5d, 0x5e, 0x5f, 0x60, 0x61, 0x62, 0x63, 0x64, 0x65, 0x66, 0x67, 0x68, 0x69, 0x6a, 0x6b, 0x6c, 0x6d, 0x6e, 0x6f, 0x70, 0x71, 0x72, 0x73, 0x74, 0x75, 0x76, 0x77, 0x78, 0x79, 0x7a, 0x7b, 0x7c, 0x7d, 0x7e, 0x7f, 0x80, 0x81, 0x82, 0x83, 0x84, 0x85, 0x86, 0x87, 0x88, 0x89, 0x8a, 0x8b, 0x8c, 0x8d, 0x8e, 0x8f, 0x90, 0x91, 0x92, 0x93, 0x94, 0x95, 0x96, 0x97, 0x98, 0x99, 0x9a, 0x9b, 0x9c, 0x9d, 0x9e, 0x9f, 0xa0, 0x41, 0xa2, 0xa3, 0xa4, 0x4c, 0x53, 0xa7, 0xa8, 0x53, 0x53, 0x54, 0x5a, 0xad, 0x5a, 0x5a, 0xb0, 0x61, 0xb2, 0xb3, 0xb4, 0x6c, 0x73, 0xb7, 0xb8, 0x73, 0x73, 0x74, 0x7a, 0xbd, 0x7a, 0x7a, 0x52, 0x41, 0x41, 0x41, 0x41, 0x4c, 0x43, 0x43, 0x43, 0x45, 0x45, 0x45, 0x45, 0x49, 0x49, 0x44, 0x44, 0x4e, 0x4e, 0x4f, 0x4f, 0x4f, 0x4f, 0xd7, 0x52, 0x55, 0x55, 0x55, 0x55, 0x59, 0xde, 0xdf, 0x72, 0x61, 0x61, 0x61, 0x61, 0x6c, 0x63, 0x63, 0x63, 0x65, 0x65, 0x65, 0x65, 0x69, 0x69, 0x64, 0x64, 0x6e, 0x6e, 0x6f, 0x6f, 0x6f, 0x6f, 0xf7, 0x72, 0x75, 0x75, 0x75, 0x75, 0x79, 0xfe, 0xff }; /* dd_matchl() is a shell to recmatch() to return only Boolean values. */ static int recmatchl(uch *pattern, uch *string, int ignore_case, uch *CPTable); int dd_matchl(const char *string,const char *pattern,int ignore_case, int ignore_diacritics) { #if (defined(__MSDOS__) && defined(DOSWILD)) char *dospattern; int j = strlen(pattern); #endif int code_page; uch *CPTable; if (ignore_diacritics == 0) { CPTable = match_C; } else { code_page = (int)query_con_codepage(); switch (code_page) { case 437: /* DOS Latin-US (United States) */ CPTable = match_CP437; break; case 850: /* DOS Latin-1 (Western European) */ CPTable = match_CP850; break; case 852: /* DOS Latin-2 (Eastern European) */ CPTable = match_CP852; break; case 1250: /* Windows Latin-2 (Eastern European) */ CPTable = match_CP1250; break; case 1252: /* Windows Latin-1 (Western European) */ CPTable = match_CP1252; break; case 28591: /* ISO Latin-1 (Western European) */ CPTable = match_CP28591; break; case 28592: /* ISO Latin-2 (Eastern European) */ CPTable = match_CP28592; break; default: /* C */ CPTable = match_C; } } #if (defined(__MSDOS__) && defined(DOSWILD)) /*--------------------------------------------------------------------------- Optional MS-DOS preprocessing section: compare last three chars of the wildcard to "*.*" and translate to "*" if found; else compare the last two characters to "*." and, if found, scan the non-wild string for dots. If in the latter case a dot is found, return failure; else translate the "*." to "*". In either case, continue with the normal (Unix-like) match procedure after translation. (If not enough memory, default to normal match.) This causes "a*.*" and "a*." to behave as MS-DOS users expect. ---------------------------------------------------------------------------*/ if ((dospattern = (char *)malloc(j+1)) != NULL) { strcpy(dospattern, pattern); if (!strcmp(dospattern+j-3, "*.*")) { dospattern[j-2] = '\0'; /* nuke the ".*" */ } else if (!strcmp(dospattern+j-2, "*.")) { char *p = strchr(string, '.'); if (p) { /* found a dot: match fails */ free(dospattern); return 0; } dospattern[j-1] = '\0'; /* nuke the end "." */ } j = recmatchl((uch *)dospattern, (uch *)string, ignore_case, CPTable); free(dospattern); return j == 1; } else #endif /* __MSDOS__ && DOSWILD */ return recmatchl((uch *)pattern, (uch *)string, ignore_case, CPTable) == 1; } static int recmatchl(uch *p,uch *s,int ic, uch *CPTable) /* uch *p; sh pattern to match */ /* uch *s; string to which to match it */ /* int ic; true for case insensitivity */ /* Recursively compare the sh pattern p with the string s and return 1 if * they match, and 0 or 2 if they don't or if there is a syntax error in the * pattern. This routine recurses on itself no more deeply than the number * of characters in the pattern. */ { int c; /* pattern char or start of range in [-] loop */ /* Get first character, the pattern for new recmatch calls follows */ c = *p++; /* If that was the end of the pattern, match if string empty too */ if (c == 0) return *s == 0; /* '?' (or '%') matches any character (but not an empty string) */ #ifdef VMS if (c == '%') /* GRR: make this conditional, too? */ #else /* !VMS */ if (c == '?') #endif /* ?VMS */ return *s ? recmatchl(p, s + 1, ic, CPTable) : 0; /* '*' matches any number of characters, including zero */ #ifdef AMIGA if (c == '#' && *p == '?') /* "#?" is Amiga-ese for "*" */ c = '*', p++; #endif /* AMIGA */ if (c == '*') { if (*p == 0) return 1; for (; *s; s++) if ((c = recmatchl(p, s, ic, CPTable)) != 0) return (int)c; return 2; /* 2 means give up--match will return false */ } #ifndef VMS /* No bracket matching in VMS */ /* Parse and process the list of characters and ranges in brackets */ if (c == '[') { int e; /* flag true if next char to be taken literally */ uch *q; /* pointer to end of [-] group */ int r; /* flag true to match anything but the range */ if (*s == 0) /* need a character to match */ return 0; p += (r = (*p == '!' || *p == '^')); /* see if reverse */ for (q = p, e = 0; *q; q++) /* find closing bracket */ if (e) e = 0; else if (*q == '\\') /* GRR: change to ^ for MS-DOS, OS/2? */ e = 1; else if (*q == ']') break; if (*q != ']') /* nothing matches if bad syntax */ return 0; for (c = 0, e = *p == '-'; p < q; p++) { /* go through the list */ if (e == 0 && *p == '\\') /* set escape flag if \ */ e = 1; else if (e == 0 && *p == '-') /* set start of range if - */ c = *(p-1); else { int cc = Case(*s); if (*(p+1) != '-') for (c = c ? c : *p; c <= *p; c++) /* compare range */ if (Case(CPTable[c]) == CPTable[cc]) return r ? 0 : recmatchl(q + 1, s + 1, ic, CPTable); c = e = 0; /* clear range, escape flags */ } } return r ? recmatchl(q + 1, s + 1, ic, CPTable) : 0; /* bracket match failed */ } #endif /* !VMS */ /* if escape ('\'), just compare next character */ if (c == '\\' && (c = *p++) == 0) /* if \ at end, then syntax error */ return 0; /* just a character--compare it */ return Case(CPTable[c]) == Case(CPTable[*s]) ? recmatchl(p, ++s, ic, CPTable) : 0; } /* end function recmatch() */ #ifdef WILD_STAT_BUG /* Turbo/Borland C, Watcom C, VAX C, Atari MiNT libs */ int dd_iswildl(const char *p) { for (; *p; ++p) if (*p == '\\' && *(p+1)) ++p; #ifdef VMS else if (*p == '%' || *p == '*') #else /* !VMS */ #ifdef AMIGA else if (*p == '?' || *p == '*' || (*p=='#' && p[1]=='?') || *p == '[') #else /* !AMIGA */ else if (*p == '?' || *p == '*' || *p == '[') #endif /* ?AMIGA */ #endif /* ?VMS */ return 1; return 0; } /* end function dd_iswild() */ #endif /* WILD_STAT_BUG */ #ifdef TEST_MATCH /* replaced gets() with fgets(). gets() can be dangerous, has known to give security problems, because it does not check for bufferoverflow. Erwin Waterlander, Jul 22 1998 */ #define put(s) { fputs(s, stdout); fflush(stdout); } void main(void) { char pat[256], str[256]; for (;;) { put("Pattern (return to exit): "); fgets(pat,100,stdin); if (!pat[0]) break; for (;;) { put("String (return for new pattern): "); fgets(str,100,stdin); if (!str[0]) break; printf("Case sensitive: %s insensitive: %s\n", dd_matchl(str, pat, 0) ? "YES" : "NO", dd_matchl(str, pat, 1) ? "YES" : "NO"); } } exit(0); } #endif /* TEST_MATCH */ wcd-5.2.4/src/matchl.h0000644000175000010010000000056311642416446014006 0ustar waterlanNone/* matchl.h Copyright (C) 2011 Erwin Waterlander 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. */ #ifndef _MATCHL_H #define _MATCHL_H #include "match.h" int dd_matchl(const char *string, const char *pattern, int ignore_case, int ignore_diacritics); #endif /* _MATCHL_H */ wcd-5.2.4/src/matchw.c0000644000175000010010000005312612035632042014004 0ustar waterlanNone/*--------------------------------------------------------------------------- match.c The match() routine recursively compares a string to a "pattern" (regular expression), returning TRUE if a match is found or FALSE if not. This version is specifically for use with unzip.c: as did the previous match() routines from SEA and J. Kercheval, it leaves the case (upper, lower, or mixed) of the string alone, but converts any uppercase characters in the pattern to lowercase if indicated by the global var pInfo->lcflag (which is to say, string is assumed to have been converted to lowercase already, if such was necessary). GRR: reversed order of text, pattern in matche() (now same as match()); added ignore_case/ic flags, Case() macro. PK: replaced matche() with recmatch() from Zip, modified to have an ignore_case argument; replaced test frame with simpler one. --------------------------------------------------------------------------- matchw.c : A modified version of match.c with Unicode matching. EW: * Option to ignore diacritics. * Unicode normalistion. --------------------------------------------------------------------------- Copyright on recmatch() from Zip's util.c (although recmatch() was almost certainly written by Mark Adler...ask me how I can tell :-) ): Copyright (C) 1990-1992 Mark Adler, Richard B. Wales, Jean-loup Gailly, Kai Uwe Rommel and Igor Mandrichenko. Copyright (C) 2011 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 --------------------------------------------------------------------------- Info-ZIP's home WWW site is listed on Yahoo and is at: http://www.cdrom.com/pub/infozip/ e-mail : Zip-Bugs@lists.wku.edu --------------------------------------------------------------------------- Match the pattern (wildcard) against the string (fixed): match(string, pattern, ignore_case); returns TRUE if string matches pattern, FALSE otherwise. In the pattern: `*' 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). [0-9a-zA-Z_] is the minimal set of characters allowed in the [..] pattern construct. Other characters are allowed (ie. 8 bit characters) if your system will support them. To suppress the special syntactic significance of any of ``[]*?!^-\'', in- side or outside a [..] construct and match the character exactly, precede it with a ``\'' (backslash). Note that "*.*" and "*." are treated specially under MS-DOS if DOSWILD is defined. See the DOSWILD section below for an explanation. ---------------------------------------------------------------------------*/ #include #include #include #ifdef WCD_UNINORM # include /* part of libunistring */ #endif #include "wcd.h" #include "display.h" #include "dosdir.h" #include "matchw.h" /* define ToLower() in here (for Unix, define ToLower * to be macro (using isupper()); otherwise just use * tolower() */ #define Case(x) (ic? towlower(x) : (wint_t)(x)) static wint_t match_C[0x250] = { 0x00, 0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07, 0x08, 0x09, 0x0a, 0x0b, 0x0c, 0x0d, 0x0e, 0x0f, 0x10, 0x11, 0x12, 0x13, 0x14, 0x15, 0x16, 0x17, 0x18, 0x19, 0x1a, 0x1b, 0x1c, 0x1d, 0x1e, 0x1f, 0x20, 0x21, 0x22, 0x23, 0x24, 0x25, 0x26, 0x27, 0x28, 0x29, 0x2a, 0x2b, 0x2c, 0x2d, 0x2e, 0x2f, 0x30, 0x31, 0x32, 0x33, 0x34, 0x35, 0x36, 0x37, 0x38, 0x39, 0x3a, 0x3b, 0x3c, 0x3d, 0x3e, 0x3f, 0x40, 0x41, 0x42, 0x43, 0x44, 0x45, 0x46, 0x47, 0x48, 0x49, 0x4a, 0x4b, 0x4c, 0x4d, 0x4e, 0x4f, 0x50, 0x51, 0x52, 0x53, 0x54, 0x55, 0x56, 0x57, 0x58, 0x59, 0x5a, 0x5b, 0x5c, 0x5d, 0x5e, 0x5f, 0x60, 0x61, 0x62, 0x63, 0x64, 0x65, 0x66, 0x67, 0x68, 0x69, 0x6a, 0x6b, 0x6c, 0x6d, 0x6e, 0x6f, 0x70, 0x71, 0x72, 0x73, 0x74, 0x75, 0x76, 0x77, 0x78, 0x79, 0x7a, 0x7b, 0x7c, 0x7d, 0x7e, 0x7f, 0x80, 0x81, 0x82, 0x83, 0x84, 0x85, 0x86, 0x87, 0x88, 0x89, 0x8a, 0x8b, 0x8c, 0x8d, 0x8e, 0x8f, 0x90, 0x91, 0x92, 0x93, 0x94, 0x95, 0x96, 0x97, 0x98, 0x99, 0x9a, 0x9b, 0x9c, 0x9d, 0x9e, 0x9f, 0xa0, 0xa1, 0xa2, 0xa3, 0xa4, 0xa5, 0xa6, 0xa7, 0xa8, 0xa9, 0xaa, 0xab, 0xac, 0xad, 0xae, 0xaf, 0xb0, 0xb1, 0xb2, 0xb3, 0xb4, 0xb5, 0xb6, 0xb7, 0xb8, 0xb9, 0xba, 0xbb, 0xbc, 0xbd, 0xbe, 0xbf, 0xc0, 0xc1, 0xc2, 0xc3, 0xc4, 0xc5, 0xc6, 0xc7, 0xc8, 0xc9, 0xca, 0xcb, 0xcc, 0xcd, 0xce, 0xcf, 0xd0, 0xd1, 0xd2, 0xd3, 0xd4, 0xd5, 0xd6, 0xd7, 0xd8, 0xd9, 0xda, 0xdb, 0xdc, 0xdd, 0xde, 0xdf, 0xe0, 0xe1, 0xe2, 0xe3, 0xe4, 0xe5, 0xe6, 0xe7, 0xe8, 0xe9, 0xea, 0xeb, 0xec, 0xed, 0xee, 0xef, 0xf0, 0xf1, 0xf2, 0xf3, 0xf4, 0xf5, 0xf6, 0xf7, 0xf8, 0xf9, 0xfa, 0xfb, 0xfc, 0xfd, 0xfe, 0xff, 0x100, 0x101, 0x102, 0x103, 0x104, 0x105, 0x106, 0x107, 0x108, 0x109, 0x10a, 0x10b, 0x10c, 0x10d, 0x10e, 0x10f, 0x110, 0x111, 0x112, 0x113, 0x114, 0x115, 0x116, 0x117, 0x118, 0x119, 0x11a, 0x11b, 0x11c, 0x11d, 0x11e, 0x11f, 0x120, 0x121, 0x122, 0x123, 0x124, 0x125, 0x126, 0x127, 0x128, 0x129, 0x12a, 0x12b, 0x12c, 0x12d, 0x12e, 0x12f, 0x130, 0x131, 0x132, 0x133, 0x134, 0x135, 0x136, 0x137, 0x138, 0x139, 0x13a, 0x13b, 0x13c, 0x13d, 0x13e, 0x13f, 0x140, 0x141, 0x142, 0x143, 0x144, 0x145, 0x146, 0x147, 0x148, 0x149, 0x14a, 0x14b, 0x14c, 0x14d, 0x14e, 0x14f, 0x150, 0x151, 0x152, 0x153, 0x154, 0x155, 0x156, 0x157, 0x158, 0x159, 0x15a, 0x15b, 0x15c, 0x15d, 0x15e, 0x15f, 0x160, 0x161, 0x162, 0x163, 0x164, 0x165, 0x166, 0x167, 0x168, 0x169, 0x16a, 0x16b, 0x16c, 0x16d, 0x16e, 0x16f, 0x170, 0x171, 0x172, 0x173, 0x174, 0x175, 0x176, 0x177, 0x178, 0x179, 0x17a, 0x17b, 0x17c, 0x17d, 0x17e, 0x17f, 0x180, 0x181, 0x182, 0x183, 0x184, 0x185, 0x186, 0x187, 0x188, 0x189, 0x18a, 0x18b, 0x18c, 0x18d, 0x18e, 0x18f, 0x190, 0x191, 0x192, 0x193, 0x194, 0x195, 0x196, 0x197, 0x198, 0x199, 0x19a, 0x19b, 0x19c, 0x19d, 0x19e, 0x19f, 0x1a0, 0x1a1, 0x1a2, 0x1a3, 0x1a4, 0x1a5, 0x1a6, 0x1a7, 0x1a8, 0x1a9, 0x1aa, 0x1ab, 0x1ac, 0x1ad, 0x1ae, 0x1af, 0x1b0, 0x1b1, 0x1b2, 0x1b3, 0x1b4, 0x1b5, 0x1b6, 0x1b7, 0x1b8, 0x1b9, 0x1ba, 0x1bb, 0x1bc, 0x1bd, 0x1be, 0x1bf, 0x1c0, 0x1c1, 0x1c2, 0x1c3, 0x1c4, 0x1c5, 0x1c6, 0x1c7, 0x1c8, 0x1c9, 0x1ca, 0x1cb, 0x1cc, 0x1cd, 0x1ce, 0x1cf, 0x1d0, 0x1d1, 0x1d2, 0x1d3, 0x1d4, 0x1d5, 0x1d6, 0x1d7, 0x1d8, 0x1d9, 0x1da, 0x1db, 0x1dc, 0x1dd, 0x1de, 0x1df, 0x1e0, 0x1e1, 0x1e2, 0x1e3, 0x1e4, 0x1e5, 0x1e6, 0x1e7, 0x1e8, 0x1e9, 0x1ea, 0x1eb, 0x1ec, 0x1ed, 0x1ee, 0x1ef, 0x1f0, 0x1f1, 0x1f2, 0x1f3, 0x1f4, 0x1f5, 0x1f6, 0x1f7, 0x1f8, 0x1f9, 0x1fa, 0x1fb, 0x1fc, 0x1fd, 0x1fe, 0x1ff, 0x200, 0x201, 0x202, 0x203, 0x204, 0x205, 0x206, 0x207, 0x208, 0x209, 0x20a, 0x20b, 0x20c, 0x20d, 0x20e, 0x20f, 0x210, 0x211, 0x212, 0x213, 0x214, 0x215, 0x216, 0x217, 0x218, 0x219, 0x21a, 0x21b, 0x21c, 0x21d, 0x21e, 0x21f, 0x220, 0x221, 0x222, 0x223, 0x224, 0x225, 0x226, 0x227, 0x228, 0x229, 0x22a, 0x22b, 0x22c, 0x22d, 0x22e, 0x22f, 0x230, 0x231, 0x232, 0x233, 0x234, 0x235, 0x236, 0x237, 0x238, 0x239, 0x23a, 0x23b, 0x23c, 0x23d, 0x23e, 0x23f, 0x240, 0x241, 0x242, 0x243, 0x244, 0x245, 0x246, 0x247, 0x248, 0x249, 0x24a, 0x24b, 0x24c, 0x24d, 0x24e, 0x24f }; static wint_t match_Unicode[0x250] = { 0x00, 0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07, 0x08, 0x09, 0x0a, 0x0b, 0x0c, 0x0d, 0x0e, 0x0f, 0x10, 0x11, 0x12, 0x13, 0x14, 0x15, 0x16, 0x17, 0x18, 0x19, 0x1a, 0x1b, 0x1c, 0x1d, 0x1e, 0x1f, 0x20, 0x21, 0x22, 0x23, 0x24, 0x25, 0x26, 0x27, 0x28, 0x29, 0x2a, 0x2b, 0x2c, 0x2d, 0x2e, 0x2f, 0x30, 0x31, 0x32, 0x33, 0x34, 0x35, 0x36, 0x37, 0x38, 0x39, 0x3a, 0x3b, 0x3c, 0x3d, 0x3e, 0x3f, 0x40, 0x41, 0x42, 0x43, 0x44, 0x45, 0x46, 0x47, 0x48, 0x49, 0x4a, 0x4b, 0x4c, 0x4d, 0x4e, 0x4f, 0x50, 0x51, 0x52, 0x53, 0x54, 0x55, 0x56, 0x57, 0x58, 0x59, 0x5a, 0x5b, 0x5c, 0x5d, 0x5e, 0x5f, 0x60, 0x61, 0x62, 0x63, 0x64, 0x65, 0x66, 0x67, 0x68, 0x69, 0x6a, 0x6b, 0x6c, 0x6d, 0x6e, 0x6f, 0x70, 0x71, 0x72, 0x73, 0x74, 0x75, 0x76, 0x77, 0x78, 0x79, 0x7a, 0x7b, 0x7c, 0x7d, 0x7e, 0x7f, 0x80, 0x81, 0x82, 0x83, 0x84, 0x85, 0x86, 0x87, 0x88, 0x89, 0x8a, 0x8b, 0x8c, 0x8d, 0x8e, 0x8f, /* Latin-1 */ 0x90, 0x91, 0x92, 0x93, 0x94, 0x95, 0x96, 0x97, 0x98, 0x99, 0x9a, 0x9b, 0x9c, 0x9d, 0x9e, 0x9f, 0xa0, 0xa1, 0xa2, 0xa3, 0xa4, 0xa5, 0xa6, 0xa7, 0xa8, 0xa9, 0xaa, 0xab, 0xac, 0xad, 0xae, 0xaf, 0xb0, 0xb1, 0xb2, 0xb3, 0xb4, 0xb5, 0xb6, 0xb7, 0xb8, 0xb9, 0xba, 0xbb, 0xbc, 0xbd, 0xbe, 0xbf, 0x41, 0x41, 0x41, 0x41, 0x41, 0x41, 0xc6, 0x43, 0x45, 0x45, 0x45, 0x45, 0x49, 0x49, 0x49, 0x49, 0x44, 0x4e, 0x4f, 0x4f, 0x4f, 0x4f, 0x4f, 0xd7, 0x4f, 0x55, 0x55, 0x55, 0x55, 0x59, 0xde, 0xdf, 0x61, 0x61, 0x61, 0x61, 0x61, 0x61, 0xe6, 0x63, 0x65, 0x65, 0x65, 0x65, 0x69, 0x69, 0x69, 0x69, 0xf0, 0x6e, 0x6f, 0x6f, 0x6f, 0x6f, 0x6f, 0xf7, 0x6f, 0x75, 0x75, 0x75, 0x75, 0x79, 0xfe, 0x79, 0x41, 0x61, 0x41, 0x61, 0x41, 0x61, 0x43, 0x63, 0x43, 0x63, 0x43, 0x63, 0x43, 0x63, 0x44, 0x64, /* Latin Extended-A */ 0x44, 0x64, 0x45, 0x65, 0x45, 0x65, 0x45, 0x65, 0x45, 0x65, 0x45, 0x65, 0x47, 0x67, 0x47, 0x67, 0x47, 0x67, 0x47, 0x67, 0x48, 0x68, 0x48, 0x68, 0x49, 0x69, 0x49, 0x69, 0x49, 0x69, 0x49, 0x69, 0x49, 0x69, 0x132, 0x133, 0x4a, 0x6a, 0x4b, 0x6b, 0x138, 0x4c, 0x6c, 0x4c, 0x6c, 0x4c, 0x6c, 0x4c, 0x6c, 0x4c, 0x6c, 0x4e, 0x6e, 0x4e, 0x6e, 0x4e, 0x6e, 0x6e, 0x4e, 0x6e, 0x4f, 0x6f, 0x4f, 0x6f, 0x4f, 0x6f, 0x152, 0x153, 0x52, 0x72, 0x52, 0x72, 0x52, 0x72, 0x53, 0x73, 0x53, 0x73, 0x53, 0x73, 0x53, 0x73, 0x54, 0x74, 0x54, 0x74, 0x54, 0x74, 0x55, 0x75, 0x55, 0x75, 0x55, 0x75, 0x55, 0x75, 0x55, 0x75, 0x55, 0x75, 0x57, 0x77, 0x59, 0x79, 0x59, 0x5a, 0x7a, 0x5a, 0x7a, 0x5a, 0x7a, 0x17f, 0x62, 0x42, 0x42, 0x62, 0x184, 0x185, 0x186, 0x43, 0x63, 0x44, 0x44, 0x44, 0x64, 0x18d, 0x18e, 0x18f, /* Latin Extended-B */ 0x45, 0x46, 0x66, 0x47, 0x194, 0x195, 0x49, 0x197, 0x4b, 0x6b, 0x19a, 0x19b, 0x19c, 0x4e, 0x6e, 0x4f, 0x4f, 0x6f, 0x1a2, 0x1a3, 0x50, 0x70, 0x1a6, 0x1a7, 0x1a8, 0x1a9, 0x1aa, 0x74, 0x54, 0x74, 0x54, 0x55, 0x75, 0x1b1, 0x56, 0x59, 0x79, 0x5a, 0x7a, 0x1b7, 0x1b8, 0x1b9, 0x1ba, 0x32, 0x1bc, 0x1bd, 0x1be, 0x1bf, 0x1c0, 0x1c1, 0x1c2, 0x1c3, 0x1c4, 0x1c5, 0x1c6, 0x1c7, 0x1c8, 0x1c9, 0x1ca, 0x1cb, 0x1cc, 0x41, 0x61, 0x49, 0x69, 0x4f, 0x6f, 0x55, 0x75, 0x55, 0x75, 0x55, 0x75, 0x55, 0x75, 0x55, 0x75, 0x1dd, 0x41, 0x61, 0x41, 0x61, 0x1e2, 0x1e3, 0x47, 0x67, 0x47, 0x67, 0x4b, 0x6b, 0x4f, 0x6f, 0x4f, 0x6f, 0x1ee, 0x1ef, 0x6a, 0x1f1, 0x1f2, 0x1f3, 0x47, 0x67, 0x1f6, 0x1f7, 0x4e, 0x6e, 0x41, 0x61, 0x1fc, 0x1fd, 0x4f, 0x6f, 0x41, 0x61, 0x41, 0x61, 0x45, 0x65, 0x45, 0x65, 0x49, 0x69, 0x49, 0x69, 0x4f, 0x6f, 0x4f, 0x6f, 0x52, 0x72, 0x52, 0x72, 0x55, 0x75, 0x55, 0x75, 0x53, 0x73, 0x54, 0x74, 0x21c, 0x21d, 0x48, 0x68, 0x4e, 0x64, 0x222, 0x223, 0x5a, 0x7a, 0x41, 0x61, 0x45, 0x65, 0x4f, 0x6f, 0x4f, 0x6f, 0x4f, 0x6f, 0x4f, 0x6f, 0x59, 0x79, 0x6c, 0x6e, 0x74, 0x6a, 0x238, 0x239, 0x41, 0x43, 0x63, 0x4c, 0x54, 0x73, 0x7a, 0x241, 0x242, 0x42, 0x55, 0x245, 0x45, 0x65, 0x4a, 0x6a, 0x71, 0x71, 0x52, 0x72, 0x59, 0x79 }; /* dd_matchwcs() is a shell to recmatch() to return only Boolean values. */ static int recmatchwcs(wchar_t *pattern, wchar_t *string, int ignore_case, wint_t *CPTable); int dd_matchmbs(const char *string, const char *pattern, int ignore_case, int ignore_diacritics) { static wchar_t wstr_string[DD_MAXPATH]; static wchar_t wstr_pattern[DD_MAXPATH]; size_t len1,len2; len1 = MBSTOWCS(wstr_string , string ,(size_t)DD_MAXPATH); len2 = MBSTOWCS(wstr_pattern, pattern,(size_t)DD_MAXPATH); if ((len1 == (size_t)(-1)) || (len2 == (size_t)(-1))) return 0; return(dd_matchwcs(wstr_string, wstr_pattern, ignore_case, ignore_diacritics)); } int dd_matchwcs(const wchar_t *string,const wchar_t *pattern,int ignore_case, int ignore_diacritics) { #if (defined(__MSDOS__) && defined(DOSWILD)) wchar_t *dospattern; size_t j = wcslen(pattern); #endif wint_t *CPTable; int result; #ifdef WCD_UNINORM static wchar_t string_buffer[DD_MAXPATH]; static wchar_t pattern_buffer[DD_MAXPATH]; size_t lengthp = DD_MAXPATH; wchar_t *string_normalized; wchar_t *pattern_normalized; # if defined(_WIN32) || defined(__CYGWIN__) /* Normalization. Composition, such that we can ignore diacritics. */ string_normalized = u16_normalize (UNINORM_NFKC, string, wcslen(string) +1, string_buffer, &lengthp); if (string_normalized == NULL) return(0); pattern_normalized = u16_normalize (UNINORM_NFKC, pattern, wcslen(pattern) +1, pattern_buffer, &lengthp); if (pattern_normalized == NULL) return(0); # else string_normalized = u32_normalize (UNINORM_NFKC, string, wcslen(string) +1, string_buffer, &lengthp); if (string_normalized == NULL) return(0); pattern_normalized = u32_normalize (UNINORM_NFKC, pattern, wcslen(pattern) +1, pattern_buffer, &lengthp); if (pattern_normalized == NULL) return(0); # endif #else /* No normalization */ const wchar_t *string_normalized; const wchar_t *pattern_normalized; string_normalized = string; pattern_normalized = pattern; #endif if (ignore_diacritics == 0) CPTable = match_C; else CPTable = match_Unicode; #if (defined(__MSDOS__) && defined(DOSWILD)) /*--------------------------------------------------------------------------- Optional MS-DOS preprocessing section: compare last three chars of the wildcard to "*.*" and translate to "*" if found; else compare the last two characters to "*." and, if found, scan the non-wild string for dots. If in the latter case a dot is found, return failure; else translate the "*." to "*". In either case, continue with the normal (Unix-like) match procedure after translation. (If not enough memory, default to normal match.) This causes "a*.*" and "a*." to behave as MS-DOS users expect. ---------------------------------------------------------------------------*/ if ((dospattern = (wchar_t *)malloc((j+1) * sizeof(wchar_t))) != NULL) { wcscpy(dospattern, pattern_normalized); if (!wcscmp(dospattern+j-3, L"*.*")) { dospattern[j-2] = '\0'; /* nuke the ".*" */ } else if (!wcscmp(dospattern+j-2, L"*.")) { wchar_t *p = wcschr(string_normalized, L'.'); if (p) { /* found a dot: match fails */ free(dospattern); return 0; } dospattern[j-1] = '\0'; /* nuke the end "." */ } result = recmatchwcs((wchar_t *)dospattern, (wchar_t *)string_normalized, ignore_case, CPTable); free(dospattern); #ifdef WCD_UNINORM if (string_normalized != string_buffer) free(string_normalized); if (pattern_normalized != pattern_buffer) free(pattern_normalized); #endif return result == 1; } else #endif /* __MSDOS__ && DOSWILD */ result = recmatchwcs((wchar_t *)pattern_normalized, (wchar_t *)string_normalized, ignore_case, CPTable) == 1; #ifdef WCD_UNINORM if (string_normalized != string_buffer) free(string_normalized); if (pattern_normalized != pattern_buffer) free(pattern_normalized); #endif return(result); } static int recmatchwcs(wchar_t *p,wchar_t *s,int ic, wint_t *CPTable) /* wchar_t *p; sh pattern to match */ /* wchar_t *s; string to which to match it */ /* int ic; true for case insensitivity */ /* Recursively compare the sh pattern p with the string s and return 1 if * they match, and 0 or 2 if they don't or if there is a syntax error in the * pattern. This routine recurses on itself no more deeply than the number * of characters in the pattern. */ { wint_t c; /* pattern char or start of range in [-] loop */ int result; /* Get first character, the pattern for new recmatch calls follows */ c = *p++; /* If that was the end of the pattern, match if string empty too */ if (c == 0) return *s == 0; /* '?' (or '%') matches any character (but not an empty string) */ #ifdef VMS if (c == L'%') /* GRR: make this conditional, too? */ #else /* !VMS */ if (c == L'?') #endif /* ?VMS */ return *s ? recmatchwcs(p, s + 1, ic, CPTable) : 0; /* '*' matches any number of characters, including zero */ #ifdef AMIGA if (c == L'#' && *p == L'?') /* "#?" is Amiga-ese for "*" */ c = L'*', p++; #endif /* AMIGA */ if (c == L'*') { if (*p == 0) return 1; for (; *s; s++) if ((result = recmatchwcs(p, s, ic, CPTable)) != 0) return result; return 2; /* 2 means give up--match will return false */ } #ifndef VMS /* No bracket matching in VMS */ /* Parse and process the list of characters and ranges in brackets */ if (c == L'[') { wint_t e; /* flag true if next char to be taken literally */ wchar_t *q; /* pointer to end of [-] group */ wint_t r; /* flag true to match anything but the range */ if (*s == 0) /* need a character to match */ return 0; p += (r = (*p == L'!' || *p == L'^')); /* see if reverse */ for (q = p, e = 0; *q; q++) /* find closing bracket */ if (e) e = 0; else if (*q == '\\') /* GRR: change to ^ for MS-DOS, OS/2? */ e = 1; else if (*q == L']') break; if (*q != L']') /* nothing matches if bad syntax */ return 0; for (c = 0, e = *p == L'-'; p < q; p++) { /* go through the list */ if (e == 0 && *p == L'\\') /* set escape flag if \ */ e = 1; else if (e == 0 && *p == L'-') /* set start of range if - */ c = *(p-1); else { wint_t cc = Case((wint_t)*s); if (*(p+1) != L'-') for (c = c ? c : (wint_t)*p; c <= (wint_t)*p; c++) /* compare range */ { if ((c < 0x250) && (cc < 0x250)) result = Case(CPTable[c]) == Case(CPTable[cc]); else result = Case(c) == Case(cc); if (result) return r ? 0 : recmatchwcs(q + 1, s + 1, ic, CPTable); } c = e = 0; /* clear range, escape flags */ } } return r ? recmatchwcs(q + 1, s + 1, ic, CPTable) : 0; /* bracket match failed */ } #endif /* !VMS */ /* if escape ('\'), just compare next character */ if (c == '\\' && (c = *p++) == 0) /* if \ at end, then syntax error */ return 0; /* just a character--compare it */ if ((c < 0x250) && (*s < 0x250)) result = Case(CPTable[c]) == Case(CPTable[*s]); else result = Case(c) == Case((wint_t)*s); return result ? recmatchwcs(p, ++s, ic, CPTable) : 0; } /* end function recmatch() */ #ifdef WILD_STAT_BUG /* Turbo/Borland C, Watcom C, VAX C, Atari MiNT libs */ int dd_iswildl(const wchar_t *p) { for (; *p; ++p) if (*p == '\\' && *(p+1)) ++p; #ifdef VMS else if (*p == L'%' || *p == L'*') #else /* !VMS */ #ifdef AMIGA else if (*p == L'?' || *p == L'*' || (*p==L'#' && p[1]==L'?') || *p == L'[') #else /* !AMIGA */ else if (*p == L'?' || *p == L'*' || *p == L'[') #endif /* ?AMIGA */ #endif /* ?VMS */ return 1; return 0; } /* end function dd_iswild() */ #endif /* WILD_STAT_BUG */ #ifdef TEST_MATCH /* replaced gets() with fgets(). gets() can be dangerous, has known to give security problems, because it does not check for bufferoverflow. Erwin Waterlander, Jul 22 1998 */ #define put(s) { fputs(s, stdout); fflush(stdout); } void main(void) { wchar_t pat[256], str[256]; for (;;) { put("Pattern (return to exit): "); fgetws(pat,100,stdin); if (!pat[0]) break; for (;;) { put("String (return for new pattern): "); fgetws(str,100,stdin); if (!str[0]) break; printf("Case sensitive: %s insensitive: %s\n", dd_matchwcs(str, pat, 0) ? "YES" : "NO", dd_matchwcs(str, pat, 1) ? "YES" : "NO"); } } exit(0); } #endif /* TEST_MATCH */ wcd-5.2.4/src/matchw.h0000644000175000010010000000073411642416446014021 0ustar waterlanNone/* matchw.h Copyright (C) 2011 Erwin Waterlander 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. */ #ifndef _MATCHW_H #define _MATCHW_H #include int dd_matchmbs(const char *string, const char *pattern, int ignore_case, int ignore_diacritics); int dd_matchwcs(const wchar_t *string, const wchar_t *pattern, int ignore_case, int ignore_diacritics); #endif /* _MATCHW_H */ wcd-5.2.4/src/patch/0000755000175000010010000000000012207427073013454 5ustar waterlanNonewcd-5.2.4/src/patch/wcd_bool.diff0000755000175000010010000000101311567517042016100 0ustar waterlanNone--- wcd-3.1.1.orig/c3po/std_macr.h +++ wcd-3.1.1/c3po/std_macr.h @@ -41,8 +41,10 @@ #define EOF -1 /* end of file */ #endif -#define true 1 -#define false 0 +/* Change by KMR to support build on Debian */ +#include +/* #define true 1 */ +/* #define false 0 */ #define expvar /* export variable */ #define expfun /* export function */ wcd-5.2.4/src/po/0000755000175000010010000000000012207427075012775 5ustar waterlanNonewcd-5.2.4/src/po/de.po0000644000175000010010000010534712207427110013725 0ustar waterlanNone# Deutsche Meldungen für WCD # Copyright 2010-2013 Erwin Waterlander # This file is distributed under the same license as the PACKAGE package. # # Philipp Thomas , 2010, 2011, 2012 # Philipp Thomas , 2010, 2011, 2012. # Lars Wendler 2013 msgid "" msgstr "" "Project-Id-Version: wcd 5.2.4\n" "Report-Msgid-Bugs-To: \n" "POT-Creation-Date: 2013-08-20 21:42+0200\n" "PO-Revision-Date: 2010-11-12 12:15+0100\n" "Last-Translator: Philipp Thomas \n" "Language-Team: German \n" "Language: de\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" "X-Generator: Lokalize 1.1\n" "Plural-Forms: nplurals=2; plural=n != 1;\n" #: wcd.c:147 #, c-format msgid "Wcd: error: %s\n" msgstr "wcd: Fehler: %s\n" #: wcd.c:161 #, c-format msgid "Wcd: wcd_fopen: Opening file \"%s\" mode=%s quiet=%d\n" msgstr "Wcd: wcd_fopen: Öffne Datei \"%s\" mode=%s quiet=%d\n" #: wcd.c:174 wcd.c:194 #, c-format msgid "Wcd: error: Unable to read file %s: %s\n" msgstr "wcd: Fehler: Die Datei %s konnte nicht gelesen werden: %s\n" #: wcd.c:183 #, c-format msgid "Wcd: error: Unable to read file %s: Not a regular file.\n" msgstr "" "wcd: Fehler: Die Datei %s konnte nicht gelesen werden: Keine normale Datei.\n" #: wcd.c:196 wcd.c:284 #, c-format msgid "Wcd: error: Unable to write file %s: %s\n" msgstr "wcd: Fehler: Die Datei %s konnte nicht geschrieben werden: %s\n" #: wcd.c:199 #, c-format msgid "Wcd: wcd_fopen: Opening file \"%s\" OK.\n" msgstr "Wcd: wcd_fopen: Öffne Datei \"%s\" OK.\n" #: wcd.c:286 #, c-format msgid "Wcd: error: Unable to close file %s: %s\n" msgstr "Wcd: Fehler: Die Datei %s konnte nicht geschlossen werden: %s\n" #: wcd.c:290 #, c-format msgid "Wcd: %sClosing file \"%s\" OK.\n" msgstr "Wcd: %sSchließe Datei \"%s\" OK.\n" #: wcd.c:629 wcd.c:642 #, c-format msgid "Wcd: %s added to file %s\n" msgstr "wcd: %s wurde zu Datei %s hinzugefügt\n" #: wcd.c:776 wcd.c:841 #, c-format msgid "Wcd: error: Unable to remove file %s: %s\n" msgstr "wcd: Fehler: Die Datei %s konnte nicht entfernt werden: %s\n" #: wcd.c:929 wcd.c:997 #, c-format msgid "" "Wcd: error: finddirs(): can't determine path in directory %s\n" "Wcd: path probably too long.\n" msgstr "" "wcd: Fehler: finddirs(): Der in Verzeichnis %s enthaltene Pfad kann nicht " "bestimmt werden\n" "wcd: wahrscheinlich ist der Pfad zu lang.\n" #: wcd.c:1108 wcd.c:1433 #, c-format msgid "Wcd: %s is not a directory.\n" msgstr "wcd: %s ist kein Verzeichnis.\n" #: wcd.c:1112 #, c-format msgid "Wcd: Please wait. Scanning disk. Building treedata-file %s from %s\n" msgstr "" "wcd: Bitte warten Sie. Das Laufwerk wird durchsucht und aus %2$s die Datei " "mit den Dateibaumdaten %1$s erstellt .\n" #: wcd.c:1173 wcd.c:2375 wcd.c:2398 wcd.c:2477 #, c-format msgid "Wcd: Writing file \"%s\"\n" msgstr "Wcd: Schreibe Datei \"%s\"\n" #: wcd.c:1178 msgid "" "Wcd: error: Write access to tree-file denied.\n" "Wcd: Set TEMP environment variable if this is a read-only disk.\n" msgstr "" "wcd: Fehler: Der Schreibzugriff auf die Dateibaum-Datei wurde verweigert.\n" "wcd: Setzen Sie bitte die Umgebungsvariable TEMP wenn dies ein nur lesbares " "Laufwerk ist.\n" #: wcd.c:1306 #, c-format msgid "Wcd: Removed symbolic link %s\n" msgstr "wcd: Die SYBOLISCHE Verknüpfung %s wurde entfernt.\n" #: wcd.c:1312 #, c-format msgid "Wcd: error: Unable to remove symbolic link %s: %s\n" msgstr "" "wcd: Fehler: Das Löschen der symbolischen Verknüpfung %s wurde verweigert: " "%s\n" #: wcd.c:1316 #, c-format msgid "Wcd: %s is a symbolic link to a file.\n" msgstr "wcd: %s ist eine symbolische Verknüpfung mit einer Datei.\n" #: wcd.c:1398 #, c-format msgid "Wcd: Recursively remove %s Are you sure? y/n :" msgstr "wcd: Rekursives Löschen von %s. Sind Sie sicher? y(ja)/n(nein)" #: wcd.c:1419 wcd.c:1428 #, c-format msgid "Wcd: Removed directory %s\n" msgstr "wcd: Verzeichnis %s wurde entfernt\n" #: wcd.c:1456 #, c-format msgid "" "Wcd: error: line too long in wcd_getline() ( > %d). The treefile could be " "corrupt, else fix by increasing DD_MAXPATH in source code.\n" msgstr "" "Wcd: Fehler: die Zeile ist zu lang in wcd_getline() ( > %d). Die Baumdatei " "könnte beschädigt sein, ansonsten erhöhen sie DD_MAXPATH im Quellcode.\n" #: wcd.c:1457 wcd.c:1517 wcd.c:1576 #, c-format msgid "Wcd: file: %s, line: %d," msgstr "Wcd: Datei: %s, Zeile: %d," #: wcd.c:1464 wcd.c:1524 wcd.c:1583 #, c-format msgid " length: %d\n" msgstr " Länge: %d\n" #: wcd.c:1516 #, c-format msgid "" "Wcd: error: line too long in wcd_wgetline() ( > %d). The treefile could be " "corrupt, else fix by increasing DD_MAXPATH in source code.\n" msgstr "" "Wcd: Fehler: die Zeile ist zu lang in wcd_wgetline() ( > %d). Die Baumdatei " "könnte beschädigt sein, ansonsten erhöhen sie DD_MAXPATH im Quellcode.\n" #: wcd.c:1575 #, c-format msgid "" "Wcd: error: line too long in wcd_wgetline_be() ( > %d). The treefile could " "be corrupt, else fix by increasing DD_MAXPATH in source code.\n" msgstr "" "Wcd: Fehler: die Zeile ist zu lang in wcd_wgetline_be() ( > %d). Die " "Baumdatei könnte beschädigt sein, ansonsten erhöhen sie DD_MAXPATH im " "Quellcode.\n" #: wcd.c:2086 #, c-format msgid "" "wcd %s (%s) - Wherever Change Directory\n" "Usage: wcd [options] [directory]\n" "\n" "directory: Name of directory to change to.\n" " Wildcards *, ? and [SET] are supported.\n" "\n" msgstr "" "wcd %s (%s) - Wherever Change Directory\n" "Aufruf: wcd [Optionen] [Verzeichnis]\n" "\n" "Verzeichnis: Name des Verzeichnisses, in welches gewechselt werden soll.\n" " Die Platzhalter *, ? und [SET] werden Unterstützt.\n" "\n" #: wcd.c:2093 #, c-format msgid "" "options:\n" " -a Add current path to treefile\n" " -aa Add current and all parent paths to treefile\n" " -A PATH Add tree from PATH\n" " -b Ban current path\n" " -c, --direct-cd direct CD mode\n" " -d DRIVE set DRIVE for stack & go files (DOS)\n" " -e add current path to Extra treefile\n" " -ee add current and all parent paths to Extra " "treefile\n" " -E PATH add tree from PATH to Extra treefile\n" " -f FILE use extra treeFile\n" " +f FILE add extra treeFile\n" " -g Graphics\n" " -gd Graphics, dump tree\n" " -G PATH set PATH Go-script\n" " -GN, --no-go-script No Go-script\n" " -h, --help show this Help\n" msgstr "" "Optionen:\n" " -a Aktuellen Pfad zur Baumdatei hinzu fügen\n" " -aa Aktuellen und alle darüberliegenden Pfade zur\n" " Baumdatei hinzufügen\n" " -A PFAD Dateibaum von PFAD hinzufügen\n" " -b Aktuellen Pfad bannen\n" " -c, --direct-cd Direkter CD Modus\n" " -d LAUFWERK Setzt LAUFWERK fúr den Stapel & wechselt zu den\n" " Dateien (DOS)\n" " -e aktuellen Pfad zu zusätzlicher Baumdatei " "hinzufügen\n" " -ee Aktuellen und alle darüber liegenden Pfade zu\n" " zusätzlicher Baumdatei hinzufügen\n" " -E PFAD Dateibaum von PFAD zu zusätzlicher Baumdatei " "hinzufügen\n" " -f DATEI Extra Baumdatei verwenden\n" " +f DATEI Extra Baumdatei hinzufügen\n" " -g Grafik\n" " -gd Grafik, Dateibaum ausgeben\n" " -G PFAD setzt PFAD zu Go-Skript\n" " -GN, --no-go-script Kein Go-skript\n" " -h, --help Diese Hilfe anzeigen\n" #: wcd.c:2112 #, c-format msgid "" " -i, --ignore-case Ignore case (default)\n" " +i, --no-ignore-case Regard case\n" msgstr "" " -i, --ignore-case Gross-/Kleinschreibung ignorieren " "(Standardeinstellung)\n" " +i, --no-ignore-case Gross-/Kleinschreibung beachten\n" #: wcd.c:2116 #, c-format msgid "" " -i, --ignore-case Ignore case\n" " +i, --no-ignore-case Regard case (default)\n" msgstr "" " -i, --ignore-case Gross-/Kleinschreibung ignorieren\n" " +i, --no-ignore-case Gross-/Kleinschreibung beachten " "(Standardeinstellung)\n" #: wcd.c:2121 #, c-format msgid "" " -I, --ignore-diacritics Ignore diacritics\n" " +I, --no-ignore-diacritics Regard diacritics (default)\n" " -j, --just-go Just go mode\n" " -k, --keep-paths Keep paths\n" " -K, --color Colors\n" " -l ALIAS aLias current directory\n" " -L, --license print software License\n" " -m DIR Make DIR, add to treefile\n" " -M DIR Make DIR, add to extra treefile\n" " -n PATH use relative treefile in PATH\n" " +n PATH add relative treefile in PATH\n" " -N, --numbers use Numbers\n" " -o use stdOut\n" " -od, --to-stdout dump matches\n" " -q, --quiet Quieter operation\n" " -r DIR Remove DIR\n" " -rmtree DIR Remove DIR recursive\n" " -s Scan disk from $HOME\n" " -S PATH Scan disk from PATH\n" " +S PATH Scan disk from PATH, create relative treefile\n" " -t Don't strip /tmp_mnt from paths\n" " -T, --ascii-tree Draw tree with ASCII characters\n" " -Ta, --alt-tree-nav Alternative tree navigation\n" " -TC, --center-tree Centered tree view\n" " -Tc, --compact-tree Compact tree\n" " -Td, --cjk-width support legacy CJK fonts\n" " -u USER use USER's treefile\n" " +u USER add USER's treefile\n" " -v, --verbose Verbose operation\n" " -V, --version print Version info\n" " -w, --wild-match-only Wild matching only\n" " -x PATH eXclude PATH during disk scan\n" " -xf FILE eXclude paths from FILE\n" " -y, --assume-yes assume Yes on all queries\n" " -z NUMBER set max stack siZe\n" " -[NUMBER] Push dir (NUMBER times)\n" " +[NUMBER] Pop dir (NUMBER times)\n" " = Show stack\n" msgstr "" " -I, --ignore-diacritics Diakritische Zeichen ignorieren\n" " +I, --no-ignore-diacritics Diakritische Zeichen nicht ignorieren " "(Standardeinstellung)\n" " -j, --just-go Geh-einfach Modus\n" " -k, --keep-paths Pfade behalten\n" " -K, --color Farben\n" " -l ALIAS ALIAS für aktuelles Verzeichnis anlegen\n" " -L, --license Software-Lizenz ausgeben\n" " -m VERZ. Erzeuge VERZEICHNIS und füge zu Baumdatei hinzu\n" " -M VERZ. Erzeuge VERZEICHNIS und füge zu extra Baumdatei " "hinzu\n" " -n PFAD Verwendet relative Baumdatei in PFAD\n" " +n PFAD Fügt relative Baumdatei in PFAD hinzu\n" " -N, --numbers Es werden Zahlen verwendet\n" " -o StdOut wird verwendet\n" " -od, --to-stdout Übereinstimmungen werden ausgegeben\n" " -q, --quiet Weniger Ausgaben\n" " -r VERZ. VERZEICHNIS wird entfernt\n" " -rmtree VERZ. VERZEICHNIS wird rekursiv entfernt\n" " -s Platte ab $HOME durchsuchen\n" " -S PFAD Platte ab PFAD durchsuchen\n" " +S PFAD Platte ab PFAD durchsuchen, relative Baumdatei " "erzeugen\n" " -t /tmp_mnt nicht vom Pfadnamen entfernen\n" " -T, --ascii-tree Den Baum mit ASCII-Zeichen zeichnen\n" " -Ta, --alt-tree-nav Alternative Baumnavigation\n" " -TC, --center-tree Zentrierte Baumansicht\n" " -Tc, --compact-tree Baum kompakter machen\n" " -Td, --cjk-width unterstütze veraltete CJK Schriften\n" " -u BENUTZER Verwendet Baumdatei von BENUTZER\n" " +u BENUTZER Fügt die Baumdatei von BENUTZER hinzu\n" " -v, --verbose WCD wird gesprächig\n" " -V, --version Programmversion ausgeben\n" " -w, --wild-match-only Nur Übereinstimmung von Platzhaltern\n" " -x PFAD PFAD beim Durchsuchen der Platte ignorieren\n" " -xf DATEI Die Pfade aus DATEI ignorieren\n" " -y, --assume-yes Setze Yes bei allen Anfragen voraus\n" " -z ZAHL Maximale Größe des Stapels festlegen\n" " -[ZAHL] Verzeichnis auf Stapel legen (ZAHL mal)\n" " +[ZAHL] Verzeinis vom Stapel nehemn (ZAHL mal)\n" " = Zeige den verzeichnisstapel an\n" #: wcd.c:2168 wcd.c:2295 #, c-format msgid "wcd %s (%s) - Wherever Change Directory\n" msgstr "wcd %s (%s) - Wherever Change Directory\n" #: wcd.c:2169 #, c-format msgid "" "Chdir for Dos and Unix.\n" "\n" msgstr "" "Chdir für Dos und Unix.\n" "\n" #: wcd.c:2173 #, c-format msgid "DOS 16 bit version (WATCOMC).\n" msgstr "DOS 16 bit Version (WATCOMC).\n" #: wcd.c:2175 #, c-format msgid "DOS 16 bit version (TURBOC).\n" msgstr "DOS 16 bit version (TURBOC).\n" #: wcd.c:2177 #, c-format msgid "DOS 32 bit version (DJGPP).\n" msgstr "32 Bit DOS Version (DJGPP).\n" #: wcd.c:2179 #, c-format msgid "DOS 32 bit version (WATCOMC).\n" msgstr "32 Bit DOS Version (WATCOMC).\n" #: wcd.c:2186 #, c-format msgid "Win64 version (MSVC %d).\n" msgstr "Win64 Version (MSVC %d).\n" #: wcd.c:2188 #, c-format msgid "Win64 version (MinGW-w64).\n" msgstr "Win64 Version (MinGW-w64).\n" #: wcd.c:2192 #, c-format msgid "Win32 version (WATCOMC).\n" msgstr "Win32 Version (WATCOMC).\n" #: wcd.c:2194 #, c-format msgid "Win32 version (MSVC %d).\n" msgstr "Win32 Version (MSVC %d).\n" #: wcd.c:2196 #, c-format msgid "Win32 version (MinGW).\n" msgstr "Win32 Version (MinGW).\n" #: wcd.c:2203 #, c-format msgid "This version is for MSYS and WinZsh.\n" msgstr "Dies ist die Version für MSYS und WinZSH.\n" #: wcd.c:2205 #, c-format msgid "This version is for Windows PowerShell.\n" msgstr "Dies ist die Version für die Windows PowerShell.\n" #: wcd.c:2207 #, c-format msgid "This version is for Windows Command Prompt (cmd.exe).\n" msgstr "Diese Version ist für die Windows Eingabeaufforderung (cmd.exe).\n" #: wcd.c:2212 #, c-format msgid "OS/2 version" msgstr "OS/2 Version" #: wcd.c:2223 #, c-format msgid "This version is for native MSYS.\n" msgstr "Diese Version ist für MSYS.\n" #: wcd.c:2226 #, c-format msgid "Cygwin version.\n" msgstr "Cygwin Version.\n" #: wcd.c:2229 #, c-format msgid "This version is for DJGPP DOS bash.\n" msgstr "Dies ist die Version für die DJGPP DOS Bash.\n" #: wcd.c:2232 #, c-format msgid "This version is for OS/2 bash.\n" msgstr "Diese Version ist für die OS/2 Bash.\n" #: wcd.c:2235 #, c-format msgid "Interface: " msgstr "Schnittstelle: " #: wcd.c:2237 #, c-format msgid "conio\n" msgstr "conio\n" #: wcd.c:2241 #, c-format msgid "ncurses version %s.%d\n" msgstr "ncurses Version %s.%d\n" #: wcd.c:2244 #, c-format msgid "PDCurses build %d\n" msgstr "PDCurses version %d\n" #: wcd.c:2246 #, c-format msgid "curses\n" msgstr "curses\n" #: wcd.c:2255 #, c-format msgid "stdout\n" msgstr "stdout\n" #: wcd.c:2259 #, c-format msgid "Native language support included.\n" msgstr "Landessprachen werden unterstützt.\n" #: wcd.c:2260 #, c-format msgid "LOCALEDIR=%s\n" msgstr "LOCALEDIR=%s\n" #: wcd.c:2262 #, c-format msgid "No native language support included.\n" msgstr "Landessprachen werden nicht unterstützt.\n" #: wcd.c:2265 #, c-format msgid "Current locale uses CP%u encoding.\n" msgstr "Aktuelle locale verwendet CP%u Encoding.\n" #: wcd.c:2267 #, c-format msgid "Current locale uses %s encoding.\n" msgstr "Aktuelle locale verwendet %s Encoding.\n" #: wcd.c:2270 #, c-format msgid "With Unicode support.\n" msgstr "Mit Unterstützung für Unicode.\n" #: wcd.c:2275 #, c-format msgid " Euro symbol: " msgstr " Euro-Symbol: " #: wcd.c:2277 #, c-format msgid " Chinese characters: " msgstr " Chinesische Schriftzeichen: " #: wcd.c:2281 #, c-format msgid "Without Unicode support.\n" msgstr "Ohne Unterstützung für Unicode.\n" #: wcd.c:2284 #, c-format msgid "With Unicode normalization.\n" msgstr "Mit Unicode-Normalisierung.\n" #: wcd.c:2286 #, c-format msgid "Without Unicode normalization.\n" msgstr "Ohne Unicode-Normalisierung.\n" #: wcd.c:2289 #, c-format msgid "Download the latest executables and sources from:\n" msgstr "" "Die neuesten Programme und Quellen können heruntergeladen werden von:\n" #: wcd.c:2290 #, c-format msgid "http://waterlan.home.xs4all.nl/\n" msgstr "http://waterlan.home.xs4all.nl/\n" #: wcd.c:2296 #, c-format msgid "" "Chdir for Dos and Unix.\n" "Copyright (C) 1997-2013 Erwin Waterlander\n" "Copyright (C) 1994-2002 Ondrej Popp on C3PO\n" "Copyright (C) 1995-1996 DJ Delorie on _fixpath()\n" "Copyright (C) 1995-1996 Borja Etxebarria & Olivier Sirol on Ninux Czo " "Directory\n" "Copyright (C) 1994-1996 Jason Mathews on DOSDIR\n" "Copyright (C) 1990-1992 Mark Adler, Richard B. Wales, Jean-loup Gailly,\n" "Kai Uwe Rommel and Igor Mandrichenko on recmatch()\n" "Source code to scan Windows LAN was originally written and placed\n" "in the public domain by Felix Kasza.\n" "Markus Kuhn's free wcwidth() implementation is used\n" "in Wcd for Windows.\n" "Rugxulo is the original author of query_con_codepage() (public domain).\n" "\n" "This program is free software; you can redistribute it and/or\n" "modify it under the terms of the GNU General Public License\n" "as published by the Free Software Foundation; either version 2\n" "of the License, or (at your option) any later version.\n" "\n" "This program is distributed in the hope that it will be useful,\n" "but WITHOUT ANY WARRANTY; without even the implied warranty of\n" "MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\n" "GNU General Public License for more details.\n" "\n" "You should have received a copy of the GNU General Public License\n" "along with this program; if not, write to the Free Software\n" "Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 " "USA.\n" msgstr "" "Chdir für Dos und Unix.\n" "Copyright © 1997-2013 Erwin Waterlander\n" "Copyright © 1994-2002 Ondrej Popp auf C3PO\n" "Copyright © 1995-1996 DJ Delorie auf _fixpath()\n" "Copyright © 1995-1996 Borja Etxebarria & Olivier Sirol auf Ninux Czo " "Verzeichnis\n" "Copyright © 1994-1996 Jason Mathews auf DOSDIR\n" "Copyright © 1990-1992 Mark Adler, Richard B. Wales, Jean-loup Gailly,\n" "Kai Uwe Rommel und Igor Mandrichenko auf recmatch()\n" "Quellcode zum Durchsuchen von Windows LAN wurde ursprünglich von\n" "Felix Kasza geschrieben und unter Public Domain gestellt.\n" "Markus Kuhn's freie wcwidth() Implementierung wird in\n" "Wcd für Windows verwendet.\n" "Rugxulo ist der ursprüngliche Author von query_con_codepage() (public " "domain).\n" "\n" "Dieses Programm ist freie Software; sie kann unter den Bedingungen\n" "der GNU Public License, wie sie von der Free Software Foundation\n" "veröffentlicht wurde, entweder Version 2 oder auf Wunsch jeder späteren\n" "Version, weiterverteilt oder modifiziert werden.\n" "\n" "Dieses Programm wird weitergegeben in dwer Hoffnung dass es nützlich ist,\n" "aber OHNE JEDE GARANTIE, mit nicht mal einer implizierten Zusicherung\n" "allgemeiner Gebrauchstauglichkeit oder NUTZBARKEIT FÜR EINEN BSTIMMTEN\n" "ZWECK. Lesen Sie die GNU General Public License für weitere Details.\n" "\n" "Sie sollten eine Kopie der GNU General Public License zusammen mit diesem\n" "Programm erhalten haben. Wenn nicht, schreiben Sie bitte an die Free\n" "Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston,\n" "MA 02110-1301 USA.\n" #: wcd.c:2355 #, c-format msgid "Wcd: creating directory %s\n" msgstr "wcd: Verzeichnis %s wird erzeugt\n" #: wcd.c:2682 msgid "Wcd: error: Value of environment variable WCDLOCALEDIR is too long.\n" msgstr "" "wcd: Fehler: Der Inhalt der Umgebungsvariable WCDLOCALEDIR ist zu lang.\n" #: wcd.c:2711 #, c-format msgid "Wcd: error: Failed to unset environment variable TERM: %s\n" msgstr "Wcd: Fehler: Konnte Umgebungsvariable TERM nicht entfernen: %s\n" #: wcd.c:2722 msgid "Wcd: error: Value of environment variable HOME is too long.\n" msgstr "wcd: Fehler: Der Inhalt der Umgebungsvariable HOME ist zu lang.\n" #: wcd.c:2737 wcd.c:2805 msgid "" "Wcd: error: Value of environment variable HOME or WCDHOME is too long.\n" msgstr "" "wcd: Fehler: Der Inhalt der Umgebungsvariablen HOME oder WCDHOME ist zu " "lang.\n" #: wcd.c:2769 wcd.c:2798 msgid "Wcd: error: Environment variable HOME or WCDHOME is not set.\n" msgstr "" "wcd: Fehler: Die Umgebungsvariablen HOME oder WCDHOOME sind nicht gesetzt.\n" #: wcd.c:2874 wcd.c:3356 wcd.c:3375 msgid "Wcd: error: Value of environment variable WCDUSERSHOME is too long.\n" msgstr "" "wcd: Fehler: Der Inhalt der Umgebungsvariable WCDUSERHOME ist zu lang.\n" #: wcd.c:2983 #, c-format msgid "Wcd: HOME is not defined\n" msgstr "Wcd: HOME ist nicht definiert\n" #: wcd.c:2985 #, c-format msgid "Wcd: HOME=\"%s\"\n" msgstr "" #: wcd.c:2987 #, c-format msgid "Wcd: WCDHOME is not defined\n" msgstr "Wcd: WCDHOME ist nicht definiert\n" #: wcd.c:2989 #, c-format msgid "Wcd: WCDHOME=\"%s\"\n" msgstr "" #: wcd.c:2991 #, c-format msgid "Wcd: WCDSCAN is not defined\n" msgstr "Wcd: WCDSCAN ist nicht definiert\n" #: wcd.c:3016 msgid "Wcd: Graphics mode only supported in wcd with curses based interface.\n" msgstr "" "wcd: Grafikmodus wird nur von wcd mit Curses basierter Oberfläche\n" " unterstützt.\n" #: wcd.c:3043 #, c-format msgid "Wcd: use_GoScript = 0\n" msgstr "" #: wcd.c:3289 #, c-format msgid "Wcd: %s added to aliasfile %s\n" msgstr "wcd: %s wurde zur Aliasdatei %s hinzugefügt\n" #: wcd.c:3388 #, c-format msgid "Wcd: error: Unable to read file %s or %s\n" msgstr "" "wcd: Fehler: Weder die Datei %s noch die Datei %s konnten gelesen werden\n" #: wcd.c:3538 #, c-format msgid "Wcd: WCDSCAN directory {%s}\n" msgstr "wcd: WCDSCAN Verzeichnis {%s}\n" #: wcd.c:3540 #, c-format msgid "Wcd: banning {%s}\n" msgstr "wcd: {%s} wird verbannt\n" #: wcd.c:3542 #, c-format msgid "Wcd: excluding {%s}\n" msgstr "wcd: {%s} wird ausgeschlossen\n" #: wcd.c:3544 #, c-format msgid "Wcd: filtering {%s}\n" msgstr "wcd\" {%s} wird gefiltert\n" #: wcd.c:3811 #, c-format msgid "" "Wcd: No directory found matching %s\n" "Wcd: Perhaps you need to rescan the disk or path is banned.\n" msgstr "" "wcd: Es wurde kein auf %s passendes Verzeichnis gefunden\n" "wcd: Vieleicht müssen Sie die Platte neu durchsuchen oder der Pfad ist " "verbannt.\n" #: wcd.c:3977 #, c-format msgid "Wcd: Cannot change to %s\n" msgstr "wcd: Zu %s kann nicht gewechselt werden\n" #: wcddir.c:104 #, c-format msgid "Wcd: Error %lu (\"%s\") reported by \"%s\".\n" msgstr "wcd: Fehler %lu »%s« wurde von »%s« zurück geliefert.\n" #: wcddir.c:127 #, c-format msgid "Wcd: access denied.\n" msgstr "wcd: der Zugriff wurde verweigert.\n" #: wcddir.c:208 #, c-format msgid "Wcd: Searching for shared directories on server %s\n" msgstr "" "wcd: Es wird nach freigegebenen Verzeichnissen auf Server %s gesucht.\n" #: wcddir.c:220 #, c-format msgid "Wcd: Found %lu shared directories on server %s\n" msgstr "wcd Es wurden %lu freigegebene Verzeichnisse auf Server %s gefunden.\n" #: wcddir.c:314 msgid "Wcd: error: wcd_islink: " msgstr "wcd: Fehler: wcd_islink: " #: wcddir.c:346 msgid "Wcd: error: Unable to get current working directory: " msgstr "" "wcd: Fehler: Das aktuelle Arbeitsverzeichnis konnte nicht abgefragt werden: " #: wcddir.c:374 #, c-format msgid "Wcd: error: Unable to change to directory %s: " msgstr "wcd: Fehler: Das Wechseln zu Verzeichnis %s war nicht möglich: " #: wcddir.c:405 #, c-format msgid "Wcd: error: Unable to create directory %s: " msgstr "wcd: Fehler: Das Verzeicnis %s konnte nicht angelegt werden: " #: wcddir.c:434 #, c-format msgid "Wcd: error: Unable to remove directory %s: " msgstr "wcd: Fehler: Das Löschen von Verzeichnis %s wurde verweigert: " #: wcddir.c:564 wcddir.c:581 #, c-format msgid "Wcd: error: Unable to create directory %s: %s\n" msgstr "wcd: Fehler: Das Verzeicnis %s konnte nicht angelegt werden: %s\n" #: wcddir.c:706 #, c-format msgid "Wcd: error: Unable to get current working directory: %s\n" msgstr "" "wcd: Fehler: Das aktuelle Arbeitsverzeichnis konnte nicht abgefragt werden: " "%s\n" #: wcddir.c:725 #, c-format msgid "Wcd: error: Unable to change to directory %s: %s\n" msgstr "wcd: Fehler: Das Wechseln zu Verzeichnis %s war nicht möglich: %s\n" #: wcddir.c:740 #, c-format msgid "Wcd: error: Unable to remove directory %s: %s\n" msgstr "wcd: Fehler: Das Löschen von Verzeichnis %s wurde verweigert: %s\n" #: stack.c:101 msgid "Wcd: Error parsing stack\n" msgstr "wcd: Fehler beim durchsuchen des Verzeichnisstapels\n" #: display.c:257 msgid "Wcd: error in maxLength(), list == NULL\n" msgstr "wcd: Fehler in maxLength(), list == NULL\n" #: display.c:277 msgid "Wcd: error in maxLengthStack(), s == NULL\n" msgstr "wcd: Fehler in maxLengthStack(), s == NULL\n" #: display.c:1129 msgid "Perfect " msgstr "Perfekt " #: display.c:1131 msgid "Wild " msgstr "Platzhalter " #: display.c:1132 #, c-format msgid "match for %d directories." msgstr "passt auf %d Verzeichnisse." #: display.c:1137 #, c-format msgid " w=up x=down ?=help Page %d/%d " msgstr " w=hoch x=runter ?=Hilfe Seite %d/%d " #: display.c:1144 display.c:1506 #, c-format msgid "Please choose one ( to abort): " msgstr "Bitte wählen Sie eins aus ( bricht ab): " #: display.c:1160 msgid "Screenheight must be > 20 for help." msgstr "Bildschirmhöhe muss für Hilfe > 20 sein." #: display.c:1163 msgid "w or Page Up." msgstr "w oder Seite hoch." #: display.c:1164 msgid "x or z or Page Down." msgstr "x,z oder Seite runter." #: display.c:1165 msgid ", or Scroll 1 left." msgstr ", oder 1 nach links rollen." #: display.c:1166 msgid ". or Scroll 1 right." msgstr ". oder 1 nach rechts rollen." #: display.c:1167 msgid "< or [ Scroll 10 left." msgstr "< oder [ 10 nach links rollen." #: display.c:1168 msgid "> or ] Scroll 10 right." msgstr "> oder ] 10 nach rechtsw rollen." #: display.c:1169 msgid "CTRL-a or Scroll to beginning." msgstr "Strg-a oder An den Anfang springen." #: display.c:1170 msgid "CTRL-e or Scroll to end." msgstr "Strg-e oder Zum Ende springen." #: display.c:1171 msgid "CTRL-c or Abort." msgstr "Strg-c oder Abbruch." #: display.c:1172 msgid " Abort." msgstr " Abbruch." #: display.c:1173 graphics.c:1810 graphics.c:1826 graphics.c:1849 #: graphics.c:1866 msgid "Press any key." msgstr "Eine beliebige Taste drücken." #: display.c:1236 graphics.c:2114 msgid "" "Wcd: warning: Error opening terminal, falling back to stdout interface.\n" msgstr "" "wcd: Warnung: Fehler beim Öffnen des Terminals, es wird die\n" "Stdout-Schnittstelle verwendet.\n" #: display.c:1257 msgid "Wcd: error: screen height must be larger than 3 lines.\n" msgstr "wcd: Fehler: die Bildschirmhöhe muss mehr als 3 Zeilen sein.\n" #: display.c:1291 graphics.c:2147 msgid "Wcd: error creating scroll window.\n" msgstr "wcd: Fehler beim Erzeugen des rollbaren Fensters.\n" #: display.c:1310 msgid "Wcd: error creating input window.\n" msgstr "wcd: Fehler beim Erzeugen des Eingabefensters.\n" #: display.c:1502 #, c-format msgid "" "\n" "Perfect " msgstr "" "\n" "Perfekt " #: display.c:1504 #, c-format msgid "" "\n" "Wild " msgstr "" "\n" "Platzhalter " #: display.c:1505 #, c-format msgid "match for %lu directories.\n" msgstr "passt auf %lu Verzeichnisse.\n" #: display.c:1548 #, c-format msgid "" "\n" "Please choose one ( to abort): " msgstr "" "\n" "Bitte wählen Sie einen ( für Abbruch): " #: graphics.c:279 #, c-format msgid "Wcd: error: line too long in function getTreeLine()" msgstr "wcd: Fehler: Die Zeile ist zu lang in der Funktion getTreeLine()" #: graphics.c:1771 msgid "/ = search forward, ? = search backward, : = help" msgstr "/ = vorwärts suchen, ? = rückwärts suchen, : = Hilfe" #: graphics.c:1776 msgid "SEARCH: " msgstr "SUCHE: " #: graphics.c:1779 msgid "Search: " msgstr "Suche: " #: graphics.c:1795 msgid "NAVIGATE MODE (1/2):" msgstr "NAVIGATIONSMODUS (1/2):" #: graphics.c:1796 msgid "h or go left." msgstr "h oder nach links gehen." #: graphics.c:1797 msgid "j or go down." msgstr "j oder \" nach unten gehen." #: graphics.c:1798 msgid "k or go up." msgstr "k oder nach oben gehen." #: graphics.c:1799 msgid "l or go right." msgstr "l oder nach rechts gehen." #: graphics.c:1800 msgid "* or v or go forward to dir with same name." msgstr "*q oder v oder vorwärts zu Verzeichnis mit gleichem Namen." #: graphics.c:1801 msgid "# or p or go backward to dir with same name." msgstr "# oder p oder rückwärts zu Verzeichnis mit gleichem Namen." #: graphics.c:1802 msgid "^ or a go to beginning of line." msgstr "^ oder a gehe an den Anfang der Zeile." #: graphics.c:1803 msgid "$ or e go to end of line." msgstr "$ oder e gehe ans Ende der Zeile." #: graphics.c:1804 msgid "1 go to root dir." msgstr "1 zum Wurzelverzeichnis gehen" #: graphics.c:1805 msgid "g or G go to last dir." msgstr "g oder G zum letzten Verzeichnis gehen." #: graphics.c:1806 msgid "f go page forward." msgstr "f eine Seite vorwärts." #: graphics.c:1807 msgid "b go page backward." msgstr "b eine Seite zurück." #: graphics.c:1808 msgid "u go half page up." msgstr "u eine halbe Seite nach oben." #: graphics.c:1809 msgid "d go half page down." msgstr "d eine halbe Seite nach unten." #: graphics.c:1816 msgid "NAVIGATE MODE (2/2):" msgstr "NAVIGATIONSMODUS (2/2):" #: graphics.c:1817 msgid "A switch alternative tree navigation on/off." msgstr "A Alternative Baumnavigation ein- bzw. ausschalten." #: graphics.c:1818 msgid "t switch centered mode on/off." msgstr "t Zentrieren ein- bzw. ausschalten." #: graphics.c:1819 msgid "T toggle between line drawing and ASCII characters." msgstr "" "T Wechseln zwischen Sonderzeichen und ASCII für das Zeichnen" #: graphics.c:1820 msgid "m toggle between compact and wide tree." msgstr "m zwischen kompaktem und breitem Baum umschalten." #: graphics.c:1821 msgid " or q Abort." msgstr " oder q Abbruch." #: graphics.c:1822 msgid "/ Search forward." msgstr "/ vorwärts suchen." #: graphics.c:1823 msgid "? Search backward." msgstr "? rúckwärts suchen." #: graphics.c:1824 msgid "n Repeat latest / or ? search." msgstr "n letzte / oder ? Suche wiederholen." #: graphics.c:1825 graphics.c:1848 msgid " Select directory." msgstr " Verzeichnis auswählen." #: graphics.c:1832 msgid "SEARCH MODE with wildcard and subdir support:" msgstr "SUCHMODUS mit Unterstützung für Platzhalte- und Unterverzeichnisse." #: graphics.c:1833 msgid " go left." msgstr " nach links gehen." #: graphics.c:1834 msgid " go down." msgstr " nach Unten." #: graphics.c:1835 msgid " go up." msgstr " nach oben gehen." #: graphics.c:1836 msgid " go right." msgstr " nach rechts gehen." #: graphics.c:1837 msgid "CTRL-v go forward to dir with same name." msgstr "Strg-v vorwärts gehen zu Verzeichnis mit gleichem Namen." #: graphics.c:1838 msgid "CTRL-p go backward to dir with same name." msgstr "Strg-p rückwärts gehen zu Verzeichnis mit gleichem Namen." #: graphics.c:1839 msgid "CTRL-a go to beginning of line." msgstr "Strg-a An den Anfang der Zeile springen." #: graphics.c:1840 msgid "CTRL-e go to end of line." msgstr "Strg-e an das Ende der Zeile springen." #: graphics.c:1841 msgid "CTRL-g go to last dir." msgstr "Strg-g zum letzten Verzeichnis gehen." #: graphics.c:1842 msgid "CTRL-f go page forward." msgstr "Strg-f eine Seite vorwärts." #: graphics.c:1843 msgid "CTRL-b go page backward." msgstr "Strg-b eine Seite zurück." #: graphics.c:1844 msgid "CTRL-u go half page up." msgstr "Strg-u eine halbe Seite nach oben" #: graphics.c:1845 msgid "CTRL-d go half page down." msgstr "Strg-d eine halbe Seite nach unten" #: graphics.c:1846 msgid " or CTRL-x Abort SEARCH MODE." msgstr " oder Strg-x SUCHMODUS abbrechen." #: graphics.c:1847 msgid "CTRL-n Repeat latest / or ? search." msgstr "Strg-n Letzte / oder ? Suche wiederholen." #: graphics.c:1855 msgid "ZOOMING:" msgstr "VERGRÖSSERN:" #: graphics.c:1856 msgid "z or i or CTRL-i zoom in." msgstr "z oder i oder Strg-i hineinzoomen." #: graphics.c:1857 msgid "Z or o or CTRL-o zoom out." msgstr "Z oder o oder Strg-o rauszoomen." #: graphics.c:1858 msgid "c condense: fold current level." msgstr "c verkürzen:: aktuelle Ebene falten." #: graphics.c:1859 msgid "C condense: fold subdir level." msgstr "C verkürzen: Unterverzeichnisebene falten." #: graphics.c:1860 msgid "w condense: fold current and sub levels." msgstr "" "w verkürzen: aktuelle Ebene mit Unterebenen falten." #: graphics.c:1861 msgid "y or CTRL-y uncondense: unfold current and sub levels." msgstr "" "y oder Strg-y dekomprimieren: aktuelle Ebene samt Unterebenen " "auffalten." #: graphics.c:1862 msgid "r or CTRL-r uncondense: unfold all directories." msgstr "r oder Strg-r dekomprimieren: alle Ebenen ausfalten." #: graphics.c:1863 msgid "- fold directory." msgstr "- Verzeichnis einfalten." #: graphics.c:1864 msgid "+ or = unfold directory." msgstr "+ oder = Verzeinis auffalten." #: graphics.c:1865 msgid "l or unfold and go right." msgstr "l oder auffalten und nach rechts gehen." #: graphics.c:1869 msgid "Screenheight must be > 21 for help" msgstr "Bildschirmhöhe muss für die Hilfe > 21 sein." #: wfixpath.c:64 msgid "Wcd: malloc error in wcd_fixpath()\n" msgstr "wcd: Malloc-Fehler in wcd_fixpath()\n" #: c3po/Error.c:40 #, c-format msgid "" "Wcd: error in '%s', no space left for allocation\n" "Wcd: Insufficient memory\n" msgstr "" "wcd: Fehler in »%s«, kein freier Speicher verfügbar\n" "wcd: Hauptspeicher reicht nicht aus\n" wcd-5.2.4/src/po/es.po0000644000175000010010000010061112207427110013731 0ustar waterlanNone# Spanish translations for wcd package # Traducciones al espaol para el paquete wcd. # Copyright (C) 2008 THE wcd'S COPYRIGHT HOLDER # This file is distributed under the same license as the wcd package. # Julio A. Freyre-Gonzalez , 2009-2013. # msgid "" msgstr "" "Project-Id-Version: wcd 5.2.4\n" "Report-Msgid-Bugs-To: \n" "POT-Creation-Date: 2013-08-20 21:42+0200\n" "PO-Revision-Date: 2008-09-08 22:17+0200\n" "Last-Translator: Julio A. Freyre-Gonzalez \n" "Language-Team: Spanish \n" "Language: es\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=ISO-8859-1\n" "Content-Transfer-Encoding: 8bit\n" "Plural-Forms: nplurals=2; plural=(n != 1);\n" #: wcd.c:147 #, c-format msgid "Wcd: error: %s\n" msgstr "Wcd: error: %s\n" #: wcd.c:161 #, c-format msgid "Wcd: wcd_fopen: Opening file \"%s\" mode=%s quiet=%d\n" msgstr "Wcd: wcd_fopen: Abriendo el archivo \"%s\" %s quiet=%d\n" #: wcd.c:174 wcd.c:194 #, c-format msgid "Wcd: error: Unable to read file %s: %s\n" msgstr "Wcd: error: Imposible leer el archivo %s: %s\n" #: wcd.c:183 #, c-format msgid "Wcd: error: Unable to read file %s: Not a regular file.\n" msgstr "Wcd: error: Imposible leer el archivo %s: No es un archivo normal.\n" #: wcd.c:196 wcd.c:284 #, c-format msgid "Wcd: error: Unable to write file %s: %s\n" msgstr "Wcd: error: Imposible escribir al archivo %s: %s\n" #: wcd.c:199 #, c-format msgid "Wcd: wcd_fopen: Opening file \"%s\" OK.\n" msgstr "Wcd: wcd_fopen: Abriendo el archivo \"%s\" OK.\n" #: wcd.c:286 #, c-format msgid "Wcd: error: Unable to close file %s: %s\n" msgstr "Wcd: error: No se puede cerrar el archivo %s: %s\n" #: wcd.c:290 #, c-format msgid "Wcd: %sClosing file \"%s\" OK.\n" msgstr "Wcd: %sCerrando el archivo \"%s\" OK.\n" #: wcd.c:629 wcd.c:642 #, c-format msgid "Wcd: %s added to file %s\n" msgstr "Wcd: %s aadido al archivo %s\n" #: wcd.c:776 wcd.c:841 #, c-format msgid "Wcd: error: Unable to remove file %s: %s\n" msgstr "Wcd: error: Imposible remover el archivo %s: %s\n" #: wcd.c:929 wcd.c:997 #, c-format msgid "" "Wcd: error: finddirs(): can't determine path in directory %s\n" "Wcd: path probably too long.\n" msgstr "" "Wcd: error: finddirs(): imposible determinar la ruta en el directorio %s\n" "Wcd: probablemente la ruta es demasiado larga.\n" #: wcd.c:1108 wcd.c:1433 #, c-format msgid "Wcd: %s is not a directory.\n" msgstr "Wcd: %s no es un directorio.\n" #: wcd.c:1112 #, c-format msgid "Wcd: Please wait. Scanning disk. Building treedata-file %s from %s\n" msgstr "" "Wcd: Favor de esperar. Explorando el disco. Construyendo el archivo %s de " "rbol de rutas para %s\n" #: wcd.c:1173 wcd.c:2375 wcd.c:2398 wcd.c:2477 #, c-format msgid "Wcd: Writing file \"%s\"\n" msgstr "Wcd: Escribiendo al archivo \"%s\"\n" #: wcd.c:1178 msgid "" "Wcd: error: Write access to tree-file denied.\n" "Wcd: Set TEMP environment variable if this is a read-only disk.\n" msgstr "" "Wcd: error: Se deneg la escritura al archivo de rbol de rutas.\n" "Wcd: Use la variable de ambiente TEMP si este es un disco de slo lectura.\n" #: wcd.c:1306 #, c-format msgid "Wcd: Removed symbolic link %s\n" msgstr "Wcd: Se removi el enlace simblico %s\n" #: wcd.c:1312 #, c-format msgid "Wcd: error: Unable to remove symbolic link %s: %s\n" msgstr "Wcd: error: mposible remover el enlace simblico %s: %s\n" #: wcd.c:1316 #, c-format msgid "Wcd: %s is a symbolic link to a file.\n" msgstr "Wcd: %s es un enlace simblico a un archivo.\n" #: wcd.c:1398 #, c-format msgid "Wcd: Recursively remove %s Are you sure? y/n :" msgstr "" "Wcd: Remover recursivamente %s Est seguro que desea continuar? y(s)/n" "(no) :" #: wcd.c:1419 wcd.c:1428 #, c-format msgid "Wcd: Removed directory %s\n" msgstr "Wcd: Se removi el directorio %s\n" #: wcd.c:1456 #, c-format msgid "" "Wcd: error: line too long in wcd_getline() ( > %d). The treefile could be " "corrupt, else fix by increasing DD_MAXPATH in source code.\n" msgstr "" "Wcd: error: lnea demasiado larga en wcd_getline() ( > %d). Es posible que " "el archivo de rbol est corrupto, sino incremente DD_MAXPATH en el cdigo " "fuente.\n" #: wcd.c:1457 wcd.c:1517 wcd.c:1576 #, c-format msgid "Wcd: file: %s, line: %d," msgstr "Wcd: archivo: %s, lnea: %d," #: wcd.c:1464 wcd.c:1524 wcd.c:1583 #, c-format msgid " length: %d\n" msgstr " longitud: %d\n" #: wcd.c:1516 #, c-format msgid "" "Wcd: error: line too long in wcd_wgetline() ( > %d). The treefile could be " "corrupt, else fix by increasing DD_MAXPATH in source code.\n" msgstr "" "Wcd: error: lnea demasiado larga en wcd_wgetline() ( > %d). Es posible que " "el archivo de rbol est corrupto, sino incremente DD_MAXPATH en el cdigo " "fuente.\n" #: wcd.c:1575 #, c-format msgid "" "Wcd: error: line too long in wcd_wgetline_be() ( > %d). The treefile could " "be corrupt, else fix by increasing DD_MAXPATH in source code.\n" msgstr "" "Wcd: error: lnea demasiado larga en wcd_wgetline_be() ( > %d). Es posible " "que el archivo de rbol est corrupto, sino incremente DD_MAXPATH en el " "cdigo fuente.\n" #: wcd.c:2086 #, c-format msgid "" "wcd %s (%s) - Wherever Change Directory\n" "Usage: wcd [options] [directory]\n" "\n" "directory: Name of directory to change to.\n" " Wildcards *, ? and [SET] are supported.\n" "\n" msgstr "" "wcd %s (%s) - Wherever Change Directory\n" "Uso: wcd [opciones] [directorio]\n" "\n" "directorio: Nombre del directorio al que desea cambiarse.\n" " Se pueden emplear los comodines *, ? y [conjunto]\n" "\n" #: wcd.c:2093 #, c-format msgid "" "options:\n" " -a Add current path to treefile\n" " -aa Add current and all parent paths to treefile\n" " -A PATH Add tree from PATH\n" " -b Ban current path\n" " -c, --direct-cd direct CD mode\n" " -d DRIVE set DRIVE for stack & go files (DOS)\n" " -e add current path to Extra treefile\n" " -ee add current and all parent paths to Extra " "treefile\n" " -E PATH add tree from PATH to Extra treefile\n" " -f FILE use extra treeFile\n" " +f FILE add extra treeFile\n" " -g Graphics\n" " -gd Graphics, dump tree\n" " -G PATH set PATH Go-script\n" " -GN, --no-go-script No Go-script\n" " -h, --help show this Help\n" msgstr "" "opciones:\n" " -a Aade la ruta actual al archivo de rbol\n" " -aa Aade la ruta actual y sus padres al archivo de " "rbol\n" " -A RUTA Aade rbol desde RUTA\n" " -b Prohbe la ruta actual\n" " -c, --direct-cd Usa modo CD directo\n" " -d UNIDAD Establece la UNIDAD para almacenar los archivos de " "la pila y el script go (DOS)\n" " -e Aade la ruta actual al archivo extra de rbol\n" " -ee Aade la ruta actual y sus padres al archivo extra " "de rbol\n" " -E RUTA Aade rbol desde RUTA al archivo extra del rbol\n" " -f ARCHIVO Usa archivo extra de rbol\n" " +f ARCHIVO Aade archivo extra de rbol\n" " -g Ambiente grfico\n" " -gd Ambiente grfico, impresin del rbol\n" " -G RUTA Establece la RUTA del script go\n" " -GN, --no-go-script No emplees el script go\n" " -h, --help Despliega esta ayuda\n" #: wcd.c:2112 #, c-format msgid "" " -i, --ignore-case Ignore case (default)\n" " +i, --no-ignore-case Regard case\n" msgstr "" " -i, --ignore-case Ignora las diferencias entre maysculas y " "minsculas (por defecto)\n" " +i, --no-ignore-case Distingue entre maysculas y minsculas\n" #: wcd.c:2116 #, c-format msgid "" " -i, --ignore-case Ignore case\n" " +i, --no-ignore-case Regard case (default)\n" msgstr "" " -i, --ignore-case Ignora las diferencias entre maysculas y " "minsculas\n" " +i, --no-ignore-case Distingue entre maysculas y minsculas (por " "defecto)\n" #: wcd.c:2121 #, c-format msgid "" " -I, --ignore-diacritics Ignore diacritics\n" " +I, --no-ignore-diacritics Regard diacritics (default)\n" " -j, --just-go Just go mode\n" " -k, --keep-paths Keep paths\n" " -K, --color Colors\n" " -l ALIAS aLias current directory\n" " -L, --license print software License\n" " -m DIR Make DIR, add to treefile\n" " -M DIR Make DIR, add to extra treefile\n" " -n PATH use relative treefile in PATH\n" " +n PATH add relative treefile in PATH\n" " -N, --numbers use Numbers\n" " -o use stdOut\n" " -od, --to-stdout dump matches\n" " -q, --quiet Quieter operation\n" " -r DIR Remove DIR\n" " -rmtree DIR Remove DIR recursive\n" " -s Scan disk from $HOME\n" " -S PATH Scan disk from PATH\n" " +S PATH Scan disk from PATH, create relative treefile\n" " -t Don't strip /tmp_mnt from paths\n" " -T, --ascii-tree Draw tree with ASCII characters\n" " -Ta, --alt-tree-nav Alternative tree navigation\n" " -TC, --center-tree Centered tree view\n" " -Tc, --compact-tree Compact tree\n" " -Td, --cjk-width support legacy CJK fonts\n" " -u USER use USER's treefile\n" " +u USER add USER's treefile\n" " -v, --verbose Verbose operation\n" " -V, --version print Version info\n" " -w, --wild-match-only Wild matching only\n" " -x PATH eXclude PATH during disk scan\n" " -xf FILE eXclude paths from FILE\n" " -y, --assume-yes assume Yes on all queries\n" " -z NUMBER set max stack siZe\n" " -[NUMBER] Push dir (NUMBER times)\n" " +[NUMBER] Pop dir (NUMBER times)\n" " = Show stack\n" msgstr "" " -I, --ignore-diacritics Ignora signos diacrticos\n" " +I, --no-ignore-diacritics Contempla signos diacrticos (por defecto)\n" " -j, --just-go Modo directo\n" " -k, --keep-paths Retn las rutas\n" " -K, --color Colores\n" " -l ALIAS Crea un ALIAS para el directorio actual\n" " -L, --license Imprime la Licencia del Programa\n" " -m DIRECTORIO Crea DIRECTORIO, y adelo al archivo de rbol\n" " -M DIRECTORIO Crea DIRECTORIO, y adelo al archivo extra de " "rbol\n" " -n RUTA Emplea archivo de rbol relativo en RUTA\n" " +n RUTA Aade archivo de rbol relativo en RUTA\n" " -N, --numbers Emplea nmeros\n" " -o Emplea la salida estndar (stdout)\n" " -od, --to-stdout Imprime correspondencias\n" " -q, --quiet Operacin silenciosa\n" " -r DIRECTORIO Remueve DIRECTORIO\n" " -rmtree DIR. Remueve recursivamente desde DIRECTORIO\n" " -s Explora disco desde $HOME\n" " -S RUTA Explora disco desde RUTA\n" " +S RUTA Explora disco desde RUTA, crea archivo de rbol " "relativo\n" " -t No remuevas /tmp_mnt de las rutas\n" " -T, --ascii-tree Dibuja el rbol con caracteres ASCII\n" " -Ta, --alt-tree-nav Navegacin de rbol alternativa\n" " -TC, --center-tree Vista centrada en rbol\n" " -Tc, --compact-tree rbol compacto\n" " -Td, --cjk-width soporte para fuentes antiguas CJK\n" " -u USUARIO Emplea archivo de rbol de USUARIO\n" " +u USUARIO Aade archivo de rbol de USUARIO\n" " -v, --verbose Imprime mensajes de informacin\n" " -V, --version Imprime informacin sobre la versin\n" " -w, --wild-match-only Emplea slo concordancias inexactas\n" " -x RUTA Excluye RUTA durante la exploracin del disco\n" " -xf ARCHIVO Excluye rutas contenidas en ARCHIVO\n" " -y, --assume-yes suprime las confirmaciones suponiendo 'S'\n" " -z NMERO Establece el tamao mximo para la pila\n" " -[NMERO] Mete directorio a la pila (NMERO veces)\n" " +[NMERO] Saca directorio de la pila (NMERO veces)\n" " = Muestra la pila\n" #: wcd.c:2168 wcd.c:2295 #, c-format msgid "wcd %s (%s) - Wherever Change Directory\n" msgstr "wcd %s (%s) - Wherever Change Directory\n" #: wcd.c:2169 #, c-format msgid "" "Chdir for Dos and Unix.\n" "\n" msgstr "" "Chdir para Dos y Unix.\n" "\n" #: wcd.c:2173 #, c-format msgid "DOS 16 bit version (WATCOMC).\n" msgstr "Versin DOS de 16 bit (WATCOMC).\n" #: wcd.c:2175 #, c-format msgid "DOS 16 bit version (TURBOC).\n" msgstr "Versin DOS de 16 bit (TURBOC).\n" #: wcd.c:2177 #, c-format msgid "DOS 32 bit version (DJGPP).\n" msgstr "Versin DOS de 32 bit (DJGPP).\n" #: wcd.c:2179 #, c-format msgid "DOS 32 bit version (WATCOMC).\n" msgstr "Versin DOS de 32 bit (WATCOMC).\n" #: wcd.c:2186 #, c-format msgid "Win64 version (MSVC %d).\n" msgstr "Versin para Win64 (MSVC %d).\n" #: wcd.c:2188 #, c-format msgid "Win64 version (MinGW-w64).\n" msgstr "Versin para Win64 (MinGW-w64).\n" #: wcd.c:2192 #, c-format msgid "Win32 version (WATCOMC).\n" msgstr "Versin para Win32 (WATCOMC).\n" #: wcd.c:2194 #, c-format msgid "Win32 version (MSVC %d).\n" msgstr "Versin para Win32 (MSVC %d).\n" #: wcd.c:2196 #, c-format msgid "Win32 version (MinGW).\n" msgstr "Versin para Win32 (MinGW).\n" #: wcd.c:2203 #, c-format msgid "This version is for MSYS and WinZsh.\n" msgstr "Esta versin es para la implementacin MSYS y WinZsh.\n" #: wcd.c:2205 #, c-format msgid "This version is for Windows PowerShell.\n" msgstr "Esta versin es para Windows PowerShell.\n" #: wcd.c:2207 #, c-format msgid "This version is for Windows Command Prompt (cmd.exe).\n" msgstr "Esta versin es para el Smbolo del sistema de Windows (cmd.exe).\n" #: wcd.c:2212 #, c-format msgid "OS/2 version" msgstr "Versin para OS/2" #: wcd.c:2223 #, c-format msgid "This version is for native MSYS.\n" msgstr "Esta versin es para MSYS nativos.\n" #: wcd.c:2226 #, c-format msgid "Cygwin version.\n" msgstr "Versin para Cygwin.\n" #: wcd.c:2229 #, c-format msgid "This version is for DJGPP DOS bash.\n" msgstr "Esta versin es para DJGPP DOS bash.\n" #: wcd.c:2232 #, c-format msgid "This version is for OS/2 bash.\n" msgstr "Esta versin es para OS/2 bash.\n" #: wcd.c:2235 #, c-format msgid "Interface: " msgstr "Interfase: " #: wcd.c:2237 #, c-format msgid "conio\n" msgstr "conio\n" #: wcd.c:2241 #, c-format msgid "ncurses version %s.%d\n" msgstr "versin ncurses %s.%d\n" #: wcd.c:2244 #, c-format msgid "PDCurses build %d\n" msgstr "PDCurses versin %d\n" #: wcd.c:2246 #, c-format msgid "curses\n" msgstr "curses\n" #: wcd.c:2255 #, c-format msgid "stdout\n" msgstr "stdout\n" #: wcd.c:2259 #, c-format msgid "Native language support included.\n" msgstr "Soporte de lenguaje nativo incluido.\n" #: wcd.c:2260 #, c-format msgid "LOCALEDIR=%s\n" msgstr "LOCALEDIR=%s\n" #: wcd.c:2262 #, c-format msgid "No native language support included.\n" msgstr "No incluye soporte de lenguaje nativo.\n" #: wcd.c:2265 #, c-format msgid "Current locale uses CP%u encoding.\n" msgstr "Localizacin actual emplea codificacin CP%u.\n" #: wcd.c:2267 #, c-format msgid "Current locale uses %s encoding.\n" msgstr "Localizacin actual emplea codificacin %s.\n" #: wcd.c:2270 #, c-format msgid "With Unicode support.\n" msgstr "Con soporte para Unicode.\n" #: wcd.c:2275 #, c-format msgid " Euro symbol: " msgstr " Smbolo de Euro: " #: wcd.c:2277 #, c-format msgid " Chinese characters: " msgstr " Caracteres chinos: " #: wcd.c:2281 #, c-format msgid "Without Unicode support.\n" msgstr "Sin soporte para Unicode.\n" #: wcd.c:2284 #, c-format msgid "With Unicode normalization.\n" msgstr "Con normalizacin Unicode.\n" #: wcd.c:2286 #, c-format msgid "Without Unicode normalization.\n" msgstr "Sin normalizacin Unicode.\n" #: wcd.c:2289 #, c-format msgid "Download the latest executables and sources from:\n" msgstr "Descarga los ltimos ejecutables y archivos fuente de:\n" #: wcd.c:2290 #, c-format msgid "http://waterlan.home.xs4all.nl/\n" msgstr "" #: wcd.c:2296 #, c-format msgid "" "Chdir for Dos and Unix.\n" "Copyright (C) 1997-2013 Erwin Waterlander\n" "Copyright (C) 1994-2002 Ondrej Popp on C3PO\n" "Copyright (C) 1995-1996 DJ Delorie on _fixpath()\n" "Copyright (C) 1995-1996 Borja Etxebarria & Olivier Sirol on Ninux Czo " "Directory\n" "Copyright (C) 1994-1996 Jason Mathews on DOSDIR\n" "Copyright (C) 1990-1992 Mark Adler, Richard B. Wales, Jean-loup Gailly,\n" "Kai Uwe Rommel and Igor Mandrichenko on recmatch()\n" "Source code to scan Windows LAN was originally written and placed\n" "in the public domain by Felix Kasza.\n" "Markus Kuhn's free wcwidth() implementation is used\n" "in Wcd for Windows.\n" "Rugxulo is the original author of query_con_codepage() (public domain).\n" "\n" "This program is free software; you can redistribute it and/or\n" "modify it under the terms of the GNU General Public License\n" "as published by the Free Software Foundation; either version 2\n" "of the License, or (at your option) any later version.\n" "\n" "This program is distributed in the hope that it will be useful,\n" "but WITHOUT ANY WARRANTY; without even the implied warranty of\n" "MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\n" "GNU General Public License for more details.\n" "\n" "You should have received a copy of the GNU General Public License\n" "along with this program; if not, write to the Free Software\n" "Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 " "USA.\n" msgstr "" #: wcd.c:2355 #, c-format msgid "Wcd: creating directory %s\n" msgstr "Wcd: Creando directorio %s\n" #: wcd.c:2682 msgid "Wcd: error: Value of environment variable WCDLOCALEDIR is too long.\n" msgstr "" "Wcd: error: El valor de la variable de ambiente WCDLOCALEDIR es demasiado " "largo.\n" #: wcd.c:2711 #, c-format msgid "Wcd: error: Failed to unset environment variable TERM: %s\n" msgstr "Wcd: error: Error al suprimir la variable de entorno TERM: %s\n" #: wcd.c:2722 msgid "Wcd: error: Value of environment variable HOME is too long.\n" msgstr "" "Wcd: error: El valor de la variable de ambiente HOME es demasiado largo.\n" #: wcd.c:2737 wcd.c:2805 msgid "" "Wcd: error: Value of environment variable HOME or WCDHOME is too long.\n" msgstr "" "Wcd: error: El valor de la variable de ambiente HOME o WCDHOME es demasiado " "largo.\n" #: wcd.c:2769 wcd.c:2798 msgid "Wcd: error: Environment variable HOME or WCDHOME is not set.\n" msgstr "Wcd: error: La variable de ambiente HOME o WCDHOME no tiene valor.\n" #: wcd.c:2874 wcd.c:3356 wcd.c:3375 msgid "Wcd: error: Value of environment variable WCDUSERSHOME is too long.\n" msgstr "" "Wcd: error: El valor de la variable de ambiente WCDUSERSHOME es demasiado " "largo.\n" #: wcd.c:2983 #, c-format msgid "Wcd: HOME is not defined\n" msgstr "Wcd: La variable de entorno HOME no est definida\n" #: wcd.c:2985 #, c-format msgid "Wcd: HOME=\"%s\"\n" msgstr "" #: wcd.c:2987 #, c-format msgid "Wcd: WCDHOME is not defined\n" msgstr "Wcd: La variable de entorno WCDHOME no est definida\n" #: wcd.c:2989 #, c-format msgid "Wcd: WCDHOME=\"%s\"\n" msgstr "" #: wcd.c:2991 #, c-format msgid "Wcd: WCDSCAN is not defined\n" msgstr "Wcd: La variable de entorno WCDSCAN no est definida\n" #: wcd.c:3016 msgid "Wcd: Graphics mode only supported in wcd with curses based interface.\n" msgstr "" "Wcd: Modo grfico slo soportado en wcd con interfase basada en curses.\n" #: wcd.c:3043 #, c-format msgid "Wcd: use_GoScript = 0\n" msgstr "" #: wcd.c:3289 #, c-format msgid "Wcd: %s added to aliasfile %s\n" msgstr "Wcd: %s se aadi al archivo de alias %s\n" #: wcd.c:3388 #, c-format msgid "Wcd: error: Unable to read file %s or %s\n" msgstr "Wcd: error: Imposible leer el archivo %s o %s\n" #: wcd.c:3538 #, c-format msgid "Wcd: WCDSCAN directory {%s}\n" msgstr "Wcd: Directorio de WCDSCAN {%s}\n" #: wcd.c:3540 #, c-format msgid "Wcd: banning {%s}\n" msgstr "Wcd: prohibiendo {%s}\n" #: wcd.c:3542 #, c-format msgid "Wcd: excluding {%s}\n" msgstr "Wcd: excluyendo {%s}\n" #: wcd.c:3544 #, c-format msgid "Wcd: filtering {%s}\n" msgstr "Wcd: filtrando {%s}\n" #: wcd.c:3811 #, c-format msgid "" "Wcd: No directory found matching %s\n" "Wcd: Perhaps you need to rescan the disk or path is banned.\n" msgstr "" "Wcd: No se encontr algn directorio que concordara con %s\n" "Wcd: Quiz necesite reexplorar el disco o la ruta.\n" #: wcd.c:3977 #, c-format msgid "Wcd: Cannot change to %s\n" msgstr "Wcd: No puedo cambiar el directorio a %s\n" #: wcddir.c:104 #, c-format msgid "Wcd: Error %lu (\"%s\") reported by \"%s\".\n" msgstr "Wcd: Error %lu (\"%s\") reportado por \"%s\".\n" #: wcddir.c:127 #, c-format msgid "Wcd: access denied.\n" msgstr "Wcd: acceso denegado.\n" #: wcddir.c:208 #, c-format msgid "Wcd: Searching for shared directories on server %s\n" msgstr "Wcd: Buscando archivos compartidos en el servidor %s\n" #: wcddir.c:220 #, c-format msgid "Wcd: Found %lu shared directories on server %s\n" msgstr "Wcd: Se encontraron %lu directorios compartidos en el servidor %s\n" #: wcddir.c:314 msgid "Wcd: error: wcd_islink: " msgstr "Wcd: error: wcd_islink: " #: wcddir.c:346 msgid "Wcd: error: Unable to get current working directory: " msgstr "Wcd: error: Imposible obtener el directorio actual de trabajo: " #: wcddir.c:374 #, c-format msgid "Wcd: error: Unable to change to directory %s: " msgstr "Wcd: error: Imposible cambiarse al directorio %s: " #: wcddir.c:405 #, c-format msgid "Wcd: error: Unable to create directory %s: " msgstr "Wcd: error: Imposible cambiarse al directorio %s: " #: wcddir.c:434 #, c-format msgid "Wcd: error: Unable to remove directory %s: " msgstr "Wcd: error: Imposible remover el directorio %s: " #: wcddir.c:564 wcddir.c:581 #, c-format msgid "Wcd: error: Unable to create directory %s: %s\n" msgstr "Wcd: error: Imposible cambiarse al directorio %s: %s\n" #: wcddir.c:706 #, c-format msgid "Wcd: error: Unable to get current working directory: %s\n" msgstr "Wcd: error: Imposible obtener el directorio actual de trabajo: %s\n" #: wcddir.c:725 #, c-format msgid "Wcd: error: Unable to change to directory %s: %s\n" msgstr "Wcd: error: Imposible cambiarse al directorio %s: %s\n" #: wcddir.c:740 #, c-format msgid "Wcd: error: Unable to remove directory %s: %s\n" msgstr "Wcd: error: Imposible remover el directorio %s: %s\n" #: stack.c:101 msgid "Wcd: Error parsing stack\n" msgstr "Wcd: Error al analizar la pila\n" #: display.c:257 msgid "Wcd: error in maxLength(), list == NULL\n" msgstr "Wcd: error en maxLength(), list == NULL\n" #: display.c:277 msgid "Wcd: error in maxLengthStack(), s == NULL\n" msgstr "Wcd: error en maxLengthStack(), s == NULL\n" #: display.c:1129 msgid "Perfect " msgstr "Perfecta " #: display.c:1131 msgid "Wild " msgstr "Inexacta " #: display.c:1132 #, c-format msgid "match for %d directories." msgstr "concordancia para %d directorios." #: display.c:1137 #, c-format msgid " w=up x=down ?=help Page %d/%d " msgstr " w=arriba x=abajo ?=ayuda Pgina %d/%d " #: display.c:1144 display.c:1506 #, c-format msgid "Please choose one ( to abort): " msgstr "Favor de elegir uno ( para abortar): " #: display.c:1160 msgid "Screenheight must be > 20 for help." msgstr "La altura de la pantalla debe ser > 20 para la ayuda." #: display.c:1163 msgid "w or Page Up." msgstr "w o Avanza pgina" #: display.c:1164 msgid "x or z or Page Down." msgstr "x o Retrocede pgina." #: display.c:1165 msgid ", or Scroll 1 left." msgstr ", o Desliza 1 a la izquierda." #: display.c:1166 msgid ". or Scroll 1 right." msgstr ". o Desliza 1 a la derecha." #: display.c:1167 msgid "< or [ Scroll 10 left." msgstr "< o [ Desliza 10 a la izquierda." #: display.c:1168 msgid "> or ] Scroll 10 right." msgstr "> o ] Desliza 10 a la derecha." #: display.c:1169 msgid "CTRL-a or Scroll to beginning." msgstr "CTRL-a o Desliza al inicio." #: display.c:1170 msgid "CTRL-e or Scroll to end." msgstr "CTRL-e o Desliza al fin." #: display.c:1171 msgid "CTRL-c or Abort." msgstr "CTRL-c o Aborta." #: display.c:1172 msgid " Abort." msgstr " Aborta." #: display.c:1173 graphics.c:1810 graphics.c:1826 graphics.c:1849 #: graphics.c:1866 msgid "Press any key." msgstr "Presione alguna tecla." #: display.c:1236 graphics.c:2114 msgid "" "Wcd: warning: Error opening terminal, falling back to stdout interface.\n" msgstr "Wcd: warning: Error al abrir la terminal, usando interfase stdout.\n" #: display.c:1257 msgid "Wcd: error: screen height must be larger than 3 lines.\n" msgstr "Wcd: error: la altura de la pantalla debe ser mayor de 3 lneas.\n" #: display.c:1291 graphics.c:2147 msgid "Wcd: error creating scroll window.\n" msgstr "Wcd: error al crear ventana deslizable.\n" #: display.c:1310 msgid "Wcd: error creating input window.\n" msgstr "Wcd: error al crear ventana de entrada.\n" #: display.c:1502 #, c-format msgid "" "\n" "Perfect " msgstr "" "\n" "Perfecta " #: display.c:1504 #, c-format msgid "" "\n" "Wild " msgstr "" "\n" "Inexacta " #: display.c:1505 #, c-format msgid "match for %lu directories.\n" msgstr "concordancia para %lu directorios.\n" #: display.c:1548 #, c-format msgid "" "\n" "Please choose one ( to abort): " msgstr "" "\n" "Favor de escoger uno ( para abortar): " #: graphics.c:279 #, c-format msgid "Wcd: error: line too long in function getTreeLine()" msgstr "Wcd: error: lnea demasiado larga en funcin getTreeLine()" #: graphics.c:1771 msgid "/ = search forward, ? = search backward, : = help" msgstr "/ = busca adelante, ? = busca atrs, : = ayuda" #: graphics.c:1776 msgid "SEARCH: " msgstr "BUSCA: " #: graphics.c:1779 msgid "Search: " msgstr "Busca: " #: graphics.c:1795 msgid "NAVIGATE MODE (1/2):" msgstr "MODO NAVEGACIN (1/2):" #: graphics.c:1796 msgid "h or go left." msgstr "h o ir a la izquierda." #: graphics.c:1797 msgid "j or go down." msgstr "j o ir hacia abajo." #: graphics.c:1798 msgid "k or go up." msgstr "k o ir hacia arriba." #: graphics.c:1799 msgid "l or go right." msgstr "l o ir a la derecha." #: graphics.c:1800 msgid "* or v or go forward to dir with same name." msgstr "* o v o ir hacia adelante al directorio con el mismo nombre." #: graphics.c:1801 msgid "# or p or go backward to dir with same name." msgstr "# o p o ir hacia atrs al directorio con el mismo nombre." #: graphics.c:1802 msgid "^ or a go to beginning of line." msgstr "^ o a ir al inicio de la lnea." #: graphics.c:1803 msgid "$ or e go to end of line." msgstr "$ o e ir al final de la lnea." #: graphics.c:1804 msgid "1 go to root dir." msgstr "1 ir al directorio raiz." #: graphics.c:1805 msgid "g or G go to last dir." msgstr "g o G ir al ltimo directorio." #: graphics.c:1806 msgid "f go page forward." msgstr "f avanzar pgina." #: graphics.c:1807 msgid "b go page backward." msgstr "b retroceder pgina." #: graphics.c:1808 msgid "u go half page up." msgstr "u avanzar media pgina." #: graphics.c:1809 msgid "d go half page down." msgstr "d retroceder media pgina." #: graphics.c:1816 msgid "NAVIGATE MODE (2/2):" msgstr "MODO NAVEGACIN (2/2):" #: graphics.c:1817 msgid "A switch alternative tree navigation on/off." msgstr "A enciende/apaga navegacin de rbol alternativa." #: graphics.c:1818 msgid "t switch centered mode on/off." msgstr "t enciende/apaga el modo centrado." #: graphics.c:1819 msgid "T toggle between line drawing and ASCII characters." msgstr "T intercambia entre grficas y caracteres ASCII." #: graphics.c:1820 msgid "m toggle between compact and wide tree." msgstr "m selecciona entre rbol compacto y expandido." #: graphics.c:1821 msgid " or q Abort." msgstr " o q Aborta." #: graphics.c:1822 msgid "/ Search forward." msgstr "/ Busca hacia adelante." #: graphics.c:1823 msgid "? Search backward." msgstr "? Busca hacia atrs." #: graphics.c:1824 msgid "n Repeat latest / or ? search." msgstr "n Repetir la ltima bsqueda / o ?." #: graphics.c:1825 graphics.c:1848 msgid " Select directory." msgstr " Selecciona directorio." #: graphics.c:1832 msgid "SEARCH MODE with wildcard and subdir support:" msgstr "MODO BUSQUEDA con soporte de comodines y subdirectorios:" #: graphics.c:1833 msgid " go left." msgstr " ir a la izquierda." #: graphics.c:1834 msgid " go down." msgstr " ir hacia abajo." #: graphics.c:1835 msgid " go up." msgstr " ir hacia arriba." #: graphics.c:1836 msgid " go right." msgstr " ir a la derecha." #: graphics.c:1837 msgid "CTRL-v go forward to dir with same name." msgstr "CTRL-v ir hacia delante al directorio con el mismo nombre." #: graphics.c:1838 msgid "CTRL-p go backward to dir with same name." msgstr "CTRL-p ir hacia atrs al directorio con el mismo nombre." #: graphics.c:1839 msgid "CTRL-a go to beginning of line." msgstr "CTRL-a ir al inicio de la lnea." #: graphics.c:1840 msgid "CTRL-e go to end of line." msgstr "CTRL-e ir al final de la lnea." #: graphics.c:1841 msgid "CTRL-g go to last dir." msgstr "CTRL-g ir al ltimo directorio." #: graphics.c:1842 msgid "CTRL-f go page forward." msgstr "CTRL-f avanzar pgina." #: graphics.c:1843 msgid "CTRL-b go page backward." msgstr "CTRL-b retroceder pgina." #: graphics.c:1844 msgid "CTRL-u go half page up." msgstr "CTRL-u avanzar media pgina." #: graphics.c:1845 msgid "CTRL-d go half page down." msgstr "CTRL-d retroceder media pgina." #: graphics.c:1846 msgid " or CTRL-x Abort SEARCH MODE." msgstr " o CTRL-x Abortar MODO BUSQUEDA." #: graphics.c:1847 msgid "CTRL-n Repeat latest / or ? search." msgstr "CTRL-n Repetir la ltima bsqueda / o ?." #: graphics.c:1855 msgid "ZOOMING:" msgstr "ZOOMING:" #: graphics.c:1856 msgid "z or i or CTRL-i zoom in." msgstr "z o i o CTRL-i acercamiento." #: graphics.c:1857 msgid "Z or o or CTRL-o zoom out." msgstr "Z o o o CTRL-o alejamiento." #: graphics.c:1858 msgid "c condense: fold current level." msgstr "c condensar: condensar nivel actual." #: graphics.c:1859 msgid "C condense: fold subdir level." msgstr "C condensar: condensar nivel del subdirectorio." #: graphics.c:1860 msgid "w condense: fold current and sub levels." msgstr "w condensar: condensar nivel actual y subdirectorios." #: graphics.c:1861 msgid "y or CTRL-y uncondense: unfold current and sub levels." msgstr "y o CTRL-y expandir: expandir nivel actual y subdirectorios." #: graphics.c:1862 msgid "r or CTRL-r uncondense: unfold all directories." msgstr "r o CTRL-r expandir: expandir todos los directorios." #: graphics.c:1863 msgid "- fold directory." msgstr "- abrir directorio." #: graphics.c:1864 msgid "+ or = unfold directory." msgstr "+ o = cerrar directorio." #: graphics.c:1865 msgid "l or unfold and go right." msgstr "l o cerrar e ir a la derecha." #: graphics.c:1869 msgid "Screenheight must be > 21 for help" msgstr "La altura de la pantalla debe ser > 21 para la ayuda" #: wfixpath.c:64 msgid "Wcd: malloc error in wcd_fixpath()\n" msgstr "Wcd: error de malloc en wcd_fixpath()\n" #: c3po/Error.c:40 #, c-format msgid "" "Wcd: error in '%s', no space left for allocation\n" "Wcd: Insufficient memory\n" msgstr "" "Wcd: error en '%s', no hay espacio para asignacin\n" "Wcd: Memoria insuficiente\n" wcd-5.2.4/src/po/fi.po0000644000175000010010000010065612207427111013732 0ustar waterlanNone# Finnish translations for wcd package. # Copyright (C) 2009-2013 Jari Aalto # This file is distributed under the same license as the wcd package. msgid "" msgstr "" "Project-Id-Version: wcd 5.2.4\n" "Report-Msgid-Bugs-To: \n" "POT-Creation-Date: 2013-08-20 21:42+0200\n" "PO-Revision-Date: 2009-09-06 13:36+0200\n" "Last-Translator: Jari Aalto \n" "Language-Team: Finnish\n" "Language: \n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" "Plural-Forms: nplurals=2; plural=(n != 1);\n" #: wcd.c:147 #, c-format msgid "Wcd: error: %s\n" msgstr "Wcd: virhe: %s\n" #: wcd.c:161 #, c-format msgid "Wcd: wcd_fopen: Opening file \"%s\" mode=%s quiet=%d\n" msgstr "Wcd: wcd_fopen: Tiedoston avaus \"%s\" %s quiet=%d\n" #: wcd.c:174 wcd.c:194 #, c-format msgid "Wcd: error: Unable to read file %s: %s\n" msgstr "Wcd: virhe: Ei oikeutta lukea tiedostosta %s: %s\n" #: wcd.c:183 #, c-format msgid "Wcd: error: Unable to read file %s: Not a regular file.\n" msgstr "Wcd: virhe: Ei voi lukea tiedostoa %s: ei epätavallinen tiedosto.\n" #: wcd.c:196 wcd.c:284 #, c-format msgid "Wcd: error: Unable to write file %s: %s\n" msgstr "Wcd: virhe: Ei oikeutta kirjoittaa tiedostoa %s: %s\n" #: wcd.c:199 #, c-format msgid "Wcd: wcd_fopen: Opening file \"%s\" OK.\n" msgstr "Wcd: wcd_fopen: Tiedoston avaus \"%s\" OK.\n" #: wcd.c:286 #, c-format msgid "Wcd: error: Unable to close file %s: %s\n" msgstr "Wcd: error: Tiedoston sulkeminen epäonnistui %s: %s\n" #: wcd.c:290 #, c-format msgid "Wcd: %sClosing file \"%s\" OK.\n" msgstr "Wcd: %sTiedosto suljettu \"%s\" OK.\n" #: wcd.c:629 wcd.c:642 #, c-format msgid "Wcd: %s added to file %s\n" msgstr "Wcd: %s lisätty tiedostoon %s\n" #: wcd.c:776 wcd.c:841 #, c-format msgid "Wcd: error: Unable to remove file %s: %s\n" msgstr "Wcd: virhe: Ei oikeutta poistaa tiedostoa %s: %s\n" #: wcd.c:929 wcd.c:997 #, c-format msgid "" "Wcd: error: finddirs(): can't determine path in directory %s\n" "Wcd: path probably too long.\n" msgstr "" "Wcd: virhe: finddirs(): polun määrittäminen ei onnistu hakemistossa %s\n" "Wcd: Polun pituus on todennäköisesti liian suuri.\n" #: wcd.c:1108 wcd.c:1433 #, c-format msgid "Wcd: %s is not a directory.\n" msgstr "Wcd: %s ei ole hakemisto.\n" #: wcd.c:1112 #, c-format msgid "Wcd: Please wait. Scanning disk. Building treedata-file %s from %s\n" msgstr "" "Wcd: Odota, kovalevyn skannaus käynnissä. Treedata-tiedoston %s rakentaminen " "lähteestä %s\n" #: wcd.c:1173 wcd.c:2375 wcd.c:2398 wcd.c:2477 #, c-format msgid "Wcd: Writing file \"%s\"\n" msgstr "Wcd: Tiedostoon kirjoitus \"%s\"\n" #: wcd.c:1178 msgid "" "Wcd: error: Write access to tree-file denied.\n" "Wcd: Set TEMP environment variable if this is a read-only disk.\n" msgstr "" "Wcd: virhe: Ei kirjoitusoikeuttaa tree-file tiedostoon.\n" "Wcd: Aseta ympäristömuuttuja TEMP eri paikkaan, jos kyseessä on " "kirjoitussuojattu levy.\n" #: wcd.c:1306 #, c-format msgid "Wcd: Removed symbolic link %s\n" msgstr "Wcd: Symolinen linkki tiedostoon poistettu %s\n" #: wcd.c:1312 #, c-format msgid "Wcd: error: Unable to remove symbolic link %s: %s\n" msgstr "Wcd: virhe: Ei oikeutta poistaa tiedoston symbolista linkkiä %s: %s\n" #: wcd.c:1316 #, c-format msgid "Wcd: %s is a symbolic link to a file.\n" msgstr "Wcd: %s on symbolinen linkki tiedostoon.\n" #: wcd.c:1398 #, c-format msgid "Wcd: Recursively remove %s Are you sure? y/n :" msgstr "Wcd: Recursiivisesti poista %s Oletko varma (yes/no)? y/n :" #: wcd.c:1419 wcd.c:1428 #, c-format msgid "Wcd: Removed directory %s\n" msgstr "Wcd: Hakemisto poistettu %s\n" #: wcd.c:1456 #, c-format msgid "" "Wcd: error: line too long in wcd_getline() ( > %d). The treefile could be " "corrupt, else fix by increasing DD_MAXPATH in source code.\n" msgstr "" "Wcd: virhe: liian pitkä rivi wcd_getline() ( > %d). Tiedosto treefile " "saattaa olla korruptoitunut, kasvata DD_MAXPATH kokoa lähdekoodissa.\n" #: wcd.c:1457 wcd.c:1517 wcd.c:1576 #, c-format msgid "Wcd: file: %s, line: %d," msgstr "Wcd: tiedosto: %s, rivi: %d," #: wcd.c:1464 wcd.c:1524 wcd.c:1583 #, c-format msgid " length: %d\n" msgstr "Wcd: pituus: %d\n" #: wcd.c:1516 #, c-format msgid "" "Wcd: error: line too long in wcd_wgetline() ( > %d). The treefile could be " "corrupt, else fix by increasing DD_MAXPATH in source code.\n" msgstr "" "Wcd: virhe: liian pitkä rivi wcd_wgetline() ( > %d). Tiedosto treefile " "saattaa olla korruptoitunut, kasvata DD_MAXPATH kokoa lähdekoodissa.\n" #: wcd.c:1575 #, c-format msgid "" "Wcd: error: line too long in wcd_wgetline_be() ( > %d). The treefile could " "be corrupt, else fix by increasing DD_MAXPATH in source code.\n" msgstr "" "Wcd: virhe: liian pitkä rivi wcd_wgetline_be() ( > %d). Tiedosto treefile " "saattaa olla korruptoitunut, kasvata DD_MAXPATH kokoa lähdekoodissa.\n" #: wcd.c:2086 #, c-format msgid "" "wcd %s (%s) - Wherever Change Directory\n" "Usage: wcd [options] [directory]\n" "\n" "directory: Name of directory to change to.\n" " Wildcards *, ? and [SET] are supported.\n" "\n" msgstr "" "wcd %s (%s) - Wherever Change Directory\n" "Käyttö: wcd [vaihtoehtoja] [hakemisto]\n" "\n" "hakemisto: hakemisotn nimi, johon siirtyä.\n" " Villikortit *, ? ja [] ovat tuettuja\n" "\n" #: wcd.c:2093 #, c-format msgid "" "options:\n" " -a Add current path to treefile\n" " -aa Add current and all parent paths to treefile\n" " -A PATH Add tree from PATH\n" " -b Ban current path\n" " -c, --direct-cd direct CD mode\n" " -d DRIVE set DRIVE for stack & go files (DOS)\n" " -e add current path to Extra treefile\n" " -ee add current and all parent paths to Extra " "treefile\n" " -E PATH add tree from PATH to Extra treefile\n" " -f FILE use extra treeFile\n" " +f FILE add extra treeFile\n" " -g Graphics\n" " -gd Graphics, dump tree\n" " -G PATH set PATH Go-script\n" " -GN, --no-go-script No Go-script\n" " -h, --help show this Help\n" msgstr "" "vaihtoehtoja:\n" " -a Lisää polku tiedostoon treefile\n" " -aa Lisään nykyinen ja kaikki polut yläpuolella " "tiedostoon treefile\n" " -A POLKU Lisää puuhierarkia POLKU\n" " -b Lisää polku mustalle listalle\n" " -c, --direct-cd Suora CD moodi\n" " -d ASEMA Aseta ASEMA toimintojen stack & go tiedostoille " "(DOS)\n" " -e Lisää polku tiedostoon Extra treefile\n" " -ee Lisää nykyinen ja kaikki polut yläpuolella " "tiedostoono Extra treefile\n" " -E POLKU Lisää puuhierarkia hakemistosta POLKU tiedostoon " "Extra treefile\n" " -f TIEDOSTO Käytä extra treeFile\n" " +f TIEDOSTO Lisää extra treeFile\n" " -g Graafinen moodi\n" " -gd Graafinen moodi, tulosta puuhierarkia\n" " -G POLKU Aseta go-tiedoston POLKU\n" " -GN, --no-go-script Poista go-tiedosto käytöstä\n" " -h, --help Näytä tämä Help\n" #: wcd.c:2112 #, c-format msgid "" " -i, --ignore-case Ignore case (default)\n" " +i, --no-ignore-case Regard case\n" msgstr "" " -i, --ignore-case Isot ja pienet kirjaimet - eivät merkityksellisiä " "(oletus)\n" " +i, --no-ignore-case Isot ja pienet kirjaimet - merkityksellisiä\n" #: wcd.c:2116 #, c-format msgid "" " -i, --ignore-case Ignore case\n" " +i, --no-ignore-case Regard case (default)\n" msgstr "" " -i, --ignore-case Isot ja pienet kirjaimet - eivät merkityksellisiä\n" " +i, --no-ignore-case Isot ja pienet kirjaimet - merkityksellisiä " "(oletus)\n" #: wcd.c:2121 #, c-format msgid "" " -I, --ignore-diacritics Ignore diacritics\n" " +I, --no-ignore-diacritics Regard diacritics (default)\n" " -j, --just-go Just go mode\n" " -k, --keep-paths Keep paths\n" " -K, --color Colors\n" " -l ALIAS aLias current directory\n" " -L, --license print software License\n" " -m DIR Make DIR, add to treefile\n" " -M DIR Make DIR, add to extra treefile\n" " -n PATH use relative treefile in PATH\n" " +n PATH add relative treefile in PATH\n" " -N, --numbers use Numbers\n" " -o use stdOut\n" " -od, --to-stdout dump matches\n" " -q, --quiet Quieter operation\n" " -r DIR Remove DIR\n" " -rmtree DIR Remove DIR recursive\n" " -s Scan disk from $HOME\n" " -S PATH Scan disk from PATH\n" " +S PATH Scan disk from PATH, create relative treefile\n" " -t Don't strip /tmp_mnt from paths\n" " -T, --ascii-tree Draw tree with ASCII characters\n" " -Ta, --alt-tree-nav Alternative tree navigation\n" " -TC, --center-tree Centered tree view\n" " -Tc, --compact-tree Compact tree\n" " -Td, --cjk-width support legacy CJK fonts\n" " -u USER use USER's treefile\n" " +u USER add USER's treefile\n" " -v, --verbose Verbose operation\n" " -V, --version print Version info\n" " -w, --wild-match-only Wild matching only\n" " -x PATH eXclude PATH during disk scan\n" " -xf FILE eXclude paths from FILE\n" " -y, --assume-yes assume Yes on all queries\n" " -z NUMBER set max stack siZe\n" " -[NUMBER] Push dir (NUMBER times)\n" " +[NUMBER] Pop dir (NUMBER times)\n" " = Show stack\n" msgstr "" " -I, --ignore-diacritics Ohita diakrittiset merkit\n" " +I, --no-ignore-diacritics Ota huomioon diakriittiset merkit (oletus)\n" " -j, --just-go Ainoastaan go-tieston moodi\n" " -k, --keep-paths Säilytä koko polku\n" " -K, --color Näytä värit\n" " -l ALIAS Määritä ALIAS nykyiselle polulle\n" " -L, --license Tulosta ohjelman lisenssi\n" " -m HAKEMISTO HAKEMISTO, lisää tiedostoon treefile\n" " -M HAKEMISTO HAKEMISTO, lisää tiedostoon extra treefile\n" " -n POLKU Käytä relatiivista treefile osoitetta POLUSSA\n" " +n POLKU Lisää relatiivinen treefile osoite POLKUUN\n" " -N, --numbers Käytä numerointia\n" " -o Käytä stdout\n" " -od, --to-stdout Tulosta esiintymät\n" " -q, --quiet Hiljainen moodi, ei viestejä\n" " -r HAKEMISTO Poista HAKEMISTO\n" " -rmtree HAKEM. Poista rekursiivisesti HAKEMISTO\n" " -s Skannaa levy, $HOME alaspäin\n" " -S POLKU Skannaa levy, POLKU alaspäin\n" " +S POLKU Skannaa levy, POLKU alaspäin, mutta käyttäen " "relatiivisia ositteita (treefile)\n" " -t Älä poista /tmp_mnt osoitetta polusta\n" " -T, --ascii-tree Esitä hakemistopuu ASCII-kirjaimin\n" " -Ta, --alt-tree-nav Vaihtoehtoinen navigointitapa\n" " -TC, --center-tree Keskitä näkymä\n" " -Tc, --compact-tree kompakti esitystapa\n" " -Td, --cjk-width Aktivoi tuki perinteisille CJK kirjasimille\n" " -u KÄYTTÄJÄ Käytä treefile: käyttäjätunnus\n" " +u KÄYTTÄJÄ Lisää treefile: käyttäjätunnus\n" " -v, --verbose Verbose moodi, lisää viestien määrää\n" " -V, --version Tulosta ohjelman versio\n" " -w, --wild-match-only Villkikorttihaku, etsi annetun säännön mukaan\n" " -y, --assume-yes Käytä oletusarvoa KYLLÄ kaikkiin kysymyksiin\n" " -x POLKU Jätä huomioimatta POLKU skannauksen aikana\n" " -xf TIEDOSTO Jätä huomioimatta kaikki polut, joktka on mainittu " "tiedostossa\n" " -z NUMERO Aseta pinon maksimikko: stack siZe\n" " -[NUMERO] Lisää hakemisto pinoon (NUMERO kertaa)\n" " +[NUMERO] Ota hakemisto pinosta (NUMERO kertaa)\n" " = Näitä pino: stackS\n" #: wcd.c:2168 wcd.c:2295 #, c-format msgid "wcd %s (%s) - Wherever Change Directory\n" msgstr "" "wcd %s (%s) - Wherever Change Directory, siirry mihin tahansa hakemistoon\n" #: wcd.c:2169 #, c-format msgid "" "Chdir for Dos and Unix.\n" "\n" msgstr "" "Hakemiston vaihto Dos and Unix -käyttöjärjestelmille.\n" "\n" #: wcd.c:2173 #, c-format msgid "DOS 16 bit version (WATCOMC).\n" msgstr "DOS 16 bit versio (WATCOMC).\n" #: wcd.c:2175 #, c-format msgid "DOS 16 bit version (TURBOC).\n" msgstr "DOS 16 bit versio (TURBOC).\n" #: wcd.c:2177 #, c-format msgid "DOS 32 bit version (DJGPP).\n" msgstr "DOS 32 bit versio (DJGPP).\n" #: wcd.c:2179 #, c-format msgid "DOS 32 bit version (WATCOMC).\n" msgstr "DOS 32 bit versio (WATCOMC).\n" #: wcd.c:2186 #, c-format msgid "Win64 version (MSVC %d).\n" msgstr "Win64 versio (MSVC %d).\n" #: wcd.c:2188 #, c-format msgid "Win64 version (MinGW-w64).\n" msgstr "Win64 versio (MinGW-w64).\n" #: wcd.c:2192 #, c-format msgid "Win32 version (WATCOMC).\n" msgstr "Win32 versio (WATCOMC).\n" #: wcd.c:2194 #, c-format msgid "Win32 version (MSVC %d).\n" msgstr "Win32 versio (MSVC %d).\n" #: wcd.c:2196 #, c-format msgid "Win32 version (MinGW).\n" msgstr "Win32 versio (MinGW).\n" #: wcd.c:2203 #, c-format msgid "This version is for MSYS and WinZsh.\n" msgstr "Tämä versio on tarkoitettu MSYS ja WinZsh käyttöön.\n" #: wcd.c:2205 #, c-format msgid "This version is for Windows PowerShell.\n" msgstr "Tämä versio on tarkoitettu Windows PowerShell käyttöön.\n" #: wcd.c:2207 #, c-format msgid "This version is for Windows Command Prompt (cmd.exe).\n" msgstr "Tämä ohjelma toimii vain Windowsin cmd.exe komentotulkissa.\n" #: wcd.c:2212 #, c-format msgid "OS/2 version" msgstr "OS/2 versio" #: wcd.c:2223 #, c-format msgid "This version is for native MSYS.\n" msgstr "Tämä versio on kotimainen MSYS.\n" #: wcd.c:2226 #, c-format msgid "Cygwin version.\n" msgstr "Cygwin versio.\n" #: wcd.c:2229 #, c-format msgid "This version is for DJGPP DOS bash.\n" msgstr "Tämä versio on tarkoitettu DJGPP DOS bash käyttöön.\n" #: wcd.c:2232 #, c-format msgid "This version is for OS/2 bash.\n" msgstr "Tämä version on OS/2 bash käyttöön.\n" #: wcd.c:2235 #, c-format msgid "Interface: " msgstr "Käyttöliittymä: " #: wcd.c:2237 #, c-format msgid "conio\n" msgstr "conio (konsoli)\n" #: wcd.c:2241 #, c-format msgid "ncurses version %s.%d\n" msgstr "ncurses tuella varustettu versio %s.%d\n" #: wcd.c:2244 #, c-format msgid "PDCurses build %d\n" msgstr "ncurses tuella varustettu versio %d\n" #: wcd.c:2246 #, c-format msgid "curses\n" msgstr "curses\n" #: wcd.c:2255 #, c-format msgid "stdout\n" msgstr "stdout (standardi ulostulo)\n" #: wcd.c:2259 #, c-format msgid "Native language support included.\n" msgstr "Kieliasetusten tuki sisäänrakennettu.\n" #: wcd.c:2260 #, c-format msgid "LOCALEDIR=%s\n" msgstr "LOCALEDIR=%s\n" #: wcd.c:2262 #, c-format msgid "No native language support included.\n" msgstr "Ei kieliasetusten tukea sisäänrakennettu.\n" #: wcd.c:2265 #, c-format msgid "Current locale uses CP%u encoding.\n" msgstr "Nykyinen lokaali käyttää CP%u koodaustapaa.\n" #: wcd.c:2267 #, c-format msgid "Current locale uses %s encoding.\n" msgstr "Nykyinen lokaali käyttää %s koodaustapaa.\n" #: wcd.c:2270 #, c-format msgid "With Unicode support.\n" msgstr "Unicode-kirjaimiston tuki sisäänrakennettu.\n" #: wcd.c:2275 #, c-format msgid " Euro symbol: " msgstr " Euro symboli: " #: wcd.c:2277 #, c-format msgid " Chinese characters: " msgstr " Kiinalaiset kirjaimet: " #: wcd.c:2281 #, c-format msgid "Without Unicode support.\n" msgstr "Ei Unicode-kirjaimiston tukea sisäänrakennettu.\n" #: wcd.c:2284 #, c-format msgid "With Unicode normalization.\n" msgstr "Unicode normalisointi käytössä.\n" #: wcd.c:2286 #, c-format msgid "Without Unicode normalization.\n" msgstr "Ilman unicode normalisointia.\n" #: wcd.c:2289 #, c-format msgid "Download the latest executables and sources from:\n" msgstr "Lataa viimeisin versio ohjelmasta ja sen lähdekoodista osoitteesta:\n" #: wcd.c:2290 #, c-format msgid "http://waterlan.home.xs4all.nl/\n" msgstr "http://waterlan.home.xs4all.nl/\n" #: wcd.c:2296 #, c-format msgid "" "Chdir for Dos and Unix.\n" "Copyright (C) 1997-2013 Erwin Waterlander\n" "Copyright (C) 1994-2002 Ondrej Popp on C3PO\n" "Copyright (C) 1995-1996 DJ Delorie on _fixpath()\n" "Copyright (C) 1995-1996 Borja Etxebarria & Olivier Sirol on Ninux Czo " "Directory\n" "Copyright (C) 1994-1996 Jason Mathews on DOSDIR\n" "Copyright (C) 1990-1992 Mark Adler, Richard B. Wales, Jean-loup Gailly,\n" "Kai Uwe Rommel and Igor Mandrichenko on recmatch()\n" "Source code to scan Windows LAN was originally written and placed\n" "in the public domain by Felix Kasza.\n" "Markus Kuhn's free wcwidth() implementation is used\n" "in Wcd for Windows.\n" "Rugxulo is the original author of query_con_codepage() (public domain).\n" "\n" "This program is free software; you can redistribute it and/or\n" "modify it under the terms of the GNU General Public License\n" "as published by the Free Software Foundation; either version 2\n" "of the License, or (at your option) any later version.\n" "\n" "This program is distributed in the hope that it will be useful,\n" "but WITHOUT ANY WARRANTY; without even the implied warranty of\n" "MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\n" "GNU General Public License for more details.\n" "\n" "You should have received a copy of the GNU General Public License\n" "along with this program; if not, write to the Free Software\n" "Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 " "USA.\n" msgstr "" #: wcd.c:2355 #, c-format msgid "Wcd: creating directory %s\n" msgstr "Wcd: Luodaan hakemisto %s\n" #: wcd.c:2682 msgid "Wcd: error: Value of environment variable WCDLOCALEDIR is too long.\n" msgstr "Wcd: virhe: Ympäristömuuttujan WCDLOCALEDIR arvo on liian pitkä.\n" #: wcd.c:2711 #, c-format msgid "Wcd: error: Failed to unset environment variable TERM: %s\n" msgstr "Wcd: error: Ympäristömuuttujan poistaminen epäonnistui TERM: %s\n" #: wcd.c:2722 msgid "Wcd: error: Value of environment variable HOME is too long.\n" msgstr "Wcd: virhe: Ympäristömuuttujan HOME arvo on liian pitkä.\n" #: wcd.c:2737 wcd.c:2805 msgid "" "Wcd: error: Value of environment variable HOME or WCDHOME is too long.\n" msgstr "" "Wcd: virhe: Ympäristömuuttujien HOME ja WCDHOME arvot ovat liian pitkät.\n" #: wcd.c:2769 wcd.c:2798 msgid "Wcd: error: Environment variable HOME or WCDHOME is not set.\n" msgstr "Wcd: virhe: Ympäristömuuttujaa HOME tai WCDHOME is ole asetettu.\n" #: wcd.c:2874 wcd.c:3356 wcd.c:3375 msgid "Wcd: error: Value of environment variable WCDUSERSHOME is too long.\n" msgstr "Wcd: virhe: Ympäristömuuttujan WCDUSERSHOME arvo on liian pitkä.\n" #: wcd.c:2983 #, c-format msgid "Wcd: HOME is not defined\n" msgstr "Wcd: HOME ympäristömuuttujaa ei ole asetettu\n" #: wcd.c:2985 #, c-format msgid "Wcd: HOME=\"%s\"\n" msgstr "" #: wcd.c:2987 #, c-format msgid "Wcd: WCDHOME is not defined\n" msgstr "" "Wcd: WCDHOME ympäristömuuttujaa ei ole asetettu\n" "\n" #: wcd.c:2989 #, c-format msgid "Wcd: WCDHOME=\"%s\"\n" msgstr "" #: wcd.c:2991 #, c-format msgid "Wcd: WCDSCAN is not defined\n" msgstr "" "Wcd: WCDSCAN ympäristömuuttujaa ei ole asetettu\n" "\n" #: wcd.c:3016 msgid "Wcd: Graphics mode only supported in wcd with curses based interface.\n" msgstr "" "Wcd: Graffinen moodi tuettu ainoastaan ohjelman curses-kirjaston " "versioissa.\n" #: wcd.c:3043 #, c-format msgid "Wcd: use_GoScript = 0\n" msgstr "" #: wcd.c:3289 #, c-format msgid "Wcd: %s added to aliasfile %s\n" msgstr "Wcd: %s lisätty tiedostoon %s\n" #: wcd.c:3388 #, c-format msgid "Wcd: error: Unable to read file %s or %s\n" msgstr "Wcd: virhe: Ei oikeutta lukea tiedostoa %s tai %s\n" #: wcd.c:3538 #, c-format msgid "Wcd: WCDSCAN directory {%s}\n" msgstr "Wcd: WCDSCAN hakemisto {%s}\n" #: wcd.c:3540 #, c-format msgid "Wcd: banning {%s}\n" msgstr "Wcd: asetettu mustalle listalle {%s}\n" #: wcd.c:3542 #, c-format msgid "Wcd: excluding {%s}\n" msgstr "Wcd: jätetään ottamasta huomioon {%s}\n" #: wcd.c:3544 #, c-format msgid "Wcd: filtering {%s}\n" msgstr "Wcd: filteroidaan {%s}\n" #: wcd.c:3811 #, c-format msgid "" "Wcd: No directory found matching %s\n" "Wcd: Perhaps you need to rescan the disk or path is banned.\n" msgstr "" "Wcd: Ei hakemistoa kriteerillä %s\n" "Wcd: Mahdollisesti levy tulee skannata uudelleen tai hakemisto on mustalla " "listalla\n" #: wcd.c:3977 #, c-format msgid "Wcd: Cannot change to %s\n" msgstr "Wcd: Ei voi vaihtaa hakemistoon %s\n" #: wcddir.c:104 #, c-format msgid "Wcd: Error %lu (\"%s\") reported by \"%s\".\n" msgstr "Wcd: virhe %lu (\"%s\") reported by \"%s\".\n" #: wcddir.c:127 #, c-format msgid "Wcd: access denied.\n" msgstr "Wcd: Ei oikeuksia.\n" #: wcddir.c:208 #, c-format msgid "Wcd: Searching for shared directories on server %s\n" msgstr "Wcd: Etsitään jaettuja hakemistoja palvelimelta %s\n" #: wcddir.c:220 #, c-format msgid "Wcd: Found %lu shared directories on server %s\n" msgstr "Wcd: Köydetty %lu hakemistoa palvelimelta %s\n" #: wcddir.c:314 msgid "Wcd: error: wcd_islink: " msgstr "Wcd: error: wcd_islink: " #: wcddir.c:346 msgid "Wcd: error: Unable to get current working directory: " msgstr "Wcd: virhe: Nykyisen hakemiston sijaintia ei voi lukea: " #: wcddir.c:374 #, c-format msgid "Wcd: error: Unable to change to directory %s: " msgstr "Wcd: virhe: Ei voi siirtyä hakemistoon %s: " #: wcddir.c:405 #, c-format msgid "Wcd: error: Unable to create directory %s: " msgstr "Wcd: virhe: Ei oikeutta poistaa tiedostoa %s: " #: wcddir.c:434 #, c-format msgid "Wcd: error: Unable to remove directory %s: " msgstr "Wcd: virhe: Ei oikeutta poistaa hakemistoa %s: " #: wcddir.c:564 wcddir.c:581 #, c-format msgid "Wcd: error: Unable to create directory %s: %s\n" msgstr "Wcd: virhe: Ei oikeutta poistaa tiedostoa %s: %s\n" #: wcddir.c:706 #, c-format msgid "Wcd: error: Unable to get current working directory: %s\n" msgstr "Wcd: virhe: Nykyisen hakemiston sijaintia ei voi lukea: %s\n" #: wcddir.c:725 #, c-format msgid "Wcd: error: Unable to change to directory %s: %s\n" msgstr "Wcd: virhe: Ei voi siirtyä hakemistoon %s: %s\n" #: wcddir.c:740 #, c-format msgid "Wcd: error: Unable to remove directory %s: %s\n" msgstr "Wcd: virhe: Ei oikeutta poistaa hakemistoa %s: %s\n" #: stack.c:101 msgid "Wcd: Error parsing stack\n" msgstr "Wcd: Error parsing stack\n" #: display.c:257 msgid "Wcd: error in maxLength(), list == NULL\n" msgstr "Wcd: error in maxLength(), list == NULL\n" #: display.c:277 msgid "Wcd: error in maxLengthStack(), s == NULL\n" msgstr "Wcd: error in maxLengthStack(), s == NULL\n" #: display.c:1129 msgid "Perfect " msgstr "Ok " #: display.c:1131 msgid "Wild " msgstr "Villi " #: display.c:1132 #, c-format msgid "match for %d directories." msgstr "osumaa %d hakemistossa." #: display.c:1137 #, c-format msgid " w=up x=down ?=help Page %d/%d " msgstr " w=yläs x=alas ?=help Sivu %d/%d " #: display.c:1144 display.c:1506 #, c-format msgid "Please choose one ( to abort): " msgstr "Valitse toiminta ( keskeytys): " #: display.c:1160 msgid "Screenheight must be > 20 for help." msgstr "" "Help-ikkunan avaaminen ei onnistu. Ikkunan korkeuden tulee olla > 20 riviä." #: display.c:1163 msgid "w or Page Up." msgstr "w tai Sivu ylös." #: display.c:1164 msgid "x or z or Page Down." msgstr "x tai z tai Sivu alas." #: display.c:1165 msgid ", or Scroll 1 left." msgstr ", tai Vieritys 1 vasemmalle." #: display.c:1166 msgid ". or Scroll 1 right." msgstr ". tai Vieritys 1 oikealle." #: display.c:1167 msgid "< or [ Scroll 10 left." msgstr "< tai [ Vieritys 10 vasemmalle." #: display.c:1168 msgid "> or ] Scroll 10 right." msgstr "> tai ] Vieritys 10 oikealle." #: display.c:1169 msgid "CTRL-a or Scroll to beginning." msgstr "CTRL-a tai Sivun alkuun." #: display.c:1170 msgid "CTRL-e or Scroll to end." msgstr "CTRL-e tai Sivun loppuun." #: display.c:1171 msgid "CTRL-c or Abort." msgstr "CTRL-c tai Keskeytys." #: display.c:1172 msgid " Abort." msgstr " Keskeytys." #: display.c:1173 graphics.c:1810 graphics.c:1826 graphics.c:1849 #: graphics.c:1866 msgid "Press any key." msgstr "Paina jotakin näppäintä." #: display.c:1236 graphics.c:2114 msgid "" "Wcd: warning: Error opening terminal, falling back to stdout interface.\n" msgstr "" "Wcd: varoitus: Terminaalin avaus ei onnistu, käytössä vain stdout.\n" "komentorivi.\n" #: display.c:1257 msgid "Wcd: error: screen height must be larger than 3 lines.\n" msgstr "Wcd: virhe: terminaalin korkeus ei ole vähintään 3 riviä.\n" #: display.c:1291 graphics.c:2147 msgid "Wcd: error creating scroll window.\n" msgstr "Wcd: virhe: vierityspalkin luonti ei onnistu ikkunaan.\n" #: display.c:1310 msgid "Wcd: error creating input window.\n" msgstr "Wcd: virhe: syötteen ikkunaa ei voi luoda.\n" #: display.c:1502 #, c-format msgid "" "\n" "Perfect " msgstr "" "\n" "Ok " #: display.c:1504 #, c-format msgid "" "\n" "Wild " msgstr "" "\n" "Villi " #: display.c:1505 #, c-format msgid "match for %lu directories.\n" msgstr "osumaa %lu hakemistosta.\n" #: display.c:1548 #, c-format msgid "" "\n" "Please choose one ( to abort): " msgstr "" "\n" "Valitse ( keskeytys): " #: graphics.c:279 #, c-format msgid "Wcd: error: line too long in function getTreeLine()" msgstr "Wcd: error: line too long in function getTreeLine()" #: graphics.c:1771 msgid "/ = search forward, ? = search backward, : = help" msgstr "/ = etsi eteenpäin, ? = etsi taaksepäin, : = help" #: graphics.c:1776 msgid "SEARCH: " msgstr "HAKU: " #: graphics.c:1779 msgid "Search: " msgstr "Haku: " #: graphics.c:1795 msgid "NAVIGATE MODE (1/2):" msgstr "NAVIGOINTIMOODI (1/2):" #: graphics.c:1796 msgid "h or go left." msgstr "h tai vasemmalle." #: graphics.c:1797 msgid "j or go down." msgstr "j tai alas." #: graphics.c:1798 msgid "k or go up." msgstr "k tai ylös." #: graphics.c:1799 msgid "l or go right." msgstr "l tai oikealle." #: graphics.c:1800 msgid "* or v or go forward to dir with same name." msgstr "* tai v tai siirry forward to dir with same name." #: graphics.c:1801 msgid "# or p or go backward to dir with same name." msgstr "# tai p tai taaksepäin samannimiseen hakemistoon." #: graphics.c:1802 msgid "^ or a go to beginning of line." msgstr "^ tai a rivin alkuun." #: graphics.c:1803 msgid "$ or e go to end of line." msgstr "$ tai e rivin loppuun." #: graphics.c:1804 msgid "1 go to root dir." msgstr "1 siirry juurihakemistoon." #: graphics.c:1805 msgid "g or G go to last dir." msgstr "g tai G siirry viimeiseen hakemistoon." #: graphics.c:1806 msgid "f go page forward." msgstr "f sivu alas." #: graphics.c:1807 msgid "b go page backward." msgstr "b sivu ylös." #: graphics.c:1808 msgid "u go half page up." msgstr "u puolisivua ylös." #: graphics.c:1809 msgid "d go half page down." msgstr "d puolisivua alas." #: graphics.c:1816 msgid "NAVIGATE MODE (2/2):" msgstr "NAVIGOINTIMOODI (2/2):" #: graphics.c:1817 msgid "A switch alternative tree navigation on/off." msgstr "A Vaihtoehtoinen navigointitapa päälle/pois." #: graphics.c:1818 msgid "t switch centered mode on/off." msgstr "t Keskitetty moodi päälle/pois." #: graphics.c:1819 msgid "T toggle between line drawing and ASCII characters." msgstr "T kytke viivanpiirto ASCII kirjaimin päälle/pois." #: graphics.c:1820 msgid "m toggle between compact and wide tree." msgstr "m Vaihda kompaktin ja tavallisen esitystavan välillä." #: graphics.c:1821 msgid " or q Abort." msgstr " tai q Keskeytä." #: graphics.c:1822 msgid "/ Search forward." msgstr "/ haku eteenpäin." #: graphics.c:1823 msgid "? Search backward." msgstr "? haku taaksepäin." #: graphics.c:1824 msgid "n Repeat latest / or ? search." msgstr "n Toista viimeisen / tai ? etsintä." #: graphics.c:1825 graphics.c:1848 msgid " Select directory." msgstr " valitse hakemisto." #: graphics.c:1832 msgid "SEARCH MODE with wildcard and subdir support:" msgstr "HAKUMOODI villikorttien ja alihakemistojen tuki:" #: graphics.c:1833 msgid " go left." msgstr " vasemmalle." #: graphics.c:1834 msgid " go down." msgstr " siirry alas." #: graphics.c:1835 msgid " go up." msgstr " ylös." #: graphics.c:1836 msgid " go right." msgstr " oikealle." #: graphics.c:1837 msgid "CTRL-v go forward to dir with same name." msgstr "CTRL-v Seuraava hakemisto samalla nimellä." #: graphics.c:1838 msgid "CTRL-p go backward to dir with same name." msgstr "CTRL-p edellinen hakemisto samalla nimellä." #: graphics.c:1839 msgid "CTRL-a go to beginning of line." msgstr "CTRL-a rivin alkuun." #: graphics.c:1840 msgid "CTRL-e go to end of line." msgstr "CTRL-e rivin loppuun." #: graphics.c:1841 msgid "CTRL-g go to last dir." msgstr "CTRL-g siirry viimeiseen hakemistoon." #: graphics.c:1842 msgid "CTRL-f go page forward." msgstr "CTRL-f sivu alas." #: graphics.c:1843 msgid "CTRL-b go page backward." msgstr "CTRL-b sivu ylös." #: graphics.c:1844 msgid "CTRL-u go half page up." msgstr "CTRL-u puolisivua ylös." #: graphics.c:1845 msgid "CTRL-d go half page down." msgstr "CTRL-d puolisivua alas." #: graphics.c:1846 msgid " or CTRL-x Abort SEARCH MODE." msgstr " tai CTRL-x Keskeytä HAKUMOODI." #: graphics.c:1847 msgid "CTRL-n Repeat latest / or ? search." msgstr "CTRL-n Toista viimeisin / tai ? etsintä." #: graphics.c:1855 msgid "ZOOMING:" msgstr "ZOOMAUS:" #: graphics.c:1856 msgid "z or i or CTRL-i zoom in." msgstr "z tai i tai CTRL-i zoom sisään." #: graphics.c:1857 msgid "Z or o or CTRL-o zoom out." msgstr "Z tai o tai CTRL-o zoom ulos." #: graphics.c:1858 msgid "c condense: fold current level." msgstr "c näkymä: tiivistä nykyinen taso." #: graphics.c:1859 msgid "C condense: fold subdir level." msgstr "C näkymä: tiivistä alihakemiston taso." #: graphics.c:1860 msgid "w condense: fold current and sub levels." msgstr "w näkymä: tiivistä nykyinen ja kaikki alitasot." #: graphics.c:1861 msgid "y or CTRL-y uncondense: unfold current and sub levels." msgstr "y tai CTRL-y näkymä: avaa nykinen ja alitasot." #: graphics.c:1862 msgid "r or CTRL-r uncondense: unfold all directories." msgstr "r tai CTRL-r näkymä: avaa kaikki hakemistot." #: graphics.c:1863 msgid "- fold directory." msgstr "- näkymä: tiivistä hakemisto." #: graphics.c:1864 msgid "+ or = unfold directory." msgstr "+ tai = näkymä: avaa hakemisto." #: graphics.c:1865 msgid "l or unfold and go right." msgstr "l tai näkymä: avaa ja siirry oikealle." #: graphics.c:1869 msgid "Screenheight must be > 21 for help" msgstr "" "Help-ikkunan avaaminen ei onnistu. Ikkunan korkeuden tulee olla > 21 riviä" #: wfixpath.c:64 msgid "Wcd: malloc error in wcd_fixpath()\n" msgstr "Wcd: malloc virhe funktiossa wcd_fixpath()\n" #: c3po/Error.c:40 #, c-format msgid "" "Wcd: error in '%s', no space left for allocation\n" "Wcd: Insufficient memory\n" msgstr "" "Wcd: virhe kohdassa '%s', muistin varaus ei onnistu\n" "Wcd: Riitämätön määrä muistia\n" wcd-5.2.4/src/po/nl.po0000644000175000010010000007565612207427110013757 0ustar waterlanNone# Dutch translations for wcd package. # Copyright (C) 2008-2013 THE wcd'S COPYRIGHT HOLDER # This file is distributed under the same license as the wcd package. # Erwin Waterlander , 2008-2013. # msgid "" msgstr "" "Project-Id-Version: wcd 5.2.4\n" "Report-Msgid-Bugs-To: \n" "POT-Creation-Date: 2013-08-20 21:42+0200\n" "PO-Revision-Date: 2008-06-01 17:57+0200\n" "Last-Translator: Erwin Waterlander \n" "Language-Team: Dutch \n" "Language: nl\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=ISO-8859-1\n" "Content-Transfer-Encoding: 8bit\n" "Plural-Forms: nplurals=2; plural=(n != 1);\n" #: wcd.c:147 #, c-format msgid "Wcd: error: %s\n" msgstr "Wcd: Fout: %s\n" #: wcd.c:161 #, c-format msgid "Wcd: wcd_fopen: Opening file \"%s\" mode=%s quiet=%d\n" msgstr "Wcd: wcd_fopen: Openen bestand \"%s\" %s quiet=%d\n" #: wcd.c:174 wcd.c:194 #, c-format msgid "Wcd: error: Unable to read file %s: %s\n" msgstr "Wcd: fout: Kan bestand %s niet lezen: %s\n" #: wcd.c:183 #, c-format msgid "Wcd: error: Unable to read file %s: Not a regular file.\n" msgstr "Wcd: fout: Kan bestand %s niet lezen: Geen regulier bestand.\n" #: wcd.c:196 wcd.c:284 #, c-format msgid "Wcd: error: Unable to write file %s: %s\n" msgstr "Wcd: fout: Kan bestand %s niet schrijven: %s\n" #: wcd.c:199 #, c-format msgid "Wcd: wcd_fopen: Opening file \"%s\" OK.\n" msgstr "Wcd: wcd_fopen: Openen bestand \"%s\" Ok\n" #: wcd.c:286 #, c-format msgid "Wcd: error: Unable to close file %s: %s\n" msgstr "Wcd: fout: Kan bestand %s niet sluiten: %s\n" #: wcd.c:290 #, c-format msgid "Wcd: %sClosing file \"%s\" OK.\n" msgstr "Wcd: %sSluiten bestand \"%s\" Ok.\n" #: wcd.c:629 wcd.c:642 #, c-format msgid "Wcd: %s added to file %s\n" msgstr "Wcd: %s toegevoegd aan bestand %s\n" #: wcd.c:776 wcd.c:841 #, c-format msgid "Wcd: error: Unable to remove file %s: %s\n" msgstr "Wcd: fout: Kan bestand %s niet verwijderen: %s\n" #: wcd.c:929 wcd.c:997 #, c-format msgid "" "Wcd: error: finddirs(): can't determine path in directory %s\n" "Wcd: path probably too long.\n" msgstr "" "Wcd: fout: finddirs(): kan pad in map %s niet bepalen\n" "Wcd: pad is waarschijnlijk te lang.\n" #: wcd.c:1108 wcd.c:1433 #, c-format msgid "Wcd: %s is not a directory.\n" msgstr "Wcd: %s is geen map.\n" #: wcd.c:1112 #, c-format msgid "Wcd: Please wait. Scanning disk. Building treedata-file %s from %s\n" msgstr "" "Wcd: Even wachten aub. Aftasten schijf. Boom-bestand %s wordt gebouwd vanaf " "%s\n" #: wcd.c:1173 wcd.c:2375 wcd.c:2398 wcd.c:2477 #, c-format msgid "Wcd: Writing file \"%s\"\n" msgstr "Wcd: Schrijven bestand \"%s\"\n" #: wcd.c:1178 msgid "" "Wcd: error: Write access to tree-file denied.\n" "Wcd: Set TEMP environment variable if this is a read-only disk.\n" msgstr "" "Wcd: fout: Schrijftoegang tot boom-bestand geweigerd.\n" "Wcd: Definieer TEMP omgevingsvariabele wanneer dit een alleen-lezen schijf " "is.\n" #: wcd.c:1306 #, c-format msgid "Wcd: Removed symbolic link %s\n" msgstr "Wcd: Symbolische koppeling %s verwijderd.\n" #: wcd.c:1312 #, c-format msgid "Wcd: error: Unable to remove symbolic link %s: %s\n" msgstr "Wcd: fout: Kan symbolische koppeling %s niet verwijderen: %s\n" #: wcd.c:1316 #, c-format msgid "Wcd: %s is a symbolic link to a file.\n" msgstr "Wcd: %s is een symbolische koppeling naar een bestand.\n" #: wcd.c:1398 #, c-format msgid "Wcd: Recursively remove %s Are you sure? y/n :" msgstr "Wcd: Recursief %s verwijderen Weet u het zeker? y(ja)/n(nee) :" #: wcd.c:1419 wcd.c:1428 #, c-format msgid "Wcd: Removed directory %s\n" msgstr "Wcd: Map %s verwijderd.\n" #: wcd.c:1456 #, c-format msgid "" "Wcd: error: line too long in wcd_getline() ( > %d). The treefile could be " "corrupt, else fix by increasing DD_MAXPATH in source code.\n" msgstr "" "Wcd: fout: regel te lang in wcd_getline() ( > %d). Het boombestand kan " "beschadigd zijn, anders oplossen door DD_MAXPATH in broncode te verhogen.\n" #: wcd.c:1457 wcd.c:1517 wcd.c:1576 #, c-format msgid "Wcd: file: %s, line: %d," msgstr "Wcd: bestand: %s, regel: %d," #: wcd.c:1464 wcd.c:1524 wcd.c:1583 #, c-format msgid " length: %d\n" msgstr " lengte: %d\n" #: wcd.c:1516 #, c-format msgid "" "Wcd: error: line too long in wcd_wgetline() ( > %d). The treefile could be " "corrupt, else fix by increasing DD_MAXPATH in source code.\n" msgstr "" "Wcd: fout: regel te lang in wcd_wgetline() ( > %d). Het boombestand " "kanbeschadigd zijn, anders oplossen door DD_MAXPATH in broncode te " "verhogen.\n" #: wcd.c:1575 #, c-format msgid "" "Wcd: error: line too long in wcd_wgetline_be() ( > %d). The treefile could " "be corrupt, else fix by increasing DD_MAXPATH in source code.\n" msgstr "" "Wcd: fout: regel te lang in wcd_wgetline_be() ( > %d). Het boombestand " "kanbeschadigd zijn, anders oplossen door DD_MAXPATH in broncode te " "verhogen.\n" #: wcd.c:2086 #, c-format msgid "" "wcd %s (%s) - Wherever Change Directory\n" "Usage: wcd [options] [directory]\n" "\n" "directory: Name of directory to change to.\n" " Wildcards *, ? and [SET] are supported.\n" "\n" msgstr "" "wcd %s (%s) - Wherever Change Directory\n" "Gebruik: wcd [opties] [map]\n" "\n" "map: Naam van map waarnaar te veranderen.\n" " Jokertekens *, ? en [SET] worden ondersteund.\n" "\n" #: wcd.c:2093 #, c-format msgid "" "options:\n" " -a Add current path to treefile\n" " -aa Add current and all parent paths to treefile\n" " -A PATH Add tree from PATH\n" " -b Ban current path\n" " -c, --direct-cd direct CD mode\n" " -d DRIVE set DRIVE for stack & go files (DOS)\n" " -e add current path to Extra treefile\n" " -ee add current and all parent paths to Extra " "treefile\n" " -E PATH add tree from PATH to Extra treefile\n" " -f FILE use extra treeFile\n" " +f FILE add extra treeFile\n" " -g Graphics\n" " -gd Graphics, dump tree\n" " -G PATH set PATH Go-script\n" " -GN, --no-go-script No Go-script\n" " -h, --help show this Help\n" msgstr "" "opties:\n" " -a Voeg huidig pad toe aan boombestand\n" " -aa Voeg huidig en alle hogere paden toe aan " "boombestand\n" " -A PAD Voeg boom toe vanaf PAD\n" " -b Verban huidig pad\n" " -c, --direct-cd direkt CD modus\n" " -d STATION stel STATION voor stapel & go bestanden in (DOS)\n" " -e voeg huidig pad toe aan Extra boombestand\n" " -ee voeg huidig en alle hogere paden toe aan Extra " "boombestand\n" " -E PAD voeg boom vanaf PAD toe aan Extra boombestand\n" " -f BESTAND gebruik extra boombestand\n" " +f BESTAND voeg extra boombestand toe\n" " -g Grafisch\n" " -gd Grafisch, dump boom\n" " -G PAD stel PAD Go-script in\n" " -GN, --no-go-script Geen Go-script\n" " -h, --help laat deze Help zien\n" #: wcd.c:2112 #, c-format msgid "" " -i, --ignore-case Ignore case (default)\n" " +i, --no-ignore-case Regard case\n" msgstr "" " -i, --ignore-case Hoofdletterongevoelig (standaard)\n" " +i, --no-ignore-case Hoofdlettergevoelig\n" #: wcd.c:2116 #, c-format msgid "" " -i, --ignore-case Ignore case\n" " +i, --no-ignore-case Regard case (default)\n" msgstr "" " -i, --ignore-case Hoofdletterongevoelig\n" " +i, --no-ignore-case Hoofdlettergevoelig (standaard)\n" #: wcd.c:2121 #, c-format msgid "" " -I, --ignore-diacritics Ignore diacritics\n" " +I, --no-ignore-diacritics Regard diacritics (default)\n" " -j, --just-go Just go mode\n" " -k, --keep-paths Keep paths\n" " -K, --color Colors\n" " -l ALIAS aLias current directory\n" " -L, --license print software License\n" " -m DIR Make DIR, add to treefile\n" " -M DIR Make DIR, add to extra treefile\n" " -n PATH use relative treefile in PATH\n" " +n PATH add relative treefile in PATH\n" " -N, --numbers use Numbers\n" " -o use stdOut\n" " -od, --to-stdout dump matches\n" " -q, --quiet Quieter operation\n" " -r DIR Remove DIR\n" " -rmtree DIR Remove DIR recursive\n" " -s Scan disk from $HOME\n" " -S PATH Scan disk from PATH\n" " +S PATH Scan disk from PATH, create relative treefile\n" " -t Don't strip /tmp_mnt from paths\n" " -T, --ascii-tree Draw tree with ASCII characters\n" " -Ta, --alt-tree-nav Alternative tree navigation\n" " -TC, --center-tree Centered tree view\n" " -Tc, --compact-tree Compact tree\n" " -Td, --cjk-width support legacy CJK fonts\n" " -u USER use USER's treefile\n" " +u USER add USER's treefile\n" " -v, --verbose Verbose operation\n" " -V, --version print Version info\n" " -w, --wild-match-only Wild matching only\n" " -x PATH eXclude PATH during disk scan\n" " -xf FILE eXclude paths from FILE\n" " -y, --assume-yes assume Yes on all queries\n" " -z NUMBER set max stack siZe\n" " -[NUMBER] Push dir (NUMBER times)\n" " +[NUMBER] Pop dir (NUMBER times)\n" " = Show stack\n" msgstr "" " -I, --ignore-diacritics Diakritische tekens negeren\n" " +I, --no-ignore-diacritics Diakritische tekens achten (standaard)\n" " -j, --just-go Ga nou maar modus\n" " -k, --keep-paths Bewaar paden\n" " -K, --color Kleuren\n" " -l ALIAS aLias huidige map\n" " -L, --license print software Licentie\n" " -m MAP Maak MAP, voeg toe aan boombestand\n" " -M MAP Maak MAP, voeg toe aan extra boombestand\n" " -n PAD gebruik relatief boombestand in PAD\n" " +n PAD voeg relatief boombestand in PAD toe\n" " -N, --numbers gebruik Nummers\n" " -o gebruik stdOut\n" " -od, --to-stdout dump treffers\n" " -q, --quiet stillere werking\n" " -r MAP Verwijder MAP\n" " -rmtree MAP Verwijder MAP recursief\n" " -s Aftasten schijf vanaf $HOME\n" " -S PAD Aftasten schijf vanaf PAD\n" " +S PAD Aftasten schijf vanaf PAD, maak relatief " "boombestand\n" " -t Paden niet van /tmp_mnt ontdoen\n" " -T, --ascii-tree Teken boom met ASCII tekens\n" " -Ta, --alt-tree-nav Alternatieve boom navigatie\n" " -TC, --center-tree Gecentreerde boomweergave\n" " -Tc, --compact-tree Compacte boom\n" " -Td, --cjk-width ondersteun oude CJK lettertypes\n" " -u GEBRUIKER gebruik boombestand van GEBRUIKER\n" " +u GEBRUIKER voeg boombestand van GEBRUIKER toe\n" " -v, --verbose woordenrijke werking\n" " -V, --version print Versie informatie\n" " -w, --wild-match-only Alleen joker vergelijkingen\n" " -x PAD uitsluiten PAD tijdens aftasten schijf\n" " -xf BESTAND uitsluiten paden uit BESTAND\n" " -z NUMMER stel max stapel grootte in\n" " -y, --assume-yes veronderstel Ja op alle vragen\n" " -[NUMMER] Voeg map toe aan stapel (NUMMER keer)\n" " +[NUMMER] Haal map van stapel (NUMMER keer)\n" " = Laat stapel zien\n" #: wcd.c:2168 wcd.c:2295 #, c-format msgid "wcd %s (%s) - Wherever Change Directory\n" msgstr "" #: wcd.c:2169 #, c-format msgid "" "Chdir for Dos and Unix.\n" "\n" msgstr "" "Chdir voor Dos en Unix.\n" "\n" #: wcd.c:2173 #, c-format msgid "DOS 16 bit version (WATCOMC).\n" msgstr "DOS 16 bit versie (WATCOMC).\n" #: wcd.c:2175 #, c-format msgid "DOS 16 bit version (TURBOC).\n" msgstr "DOS 16 bit versie (TURBOC).\n" #: wcd.c:2177 #, c-format msgid "DOS 32 bit version (DJGPP).\n" msgstr "DOS 32 bit versie (DJGPP).\n" #: wcd.c:2179 #, c-format msgid "DOS 32 bit version (WATCOMC).\n" msgstr "DOS 32 bit versie (WATCOMC).\n" #: wcd.c:2186 #, c-format msgid "Win64 version (MSVC %d).\n" msgstr "Win64 versie (MSVC %d).\n" #: wcd.c:2188 #, c-format msgid "Win64 version (MinGW-w64).\n" msgstr "Win64 versie (MinGW-w64).\n" #: wcd.c:2192 #, c-format msgid "Win32 version (WATCOMC).\n" msgstr "Win32 versie (WATCOMC).\n" #: wcd.c:2194 #, c-format msgid "Win32 version (MSVC %d).\n" msgstr "Win32 versie (MSVC %d).\n" #: wcd.c:2196 #, c-format msgid "Win32 version (MinGW).\n" msgstr "Win32 versie (MinGW).\n" #: wcd.c:2203 #, c-format msgid "This version is for MSYS and WinZsh.\n" msgstr "Deze versie is voor MSYS en WinZsh.\n" #: wcd.c:2205 #, c-format msgid "This version is for Windows PowerShell.\n" msgstr "Deze versie is voor Windows PowerShell.\n" #: wcd.c:2207 #, c-format msgid "This version is for Windows Command Prompt (cmd.exe).\n" msgstr "Deze versie is voor Windows Opdrachtprompt (cmd.exe).\n" #: wcd.c:2212 #, c-format msgid "OS/2 version" msgstr "OS/2 versie" #: wcd.c:2223 #, c-format msgid "This version is for native MSYS.\n" msgstr "Deze versie is voor MSYS.\n" #: wcd.c:2226 #, c-format msgid "Cygwin version.\n" msgstr "Cygwin versie.\n" #: wcd.c:2229 #, c-format msgid "This version is for DJGPP DOS bash.\n" msgstr "Deze versie is voor DJGPP DOS bash.\n" #: wcd.c:2232 #, c-format msgid "This version is for OS/2 bash.\n" msgstr "Deze versie is voor OS/2 bash.\n" #: wcd.c:2235 #, c-format msgid "Interface: " msgstr "" #: wcd.c:2237 #, c-format msgid "conio\n" msgstr "" #: wcd.c:2241 #, c-format msgid "ncurses version %s.%d\n" msgstr "ncurses versie %s.%d\n" #: wcd.c:2244 #, c-format msgid "PDCurses build %d\n" msgstr "" #: wcd.c:2246 #, c-format msgid "curses\n" msgstr "" #: wcd.c:2255 #, c-format msgid "stdout\n" msgstr "" #: wcd.c:2259 #, c-format msgid "Native language support included.\n" msgstr "Met moedertaal ondersteuning.\n" #: wcd.c:2260 #, c-format msgid "LOCALEDIR=%s\n" msgstr "" #: wcd.c:2262 #, c-format msgid "No native language support included.\n" msgstr "Geen moedertaal ondersteuning.\n" #: wcd.c:2265 #, c-format msgid "Current locale uses CP%u encoding.\n" msgstr "Huidige locale gebruikt CP%u codering.\n" #: wcd.c:2267 #, c-format msgid "Current locale uses %s encoding.\n" msgstr "Huidige locale gebruikt %s codering.\n" #: wcd.c:2270 #, c-format msgid "With Unicode support.\n" msgstr "Met Unicode ondersteuning.\n" #: wcd.c:2275 #, c-format msgid " Euro symbol: " msgstr " Euro symbool:" #: wcd.c:2277 #, c-format msgid " Chinese characters: " msgstr " Chinese letters:" #: wcd.c:2281 #, c-format msgid "Without Unicode support.\n" msgstr "Zonder Unicode ondersteuning.\n" #: wcd.c:2284 #, c-format msgid "With Unicode normalization.\n" msgstr "Met Unicode-normalisatie.\n" #: wcd.c:2286 #, c-format msgid "Without Unicode normalization.\n" msgstr "Zonder Unicode-normalisatie.\n" #: wcd.c:2289 #, c-format msgid "Download the latest executables and sources from:\n" msgstr "Download de nieuwste versie met broncode van:\n" #: wcd.c:2290 #, c-format msgid "http://waterlan.home.xs4all.nl/\n" msgstr "" #: wcd.c:2296 #, c-format msgid "" "Chdir for Dos and Unix.\n" "Copyright (C) 1997-2013 Erwin Waterlander\n" "Copyright (C) 1994-2002 Ondrej Popp on C3PO\n" "Copyright (C) 1995-1996 DJ Delorie on _fixpath()\n" "Copyright (C) 1995-1996 Borja Etxebarria & Olivier Sirol on Ninux Czo " "Directory\n" "Copyright (C) 1994-1996 Jason Mathews on DOSDIR\n" "Copyright (C) 1990-1992 Mark Adler, Richard B. Wales, Jean-loup Gailly,\n" "Kai Uwe Rommel and Igor Mandrichenko on recmatch()\n" "Source code to scan Windows LAN was originally written and placed\n" "in the public domain by Felix Kasza.\n" "Markus Kuhn's free wcwidth() implementation is used\n" "in Wcd for Windows.\n" "Rugxulo is the original author of query_con_codepage() (public domain).\n" "\n" "This program is free software; you can redistribute it and/or\n" "modify it under the terms of the GNU General Public License\n" "as published by the Free Software Foundation; either version 2\n" "of the License, or (at your option) any later version.\n" "\n" "This program is distributed in the hope that it will be useful,\n" "but WITHOUT ANY WARRANTY; without even the implied warranty of\n" "MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\n" "GNU General Public License for more details.\n" "\n" "You should have received a copy of the GNU General Public License\n" "along with this program; if not, write to the Free Software\n" "Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 " "USA.\n" msgstr "" #: wcd.c:2355 #, c-format msgid "Wcd: creating directory %s\n" msgstr "Wcd: aanmaken map %s\n" #: wcd.c:2682 msgid "Wcd: error: Value of environment variable WCDLOCALEDIR is too long.\n" msgstr "Wcd: fout: Waarde van omgevingsvariabele WCDLOCALEDIR is te lang.\n" #: wcd.c:2711 #, c-format msgid "Wcd: error: Failed to unset environment variable TERM: %s\n" msgstr "Wcd: fout: Niet gelukt om omgevingsvariabele TERM te verwijderen: %s\n" #: wcd.c:2722 msgid "Wcd: error: Value of environment variable HOME is too long.\n" msgstr "Wcd: fout: Waarde van omgevingsvariabele HOME is te lang.\n" #: wcd.c:2737 wcd.c:2805 msgid "" "Wcd: error: Value of environment variable HOME or WCDHOME is too long.\n" msgstr "Wcd: fout: Waarde van omgevingsvariabele HOME of WCDHOME is te lang.\n" #: wcd.c:2769 wcd.c:2798 msgid "Wcd: error: Environment variable HOME or WCDHOME is not set.\n" msgstr "Wcd: fout: Omgevingsvariabele HOME of WCDHOME zijn niet ingesteld.\n" #: wcd.c:2874 wcd.c:3356 wcd.c:3375 msgid "Wcd: error: Value of environment variable WCDUSERSHOME is too long.\n" msgstr "Wcd: fout: Waarde van omgevingsvariabele WCDUSERSHOME is te lang.\n" #: wcd.c:2983 #, c-format msgid "Wcd: HOME is not defined\n" msgstr "Wcd: HOME is niet gedefinieerd.\n" #: wcd.c:2985 #, c-format msgid "Wcd: HOME=\"%s\"\n" msgstr "" #: wcd.c:2987 #, c-format msgid "Wcd: WCDHOME is not defined\n" msgstr "Wcd: WCDHOME is niet gedefinieerd.\n" #: wcd.c:2989 #, c-format msgid "Wcd: WCDHOME=\"%s\"\n" msgstr "" #: wcd.c:2991 #, c-format msgid "Wcd: WCDSCAN is not defined\n" msgstr "Wcd: WCDSCAN is niet gedefinieerd.\n" #: wcd.c:3016 msgid "Wcd: Graphics mode only supported in wcd with curses based interface.\n" msgstr "" "Wcd: Grafische modus wordt alleen ondersteund in wcd met curses gebaseerde " "interface.\n" #: wcd.c:3043 #, c-format msgid "Wcd: use_GoScript = 0\n" msgstr "" #: wcd.c:3289 #, c-format msgid "Wcd: %s added to aliasfile %s\n" msgstr "Wcd: %s toegevoegd aan aliasbestand %s\n" #: wcd.c:3388 #, c-format msgid "Wcd: error: Unable to read file %s or %s\n" msgstr "Wcd: fout: Kan bestand %s of %s niet lezen.\n" #: wcd.c:3538 #, c-format msgid "Wcd: WCDSCAN directory {%s}\n" msgstr "Wcd: WCDSCAN map {%s}\n" #: wcd.c:3540 #, c-format msgid "Wcd: banning {%s}\n" msgstr "Wcd: verbannen {%s}\n" #: wcd.c:3542 #, c-format msgid "Wcd: excluding {%s}\n" msgstr "Wcd: uitsluiten {%s}\n" #: wcd.c:3544 #, c-format msgid "Wcd: filtering {%s}\n" msgstr "Wcd: filteren {%s}\n" #: wcd.c:3811 #, c-format msgid "" "Wcd: No directory found matching %s\n" "Wcd: Perhaps you need to rescan the disk or path is banned.\n" msgstr "" "Wcd: Geen map gevonden gelijk aan %s\n" "Wcd: Misschien moet u de schijf opnieuw aftasten of is het pad verbannen.\n" #: wcd.c:3977 #, c-format msgid "Wcd: Cannot change to %s\n" msgstr "Wcd: Kan niet veranderen naar %s\n" #: wcddir.c:104 #, c-format msgid "Wcd: Error %lu (\"%s\") reported by \"%s\".\n" msgstr "Wcd: Fout %lu (\"%s\") gerapporteerd door \"%s\".\n" #: wcddir.c:127 #, c-format msgid "Wcd: access denied.\n" msgstr "Wcd: toegang geweigerd.\n" #: wcddir.c:208 #, c-format msgid "Wcd: Searching for shared directories on server %s\n" msgstr "Wcd: Zoeken naar gedeelde mappen op server %s\n" #: wcddir.c:220 #, c-format msgid "Wcd: Found %lu shared directories on server %s\n" msgstr "Wcd: %lu gedeelde mappen gevonden op server %s\n" #: wcddir.c:314 msgid "Wcd: error: wcd_islink: " msgstr "Wcd: Fout: wcd_islink: " #: wcddir.c:346 msgid "Wcd: error: Unable to get current working directory: " msgstr "Wcd: fout: Kan huidige werkmap niet verkrijgen: " #: wcddir.c:374 #, c-format msgid "Wcd: error: Unable to change to directory %s: " msgstr "Wcd: fout: Kan niet veranderen naar map %s: " #: wcddir.c:405 #, c-format msgid "Wcd: error: Unable to create directory %s: " msgstr "Wcd: fout: Kan map %s niet aanmaken: " #: wcddir.c:434 #, c-format msgid "Wcd: error: Unable to remove directory %s: " msgstr "Wcd: fout: Kan map %s niet verwijderen: " #: wcddir.c:564 wcddir.c:581 #, c-format msgid "Wcd: error: Unable to create directory %s: %s\n" msgstr "Wcd: fout: Kan map %s niet aanmaken: %s\n" #: wcddir.c:706 #, c-format msgid "Wcd: error: Unable to get current working directory: %s\n" msgstr "Wcd: fout: Kan huidige werkmap niet verkrijgen: %s\n" #: wcddir.c:725 #, c-format msgid "Wcd: error: Unable to change to directory %s: %s\n" msgstr "Wcd: fout: Kan niet veranderen naar map %s: %s\n" #: wcddir.c:740 #, c-format msgid "Wcd: error: Unable to remove directory %s: %s\n" msgstr "Wcd: fout: Kan map %s niet verwijderen: %s\n" #: stack.c:101 msgid "Wcd: Error parsing stack\n" msgstr "Wcd: Fout met verwerken stapel\n" #: display.c:257 msgid "Wcd: error in maxLength(), list == NULL\n" msgstr "Wcd: fout in maxLength(), list == NULL\n" #: display.c:277 msgid "Wcd: error in maxLengthStack(), s == NULL\n" msgstr "Wcd: fout in maxLengthStack(), s == NULL\n" #: display.c:1129 msgid "Perfect " msgstr "Perfect " #: display.c:1131 msgid "Wild " msgstr "Joker " #: display.c:1132 #, c-format msgid "match for %d directories." msgstr "gelijke voor %d mappen." #: display.c:1137 #, c-format msgid " w=up x=down ?=help Page %d/%d " msgstr " w=omhoog x=omlaag ?=help Pagina %d/%d " #: display.c:1144 display.c:1506 #, c-format msgid "Please choose one ( to abort): " msgstr "Maak een keuze ( voor afbreken): " #: display.c:1160 msgid "Screenheight must be > 20 for help." msgstr "Schermhoogte moet groter dan 20 zijn voor help" #: display.c:1163 msgid "w or Page Up." msgstr "w of Pagina Omhoog." #: display.c:1164 msgid "x or z or Page Down." msgstr "x of z of Pagina Omlaag." #: display.c:1165 msgid ", or Scroll 1 left." msgstr ", of Rol 1 naar links." #: display.c:1166 msgid ". or Scroll 1 right." msgstr ". of Rol 1 naar rechts." #: display.c:1167 msgid "< or [ Scroll 10 left." msgstr "< of [ Rol 10 naar links." #: display.c:1168 msgid "> or ] Scroll 10 right." msgstr "> of ] Rol 10 naar rechts." #: display.c:1169 msgid "CTRL-a or Scroll to beginning." msgstr "CTRL-a of Rol naar begin." #: display.c:1170 msgid "CTRL-e or Scroll to end." msgstr "CTRL-e of Rol naar einde." #: display.c:1171 msgid "CTRL-c or Abort." msgstr "CTRL-c of Afbreken." #: display.c:1172 msgid " Abort." msgstr " Afbreken." #: display.c:1173 graphics.c:1810 graphics.c:1826 graphics.c:1849 #: graphics.c:1866 msgid "Press any key." msgstr "Druk een toets." #: display.c:1236 graphics.c:2114 msgid "" "Wcd: warning: Error opening terminal, falling back to stdout interface.\n" msgstr "" "Wcd: let op: Fout tijdens openen terminal, val terug op stdout interface.\n" #: display.c:1257 msgid "Wcd: error: screen height must be larger than 3 lines.\n" msgstr "Wcd: fout: scherm hoogte moet groter zijn dan 3 regels.\n" #: display.c:1291 graphics.c:2147 msgid "Wcd: error creating scroll window.\n" msgstr "Wcd: fout tijdens maken rolvenster.\n" #: display.c:1310 msgid "Wcd: error creating input window.\n" msgstr "Wcd: fout aanmaken invoervenster.\n" #: display.c:1502 #, c-format msgid "" "\n" "Perfect " msgstr "" "\n" "Perfecte " #: display.c:1504 #, c-format msgid "" "\n" "Wild " msgstr "" "\n" "Joker " #: display.c:1505 #, c-format msgid "match for %lu directories.\n" msgstr "gelijke voor %lu mappen.\n" #: display.c:1548 #, c-format msgid "" "\n" "Please choose one ( to abort): " msgstr "" "\n" "Maak een keuze ( voor afbreken): " #: graphics.c:279 #, c-format msgid "Wcd: error: line too long in function getTreeLine()" msgstr "Wcd: fout: regel te lang in functie getTreeLine()" #: graphics.c:1771 msgid "/ = search forward, ? = search backward, : = help" msgstr "/ = zoek vooruit, ? = zoek achteruit, : = help" #: graphics.c:1776 msgid "SEARCH: " msgstr "ZOEK: " #: graphics.c:1779 msgid "Search: " msgstr "Zoek: " #: graphics.c:1795 msgid "NAVIGATE MODE (1/2):" msgstr "NAVIGATIE MODUS (1/2):" #: graphics.c:1796 msgid "h or go left." msgstr "h of ga naar links." #: graphics.c:1797 msgid "j or go down." msgstr "j of ga omlaag." #: graphics.c:1798 msgid "k or go up." msgstr "k of ga omhoog." #: graphics.c:1799 msgid "l or go right." msgstr "l of ga naar rechts." #: graphics.c:1800 msgid "* or v or go forward to dir with same name." msgstr "* of v of ga vooruit naar map met dezelfde naam." #: graphics.c:1801 msgid "# or p or go backward to dir with same name." msgstr "# of p of ga achteruit naar map met dezelfde naam." #: graphics.c:1802 msgid "^ or a go to beginning of line." msgstr "^ of a ga naar begin van regel." #: graphics.c:1803 msgid "$ or e go to end of line." msgstr "$ of e ga naar einde van regel." #: graphics.c:1804 msgid "1 go to root dir." msgstr "1 ga naar eerste map." #: graphics.c:1805 msgid "g or G go to last dir." msgstr "g of G ga naar laatste map." #: graphics.c:1806 msgid "f go page forward." msgstr "f ga pagina vooruit." #: graphics.c:1807 msgid "b go page backward." msgstr "b ga pagina achteruit." #: graphics.c:1808 msgid "u go half page up." msgstr "u ga halve pagina omhoog." #: graphics.c:1809 msgid "d go half page down." msgstr "d ga halve pagina omlaag." #: graphics.c:1816 msgid "NAVIGATE MODE (2/2):" msgstr "NAVIGATIE MODUS (2/2):" #: graphics.c:1817 msgid "A switch alternative tree navigation on/off." msgstr "A in- uitschakelen alternatieve boomnavigatie." #: graphics.c:1818 msgid "t switch centered mode on/off." msgstr "t in- uitschakelen gecentreerde modus." #: graphics.c:1819 msgid "T toggle between line drawing and ASCII characters." msgstr "T schakel tussen lijnen en ASCII lettertekens." #: graphics.c:1820 msgid "m toggle between compact and wide tree." msgstr "m schakel tussen compacte en brede boom." #: graphics.c:1821 msgid " or q Abort." msgstr " of q Afbreken." #: graphics.c:1822 msgid "/ Search forward." msgstr "/ Zoek vooruit." #: graphics.c:1823 msgid "? Search backward." msgstr "? Zoek achteruit." #: graphics.c:1824 msgid "n Repeat latest / or ? search." msgstr "n Herhaal laatste / of ? zoekopdracht." #: graphics.c:1825 graphics.c:1848 msgid " Select directory." msgstr " Kies map." #: graphics.c:1832 msgid "SEARCH MODE with wildcard and subdir support:" msgstr "ZOEK MODUS met jokertekens en submap ondersteuning:" #: graphics.c:1833 msgid " go left." msgstr " ga naar links." #: graphics.c:1834 msgid " go down." msgstr " ga omlaag." #: graphics.c:1835 msgid " go up." msgstr " ga omhoog." #: graphics.c:1836 msgid " go right." msgstr " ga naar rechts." #: graphics.c:1837 msgid "CTRL-v go forward to dir with same name." msgstr "CTRL-v ga vooruit naar map met dezelfde naam." #: graphics.c:1838 msgid "CTRL-p go backward to dir with same name." msgstr "CTRL-p ga achteruit naar map met dezelfde naam." #: graphics.c:1839 msgid "CTRL-a go to beginning of line." msgstr "CTRL-a ga naar begin van regel." #: graphics.c:1840 msgid "CTRL-e go to end of line." msgstr "CTRL-e ga naar einde van regel." #: graphics.c:1841 msgid "CTRL-g go to last dir." msgstr "CTRL-g ga naar laatste map." #: graphics.c:1842 msgid "CTRL-f go page forward." msgstr "CTRL-f ga pagina vooruit." #: graphics.c:1843 msgid "CTRL-b go page backward." msgstr "CTRL-b ga pagina achteruit." #: graphics.c:1844 msgid "CTRL-u go half page up." msgstr "CTRL-u ga halve pagina omhoog." #: graphics.c:1845 msgid "CTRL-d go half page down." msgstr "CTRL-d ga halve pagina omlaag." #: graphics.c:1846 msgid " or CTRL-x Abort SEARCH MODE." msgstr " of CTRL-x ZOEK MODUS afbreken." #: graphics.c:1847 msgid "CTRL-n Repeat latest / or ? search." msgstr "CTRL-n Herhaal laatste / of ? zoekopdracht." #: graphics.c:1855 msgid "ZOOMING:" msgstr "ZOOMEN:" #: graphics.c:1856 msgid "z or i or CTRL-i zoom in." msgstr "z of i of CTRL-i zoom in." #: graphics.c:1857 msgid "Z or o or CTRL-o zoom out." msgstr "Z of o of CTRL-o zoom uit." #: graphics.c:1858 msgid "c condense: fold current level." msgstr "c huidig niveau vouwen." #: graphics.c:1859 msgid "C condense: fold subdir level." msgstr "C submap niveau vouwen." #: graphics.c:1860 msgid "w condense: fold current and sub levels." msgstr "w huidig en subniveaus vouwen." #: graphics.c:1861 msgid "y or CTRL-y uncondense: unfold current and sub levels." msgstr "y of CTRL-y huidig en subniveaus ontvouwen." #: graphics.c:1862 msgid "r or CTRL-r uncondense: unfold all directories." msgstr "r of CTRL-r alle mappen ontvouwen." #: graphics.c:1863 msgid "- fold directory." msgstr "- vouw map." #: graphics.c:1864 msgid "+ or = unfold directory." msgstr "+ of = ontvouw map." #: graphics.c:1865 msgid "l or unfold and go right." msgstr "l of ontvouwen en naar rechts gaan." #: graphics.c:1869 msgid "Screenheight must be > 21 for help" msgstr "Schermhoogte moet groter dan 21 zijn voor help" #: wfixpath.c:64 msgid "Wcd: malloc error in wcd_fixpath()\n" msgstr "Wcd: malloc fout in wcd_fixpath()\n" #: c3po/Error.c:40 #, c-format msgid "" "Wcd: error in '%s', no space left for allocation\n" "Wcd: Insufficient memory\n" msgstr "" "Wcd: fout in '%s', geen ruimte meer voor toewijzing\n" "Wcd: Onvoldoende geheugen\n" wcd-5.2.4/src/po/wcd.pot0000644000175000010010000005052612205217412014274 0ustar waterlanNone# SOME DESCRIPTIVE TITLE. # Copyright (C) YEAR THE PACKAGE'S COPYRIGHT HOLDER # This file is distributed under the same license as the PACKAGE package. # FIRST AUTHOR , YEAR. # #, fuzzy msgid "" msgstr "" "Project-Id-Version: PACKAGE VERSION\n" "Report-Msgid-Bugs-To: \n" "POT-Creation-Date: 2013-08-21 21:45+0200\n" "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" "Last-Translator: FULL NAME \n" "Language-Team: LANGUAGE \n" "Language: \n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=CHARSET\n" "Content-Transfer-Encoding: 8bit\n" #: wcd.c:147 #, c-format msgid "Wcd: error: %s\n" msgstr "" #: wcd.c:161 #, c-format msgid "Wcd: wcd_fopen: Opening file \"%s\" mode=%s quiet=%d\n" msgstr "" #: wcd.c:174 wcd.c:194 #, c-format msgid "Wcd: error: Unable to read file %s: %s\n" msgstr "" #: wcd.c:183 #, c-format msgid "Wcd: error: Unable to read file %s: Not a regular file.\n" msgstr "" #: wcd.c:196 wcd.c:284 #, c-format msgid "Wcd: error: Unable to write file %s: %s\n" msgstr "" #: wcd.c:199 #, c-format msgid "Wcd: wcd_fopen: Opening file \"%s\" OK.\n" msgstr "" #: wcd.c:286 #, c-format msgid "Wcd: error: Unable to close file %s: %s\n" msgstr "" #: wcd.c:290 #, c-format msgid "Wcd: %sClosing file \"%s\" OK.\n" msgstr "" #: wcd.c:629 wcd.c:642 #, c-format msgid "Wcd: %s added to file %s\n" msgstr "" #: wcd.c:776 wcd.c:841 #, c-format msgid "Wcd: error: Unable to remove file %s: %s\n" msgstr "" #: wcd.c:929 wcd.c:997 #, c-format msgid "" "Wcd: error: finddirs(): can't determine path in directory %s\n" "Wcd: path probably too long.\n" msgstr "" #: wcd.c:1108 wcd.c:1433 #, c-format msgid "Wcd: %s is not a directory.\n" msgstr "" #: wcd.c:1112 #, c-format msgid "Wcd: Please wait. Scanning disk. Building treedata-file %s from %s\n" msgstr "" #: wcd.c:1173 wcd.c:2375 wcd.c:2398 wcd.c:2477 #, c-format msgid "Wcd: Writing file \"%s\"\n" msgstr "" #: wcd.c:1178 msgid "" "Wcd: error: Write access to tree-file denied.\n" "Wcd: Set TEMP environment variable if this is a read-only disk.\n" msgstr "" #: wcd.c:1306 #, c-format msgid "Wcd: Removed symbolic link %s\n" msgstr "" #: wcd.c:1312 #, c-format msgid "Wcd: error: Unable to remove symbolic link %s: %s\n" msgstr "" #: wcd.c:1316 #, c-format msgid "Wcd: %s is a symbolic link to a file.\n" msgstr "" #: wcd.c:1398 #, c-format msgid "Wcd: Recursively remove %s Are you sure? y/n :" msgstr "" #: wcd.c:1419 wcd.c:1428 #, c-format msgid "Wcd: Removed directory %s\n" msgstr "" #: wcd.c:1456 #, c-format msgid "" "Wcd: error: line too long in wcd_getline() ( > %d). The treefile could be " "corrupt, else fix by increasing DD_MAXPATH in source code.\n" msgstr "" #: wcd.c:1457 wcd.c:1517 wcd.c:1576 #, c-format msgid "Wcd: file: %s, line: %d," msgstr "" #: wcd.c:1464 wcd.c:1524 wcd.c:1583 #, c-format msgid " length: %d\n" msgstr "" #: wcd.c:1516 #, c-format msgid "" "Wcd: error: line too long in wcd_wgetline() ( > %d). The treefile could be " "corrupt, else fix by increasing DD_MAXPATH in source code.\n" msgstr "" #: wcd.c:1575 #, c-format msgid "" "Wcd: error: line too long in wcd_wgetline_be() ( > %d). The treefile could " "be corrupt, else fix by increasing DD_MAXPATH in source code.\n" msgstr "" #: wcd.c:2086 #, c-format msgid "" "wcd %s (%s) - Wherever Change Directory\n" "Usage: wcd [options] [directory]\n" "\n" "directory: Name of directory to change to.\n" " Wildcards *, ? and [SET] are supported.\n" "\n" msgstr "" #: wcd.c:2093 #, c-format msgid "" "options:\n" " -a Add current path to treefile\n" " -aa Add current and all parent paths to treefile\n" " -A PATH Add tree from PATH\n" " -b Ban current path\n" " -c, --direct-cd direct CD mode\n" " -d DRIVE set DRIVE for stack & go files (DOS)\n" " -e add current path to Extra treefile\n" " -ee add current and all parent paths to Extra " "treefile\n" " -E PATH add tree from PATH to Extra treefile\n" " -f FILE use extra treeFile\n" " +f FILE add extra treeFile\n" " -g Graphics\n" " -gd Graphics, dump tree\n" " -G PATH set PATH Go-script\n" " -GN, --no-go-script No Go-script\n" " -h, --help show this Help\n" msgstr "" #: wcd.c:2112 #, c-format msgid "" " -i, --ignore-case Ignore case (default)\n" " +i, --no-ignore-case Regard case\n" msgstr "" #: wcd.c:2116 #, c-format msgid "" " -i, --ignore-case Ignore case\n" " +i, --no-ignore-case Regard case (default)\n" msgstr "" #: wcd.c:2121 #, c-format msgid "" " -I, --ignore-diacritics Ignore diacritics\n" " +I, --no-ignore-diacritics Regard diacritics (default)\n" " -j, --just-go Just go mode\n" " -k, --keep-paths Keep paths\n" " -K, --color Colors\n" " -l ALIAS aLias current directory\n" " -L, --license print software License\n" " -m DIR Make DIR, add to treefile\n" " -M DIR Make DIR, add to extra treefile\n" " -n PATH use relative treefile in PATH\n" " +n PATH add relative treefile in PATH\n" " -N, --numbers use Numbers\n" " -o use stdOut\n" " -od, --to-stdout dump matches\n" " -q, --quiet Quieter operation\n" " -r DIR Remove DIR\n" " -rmtree DIR Remove DIR recursive\n" " -s Scan disk from $HOME\n" " -S PATH Scan disk from PATH\n" " +S PATH Scan disk from PATH, create relative treefile\n" " -t Don't strip /tmp_mnt from paths\n" " -T, --ascii-tree Draw tree with ASCII characters\n" " -Ta, --alt-tree-nav Alternative tree navigation\n" " -TC, --center-tree Centered tree view\n" " -Tc, --compact-tree Compact tree\n" " -Td, --cjk-width support legacy CJK fonts\n" " -u USER use USER's treefile\n" " +u USER add USER's treefile\n" " -v, --verbose Verbose operation\n" " -V, --version print Version info\n" " -w, --wild-match-only Wild matching only\n" " -x PATH eXclude PATH during disk scan\n" " -xf FILE eXclude paths from FILE\n" " -y, --assume-yes assume Yes on all queries\n" " -z NUMBER set max stack siZe\n" " -[NUMBER] Push dir (NUMBER times)\n" " +[NUMBER] Pop dir (NUMBER times)\n" " = Show stack\n" msgstr "" #: wcd.c:2168 wcd.c:2295 #, c-format msgid "wcd %s (%s) - Wherever Change Directory\n" msgstr "" #: wcd.c:2169 #, c-format msgid "" "Chdir for Dos and Unix.\n" "\n" msgstr "" #: wcd.c:2173 #, c-format msgid "DOS 16 bit version (WATCOMC).\n" msgstr "" #: wcd.c:2175 #, c-format msgid "DOS 16 bit version (TURBOC).\n" msgstr "" #: wcd.c:2177 #, c-format msgid "DOS 32 bit version (DJGPP).\n" msgstr "" #: wcd.c:2179 #, c-format msgid "DOS 32 bit version (WATCOMC).\n" msgstr "" #: wcd.c:2186 #, c-format msgid "Win64 version (MSVC %d).\n" msgstr "" #: wcd.c:2188 #, c-format msgid "Win64 version (MinGW-w64).\n" msgstr "" #: wcd.c:2192 #, c-format msgid "Win32 version (WATCOMC).\n" msgstr "" #: wcd.c:2194 #, c-format msgid "Win32 version (MSVC %d).\n" msgstr "" #: wcd.c:2196 #, c-format msgid "Win32 version (MinGW).\n" msgstr "" #: wcd.c:2203 #, c-format msgid "This version is for MSYS and WinZsh.\n" msgstr "" #: wcd.c:2205 #, c-format msgid "This version is for Windows PowerShell.\n" msgstr "" #: wcd.c:2207 #, c-format msgid "This version is for Windows Command Prompt (cmd.exe).\n" msgstr "" #: wcd.c:2212 #, c-format msgid "OS/2 version" msgstr "" #: wcd.c:2223 #, c-format msgid "This version is for native MSYS.\n" msgstr "" #: wcd.c:2226 #, c-format msgid "Cygwin version.\n" msgstr "" #: wcd.c:2229 #, c-format msgid "This version is for DJGPP DOS bash.\n" msgstr "" #: wcd.c:2232 #, c-format msgid "This version is for OS/2 bash.\n" msgstr "" #: wcd.c:2235 #, c-format msgid "Interface: " msgstr "" #: wcd.c:2237 #, c-format msgid "conio\n" msgstr "" #: wcd.c:2241 #, c-format msgid "ncurses version %s.%d\n" msgstr "" #: wcd.c:2244 #, c-format msgid "PDCurses build %d\n" msgstr "" #: wcd.c:2246 #, c-format msgid "curses\n" msgstr "" #: wcd.c:2255 #, c-format msgid "stdout\n" msgstr "" #: wcd.c:2259 #, c-format msgid "Native language support included.\n" msgstr "" #: wcd.c:2260 #, c-format msgid "LOCALEDIR=%s\n" msgstr "" #: wcd.c:2262 #, c-format msgid "No native language support included.\n" msgstr "" #: wcd.c:2265 #, c-format msgid "Current locale uses CP%u encoding.\n" msgstr "" #: wcd.c:2267 #, c-format msgid "Current locale uses %s encoding.\n" msgstr "" #: wcd.c:2270 #, c-format msgid "With Unicode support.\n" msgstr "" #: wcd.c:2275 #, c-format msgid " Euro symbol: " msgstr "" #: wcd.c:2277 #, c-format msgid " Chinese characters: " msgstr "" #: wcd.c:2281 #, c-format msgid "Without Unicode support.\n" msgstr "" #: wcd.c:2284 #, c-format msgid "With Unicode normalization.\n" msgstr "" #: wcd.c:2286 #, c-format msgid "Without Unicode normalization.\n" msgstr "" #: wcd.c:2289 #, c-format msgid "Download the latest executables and sources from:\n" msgstr "" #: wcd.c:2290 #, c-format msgid "http://waterlan.home.xs4all.nl/\n" msgstr "" #: wcd.c:2296 #, c-format msgid "" "Chdir for Dos and Unix.\n" "Copyright (C) 1997-2013 Erwin Waterlander\n" "Copyright (C) 1994-2002 Ondrej Popp on C3PO\n" "Copyright (C) 1995-1996 DJ Delorie on _fixpath()\n" "Copyright (C) 1995-1996 Borja Etxebarria & Olivier Sirol on Ninux Czo " "Directory\n" "Copyright (C) 1994-1996 Jason Mathews on DOSDIR\n" "Copyright (C) 1990-1992 Mark Adler, Richard B. Wales, Jean-loup Gailly,\n" "Kai Uwe Rommel and Igor Mandrichenko on recmatch()\n" "Source code to scan Windows LAN was originally written and placed\n" "in the public domain by Felix Kasza.\n" "Markus Kuhn's free wcwidth() implementation is used\n" "in Wcd for Windows.\n" "Rugxulo is the original author of query_con_codepage() (public domain).\n" "\n" "This program is free software; you can redistribute it and/or\n" "modify it under the terms of the GNU General Public License\n" "as published by the Free Software Foundation; either version 2\n" "of the License, or (at your option) any later version.\n" "\n" "This program is distributed in the hope that it will be useful,\n" "but WITHOUT ANY WARRANTY; without even the implied warranty of\n" "MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\n" "GNU General Public License for more details.\n" "\n" "You should have received a copy of the GNU General Public License\n" "along with this program; if not, write to the Free Software\n" "Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 " "USA.\n" msgstr "" #: wcd.c:2355 #, c-format msgid "Wcd: creating directory %s\n" msgstr "" #: wcd.c:2682 msgid "Wcd: error: Value of environment variable WCDLOCALEDIR is too long.\n" msgstr "" #: wcd.c:2711 #, c-format msgid "Wcd: error: Failed to unset environment variable TERM: %s\n" msgstr "" #: wcd.c:2722 msgid "Wcd: error: Value of environment variable HOME is too long.\n" msgstr "" #: wcd.c:2737 wcd.c:2805 msgid "" "Wcd: error: Value of environment variable HOME or WCDHOME is too long.\n" msgstr "" #: wcd.c:2769 wcd.c:2798 msgid "Wcd: error: Environment variable HOME or WCDHOME is not set.\n" msgstr "" #: wcd.c:2874 wcd.c:3356 wcd.c:3375 msgid "Wcd: error: Value of environment variable WCDUSERSHOME is too long.\n" msgstr "" #: wcd.c:2983 #, c-format msgid "Wcd: HOME is not defined\n" msgstr "" #: wcd.c:2985 #, c-format msgid "Wcd: HOME=\"%s\"\n" msgstr "" #: wcd.c:2987 #, c-format msgid "Wcd: WCDHOME is not defined\n" msgstr "" #: wcd.c:2989 #, c-format msgid "Wcd: WCDHOME=\"%s\"\n" msgstr "" #: wcd.c:2991 #, c-format msgid "Wcd: WCDSCAN is not defined\n" msgstr "" #: wcd.c:3016 msgid "Wcd: Graphics mode only supported in wcd with curses based interface.\n" msgstr "" #: wcd.c:3043 #, c-format msgid "Wcd: use_GoScript = 0\n" msgstr "" #: wcd.c:3289 #, c-format msgid "Wcd: %s added to aliasfile %s\n" msgstr "" #: wcd.c:3388 #, c-format msgid "Wcd: error: Unable to read file %s or %s\n" msgstr "" #: wcd.c:3538 #, c-format msgid "Wcd: WCDSCAN directory {%s}\n" msgstr "" #: wcd.c:3540 #, c-format msgid "Wcd: banning {%s}\n" msgstr "" #: wcd.c:3542 #, c-format msgid "Wcd: excluding {%s}\n" msgstr "" #: wcd.c:3544 #, c-format msgid "Wcd: filtering {%s}\n" msgstr "" #: wcd.c:3811 #, c-format msgid "" "Wcd: No directory found matching %s\n" "Wcd: Perhaps you need to rescan the disk or path is banned.\n" msgstr "" #: wcd.c:3977 #, c-format msgid "Wcd: Cannot change to %s\n" msgstr "" #: wcddir.c:104 #, c-format msgid "Wcd: Error %lu (\"%s\") reported by \"%s\".\n" msgstr "" #: wcddir.c:127 #, c-format msgid "Wcd: access denied.\n" msgstr "" #: wcddir.c:208 #, c-format msgid "Wcd: Searching for shared directories on server %s\n" msgstr "" #: wcddir.c:220 #, c-format msgid "Wcd: Found %lu shared directories on server %s\n" msgstr "" #: wcddir.c:314 msgid "Wcd: error: wcd_islink: " msgstr "" #: wcddir.c:346 msgid "Wcd: error: Unable to get current working directory: " msgstr "" #: wcddir.c:374 #, c-format msgid "Wcd: error: Unable to change to directory %s: " msgstr "" #: wcddir.c:405 #, c-format msgid "Wcd: error: Unable to create directory %s: " msgstr "" #: wcddir.c:434 #, c-format msgid "Wcd: error: Unable to remove directory %s: " msgstr "" #: wcddir.c:564 wcddir.c:581 #, c-format msgid "Wcd: error: Unable to create directory %s: %s\n" msgstr "" #: wcddir.c:706 #, c-format msgid "Wcd: error: Unable to get current working directory: %s\n" msgstr "" #: wcddir.c:725 #, c-format msgid "Wcd: error: Unable to change to directory %s: %s\n" msgstr "" #: wcddir.c:740 #, c-format msgid "Wcd: error: Unable to remove directory %s: %s\n" msgstr "" #: stack.c:101 msgid "Wcd: Error parsing stack\n" msgstr "" #: display.c:257 msgid "Wcd: error in maxLength(), list == NULL\n" msgstr "" #: display.c:277 msgid "Wcd: error in maxLengthStack(), s == NULL\n" msgstr "" #: display.c:1129 msgid "Perfect " msgstr "" #: display.c:1131 msgid "Wild " msgstr "" #: display.c:1132 #, c-format msgid "match for %d directories." msgstr "" #: display.c:1137 #, c-format msgid " w=up x=down ?=help Page %d/%d " msgstr "" #: display.c:1144 display.c:1506 #, c-format msgid "Please choose one ( to abort): " msgstr "" #: display.c:1160 msgid "Screenheight must be > 20 for help." msgstr "" #: display.c:1163 msgid "w or Page Up." msgstr "" #: display.c:1164 msgid "x or z or Page Down." msgstr "" #: display.c:1165 msgid ", or Scroll 1 left." msgstr "" #: display.c:1166 msgid ". or Scroll 1 right." msgstr "" #: display.c:1167 msgid "< or [ Scroll 10 left." msgstr "" #: display.c:1168 msgid "> or ] Scroll 10 right." msgstr "" #: display.c:1169 msgid "CTRL-a or Scroll to beginning." msgstr "" #: display.c:1170 msgid "CTRL-e or Scroll to end." msgstr "" #: display.c:1171 msgid "CTRL-c or Abort." msgstr "" #: display.c:1172 msgid " Abort." msgstr "" #: display.c:1173 graphics.c:1810 graphics.c:1826 graphics.c:1849 #: graphics.c:1866 msgid "Press any key." msgstr "" #: display.c:1236 graphics.c:2114 msgid "" "Wcd: warning: Error opening terminal, falling back to stdout interface.\n" msgstr "" #: display.c:1257 msgid "Wcd: error: screen height must be larger than 3 lines.\n" msgstr "" #: display.c:1291 graphics.c:2147 msgid "Wcd: error creating scroll window.\n" msgstr "" #: display.c:1310 msgid "Wcd: error creating input window.\n" msgstr "" #: display.c:1502 #, c-format msgid "" "\n" "Perfect " msgstr "" #: display.c:1504 #, c-format msgid "" "\n" "Wild " msgstr "" #: display.c:1505 #, c-format msgid "match for %lu directories.\n" msgstr "" #: display.c:1548 #, c-format msgid "" "\n" "Please choose one ( to abort): " msgstr "" #: graphics.c:279 #, c-format msgid "Wcd: error: line too long in function getTreeLine()" msgstr "" #: graphics.c:1771 msgid "/ = search forward, ? = search backward, : = help" msgstr "" #: graphics.c:1776 msgid "SEARCH: " msgstr "" #: graphics.c:1779 msgid "Search: " msgstr "" #: graphics.c:1795 msgid "NAVIGATE MODE (1/2):" msgstr "" #: graphics.c:1796 msgid "h or go left." msgstr "" #: graphics.c:1797 msgid "j or go down." msgstr "" #: graphics.c:1798 msgid "k or go up." msgstr "" #: graphics.c:1799 msgid "l or go right." msgstr "" #: graphics.c:1800 msgid "* or v or go forward to dir with same name." msgstr "" #: graphics.c:1801 msgid "# or p or go backward to dir with same name." msgstr "" #: graphics.c:1802 msgid "^ or a go to beginning of line." msgstr "" #: graphics.c:1803 msgid "$ or e go to end of line." msgstr "" #: graphics.c:1804 msgid "1 go to root dir." msgstr "" #: graphics.c:1805 msgid "g or G go to last dir." msgstr "" #: graphics.c:1806 msgid "f go page forward." msgstr "" #: graphics.c:1807 msgid "b go page backward." msgstr "" #: graphics.c:1808 msgid "u go half page up." msgstr "" #: graphics.c:1809 msgid "d go half page down." msgstr "" #: graphics.c:1816 msgid "NAVIGATE MODE (2/2):" msgstr "" #: graphics.c:1817 msgid "A switch alternative tree navigation on/off." msgstr "" #: graphics.c:1818 msgid "t switch centered mode on/off." msgstr "" #: graphics.c:1819 msgid "T toggle between line drawing and ASCII characters." msgstr "" #: graphics.c:1820 msgid "m toggle between compact and wide tree." msgstr "" #: graphics.c:1821 msgid " or q Abort." msgstr "" #: graphics.c:1822 msgid "/ Search forward." msgstr "" #: graphics.c:1823 msgid "? Search backward." msgstr "" #: graphics.c:1824 msgid "n Repeat latest / or ? search." msgstr "" #: graphics.c:1825 graphics.c:1848 msgid " Select directory." msgstr "" #: graphics.c:1832 msgid "SEARCH MODE with wildcard and subdir support:" msgstr "" #: graphics.c:1833 msgid " go left." msgstr "" #: graphics.c:1834 msgid " go down." msgstr "" #: graphics.c:1835 msgid " go up." msgstr "" #: graphics.c:1836 msgid " go right." msgstr "" #: graphics.c:1837 msgid "CTRL-v go forward to dir with same name." msgstr "" #: graphics.c:1838 msgid "CTRL-p go backward to dir with same name." msgstr "" #: graphics.c:1839 msgid "CTRL-a go to beginning of line." msgstr "" #: graphics.c:1840 msgid "CTRL-e go to end of line." msgstr "" #: graphics.c:1841 msgid "CTRL-g go to last dir." msgstr "" #: graphics.c:1842 msgid "CTRL-f go page forward." msgstr "" #: graphics.c:1843 msgid "CTRL-b go page backward." msgstr "" #: graphics.c:1844 msgid "CTRL-u go half page up." msgstr "" #: graphics.c:1845 msgid "CTRL-d go half page down." msgstr "" #: graphics.c:1846 msgid " or CTRL-x Abort SEARCH MODE." msgstr "" #: graphics.c:1847 msgid "CTRL-n Repeat latest / or ? search." msgstr "" #: graphics.c:1855 msgid "ZOOMING:" msgstr "" #: graphics.c:1856 msgid "z or i or CTRL-i zoom in." msgstr "" #: graphics.c:1857 msgid "Z or o or CTRL-o zoom out." msgstr "" #: graphics.c:1858 msgid "c condense: fold current level." msgstr "" #: graphics.c:1859 msgid "C condense: fold subdir level." msgstr "" #: graphics.c:1860 msgid "w condense: fold current and sub levels." msgstr "" #: graphics.c:1861 msgid "y or CTRL-y uncondense: unfold current and sub levels." msgstr "" #: graphics.c:1862 msgid "r or CTRL-r uncondense: unfold all directories." msgstr "" #: graphics.c:1863 msgid "- fold directory." msgstr "" #: graphics.c:1864 msgid "+ or = unfold directory." msgstr "" #: graphics.c:1865 msgid "l or unfold and go right." msgstr "" #: graphics.c:1869 msgid "Screenheight must be > 21 for help" msgstr "" #: wfixpath.c:64 msgid "Wcd: malloc error in wcd_fixpath()\n" msgstr "" #: c3po/Error.c:40 #, c-format msgid "" "Wcd: error in '%s', no space left for allocation\n" "Wcd: Insufficient memory\n" msgstr "" wcd-5.2.4/src/querycp.c0000644000175000010010000001415212066325113014207 0ustar waterlanNone/* querycp.c is in the public domain */ #if (defined(__WATCOMC__) && defined(__NT__)) # define _WIN32 #endif #ifdef __MSYS__ # define _WIN32 # undef __CYGWIN__ #endif #ifdef __DJGPP__ #include #include #include /* ---------------------------------------------------------------------- Tuesday, May 5, 2009 1:40pm rugxulo _AT_ gmail _DOT_ com This file is (obviously?) not copyrighted, "nenies proprajxo" !! Tested successfully on DR-DOS 7.03, FreeDOS 1.0++, and MS-DOS 6.22. (Doesn't work on XP or Vista, though.) ---------------------------------------------------------------------- unsigned short query_con_codepage(void); gets currently selected display CON codepage int 21h, 6601h ("chcp") needs NLSFUNC.EXE + COUNTRY.SYS, but many obscure codepages (e.g. FD's cp853 from EGA.CPX (CPIX.ZIP) or Kosta Kostis' cp913 from ISOLATIN.CPI (ISOCP101.ZIP) have no relevant data inside COUNTRY.SYS. int 21h, 440Ch 6Ah only works in MS-DOS and DR-DOS (not FreeDOS) because FreeDOS DISPLAY is an .EXE TSR, not a device driver, and hence doesn't fully support IOCTL, so they use the undocumented int 2Fh, 0AD02h (which doesn't work in DR-DOS!). But DR-DOS' DISPLAY doesn't respond to the typical install check i.d. anyways. FreeDOS currently only supports COUNTRY.SYS in their "unstable" kernel 2037, but at least their KEYB, "gxoje", supports cp853 too (thanks, Henrique!). P.S. For MS or DR: ren ega.cpx *.com ; upx -d ega.com ; ren ega.com *.cpi ADDENDUM (2011): Latest "stable" FreeDOS kernel is 2040, it now includes COUNTRY.SYS support by default, but NLSFUNC (CHCP) 'system code page' support is partially unimplemented (lacking some int 2Fh calls, yet Eduardo Casino didn't seem too worried, so I dunno, nag him if necessary, heh). ---------------------------------------------------------------------- */ unsigned short query_con_codepage(void) { __dpmi_regs regs; unsigned short param_block[2] = { 0, 437 }; regs.d.eax = 0x440C; /* GENERIC IO FOR HANDLES */ regs.d.ebx = 1; /* STDOUT */ regs.d.ecx = 0x036A; /* 3 = CON, 0x6A = QUERY SELECTED CP */ regs.x.ds = __tb >> 4; /* using transfer buffer for low mem. */ regs.x.dx = __tb & 0x0F; /* (suggested by DJGPP FAQ, hi Eli!) */ regs.x.flags |= 1; /* preset carry for potential failure */ __dpmi_int (0x21, ®s); if (!(regs.x.flags & 1)) /* if succeed (carry flag not set) */ dosmemget( __tb, 4, param_block); else { /* (undocumented method) */ regs.x.ax = 0xAD02; /* 440C -> MS-DOS or DR-DOS only */ regs.x.bx = 0xFFFE; /* AD02 -> MS-DOS or FreeDOS only */ regs.x.flags |= 1; __dpmi_int(0x2F, ®s); if ((!(regs.x.flags & 1)) && (regs.x.bx < 0xFFFE)) param_block[1] = regs.x.bx; } return param_block[1]; } #elif defined(__WATCOMC__) && defined(__I86__) /* Watcom C, 16 bit Intel */ /* rugxulo _AT_ gmail _DOT_ com */ #include #include #include unsigned short query_con_codepage(void) { union REGS regs; unsigned short param_block[2] = { 0, 437 }; regs.x.ax = 0x440C; /* GENERIC IO FOR HANDLES */ regs.x.bx = 1; /* STDOUT */ regs.x.cx = 0x036A; /* 3 = CON, 0x6A = QUERY SELECTED CP */ regs.x.dx = (unsigned short)param_block; regs.x.cflag |= 1; /* preset carry for potential failure */ int86(0x21, ®s, ®s); if (regs.x.cflag) /* if not succeed (carry flag set) */ { regs.x.ax = 0xAD02; /* 440C -> MS-DOS or DR-DOS only */ regs.x.bx = 0xFFFE; /* AD02 -> MS-DOS or FreeDOS only */ regs.x.cflag |= 1; int86(0x2F, ®s, ®s); } if ((!(regs.x.cflag)) && (regs.x.bx < 0xFFFE)) param_block[1] = regs.x.bx; return param_block[1]; } #elif defined(__WATCOMC__) && defined(__DOS__) /* Watcom C, 32 bit DOS */ /* rugxulo _AT_ gmail _DOT_ com */ #include #include #include unsigned short query_con_codepage(void) { union REGS regs; unsigned short param_block[2] = { 0, 437 }; regs.x.eax = 0x440C; /* GENERIC IO FOR HANDLES */ regs.x.ebx = 1; /* STDOUT */ regs.x.ecx = 0x036A; /* 3 = CON, 0x6A = QUERY SELECTED CP */ regs.x.edx = (unsigned short)param_block; regs.x.cflag |= 1; /* preset carry for potential failure */ int386(0x21, ®s, ®s); if (regs.x.cflag) /* if not succeed (carry flag set) */ { regs.x.eax = 0xAD02; /* 440C -> MS-DOS or DR-DOS only */ regs.x.ebx = 0xFFFE; /* AD02 -> MS-DOS or FreeDOS only */ regs.x.cflag |= 1; int386(0x2F, ®s, ®s); } if ((!(regs.x.cflag)) && (regs.x.ebx < 0xFFFE)) param_block[1] = regs.x.ebx; return param_block[1]; } #elif defined (_WIN32) && !defined(__CYGWIN__) /* Windows, not Cygwin */ /* Erwin Waterlander */ #include unsigned short query_con_codepage(void) { /* Get the console's DOS code page */ /* return((unsigned short)GetConsoleOutputCP()); */ /* The Windows version of Wcd writes the treedata * files in the system's default encoding, which is * the ANSI code page. */ /* Get the system's ANSI code page */ return((unsigned short)GetACP()); } #elif defined (__OS2__) /* OS/2 Warp */ #define INCL_DOS #include unsigned short query_con_codepage(void) { ULONG cp[3]; ULONG cplen; DosQueryCp(sizeof(cp), cp, &cplen); return((unsigned short)cp[0]); } #else /* Unix, other */ #ifndef __MSDOS__ #include #include #endif unsigned short query_con_codepage(void) { #ifndef __MSDOS__ if (strcmp(nl_langinfo(CODESET), "ISO-8859-1") == 0) return(28591); if (strcmp(nl_langinfo(CODESET), "ISO-8859-2") == 0) return(28592); #endif return(0); } #endif #ifdef TEST int main() { printf("\nCP%u\n",query_con_codepage() ); /* should be same result as */ return 0; /* "mode con cp /status" */ } #endif wcd-5.2.4/src/querycp.h0000644000175000010010000000012212066325113014204 0ustar waterlanNone/* querycp.h is in the public domain */ unsigned short query_con_codepage(void); wcd-5.2.4/src/stack.c0000644000175000010010000001263512127761643013642 0ustar waterlanNone/* Copyright (C) 1997-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. */ #include #include #include #include "std_macr.h" #include "structur.h" #include "nameset.h" #include "display.h" #include "dosdir.h" #include "WcdStack.h" #include "Text.h" #include "wcd.h" #include "stack.h" #include "config.h" #include "wcddir.h" /******************************************************************** * * stack_add * ********************************************************************/ int stack_add(WcdStack ws, char *dir) { ws->lastadded++; if(ws->lastadded == ws->maxsize) ws->lastadded = 0; ws->current = ws->lastadded; /* printWcdStack("add ", ws, stdout); */ /* free old dir string if present */ if (ws->dir != NULL) if((ws->dir[ws->lastadded] != NULL) && (ws->size == (size_t)ws->maxsize)) free (ws->dir[ws->lastadded]); putElementAtWcdStackDir(textNew(dir), (size_t)ws->lastadded, ws); return(0); } /******************************************************************** * * stack_read * ********************************************************************/ int stack_read(WcdStack ws,char *stackfilename) { FILE *infile; char tmp[DD_MAXPATH]; int line_nr=1; /* open stack-file */ if ((ws->maxsize <= 0)||((infile = wcd_fopen(stackfilename,"r",1)) == NULL)) { /* fprintf(stderr,"Wcd: error: Unable to read file %s\n",stackfilename); */ ws->lastadded = -1; ws->current = -1; } else { if(fscanf(infile,"%d %d",&ws->lastadded,&ws->current)==2) { while( !feof(infile)&&(ws->size < (size_t)ws->maxsize) ) { int len ; /* read a line */ len = wcd_getline(tmp,DD_MAXPATH,infile,stackfilename,&line_nr); ++line_nr; if (len > 0 ) addToWcdStackDir(textNew(tmp), ws); } } else { fprintf(stderr, "%s", _("Wcd: Error parsing stack\n")); ws->lastadded = -1; ws->current = -1; } wcd_fclose(infile, stackfilename, "r", "stack_read: "); if (ws->lastadded >= (int)ws->size) ws->lastadded = 0; if (ws->current >= (int)ws->size) ws->current = 0; } /* printWcdStack("READ ", ws, stdout); */ return(0); } /*******************************************************************/ int stack_print(WcdStack ws, int use_numbers, int use_stdout) { #ifdef WCD_USECONIO if (use_stdout == WCD_STDOUT_NO) return display_list_conio(NULL,ws,0,use_numbers); else return display_list_stdout(NULL,ws,0, use_stdout); #else # ifdef WCD_USECURSES int i; if ((use_stdout == WCD_STDOUT_NO) && ((i = display_list_curses(NULL,ws,0,use_numbers)) != WCD_ERR_CURSES)) return i; else return display_list_stdout(NULL,ws,0, use_stdout); # else return display_list_stdout(NULL,ws,0, use_stdout); # endif #endif } /******************************************************************** * * stack_push * ********************************************************************/ char* stack_push(WcdStack ws, int push_ntimes) { int new_stack_nr; if(ws == NULL) return (NULL); else if( ((ws->size) == 0) || ((ws->size) > (size_t)ws->maxsize) ) return (NULL); else { push_ntimes = push_ntimes % (int)ws->size; new_stack_nr = ws->current - push_ntimes; if(new_stack_nr < 0) new_stack_nr = (int)ws->size + new_stack_nr; ws->current = new_stack_nr; return(ws->dir[ws->current]); } } /******************************************************************** * * stack_pop * * * ********************************************************************/ char* stack_pop(WcdStack ws, int pop_ntimes) { int new_stack_nr; if(ws == NULL) return (NULL); else if( ((ws->size) == 0) || ((ws->size) > (size_t)ws->maxsize) ) return (NULL); else { pop_ntimes = pop_ntimes % (int)ws->size; new_stack_nr = ws->current + pop_ntimes; if(new_stack_nr > (int)(ws->size -1)) new_stack_nr = new_stack_nr - (int)ws->size; ws->current = new_stack_nr; return(ws->dir[ws->current]); } } /******************************************************************** * * stack_write * ********************************************************************/ int stack_write(WcdStack ws,char *stackfilename) { FILE *outfile; int i; if (ws->maxsize <= 0) return(0); else { /* create directory for stack file if it doesn't exist */ create_dir_for_file(stackfilename); if ( (outfile = wcd_fopen(stackfilename,"w",0)) == NULL) { return(0); } else { fprintf(outfile,"%d %d\n",ws->lastadded,ws->current); for(i=0;((i<(int)ws->size)&&(imaxsize));i++) { /* printf("writing line %d\n",i); */ fprintf(outfile,"%s\n",ws->dir[i]); } wcd_fclose(outfile, stackfilename, "w", "stack_write: "); } return(0); } } wcd-5.2.4/src/stack.h0000644000175000010010000000211011273517352013627 0ustar waterlanNone/* Copyright (C) 1997-1998 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 _STACK_H #define _STACK_H #define WCD_STACK_SIZE 10 int stack_read(WcdStack ws,char *stackfilename); int stack_print(WcdStack ws, int use_numbers, int use_stdout); int stack_write(WcdStack ws,char *stackfilename); int stack_add(WcdStack ws, char *dir); char* stack_push(WcdStack ws, int push_ntimes); char* stack_pop(WcdStack ws, int pop_ntimes); #endif wcd-5.2.4/src/tailor.h0000644000175000010010000000702112025724165014020 0ustar waterlanNone/* tailor.h Copyright (C) 1998-2012 Erwin Waterlander. Was original written by Mark Adler (Not copyrighted 1993) 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 _TAILOR_H #define _TAILOR_H /* Define __MSDOS__ for Turbo C and Power C */ #ifdef __POWERC # define __TURBOC__ # define __MSDOS__ #endif /* __POWERC */ #if (defined(__DOS__) && !defined(__MSDOS__)) # define __MSDOS__ #endif /* Watcom C DOS target. EW */ #if (defined(__MSDOS__) && !defined(MSDOS)) # define MSDOS #endif #if (defined(__NT__) && !defined(_WIN32)) # define _WIN32 #endif /* Watcom C Windows NT and 95 target. EW */ #if (defined(_WIN32) && !defined(WIN32)) # define WIN32 #endif #ifdef ATARI_ST # undef __MSDOS__ /* avoid the MS-DOS specific includes */ #endif /* Use prototypes and ANSI libraries if _STDC__, or Microsoft or Borland C, * or Silicon Graphics, or IBM C Set/2, or Watcom C, or GNU gcc under emx. */ #if defined(__STDC__) || defined(__MSDOS__) || defined(ATARI_ST) || defined(sgi) # ifndef PROTO # define PROTO # endif /* !PROTO */ # define MODERN #endif #if defined(__IBMC__) || defined(__EMX__) || defined(__WATCOMC__) # ifndef PROTO # define PROTO # endif /* !PROTO */ # define MODERN #endif #if defined(__BORLANDC__) || (defined(__alpha) && defined(VMS)) # ifndef PROTO # define PROTO # endif /* !PROTO */ # define MODERN #endif #ifdef __IBMC__ # define S_IFMT 0xF000 #endif /* __IBMC__ */ #if defined(__EMX__) || defined(__WATCOMC__) || defined(__BORLANDC__) # if (defined(__OS2__) && !defined(__32BIT__)) # define __32BIT__ # endif #endif #if (defined(__OS2__) && !defined(OS2)) # define OS2 #endif #if defined(__DJGPP__) /* MS-DOS extender: NOT Unix */ # undef unix # undef __unix # undef __unix__ #endif #if (defined(unix) || defined(__unix) || defined(__unix__)) # ifndef UNIX # define UNIX # endif #endif /* unix || __unix || __unix__ */ /* GCC on OS/2 defines _BSD_SOURCE in /usr/inlcude/features.h EW. */ #if (defined(linux) || defined(_BSD_SOURCE)) && !defined(__OS2__) # ifndef UNIX # define UNIX # endif #endif /* linux || _BSD_SOURCE */ #if (defined(M_XENIX) || defined(COHERENT) || defined(__hpux)) # ifndef UNIX # define UNIX # endif #endif /* M_XENIX || COHERENT || __hpux */ #if defined(__convexc__) || defined(MINIX) || defined(sgi) # ifndef UNIX # define UNIX # endif #endif /* __convexc__ || MINIX || sgi */ #ifdef __COMPILER_KCC__ # define TOPS20 # define NOPROTO #endif /* Turn off prototypes if requested */ #if (defined(NOPROTO) && defined(PROTO)) # undef PROTO #endif /* Used to remove arguments in function prototypes for non-ANSI C */ #ifdef PROTO # define OF(a) a #else /* !PROTO */ # define OF(a) () #endif /* ?PROTO */ #ifdef MACOS # define DYN_ALLOC #endif /* Define MSVMS if MSDOS or VMS defined -- ATARI also does, Amiga could */ #if defined(__MSDOS__) || defined(VMS) # define MSVMS #endif #endif /* end of tailor.h */ wcd-5.2.4/src/vc.mak0000755000175000010010000001104212026550505013454 0ustar waterlanNone# Common parts of the Microsoft Visual C++ makefiles. !if "$(ASCII_TREE)" == "1" CFLAGS = $(CFLAGS) /DASCII_TREE !endif !if "$(UCS)" == "1" CFLAGS = $(CFLAGS) /DWCD_UNICODE !endif stack.obj : $(SRCDIR)\stack.c $(CC) /c $(CFLAGS) $(SRCDIR)\stack.c match.obj : $(SRCDIR)\match.c $(CC) /c $(CFLAGS) $(SRCDIR)\match.c matchl.obj : $(SRCDIR)\matchl.c $(CC) /c $(CFLAGS) $(SRCDIR)\matchl.c matchw.obj : $(SRCDIR)\matchw.c $(CC) /c $(CFLAGS) $(SRCDIR)\matchw.c querycp.obj : $(SRCDIR)\querycp.c $(CC) /c $(CFLAGS) $(SRCDIR)\querycp.c wcwidth.obj : $(SRCDIR)\wcwidth.c $(CC) /c $(CFLAGS) $(SRCDIR)\wcwidth.c wfixpath.obj : $(SRCDIR)\wfixpath.c $(CC) /c $(CFLAGS) $(SRCDIR)\wfixpath.c dosdir.obj : $(SRCDIR)\dosdir.c $(CC) /c $(CFLAGS) $(SRCDIR)\dosdir.c display.obj : $(SRCDIR)\display.c $(CC) /c $(CFLAGS) $(SRCDIR)\display.c colors.obj : $(SRCDIR)\colors.c $(CC) /c $(CFLAGS) $(SRCDIR)\colors.c graphics.obj : $(SRCDIR)\graphics.c $(CC) /c $(CFLAGS) $(SRCDIR)\graphics.c wcd.obj : $(SRCDIR)\wcd.c $(CC) /c $(CFLAGS) $(CFLAGS_VERSION) $(SRCDIR)\wcd.c wcddir.obj : $(SRCDIR)\wcddir.c $(CC) /c $(CFLAGS) $(SRCDIR)\wcddir.c WcdStack.obj : $(SRCDIR)\c3po\WcdStack.c $(CC) /c $(CFLAGS) $(SRCDIR)\c3po\WcdStack.c Text.obj : $(SRCDIR)\c3po\Text.c $(CC) /c $(CFLAGS) $(SRCDIR)\c3po\Text.c nameset.obj : $(SRCDIR)\c3po\nameset.c $(CC) /c $(CFLAGS) $(SRCDIR)\c3po\nameset.c Error.obj : $(SRCDIR)\c3po\Error.c $(CC) /c $(CFLAGS) $(SRCDIR)\c3po\Error.c intset.obj : $(SRCDIR)\c3po\intset.c $(CC) /c $(CFLAGS) $(SRCDIR)\c3po\intset.c command.obj : $(SRCDIR)\c3po\command.c $(CC) /c $(CFLAGS) $(SRCDIR)\c3po\command.c dirnode.obj : $(SRCDIR)\c3po\dirnode.c $(CC) /c $(CFLAGS) $(SRCDIR)\c3po\dirnode.c PACKAGE = wcd exec_prefix = $(prefix) bindir = $(exec_prefix)\bin datarootdir = $(prefix)\share datadir = $(datarootdir) !ifndef docsubdir docsubdir = $(PACKAGE)-$(VERSION) !endif docdir = $(datarootdir)\doc\$(docsubdir) status: @echo "CFLAGS = $(CFLAGS)" @echo $(MAKEDIR) $(prefix): if not exist $@ mkdir $@ $(bindir): $(prefix) if not exist $@ mkdir $@ $(datarootdir): $(prefix) if not exist $@ mkdir $@ $(datarootdir)\doc: $(datarootdir) if not exist $@ mkdir $@ $(docdir): $(datarootdir)\doc if not exist $@ mkdir $@ install: $(PROGRAM) $(DOCFILES) $(bindir) $(docdir) copy $(PROGRAM) $(bindir) !if "$(PROGRAM)" == "wcdwin32.exe" copy ..\wcd.bat $(bindir) copy ..\wcd_win95.bat $(bindir) !endif !if "$(PROGRAM)" == "wcdwin64.exe" copy ..\wcd.bat $(bindir) !endif $(MAKE) install-doc $(SRCDIR)\man\man1\wcd1.pod : $(SRCDIR)\man\man1\wcd1pod.in cl /EP /C /Ddos /Dunix $** > $@ $(SRCDIR)\..\doc\wcd.txt : $(SRCDIR)\man\man1\wcd1.pod pod2text $** > $@ $(SRCDIR)\..\doc\wcd.$(HTMLEXT) : $(SRCDIR)\man\man1\wcd1.pod pod2html --title="$(PACKAGE) $(VERSION) - Wherever Change Directory" $** > $@ txt: $(SRCDIR)\..\doc\wcd.txt html: $(SRCDIR)\..\doc\wcd.$(HTMLEXT) doc : $(DOCFILES) install-doc: $(docdir) $(DOCFILES) copy $(SRCDIR)\..\doc\faq.txt $(docdir) copy $(SRCDIR)\..\doc\whatsnew.txt $(docdir) copy $(SRCDIR)\..\doc\README.txt $(docdir) copy $(SRCDIR)\..\doc\problems.txt $(docdir) copy $(SRCDIR)\..\doc\todo.txt $(docdir) copy $(SRCDIR)\..\doc\INSTALL.txt $(docdir) copy $(SRCDIR)\..\doc\INST_DOS.txt $(docdir) copy $(SRCDIR)\..\doc\translat.txt $(docdir) copy $(SRCDIR)\..\doc\copying.txt $(docdir) copy $(SRCDIR)\..\doc\$(PACKAGE).txt $(docdir) copy $(SRCDIR)\..\doc\$(PACKAGE).$(HTMLEXT) $(docdir) uninstall: -del $(bindir)\$(PROGRAM) !if "$(PROGRAM)" == "wcdwin32.exe" -del $(bindir)\wcd.bat -del $(bindir)\wcd_win95.bat !endif !if "$(PROGRAM)" == "wcdwin64.exe" -del $(bindir)\wcd.bat !endif -rmdir /s /q $(docdir) !ifndef VERSIONSUFFIX VERSIONSUFFIX = -bin !endif !ifndef ZIPFILE ZIPFILE = $(PACKAGE)$(VERSION)$(VERSIONSUFFIX).zip !endif !ifndef ZIPFILEDIR ZIPFILEDIR = ..\..\.. !endif ZIPOBJ = bin\$(PROGRAM) share\doc\$(docsubdir) $(ZIPOBJ_EXTRA) DISTCMD = dist.bat dist : @echo cd /d $(prefix) > $(DISTCMD) @echo unix2dos -k share\doc\$(docsubdir)\*.txt >> $(DISTCMD) @echo unix2dos -k share\doc\$(docsubdir)\*.$(HTMLEXT) >> $(DISTCMD) @echo zip -r $(ZIPFILE) $(ZIPOBJ) >> $(DISTCMD) @echo cd /d $(MAKEDIR) >> $(DISTCMD) @echo move $(prefix)\$(ZIPFILE) $(ZIPFILEDIR) >> $(DISTCMD) .\$(DISTCMD) mostlyclean: -del *~ -del *.bak -del *.obj -del *.exe -del *.tmp -del $(DISTCMD) clean: mostlyclean -del $(DOCFILES) wcd-5.2.4/src/version.mk0000644000175000010010000000010012207427053014360 0ustar waterlanNone VERSION = 5.2.4 VERSION_SHORT = 524 VERSION_DATE = 2013-08-28 wcd-5.2.4/src/watcom.mif0000755000175000010010000001143612026164112014343 0ustar waterlanNone# Common parts of the Watcom C makefiles. !ifdef ASCII_TREE CFLAGS += -dASCII_TREE !endif !ifeq UCS 1 CFLAGS += -dWCD_UNICODE -za99 !endif stack.obj : $(SRCDIR)\stack.c $(CC) $(CFLAGS) $(SRCDIR)\stack.c match.obj : $(SRCDIR)\match.c $(CC) $(CFLAGS) $(SRCDIR)\match.c matchl.obj : $(SRCDIR)\matchl.c $(CC) $(CFLAGS) $(SRCDIR)\matchl.c matchw.obj : $(SRCDIR)\matchw.c $(CC) $(CFLAGS) $(SRCDIR)\matchw.c querycp.obj : $(SRCDIR)\querycp.c $(CC) $(CFLAGS) $(SRCDIR)\querycp.c wcwidth.obj : $(SRCDIR)\wcwidth.c $(CC) $(CFLAGS) $(SRCDIR)\wcwidth.c wfixpath.obj : $(SRCDIR)\wfixpath.c $(CC) $(CFLAGS) $(SRCDIR)\wfixpath.c dosdir.obj : $(SRCDIR)\dosdir.c $(CC) $(CFLAGS) $(SRCDIR)\dosdir.c display.obj : $(SRCDIR)\display.c $(CC) $(CFLAGS) $(SRCDIR)\display.c colors.obj : $(SRCDIR)\colors.c $(CC) $(CFLAGS) $(SRCDIR)\colors.c graphics.obj : $(SRCDIR)\graphics.c $(CC) $(CFLAGS) $(SRCDIR)\graphics.c wcd.obj : $(SRCDIR)\wcd.c $(CC) $(CFLAGS) $(CFLAGS_VERSION) $(SRCDIR)\wcd.c wcddir.obj : $(SRCDIR)\wcddir.c $(CC) $(CFLAGS) $(SRCDIR)\wcddir.c WcdStack.obj : $(SRCDIR)\c3po\WcdStack.c $(CC) $(CFLAGS) $(SRCDIR)\c3po\WcdStack.c Text.obj : $(SRCDIR)\c3po\Text.c $(CC) $(CFLAGS) $(SRCDIR)\c3po\Text.c nameset.obj : $(SRCDIR)\c3po\nameset.c $(CC) $(CFLAGS) $(SRCDIR)\c3po\nameset.c Error.obj : $(SRCDIR)\c3po\Error.c $(CC) $(CFLAGS) $(SRCDIR)\c3po\Error.c intset.obj : $(SRCDIR)\c3po\intset.c $(CC) $(CFLAGS) $(SRCDIR)\c3po\intset.c command.obj : $(SRCDIR)\c3po\command.c $(CC) $(CFLAGS) $(SRCDIR)\c3po\command.c dirnode.obj : $(SRCDIR)\c3po\dirnode.c $(CC) $(CFLAGS) $(SRCDIR)\c3po\dirnode.c PACKAGE = wcd exec_prefix = $(prefix) bindir = $(exec_prefix)\bin datarootdir = $(prefix)\share datadir = $(datarootdir) !ifndef docsubdir docsubdir = $(PACKAGE)-$(VERSION) !endif docdir = $(datarootdir)\doc\$(docsubdir) status: .SYMBOLIC @echo CFLAGS = $(CFLAGS) $(prefix): .EXISTSONLY mkdir $@ $(bindir): $(prefix) .EXISTSONLY mkdir $@ $(datarootdir): $(prefix) .EXISTSONLY mkdir $@ $(datarootdir)\doc: $(datarootdir) .EXISTSONLY mkdir $@ $(docdir): $(datarootdir)\doc .EXISTSONLY mkdir $@ install: $(PROGRAM) $(DOCFILES) $(bindir) $(docdir) .SYMBOLIC copy $(PROGRAM) $(bindir) !ifeq PROGRAM wcdwin32.exe copy ..\wcd.bat $(bindir) copy ..\wcd_win95.bat $(bindir) !endif !ifeq PROGRAM wcdos2.exe copy ..\wcd.cmd $(bindir) !endif $(MAKE) install-doc $(SRCDIR)\man\man1\wcd1.pod : $(SRCDIR)\man\man1\wcd1pod.in wcc386 -pc -ddos -dunix $< > $@ $(SRCDIR)\..\doc\wcd.txt : $(SRCDIR)\man\man1\wcd1.pod pod2text $< > $@ $(SRCDIR)\..\doc\wcd.$(HTMLEXT) : $(SRCDIR)\man\man1\wcd1.pod pod2html --title="$(PACKAGE) $(VERSION) - Wherever Change Directory" $< > $@ txt: $(SRCDIR)\..\doc\wcd.txt .SYMBOLIC html: $(SRCDIR)\..\doc\wcd.$(HTMLEXT) .SYMBOLIC doc : $(DOCFILES) .SYMBOLIC install-doc: $(docdir) $(DOCFILES) .SYMBOLIC copy $(SRCDIR)\..\doc\faq.txt $(docdir) copy $(SRCDIR)\..\doc\whatsnew.txt $(docdir) copy $(SRCDIR)\..\doc\README.txt $(docdir) copy $(SRCDIR)\..\doc\problems.txt $(docdir) copy $(SRCDIR)\..\doc\todo.txt $(docdir) copy $(SRCDIR)\..\doc\INSTALL.txt $(docdir) copy $(SRCDIR)\..\doc\INST_DOS.txt $(docdir) copy $(SRCDIR)\..\doc\translat.txt $(docdir) copy $(SRCDIR)\..\doc\copying.txt $(docdir) copy $(SRCDIR)\..\doc\$(PACKAGE).txt $(docdir) copy $(SRCDIR)\..\doc\$(PACKAGE).$(HTMLEXT) $(docdir) uninstall: .SYMBOLIC -del $(bindir)\$(PROGRAM) !ifeq PROGRAM wcdwin32.exe -del $(bindir)\wcd.bat -del $(bindir)\wcd_win95.bat !endif !ifeq PROGRAM wcdos2.exe -del $(bindir)\wcd.cmd !endif -rmdir /s /q $(docdir) !ifndef VERSIONSUFFIX VERSIONSUFFIX = -bin !endif !ifndef ZIPFILE ZIPFILE = $(PACKAGE)$(VERSION)$(VERSIONSUFFIX).zip !endif !ifndef ZIPFILEDIR ZIPFILEDIR = ..\..\.. !endif ZIPOBJ = bin\$(PROGRAM) share\doc\$(docsubdir) $(ZIPOBJ_EXTRA) CURDISK = $+ $(%cdrive): $- CURDIR = $+ $(%cwd) $- !ifdef __OS2__ DISTCMD = dist.cmd !else DISTCMD = dist.bat !endif dist : .SYMBOLIC @%create $(DISTCMD) @%append $(DISTCMD) set PREFIX=$(prefix) @%append $(DISTCMD) set PREFIXDISK=%PREFIX:~0,2% @%append $(DISTCMD) %PREFIXDISK% @%append $(DISTCMD) cd $(prefix) @%append $(DISTCMD) unix2dos -k share\doc\$(docsubdir)\*.txt @%append $(DISTCMD) unix2dos -k share\doc\$(docsubdir)\*.$(HTMLEXT) @%append $(DISTCMD) zip -r $(ZIPFILE) $(ZIPOBJ) @%append $(DISTCMD) $(CURDISK) @%append $(DISTCMD) cd $(CURDIR) @%append $(DISTCMD) move $(prefix)\$(ZIPFILE) $(ZIPFILEDIR) .\$(DISTCMD) mostlyclean: .SYMBOLIC -del *~ -del *.bak -del *.obj -del *.ilk -del *.map -del *.err -del *.sym -del *.exe -del *.tmp -del $(DISTCMD) clean: mostlyclean .SYMBOLIC -del $(DOCFILES) wcd-5.2.4/src/wcd.c0000644000175000010010000034656112205217412013305 0ustar waterlanNone/* filename: WCD.C WCD - Chdir for Dos and Unix. Author: Erwin Waterlander E-mail : waterlan@xs4all.nl WWW : http://waterlan.home.xs4all.nl/ ====================================================================== = Copyright = ====================================================================== Copyright (C) 1997-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. ======================================================================= Jason Mathews' file filelist.c was a starting point for this file. */ #include #include #include #include #include #include #if !defined(__TURBOC__) && !defined(_MSC_VER) # include #endif #ifdef __TURBOC__ #define __FLAT__ #endif #include #ifdef _MSC_VER #include #define S_ISDIR( m ) (((m) & _S_IFMT) == _S_IFDIR) #define S_ISREG( m ) (((m) & _S_IFMT) == _S_IFREG) #endif #ifdef __DJGPP__ # include #endif #include "wcd.h" #ifndef __MSDOS__ /* Win32, OS/2, Unix, Cygwin */ #include #endif #if !defined(__MSDOS__) && !defined(_WIN32) && !defined(__OS2__) && !defined(__MSYS__) /* Unix, Cygwin */ # include #endif #include "querycp.h" #include "dosdir.h" #include "match.h" #ifdef WCD_UNICODE # include "matchw.h" #else # include "matchl.h" #endif #include "std_macr.h" #include "structur.h" #include "Error.h" #include "Text.h" #include "nameset.h" #include "WcdStack.h" #include "dirnode.h" #include "stack.h" #include "display.h" #include "wfixpath.h" #include "graphics.h" #include "wcddir.h" #include "config.h" #if defined(_WIN32) || defined(WCD_UNICODE) # include #endif #if defined (_WIN32) && !defined(__CYGWIN__) # include #endif #ifdef __CYGWIN__ # undef _WIN32 #endif /* Global variables */ const wcd_char *default_mask = ALL_FILES_MASK; /* Disable wildcard globbing */ #ifdef __MINGW32__ # ifdef __MINGW64__ int _dowildcard = 0; # else int _CRT_glob = 0; # endif #endif #ifdef __DJGPP__ #include char **__crt0_glob_function (char *arg) { return 0; } #endif /* Use wcd_fprintf() when we write to files. To get an * error message when the disk is full or quota is exceeded. Because the output is buffered, you may not get the disk-full error during fprintf(), but during fclose() when the buffer is flushed to disk. When you write a lot of data, more than fits in the buffer, the buffer is flushed in the meantime, before closing the file and you get the disk-full error during fprintf(). You may not get the error message during fclose() then. Therefore we have to check for errors during writing to file AND when the file is closed. */ int wcd_fprintf(FILE *stream, const char *format, ...) { va_list args; int rc; char *errstr; va_start(args, format); rc = vfprintf(stream, format, args); va_end(args); if (rc < 0) { errstr = strerror(errno); fprintf(stderr,_("Wcd: error: %s\n"), errstr); } return(rc); } FILE *wcd_fopen(const char *filename, const char *m, int quiet) { struct stat buf; FILE *f; char *errstr; int loc_quiet; #if DEBUG fprintf(stderr, _("Wcd: wcd_fopen: Opening file \"%s\" mode=%s quiet=%d\n"),filename, m, quiet); loc_quiet = 0; #else loc_quiet = quiet; #endif if (m[0] == 'r') /* we try to read an existing file */ { if (stat(filename, &buf) != 0) /* check if file exists */ { if ( !loc_quiet ) { errstr = strerror(errno); fprintf(stderr,_("Wcd: error: Unable to read file %s: %s\n"), filename, errstr); } return(NULL); } if (!S_ISREG(buf.st_mode)) /* check if it is a file */ { if ( !loc_quiet ) { fprintf(stderr,_("Wcd: error: Unable to read file %s: Not a regular file.\n"), filename); } return(NULL); } } f = fopen(filename, m); /* open the file */ if ( !loc_quiet && (f == NULL)) { errstr = strerror(errno); if (m[0] == 'r') fprintf(stderr,_("Wcd: error: Unable to read file %s: %s\n"), filename, errstr); else fprintf(stderr,_("Wcd: error: Unable to write file %s: %s\n"), filename, errstr); } #if DEBUG fprintf(stderr, _("Wcd: wcd_fopen: Opening file \"%s\" OK.\n"), filename); #endif return(f); } /* wcd_fopen_type, similar as wcd_fopen, but also returns file * type based on Unicode BOM. */ FILE *wcd_fopen_bom(const char *filename, const char *m, int quiet, int *bomtype) { FILE *f; int bom[3]; /* BOMs * UTF16-LE ff fe * UTF16-BE fe ff * UTF-8 ef bb bf */ *bomtype = FILE_MBS; f = wcd_fopen(filename, m, quiet); /* Check for BOM */ if ((m[0] == 'r') && (f != NULL)) { if ((bom[0] = fgetc(f)) == EOF) { ungetc(bom[0], f); *bomtype = FILE_MBS; return(f); } if ((bom[0] != 0xff) && (bom[0] != 0xfe) && (bom[0] != 0xef)) { ungetc(bom[0], f); *bomtype = FILE_MBS; return(f); } if ((bom[1] = fgetc(f)) == EOF) { ungetc(bom[1], f); ungetc(bom[0], f); *bomtype = FILE_MBS; return(f); } if ((bom[0] == 0xff) && (bom[1] == 0xfe)) /* UTF16-LE */ { *bomtype = FILE_UTF16LE; return(f); } if ((bom[0] == 0xfe) && (bom[1] == 0xff)) /* UTF16-BE */ { *bomtype = FILE_UTF16BE; return(f); } if ((bom[2] = fgetc(f)) == EOF) { ungetc(bom[2], f); ungetc(bom[1], f); ungetc(bom[0], f); *bomtype = FILE_MBS; return(f); } if ((bom[0] == 0xef) && (bom[1] == 0xbb) && (bom[2]== 0xbf)) /* UTF-8 */ { *bomtype = FILE_UTF8; return(f); } ungetc(bom[2], f); ungetc(bom[1], f); ungetc(bom[0], f); *bomtype = FILE_MBS; return(f); } return(f); } void wcd_fclose(FILE *fp, const char *filename, const char *m, const char *functionname) { char *errstr; if (fclose(fp) != 0) { errstr = strerror(errno); if (m[0] == 'w') fprintf(stderr,_("Wcd: error: Unable to write file %s: %s\n"), filename, errstr); else fprintf(stderr,_("Wcd: error: Unable to close file %s: %s\n"), filename, errstr); } #if DEBUG else fprintf(stderr, _("Wcd: %sClosing file \"%s\" OK.\n"), functionname, filename); #endif } /******************************************************************** * void cleanPath(char path[], int len, minlength) * * Clean path string from ending '/' character. * * Borland's chdir() function cannot change to paths ending with '/' * or '\' except root itself (/ or \). * ********************************************************************/ void cleanPath(char path[], int len, int minlength) { /* strip ending separator (if present) */ if (len > minlength && path[len-1]==DIR_SEPARATOR && path[len-2]!=':') path[len-1] = '\0'; } void rmDriveLetter(char path[], int *use_HOME) { char *ptr; if (path == NULL) return; /* remove drive letter */ if (*use_HOME == 0 ) if ( (ptr=strstr(path,"/")) != NULL) strcpy(path,ptr); } void rmDirFromList(char *string, nameset n) { char dir[DD_MAXPATH]; char subdir[DD_MAXPATH]; size_t i; strcpy(dir,string); wcd_fixpath(dir,sizeof(dir)); strcpy(subdir,dir); strcat(subdir,"/*"); i = 0; while (i < n->size ) { #ifdef _WCD_DOSFS if( dd_match(n->array[i],dir,1) || dd_match(n->array[i],subdir,1)) #else if( dd_match(n->array[i],dir,0) || dd_match(n->array[i],subdir,0)) #endif removeElementAtNamesetArray(i,n,true); else ++i; } } /********************************/ void writeList(char * filename, nameset n, int bomtype) { size_t i; FILE *outfile; int rc = 0; #ifdef WCD_ANSI char path[DD_MAXPATH]; wchar_t pathw[DD_MAXPATH]; #endif if ( (outfile = wcd_fopen(filename,"w",0)) != NULL) { #ifdef WCD_UTF16 wcd_fprintf(outfile, "%s", "\xEF\xBB\xBF"); /* UTF-8 BOM */ #endif #ifdef WCD_ANSI /* non-Unicode Windows version */ /* When the treefile was in Unicode the non-Unicode Windows version of wcd translated the Unicode directory names to the system default ANSI code page. */ if (bomtype > 0) /* Unicode, write back in UTF-8 */ wcd_fprintf(outfile, "%s", "\xEF\xBB\xBF"); /* UTF-8 BOM */ #endif for(i=0;((isize)&&(rc>=0));i++) { #ifdef WCD_ANSI if (bomtype > 0) { /* Unicode, write back in UTF-8. Characters that are not supported by the ANSI code page get broken. */ strncpy(path, n->array[i], sizeof(path)); MultiByteToWideChar(CP_ACP, 0, path, -1, pathw, sizeof(pathw)); WideCharToMultiByte(CP_UTF8, 0, pathw, -1, path, sizeof(path), NULL, NULL); rc = wcd_fprintf(outfile,"%s\n",path); } else rc = wcd_fprintf(outfile,"%s\n",n->array[i]); #else rc = wcd_fprintf(outfile,"%s\n",n->array[i]); #endif } wcd_fclose(outfile, filename, "w", "writeList: "); } } #ifdef UNIX /************************************************************* * void stripTmpMnt(char* path) * * This function stips /tmp_mnt from path if it begins with it. * /tmp_mnt is used by the automounter. * *************************************************************/ void stripTmpMnt(char* path) { char* ptr; if (path != NULL) { if (strncmp(path,TMP_MNT_STR,strlen(TMP_MNT_STR)) == 0) { ptr = path + strlen(TMP_MNT_STR) - 1 ; strcpy(path,ptr); } } } #endif #ifdef WCD_UNIXSHELL /************************************************************* * * void quoteString(char *string) * * ----- * quote all metacharacters (; & $ ( ) | < > space), quotes ("), * apostrophes ('), grave accents (`), wildcard characters * (* ? [ ]), and backslashes (\) with a backslash. * * Quoting every character with a backslash seems to be * the most portable solution. Using apostrophes ('...') to quote the whole * string makes it impossible to quote an apostrophe in the path. Using quotes * ("...") does not work well in csh, because you can't escape a $ character * inside quotes to stop variable substitution, and you can't escape a grave * accent. * * Functions is_slash() and is_term() in file wfixpath.c have also * been modified so that a backslash is not replaced by slash anymore * on UNIX systems. * * Erwin Waterlander Oct 17 2001 *************************************************************/ void quoteString(char *string) { size_t i, j; int k,kmax; char help1_str[DD_MAXPATH]; j = strlen(string); k = 0; kmax = DD_MAXPATH -3; for (i=0; (i < j)&&(k < kmax) ; i++) { if ( (string[i] == '"') || (string[i] == '$') || (string[i] == '&') || (string[i] == '\'') || (string[i] == '(') || (string[i] == ')') || (string[i] == '*') || (string[i] == ';') || (string[i] == '<') || (string[i] == '>') || (string[i] == '?') || (string[i] == '[') || (string[i] == '\\') || (string[i] == ']') || (string[i] == ' ') || (string[i] == '`') || (string[i] == '|') ) { help1_str[k] = '\\'; k++; } help1_str[k] = string[i]; k++ ; } help1_str[k] = '\0' ; strcpy(string,help1_str); } #endif /************************************************************* * * void quoteString(char *string) * * For cmd.exe on Windows and OS/2, and Windows PowerShell. * We need backslashes instead of forward slashes. * * ----- * Quoting ("...") is needed for paths that contain '&' characters * Quote '%' characters with '%', needed when cd command is executed * via batch file. * Oct 16 2001 * *************************************************************/ #if (defined(_WIN32) && !defined(WCD_WINZSH)) || (defined(__OS2__) && !defined(WCD_OS2BASH)) void quoteString(char *string) { size_t i, j; int k,kmax; char help1_str[DD_MAXPATH]; j = strlen(string); help1_str[0] = '"'; k = 1; kmax = DD_MAXPATH -3; for (i=0; (i < j)&&(k < kmax) ; i++) { #ifndef WCD_WINPWRSH if (string[i] == '%') { help1_str[k] = '%'; k++; } #endif if (string[i] == '/') help1_str[k] = '\\'; else help1_str[k] = string[i]; k++ ; } help1_str[k] = '"' ; k++; help1_str[k] = '\0' ; strcpy(string,help1_str); } #endif /************************************************************* * * changeDisk * * Returns: * On succes : the new drive number >=0, or the current * disk number >=0 if there was no drive to go to. * Fail : -1 * *************************************************************/ #ifdef _WCD_DOSFS int changeDisk(char *path, int *changed, char *newdrive, int *use_HOME) { int i = -1, destDisk; char *ptr; char drive[DD_MAXDRIVE]; i = getdisk(); /* current disk */ if (strlen(path)>1) { strncpy(drive,path,2); drive[DD_MAXDRIVE-1] = '\0'; if (dd_match(drive,"[a-z]:",1)) { destDisk = islower(*drive) ? *drive-'a' : *drive-'A'; if (destDisk >= 0) { setdisk(destDisk); i = getdisk(); /* new disk */ } if ((i==destDisk) && (i>=0)) /* succes ? */ { *changed = 1 ; strcpy(newdrive,drive) ; if((use_HOME == NULL)||(*use_HOME == 0)) { ptr = path + 2; if (strcmp(ptr,"") == 0) { strcpy(path,"/"); } else { strcpy(path,ptr); } } } else i = -1; } } return(i); } #endif /*****************************************************************/ void getCurPath(char *buffer, size_t size, int *use_HOME) { size_t len; if(wcd_getcwd(buffer, size) != NULL) { len = strlen(buffer); if (len==0) buffer[len] = '\0'; wcd_fixpath(buffer,size); rmDriveLetter(buffer,use_HOME); } } /***************************************************************** * add current path to file. * *****************************************************************/ void addCurPathToFile(char *filename,int *use_HOME, int parents) { char tmp[DD_MAXPATH]; /* tmp string buffer */ FILE *outfile; getCurPath(tmp,(size_t)DD_MAXPATH,use_HOME); if(tmp != NULL) { /* open the treedata file */ if ((outfile = wcd_fopen(filename,"a",0)) != NULL) { wcd_fprintf(outfile,"%s\n",tmp); wcd_printf(_("Wcd: %s added to file %s\n"),tmp,filename); if (parents) { char *ptr ; while ( (ptr = strrchr(tmp,DIR_SEPARATOR)) != NULL) { *ptr = '\0' ; /* keep one last separator in the path */ if (strrchr(tmp,DIR_SEPARATOR) != NULL) { wcd_fprintf(outfile,"%s\n",tmp); wcd_printf(_("Wcd: %s added to file %s\n"),tmp,filename); } } } wcd_fclose(outfile, filename, "w", "addCurPathToFile: "); } } } /****************************************************************/ typedef struct TDirTag { char* dirname; struct TDirTag *next; } TDirEntry; typedef struct { TDirEntry *head, *tail; } TDirList; /* Function: SpecialDir * * Purpose: Test for special directories * * Returns: 1 if path = "." or ".." * 0 otherwise. */ int SpecialDir(const char *path) { if (*path != '.') return 0; if (*(++path) == '.') path++; return (*path=='/' || *path=='\0'); } /****************************************************************** * * q_insert - insert directory name to queue * ******************************************************************/ void q_insert(TDirList *list,const char *s) { TDirEntry *ptr; size_t len = strlen(s); if (!len) return; if ((ptr = (TDirEntry*) malloc(sizeof(TDirEntry))) == NULL ) { perror("malloc"); return; } if ((ptr->dirname = (char*) malloc(len+1)) == NULL ) { perror("malloc"); free(ptr); return; } strcpy(ptr->dirname, s); ptr->next = NULL; if (!list->head) list->head = ptr; else list->tail->next = ptr; list->tail = ptr; } /******************************************************************* * * q_remove - remove directory name from queue * *******************************************************************/ int q_remove(TDirList *list,char *s) { TDirEntry *ptr = list->head; if (!ptr) return 0; /* queue empty? */ strcpy(s, ptr->dirname); list->head = ptr->next; free(ptr->dirname); free(ptr); return 1; /* okay */ } /******************************************************************** * * rmTree(dir) * * Recursively delete directory: *dir * ********************************************************************/ #ifdef __DJGPP__ /* The 32 bit dos versions are compiled with DJGPP and do not use DOSDIR. DJGPP is a mix of DOS/Unix (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. */ void rmTree(char *dir) { static struct ffblk fb; /* file block structure */ char tmp[DD_MAXPATH]; /* tmp string */ int rc; /* error code */ TDirList list; /* directory queue */ char *errstr; if (dir) { if (wcd_chdir(dir,0)) return; /* Go to the dir, else return */ } else return ; /* dir == NULL */ rc = findfirst( default_mask, &fb, FA_DIREC|FA_RDONLY|FA_HIDDEN|FA_SYSTEM|FA_ARCH|FA_LABEL); list.head = list.tail = 0; while (rc==0) /* go through all the files in the current dir */ { if (DD_ISDIREC(fb.ff_attrib)) { #ifndef VMS /* Ignore directory entries starting with '.' * which includes the current and parent directories. */ if (!SpecialDir(fb.ff_name)) #endif /* ?!VMS */ q_insert(&list, fb.ff_name); /* add all directories in current dir to list */ } else if ( unlink(fb.ff_name) != 0) /* not a directory */ { errstr = strerror(errno); fprintf(stderr,_("Wcd: error: Unable to remove file %s: %s\n"), fb.ff_name, errstr); } rc = findnext(&fb); } /* while !rc */ /* recursively parse subdirectories (if any) */ while (q_remove(&list, tmp)) { rmTree(tmp); wcd_rmdir(tmp,0); } wcd_chdir(DIR_PARENT,0); /* go to parent directory */ } #else /* not DJGPP */ void rmTree(char *dir) { static dd_ffblk fb; /* file block structure */ char tmp[DD_MAXPATH]; /* tmp string */ int rc; /* error code */ char *errstr; TDirList list; /* directory queue */ if (dir) { if (wcd_chdir(dir,0)) return; /* Go to the dir, else return */ } else return ; /* dir == NULL */ /* Don't set DD_LABEL. Otherwise wcd compiled with Borland CPP 5.x bcc32 finds no files or directories at all. This was seen with Borland CPP 5.02 and 5.5.1. Apr 29 2005 Erwin Waterlander */ rc = dd_findfirst( default_mask, &fb, DD_DIREC|DD_RDONLY|DD_HIDDEN|DD_SYSTEM|DD_ARCH|DD_DEVICE ); /* Unix: dd_findfirst is a wrapper around 'opendir'. The directory opened in dd_findfirst * has to be closed by 'closedir' in dd_findnext. So do not exit this function until * the dd_findnext loop is complete. Otherwise directories will be left open and you * will have a memory leak. When too many directories are left open getcwd() may return * an incorrect pathname. */ list.head = list.tail = 0; while (rc==0) /* go through all the files in the current dir */ { if (DD_ISDIREC(fb.dd_mode)) { #ifndef VMS /* Ignore directory entries starting with '.' * which includes the current and parent directories. */ if (!SpecialDir(fb.dd_name)) #endif /* ?!VMS */ q_insert(&list, fb.dd_name); /* add all directories in current dir to list */ } else if ( unlink(fb.dd_name) != 0) /* not a directory */ { errstr = strerror(errno); fprintf(stderr,_("Wcd: error: Unable to remove file %s: %s\n"), fb.dd_name, errstr); } rc = dd_findnext(&fb); } /* while !rc */ /* recursively parse subdirectories (if any) */ while (q_remove(&list, tmp)) { rmTree(tmp); wcd_rmdir(tmp,0); } wcd_chdir(DIR_PARENT,0); /* go to parent directory */ } #endif /******************************************************************** * * pathInNameset(char *path, nameset set) * * Test if *path is a directory or a subdirectory of one * of the paths in set. * * set is a list of paths. * wildcards are supported. * * * Returns (size_t)-1 if directory is not in nameset. * Returns index number (>=0) of first match found if directory is in nameset. * ********************************************************************/ size_t pathInNameset (text path, nameset set) { char tmp[DD_MAXPATH+2]; size_t size, index = 0; if ((path == NULL)||(set == NULL)) return((size_t)-1); size = getSizeOfNamesetArray(set); while (index < size) { strcpy(tmp,set->array[index]); strcat(tmp,"/*"); #ifdef _WCD_DOSFS if ((dd_match(path,set->array[index],1)) || (dd_match(path, tmp,1))) #else if ((dd_match(path,set->array[index],0)) || (dd_match(path, tmp,0))) #endif { return(index); } ++index; } return((size_t)-1); } /******************************************************************** * * finddirs(char *dir, size_t *offset, FILE *outfile, int *use_HOME, int quiet) * ********************************************************************/ #ifdef __DJGPP__ /* * See comment above function rmTree(). */ void finddirs(char* dir, size_t *offset, FILE *outfile, int *use_HOME, nameset exclude, int quiet) { static struct ffblk fb; /* file block structure */ static char tmp[DD_MAXPATH]; /* tmp string buffer */ int rc; /* error code */ size_t len ; TDirList list; /* directory queue */ char *tmp_ptr ; if (dir) { if (wcd_chdir(dir,quiet)) return; /* ?err */ } else return ; /* dir == NULL */ if (wcd_getcwd(tmp, sizeof(tmp)) == NULL) { fprintf(stdout,_("Wcd: error: finddirs(): can't determine path in directory %s\nWcd: path probably too long.\n"),dir); wcd_chdir(DIR_PARENT,quiet); /* go to parent directory */ return; }; wcd_fixpath(tmp,sizeof(tmp)); rmDriveLetter(tmp,use_HOME); if (pathInNameset(tmp,exclude) != (size_t)-1) { wcd_chdir(DIR_PARENT,quiet); /* go to parent directory */ return; } len = strlen(tmp); if(*offset < len) tmp_ptr = tmp + *offset ; else tmp_ptr = tmp + len; /* tmp_ptr points to ending '\0' of tmp */ if (wcd_fprintf(outfile,"%s\n", tmp_ptr) < 0) return; /* Quit when we can't write path to disk */ rc = findfirst( default_mask, &fb, FA_DIREC|FA_RDONLY|FA_HIDDEN|FA_SYSTEM|FA_ARCH|FA_LABEL ); list.head = list.tail = 0; while (rc==0) /* go through all the files in the current dir */ { if (DD_ISDIREC(fb.ff_attrib)) { /* Ignore directory entries starting with '.' * which includes the current and parent directories. */ if (!SpecialDir(fb.ff_name)) q_insert(&list, fb.ff_name); } rc = findnext(&fb); } /* while !rc */ /* recursively parse subdirectories (if any) (quiet) */ while (q_remove(&list, tmp)) finddirs(tmp,offset, outfile, use_HOME, exclude, 1); if (dir) wcd_chdir(DIR_PARENT,quiet); /* go to parent directory */ } #else /* not DJGPP */ void finddirs(char *dir, size_t *offset, FILE *outfile, int *use_HOME, nameset exclude, int quiet) { static dd_ffblk fb; /* file block structure */ static char tmp[DD_MAXPATH]; /* tmp string buffer */ int rc; /* error code */ size_t len ; TDirList list; /* directory queue */ char *tmp_ptr ; if (dir) { if (wcd_chdir(dir,quiet)) return; /* Go to the dir, else return */ } else return ; /* dir == NULL */ if (wcd_getcwd(tmp, sizeof(tmp)) == NULL) { fprintf(stdout,_("Wcd: error: finddirs(): can't determine path in directory %s\nWcd: path probably too long.\n"),dir); wcd_chdir(DIR_PARENT,1); /* go to parent directory */ return; }; #ifdef _WCD_DOSFS wcd_fixpath(tmp,sizeof(tmp)); rmDriveLetter(tmp,use_HOME); #endif if (pathInNameset(tmp,exclude) != (size_t)-1) { wcd_chdir(DIR_PARENT,1); /* go to parent directory */ return; } len = strlen(tmp); if(*offset < len) tmp_ptr = tmp + *offset ; else tmp_ptr = tmp + len; /* tmp_ptr points to ending '\0' of tmp */ if (wcd_fprintf(outfile,"%s\n", tmp_ptr) < 0) return; /* Quit when we can't write path to disk */ /* Don't set DD_LABEL. Otherwise wcd compiled with Borland CPP 5.x bcc32 finds no files or directories at all. This was seen with Borland CPP 5.02 and 5.5.1. Apr 29 2005 Erwin Waterlander */ rc = dd_findfirst( default_mask, &fb, DD_DIREC|DD_RDONLY|DD_HIDDEN|DD_SYSTEM|DD_ARCH|DD_DEVICE ); list.head = list.tail = 0; /* Unix: dd_findfirst is a wrapper around 'opendir'. The directory opened in dd_findfirst * has to be closed by 'closedir' in dd_findnext. So do not exit this function until * the dd_findnext loop is complete. Otherwise directories will be left open and you * will have a memory leak. When too many directories are left open getcwd() may return * an incorrect pathname. */ while (rc==0) /* go through all the files in the current dir */ { if (DD_ISDIREC(fb.dd_mode)) { #ifndef VMS /* Ignore directory entries starting with '.' * which includes the current and parent directories. */ if (!SpecialDir(fb.dd_name)) #endif /* ?!VMS */ #ifdef _WIN32 { /* On Windows a symbolic directory link is seen as a normal directory * by DD_ISDIREC(). */ if(wcd_islink(fb.dd_name,quiet)) wcd_fprintf(outfile,"%s/%s\n", tmp_ptr, fb.dd_name); else q_insert(&list, fb.dd_name); /* add all directories in current dir to list */ } #else q_insert(&list, fb.dd_name); /* add all directories in current dir to list */ #endif } #ifdef UNIX if ( S_ISLNK(fb.dd_mode)) /* is it a link ? */ { static struct stat buf ; if ((stat(fb.dd_name, &buf) == 0) && S_ISDIR(buf.st_mode)) /* does the link point to a dir */ wcd_fprintf(outfile,"%s/%s\n", tmp_ptr, fb.dd_name); } #endif rc = dd_findnext(&fb); } /* while !rc */ /* recursively parse subdirectories (if any) (quiet) */ while (q_remove(&list, tmp)) finddirs(tmp,offset, outfile, use_HOME, exclude, 1); /* Quiet, because on OS/2 changing to .. from a disk root dir gives an error. */ wcd_chdir(DIR_PARENT,1); /* go to parent directory */ } #endif /******************************************************************** * * scanDisk(char *path, char *treefile, int scanreldir, size_t append, int *use_HOME) * * append == 1 : append to treefile * scanreldir == 1 : write relative paths in rtdata.wcd * ********************************************************************/ void scanDisk(char *path, char *treefile, int scanreldir, size_t append, int *use_HOME, nameset exclude) { size_t offset = 0 ; /* offset to remove scanned from path */ char tmp[DD_MAXPATH]; /* tmp string buffer */ char tmp2[DD_MAXPATH]; /* tmp string buffer */ FILE *outfile; #ifdef _WCD_DOSFS char drive[DD_MAXDRIVE]; int changedrive = 0; #endif wcd_fixpath(path,(size_t)DD_MAXPATH); wcd_fixpath(treefile,(size_t)DD_MAXPATH); wcd_getcwd(tmp2, sizeof(tmp2)); /* remember current dir */ if(wcd_isdir(path,0) != 0) { wcd_printf(_("Wcd: %s is not a directory.\n"),path); return ; } wcd_printf(_("Wcd: Please wait. Scanning disk. Building treedata-file %s from %s\n"),treefile, path); #ifdef _WCD_DOSFS changeDisk(path,&changedrive,drive,use_HOME); #endif if (scanreldir) { if ( !wcd_chdir(path,0) ) { wcd_getcwd(tmp, sizeof(tmp)); /* get full path */ #ifdef _WCD_DOSFS wcd_fixpath(tmp,sizeof(tmp)); rmDriveLetter(tmp,use_HOME); #endif offset = strlen(tmp); /* do not count ending separator (if present) */ if (offset > 0 && tmp[offset-1]==DIR_SEPARATOR) offset--; offset++; } wcd_chdir(tmp2,0); /* go back */ } #ifdef _WCD_DOSFS /* open the output file */ if (append) outfile = wcd_fopen(treefile,"a",0); /* append to database */ else outfile = wcd_fopen(treefile,"w",0); /* create new database */ if (!outfile) /* Try to open in a temp dir */ { char *ptr; if ( (ptr = getenv("TEMP")) != NULL ) { strcpy(treefile,ptr); strcat(treefile,TREEFILE); outfile = wcd_fopen(treefile,"w",1); } if (outfile == NULL) { if ( (ptr = getenv("TMP")) != NULL ) { strcpy(treefile,ptr); strcat(treefile,TREEFILE); outfile = wcd_fopen(treefile,"w",1); } if (outfile == NULL) { if ( (ptr = getenv("TMPDIR")) != NULL ) { strcpy(treefile,ptr); strcat(treefile,TREEFILE); outfile = wcd_fopen(treefile,"w",1); } } } fprintf(stderr,_("Wcd: Writing file \"%s\"\n"), treefile); } if (outfile == NULL) /* Did we succeed? */ { fprintf(stderr, "%s", _("Wcd: error: Write access to tree-file denied.\nWcd: Set TEMP environment variable if this is a read-only disk.\n")); return ; } #else /* open the output file */ if (append) outfile = wcd_fopen(treefile,"a",0); /* append to database */ else outfile = wcd_fopen(treefile,"w",0); /* create new database */ if (outfile == NULL) return ; #endif #ifdef WCD_UTF16 /* Add UTF-8 BOM to make it readable by notepad. */ if (append == 0) wcd_fprintf(outfile, "%s", "\xEF\xBB\xBF"); /* UTF-8 BOM */ #endif finddirs( path, &offset, outfile, use_HOME, exclude, 0); /* Build treedata-file */ wcd_fclose(outfile, treefile, "w", "scanDisk: "); wcd_chdir(tmp2,0); /* go back */ } #if (defined(_WIN32) || defined(__CYGWIN__)) /*********************************************************************** * scanServer() * scan all the shared directories on a server ***********************************************************************/ void scanServer(char *path, char *treefile, size_t append, int *use_HOME, nameset exclude) { size_t i; nameset shares; shares = namesetNew(); wcd_getshares(path, shares); i = 0; while (i= lim-1) { fprintf(stderr,_("Wcd: error: line too long in wcd_getline() ( > %d). The treefile could be corrupt, else fix by increasing DD_MAXPATH in source code.\n"),(lim-1)); fprintf(stderr,_("Wcd: file: %s, line: %d,"),file_name, *line_nr); /* Continue reading until end of line */ j = i+1; while (((c=getc(infile)) != '\n') && (!feof(infile))) { ++j; } fprintf(stderr,_(" length: %d\n"),j); } return i ; } #if defined(_WIN32) || defined(WCD_UNICODE) /* UTF16 little endian */ int wcd_wgetline(wchar_t s[], int lim, FILE* infile, const char* file_name, const int* line_nr) { int i, j ; int c_high, c_low; #if !defined(_WIN32) && !defined(__CYGWIN__) wchar_t lead, trail; #endif for (i=0; i= 4) && (s[i] >= 0xd800) && (s[i] < 0xdc00)) { lead = s[i]; if (((c_low=fgetc(infile)) != EOF) && ((c_high=fgetc(infile)) != EOF) && !((c_high == '\0') && (c_low == '\n'))) { c_high <<=8; trail = (wchar_t)(c_high + c_low) ; if ((trail >= 0xdc00) && (trail < 0xe000)) { s[i] = 0x10000; s[i] += (lead & 0x03FF) << 10; s[i] += (trail & 0x03FF); } else /* not a UTF-16 surrogate pair trail. */ { s[i] = trail; if (s[i] == L'\r') i--; } } } #endif } s[i] = L'\0' ; if (i >= lim-1) { fprintf(stderr,_("Wcd: error: line too long in wcd_wgetline() ( > %d). The treefile could be corrupt, else fix by increasing DD_MAXPATH in source code.\n"),(lim-1)); fprintf(stderr,_("Wcd: file: %s, line: %d,"),file_name, *line_nr); /* Continue reading until end of line */ j = i+1; while (((c_low=fgetc(infile)) != EOF) && ((c_high=fgetc(infile)) != EOF) && !((c_high == '\0') && (c_low == '\n'))) { ++j; } fprintf(stderr,_(" length: %d\n"),j); } return i ; } /* UTF16 big endian */ int wcd_wgetline_be(wchar_t s[], int lim, FILE* infile, const char* file_name, const int* line_nr) { int i, j; int c_high, c_low; #if !defined(_WIN32) && !defined(__CYGWIN__) wchar_t lead, trail; #endif for (i=0; i= 4) && (s[i] >= 0xd800) && (s[i] < 0xdc00)) { lead = s[i]; if (((c_high=fgetc(infile)) != EOF) && ((c_low=fgetc(infile)) != EOF) && !((c_high == '\0') && (c_low == '\n'))) { c_high <<=8; trail = (wchar_t)(c_high + c_low) ; if ((trail >= 0xdc00) && (trail < 0xe000)) { s[i] = 0x10000; s[i] += (lead & 0x03FF) << 10; s[i] += (trail & 0x03FF); } else /* not a UTF-16 surrogate pair trail. */ { s[i] = trail; if (s[i] == L'\r') i--; } } } #endif } s[i] = L'\0' ; if (i >= lim-1) { fprintf(stderr,_("Wcd: error: line too long in wcd_wgetline_be() ( > %d). The treefile could be corrupt, else fix by increasing DD_MAXPATH in source code.\n"),(lim-1)); fprintf(stderr,_("Wcd: file: %s, line: %d,"),file_name, *line_nr); /* Continue reading until end of line */ j = i+1; while (((c_high=fgetc(infile)) != EOF) && ((c_low=fgetc(infile)) != EOF) && !((c_high == '\0') && (c_low == '\n'))) { ++j; } fprintf(stderr,_(" length: %d\n"),j); } return i ; } #endif /******************************************************************** * * Read treefile in a structure. * ********************************************************************/ void read_treefileA(FILE *f, nameset bd, const char* file_name) { int len, line_nr=1; char path[DD_MAXPATH]; while (!feof(f) ) { /* read a line */ len = wcd_getline(path,DD_MAXPATH,f,file_name,&line_nr); ++line_nr; if (len > 0 ) { wcd_fixpath(path,sizeof(path)); addToNamesetArray(textNew(path),bd); } } /* while (!feof(f) ) */ } #if defined(_WIN32) || defined(WCD_UNICODE) void read_treefileUTF16LE(FILE *f, nameset bd, const char* file_name) { int len, line_nr=1; char path[DD_MAXPATH]; wchar_t pathw[DD_MAXPATH]; while (!feof(f) ) { /* read a line */ len = wcd_wgetline(pathw,DD_MAXPATH,f,file_name,&line_nr); ++line_nr; if (len > 0 ) { WCSTOMBS(path, pathw, sizeof(path)); wcd_fixpath(path,sizeof(path)); addToNamesetArray(textNew(path),bd); } } /* while (!feof(f) ) */ } void read_treefileUTF16BE(FILE *f, nameset bd, const char* file_name) { int len, line_nr=1; char path[DD_MAXPATH]; wchar_t pathw[DD_MAXPATH]; while (!feof(f) ) { /* read a line */ len = wcd_wgetline_be(pathw,DD_MAXPATH,f,file_name,&line_nr); ++line_nr; if (len > 0 ) { WCSTOMBS(path, pathw, sizeof(path)); wcd_fixpath(path,sizeof(path)); addToNamesetArray(textNew(path),bd); } } /* while (!feof(f) ) */ } /* read_treefileUTF8() was made to make it possible that a non-Unicode Windows version of Wcd can read UTF-8 encoded tree-data files. Handy when a person uses also the Windows version for PowerShell with Unicode support. Most non-ASCII characters are likely part of the default system ANSI code page. */ void read_treefileUTF8(FILE *f, nameset bd, const char *file_name) { int len, line_nr=1; char path[DD_MAXPATH]; #ifdef WCD_ANSI wchar_t pathw[DD_MAXPATH]; #endif while (!feof(f) ) { /* read a line */ len = wcd_getline(path,DD_MAXPATH,f,file_name,&line_nr); ++line_nr; if (len > 0 ) { #ifdef WCD_ANSI /* Convert UTF-8 to ANSI */ MultiByteToWideChar(CP_UTF8, 0, path, -1, pathw, sizeof(pathw)); WideCharToMultiByte(CP_ACP, 0, pathw, -1, path, sizeof(path), NULL, NULL); #endif wcd_fixpath(path,sizeof(path)); addToNamesetArray(textNew(path),bd); } } /* while (!feof(f) ) */ } #endif int read_treefile(char* filename, nameset bd, int quiet) { FILE *infile; int bomtype; /* open treedata-file */ if ((infile = wcd_fopen_bom(filename,"rb", quiet, &bomtype)) != NULL) { switch (bomtype) { case FILE_MBS: read_treefileA(infile, bd, filename); break; #if defined(_WIN32) || defined(WCD_UNICODE) case FILE_UTF16LE: read_treefileUTF16LE(infile, bd, filename); break; case FILE_UTF16BE: read_treefileUTF16BE(infile, bd, filename); break; case FILE_UTF8: read_treefileUTF8(infile, bd, filename); break; #endif default: read_treefileA(infile, bd, filename); } wcd_fclose(infile, filename, "r", "read_treefile: "); } return(bomtype); } /******************************************************************** * * void cleanTreeFile(char *filename, char *dir) * * remove path from treefile * ********************************************************************/ void cleanTreeFile(char *filename, char *dir) { nameset dirs; int bomtype; dirs = namesetNew(); bomtype = read_treefile(filename,dirs,0); rmDirFromList(dir,dirs); writeList(filename, dirs, bomtype); freeNameset(dirs, 1); } /******************************************************************** * * check_double_match(char *dir, nameset set) * * Returns 0 if directory had no match before. * Returns 1 if directory is double matched. * ********************************************************************/ int check_double_match(char *dir, nameset set) { size_t i = 0; if ((dir == NULL) || (set == NULL)) return(0); while(i < set->size) { #ifdef _WCD_DOSFS if( stricmp(set->array[i],dir) == 0) return(1); #else if( strcmp(set->array[i],dir) == 0) return(1); #endif ++i; } return(0); } /******************************************************************** * * check_filter(char *dir, nameset filter) * * Returns 0 if directory is in filter list or filter list is empty. * Returns 1 if directory is in filter list. * ********************************************************************/ int check_filter(char *dir, nameset filter) { size_t index = 0; if (filter->size == 0) return (0); while (index < filter->size) { #ifdef _WCD_DOSFS if(dd_match(dir,filter->array[index],1)) return(0); #else if(dd_match(dir,filter->array[index],0)) return(0); #endif ++index; } return(1); } /******************************************************************** * * scanfile(char *org_dir, char *filename, int * ignore_case, nameset pm, nameset wm, nameset bd, int nfs) * * ********************************************************************/ void scanfile(char *org_dir, char *filename, int ignore_case, nameset pm, nameset wm, nameset bd, nameset filter, int relative, int wildOnly, int ignore_diacritics) { FILE *infile; char line[DD_MAXPATH]; /* database path */ #if defined(_WIN32) || defined(WCD_UNICODE) wchar_t linew[DD_MAXPATH]; /* database path */ #endif int bomtype ; char *line_end; /* database directory */ char path_str[DD_MAXPATH]; /* path name to match */ char dirwild_str[DD_MAXPATH]; /* directory name to wild match */ char *dir_str ; /* directory name to perfect match */ char relative_prefix[DD_MAXPATH]; /* relative prefix */ char tmp[DD_MAXPATH]; int wild = 0; int line_nr =1; /* open treedata-file */ if ((infile = wcd_fopen_bom(filename,"rb",0,&bomtype)) == NULL) return; if( (dir_str = strrchr(org_dir,DIR_SEPARATOR)) != NULL) dir_str++; else dir_str = org_dir; strcpy(dirwild_str,dir_str); #ifdef _WCD_DOSFS if ((strlen(org_dir)>1) && (dd_match(org_dir,"[a-z]:*",1))) { /* If user searches "c:bin" (a directory "bin" on drive c:) set path_str to "c:*bin" */ strncpy(path_str,org_dir,2); path_str[DD_MAXDRIVE-1] = '\0'; line_end = org_dir + DD_MAXDRIVE ; strcat(path_str,"*"); strcat(path_str,line_end); } else #endif { strcpy(path_str,"*"); strcat(path_str,org_dir); } if (!dd_iswild(dir_str)) { strcat(dirwild_str,"*"); strcat(path_str,"*"); wild = 0; } else wild = 1; if (wildOnly) wild = 1; if (relative) { strcpy(relative_prefix,filename); if( (line_end = strrchr(relative_prefix,DIR_SEPARATOR)) != NULL) { line_end++ ; *line_end = '\0'; } else relative_prefix[0] = '\0'; } while (!feof(infile) ) /* parse the file */ { int len; #if defined(_WIN32) || defined(WCD_UNICODE) /* read a line */ switch (bomtype) { case FILE_MBS: len = wcd_getline(line,DD_MAXPATH,infile,filename,&line_nr); break; case FILE_UTF16LE: len = wcd_wgetline(linew,DD_MAXPATH,infile,filename,&line_nr); WCSTOMBS(line, linew, sizeof(line)); break; case FILE_UTF16BE: len = wcd_wgetline_be(linew,DD_MAXPATH,infile,filename,&line_nr); WCSTOMBS(line, linew, sizeof(line)); break; case FILE_UTF8: len = wcd_getline(line,DD_MAXPATH,infile,filename,&line_nr); #ifdef WCD_ANSI /* convert UTF-8 to ANSI */ MultiByteToWideChar(CP_UTF8, 0, line, -1, linew, sizeof(linew)); WideCharToMultiByte(CP_ACP, 0, linew, -1, line, sizeof(line), NULL, NULL); #endif break; default: len = wcd_getline(line,DD_MAXPATH,infile,filename,&line_nr); } #else len = wcd_getline(line,DD_MAXPATH,infile,filename,&line_nr); #endif ++line_nr; cleanPath(line,len,1) ; if( (line_end = strrchr(line,DIR_SEPARATOR)) != NULL) line_end++; else line_end = line; /* test for a perfect match */ #ifdef WCD_UNICODE if ( (wild == 0) && (dd_matchmbs(line_end,dir_str,ignore_case,ignore_diacritics)) && (dd_matchmbs(line,path_str,ignore_case,ignore_diacritics)) ) #else if ( (wild == 0) && (dd_matchl(line_end,dir_str,ignore_case,ignore_diacritics)) && (dd_matchl(line,path_str,ignore_case,ignore_diacritics)) ) #endif { if (relative) { strcpy(tmp,relative_prefix); strcat(tmp,line); strcpy(line,tmp); } if ((pathInNameset(line,bd) == (size_t)-1) && (check_double_match(line,pm)==0)&& (check_filter(line,filter)==0)) { addToNamesetArray(textNew(line),pm); } } else { /* test for a wild match if no perfect match */ #ifdef WCD_UNICODE if ( (dd_matchmbs(line_end,dirwild_str,ignore_case,ignore_diacritics)) && (dd_matchmbs(line,path_str,ignore_case,ignore_diacritics)) && (pm->size == 0)) #else if ( (dd_matchl(line_end,dirwild_str,ignore_case,ignore_diacritics)) && (dd_matchl(line,path_str,ignore_case,ignore_diacritics)) && (pm->size == 0)) #endif { if (relative) { strcpy(tmp,relative_prefix); strcat(tmp,line); strcpy(line,tmp); } if((pathInNameset(line,bd) == (size_t)-1) && (check_double_match(line,wm)==0) && (check_filter(line,filter)==0)) { addToNamesetArray(textNew(line),wm); } } } } /* while (!feof(infile) ) */ wcd_fclose(infile, filename, "r", "scanfile: "); } /******************************************************************** * * scanaliasfile(char *org_dir, char *filename, * nameset *pm, nameset *wm, int wildOnly) * * ********************************************************************/ void scanaliasfile(char *org_dir, char *filename, nameset pm, nameset wm, int wildOnly) { FILE *infile; char *dir; char line[DD_MAXPATH]; char alias[256]; int line_nr=1; dir = org_dir; #ifdef _WCD_DOSFS /* wcd_fixpath() could have added a '/' before the alias e.g. wcd d:alias => /alias */ if (*dir == '/') dir++; #endif /* open treedata-file */ if ((infile = wcd_fopen(filename,"r",1)) != NULL) { while (!feof(infile) ) { int len; if(fscanf(infile,"%s",alias)==1) { /* skip spaces between alias and path */ while ((line[0]=(char)getc(infile)) == ' '){}; /* read a line */ len = wcd_getline(line+1,DD_MAXPATH,infile,filename,&line_nr); ++len; ++line_nr; if (len > 0 ) /* Only a perfect match counts, case sensitive */ if ((strcmp(alias,dir)==0) && (check_double_match(line,pm)==0) /* && (check_filter(line,filter)==0) */ ) { if(wildOnly) addToNamesetArray(textNew(line),wm); else addToNamesetArray(textNew(line),pm); } } } /* while (!feof(infile) ) */ wcd_fclose(infile, filename, "r", "scanaliasfile: "); } } /******************************************************************** * * Get int * ********************************************************************/ int wcd_get_int() { int i; char string[32]; fgets(string,(int)sizeof(string),stdin); fflush(stdin); /* flush the input stream in case of bad input */ /* fgets retains the newline character (LF) at the end of string and appends a null byte to string to mark the end of the string. */ string[strlen(string)-1] = '\0'; /* remove LF */ i=atoi(string); return(i); } /******************************************************************** * * exit * ********************************************************************/ int wcd_exit(nameset pm, nameset wm, nameset ef, nameset bd, nameset nfs, WcdStack ws, nameset excl) { /* free datastructures */ freeNameset(pm, 1); /* perfect list */ freeNameset(wm, 1); /* wild list */ freeNameset(ef, 1); /* extra files */ freeNameset(bd, 1); /* banned dirs */ freeNameset(nfs, 1); /* relative files */ freeWcdStack(ws, 1); /* directory stack */ freeNameset(excl, 1); /* excluded paths */ return(0); } /******************************************************************** * * Print help * ********************************************************************/ void print_help() { printf(_("\ wcd %s (%s) - Wherever Change Directory\n\ Usage: wcd [options] [directory]\n\ \n\ directory: Name of directory to change to.\n\ Wildcards *, ? and [SET] are supported.\n\n"),VERSION,VERSION_DATE); printf(_("options:\n\ -a Add current path to treefile\n\ -aa Add current and all parent paths to treefile\n\ -A PATH Add tree from PATH\n\ -b Ban current path\n\ -c, --direct-cd direct CD mode\n\ -d DRIVE set DRIVE for stack & go files (DOS)\n\ -e add current path to Extra treefile\n\ -ee add current and all parent paths to Extra treefile\n\ -E PATH add tree from PATH to Extra treefile\n\ -f FILE use extra treeFile\n\ +f FILE add extra treeFile\n\ -g Graphics\n\ -gd Graphics, dump tree\n\ -G PATH set PATH Go-script\n\ -GN, --no-go-script No Go-script\n\ -h, --help show this Help\n")); #ifdef _WCD_DOSFS printf(_("\ -i, --ignore-case Ignore case (default)\n\ +i, --no-ignore-case Regard case\n")); #else printf(_("\ -i, --ignore-case Ignore case\n\ +i, --no-ignore-case Regard case (default)\n")); #endif printf(_("\ -I, --ignore-diacritics Ignore diacritics\n\ +I, --no-ignore-diacritics Regard diacritics (default)\n\ -j, --just-go Just go mode\n\ -k, --keep-paths Keep paths\n\ -K, --color Colors\n\ -l ALIAS aLias current directory\n\ -L, --license print software License\n\ -m DIR Make DIR, add to treefile\n\ -M DIR Make DIR, add to extra treefile\n\ -n PATH use relative treefile in PATH\n\ +n PATH add relative treefile in PATH\n\ -N, --numbers use Numbers\n\ -o use stdOut\n\ -od, --to-stdout dump matches\n\ -q, --quiet Quieter operation\n\ -r DIR Remove DIR\n\ -rmtree DIR Remove DIR recursive\n\ -s Scan disk from $HOME\n\ -S PATH Scan disk from PATH\n\ +S PATH Scan disk from PATH, create relative treefile\n\ -t Don't strip /tmp_mnt from paths\n\ -T, --ascii-tree Draw tree with ASCII characters\n\ -Ta, --alt-tree-nav Alternative tree navigation\n\ -TC, --center-tree Centered tree view\n\ -Tc, --compact-tree Compact tree\n\ -Td, --cjk-width support legacy CJK fonts\n\ -u USER use USER's treefile\n\ +u USER add USER's treefile\n\ -v, --verbose Verbose operation\n\ -V, --version print Version info\n\ -w, --wild-match-only Wild matching only\n\ -x PATH eXclude PATH during disk scan\n\ -xf FILE eXclude paths from FILE\n\ -y, --assume-yes assume Yes on all queries\n\ -z NUMBER set max stack siZe\n\ -[NUMBER] Push dir (NUMBER times)\n\ +[NUMBER] Pop dir (NUMBER times)\n\ = Show stack\n")); } #ifdef ENABLE_NLS void print_version(char *localedir) #else void print_version() #endif { printf(_("wcd %s (%s) - Wherever Change Directory\n"),VERSION,VERSION_DATE); printf(_("Chdir for Dos and Unix.\n\n")); #ifdef __MSDOS__ #if defined(__WATCOMC__) && defined(__I86__) printf(_("DOS 16 bit version (WATCOMC).\n")); #elif defined(__TURBOC__) printf( _("DOS 16 bit version (TURBOC).\n")); #elif defined(__GO32__) printf(_("DOS 32 bit version (DJGPP).\n")); #elif defined(__WATCOMC__) && defined(__386__) printf(_("DOS 32 bit version (WATCOMC).\n")); #endif #endif #ifdef _WIN32 # ifdef _WIN64 # ifdef _MSC_VER printf(_("Win64 version (MSVC %d).\n"),_MSC_VER); # else printf(_("Win64 version (MinGW-w64).\n")); # endif # else # if defined(__WATCOMC__) && defined(__NT__) printf(_("Win32 version (WATCOMC).\n")); # elif defined(_MSC_VER) printf(_("Win32 version (MSVC %d).\n"),_MSC_VER); # else printf(_("Win32 version (MinGW).\n")); # endif # endif #endif #ifdef _WIN32 # ifdef WCD_WINZSH printf(_("This version is for MSYS and WinZsh.\n")); # elif defined(WCD_WINPWRSH) printf(_("This version is for Windows PowerShell.\n")); # else printf(_("This version is for Windows Command Prompt (cmd.exe).\n")); # endif #endif #ifdef __OS2__ printf(_("OS/2 version")); # ifdef __WATCOMC__ printf(" (WATCOMC).\n"); # elif defined(__EMX__) printf(" (EMX).\n"); # else printf( ".\n"); # endif #endif #ifdef __MSYS__ printf(_("This version is for native MSYS.\n")); #endif #if defined(__CYGWIN__) && !defined(__MSYS__) printf(_("Cygwin version.\n")); #endif #ifdef WCD_DOSBASH printf(_("This version is for DJGPP DOS bash.\n")); #endif #ifdef WCD_OS2BASH printf(_("This version is for OS/2 bash.\n")); #endif printf(_("Interface: ")); #ifdef WCD_USECONIO printf(_("conio\n")); #else # ifdef WCD_USECURSES # ifdef NCURSES_VERSION printf(_("ncurses version %s.%d\n"),NCURSES_VERSION,NCURSES_VERSION_PATCH); # else # ifdef __PDCURSES__ printf(_("PDCurses build %d\n"),PDC_BUILD); # else printf(_("curses\n")); # endif # endif # ifdef ASCII_TREE printf("ASCII_TREE=1\n"); # else printf("ASCII_TREE=0\n"); # endif # else printf(_("stdout\n")); # endif #endif #ifdef ENABLE_NLS printf(_("Native language support included.\n")); printf(_("LOCALEDIR=%s\n"),localedir); #else printf(_("No native language support included.\n")); #endif #if defined(_WCD_DOSFS) || defined(__MSYS__) printf(_("Current locale uses CP%u encoding.\n"),query_con_codepage()); #else printf(_("Current locale uses %s encoding.\n"),nl_langinfo(CODESET)); #endif #ifdef WCD_UNICODE printf(_("With Unicode support.\n")); #ifndef WCD_UTF16 if (strcmp(nl_langinfo(CODESET), "UTF-8") == 0) #endif { printf(_(" Euro symbol: ")); wcd_printf ("%s\n","€"); /* Put real UTF-8. Visual C does not support C99 unicode notation. */ printf(_(" Chinese characters: ")); wcd_printf ("%s\n","中文"); } #else printf(_("Without Unicode support.\n")); #endif #ifdef WCD_UNINORM printf(_("With Unicode normalization.\n")); #else printf(_("Without Unicode normalization.\n")); #endif printf("\n"); printf(_("Download the latest executables and sources from:\n")); printf(_("http://waterlan.home.xs4all.nl/\n")); } void print_license() { printf(_("wcd %s (%s) - Wherever Change Directory\n"),VERSION,VERSION_DATE); printf(_("\ Chdir for Dos and Unix.\n\ Copyright (C) 1997-2013 Erwin Waterlander\n\ Copyright (C) 1994-2002 Ondrej Popp on C3PO\n\ Copyright (C) 1995-1996 DJ Delorie on _fixpath()\n\ Copyright (C) 1995-1996 Borja Etxebarria & Olivier Sirol on Ninux Czo Directory\n\ Copyright (C) 1994-1996 Jason Mathews on DOSDIR\n\ Copyright (C) 1990-1992 Mark Adler, Richard B. Wales, Jean-loup Gailly,\n\ Kai Uwe Rommel and Igor Mandrichenko on recmatch()\n\ Source code to scan Windows LAN was originally written and placed\n\ in the public domain by Felix Kasza.\n\ Markus Kuhn's free wcwidth() implementation is used\n\ in Wcd for Windows.\n\ Rugxulo is the original author of query_con_codepage() (public domain).\n\n\ \ This program is free software; you can redistribute it and/or\n\ modify it under the terms of the GNU General Public License\n\ as published by the Free Software Foundation; either version 2\n\ of the License, or (at your option) any later version.\n\n\ \ This program is distributed in the hope that it will be useful,\n\ but WITHOUT ANY WARRANTY; without even the implied warranty of\n\ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\n\ GNU General Public License for more details.\n\n\ \ You should have received a copy of the GNU General Public License\n\ along with this program; if not, write to the Free Software\n\ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.\n")); } /* Recurively create directory path, to enable writing * the file */ void create_dir_for_file(char *f) { char path[DD_MAXPATH]; char *ptr ; #if (defined(UNIX) || defined(__DJGPP__) || defined(__EMX__)) mode_t m; #endif strncpy(path, f, sizeof(path)); if ( (ptr = strrchr(path,DIR_SEPARATOR)) != NULL) { *ptr = '\0' ; if ( (path[0] != '\0') && /* not an empty string */ #ifdef _WCD_DOSFS (!dd_match(path,"[a-z]:",1)) && /* not a drive letter */ #endif (wcd_isdir(path,1) != 0) /* dir does not exist */ ) { create_dir_for_file(path); #if (defined(UNIX) || defined(__DJGPP__) || defined(__EMX__)) m = S_IRWXU | S_IRWXG | S_IRWXO; if (wcd_mkdir(path,m,0)==0) #else if (wcd_mkdir(path,0)==0) #endif fprintf(stderr,_("Wcd: creating directory %s\n"), path); } } } /******************************************************************** * * empty wcd.go file * ********************************************************************/ #if defined(UNIX) || defined(_WIN32) || defined(__OS2__) void empty_wcdgo(char *go_file, int use_GoScript, int verbose) { FILE *outfile; if (use_GoScript == 0) return; if (verbose) fprintf(stderr,_("Wcd: Writing file \"%s\"\n"), go_file); /* try to create directory for go-script if it doesn't exist */ create_dir_for_file(go_file); if ((outfile = wcd_fopen(go_file,"w",0)) == NULL) exit(0); wcd_fprintf(outfile, "%s", "\n"); wcd_fclose(outfile, go_file, "w", "empty_wcdgo: "); } #endif #ifdef WCD_DOSBASH void empty_wcdgo(char *go_file, int changedrive, char *drive, int use_GoScript, int verbose) { FILE *outfile; if (use_GoScript == 0) return; if (verbose) fprintf(stderr,_("Wcd: Writing file \"%s\"\n"), go_file); /* try to create directory for go-script if it doesn't exist */ create_dir_for_file(go_file); if ((outfile = wcd_fopen(go_file,"w",0)) == NULL) exit(0); if(changedrive == 1) wcd_fprintf(outfile,"cd %s\n",drive); else wcd_fprintf(outfile, "%s", "\n"); wcd_fclose(outfile, go_file, "w", "empty_wcdgo: "); } #endif /******************************************************************** * * pickDir() * * gets current dirname. * picks dirname from a nameset. The next one after the current, * otherwise the first dirname. * * Returns 0, if no dir found. Otherwise the indexnumber of the * list + 1. * * ******************************************************************/ size_t pickDir(nameset list, int *use_HOME) { char curDir[DD_MAXPATH]; size_t i; if (list == NULL) /* there is no list */ return(0); sort_list(list); getCurPath(curDir,(size_t)DD_MAXPATH,use_HOME); /* get previous dirname from file */ if (curDir == NULL) /* no dirname found */ return(1); /* return first of list */ if ((i = inNameset(curDir,list)) == (size_t)-1) /* not in list */ return(1); /* return first of list */ i++; /* next dirname */ if (i >= getSizeOfNamesetArray(list)) i = 0; /* wrap to beginning */ return(i+1); } /******************************************************************** * * ********************************************************************/ #ifdef WCD_SHELL void writeGoFile(char *go_file, int *changedrive, char *drive, char *best_match, int use_GoScript, int verbose) { FILE *outfile; #ifdef WCD_UNIXSHELL char *ptr ; #endif #if defined (_WIN32) && !defined(__CYGWIN__) unsigned int codepage_ansi, codepage_dos; codepage_ansi = GetACP(); codepage_dos = GetConsoleOutputCP(); #endif if (use_GoScript == 0) return; if (verbose) fprintf(stderr,_("Wcd: Writing file \"%s\"\n"), go_file); /* try to create directory for go-script if it doesn't exist */ create_dir_for_file(go_file); /* open go-script */ if ((outfile = wcd_fopen(go_file,"w",0)) == NULL) return; # ifdef WCD_UNIXSHELL /* unix shell */ # ifdef WCD_DOSBASH /* In DOS Bash $SHELL points to the windows command shell. So we use $BASH instead. */ if ((ptr = getenv("BASH")) != NULL) wcd_fprintf(outfile,"#!%s\n",ptr); if (*changedrive) wcd_fprintf(outfile,"cd %s ; ",drive); # else /* Printing of #!$SHELL is needed for 8 bit characters. Some shells otherwise think that the go-script is a binary file and will not source it. */ if ((ptr = getenv("SHELL")) != NULL) wcd_fprintf(outfile,"#!%s\n",ptr); # endif wcd_fprintf(outfile,"cd %s\n", best_match); # else /* WCD_UNIXSHELL */ /* Go-script required, but not unix shell type. */ # ifdef WCD_WINPWRSH /* Windows powershell */ # ifdef WCD_UTF16 /* PowerShell can run UTF-8 encoded scripts when the UTF-8 BOM is in. */ wcd_fprintf(outfile, "%s", "\xEF\xBB\xBF"); /* UTF-8 BOM */ # endif if (codepage_ansi != codepage_dos) wcd_fprintf(outfile,"chcp %d | Out-Null\n", codepage_ansi); wcd_fprintf(outfile,"set-location %s\n", best_match); if (codepage_ansi != codepage_dos) wcd_fprintf(outfile,"chcp %d | Out-Null\n", codepage_dos); # else /* Windows Command Prompt, os/2 */ wcd_fprintf(outfile, "%s", "@echo off\n"); if (*changedrive) wcd_fprintf(outfile,"%s\n",drive); # ifdef WCD_UTF16 if (codepage_ansi != 65001) wcd_fprintf(outfile,"chcp 65001 > nul\n"); # endif # ifdef WCD_ANSI if (codepage_ansi != codepage_dos) wcd_fprintf(outfile,"chcp %d > nul\n", codepage_ansi); # endif if (strncmp(best_match,"\"\\\\",3) == 0) wcd_fprintf(outfile,"pushd %s\n", best_match); /* UNC path */ else wcd_fprintf(outfile,"cd %s\n", best_match); # ifdef WCD_UTF16 if (codepage_ansi != 65001) wcd_fprintf(outfile,"chcp %d > nul\n", codepage_dos); # endif # ifdef WCD_ANSI if (codepage_ansi != codepage_dos) wcd_fprintf(outfile,"chcp %d > nul\n", codepage_dos); # endif # endif # endif wcd_fclose(outfile, go_file, "w", "writeGoFile: "); } #endif void addListToNameset(nameset set, char *list) { char tmp[DD_MAXPATH]; /* tmp string buffer */ if (list != NULL) { list = strtok(list, LIST_SEPARATOR); while (list != NULL) { if (strlen(list) < (DD_MAXPATH-2)) /* prevent buffer overflow */ { strcpy(tmp,list); wcd_fixpath(tmp,sizeof(tmp)); addToNamesetArray(textNew(tmp),set); } list = strtok(NULL, LIST_SEPARATOR); } } } void addListToNamesetFilter(nameset set, char *list) { char tmp[DD_MAXPATH]; /* tmp string buffer */ if (list != NULL) { list = strtok(list, LIST_SEPARATOR); while (list != NULL) { if (strlen(list) < (DD_MAXPATH-2)) /* prevent buffer overflow */ { strcpy(tmp,"*"); strcat(tmp,list); strcat(tmp,"*"); wcd_fixpath(tmp,sizeof(tmp)); addToNamesetArray(textNew(tmp),set); } list = strtok(NULL, LIST_SEPARATOR); } } } /******************************************************************** * * MAIN * ********************************************************************/ #if defined(XCURSES) char *XCursesProgramName = "wcd"; #endif int main(int argc,char** argv) { FILE *infile; FILE *outfile; char best_match[DD_MAXPATH]; char verbose = 0; int i; size_t ii, j; int exit_wcd = 0; int use_default_treedata = 1; int use_numbers = 0; /* use numbers instead of letters in conio or curses interface */ int use_stdout = WCD_STDOUT_NO; /* use stdout interface instead of curses */ #ifdef UNIX int strip_mount_string = 1 ; /* remove mount string prefix( e.g. /tmp_mnt ) from path before /home */ #endif int stack_hit = 0, stack_index; char rootdir[DD_MAXPATH],treefile[DD_MAXPATH],banfile[DD_MAXPATH],aliasfile[DD_MAXPATH]; char stackfile[DD_MAXPATH]; char scandir[DD_MAXPATH]; char rootscandir[DD_MAXPATH]; char extratreefile[DD_MAXPATH]; char homedir[DD_MAXPATH]; char dir[DD_MAXPATH]; /* directory to go to, or dir to scan, make or remove */ char scan_mk_rm = 0; /* scan disk, or make dir, or remove dir */ char *ptr, *stackptr; int quieter = 0, cd = 0 ; size_t len; char tmp[DD_MAXPATH]; /* tmp string buffer */ char tmp2[DD_MAXPATH]; /* tmp string buffer */ int stack_is_read = 0; WcdStack DirStack; nameset extra_files, banned_dirs, scan_dirs; nameset perfect_list, wild_list ; /* match lists */ nameset relative_files; nameset exclude; /* list of paths to exclude from scanning */ nameset filter; int use_HOME = 0 ; int wildOnly = 0 ; int justGo = 0; int assumeYes = 0; int graphics = WCD_GRAPH_NO ; int keep_paths =0; /* Keep paths in treedata.wcd when wcd can't change to them */ #ifdef WCD_USECURSES dirnode rootNode ; #endif int changedrive = 0; char drive[DD_MAXDRIVE]; int ignore_diacritics = 0; #ifdef _WCD_DOSFS int ignore_case = 1; # if (defined(_WIN32) || defined(WCD_DOSBASH) || defined(__OS2__)) char go_file[DD_MAXPATH]; int use_GoScript = 1; # endif #else int ignore_case = 0; char go_file[DD_MAXPATH]; int use_GoScript = 1; #endif #ifdef WCD_UTF16 wchar_t *cmdstr; wchar_t **wargv; #endif #ifndef __MSDOS__ /* Win32, OS/2, Unix, Cygwin */ /* setlocale is required for correct working of nl_langinfo() DOS versions of wcd will use query_con_codepage(). */ setlocale (LC_ALL, ""); #endif #ifdef ENABLE_NLS char localedir[DD_MAXPATH]; ptr = getenv("WCDLOCALEDIR"); if (ptr == NULL) strcpy(localedir,LOCALEDIR); else { if (strlen(ptr) < sizeof(localedir)) { strcpy(localedir,ptr); wcd_fixpath(localedir,sizeof(localedir)); } else { fprintf(stderr, "%s", _("Wcd: error: Value of environment variable WCDLOCALEDIR is too long.\n")); strcpy(localedir,LOCALEDIR); } } bindtextdomain (PACKAGE, localedir); textdomain (PACKAGE); #endif #ifdef __PDCURSES__ /* if ( getenv("PDC_RESTORE_SCREEN") == NULL ) putenv("PDC_RESTORE_SCREEN=1"); */ /* restore screen after exit */ if ( getenv("PDC_ORIGINAL_COLORS") == NULL ) putenv("PDC_ORIGINAL_COLORS=1"); /* use command prompt original colours */ /* When PDC_RESTORE_SCREEN is set, wcd scrolls away if command window buffer is too large. This has been fixed in PDCurses 2.7. Bug 1144353. Don't assume user has PDCurses 2.7, so don't set PDC_RESTORE_SCREEN by default. Erwin */ #endif #if defined(_WIN32) && !defined(__CYGWIN__) && defined(NCURSES_VERSION) /* On Windows TERM is not standardized and may be set to any value. * When ncurses does not understand the value of TERM it will exit * right away. On Windows (not Cygwin) it is best to not set TERM at all. */ if (getenv("TERM") != NULL) { if (putenv("TERM=") != 0) { ptr = strerror(errno); fprintf(stderr,_("Wcd: error: Failed to unset environment variable TERM: %s\n"), ptr); } } #endif if ((ptr = getenv("HOME")) == NULL) { strcpy(rootscandir,ROOTDIR); } else { if (strlen(ptr) > (DD_MAXPATH -20)) { fprintf(stderr, "%s", _("Wcd: error: Value of environment variable HOME is too long.\n")); return(1); } strncpy(rootscandir,ptr,sizeof(rootscandir)); } #ifdef _WCD_DOSFS if ((ptr = getenv("WCDHOME")) == NULL) ptr = getenv("HOME"); if (ptr != NULL) { if (strlen(ptr) > (DD_MAXPATH -20)) { fprintf(stderr, "%s", _("Wcd: error: Value of environment variable HOME or WCDHOME is too long.\n")); return(1); } use_HOME = 1 ; strcpy(rootdir,ptr); wcd_fixpath(rootdir,sizeof(rootdir)); strcpy(treefile,rootdir); strcat(treefile,TREEFILE); strcpy(extratreefile,rootdir); strcat(extratreefile,EXTRA_TREEFILE); # if (defined(_WIN32) || defined(WCD_DOSBASH) || defined(__OS2__)) strcpy(go_file,rootdir); strcat(go_file,GO_FILE); # endif strcpy(banfile,rootdir); strcat(banfile,BANFILE); strcpy(aliasfile,rootdir); strcat(aliasfile,ALIASFILE); if ((ptr = getenv("WCDSTACKFILE")) == NULL) { strcpy(stackfile,rootdir); strcat(stackfile,STACKFILE); } else { strncpy(stackfile,ptr,sizeof(stackfile)); } } else { # if (defined(WCD_WINZSH) || defined(WCD_WINPWRSH)) fprintf(stderr, "%s", _("Wcd: error: Environment variable HOME or WCDHOME is not set.\n")); return(1); # endif # if (defined(_WIN32) || defined(WCD_DOSBASH) || defined(__OS2__)) strcpy(go_file,STACK_GO_DRIVE); strcat(go_file,GO_FILE); # endif strcpy(rootdir,ROOTDIR); strcpy(treefile,TREEFILE); strcpy(extratreefile,EXTRA_TREEFILE); strcpy(banfile,BANFILE); strcpy(aliasfile,ALIASFILE); if ((ptr = getenv("WCDSTACKFILE")) == NULL) { strcpy(stackfile,STACK_GO_DRIVE); strcat(stackfile,STACKFILE); } else { strncpy(stackfile,ptr,sizeof(stackfile)); } } #else if ((ptr = getenv("WCDHOME")) == NULL) ptr = getenv("HOME"); if (ptr == NULL) { fprintf(stderr, "%s", _("Wcd: error: Environment variable HOME or WCDHOME is not set.\n")); return(1); } else { if (strlen(ptr) > (DD_MAXPATH -20)) { fprintf(stderr, "%s", _("Wcd: error: Value of environment variable HOME or WCDHOME is too long.\n")); return(1); } strcpy(rootdir,ptr); } wcd_fixpath(rootdir,sizeof(rootdir)); strcpy(treefile,rootdir); strcat(treefile,TREEFILE); strcpy(extratreefile,rootdir); strcat(extratreefile,EXTRA_TREEFILE); strcpy(go_file,rootdir); strcat(go_file,GO_FILE); strcpy(banfile,rootdir); strcat(banfile,BANFILE); strcpy(aliasfile,rootdir); strcat(aliasfile,ALIASFILE); if ((ptr = getenv("WCDSTACKFILE")) == NULL) { strcpy(stackfile,rootdir); strcat(stackfile,STACKFILE); } else { strncpy(stackfile,ptr,sizeof(stackfile)); } #endif create_dir_for_file(treefile); strncpy(scandir,rootdir,(size_t)DD_MAXPATH); strcpy(dir,""); perfect_list = namesetNew(); wild_list = namesetNew(); extra_files = namesetNew(); banned_dirs = namesetNew(); scan_dirs = namesetNew(); relative_files = namesetNew(); exclude = namesetNew(); filter = namesetNew(); DirStack = WcdStackNew(WCD_STACK_SIZE); read_treefile(banfile,banned_dirs,1); ptr = getenv("WCDSCAN"); addListToNameset(scan_dirs, ptr); ptr = getenv("WCDEXCLUDE"); addListToNameset(exclude, ptr); ptr = getenv("WCDBAN"); addListToNameset(banned_dirs, ptr); ptr = getenv("WCDFILTER"); addListToNamesetFilter(filter, ptr); stackptr = NULL; ptr = getenv("WCDUSERSHOME"); if (ptr == NULL) strcpy(homedir,HOMESTRING); else { if (strlen(ptr) > DD_MAXPATH) { fprintf(stderr, "%s", _("Wcd: error: Value of environment variable WCDUSERSHOME is too long.\n")); return(1); } strcpy(homedir,ptr); wcd_fixpath(homedir,sizeof(homedir)); } #ifdef WCD_UTF16 /* Get Unicode parameters. */ cmdstr = GetCommandLineW(); wargv = CommandLineToArgvW(cmdstr, &argc); #endif /* ---------------------- parse the commandline ------------*/ for (i=1; i < argc; i++) { if (*argv[i]=='-') /* is it a switch? */ switch (argv[i][1]) { case '\0': if (stack_is_read == 0) { stack_read(DirStack,stackfile); stack_is_read = 1; } stackptr = stack_push(DirStack,1); if (stackptr != NULL) { stack_hit = 1; stack_write(DirStack,stackfile); } break; case '0': case '1': case '2': case '3': case '4': case '5': case '6': case '7': case '8': case '9': if (stack_is_read == 0) { stack_read(DirStack,stackfile); stack_is_read = 1; } ptr = argv[i]; ptr++; stackptr = stack_push(DirStack,atoi(ptr)); if (stackptr != NULL) { stack_hit = 1; stack_write(DirStack,stackfile); } break; case 's': if (getSizeOfNamesetArray(scan_dirs) == 0) scanDisk(rootscandir,treefile,0,(size_t)0,&use_HOME,exclude); else { j = 0; while (j= 0) { stackptr = DirStack->dir[stack_index] ; if (stackptr != NULL) { stack_hit = 1; stack_write(DirStack,stackfile); } } else { #if defined(UNIX) || defined(_WIN32) || defined(__OS2__) /* empty wcd.go file */ empty_wcdgo(go_file,use_GoScript,verbose); #endif #ifdef WCD_DOSBASH /* empty wcd.go file */ empty_wcdgo(go_file,0,drive,use_GoScript,verbose); #endif return wcd_exit(perfect_list,wild_list,extra_files,banned_dirs,relative_files,DirStack,exclude); } } else /* Not a switch. Must be a dir or filename. */ { if (strcmp(argv[i-1],"-l") == 0 ) { if (wcd_getcwd(tmp, sizeof(tmp)) != NULL) { len = strlen(tmp); if (len==0) tmp[len] = '\0'; /* open the treedata file */ if ((outfile = wcd_fopen(aliasfile,"a",0)) != NULL) { wcd_fixpath(tmp,sizeof(tmp)) ; rmDriveLetter(tmp,&use_HOME); wcd_fprintf(outfile,"%s %s\n",argv[i],tmp); printf(_("Wcd: %s added to aliasfile %s\n"),tmp,aliasfile); wcd_fclose(outfile, aliasfile, "w", "main: "); } } #if defined(UNIX) || defined(_WIN32) || defined(__OS2__) /* empty wcd.go file */ empty_wcdgo(go_file,use_GoScript,verbose); #endif #ifdef WCD_DOSBASH /* empty wcd.go file */ empty_wcdgo(go_file,0,drive,use_GoScript,verbose); #endif return wcd_exit(perfect_list,wild_list,extra_files,banned_dirs,relative_files,DirStack,exclude); } else if ((strcmp(argv[i-1],"-f") == 0 ) || (strcmp(argv[i-1],"+f") == 0 )) { if (argv[i-1][0] == '-') use_default_treedata = 0; addToNamesetArray(textNew(argv[i]),extra_files); } else if (strncmp(argv[i-1],"-x",(size_t)2) == 0 ) /* exclude paths from scanning */ { strncpy(tmp,argv[i],sizeof(tmp)); wcd_fixpath(tmp,sizeof(tmp)); if (argv[i-1][2] == 'f') read_treefile(tmp,exclude,0); /* read exclude paths from file */ else addToNamesetArray(textNew(tmp),exclude); /* get path from argument */ /* printNameset("exclude ==>",exclude,stderr,true); */ } else if ((strcmp(argv[i-1],"-n") == 0 ) || (strcmp(argv[i-1],"+n") == 0 )) { if (argv[i-1][0] == '-') use_default_treedata = 0; strncpy(tmp,argv[i],sizeof(tmp)); wcd_fixpath(tmp,sizeof(tmp)); #ifdef _WCD_DOSFS /* is there a drive to go to ? */ changeDisk(tmp,&changedrive,drive,&use_HOME); #endif if (wcd_isdir(tmp,1) == 0) /* is it a dir */ { strcat(tmp,RELTREEFILE); wcd_fixpath(tmp,sizeof(tmp)); addToNamesetArray(textNew(tmp),relative_files); } else /* it is a file */ { addToNamesetArray(textNew(tmp),relative_files); } } else if ((strcmp(argv[i-1],"-u") == 0 ) || (strcmp(argv[i-1],"+u") == 0 )) { if (argv[i-1][0] == '-') use_default_treedata = 0; if (strcmp(argv[i],"root") == 0) strcpy(tmp,"/"); else strcpy(tmp,homedir); if ((strlen(tmp)+strlen(argv[i])+strlen(TREEFILE)+1) > DD_MAXPATH ) { fprintf(stderr, "%s", _("Wcd: error: Value of environment variable WCDUSERSHOME is too long.\n")); return(1); } strcat(tmp,"/"); strcat(tmp,argv[i]); strcat(tmp,TREEFILE); if ((infile = wcd_fopen(tmp,"r",1)) != NULL) { wcd_fclose(infile, tmp, "r", "main: "); addToNamesetArray(textNew(tmp),extra_files); } else { if (strcmp(argv[i],"root") == 0) strcpy(tmp2,"/"); else strcpy(tmp2,homedir); if ((strlen(tmp2)+strlen(argv[i])+strlen(TREEFILE)+1+5) > DD_MAXPATH ) { fprintf(stderr, "%s", _("Wcd: error: Value of environment variable WCDUSERSHOME is too long.\n")); return(1); } strcat(tmp2,"/"); strcat(tmp2,argv[i]); strcat(tmp2,"/.wcd"); strcat(tmp2,TREEFILE); if ((infile = wcd_fopen(tmp2,"r",1)) != NULL) { wcd_fclose(infile, tmp2, "r", "main: "); addToNamesetArray(textNew(tmp2),extra_files); } else fprintf(stderr, _("Wcd: error: Unable to read file %s or %s\n"), tmp, tmp2); } } else #ifdef _WCD_DOSFS if (strcmp(argv[i-1],"-d") == 0 ) { if (stack_is_read == 0) { stackfile[0] = argv[i][0]; #ifdef WCD_DOSBASH go_file[0] = argv[i][0]; #endif } } else #endif if (strcmp(argv[i-1],"-S") == 0 ) { #ifdef WCD_UTF16 wcstoutf8(scandir,wargv[i],sizeof(scandir)); #else strncpy(scandir,argv[i],sizeof(scandir)); #endif #if (defined(_WIN32) || defined(__CYGWIN__)) if (wcd_isServerPath(scandir)) { scanServer(scandir,treefile,0,&use_HOME,exclude); } else #endif scanDisk(scandir,treefile,0,(size_t)0,&use_HOME,exclude); } else if (strcmp(argv[i-1],"+S") == 0 ) { #ifdef WCD_UTF16 wcstoutf8(scandir,wargv[i],sizeof(scandir)); #else strncpy(scandir,argv[i],sizeof(scandir)); #endif strncpy(treefile,scandir,sizeof(treefile) - strlen(RELTREEFILE)); strcat(treefile,RELTREEFILE); scanDisk(scandir,treefile,1,(size_t)0,&use_HOME,exclude); } else if (strcmp(argv[i-1],"-z") == 0 ) { if ((stack_is_read == 0) && (atoi(argv[i]) >= 0)) DirStack->maxsize = atoi(argv[i]); } else if (strcmp(argv[i-1],"-A") == 0 ) { #ifdef WCD_UTF16 wcstoutf8(scandir,wargv[i],sizeof(scandir)); #else strncpy(scandir,argv[i],sizeof(scandir)); #endif #if (defined(_WIN32) || defined(__CYGWIN__)) if (wcd_isServerPath(scandir)) { scanServer(scandir,treefile,1,&use_HOME,exclude); } else #endif scanDisk(scandir,treefile,0,(size_t)1,&use_HOME,exclude); } else if (strcmp(argv[i-1],"-E") == 0 ) { #ifdef WCD_UTF16 wcstoutf8(scandir,wargv[i],sizeof(scandir)); #else strncpy(scandir,argv[i],sizeof(scandir)); #endif #if (defined(_WIN32) || defined(__CYGWIN__)) if (wcd_isServerPath(scandir)) { scanServer(scandir,extratreefile,1,&use_HOME,exclude); } else #endif scanDisk(scandir,extratreefile,0,(size_t)1,&use_HOME,exclude); } else if (strcmp(argv[i-1],"-m") == 0 ) { #ifdef WCD_UTF16 wcstoutf8(tmp,wargv[i],sizeof(tmp)); #else strncpy(tmp,argv[i],sizeof(tmp)); #endif makeDir(tmp,treefile,&use_HOME) ; } else if (strcmp(argv[i-1],"-M") == 0 ) { strncpy(tmp,argv[i],sizeof(tmp)); makeDir(tmp,extratreefile,&use_HOME) ; } else if (strcmp(argv[i-1],"-r") == 0 ) /* remove one dir, or link to dir */ { #ifdef WCD_UTF16 wcstoutf8(tmp,wargv[i],sizeof(tmp)); #else strncpy(tmp,argv[i],sizeof(tmp)); #endif deleteDir(tmp,treefile,0,&use_HOME, assumeYes) ; } else if (strcmp(argv[i-1],"-rmtree") == 0 ) /* remove dir recursive */ { strncpy(tmp,argv[i],sizeof(tmp)); deleteDir(tmp,treefile,1,&use_HOME, assumeYes) ; } #ifdef WCD_SHELL else if (strcmp(argv[i-1],"-G") == 0) { strncpy(go_file,argv[i],sizeof(go_file)); wcd_fixpath(go_file,sizeof(go_file)) ; # ifdef UNIX strcat(go_file,GO_FILE2); # else strcat(go_file,GO_FILE); # endif } #endif else { #ifdef WCD_UTF16 wcstoutf8(dir,wargv[i],sizeof(dir)); #else strncpy(dir,argv[i],sizeof(dir)); #endif wcd_fixpath(dir,sizeof(dir)); } } } /* for */ /*--- end parsing commandline -----------*/ if (verbose > 0) { for (ii=0; iisize; ++ii) printf(_("Wcd: WCDSCAN directory {%s}\n"),elementAtNamesetArray(ii, scan_dirs)); for (ii=0; iisize; ++ii) printf(_("Wcd: banning {%s}\n"),elementAtNamesetArray(ii, banned_dirs)); for (ii=0; iisize; ++ii) printf(_("Wcd: excluding {%s}\n"),elementAtNamesetArray(ii, exclude)); for (ii=0; iisize; ++ii) printf(_("Wcd: filtering {%s}\n"),elementAtNamesetArray(ii, filter)); } if (stack_is_read == 0) { stack_read(DirStack,stackfile); stack_is_read = 1; } if ((strcmp(dir,"") == 0 )&& !(graphics & WCD_GRAPH_NORMAL)) /* no directory given, no graphics, so we go HOME */ addToNamesetArray(textNew(rootscandir),perfect_list); /*--- stack hit ? ------------------------*/ if (stack_hit==1) { strcpy(best_match,stackptr); #ifdef UNIX /* strip the /tmp_mnt string */ if (strip_mount_string) stripTmpMnt(best_match); #endif if ((!quieter)&&(!justGo)) wcd_printf("-> %s\n",best_match); #ifdef _WCD_DOSFS /* is there a drive to go to ? */ changeDisk(best_match,&changedrive,drive,&use_HOME); #endif #ifdef WCD_SHELL quoteString(best_match); if (justGo) wcd_printf("%s\n",best_match); writeGoFile(go_file,&changedrive,drive,best_match,use_GoScript,verbose); #else wcd_chdir(best_match,0); /* change to directory */ #endif stack_write(DirStack,stackfile); return wcd_exit(perfect_list,wild_list,extra_files,banned_dirs,relative_files,DirStack,exclude); } /*--- end stack hit ? ------------------------*/ /*--- Direct CD mode -------------------------*/ if ((cd==1)&&(strcmp(dir,"")!=0)) /* Try open dir direct. */ { if(wcd_isdir(dir,1) == 0) /* GJM */ { if ( use_stdout & WCD_STDOUT_DUMP ) /* just dump the match and exit */ { wcd_printf("%s\n", dir); #if defined(UNIX) || defined(_WIN32) || defined(__OS2__) /* empty wcd.go file */ empty_wcdgo(go_file,use_GoScript,verbose); #endif #ifdef WCD_DOSBASH /* empty wcd.go file */ empty_wcdgo(go_file,changedrive,drive,use_GoScript,verbose); #endif return wcd_exit(perfect_list,wild_list,extra_files,banned_dirs,relative_files,DirStack,exclude); } strcpy(best_match,dir); if ((!quieter)&&(!justGo)) wcd_printf("-> %s\n",best_match); #ifdef _WCD_DOSFS /* is there a drive to go to ? */ changeDisk(best_match,&changedrive,drive,&use_HOME); #endif wcd_chdir(dir,0); if(wcd_getcwd(tmp, sizeof(tmp)) != NULL) { len = strlen(tmp); if (len==0) tmp[len] = '\0'; wcd_fixpath(tmp,sizeof(tmp)); if ( (ptr=strstr(tmp,"/")) != NULL) { strcpy(best_match,tmp); #ifdef UNIX /* strip the /tmp_mnt string */ if (strip_mount_string) stripTmpMnt(best_match); #endif stack_add(DirStack,tmp); /* stack include /tmp_mnt string */ stack_write(DirStack,stackfile); } } #ifdef WCD_SHELL quoteString(best_match); if (justGo) wcd_printf("%s\n",best_match); writeGoFile(go_file,&changedrive,drive,best_match,use_GoScript,verbose); #else wcd_chdir(best_match,0); /* change to directory */ #endif return wcd_exit(perfect_list,wild_list,extra_files,banned_dirs,relative_files,DirStack,exclude); } /* ? (wcd_isdir(dir) == 0) */ } /* ? direct cd mode ((cd==1)&&(strcmp(dir,"")!=0)) */ /*--- end Direct CD mode -------------------------*/ #ifdef _WCD_DOSFS /* is there a drive to go to ? */ changeDisk(dir,&changedrive,drive,&use_HOME); #endif /* does default treedata-file exist? */ if (use_default_treedata) { if ((infile = wcd_fopen(treefile,"r",1)) == NULL) { /* create treefile */ if (getSizeOfNamesetArray(scan_dirs) == 0) scanDisk(rootscandir,treefile,0,(size_t)0,&use_HOME,exclude); else { j = 0; while (jsize;ii++) { scanfile(dir, extra_files->array[ii],ignore_case,perfect_list,wild_list,banned_dirs,filter,0,wildOnly,ignore_diacritics); /* scan the extra treedata file */ } /* search relative files */ for (ii=0;iisize;ii++) { scanfile(dir, relative_files->array[ii],ignore_case,perfect_list,wild_list,banned_dirs,filter,1,wildOnly,ignore_diacritics); /* scan the nfs treedata file */ } /* search alias file */ scanaliasfile(dir, aliasfile, perfect_list, wild_list,wildOnly); freeNameset(filter, 1); /* free filter list */ } #ifdef WCD_USECURSES else { /* graphics? */ if (graphics & WCD_GRAPH_NORMAL) { nameset dirs; dirs = namesetNew(); rootNode = createRootNode(); if(dirs != NULL) { if (use_default_treedata) read_treefile(treefile,dirs,0); read_treefile(extratreefile,dirs,1); for (ii=0;iisize;ii++) { read_treefile(extra_files->array[ii],dirs,0); } for (ii=0;iisize;ii++) { read_treefile(relative_files->array[ii],dirs,0); } buildTreeFromNameset(dirs, rootNode); setXYTree(rootNode, &graphics); } freeNameset(dirs, 1); if (graphics & WCD_GRAPH_DUMP) { dumpTree(rootNode, &graphics); ptr = NULL; } else ptr = selectANode(rootNode,&use_HOME,ignore_case,graphics,ignore_diacritics); if (ptr != NULL) addToNamesetArray(textNew(ptr),perfect_list); else { #if defined(UNIX) || defined(_WIN32) || defined(__OS2__) /* empty wcd.go file */ empty_wcdgo(go_file,use_GoScript,verbose); #endif #ifdef WCD_DOSBASH /* empty wcd.go file */ empty_wcdgo(go_file,changedrive,drive,use_GoScript,verbose); #endif return wcd_exit(perfect_list,wild_list,extra_files,banned_dirs,relative_files,DirStack,exclude); } } } #endif /*********** search is done ***************/ if ((perfect_list->size==0)&&(wild_list->size == 0)&&(cd==0)) /* No match at all & no direct CD mode */ { if(wcd_isdir(dir,1) == 0) /* GJM */ { /* typed directory exists */ addToNamesetArray(textNew(dir),perfect_list); } } /*******************************/ if ((perfect_list->size==0)&&(wild_list->size == 0)) /* No match at all */ { if ( !(use_stdout & WCD_STDOUT_DUMP) ) /* don't print message if option -od is used */ wcd_printf(_("Wcd: No directory found matching %s\nWcd: Perhaps you need to rescan the disk or path is banned.\n"),dir); #if defined(UNIX) || defined(_WIN32) || defined(__OS2__) /* empty wcd.go file */ empty_wcdgo(go_file,use_GoScript,verbose); #endif #ifdef WCD_DOSBASH /* empty wcd.go file */ empty_wcdgo(go_file,changedrive,drive,use_GoScript,verbose); #endif return wcd_exit(perfect_list,wild_list,extra_files,banned_dirs,relative_files,DirStack,exclude); } else if (perfect_list->size > 1) /* choose from perfect list */ { #ifdef WCD_USECURSES if(graphics & WCD_GRAPH_NORMAL) { rootNode = createRootNode(); buildTreeFromNameset(perfect_list, rootNode); setXYTree(rootNode, &graphics); if (graphics & WCD_GRAPH_DUMP) { dumpTree(rootNode, &graphics); ptr = NULL; } else ptr = selectANode(rootNode,&use_HOME,ignore_case,graphics,ignore_diacritics); if (ptr != NULL) strcpy(best_match,ptr); else exit_wcd = 1; } else #endif { if (justGo) i = (int)pickDir(perfect_list,&use_HOME); else i = display_list(perfect_list,1,use_numbers,use_stdout); if ( (i>0) && (i <= (int)perfect_list->size)) { i--; strcpy(best_match,perfect_list->array[i]); } else exit_wcd = 1; } if (exit_wcd) { #if defined(UNIX) || defined(_WIN32) || defined(__OS2__) /* empty wcd.go file */ empty_wcdgo(go_file,use_GoScript,verbose); #endif #ifdef WCD_DOSBASH /* empty wcd.go file */ empty_wcdgo(go_file,changedrive,drive,use_GoScript,verbose); #endif return wcd_exit(perfect_list,wild_list,extra_files,banned_dirs,relative_files,DirStack,exclude); } } else if (perfect_list->size==1) /* one perfect match */ { strcpy(best_match,perfect_list->array[0]); } else if ((perfect_list->size==0)&&(wild_list->size > 1)) /* more than one wild match, zero perfect matches */ { /* choose from wild list */ #ifdef WCD_USECURSES if(graphics & WCD_GRAPH_NORMAL) { rootNode = createRootNode(); buildTreeFromNameset(wild_list, rootNode); setXYTree(rootNode, &graphics); if (graphics & WCD_GRAPH_DUMP) { dumpTree(rootNode, &graphics); ptr = NULL; } else ptr = selectANode(rootNode,&use_HOME,ignore_case,graphics,ignore_diacritics); if (ptr != NULL) strcpy(best_match,ptr); else exit_wcd = 1; } else #endif { if (justGo) i = (int)pickDir(wild_list,&use_HOME); else i = display_list(wild_list,0,use_numbers,use_stdout); if ( (i>0) && (i <= (int)wild_list->size)) { i--; strcpy(best_match,wild_list->array[i]); } else exit_wcd = 1; } if (exit_wcd) { #if defined(UNIX) || defined(_WIN32) || defined(__OS2__) /* empty wcd.go file */ empty_wcdgo(go_file,use_GoScript,verbose); #endif #ifdef WCD_DOSBASH /* empty wcd.go file */ empty_wcdgo(go_file,changedrive,drive,use_GoScript,verbose); #endif return wcd_exit(perfect_list,wild_list,extra_files,banned_dirs,relative_files,DirStack,exclude); } } else /* (perfect_list->size==0) && (wild_list->size==1) */ /* one wild match, zero perfect matches */ { strcpy(best_match,wild_list->array[0]); } /*******************************/ /* Yes, a match (best_match) */ if ( use_stdout & WCD_STDOUT_DUMP ) /* just dump the match and exit */ { wcd_printf("%s\n", best_match); #if defined(UNIX) || defined(_WIN32) || defined(__OS2__) /* empty wcd.go file */ empty_wcdgo(go_file,use_GoScript,verbose); #endif #ifdef WCD_DOSBASH /* empty wcd.go file */ empty_wcdgo(go_file,changedrive,drive,use_GoScript,verbose); #endif return wcd_exit(perfect_list,wild_list,extra_files,banned_dirs,relative_files,DirStack,exclude); } strcpy(tmp,best_match); /* remember path (with /tmp_mnt) */ #ifdef UNIX /* strip the /tmp_mnt string */ if (strip_mount_string) stripTmpMnt(best_match); #else changeDisk(tmp,&changedrive,drive,&use_HOME); #endif if ( wcd_chdir(best_match,0) == 0) /* change to dir to get full path */ { if(wcd_getcwd(tmp, sizeof(tmp)) != NULL) { if ((!quieter)&&(!justGo)) wcd_printf("-> %s\n",best_match); /* print match without /tmp_mnt string */ len = strlen(tmp); if (len==0) tmp[len] = '\0'; wcd_fixpath(tmp,sizeof(tmp)); if ( (ptr=strstr(tmp,"/")) != NULL) { strcpy(best_match,tmp); #ifdef UNIX /* strip the /tmp_mnt string */ if (strip_mount_string) stripTmpMnt(best_match); #endif stack_add(DirStack,tmp); /* stack includes /tmp_mnt string */ stack_write(DirStack,stackfile); } } } else { wcd_printf(_("Wcd: Cannot change to %s\n"),best_match); #if defined(UNIX) || defined(_WIN32) || defined(__OS2__) /* empty wcd.go file */ empty_wcdgo(go_file,use_GoScript,verbose); #endif #ifdef WCD_DOSBASH /* empty wcd.go file */ empty_wcdgo(go_file,changedrive,drive,use_GoScript,verbose); #endif if (keep_paths == 0) cleanTreeFile(treefile,tmp); return wcd_exit(perfect_list,wild_list,extra_files,banned_dirs,relative_files,DirStack,exclude); } #ifdef WCD_SHELL quoteString(best_match); if (justGo) wcd_printf("%s\n",best_match); writeGoFile(go_file,&changedrive,drive,best_match,use_GoScript,verbose); #else wcd_chdir(best_match,0); /* change to directory */ #endif return wcd_exit(perfect_list,wild_list,extra_files,banned_dirs,relative_files,DirStack,exclude); } wcd-5.2.4/src/wcd.h0000644000175000010010000001324412127761643013314 0ustar waterlanNone/* 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_H #define _WCD_H #include #include #include "tailor.h" #include "std_macr.h" #include "structur.h" #if defined(__MSDOS__) || defined(__OS2__) || (defined(_WIN32) && !defined(__CYGWIN__)) /* A DOS like file system: * with drive letters * case insensitive * backslash separator. */ #define _WCD_DOSFS 1 #endif #ifdef VMS # define EXIT_OK 1 # define ALT_SW || *argv[i]=='/' # define CHDIR(s) vms_chdir(s) #else # define EXIT_OK 0 # define CHDIR(s) chdir(s) # ifdef _WCD_DOSFS # define ALT_SW || *argv[i]=='/' # define TREEFILE "/treedata.wcd" # define RELTREEFILE "/rtdata.wcd" /* relative treedata */ # define EXTRA_TREEFILE "/extra.wcd" # define BANFILE "/ban.wcd" # define ALIASFILE "/alias.wcd" # define STACK_GO_DRIVE "c:" # define STACKFILE "/stack.wcd" # ifdef WCD_WINZSH # define GO_FILE "/wcd.go" # elif defined(WCD_WINPWRSH) # define GO_FILE "/wcdgo.ps1" # elif defined(_WIN32) # define GO_FILE "/wcdgo.bat" # elif defined(__OS2__) # define GO_FILE "/wcdgo.cmd" # else # define GO_FILE "/wcd.go" # endif # define ROOTDIR "/" # define HOMESTRING "//users" # define DIR_SEPARATOR '/' # else /* ?UNIX */ # define ALT_SW # define TREEFILE "/.treedata.wcd" # define RELTREEFILE "/.rtdata.wcd" /* relative treedata */ # define EXTRA_TREEFILE "/.extra.wcd" # define BANFILE "/.ban.wcd" # define ALIASFILE "/.alias.wcd" # define STACKFILE "/.stack.wcd" # define ROOTDIR "/" # define HOMESTRING "/home" # define TMP_MNT_STR "/tmp_mnt/" /* temp mount dir for automounter, including ending / */ # define GO_FILE "/bin/wcd.go" # define GO_FILE2 "/wcd.go" # define DIR_SEPARATOR '/' # endif /* ?__MSDOS__ */ #endif /* ?VMS */ #if defined(UNIX) || defined(_WIN32) || defined(WCD_DOSBASH) || defined(__OS2__) /* A go-script is required */ #define WCD_SHELL #endif #if defined(UNIX) || defined(WCD_WINZSH) || defined(WCD_DOSBASH) || defined(WCD_OS2BASH) #define WCD_UNIXSHELL #endif /* Unix shells DJGPP-bash and WinZsh use Windows style paths, e.g. "c:/Program Files". * So in these shells we have to use a semicolon ';' as list separator. */ #ifdef _WCD_DOSFS # define LIST_SEPARATOR ";" #else # define LIST_SEPARATOR ":" #endif #if defined(__MSDOS__) || defined(_WIN32) || defined(__OS2__) || defined(VMS) # define OP_DIR "" #else /* ?unix */ # define OP_DIR "." #endif /* ?__MSDOS__|VMS */ /* Function prototypes */ #if defined(UNIX) || defined(WCD_DOSBASH) || defined(_WIN32) || defined(__OS2__) void quoteString(char *string); #endif #if defined(_WIN32) && !defined(__CYGWIN__) && defined(WCD_UNICODE) # define WCD_UTF16 # define WCSTOMBS wcstoutf8 # define MBSTOWCS utf8towcs #elif defined(_WIN32) && !defined(__CYGWIN__) && !defined(WCD_UTF16) # define WCD_ANSI # define WCSTOMBS wcstoansi # define MBSTOWCS ansitowcs #else # define WCSTOMBS wcstombs # define MBSTOWCS mbstowcs #endif #ifdef WCD_UTF16 typedef unsigned char wcd_uchar; typedef wchar_t wcd_char; #else typedef unsigned char wcd_uchar; typedef char wcd_char; #endif #if defined(_WIN32) && !defined(__CYGWIN__) # define WCD_WINDOWS #endif #define FILE_MBS 0 /* Multi-byte string or 8-bit char */ #define FILE_UTF16LE 1 /* UTF-16 Little Endian */ #define FILE_UTF16BE 2 /* UTF-16 Big Endian */ #define FILE_UTF8 3 /* UTF-8 */ FILE *wcd_fopen(const char *filename, const char *m, int quiet); FILE *wcd_fopen_bom(const char *filename, const char *m, int quiet, int *bomtype); void wcd_fclose(FILE *fp, const char *filename, const char *m, const char *functionname); void finddirs(char *dir, size_t *offset, FILE *outfile, int *use_HOME, nameset exclude, int quiet); int read_treefile(char *filename, nameset bd, int silent); void rmDirFromList(char *string, nameset n); void writeList(char *filename, nameset n, int bomtype); void cleanTreeFile(char *filename, char *dir); void create_dir_for_file(char *f); char *removeBackSlash(char *string); void addCurPathToFile(char *filename, int *use_HOME, int parents); int check_double_match(char *dir, nameset set); void scanfile(char *org_dir, char *filename, int ignore_case, nameset pm, nameset wm, nameset bd, nameset filter, int relative, int wildOnly, int ignore_diacritics); void scanaliasfile(char *org_dir, char *filename, nameset pm, nameset wm, int wildOnly); int strcompare(const char*, const char*, int); void print_help(void); #ifdef ENABLE_NLS void print_version(char *localedir); #else void print_version(void); #endif int wcd_get_int(void); int wcd_getline(char s[], int lim, FILE* infile, const char* file_name, const int* line_nr); int wcd_exit(nameset pm, nameset wm, nameset ef, nameset bd, nameset nfs, WcdStack ws, nameset excl); void getCurPath(char *buffer, size_t size, int *use_HOME); #ifdef WCD_DOSBASH void empty_wcdgo(char *go_file, int changedrive, char *drive, int use_GoScript, int verbose); #else void empty_wcdgo(char *go_file, int use_GoScript, int verbose); #endif int SpecialDir(const char *path); #endif wcd-5.2.4/src/wcddir.c0000644000175000010010000004454212135313660014002 0ustar waterlanNone/* filename: wcddir.c WCD - Chdir for Dos and Unix. Author: Erwin Waterlander ====================================================================== = Copyright = ====================================================================== Copyright (C) 2002-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. ======================================================================= */ /* set tabstop=3 */ /* This file contains wrapper functions that operate on directories. These are needed to use the WIN32 API functions. WIN32 API functions are needed to get support for UNC paths. */ #include "config.h" #include #include #ifdef _MSC_VER #define S_ISDIR( m ) (((m) & _S_IFMT) == _S_IFDIR) #endif #if defined(UNIX) || defined(__DJGPP__) || defined(__OS2__) # include #endif #include "dosdir.h" #include "wcddir.h" #include "match.h" #include #include #if (defined(_WIN32) && defined(WCD_UNICODE)) #include #endif #if (defined(_WIN32) || defined(__CYGWIN__)) /* WIN32: Use WIN32 API to support UNC paths. CYGWIN: Use WIN32 API only to scan servers and find shared directories. The Cygwin POSIX interface already supports UNC paths directly. In Cygwin the Win32 api function don't work on cygwin (unix like) paths. */ #include "std_macr.h" #include "structur.h" #include "Text.h" #include "nameset.h" #include "wfixpath.h" #include "dosdir.h" #include #include "display.h" #include /* #include */ #include "wcd.h" /* int wcd_isServerPath (char* path) check if path is a possible UNC server path like \\servername RETURNS 1 if true RETURNS 0 if false */ int wcd_isServerPath (char* path) { if ((strlen(path) > 2) && (wcd_is_slash(*path)) && (wcd_is_slash(*(path+1))) && (strchr(path+2,'/') == NULL) && (strchr(path+2,'\\') == NULL)) return(1); else return(0); } void exterr( void ) { /* This function was taken from Felix Kasza's Win32 Samples page at MVPS.ORG. http://www.mvps.org/win32/ */ char errbuf[2048], namebuf[2048]; DWORD err; errbuf[0] = namebuf[0] = '\0'; if ( WNetGetLastError( &err, errbuf, sizeof errbuf, namebuf, sizeof namebuf ) == NO_ERROR ) printf( _("Wcd: Error %lu (\"%s\") reported by \"%s\".\n"), err, errbuf, namebuf ); return; } #define MAX_NR_BUF 1000 int doEnum( int level, NETRESOURCE *pnr, nameset n ) { /* This function was taken from Felix Kasza's Win32 Samples page at MVPS.ORG. http://www.mvps.org/win32/ */ DWORD rc, rc2; HANDLE hEnum; DWORD count, bufsize, ui; NETRESOURCE buf[MAX_NR_BUF]; /* const char *type; */ char path[DD_MAXPATH]; rc = WNetOpenEnum( RESOURCE_GLOBALNET, RESOURCETYPE_DISK, 0, pnr, &hEnum ); if ( rc == ERROR_ACCESS_DENIED ) { /* printf( "%-6.6s %-4.4s%*s Error 5 -- access denied\n", "", "", level * 2, "" ); */ printf( _("Wcd: access denied.\n")); return 1; } if ( rc ) { rc2 = GetLastError(); /* printf( "WNOE(): rc = %lu, gle = %lu\n", rc, rc2 ); */ if ( rc2 == ERROR_EXTENDED_ERROR ) exterr(); return 0; } while ( 1 ) { count = (DWORD) -1L; bufsize = sizeof buf; rc = WNetEnumResource( hEnum, &count, buf, &bufsize ); if ( rc != NO_ERROR ) break; for ( ui = 0; (ui < count); ++ ui ) { switch ( buf[ui].dwDisplayType ) { case RESOURCEDISPLAYTYPE_DOMAIN: /* type = "domain"; */ break; case RESOURCEDISPLAYTYPE_GENERIC: /* type = "generic"; */ break; case RESOURCEDISPLAYTYPE_SERVER: /* type = "server"; */ break; case RESOURCEDISPLAYTYPE_SHARE: /* type = "share"; */ printf( "Wcd: %s\n", buf[ui].lpRemoteName ); strncpy(path, buf[ui].lpRemoteName, DD_MAXPATH); wcd_fixpath(path, DD_MAXPATH); addToNamesetArray(textNew(path), n); break; default: /* type = "unknown"; */ break; } /* now we recurse if it's a container */ if ( buf[ui].dwUsage & RESOURCEUSAGE_CONTAINER ) doEnum( level + 1, &buf[ui], n ); } } if ( rc != ERROR_NO_MORE_ITEMS ) /* bad things */ { rc2 = GetLastError(); /* printf( "WNER(): rc = %lu, gle = %lu\n", rc, rc2 ); */ if ( rc2 == ERROR_EXTENDED_ERROR ) exterr(); } WNetCloseEnum( hEnum ); return 1; } /************************************************************* * * wcd_getshares(char *path, nameset n) * * In case path points to a server this function will * search for shared directories on that server and add * the shared directory names to n. *************************************************************/ void wcd_getshares(char* path, nameset n) { NETRESOURCE nr; if ((path == NULL) || (n == NULL)) return; if (wcd_isServerPath(path)) { /* an UNC path, possibly pointing to a server */ /* WIN32 API needs backslashes. */ *path = '\\'; *(path+1) = '\\'; printf(_("Wcd: Searching for shared directories on server %s\n"), path); nr.dwScope = RESOURCE_GLOBALNET; nr.dwType = RESOURCETYPE_ANY; nr.dwDisplayType = RESOURCEDISPLAYTYPE_SERVER; nr.dwUsage = RESOURCEUSAGE_CONTAINER; nr.lpLocalName = NULL; nr.lpRemoteName = path ; nr.lpProvider = NULL; doEnum( 0, &nr, n ); } printf(_("Wcd: Found %lu shared directories on server %s\n"), (unsigned long)getSizeOfNamesetArray(n), path); } #endif #if (defined(_WIN32) && !defined(__CYGWIN__)) /* WIN32, not CYGWIN Use WIN32 API */ void PrintError(DWORD dw) { /* Retrieve the system error message for the last-error code */ LPVOID lpMsgBuf; FormatMessage( FORMAT_MESSAGE_ALLOCATE_BUFFER | FORMAT_MESSAGE_FROM_SYSTEM | FORMAT_MESSAGE_IGNORE_INSERTS, NULL, dw, MAKELANGID(LANG_NEUTRAL, SUBLANG_DEFAULT), (LPTSTR) &lpMsgBuf, 0, NULL ); /* Display the error message */ /* MessageBox(NULL, (LPCTSTR)lpMsgBuf, TEXT("Error"), MB_OK); */ fprintf(stderr, "%s\n",(LPCTSTR)lpMsgBuf); LocalFree(lpMsgBuf); } /* int wcd_isSharePath (char* path) check if path is a possible UNC share path like \\servername\sharename RETURNS 1 if true RETURNS 0 if false */ int wcd_isSharePath (char* path) { char *ptr; /* Assume the path has been fixed by wcd_fixpath(). Only forward slashes. */ if ((strlen(path) > 2) && (wcd_is_slash(*path)) && (wcd_is_slash(*(path+1)))) { ptr = strchr(path+2,'/'); if (ptr == NULL) return(0); else { ptr = strchr(ptr+1,'/'); if (ptr == NULL) { return(1); } else return(0); } } else return(0); } /* * wcd_islink() * Check if directory is a symbolic link. * Returns: 1 if dir is a symlink, 0 if dir is not a symlink. */ int wcd_islink(const char *dir, int quiet) { DWORD attrs; DWORD dw; #ifdef WCD_UNICODE static wchar_t wstr[DD_MAXPATH]; if (utf8towcs(wstr, dir, DD_MAXPATH) == (size_t)(-1)) attrs = INVALID_FILE_ATTRIBUTES; else attrs = GetFileAttributesW(wstr); #else attrs = GetFileAttributes(dir); #endif if (attrs == INVALID_FILE_ATTRIBUTES) { if ( !quiet ) { dw = GetLastError(); wcd_printf(_("Wcd: error: wcd_islink: ")); PrintError(dw); } return(0); } return ((attrs & FILE_ATTRIBUTE_REPARSE_POINT) != 0); } /* If WCD_UNICODE is defined we assume that all multi-byte * strings are encoded in UTF-8. */ char *wcd_getcwd(char *buf, size_t size) { DWORD err; DWORD dw; #ifdef WCD_UNICODE static wchar_t wstr[DD_MAXPATH]; err = GetCurrentDirectoryW(size, wstr); if ( err != 0) if (wcstoutf8(buf, wstr, DD_MAXPATH) == (size_t)(-1)) err = 0; #else err = GetCurrentDirectory(size, buf); #endif if (err == 0) { dw = GetLastError(); fprintf(stderr, "%s", _("Wcd: error: Unable to get current working directory: ")); PrintError(dw); return(NULL); /* fail */ } else return(buf); /* success */ } int wcd_chdir(char *buf, int quiet) { BOOL err; DWORD dw; #ifdef WCD_UNICODE static wchar_t wstr[DD_MAXPATH]; if (utf8towcs(wstr, buf, DD_MAXPATH) == (size_t)(-1)) err = 0; else err = SetCurrentDirectoryW(wstr); #else err = SetCurrentDirectory(buf); #endif if (err == 0) { if ( !quiet ) { dw = GetLastError(); wcd_printf(_("Wcd: error: Unable to change to directory %s: "), buf); PrintError(dw); } return(1); /* fail */ } else return(0); /* success */ } int wcd_mkdir(char *buf, int quiet) { BOOL err; DWORD dw; #ifdef WCD_UNICODE static wchar_t wstr[DD_MAXPATH]; if (utf8towcs(wstr, buf, DD_MAXPATH) == (size_t)(-1)) err = FALSE; else err = CreateDirectoryW(wstr, NULL); #else err = CreateDirectory(buf, NULL); #endif if (err == TRUE) return(0); /* success */ else { if ( !quiet ) { dw = GetLastError(); wcd_printf(_("Wcd: error: Unable to create directory %s: "), buf); PrintError(dw); } return(1); /* fail */ } } int wcd_rmdir(char *buf, int quiet) { BOOL err; DWORD dw; #ifdef WCD_UNICODE static wchar_t wstr[DD_MAXPATH]; if (utf8towcs(wstr, buf, DD_MAXPATH) == (size_t)(-1)) err = FALSE; else err = RemoveDirectoryW(wstr); #else err = RemoveDirectory(buf); #endif if (err == TRUE) return(0); /* success */ else { if ( !quiet ) { dw = GetLastError(); wcd_printf(_("Wcd: error: Unable to remove directory %s: "), buf); PrintError(dw); } return(1); /* fail */ } } /****************************************************************** * * int wcd_isdir(char *dir) * * test if *dir points to a directory. * * returns 0 on success, -1 when it fails. * * - The following method using POSIX API fails on UNC share paths * like //servername/sharename on MS-Windows systems. * * stat(path, &buf) ; * if (S_ISDIR(buf.st_mode)) { ... } * * See also bug report at http://sourceforge.net/projects/mingw/ * http://sourceforge.net/tracker/?func=detail&atid=102435&aid=3304800&group_id=2435 * * - The function 'opendir()' from works on all systems, * also on Windows UNC paths as above, but not all compilers have 'dirent' * included. E.g. LCC 3.8 and Open Watcom 1.3 don't have it. * * - Using 'wcd_chdir()' is a portable solution to check \\servername\sharename. * ******************************************************************/ int wcd_isdir(char *dir, int quiet) { #ifdef WCD_UTF16 static wchar_t wstr[DD_MAXPATH]; BOOL err; DWORD dw; struct _stat buf; #else struct stat buf; #endif char *errstr; char tmp[DD_MAXDIR]; if (wcd_isSharePath(dir)) { wcd_getcwd(tmp, sizeof(tmp)); /* remember current dir */ if (wcd_chdir(dir, quiet) == 0) /* just try to change to dir */ { wcd_chdir(tmp, quiet); /* go back */ return(0); } else return(-1); } else { #ifdef WCD_UTF16 if (utf8towcs(wstr, dir, DD_MAXPATH) == (size_t)(-1)) err = FALSE; else err = TRUE; if (err == TRUE) { if (_wstat(wstr, &buf) == 0) { if (S_ISDIR(buf.st_mode)) return(0); else return(-1); } else { if (!quiet) { errstr = strerror(errno); wcd_printf("Wcd: %s: %s\n", dir, errstr); } return(-1); } } else { if ( !quiet ) { dw = GetLastError(); wcd_printf("Wcd: %s: ", dir); PrintError(dw); } return(-1); /* fail */ } #else if (stat(dir, &buf) == 0) { if (S_ISDIR(buf.st_mode)) return(0); else return(-1); } else { if (!quiet) { errstr = strerror(errno); fprintf(stderr,"Wcd: %s: %s\n", dir, errstr); } return(-1); } #endif } } #else /************************************************************/ /* Use POSIX API */ #if defined(UNIX) || defined(__DJGPP__) || defined(__EMX__) int wcd_mkdir(char *buf, mode_t m, int quiet) { char *errstr; int err; err = mkdir(buf, m); if ( !quiet && err) { errstr = strerror(errno); fprintf(stderr,_("Wcd: error: Unable to create directory %s: %s\n"), buf, errstr); } return(err); } #else int wcd_mkdir(char *buf, int quiet) { char *errstr; int err; err = mkdir(buf); if ( !quiet && err) { errstr = strerror(errno); fprintf(stderr,_("Wcd: error: Unable to create directory %s: %s\n"), buf, errstr); } return(err); } #endif #ifdef UNIX /* The $HOME directory can be mounted to a long absolute path by * a volume manager. Replace the absolute volume path by $HOME. */ char *replace_volume_path_HOME(char *buf, size_t size) { static char *home = NULL; /* value of $HOME env variable */ static char home_abs[DD_MAXPATH]; /* absolute volume path of $HOME */ static char status = 0; static size_t len_home = 0; static size_t len_home_abs = 0; size_t i, len_buf; size_t j; char tmp[DD_MAXPATH]; static char pattern[DD_MAXPATH]; char *ptr1, *ptr2; if (buf == NULL) return(NULL); if ( status == 0 ) { /* not intialised. */ /* initialize only once. */ if ((home = getenv("HOME")) != NULL ) { getcwd(tmp, sizeof(tmp)); /* remember current dir */ if (wcd_chdir(home,0) == 0) { if (getcwd(home_abs, sizeof(home_abs)) == NULL) { status = 3; /* fail */ } else { if (strcmp(home,home_abs) == 0) { status = 4; /* home and home_abs are equal */ } else { if ( ((ptr1 = strrchr(home,DIR_SEPARATOR)) != NULL) && ((ptr2 = strrchr(home_abs,DIR_SEPARATOR)) != NULL)) { if (strcmp(ptr1,ptr2) == 0) { /* Both paths have same user name. Strip user name, so that * also paths from other users benefit if users have a common * volume prefix. Depends on how Volume Manager was configured. */ ptr1 = '\0'; ptr2 = '\0'; } } strncpy(pattern, home_abs, sizeof(pattern)-1); strcat(pattern,"*"); len_home = strlen(home); len_home_abs = strlen(home_abs); if (len_home <= len_home_abs) { status = 1; /* home and home_abs are not equal */ } else { status = 2; /* home and home_abs are not equal */ } } } wcd_chdir(tmp,0); /* go back */ } else { status = 5; /* fail */ } } else { status = 6; /* fail */ } /* printf("status = %d\n", status); */ } if ( status == 1 ) /* $HOME is shorter or equal length than volume name */ { if (dd_match(buf, pattern , 0)) { len_buf = strlen(buf); for (i=0; i < len_home; i++) buf[i] = home[i]; j = i; for (i=len_home_abs; i < len_buf; i++) { buf[j] = buf[i]; ++j; } buf[j] = '\0'; } } if ( status == 2 ) /* $HOME is longer than volume name */ { if (dd_match(buf, pattern, 0)) { len_buf = strlen(buf); for (i=0; (i < len_home) && (i < size); i++) tmp[i] = home[i]; j = i; for (i=len_home_abs; (i < len_buf) && (i < size); i++) { tmp[j] = buf[i]; ++j; } tmp[j] = '\0'; strcpy(buf,tmp); } } return(buf); } #endif char *wcd_getcwd(char *buf, size_t size) { char *err; char *errstr; err = getcwd(buf, size); if ( err == NULL) { errstr = strerror(errno); fprintf(stderr,_("Wcd: error: Unable to get current working directory: %s\n"), errstr); } #ifdef UNIX else replace_volume_path_HOME(buf,size); #endif return(err); } int wcd_chdir(char *buf, int quiet) { char *errstr; int err; err = chdir(buf); if ( !quiet && err) { errstr = strerror(errno); fprintf(stderr,_("Wcd: error: Unable to change to directory %s: %s\n"), buf, errstr); } return(err); } int wcd_rmdir(char *buf, int quiet) { char *errstr; int err; err = rmdir(buf); if ( !quiet && err) { errstr = strerror(errno); fprintf(stderr,_("Wcd: error: Unable to remove directory %s: %s\n"), buf, errstr); } return(err); } /****************************************************************** * * int wcd_isdir(char *dir) * * test if *dir points to a directory. * * returns 0 on success, -1 when it fails. * ******************************************************************/ int wcd_isdir(char *dir, int quiet) { struct stat buf; char *errstr; if (stat(dir, &buf) == 0) { if (S_ISDIR(buf.st_mode)) return(0); else return(-1); } else { if (!quiet) { errstr = strerror(errno); fprintf(stderr,"Wcd: %s: %s\n", dir, errstr); } return(-1); } } #endif wcd-5.2.4/src/wcddir.h0000644000175000010010000000327312133335700014000 0ustar waterlanNone/* filename: wcddir.h WCD - Chdir for Dos and Unix. Author: Erwin Waterlander ====================================================================== = Copyright = ====================================================================== Copyright (C) 2002-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. ======================================================================= */ #if (defined(_WIN32) || defined(__CYGWIN__)) int wcd_isServerPath (char* path); void wcd_getshares(char* path, nameset n); #endif #if (defined(_WIN32) && !defined(__CYGWIN__)) int wcd_islink(const char *dir, int quiet); int wcd_mkdir(char *buf, int quiet); #else /* not WIN32 API */ # if defined(UNIX) || defined(__DJGPP__) || defined(__EMX__) int wcd_mkdir(char *buf, mode_t m, int quiet); # else int wcd_mkdir(char *buf, int quiet); # endif #endif char *wcd_getcwd(char *buf, size_t size); int wcd_chdir(char *buf, int quiet); int wcd_rmdir(char *buf, int quiet); int wcd_isdir(char *dir, int quiet); wcd-5.2.4/src/wcwidth.c0000644000175000010010000003346012151203455014172 0ustar waterlanNone/* * This is an implementation of wcwidth() and wcswidth() (defined in * IEEE Std 1002.1-2001) for Unicode. * * http://www.opengroup.org/onlinepubs/007904975/functions/wcwidth.html * http://www.opengroup.org/onlinepubs/007904975/functions/wcswidth.html * * In fixed-width output devices, Latin characters all occupy a single * "cell" position of equal width, whereas ideographic CJK characters * occupy two such cells. Interoperability between terminal-line * applications and (teletype-style) character terminals using the * UTF-8 encoding requires agreement on which character should advance * the cursor by how many cell positions. No established formal * standards exist at present on which Unicode character shall occupy * how many cell positions on character terminals. These routines are * a first attempt of defining such behavior based on simple rules * applied to data provided by the Unicode Consortium. * * For some graphical characters, the Unicode standard explicitly * defines a character-cell width via the definition of the East Asian * FullWidth (F), Wide (W), Half-width (H), and Narrow (Na) classes. * In all these cases, there is no ambiguity about which width a * terminal shall use. For characters in the East Asian Ambiguous (A) * class, the width choice depends purely on a preference of backward * compatibility with either historic CJK or Western practice. * Choosing single-width for these characters is easy to justify as * the appropriate long-term solution, as the CJK practice of * displaying these characters as double-width comes from historic * implementation simplicity (8-bit encoded characters were displayed * single-width and 16-bit ones double-width, even for Greek, * Cyrillic, etc.) and not any typographic considerations. * * Much less clear is the choice of width for the Not East Asian * (Neutral) class. Existing practice does not dictate a width for any * of these characters. It would nevertheless make sense * typographically to allocate two character cells to characters such * as for instance EM SPACE or VOLUME INTEGRAL, which cannot be * represented adequately with a single-width glyph. The following * routines at present merely assign a single-cell width to all * neutral characters, in the interest of simplicity. This is not * entirely satisfactory and should be reconsidered before * establishing a formal standard in this area. At the moment, the * decision which Not East Asian (Neutral) characters should be * represented by double-width glyphs cannot yet be answered by * applying a simple rule from the Unicode database content. Setting * up a proper standard for the behavior of UTF-8 character terminals * will require a careful analysis not only of each Unicode character, * but also of each presentation form, something the author of these * routines has avoided to do so far. * * http://www.unicode.org/unicode/reports/tr11/ * * Markus Kuhn -- 2007-05-26 (Unicode 5.0) * * Permission to use, copy, modify, and distribute this software * for any purpose and without fee is hereby granted. The author * disclaims all warranties with regard to this software. * * Latest version: http://www.cl.cam.ac.uk/~mgk25/ucs/wcwidth.c */ #include struct interval { int first; int last; }; /* auxiliary function for binary search in interval table */ static int bisearch(wchar_t ucs, const struct interval *table, int max) { int min = 0; int mid; if (ucs < table[0].first || ucs > table[max].last) return 0; while (max >= min) { mid = (min + max) / 2; if (ucs > table[mid].last) min = mid + 1; else if (ucs < table[mid].first) max = mid - 1; else return 1; } return 0; } /* The following two functions define the column width of an ISO 10646 * character as follows: * * - The null character (U+0000) has a column width of 0. * * - Other C0/C1 control characters and DEL will lead to a return * value of -1. * * - Non-spacing and enclosing combining characters (general * category code Mn or Me in the Unicode database) have a * column width of 0. * * - SOFT HYPHEN (U+00AD) has a column width of 1. * * - Other format characters (general category code Cf in the Unicode * database) and ZERO WIDTH SPACE (U+200B) have a column width of 0. * * - Hangul Jamo medial vowels and final consonants (U+1160-U+11FF) * have a column width of 0. * * - Spacing characters in the East Asian Wide (W) or East Asian * Full-width (F) category as defined in Unicode Technical * Report #11 have a column width of 2. * * - All remaining characters (including all printable * ISO 8859-1 and WGL4 characters, Unicode control characters, * etc.) have a column width of 1. * * This implementation assumes that wchar_t characters are encoded * in ISO 10646. */ int mk_wcwidth(wchar_t ucs) { /* sorted list of non-overlapping intervals of non-spacing characters */ /* generated by "uniset +cat=Me +cat=Mn +cat=Cf -00AD +1160-11FF +200B c" */ static const struct interval combining[] = { { 0x0300, 0x036F }, { 0x0483, 0x0486 }, { 0x0488, 0x0489 }, { 0x0591, 0x05BD }, { 0x05BF, 0x05BF }, { 0x05C1, 0x05C2 }, { 0x05C4, 0x05C5 }, { 0x05C7, 0x05C7 }, { 0x0600, 0x0603 }, { 0x0610, 0x0615 }, { 0x064B, 0x065E }, { 0x0670, 0x0670 }, { 0x06D6, 0x06E4 }, { 0x06E7, 0x06E8 }, { 0x06EA, 0x06ED }, { 0x070F, 0x070F }, { 0x0711, 0x0711 }, { 0x0730, 0x074A }, { 0x07A6, 0x07B0 }, { 0x07EB, 0x07F3 }, { 0x0901, 0x0902 }, { 0x093C, 0x093C }, { 0x0941, 0x0948 }, { 0x094D, 0x094D }, { 0x0951, 0x0954 }, { 0x0962, 0x0963 }, { 0x0981, 0x0981 }, { 0x09BC, 0x09BC }, { 0x09C1, 0x09C4 }, { 0x09CD, 0x09CD }, { 0x09E2, 0x09E3 }, { 0x0A01, 0x0A02 }, { 0x0A3C, 0x0A3C }, { 0x0A41, 0x0A42 }, { 0x0A47, 0x0A48 }, { 0x0A4B, 0x0A4D }, { 0x0A70, 0x0A71 }, { 0x0A81, 0x0A82 }, { 0x0ABC, 0x0ABC }, { 0x0AC1, 0x0AC5 }, { 0x0AC7, 0x0AC8 }, { 0x0ACD, 0x0ACD }, { 0x0AE2, 0x0AE3 }, { 0x0B01, 0x0B01 }, { 0x0B3C, 0x0B3C }, { 0x0B3F, 0x0B3F }, { 0x0B41, 0x0B43 }, { 0x0B4D, 0x0B4D }, { 0x0B56, 0x0B56 }, { 0x0B82, 0x0B82 }, { 0x0BC0, 0x0BC0 }, { 0x0BCD, 0x0BCD }, { 0x0C3E, 0x0C40 }, { 0x0C46, 0x0C48 }, { 0x0C4A, 0x0C4D }, { 0x0C55, 0x0C56 }, { 0x0CBC, 0x0CBC }, { 0x0CBF, 0x0CBF }, { 0x0CC6, 0x0CC6 }, { 0x0CCC, 0x0CCD }, { 0x0CE2, 0x0CE3 }, { 0x0D41, 0x0D43 }, { 0x0D4D, 0x0D4D }, { 0x0DCA, 0x0DCA }, { 0x0DD2, 0x0DD4 }, { 0x0DD6, 0x0DD6 }, { 0x0E31, 0x0E31 }, { 0x0E34, 0x0E3A }, { 0x0E47, 0x0E4E }, { 0x0EB1, 0x0EB1 }, { 0x0EB4, 0x0EB9 }, { 0x0EBB, 0x0EBC }, { 0x0EC8, 0x0ECD }, { 0x0F18, 0x0F19 }, { 0x0F35, 0x0F35 }, { 0x0F37, 0x0F37 }, { 0x0F39, 0x0F39 }, { 0x0F71, 0x0F7E }, { 0x0F80, 0x0F84 }, { 0x0F86, 0x0F87 }, { 0x0F90, 0x0F97 }, { 0x0F99, 0x0FBC }, { 0x0FC6, 0x0FC6 }, { 0x102D, 0x1030 }, { 0x1032, 0x1032 }, { 0x1036, 0x1037 }, { 0x1039, 0x1039 }, { 0x1058, 0x1059 }, { 0x1160, 0x11FF }, { 0x135F, 0x135F }, { 0x1712, 0x1714 }, { 0x1732, 0x1734 }, { 0x1752, 0x1753 }, { 0x1772, 0x1773 }, { 0x17B4, 0x17B5 }, { 0x17B7, 0x17BD }, { 0x17C6, 0x17C6 }, { 0x17C9, 0x17D3 }, { 0x17DD, 0x17DD }, { 0x180B, 0x180D }, { 0x18A9, 0x18A9 }, { 0x1920, 0x1922 }, { 0x1927, 0x1928 }, { 0x1932, 0x1932 }, { 0x1939, 0x193B }, { 0x1A17, 0x1A18 }, { 0x1B00, 0x1B03 }, { 0x1B34, 0x1B34 }, { 0x1B36, 0x1B3A }, { 0x1B3C, 0x1B3C }, { 0x1B42, 0x1B42 }, { 0x1B6B, 0x1B73 }, { 0x1DC0, 0x1DCA }, { 0x1DFE, 0x1DFF }, { 0x200B, 0x200F }, { 0x202A, 0x202E }, { 0x2060, 0x2063 }, { 0x206A, 0x206F }, { 0x20D0, 0x20EF }, { 0x302A, 0x302F }, { 0x3099, 0x309A }, { 0xA806, 0xA806 }, { 0xA80B, 0xA80B }, { 0xA825, 0xA826 }, { 0xFB1E, 0xFB1E }, { 0xFE00, 0xFE0F }, { 0xFE20, 0xFE23 }, { 0xFEFF, 0xFEFF }, { 0xFFF9, 0xFFFB }, { 0x10A01, 0x10A03 }, { 0x10A05, 0x10A06 }, { 0x10A0C, 0x10A0F }, { 0x10A38, 0x10A3A }, { 0x10A3F, 0x10A3F }, { 0x1D167, 0x1D169 }, { 0x1D173, 0x1D182 }, { 0x1D185, 0x1D18B }, { 0x1D1AA, 0x1D1AD }, { 0x1D242, 0x1D244 }, { 0xE0001, 0xE0001 }, { 0xE0020, 0xE007F }, { 0xE0100, 0xE01EF } }; /* test for 8-bit control characters */ if (ucs == 0) return 0; if (ucs < 32 || (ucs >= 0x7f && ucs < 0xa0)) return -1; /* binary search in table of non-spacing characters */ if (bisearch(ucs, combining, sizeof(combining) / sizeof(struct interval) - 1)) return 0; /* if we arrive here, ucs is not a combining or C0/C1 control character */ return 1 + (ucs >= 0x1100 && (ucs <= 0x115f || /* Hangul Jamo init. consonants */ ucs == 0x2329 || ucs == 0x232a || (ucs >= 0x2e80 && ucs <= 0xa4cf && ucs != 0x303f) || /* CJK ... Yi */ (ucs >= 0xac00 && ucs <= 0xd7a3) || /* Hangul Syllables */ (ucs >= 0xf900 && ucs <= 0xfaff) || /* CJK Compatibility Ideographs */ (ucs >= 0xfe10 && ucs <= 0xfe19) || /* Vertical forms */ (ucs >= 0xfe30 && ucs <= 0xfe6f) || /* CJK Compatibility Forms */ (ucs >= 0xff00 && ucs <= 0xff60) || /* Fullwidth Forms */ (ucs >= 0xffe0 && ucs <= 0xffe6) || (ucs >= 0x20000 && ucs <= 0x2fffd) || (ucs >= 0x30000 && ucs <= 0x3fffd))); } int mk_wcswidth(const wchar_t *pwcs, size_t n) { int w, width = 0; for (;*pwcs && n-- > 0; pwcs++) if ((w = mk_wcwidth(*pwcs)) < 0) return -1; else width += w; return width; } /* * The following functions are the same as mk_wcwidth() and * mk_wcswidth(), except that spacing characters in the East Asian * Ambiguous (A) category as defined in Unicode Technical Report #11 * have a column width of 2. This variant might be useful for users of * CJK legacy encodings who want to migrate to UCS without changing * the traditional terminal character-width behaviour. It is not * otherwise recommended for general use. */ int mk_wcwidth_cjk(wchar_t ucs) { /* sorted list of non-overlapping intervals of East Asian Ambiguous * characters, generated by "uniset +WIDTH-A -cat=Me -cat=Mn -cat=Cf c" */ static const struct interval ambiguous[] = { { 0x00A1, 0x00A1 }, { 0x00A4, 0x00A4 }, { 0x00A7, 0x00A8 }, { 0x00AA, 0x00AA }, { 0x00AE, 0x00AE }, { 0x00B0, 0x00B4 }, { 0x00B6, 0x00BA }, { 0x00BC, 0x00BF }, { 0x00C6, 0x00C6 }, { 0x00D0, 0x00D0 }, { 0x00D7, 0x00D8 }, { 0x00DE, 0x00E1 }, { 0x00E6, 0x00E6 }, { 0x00E8, 0x00EA }, { 0x00EC, 0x00ED }, { 0x00F0, 0x00F0 }, { 0x00F2, 0x00F3 }, { 0x00F7, 0x00FA }, { 0x00FC, 0x00FC }, { 0x00FE, 0x00FE }, { 0x0101, 0x0101 }, { 0x0111, 0x0111 }, { 0x0113, 0x0113 }, { 0x011B, 0x011B }, { 0x0126, 0x0127 }, { 0x012B, 0x012B }, { 0x0131, 0x0133 }, { 0x0138, 0x0138 }, { 0x013F, 0x0142 }, { 0x0144, 0x0144 }, { 0x0148, 0x014B }, { 0x014D, 0x014D }, { 0x0152, 0x0153 }, { 0x0166, 0x0167 }, { 0x016B, 0x016B }, { 0x01CE, 0x01CE }, { 0x01D0, 0x01D0 }, { 0x01D2, 0x01D2 }, { 0x01D4, 0x01D4 }, { 0x01D6, 0x01D6 }, { 0x01D8, 0x01D8 }, { 0x01DA, 0x01DA }, { 0x01DC, 0x01DC }, { 0x0251, 0x0251 }, { 0x0261, 0x0261 }, { 0x02C4, 0x02C4 }, { 0x02C7, 0x02C7 }, { 0x02C9, 0x02CB }, { 0x02CD, 0x02CD }, { 0x02D0, 0x02D0 }, { 0x02D8, 0x02DB }, { 0x02DD, 0x02DD }, { 0x02DF, 0x02DF }, { 0x0391, 0x03A1 }, { 0x03A3, 0x03A9 }, { 0x03B1, 0x03C1 }, { 0x03C3, 0x03C9 }, { 0x0401, 0x0401 }, { 0x0410, 0x044F }, { 0x0451, 0x0451 }, { 0x2010, 0x2010 }, { 0x2013, 0x2016 }, { 0x2018, 0x2019 }, { 0x201C, 0x201D }, { 0x2020, 0x2022 }, { 0x2024, 0x2027 }, { 0x2030, 0x2030 }, { 0x2032, 0x2033 }, { 0x2035, 0x2035 }, { 0x203B, 0x203B }, { 0x203E, 0x203E }, { 0x2074, 0x2074 }, { 0x207F, 0x207F }, { 0x2081, 0x2084 }, { 0x20AC, 0x20AC }, { 0x2103, 0x2103 }, { 0x2105, 0x2105 }, { 0x2109, 0x2109 }, { 0x2113, 0x2113 }, { 0x2116, 0x2116 }, { 0x2121, 0x2122 }, { 0x2126, 0x2126 }, { 0x212B, 0x212B }, { 0x2153, 0x2154 }, { 0x215B, 0x215E }, { 0x2160, 0x216B }, { 0x2170, 0x2179 }, { 0x2190, 0x2199 }, { 0x21B8, 0x21B9 }, { 0x21D2, 0x21D2 }, { 0x21D4, 0x21D4 }, { 0x21E7, 0x21E7 }, { 0x2200, 0x2200 }, { 0x2202, 0x2203 }, { 0x2207, 0x2208 }, { 0x220B, 0x220B }, { 0x220F, 0x220F }, { 0x2211, 0x2211 }, { 0x2215, 0x2215 }, { 0x221A, 0x221A }, { 0x221D, 0x2220 }, { 0x2223, 0x2223 }, { 0x2225, 0x2225 }, { 0x2227, 0x222C }, { 0x222E, 0x222E }, { 0x2234, 0x2237 }, { 0x223C, 0x223D }, { 0x2248, 0x2248 }, { 0x224C, 0x224C }, { 0x2252, 0x2252 }, { 0x2260, 0x2261 }, { 0x2264, 0x2267 }, { 0x226A, 0x226B }, { 0x226E, 0x226F }, { 0x2282, 0x2283 }, { 0x2286, 0x2287 }, { 0x2295, 0x2295 }, { 0x2299, 0x2299 }, { 0x22A5, 0x22A5 }, { 0x22BF, 0x22BF }, { 0x2312, 0x2312 }, { 0x2460, 0x24E9 }, { 0x24EB, 0x254B }, { 0x2550, 0x2573 }, { 0x2580, 0x258F }, { 0x2592, 0x2595 }, { 0x25A0, 0x25A1 }, { 0x25A3, 0x25A9 }, { 0x25B2, 0x25B3 }, { 0x25B6, 0x25B7 }, { 0x25BC, 0x25BD }, { 0x25C0, 0x25C1 }, { 0x25C6, 0x25C8 }, { 0x25CB, 0x25CB }, { 0x25CE, 0x25D1 }, { 0x25E2, 0x25E5 }, { 0x25EF, 0x25EF }, { 0x2605, 0x2606 }, { 0x2609, 0x2609 }, { 0x260E, 0x260F }, { 0x2614, 0x2615 }, { 0x261C, 0x261C }, { 0x261E, 0x261E }, { 0x2640, 0x2640 }, { 0x2642, 0x2642 }, { 0x2660, 0x2661 }, { 0x2663, 0x2665 }, { 0x2667, 0x266A }, { 0x266C, 0x266D }, { 0x266F, 0x266F }, { 0x273D, 0x273D }, { 0x2776, 0x277F }, { 0xE000, 0xF8FF }, { 0xFFFD, 0xFFFD }, { 0xF0000, 0xFFFFD }, { 0x100000, 0x10FFFD } }; /* binary search in table of non-spacing characters */ if (bisearch(ucs, ambiguous, sizeof(ambiguous) / sizeof(struct interval) - 1)) return 2; return mk_wcwidth(ucs); } int mk_wcswidth_cjk(const wchar_t *pwcs, size_t n) { int w, width = 0; for (;*pwcs && n-- > 0; pwcs++) if ((w = mk_wcwidth_cjk(*pwcs)) < 0) return -1; else width += w; return width; } #if defined (_WIN32) && !defined(__CYGWIN__) int wcwidth(wchar_t ucs) { return mk_wcwidth(ucs); } int wcswidth(const wchar_t *pwcs, size_t n) { return mk_wcswidth(pwcs,n); } #endif wcd-5.2.4/src/wcwidth.h0000644000175000010010000000213012151203455014165 0ustar waterlanNone/* Copyright (C) 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 _WCWIDTH_H #define _WCWIDTH_H #include int mk_wcwidth(wchar_t ucs); int mk_wcswidth(const wchar_t *pwcs, size_t n); int mk_wcwidth_cjk(wchar_t ucs); int mk_wcswidth_cjk(const wchar_t *pwcs, size_t n); #if defined (_WIN32) && !defined(__CYGWIN__) int wcwidth(wchar_t ucs); int wcswidth(const wchar_t *pwcs, size_t n); #endif #endif wcd-5.2.4/src/wfixpath.c0000644000175000010010000000716612025724165014365 0ustar waterlanNone/* Copyright (C) 1996 DJ Delorie, see COPYING.DJ for details */ /* Copyright (C) 1995 DJ Delorie, see COPYING.DJ for details */ /* Modified by Erwin Waterlander. Mar 30 1999 */ /* Oct 16 2001: On Unix directories can have a backslash (\) * in the name, so they must not be replaced a slash (/) * Erwin Waterlander * Oct 26 2002: Keep first two slashes if WIN32 (UNC path) * Erwin Waterlander * Sep 8 2005: Keep first two slashes also for Cygwin (UNC path) * Erwin Waterlander * Sep 15 2011: changed parameter 'lim' to size_t type. * Erwin Waterlander */ #include /* For FILENAME_MAX */ #include #include #include "tailor.h" #include "config.h" int wcd_is_slash(int c) { #if (defined(UNIX) && !defined(__CYGWIN__)) /* Oct 16 2001 */ return c == '/'; #else return c == '/' || c == '\\'; #endif } static int is_term(int c) { #if (defined(UNIX) && !defined(__CYGWIN__)) /* Oct 16 2001 */ return c == '/' || c == '\0'; #else return c == '/' || c == '\\' || c == '\0'; #endif } /* Takes as input an arbitrary path. Fixes up the path by: 1. Removing consecutive slashes 2. Removing trailing slashes 4. Removing "." in the path 7. Converting all slashes to '/' 8. Keep beginning "/" 9. Keep beginning "./" 10. Don't fix path "." */ void wcd_fixpath(char *in, size_t lim) { size_t i=0; int drive_number= -1; const char *ip = in; char *out; char *op; if ((in == NULL) || (lim == 0)) return ; if ((out = (char *) malloc(lim)) == NULL) { fprintf(stderr, "%s", _("Wcd: malloc error in wcd_fixpath()\n")); return; } op = out; #if defined(__MSDOS__) || defined(_WIN32) || defined(__OS2__) /* Add drive specification to output string (if present) */ if (((*ip >= 'a' && *ip <= 'z') || (*ip >= 'A' && *ip <= 'Z')) && (*(ip + 1) == ':')) { if (*ip >= 'a' && *ip <= 'z') { drive_number = *ip - 'a'; *op++ = *ip++; } else { drive_number = *ip - 'A'; if (*ip <= 'Z') *op++ = (char)(drive_number + 'a'); else *op++ = *ip; ++ip; } *op++ = *ip++; i+=2; } #endif #if (defined(_WIN32) || defined(__CYGWIN__)) /* Keep first "//" if present (UNC path) */ if (wcd_is_slash(*ip) && wcd_is_slash(*(ip + 1))) { ip+=2 ; *op++ = '/'; *op++ = '/'; i+=2 ; } else #endif /* Keep first slash if present */ if (wcd_is_slash(*ip)) { ip++; *op++ = '/'; i++ ; } else /* return if ip == "." */ if ((*ip == '.') && (*(ip + 1) == '\0')) { free(out); return ; } else /* Keep first "./" if present */ if (*ip == '.' && wcd_is_slash(*(ip + 1))) { ip+=2 ; *op++ = '.'; *op++ = '/'; i+=2 ; } /* Step through the input path */ while ((*ip) && (i<(lim-1))) { /* Skip input slashes */ if (wcd_is_slash(*ip)) { ip++; continue; } /* Skip "." and output nothing */ if (*ip == '.' && is_term(*(ip + 1))) { ip++; continue; } /* Copy path component from in to out */ if ((op > out) && (*(op-1) != '/')) { *op++ = '/'; i++ ; } while (!is_term(*ip)) { *op++ = *ip++; i++; } } /* If root directory, insert trailing slash */ if (((drive_number >= 0) && (op == out + 2)) || (op == out)) *op++ = '/'; /* Null terminate the output */ *op = '\0'; strcpy(in,out); free(out); } #ifdef TEST int main (int argc, char *argv[]) { char fixed[FILENAME_MAX]; if (argc > 1) { strcpy(fixed,argv[1]); wcd_fixpath (fixed,FILENAME_MAX); printf ("You mean %s?\n", fixed); } return 0; } #endif wcd-5.2.4/src/wfixpath.h0000644000175000010010000000016511634627213014363 0ustar waterlanNone#ifndef _WFIXPATH_H_ #define _WFIXPATH_H_ int wcd_is_slash(int c); void wcd_fixpath(char *in, size_t lim) ; #endif wcd-5.2.4/test/0000755000175000010010000000000012207427072012544 5ustar waterlanNonewcd-5.2.4/test/utf8.wcd0000755000175000010010000001411312073112776014137 0ustar waterlanNone/home/waterlan/src/utf8 /home/waterlan/src/utf8/utf8_EUR € 14.95 /home/waterlan/src/utf8/test /home/waterlan/src/utf8/test/iso-8859-1 /home/waterlan/src/utf8/test/iso-8859-1/xyz_startmen� /home/waterlan/src/utf8/test/iso-8859-1/xyz_�rwon /home/waterlan/src/utf8/test/iso-8859-1/xyz_���� /home/waterlan/src/utf8/test/iso-8859-1/xyz_����/xyz_a /home/waterlan/src/utf8/test/iso-8859-1/xyz_����/xyz_erwin /home/waterlan/src/utf8/test/iso-8859-1/xyz_����/xyz_b /home/waterlan/src/utf8/test/iso-8859-1/xyz_��� /home/waterlan/src/utf8/test/utf8 /home/waterlan/src/utf8/test/utf8/utf8_ERWAN /home/waterlan/src/utf8/test/utf8/utf8_ERWUN /home/waterlan/src/utf8/test/utf8/utf8_ZZ /home/waterlan/src/utf8/test/utf8/utf8_chinees 中文 /home/waterlan/src/utf8/test/utf8/utf8_chinees 中文/aa /home/waterlan/src/utf8/test/utf8/utf8_chinees 中文/bb /home/waterlan/src/utf8/test/utf8/utf8_chinees 中文/bb/utf8_chinees 中文 /home/waterlan/src/utf8/test/utf8/utf8_chinees 中文/bb/utf8_chinees 中文/utf8_a /home/waterlan/src/utf8/test/utf8/utf8_chinees 中文/bb/utf8_chinees 中文/utf8_a/utf8_b /home/waterlan/src/utf8/test/utf8/utf8_chinees 中文/bb/utf8_chinees 中文/utf8_a/utf8_b/utf8_c /home/waterlan/src/utf8/test/utf8/utf8_chinees 中文/bb/utf8_chinees 中文/utf8_b /home/waterlan/src/utf8/test/utf8/utf8_chinees 中文/bb/utf8_EUR € 14.95 /home/waterlan/src/utf8/test/utf8/utf8_chinees 中文/cc /home/waterlan/src/utf8/test/utf8/utf8_chinees 中文/cc/utf8_greek_δΔΩ/utf8_a/utf8_b/utf8_c /home/waterlan/src/utf8/test/utf8/utf8_chinees 中文/cc/utf8_greek_δΔΩ/utf8_a/utf8_b/utf8_d /home/waterlan/src/utf8/test/utf8/utf8_chinees 中文/cc/utf8_greek_δΔΩ/utf8_a/utf8_β/utf8_Σ /home/waterlan/src/utf8/test/utf8/utf8_chinees 中文/cc/utf8_greek_δΔΩ/utf8_a/utf8_β/utf8_Ψ /home/waterlan/src/utf8/test/utf8/utf8_chinees 中文/cc/utf8_greek_δΔΩ/utf8_b/utf8_c /home/waterlan/src/utf8/test/utf8/utf8_chinees 中文/cc/utf8_greek_δΔΩ/utf8_a /home/waterlan/src/utf8/test/utf8/utf8_chinees 中文/cc/utf8_a /home/waterlan/src/utf8/test/utf8/utf8_chinees 中文/cc/utf8_b /home/waterlan/src/utf8/test/utf8/utf8_erwin /home/waterlan/src/utf8/test/utf8/utf8_ccccccc_xx /home/waterlan/src/utf8/test/utf8/utf8_ccccccc_xx/dd /home/waterlan/src/utf8/test/utf8/utf8_ccccccc_xx/dd/utf8_ccccccc_zz /home/waterlan/src/utf8/test/utf8/utf8_µ /home/waterlan/src/utf8/test/utf8/utf8_ERW-IN /home/waterlan/src/utf8/test/utf8/utf8_EUR € 14.95 /home/waterlan/src/utf8/test/utf8/utf8_† /home/waterlan/src/utf8/test/utf8/utf8_© /home/waterlan/src/utf8/test/utf8/utf8_é /home/waterlan/src/utf8/test/utf8/utf8_sü /home/waterlan/src/utf8/test/utf8/utf8_� /home/waterlan/src/utf8/test/utf8/utf8_Su /home/waterlan/src/utf8/test/utf8/utf8_π /home/waterlan/src/utf8/test/utf8/utf8_chinees 中 /home/waterlan/src/utf8/test/utf8/utf8_chinees 中/aa /home/waterlan/src/utf8/test/utf8/utf8_chinees 中/bb /home/waterlan/src/utf8/test/utf8/utf8_chinees 中/bb/utf8_chinees 中文 /home/waterlan/src/utf8/test/utf8/utf8_chinees 中/bb/utf8_chinees 中文/utf8_a /home/waterlan/src/utf8/test/utf8/utf8_chinees 中/bb/utf8_chinees 中文/utf8_a/utf8_b /home/waterlan/src/utf8/test/utf8/utf8_chinees 中/bb/utf8_chinees 中文/utf8_a/utf8_b/utf8_c /home/waterlan/src/utf8/test/utf8/utf8_chinees 中/bb/utf8_chinees 中文/utf8_b /home/waterlan/src/utf8/test/utf8/utf8_chinees 中/bb/utf8_EUR € 14.95 /home/waterlan/src/utf8/test/utf8/utf8_chinees 中/cc /home/waterlan/src/utf8/test/utf8/utf8_chinees 中/cc/utf8_a /home/waterlan/src/utf8/test/utf8/utf8_chinees 中/cc/utf8_b /home/waterlan/src/utf8/utf8_EUR-8 € /home/waterlan/src/utf8/utf8_chinees 中文 /home/waterlan/src/utf8/utf8_nee /home/waterlan/src/utf8/utf8_comb_áêu̠-xx-o̷ /home/waterlan/src/utf8/utf8_comb_áêu̠-xx-o̷/a /home/waterlan/src/utf8/utf8_comb_áêu̠-xx-o̷/a/b /home/waterlan/src/utf8/utf8_comb_áêu̠-xx-o̷/a/b/c /home/waterlan/src/utf8/utf8_comb_áêu̠-xx-o̷/a/b/c/d /home/waterlan/src/utf8/utf8_comb_áêu̠-xx-o̷/a/c /home/waterlan/src/utf8/utf8_comb_áêu̠-xx-o̷/a/c/d /home/waterlan/src/utf8/utf8_comb_áê中文u̠-xx-o̷ /home/waterlan/src/utf8/utf8_comb_áê中文u̠-xx-o̷/utf1 /home/waterlan/src/utf8/utf8_comb_áê中文u̠-xx-o̷/utf1/utf2 /home/waterlan/src/utf8/utf8_comb_áê中文u̠-xx-o̷/utf1/utf2/utf3 /home/waterlan/src/utf8/utf8_comb_áê中文u̠-xx-o̷/utf1/utf2/utf3/a /home/waterlan/src/utf8/utf8_comb_áê中文u̠-xx-o̷/utf1/utf2/utf3/a/b /home/waterlan/src/utf8/utf8_comb_áê中文u̠-xx-o̷/utf1/utf2/utf3/a/b/c /home/waterlan/src/utf8/utf8_comb_áê中文u̠-xx-o̷/utf1/utf2/utf3/a/b/c/d /home/waterlan/src/utf8/utf8_comb_áê中文u̠-xx-o̷/utf1/utf2/utf3/a/b/c/d/e /home/waterlan/src/utf8/utf8_comb_áê中文u̠-xx-o̷/utf1/utf2/utf3/a/b/c/d/e/f /home/waterlan/src/utf8/utf8_comb_áê中文u̠-xx-o̷/utf1/utf2/utf3/utf4 /home/waterlan/src/utf8/utf8_comb_áê中文u̠-xx-o̷/utf1/utf2/utf3/utf4/utf5 /home/waterlan/src/utf8/utf8_comb_áê中文u̠-xx-o̷/a /home/waterlan/src/utf8/utf8_comb_áê中文u̠-xx-o̷/a/b /home/waterlan/src/utf8/utf8_comb_áê中文u̠-xx-o̷/a/b/c /home/waterlan/src/utf8/utf8_comb_áê中文u̠-xx-o̷/a/b/c/d /home/waterlan/src/utf8/utf8_comb_áê中文u̠-xx-o̷/a/b/c/d/e /home/waterlan/src/utf8/utf8_comb_áê中文u̠-xx-o̷/a/b/c/d/e/f /home/waterlan/src/utf8/utf8_comb_áê中文u̠-xx-o̷/a/b/c/d/e/f/g /home/waterlan/src/utf8/utf8_comb_áê中文u̠-xx-o̷/a/b/c/d/e/f/g/h /home/waterlan/src/utf8/utf8_comb_áê中文u̠-xx-o̷/a/b/c/d/e/f/g/h/i /home/waterlan/src/utf8/utf8_comb_áê中文u̠-xx-o̷/a/b/c/d/e/f/g/h/i/utf8_x /home/waterlan/src/utf8/utf8_comb_áê中文u̠-xx-o̷/a/b/c/d/e/f/utf8_u /home/waterlan/src/utf8/utf8_nèe /home/waterlan/src/utf8/utf8_nêé /home/waterlan/src/utf8/utf8_surrogate_𠜎/utf8_𠜎/utf8_erwin /home/waterlan/src/utf8/utf8_surrogate_𠜎/utf8_9_𠜎/utf8_erwin /home/waterlan/src/utf8/utf8_surrogate_𠜎/utf8_99_𠜎/utf8_erwin /home/waterlan/src/utf8/utf8_surrogate_𠜎/utf8_99_𠜎/utf8_waterlander wcd-5.2.4/win32/0000755000175000010010000000000012207427075012532 5ustar waterlanNonewcd-5.2.4/win32/Makefile0000644000175000010010000000376112101167345014173 0ustar waterlanNone PREFIX = c:/usr/local prefix = $(PREFIX) exec_prefix = $(prefix) MKDIR = mkdir LIBS_EXTRA = -lkernel32 -luser32 -lmpr CFLAGS = -O2 -Wall -Wextra -Wconversion -Wno-unused-parameter CURSES = pdcursesw ENABLE_NLS = 1 DEFS = ifdef CURSES LIB_CURSES = -l${CURSES} DEFS += -DWCD_USECURSES -DPDC_STATIC_BUILD DEFS += -DPDC_WIDE EXTRA_OBJ += wcwidth.o endif ifdef ENABLE_NLS LIBS_EXTRA += -lintl -liconv endif ifdef WCD_UTF8 # WCD_UTF8 was used in older versions. UCS=1 endif ifdef UNINORM UCS=1 endif ifdef UCS EXTRA_OBJ += matchw.o endif bindir = ${exec_prefix}/bin PROGRAM = wcdwin32.exe VERSIONSUFFIX = -win32 ZIPOBJ_EXTRA = bin/wcd.bat bin/wcd_win95.bat ifdef ENABLE_NLS # Using GnuWin32 gettext,iconv #ZIPOBJ_EXTRA += bin/libintl3.dll bin/libiconv2.dll # Using MinGW gettext,iconv ZIPOBJ_EXTRA += bin/libintl-8.dll bin/libiconv-2.dll endif ifdef UNINORM ZIPOBJ_EXTRA += bin/libunistring-0.dll endif all : ${MAKE} -C ../src all PROGRAM=${PROGRAM} CFLAGS="${CFLAGS}" CURSES=${CURSES} LIB_CURSES=${LIB_CURSES} DEFS="${DEFS}" LIBS_EXTRA="${LIBS_EXTRA}" prefix=${prefix} EXTRA_OBJ="${EXTRA_OBJ}" 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}" prefix=${prefix} MKDIR=${MKDIR} EXTRA_OBJ="${EXTRA_OBJ}" INSTALL_OBJS_DOC_INSTALL="../doc/INST_DOS.txt ../doc/INSTALL.txt" ENABLE_NLS=${ENABLE_NLS} install -m 755 wcd.bat $(DESTDIR)${bindir}/wcd.bat install -m 755 wcd_win95.bat $(DESTDIR)${bindir}/wcd_win95.bat uninstall : ${MAKE} -C ../src uninstall PROGRAM=${PROGRAM} prefix=${prefix} ENABLE_NLS=${ENABLE_NLS} -rm -f $(DESTDIR)${bindir}/wcd.bat -rm -f $(DESTDIR)${bindir}/wcd_win95.bat 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.2.4/win32/vc/0000755000175000010010000000000012207427075013142 5ustar waterlanNonewcd-5.2.4/win32/vc/makefile0000755000175000010010000000221112026550505014633 0ustar waterlanNoneSRCDIR = ..\..\src !include $(SRCDIR)\version.mk CC = cl.exe /nologo LINK = link.exe /nologo PROGRAM = wcdwin32.exe DEFINES = CURSES = pdcursesw !if "$(CURSES)" != "" DEFINES = $(DEFINES) /DWCD_USECURSES /DPDC_WIDE !endif CFLAGS = $(DEFINES) /I$(SRCDIR) /I$(SRCDIR)\c3po 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 wcwidth.obj LIBS = mpr.lib !if "$(CURSES)" != "" OBJS = $(OBJS) dirnode.obj colors.obj graphics.obj LIBS = $(LIBS) user32.lib advapi32.lib $(CURSES).lib !endif !if "$(UCS)" == "1" OBJS = $(OBJS) matchw.obj LIBS = $(LIBS) shell32.lib VERSIONSUFFIX = -win32-ucs !else VERSIONSUFFIX = -win32 !endif HTMLEXT = htm DOCFILES = $(SRCDIR)\..\doc\wcd.txt $(SRCDIR)\..\doc\wcd.$(HTMLEXT) ZIPOBJ_EXTRA = bin\wcd.bat bin\wcd_win95.bat prefix = c:\usr\local all: $(PROGRAM) $(DOCFILES) $(PROGRAM): $(OBJS) $(LINK) /out:$@ $(LDFLAGS) $(OBJS) $(LIBS) !include $(SRCDIR)\vc.mak wcd-5.2.4/win32/watcom/0000755000175000010010000000000012207427075014024 5ustar waterlanNonewcd-5.2.4/win32/watcom/makefile0000755000175000010010000000275112017463766015542 0ustar waterlanNoneSRCDIR = ..\..\src !include $(SRCDIR)\version.mk CC = wcc386 PROGRAM = wcdwin32.exe DEFINES = CURSES = pdcursesw !ifneq CURSES DEFINES += -dWCD_USECURSES -dPDC_WIDE !endif CFLAGS = $(DEFINES) -i=$(SRCDIR) -i=$(SRCDIR)\c3po -w4 -e25 -zq -od -d2 -5r -bt=nt -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 wcwidth.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,wcwidth.obj !ifneq CURSES OBJS += dirnode.obj colors.obj graphics.obj LOBJS +=,dirnode.obj,colors.obj,graphics.obj !endif !ifeq UCS 1 OBJS += matchw.obj LOBJS +=,matchw.obj VERSIONSUFFIX = -win32-ucs !else VERSIONSUFFIX = -win32 !endif HTMLEXT = htm DOCFILES = $(SRCDIR)\..\doc\wcd.txt $(SRCDIR)\..\doc\wcd.$(HTMLEXT) ZIPOBJ_EXTRA = bin\wcd.bat bin\wcd_win95.bat prefix = c:\usr\local TARGET = nt all: $(PROGRAM) $(DOCFILES) .SYMBOLIC $(PROGRAM): $(OBJS) @%create wcd.lnk @%append wcd.lnk FIL $(LOBJS) @%append wcd.lnk library mpr.lib !ifneq CURSES @%append wcd.lnk library $(CURSES).lib !endif wlink name wcdwin32 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.2.4/win32/wcd.bat0000755000175000010010000000121312054434334013773 0ustar waterlanNone@echo off set PDC_RESTORE_SCREEN=1 rem set WCDHOME=%HOMEDRIVE%%HOMEPATH% rem set LANG=nl_NL rem set LANGUAGE=nl rem set WCDLOCALEDIR=c:/Program Files/wcd/share/locale rem set WCDSCAN=c:;d: rem Define WCDHOME when WCDHOME and HOME are both not defined, rem because on Windows Vista and up users are not allowed to rem create files in the root directory of the system partition. IF NOT DEFINED WCDHOME ( IF NOT DEFINED HOME ( set WCDHOME=%HOMEDRIVE%%HOMEPATH% ) ) wcdwin32.exe %* IF DEFINED WCDHOME ( "%WCDHOME%\wcdgo.bat" ) ELSE ( IF DEFINED HOME ( "%HOME%\wcdgo.bat" ) ELSE ( c:\wcdgo.bat ) ) wcd-5.2.4/win32/wcd_win95.bat0000755000175000010010000000056311227272030015027 0ustar waterlanNone@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 wcdwin32.exe %1 %2 %3 %4 %5 %6 %7 %8 %9 IF NOT "%WCDHOME%" == "" GOTO WCDHOME IF NOT "%HOME%" == "" GOTO HOME c:\wcdgo.bat GOTO END :WCDHOME %WCDHOME%\wcdgo.bat GOTO END :HOME %HOME%\wcdgo.bat GOTO END :END wcd-5.2.4/win32psh/0000755000175000010010000000000012207427076013246 5ustar waterlanNonewcd-5.2.4/win32psh/Makefile0000644000175000010010000000344612101167345014706 0ustar waterlanNone PREFIX = c:/usr/local prefix = $(PREFIX) exec_prefix = $(prefix) MKDIR = mkdir LIBS_EXTRA = -lkernel32 -luser32 -lmpr CFLAGS = -O2 -Wall -Wextra -Wconversion -Wno-unused-parameter CURSES = pdcursesw ENABLE_NLS = 1 DEFS = -DWCD_WINPWRSH ifdef CURSES LIB_CURSES = -l${CURSES} DEFS += -DWCD_USECURSES -DPDC_STATIC_BUILD DEFS += -DPDC_WIDE EXTRA_OBJ += wcwidth.o endif ifdef ENABLE_NLS LIBS_EXTRA += -lintl -liconv endif ifdef WCD_UTF8 # WCD_UTF8 was used in older versions. UCS=1 endif ifdef UNINORM UCS=1 endif ifdef UCS EXTRA_OBJ += matchw.o endif bindir = ${exec_prefix}/bin PROGRAM = wcdwin32psh.exe VERSIONSUFFIX = -win32psh ZIPOBJ_EXTRA = ifdef ENABLE_NLS # Using GnuWin32 gettext,iconv #ZIPOBJ_EXTRA += bin/libintl3.dll bin/libiconv2.dll # Using MinGW gettext,iconv ZIPOBJ_EXTRA += bin/libintl-8.dll bin/libiconv-2.dll endif ifdef UNINORM ZIPOBJ_EXTRA += bin/libunistring-0.dll endif all : ${MAKE} -C ../src all PROGRAM=${PROGRAM} CFLAGS="${CFLAGS}" CURSES=${CURSES} LIB_CURSES=${LIB_CURSES} DEFS="${DEFS}" LIBS_EXTRA="${LIBS_EXTRA}" prefix=${prefix} EXTRA_OBJ="${EXTRA_OBJ}" 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}" prefix=${prefix} MKDIR=${MKDIR} EXTRA_OBJ="${EXTRA_OBJ}" INSTALL_OBJS_DOC_INSTALL="../doc/INST_DOS.txt ../doc/INSTALL.txt" ENABLE_NLS=${ENABLE_NLS} uninstall : ${MAKE} -C ../src uninstall PROGRAM=${PROGRAM} prefix=${prefix} ENABLE_NLS=${ENABLE_NLS} dist : ${MAKE} -C ../src dist-zip ZIPOBJ_EXTRA="${ZIPOBJ_EXTRA}" PROGRAM=${PROGRAM} prefix=${prefix} VERSIONSUFFIX=${VERSIONSUFFIX} ENABLE_NLS=${ENABLE_NLS} strip: ${MAKE} -C ../src strip PROGRAM=${PROGRAM} mostlyclean : ${MAKE} -C ../src mostlyclean clean : ${MAKE} -C ../src clean wcd-5.2.4/win32psh/vc/0000755000175000010010000000000012207427076013656 5ustar waterlanNonewcd-5.2.4/win32psh/vc/makefile0000755000175000010010000000216412026665041015357 0ustar waterlanNoneSRCDIR = ..\..\src !include $(SRCDIR)\version.mk CC = cl.exe /nologo LINK = link.exe /nologo PROGRAM = wcdwin32psh.exe DEFINES = /DWCD_WINPWRSH CURSES = pdcursesw !if "$(CURSES)" != "" DEFINES = $(DEFINES) /DWCD_USECURSES /DPDC_WIDE !endif CFLAGS = $(DEFINES) /I$(SRCDIR) /I$(SRCDIR)\c3po 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 wcwidth.obj LIBS = mpr.lib !if "$(CURSES)" != "" OBJS = $(OBJS) dirnode.obj colors.obj graphics.obj LIBS = $(LIBS) user32.lib advapi32.lib $(CURSES).lib !endif !if "$(UCS)" == "1" OBJS = $(OBJS) matchw.obj LIBS = $(LIBS) shell32.lib VERSIONSUFFIX = -win32psh-ucs !else VERSIONSUFFIX = -win32psh !endif HTMLEXT = htm DOCFILES = $(SRCDIR)\..\doc\wcd.txt $(SRCDIR)\..\doc\wcd.$(HTMLEXT) prefix = c:\usr\local all: $(PROGRAM) $(DOCFILES) $(PROGRAM): $(OBJS) $(LINK) /out:$@ $(LDFLAGS) $(OBJS) $(LIBS) !include $(SRCDIR)\vc.mak wcd-5.2.4/win32psh/watcom/0000755000175000010010000000000012207427076014540 5ustar waterlanNonewcd-5.2.4/win32psh/watcom/makefile0000755000175000010010000000272612017356345016251 0ustar waterlanNoneSRCDIR = ..\..\src !include $(SRCDIR)\version.mk CC = wcc386 PROGRAM = wcdwin32psh.exe DEFINES = -dWCD_WINPWRSH CURSES = pdcursesw !ifneq CURSES DEFINES += -dWCD_USECURSES -dPDC_WIDE !endif CFLAGS = $(DEFINES) -i=$(SRCDIR) -i=$(SRCDIR)\c3po -w4 -e25 -zq -od -d2 -5r -bt=nt -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 wcwidth.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,wcwidth.obj !ifneq CURSES OBJS += dirnode.obj colors.obj graphics.obj LOBJS +=,dirnode.obj,colors.obj,graphics.obj !endif !ifeq UCS 1 OBJS += matchw.obj LOBJS +=,matchw.obj VERSIONSUFFIX = -win32psh-ucs !else VERSIONSUFFIX = -win32psh !endif HTMLEXT = htm DOCFILES = $(SRCDIR)\..\doc\wcd.txt $(SRCDIR)\..\doc\wcd.$(HTMLEXT) prefix = c:\usr\local TARGET = nt all: $(PROGRAM) $(DOCFILES) .SYMBOLIC $(PROGRAM): $(OBJS) @%create wcd.lnk @%append wcd.lnk FIL $(LOBJS) @%append wcd.lnk library mpr.lib !ifneq CURSES @%append wcd.lnk library $(CURSES).lib !endif wlink name wcdwin32psh 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.2.4/win32zsh/0000755000175000010010000000000012207427075013257 5ustar waterlanNonewcd-5.2.4/win32zsh/Makefile0000644000175000010010000000332112101167345014710 0ustar waterlanNone PREFIX = c:/usr/local prefix = $(PREFIX) exec_prefix = $(prefix) MKDIR = mkdir LIBS_EXTRA = -lkernel32 -luser32 -lmpr CFLAGS = -O2 -Wall -Wextra -Wconversion -Wno-unused-parameter CURSES = pdcursesw ENABLE_NLS = 1 DEFS = -DWCD_WINZSH ifdef CURSES LIB_CURSES = -l${CURSES} DEFS += -DWCD_USECURSES -DPDC_STATIC_BUILD DEFS += -DPDC_WIDE EXTRA_OBJ += wcwidth.o endif ifdef ENABLE_NLS LIBS_EXTRA += -lintl -liconv endif ifdef WCD_UTF8 # WCD_UTF8 was used in older versions. UCS=1 endif ifdef UNINORM UCS=1 endif ifdef UCS EXTRA_OBJ += matchw.o endif bindir = ${exec_prefix}/bin PROGRAM = wcdwin32zsh.exe VERSIONSUFFIX = -win32zsh ZIPOBJ_EXTRA = ifdef ENABLE_NLS # Using MinGW gettext,iconv ZIPOBJ_EXTRA += bin/libintl-8.dll bin/libiconv-2.dll endif ifdef UNINORM ZIPOBJ_EXTRA += bin/libunistring-0.dll endif all : ${MAKE} -C ../src all PROGRAM=${PROGRAM} CFLAGS="${CFLAGS}" CURSES=${CURSES} LIB_CURSES=${LIB_CURSES} DEFS="${DEFS}" LIBS_EXTRA="${LIBS_EXTRA}" prefix=${prefix} EXTRA_OBJ="${EXTRA_OBJ}" 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}" prefix=${prefix} MKDIR=${MKDIR} EXTRA_OBJ="${EXTRA_OBJ}" INSTALL_OBJS_DOC_INSTALL="../doc/INST_DOS.txt ../doc/INSTALL.txt" ENABLE_NLS=${ENABLE_NLS} uninstall : ${MAKE} -C ../src uninstall PROGRAM=${PROGRAM} prefix=${prefix} ENABLE_NLS=${ENABLE_NLS} dist : ${MAKE} -C ../src dist-zip ZIPOBJ_EXTRA="${ZIPOBJ_EXTRA}" PROGRAM=${PROGRAM} prefix=${prefix} VERSIONSUFFIX=${VERSIONSUFFIX} ENABLE_NLS=${ENABLE_NLS} strip: ${MAKE} -C ../src strip PROGRAM=${PROGRAM} mostlyclean : ${MAKE} -C ../src mostlyclean clean : ${MAKE} -C ../src clean wcd-5.2.4/win32zsh/vc/0000755000175000010010000000000012207427075013667 5ustar waterlanNonewcd-5.2.4/win32zsh/vc/makefile0000755000175000010010000000216212026665041015367 0ustar waterlanNoneSRCDIR = ..\..\src !include $(SRCDIR)\version.mk CC = cl.exe /nologo LINK = link.exe /nologo PROGRAM = wcdwin32zsh.exe DEFINES = /DWCD_WINZSH CURSES = pdcursesw !if "$(CURSES)" != "" DEFINES = $(DEFINES) /DWCD_USECURSES /DPDC_WIDE !endif CFLAGS = $(DEFINES) /I$(SRCDIR) /I$(SRCDIR)\c3po 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 wcwidth.obj LIBS = mpr.lib !if "$(CURSES)" != "" OBJS = $(OBJS) dirnode.obj colors.obj graphics.obj LIBS = $(LIBS) user32.lib advapi32.lib $(CURSES).lib !endif !if "$(UCS)" == "1" OBJS = $(OBJS) matchw.obj LIBS = $(LIBS) shell32.lib VERSIONSUFFIX = -win32zsh-ucs !else VERSIONSUFFIX = -win32zsh !endif HTMLEXT = htm DOCFILES = $(SRCDIR)\..\doc\wcd.txt $(SRCDIR)\..\doc\wcd.$(HTMLEXT) prefix = c:\usr\local all: $(PROGRAM) $(DOCFILES) $(PROGRAM): $(OBJS) $(LINK) /out:$@ $(LDFLAGS) $(OBJS) $(LIBS) !include $(SRCDIR)\vc.mak wcd-5.2.4/win32zsh/watcom/0000755000175000010010000000000012207427075014551 5ustar waterlanNonewcd-5.2.4/win32zsh/watcom/makefile0000755000175000010010000000272412026665041016255 0ustar waterlanNoneSRCDIR = ..\..\src !include $(SRCDIR)\version.mk CC = wcc386 PROGRAM = wcdwin32zsh.exe DEFINES = -dWCD_WINZSH CURSES = pdcursesw !ifneq CURSES DEFINES += -dWCD_USECURSES -dPDC_WIDE !endif CFLAGS = $(DEFINES) -i=$(SRCDIR) -i=$(SRCDIR)\c3po -w4 -e25 -zq -od -d2 -5r -bt=nt -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 wcwidth.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,wcwidth.obj !ifneq CURSES OBJS += dirnode.obj colors.obj graphics.obj LOBJS +=,dirnode.obj,colors.obj,graphics.obj !endif !ifeq UCS 1 OBJS += matchw.obj LOBJS +=,matchw.obj VERSIONSUFFIX = -win32zsh-ucs !else VERSIONSUFFIX = -win32zsh !endif HTMLEXT = htm DOCFILES = $(SRCDIR)\..\doc\wcd.txt $(SRCDIR)\..\doc\wcd.$(HTMLEXT) prefix = c:\usr\local TARGET = nt all: $(PROGRAM) $(DOCFILES) .SYMBOLIC $(PROGRAM): $(OBJS) @%create wcd.lnk @%append wcd.lnk FIL $(LOBJS) @%append wcd.lnk library mpr.lib !ifneq CURSES @%append wcd.lnk library $(CURSES).lib !endif wlink name wcdwin32zsh 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.2.4/win64/0000755000175000010010000000000012207427076012540 5ustar waterlanNonewcd-5.2.4/win64/Makefile0000644000175000010010000000360012101167345014170 0ustar waterlanNone PREFIX = c:/usr/local64 prefix = $(PREFIX) exec_prefix = $(prefix) MKDIR = mkdir LIBS_EXTRA = -lkernel32 -luser32 -lmpr CC = x86_64-w64-mingw32-gcc STRIP = x86_64-w64-mingw32-strip CFLAGS = -O2 -Wall -Wextra -Wconversion -Wno-unused-parameter CURSES = pdcursesw ENABLE_NLS = DEFS = ifdef CURSES LIB_CURSES = -l${CURSES} DEFS += -DWCD_USECURSES -DPDC_STATIC_BUILD DEFS += -DPDC_WIDE EXTRA_OBJ += wcwidth.o endif ifdef ENABLE_NLS LIBS_EXTRA += -lintl -liconv endif ifdef WCD_UTF8 # WCD_UTF8 was used in older versions. UCS=1 endif ifdef UNINORM UCS=1 endif ifdef UCS EXTRA_OBJ += matchw.o endif bindir = ${exec_prefix}/bin PROGRAM = wcdwin64.exe VERSIONSUFFIX = -win64 ZIPOBJ_EXTRA = bin/wcd.bat ifdef ENABLE_NLS # Using MinGW gettext,iconv ZIPOBJ_EXTRA += bin/libintl-8.dll bin/libiconv-2.dll endif ifdef UNINORM ZIPOBJ_EXTRA += bin/libunistring-0.dll endif all : ${MAKE} -C ../src all PROGRAM=${PROGRAM} CFLAGS="${CFLAGS}" CURSES=${CURSES} LIB_CURSES=${LIB_CURSES} DEFS="${DEFS}" LIBS_EXTRA="${LIBS_EXTRA}" prefix=${prefix} EXTRA_OBJ="${EXTRA_OBJ}" ENABLE_NLS=${ENABLE_NLS} CC=$(CC) 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} EXTRA_OBJ="${EXTRA_OBJ}" INSTALL_OBJS_DOC_INSTALL="../doc/INST_DOS.txt ../doc/INSTALL.txt" ENABLE_NLS=${ENABLE_NLS} CC=$(CC) install -m 755 wcd.bat $(DESTDIR)${bindir}/wcd.bat uninstall : ${MAKE} -C ../src uninstall PROGRAM=${PROGRAM} prefix=${prefix} ENABLE_NLS=${ENABLE_NLS} -rm -f $(DESTDIR)${bindir}/wcd.bat 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} STRIP=$(STRIP) mostlyclean : ${MAKE} -C ../src mostlyclean clean : ${MAKE} -C ../src clean wcd-5.2.4/win64/wcd.bat0000755000175000010010000000121312054434334014000 0ustar waterlanNone@echo off set PDC_RESTORE_SCREEN=1 rem set WCDHOME=%HOMEDRIVE%%HOMEPATH% rem set LANG=nl_NL rem set LANGUAGE=nl rem set WCDLOCALEDIR=c:/Program Files/wcd/share/locale rem set WCDSCAN=c:;d: rem Define WCDHOME when WCDHOME and HOME are both not defined, rem because on Windows Vista and up users are not allowed to rem create files in the root directory of the system partition. IF NOT DEFINED WCDHOME ( IF NOT DEFINED HOME ( set WCDHOME=%HOMEDRIVE%%HOMEPATH% ) ) wcdwin64.exe %* IF DEFINED WCDHOME ( "%WCDHOME%\wcdgo.bat" ) ELSE ( IF DEFINED HOME ( "%HOME%\wcdgo.bat" ) ELSE ( c:\wcdgo.bat ) ) wcd-5.2.4/win64psh/0000755000175000010010000000000012207427073013250 5ustar waterlanNonewcd-5.2.4/win64psh/Makefile0000644000175000010010000000346112101167345014710 0ustar waterlanNone PREFIX = c:/usr/local64 prefix = $(PREFIX) exec_prefix = $(prefix) MKDIR = mkdir LIBS_EXTRA = -lkernel32 -luser32 -lmpr CC = x86_64-w64-mingw32-gcc STRIP = x86_64-w64-mingw32-strip CFLAGS = -O2 -Wall -Wextra -Wconversion -Wno-unused-parameter CURSES = pdcursesw ENABLE_NLS = DEFS = -DWCD_WINPWRSH ifdef CURSES LIB_CURSES = -l${CURSES} DEFS += -DWCD_USECURSES -DPDC_STATIC_BUILD DEFS += -DPDC_WIDE EXTRA_OBJ += wcwidth.o endif ifdef ENABLE_NLS LIBS_EXTRA += -lintl -liconv endif ifdef WCD_UTF8 # WCD_UTF8 was used in older versions. UCS=1 endif ifdef UNINORM UCS=1 endif ifdef UCS EXTRA_OBJ += matchw.o endif bindir = ${exec_prefix}/bin PROGRAM = wcdwin64psh.exe VERSIONSUFFIX = -win64psh ZIPOBJ_EXTRA = # Using MinGW gettext,iconv ifdef ENABLE_NLS ZIPOBJ_EXTRA += bin/libintl-8.dll bin/libiconv-2.dll endif ifdef UNINORM ZIPOBJ_EXTRA += bin/libunistring-0.dll endif all : ${MAKE} -C ../src all PROGRAM=${PROGRAM} CFLAGS="${CFLAGS}" CURSES=${CURSES} LIB_CURSES=${LIB_CURSES} DEFS="${DEFS}" LIBS_EXTRA="${LIBS_EXTRA}" prefix=${prefix} EXTRA_OBJ="${EXTRA_OBJ}" ENABLE_NLS=${ENABLE_NLS} CC=$(CC) 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} EXTRA_OBJ="${EXTRA_OBJ}" INSTALL_OBJS_DOC_INSTALL="../doc/INST_DOS.txt ../doc/INSTALL.txt" ENABLE_NLS=${ENABLE_NLS} CC=$(CC) uninstall : ${MAKE} -C ../src uninstall PROGRAM=${PROGRAM} prefix=${prefix} ENABLE_NLS=${ENABLE_NLS} dist : ${MAKE} -C ../src dist-zip ZIPOBJ_EXTRA="${ZIPOBJ_EXTRA}" PROGRAM=${PROGRAM} prefix=${prefix} VERSIONSUFFIX=${VERSIONSUFFIX} ENABLE_NLS=${ENABLE_NLS} strip: ${MAKE} -C ../src strip PROGRAM=${PROGRAM} STRIP=$(STRIP) mostlyclean : ${MAKE} -C ../src mostlyclean clean : ${MAKE} -C ../src clean