FD-3.01j/ 40755 2105 1751 0 13516612560 10564 5ustar shiraiuserFD-3.01j/README.eng100644 2105 1751 27443 13516612560 12343 0ustar shiraiuser############################################################ # # About FDclone Ver. 3.01 # # Takashi SHIRAI, # Jul 27, 2019 # ############################################################ FDclone is a file & directory maintenance tool for the UNIX based OS (called as "UNIX" expediently below). It is a clone of "FD" for MS-DOS, made by Mr. A.Idei in 1989. I make it as similar as possible in its specifications, but implement it quite originally. The reason why I called it a clone is based on the fact that "FD" is so popular that Japanese MS-DOS users treat the name of "FD" as the synonym of file maintenance tools. Once, there was a file maintenance tool for UNIX named 'fu' (made by Mr. Takashi Tashiro ), with which I was concerned to develop. I heard that many users rename it "fd" as alias. I think that the users came from MS-DOS to UNIX adapt to this name, because of easy typing. Therefore, it seemed effective that development of the tool based on it as its specifications made UNIX novices who came from MS-DOS adapt the UNIX environment naturally. From the above reason, this FDclone is made. While there ware long transitions and difficulties on its way, at last, I complete and release it. I dare say I'm happy. -- FDclone-3.01 package includes the following files. README this file (in Japanese) README.eng this file HISTORY amendment history up to now (in Japanese) HISTORY.eng amendment history up to now FAQ Q&A (Frequently Asked Question in Japanese) FAQ.eng Q&A (Frequently Asked Question) TECHKNOW technical knowhow (in Japanese) TECHKNOW.eng technical knowhow LICENSES document for licenses (in Japanese) LICENSES.eng document for licenses Install document to install FDclone (in Japanese) Install.eng document to install FDclone ToAdmin document for the administrator of FDclone (in Japanese) ToAdmin.eng document for the administrator of FDclone Configur auto configuration program (used in Makefile) Makefile Makefile Makefile.in template of Makefile fd.man roff file for man page (in Japanese) fd_e.man roff file for man page fd.cat plain text for man page (in Japanese) fd_e.cat plain text for man page mkmfsed.c sed script generator for filtering Makefile kanjicnv.c simple kanji code converter mkfunkno.c command serial number generator expfunc.c shell function expander (for obsolete /bin/sh) mkunitbl.c UNICODE translation table generator mkdict.c Kana-Kanji translation table convertor mktankan.c Tan-Kanji translation table generator mkkanji.c kanji.h convertor mkcat.c message catalog generator mkdir_p.c directory generator evalopt.c option strings parser module evalopt.h header for evalopt.c gentbl.c table generator module gentbl.h header for gentbl.c mkmfsedg.sed sed script filtering Makefile for djgpp v1.xx mkmfsedd.sed sed script filtering Makefile for djgpp v2.xx mkmfdosl.sed sed script filtering Makefile for LSI C-86 3.5 mkmfdosb.sed sed script filtering Makefile for Borland C++ makefile.gpc Makefile for djgpp v1.xx on DOS/V makefile.g98 Makefile for djgpp v1.xx on PC-98x1 makefile.dpc Makefile for djgpp v2.xx on DOS/V makefile.d98 Makefile for djgpp v2.xx on PC-98x1 makefile.lpc Makefile for LSI C-86 3.5 on DOS/V makefile.l98 Makefile for LSI C-86 3.5 on PC-98x1 makefile.bpc Makefile Borland C++ on DOS/V makefile.b98 Makefile for Borland C++ on PC-98x1 main.c FDclone main source termio.c terminal I/O library source termio.h header for termio.c term.c termcap library source term.h header for term.c printf.c formatted printing module printf.h header for printf.c string.c alternative string functions string.h header for string.c malloc.c alternative memoly allocation functions malloc.h header for malloc.c stream.c stream I/O library source stream.h header for stream.c time.c alternative time functions time.h header for time.c pathname.c pathname operation module pathname.h header for pathname.c system.c /bin/sh compatible system(3) module system.h header for system.c posixsh.c POSIX based builtin commands used in system.c posixsh.h header for posix.c doscom.c COMMAND.COM builtin commands used in system.c log.c system logging module log.h header for log.c dosdisk.c floppy drive driver dosdisk.h header for dosdisk.c sysemu.c system call wrapper for floppy drive sysemu.h header for sysemu.c unixdisk.c file I/O functions for MS-DOS unixdisk.h header for unixdisk.c realpath.c canonicalization for absolute pathname realpath.h header for realpath.c encode.c MD5 (RFC1321) & BASE64 (RFC3548) module encode.h header for encode.c pty.c pseudo terminal module termemu.c terminal emulation module termemu.h header for termemu.c frontend.c frontend module of terminal emulation backend.c backend module of terminal emulation libc.c arrangement of C standard library file.c file I/O module mntinfo.c mount information module mntinfo.h header for mntinfo.c statfs.c alternative statfs() apply.c applying one after another module parse.c strings parser module parse.h header for parse.c builtin.c builtin command module shell.c shell command module socket.c network socket functions socket.h header for socket.c url.c URL parser module url.h header for url.c auth.c authentication (RFC2617) module auth.h header for auth,c ftp.c FTP (RFC959) module html.c HTML (RFC2616) module html.h header for html.c http.c HTTP module urldisk.c URL drive driver urldisk.h header for urldisk.c catalog.c message catalog module catalog.h header for catalog.c kconv.c kanji code convert module kconv.h header for kconv.c input.c user input module ime.c tiny Kanji Input Method Editor roman.c Roman-Kana translation module roman.h header for roman.c dict.c Kanji dictionary searching module hinsi.h header for Hinsi grammar info.c various information module rockridg.c ISO 9660 RockRidge extension module lsparse.c parser for file list lsparse.h header for lsparse.c archive.c archiver module tree.c tree screen module custom.c customizer module command.c internal command module browse.c browser screen module fd.h header for customizing FDclone machine.h header for machine dependency config.hin dummy header for environment setting headers.h basic headers depend.h headers for dependency of option identifiers types.h variable type declarations namelist.h header for file list kctype.h header for kanji code typesize.h header for size of types wait.h header for child processes dirent.h header for directory entries unixemu.h header for system call emulation on MS-DOS fsinfo.h header for file system information device.h header for device ID func.h prototype declarations functabl.h header for attribute on internal command kanji.hin Japanese strings version.h version _fdrc template for .fd2rc _fdrc.dif changes from 1.03 about .fd2rc fd.spec spec file for RPM -- The copyright of FDclone belongs to: [ Takashi Shirai ] However, you are allowed freely to distribute, change, include and use secondarily the all sources, without any restriction. New development from my products, based on the source of FDclone, will satisfy me as author. You can recycle it freely. But, an act which adds restriction to use and distribution of FDclone, for example applying the patent about FDclone without permission, is forbidden entirely, because it becomes the act against the ideology of free software. Please tell me individually about distribution of the executable binary via CD-ROM or various networks. However, secondary distribution of the already distributed binary follows licenses of each distributor, then you should tell them details. The distributor's address of a distributed binary is displayed on the function line of the help screen, it is shown by HELP_MESSAGE command. If there is not this address, or the version number in a title line don't suffix the character of '#', it is revealed to be an unofficial distributed binary. Then I have no responsibilities for it. -- Please refer to each document for details. Compile according to `Install', and see man page for operational details after installation. I've prepared FAQ. When you got some troubles, read these documents before asking me. Almost troubles will be solved with FAQ and man page. You can compile this not only on each UNIX but also on MS-DOS, compiling on MS-DOS makes you need to replace Makefile. -- UNIX is the registered trademark licensed by X/Open Company Ltd. However, the name of UNIX called in each document of FDclone is not means UNIX OS licensed by X/Open, but means the any OS derived from unics, AT&T Bell Laboratory developed. Though I don't intend to invade the copyright of X/Open, the generic name means these all is disappeared, so I use this name expediently. -- Acknowledgement At last, thank the following persons for taking care of FDclone development. (in alphabetical order; "@" is described as " at ") o He is the author of "FD", and permit to release FDclone. SDI00544 at niftyserve.or.jp (Atsushi Idei) o They guided me about file systems in the WINC workshop ML. kenji at reseau.toyonaka.osaka.jp (Kenji Rikitake) mori at chuo-computer.co.jp (Hidekazu Mori) ohm at kyoto.wide.ad.jp (Akitoshi Morishima) saitoh at ics.es.osaka-u.ac.jp (Akinori Saito) o Administrator of the beta test ML matusita at ics.es.osaka-u.ac.jp (Makoto MATSUSHITA) o Beta testers 7m2vej at ritp.ye.IHI.co.jp (UENO Fumihiro) aki at pic.hitachi-sk.co.jp (Akiyoshi Sakaguchi) ao at orient.tuins.cs.toyo.ac.jp (AOYAGI Yoichi) daikoku at lang2.bs1.fc.nec.co.jp (Hirosi Daikoku) fuku at amorph.rim.or.jp (FUKUSHIMA Osamu) go at cclub.tutcc.tut.ac.jp (Go Watanabe) h-inoue at is.aist-nara.ac.jp (Hiroyuki Inoue) h-yagi at zero0.nsis.cl.nec.co.jp (Hideo Yagi) hashi at star.rcast.u-tokyo.ac.jp (TAKAHASHI Katsuyuki) hide at mamoru.ee.sophia.ac.jp (Takahide Yamaguchi) hiro at akinus1.aki.che.tohoku.ac.jp (Akiyasu Hirotani) i4579 at info.nara-k.ac.jp (Kimura Masashi) ishida at econ.shinshu-u.ac.jp (Akira Ishida) ito at getz.isc.chubu.ac.jp (Maki ITO) j0442 at cranesv.egg.kushiro-ct.ac.jp (Kazunori Yoshida) j9194169 at ed.yama.sut.ac.jp (Keitarou Yoshimura) jt at ng.nefs.nec.co.jp (Jiro_Takabatake) katsu at cs.uec.ac.jp (Katsuaki Suzuki) ke3057yt at ex.ecip.osaka-u.ac.jp (yosioka tuneo) kimai at av.crl.sony.co.jp (IMAI Kenichi) kjm at yonka.ngy.mhi.co.jp (KOJIMA Hajime) kkubota at crl.go.jp (Kazuo Kubota) kmiya at mm.rd.nttdata.jp (Kunio Miyamoto) kobashi at comp.eng.himeji-tech.ac.jp (kobashi) manabu at saskg.semicon.sony.co.jp (Niizato -Gamer- Manabu) mat at azalea.gose.nara.jp (Matsuo Kazunori) mats at cc.tuat.ac.jp (Seiji Matsumoto) mhirano at avkk.yamaha.co.jp (Mitsuyuki HIRANO) mino at kis-gw.msk.kis.co.jp (MINOMO Kazutoshi) mori at isc.mew.co.jp (Shigeki Morimoto) nino at windy.mech.utsunomiya-u.ac.jp (Nao NINOMIYA) nyoshi at kaba.or.jp (YOSHIDA Nobuaki) ohge at enzan.ee.kansai-u.ac.jp (Hiroki Ohge) ohishi at otc.qnes.nec.co.jp (Isao Ohishi) okubo at mem.cl.nec.co.jp (Shuichi OHKUBO) ozawa at prince.pe.u-tokyo.ac.jp roy at lit.cs.uec.ac.jp (SATOU Masaki) ryoji at kgupyr.kwansei.ac.jp (Ryoji Nagai) sakai at csl.cl.nec.co.jp (Junji SAKAI) sakanaga at ds.kyoto.omronsoft.co.jp (Toshiyuki Sakanaga) sawada at h3news1.kais.kyoto-u.ac.jp (Yutaka SAWADA) senshu at astro.yamagata-cit.ac.jp (Hiroyuki Senshu) shige at luck.imasy.or.jp (Shigechika Aikawa) shirai at atropos.gen.u-tokyo.ac.jp (Izuru Shirai) taka-mm at super.win.or.jp (Takahasi Mamoru) tan at kei-n.huap.hokudai.ac.jp (Takushi Tanaka) tanaka at inf.ptg.sony.co.jp ("T.Tanaka") tomiyan at cv.sony.co.jp (Mitsuhiko Tomita) tsuka at ohsaki.meidensha.co.jp (Yoshihiro Tsukamoto) uno at meleager.mel.go.jp wakui at casiogw.rd.casio.co.jp (WAKUI Kazuhiko) watanabe at jis.ptg.sony.co.jp (ebaN) yajima at ccedu.sendai-ct.ac.jp (Kuniaki YAJIMA) yaku at jedi.seg.kobe-u.ac.jp (Masao Yakushijin) yamakawa at crdl.pioneer.co.jp (Yuzo Yamakawa) yamamoto at ogw.ei.hosei.ac.jp (Kouya Yamamoto) FD-3.01j/HISTORY.eng100644 2105 1751 70151 13516612560 12541 0ustar shiraiuserVer. 3.01j Bug that symbolic link is copied as absolute path is fixed. (07/27/19) Failure to convert Kanji of symbolic link body is fixed. Ver. 3.01i Support Android 9.0. (05/25/19) Failure to cross-compile with some clang is fixed. Ver. 3.01h Keep one-on-one UTF-8 table with filename Kanji conversion. (08/11/18) Bug that previous job never become current job is fixed. Lack of output rarely with command termination is fixed. Ver. 3.01g Failure to display file system info. on WSL is fixed. (06/02/18) Broken display of error message is fixed. Illegal syntax error caused with the internal shell is fixed. Broken Kanji with some builtins is fixed. Broken Kanji with internal commands via EXECUTE_SH is fixed. Ver. 3.01f Support FreenBSD 11.1. (04/14/18) Support NetBSD 7.1. Support OpenBSD 6.2. Support MINIX 3.3. Failure to compile with some clang is fixed. Failure to compile on some POSIX environments is fixed. Ver. 3.01e Support Cygwin 2.5.1. (01/20/18) Wrong display width of some Kanji when PTYMODE=1 is fixed. Broken display of Kanji with the internal shell is fixed. Japanese documents are fixed from EUC-JP to Shift_JIS. (MS-DOS) Ver. 3.01d Needless file included in the source package is deleted. (12/25/17) Omission to update fd.spec is fixed. Ver. 3.01c Overflowed MD5 with 'checkid' builtin on 64bits OS is fixed. (12/23/17) Wrong terminal size got on some environments is fixed. Broken display when internal shell resized is fixed. Some broken Kanji with fd invoked by fdsh is fixed. Ver. 3.01b Abortion with sparc64 architecture is fixed. (05/06/14) Failure to expand macros with Linux kernel >=2.6.23 is fixed. Failure to overwrite some macro with 'bind' is fixed. Infinite loop by some builtin with %M macro is fixed. Ver. 3.01a Change 'IMELARNING' internal variable to 'IMELEARNING'. (06/08/13) Sorting rule for tree screen is adjusted to browser screen. Bug that any invalid UID/GID breaks file list is fixed. Bug that file list is not updated with lost directory is fixed. Failure to compile with environments using termio is fixed. Ver. 3.01 Add 'WIDEDIGIT', 'SIZEUNIT' internal variables. (08/03/12) Add 'HISTUMASK', 'DIRHISTUMASK' internal variables. Add 'IMELARNING', 'FREQFILE', 'FREQUMASK' internal variables. Add 'getfreq', 'setfreq' builtins. The object tables of 'IMEBUFFER' internal variable is extended. Ver. 3.00m Add the identifier UTF8LANG for compile. (07/27/12) Abortion when save file on customizer with some OS is fixed. Wrong priority with IME translation candidates is fixed. Unavailable dictionary in DICTSRC with ShiftJIS OS is fixed. Failure to compile with gcc-4.2 is fixed. Bug that some pipes cause infinite loop is fixed. Ineffective suspend key in any pipes is fixed. Wrong manual page for 'wait' builtin with no argument is fixed. Ver. 3.00l Support Android 4.0. (06/30/12) Support MINIX 3.2. Add the identifiers DEFKCODE, UTF8DOC, LANGWIDTH for compile. Add the identifiers _NOUNICDTBL, _NODICTTBL for compile. The cross-compiling is supported more carefully. Strange attribute-changing screen in narrow terminal is fixed. Some abortion when open archive browser is fixed. Some abortion when access MS-DOS formed path is fixed. Persistence of "Wait a minute" when TRADLAYOUT=1 is fixed. Ineffective sequence to save cursor when PTYMODE=1 is fixed. Unreadable file starting with "./" in archive browser is fixed. Ver. 3.00k Support Cygwin 1.7.13. (04/21/12) The cursor position after changing directory upward is changed. Failure by PageUp/PageDown key on the tree screen is fixed. Unsupported second resolution on the floppy drive is fixed. Some abortions by Bs key on the tree screen is fixed. Broken tree screen on the MS-DOS formed path is fixed. Failure to get HTTP log on some environments is fixed. Ineffective command result just before NEXT_WINDOW is fixed. Abortion with LOG_DIR in archive browser is fixed. Unexpected result of LOG_DIR in archive browser is fixed. Overflow by the too long path name is suppressed. Some commands in archive browser is restricted. Ver. 3.00j Failure of some HTTP redirection is fixed. (09/25/10) Needless network access when URLDRIVE=1 is suppressed. Mis-parsing of the file list from some HTTP servers is fixed. Failure of INFO_FILESYS on MINIX is fixed. Ver. 3.00i Support MINIX 3. (07/24/10) Support NetBSD 5.0. Changing to directory on some pseudo file system is allowed. Freezing of pseudo terminal with utf8-mac is fixed. Failure to convert Kanji code of startup argument is fixed. Broken shell output string with effective DEFKCODE is fixed. Failure to convert case letter on ShiftJIS is fixed. Miscount of items on customizer when changing tab is fixed. Misprint of string to map key code is fixed. Column overflow of Japanese filename on status line is fixed. Wrong cursor position when closing archive browser is fixed. Failed archive browser with here-document is fixed. Illegal newline code with archive browser is fixed. (MS-DOS) Invalid terminal input with internal shell on DJGPP is fixed. Unloadable newline (^J) from command history file is fixed. Ver. 3.00h Hang-up when 'PS1' internal variable includes \[...\] is fixed. (06/14/10) Failure to compile with non-standard C compiler is fixed. Recursive call of malloc() in abortion is fixed. Ver. 3.00g Broken tree screen with unprintable directory name is fixed. (06/04/10) Abortion when accessing directory with Japanese is fixed. Buffer overflow in Japanese string parser is fixed. Ver. 3.00f Mis-action of 'dir' builtin which differs from MS-DOS is fixed. (05/29/10) Invalidated default attribute mask of 'dir' builtin is fixed. Abortion when canceling in COPY_TREE/MOVE_TREE is fixed. Ver. 3.00e Add mkdir_p.c for installation. (02/27/10) Support Cygwin 1.7.1. Failure to compile with some non-ANSI C compilers is fixed. Ver. 3.00d Freezing by filename completion on some environments is fixed. (11/30/08) Mis-identified path invoked as login shell via su(1) is fixed. Freezing by the large value set as 'HISTSIZE' is fixed. Bug that 'echo' builtin ignores anyone starts with - is fixed. Support function keys with some VT100 compatible terminals. Warning by ioctl() on 64bits BSDs is fixed. Ver. 3.00c Bug to garble the pasted string when INPUTKCODE=utf8 is fixed. (07/27/08) Failure to access the root directory is fixed. (MS-DOS) Failure to be invoked on Windows NT is fixed. (MS-DOS) Illegal newline code for input/output is fixed. (MS-DOS) Failure to replace some strings in 'fc' builtin is fixed. Ver. 3.00b Failure to replace with $()/$(()) is fixed. (07/06/08) Bug that some temporary files may remain is fixed. Freezing by here-document with huge size is fixed. Mis-substitution of variables with exit status is fixed. Failure to treat argument with '=' as substitution is fixed. Buffer overflow with the undefined floppy drive is fixed. Mis-operation for redirections with complex sentences is fixed. Bug that trap on exit cannot be executed suitably is fixed. Inaccurate value of 'LINENO' internal variable is fixed. Bug that newline cannot be allowed in 'case' sentence is fixed. Bug that ${} cannot include meta characters within "" is fixed. Mis-replacement for meta characters in here-document is fixed. Adjust representations for 'FD_VERSION' of each documents. Bug that 'FD_VERSION' may not be set is fixed. Ver. 3.00a Failure to replace the alias with no argument is fixed. (06/21/08) Abortion with recursively invoked archive browser is fixed. Resolve a directory traversal vulnerability on the URL drive. Mis-implementation of telnet commands in FTP is fixed. Failure to compile on Solaris 8 is fixed. Adjust representations of each documents to Ver. 3.00. Ver. 3.00 Add the URL drive function. (05/31/08) Add scheme moditiers to access socket as redirect file. Support the message catalog. Abolish limits of each registrations. Support argument of EDIT_CONFIG as environment variable name. Add 'AUTOUPDATE' internal variable. Add 'VERSION' internal variable. Add 'URLDRIVE', 'URLKCODE', 'HIDEPASSWD' internal variables. Add 'URLOPTIONS', 'URLTIMEOUT' internal variables. Add 'FTPPROXY', 'FTPLOGFILE', 'FTPADDRESS' internal variables. Add 'HTTPPROXY', 'HTTPLOGFILE' internal variables. Add 'HTMLLOGFILE' internal variable. Add 'accept', 'socketinfo', 'addcr' builtins. Add -N option in 'echo' builtin. Add -N option in 'read' builtin. Add the formats of %w, %p, %B, %b, %/, %! for archive browser. Add the redirectees of '<>&', '><&' for duplication. Add the redirectees of '<>-', '<>&-', '><-', '><&-' for close. Change default file descriptor of '><' redirectee to stdout. Ver. 2.09i Failure to compile on Darwin 9.x (Mac OS X 10.5) is fixed. (04/19/08) Odd screen when displaying some long file names is fixed. Failure to write directory for FAT file system is fixed. Ver. 2.09h Bug that ATTR_FILE/ATTR_DIR have sometimes no effect is fixed. (03/15/08) Unsuitable error message with no controlling terminal is fixed. Odd completion choice list while shifting filename is fixed. Ver. 2.09g Abortion with no controlling terminal is fixed. (01/26/08) Failure to find the startup directory is resolved partly. Failure to input some special keys is reduced. Ver. 2.09f Bug to garble the pasted string in some environments is fixed. (10/28/07) Mis-inputted keys after dynamic variation of 'TERM' is fixed. Bug to ignore some configuration files on NFS is fixed. Failure with some builtins in non-interactive shell is fixed. Bug not to expand variables after '~' is fixed. Ver. 2.09e Freezing sometimes caused in 'copy' builtin is fixed. (09/16/07) Abortion when missing the current directory is fixed. Wrong default file descriptor of '<>'/'><' redirectee is fixed. Incomplete check for the supplementary group is fixed. Ver. 2.09d Support Linux kernel 2.6.20. (04/26/07) Progress key responses when INPUTKCODE=utf8. Abortion with accessing the empty directory is fixed. Inaccessiblity of the floppy drive with large size is fixed. Ver. 2.09c Failure to support Linux kernel 2.6.18 is fixed. (01/17/07) Ver. 2.09b Support Linux kernel 2.6.18. (12/22/06) Bug that '..' is not accessible in floppy drive is fixed. Ver. 2.09a Support hard-linked archive files with GNU tar. (10/31/06) Support timeout of locking files. Bug that shared folder cannot be accessed on Cygwin is fixed. Bug that UTF8-mac cannot work in some code settings is fixed. Bug that some Japanese input is broken on PTYMODE=1 is fixed. Mis-sorting order for filenames on IGNORECASE=1 is fixed. Bug that function keys cannot work in some terminals is fixed. Ver. 2.09 Add 'IMEKEY', 'IMEBUFFER' internal variables. (08/22/06) Add 'BASICCUSTOM' internal variable. Add 'PROGRESSBAR', 'PRECOPYMENU' internal variables. Add 'SAVEDIRHIST', 'DIRHISTFILE' internal variables. Add 'FUNCLAYOUT' internal variable. Add 'MESSAGELANG' internal variable. 'LANGUAGE' etc. support the value of UTF8-iconv. Add 'UTF8ICONVPATH' internal variable. Add %JI macro. 'SORTTYPE' supports preserving sort type in archive browser. 'ANSIPALETTE' supports the color of executable files. Add 'setroman', 'printroman' builtins. Support specifying key comment up to F20 with 'bind' builtin. Add Kanji input to the pseudo terminal menu. Support Kanji code on 'InputCode' of the pseudo terminal menu. Freezing when PTYMODE=1 on Cygwin is fixed. Abortion when the log file is specified is fixed. Bug that no UTF8 filename can be treated is fixed. Abortion with the UTF8 environment on UNICODEBUFFER=1 is fixed. Ver. 2.08f Support locking on NFS to protect the command history file. (08/08/06) Failure to compile on the non-ANSI environment is fixed. Support Cygwin 1.5.21. Mis-sorting for Japanese filenames on IGNORECASE=1 is fixed. Broken UNICODE table is fixed. (MS-DOS) Ver. 2.08e Support the menu method for 'ANSIPALETTE' on customizer. (07/28/06) Support the key-input method for 'PTYMENUKEY' on customizer. Support the setting of "EDITOR", "PAGER", etc. on customizer. Bug that the setting of 'SORTTYPE' takes no effect is fixed. Abortion with sparc64 architecture is fixed. Unsuitable cursor position with UTF8 on PTYMODE=1 is fixed. Failure to copy/move the unwritable directory is fixed. Failure to complete the filename with a drive name is fixed. Failure to change timespamp of SFN directory is fixed. (MS-DOS) Ver. 2.08d Bug that command line rejects any Japanese on the pty is fixed. (06/13/06) Bug that command line rejects any Kana is fixed. Mis-indicating for the incremental history search is fixed. Bug that the history file on NFS is deadlocked is fixed. Ver. 2.08c Bug that the command history file on NFS is truncated is fixed. (05/24/06) Support some OSs displaying every archived file size as 0. Ver. 2.08b Support Cygwin 1.5.19. (03/30/06) Support internal commands with the command line on PTYMODE=1. Bug that inputted key is dropped in some environments is fixed. Abortion when "!string"-type history is not found is fixed. Unsuitable filename completion with meta characters is fixed. Bug that macros ignore any mark files on PTYMODE=1 is fixed. Bug that ANSICOLOR=2 is ineffective on PTYMODE=1 is fixed. Bug that current directory is not passed on PTYMODE=1 is fixed. Bug that terminal status of mlterm will be broken is fixed. Bug that OUT_DIR is ineffective with no file is fixed. Bug that 'bgnotify' is ineffective out of EXECUTE_SH is fixed. Bug that some background jobs output strange string is fixed. Ver. 2.08a Support NetBSD 3.0. (02/07/06) Failure to work according to 'PTYINKCODE' setting is fixed. Failure to compile on some environments using varargs is fixed. Failure to compile on some environments using sgtty is fixed. Failure to input keys on fdsh with unregistered TERM is fixed. Bug that 'echo' builtin does not refer to 'DEFKCODE' is fixed. Ver. 2.08 Add 'PTYINKCODE' and 'PTYOUTKCODE' internal variables. (12/26/05) Add 'LOGFILE', 'LOGSIZE' and 'USESYSLOG' internal variables. Add 'LOGLEVEL' and 'ROOTLOGLEVEL' internal variables. Add 'THRUARGS' internal variable. Add 'savetty' builtin. Add -o autosavetty and -S options in 'set' builtin. Add -o ptyshell and -T options in 'set' builtin. Add -P option in 'set' builtin as an alias of -o physical. Add ATTR_DIR command. Support changing file owner/group in ATTR_FILE. Bug that some files may be lost in writing directory is fixed. Ver. 2.07c Support archive list terminated with duplicate path delimiters. (12/13/05) Bug that arguments of fd from fdsh are re-evaluated is fixed. Bug that customizer cannot set HEX/CAP as FNAMEKCODE is fixed. Bug that select menus are sometimes broken is fixed. Mis-handling dynamic change of LANGUAGE on PTYMODE=1 is fixed. Abortion when fdsh is invoked with -N option is fixed. Support file lock to protect the command history file. Bug that fdsh cannot validate ADJTTY is fixed. Ver. 2.07b Bug that some pipes cause suspention is fixed. (09/14/05) Failure to do make with tail(1) strict on POSIX is fixed. Ver. 2.07a Bug that the screen is not updated with no file is fixed. (06/22/05) Failure to be invoked on Darwin (Mac OS X) is fixed. Allow evaluation of \ included in `` with the internal shell. Faliure to redirect to a new file descriptor is fixed. Ver. 2.07 Add 'PTYMODE', 'PTYTERM' and 'PTYMENUKEY' internal variables. (05/26/05) Add 'DEFKCODE' internal variable. Expand the maximum number of split windows into 5. Add WIDEN_WINDOW/NARROW_WINDOW/KILL_WINDOW commands. Support dynamic 'COLUMNS' and 'LINES' environment variables. Ver. 2.06d The directory for /etc/fd2rc becomes specifiable in compile. (05/10/05) Add the inhibited filenames COM5-COM9 in floppy drive. Bug that here-document is unavailable in functions is fixed. Bug that completion sometimes causes strange display is fixed. Abortion of child process with pipe of builtin is fixed. Abortion when invoked from directory with Japanese is fixed. Abortion when exit fd with split windows via fdsh is fixed. Support changing screen size while child process is executed. Ver. 2.06c Add the function to unset variables on customizer. (02/23/05) Mis-handling for archived file with meta characters is fixed. Ver. 2.06b Support the key input by UTF-8 code. (12/14/04) Support some OS environments displaying every file size as 0. Suppress the useless access to FDD on Cygwin. Bug that some kanji cannot be inputted on ShiftJIS is fixed. Ver. 2.06a Validate interrupt key at question in marked file operations. (09/08/04) Broken copy into the file linked the same entity is fixed. Bug that symbolic link cannot overwrite existent file is fixed. Mis-expansion of the macro with Japanese string is fixed. Mis-completion of symbolic link name without entity is fixed. Mis-position of cursor when cancel to move files is fixed. Ver. 2.06 Add the second startup argument for supplemental directory. (08/10/04) Add the incremental history search in the string input. Add 'builtin', 'enable' builtins. Add the startup options -l, -N. Allow `` included in "" with the internal shell. Ver. 2.05h Freezing fd invoked from fdsh with any arguments is fixed. (07/27/04) Mis-handling for the archived file with '.' or '..' is fixed. Bug to garble symbolic link to Japanese filename is fixed. Mis-location of cursor in case conversion of string is fixed. Mis-location of cursor in filename incremental search is fixed. Ver. 2.05g Bug that startup options with directory cannot work is fixed. (07/07/04) Strange sorted order in the filename completion is fixed. Delete 'mkdir'/'rmdir' builtin commands for UNIX. Support the kernel who handles SIGSTOP/SIGCONT in own style. Ver. 2.05f Failure to treat the command line ending with '\' is fixed. (06/23/04) Failure to launch archived file with any marked files is fixed. Bug that USEGETCURSOR cannot work is fixed. Bug that the startup option -r cannot work is fixed. Refine line editing in vi mode. Ingore unsupported error for the new tty line discipline. Ver. 2.05e Failure to copy files to destination suffixed by '/' is fixed. (06/09/04) Bug that wildcard out of quotation cannot be expanded is fixed. Make meta characters in directory history to be escaped. Invalidate filename completion in input unrelated to filename. Bug to call chflags() in ATTR_FILE for marked files is fixed. Allow ext2 file system to write directory. Ver. 2.05d Bug that ineffective \$ in PS1 is fixed. (05/12/04) Bug that \~ in PS1 is sometimes expanded incorrectly is fixed. Bug that fd invoked by fdsh changes current directory is fixed. Add notice when temporary directory is selected to expand file. Ver. 2.05c Bug that 'bind' binds a wrong macro to the bound key is fixed. (02/04/04) Failure to do 'make install' on Cygwin is fixed. Ver. 2.05b Abortion with InsLine key in the string input is fixed. (01/14/04) Bug that option letter for 'getopt' is lowercase only is fixed. Bug to bind commands to no Katakana key on EUC is fixed. Bug that strange error string for initialize in 16bit based OS. Bug that cursor cannot back on string input without CODEEUC. Strange display on some terminals with terminfo is fixed. Ver. 2.05a Bug that 'checkid' builtin outputs a wrong value is fixed. (12/10/03) Ver. 2.05 Support 'utf8-mac' as an additional Kanji code. (12/03/03) Add 'LOOPCURSOR' and 'TRADLAYOUT' internal variables. Add 'UNICODEBUFFER' internal variable. Add builtin commands in COMMAND.COM also for UNIX. Abortion when some file group differs from others is fixed. Bug that customizer sets key binding incorrectly is fixed. Bug that customizer overwrites a file destructively is fixed. Ver. 2.04c Support Cygwin. (10/15/03) Strange behaviors with redirected stdin are fixed. Invisible file info. when set 'PRECEDEPATH' is fixed. (MS-DOS) Strange information in archive browser on IRIX is fixed. Freezing in archive browser with some format is fixed. Freezing in 'exec' builtin with redirection is fixed. Ver. 2.04b Failure to execute fdsh with no terminal is fixed. (09/17/03) Freezing when use any history in -c option of fdsh is fixed. Ver. 2.04a Failure to compile on some environments using varargs is fixed. (07/24/03) Failure to compile on FreeBSD 5.x is fixed. Failure to count amount of file system on Linux/Alpha is fixed. Bug that 'dir' builtin shows wrong timestamp is fixed. (MS-DOS) Ver. 2.04 Add 'DUMBSHELL' and 'HISTFILE' internal variables. (06/25/03) Add 'ENV'/'LINENO'/'PPID'/'PS4' internal variables for POSIX. Support dynamic variation of 'TERM' internal variable. Support 'PWD' internal varable for current directory. Support the variable completion with Tab on string input. Support Large File Summit (over 2GB) for some OS. The screen columns limit for file size is enlarged. Prepare some substitute functions for System V. Bug that no child can be executed on some System V is fixed. Bug that no control works when invoked from GNU Emacs is fixed. Bug that some customizer functions work incorrectly is fixed. Bug that some symbolic links is followed incorrectly is fixed. Bug that Kanji code in floppy drive on fdsh is wrong is fixed. Bug that some OS cannot write directory correctly is fixed. Ver. 2.03b Bug that %T, %M macros cannot be except in arguments is fixed. (05/15/03) Bug that Japanese filename in floppy drive is broken is fixed. Bug that directory in floppy drive cannot be written is fixed. Abortion when the directory has some symbolic links is fixed. Support the unreliable signal() on System V. Bug that ${%}/${#} for null variable work strangely is fixed. Ver. 2.03a Bug that the default palette differs in color mode is fixed. (04/15/03) Bug that the function name can include any character is fixed. Some troubles when missing the current directory is fixed. Ver. 2.03 Add 'browse' builtin. (03/26/03) Add 'readline', 'yesno' builtins. Add 'ANSIPALETTE' internal variable. Add 'TMPUMASK' internal variable. Add -f, -i, -e, -t, -b options in 'launch' builtin. Add %l, * in the format for archive browser registration. %T, %M macros are refined to be used in any statements. The maximum 1023 characters for a command macro is abolished. The maximum 255 characters for an input line is abolished. The archive browser is refined to refer FNAMEKCODE. Bug that FIND_FILE with '/' sometimes fails is fixed. Abortion in the wildcard with more than 31 characters is fixed. Bug that some pipes cannot close safely is fixed. Bug that some temporary directories remain is fixed. Support invoking from the shell with lazy terminal control. Some incompletion when reading recursive directories is fixed. Abortion in EDIT_CONFIG with the minimum screen size is fixed. Broken select menus with the minimum screen size is fixed. Bug that '%' cannot kill meta characters on MS-DOS is fixed. Ver. 2.02b Support cross-compiling. (02/26/03) Support 64bit based OS. Reduce the minimum columns of a terminal to 34. The terminal erase character will be treated as a BS key. Bug for symbolic links in the archive file is fixed. Bug for symbolic links in the pseudo RockRidge is fixed. Abortion when failing to change directory is fixed. Bug that logical changing directory works incorrectly is fixed. The terminal control with suspending in shell will be strict. Bug that '\' cannot kill meta characters in wildcards is fixed. Mis-evaluation for && and || is fixed. Bug that a variable name cannot contain numerals is fixed. Bug that ${##} cannot work legally is fixed. Bug that the operator '|' of $(()) is treated as '^' is fixed. Bug that $(()) cannot treat negative values is fixed. Bug that $(()) cannot use octal/hexadecimal numbers is fixed. Ver. 2.02a Allow pack/unpack archive files into floppy drives. (12/25/02) Temporary directory names will be generated randomly. Interruption in some internal commands via EXECUTE_SH is fixed. Abortion when reading recursive directories is fixed. Abortion when changing file attributions on some OS is fixed. Ver. 2.02 Add 'pushd', 'popd' and 'dirs' builtins. (11/26/02) Add -L, -P options in 'cd', 'pwd' builtins. Add -o physical option in 'set' builtin. Add %JA macro. Add 'MAIL', 'MAILPATH', 'MAILCHECK' internal variables. Add ${#foo}, ${foo%bar}, ${foo#bar} substitutions for POSIX. Add $(command), $((expression)) expansions for POSIX. Add 'dtype' builtin. (MS-DOS) Add /S, /4 options in 'dir' builtin. (MS-DOS) Expand the length of fdsh's command line into 255 characters. Temporary filenames will be generated randomly for security. Bug that '.' and '..' are invisible on floppy drives is fixed. Bug that no here-document can be used in statements is fixed. Broken path when invoked with a floppy drive argument is fixed. Bug that file preceding makes some commands illegal is fixed. Evaluation for arguments in shell command line is revised. Bug that each RRPATH and FNAMEKCODE works exclusively is fixed. Useless redirected CON on DJGPP and Borland C++ is fixed. Miscalculation of free disk space on floppy drives is fixed. Bug that customizer cannot save configurations is fixed. Bug that pure MS-DOS cannot write some directories is fixed. Ver. 2.01c Enlarge range of the filename shift for symbolic link. (10/01/02) Mis-parsing for the archived file with '.' directory is fixed. Trivial fixes about the filename completion. Mis-repeating for the shell delimiter before/after %T is fixed. Stop evaluating any meta characters in renaming filename. Add the default archiver registration for .taz, .tgz. Mistaken format strings for .zip, .zoo are fixed. Ver. 2.01b Allow LOG_DIR in archive browser. (07/10/02) Abortion in archive browser with inappropriate format is fixed. Bug not to extract directory in archive browser is fixed. Trivial fixes about the filename completion. Ver. 2.01a Abortion when accessing filenames like as "a:" is fixed. (06/10/02) Freezing caused by syntax error in 'case' is fixed. Ver. 2.01 Add true/false/command/getopts/newgrp/fc builtins for POSIX. (05/08/02) Add -o, -b, -C options in 'set' builtin for POSIX. Add the redirectees of '>|', '&>|' for -C option. Add the redirectee of '&>>'. Add 'login', 'logout' and 'disown' builtins. Add the command separator '&|'. Change the old pipe identifier '&|' to '|&'. Change the overlapped variable name COLUMNS to DEFCOLUMNS. Escape from depending on ANSI.SYS. (MS-DOS) Missing .. on Windows NT is fixed. (MS-DOS) Missing LFN on Windows 2000/XP is fixed. (MS-DOS) Reference error of the history number is fixed. Untermination error of the builtin 'execmacro' is fixed. Unavailability of %M macro enclosed by %J macro is fixed. Unrepeated error for the description before/after %T is fixed. Illegal execution of 'trap 0' is fixed. Misjudgment for the exit status of child process is fixed. Abortion sometimes caused by filename completion is fixed. Mismatching [] with dot files is fixed. Bug that the last component of 'case' cannot omit ;; is fixed. Bug that alias name cannot consist every character is fixed. Support Linux/ia64. Ver. 2.00b Allow ambiguity in decoding JIS type encoded strings. (03/27/02) Support to decode ISO-2022-JP-3 encoding. The different rule from Windows in generating LFN is adjusted. Evaluation error for shell variables is fixed. Bug that ADJTTY has been always effective is fixed. Probe error of readonly attribute in mount option is fixed. An expanding error of continuous wildcards is fixed. Ver. 2.00a Some fixes for HP-UX. (02/06/02) Support terminfo(5) library. Restriction error of fd invoked from fdsh is fixed. Redirection on fdsh supports floppy drives. Strange display of filename completion list on fdsh is fixed. Support the terminal whose columns are over 255. Adjust some behaviors with a sub shell to Bourne shell. Substitution error of $$ in a sub shell is fixed. Some expanding errors of wildcards are fixed. Displaying error of some special keys in HELP_MESSAGE is fixed. Bug when select unsupported items in customizer is fixed. Bug when set INPUTKCODE in customizer is fixed. Bug that "make install" could not overwrite is fixed. Misspelling for several documents is fixed. Comment out all written in _fdrc for safety. Ver. 2.00 The second edition release. (01/11/02) Includes English documents. FD-3.01j/FAQ.eng100644 2105 1751 72122 13516612560 12007 0ustar shiraiuser[FAQ FOR FDCLONE3] <1.UNIX Depended Problem> Q1-01. A long UNIX filename is not displayed to the end. A1-01. You can scroll a display position of a filename by `(' and `)' key, on the default key binding. Put a cursor on the objective file and push `)' key several times, to display the whole filename. Q1-02. When FDclone is finished, it is returned the startup directory. How I can do? A1-02. On UNIX OS, each process has their own current directories, and no child process can manage to change the current directory of its parent process. Since FDclone is started as a child process of your user shell, FDclone can never manage to change the current directory of the user shell, as its parent process. It is an ad hoc method that invoking from a shell with the form as "cd `fd`" can change the current directory when finished. In this case, specification as `trap "pwd" 0' in .fd2rc and so on causes outputting the current directory when finished, so that the parent shell who receives it will change its current directory. Q1-03. I want to page up/down by Shift + up/down key. Q1-04. I want to execute editors and executable files by Shift + Ret key. Q1-05. When I push Shift key, notation of a function line doesn't change. A1-03. A1-04. A1-05. On UNIX, a keyboard input is brought by the communication between a host and a terminal. Each terminal emulator or terminal itself defines what code is sent and received. A general terminal doesn't send any key code with the only Shift key. Only when it pushed with any other key, it sends the key code for Shift. Therefore, only when the key code for Shift is different from the original key code, it can be find whether Shift is pushed or not. It is defined by each terminal what key has this feature. And now, Ret and the cursor keys send the same code whether Shift is pushed or not. Q1-06. The owner/group name in the archive browser seems strange. Q1-07. The owner/group name seems strange, when the floppy drive is referred to. A1-06. A1-07. The owner/group name of a file has a meaning only on the machine including it. On another machine, there is no guarantee to mean the same owner/group name. The owner/group name in archive files is named on the machine archiving them. Since MS-DOS has no such file attribute, there is not the owner/group name in files of the floppy drive. In that case, the owner/group name doesn't indicate any real owner/group. UNIX is implemented so that the owner/group name is treated as numeric, then it cannot be helped. (The tar which supports the new USTAR format can hold the owner/group name up to 32 characters in archives, to display the original owner/group name in the different environment. The ustar of System V and GNU tar are known as the tar which supports the USTAR format.) <2.Customization Problem> Q2-01. I want to execute an external command according to the extension of a filename. Can I customize? Q2-02. How I can change the key binding? A2-01. A2-02. Treat .fd2rc in your home directory as a configuration file. See man page for details of the usage. Q2-03. I can not set some key bindings. A2-03. The only key for which the special key identifier (See man page) is prepared can change its key binding. But, the builtin command "keymap" can make any key substitution of another function key, to set key binding in pseudo method. Key substitution by the edit mode is prior with key binding of a control character, so that there can be a control character to be unable to set key binding in some edit mode. If you need set in any way, you have to change the edit mode. And, It is forbidden to change ESC key binding, in order to avoid the problem that unusual change makes FDclone unterminatable. Q2-04. The display of a function key is different from an actual keyboard. A2-04. You can change a display of the function key when you change a key binding of the function key into your customization. See man page for details. But, if your keyboard layout is different from the function line, you can not suit a display to a keyboard. Sorry. (You can set up the function line layout with the internal variable (or the environment variable) FUNCLAYOUT, in Ver. 2.09 or later.) Q2-05. I want to confirm how it is customized. A2-05. You can confirm with some builtin commands in EXECUTE_SH command. For example, "printbind" for the key binding, "set" for the internal variable definition. See man page for details. (You can confirm and set up the configurations with the customizer all at once, in Ver. 2.00 or later.) Q2-06. As a system administrator, I want to prepare a configuration file common to users. A2-06. Make a file named /etc/fd2rc. It is referred to before the users .fd2rc is referred to, whether if .fd2rc exists or not. Q2-07. I want to register a new archive form in the archive browser. How can I do? A2-07. I've explained in #5 of TECHKNOW.eng, see it with the clause of "ARCHIVE BROWSER" in man page. Q2-08. It is always sorted. Q2-09. I want to see the information of a linked file in the case of a symbolic link. Q2-10. Some filenames are followed by a `*' or `/' character. Q2-11. A filename which starts with `.' is not displayed. Q2-12. I want to sort in the tree screen. Q2-13. The directory writing function takes no effect. Q2-14. When finished, my terminal configuration is different from the one before startup. Q2-15. I want to change the number of rows in startup. Q2-16. Can I get a longer filename field? Q2-17. I cannot use the command history. Q2-18. Can I refer to the history to input a pathname? Q2-19. I want to carry over the history to the next execution. Q2-20. A part the file list is not displayed in the tree screen. Q2-21. Can I see a second with the time display? Q2-22. I want to know the whole file size and the amount of disk. Q2-23. Can I use with color screen? Q2-24. I want to change the prompt in EXECUTE_SH command. A2-08. A2-09. A2-10. A2-11. A2-12. A2-13. A2-14. A2-15. A2-16. A2-17. A2-18. A2-19. A2-20. A2-21. A2-22. A2-23. A2-24. These configurations are set by the internal variables or the environment variables. There was not only the case each user configure them intentionally, but also the case the system administrator prepares the configuration file common to users, or hardcodes them when compiled. See the clause of "ENVIRONMENT VARIABLES" in man page well, to set a suitable configuration by .fd2rc and so on. Moreover, an administrator should prepare a suitable common configuration file, not to confuse users like this. The configuration file in the distribution package is no more than sample, then make your own common configuration file with enough consideration. Q2-25. I cannot understand the edit mode. A2-25. It seems hard for who has used neither emacs nor vi to know why there are multiple methods for binding the substitutive key by the control character. If you want to suit to the original FD, you should define "wordstar" as the internal variable (or the environment variable) EDITMODE, without considering anything. Especially about vi mode, it is the just confused environment for except who is familiar to vi, then you should not set this configuration unless the special case. Q2-26. When I try to refer to a file in the archive browser, it is rejected as "No such file or directory". Q2-27. When I try to refer to a file in the floppy drive, it is rejected as "No such file or directory". A2-26. A2-27. Is it right the value which is defined as the internal variable (or the environment variable) TMPDIR? It is necessary not only to exist the directory named as defined here, but also to be writable for you. Try to change the defined directory name, or change the permission of the directory. Q2-28. I can not use the floppy drive function. A2-28. Is it set up validly the configuration about the floppy drive? Even if you didn't set up when compiled, you can customize later. You must set the internal variable (or the environment variable) DOSDRIVE, and must register the floppy drive. See #6 of TECHKNOW.eng as details. And, sometimes a general user cannot use the floppy drive because of the permission of the device file assigned for the floppy disk drive. In this case, try to tell the administrator of a machine. Q2-29. Why the common configuration file is not located under /usr/local. A2-29. In some case, /usr/local is shared by some machines with NFS. If the common configuration file is located under /usr/local in such environment, multiple machines will use the same configuration file. There are not a few factors depended on machines in each configuration on FDclone, then I think it is sometimes unsuitable to be used the same configuration file by multiple machines. Therefore, it is designed to locate it under /etc which is rare to be used with NFS. If you understand the above and still want to locate it under /usr/local, as "Install" says, you may install with rewriting DEFRC in Makefile.in. Q2-30. What I should prepare as the common configuration file. Q2-31. I don't know what I should write in the configuration file. A2-30. A2-31. It is no need to prepare /etc/fd2rc as the common configuration file, nor .fd2rc as the configuration file for each user. If you don't prepare them, it is valid the default configurations hardcoded in executable file. So these defaults is set with considering the difference from each OS, usually, it should run normally even if as is. If you make some strange configuration file with no understanding, or use the attached sample as it was, you may get into trouble. It will be wise to avoid preparing the configuration file meaninglessly. <3.Environment Problem> Q3-01. When I try to refer to the contents of a file, page control is not managed, or a screen is broken. A3-01. It depends on the specification of a pager. If you change the pager software defined in the internal variable (or the environment variable) PAGER, the problem in reference will be cleared. I recommend, for example, GNU less distributed by FSF. Q3-02. Some special keys or function keys don't respond. Q3-03. DEL key and BS key has a strange behavior. A3-02. A3-03. Perhaps the key code of special keys and function keys may be different from the expected one. See the man page of termcap(5) or terminfo(5), to re-register the entry for your terminal suitably. If you cannot access termcap/terminfo, the builtin command "keymap" can change the key code dynamically. Examine a key code of the object key to register, with the builtin command "getkey". On some terminals, pushing function keys don't cause to send any key code, but cause action of the screen copy and so on. On these terminals, you cannot use any function keys. Q3-04. It has been finished with a message as "Column size too small". A3-04. It means that the terminal column size is too small to display for FDclone, to force it to terminate. Similarly, if the terminal line size is too small, its message is "Line size too small". Execute on wider terminal, or widen size more than 34x8 in case of the variable-sized terminal such as a window terminal. In case of variable-sized terminal, if you shorten a terminal size less than this while running, you should note that you will be prompted to widen a terminal size. Q3-05. I cannot read a kanji because it is broken. A3-05. Perhaps it may be compiled at a wrong kanji code, or you execute it in the terminal which use the different kanji code. In the latter case, set any of sjis, jis, or euc to the internal variable LANGUAGE, according to your terminal. FDclone will change the code internally. In the former case, you must re-compile with modifying the original kanji code, but you can manage like as the latter case in half measures. In this case, I think that it occurs some troubles to refer to the file with kanji filename or the Japanese man page. (Kanji filename will also be converted dynamically according to the internal variable FNAMEKCODE, in Ver. 2.00 or later.) Q3-06. When I bring it to a machine with the different environment, it works strangely. A3-06. It is generally the principle to re-compile for the different environment. Even if it may seem the same apparently, some troubles will be occurred in spite of just running because of the difference of OS version or the difference of configuration. Besides, don't forget to compile after executing "make clean", not to remain the previous unfinished file. Q3-07. I do "make config", but cannot compile normally. A3-07. Auto configuration is not perfect. Then see #1 of TECHKNOW.eng to modify config.h manually. It needs you have some knowledge of the C language, but each man page guides you without the advanced knowledge. If you use the OS which is written as the supported OS in Install, "make config" may sometimes makes a rather unsuitable configuration, so that you should not do "make config". When you've done accidentally, do "make realclean". If you can make configuration of config.h for any unsupported OS, you can report this to make me register it as the supported OS. But, I cannot support basically the environment which I don't have, then you must abandon it if it was imperfect in spite of modifying config.h. If you prepare me the developing environment with hardware, I will support it. Q3-08. I execute "man fd", but man page is not displayed correctly. A3-08. It is a possibility that the man page is not installed correctly. Did you prepare MANDIR which you've reserved in Makefile.in? Or it may be imperfect configurations about a kanji code. Try to confirm if you set correctly the environment variable such as MANPATH or LANG in user environment. In the worst case, It supposed that your OS is not supported in Japanese. Though the terminal itself can display Japanese, a text formatter (usually nroff) may be unable to use Japanese rightly. In this case, install a man page of the plain text version, referring to Install #8. Q3-09. The archive browser cannot display correctly only the timestamp of a file. A3-09. Try to exit from FDclone and do manually "tar tvf ". I suppose that date and time will be display in Japanese. Such a form of the timestamp is not recognized correctly, so that execute "export LANG=C" in .fd2rc and so on, to let tar done in English mode. Or, you may register the archive browser with any mistake, see enough #5 of TECHKNOW.eng or the clause of "ARCHIVE BROWSER" in man page. (The value of LANG will be changed automatically before executing archivers, in Ver. 2.04c or later.) Q3-10. I cannot read a file to the end. A3-10. Some pager, e.g. "more" which is a standard command included in OS, will immediately return to FDclone at the as soon as it has read through the end of a file, not to read to the end. In that case, you should use the "%K" macro in order to prompt once before returning. Specifically, you should add 2 characters "%K" after a pager name at the point to set up the internal variable (or the environment variable) PAGER. Q3-11. I want to read the file from which a kanji code is different. A3-11. Conversion of a kanji code is the work by a pager, so that you must manage with the pager side. GNU less has iso-2022-jp patch which to recognize each kanji code automatically, you can find it in anonymous ftp sites. Or there are some kanji code filters to recognize automatically, such as nkf. It is a way to set up the internal variable (or the environment variable) PAGER as "nkf %C | less". Q3-12. One day suddenly, a browser display of an archive file becomes strange. A3-12. LHa on UNIX has been changed for a format to display in list from V 1.14. You should register a launcher as follows. launch ".lzh" "lha -lq" "%a %u/%g %s %x %m %d %{yt} %f" GNU tar has been changed for a format to display in list from version 1.12. You should register a launcher as follows. launch ".tar" "tar tvf" "%a %u/%g %s %y-%m-%d %t %f" launch ".tar.Z" "tar tvfZ" "%a %u/%g %s %y-%m-%d %t %f" launch ".tar.gz" "tar tvfz" "%a %u/%g %s %y-%m-%d %t %f" Both samples are prepared in _fdrc. Q3-13. When executed on winterm terminal of IRIX, neither Ret key nor a cursor key takes no effect. A3-13. It is the cause that description for winterm is wrongly prepared by the standard. You should add the following description in /etc/fd2rc if [ " $TERM" = " iris-ansi" ]; then keymap ENTER "" keymap UP "\033OA" keymap DOWN "\033OB" keymap RIGHT "\033OC" keymap LEFT "\033OD" fi To explain additionally, this ENTER means Enter key of a special key, and never means Ret key (so-called new-line key). Although some keyboards have Ret key (mostly located above a right SHIFT) on which stamped "Enter" with its key-top, Enter key mentioned here is a special key prepared in some other keyboards, unlike this. It may be called as a send key. It seems the main cause of this trouble that this confusion occurred in the implementation of IRIX. Q3-14. Although compiled on BSD on Windows 1.5, it is regarded as FreeBSD, so that a kanji code is set to EUC-JP instead of Shift JIS. A3-14. Because there is a trouble in the installer of BSD on Windows 1.5, which an identifier due to be pre-defined is not defined. You should copy the following file. source:("X" is the drive letter where BOW CD-ROM exists) /dfs/X/usr/local/lib/gcc-lib/i386--freebsd/2.6/specs destination: /usr/local/lib/gcc-lib/i386--freebsd/2.6.2/specs Q3-15. I've got a FDclone circulated as binary, but it is not work well. A3-15. It is a rule to prepare the circulation manager for binary circulation, in FDclone Ver. 1.03 or later. When you execute such a binary, the version number in a title line must suffix the character of `#'. The author guarantees no warranty for the binary without this display. The binary with this display will show an address of the circulation manager on the function line of a help screen, so that try to push `?'. When some trouble has occurred about a circulated binary, you should contact with simultaneously not only the author but also this circulation manager. Q3-16. I'm a MS-DOS user without compile environment. A3-16. You can get a executable binary package compiled by LSI C-86 3.5 from the following URL. And this URL will provide you the package to compile them automatically with DJGPP. (Sorry, this URL page is written by Japanese only.) http://hp.vector.co.jp/authors/VA012337/soft/fd/ Q3-17. A screen is too broken to operate anything on MS-DOS version. A3-17. Is ANSI.SYS set up? A general MS-DOS screen except the MS-DOS prompt on Windows can never work terminal I/O exactly, unless ANSI.SYS is set up. Since the startup disk of Windows95 has also no ANSI.SYS, you should set it up manually by rewriting CONFIG.SYS. Don't forget to prepare ANSI.SYS itself. For example, in the case of Windows95, it exists in the directory pointed out by the environment variable WINDIR. In the case of WindowsNT/2000, you should add "devicehigh=%SystemRoot%\system32\ansi.sys" in \WINNT\SYSTEM32\CONFIG.NT. (ANSI.SYS is not necessary, in Ver. 2.01 or later.) Q3-18. On Fujitsu UXP/DS, I cannot refer to a tar file by the archive browser. A3-18. Since tar on UXP/DS is special in the output form about the file mode, you cannot use an archive browser format for the other SVR4 type OS. The format hardcoded by the default can treat this special output form, but you should describe with care in the format when writing to .fd2rc etc. manually. Moreover, on UXP/DS V10, the output of tar is token out to stderr instead of stdout. For this reason, you have to order redirection as "2>&1" in .fd2rc etc. Both samples are prepared in _fdrc. Q3-19. On MS-DOS, the special key inputted for the first time after startup is ignored. A3-19. Some of SMARTDRV.EXE which is included MS-DOS made by NEC, seems specified to hook the keyboard BIOS and intercept an input character. I don't know this reason. This intercepted key input is returned to the key buffer for MS-DOS after a certain processing. Since this key buffer is invisible when the keyboard BIOS is used, the key input will be thrown away. Although this key input can naturally also be read if using only MS-DOS function call, MS-DOS made by NEC is specified that a cursor key cannot be got unless the keyboard BIOS is used. Then, I prepared in 1.03h the technique to get key input with MS-DOS function call, referring to the work memory for the keyboard BIOS. Although this technique is effective only on PC-9800 series, if this condition occurs in another environment, you can add the following line to the head of term.c, to recompile. #define NOTUSEBIOS Q3-20. On MS-DOS, I don't want to use Long File Name. How can I do? A3-20. If a capital letter is used like "C:\" as a drive letter of the object directory name, it comes to use Short File Name forcibly. Or it is one way to disguise the version of OS and pretend that OS is before MS-DOS 7.0 (MS-DOS included in Windows95) which supports LFN. You can drive it to answer an old version to FDclone, using SETVER.EXE included OS like the following. setver fd.exe 6.2 But, you must note that the effect of SETVER.EXE will not be taken unless you describe the following line in CONFIG.SYS and reboot OS. DEVICE=[drive:][path]SETVER.EXE Q3-21. On PC-UNIX, I've used a MS-DOS filesystem with mounting, which doesn't accord with the contents seen by the floppy drive. A3-21. It is generally forbidden to access a single medium with multiple ways, so that you must not use the floppy drive function to the mounted disk. It is a general solution to use after "umount", or to give up using the floppy drive function. When you want to use simultaneously in the knowledge of danger, I write about the details of these situation on #9 of TECHKNOW.eng, so you can refer to it. Q3-22. On Solaris, when I am going to use the floppy drive, to be unable to access with a message as "Device busy.". A3-22. Doesn't vold (Volume Management daemon) work? Since this daemon automatically use a floppy disk device, FDclone try to use it, and cannot access because already under use. You can edit /etc/vold.conf to delete all the lines including the string "floppy", and reboot. Or the same effect is taken by sending SIGHUP to running vold instead of rebooting. However, this configuration will make some of standard floppy disk control commands unavailable. Moreover, if you are going to substitute /dev/rfd0a because /dev/rfd0c is unavailable owing to vold, the last cylinder of a floppy disk will be unable to access. Don't use rfd0a. Q3-23. On PC-DOS (IBM-DOS), strange characters sometimes appear in screen, like as ">5h" or ">5l". A3-23. PC-DOS (IBM-DOS) standard ANSI.SYS is inferior to MS-DOS one in some functions, to display the invalid sequence as it is. PANSI.SYS, the ANSI.SYS emulator equivalent to MS-DOS one, has been released, you should better use it instead of standard ANSI.SYS. http://hp.vector.co.jp/authors/VA003655/en/down.html (ANSI.SYS is not necessary, in Ver. 2.01 or later.) <4.Specification Problem> Q4-01. Can't I save the history of a pathname? A4-01. Although I added the pathname history in Ver. 1.03, this is not the history of input lines but the history of directories operated by commands. Because of its feature, it should not be carried over to the next FDclone execution, and occurs troublesome problems such as management of a save file, the pathname history has been made into the specification not to save. (You can set up to save the history of a pathname with the internal variables (or the environment variables) SAVEDIRHIST and DIRHISTFILE, in Ver. 2.09 or later.) Q4-02. Value by INFO_SYSTEM command may sometimes become "?". A4-02. There is the case that it cannot get any file system information by the specification of OS. In this case it displays as "?", but, since it has been so on the convenience of OS, there is no way to manage for FDclone. Q4-03. Can I mark also a directory? A4-03. If allowed to mark a directory, a damage when the user has been mistaken in operation will be large. As a safe policy, it is forbidden to mark a directory. In addition, it must be such specification also by the original "FD". Q4-04. When I chose "*" as a lookup string, the file which starts with `.' will be excepted. A4-04. UNIX shell is implemented not to match the file starts with `.' to the wildcard pattern "*". FDclone also follows this specification. Incidentally, it can generally make the file starts with `.' match to lookup with the string ".??*". Moreover, you should confirm whether if you make the file starts with `.' invisible, using DOTFILE_MODE command. Q4-05. When I upgrade to Ver. 2.00, configuration completely has changed from the previous. A4-05. In Ver. 2.00, a great specification change was given to the form of the internal command which is used in EXECUTE_SH and .fd2rc. You cannot use .fdrc of Ver. 1.03 or before as it is, and should rewrite referring to man page or _fdrc.dif etc. Q4-06. I found a bug. A4-06. Please report the following address via E-mail. If I find the solution, will fix the bug on the next version. Q4-07. When sorted, only directories always come previous. Q4-08. When in the tree screen, even if I set up to sort a current directory always comes to a head. A4-07. A4-08. It is made such specification. Q4-09. Although I set up to display Japanese both in compile and in execution, some English error messages are displayed. A4-09. Among the error messages output, the one in connection with the fundamental part of OS, e.g. filesystem etc., uses the error string in the library prepared by OS. Therefore, when OS supports Japanese, conversely, any Japanese error messages may be displayed even if you set up to display English. This error message is quite closely related to the function specification of OS, and message specification differs with OS in details. For this reason, it is very difficult to predict possible errors in advance and to prepare the error messages correspondent to them. Then, an original error message is prepared only about the error which can be enough predicted, and the other error messages use established one, in its specification. In addition, it seems that the details of each error message can be referred to by "man 2 intro", in many cases. Q4-10. The contents of a ejected floppy disk are not updated even if it is written in the floppy drive. A4-10. Since the floppy drive function uses caches, a floppy disk may not actually be written immediately after accessing to write. You can execute REREAD_DIR command on the screen you are looking at the floppy drive, to forced flushing caches, thereby, it is actually written. Or also moving to directories other than the floppy drive can make it written actually. You should not eject a floppy disk until it is actually written. Q4-11. I have used the shell which can treat the logical directory described by symbolic links. While I invoke FDclone on the directory with symbolic links, the displayed pathname has indicated the physical directory. A4-11. It is the first thing you should understand that the function treating the logical directory is particular to each shell and is not general function over UNIX world. Any processes invokes from a shell cannot get a pathname of the logical directory held by the shell from other than the shell itself. Some shells will hold a pathname of the logical directory with PWD the shell variable, so that you can give it as the environment variable to FDclone who is a child process in order to tell this information. In this case, you can describe `[ -d "$PWD" ] && cd $PWD' in .fd2rc and so on to change the current directory when invoked to the directory explicitly specified by PWD the environment variable, and then the displayed pathname will be logical one. (The logical directory held with PWD will be refered automatically without this description, in Ver. 2.04 or later.) By the way, referring to each shell, Bourne shell and ash cannot treat any logical directories. Korn shell and bash can treat the logical directory and hold its pathname with PWD the shell variable. zsh and tcsh export PWD as the environment variable by default. The history of csh is confusing. The original csh written by Bill Joy cannot treat the logical directory nor have PWD as the shell variable. The csh rewritten in 4.3BSD Net/2 and after this can treat the logical directory and export the pathname as PWD the environment variable. <5.Others> Q5-01. I've lost the source. A5-01. It is confirmed that it exists in the following URL at present. You can get it from there. http://hp.vector.co.jp/authors/VA012337/soft/fd/ ftp://ftp.unixusers.net/src/fdclone/ ftp://ftp.vector.co.jp/pack/unix/util/file/filer/fd/ Q5-02. I have a question which has not appeared in FAQ. A5-02. Really? Over 90% of question mails brought after FDclone release is indicated by the included documents, and the most of them was the question as it is in this FAQ. It is not bad to ask others what you don't know, but doing it yourself as possible is the mutual-aid spirit supporting the Internet. You should better read documents over once again before writing a question mail. And if you have something that you cannot understand anyway, please send me a question mail unreservedly. FD-3.01j/TECHKNOW.eng100644 2105 1751 163241 13516612560 12645 0ustar shiraiuser[TECHNICAL KNOWHOW ABOUT FDCLONE3] 1.Identifiers for Machine Dependency In machine.h, or config.h built by "make config", the various identifiers are defined. These identifiers are established to merge the differences from each OS. If you cannot compile successfully or find some strange behaviors, you can define/undefine these identifiers to modify it. The following is the meaning of each identifier. SYSV SVR4 BSD4 BSD43 This indicates the oriented type of OS. SYSV, SVR4 is referred in the latter part of machine.h for the definition unique with OS. BSD4, BSD43 is defined only as an information, not to be referred in actual sources. OSTYPE This indicates the OS name. It is used to setup the floppy drive in the default value, according to each OS. CODEEUC This means to use EUC-JP (Extended Unix Code) as the Kanji code. If undefined, it means Shift JIS is used. This concerns the man page after installation, and the default value when you don't define the Kanji code, and so on. You can dynamically change the Kanji code used in input/output and filename, after compiled. DEFKCODE This specifies the string which indicates Kanji code used as the OS standard. If defined, it is used as the default value of each internal variables for Kanji code. UTF8DOC This means to use UTF-8 as the Kanji code of documents. If undefined, it follows the definition of CODEEUC. You can also define the value of DEFKCODE as 'utf8-mac' or 'utf8-iconv', which specified the UNICODE mapping. UTF8LANG This specifies the string which indicates Kanji code used as the OS standard and Kanji code of documents, if the environment variable LANG includes "UTF". It will be meaningless in case that LANG does not include "UTF". NOMULTIKANJI It is not necessary to consider the environment which has multiple Kanji codes. PATHNOCASE System calls ignore case for any filename. COMMNOCASE Shell ignore case for any shell command name. ENVNOCASE System calls ignore case for any environment variable. NOUID Neither user ID nor group ID don't exist. NODIRLOOP Any directory structure can never loop. NOSYMLINK Symbolic link system is not implemented. BSPATHDELIM The path delimiter is a backslash character. USECRNL The character who indicates end of line is CR-NL. CWDINPATH The current work directory is always included in the command search path implicitly. DOUBLESLASH The pathname which starts with // (or \\) is allowed as the some special pathname (e.g. the shared folder on Cygwin). USEMANLANG The search pathname referred to man(1) includes the string shown by the environment variable LANG, such as '/usr/man/ja_JP.SJIS/', to support M17N. LANGWIDTH In case that USEMANLANG is defined, this specifies width of the string included by the search pathname of man(1) from the beginning of the string shown by the environment valiable LANG. It will be 2 or 5 letters with the standard NLS (Native Language System). USEDATADIR fd-unicd.tbl, which is the translation table for UNICODE, and fd-dict.tbl, which is the Kana-Kanji translation table for the Japanese input method editor, are not placed on the same directory as the executable binary of fd, but on the directory which is specified by DATADIR in Makefile.in. SUPPORTSJIS cc(1) or man(1) supports Shift JIS perfectly. Even for the Kanji whose second byte is '\', this '\' is not treated as a meta character. BSDINSTALL The BSD-like install(1) is installed on the standard command search path, and can use the option -c (copy) and -s (strip). BSDINSTCMD If the command name of the BSD-like install(1) is not "install", you can define that command name. It will be meaningless in case that BSDINSTALL is not defined. TARUSESPACE tar(1) with t option will output the list in which each file mode string (Ex:rw-rw-rw-) is always followed by spaces. In the BSDish OS, it seems usually followed by not spaces but UID/GID. In the GNU tar, it is followed by spaces. Even if you are wrong to define, the description of .fd2rc and /etc/fd2rc can change it dynamically. TARFROMPAX The implementation of tar(1) comes from pax(1), and the output of -t option follows the format used by pax(1). Even if you are wrong to define, the description of .fd2rc and /etc/fd2rc can change it dynamically. BUGGYMAKE make(1) cannot evaluate correctly a time relationship between the files created continuously within 1 second. CPP7BIT cpp(1) cannot pass through any 8bit character, such as the Kanji. OLDARGINT cc(1) treats any old-fashioned argument as integer. CCCOMMAND This indicates the fullpath of the C compiler which you want to use as standard. In some OS, both of BSD version cc and SYSV version cc exists at once, you should choose only one. If undefined, 'cc' is used. EXTENDCCOPT This indicates the option gave to cc(1). If undefined, "-O" is assigned. In case it cannot support "-O" (Optimize), you should define null. CCOUTOPT This indicates the option to give cc(1) the output filename, when it only compile and don't link (with -c option). This must include the make(1) macro for output filename. You must define this, when you don't need the default value "-o $@". CCLNKOPT This indicates the option to give cc(1) the output filename, when it links the executable file (without -c option). This must include the make(1) macro for output filename. You must define this, when you don't need the default value "-o $@". USETERMINFO The terminfo(5) library is used as the terminal database instead of the termcap(5) library. TERMCAPLIB This indicates the library which is need to be link as the termcap(5) library. If undefined, -ltermcap is assigned. REGEXPLIB This indicates the library which is need to be link as the regular expression library, if need. SOCKETLIB This indicates the libraries which are need to be link as the socket libraries, if need. EXTENDLIB This indicates the other library which is need to be link, if need. UNKNOWNFS The OS adopts the filesystem except to be assumed by FDclone. Or, you should define this for security, when the directory writing function don't work successfully. Refer to the #2 for details. NOFILEMACRO cc(1) cannot evaluate the macro __FILE__. NOFUNCMACRO cc(1) cannot evaluate the macro __FUNCTION__. NOLINEMACRO cc(1) cannot evaluate the macro __LINE__. FORCEDSTDC Although __STDC__ is not pre-defined, the compiler requires the ANSI standard C format in the prototype declaration and so on. If you trust it is based on ANSI, it is no problem to define this unconditionally. STRICTSTDC The compiler has the strict ANSI standard C specifications not to allow the coexistence of the modern type prototype declaration and the classical type function declaration of K&R. You should define this, when there are a number of errors concerned the type of function argument. NOSTDC Although __STDC__ is pre-defined, the compiler expects the classical C language specifications of K&R. NOCONST Although __STDC__ is pre-defined, the compiler does not support the "const" qualifier. NOVOID The "void" type cannot be used. NOUINT The "u_int" type cannot be used. NOLONGLONG The "long long" type cannot be used. HAVELONGLONG The "long long" type is supported. NOUID_T uid_t, gid_t is not defined in USEPID_T fork(2) and wait(2) treat a prosess ID as a type of pid_t. DECLSIGLIST The global variable sys_siglist[] is declared in , not to need to declare again in the source list. NOSIGLIST The global variable sys_siglist[] don't exist in the standard library. DECLERRLIST The global variable sys_siglist[] is declared in or , not to need to declare again in the source list. PWNEEDERROR Linking /lib/libPW.a requires to prepare the global variable Error[] in the source, NOERRNO The global variable errno is not declared in . NOFILEMODE The constant S_IRUSR, S_IWUSR, etc. are not declared in . NOUNISTDH don't exist. NOSTDLIBH don't exist. NOTZFILEH don't exist. USELEAPCNT The structure tzhead has the member tzh_leapcnt. USESELECTH The structure fd_set which is needed when use the function select(2) is defined in . USESYSDIRH The constant DEV_BSIZE which indicates the block of the directory file is defined in . USETIMEH The structure tm is not defined in nor , to require . USESTDARGH The type va_list for variable argument is defined in . USEMKDEVH The macro (or function) major()/minor() for the device number is defined . USEMKNODH The macro (or function) major()/minor() for the device number is defined . USELOCKFH The constants which indicate the commands for the function lockf(2) to lock files is defined in . USETERMIO The structure termio is used as the terminal interface. USETERMIOS The structure termios is used as the terminal interface. If both USETERMIO and USETERMIOS is undefined, the structure sgttyb is used. HAVECLINE The structure termios has the member c_line. USEDEVPTMX The device file /dev/ptmx and /dev/pts/? are used for the pseudo terminal. USEDEVPTY The device file /dev/ptyXX and /dev/ttyXX are used for the pseudo terminal. USEDIRECT The structure direct is used instead of dirent. SYSVDIRENT The structure dirent doesn't have the member d_fileno and has the member d_ino. NODNAMLEN The structure dirent doesn't have the member d_namlen. NODRECLEN The structure dirent doesn't have the member d_reclen. It has the member d_fd instead. DNAMESIZE The size of tha member d_name of the structure dirent. HAVETIMEZONE The global variable timezone indicates the offset value from GMT. NOTMGMTOFF The structure tm doesn't have the member tm_gmtoff. NOSTBLKSIZE The structure stat doesn't have the member st_blksize. NOFLAGS The structure stat has the member st_flags, which is not supported actually. NOFTPH don't exist. USEINSYSTMH is needed for . NOHADDRLIST The structure hostent doesn't have the member h_addr_list. (The following 5 identifiers is exclusive. These can not be defined simultaneously.) USESTATVFSH The functions declared in is used to get the filesystem information. USESTATFSH The functions declared in is used to get the filesystem information. USEVFSH The functions declared in is used to get the filesystem information. USEMOUNTH The functions declared in is used to get the filesystem information. USEFSDATA The functions using the structure fs_data is used to get the filesystem information. USEFFSIZE The structure statfs has the member f_fsize, which indicates the block size of the filesystem. If undefined, member f_bsize is referred. In case that USESTATVFSH, USEFSDATA is defined, this is meaningless. NOFBLOCKS The structure statfs doesn't have the member f_blocks. NOFBFREE The structure statfs doesn't have the member f_bfree. NOFFILES The structure statfs doesn't have the member f_files. USESTATVFS_T The structure statvfs_t is used instead of statvfs. STATFSARGS This indicates the number of arguments used by function statfs(2). In case that USESTATVFSH, USEFSDATA is defined, this is meaningless. USEFSTATFS The function statfs(2) is unavailable to get the filesystem information, and fstatfs(2) is used instead. (The following 10 identifiers is exclusive. These can not be defined simultaneously.) USEMNTENTH The functions declared in is used to get the mount information. USEMNTTABH The functions declared in is used to get the mount information. USEGETFSSTAT The function getfsstat(2) is used to get the mount information. USEGETVFSTAT The function getvfsstat(2) is used to get the mount information. USEMNTCTL The function mntctl(3) is used to get the mount information. USEMNTINFOR The function getmntinfo_r(3) is used to get the mount information. USEMNTINFO The function getmntinfo(3) is used to get the mount information. USEGETMNT The function getmnt(3) is used to get the mount information. USEGETFSENT The function getfsent(3) is used to get the mount information. (This method can get only the information before mount, not to be recommended. Suppose that it is a last resort.) USEREADMTAB /etc/mtab is read directly to get the mount information. USEPROCMNT The file /proc/mounts is used as the mount information file. (This method can get only the information from kernel, instead of mount(8), not to be recommended. Suppose that it is a last resort.) HAVEPROCMNT The file /proc/mounts is used as the mount information file only if /etc/mtab does not exist. (The following 2 identifiers is exclusive. These can not be defined simultaneously. In case that the identifier except USEMNTINFO is defined among the above 8 choices, this is meaningless.) USEVFCNAME The structure vfsconf has the member vfc_name, which indicates the string to mean the mount type. And, getvfsbytype() is used to get the type vfsconf. USEFFSTYPE The structure statfs has the member f_fdtypename, which indicates the string to mean the mount type. (The following 3 identifiers is exclusive. These can not be defined simultaneously.) USERE_COMP The function re_comp(3) is used to search the regular expression. USEREGCOMP The function regcomp(3) is used to search the regular expression. USEREGCMP The function regcmp(3) is used to search the regular expression. USERAND48 The function for random number generator is not random(3) but rand48(3). USESETENV The function setenv(3) is available to set the environ variables. NOSELECT The function select(2) is unavailable for the low level input/output. DEFFDSETSIZE The function select(2) needs the FD_SETSIZE identifier to be pre-defined as the maximum number of openable files. SELECTRWONLY The function select(2) cannot respond the file descriptor opened as read/write. NOVSPRINTF The function vsprintf(3) is unavailable for the formatted output. NOTERMVAR The termcap(5) library has not the global variables; PC, ospeed, BC and UP. USEUTIME The function utimes(2) is unavailable to set the timestamp, and utime(3) is used instead. USEGETWD The function getcwd(3) is unavailable to get the current directory, and getwd(3) is used instead. ULONGIOCTL The second argument of the I/O control function inctl(2) must be the type of unsigned long. NOFTRUNCATE The function ftruncate(2) is unavailable to resize files. USEFCNTLOCK The function fnctl(2) is used instead of flock(2) to lock files. USELOCKF The function flock(2) is unavailable to lock files, and lockf(2) is used instead. NOFLOCK Both of the function flock(2) and lockf(2) are unavailable to lock files. NOSYSLOG The function syslog(3) is unavailable for system logger. USETIMELOCAL The function timelocal(3) is available as the inverse function of localtime(3) for the time conversion. USEMKTIME The function mktime(3) is used instead of timelocal(3) for the time conversion. USESYSCONF The function sysconf(3) is used to get the system configurations. USELLSEEK The function _llseek(2) is used instead of lseek(2) for the file control. In the 32bit Linux environment, lseek(2) cannot specify the offset value over 2^32 bytes, so that _llseek(2) is necessary. USEUNAME The function uname(2) is used instead of gethostname(2) to get the hostname. NOKILLPG The function killpg(2) is unavailable to manage the process group. USEWAITPID The function waitpid(2) is used instead of wait3(2) to wait the software signals. USESIGACTION The function sigaction(2) is used instead of signal(2) to control the signals. USESIGPMASK The function sigprocmask(2) is used instead of sigsetmask(2) to control the signals. NODTABLESIZE The function getdtablesize(2) is unavailable to get the descriptor size. USERESOURCEH The functions declared in is used to get/set the resource information. USEULIMITH The functions declared in is used to get/set the resource information. USEGETRUSAGE The function getrusage(2) is used to get the process time information. USETIMES The function times(2) is used to get the process time information. GETPGRPVOID The function getpgrp(2) has no argument, to get the process group. USESETPGID The function setpgid(2) is used instead of setpgrp(2) to set the process group. NOSETPGRP The function setpgrp(2) is not available to set the process group. USETCGETPGRP The function tcgetpgrp(3)/tcsetpgrp(3) is used instead of ioctl(2) to get/set the control terminal. USESETVBUF The function setvbuf(3) is used instead of setlinebuf(3) to buffer the stream. SIGARGINT The second argument of the software signal function signal(3) must be the pointer to the function which returns the type int. SIGFNCINT The second argument of the software signal function signal(3) must be the pointer to the function which has the argument of the type int. USESTRERROR The function strerror(3) is used instead of sys_errlist[] to get error messages. GETTODARGS This indicates the number of arguments used by the time-getting function gettimeofday(3). The default value is 2. GETTODNULL The second argument of the time-getting function gettimeofday(3) must be NULL. USESETSID The function setsid(2) can be used to control session. USEMMAP The function mmap(2) can be used to map files. NOGETPASS The function getpass(3) is not avaliable to input password. USESOCKLEN The third argument of the socket function bind(2)/ connect(2)/accept(2) must be the type socklen_t. NOSENDFLAGS The fourth argument of the socket function send(2) cannot be specified as flags. USEINETATON The function inet_aton(3) is used instead of inet_addr(3) to manipulate the Internet address. USEINETPTON The function inet_pton(3) is used instead of inet_addr(3) to manipulate the Internet address. NOGETPWENT The function getpwent(3) is not available to get the user ID. NOGETGRENT The function getgrent(3) is not available to get the group ID. USESETREUID The function setreuid(2) is used instead of geteuid(2) to set the user ID. USESETRESUID The function setresuid(2) is used instead of geteuid(2) to set the user ID. USESETREGID The function setregid(2) is used instead of getegid(2) to set the group ID. USESETRESGID The function setresgid(2) is used instead of getegid(2) to set the group ID. USEGETGROUPS The function getgroups(2) is used to get the group access list. SENSEPERSEC This indicates the number to sense the key input per second. It is suitable in case that the terminal communication speed is slow. The default value is 50 per second. WAITKEYPAD This indicates the time to wait after getting the inputted keycode of ESC. It is suitable in case that the terminal communication speed is slow. The default value is 360ms. WAITTERMINAL This indicates the time to wait for each characters in the escape sequence received from the terminal. It is suitable in case that the terminal response is slow. The default value is inherited from the value of WAITKEYPAD. WAITKANJI This indicates the time to wait the next keycode while some multi-byte character is inputted. It is suitable in case that the terminal communication speed is slow. The default value is 120ms. HDDMOUNT This causes the floppy drive function to support the hard disk drive. It will be defined in case that you want this function on the environment except PC-UNIX. 2.Directory Writing Function The command WRITE_DIR (w) can write the directory entry to the file system according to the displayed order. But, this function is only established by analyzing the structure and behavior of the file system on the each OS, so that the directory writing function is unavailable in the unanalyzed file systems. The string which means the file system type is referred from the mount information of the each file system, to judge whether if the analyzed file system or not. The following file systems are supported in FDclone about the directory writing function. 4.3 NEWS-OS 3,4.x 4.2 SunOS 4.x ufs SVR4, OSF/1, FreeBSD, NetBSD ffs NetBSD, OpenBSD hfs HP-UX, HI-UX ext2 Linux ext3 Linux jfs AIX efs IRIX (SGI original spec.) sysv SVR3 (SystemV Rel.3 spec.) dg/ux DG/UX (SystemV Rel.3 spec.) In the file system type except these, unfortunately, the directory writing function is unavailable. More correctly, although it is possible that the directory writing function is available in the file system except the above, this function is invalidated for security because it is not confirmed. If you are an explorer and regret that the directory writing function is unavailable in your own file system, I suggest trying to rewrite writablefs() in info.c. Writing is possibly successful, or fail to make a mess of the directory contents. If you are a heavier explorer, you should maybe analyze the structure of the file system at your hand, and change the directory writing algorithm itself. If these changes can add to the supported object of the directory writing function, let the author know please. It will be reflected in the next release. On the other hand, although the directory writing function should be available in your file system type, this function sometimes doesn't work well because of affairs from OS. For example, in case of ext2/ext3 file systems, dir_index option will make the directory writing function ineffective. It is because of tune2fs(8). Or, some OS may be unable to write directory in any file system. In that case, you should defile UNKNOWNFS in compiling, to give top priority to safety. (Appendix) The directory writing algorithm 1.A temporary directory (assumed TMP) is made in the current directory. At this time, the file name of TMP must be as long as the file name of the file which will be placed ahead. 2.It is confirmed if TMP is physically ahead in the directory entry. 3.The all file but TMP (including directories) is moved under TMP. 4.If it is not ahead at 2., the name of TMP is renamed, to guarantee that TMP is ahead in this entry. 5.The files in TMP is move back in sorted order. But, the only file which should be ahead is remained. 6.Considering the block size of the directory, if a gap has made on the block boundary, the dummy file which has a short name is created to fill the gap. 7.After moving files, the name of TMP is renamed. As a result, TMP is placed at the tail of entries, and the space is placed at the head of entries. 8.The file which should be ahead is moved back from TMP. 9.TMP and the dummy files created at 6. is removed. 10.Finished. Notes) This is not accessing the directory file directly, it needs quite long time with some directory size. 3.File System Information At the beta test, it was the most difficulty how to get the file system information which is different in every OS. Generally classifying, the kinds of prepared methods are 5 kinds about the file system information, and 8 kinds of method about the mount information. Some OS can support multiple methods among these. When OS prepares multiple methods, there is a difficult problem which is used among them. Because some choice of method will cause any trouble in the OS. The priority generally should maybe be taken to the order enumerated in 1., but some OS may seems this priority is not quite right. Finally, you should try the all possible method, to choose the most suitable one among them after implementation. If you cannot even compile it, it is a quite mistaken choice. If you succeeds to compile it, try to the command INFO_FILESYS (i) to the various directory path. The output of the command INFO_FILESYS is almost the same as the output of df(1). If the obviously strange value is output considering a rounding error, it may be a mistaken choice. The abnormal output value caused by mistaken choice seems to result from 2 reasons. 1.mistake the mount point. 2.mistake to get the file system information. If the items of "File system" and "Mount point" in output informations are not right, try to change the choice about the method to get the mount information. Or, while these items are right, when the capacity is not right, try to change the choice about the file system information. In the worst case, any choice may not be able to cause the right output. In this case, you cannot but abandon. But, though this output is wrong, these mistaken informations is not connected with any fatal faults in FDclone. Since these are used only in the command INFO_FILESYS, there is no problem as long as this command is not used. However, any OS must prepare the right method to get these informations. If you know it, it is possible to implement the method on FDclone. Then if you find the method, please let the author know. It is reflected in the next release. 4.Key Code The input from the keyboard is generally received as an ASCII code which indicates the key top character, in case of the normal key. But, the keyboard sends some sequence beginning with ESC, in case of the special key. In order to correctly distinguish these sequences and the ESC input itself, FDclone waits for 360ms after the ESC code is received, and regards it as the input of ESC itself when no input code follows it. However, this value is experimental value at the environment around the author, and don't have any absolute reason. If this value is not suitable in some environment, you should try to define the value of WAITKEYPAD in machine.h as some larger value. Moreover, it refers to descriptions in termcap/terminfo as the correspondence table of the key sequence and the actual key. If the key has no description, the keymap in the VT100 compatible terminal is used as default value. If this correspondence doesn't match with the actual sending code of the keyboard, getting the key will be impossible. In that case, I recommend you to change rightly the registration of termcap/terminfo. 5.Registration of Archive Browser When you newly register an archive browser, you must describe a format string in .fd2rc etc. I refer to the example which is not mentioned in the manual, in this sentence. The format string is as follows. "%n %n %n ... " top bottom Most of the archivers seems to be able to avoid top and bottom, both of these values will be 0. If the both are 0, you can skip these descriptions. Only if the excessive lines, such as a copyright, are displayed in addition to the archive file information, you must specify the number of lines from the top/bottom line, which is to be deleted. You can also specify lines to be deleted as a pattern with -i option, and specify error message lines with -e option to treat their contents as an error. The string showing the format is so similar to the format of printf(3) and scanf(3) that who is familiar with the C language will not be very puzzled. It is perplexing that each field is not separated by spaces nor tabs. Some archivers display the independent informations continuously. The next example is from the BSDish tar. rw-r--r--9999/999 17531 Aug 7 11:50 1995 main.c There is no separator between the first string showing the file mode and the next string showing the user ID. In this case, you must specify the length of sequence showing the file mode. In this example, it is the length of 9 letters, so that you can specify as "%9a". Therefore, the whole format string is as follows. "%9a %u/%g %s %m %d %t %y %*f" You can see a space after "%9a" in this example, a space matches 0 or more spaces or tabs, then this format string can also match the output which has no space such as the above example. If the format string does not have this space, it cannot skip any space on the output. BSDish tar will insert some spaces before the user ID whose digits are less than 3, then the inserted spaces will be treated as a part of the field for the following "%u". The behavior for the field with some spaces and tabs will differ with the type of field. Some types of field cannot allow any spaces in the field. They will be ignored in the needless field. In the field specifying a filename, spaces at the end of line will be ignored and the rest spaces are regarded as a part of the filename. In the other field, only the spaces at the front or end of field will be ignored, but the format string will be inferior when there are the other candidates of format string. By the way, the length of field for a filename is specified as "to the end of line" in this example, then whole string to the end of line with spaces and tabs will be regarded as a filename. By the way, some archivers cannot display a year nor a time, or use a field as these double purpose. The following is the example of output by LHa. drwxr-xr-x 9999/999 0 ****** Jun 8 12:04 demo/ -rw-r--r-- 9999/999 49 100.0% Dec 8 1994 demo/Makefile Thus, the time field and the year field are used as the same field, there is no time information in the file which has an old timestamp. In that case, you should specify with { } as the year information and the time information share the same field, being ready for the strange display of the archive browser. Then, the year is displayed as 2012 in the former example, and the time is displayed as 0:00 (Because the hour called 1994 cannot exist.) in the latter example. The following is the format string in this case. "%a %u/%g %s %x %m %d %{yt} %*f" Since the outputs of archivers are different from each other according to your environment, you should register multiple format strings to use generally in every environment. While some different format strings are prepared by default for some archivers which are used rather popularly like as tar and LHa, you should analyze and register them by yourself for archivers except them. But you should be careful with the order of description, because the multiple registered format strings will be compared in order of description. For example, the format string which regards a whole line as a filename, such as "%*f", will match any output line, then the format strings described after this are never used as candidates to be compared. 6.Registration of Floppy Drive If you want to treat the MS-DOS floppy disk like as general file systems, in the floppy disk drive as the attachment of your system, you must register the drive in .fd2rc etc. For this registration, it is necessary that the driver for the floppy disk drive is installed in your OS, and that the interface as a special file to access the driver. Depending on OS, this detail is often referred in the manual of fd(4). Generally, some formats are supported in one physical drive. These formats may be automatically identified, or may be classified by the name of special file. In the former case, you can describe the same special file name as the item of device file in the drive registration line, and each format is distinguished with parameters for the format. In the latter case, you must describe the special file name according to each format for the same drive. In addition, you had better describe the raw device as the device file, if possible. The following is examples for the inside drive of the SPARC systems and NWS-4300 series. SPARC: A: "/dev/rfd0c" 2 18 80 (1440KB 2HD) A: "/dev/rfd0c" 2 9 80 (720KB 2DD) A: "/dev/rfd0c" 2 108 80 (640KB 2DD) NWS-3400: A: "/dev/rfd00a" 2 18 80 (1440KB 2HD) A: "/dev/rfd01a" 2 9 80 (720KB 2DD) A: "/dev/rfd03a" 2 8 80 (640KB 2DD) These configurations depend on machines and structures even if they have the same OS, so that had better be set in the common configuration file rather than in the builtin setting when compiled. Conversely, if it is the only machine which may use the compiled binary of FDclone, it is available to compile as builtin setting. If you want to compile as builtin setting, you should change the value of the structure array fdtype in dosdisk.c. The set up factor is the same as the registration in .fd2rc etc. But, the drive name is described as not the string like "A:" but an alphabetical letter. And it must be capital. It is quite depend on OS and models which special file indicates what format of which drive, so that you should refer the OS manual or ask each maker directly. Though the configurations for the inside drive on standard models will be builtin with the distributed package, you can change it in judgment of a person who install. Moreover, the convert from the restriction on MS-DOS filenames keep the following rules. This is the same as the specification in BSD on Windows. 1.The part over 8+3 characters in filenames is deleted. 2.The . at the beginning of line or in after the second appearance is changed to $. 3.Any + is changed to `. 4.Any , is changed to '. 5.Any [ is changed to &. When you look the filename in the floppy drive via FDclone, reverse convert of above 2.-5. is done. But, when you specify a small letter as the drive name for the LFN access, this rule is not applied. The SFN generated in creating the new file follows the filename generation rule of Windows 95/98. On PC-UNIX, the hard disk drive can be registered as well as the floppy disk drive. How to register is written in the manual. It is to describe the string "HDD" or "HDD98" instead of the item value of the number of heads, and so on. The special file specified at this time must not be the one separated for each partition (slice), but the one prepared for every physical drive unit. The following is the special file name prepared for every physical drive unit, on the typical PC-UNIX. With after the second unit, the place of '0' or 'a' in the following filename is replaced with the letter after '1' or 'b'. (On Solaris, it means '0' next to 'd') Solaris /dev/rdsk/c0d0p0 (IDE) /dev/rdsk/c0t1d0p0 (SCSI) Linux /dev/hda (IDE) /dev/sda (SCSI) FreeBSD /dev/rwd0 (IDE) /dev/rsd0 (SCSI) or /dev/rad0 (IDE) /dev/rda0 (SCSI) NetBSD /dev/rwd0d (IDE) /dev/rsd0d (SCSI) OpenBSD /dev/rwd0c (IDE) /dev/rsd0c (SCSI) 7.Function It is the same as the function definition of sh(1). For your confirmation, the differences from the function implementation in Ver. 1.x is following. 1.It can be described in separate lines without '\'. 2.It is regarded as the function even if it appears at the beginning of the command line. 3.It can be used with the pipe and the redirectee. 4.It is impossible to use the parameter macro in the argument in the function definition. 1.-3. result from the FDclone shell-izing, as the bad effect, the extension as 4., it is just for FDclone, has been lost. Then, in Ver. 2.00 or later, the builtin command evalmacro is prepared, which can make it possible to use the parameter macro, in the way to execute after evaluating the macro explicitly in the function. I think that the merit from using the parameter macro is mainly to be able to use selected filenames as arguments. For the example which can exercise this ability best, suppose the function which applies some commands to the filenames searched with the wildcard. delete() { MARK_FIND $1 DELETE_FILE } As an example to use, "delete '*.bak'" can delete all files that has the extension ".bak" in the current directory. Note that "*.bak" is evaluated before this argument is given to the function delete, without ''. In this case, the command line argument "*.bak" is substituted for the positional parameter $1, then the 1st line is evaluated into "MARK_FIND *.bak". DELETE_FILE in the 2nd line doesn't need any arguments, and deletes all selected files if exist, then all files selected with "*.bak" at the 1st line are deleted. It is important that, when no filename matches "*.bak" at the 1st line, the object file of DELETE_FILE is not selected and the object is forced to be the file on the cursor position. But, DELETE_FILE requires the confirmation before deleting to let you notice, and it is safe that you place the cursor position, in advance, on the file which is unable to be deleted by DELETE_FILE, for example "..". Incidentally, this function delete behaves the default action of MARK_FIND, i.e. requires to input the wildcard string, so that you can delete files interactively. Now, see a little more complex case. rename() { MARK_ALL 0 MARK_FIND $1 evalmacro mv %%M $2 } This is the function which renames appointed filenames all together. This time it is a little careful to insert clearing marks in the 1st line. In specifications, MARK_FIND will select without clearing existent marks. Although it seems suitable that RENAME_FILE is used for renaming files in the 3rd line, the truth is that it is impossible. Because RENAME_FILE has only the specification to change the filename on the cursor position, doesn't have the ability to rename selected files continuously. Therefore, the UNIX standard command mv(1) is used. For the continuous execution, we don't use the ability of mv(1) but the ability of the parameter macro. This is %M in the 3rd line. Suppose that you input as "rename '*.c' '%XM.c.bak'" from the command line, all files which has the extension ".c" will be replaced the extension ".c.bak". Note that "*.c" and "%XM" is evaluated before this argument is given to the function rename, without ''. In this example, since $1="*.c", $2="%XM.c.bak", the 3rd line is evaluated into "mv %M %XM.c.bak". %M is the parameter macro for which the selected files is substituted one by one, %XM is what is removed the extension from that. "*.c" is selected in the 2nd line, and these selected files is renamed into the form "*.c.bak" in the 3rd line. It is important that the parameter macro "%M" is described as "%%M" in the function definition. In specifications, the parameter macro is not evaluated in the initial configuration file and the input file of the source command as well as inside of the function, so that this description may be "%M". But, when this function definition is executed in the command line of EXECUTE_SH, the parameter macro "%M" is evaluated before the function definition. Therefore, you must specify "%%M" as the string which becomes "%M" after evaluating the parameter macro. The description "'%M'" like the function argument also can leave "%M" unevaluated surely. But it doesn't cause the expected behavior. Since in the function definition "'" is not evaluated, this is defined "'%M'" as it is. When you define the function with EXECUTE_SH, such a troublesome problem is included. You had better define the function in the initial configuration file or the input file of the source command, or in the fdsh (it runs by inputting the null line in EXECUTE_SH.). This method to combine MARK_FIND something reminds us the RISC programming, and seems incomprehensible. But, simply listing commands can be achieved also by the alias. If you intend to use perfectly the ability of just the function, you had better know such a usage. 8.Functional Restriction in Compile In compile, if you define the following identifiers, you can create the executable file in which each function is not implemented. _NOARCHIVE cannot use archive browser _NODOSDRIVE cannot access MS-DOS floppy drive _NOUSELFN cannot use LongFileName (MS-DOS version) _NOTREE cannot use tree screen _NOROCKRIDGE cannot use pseudo RockRidge extension _NOCOMPLETE cannot use filename completion _NOWRITEFS cannot use directory writing _NOEDITMODE cannot use alternative key in edit mode _NOKANJICONV cannot change kanji code dynamically _NOKANJIFCONV cannot change filename kanji code dynamically _NOUNICODE cannot support UNICODE _NOENGMES cannot display English messages _NOJPNMES cannot display Japanese messages _NOCOLOR cannot use color display _NOKEYMAP cannot use builtin command keymap, getkey _NOORIGSHELL cannot use internal shell _NOUSEHASH cannot use hash function for search path _NOORIGGLOB use regular expression library for globbing _NOSPLITWIN cannot use split window _NOPRECEDE cannot use preceding filename display _NOCUSTOMIZE cannot use customizer _NOEXTRACOPY cannot use extra copy _NOBROWSE cannot use browse the builtin command _NOEXTRAMACRO cannot use %T, %M the macro in statements _NOTRADLAYOUT cacnot use the traditional screen layout _NODOSCOMMAND cannot use COMMAND.COM builtins on UNIX _NOEXTRAWIN cannot resize each split window _NOPTY cannot use pseudo terminal _NOEXTRAATTR cannot use extra attribute changing command _NOLOGGING cannot use system logging _NOIME cannot use tiny Input Method Editor _NOCATALOG cannot use message calalog _NODYNAMICLIST cannot avoid limits of each registrations _NOSOCKET cannot use socket networking _NOSOCKREDIR cannot use socket redirections _NOFTP cannot use FTP connections _NOHTTP cannot use HTTP connections _NOUNICDTBL cannot use fd-unicd.tbl (but embed it) _NODICTTBL cannot use fd-dict.tbl (but embed it) If you edit config.hin to add the definition of these identifiers, you can reduce functions to make size small, or you can restrict the function you don't want to used by end users. 9.Synchronizing Floppy Drive on PC-UNIX In the floppy drive function, the cached memory is used for the purpose of fast disk access. When accessing the same place of the disk in succession, it refers to the saved data in the cached memory instead of the actual disk access, in after the 2nd access. Therefore, if any process except FDclone accesses this disk simultaneously, the contents is sometimes different from each other temporarily. Many PC-UNIX prepares the operation which mounts the MS-DOS file system and accesses it directly. The contents which is got with this operation is not synchronized with the contents of the floppy drive. When you write some data into the MS-DOS file system, first it is written in the cached memory of the system, and at the later point in time it is written in the actual disk. Even after written in the actual disk, FDclone cannot know this writing and then will keep referring to the old data while it reads its cache. The contents of cached memory in the file system is affected to the actual disk, by calling the system call sync(2). The contents of the disk is affected to the cached memory of the floppy drive, by re-opening the floppy drive or REREAD_DIR command. And REREAD_DIR command calls sync(2) only when the floppy drive function is used, so that it can synchronize both of them at the same time. When you write some data into the floppy drive, first it is written in the cached memory of FDclone, and at the later point in time it is written in the actual disk. Even after written in the actual disk by the floppy drive, a file system generally accesses the disk with buffering and then will keep referring to the old data in its cached buffer while they exists in it. The contents of cached memory in FDclone is synchronized with the actual disk, by closing the floppy drive or REREAD_DIR command. But the MS-DOS file system doesn't always reload them. In this case, you must do "umount" the MS-DOS file system and re-do "mount" it again after closing the floppy drive or REREAD_DIR command, to surely reload the contents. However, Linux has more problems. It is because Linux has no raw device as specific issue. Except for Linux, if you select the raw device as the device name used in setting the floppy drive function, FDclone can access the device and the actual disk simultaneously. But since Linux has no raw device and the device itself accesses the disk with buffering, this synchronization can never be realized. First, about writing into the floppy drive, both of the buffer written by the floppy drive and the buffer read by the file system are written into the actual disk by calling sync(2). Therefore, while the floppy drive rewrites data again and again, they are always overwritten by the buffer of the file system, not to be affected. In order to avoid it, if the floppy drive has been already mounted as the file system when it is opened, FDclone treats the floppy drive as readonly, on Linux. Next, about reading from the floppy drive, since only root has the permission to realize synchronization, general users can never know the contents of the actual disk. Therefore, if you want to refer to the contents written by the MS-DOS file system from the MS-DOS file system, it is necessary to do "umount" the MS-DOS file system, as well as writing into the floppy drive. But, while the device buffer is canceled by "umount" in the case that the disk is a removable medium like a floppy disk, it is not canceled by "umount" in the case of a fixed medium like a hard disk, in specifications. In order to force it canceled, you cannot help ordering it with the root permission. Opening the floppy drive and REREAD_DIR command call this order to cancel the Linux buffer, only when FDclone is running with the root permission. If you want synchronize in any way on Linux, you should invoke FDclone with the root permission, and use the floppy drive function. But, since the root cause of this synchronization issue is accessing one disk medium in two ways, I think that it is best to avoid by employment of not accessing simultaneously in different ways. While you use the floppy drive function, you should manage to cover it, for example, you do "umount" the corresponding MS-DOS file system in advance, or you take care that the other users or processes may not access it, etc. 10.Browse the Builtin Command The manual describes only specifications then this document will refer to an usage for browse the builtin command with some samples. The basic of browse is invoking browsers recursively, such as invoking a browser first, and invoking the next browser if you select a file, and then... For a simple example, I will introduce the browse which shows the calendar of specified year and month. browse \ 'for i in 0 1 2 3 4 5 6 7 8 9; do echo 200$i; done' \ -f "%f" \ 'for i in 1 2 3 4 5 6 7 8 9 10 11 12; do echo $i; done' \ -f "%f" \ 'cal $1 $2%K' Though each end of line has '\' because of separating each arguments by line for ease to look, these are a command line then should be described in one line. The 1st line is a name of command. The 2nd line is the command macro to display strings from "2000" to "2009" line by line. I don't mention the shell syntax, then you should understand that this description can cause so. The 3rd line is the format for an archive browser. This result outputted by the 2nd line does not include information of timestamp nor file size, so that only "%f" which means a filename is specified. In this description, the browser is built such that lists filenames from "2000" to "2009" and lets you select a file from them. When you select any of file, the next command in the 4th line is executed. This is the command macro to display strings from "1" to "12" line by line. The 5th line is the format for an archive browser as same as above which means to pick up only the item of filename from the outputted result. As a result, the browser is built such that lets you select any of file from "1" to "12". The 6th line executes 'cal' the external command. $1 and $2 the positional parameters hold the filenames selected till now, so that they hold the one from "1" to "12" and the one from "2000" to "2009" respectively. Since no -f option follows this command, in this case, this output is just displayed to screen and it is done. You will not be able to have enough time to read the output if finished at that, then "%K" the macro waits for a key input. In total, this command builds the following browser. 1. The first, you select a year. 2. The next, you select a month. 3. Then it shows the calendar of selected year and month. And now, I will show you more complex example. browse \ 'echo "host1 host2 host3"' \ -f "%f" \ -p 'RHOST=$1; RPATH=' \ 'rsh $RHOST "ls -lag $RPATH"' \ -f "%a %l %u %g %s %m %d %{yt} %*f" \ -i "total *" \ -p 'RPATH=$1; while [ "$#" -gt 2 ]; do shift; RPATH=$1/$RPATH; done' \ -d loop \ 'rcp $RHOST:$RPATH ./${RPATH##*/}' The 1st line is a name of command. The 2nd-4th line is the command macro to display strings "host1", "host2 and "host3" line by line. The 5th line is the format. It is less difference from the above example so far. The -p option in the 6th line works a little specially. Though you could step the next selection when you select any of file, this option orders to execute the command such as "RHOST=$1; RPATH=" before then. This is the command to substitute the selected filename for "RHOST" the internal variable and empty the value of "RPATH" the internal variable. So the next level of command will be executed when you select a file, you may think that it is enough to describe so in it. Yet there are two reasons why I don't so. The one reason is that a loop is occurred, this will be mentioned after. The other reason is no definition of internal variables in the command whose output is used for an archive browser is left later. In general, the shell pipeline with "|" will be executed in a child process, and any values set in a child process will not affect its parent process. Of course, I could build the implementation in which the result output executed in the current process is passed to an archive browser, but I dare to take another specification. You should think as it is. You can step the next selection if you select any of "host?". The command in the 7th line is execute then. The internal variables already set by -p option are used at once. Rsh the external command requires the 1st argument as a remote host name, and the 2nd argument as the command string to be executed on the remote host. The content of "RPATH" is empty, so "ls -lag" will be executed on the selected host. And the format in the 8th line specify the output form of ls. -i option in the 10th line set a value of an internal variable as same as above. Though it looks like confusing, the value of "RPATH" finally becomes ".../$3/$2/$1". Because of the condition such as `[ "$#" -gt 2 ]', it does not include the last positional parameter. Since the last positional parameter holds the filename selected first, it is the host name in this case. The 11th line orders "Execute the same command as the last one instead of stepping the next, if the selected file is a directory". Whenever you select any directory, rsh will be used. As a result, it is repeated that whenever you continue to select directories, the name is added to "RPATH" the internal variable and ls is executed with the content as an argument. Because the loop has occurred in this line, the previous initialization for "RHOST" and "RPATH" must be described in -p option. Meanwhile, how about in case that you select except directories ? Since the loop is not ordered with except directories, you will step the next 12th line. Rcp the external command requires the 1st argument as a source filename, and the 2nd argument as a destination filename. The "hostname:" prefixed to each filename means a file on the remote host. Since the command execution specified by the -p option in the 10th line precedes the execution of the 12th line, "RPATH" the internal variable will hold the fullpath name for the selected file. And the description such as "${RPATH##*/}" extracts the last item of this fullpath name, so that this description means that the selected file on the selected remote host is copied to the current directory on the local machine as the same name. In total, this command builds the following browser. 1. The first, you select a host. 2. The next, you select directories recursively. 3. The last, select a filename. 4. Then it copies the selected file in the selected directory from the selected remote host to the current directory on local machine. As compared with the above example of a calendar, it looks like the browser more. The example with a similar structure is described with getftp() the function definition in _fdrc, you can analyze it if possible. By the way, it is troublesome for browsing that you can only dig one-way directories. It is necessary to return to the parent directory and to re-enter another directory. In the browser build by browse the builtin command, as written in a manual, the filename as ".." is treated specially. This is the same as general browsers. Since ".." is clearly the filename which means the parent directory, even if no ".." appeared in the output passed to the archive browser, it will use as "the filename to return". Then you can return the parent directory with pushing the [Bs] key or selecting ".." in LOG_DIR the command, if no ".." is listed. In this case, ".." is a directory absolutely, so that it will obey the order of -d option. In the above example, it continues to execute rsh instead of stepping rcp. And it executes the command specified by -p option unless -d noprep is specified, then the value of "RPATH" will be also set in the above example. Since the case that you push the [Bs] key is treated as you select "..", $1 will hold "..". Then "RPATH" will always keep a name of the current directory. As look well, execution of shift in -p option of the 10th line seems to empty the all positional parameters. But these positional parameters will be restored when you select each file even if shift is done or set another value with set the builtin command, because they are set together when you select each file, as written in a manual. Because there is no file selection from the execution of the command for -p option to the execution of the next command for an archive browser, you should note that, if you empty positional parameters in -p option, you cannot refer to it in the next command for an archive browser. The last I refer to a difficult notice. It is that when you use the external command such as rsh and ftp in the examples, its output form will be different according to the OS or the environment. In the general archive browser, since the output of each archiver which is the external command also relies on the environment, launch the builtin command needs registrations of the multiple format strings with -f option. It is the same for browse the builtin command. Unlike the archiver command which has the only implementation on the only environment, the command using the network such as rsh and ftp will have the quite different output form only if the remote host is different. In above example, the format string is shown for the rather popular output form. For more practical, you should register the multiple format strings in order to support more various remote hosts. Like this, you should also register the multiple -i options and -e options. 11.Kana-Kanji Translation Dictionary In the standard state, the included mktankan.c makes the text dictionary for the Tan-Kanji translation to make fd-dict.tbl, the Kana-Kanji translation dictionary, from it. In this state, fd-dict.tbl does not include any Hinsi information. Then you will be able to use only the Tan-Kanji translation in the Kana-Kanji IME mode, if you use this as is. The internal translation engine supports the Tan-Bunsetsu translation based on the Hinsi translation. If you prepare the other text dictionary with the Hinsi information, you can use Ren-Bubsetsu translation in the Kana-Kanji IME mode. The supported dictionary form is the pubdic form. And you can also use the text converted from the dictionary of Wnn, Canna and SJ3. If you describe these dictionaries as DICTSRC in Makefile.in at compile time, fd-dict.tbl, the Kana-Kanji translation dictionary, will be based on these dictionaries. When you describe it as DICTSRC, you should describe it with the absolute path or the relative path from the directory where they are compiled. You may describe only the filename, of cource, when you place them at the same directory. When you describe multiple dictionaries, you should separate them with spaces. You can not choose one of them at execution, so that the translation candidate will be selected from all of them. You can specify it from the command line of 'make' such as "make DICTSRC=./puvdic.p", in the case of a single dictionary. When you change the dictionary specification after once compiling, you must delete the compiled fd-dict.tbl and compile it. In this case, you can execute "make rmdict". Then only the files related to the dictionary will be deleted, and the other compile results will be leaved as they were. 12.Message Catalog In the standard state, the included mkcat.c makes fd-cat.ja as the Japanese message catalog and fd-cat.C as the English message catalog, based on message strings written in kanji.hin. If these message catalogs exist in the same directory as the executable binary of fd, you can specify its extension string for MESSAGELANG the internal variable to replace displaying messages to contents of the catalog. If you want to use the original message catalog, you can edit the standard message catalog to make the new message catalog. On the way to compile fd, _fd-cat.ja and _fd-cat.C as the text file will be auto-generated. These are the source file for each message catalogs. You must describe these source files in Shift JIS or EUC- JP. EUC-JP is selected when CODEEUC the identifier is set, otherwise Shift JIS is selected. If you make the message catalog with single byte characters, you need not care about its Kanji code. The message catalog with multi byte characters except Japanese is not supported now. You can use mkcat.c to generate the message catalog. The following process will generate fd-cat.fr from the source of _fd-cat.fr for example. You can execute the next command in the directory where fd was compiled. And you will copy generated fd-cat.fr to the same directory as the executable binary of fd, to use it as an additional message catalog. ./mkcat _fd-cat.fr fd-cat.fr But, you must be careful when USEDATADIR the identifier had been defined before fd was compiled. In this case, the message catalog must be placed in not the same directory as the executable binary of fd, but the directory which is specified by DATADIR in Makefile.in. You will make the directory under DATADIR for each fd versions. Suppose DATADIR=/fd and version is 3.00, the directory name will be /fd/3.00. This directory for message catalogs will be auto-generated with installation. Then you should execute installation once. FD-3.01j/Install.eng100644 2105 1751 22216 13516612560 13005 0ustar shiraiuser[HOW TO INSTALL FDCLONE3] - In Case of UNIX 1. In machine.h, you can find the part which is commented out. Then you will move the "/*" on beginning of the line to the place before ';' after it, referring to an attached comment content. Especially, in the following four configurations, the administrator sometimes setups differently from the OS default setups. Then you must be careful to select. CODEEUC This OS uses the EUC-JP Kanji code. (If undefined, it means Shift JIS is used.) DEFKCODE The string which specifies the Kanji code used as OS standard. UTF8DOC This OS uses UTF-8 as the Kanji code for documents. UTF8LANG The string which specifies the Kanji code used as OS standard, if the environment variable LANG includes "UTF". TARUSESPACE tar(1) with t option will output the list in which each file mode string is always followed by spaces. In the following OS, there is need to change nothing except these two configurations. If you force to change anything, you will fail. So, you should go to the next step. Sun SunOS (5.x) (free) Cygwin (1.x, 2.x) (free) Linux (2.x, 3.x) (free) FreeBSD (2.x, 3.x, 4.x, 5.x, 6.x, 11.x) (free) NetBSD (7.x) (free) OpenBSD (6.x) (free) MINIX (3.x) Google Android (1.x, 2.x, 3.x, 4.x) Apple Mac OS X (10.x) In the following OS, the codes for these OS are described while it is not confirmed whether if Ver. 3.01 will be running normally. Then you seem to need no change. At least, if you can compile it with no change, it seems that any changes are not necessary. Sun SunOS (4.1.x) SONY NEWS-OS (3.2, 4.x, 6.x) SGI IRIX (R4.0.5, R5.x, R6.x) HP HP-UX (9.x, 10.01, 11.x) HITACHI HI-UX/WE2 (01-x, 02-01, 04-02) NEC EWS-UX/V(Rel4.x)(R5.3, R7.1, R8.1, R9.1, R10.1, R12.3, R13.1) OMRON UniOS-U (Ver3.00) OMRON UniOS-B (2.00) OMRON Luna/Mach (2.5) DEC OSF/1 (V1.2, V2.0, V3.2, V4.x, V5.x) DEC ULTRIX (V4.x) IBM AIX (3.x, 4.x) Apple A/UX (3.0) DG DG/UX (5.4) Fujitsu UXP/M (4.0, 4.1) Fujitsu UXP/DS (V10, V20) Mips RISC/os (4.x, 5.0x) NeXT NEXTSTEP (3.0) (free) 386BSD (R0.1) (free) NetBSD (1.x, 2.x, 3.x, 4.x, 5.x) (free) OpenBSD (2.x, 3.x, 4.x, 5.x) BSDI BSD/OS (1.1, 2.x, 3.0) JCC 4.4BSD-Lite (v1.0) ASCII BSD on Windows (1.0, 1.5) In the other OS which is not listed in both these lists, the program which judges the OS environment is prepared, and you can do "make config" to build the configuration file. But, this automatic judgment is not perfect. If you can not compile it, you must manually edit config.h which is built by "make config". And you can refer TECHKNOW.eng for the detail of changes. Reversely, in the OS which is listed in either of above lists, don't do "make config" because "make config" may sometimes cause rather unsuitable result. Especially in Linux, it is one of the most strange OS as UNIX, some special codes for Linux are prepared. Since these codes will never be judged automatically, you must never do "make config" in Linux. When you've done "make config" accidentally, do "make realclean" before the next step. 2. You can change some constants defined in fd.h, if you want. The meaning of each constant is described in the manual as the ENVIRONMENT VARIABLES. These constants and the environment variables have the same name. If you cannot decide, there is no problem as it is. Moreover, it is better to change PAGER and EDITOR to the suitable commands according to environment. But, if you can not prepare any applicable command, you should comment out that line. (PAGER: file viewer, EDITOR: text editor) 3. do "make". 'cc' is used as a compiler by default. If you wish to use another compiler, you can specify it as "make CC=gcc". In this example, 'gcc' is used as a compiler. In case of cross-compiling, "make CC=lcc80 HOSTCC=cc" can specify both the cross-compiler and the compiler which is used for local executable files generated in build process. In this example, 'lcc80' is used as a compiler and 'cc' is used as a local compiler. In this case, the identifiers of 'CFLAGS'/'HOSTCFLAGS', 'CPPFLAGS'/'HOSTCPPFLAGS' and 'LDFLAGS'/'HOSTLDFLAGS' can be also specified, to specify compiling options individually for cross-compiling and local compiling. It is supposed that files are installed under '/usr/local' by default. You can specify the installation path as "make PREFIX=/usr". In this example, it is supposed that files are installed under '/usr'. You can also specify the system configuration path as "make CONFDIR=/usr/local/etc". 4. Confirm whether the compiled one will run with no problem. 5. You can rewrite the macros (TOPDIR etc.) in Makefile.in according to your environment. If you rewrite DEFRC at this point, you must do "make clean" and do "make" again. In this case, while each description in documentation is different from the fact, there is no problem in executing this program. You can rewrite also DICTSRC, to change the Kana-Kanji translation dictionary from the standard Tan-Kanji dictionary to the other one. You should refer the #11 in TECHKNOW.eng for details. 6. You can copy _fdrc as the name of fdrc, and rewrite fdrc according to your environment. Or, you can create it from scratch. The prepared _fdrc is just an example. The configurations in it becomes the configurations common to your whole system. Then you should consider with the policy as an administrator. If you don't create fdrc, the configuration file common to whole system is not installed. In this case, only a configuration file of each user is valid. 7. do "make install". 8. If the manual is installed correctly (you can do "man fd"), all step is over. Sometimes the manual is not installed correctly, for the reason that nroff is not support Japanese, or so. For example, the meaningless characters is output, or the man command outputs any error message. In this case, if you install the plain text manual, you can refer the manual correctly. You can try the following targets for make in this rotation, and confirm to be able to do "man fd". jcatman -> jcatman-b -> jcompman -> jcompman-b If you do "make jcatman" and can not install correctly, then you do "make jcatman-b" ... you will continue. The target with -b will install for the terminal which cannot interpret the backspace (^H). The target with comp will install the textfile after compress it. If your OS doesn't support locale, the Japanese manual sometimes overwrite the English manual. In this case, you can install the only English one with the following targets. catman -> catman-b -> compman -> compman-b Each target can install the manual as well as the above targets, except that the Japanese manual is not installed. 9. Finish. -------- - In Case of MS-DOS 1. The following compilers are confirmed. djgpp 1.1x (g) djgpp 2.0x (d) LSI C-86 Ver. 3.5 (l) Borland C++ 5.xx (b) It is prepared makefile.?pc for DOS/V, makefile.?98 for PC-9800 series, then use it. `?' means the above letter in "()" according to each compiler. You can rename each file to makefile, or you can explicitly do "make -f makefile.xxx" when you do make. (You cannot compile with LSI C-86 trial version.) 2. You can change some constants defined in fd.h, if you want. The meaning of each constant is described in the manual as the ENVIRONMENT VARIABLES. These constants and the environment variables have the same name. If you cannot decide, there is no problem as it is. Moreover, it is better to change PAGER and EDITOR to the suitable commands according to environment. But, if you can not prepare any applicable command, you should comment out that line. (PAGER: file viewer, EDITOR: text editor) 3. do "make". 4. If it will become any error in compile by the shortage of memories or so, you can reduce some functions partially. You can define the identifier to reduce function in config.hin, referring the #8 in TECHKNOW.eng, and re-compile. Ex: #define _NOTREE (cannot use tree screen) 5. You can convert the Kanji code with "make fd.doc" for the Japanese manual. Similarly, you can also create README.doc, HISTORY.doc, FAQ.doc and LICENSES.doc for the Japanese documents. (If you cannot read Japanese, these files are needless.) 6. You will copy the file of fd.exe and fd-unicd.tbl to the same directory where PATH passed. If you don't need the function to access LFN on the old MS-DOS, fd-unicd.tbl is not required. 7. You can copy _fdrc as the name of fd2rc to the directory where you copy fd.exe, and rewrite fd2rc according to your environment. Or, you can create it from scratch. The prepared _fdrc is just an example. Especially, it contains also the configurations nonexistent in MS-DOS version, you should consider and build it. If you want to prepare the configuration file for every user, you can set the environment variable HOME as the home directory of each user, and build fd2.rc in that directory. And, also fd.hst as the history file will be created on $HOME. 8. Finish. FD-3.01j/ToAdmin.eng100644 2105 1751 11047 13516612560 12732 0ustar shiraiuser[CAUTION TO THE ADMINISTRATORS FOR FDCLONE3 EMPLOYMENT] 1.Employment Policy for FDclone Although FDclone is built aiming at the general purpose tool for beginners, its intention is "compromise from UNIX to beginners". In view of the present condition where someone complains that it has only interface difficult for beginners, the target is that any beginner can handle UNIX easily and any administrator can be out of supporting beginners. I can hear some reactions in various places after the first release of FDclone, and often feel that the above policy can not be always kept in the actual employment. One of the worst case as employment seems "the system administration with FDclone by a novice root". FDclone is only a tool for end users. The author has the policy that any root, even if he is a novice, should be used to the UNIX world well. If he is used to FDclone in daily administrations, he will not be able to raise the skill of the special operation in some accidents and the shell programming. And the most important problem is a security. There is not only the risk that a miss operation can cause damages widely, but also the problem that FDclone operations is hard to be traced later. If you nevertheless dare to operate as a root, I suggest that you should record the log at least. FDclone has the function to record the log, which can output to not only a file but also syslogd(8). The log level of the root especially can be specified individually. If you specify this log setting in /etc/fd2rc and then attribute readonly to the variables for the setting, no one can avoid logging with changing settings after FDclone has been invoked. You should keep a awareness of the problem for just root, and walk on the road of UNIX administrator not invoking FDclone with root permission easily. 2.Administration of End Users Although FDclone is a tool for beginners, the responsibility for the beginner education in each environment cannot be taken. The administrator who install FDclone take the minimum responsibility in its employed environment, and need to educate and enlighten end users including UNIX itself in order to use FDclone correctly. FDclone is just only a tool. When you install FDclone, you must build the environment where any end user can make use of FDclone with no special knowledge. This means not only to consider the configuration of /etc/fd2rc specialized in your environment, but also to build the environment "kind to beginner" about the reference method for a man page and FAQ. Therefore, the administrator who install FDclone will need to have the minimum knowledge as the UNIX administrator. It seems the work of each administrator to support end users in order to use FDclone comfortably. I wish you endeavor not to neglect the beginner education and support with expecting FDclone to be more than a tool. You should avoid that any complaint and question from end users reach the author directly. Some mails are send to the author about not only the affair specialized in FDclone but also the general question for UNIX. A FDclone package includes FAQ about FDclone, and can hardly include FAQ over whole UNIX. Moreover, even if it is a question about FDclone, the direct mail from an end user requires a lot of explanation filling his UNIX knowledge, and make difficult to support. It is recommended that the administrator in the employed environment will administer the employment of FDclone, and he send only the problem which will be resolved only by the author. 3.Guarantees of FDclone FDclone has no warranty. The fact is that it is not checked perfectly differing from some commercial products. Especially in the development after Ver. 1.03, the developing environment becomes very poor for my personal reasons. I am currently not a UNIX administrator but just end user who can not have any root permission. Although it is very difficult to continue the development of FDclone in such environment, I have continued the development with a long time and earnest approval from some users. It still has poor implementation in the view of some UNIX wizards, and may keep some security holes possibly. If you have some anxiety for them, FDclone don't hold the reliability enough to sweep off the anxiety. In opposite view, I propose that whose who expect such that reliability should build the safer and more reliable tool yourself. FDclone is not made by the engineer familiar with UNIX, and just a tool made for hobby by a mere game designer in spare time. Please don't expect FDclone too much on account of this point. FD-3.01j/LICENSES.eng100644 2105 1751 22444 13516612560 12607 0ustar shiraiuser[LICENSES FOR FDCLONE3] (NOTICE: The official licenses is written in Japanese language. This version in English language is only a translation, and is NOT VALID LEGALLY.) <0.Intro> This document is written for licenses to use, modify, duplicate, and distribute `FDclone'. `FDclone' is a free software, not to restrict users to any use. This document says the details based on each case, including author's wishful desire. <1.Definition> First of all, the terms used in this document are defined as following. In this document, these terms are used in their specific meanings written here, as long as there is no notice. source A set of a source program. Or a set of a package which contained any document or something else in it. binary An executable binary gotten with compiling a set of a source program. Or a set of a package which contained any document or something else in it. distribution In a broad sense, to create the duplicate (if modified or not) of a source or a binary, and give the third party. In a narrow sense, to give the duplicate to the specific persons. circulation A form of distribution in a broad sense. To give the duplicate of a source or a binary to the general public, widely at a public space. primary distribution, primary circulation distribution (or circulation) by the hand of the author himself. secondary distribution, secondary circulation distribution (or circulation) of the primary distribution or the primary circulation by the hand of someone except the author. It counts similarly as the 3rd distribution (or the 3rd circulation), the 4th distribution (or the 4th circulation). re-distribution, re-circulation A general term for distribution (or circulation) after the primary one. modification To make several change on the original source or the binary. secondary use To use a part of the original source, by including it in another software. <2.Re-Distribution> About re-distribution in a narrow sense, re-distribution of a source and a binary is permitted, if modified or not. You can do it freely in any purpose, profit or not. Re-distribution after the secondary one is as free as this. However, the author doesn't take any responsibility for the re-distributed package. If you want any guarantees to keep original or to work normally, the re-distributor himself will needs to guarantee. <3.Re-Circulation> Re-circulation of a source and a binary is permitted, if modified or not. You can do it freely in any purpose, like re-distribution in a narrow sense, But, in order to take care of the re-circulated package as possible, a circulation registration system is established for a part of circulation form. The author cannot take any responsibility for the re-circulated one with no registration, like the re-distributed one. The author takes care of the registered re-circulation equivalent to the primary circulation. If you don't need this, you don't have to make circulation registration. When you circulate the re-circulation already registered, and don't make any modification on the package form and it's contents against the registered re-circulation, the author shall take care of it equivalent to the re-circulation. In the case of making some modification on the package, at the moment you've done, circulation registration becomes invalid. Then, the author doesn't take any responsibility, unless circulation is registered again. However, if a secondary circulator adds some licenses on the second circulation with registration, the licenses for distribution after the secondary one follow them. If registered, a secondary circulator can freely set up the licenses for re-distribution after the secondary one, except they break the licenses for the primary circulation. So, if you think to re-circulate the secondary circulation, you should tell a secondary circulator. As far as circulation registration is made, the author will keep out of re-distribution after the secondary one. <4.Author's Responsibility> The author take care of the primary distribution and the registered re-circulation. Specifically, replying to questions and requests from users, changing the program if need, and guaranteeing that the program never includes the operation against specifications to work normally. If it doesn't work by according to specifications on each document, the author should accept changing. The author doesn't take any responsibility for the re-circulated packages with no registration, and cannot reply to questions nor requests from users. If the contact from users occurs, it is hoped that the re-circulator accepts the contact and manages it with responsibility. However, the author guarantees no warranty in the use of this program, each user will need to use it at their own risk. <5.Source Circulation Registration> The author take care of the unregistered circulation of a source, only if the contents of its package have no modification. The package which has some modification on its contents, in which the program source part has no modification and its modification is only the additional documents or programs, will be treated equivalent to the case which has no modification. In these cases, modification of package form is ignored, that is modification of an archiving method or a package name. When there is some modification in the program source part, or in the files which have effect on the executable binary, e.g. `Makefile' etc., source circulation registration will make the author take care of it. You can make circulation registration according to the following procedure. <6.Binary Circulation Registration> The author doesn't take any responsibility for the circulation of a binary, if it is re-circulation with no registration. Even if it has no modification from the primary circulation, it is the same. If you want any guarantees from the author, you need to make circulation registration according to the following procedure, if modified or not. It is suggested from the author that you will make surely circulation registration, because the circulation of a binary is especially dangerous. <7.Adaptation of Program> When a user makes some modification partly on the program and uses it, and treats as quite different from the original program, it is regarded as secondary use, not depending on the volume of modification. The modification which can not be regarded as the secondary use follows above rule for re-distribution. On the other hand, the secondary use can be treated freely as a work of the secondary author. <8.Broadcast through Books> It is regarded as re-circulation to broadcast through the commercial books by the media, such as CD-ROM. If the author's guarantee is required, you should make each circulation registration according to whether it is a source or a binary. It is treated as same as the other re-circulation. However, broadcasting the re-circulation already registered doesn't need any registration again, then you should follow the licenses by the circulator who made circulation registration. In case of not broadcasting but introducing as an article, it has no need to register, because neither a guarantee nor responsibility can be generated. No need to contact the author. As the author's hope, it is preferable to contact or contribute books if you broadcast or introduce. Especially in case of an introduction report, if you show a manuscript in advance, the author will be able to confirm whether it is suitable. Who intend to broadcast is be wanted to consider. <9.Procedure of Circulation registration> If you want circulation registration, the following procedure is authorized. 1. Define the circulation manager. 2. Rewrite from `NULL' to the E-mail address of the circulation manager, variable `distributor' in `version.h'. ex.: char *distributor = "shirai@unixusers.net (Takashi SHIRAI)"; 3. Make the differential in modification from the package of the primary circulation, including the additional files if exist. 4. Create a circulation package. 5. Check the MD5 checksum of the package, and note it. In case of the binary circulation, check it for the executable binary of FDclone, too. If you have no way to check it, FDclone has a builtin command `checkid', so that you can use it. Compile and run FDclone, and push the `h' key for executing EXECUTE_SH command, and then run `checkid NAME_OF_FILE' to display the MD5 checksum. 6. Send the registration letter to the author via E-mail, with the differential and the package's MD5. In case of the binary circulation, you must refer to the environment(OS, machine, etc.) in which the circulated executable binary works, and MD5 of the executable binary. 7. Explain in the registration letter that you change the licenses of re-circulation, if need. In the registration letter, you should better declare whether source circulation registration or binary circulation registration. You can make source circulation registration and binary circulation registration simultaneously in the same registration letter. When you make binary circulation registration on multiple environments with the same differential, listing each environment can regard one registration as registration for all environment simultaneously. If you are anxious about the operation in detail, please tell the author before registration. FD-3.01j/fd_e.man100644 2105 1751 466631 13516612560 12333 0ustar shiraiuser.\" .\" Copyright (C) 1995-2019 Takashi SHIRAI .\" .\" .\" @(#)fd.1 3.01j 07/27/19 .\" fd - File & Directory maintenance tool .TH FD 1 "July 27, 2019" .de sh .br .PP \fB\\$1\fR .PP .. .SH NAME fd \- file & directory maintenance tool .SH SYNOPSIS .B fd [ .B \-abCefhiklmNnPrSsTtuvx ] [ .BI \- NAME = value ] [ .I directory [ .I directory2 .\|.\|. ]] .br .B fdsh [ .B \-abCcefhiklmNnPrSsTtuvx ] [ .I args ] .SH DESCRIPTION .B Fd is a file & directory maintenance tool considered for the text terminals on general UNIX. It aims for a clone of the same named utility which is made for the PC/AT compatible machine and PC-9800 series. In fact, it is upper compatible functionally. .B Fd shows the browser screen listing files when you have invoked it. You can input some key which is bound each command, to execute various operations. (In the following description, .B (UNIX) means that the operation is implemented only on UNIX version and not effective on MS-DOS version. As well as it, .B (DOS) means that the operation is implemented only on MS-DOS version.) .SS Options The command line option is used for setting internal shell operations and setting the internal variables described below. You can use any variable name as the internal variable, but .B fd can accept only those which are described in the below section of .BR "ENVIRONMENT VARIABLES" . If you specify .IR directory , the current directory is moved to the directory initially. If you specify .IR "directory2 .\|.\|." , the split window mode is invoked, and the current directories of the supplemental windows are moved to the each directory. The following options are available for the internal shell. .TP .BI \-c " string" Commands described by .I string are executed and exit immediately. It is effective only when it is invoked as .BR fdsh . .TP .B \-i If the .B \-i flag is present or if the standard input/output is a terminal, the shell is the interactive shell. .TP .B \-s If the .B \-s flag is present or if no .I args is specified, commands for the shell are read from the standard input. Any remaining argument specifies the positional parameter. .TP .B \-r The shell is a restricted shell. Specifically, the following operations are disallowed. .RS 10 .PD 0 .PP changing the current directory .br setting the value of .BR $PATH , .B $SHELL and .B $ENV .br specifying command names include .B / .br redirecting output .RB ( > and .BR >> ) .ta 1.5i 3i .nf .ft B IN_DIR OUT_DIR LOG_TOP LOG_DIR ATTR_FILE COPY_FILE MOVE_FILE DELETE_FILE DELETE_DIR RENAME_FILE MAKE_DIR WRITE_DIR TREE_DIR BACKUP_TAPE EDIT_FILE UNPACK_FILE PACK_FILE LOG_TREE COPY_TREE MOVE_TREE UNPACK_TREE FIND_DIR ATTR_DIR .ft R .fi .PD .RE .RS When invoked as .B rfd or .BR rfdsh , it becomes this restricted shell automatically. .RE .TP .B \-l The shell is a login shell. .TP .B \-N Reading the initial configuration files is omitted. .PP In addition, the options described below in the description of .B set the builtin command are available. .SS Screen Layout .B Fd has the 3 major screen modes. In the browser screen, you can select from the file list and execute each command. In the archive browser screen, files in the archive file are listed separately by directory, and you can browse as well as the browser screen. In the tree screen, you can move on the directory tree and select the directory path. In all screen modes, each .B 3 lines on the top/bottom of the screen are used for the various information of .B fd. The top information lines sometimes become .B 4 lines. The screen layout is the following. .IP line# 10 Description .IP \fB1\fP The title line. The clock at the right end is updated every .B 10 seconds. .IP \fB2\fP The information line. It displays information in this order: the current page (and the total pages), the number of marks (ant the total marks), the sorted type, the pattern string for file search. .IP \fB3\fP The path line. It displays the fullpath of the current directory. In the archive browser screen, it displays the fullpath of the archive file and the current path in the archive. .IP "\fB2\fP (optional)" The file size information line. It displays the total size of the marked files in the directory (and the total size of all files), the total capacity and the free size of the file system including the current directory. This line appears by .B SIZEINFO the internal variable setting. When this line is displayed, The information line and the path line are displayed 1 line under each. .IP "\fBbottom \- 2\fP" The stack line. It displays files temporarily which you push in stack, when arranging files. .IP "\fBbottom \- 1\fP" The function line. It displays the operations of function keys. .IP "\fBbottom\fP" The status line. It displays the status of the file on the cursor position. It also displays warning messages when command is executed with some troubles. .SS Internal Commands You can use the following internal commands on .BR fd . While any user can change the key binding for these internal commands, here shows the default key binding. The identifier is used when it is executed from the command line of .B EXECUTE_SH command, and when the user defines the key binding. .br .ta 2i 5i .nf Identifier Command Key \fBCUR_UP\fP Move a cursor up \fBUp\fP \fBCUR_DOWN\fP Move a cursor down \fBDown\fP \fBCUR_RIGHT\fP Move a cursor right \fBRight\fP \fBCUR_LEFT\fP Move a cursor left \fBLeft\fP \fBROLL_UP\fP Turn ahead to the next page \fBPageDown\fP \fBROLL_DOWN\fP Turn back to the prev. page \fBPageUp\fP \fBCUR_TOP\fP Move a cursor top \fBBeg\fP(<) \fBCUR_BOTTOM\fP Move a cursor bottom \fBEol\fP(>) \fBFNAME_RIGHT\fP Shift right a filename \fB(\fP \fBFNAME_LEFT\fP Shift left a filename \fB)\fP \fBONE_COLUMN\fP Change layout into 1 column \fB1\fP \fBTWO_COLUMNS\fP Change layout into 2 columns \fB2\fP \fBTHREE_COLUMNS\fP Change layout into 3 columns \fB3\fP \fBFIVE_COLUMNS\fP Change layout into 5 columns \fB5\fP \fBMARK_FILE\fP Mark a file \fBTab\fP \fBMARK_FILE2\fP Mark and move down \fBSpace\fP \fBMARK_FILE3\fP Mark and move in a page \fB^Space\fP(^@) \fBMARK_ALL\fP Mark all files \fBHome\fP(+) \fBMARK_REVERSE\fP Mark all files reversely \fBEnd\fP(-) \fBMARK_FIND\fP Mark the matched files \fB\(**\fP \fBIN_DIR\fP Change to a sub directory \fBReturn\fP \fBOUT_DIR\fP Change to a parent directory \fBBs\fP \fBLOG_TOP\fP Change to a root directory \fB\e\fP \fBREREAD_DIR\fP Reread the current directory \fB^L\fP \fBPUSH_FILE\fP Push a file to the stack \fBDel\fP(]) \fBPOP_FILE\fP Pop a file from the stack \fBIns\fP([) \fBLOG_DIR\fP Change to a logical directory \fBF1\fP(l) \fBEXECUTE_FILE\fP Execute a file \fBF2\fP(x) \fBCOPY_FILE\fP Copy a file \fBF3\fP(c) \fBDELETE_FILE\fP Delete a file \fBF4\fP(d) \fBRENAME_FILE\fP Rename a file \fBF5\fP(r) \fBSORT_DIR\fP Sort the current directory \fBF6\fP(s) \fBFIND_FILE\fP Find files \fBF7\fP(f) \fBTREE_DIR\fP Display the tree screen \fBF8\fP(t) \fBEDIT_FILE\fP Edit a file \fBF9\fP(e) \fBUNPACK_FILE\fP Unpack a file \fBF10\fP(u) \fBATTR_FILE\fP Change a file attribute \fBF11\fP(a) \fBINFO_FILESYS\fP Display a file system info. \fBF12\fP(i) \fBMOVE_FILE\fP Move a file \fBF13\fP(m) \fBDELETE_DIR\fP Delete a directory \fBF14\fP(D) \fBMAKE_DIR\fP Make a directory \fBF15\fP(k) \fBEXECUTE_SH\fP Execute a child process \fBF16\fP(h) \fBWRITE_DIR\fP Write a displayed directory \fBF17\fP(w) \fBBACKUP_TAPE\fP Backup into a tape \fBF18\fP(b) \fBVIEW_FILE\fP View a file \fBF19\fP(v) \fBPACK_FILE\fP Pack a file \fBF20\fP(p) \fBLOG_TREE\fP Change directory with tree \fBL\fP \fBCOPY_TREE\fP Copy a file with tree \fBC\fP \fBMOVE_TREE\fP Move a file with tree \fBM\fP \fBUNPACK_TREE\fP Unpack a file with tree \fBU\fP \fBFIND_DIR\fP Find a file recursively \fBF\fP \fBATTR_DIR\fP Change attributes recursively \fBA\fP \fBSYMLINK_MODE\fP Switch the symbolic link mode \fBS\fP \fBFILETYPE_MODE\fP Switch the file type symbol \fBT\fP \fBDOTFILE_MODE\fP Switch the dot file display \fBH\fP \fBFILEFLG_MODE\fP Switch the file flag display \fBO\fP \fBLAUNCH_FILE\fP Invoke the launcher \fBReturn\fP \fBSEARCH_FORW\fP Search forward a file \fB^S\fP \fBSEARCH_BACK\fP Search backward a file \fB^R\fP \fBSPLIT_WINDOW\fP Split into the windows \fB/\fP \fBNEXT_WINDOW\fP Change to the next window \fB^\fP \fBWIDEN_WINDOW\fP Widen the current window \fBW\fP \fBNARROW_WINDOW\fP Narrow the current window \fBN\fP \fBKILL_WINDOW\fP Kill the current window \fBK\fP \fBEDIT_CONFIG\fP Invoke the customizer \fBE\fP \fBHELP_MESSAGE\fP Display a help screen \fB?\fP \fBQUIT_SYSTEM\fP Quit from fd \fBEsc\fP(q) \fBWARNING_BELL\fP Bell for warning \fBNO_OPERATION\fP Do nothing .fi .PP The last 2 internal commands are used when you want change the default key binding to cancel. .SS Internal Commands Description The detail of each internal command is the following. Internal commands with similar function are described together. .RS 3 .IP "\fBMove cursor\fP" 5 Move a cursor. .IP "\fBTurn page\fP" Turn to the previous/next page, when files are not completely held in a screen. Also if you try to move out of the page with Cursor move, the page will be turned. .IP "\fBMove to the top/bottom\fP" Move a cursor to the top/bottom of the file list. When the list is not held in a screen, the page is turned. .IP "\fBShift filename\fP" Shift the displayed string of filename on the cursor position, when the filename is longer than the prepared column width. It is displayed as shifted to right/left by 1 character. The display of the status line is also shifted simultaneously. .IP "\fBChange layout\fP" Change the number of columns into each value. There are usually .B 2 columns per screen. As the column width per file is changed according to the number of columns, the displayed information is also changed. .IP "\fBMark file\fP" Mark the file on the cursor position. You cannot mark any directory. .RB [ Space ] marks and moves down a cursor. .RB [ ^Space ] also marks and moves down a cursor, but doesn't turn the page. .RB [ Home ] marks all the files, .RB [ End ] marks all the files reversely. .RB [ \(** ] additionally marks the file which matches the wildcard. You must input the wildcard string whenever you push .RB [ \(** ]. Marked files are used as the target of .BR ATTR_FILE , .BR COPY_FILE , .BR DELETE_FILE , .BR MOVE_FILE , .B UNPACK_FILE and the user defined command macros. .IP "\fBChange directory\fP" .RB [ Return ] changes the current directory to the directory on the cursor position. If you want to change it to the parent directory, you should move a cursor to the file of ".\|." and push .RB [ Return ], or simply push .RB [ Bs ]. .RB [ \e ] changes the current directory to the root directory. .IP "\fBPush/pop file stack\fP" .RB [ Del ] pushes the file on the cursor position to the file stack, and temporarily deletes the file from the file list screen. You can push files to the file stack up to .B 5 files. .RB [ Ins ] pops the file from the file stack and insert it on the cursor position. The last pushed file is popped first. But this order is expediently displayed in .BR fd , and it is reset by Directory move. .IP "\fBRedraw screen\fP" Redraw the file list screen by rereading the information of the current directory. It is useful when some other process add/delete files, or when something break the screen display. Moreover, when you use the terminal which doesn't raise .B SIGWINCH signal at changing the screen size (like .BR kterm (1) on HP-UX etc.), you must intentionally redraw after you change the screen size. .IP "\fBChange logical directory\fP (Logdir)" Change the current directory to the inputted pathname. When you input the pathname which starts with '/', it means not the relative move but the absolute move. When you input the pathname "\fB.\fP", the pathname of the current directory is adjusted into absolute expression. Except this case, the current directory always is shown as the virtual pathname, by reason of a link and so on. When you input the pathname "\fB?\fP", you can move to the current directory when .B fd was invoked. When you input the pathname "\fB\-\fP", you can move to the last visited directory. Moreover, When you input the pathname "\fB@\fP" in floppy drive, you can move to the directory on UNIX file system, where you existed before moving to floppy drive. .B (UNIX) (Note: This command is called as "Loddsk" in the original FD on MS-DOS, which is short for "LOGical DiSK drive". This "logical" means the drive name prefixed to pathnames, and it is virtually named against "physical disk drive". On UNIX, since "logical disk drive" never means pathname nor directory, this command name "Change logical directory" is not suitable. But this name is expediently inherited from the original version.) .IP "\fBExecute file\fP (eXec)" Execute the file on the cursor position with some parameters, as the child process. The cursor position in command line exists after the filename in case of the executable file, and before the filename except it. You should fill suitable parameters or command name in each case. The up/down cursor keys can provide the command history which you executed before. On MS-DOS version, the LFN form filename in the command line which is quoted with the quotation mark \fB"\fP is automatically replaced into 8+3 form filename before execution. In this case, when there is the filename described by the string quoted with \fB"\fP, this string is always replaced into 8+3 form filename after deleting \fB"\fP, otherwise it is never replaced including \fB"\fP. .IP "\fBCopy file\fP (Copy)" Copy the file on the cursor position to the specified directory. When the cursor position indicates a directory, its contents are copied recursively. When some files are marked, the target is not the file on the cursor position but the marked files. When the same named file exists in the destination, you can select the operation from the following: "Update (by timestamp)", "Rename (each copied file)", "Overwrite", "Not_copy_the_same_name", "Forward". If you select "Forward", you should specify the directory as the destination to forward. All files which have the same names are moved to the specified directory. .IP "\fBDelete file\fP (Delete)" Delete the file on the cursor position. No directory can be deleted. When some files are marked, the target is not the file on the cursor position but the marked files. When you don't have write permission on the file, you are confirmed for security. .IP "\fBRename file\fP (Rename)" Rename the file on the cursor position. You cannot rename to the same name as any existent file. When you specify the pathname with some directory name, it is also moved to the directory. .IP "\fBSort file\fP (Sort)" Sort files in the current directory. You can select the sorted type from the following: "fileName", "Extension", "Size", "Timestamp", "Length (of filename)", and specify "Up (incremental order)" or "Down (decremental order)". When the sorted type before sorting is the one except "No chg (not sort)", the choice will include "No chg". When you sort after sorting another sorted type, the previous sorted result is based in sorting. This sorting has a priority except specified type, the directory is always precedes any file, except for the case of "No chg". In case of "Length", files which have the same filename length are sorted in order of their names. But this sorting is expediently displayed in .BR fd , and it is reset by Directory move. .IP "\fBFind file\fP (Find)" Find the files matching the wildcard, and display only them. The filename which starts with '.' doesn't match the wildcard which starts with '\(**' nor '?'. If you want to cancel the File find, you should move the current directory, or do .B FIND_FILE again and input a null line. When the current directory has the files which have the extension registered to associate with an archive browser, the string which starts with '/' is used to find not the filename but the filename in archive files, and only the archive files which contain matched files are displayed. This function is available in the archive browser. After Find file, you can not do .BR WRITE_DIR . .IP "\fBDisplay tree screen\fP (Tree)" Display the directory tree based on the current directory. You can select the directory in the tree screen, to move the current directory. .IP "\fBEdit file\fP (Editor)" Edit the file on the cursor position. The editor is used referring .B EDITOR the internal variable, or referring .B EDITOR the environment variable when the internal variable is undefined. .IP "\fBUnpack file\fP (Unpack)" Unpack the archive file on the cursor position into the specified directory. In builtin configuration, you can unpack only the tar file and its compressed file and the LHa compressed file. You can describe configurations in the initial configuration file to support archivers except these. .IP "\fBChange attribute\fP (Attr)" Change the file access mode, the timestamp and the owner/group of the file on the cursor position. When some files are marked, the target is not the file on the cursor position but the marked files. In case of the marked files, you must select the mode, the timestamp or the owner/group, before changing it all together. When you input the mode, cursor keys move a cursor to the position you want to change, .RB [ Space ] reverses the attribute on the position. You should notice that the attribute of the execution bit is not a binary toggle but a triple toggle, which includes setuid bit, setgid bit and sticky bit respectively. If the target is the marked files, .RB [ m ](Mask) will mask a bit on the cursor position with .RB ' * ', to keep the value of the original file attribute. When you input the timestamp, you move a cursor to the position you want to change, and input a numeric value. When you input the owner/group, you move a cursor to the position for each name, and input a name or a ID value with .RB [ Space ]. You can use the completion for a user name and a group name to input each name. Finally, .RB [ Return ] executes the change. You can cancel with .RB [ Esc ]. Be careful that the limit check of date is not perfect. Moreover, .RB [ a ](Attr), .RB [ d ](Date), .RB [ t ](Time), .RB [ o ](Owner) and .RB [ g ](Group) move a cursor to the each beginning of input line. On the OS which has the attribute of file flags, you can change the file flags as well as the mode. In this case, .RB [ f ](Flag) move a cursor to the beginning of input line of file flags. But the value of flags which you can change is based on your permission. .IP "\fBFile system information\fP (Info)" Display the information of the specified file system. When the inputted pathname is not the special file which indicates a file system, the information of the file system including the pathname is displayed. .IP "\fBMove file\fP (Move)" Move the file on the cursor position to the specified directory. When the cursor position indicates a directory, the directory itself is moved. When some files are marked, the target is not the file on the cursor position but the marked files. When the same named file exists in the destination, you can select the operation as well as .BR COPY_FILE . When the destination belongs to the different file system, copy and delete are just executed continuously. .IP "\fBDelete directory\fP (rmDir)" Delete the directory on the cursor position recursively. When the directory in a symbolic link, only the link is deleted and the linked directory has no effect. .IP "\fBMake directory\fP (mKdir)" Make the sub directory on the current directory. When the inputted sub directory string includes '/', which is the pathname delimiter, it goes on making directory recursively until the directory described by the string is finally created. When you input the pathname which starts with '/', the directory is made not on the current directory but on the absolute path described. .IP "\fBExecute child process\fP (sHell)" Execute the inputted command string as the child process, by handling the internal shell. You can refer the command history and use automatic LFN replacement, as well as .BR EXECUTE_FILE . When you push only .RB [ Return ] without any input, the user shell which is described by .B SHELL the internal variable or the environment variable is invoked. In this case, you should input "\fBexit\fP" to return to .BR fd . When the value of .B SHELL is .BR fdsh , the internal shell is executed as the interactive shell. However, when there is the same command name as a builtin command or a internal command, the builtin command or the internal command are executed instead of the external command. You can refer the clause of `\fBBuiltin Commands\fP' for the details of the builtin command. .IP "\fBWrite directory\fP (Write)" Write the displayed directory. The gap between files on the directory entry is filled. When it is executed after arranged by .BR PUSH_FILE , .B POP_FILE and .BR SORT_DIR , the result is written. When the displayed directory doesn't belong to the hierarchy under your home directory, you are confirmed for security whether if any other user doesn't use the directory. Since it is insecure, you cannot write the NFS mounted directory and some special directories. If you execute the internal command which arranges the file order, and then try to execute the internal command which will break that order, you will be confirmed whether if you write the directory or not, just before the internal command is executed. For this function, you can write the directory without intentionally executing this Directory write command. But when the displayed directory is not under your home directory, this confirmation is not done. .IP "\fBBackup tape\fP (Backup)" Backup the file on the cursor position into the specified storage device. When the cursor position indicates a directory, all of its contents is backuped. When some files are marked, the target is not the file on the cursor position but the marked files. .BR Tar (1) is used for backup. When you specify the filename except special files indicates devices as input of the device name, the archive file is created with that filename. .IP "\fBView file\fP (View)" View the file on the cursor position. The pager is used referring .B PAGER the internal variable, or referring .B PAGER the environment variable when the internal variable is undefined. .IP "\fBPack file\fP (Pack)" Pack the file on the cursor position into the specified archive file. When the cursor position indicates a directory, all of its contents is packed into the archive file. When some files are marked, the target is not the file on the cursor position but the marked files. According to the extension of the inputted archive file, the associated archiver is automatically selected. In builtin configuration, you can pack only the tar file and its compressed file and the LHa compressed file. You can describe configurations in the initial configuration file to support archivers except these. When you use .BR tar (1), you may sometimes be unable to pack a lot of files at once, because of the maximum parameter length which can be given at once. In those case, you can create the archive file with .BR BACKUP_TAPE . .IP "\fBOperations with tree\fP" .RB [ L ], .RB [ C ], .RB [ M ] and .RB [ U ] can make you select the pathname from the directory tree instead of the string input. They execute the internal command equivalent to .BR LOG_DIR , .BR COPY_FILE , .B MOVE_FILE and .BR UNPACK_FILE , respectively. .IP "\fBFind file recursively\fP" Find the file matching the wildcard recursively under the current directory, and move the directory where the found file exists. When the cursor position indicates a directory, it find the file under the directory on the cursor position instead of the current directory. You will be confirmed for each matching file whether if you move or not, and you can select .RB [ n ](No) unless the target file is displayed. .IP "\fBChange attributes recursively\fP" Change attributes the directory on the cursor position revursively. As well as changing attributes of the marked files, you must select the mode, the timestamp or the owner/group, before changing it all together with each file under the directory. When you input the mode, you should notice that the attribute of the execution bit is not a triple toggle but a 5-states toggle, which includes .RB ' X ' and .RB ' ! '. .RB ' X ' means setting the bit only if the object is a directory or some execution bits are set. .RB ' ! ' also means unsetting the bit only if the object is a directory or some execution bits are set. .RB [ m ](Mask) will mask a bit on the cursor position with .RB ' * ', to keep the value of the original file attribute. .IP "\fBInvoke launcher\fP" .RB [ Return ] executes the operation according to the extension of the file on the cursor position, unless the cursor position indicates a directory. In builtin configuration, the archive browser is registered with the tar file and its compressed file and the LHa compressed file. You can describe configurations in the initial configuration file to register launchers except these. When the file on the cursor position has the unregistered extension, it will behave as same as .BR VIEW_FILE . In the archive browser, the registered launcher is available, so that you can invoke the archive browser recursively. .IP "\fBSwitch symbolic link mode\fP" In case of the symbolic link file, the file information displayed in the file column and the status line shows not the status of its referential file but the status of the link itself. It switches to show the status of the referential file. .B (UNIX) In the mode of showing the status of the referential file, .RB ' S '(Symbolic Link) is displayed on the left end of the function line. .IP "\fBSwitch file type symbol mode\fP" Switch to display the symbol which means the file type after the filename in the file list, like as the display in .B \-F option of .BR ls (1). It is toggle to switch if display the symbol or not. The each symbol means the following. .RS 10 .ta 0.5i .nf \fB/\fP directory \fB@\fP symbolic link \fB\(**\fP executable file \fB=\fP socket \fB\(bv\fP FIFO .fi .RE .RS 10 (MS-DOS version and the floppy drive) .ta 0.5i .nf \fB/\fP directory \fB\(**\fP executable file \fB=\fP system file \fB\(bv\fP label .fi .RE .RS In the mode of displaying the file type symbol, .RB ' T '(Type) is displayed on the left end of the function line. .RE .IP "\fBSwitch dot file display mode\fP" Switch not to display the file whose filename starts with '.' in the file list. It is toggle to switch if display the dot file or not. In the mode of not displaying the dot file, .RB ' H '(Hidden) is displayed on the left end of the function line. .IP "\fBSwitch file flag display mode\fP" Switch to display the file flag, which exists in some OS, instead of the file mode on each file. It is toggle to switch if display the file flag or the file mode. This is not available on any OS without the file flag. The each symbol means the following respectively. .B (UNIX) .RS 10 .ta 0.5i .nf \fBA\fP Archived \fBN\fP Nodump \fBa\fP system Append-only \fBc\fP system unChangeable (immutable) \fBu\fP system Undeletable \fBa\fP user Append-only \fBc\fP user unChangeable (immutable) \fBu\fP user Undeletable .fi .RE .RS In the mode of displaying the file flag, .RB ' F '(Flags) is displayed on the left end of the function line. .RE .IP "\fBSearch file\fP" Search the current directory incrementally for the filename, with moving a cursor. When you execute this command, to switch to the search mode, a prompt appears in the function line. You can input the filename in this prompt, and a cursor will move to the filename matching the string which is already inputted at that present. .RB [ Esc ] switches to the normal mode. .IP "\fBSplit window\fP" Split the current window. When you split a window in the normal non-split window mode, it will be the split window mode in which the screen is split into 2 windows vertically. In the split window mode, you can operate works individually on each window. When you split a window in the split window mode, the current working window is split into 2 windows vertically. You can make split windows up to .BR 5 . .IP "\fBChange window\fP" Change effective window to the next in the split window mode. When the current window is the last, the first window will be effective. In the non-split window mode, it is ineffective. .IP "\fBWiden window\fP" Widen the current window size in the split window mode, to narrow the next window size. When the current window is the last, the first window size will be narrowed. In the non-split window mode, it is ineffective. .IP "\fBNarrow window\fP" Narrow the current window size in the split window mode, to widen the next window size. When the current window is the last, the first window size will be widened. In the non-split window mode, it is ineffective. .IP "\fBKill window\fP" Kill the current window in the split window mode, to join it to the previous window. When the current window is the first, it will be joined to the last window. If the result number of windows is one, it will be the non-split window mode. In the non-split window mode, it is ineffective. .IP "\fBInvoke customizer\fP" Invoke the customizer which interactively changes the configurations to be set up by the internal variable and the builtin command. While the configurations which is set up here is reflected immediately, you must intentionally save configurations in the customizer if you want to reflect in the initial configuration file. .IP "\fBDisplay help\fP" Display the list of the current key bindings and their command descriptions. When the list is not completely held in a screen, it prompts for every screen. In case of the circulated executable binary file, this screen shows the E-mail address of the circulation manager in the function line. Please contact here when something will happen. .IP "\fBQuit\fP (Quit)" Quit from .BR fd . .RE .SS Commands In .B EXECUTE_SH and the initial configuration file, you can use the internal commands described above and the builtin commands described below, as well as the external commands. With these commands, a pipeline can consist of one or more commands separated by .B \(bv or .BR \(bv\|& . .B \(bv connects the standard output of the previous command to the standard input of the next command. .B \(bv\|& connects both the standard output and the standard error output of the previous command to the standard input of the next command. The exit status of a pipeline is the exit status of the last command. You can start a pipeline with .BR ! , then the exit status of a pipeline will be the logical NOT of the exit status of the last command. Moreover, a command list can consist of one or more pipelines separated by .BR ; , .BR & , .BR &\|\(bv , .BR && , .BR \(bv\|\(bv . This command list can end with .BR ; , .B & or .BR &\|\(bv . These separators mean the following. .RS 3 .PD 0 .IP "\fB;\fP" 5 Execute commands sequentially. .IP "\fB&\fP" Execute commands synchronously, not waiting for the preceding pipeline to finish. .B (UNIX) .IP "\fB&\|\(bv\fP" Same as .BR & , except to immediately .B disown the job. .B (UNIX) .IP "\fB&\|&\fP" Execute the following pipeline only if the preceding pipeline returns a .B 0 exit status. .IP "\fB\(bv\|\(bv\fP" Execute the following pipeline only if the preceding pipeline returns a .RB non\- 0 exit status. .PD .RE In these command lists, a newline means as same as .BR ; . The input/output of each command in the command list can be redirected with the following redirectees. These redirectees can be placed on any position in the command string. .RS 3 .PD 0 .IP "\fIn\fR\fB<\fP\fIfile\fR" 10 Redirect the input indicated by the file descriptor .I n into the input from .IR file . If .I n is omitted, it is regarded as the standard input is specified. .IP "\fIn\fR\fB>\fP\fIfile\fR" Redirect the output indicated by the file descriptor .I n into the output to .IR file . If .I n is omitted, it is regarded as the standard output is specified. If .I file doesn't exist it is created, otherwise it is truncated to 0 length before output. .IP "\fIn\fR\fB>\|\(bv\fP\fIfile\fR" Same as .BR \> , except to force to overwrite existent files even if .B \-C option is set by .B set the builtin command. .IP "\fIn\fR\fB>\|>\fP\fIfile\fR" Redirect the output indicated by the file descriptor .I n into the output to .IR file . If .I n is omitted, it is regarded as the standard output is specified. If .I file doesn't exist it is created, otherwise output is appended to it. .IP "\fIn1\fR\fB<\|&\fP\fIn2\fR" Redirect the input indicated by the file descriptor .I n1 into the input indicated by the file descriptor .IR n2 . If .I n1 is omitted, it is regarded as the standard input is specified. .IP "\fIn1\fR\fB>\|&\fP\fIn2\fR" Redirect the output indicated by the file descriptor .I n1 into the output indicated by the file descriptor .IR n2 . If .I n1 is omitted, it is regarded as the standard output is specified. .IP "\fB&\|>\fP\fIfile\fR" Redirect both the standard output and the standard error output into the output to .IR file . If .I file doesn't exist it is created, otherwise it is truncated to 0 length before output. .IP "\fB&\|>\|\(bv\fP\fIfile\fR" Same as .BR &\|> , except to force to overwrite existent files even if .B \-C option is set by .B set the builtin command. .IP "\fB&\|>\|>\fP\fIfile\fR" Redirect both the standard output and the standard error output into the output to .IR file . If .I file doesn't exist it is created, otherwise output is appended to it. .IP "\fIn\fR\fB<\|>\fP\fIfile\fR" Redirect both the input/output indicated by the file descriptor .I n into the input/output from/to .IR file . If .I n is omitted, it is regarded as the standard input is specified. .IP "\fIn\fR\fB>\|<\fP\fIfile\fR" Redirect both the input/output indicated by the file descriptor .I n into the input/output from/to .IR file . If .I n is omitted, it is regarded as the standard output is specified. .IP "\fIn1\fR\fB<\|>\|&\fP\fIn2\fR" Redirect both the input/output indicated by the file descriptor .I n1 into the input/output indicated by the file descriptor .IR n2 . If .I n1 is omitted, it is regarded as the standard input is specified. .IP "\fIn1\fR\fB>\|<\|&\fP\fIn2\fR" Redirect both the input/output indicated by the file descriptor .I n1 into the input/output indicated by the file descriptor .IR n2 . If .I n1 is omitted, it is regarded as the standard output is specified. .IP "\fIn\fR\fB<\|\-\fP" .IP "\fIn\fR\fB<\|&\|\-\fP" Close the input indicated by the file descriptor .IR n . If .I n is omitted, it is regarded as the standard input is specified. .IP "\fIn\fR\fB>\|\-\fP" .IP "\fIn\fR\fB>\|&\|\-\fP" Close the output indicated by the file descriptor .IR n . If .I n is omitted, it is regarded as the standard output is specified. .IP "\fIn\fR\fB<\|>\|\-\fP" .IP "\fIn\fR\fB<\|>\|&\|\-\fP" Close both the input/output indicated by the file descriptor .IR n . If .I n is omitted, it is regarded as the standard input is specified. .IP "\fIn\fR\fB>\|<\|\-\fP" .IP "\fIn\fR\fB>\|<\|&\|\-\fP" Close both the input/output indicated by the file descriptor .IR n . If .I n is omitted, it is regarded as the standard output is specified. .IP "\fIn\fR\fB<\|<\fP[\fB\-\fP]\fIword\fR" Redirect the input indicated by the file descriptor .I n into the input which is read up to a input line as same as .IR word , or to an end of file. If any part of .I word is quoted, no input line is evaluated. Otherwise, each input line is evaluated to expand variables or replace strings. When you specify .BR \- , all tabs on the beginning of input lines is stripped to be send to a command. If .I n is omitted, it is regarded as the standard input is specified. .PD .RE When you specify the file with each redirect, you can describe the filename as .RI ` scheme\fB://\fPhost\fB:\fPport ' form to open the following TCP sockets, according to the string of .IR scheme . The authentication of your OS will restrict specifying the accepting port. .B (UNIX) .RS 3 .PD 0 .IP "\fBconnect://\fP\fIhost\fR\fB:\fP\fIport\fR" 10 This socket is connected to the remote host specified by .I host with the TCP port number specified by .IR port . .IP "\fBaccept://\fP[\fIhost\fR][\fB:\fP\fIport\fR]" This socket is accepted to the local host specified by .I host with the TCP port number specified by .IR port . If .I host is omitted, this socket will be accepted to any host. If .I port is omitted, the port within the range determined by the OS is used. .IP "\fBbind://\fP[\fIhost\fR][\fB:\fP\fIport\fR]" This socket is bound to the local host specified by .I host with the TCP port number specified by .IR port , preparing .B accept the builtin command. If .I host is omitted, this socket will be accepted to any host. If .I port is omitted, the port within the range determined by the OS is used. .PD .RE On each command line, the string from .RB ' # ' to the end of line and a null line are ignored. When the line ends with .RB ' \e ', it is referred as continuing into the next line, so that you can split a long line with this. .SS Builtin Commands .B Fd has the following builtin commands. These builtin commands can be used in .B EXECUTE_SH and the initial configuration file. .IP "\fBif\fP \fIlist\fR \fBthen\fP [\fBelif\fP \fIlist\fR \fBthen\fP \fIlist\fR] .\|.\|. [\fBelse\fP \fIlist\fR] \fBfi\fP" 14 The .I list of .B if clause and .B elif clauses are executed in order, and if each exit status is a 0, then the .I list of .B then clause associated with it is executed and the .B elif clauses after it are ignored. If no .I list of .B if clause nor .B elif clauses return a 0, the .I list of .B else clause is executed. If no .I list of .B then clauses nor .B else clause is executed, then .B if returns a .B 0 exit status. .IP "\fBwhile\fP \fIlist\fR \fBdo\fP \fIlist\fR \fBdone\fP" The .I list of .B while clause is executed repeatedly, and while its exit status is 0, the .I list of .B do clause is executed repeatedly. If the .I list of .B do clause is never executed, then .B while returns a .B 0 exit status. .IP "\fBuntil\fP \fIlist\fR \fBdo\fP \fIlist\fR \fBdone\fP" The .I list of .B until clause is executed repeatedly, and while its exit status is NOT 0, the .I list of .B do clause is executed repeatedly. If the .I list of .B do clause is never executed, then .B until returns a .B 0 exit status. .IP "\fBfor\fP \fINAME\fR [\fBin\fP \fIvalue\fR .\|.\|.] \fBdo\fP \fIlist\fR \fBdone\fP" .I NAME the internal variable is substituted for values of .I value one by one, and .I list is executed according to the each value. If .B in .I value is omitted, then each positional parameter is substituted one by one. .IP "\fBcase\fP \fIword\fR \fBin\fP [\fIpattern\fR [\fB\(bv\fP \fIpattern\fR] .\|.\|. \fB)\fP \fIlist\fR \fB;\|;\fP] .\|.\|. \fBesac\fP" The string .I word is compared with the each .IR pattern , .I list associated with the .I pattern which first matches it is executed. .IP "\fB(\fP\fIlist\fR\fB)\fP" Execute .I list in a sub shell. .IP "\fB{\fP \fIlist\fR\fB;\fP \fB}\fP" Execute .I list in the current shell. .IP "\fINAME\fR\fB=\fP[\fIvalue\fR] [\fIcom\fR .\|.\|.]" Define a internal variable which is available only in .BR fd . It substitutes the value (string) .I value for .I NAME the internal variable. When you describe the command .I com after the definition of a variable, .I com is executed on the state where this variable is regarded as the environment variable. In this case, the definition of .I NAME is not remain as the environment variable nor the internal variable. If .I value is omitted, the value of .I NAME the internal variable is defined as a null. If you want to delete the definition of a internal variable, use .B unset the builtin command. .IP "\fIname\fR\fB()\fP \fB{\fP \fIlist\fR; \fB}\fP" Define a function whose body is .IR list , as the name of .IR name . The defined function can be used in the command line of .B EXECUTE_SH and each command macro described below. You can use the positional parameter .BI $ n in each description of .IR list , which indicates the argument when the function is invoked. .B $0 is .I name itself, and .BR $1 \- $9 indicates each argument. Although you cannot omit .B { } and .IR list , you can omit .B { } before/after .I list which consists of a single command. If you want to delete the definition of a function, use .B unset the builtin command. .IP "\fB!\fP\fInum\fR" Execute the command which has the history number specified with the numeric value .IR num . When .I num is negative value, it executes the command which has the history number as the current history number minus .IR num . .IP "\fB!!\fP" Execute the previous command. This is synonym for .BR !\-1 . .IP "\fB!\fP\fIstr\fR" Execute the command history which starts with the string .IR str . .IP "\fB:\fP [\fIarg\fR .\|.\|.]" No effect. But it evaluates .I arg and performs redirection. .IP "\fB.\fP \fIfile\fR" .PD 0 .IP "\fBsource\fP \fIfile\fR" .PD Read and evaluate commands from .IR file . .I File must exists on the directory which .B PATH includes, or be described with pathname. The each line format is based on the format of .BR EXECUTE_SH . You can describe this in the file as nesting. .IP "\fBaccept\fP [\fIfd\fR]" Accept the connection with the file descriptor indicated by .IR fd , and the connected socket will be assign to .I fd of the same file descriptor. At the same time, the accepted socket will be closed. When .I fd is not the redirection as the form of .BR bind:// , this command will be failed. In comparison with the redirection as the form of .BR accept:// , the shell can receive controls before establishing connection to negotiate the TCP port number with the remote host in advance. .B (UNIX) If .I fd is omitted, the connection will be accepted with the standard input. .IP "\fBaddcr\fP [\fB-1\fP] [\fIfile\fR]" Output the string read from the file specified by .IR file , line by line. The newline of each line is unified into CR-NL (\er\en). It is useful to pipe the output to some socket. If .I file is omitted, it is regarded as the standard input is specified. If .B \-1 is specified, it will output just 1 line and exit. .IP "\fBalias\fP [\fIname\fR[\fB=\fP\fIcom\fR]]" Define a alias whose body is .IR com , as the name of .IR name . The defined alias can be used in the command line of .B EXECUTE_SH and each command macro described below. The alias substitution is performed recursively. If .I com is omitted, the alias of .I name is displayed. If both .I com and .I name are omitted, all the current alias definition list is displayed. .IP "\fBarch\fP \fIext\fR [\fIpack unpack\fR]" Register the archiver command associated with the archive file which has .I ext the extension. The pack command is specified as .IR pack , and the unpack command is specified as .IR unpack , using the macro representation quoted with \fB"\fP. When .I ext starts with .BR / , uppercase/lowercase is ignored in the comparison of any extension. If both .I pack and .I unpack are omitted, the archiver command registration for .I ext the extension is deleted. .IP "\fBbg\fP [\fIjob\fR]" Continue the execution of the job specified with .I job in the background. The following format is available to specify a job. .B (UNIX) .RS 20 .ta 0.5i .nf \fB%\fP \fB%+\fP the current job \fB%\-\fP the previous job \fB%\fP\fIn\fR the job with job number \fIn\fR \fB%\fP\fIstr\fR the job whose command line starts with \fIstr\fR .fi .RE .RS But, you must describe these .B % in the command line of .B EXECUTE_SH as the duplicated expression, such as .BR %% , for the reason of the parameter macro function described below. If .I job is omitted, the current job is continued in the background. .RE .IP "\fBbind\fP \fIc\fR [\fIcom1\fR [\fIcom2\fR] [\fB:\fP\fIcomment\fR]]" Bind the command .I com1 to the key .IR c . When you want to specify a control character for .IR c , you can prefix .B ^ into 2 characters, such as ^A. When you want to specify a character with the META key (or the ALT key on MS-DOS version), you can prefix .B @ into 2 characters, such as @a. When you want to specify a function key and a special key, you can use each identifier described in .B keymap command after, such as F10. Or you can describe the escape sequence, such as .B \en and .BR \ee , and the octal expression, such as .BR \eooo . In case of binding the internal command of .BR fd , you can the command identifier as it is. When you want to define the internal command with some arguments or define the command in the macro representation, you should describe the string quoted with \fB"\fP. If .I com2 is not omitted, .I com2 is executed when the cursor position indicates a directory. When the key .I c is the function key of F1-F20, if you describe .I comment prefixed with .B : trailing the command description, you can change the display of associated part in the function line into .IR comment . However, note that, with the key binding for the control key, the configuration in the edit mode described below is prior to the key binding. If both .I com1 and .I com2 are omitted, the registration of key binding for the key .I c is deleted. .IP "\fBbreak\fP [\fIn\fR]" Exit from the loop, it is used in the .B for statement and so on. If .I n is specified, it breaks .I n levels from the loop. .IP "\fBbrowse\fP [\fB\-@\fP \fIfile\fR]" .PD 0 .IP "\fBbrowse\fP \fIcom\fR [\fB\-ftbie\fP \fIarg\fR] [\fB\-p\fP \fIcom2\fR] [\fB\-dn\fP {\fBnoprep\fP,\fBloop\fP}] .\|.\|." .PD Execute .I com the command, and invoke the archive browser who receives its output. You should the macro representation quoted with \fB"\fP as .IR com . .BR \-f , .BR \-t , .BR \-b , .B \-i and .B \-e options are the same as the one for .B launch the builtin command. In case that multiple .IR com s are specified, the next .I com the command is executed one after another when you select each files in the archive browser, and the formats and patterns described after each .I com the command are adopted. In order to return to the previous level of archive browser, you should select the file named as .B .\|. or push the key .RB [ Bs ]. Or you can use .B QUIT_SYSTEM the command to escape from all of the archive browsers invoked by .BR browse . You must describe .B \-f option, except for the last .I com the command. When the last .I com has no .B \-f option, the command has been just executed instead of invoking an archive browser, and then will return to the previous archive browser when it is done. When you specify .B \-p option, the execution of .I com2 the command precedes the execution of the next .I com the command when you select a file. While .I com is executed in the sub shell for a pipeline, .I com2 is executed in the current shell to inherit the values of internal variables set in this command after .I com2 has been done. The filenames which is selected toward this level of archive browser are held in positional parameters sequentially, and the last selected filename is held in .BR $1 . These parameters will be newly set whenever you select a file, so that they are reset in sequential order when you select the next file even if you replace them with .B set or .B shift the builtin command. .B \-d and .B \-n options specify a control if the selected file is a directory or not respectively. When you specify .BR noprep , .I com2 specified by .B \-p option is not executed. When you specify .BR loop , you don't step the next .I com the command but the same .I com the command again. And when you think troublesome to describe too many arguments for .BR browse , you can specify .I file the file in which some arguments are described with .B \-@ option. You can describe .B \-@ option in any place of arguments, the arguments described in .I file are inserted in the place where .B \-@ is described. If you specify .B \- as .IR file , arguments are read from the standard input instead of the file. You should describe arguments in .I file with spaces or newlines as separator. The null line and the line started with .B # will be ignored. When you describe .B \-@ option in .IR file , the argument file is referred recursively. .IP "\fBbuiltin\fP \fIarg\fR .\|.\|." Execute .I arg as a simple builtin command. When the same named function is defined, the function will not be executed. .IP "\fBcd\fP [\fB\-LP\fP] [\fIdir\fR]" .PD 0 .IP "\fBchdir\fP [\fB\-LP\fP] [\fIdir\fR]" .PD Change the current directory in .B fd to .IR dir . If .I dir is omitted, it moves to the directory indicated by .B HOME the internal variable. If you specify the pathname as "\fB.\fP", "\fB?\fP", "\fB\-\fP", "\fB@\fP", it behaves like as .BR LOG_DIR . If .B \-L is specified, the logical pathname following symbolic links is used. If .B \-P is specified, the physical pathname following no symbolic links is used. Otherwise, the .B physical option for .B set the builtin command is effective. .IP "\fBcheckid\fP [\fIfile\fR .\|.\|.]" Calculate the unique ID of the specified file and display it, according to the MD5 algorithm in RFC1321. When you specify multiple .IR file s, the IDs of all specified files are calculated and displayed. When you specify nothing, the ID of running .B fd itself is displayed. Since this algorithm is guaranteed to be secure, it is available to confirm the identity of files. .IP "\fBcls\fP" Clear the screen. .IP "\fBcommand\fP [\fB\-p\fP | \fB\-v\fP | \fB\-V\fP] \fIarg\fR .\|.\|." Execute .I arg as a simple command. When the same named function is defined, the function will not be executed. If .B \-p is specified, the default value of .B PATH is used to search the path. If .B \-v is specified, the absolute path for .I arg is displayed instead of executing .IR arg . In this case, .I arg the builtin command will cause simply its name. If .B \-V is specified, verbose description for .I arg is displayed as same as .BR type . .IP "\fBcontinue\fP \fIn\fR" Resume the next iteration in the loop, it is used in the .B for statement and so on. If .I n is specified, it resumes the next iteration in the loop .I n - 1 levels out of the loop. .IP "\fBcopy\fP [\fB\-ABVY\-Y\fP] \fIsrc\fR [\fB\-AB\fP] [\fB\+\fP \fIsrc2\fR [\fB\-AB\fP] [\fB\+\fP .\|.\|.]] [\fIdest\fR [\fB\-AB\fP]]" Copy the file indicated by .I src into the file or the directory indicated by .IR dest . When .I dest indicates a directory, the filename in the destination is .IR src . If .I dest is omitted, it is copied into the current directory. You can specify multiple source files by describing to separate them with .BR \+ , or by using the wildcard. When you separate them with .BR \+ , those files are concatenated and copied. When you use the wildcard, they are copied one by one in case that the destination is a directory, and they are concatenated in case that the destination is a file. When you specify .BR \-A , it is treated as the ASCII text file. When you specify .BR \-B , it is treated as the binary file. When you specify .BR \-V , it is verified to copy. When you specify .BR \-Y , it doesn't prompts for confirming to overwrite into the destination. When you specify .BR \-\-Y , it prompts for confirmation before overwriting into the destination. (MS-DOS version requires to use .B / instead of .B \- as an option prefix for compatibility with COMMAND.COM.) .IP "\fBdel\fP [\fB\-P\fP] \fIfile\fR" .PD 0 .IP "\fBerase\fP [\fB\-P\fP] \fIfile\fR" .PD Delete the files indicated by .IR file . You can specify multiple files by using wildcard. When you specify .BR \-P , it prompts for confirmation before deleting files. (MS-DOS version requires to use .B / instead of .B \- as an option prefix for compatibility with COMMAND.COM.) .IP "\fBdir\fP [\fB\-\fP[\fB\-\fP]\fBPWSBLV4\fP] [\fB\-A\fP[\fBDRHSA\-\fP]] [\fB\-O\fP[\fBNSEDGA\-\fP]] [\fIdir\fR]" List files and sub directories in the directory indicated by .IR dir . If .I dir is omitted, the information in the current directory is listed. When you specify .BR \-P , it prompts for every screen. When you specify .BR \-W , it is listed in the wide view. When you specify .BR \-A , it lists only the files which have the attribute indicated by the trailing character. .RS 20 .ta 0.3i 2i 2.3i .nf \fBD\fP directory \fBR\fP read only file \fBH\fP hidden file \fBS\fP system file \fBA\fP ready to archive \fB\-\fP except it .fi .RE .RS When you specify .BR \-O , it sorts with the sorted type indicated by the trailing character. .RE .RS 20 .ta 0.3i 2i 2.3i .nf \fBN\fP by name \fBS\fP by size \fBE\fP by extension \fBD\fP by date & time \fBG\fP directory first \fBA\fP by last access time \fB\-\fP reverse order .fi .RE .RS When you specify .BR \-S , it lists files in all sub directories. When you specify .BR \-B , it displays only names of files and directories. When you specify .BR \-L , it uses lowercase. When you specify .BR \-V , it lists the verbose information. When you specify .BR \-4 , it displays year with 4 digits. And you can prefix .B \- to any option letter to override the option. (MS-DOS version requires to use .B / instead of .B \- as an option prefix for compatibility with COMMAND.COM.) .RE .IP "\fBdirs\fP" Display the list of the current directory stack. .B Pushd and .B popd the builtin command can load/unload directories onto the directory stack. .IP "\fBdisown\fP [\fIjob\fR]" Remove the job specified with .I job from the shell control. The job to be .BR disown ed cannot be controlled by .BR jobs , .B fg and .BR bg . If invoked as a login shell, any jobs not to be .BR disown ed will be forced to exit when the shell finish. .B (UNIX) If .I job is omitted, the current job is removed from the shell control. .IP "\fBdtype\fP \fIfile\fR" Display the contents of the file indicated by .IR file . .IP "\fBecho\fP [\fB\-nN\fP] [\fIarg\fR .\|.\|.]" Echo .I arg to the standard output. When you don't specify .BR \-n , newline is added to output trailing after .IR arg . When you specify .BR \-N , the outputted newline becomes CR-NL (\er\en). See .BR echo (1) for details. .IP "\fBenable\fP [\fB\-n\fP] [\fIarg\fR .\|.\|.]" Enable .I arg as a builtin command. When you specify .BR \-n , it is disabled. If .I arg is omitted, all of the enabled or disabled builtin commands is listed. .IP "\fBeval\fP [\fIarg\fR .\|.\|.]" Evaluate .I arg and execute the results. .IP "\fBevalmacro\fP [\fIarg\fR .\|.\|.]" Evaluate parameter macros included in .I arg and execute the results. Since .B eval doesn't evaluate any parameter macro, you should choose them according to uses. When in the function, you cannot use any parameter macro, then you need this command to extract parameter macros. .IP "\fBexec\fP [\fIcom\fR [\fIarg .\|.\|.\fR]]" Execute .I com in place of the execution of .BR fd . You can specify .I arg as arguments of .IR com . .IP "\fBexit\fP [\fIn\fR]" Exit from .BR fd . When you specify .IR n , it exits with the exit status .IR n . .IP "\fBexport\fP [\fINAME\fR[\fB=\fP[\fIvalue\fR]] .\|.\|.]" Mark .I NAME the internal variable to be inherited to child processes as the environment variable. Since then, the definition of .I NAME can be referred in any child process. When you .B export the undefined internal variable, it doesn't become the environment variable until the internal variable is defined. When you want to define the value at the same time, you should specify .IR value . If only .B = is specified and .I value is omitted, the value of .I NAME the environment variable is defined as a null. If no argument is specified, all of the .BR export ed environment variables is listed. When you want to delete the definition of the environment variable, you can use .B unset the builtin command. .IP "\fBfalse\fP" Only return with a .B 1 exit status. .IP "\fBfc\fP [\fB\-l\fP | \fB\-s\fP [\fIold\fR\fB=\fP\fInew\fR .\|.\|.]] [\fB\-nr \fP] [\fB\-e\fP \fIeditor\fR] [\fIfirst\fR [\fIlast\fR]]" List or edit command histories. .I First and .I last select the range of command histories. This specification can be described as a numeric value or a string. A positive value means the command history number, and a negative value means the command history which has the history number as the current history number minus the value. A string mean the command history which starts with the string. If .B \-n is specified, command histories are listed without their history numbers. If .B \-r is specified, command histories are listed in reverse order. If .B \-e is specified, the editor named by .I editor is used to edit command histories, otherwise the editor specified by .B FCEDIT or .B EDITOR the internal variable is used. When .B \-l is specified, selected command histories are listed to the standard output. In this case, omitting .I last means to specify the current history number, and also omitting .I first means to specify .BR \-16 . When .B \-s is specified, the command history selected by .I first is executed immediately. In this case, omitting .I first means to specify the current history number. The first occurrence of the string .I old in the command history will be replaced by the string .I new before execution. When neither .B \-l nor .B \-s is not specified, selected command histories are edited, and then each edited commands are executed one by one with display in the standard output. In this case, omitting .I last means to specify .IR first , and also omitting .I first means to specify the current history number for both. .IP "\fBfd\fP [\fIdirectory\fR [\fIdirectory2\fR]]" Invoke .B fd from the internal shell. If you specify .IR directory , the current directory is moved to the directory initially. If you specify .IR directory2 , the split window mode is invoked, and the current directory of the supplemental window is moved to the directory. You can return to the internal shell by .BR QUIT_SYSTEM . It is effective only when it is invoked as .BR fdsh . .IP "\fBfg\fP [\fIjob\fR]" Continue the execution of the job specified with .I job in the foreground. The following format is available to specify a job. .B (UNIX) .RS 20 .ta 0.5i .nf \fB%\fP \fB%+\fP the current job \fB%\-\fP the previous job \fB%\fP\fIn\fR the job with job number \fIn\fR \fB%\fP\fIstr\fR the job whose command line starts with \fIstr\fR .fi .RE .RS But, you must describe these .B % in the command line of .B EXECUTE_SH as the duplicated expression, such as .BR %% , for the reason of the parameter macro function described below. If .I job is omitted, the current job is continued in the foreground. .RE .IP "\fBgetfreq\fP [\fIfile\fR]" Output the contents of the translation frequency file, specified by .IR file , to the standard output for the users Kana-Kanji translation learning. The output format provides one record per line, which consists of "Yomi-Gana", "word" and "frequency" separated by tab. You can use this output as the argument of .B setfreq to import the frequency information. If .I file is omitted, it is regarded as the translation frequency file specified by .B FREQFILE the internal variable. .B (UNIX) .IP "\fBgetkey\fP [\fInum\fR]" Get the key code sequence for the pushed key. It prompts after executed, and displays the key code sequence for the key which you push to specify. It continues until you push any key .I num times. When .I num is more than .B 1 time, you can stop it with pushing .RB [ Space ]. When .I num is .B 0 time, it continues forever until .RB [ Space ] is pushed. The displayed sequence can be used as the key code sequence for .B keymap command. .B (UNIX) If .I num is omitted, it is regarded as .B 1 time is specified. .IP "\fBgetopts\fP \fIoptstr\fR \fINAME\fR [\fIarg .\|.\|.\fR]" Used to parse the optional parameters from a sequence of .IR arg . The valid characters as option is described in .IR optstr . An option character which needs an argument is described with following .B : in .IR optstr . Each time .B getopts is invoked, the new option character parsed from .I arg is substituted for .I NAME the internal variable. When the option has an argument, the argument is substituted for .B OPTARG the internal variable. And the index of the next parameter is substituted for .B OPTIND the internal variable every time. The value of .B OPTIND is initialized to .B 1 whenever the shell is invoked, another parsing of option parameters needs initializing .B OPTIND to .B 1 manually. If .I arg is omitted, positional parameters are parsed to the optional parameters. When the end of option is encountered, .B getopts will exit with the value of .BR 1 . In this case, .B ? is substituted for .IR NAME . When an option character which is not included in .I optstr is found, an error message is written to the standard error, then .B ? is substituted for .I NAME and .B OPTARG is unset. But, if .B OPTARG is started with .BR : , no error message is written, and the found option character is substituted for .B OPTARG instead. When no argument is found with the option character which needs an argument, an error message is written to the standard error, then .B ? is substituted for .I NAME and .B OPTARG is unset. But, if .B OPTARG is started with .BR : , no error message is written, then the found option character is substituted for .B OPTARG instead, and .B : is substituted for .IR NAME . .IP "\fBhash\fP [\fB\-r\fP \(bv \fIcom\fR .\|.\|.]" Search the absolute path for .I com referring to .BR PATH , which indicates the search path when the external command is executed, and register the result in the hash table. When you specify .B \-r instead of .IR com , all the memorized hash table is discarded. If .I com is omitted, the hash table information is listed. .BR hits , .BR cost , .B command indicate the number of times the command has been executed, the measure of the work required to search it in the search path, and the absolute path for the command, respectively. When the command is searched in a relative directory, it is necessary to re-search whenever the current directory is moved, because it is not registered as the absolute path. In such command, .B \(** trailing .B hits is displayed. .IP "\fBhistory\fP [\fIn\fR]" List the last .I n command histories with the history number. If .I n is omitted, all of the memorized command histories is listed. .IP "\fBjobs\fP" List the running jobs. .B (UNIX) .IP "\fBkconv\fP [\fB\-i\fP \fIin\fR] [\fB\-o\fP \fIout\fR] [\fIinfile\fR [\fIoutfile\fR]]" Read from .I infile and convert its Kanji code from .I in to .IR out , and output to .IR outfile . In .I in and .IR out , you can specify the string which used in .B FNAMEKCODE the internal variable described below. If each of them is omitted, it is regarded as that the Kanji code specified in compile is specified. If .I outfile is omitted, it outputs to the standard output. If also .I infile is omitted, it reads from the standard input. .B (UNIX) .IP "\fBkeymap\fP [\fIc\fR [\fIstr\fR]]" Map the sequence .I str as key code of the special key .IR c . You can use only the following identifiers as .IR c . .B (UNIX) .RS 20 .ta 0.9i 2i 2.9i .nf \fBUP\fP Up \fBDOWN\fP Down \fBRIGHT\fP Right \fBLEFT\fP Left \fBBEG\fP Begin \fBEOL\fP Eol \fBHOME\fP Home \fBEND\fP End \fBINS\fP Insert \fBDEL\fP Delete \fBINSLIN\fP InsLine \fBDELLIN\fP DelLine \fBPPAGE\fP PageUp \fBNPAGE\fP PageDown \fBENTER\fP Enter \fBBS\fP Bs \fBCLR\fP Clear \fBHELP\fP Help \fBPLUS\fP + (tenkey) \fBMINUS\fP - (tenkey) \fBASTER\fP \(** (tenkey) \fBSLASH\fP / (tenkey) \fBCOMMA\fP , (tenkey) \fBDOT\fP . (tenkey) \fBEQUAL\fP = (tenkey) \fBRET\fP Return (tenkey) \fBTK0\fP.\|.\fBTK9\fP 0-9 (tenkey) \fBF1\fP.\|.\|.\fBF20\fP function key .fi .RE .RS You can use the escape sequence in the key code sequence, such as .B \en =0x0a and .B \ee =0x1b. You can also use the octal expression, such as .BR \eooo . You can describe the control character prefixing .BR ^ , such as ^A. .B ^ itself can be described as .BR \e^ . If .I str is omitted, the key code sequence for .I c is displayed. If both .I str and .I c are omitted, all of the mappings for special keys is listed. When you specify .I str as \fB"\|"\fP, the key code mapping for .I c is canceled. .RE .IP "\fBkill\fP [\fB\-l\fP \(bv \fB\-\fP\fIsignal\fR] [\fIpid\fR \(bv \fIjob\fR .\|.\|.]" Send the signal indicated by .I signal to the process indicated by the process number .I pid or to the job indicated by .IR job . .I Signal is described as a numeric value or a signal name. If .I signal is omitted, .B SIGTERM is send. When you specify .BR \-l , it lists the signal names which can be used as .I signal instead of sending a signal. .IP "\fBlaunch\fP \fIext\fR [\fIcom\fR [\fIformat\fR [\fItop\fR \fIbottom\fR]]]" .PD 0 .IP "\fBlaunch\fP \fIext\fR \fIcom\fR [\fB\-f\fP \fIformat\fR] [\fB\-t\fP \fItop\fR\] [\fB\-b\fP \fIbottom\fR] [\fB\-ie\fP \fIpatt\fR\]" .PD Register the behavior for .I ext the extension as the launcher. You should the macro representation quoted with \fB"\fP as .IR com . When you register an archive browser, you should describe the command to list the archived files as .IR com , and describe the format of the list as .IR format . When you describe .I top and .IR bottom , you can specify unnecessary lines in the list as the number of lines from the top/bottom line. When .I ext starts with .BR / , uppercase/lowercase is ignored in the comparison of any extension. If .I com is omitted, the launcher registration for .I ext is canceled. When you register an archive browser, you can use the latter form to describe more detailed control. You can specify multiple formats as candidates with multiple .B \-f options. These candidates for format are compared in order of appearance, if no one is matched completely then the nearest one is adopted. .B \-i and .B \-e options specify .I patt the pattern for the line to be ignored and for the line to be treated as error respectively. When the list includes unnecessary lines you can specify also .I top and .IR bottom , but you must specify lines except top/bottom lines with .B \-i option. In case that a failure to unpack files in the archive file causes outputting some strings, you can specify the strings with .B \-e option. .B \-i and .B \-e options can specify multiple patterns, and they are effective if one of them is matched. And you can use a wildcard in the description for each .I patt the pattern. .IP "\fBmd\fP \fIdir\fR" Create the directory .IR dir . .IP "\fBmkdir\fP \fIdir\fR" Same as .BR md . .B (DOS) .IP "\fBnewgrp\fP [\fIarg .\|.\|.\fR]" Execute .BR newgrp (1) in place of the execution of .BR fd . You can specify .I arg as arguments of .BR newgrp (1). See .BR newgrp (1) for details. .B (UNIX) .IP "\fBlogin\fP [\fIarg .\|.\|.\fR]" Execute .BR login (1) in place of the execution of .BR fd . You can specify .I arg as arguments of .BR login (1). See .BR login (1) for details. .B (UNIX) .IP "\fBlogout\fP [\fIn\fR]" Exit from a login shell. When you specify .IR n , it exits with the exit status .IR n . .IP "\fBpopd\fP" Unload the top directory onto the directory stack, and change the current directory in .B fd to the directory. This command is failed when the directory stack is empty. .IP "\fBprintarch\fP [\fIext\fR]" Print the archiver commands registered for the archive file which has .I ext the extension. If .I ext is omitted, all of the registered archiver commands is listed. .IP "\fBprintbind\fP [\fIc\fR]" Print the command binded to the key .IR c . You can specify the key as well as .BR bind . If .I c is omitted, all of the registered key bindings is listed, which is defined not as the internal command but as the command macro. The key bindings of internal commands can be referred in .BR HELP_MESSAGE . .IP "\fBprintdrv\fP [\fIc\fR]" Print the device file and the number of heads/sectors/cylinders of the floppy drive registered for the drive name .IR c . .B (UNIX) If .I c is omitted, all of the registered floppy drives is listed. .IP "\fBprintlaunch\fP [\fIext\fR]" Print the command macro registered as the launcher for .I ext the extension. When it is registered as the archive browser, the format for listing is also printed. If .I ext is omitted, all of the registered launchers is listed. .IP "\fBprintroman\fP [\fIroman\fR]" Print the Roman-Kana translation table for the Kana-Kanji IME mode. It means printing the Japanese string bound for .I roman the Roman string. .B (UNIX) If .I roman is omitted, all the registered Roman-Kana translation table is listed. .IP "\fBpushd\fP [\fIdir\fR]" Load the current directory onto the directory stack, and change the current directory in .B fd to .IR dir . If you specify the pathname as "\fB.\fP", "\fB?\fP", "\fB\-\fP", "\fB@\fP", it behaves like as .BR LOG_DIR . The .B physical option for .B set the builtin command is effective for symbolic links. If .I dir is omitted, change the current directory to the top directory of the directory stack, and replace it with the current directory. In this case, this command is failed when the directory stack is empty. .IP "\fBpwd\fP [\fB\-LP\fP]" Display the current directory with the absolute representation. If .B \-L is specified, the logical pathname following symbolic links is displayed. If .B \-P is specified, the physical pathname following no symbolic links is displayed. Otherwise, the .B physical option for .B set the builtin command is effective. .IP "\fBread\fP [\fB-N\fP] [\fINAME .\|.\|.\fR]" Read one line from the standard input and substitute that string for .I NAME the internal variable. The inputted string is separated with .B IFS into some words. When multiple .IR NAME s are specified, words are substituted one by one from the first of line, and all the rest are substituted for the last .IR NAME . When the number of words in inputted string is less than the number of .IR NAME , a null is substituted for the rest of .IR NAME . If .B \-N is specified, the newline of the line to be read is regarded as CR-NL (\er\en). .IP "\fBreadline\fP [\fIprompt\fR]" Read one line from the terminal input and output that string to the standard output. When .I prompt is specified, the string is displayed on the beginning of input line. This command differs from .B read the builtin command in the terminal input and the line editing. You cannot use the history as one of the line editing, but can use the completion for a pathname. .IP "\fBreadonly\fP [\fINAME\fR[\fB=\fP[\fIvalue\fR]] .\|.\|.]" Mark .I NAME the internal variable to be readonly. Since then, you cannot change the value of .IR NAME . When you want to define the value at the same time, you should specify .IR value . If only .B = is specified and .I value is omitted, the value of .I NAME the internal variable is defined as a null. If no argument is specified, all of the readonly internal variables is listed. .IP "\fBrd\fP \fIdir\fR" Delete the directory .IR dir . You cannot delete the non-empty directory. .IP "\fBrmdir\fP \fIdir\fR" Same as .BR rd . .B (DOS) .IP "\fBren\fP \fIold\fR \fInew\fR" .PD 0 .IP "\fBrename\fP \fIold\fR \fInew\fR" .PD Rename the filename or the directory name .I old into .IR new . You can specify the wildcard in .I old and .I new to rename the multiple filenames all together. .IP "\fBrem\fP [\fIarg\fR .\|.\|.]" No effect, same as .BR : . .IP "\fBreturn\fP [\fIn\fR]" Return from a function with the return value specified by .IR n . If .I n is omitted, the return value is the exit status of the last executed command. It cannot be used out of a function. .IP "\fBsavetty\fP [\fB-n\fP]" Save the current terminal settings. The saved settings will be restored when .B EXECUTE_SH is executed later. In case that you change terminal settings with .BR stty (1) and so on, you should save the settings with this command not to reset settings with the next execution of .BR EXECUTE_SH . If you change terminal settings and execute this command not in the same command line, you should notice that this command will save the reset settings. If .B \-n is specified, the saved settings will be cleared. .B (UNIX) .IP "\fBset\fP [\fB\-\-abCefhkmntuvx\fP] [\fB\-o\fP \fIoption\fR] [\fIarg\fR .\|.\|.]" List internal variables and functions, without any argument. When you specify .IR arg , .I arg is substituted for the positional parameter .BR $1 , .BR $2 , \&.\|.\|., .BI $ n in order. When you specify any option, each option means the following. When you use .B \+ instead of .BR \- , the option parameter turns off each option. .RS .PD 0 .IP "\fB\-a\fP" 5 .B Export any internal variable automatically when it is defined. .IP "\fB\-b\fP" When a background job has been terminated, its status report will be displayed immediately. there is no effect when the job control is not enabled. .IP "\fB\-C\fP" Prevent overwriting to any existent files in redirection. .IP "\fB\-e\fP" Exit immediately when any command returns the exit status except .BR 0 . .IP "\fB\-f\fP" Disable the wildcard expansion. .IP "\fB\-h\fP" Register any command to the hash table just before it is executed. The commands used in a function are read when it is defined, and are registered to the hash table. The command hash itself is always valid, if .B \-h option is set or not. .IP "\fB\-k\fP" Treat all .IR NAME\fB=\fP [ value ] formed arguments as the variable definition, while they are not placed on the beginning of command line string. .IP "\fB\-m\fP" Enable the job control. This option is valid by default. .B (UNIX) .IP "\fB\-n\fP" Read command inputs but don't execute them. .IP "\fB\-o\fP \fIoption\fR" The following identifiers are valid in .IR option . .RS .PD 0 .IP "\fBallexport\fP" 5 Same as .BR \-a . .IP "\fBautosavetty\fP" Same as .BR \-S . .IP "\fBemacs\fP" Same as .BR EDITMODE=emacs . .IP "\fBerrexit\fP" Same as .BR \-e . .IP "\fBhashahead\fP" Same as .BR \-h . .IP "\fBignoreeof\fP" Any .B EOF will not terminate the interactive shell. .IP "\fBkeyword\fP" Same as .BR \-k . .IP "\fBmonitor\fP" Same as .BR \-m . .IP "\fBnoclobber\fP" Same as .BR \-C . .IP "\fBnoexec\fP" Same as .BR \-n . .IP "\fBnoglob\fP" Same as .BR \-f . .IP "\fBnotify\fP" Same as .BR \-b . .IP "\fBnounset\fP" Same as .BR \-u . .IP "\fBonecmd\fP" Same as .BR \-t . .IP "\fBphysical\fP" Same as .BR \-P . .IP "\fBptyshell\fP" Same as .BR \-T . .IP "\fBverbose\fP" Same as .BR \-v . .IP "\fBvi\fP" Same as .BR EDITMODE=vi . .IP "\fBxtrace\fP" Same as .BR \-x . .RE .RS If .I option is omitted, the values of the current options are displayed. .RE .IP "\fB\-P\fP" .B Cd and .B pwd the builtin command use the physical directory structure instead of the logical directory structure following symbolic links. .IP "\fB\-S\fP" Execute .B savetty the builtin command automatically whenever any command line is processed. The terminal settings will be saved absolutely unless you operate the terminal settings intentionally, so that you should manually adjust the terminal settings saved accidentally. .B (UNIX) .IP "\fB\-T\fP" Invoke .B fdsh as the pseudo terminal. You cannot invoke any more pseudo terminals in this mode. It is effective only if you specify it as the startup option or in the initial configuration file. It is effective only if you specify it as the startup option, when the shell is executed as the non-interactive shell. It is just ignored when invoked as .BR fd . .B (UNIX) .IP "\fB\-t\fP" Exit immediately after executing the current command input. .IP "\fB\-u\fP" Treat the reference of undefined variables as an error. .IP "\fB\-v\fP" Display the command inputs whenever they are read. .IP "\fB\-x\fP" Display the command strings whenever they are executed. .IP "\fB\-\-\fP" Indicate the end of options. No flag is changed. .PD .RE .IP "\fBsetdrv\fP \fIc\fR \fIdevice\fR \fIhd\fR \fIsc\fR \fIcl\fR" Specify the device file indicated by .I device for the MS-DOS floppy drive named as .IR c . At the same time, .IR hd , .IR sc , .I cl are specified as the number of heads(sides)/sectors/cylinders(tracks) in the format which is treated in the driver of .IR device . In special case, when you want to treat the 640KB2DD(hd=2/sc=8/cl=80) floppy disk with the driver which can treat only the 820KB2DD(hd=2/sc=9/cl=80) floppy disk, you should specify the value adding .B 100 (108) as the value of .IR sc . .B (UNIX) On the PC-UNIX environment which is worked on PC, specifying the string .B HDD or .B HDD98 instead of .IR hd , .IR sc , .IR cl , can register the MS-DOS partition on the hard disk for the PC/AT compatible machine or PC-9800 series. In this case, You should describe the device file as the device name prepared per the physical drive unit rather than the device name prepared per the partition (slice). The MS-DOS partitions included in the drive unit are automatically expanded to the drive name after the drive name .IR c . When no MS-DOS partition is included in the specified drive unit, this command is ignored. You can confirm what drive name is valid by .B printdrv command. But any hard disk is registered as readonly, for security. .IP "\fBsetfreq\fP [\fIfile\fR]" Append the frequency information inputted from the standard input to the translation frequency file, specified by .IR file , for the users Kana-Kanji translation learning. The input format is based on the output format of .BR getfreq . If you want to replace, rather than to append, you must remove the translation frequency file in advance. If .I file is omitted, it is regarded as the translation frequency file specified by .B FREQFILE the internal variable. .B (UNIX) .IP "\fBsetroman\fP [\fB-c\fP] [\fB-r\fP] [\fB-f\fP \fIfile\fR] [\fIroman\fR [\fIkanji\fR]]" Setup the Roman-Kana translation table for the Kana-Kanji IME mode. It means binding .I kanji the Japanese string to .I roman the Roman string. The part over .B 4 characters of .IR roman , the string which consists of 1 byte characters only, will be ignored. The part over .B 2 characters of .IR kanji , the string which consists of multibyte characters or 1 byte characters, will be ignored. In this case, a multibyte character is counted as 1 character as well as a 1 byte character. .B (UNIX) If .I kanji is omitted, the registered binding of the Roman-Kana translation table for .I roman the Roman string will be deleted. When you specify .BR \-c , the whole Roman-Kana translation table will be cleared to be empty. When you specify .BR \-r , all the registered bindings will be reset to restore the Roman-Kana translation table. When you specify .BR \-f , the file specified by .I file will be read as bindings of the Roman-Kana translation table. In this case, a pair of .I roman and .IR kanji , which is separated by spaces, must be described in each line of .IR file . You can also use the file which contains the output of .BR printroman . .IP "\fBshift\fP [\fIn\fR]" Rename the positional parameters from .BI $ n\+1 into ones from .B $1 in order. The original positional parameters from .B $1 to .BI $ n are discarded. If .I n is omitted, it is regard as .B 1 is specified. .IP "\fBsocketinfo\fP [\fB-apAP\fP] [\fIfd\fR]" If the file descriptor specified by .I fd is a socket, the IP address and the TCP port number of the connected remote host, and the IP address and the TCP port number of the connected local host, are outputted to the standard output. If .I fd is not a socket, this command will be failed. .B (UNIX) If .I fd is omitted, it is regarded as the standard input is specified. If .B \-a is specified, only the IP address of the remote host will be outputted. If .B \-p is specified, only the TCP port number of the remote host will be outputted. If .B \-A is specified, only the IP address of the local host will be outputted. If .B \-P is specified, only the TCP port number of the local host will be outputted. .IP "\fBtest\fP [\fIexpr\fR]" .PD 0 .IP "\fB[\fP \fIexpr\fR \fB]\fP" .PD Evaluate the conditional expression .IR expr . See .BR test (1) for details. .IP "\fBtimes\fP" Display the accumulated user and system time for the processes which has so far been executed. .IP "\fBtrap\fP [\fIcom\fR] [\fIn\fR .\|.\|.]" Read and execute the command .I com when .B fd receives the signal .IR n . If .I com is omitted, the trap for the signal is reset. When you specify .I com as a null, the signal ignored. When you specify .I n as .BR 0 , the command .I com is executed on exit. If both .I com and .I n are omitted, all of the registered traps is listed. .IP "\fBtrue\fP" Only return with a .B 0 exit status. .IP "\fBtype\fP [\fIcom\fR .\|.\|.]" Display how each .I com would be treated when it is used as a command name. .IP "\fBulimit\fP [\fB\-SH\fP] [\fB\-a\fP \(bv \fB\-cdflmnstv\fP] \fIn\fR" Set the resource limits for .B fd and its child processes to the value indicated by .IR n . You can use the string .B unlimited or the numeric value in .IR n , .B unlimited means the maximum specifiable value. .B (UNIX) When you specify .BR \-H , a hard limit is set. When you specify .BR \-S , a soft limit is set. When you don't specify neither of them, both limits are set. If .I n is omitted, the current limit is displayed. When you specify .BR \-a , all of the resource limits is displayed. When you specify the following options, the each resource limit is individually set or displayed. If no option is specified, it is regarded as .B \-f is specified. .RS .PD 0 .IP "\fB\-c\fP" 5 maximum core file size (in blocks) .IP "\fB\-d\fP" maximum size of data segment (in KB) .IP "\fB\-f\fP" maximum file size (in blocks) .IP "\fB\-l\fP" maximum size of locked in memory (in KB) .IP "\fB\-m\fP" maximum size of resident set (in KB) .IP "\fB\-n\fP" maximum number of open file files .IP "\fB\-s\fP" maximum size of stack segment (in KB) .IP "\fB\-t\fP" maximum CPU time (in seconds) .IP "\fB\-v\fP" maximum size of virtual memory (in KB) .PD .RE .IP "\fBumask\fP [\fInnn\fR]" Set the file creation mask to .IR nnn . If .I nnn is omitted, the current value of the file creation mask is displayed. See .BR umask (2) for details. .IP "\fBunalias\fP \fIname\fR" Cancel the definition of the alias .IR name . You can use the wildcard in .IR name , in this case, all of the matched alias definitions is canceled. When you specify "\(**", all of the alias definitions is invalid. .IP "\fBunset\fP [\fINAME\fR .\|.\|.]" Delete the defined internal variable or function for each .IR NAME . But the following variable definition cannot be deleted. .RS 20 .ta 1i 2i 3i .nf .ft B PATH PS1 PS2 IFS MAILCHECK PPID .ft R .fi .RE .IP "\fBunsetdrv\fP \fIc\fR \fIdevice\fR \fIhd\fR \fIsc\fR \fIcl\fR" Delete the registered floppy drive. Only the registration with which all of .IR device , .IR hd , .IR sc , .I cl is corresponded is deleted, then you should confirm to delete very well. .B (UNIX) When it is registered as .B HDD or .B HDD98 in .BR setdrv , you should describe .B HDD or .B HDD98 instead of .IR hd , .IR sc , .IR cl . .IP "\fBwait\fP [\fIpid\fR \(bv \fIjob\fR]" Wait for the process indicated by .I pid or for the job indicated by .IR job , and return its exit status. If both .I pid and .I job are omitted, all running jobs are waited. .B (UNIX) .IP "\fByesno\fP [\fIprompt\fR]" Wait for a input of .B y or .B n from the terminal, and then return .B 0 when .B y is inputted, return .B 255 when .B n is inputted. Instead of input of .B y or .BR n , you can select a character from displayed .B [Y/N] with cursor keys and push .RB [ Return ] to be regarded as an input of the selected character. An input of .RB [ Space ] or .RB [ Esc ] means the input of .BR n . When .I prompt is specified, the string is displayed before .BR [Y/N] . .IP "\fICOMMAND\fR [\fIarg\fR]" Execute the internal command .I COMMAND of .BR fd . You can describe each command identifier in .IR COMMAND . The following internal commands can take a parameter argument .IR arg . .RS .PD 0 .IP "\fBCUR_UP\fP" 15 .IP "\fBCUR_DOWN\fP" .IP "\fBCUR_RIGHT\fP" .IP "\fBCUR_LEFT\fP" .IP "\fBROLL_UP\fP" .IP "\fBROLL_DOWN\fP" .IP "\fBWIDEN_WINDOW\fP" .IP "\fBNARROW_WINDOW\fP" The number of lines, columns, or pages. .IP "\fBRENAME_FILE\fP" .IP "\fBPACK_FILE\fP" .IP "\fBBACKUP_TAPE\fP" The filename. .IP "\fBLOG_DIR\fP" .IP "\fBMAKE_DIR\fP" .IP "\fBINFO_FILESYS\fP" .IP "\fBUNPACK_FILE\fP" The directory name. .IP "\fBEXECUTE_SH\fP" The command string. .IP "\fBMARK_FIND\fP" .IP "\fBFIND_FILE\fP" .IP "\fBFIND_DIR\fP" The wildcard string. .IP "\fBMARK_ALL\fP" .B 0 will reset the mark of all files, the other will mark all files. .IP "\fBSORT_DIR\fP" The number substituted for .B SORTTYPE the internal variable. .IP "\fBEDIT_CONFIG\fP" The name of internal variable to be edited. .PD .RE .PP .B ~ and .B $ in the previous registration string are expanded. But these expansions are restrained in the string quoted with .B ' instead of \fB"\fP. .SS Tree Screen Since representing the whole file system in tree structure takes too many time, only the directories which are direct ancestors and the direct sub directories are displayed, first in the tree screen. In the directories which are direct ancestors, the other sub directories (if exists) are grouped as "\fB.\|.\|.\fP". These grouped sub directories will be expanded automatically when a cursor is placed on its position. The sub directories which are not expanded yet are represented with .RB ' > ' trailing the filename, which shows as they are. Such directory is never expanded until it is required to expand explicitly, then you should expand it by the following key inputs before moving to any hidden sub directory. In the tree screen, the following key inputs are available. .PD 0 .RS .IP "\fBUp\fP, \fBDown\fP" 10 Move a cursor. .IP "\fBRight\fP" Expand the sub directory on the cursor position. .IP "\fBTab\fP" Expand the sub directory on the cursor position recursively. .IP "\fBPageUp\fP, \fBPageDown\fP" Move a cursor by half screen. .IP "\fBHome\fP(<), \fBEnd\fP(>)" Move a cursor to the top/bottom of tree. .IP "\fB?\fP" Move a cursor to the current directory. .IP "\fBBs\fP" Move a cursor to the parent directory. .IP "\fBLeft\fP" Group sub directories of the directory on the cursor position, or move a cursor to the parent directory. .IP "\fB(\fP, \fB)\fP" Move a cursor to the previous/next directory among the same level sub directories. .IP "\fBA\fP \- \fBZ\fP" Move a cursor to the directory whose name starts with the character or its lowercase. .IP "\fBl\fP" Change the directory tree into the specified directory. Moving to the floppy drive is also available. .IP "\fB^L\fP" Redraw the tree structure. .IP "\fBReturn\fP" Select the directory. .IP "\fBEsc\fP" Cancel. .RE .PD .PP When directories are recursively expanded, the machine operation is so late that it maybe seems to freeze. In this case, you can input any key while operating. If key input is recognized while expanding directories, expanding has been stopped at that moment in spite of not finishing. Even if key repeat keeps effective, any operation will be delayed for this function. .SS Archive Browser When the launcher is invoked on the position of the file whose extension is registered to associate with an archive browser, the archive browser screen has come. In this screen, you can browse files in the archive file as well as in the normal directory. But you cannot use the following internal commands in this screen. .PD 0 .PP .RS .ta 1.5i 3i 4.5i .nf .ft B LOG_TOP ATTR_FILE COPY_FILE MOVE_FILE DELETE_FILE DELETE_DIR RENAME_FILE MAKE_DIR WRITE_DIR TREE_DIR EDIT_FILE LOG_TREE COPY_TREE MOVE_TREE FIND_DIR ATTR_DIR SYMLINK_MODE DOTFILE_MODE FILEFLG_MODE SPLIT_WINDOW KILL_WINDOW .ft R .fi .RE .PD When you want to register a new archive browser, you must describe the format listed by the archiver as the following representation. One format string represents the format for 1 file in the list. .PD 0 .PP .RS .ta 1i .nf \fB%a\fP Field which indicates a file mode \fB%u\fP Field which indicates UID of a file \fB%g\fP Field which indicates GID of a file \fB%s\fP Field which indicates a file size \fB%y\fP Field which indicates a file creation year \fB%m\fP Field which indicates a file creation month (No concerning if numeric or alphabetical) \fB%d\fP Field which indicates a file creation day \fB%w\fP Field which indicates a file creation week (ignored) \fB%t\fP Field which indicates a file creation time ("HH:MM:SS" form, MM and SS can be lacking) \fB%p\fP Field which indicates a file creation am/pm \fB%B\fP Field which indicates a major device ID \fB%b\fP Field which indicates a minor device ID \fB%/\fP\fIstr\fR\fB/\fP Field which indicates a type is directory when this field string is \fIstr\fR (case insensitive) \fB%!\fP\fIstr\fR\fB!\fP 0 or more continuous fields which consists of the string \fIstr\fR (case insensitive) \fB%f\fP Field which indicates a filename \fB%x\fP Field which is needless (ignored) \fB%%\fP % itself \fB\en\fP Newline \fBSpace Tab\fP 0 or more characters of spaces or tabs .fi .RE .PD .PP In this description, the field means the area separated by spaces, tabs or newlines. When the string which indicates each information is separated by these characters, you can simply describe the above string which indicates that field. When the string is separated by another character, you should describe the above string with that separator. You can describe to indicate the field length as numeric, such as .IR %10a . This example means that the field which indicates a file mode consists of 10 characters. If you describe it with a character .B * as the field length instead of numeric, such as .IR %*f , the string to the end of line is regarded as a field, in which any space and tab will be ignored. When a field may have the different meanings according to situation, you should describe it quoted with .BR "{ }" , such as .IR %{yt} . This example means that this field indicates a creation year or a creation time. When the information for 1 file consists of multiple lines, you should place a .B \en on the position of newline in the format string. For example, the following are the format strings for the list of some archivers. While some spaces are used here for easiness to see, these spaces are not always necessary because any space between fields is ignored. .PD 0 .IP "`\fBlha l\fP'" 18 "%9a %u/%g %s %x %m %d %{yt} %f" .IP "`\fBlha v\fP' (MS\-DOS)" "%f\en%s %x %x %y-%m-%d %t" .IP "`\fBtar tvf\fP' (BSD)" "%9a %u/%g %s %m %d %t %y %f" .IP "`\fBtar tvf\fP' (SVR4)" "%a %u/%g %s %m %d %t %y %f" .PD .PP If you register archive browsers with above format, in the builtin command of .B EXECUTE_SH or in the initial configuration file, you can use the archive browser which is not prepared by default. But, if you want to execute or view files in the archive file, you must register the archiver command for the archive file, too, don't forget this. On some OS, .BR tar (1) may output the Japanese timestamp when .I japanese is substituted for .B LANG the environment variable. Since .B fd cannot analyze the representation like this, you should describe .I `export LANG=C' in the initial configuration file, or specify .B LANG in the description of listing command, such as .IR "`LANG=C tar tvf'" . .SS Floppy Drive (UNIX) You can access the MS-DOS formatted floppy disk, by representing to prefix "\fIc\fR\fB:\fP" to the directory name. But, it is necessary to register the floppy drive and set .B DOSDRIVE the internal variable which makes this function effective, in advance. Each registered drive is distinguished with the drive name. You should tag the physically different drive as the different drive name. When the same physical drive supports multiple formats, you can register each format with the same drive name, or the different drive name each other. If you tag the same drive name, the justice of the format is tried in registered order, so that you should register the format which you often use in the first place. Each drive of the floppy drive has the its own current directory. The default value of this is a root directory, and the current directory is moved back to a root directory again whenever you change a floppy disk. When you describe the directory name as starting with '/' after .RB ' : ', it means the absolute path representation of that drive. If this '/' is not exist, it means the relative path representation from the current directory of that drive, don't forget this. Regrettably, some internal commands like as .BR WRITE_DIR , .B INFO_FILESYS cannot support the floppy drive. Some filenames are renamed when they are copied from UNIX for reason of the filename length limit. When you use a lowercase letter as the drive name, you can access it as the floppy drive which can treat the Long File Name (LFN) for MS-Windows formatted floppy disk. In this case, you can copy a file with a long filename on UNIX as it is. But, when the UNICODE translation table .B fd\-unicd.tbl does not exist in the same directory as the invoked .B fd exists, any Kanji filename cannot be treated as LFN representation. Reversely, when you use a uppercase letter as the drive name, LFN is ignored and 8+3 formed filename is treated. MS-DOS version inherits this specification by the case of a drive name. .SS URL Drive (UNIX) You can access remote services on the network, by representing the URL string as the directory name. The URL format is \fIscheme\fR\fB://\fP[\fIuser\fR[\fB:\fP\fIpassword\fR]\fB@\fP]\fIhost\fR[\fB:\fP\fIport\fR]\fB/\fP\fIdirectory\fR\fB/\fP. You can specify .B ftp or .B http as .IR scheme . You can specify the name or IP address of the remote host as .IR host . You can specify the TCP port number as .IR port . If .I port is omitted, the default port number is used. The default port number for .B ftp is .BR 21 , and the default port number for .B http is .BR 80 . You can specify account information to connect the remote host as .I user and .IR password . If .I user is omitted, the anonymous FTP connection will be used with .BR ftp , or you will be queried as needed with .BR http . If .I password is omitted, you will be queried as needed. But, it is necessary to set .B URLDRIVE the internal variable which makes this function effective, in advance. Regrettably, some internal commands cannot support the URL drive, for the sake of restrictions of the FTP and HTTP protocols or settings of the host side. .SS String Input When you input the string, such as the pathname, the following key inputs are available. The kind of referred history differs with the input string required. In the split window mode, the current directory of another window is always placed on the top of the pathname history. .PD 0 .IP "\fBLeft\fP, \fBRight\fP" 10 Move a cursor. .IP "\fBUp\fP, \fBDown\fP" Refer the previous histories (only commands and pathnames), or move a cursor. .IP "\fBBeg\fP" Move a cursor to the beginning of string. .IP "\fBEol\fP" Move a cursor to the end of string. .IP "\fBIns\fP" Switch a input method to the insert/overwrite mode. (Default value is the insert mode.) .IP "\fBDel\fP" Delete a character on the cursor position. .IP "\fBBs\fP" Delete a character before the cursor position. .IP "\fBDelLine\fP" Delete a string after the cursor position. .IP "\fBInsLine\fP" Treat the next input character as it is, effective to input control characters. .IP "\fBEnter\fP" Insert a filename of the file on the cursor position. .IP "\fBPageUp\fP" Convert a character on the cursor position to uppercase. .IP "\fBPageDown\fP" Convert a character on the cursor position to lowercase. .IP "\fBTab\fP" Complete a pathname, a command name or a variable name on the cursor position. .RS When there are two or more completion choices, inputting this continuously can display the completion choice list. Except for command line in the internal shell, you can make a choice from this list with cursor keys and .RB [ Return ]. .RE .IP "\fB^L\fP" Redraw the input string. .IP "\fB^S\fP, \fB^R\fP" Search the previous histories (only commands and pathnames) incrementally. .IP "\fBReturn\fP" Decide the input, or decide the choice in the completion choice list. .IP "\fBEsc\fP" Cancel. .PD .PP The inputted string is expanded before evaluation as following. These expansions are also valid in the string of command macros. But these expansions are restrained in the string quoted with the quotation mark .BR ' . .IP "\fB~\fP" 8 Indicate your home directory, when it is the beginning of filename. .IP "\fB~\fP\fIuser\fR" Indicate .IR user 's home directory, when it is the beginning of filename. .B (UNIX) .IP "\fB~FD\fP" Indicate the directory where the invoked .B fd is exists, when it is the beginning of filename. .IP "\fB$\fP\fINAME\fR" .PD 0 .IP "\fB${\fP\fINAME\fR\fB}\fP" .PD Indicate the value of .I NAME the internal variable or the environment variable. When both are defined, the internal variable is prior. When both are undefined, it is replaced a null. The brace .B "{ }" separates .I NAME from its trailing characters. When .I NAME is the following character, it is replaced by the value substituted automatically by the shell. .RS .PD 0 .IP "\fB0\fP" 7 The executable filename when invoked. .IP "[\fB1\fP\-\fB9\fP]" The positional parameter. .IP "\fB\(**\fP" The all positional parameters which starts from .BR $1 . \fB"$\(**"\fR is replaced by \fB"$1 $2\fR .\|.\|.\fB"\fR. .IP "\fB@\fP" The all positional parameters which starts from .BR $1 . \fB"$@"\fR is replaced by \fB"$1" "$2"\fR .\|.\|. . .IP "\fB#\fP" The number of positional parameters. .IP "\fB\-\fP" The option flags which is set by options when invoked or .B set the builtin command. .IP "\fB?\fP" The exit status of the last executed command. .IP "\fB$\fP" The process number of the current shell. .IP "\fB!\fP" The process number of the last executed background process. .PD .RE .IP "\fB${\fP\fINAME\fR\fB:\-\fP\fIword\fR\fB}\fP" If the value except a null is substituted for .I NAME the internal variable or the environment variable, it is replaced by the value, otherwise it is replaced by .IR word . .IP "\fB${\fP\fINAME\fR\fB:=\fP\fIword\fR\fB}\fP" If the value except a null is substituted for .I NAME the internal variable or the environment variable, it is replaced by the value, otherwise .I word is substituted for .I NAME the internal variable, and this expression itself is replaced by .IR word . But you cannot substitute the value for any positional parameter. .IP "\fB${\fP\fINAME\fR\fB:?\fP\fIword\fR\fB}\fP" If the value except a null is substituted for .I NAME the internal variable or the environment variable, it is replaced by the value, otherwise display .I word and exit from the shell. If .I word is omitted, the string .RB `` "parameter null or not set" '' is displayed in its place. .IP "\fB${\fP\fINAME\fR\fB:\+\fP\fIword\fR\fB}\fP" If the value except a null is substituted for .I NAME the internal variable or the environment variable, it is replaced by .IR word , otherwise it is replaced by a null. .IP "\fB${\fP\fINAME\fR\fB\-\fP\fIword\fR\fB}\fP" If any value is substituted for .I NAME the internal variable or the environment variable, it is replaced by the value, otherwise it is replaced by .IR word . .IP "\fB${\fP\fINAME\fR\fB=\fP\fIword\fR\fB}\fP" If any value is substituted for .I NAME the internal variable or the environment variable, it is replaced by the value, otherwise .I word is substituted for .I NAME the internal variable, and this expression itself is replaces by .IR word . But you cannot substitute the value for any positional parameter. .IP "\fB${\fP\fINAME\fR\fB?\fP\fIword\fR\fB}\fP" If any value is substituted for .I NAME the internal variable or the environment variable, it is replaced by the value, otherwise display .I word and exit from the shell. If .I word is omitted, the string .RB `` "parameter null or not set" '' is displayed in its place. .IP "\fB${\fP\fINAME\fR\fB\+\fP\fIword\fR\fB}\fP" If any value is substituted for .I NAME the internal variable or the environment variable, it is replaced by .IR word , otherwise it is replaced by a null. .IP "\fB${#\fP\fINAME\fR\fB}\fP" It is replaced by the length in characters of the value of .I NAME the internal variable or the environment variable. If .I NAME is .B * or .BR @ , it is replaced by the number of positional parameters instead of the length of characters. .IP "\fB${\fP\fINAME\fR\fB%\fP\fIword\fR\fB}\fP" It is replaced by the string in which the smallest portion of the suffix matched by the .I word pattern is deleted from the value of .I NAME the internal variable or the environment variable. If .I NAME is .B * or .BR @ , each positional parameter is replaced. ( .B \e is used instead of .B % on MS-DOS version.) .IP "\fB${\fP\fINAME\fR\fB%%\fP\fIword\fR\fB}\fP" It is replaced by the string in which the largest portion of the suffix matched by the .I word pattern is deleted from the value of .I NAME the internal variable or the environment variable. If .I NAME is .B * or .BR @ , each positional parameter is replaced. ( .B \e\e is used instead of .B %% on MS-DOS version.) .IP "\fB${\fP\fINAME\fR\fB#\fP\fIword\fR\fB}\fP" It is replaced by the string in which the smallest portion of the prefix matched by the .I word pattern is deleted from the value of .I NAME the internal variable or the environment variable. If .I NAME is .B * or .BR @ , each positional parameter is replaced. .IP "\fB${\fP\fINAME\fR\fB##\fP\fIword\fR\fB}\fP" It is replaced by the string in which the largest portion of the prefix matched by the .I word pattern is deleted from the value of .I NAME the internal variable or the environment variable. If .I NAME is .B * or .BR @ , each positional parameter is replaced. .IP "\fB\e\fP\fIc\fR" It indicates a character .I c itself. You can use it when you want to use the preceding meta-character as a character with no evaluation, such as .B ~ or .BR $ . You can describe .B \e itself as "\fB\e\e\fP". But, on MS-DOS version, because .B \e which is used as the pathname delimiter must be treat as well as the normal character, .BI % c is expediently used in place of .BR \e . .PP .PD The following is replaced only in the shell which is executed by .B EXECUTE_SH and .BR EXECUTE_FILE . .IP "\fB`\fP\fIlist\fR\fB`\fP" 8 .I List is executed and this string is replaced by its standard output. .IP "\fB$(\fP\fIlist\fR\fB)\fP" .I List is executed and this string is replaced by its standard output like as \fB`\fP\fIlist\fR\fB`\fP. This differs from .BI ` list ` in the point that nested expressions are allowed. And any meta-characters such as quotes in .I list are evaluated as it is. .IP "\fB$((\fP\fIexpression\fR\fB))\fP" .I Expression the arithmetic expression is evaluated and this string is replaced by its result value. You can specify numeric values, variables and integral calculations with the following operators in .IR expression . .RS 12 .ta 1.8i 2.6i .nf (unary) (binary) arithmetic \fB+ \-\fP \fB+ \- * / %\fP boolean \fB!\fP \fB== != < > <= >= && ||\fP bit operator \fB~\fP \fB& | ^ << >>\fP parenthesis \fB( )\fP .fi .RE .IP "\fB?\fP" .PD 0 .IP "\fB\(**\fP" .IP "\fB[\fP" .IP "\fB]\fP" .PD The string including these letters is pattern-matched with existent files. When it is matched, it is replaced by all of the matched filenames which are sorted in alphabetical order. .RS .PD 0 .IP "\fB?\fP" 5 Match any single character except .BR / . .IP "\fB\(**\fP" Match any 0 or more length string not including .BR / . .IP "\fB\(**\(**\fP" Match any 0 or more length string including .BR / . .IP "\fB[\fP.\|.\|.\fB]\fP" Match any one of the characters enclosed by .BR "[ ]" . When enclosed characters include .BR \- , it matches any character whose character code is between characters before/after .BR \- . .IP "\fB[!\fP.\|.\|.\fB]\fP" Match any one of the characters not enclosed by .BR "[ ]" . .PD .PP But, when the first character of the filename is .BR . , .BR ? , .B \(** and .B \(**\(** don't match it. .RE .SS Edit Mode When you want to use some functions bound to special keys, such as a cursor key or a scroll key, such a key doesn't exist in some terminals. In such a case, substituting the string for .B EDITMODE the internal variable can make you use some control keys as alternative to these special keys. Since this alternative key function is prior to the key binding by the builtin command, the key binding is invalid for the control characters used as the alternative keys. The prepared edit modes are the following 3 modes. .IP "\fBemacs\fP" 8 .RS 12 .ta 0.5i 1.5i 2i 3i 3.5i .nf \fB^P\fP = \fBUp\fP \fB^A\fP = \fBBeg\fP \fB^N\fP = \fBDown\fP \fB^E\fP = \fBEol\fP \fB^D\fP = \fBDel\fP \fB^F\fP = \fBRight\fP \fB^Q\fP = \fBInsLine\fP \fB^B\fP = \fBLeft\fP \fB^K\fP = \fBDelLine\fP \fB^V\fP = \fBPageDn\fP \fB^Y\fP = \fBPageUp\fP \fB^O\fP = \fBEnter\fP \fB^M\fP = \fBReturn\fP \fB^I\fP = \fBTab\fP \fB^H\fP = \fBBs\fP \fB^[\fP = \fBEsc\fP \fB^G\fP = \fBEsc\fP .fi .RE .IP "\fBwordstar\fP" .RS 12 .ta 0.5i 1.5i 2i 3i 3.5i .nf \fB^E\fP = \fBUp\fP \fB^A\fP = \fBBeg\fP \fB^V\fP = \fBIns\fP \fB^N\fP = \fBDown\fP \fB^F\fP = \fBEol\fP \fB^G\fP = \fBDel\fP \fB^F\fP = \fBRight\fP \fB^W\fP = \fBHome\fP \fB^]\fP = \fBInsLine\fP \fB^S\fP = \fBLeft\fP \fB^Z\fP = \fBEnd\fP \fB^Y\fP = \fBDelLine\fP \fB^C\fP = \fBPageDn\fP \fB^R\fP = \fBPageUp\fP \fB^N\fP = \fBEnter\fP \fB^M\fP = \fBReturn\fP \fB^I\fP = \fBTab\fP \fB^H\fP = \fBBs\fP \fB^[\fP = \fBEsc\fP .fi .RE .IP "\fBvi\fP" .B Vi mode has the 2 local modes: "insert mode" and "command mode", and the function of keys are quite different with each mode. You are in the command mode when you start to input, then you must input any key among 4 keys which switch to the insert mode, in order to input normal keys. .RS 12 .ta 0.5i 1.5i 2i 3i 3.5i .nf (command mode) \fBk\fP = \fBUp\fP \fB0\fP = \fBBeg\fP \fBj\fP = \fBDown\fP \fB$\fP = \fBEol\fP \fBx\fP = \fBDel\fP \fBl\fP = \fBRight\fP \fBg\fP = \fBHome\fP \fBh\fP = \fBLeft\fP \fBG\fP = \fBEnd\fP \fBD\fP = \fBDelLine\fP \fB^F\fP = \fBPageDn\fP \fB^B\fP = \fBPageUp\fP \fBo\fP = \fBEnter\fP \fB^M\fP = \fBReturn\fP \fB^I\fP = \fBTab\fP \fB^H\fP = \fBBs\fP \fB^[\fP = \fBEsc\fP (from command mode to insert mode) \fBi\fP, \fB:\fP = only switch its mode \fBI\fP = + \fBBeg\fP \fBa\fP = + \fBRight\fP \fBA\fP = + \fBEol\fP \fBR\fP = overwrite \fBr\fP = overwrite once (insert mode) \fB^V\fP = \fBInsLine\fP \fBEsc\fP = to command mode .fi .RE .RS This key binding is so particular that it is not suitable for those who don't use .B vi editor everyday. .RE .SS Kana-Kanji IME (UNIX) You can input strings in the Kana-Kanji IME mode, if you input the key specified by .B IMEKEY or select "Kanji" from the pseudo terminal menu. The translation performance will depend on the Kana-Kanji translation dictionary .BR fd\-dict.tbl . When it does not exist in the same directory as the invoked .B fd exists, translation to Kanji will not be available. The standard installed dictionary file is the Tan-Kanji dictionary, which can support only the Tan-Kanji translation. The dictionaly such as the pubdic, which includes the Hinsi information, will bring you the Tan-Bunsetsu translation. The Ren-Bunsetsu translation is not be supported. In the Kana-Kanji IME mode, the following key inputs are available. .PD 0 .RS .IP "\fBSpace\fP" 10 Trancelate to Kanji, or select the next translation candidate. .IP "\fBLeft\fP, \fBRight\fP" .IP "\fBUp\fP, \fBDown\fP" Move a cursor in the list of the translation candidate. .IP "\fBBs\fP, \fBDel\fP" Delete a character before the cursor position. .IP "\fBTab\fP" Toggle Hiragana, Katakana, Hankaku-Kana and the direct input. .IP "\fB^L\fP" Redraw the input string. .IP "\fBReturn\fP" Decide the translation result. .IP "\fBEsc\fP" Cancel. .RE .PD .PP When you translate the string of the capital 4 digit hexadecimal prefixed by a capital letter, it is regarded as the hexadecimal showing the following Kanji code respectively. Then the menu will be displayed to select Kanji next to the Kanji code number. .PD 0 .RS .IP "\fBS\fP" 4 Shift JIS .IP "\fBE\fP" EUC-JP .IP "\fBJ\fP" JIS code (JIS X0208) .IP "\fBK\fP" Kuten code .IP "\fBU\fP" UNICODE (UCS2) .RE When you input .RB [ Space ] in the state where you decide an un-translated Kana, it is regarded as the initial reading of Kanji. Then the menu will be desplayed to select Kanji whose reading starts with the Kana. .PD .SS Parameter Macros You can use the following parameter macros in the string which is used for the registration of command macros and for executing command. But, you cannot use them in the functions, the input file for .B source command, and the initial configuration file, then you should use .B evalmacro command when you want to use any parameter macro in them. .IP "\fB%C\fP" 8 The filename on the cursor position. Or, it indicates the archive filename, in the macro to register the archiver command. .IP "\fB%X\fP" The filename except its extension on the cursor position. Or, it indicates the archive filename except its extension, in the macro to register the archiver command. Only the last one extension is removed. .BR T , .BR TA , .B M trailing .B %X are replaced by .BR %T , .BR %TA , .B %M except its extension respectively. On MS-DOS version, you can describe a trailing .B S as well as them. .IP "\fB%P\fP" The pathname of the current directory. .IP "\fB%K\fP" Prompt and return to .B fd after a command is finished. But, the meaning of .B %K is reverse in .B EXECUTE_FILE and .BR EXECUTE_SH ; it prompts by default and doesn't prompt if .B %K is specified. You can never specify to prompt in macros to register the archive browser of the launcher and macros to register the archiver command. .IP "\fB%T\fP" List marked files separated by spaces as possible. When files are so many that the command line length exceeds the OS limitation, the rest of marked files are ignored. .IP "\fB%TA\fP" List marked files as well as .BR %T , and repeat the same command for spilt files to complete all marked files. .IP "\fB%M\fP" Execute the same command as many times as marked files, sending the marked file one by one. It is useful to mark files by .B MARK_FIND and execute "mv %M %XM.bak" by .BR EXECUTE_SH . .IP "\fB%N\fP" Restrain the filename addition even if the parameter is omitted. .IP "\fB%R\fP" Make you input the additional parameter in executing a macro, if the length of command string has enough margin. The cursor position in input is placed on the position of .B %R in a macro. But, .B %R is ignored in macros to register the archive browser of the launcher, macros to register the archiver command, and .BR EXECUTE_FILE , .BR EXECUTE_SH . .IP "\fB%S\fP" The 8+3 formed filename with which the LFN formed filename on the cursor position is replaced. You can use it when you use external commands which can treat only 8+3 formed arguments. .BR T , .BR TA , .B M trailing .B %S can be described as well as .BR %X . .B (DOS) .IP "\fB%JS\fP" The Kanji code of the string enclosed by this macro is converted into Shift JIS. .B (UNIX) .IP "\fB%JE\fP" The Kanji code of the string enclosed by this macro is converted into EUC-JP. .B (UNIX) .IP "\fB%J7\fP" The Kanji code of the string enclosed by this macro is converted into 7bit JIS. .B (UNIX) .IP "\fB%J8\fP" The Kanji code of the string enclosed by this macro is converted into 8bit JIS. .B (UNIX) .IP "\fB%JJ\fP" The Kanji code of the string enclosed by this macro is converted into ISO-2022-JP. .B (UNIX) .IP "\fB%JH\fP" The Kanji code of the string enclosed by this macro is converted into HEX. .B (UNIX) .IP "\fB%JC\fP" The Kanji code of the string enclosed by this macro is converted into CAP. .B (UNIX) .IP "\fB%JU\fP" The Kanji code of the string enclosed by this macro is converted into UTF-8. .B (UNIX) .IP "\fB%JM\fP" The Kanji code of the string enclosed by this macro is converted into UTF-8 for Mac OS X. .B (UNIX) .IP "\fB%JI\fP" The Kanji code of the string enclosed by this macro is converted into UTF-8 for iconv, which is used on environments using iconv-based UTF-8 such as Linux. .B (UNIX) .IP "\fB%JA\fP" The Kanji code of the string enclosed by this macro is converted into the Kanji code which is used in the pathname indicated by the string. The variables .BR SJISPATH , .BR EUCPATH , etc. can specify what kanji code is used in each pathname. .B (UNIX) .PP When no filename parameter, such as .B %C and .BR %T , is taken with the result to expand parameter macros in a command macro, the filename on the cursor position is automatically added to the last of expanded string, as .I ./filename form. This addition is not done, in case of the input string for executing command, or when .B %N macro is specified. .SS Customize You can customize .B fd as the following ways. If you specify some configuration in multiple ways overlapped, it is prior in this order. .RS 3 .IP "\fBExecuting builtin commands with EXECUTE_SH\fP" 10 You can execute builtin commands for each registration for the internal variable definition, the environment variable definition, the alias definition, the function definition, the key binding, the keymap changing, the launcher registration, the archiver command registration, and the floppy drive registration. .IP "\fBCustomizer\fP" .B EDIT_CONFIG command is available for the internal variable definition, the key binding, the keymap changing, the launcher registration, the archiver command registration, and the floppy drive registration. .IP "\fBCommand line options\fP" You can specify the command line options as .RI ` \fB\-\fPNAME\fB=\fPvalue ' form, to define the internal variables. .IP "\fB.fd2rc\fP" You can prepare the initial configuration file .B .fd2rc on your home directory, to execute the command which is written in this file, before the startup of .BR fd . You can describe builtin commands and external commands in it to set up each configuration. Yet, when .B fdsh is invoked as a login shell, .B .fdshrc is read instead of .BR .fd2rc . The initial configuration file .B /etc/fd2rc which is prepared by a system administrator is read preceding .B .fd2rc and .BR .fdshrc . If this file exists, the initial configurations prepared by a system administrator are valid unless you intentionally delete them in .B .fd2rc and .BR .fdshrc . (On MS-DOS version, these filenames are .BR $HOME\efd2.rc , " $HOME\efdsh.rc" and .BR ~FD\efd2rc .) .IP "\fBEnvironment variables\fP" Any valid variable name as the internal variable can be valid to be defined as the environment variable in advance. But the internal variable is always prior to the environment variable in .BR fd . When the same named environment variable is used in another application, you can also use the name which .B FD_ is prefixed to each environment variable for .B fd only. This environment variable with .B FD_ is always prior to the environment variable without it, then the definition of the environment variable with .B FD_ is prior to the definition of the internal variable without .BR FD_ . .RE .SS Customizer .B EDIT_CONFIG command invokes the customizer to set up configurations interactively. You can select the category with the right/left cursor key, and select the item with the up/down cursor key, and change its content with .RB [ Return ]. When you finish to change, exit from the customizer with .RB [ Esc ]. The following categories are prepared. .PD 0 .PP .RS 3 .IP "\fBVariables\fP" 10 Change the value of internal variables. The input method is different with the variable, then you should input following the guidance on screen. .IP "\fBKey bind\fP" Change the command bound to each key. When you newly bind a command to the key with no binding, you should select "NewEntry". If you select "Delete bind", the existent key binding is deleted. .IP "\fBKey map\fP" Change the key code mapping for each special key. If you push .RB [ Esc ] when you are prompted to push the key, the existent key mapping is deleted. .B (UNIX) .IP "\fBLauncher\fP" Change the launcher registration for each extension. When you newly register a launcher for the extension with no registration, you should select "NewEntry". If you input a null line when you input a command for the launcher, the existent launcher registration is deleted. .IP "\fBArchiver\fP" Change the archiver command registration for each extension. When you newly register a archiver command for the extension with no registration, you should select "NewEntry". If you input a null line both when you input a command for pack/unpack, the existent archiver command registration is deleted. .IP "\fBDOS drive\fP" Change the floppy drive registration. When you newly register a floppy drive for the drive name with no registration, you should select "NewEntry". If you input a null line when you input a device name, the existent floppy drive registration is deleted. .B (UNIX) .IP "\fBSave\fP" Save the configurations changed with the customizer into a file, or cancel configurations to restore to the previous state. .RS 10 .IP Cancel 10 Cancel the changed configurations within the specified categories, and restore to the state before the customizer is invoked. .IP Clear Cancel all the configurations within the specified categories, and restore to the default state. .IP Load Load configurations from the specified file. .IP Save Save all the configurations within the specified categories to the specified file. .IP Overwrite Overwrite all the configurations within the specified categories to the specified existent file. The original configurations which has existed in the file are parsed, and the configuration for the same target is overwritten at the same place as possible. The configurations which are not set up at present and the configurations which are not supported by the customizer are remains as it is. .PD .PP When you specify the range of categories, all categories are selected by default, then you should turn on/off each selection with .RB [ Space ] and decide with .RB [ Return ]. .RE .RE If you try to exit from the customizer without saving after changing any configuration, you will be confirmed whether if it is right to exit without saving. While the changed configurations themselves are valid even if you exit without saving, when you want them to be valid in the next invoked .BR fd , you must save them into the initial configuration file. .SH ENVIRONMENT VARIABLES The following environment variables are valid in .BR fd . These environment variables can be valid if they are defined as the internal variables. You can specify them as the command line options in .RI ` \fB\-\fPNAME\fB=\fPvalue ' form. But the variables followed by \(** cannot be use with the prefix .B FD_ as the environment variables. .IP "\fBADJTTY\fP" 14 Reset the terminal mode forcedly to the normal state, when .B fd is finished. Invoking .B fd can adjust the terminal rightly from the state displaying broken characters. Any value except .B 0 and null effects valid. .B (UNIX) .IP "\fBANSICOLOR\fP" Colorize the file display. When the terminal which you use supports the color control escape sequence of ANSI standard, each file is displayed with color according to its file type. If the value is .BR 1 , it is colorized. If the value is .BR 2 , the background color is forced to be black, for the case that the foreground color is the same as the background color and indistinguishable. If the value is .BR 3 , the foreground color is forced to be black. .IP "\fBANSIPALETTE\fP" Specify color palette according to file type when the file display is colorized. This variable value consists of a numeric value whose maximum columns are .B 11 columns. The number of each column shows a color number, which specifies the color of file type corresponding with its column. The following are correspondence of the column number to the file type. .RS 18 .ta 0.5i .nf \fB1\fP normal file \fB2\fP background \fB3\fP directory \fB4\fP unwritable file \fB5\fP unreadable file \fB6\fP symbolic link \fB7\fP socket (or system file on MS-DOS) \fB8\fP FIFO (or label on MS-DOS) \fB9\fP block device \fB10\fP character device \fB11\fP executable file .fi .RE .RS The following are the meaning of color number specified on each column. .RE .RS 18 .ta 0.5i .nf \fB0\fP black \fB1\fP red \fB2\fP green \fB3\fP yellow \fB4\fP blue \fB5\fP magenta \fB6\fP cyan \fB7\fP white \fB8\fP default color for foreground \fB9\fP default color for background .fi .RE .RS The color number .B 8 is forced to be black, if the value of .B ANSICOLOR the variable is .BR 3 . The color number .B 9 is forced to be black, if the value of .B ANSICOLOR the variable is .BR 2 . .RE .RS When the columns are less than .B 11 or this variable is not set, the standard color palette will be applied for the file type corresponding with the following columns. The standard color palette is described with the above color number as .BR 89624351888 . .RE .IP "\fBAUTOUPDATE\fP" Specify the interval in seconds to update automatically the browser screen or the tree screen. When the key input idles for the specified seconds, the current information of file list will be updated. If this value is .BR 0 , the screen will never updated automatically. The default value is .BR 0 . .IP "\fBBASICCUSTOM\fP" Limit the internal variables for configuration only to basic variables in the customizer, to hide advanced variables. Any value except .B 0 and null effects valid. .IP "\fBCDPATH\fP\(**" Specify the search path when an argument of .B cd the builtin command does not start with .BR / . You can specify multiple paths separating with .RB ' : '. No search path is specified by default. .IP "\fBCOLUMNS\fP\(**" The variable for the columns of a terminal screen. If some value is set, this value will be replaced automatically according to changing the screen size. If no value is set, this value will remain unset. .IP "\fBCOMSPEC\fP" Specify the shell used to invoke a batch file. If undefined, the shell defined by .B SHELL the internal variable or \eCOMMAND.COM is used. .B (DOS) .IP "\fBCOPYCMD\fP\(**" Specify the default options used by .B copy the builtin command. .IP "\fBDEFCOLUMNS\fP" Specify the columns displayed in the screen when .B fd is invoked. The default value is .BR 2 . If you specify the value except .BR 1 , .BR 2 , .B 3 and .BR 5 , it is ignored. .IP "\fBDEFKCODE\fP" Specify the system default Kanji code. The arguments passed to external commands invoked from .B fd will be converted into the specified Kanji code. When you use macros such as .B %C and .BR %JJ , it will be converted into the Kanji code according to each macro. .BR JIS8 , .BR JUNET , .BR HEX , .BR CAP , etc. among them are the Kanji codes used in Samba. .B (UNIX) .RS 18 .ta 1.5i .nf \fBSJIS\fP, \fBsjis\fP Shift JIS \fBEUC\fP, \fBeuc\fP EUC-JP \fBJIS\fP, \fBjis\fP 7bit JIS \fBJIS8\fP, \fBjis8\fP 8bit JIS \fBJUNET\fP, \fBjunet\fP ISO-2022-JP \fBOJIS\fP, \fBojis\fP 7bit JIS (JIS C6226-1978 + roman) \fBOJIS8\fP, \fBojis8\fP 8bit JIS (JIS C6226-1978 + roman) \fBOJUNET\fP, \fBojunet\fP ISO-2022-JP (JIS C6226-1978 + roman) \fBHEX\fP, \fBhex\fP HEX \fBCAP\fP, \fBcap\fP CAP \fBUTF8\fP, \fButf8\fP UTF-8 \fBUTF8-mac\fP, \fBmac\fP UTF-8 for Mac OS X \fBUTF8-iconv\fP UTF-8 for iconv default no convert .fi .RE .IP "\fBDIRCOUNTLIMIT\fP" Specify the maximum number of files read from the directory in the tree screen. When the directory trailed by .RB ' > ' has no sub directory, the expanded result is not changed. If the number of files (including directories) in the directory is within this value, the directory with no sub directory is not trailed .RB ' > ' from the first. Moreover, the file list in the directory displayed on the right of screen is not displayed over this value. If this value is .BR 0 , you can realize a comfortable operation speed even in the slow machine. The default value is .B 50 files. .IP "\fBDIRCMD\fP\(**" Specify the default options used by .B dir the builtin command. .IP "\fBDIRHIST\fP" Specify the maximum number of the directory histories which can be referred by the directory input line. The default value is .BR 50 . If this value is .BR 0 , you can refer to no directory history. .IP "\fBDIRHISTFILE\fP" Specify the name of the directory history file which can be referred by the directory input line. Unless you specify it, the directory history is not loaded nor saved. The default value is not specified. .IP "\fBDIRHISTUMASK\fP" Specify the file creation mask with octal expression for the directory history file. It is used only if no existent file exists. But the mask value set by .B umask the builtin command is prior, then actual mask value is the logical OR of this value and .B umask value. .IP "\fBDISPLAYMODE\fP" Specify the filename display mode of the file list when .B fd is invoked. Each of the symbolic link mode, the file type symbol mode and the dot file display mode can be selected individually. The default value is .BR 0 . The following are specifiable values. .RS 18 .ta 0.5i 1.75i 3i .nf \fB0\fP standard \fB1\fP SYMLINK \fB2\fP FILETYPE \fB3\fP SYMLINK & FILETYPE \fB4\fP DOTFILE \fB5\fP SYMLINK & DOTFILE \fB6\fP FILETYPE & DOTFILE \fB7\fP SYMLINK & FILETYPE & DOTFILE .fi .RE .RS Moreover, on the OS which supports the file flag, if you specify the value adding .B 8 to each value, you can select the file flag display mode. .RE .IP "\fBDOSDRIVE\fP" Validate the access function to the MS-DOS floppy. If no floppy drive is registered, this validation cannot make you access the floppy. Any value except .B 0 and null effects valid. .RS On MS-DOS version, This definition can make you treat the LFN formed filename in the old DOS before Ver. 6.xx. In this case, you don't have to register any floppy drive. the access speed may be slow or some functions may be restricted for the reason to operate the disk I/O not by way of OS. .RE .IP "\fBDUMBSHELL\fP" Don't use any control sequences to edit command line in the internal shell. In the internal shell, the cursor addressing of terminal mode is not valid. In case of some terminal such as a console terminal, the cursor addressing cannot work correctly in this terminal mode, and the editing string is displayed incorrectly. When this variable is valid, while no control sequence is used to edit command line, an inefficient cursor addressing will cause restriction of some functions and failure of response. Any value except .B 0 and null effects valid. .IP "\fBEDITMODE\fP" Specify the edit mode of key input as the string. The default value is .BR emacs . The value except .BR emacs , .B wordstar and .B vi or null are specified, any control character is not converted and will be sent as it is. .IP "\fBEDITOR\fP" Specify the editor command used for editing files. .IP "\fBENV\fP\(**" Specify the additional initial configuration file when invoked as .BR fdsh . You must specify its filename as fullpath. When this variable is set, the initial configuration file is read after .BR /etc/fd2rc , and before .B .fd2rc or .BR .fdshrc . This value will be ignored if your real and effective UIDs or real and effective GIDs are different. .IP "\fBFCEDIT\fP" Specify the editor command used for .B fc the builtin command. .IP "\fBFD_VERSION\fP" A version string of the running .BR fd . .IP "\fBFNAMEKCODE\fP" Specify the Kanji code for filename. Any filename is converted into the specified Kanji code at the point of accessing the file, then you can refer to the file which has a Kanji filename from another machine on network which use a different Kanji code. The archive browser and .B browse the builtin command also refer the specified Kanji code. .BR JIS8 , .BR JUNET , .BR HEX , .BR CAP , etc. among them are the Kanji codes used in Samba. .B (UNIX) .RS 18 .ta 1.5i .nf \fBSJIS\fP, \fBsjis\fP Shift JIS \fBEUC\fP, \fBeuc\fP EUC-JP \fBJIS\fP, \fBjis\fP 7bit JIS \fBJIS8\fP, \fBjis8\fP 8bit JIS \fBJUNET\fP, \fBjunet\fP ISO-2022-JP \fBOJIS\fP, \fBojis\fP 7bit JIS (JIS C6226-1978 + roman) \fBOJIS8\fP, \fBojis8\fP 8bit JIS (JIS C6226-1978 + roman) \fBOJUNET\fP, \fBojunet\fP ISO-2022-JP (JIS C6226-1978 + roman) \fBHEX\fP, \fBhex\fP HEX \fBCAP\fP, \fBcap\fP CAP \fBUTF8\fP, \fButf8\fP UTF-8 \fBUTF8-mac\fP, \fBmac\fP UTF-8 for Mac OS X \fBUTF8-iconv\fP UTF-8 for iconv default no convert .fi .RE .IP "\fBFREQFILE\fP" Specify the translation frequency file for the users Kana-Kanji translation learning. If the filename is not defined, the frequency information will not be saved nor be referred. The default value is .BR ~/.fd_freq . .B (UNIX) .IP "\fBFREQUMASK\fP" Specify the file creation mask with octal expression for the translation frequency file for the users Kana-Kanji translation learning. The updated translation frequency file will be rebuilt, not be overwritten, so that it is used even if existent file exists. But the mask value set by .B umask the builtin command is prior, then actual mask value is the logical OR of this value and .B umask value. .B (UNIX) .IP "\fBFTPADDRESS\fP" Specify the mail address used as the password for anonymous FTP, when the URL drive connects the FTP host. The default value is .BR FDclone@ . .B (UNIX) .IP "\fBFTPLOGFILE\fP" Specify the filename to which communication logs are outputted, when the URL drive communicates with the FTP host. If it is not specified as fullpath nor you don't prepare the directory in which the log file is stored, no log will be outputted. .B (UNIX) .IP "\fBFTPPROXY\fP" Specify the URL used as the proxy server, when the URL drive connects the FTP host. The URL format is \fIscheme\fR\fB://\fP[\fIuser\fR[\fB:\fP\fIpassword\fR]\fB@\fP]\fIhost\fR[\fB:\fP\fIport\fR]. You can specify .B ftp or .B http as .IR scheme . You can specify account information to connect the proxy server as .I user and .IR password . The default value is not specified. .B (UNIX) .IP "\fBFUNCLAYOUT\fP" Specify the layout of the function line, as the form of .I n * 100 + .IR size . .I N means the number of function keys to be displayed in the function line. .I Size means the block size of function keys to be displayed. The default value is .BR 1005 . (It means 10 function keys will be displayed, 5 of which are grouped.) .IP "\fBHIDEPASSWD\fP" Suppress displaying .B * as a replacement for the inputted letter, when the URL drive requires you to input a password. Any value except .B 0 and null effects valid. .B (UNIX) .IP "\fBHISTFILE\fP" Specify the name of the command history file which can be referred by .B EXECUTE_FILE and .BR EXECUTE_SH . Unless you specify it, the command history is not loaded nor saved. The default value is .BR ~/.fd_history . (On MS-DOS version, The default value is .BR $HOME\efd.hst .) .IP "\fBHISTSIZE\fP" Specify the maximum number of the command histories which can be referred by .B EXECUTE_FILE and .BR EXECUTE_SH . The default value is .BR 50 . If this value is .BR 0 , you can refer to no command history. .IP "\fBHISTUMASK\fP" Specify the file creation mask with octal expression for the command history file. It is used only if no existent file exists. But the mask value set by .B umask the builtin command is prior, then actual mask value is the logical OR of this value and .B umask value. .IP "\fBHOME\fP\(**" Specify the default value when no argument of .B cd the builtin command is specified. When invoked as a login shell, if this variable is specified that directory becomes the current directory, otherwise your home directory is automatically defined as this value. .IP "\fBHTMLLOGFILE\fP" Specify the filename to which received HTML data log are outputted, when the URL drive communicates with the HTTP host. If it is not specified as fullpath nor you don't prepare the directory in which the log file is stored, no log will be outputted. .B (UNIX) .IP "\fBHTTPLOGFILE\fP" Specify the filename to which communication logs are outputted, when the URL drive communicates with the HTTP host. If it is not specified as fullpath nor you don't prepare the directory in which the log file is stored, no log will be outputted. .B (UNIX) .IP "\fBHTTPPROXY\fP" Specify the URL used as the proxy server, when the URL drive connects the HTTP host. The URL format is \fIscheme\fR\fB://\fP[\fIuser\fR[\fB:\fP\fIpassword\fR]\fB@\fP]\fIhost\fR[\fB:\fP\fIport\fR]. You can specify .B http as .IR scheme . You can specify account information to connect the proxy server as .I user and .IR password . The default value is not specified. .B (UNIX) .IP "\fBIFS\fP\(**" Specify the internal field separators. They are used in .B EXECUTE_SH to separate command and arguments. Space, tab and newline are specified by default. .IP "\fBIGNORECASE\fP" Ignore uppercase/lowercase when filenames are compared. Any value except .B 0 and null effects valid. .B (UNIX) .IP "\fBIMEBUFFER\fP" Specify whether if the Kana-Kanji translation table is held on memory or not. It will be fast to translate strings from Kana to Kanji. You should set this if you have enough memory. The following are specifiable values. .B (UNIX) .RS 18 .ta 0.5i 1i .nf \fB0\fP not hold on memory \fB1\fP only the Hinsi information table \fB2\fP also includes the index tables \fB3\fP hold all tables .fi .RE .IP "\fBIMELEARNING\fP" Specify the learning level with the translation frequency file for the users Kana-Kanji translation learning. The larger value will increase the importance of the frequency information. If the value is .BR 0 , the frequency information is only saved, without any reference. The default value is .BR 16 . .B (UNIX) .IP "\fBIMEKEY\fP" Specify the key to toggle the direct input mode and the Kana-Kanji IME mode when you input some strings. You can describe the same key name as .B bind command. The default value is not specified. .B (UNIX) .IP "\fBINHERITCOPY\fP" Inherit the destination timestamp from the source timestamp when .B COPY_FILE command is executed. Any value except .B 0 and null effects valid. .B (UNIX) (On MS-DOS version, the destination timestamp is always inherited, if this variable is effective or not.) .IP "\fBINPUTKCODE\fP" Specify the Kanji code for input from keyboard. When the value except the following is specified, the Kanji code specified in compile is valid. .B (UNIX) .RS 18 .ta 1.5i .nf \fBSJIS\fP, \fBsjis\fP Shift JIS \fBEUC\fP, \fBeuc\fP EUC-JP \fBUTF8\fP, \fButf8\fP UTF-8 \fBUTF8-mac\fP, \fBmac\fP UTF-8 for Mac OS X \fBUTF8-iconv\fP UTF-8 for iconv .fi .RE .IP "\fBLANGUAGE\fP" Specify the language for display character. It means not only each messages displayed by .BR fd , but also a Kanji code of filename to be converted. The following is the kind of languages, it doesn't have to be the string itself and is enough to contain the string, the value of .B LANG the environment variable also can be used. .BR JIS8 , .BR JUNET , etc. among them are the Kanji codes used in Samba. .RS 18 .ta 1.5i .nf \fBSJIS\fP, \fBsjis\fP Shift JIS \fBEUC\fP, \fBeuc\fP EUC-JP \fBJIS\fP, \fBjis\fP 7bit JIS \fBJIS8\fP, \fBjis8\fP 8bit JIS \fBJUNET\fP, \fBjunet\fP ISO-2022-JP \fBOJIS\fP, \fBojis\fP 7bit JIS (JIS C6226-1978 + roman) \fBOJIS8\fP, \fBojis8\fP 8bit JIS (JIS C6226-1978 + roman) \fBOJUNET\fP, \fBojunet\fP ISO-2022-JP (JIS C6226-1978 + roman) \fBUTF8\fP, \fButf8\fP UTF-8 \fBUTF8-mac\fP, \fBmac\fP UTF-8 for Mac OS X \fBUTF8-iconv\fP UTF-8 for iconv \fBen\fP, \fBC\fP, \fBPOSIX\fP English (message only) default no convert .fi .RE .RS (On MS-DOS version, only the English is valid.) .RE .IP "\fBLINENO\fP\(**" Indicate the current line number. When not in a script nor function, this value cannot be guaranteed to make sense. If you .B unset or reset this value, this variable will lose its special meaning to be treated as a general variable. .IP "\fBLINES\fP\(**" The variable for the lines of a terminal screen. If some value is set, this value will be replaced automatically according to changing the screen size. If no value is set, this value will remain unset. .IP "\fBLOGFILE\fP" Specify the log filename with the level spacified by .B LOGLEVEL or .BR ROOTLOGLEVEL . If it is not specified as fullpath, it will be regarded as the path under your home directory. You must prepare the directory in which the log file is stored, because any directories are not created automatically. The default value is not specified. .IP "\fBLOGLEVEL\fP" Specify the priority for the log contents. The default value is .BR 0 . .RS 18 .ta 0.8i .nf \fB0\fP no log \fB1\fP only warning such as writing \fB2\fP notice such as changing, and over \fB3\fP info. such as refering, and over >= \fB4\fP debug level, and over .fi .RE .RS The same operation can result as an error to output the log in the lower priority by 1 level. .RE .IP "\fBLOGSIZE\fP" Specify the maximum kilobyte size for the log file specified by .BR LOGFILE . If the size exceeds this value, the last log file will be renamed as the filename followed by the extension .B .old to create another new log file. The default value is .BR 1024 (1MB). If this value is .BR 0 , the log file will not be renamed. .IP "\fBLOOPCURSOR\fP" Loop a cursor moving within the same page, when you move a cursor. Any value except .B 0 and null effects valid. .IP "\fBMAIL\fP\(**" Specify the spool filename when the internal shell will check new mails. If .B MAILPATH is set, it is prior to this. .B (UNIX) .IP "\fBMAILCHECK\fP\(**" Specify the interval of checking new mails in seconds, for the spool files specified by .B MAILPATH or .BR MAIL . The default value is .B 600 seconds. If this value is .BR 0 , it will be checked before each prompt. .B (UNIX) .IP "\fBMAILPATH\fP\(**" Specify the multiple spool filenames, as the list separated by .BR : , when the internal shell will check new mails. The any specified files will be checked. Each filenames can be followed by .B % and a arrival message of new mails. The default message is .BR "you have mail\^" . .B (UNIX) .IP "\fBMESSAGELANG\fP" Specify the language for display character. The language of messages specified by this will be prior to the one specified by .BR LANGUAGE . When the message is Japanese, the Kanji code will be defined by the value of .BR LANGUAGE . The following is the kind of languages, it doesn't have to be the string itself and is enough to contain the string, the value of .B LANG the environment variable also can be used. Otherwise, In case of some additional message catalogs are prepared, you can specify its extension as the catalog name for .B MESSAGELANG to replace messages. .RS 18 .ta 1.5i .nf \fBen\fP, \fBC\fP, \fBPOSIX\fP English \fBja\fP Japanese default the value of \fBLANGUAGE\fP .fi .RE .IP "\fBMINFILENAME\fP" Specify the minimum character length of filename display area in the file list. When the area enough to be specified here cannot be obtained, the information is reduced in the order of UID, GID, timestamp, size. The default value is .B 12 characters. .IP "\fBOPTARG\fP\(**" An option argument is substituted in .B getopts the builtin command. .IP "\fBOPTIND\fP\(**" Specify the index of the next parameter in .B getopts the builtin command. .IP "\fBPAGER\fP" Specify the pager command used for viewing files. .IP "\fBPATH\fP\(**" Specify the search path for executing external commands. You can specify multiple paths separating with .RB ' : '. .IP "\fBPPID\fP\(**" Indicate the process ID of the parent proccess for .B fd which is invoked first. .B (UNIX) .IP "\fBPRECEDEPATH\fP" Specify the file preceding function, which displays only filenames before obtaining their file information, for the directory which has a lot of files like as /dev. You can specify multiple pathnames separating with .RB ' : '. You are enough to specify only the top directory where you want to realize the file preceding function, then the file preceding function is valid in all of the directories under that directory. When the file preceding function is effective, any files are not sorted in that directory, and file information is obtained file by file while waiting the key input. No pathname is specified by default. .IP "\fBPRECOPYMENU\fP" Display the menu in advance, which ask you what do you want with the same named files and the restricted files, when you copy, move, or delete multiple files. In case of too many target files, it avoids the occurrence of query after waiting for a moment. Any value except .B 0 and null effects valid. .IP "\fBPROGRESSBAR\fP" Display the progress bar, which indicates the progress, when you copy, move, or delete files. It needs the time to calculate the progress, to make the processing time a little longer than no progress bar. Any value except .B 0 and null effects valid. .IP "\fBPS1\fP" Specify the prompt string of input line in .BR EXECUTE_SH . The default value is "\fB$\fP\|\ \|". The following escape sequences are available. .RS 18 .ta 0.5i .nf \fB\eu\fP username \fB(UNIX)\fP \fB\eh\fP hostname \fB(UNIX)\fP \fB\eH\fP hostname (including domain name) \fB(UNIX)\fP \fB\ew\fP fullpath of current directory \fB\e~\fP fullpath of current directory (to simplify home directory with \fB~\fP) \fB\eW\fP current directory name \fB\e!\fP command history number \fB\e$\fP if UID is 0, a \fB#\fP, otherwise a \fB$\fP \fB(UNIX)\fP \fB\e[\fP beginning of non-printing sequence (terminal control character etc.) \fB\e]\fP ending of non-printing sequence \fB\ee\fP ESC (\e033) \fB\e\fP\fIooo\fR character indicated by the octal \fIooo\fR \fB\e\e\fP \e itself .fi .RE .IP "\fBPS2\fP" Specify the prompt string when more continuous input is needed in .BR EXECUTE_SH . The default value is "\fB>\fP\|\ \|". .IP "\fBPS4\fP\(**" Specify the prompt string with which command strings are displayed when you do .B set .BR -x . .IP "\fBPTYINKCODE\fP" Specify the Kanji code for the string passed to the pseudo terminal. The string, which is converted from the Kanji code specified by .B INPUTKCODE to the Kanji code specified by this command, is inputted to any processes running on the pseudo terminal. This variable has the individual value for each pseudo terminal, so that you should change value of the variable on the pseudo terminal to change the input Kanji code of the pseudo terminal running already. .B (UNIX) .RS 18 .ta 1.5i .nf \fBSJIS\fP, \fBsjis\fP Shift JIS \fBEUC\fP, \fBeuc\fP EUC-JP \fBUTF8\fP, \fButf8\fP UTF-8 \fBUTF8-mac\fP, \fBmac\fP UTF-8 for Mac OS X \fBUTF8-iconv\fP UTF-8 for iconv default no convert .fi .RE .IP "\fBPTYMENUKEY\fP" Specify the key to open the pseudo terminal menu while you are handling the pseudo terminal. You can describe the same key name as .B bind command. You can select the following items in the pseudo terminal menu: "SendAsIs", "InputCode", "Break", "NextWindow" and "Kanji". Each item means respectively: sending the pseudo terminal menu key as is, inputting the key name to be sent, terminating forcedly the process running in the pseudo terminal, changing to the next window, invoking the Kana-Kanji IME. In "InputCode", you can use the key name like as .B bind command, and also the Kanji code number used in the Kana-Kanji IME mode. But you cannot select "NextWindow" in the non-split window mode. The default value is not specified. .B (UNIX) .IP "\fBPTYMODE\fP" Use the pseudo terminal to invoke external commands. In the split window mode, the independent pseudo terminals for every windows will be opened and enable you to handle simultaneously multiple external commands via terminals. If the terminal in use can not provide some functions required for the terminal emulation, the pseudo terminal may not work correctly. Any value except .B 0 and null effects valid. .B (UNIX) .IP "\fBPTYOUTKCODE\fP" Specify the Kanji code for the string passed from the pseudo terminal. The string, which is converted from the Kanji code specified by this command to the Kanji code specified by .BR LANGUAGE , is displayed from any processes running on the pseudo terminal. This variable has the individual value for each pseudo terminal, so that you should change value of the variable on the pseudo terminal to change the output Kanji code of the pseudo terminal running already. .B (UNIX) .RS 18 .ta 1.5i .nf \fBSJIS\fP, \fBsjis\fP Shift JIS \fBEUC\fP, \fBeuc\fP EUC-JP \fBUTF8\fP, \fButf8\fP UTF-8 \fBUTF8-mac\fP, \fBmac\fP UTF-8 for Mac OS X \fBUTF8-iconv\fP UTF-8 for iconv default no convert .fi .RE .IP "\fBPTYTERM\fP" Specify the value of .B TERM the environment variable to be passed to external commands, when you use the pseudo terminal. Some .BR termcap (5) or .BR terminfo (5) may cause unexpected behavior of the pseudo terminal, you should specify the effective terminal name in your environment. The default value is .BR vt100 . .B (UNIX) .IP "\fBPWD\fP\(**" The variable for the current directory with the absolute representation. If some value is set, this value will be replaced automatically according to changing the current directory. If no value is set, this value will remain unset. If this is passed as an environment variable when invoked, and this value and the current directory indicate the same directory logically, then it is used as the default value for the current directory. It is useful when you want to specify the logical pathname following symbolic links. .IP "\fBROOTLOGLEVEL\fP" Specify the priority for the log contents of the super user. The default value is .BR 1 . .B (UNIX) .RS 18 .ta 0.8i .nf \fB0\fP no log \fB1\fP only warning such as writing \fB2\fP notice such as changing, and over \fB3\fP info. such as refering, and over >= \fB4\fP debug level, and over .fi .RE .RS The same operation can result as an error to output the log in the lower priority by 1 level. .RE .IP "\fBRRPATH\fP" Display files under the directory mounted by CD-ROM, with the pseudo ISO 9660 RockRidge Extension, for the OS which cannot support RockRidge Extension. You can specify multiple mount points separating with .RB ' : '. You are enough to specify only the top directory mounted by CD-ROM, then the pseudo RockRidge Extension function is valid in all of the directories under that directory. This is no more than a pseudo extension, which only replaces filenames according to TRANS.TBL, and cannot handle some CD-ROM which has an inconsistent TRANS.TBL. No mount point is specified by default. .IP "\fBSAVEDIRHIST\fP" Specify the maximum number saved to the directory history file. The default value is .BR 50 . If this value is .BR 0 , no directory history file is saved. .IP "\fBSAVEHIST\fP" Specify the maximum number saved to the command history file. The default value is .BR 50 . If this value is .BR 0 , no command history file is saved. .IP "\fBSECOND\fP" Display the second in the clock of the title line. But the clock is adjusted correctly every .B 10 seconds, and some gap from the real time will be occurred in this span. Any value except .B 0 and null effects valid. .IP "\fBSHELL\fP" When the filename part of this specified value is .B rfd or .BR rfdsh , the shell becomes a restricted shell as well as .B \-r option when invoked. This variable also specify the shell which can be invoked from .BR EXECUTE_SH . .IP "\fBSIZEINFO\fP" Display the file size information line at the top of screen. The total size displayed here is not the sum of bytes but the sum of disk block size occupied actually. Any value except .B 0 and null effects valid. .IP "\fBSIZEUNIT\fP" Represent the huge file size which overflows the displayed digit with the prefix of the SI unit, as "KB", "MB" and so on. Any value except .B 0 and null effects valid. .IP "\fBSORTTREE\fP" Sort directories in the tree screen. The sorted type specified by .B SORT_DIR is used, but they can not be sorted when it is "by size" or "by timestamp". The directory included in the current directory path is always placed on the top of directory tree, with no regard to the sorted type. Any value except .B 0 and null effects valid. .IP "\fBSORTTYPE\fP" The file list in the browser screen is not sorted by default, but placed in order registered in the directory. This variable specify it to be sorted by default. The following are specifiable values. .RS 18 .ta 0.5i 1i 2i 2.5i .nf \fB0\fP not sort \fB1\fP by filename \fB9\fP by filename(reverse) \fB2\fP by extension \fB10\fP by extension(reverse) \fB3\fP by size \fB11\fP by size(reverse) \fB4\fP by timestamp \fB12\fP by timestamp(reverse) \fB5\fP by length \fB13\fP by length(reverse) \fB100\-113\fP keep the last sorted type \fB200\-213\fP keep it also in archive browser .fi .RE .RS If you specify the value of 100-113, it is sorted according to the value indicated by lower 2 digits just after invoked, the last specified sorted type is kept when moving directory. If you specify the value of 200-213, the last sort type will be kept also after invoking the archive browser. .RE .IP "\fBTERM\fP\(**" Specity the terminal name. When this value is .BR dumb , .B unknown or .BR un , it is regarded as the dumb terminal to suppress any escape sequences in the internal shell in spite of .BR DUMBSHELL . If this value does not exist in .BR termcap (5) and .BR terminfo (5) entry, it is executable only when it is invoked as .BR fdsh . The terminal name will be variable dynamically, then you can re-specify the suitable one as this value after invoked for some strange terminal display and key input. .IP "\fBTHRUARGS\fP" Pass through the pathnames as is, which is specified as the startup arguments. .B Fd expands the meta character such as .B ~ and .B ${#} in the given pathname by itself, because the obsolete low-level shell cannot support these expansion extended by POSIX. .B Fd can sometimes expand the pathname given by the shell into the unexpected string as a result of duplicate expansion, because the latest high-level shell generally support these expansion. This variable will be suppress the expansion of arguments. Any value except .B 0 and null effects valid. .IP "\fBTMPDIR\fP" Specify the working directory where the archiver command temporarily unpack files in the archive file. The default value is .BR /tmp . (On MS-DOS version, The default value is .RB ` . '.) .IP "\fBTMPUMASK\fP" Specify the file creation mask with octal expression for files and directories created temporarily in .BR TMPDIR . But the mask value set by .B umask the builtin command is prior, then actual mask value is the logical OR of this value and .B umask value. .IP "\fBTRADLAYOUT\fP" Use the traditional screen layout based on the original "FD". In this layout, the file size information will be always displayed, whether .B SIZEINFO is set or not. When the screen width is less than .B 80 columns, this specification is invalid. Any value except .B 0 and null effects valid. .IP "\fBUNICODEBUFFER\fP" Hold the UNICODE translation table on memory. It will be fast to access the floppy drive and to translate from/to UTF-8. You should set this if you have enough memory. Any value except .B 0 and null effects valid. .IP "\fBURLDRIVE\fP" Validate the function of the URL drive. Any value except .B 0 and null effects valid. .B (UNIX) .IP "\fBURLKCODE\fP" Specify the Kanji code for filename on the host with the URL drive. .BR JIS8 , .BR JUNET , .BR HEX , .BR CAP , etc. among them are the Kanji codes used in Samba. .B (UNIX) .RS 18 .ta 1.5i .nf \fBSJIS\fP, \fBsjis\fP Shift JIS \fBEUC\fP, \fBeuc\fP EUC-JP \fBJIS\fP, \fBjis\fP 7bit JIS \fBJIS8\fP, \fBjis8\fP 8bit JIS \fBJUNET\fP, \fBjunet\fP ISO-2022-JP \fBOJIS\fP, \fBojis\fP 7bit JIS (JIS C6226-1978 + roman) \fBOJIS8\fP, \fBojis8\fP 8bit JIS (JIS C6226-1978 + roman) \fBOJUNET\fP, \fBojunet\fP ISO-2022-JP (JIS C6226-1978 + roman) \fBHEX\fP, \fBhex\fP HEX \fBCAP\fP, \fBcap\fP CAP \fBUTF8\fP, \fButf8\fP UTF-8 \fBUTF8-mac\fP, \fBmac\fP UTF-8 for Mac OS X \fBUTF8-iconv\fP UTF-8 for iconv default no convert .fi .RE .IP "\fBURLOPTIONS\fP" Specify communication options, when the URL drive communicates with the host. You can select individually whether if PASV, PORT, MDTM, FEAT each commands for the FTP communication are limited or not, or whether if the exact file information is need or not. On the HTTP protocol, you will get the timestamp and size of files with some rounding error in bulk. If you need the exact information, the operations by file will spend the more communication time. The default value is .BR 0 . The following are specifiable values. .B (UNIX) .RS 18 .ta 0.5i 1.3i 2.1i 2.9i 3.7i .nf \fB0\fP standard \fB1\fP PASV \fB2\fP PORT \fB3\fP PASV & PORT \fB4\fP MDTM \fB5\fP PASV & MDTM \fB6\fP PORT & MDTM \fB7\fP PASV & PORT & MDTM \fB8\fP FEAT \fB9\fP PASV & FEAT \fB10\fP PORT & FEAT \fB11\fP PASV & PORT & FEAT \fB12\fP MDTM & FEAT \fB13\fP PASV & MDTM & FEAT \fB14\fP PORT & MDTM & FEAT \fB15\fP PASV & PORT & MDTM & FEAT \fB16\fP HTTP \fB17\fP PASV & HTTP \fB18\fP PORT & HTTP \fB19\fP PASV & PORT & HTTP \fB20\fP MDTM & HTTP \fB21\fP PASV & MDTM & HTTP \fB22\fP PORT & MDTM & HTTP \fB23\fP PASV & PORT & MDTM & HTTP \fB24\fP FEAT & HTTP \fB25\fP PASV & FEAT & HTTP \fB26\fP PORT & FEAT & HTTP \fB27\fP PASV & PORT & FEAT & HTTP \fB28\fP MDTM & FEAT & HTTP \fB29\fP PASV & MDTM & FEAT & HTTP \fB30\fP PORT & MDTM & FEAT & HTTP \fB31\fP PASV & PORT & MDTM & FEAT & HTTP .fi .RE .IP "\fBURLTIMEOUT\fP" Specify the timeout in seconds, when the URL drive communicates with the host. If the communication from the host is lost for the time specified, the communication is regarded as invalid and its connection will be shutdown forcedly. If this value is .B 0 second, the timeout operation is invalid to continue waiting response forever. The default value is .B 0 second. .B (UNIX) .IP "\fBUSEGETCURSOR\fP" Use the VT100 compatible escape sequence getting the cursor position in order to get the terminal size. When the screen size of .B fd doesn't correspond with the terminal size, this variable can be sometimes valid. On some terminals which don't support the escape sequence getting the cursor position, the operation may be stopped. In this case, it is continued by inputting 'R' from the keyboard. Any value except .B 0 and null effects valid. .B (UNIX) .IP "\fBUSESYSLOG\fP" Send the log to .BR syslogd (8) the system logger with the level spacified by .B LOGLEVEL or .BR ROOTLOGLEVEL . The log priority is LOG_ERR only some errors are caused, otherwise the log priority is always LOG_INFO. LOG_USER is used as the facirity if it can be specified. Any value except .B 0 and null effects valid. .B (UNIX) .IP "\fBWIDEDIGIT\fP" Widen the displayed digits for the number of pages and files. The standard displayed digits for the number of pages and files are .B 2 and .B 4 respectively. This expands them into .B 4 and .B 5 respectively. Any value except .B 0 and null effects valid. .IP "\fBWRITEFS\fP" Forbid use of .B WRITE_DIR command. If the value is .BR 1 , the directory is written only when the command is executed intentionally, and you are not confirmed after arranging the file order. If the value is .BR 2 , even writing by the command is invalid, the directory writing is quite forbidden. .IP "\fBSJISPATH\fP" .PD 0 .IP "\fBEUCPATH\fP" .IP "\fBJISPATH\fP" .IP "\fBJIS8PATH\fP" .IP "\fBJUNETPATH\fP" .IP "\fBOJISPATH\fP" .IP "\fBOJIS8PATH\fP" .IP "\fBOJUNETPATH\fP" .IP "\fBHEXPATH\fP" .IP "\fBCAPPATH\fP" .IP "\fBUTF8PATH\fP" .IP "\fBUTF8MACPATH\fP" .IP "\fBUTF8ICONVPATH\fP" .IP "\fBNOCONVPATH\fP" .PD Specify the Kanji code for filename per directory, which is prior to .BR FNAMEKCODE . You can specify multiple pathnames separating with .RB ' : '. You are enough to specify only the top directory where you want to use the Kanji code, then you can use the Kanji code in all of the directories under that directory. In the directory which is described in .BR NOCONVPATH , no Kanji code is converted ignoring the value of .BR FNAMEKCODE . No pathname is specified by default. .B (UNIX) .SH MULTI LANGUAGE SUPPORT .B Fd processes the Kanji character-set to input/output as "EUC-JP" or "Shift JIS" according to setting in compile. The the pathname including Kanji is displayed in consideration for the 2nd byte character in Kanji. You can dynamically select Kanji code to input/output with .BR LANGUAGE , .B INPUTKCODE and .B FNAMEKCODE the internal variable. You can input Japanese string with the Kana-Kanji IME mode. You can use Kanji in the command macro and the command string, but cannot use Kanji as the value of the internal variables. You cannot use the multibyte symbol character as the meta character, such as .RB ' % ' and '\fB"\fP' and so on, Kanji character is not counted as 1 character in the wildcard search. And when you give the non-standard Kanji code for the OS to the shell with the parameter macro such as .BR %JJ , some Kanji is converted into the code including the meta character such as .RB ' $ ' and .RB ' \e ' and so on, to cause unexpected behavior. In that case, you can probably avoid it by quoting the string to be converted with .BR %' . .SH AUTHOR Takashi SHIRAI .br The original "FD" for MS-DOS was created and released by A.Idei for the first time, in 1989. .B Fd was created for UNIX from scratch following that implementation, in 1995. .SH FILES .PD 0 .TP 10 .B /etc/fd2rc The systemwide initial configuration file for .B fd .TP .B ~/.fd2rc The individual initial configuration file for .B fd .TP .B ~/.fdshrc The individual initial configuration file for .B fdsh .TP .B ~/.fd_history The command history file by default .TP .B ~/.fd_freq The translation frequency file by default for the users Kana-Kanji translation learning .TP .B /bin/sh The user shell when .B SHELL the environment variable is undefined .TP .B /bin/rm The command to remove temporary files when abort .TP .B /tmp/fd\(** The temporary directory to unpack the archive file .TP .B fd\-unicd.tbl The UNICODE translation table, which is installed in the same directory as the executable binary of .B fd .TP .B fd\-dict.tbl The Kana-Kanji translation dictionary file, which is installed in the same directory as the executable binary of .B fd .TP .B fd2rc The systemwide initial configuration file for .B fd on MS-DOS version, which must be prepared in the same directory as the executable binary of .B fd .TP .B $HOME\efd2.rc The individual initial configuration file for .B fd on MS-DOS version .TP .B $HOME\efdsh.rc The individual initial configuration file for .B fdsh on MS-DOS version .TP .B $HOME\efd.hst The command history file on MS-DOS version by default .PD .SH LIMITATIONS Some terminals cannot send the input of certain function keys and special keys. The sequence compatible with .B VT200 is assigned as the default sequence which is not registered in .BR termcap (5), and when the terminal cannot support this, the key receipt or the screen control due to be brought by this is not available. .SH SEE ALSO .BR sh (1), .BR echo (1), .BR test (1), .BR ls (1), .BR rm (1), .BR tar (1), .BR compress (1), .BR zcat (1), .BR gzip (1), .BR gunzip (1), .BR lha (1), .BR login (1), .BR newgrp (1), .BR stty (1), .BR umask (2), .BR termcap (5), .BR terminfo (5), .BR syslogd (8) .SH BUGS When files in an archive file are packed with a pathname including ".\|.", the archive browser cannot work normally. The symbolic links in an archive file cannot be unpacked individually. The user interface is cheap. .SH COPYRIGHT Copyright (C) 1995-2019 by Takashi SHIRAI FD-3.01j/fd_e.cat100644 2105 1751 661125 13516612560 12322 0ustar shiraiuserFD(1) UNIX-OS Programmer's Manual FD(1) NNAAMMEE fd - file & directory maintenance tool SSYYNNOOPPSSIISS ffdd [ --aabbCCeeffhhiikkllmmNNnnPPrrSSssTTttuuvvxx ] [ --_N_A_M_E==_v_a_l_u_e ] [ _d_i_r_e_c_t_o_r_y [ _d_i_r_e_c_t_o_r_y_2 _._._. ]] ffddsshh [ --aabbCCcceeffhhiikkllmmNNnnPPrrSSssTTttuuvvxx ] [ _a_r_g_s ] DDEESSCCRRIIPPTTIIOONN FFdd is a file & directory maintenance tool considered for the text terminals on general UNIX. It aims for a clone of the same named utility which is made for the PC/AT compatible machine and PC-9800 series. In fact, it is upper compatible functionally. FFdd shows the browser screen listing files when you have invoked it. You can input some key which is bound each com- mand, to execute various operations. (In the following description, ((UUNNIIXX)) means that the opera- tion is implemented only on UNIX version and not effective on MS-DOS version. As well as it, ((DDOOSS)) means that the operation is implemented only on MS-DOS version.) OOppttiioonnss The command line option is used for setting internal shell operations and setting the internal variables described below. You can use any variable name as the internal vari- able, but ffdd can accept only those which are described in the below section of EENNVVIIRROONNMMEENNTT VVAARRIIAABBLLEESS. If you specify _d_i_r_e_c_t_o_r_y, the current directory is moved to the directory initially. If you specify _d_i_r_e_c_t_o_r_y_2 _._._., the split window mode is invoked, and the current directoris of the supple- mental windows are moved to the each directory. The following options are available for the internal shell. --cc _s_t_r_i_n_g Commands described by _s_t_r_i_n_g are executed and exit immediately. It is effective only when it is invoked as ffddsshh. --ii If the --ii flag is present or if the standard input/output is a terminal, the shell is interactive shell. --ss If the --ss flag is present or if no _a_r_g_s is specified, commands for the shell are read from the standard input. Any remaining argument specifies the positional parameter. --rr The shell is a restricted shell. Specifically, the following operations are disallowed. changing the current directory setting the value of $$PPAATTHH, $$SSHHEELLLL and $$EENNVV specifying command names include // redirecting output (>> and >>>>) IINN_DDIIRR OOUUTT_DDIIRR LLOOGG_TTOOPP LLOOGG_DDIIRR AATTTTRR_FFIILLEE CCOOPPYY_FFIILLEE MMOOVVEE_FFIILLEE DDEELLEETTEE_FFIILLEE DDEELLEETTEE_DDIIRR RREENNAAMMEE_FFIILLEE MMAAKKEE_DDIIRR WWRRIITTEE_DDIIRR TTRREEEE_DDIIRR BBAACCKKUUPP_TTAAPPEE EEDDIITT_FFIILLEE UUNNPPAACCKK_FFIILLEE PPAACCKK_FFIILLEE LLOOGG_TTRREEEE CCOOPPYY_TTRREEEE MMOOVVEE_TTRREEEE UUNNPPAACCKK_TTRREEEE FFIINNDD_DDIIRR AATTTTRR_DDIIRR When invoked as rrffdd or rrffddsshh, it becomes this res- tricted shell automatically. --ll The shell is a login shell. --NN Reading the initial configuration files is omitted. In addition, the options described below in the description of sseett the builtin command are available. SSccrreeeenn LLaayyoouutt FFdd has the 3 major screen modes. In the browser screen, you can select from the file list and execute each command. In the archive browser screen, files in the archive file are listed separately by directory, and you can browse as well as the browser screen. In the tree screen, you can move on the directory tree and select the directory path. In all screen modes, each 33 lines on the top/bottom of the screen are used for the various information of ffdd.. The top information lines sometimes become 44 lines. The screen lay- out is the following. line# Description 11 The title line. The clock at the right end is updated every 1100 seconds. 22 The information line. It displays information in this order: the current page (and the total pages), the number of marks (ant the total marks), the sorted type, the pattern string for file search. 33 The path line. It displays the fullpath of the current directory. In the archive browser screen, it displays the fullpath of the archive file and the current path in the archive. 22 (optional) The file size information line. It displays the total size of the marked files in the directory (and the total size of all files), the total capa- city and the free size of the file system includ- ing the current directory. This line appears by SSIIZZEEIINNFFOO the internal variable setting. When this line is displayed, The information line and the path line are displayed 1 line under each. bboottttoomm -- 22 The stack line. It displays files temporarily which you push in stack, when arranging files. bboottttoomm -- 11 The function line. It displays the operations of function keys. bboottttoomm The status line. It displays the status of the file on the cursor position. It also displays warning messages when command is executed with some troubles. IInntteerrnnaall CCoommmmaannddss You can use the following internal commands on ffdd. While any user can change the key binding for these internal com- mands, here shows the default key binding. The identifier is used when it is executed from the command line of EEXXEECCUUTTEE_SSHH command, and when the user defines the key bind- ing. Identifier Command Key CCUURR_UUPP Move a cursor up UUpp CCUURR_DDOOWWNN Move a cursor down DDoowwnn CCUURR_RRIIGGHHTT Move a cursor right RRiigghhtt CCUURR_LLEEFFTT Move a cursor left LLeefftt RROOLLLL_UUPP Turn ahead to the next page PPaaggeeDDoowwnn RROOLLLL_DDOOWWNN Turn back to the prev. page PPaaggeeUUpp CCUURR_TTOOPP Move a cursor top BBeegg(<) CCUURR_BBOOTTTTOOMM Move a cursor bottom EEooll(>) FFNNAAMMEE_RRIIGGHHTT Shift right a filename (( FFNNAAMMEE_LLEEFFTT Shift left a filename )) OONNEE_CCOOLLUUMMNN Change layout into 1 column 11 TTWWOO_CCOOLLUUMMNNSS Change layout into 2 columns 22 TTHHRREEEE_CCOOLLUUMMNNSS Change layout into 3 columns 33 FFIIVVEE_CCOOLLUUMMNNSS Change layout into 5 columns 55 MMAARRKK_FFIILLEE Mark a file TTaabb MMAARRKK_FFIILLEE22 Mark and move down SSppaaccee MMAARRKK_FFIILLEE33 Mark and move in a page ^^SSppaaccee(^@) MMAARRKK_AALLLL Mark all files HHoommee(+) MMAARRKK_RREEVVEERRSSEE Mark all files reversely EEnndd(-) MMAARRKK_FFIINNDD Mark the matched files ** IINN_DDIIRR Change to a sub directory RReettuurrnn OOUUTT_DDIIRR Change to a parent directory BBss LLOOGG_TTOOPP Change to a root directory \\ RREERREEAADD_DDIIRR Reread the current directory ^^LL PPUUSSHH_FFIILLEE Push a file to the stack DDeell(]) PPOOPP_FFIILLEE Pop a file from the stack IInnss([) LLOOGG_DDIIRR Change to a logical directory FF11(l) EEXXEECCUUTTEE_FFIILLEE Execute a file FF22(x) CCOOPPYY_FFIILLEE Copy a file FF33(c) DDEELLEETTEE_FFIILLEE Delete a file FF44(d) RREENNAAMMEE_FFIILLEE Rename a file FF55(r) SSOORRTT_DDIIRR Sort the current directory FF66(s) FFIINNDD_FFIILLEE Find files FF77(f) TTRREEEE_DDIIRR Display the tree screen FF88(t) EEDDIITT_FFIILLEE Edit a file FF99(e) UUNNPPAACCKK_FFIILLEE Unpack a file FF1100(u) AATTTTRR_FFIILLEE Change a file attribute FF1111(a) IINNFFOO_FFIILLEESSYYSS Display a file system info. FF1122(i) MMOOVVEE_FFIILLEE Move a file FF1133(m) DDEELLEETTEE_DDIIRR Delete a directory FF1144(D) MMAAKKEE_DDIIRR Make a directory FF1155(k) EEXXEECCUUTTEE_SSHH Execute a child process FF1166(h) WWRRIITTEE_DDIIRR Write a displayed directory FF1177(w) BBAACCKKUUPP_TTAAPPEE Backup into a tape FF1188(b) VVIIEEWW_FFIILLEE View a file FF1199(v) PPAACCKK_FFIILLEE Pack a file FF2200(p) LLOOGG_TTRREEEE Change directory with tree LL CCOOPPYY_TTRREEEE Copy a file with tree CC MMOOVVEE_TTRREEEE Move a file with tree MM UUNNPPAACCKK_TTRREEEE Unpack a file with tree UU FFIINNDD_DDIIRR Find a file recursively FF AATTTTRR_DDIIRR Change attributes recursively AA SSYYMMLLIINNKK_MMOODDEE Switch the symbolic link mode SS FFIILLEETTYYPPEE_MMOODDEE Switch the file type symbol TT DDOOTTFFIILLEE_MMOODDEE Switch the dot file display HH FFIILLEEFFLLGG_MMOODDEE Switch the file flag display OO LLAAUUNNCCHH_FFIILLEE Invoke the launcher RReettuurrnn SSEEAARRCCHH_FFOORRWW Search forward a file ^^SS SSEEAARRCCHH_BBAACCKK Search backward a file ^^RR SSPPLLIITT_WWIINNDDOOWW Split into the windows // NNEEXXTT_WWIINNDDOOWW Change to the next window ^^ WWIIDDEENN_WWIINNDDOOWW Widen the current window WW NNAARRRROOWW_WWIINNDDOOWW Narrow the current window NN KKIILLLL_WWIINNDDOOWW Kill the current window KK EEDDIITT_CCOONNFFIIGG Invoke the customizer EE HHEELLPP_MMEESSSSAAGGEE Display a help screen ?? QQUUIITT_SSYYSSTTEEMM Quit from fd EEsscc(q) WWAARRNNIINNGG_BBEELLLL Bell for warning NNOO_OOPPEERRAATTIIOONN Do nothing The last 2 internal commands are used when you want change the default key binding to cancel. IInntteerrnnaall CCoommmmaannddss DDeessccrriippttiioonn The detail of each internal command is the following. Internal commands with similar function are described together. MMoovvee ccuurrssoorr Move a cursor. TTuurrnn ppaaggee Turn to the previous/next page, when files are not completely held in a screen. Also if you try to move out of the page with Cursor move, the page will be turned. MMoovvee ttoo tthhee ttoopp//bboottttoomm Move a cursor to the top/bottom of the file list. When the list is not held in a screen, the page is turned. SShhiifftt ffiilleennaammee Shift the displayed string of filename on the cursor position, when the filename is longer than the prepared column width. It is displayed as shifted to right/left by 1 character. The display of the status line is also shifted simultaneously. CChhaannggee llaayyoouutt Change the number of columns into each value. There are usually 22 columns per screen. As the column width per file is changed according to the number of columns, the displayed information is also changed. MMaarrkk ffiillee Mark the file on the cursor position. You cannot mark any directory. [SSppaaccee] marks and moves down a cursor. [^^SSppaaccee] also marks and moves down a cur- sor, but doesn't turn the page. [HHoommee] marks all the files, [EEnndd] marks all the files reversely. [**] additionally marks the file which matches the wild- card. You must input the wildcard string whenever you push [**]. Marked files are used as the target of AATTTTRR_FFIILLEE, CCOOPPYY_FFIILLEE, DDEELLEETTEE_FFIILLEE, MMOOVVEE_FFIILLEE, UUNNPPAACCKK_FFIILLEE and the user defined command macros. CChhaannggee ddiirreeccttoorryy [RReettuurrnn] changes the current directory to the direc- tory on the cursor position. If you want to change it to the parent directory, you should move a cursor to the file of ".." and push [RReettuurrnn], or simply push [BBss]. [\\] changes the current directory to the root directory. PPuusshh//ppoopp ffiillee ssttaacckk [DDeell] pushes the file on the cursor position to the file stack, and temporarily deletes the file from the file list screen. You can push files to the file stack up to 55 files. [IInnss] pops the file from the file stack and insert it on the cursor position. The last pushed file is popped first. But this order is expediently displayed in ffdd, and it is reset by Directory move. RReeddrraaww ssccrreeeenn Redraw the file list screen by rereading the infor- mation of the current directory. It is useful when some other process add/delete files, or when some- thing break the screen display. Moreover, when you use the terminal which doesn't raise SSIIGGWWIINNCCHH signal at changing the screen size (like kktteerrmm(1) on HP-UX etc.), you must intention- ally redraw after you change the screen size. CChhaannggee llooggiiccaall ddiirreeccttoorryy (Logdir) Change the current directory to the inputted path- name. When you input the pathname which starts with '/', it means not the relative move but the absolute move. When you input the pathname "..", the pathname of the current directory is adjusted into absolute expres- sion. Except this case, the current directory always is shown as the virtual pathname, by reason of a link and so on. When you input the pathname "??", you can move to the current directory when ffdd was invoked. When you input the pathname "--", you can move to the last visited directory. Moreover, When you input the pathname "@@" in floppy drive, you can move to the directory on UNIX file system, where you existed before moving to floppy drive. ((UUNNIIXX)) (Note: This command is called as "Loddsk" in the original FD on MS-DOS, which is short for "LOGical DiSK drive". This "logical" means the drive name prefixed to pathnames, and it is virtually named against "physical disk drive". On UNIX, since "log- ical disk drive" never means pathname nor directory, this command name "Change logical directory" is not suitable. But this name is expediently inherited from the original version.) EExxeeccuuttee ffiillee (eXec) Execute the file on the cursor position with some parameters, as the child process. The cursor posi- tion in command line exists after the filename in case of the executable file, and before the filename except it. You should fill suitable parameters or command name in each case. The up/down cursor keys can provide the command history which you executed before. On MS-DOS version, the LFN form filename in the com- mand line which is quoted with the quotation mark "" is automatically replaced into 8+3 form filename before execution. In this case, when there is the filename described by the string quoted with "", this string is always replaced into 8+3 form filename after deleting "", otherwise it is never replaced including "". CCooppyy ffiillee (Copy) Copy the file on the cursor position to the speci- fied directory. When the cursor position indicates a directory, its contents are copied recursively. When some files are marked, the target is not the file on the cursor position but the marked files. When the same named file exists in the destination, you can select the operation from the following: "Update (by timestamp)", "Rename (each copied file)", "Overwrite", "Not_copy_the_same_name", "For- ward". If you select "Forward", you should specify the directory as the destination to forward. All files which have the same names are moved to the specified directory. DDeelleettee ffiillee (Delete) Delete the file on the cursor position. No direc- tory can be deleted. When some files are marked, the target is not the file on the cursor position but the marked files. When you don't have write permission on the file, you are confirmed for security. RReennaammee ffiillee (Rename) Rename the file on the cursor position. You cannot rename to the same name as any existent file. When you specify the pathname with some directory name, it is also moved to the directory. SSoorrtt ffiillee (Sort) Sort files in the current directory. You can select the sorted type from the following: "fileName", "Extension", "Size", "Timestamp", "Length (of filename)", and specify "Up (incremental order)" or "Down (decremental order)". When the sorted type before sorting is the one except "No chg (not sort)", the choice will include "No chg". When you sort after sorting another sorted type, the previous sorted result is based in sorting. This sorting has a priority except specified type, the directory is always precedes any file, except for the case of "No chg". In case of "Length", files which have the same filename length are sorted in order of their names. But this sorting is expediently displayed in ffdd, and it is reset by Directory move. FFiinndd ffiillee (Find) Find the files matching the wildcard, and display only them. The filename which starts with '.' doesn't match the wildcard which starts with '*' nor '?'. If you want to cancel the File find, you should move the current directory, or do FFIINNDD_FFIILLEE again and input a null line. When the current directory has the files which have the extension registered to associate with an archive browser, the string which starts with '/' is used to find not the filename but the filename in archive files, and only the archive files which con- tain matched files are displayed. This function is available in the archive browser. After Find file, you can not do WWRRIITTEE_DDIIRR. DDiissppllaayy ttrreeee ssccrreeeenn (Tree) Display the directory tree based on the current directory. You can select the directory in the tree screen, to move the current directory. EEddiitt ffiillee (Editor) Edit the file on the cursor position. The editor is used referring EEDDIITTOORR the internal variable, or referring EEDDIITTOORR the environment variable when the internal variable is undefined. UUnnppaacckk ffiillee (Unpack) Unpack the archive file on the cursor position into the specified directory. In builtin configuration, you can unpack only the tar file and its compressed file and the LHa compressed file. You can describe configurations in the initial configuration file to support archivers except these. CChhaannggee aattttrriibbuuttee (Attr) Change the file access mode, the timestamp and the owner/group of the file on the cursor position. When some files are marked, the target is not the file on the cursor position but the marked files. In case of the marked files, you must select the mode, the timestamp or the owner/group, before chang- ing it all together. When you input the mode, cursor keys move a cursor to the position you want to change, [SSppaaccee] reverses the attribute on the position. You should notice that the attribute of the execution bit is not a binary toggle but a triple toggle, which includes setuid bit, setgid bit and sticky bit respectively. If the target is the marked files, [mm](Mask) will mask a bit on the cursor position with '**', to keep the value of the original file attribute. When you input the timestamp, you move a cursor to the posi- tion you want to change, and input a numeric value. When you input the owner/group, you move a cursor to the position for each name, and input a name or a ID value with [SSppaaccee]. You can use the completion for a user name and a group name to input each name. Fi- nally, [RReettuurrnn] executes the change. You can cancel with [EEsscc]. Be careful that the limit check of date is not perfect. Moreover, [aa](Attr), [dd](Date), [tt](Time), [oo](Owner) and [gg](Group) move a cursor to the each beginning of input line. On the OS which has the attribute of file flags, you can change the file flags as well as the mode. In this case, [ff](Flag) move a cursor to the begin- ning of input line of file flags. But the value of flags which you can change is based on your permis- sion. FFiillee ssyysstteemm iinnffoorrmmaattiioonn (Info) Display the information of the specified file sys- tem. When the inputted pathname is not the special file which indicates a file system, the information of the file system including the pathname is displayed. MMoovvee ffiillee (Move) Move the file on the cursor position to the speci- fied directory. When the cursor position indicates a directory, the directory itself is moved. When some files are marked, the target is not the file on the cursor position but the marked files. When the same named file exists in the destination, you can select the operation as well as CCOOPPYY_FFIILLEE. When the destination belongs to the different file system, copy and delete are just executed continu- ously. DDeelleettee ddiirreeccttoorryy (rmDir) Delete the directory on the cursor position recur- sively. When the directory in a symbolic link, only the link is deleted and the linked directory has no effect. MMaakkee ddiirreeccttoorryy (mKdir) Make the sub directory on the current directory. When the inputted sub directory string includes '/', which is the pathname delimiter, it goes on making directory recursively until the directory described by the string is finally created. When you input the pathname which starts with '/', the directory is made not on the current directory but on the absolute path described. EExxeeccuuttee cchhiilldd pprroocceessss (sHell) Execute the inputted command string as the child process, by handling the internal shell. You can refer the command history and use automatic LFN replacement, as well as EEXXEECCUUTTEE_FFIILLEE. When you push only [RReettuurrnn] without any input, the user shell which is described by SSHHEELLLL the internal variable or the environment variable is invoked. In this case, you should input "eexxiitt" to return to ffdd. When the value of SSHHEELLLL is ffddsshh, the internal shell is exe- cuted as the interactive shell. However, when there is the same command name as a builtin command or a internal command, the builtin command or the internal command are executed instead of the external command. You can refer the clause of `BBuuiillttiinn CCoommmmaannddss' for the details of the builtin command. WWrriittee ddiirreeccttoorryy (Write) Write the displayed directory. The gap between files on the directory entry is filled. When it is executed after arranged by PPUUSSHH_FFIILLEE, PPOOPP_FFIILLEE and SSOORRTT_DDIIRR, the result is written. When the displayed directory doesn't belong to the hierarchy under your home directory, you are con- firmed for security whether if any other user doesn't use the directory. Since it is insecure, you cannot write the NFS mounted directory and some special directories. If you execute the internal command which arranges the file order, and then try to execute the internal command which will break that order, you will be confirmed whether if you write the directory or not, just before the internal command is executed. For this function, you can write the directory without intentionally executing this Directory write com- mand. But when the displayed directory is not under your home directory, this confirmation is not done. BBaacckkuupp ttaappee (Backup) Backup the file on the cursor position into the specified storage device. When the cursor position indicates a directory, all of its contents is back- uped. When some files are marked, the target is not the file on the cursor position but the marked files. TTaarr(1) is used for backup. When you specify the filename except special files indicates devices as input of the device name, the archive file is created with that filename. VViieeww ffiillee (View) View the file on the cursor position. The pager is used referring PPAAGGEERR the internal variable, or referring PPAAGGEERR the environment variable when the internal variable is undefined. PPaacckk ffiillee (Pack) Pack the file on the cursor position into the speci- fied archive file. When the cursor position indi- cates a directory, all of its contents is packed into the archive file. When some files are marked, the target is not the file on the cursor position but the marked files. According to the extension of the inputted archive file, the associated archiver is automatically selected. In builtin configuration, you can pack only the tar file and its compressed file and the LHa compressed file. You can describe configura- tions in the initial configuration file to support archivers except these. When you use ttaarr(1), you may sometimes be unable to pack a lot of files at once, because of the maximum parameter length which can be given at once. In those case, you can create the archive file with BBAACCKKUUPP_TTAAPPEE. OOppeerraattiioonnss wwiitthh ttrreeee [LL], [CC], [MM] and [UU] can make you select the path- name from the directory tree instead of the string input. They execute the internal command equivalent to LLOOGG_DDIIRR, CCOOPPYY_FFIILLEE, MMOOVVEE_FFIILLEE and UUNNPPAACCKK_FFIILLEE, respectively. FFiinndd ffiillee rreeccuurrssiivveellyy Find the file matching the wildcard recursively under the current directory, and move the directory where the found file exists. When the cursor posi- tion indicates a directory, it find the file under the directory on the cursor position instead of the current directory. You will be confirmed for each matching file whether if you move or not, and you can select [nn](No) unless the target file is displayed. CChhaannggee aattttrriibbuutteess rreeccuurrssiivveellyy Change attributes the directory on the cursor posi- tion revursively. As well as changing attributes of the marked files, you must select the mode, the time- stamp or the owner/group, before changing it all to- gether with each file under the directory. When you input the mode, you should notice that the attribute of the execution bit, in this case, is not a triple toggle but a 5-states toggle, which in- cludes 'XX' and '!!'. 'XX' means setting the bit only if the object is a directory or some execution bits are set. '!!' also means unsetting the bit only if the object is a directory or some execution bits are set. [mm](Mask) will mask a bit on the cursor posi- tion with '**', to keep the value of the original file attribute. IInnvvookkee llaauunncchheerr [RReettuurrnn] executes the operation according to the extension of the file on the cursor position, unless the cursor position indicates a directory. In buil- tin configuration, the archive browser is registered with the tar file and its compressed file and the LHa compressed file. You can describe configura- tions in the initial configuration file to register launchers except these. When the file on the cursor position has the unre- gistered extension, it will behave as same as VVIIEEWW_FFIILLEE. In the archive browser, the registered launcher is available, so that you can invoke the archive browser recursively. SSwwiittcchh ssyymmbboolliicc lliinnkk mmooddee In case of the symbolic link file, the file informa- tion displayed in the file column and the status line shows not the status of its referential file but the status of the link itself. It switches to show the status of the referential file. ((UUNNIIXX)) In the mode of showing the status of the referential file, 'SS'(Symbolic Link) is displayed on the left end of the function line. SSwwiittcchh ffiillee ttyyppee ssyymmbbooll mmooddee Switch to display the symbol which means the file type after the filename in the file list, like as the display in --FF option of llss(1). It is toggle to switch if display the symbol or not. The each sym- bol means the following. // directory @@ symbolic link ** executable file == socket || FIFO (MS-DOS version and the floppy drive) // directory ** executable file == system file || label In the mode of displaying the file type symbol, 'TT'(Type) is displayed on the left end of the func- tion line. SSwwiittcchh ddoott ffiillee ddiissppllaayy mmooddee Switch not to display the file whose filename starts with '.' in the file list. It is toggle to switch if display the dot file or not. In the mode of not displaying the dot file, 'HH'(Hidden) is displayed on the left end of the function line. SSwwiittcchh ffiillee ffllaagg ddiissppllaayy mmooddee Switch to display the file flag, which exists in some OS, instead of the file mode on each file. It is toggle to switch if display the file flag or the file mode. This is not available on any OS without the file flag. The each symbol means the following respectively. ((UUNNIIXX)) AA Archived NN Nodump aa system Append-only cc system unChangeable (immutable) uu system Undeletable aa user Append-only cc user unChangeable (immutable) uu user Undeletable In the mode of displaying the file flag, 'FF'(Flags) is displayed on the left end of the function line. SSeeaarrcchh ffiillee Search the current directory incrementally for the filename, with moving a cursor. When you execute this command, to switch to the search mode, a prompt appears in the function line. You can input the filename in this prompt, and a cursor will move to the filename matching the string which is already inputted at that present. [EEsscc] switches to the normal mode. SSpplliitt wwiinnddooww Split the current window. When you split a window in the normal non-split window mode, it will be the split window mode in which the screen is split into 2 windows vertically. In the split window mode, you can operate works individually on each window. When you split a window in the split window mode, the current working window is split into 2 windows ver- tically. You can make split windows up to 55. CChhaannggee wwiinnddooww Change effective window to the next in the split window mode. When the current window is the last, the first window will be effective. In the non- split window mode, it is ineffective. WWiiddeenn wwiinnddooww Widen the current window size in the split window mode, to narrow the next window size. When the cur- rent window is the last, the first window size will be narrowed. In the non-split window mode, it is ineffective. NNaarrrrooww wwiinnddooww Narrow the current window size in the split window mode, to widen the next window size. When the cur- rent window is the last, the first window size will be widened. In the non-split window mode, it is ineffective. KKiillll wwiinnddooww Kill the current window in the split window mode, to join it to the previous window. When the current window is the first, it will be joined to the last window. If the result number of windows is one, it will be the non-split window mode. In the non-split window mode, it is ineffective. IInnvvookkee ccuussttoommiizzeerr Invoke the customizer which interactively changes the configurations to be set up by the internal variable and the builtin command. While the confi- gurations which is set up here is reflected immedi- ately, you must intentionally save configurations in the customizer if you want to reflect in the initial configuration file. DDiissppllaayy hheellpp Display the list of the current key bindings and their command descriptions. When the list is not completely held in a screen, it prompts for every screen. In case of the circulated executable binary file, this screen shows the E-mail address of the circula- tion manager in the function line. Please contact here when something will happen. QQuuiitt (Quit) Quit from ffdd. CCoommmmaannddss In EEXXEECCUUTTEE_SSHH and the initial configuration file, you can use the internal commands described above and the builtin commands described below, as well as the external commands. With these commands, a pipeline can consist of one or more commands separated by || or ||&&. || connects the standard out- put of the previous command to the standard input of the next command. ||&& connects both the standard output and the standard error output of the previous command to the stan- dard input of the next command. The exit status of a pipe- line is the exit status of the last command. You can start a pipeline with !!, then the exit status of a pipeline will be the logical NOT of the exit status of the last command. Moreover, a command list can consist of one or more pipe- lines separated by ;;, &&, &&||, &&&&, ||||. This command list can end with ;;, && or &&||. These separators mean the following. ;; Execute commands sequentially. && Execute commands synchronously, not waiting for the preceding pipeline to finish. ((UUNNIIXX)) &&|| Same as &&, except to immediately ddiissoowwnn the job. ((UUNNIIXX)) &&&& Execute the following pipeline only if the preceding pipeline returns a 00 exit status. |||| Execute the following pipeline only if the preceding pipeline returns a non-00 exit status. In these command lists, a newline means as same as ;;. The input/output of each command in the command list can be redirected with the following redirectees. These redirectees can be placed on any position in the command string. _n<<_f_i_l_e Redirect the input indicated by the file descriptor _n into the input from _f_i_l_e. If _n is omitted, it is regarded as the standard input is specified. _n>>_f_i_l_e Redirect the output indicated by the file descriptor _n into the output to _f_i_l_e. If _n is omitted, it is regarded as the standard output is specified. If _f_i_l_e doesn't exist it is created, otherwise it is truncated to 0 length before output. _n>>||_f_i_l_e Same as >>, except to force to overwrite existent files even if --CC option is set by sseett the builtin command. _n>>>>_f_i_l_e Redirect the output indicated by the file descriptor _n into the output to _f_i_l_e. If _n is omitted, it is regarded as the standard output is specified. If _f_i_l_e doesn't exist it is created, otherwise output is appended to it. _n_1<<&&_n_2 Redirect the input indicated by the file descriptor _n_1 into the input indicated by the file descriptor _n_2. If _n_1 is omitted, it is regarded as the standard input is specified. _n_1>>&&_n_2 Redirect the output indicated by the file descriptor _n_1 into the output indicated by the file descriptor _n_2. If _n_1 is omitted, it is regarded as the standard output is specified. &&>>_f_i_l_e Redirect both the standard output and the stan- dard error output into the output to _f_i_l_e. If _f_i_l_e doesn't exist it is created, otherwise it is truncated to 0 length before output. &&>>||_f_i_l_e Same as &&>>, except to force to overwrite existent files even if --CC option is set by sseett the builtin command. &&>>>>_f_i_l_e Redirect both the standard output and the stan- dard error output into the output to _f_i_l_e. If _f_i_l_e doesn't exist it is created, otherwise output is appended to it. _n<<>>_f_i_l_e Redirect both the input/output indicated by the file descriptor _n into the input/output from/to _f_i_l_e. If _n is omitted, it is regarded as the standard input is specified. _n>><<_f_i_l_e Redirect both the input/output indicated by the file descriptor _n into the input/output from/to _f_i_l_e. If _n is omitted, it is regarded as the standard output is specified. _n_1<<>>&&_n_2 Redirect both the input/output indicated by the file descriptor _n_1 into the input/output indi- cated by the file descriptor _n_2. If _n_1 is omit- ted, it is regarded as the standard input is specified. _n_1>><<&&_n_2 Redirect both the input/output indicated by the file descriptor _n_1 into the input/output indi- cated by the file descriptor _n_2. If _n_1 is omit- ted, it is regarded as the standard output is specified. _n<<-- _n<<&&-- Close the input indicated by the file descrip- tor _n. If _n is omitted, it is regarded as the standard input is specified. _n>>-- _n>>&&-- Close the output indicated by the file descrip- tor _n. If _n is omitted, it is regarded as the standard output is specified. _n<<>>-- _n<<>>&&-- Close both the input/output indicated by the file descriptor _n. If _n is omitted, it is re- garded as the standard input is specified. _n>><<-- _n>><<&&-- Close both the input/output indicated by the file descriptor _n. If _n is omitted, it is re- garded as the standard output is specified. _n<<<<[--]_w_o_r_d Redirect the input indicated by the file descriptor _n into the input which is read up to a input line as same as _w_o_r_d, or to an end of file. If any part of _w_o_r_d is quoted, no input line is evaluated. Otherwise, each input line is evaluated to expand variables or replace strings. When you specify --, all tabs on the beginning of input lines is stripped to be send to a command. If _n is omitted, it is regarded as the standard input is specified. When you specify the file with each redirect, you can de- scribe the filename as `_s_c_h_e_m_e::////_h_o_s_t::_p_o_r_t' form to open the following TCP sockets, according to the string of _s_c_h_e_m_e. The authentication of your OS will restrict specifying the accepting port. ((UUNNIIXX)) ccoonnnneecctt::////_h_o_s_t::_p_o_r_t This socket is connected to the remote host specified by _h_o_s_t with the TCP port number spec- ified by _p_o_r_t. aacccceepptt::////[_h_o_s_t][::_p_o_r_t] This socket is accepted to the local host spec- ified by _h_o_s_t with the TCP port number specifi- ed by _p_o_r_t. If _h_o_s_t is omitted, this socket will be accepted to any host. If _p_o_r_t is omit- ted, the port within the range determined by the OS is used. bbiinndd::////[_h_o_s_t][::_p_o_r_t] This socket is bound to the local host specifi- ed by _h_o_s_t with the TCP port number specified by _p_o_r_t, preparing aacccceepptt the builtin command. If _h_o_s_t is omitted, this socket will be accept- ed to any host. If _p_o_r_t is omitted, the port within the range determined by the OS is used. On each command line, the string from '##' to the end of line and a null line are ignored. When the line ends with '\\', it is referred as continuing into the next line, so that you can split a long line with this. BBuuiillttiinn CCoommmmaannddss FFdd has the following builtin commands. These builtin com- mands can be used in EEXXEECCUUTTEE_SSHH and the initial configura- tion file. iiff _l_i_s_t tthheenn [eelliiff _l_i_s_t tthheenn _l_i_s_t] ... [eellssee _l_i_s_t] ffii The _l_i_s_t of iiff clause and eelliiff clauses are executed in order, and if each exit status is a 0, then the _l_i_s_t of tthheenn clause associated with it is executed and the eelliiff clauses after it are ignored. If no _l_i_s_t of iiff clause nor eelliiff clauses return a 0, the _l_i_s_t of eellssee clause is executed. If no _l_i_s_t of tthheenn clauses nor eellssee clause is executed, then iiff returns a 00 exit status. wwhhiillee _l_i_s_t ddoo _l_i_s_t ddoonnee The _l_i_s_t of wwhhiillee clause is executed repeat- edly, and while its exit status is 0, the _l_i_s_t of ddoo clause is executed repeatedly. If the _l_i_s_t of ddoo clause is never executed, then wwhhiillee returns a 00 exit status. uunnttiill _l_i_s_t ddoo _l_i_s_t ddoonnee The _l_i_s_t of uunnttiill clause is executed repeat- edly, and while its exit status is NOT 0, the _l_i_s_t of ddoo clause is executed repeatedly. If the _l_i_s_t of ddoo clause is never executed, then uunnttiill returns a 00 exit status. ffoorr _N_A_M_E [iinn _v_a_l_u_e ...] ddoo _l_i_s_t ddoonnee _N_A_M_E the internal variable is substituted for values of _v_a_l_u_e one by one, and _l_i_s_t is exe- cuted according to the each value. If iinn _v_a_l_u_e is omitted, then each positional parameter is substituted one by one. ccaassee _w_o_r_d iinn [_p_a_t_t_e_r_n [|| _p_a_t_t_e_r_n] ... )) _l_i_s_t ;;;;] ... eessaacc The string _w_o_r_d is compared with the each _p_a_t_- _t_e_r_n, _l_i_s_t associated with the _p_a_t_t_e_r_n which first matches it is executed. ((_l_i_s_t)) Execute _l_i_s_t in a sub shell. {{ _l_i_s_t;; }} Execute _l_i_s_t in the current shell. _N_A_M_E==[_v_a_l_u_e] [_c_o_m ...] Define a internal variable which is available only in ffdd. It substitutes the value (string) _v_a_l_u_e for _N_A_M_E the internal variable. When you describe the command _c_o_m after the defini- tion of a variable, _c_o_m is executed on the state where this variable is regarded as the environment variable. In this case, the definition of _N_A_M_E is not remain as the environment variable nor the internal vari- able. If _v_a_l_u_e is omitted, the value of _N_A_M_E the internal variable is defined as a null. If you want to delete the definition of a inter- nal variable, use uunnsseett the builtin command. _n_a_m_e(()) {{ _l_i_s_t; }} Define a function whose body is _l_i_s_t, as the name of _n_a_m_e. The defined function can be used in the command line of EEXXEECCUUTTEE_SSHH and each command macro described below. You can use the positional parameter $$_n in each description of _l_i_s_t, which indicates the argu- ment when the function is invoked. $$00 is _n_a_m_e itself, and $$11-$$99 indicates each argument. Although you cannot omit {{ }} and _l_i_s_t, you can omit {{ }} before/after _l_i_s_t which consists of a single command. If you want to delete the definition of a function, use uunnsseett the buil- tin command. !!_n_u_m Execute the command which has the history number specified with the numeric value _n_u_m. When _n_u_m is negative value, it executes the command which has the history number as the current history number minus _n_u_m. !!!! Execute the previous command. This is synonym for !!--11. !!_s_t_r Execute the command history which starts with the string _s_t_r. :: [_a_r_g ...] No effect. But it evaluates _a_r_g and performs redirection. .. _f_i_l_e ssoouurrccee _f_i_l_e Read and evaluate commands from _f_i_l_e. _F_i_l_e must exists on the directory which PPAATTHH includes, or be described with pathname. The each line format is based on the format of EEXXEECCUUTTEE_SSHH. You can describe this in the file as nesting. aacccceepptt [_f_d] Accept the connection with the file descriptor indicated by _f_d, and the connected socket will be assign to _f_d of the same file descriptor. At the same time, the accepted socket will be closed. When fd is not the redirection as the form of bbiinndd::////, this command will be failed. In comparison with the redirection as the form of aacccceepptt::////, the shell can receive controls before establishing connection to negotiate the TCP port number with the remote host in ad- vance. ((UUNNIIXX)) If _f_d is omitted, the connection will be ac- cepted with the standard input. aaddddccrr [--11] [_f_i_l_e] Output the string read from the file specified by _f_i_l_e, line by line. The newline of each line is unified into CR-NL (\r\n). It is use- ful to pipe the output to some socket. If _f_i_l_e is omitted, it is regarded as the stan- dard input is specified. If --11 is specified, it will output just 1 line and exit. aalliiaass [_n_a_m_e[==_c_o_m]] Define a alias whose body is _c_o_m, as the name of _n_a_m_e. The defined alias can be used in the command line of EEXXEECCUUTTEE_SSHH and each command macro described below. The alias substitution is performed recursively. If _c_o_m is omitted, the alias of _n_a_m_e is displayed. If both _c_o_m and _n_a_m_e are omitted, all the current alias definition list is displayed. aarrcchh _e_x_t [_p_a_c_k _u_n_p_a_c_k] Register the archiver command associated with the archive file which has _e_x_t the extension. The pack command is specified as _p_a_c_k, and the unpack command is specified as _u_n_p_a_c_k, using the macro representation quoted with "". When _e_x_t starts with //, uppercase/lowercase is ignored in the comparison of any extension. If both _p_a_c_k and _u_n_p_a_c_k are omitted, the archiver command registration for _e_x_t the extension is deleted. bbgg [_j_o_b] Continue the execution of the job specified with _j_o_b in the background. The following format is available to specify a job. ((UUNNIIXX)) %% %%++ the current job %%-- the previous job %%_n the job with job number _n %%_s_t_r the job whose command line starts with _s_t_r But, you must describe these %% in the command line of EEXXEECCUUTTEE_SSHH as the duplicated expres- sion, such as %%%%, for the reason of the param- eter macro function described below. If _j_o_b is omitted, the current job is contin- ued in the background. bbiinndd _c [_c_o_m_1 [_c_o_m_2] [::_c_o_m_m_e_n_t]] Bind the command _c_o_m_1 to the key _c. When you want to specify a control character for _c, you can prefix ^^ into 2 characters, such as ^A. When you want to specify a character with the META key (or the ALT key on MS-DOS version), you can prefix @@ into 2 characters, such as @a. When you want to specify a function key and a special key, you can use each identifier described in kkeeyymmaapp command after, such as F10. Or you can describe the escape sequence, such as \\nn and \\ee, and the octal expression, such as \\oooooo. In case of binding the internal command of ffdd, you can the command identifier as it is. When you want to define the internal command with some arguments or define the command in the macro representation, you should describe the string quoted with "". If _c_o_m_2 is not omitted, _c_o_m_2 is executed when the cursor position indicates a directory. When the key _c is the function key of F1-F20, if you describe _c_o_m_- _m_e_n_t prefixed with :: trailing the command description, you can change the display of associated part in the function line into _c_o_m_- _m_e_n_t. However, note that, with the key binding for the control key, the configuration in the edit mode described below is prior to the key bind- ing. If both _c_o_m_1 and _c_o_m_2 are omitted, the regis- tration of key binding for the key _c is deleted. bbrreeaakk [_n] Exit from the loop, it is used in the ffoorr statement and so on. If _n is specified, it breaks _n levels from the loop. bbrroowwssee [--@@ _f_i_l_e] bbrroowwssee _c_o_m [--ffttbbiiee _a_r_g] [--pp _c_o_m_2] [--ddnn {nnoopprreepp,lloooopp}] ... Execute _c_o_m the command, and invoke the archive browser who receives its output. You should the macro representation quoted with "" as _c_o_m. --ff, --tt, --bb, --ii and --ee options are the same as the one for llaauunncchh the builtin com- mand. In case that multiple _c_o_ms are specified, the next _c_o_m the command is exe- cuted one after another when you select each files in the archive browser, and the formats and patterns described after each _c_o_m the com- mand are adopted. In order to return to the previous level of archive browser, you should select the file named as .... or push the key [BBss]. Or you can use QQUUIITT_SSYYSSTTEEMM the command to escape from all of the archive browsers invoked by bbrroowwssee. You must describe --ff option, except for the last _c_o_m the command. When the last _c_o_m has no --ff option, the com- mand has been just executed instead of invok- ing an archive browser, and then will return to the previous archive browser when it is done. When you specify --pp option, the execution of _c_o_m_2 the command precedes the execution of the next _c_o_m the command when you select a file. While _c_o_m is executed in the sub shell for a pipeline, _c_o_m_2 is executed in the current shell to inherit the values of internal vari- ables set in this command after _c_o_m_2 has been done. The filenames which is selected toward this level of archive browser are held in positional parameters sequentially, and the last selected filename is held in $$11. These parameters will be newly set whenever you select a file, so that they are reset in sequential order when you select the next file even if you replace them with sseett or sshhiifftt the builtin command. --dd and --nn options specify a control if the selected file is a directory or not respectively. When you specify nnoopprreepp, _c_o_m_2 specified by --pp option is not executed. When you specify lloooopp, you don't step the next _c_o_m the command but the same _c_o_m the command again. And when you think troublesome to describe too many arguments for bbrroowwssee, you can specify _f_i_l_e the file in which some arguments are described with --@@ option. You can describe --@@ option in any place of arguments, the argu- ments described in _f_i_l_e are inserted in the place where --@@ is described. If you specify -- as _f_i_l_e, arguments are read from the standard input instead of the file. You should describe arguments in _f_i_l_e with spaces or new- lines as separator. The null line and the line started with ## will be ignored. When you describe --@@ option in _f_i_l_e, the argument file is referred recursively. bbuuiillttiinn _a_r_g ... Execute _a_r_g as a simple builtin command. When the same named function is defined, the func- tion will not be executed. ccdd [--LLPP] [_d_i_r] cchhddiirr [--LLPP] [_d_i_r] Change the current directory in ffdd to _d_i_r. If _d_i_r is omitted, it moves to the directory indicated by HHOOMMEE the internal variable. If you specify the pathname as "..", "??", "--", "@@", it behaves like as LLOOGG_DDIIRR. If --LL is specified, the logical pathname fol- lowing symbolic links is used. If --PP is specified, the physical pathname following no symbolic links is used. Otherwise, the pphhyyssii-- ccaall option for sseett the builtin command is effective. cchheecckkiidd [_f_i_l_e ...] Calculate the unique ID of the specified file and display it, according to the MD5 algorithm in RFC1321. When you specify multiple _f_i_l_es, the IDs of all specified files are calculated and displayed. When you specify nothing, the ID of running ffdd itself is displayed. Since this algorithm is guaranteed to be secure, it is available to confirm the iden- tity of files. ccllss Clear the screen. ccoommmmaanndd [--pp | --vv | --VV] _a_r_g ... Execute _a_r_g as a simple command. When the same named function is defined, the function will not be executed. If --pp is specified, the default value of PPAATTHH is used to search the path. If --vv is specified, the absolute path for _a_r_g is displayed instead of executing _a_r_g. In this case, _a_r_g the builtin command will cause simply its name. If --VV is specified, verbose description for _a_r_g is displayed as same as ttyyppee. ccoonnttiinnuuee _n Resume the next iteration in the loop, it is used in the ffoorr statement and so on. If _n is specified, it resumes the next iteration in the loop _n - 1 levels out of the loop. ccooppyy [--AABBVVYY--YY] _s_r_c [--AABB] [++ _s_r_c_2 [--AABB] [++ ...]] [_d_e_s_t [--AABB]] Copy the file indicated by _s_r_c into the file or the directory indicated by _d_e_s_t. When _d_e_s_t indicates a directory, the filename in the destination is _s_r_c. If _d_e_s_t is omitted, it is copied into the current directory. You can specify multiple source files by describing to separate them with ++, or by using the wild- card. When you separate them with ++, those files are concatenated and copied. When you use the wildcard, they are copied one by one in case that the destination is a directory, and they are concatenated in case that the destination is a file. When you specify --AA, it is treated as the ASCII text file. When you specify --BB, it is treated as the binary file. When you specify --VV, it is verified to copy. When you specify --YY, it doesn't prompts for confirming to overwrite into the destination. When you specify ----YY, it prompts for confirmation before overwriting into the destination. (MS-DOS version requires to use // instead of -- as an option prefix for compatibility with COMMAND.COM.) ddeell [--PP] _f_i_l_e eerraassee [--PP] _f_i_l_e Delete the files indicated by _f_i_l_e. You can specify multiple files by using wildcard. When you specify --PP, it prompts for confirma- tion before deleting files. (MS-DOS version requires to use // instead of -- as an option prefix for compatibility with COMMAND.COM.) ddiirr [--[--]PPWWSSBBLLVV44] [--AA[DDRRHHSSAA--]] [--OO[NNSSEEDDGGAA--]] [_d_i_r] List files and sub directories in the direc- tory indicated by _d_i_r. If _d_i_r is omitted, the information in the current directory is listed. When you specify --PP, it prompts for every screen. When you specify --WW, it is listed in the wide view. When you specify --AA, it lists only the files which have the attribute indi- cated by the trailing character. DD directory RR read only file HH hidden file SS system file AA ready to archive -- except it When you specify --OO, it sorts with the sorted type indicated by the trailing character. NN by name SS by size EE by extension DD by date & time GG directory first AA by last access time -- reverse order When you specify --SS, it lists files in all sub directories. When you specify --BB, it displays only names of files and directories. When you specify --LL, it uses lowercase. When you specify --VV, it lists the verbose information. When you specify --44, it displays year with 4 digits. And you can prefix -- to any option letter to override the option. (MS-DOS version requires to use // instead of -- as an option prefix for compatibility with COMMAND.COM.) ddiirrss Display the list of the current directory stack. PPuusshhdd and ppooppdd the builtin command can load/unload directories onto the directory stack. ddiissoowwnn [_j_o_b] Remove the job specified with _j_o_b from the shell control. The job to be ddiissoowwnned cannot be controlled by jjoobbss, ffgg and bbgg. If invoked as a login shell, any jobs not to be ddiissoowwnned will be forced to exit when the shell finish. ((UUNNIIXX)) If _j_o_b is omitted, the current job is removed from the shell control. ddttyyppee _f_i_l_e Display the contents of the file indicated by _f_i_l_e. eecchhoo [--nnNN] [_a_r_g ...] Echo _a_r_g to the standard output. When you don't specify --nn, newline is added to output trailing after _a_r_g. When you specify --NN, the outputted newline becomes CR-NL (\r\n). See eecchhoo(1) for details. eennaabbllee [--nn] [_a_r_g ...] Enable _a_r_g as a builtin command. When you specify --nn, it is disabled. If _a_r_g is omit- ted, all of the enabled or disabled builtin commands is listed. eevvaall [_a_r_g ...] Evaluate _a_r_g and execute the results. eevvaallmmaaccrroo [_a_r_g ...] Evaluate parameter macros included in _a_r_g and execute the results. Since eevvaall doesn't evaluate any parameter macro, you should choose them according to uses. When in the function, you cannot use any parameter macro, then you need this command to extract parame- ter macros. eexxeecc [_c_o_m [_a_r_g ...]] Execute _c_o_m in place of the execution of ffdd. You can specify _a_r_g as arguments of _c_o_m. eexxiitt [_n] Exit from ffdd. When you specify _n, it exits with the exit status _n. eexxppoorrtt [_N_A_M_E[==[_v_a_l_u_e]] ...] Mark _N_A_M_E the internal variable to be inherited to child processes as the environ- ment variable. Since then, the definition of _N_A_M_E can be referred in any child process. When you eexxppoorrtt the undefined internal vari- able, it doesn't become the environment vari- able until the internal variable is defined. When you want to define the value at the same time, you should specify _v_a_l_u_e. If only == is specified and _v_a_l_u_e is omitted, the value of _N_A_M_E the environment variable is defined as a null. If no argument is speci- fied, all of the eexxppoorrtted environment vari- ables is listed. When you want to delete the definition of the environment variable, you can use uunnsseett the builtin command. ffaallssee Only return with a 11 exit status. ffcc [--ll | --ss [_o_l_d==_n_e_w ...]] [--nnrr ] [--ee _e_d_i_t_o_r] [_f_i_r_s_t [_l_a_s_t]] List or edit command histories. _F_i_r_s_t and _l_a_s_t select the range of command histories. This specification can be described as a numeric value or a string. A positive value means the command history number, and a nega- tive value means the command history which has the history number as the current history number minus the value. A string mean the command history which starts with the string. If --nn is specified, command histories are listed without their history numbers. If --rr is specified, command histories are listed in reverse order. If --ee is specified, the editor named by _e_d_i_t_o_r is used to edit command his- tories, otherwise the editor specified by FFCCEEDDIITT or EEDDIITTOORR the internal variable is used. When --ll is specified, selected command his- tories are listed to the standard output. In this case, omitting _l_a_s_t means to specify the current history number, and also omitting _f_i_r_s_t means to specify --1166. When --ss is specified, the command history selected by _f_i_r_s_t is executed immediately. In this case, omitting _f_i_r_s_t means to specify the current history number. The first occurrence of the string _o_l_d in the command history will be replaced by the string _n_e_w before execu- tion. When neither --ll nor --ss is not specified, selected command histories are edited, and then each edited commands are executed one by one with display in the standard output. In this case, omitting _l_a_s_t means to specify _f_i_r_s_t, and also omitting _f_i_r_s_t means to specify the current history number for both. ffdd [_d_i_r_e_c_t_o_r_y [_d_i_r_e_c_t_o_r_y_2]] Invoke ffdd from the internal shell. If you specify _d_i_r_e_c_t_o_r_y, the current directory is moved to the directory initially. If you specify _d_i_r_e_c_t_o_r_y_2, the split window mode is invoked, and the current directory of the supplemental window is moved to the directory. You can return to the internal shell by QQUUIITT_SSYYSSTTEEMM. It is effective only when it is invoked as ffddsshh. ffgg [_j_o_b] Continue the execution of the job specified with _j_o_b in the foreground. The following format is available to specify a job. ((UUNNIIXX)) %% %%++ the current job %%-- the previous job %%_n the job with job number _n %%_s_t_r the job whose command line starts with _s_t_r But, you must describe these %% in the command line of EEXXEECCUUTTEE_SSHH as the duplicated expres- sion, such as %%%%, for the reason of the param- eter macro function described below. If _j_o_b is omitted, the current job is contin- ued in the foreground. ggeettffrreeqq [_f_i_l_e] Output the contents of the translation fre- quency file, specified by _f_i_l_e, to the stan- dard output for the users Kana-Kanji trans- lation learning. The output format provides one record per line, which consists of "Yomi- Gana", "word" and "frequency" separated by tab. You can use this output as the argument of sseettffrreeqq to import the frequency information. If _f_i_l_e is omitted, it is regarded as the translation frequency file specified by FFRREEQQFFIILLEE the internal variable. ((UUNNIIXX)) ggeettkkeeyy [_n_u_m] Get the key code sequence for the pushed key. It prompts after executed, and displays the key code sequence for the key which you push to specify. It continues until you push any key _n_u_m times. When _n_u_m is more than 11 time, you can stop it with pushing [SSppaaccee]. When _n_u_m is 00 time, it continues forever until [SSppaaccee] is pushed. The displayed sequence can be used as the key code sequence for kkeeyymmaapp command. ((UUNNIIXX)) If _n_u_m is omitted, it is regarded as 11 time is specified. ggeettooppttss _o_p_t_s_t_r _N_A_M_E [_a_r_g ...] Used to parse the optional parameters from a sequence of _a_r_g. The valid characters as option is described in _o_p_t_s_t_r. An option character which needs an argument is described with following :: in _o_p_t_s_t_r. Each time ggeettooppttss is invoked, the new option character parsed from _a_r_g is substituted for _N_A_M_E the internal variable. When the option has an argument, the argument is substituted for OOPPTTAARRGG the internal variable. And the index of the next parameter is substituted for OOPPTTIINNDD the inter- nal variable every time. The value of OOPPTTIINNDD is initialized to 11 whenever the shell is invoked, another parsing of option parameters needs initializing OOPPTTIINNDD to 11 manually. If _a_r_g is omitted, positional parameters are parsed to the optional parameters. When the end of option is encountered, ggeettooppttss will exit with the value of 11. In this case, ?? is substituted for _N_A_M_E. When an option character which is not included in _o_p_t_s_t_r is found, an error message is written to the standard error, then ?? is substituted for _N_A_M_E and OOPPTTAARRGG is unset. But, if OOPPTTAARRGG is started with ::, no error message is written, and the found option character is substituted for OOPPTTAARRGG instead. When no argument is found with the option character which needs an argu- ment, an error message is written to the stan- dard error, then ?? is substituted for _N_A_M_E and OOPPTTAARRGG is unset. But, if OOPPTTAARRGG is started with ::, no error message is written, then the found option character is substituted for OOPPTTAARRGG instead, and :: is substituted for _N_A_M_E. hhaasshh [--rr | _c_o_m ...] Search the absolute path for _c_o_m referring to PPAATTHH, which indicates the search path when the external command is executed, and register the result in the hash table. When you specify --rr instead of _c_o_m, all the memorized hash table is discarded. If _c_o_m is omitted, the hash table information is listed. hhiittss, ccoosstt, ccoommmmaanndd indicate the number of times the command has been executed, the meas- ure of the work required to search it in the search path, and the absolute path for the command, respectively. When the command is searched in a relative directory, it is neces- sary to re-search whenever the current direc- tory is moved, because it is not registered as the absolute path. In such command, ** trail- ing hhiittss is displayed. hhiissttoorryy [_n] List the last _n command histories with the history number. If _n is omitted, all of the memorized command histories is listed. jjoobbss List the running jobs. ((UUNNIIXX)) kkccoonnvv [--ii _i_n] [--oo _o_u_t] [_i_n_f_i_l_e [_o_u_t_f_i_l_e]] Read from _i_n_f_i_l_e and convert its Kanji code from _i_n to _o_u_t, and output to _o_u_t_f_i_l_e. In _i_n and _o_u_t, you can specify the string which used in FFNNAAMMEEKKCCOODDEE the internal variable described below. If each of them is omitted, it is re- garded as that the Kanji code specified in com- pile is specified. If _o_u_t_f_i_l_e is omitted, it outputs to the standard output. If also _i_n_f_i_l_e is omitted, it reads from the standard input. ((UUNNIIXX)) kkeeyymmaapp [_c [_s_t_r]] Map the sequence _s_t_r as key code of the spe- cial key _c. You can use only the following identifiers as _c. ((UUNNIIXX)) UUPP Up DDOOWWNN Down RRIIGGHHTT Right LLEEFFTT Left BBEEGG Begin EEOOLL Eol HHOOMMEE Home EENNDD End IINNSS Insert DDEELL Delete IINNSSLLIINN InsLine DDEELLLLIINN DelLine PPPPAAGGEE PageUp NNPPAAGGEE PageDown EENNTTEERR Enter BBSS Bs CCLLRR Clear HHEELLPP Help PPLLUUSS + (tenkey) MMIINNUUSS - (tenkey) AASSTTEERR * (tenkey) SSLLAASSHH / (tenkey) CCOOMMMMAA , (tenkey) DDOOTT . (tenkey) EEQQUUAALL = (tenkey) RREETT Return (tenkey) TTKK00..TTKK99 0-9 (tenkey) FF11...FF2200 function key You can use the escape sequence in the key code sequence, such as \\nn =0x0a and \\ee =0x1b. You can also use the octal expression, such as \\oooooo. You can describe the control character prefixing ^^, such as ^A. ^^ itself can be described as \\^^. If _s_t_r is omitted, the key code sequence for _c is displayed. If both _s_t_r and _c are omitted, all of the mappings for special keys is listed. When you specify _s_t_r as """", the key code map- ping for _c is canceled. kkiillll [--ll | --_s_i_g_n_a_l] [_p_i_d | _j_o_b ...] Send the signal indicated by _s_i_g_n_a_l to the process indicated by the process number _p_i_d or to the job indicated by _j_o_b. _S_i_g_n_a_l is described as a numeric value or a signal name. If _s_i_g_n_a_l is omitted, SSIIGGTTEERRMM is send. When you specify --ll, it lists the signal names which can be used as _s_i_g_n_a_l instead of sending a signal. llaauunncchh _e_x_t [_c_o_m [_f_o_r_m_a_t [_t_o_p _b_o_t_t_o_m]]] llaauunncchh _e_x_t _c_o_m [--ff _f_o_r_m_a_t] [--tt _t_o_p] [--bb _b_o_t_t_o_m] [--iiee _p_a_t_t] Register the behavior for _e_x_t the extension as the launcher. You should the macro represen- tation quoted with "" as _c_o_m. When you regis- ter an archive browser, you should describe the command to list the archived files as _c_o_m, and describe the format of the list as _f_o_r_m_a_t. When you describe _t_o_p and _b_o_t_t_o_m, you can specify unnecessary lines in the list as the number of lines from the top/bottom line. When _e_x_t starts with //, uppercase/lowercase is ignored in the comparison of any extension. If _c_o_m is omitted, the launcher registration for _e_x_t is canceled. When you register an archive browser, you can use the latter form to describe more detailed control. You can specify multiple formats as candidates with multiple --ff options. These candidates for format are compared in order of appearance, if no one is matched completely then the nearest one is adopted. --ii and --ee options specify _p_a_t_t the pattern for the line to be ignored and for the line to be treated as error respectively. When the list includes unnecessary lines you can specify also _t_o_p and _b_o_t_t_o_m, but you must specify lines except top/bottom lines with --ii option. In case that a failure to unpack files in the archive file causes outputting some strings, you can specify the strings with --ee option. --ii and --ee options can specify multiple patterns, and they are effective if one of them is matched. And you can use a wildcard in the description for each _p_a_t_t the pattern. mmdd _d_i_r Create the directory _d_i_r. mmkkddiirr _d_i_r Same as mmdd. ((DDOOSS)) nneewwggrrpp [_a_r_g ...] Execute nneewwggrrpp(1) in place of the execution of ffdd. You can specify _a_r_g as arguments of nneewwggrrpp(1). See nneewwggrrpp(1) for details. ((UUNNIIXX)) llooggiinn [_a_r_g ...] Execute llooggiinn(1) in place of the execution of ffdd. You can specify _a_r_g as arguments of llooggiinn(1). See llooggiinn(1) for details. ((UUNNIIXX)) llooggoouutt [_n] Exit from a login shell. When you specify _n, it exits with the exit status _n. ppooppdd Unload the top directory onto the directory stack, and change the current directory in ffdd to the directory. This command is failed when the directory stack is empty. pprriinnttaarrcchh [_e_x_t] Print the archiver commands registered for the archive file which has _e_x_t the extension. If _e_x_t is omitted, all of the registered archiver commands is listed. pprriinnttbbiinndd [_c] Print the command binded to the key _c. You can specify the key as well as bbiinndd. If _c is omitted, all of the registered key bindings is listed, which is defined not as the internal command but as the command macro. The key bindings of internal commands can be referred in HHEELLPP_MMEESSSSAAGGEE. pprriinnttddrrvv [_c] Print the device file and the number of heads/sectors/cylinders of the floppy drive registered for the drive name _c. ((UUNNIIXX)) If _c is omitted, all of the registered floppy drives is listed. pprriinnttllaauunncchh [_e_x_t] Print the command macro registered as the launcher for _e_x_t the extension. When it is registered as the archive browser, the format for listing is also printed. If _e_x_t is omitted, all of the registered launchers is listed. pprriinnttrroommaann [_r_o_m_a_n] Print the Roman-Kana translation table for the Kana-Kanji IME mode. It means printing the Japanese string bound for _r_o_m_a_n the Roman string. ((UUNNIIXX)) If _r_o_m_a_n is omitted, all the registered Roman- Kana translation table is listed. ppuusshhdd [_d_i_r] Load the current directory onto the directory stack, and change the current directory in ffdd to _d_i_r. If you specify the pathname as "..", "??", "--", "@@", it behaves like as LLOOGG_DDIIRR. The pphhyyssiiccaall option for sseett the builtin com- mand is effective for symbolic links. If _d_i_r is omitted, change the current direc- tory to the top directory of the directory stack, and replace it with the current direc- tory. In this case, this command is failed when the directory stack is empty. ppwwdd [--LLPP] Display the current directory with the abso- lute representation. If --LL is specified, the logical pathname following symbolic links is displayed. If --PP is specified, the physical pathname following no symbolic links is displayed. Otherwise, the pphhyyssiiccaall option for sseett the builtin command is effective. rreeaadd [--NN] [_N_A_M_E ...] Read one line from the standard input and sub- stitute that string for _N_A_M_E the internal variable. The inputted string is separated with IIFFSS into some words. When multiple _N_A_M_Es are specified, words are substituted one by one from the first of line, and all the rest are substituted for the last _N_A_M_E. When the number of words in inputted string is less than the number of _N_A_M_E, a null is substituted for the rest of _N_A_M_E. If --NN is specified, the newline of the line to be read is regarded as CR-NL (\r\n). rreeaaddlliinnee [_p_r_o_m_p_t] Read one line from the terminal input and out- put that string to the standard output. When _p_r_o_m_p_t is specified, the string is displayed on the beginning of input line. This command differs from rreeaadd the builtin command in the terminal input and the line editing. You can- not use the history as one of the line edit- ing, but can use the completion for a path- name. rreeaaddoonnllyy [_N_A_M_E[==[_v_a_l_u_e]] ...] Mark _N_A_M_E the internal variable to be readonly. Since then, you cannot change the value of _N_A_M_E. When you want to define the value at the same time, you should specify _v_a_l_u_e. If only == is specified and _v_a_l_u_e is omitted, the value of _N_A_M_E the internal variable is defined as a null. If no argument is specified, all of the readonly internal vari- ables is listed. rrdd _d_i_r Delete the directory _d_i_r. You cannot delete the non-empty directory. rrmmddiirr _d_i_r Same as rrdd. ((DDOOSS)) rreenn _o_l_d _n_e_w rreennaammee _o_l_d _n_e_w Rename the filename or the directory name _o_l_d into _n_e_w. You can specify the wildcard in _o_l_d and _n_e_w to rename the multiple filenames all together. rreemm [_a_r_g ...] No effect, same as ::. rreettuurrnn [_n] Return from a function with the return value specified by _n. If _n is omitted, the return value is the exit status of the last executed command. It cannot be used out of a function. ssaavveettttyy [--nn] Save the current terminal settings. The saved settings will be restored when EEXXEECCUUTTEE_SSHH is executed later. In case that you change termi- nal settings with ssttttyy(1) and so on, you should save the settings with this command not to reset settings with the next execution of EEXXEECCUUTTEE_SSHH. If you change terminal settings and execute this command not in the same com- mand line, you should notice that this command will save the reset settings. If --nn is speci- fied, the saved settings will be cleared. ((UUNNIIXX)) sseett [----aabbCCeeffhhkkmmnnttuuvvxx] [--oo _o_p_t_i_o_n] [_a_r_g ...] List internal variables and functions, without any argument. When you specify _a_r_g, _a_r_g is substituted for the positional parameter $$11, $$22, ..., $$_n in order. When you specify any option, each option means the following. When you use ++ instead of --, the option parameter turns off each option. --aa EExxppoorrtt any internal variable automati- cally when it is defined. --bb When a background job has been ter- minated, its status report will be displayed immediately. there is no effect when the job control is not enabled. --CC Prevent overwriting to any existent files in redirection. --ee Exit immediately when any command returns the exit status except 00. --ff Disable the wildcard expansion. --hh Register any command to the hash table just before it is executed. The commands used in a function are read when it is defined, and are registered to the hash table. The command hash itself is always valid, if --hh option is set or not. --kk Treat all _N_A_M_E==[_v_a_l_u_e] formed arguments as the variable definition, while they are not placed on the beginning of com- mand line string. --mm Enable the job control. This option is valid by default. ((UUNNIIXX)) --nn Read command inputs but don't execute them. --oo _o_p_t_i_o_n The following identifiers are valid in _o_p_t_i_o_n. aalllleexxppoorrtt Same as --aa. aauuttoossaavveettttyy Same as --SS. eemmaaccss Same as EEDDIITTMMOODDEE==eemmaaccss. eerrrreexxiitt Same as --ee. hhaasshhaahheeaadd Same as --hh. iiggnnoorreeeeooff Any EEOOFF will not terminate the interactive shell. kkeeyywwoorrdd Same as --kk. mmoonniittoorr Same as --mm. nnoocclloobbbbeerr Same as --CC. nnooeexxeecc Same as --nn. nnoogglloobb Same as --ff. nnoottiiffyy Same as --bb. nnoouunnsseett Same as --uu. oonneeccmmdd Same as --tt. pphhyyssiiccaall Same as --PP. ppttyysshheellll Same as --TT. vveerrbboossee Same as --vv. vvii Same as EEDDIITTMMOODDEE==vvii. xxttrraaccee Same as --xx. If _o_p_t_i_o_n is omitted, the values of the current options are displayed. --PP CCdd and ppwwdd the builtin command use the physical directory structure instead of the logical directory structure following symbolic links. --SS Execute ssaavveettttyy the builtin command auto- matically whenever any command line is processed. The terminal settings will be saved absolutely unless you operate the terminal settings intentionally, so that you should manually adjust the terminal settings saved accidentally. ((UUNNIIXX)) --TT Invoke ffddsshh as the pseudo terminal. You cannot invoke any more pseudo terminals in this mode. It is effective only if you specify it as the startup option or in the initial configuration file. It is effective only if you specify it as the startup option, when the shell is execut- ed as the non-interactive shell. It is just ignored when invoked as ffdd. ((UUNNIIXX)) --tt Exit immediately after executing the current command input. --uu Treat the reference of undefined vari- ables as an error. --vv Display the command inputs whenever they are read. --xx Display the command strings whenever they are executed. ---- Indicate the end of options. No flag is changed. sseettddrrvv _c _d_e_v_i_c_e _h_d _s_c _c_l Specify the device file indicated by _d_e_v_i_c_e for the MS-DOS floppy drive named as _c. At the same time, _h_d, _s_c, _c_l are specified as the number of heads(sides)/sectors/cylinders(tracks) in the format which is treated in the driver of _d_e_v_- _i_c_e. In special case, when you want to treat the 640KB2DD(hd=2/sc=8/cl=80) floppy disk with the driver which can treat only the 820KB2DD(hd=2/sc=9/cl=80) floppy disk, you should specify the value adding 110000 (108) as the value of _s_c. ((UUNNIIXX)) On the PC-UNIX environment which is worked on PC, specifying the string HHDDDD or HHDDDD9988 instead of _h_d, _s_c, _c_l, can register the MS-DOS parti- tion on the hard disk for the PC/AT compatible machine or PC-9800 series. In this case, You should describe the device file as the device name prepared per the physical drive unit rather than the device name prepared per the partition (slice). The MS-DOS partitions included in the drive unit are automatically expanded to the drive name after the drive name _c. When no MS-DOS partition is included in the specified drive unit, this command is ignored. You can confirm what drive name is valid by pprriinnttddrrvv command. But any hard disk is registered as readonly, for security. sseettffrreeqq [_f_i_l_e] Append the frequency information inputted from the standard input to the translation fre- quency file, specified by _f_i_l_e, for the users Kana-Kanji translation learning. The input format is based on the output format of ggeettffrreeqq. If you want to replace, rather than to append, you must remove the translation fre- quency file in advance. If _f_i_l_e is omitted, it is regarded as the translation frequency file specified by FFRREEQQFFIILLEE the internal vari- able. ((UUNNIIXX)) sseettrroommaann [--cc] [--rr] [--ff _f_i_l_e] [_r_o_m_a_n [_k_a_n_j_i]] Setup the Roman-Kana translation table for the Kana-Kanji IME mode. It means binding _k_a_n_j_i the Japanese string to _r_o_m_a_n the Roman string. The part over 44 characters of _r_o_m_a_n, the string which consists of 1 byte characters only, will be ignored. The part over 22 charac- ters of _k_a_n_j_i, the string which consists of multibyte characters or 1 byte characters, will be ignored. In this case, a multibyte character is counted as 1 character as well as a 1 byte character. ((UUNNIIXX)) If _k_a_n_j_i is omitted, the registered binding of the Roman-Kana translation table for _r_o_m_a_n the Roman string will be deleted. When you speci- fy --cc, the whole Roman-Kana translation table will be cleared to be empty. When you specify --rr, all the registered bindings will be reset to restore the Roman-Kana translation table. When you specify --ff, the file specified by _f_i_l_e will be read as bindings of the Roman- Kana translation table. In this case, a pair of _r_o_m_a_n and _k_a_n_j_i, which is separated by spaces, must be described in each line of _f_i_l_e. You can also use the file which contains the output of pprriinnttrroommaann. sshhiifftt [_n] Rename the positional parameters from $$_n+_1 into ones from $$11 in order. The original positional parameters from $$11 to $$_n are dis- carded. If _n is omitted, it is regard as 11 is specified. ssoocckkeettiinnffoo [--aappAAPP] [_f_d] If the file descriptor specified by _f_d is a socket, the IP address and the TCP port number of the connected remote host, and the IP ad- dress and the TCP port number of the connected local host, are outputted to the standard out- put. If _f_d is not a socket, this command will be failed. ((UUNNIIXX)) If _f_d is omitted, it is regarded as the stan- dard input is specified. If --aa is specified, only the IP address of the remote host will be outputted. If --pp is specified, only the TCP port number of the remote host will be output- ted. If --AA is specified, only the IP address of the local host will be outputted. If --PP is specified, only the TCP port number of the local host will be outputted. tteesstt [_e_x_p_r] [[ _e_x_p_r ]] Evaluate the conditional expression _e_x_p_r. See tteesstt(1) for details. ttiimmeess Display the accumulated user and system time for the processes which has so far been exe- cuted. ttrraapp [_c_o_m] [_n ...] Read and execute the command _c_o_m when ffdd receives the signal _n. If _c_o_m is omitted, the trap for the signal is reset. When you specify _c_o_m as a null, the signal ignored. When you specify _n as 00, the command _c_o_m is executed on exit. If both _c_o_m and _n are omit- ted, all of the registered traps is listed. ttrruuee Only return with a 00 exit status. ttyyppee [_c_o_m ...] Display how each _c_o_m would be treated when it is used as a command name. uulliimmiitt [--SSHH] [--aa | --ccddffllmmnnssttvv] _n Set the resource limits for ffdd and its child processes to the value indicated by _n. You can use the string uunnlliimmiitteedd or the numeric value in _n, uunnlliimmiitteedd means the maximum specifiable value. ((UUNNIIXX)) When you specify --HH, a hard limit is set. When you specify --SS, a soft limit is set. When you don't specify neither of them, both limits are set. If _n is omitted, the current limit is displayed. When you specify --aa, all of the resource limits is displayed. When you specify the following options, the each resource limit is individually set or displayed. If no option is specified, it is regarded as --ff is specified. --cc maximum core file size (in blocks) --dd maximum size of data segment (in KB) --ff maximum file size (in blocks) --ll maximum size of locked in memory (in KB) --mm maximum size of resident set (in KB) --nn maximum number of open file files --ss maximum size of stack segment (in KB) --tt maximum CPU time (in seconds) --vv maximum size of virtual memory (in KB) uummaasskk [_n_n_n] Set the file creation mask to _n_n_n. If _n_n_n is omitted, the current value of the file crea- tion mask is displayed. See uummaasskk(2) for details. uunnaalliiaass _n_a_m_e Cancel the definition of the alias _n_a_m_e. You can use the wildcard in _n_a_m_e, in this case, all of the matched alias definitions is cancel- ed. When you specify "*", all of the alias definitions is invalid. uunnsseett [_N_A_M_E ...] Delete the defined internal variable or func- tion for each _N_A_M_E. But the following variable definition cannot be deleted. PPAATTHH PPSS11 PPSS22 IIFFSS MMAAIILLCCHHEECCKK PPPPIIDD uunnsseettddrrvv _c _d_e_v_i_c_e _h_d _s_c _c_l Delete the registered floppy drive. Only the registration with which all of _d_e_v_i_c_e, _h_d, _s_c, _c_l is corresponded is deleted, then you should confirm to delete very well. ((UUNNIIXX)) When it is registered as HHDDDD or HHDDDD9988 in sseettddrrvv, you should describe HHDDDD or HHDDDD9988 instead of _h_d, _s_c, _c_l. wwaaiitt [_p_i_d | _j_o_b] Wait for the process indicated by _p_i_d or for the job indicated by _j_o_b, and return its exit status. If both _p_i_d and _j_o_b are omitted, all running jobs are waited. ((UUNNIIXX)) yyeessnnoo [_p_r_o_m_p_t] Wait for a input of yy or nn from the terminal, and then return 00 when yy is inputted, return 225555 when nn is inputted. Instead of input of yy or nn, you can select a character from displayed [[YY//NN]] with cursor keys and push [RReettuurrnn] to be regarded as an input of the selected character. An input of [SSppaaccee] or [EEsscc] means the input of nn. When _p_r_o_m_p_t is specified, the string is displayed before [[YY//NN]]. _C_O_M_M_A_N_D [_a_r_g] Execute the internal command _C_O_M_M_A_N_D of ffdd. You can describe each command identifier in _C_O_M_M_A_N_D. The following internal commands can take a parameter argument _a_r_g. CCUURR_UUPP CCUURR_DDOOWWNN CCUURR_RRIIGGHHTT CCUURR_LLEEFFTT RROOLLLL_UUPP RROOLLLL_DDOOWWNN WWIIDDEENN_WWIINNDDOOWW NNAARRRROOWW_WWIINNDDOOWW The number of lines, columns, or pages. RREENNAAMMEE_FFIILLEE PPAACCKK_FFIILLEE BBAACCKKUUPP_TTAAPPEE The filename. LLOOGG_DDIIRR MMAAKKEE_DDIIRR IINNFFOO_FFIILLEESSYYSS UUNNPPAACCKK_FFIILLEE The directory name. EEXXEECCUUTTEE_SSHH The command string. MMAARRKK_FFIINNDD FFIINNDD_FFIILLEE FFIINNDD_DDIIRR The wildcard string. MMAARRKK_AALLLL 00 will reset the mark of all files, the other will mark all files. SSOORRTT_DDIIRR The number substituted for SSOORRTTTTYYPPEE the internal variable. EEDDIITT_CCOONNFFIIGG The name of internal variable to be edited. ~~ and $$ in the previous registration string are expanded. But these expansions are restrained in the string quoted with '' instead of "". TTrreeee SSccrreeeenn Since representing the whole file system in tree structure takes too many time, only the directories which are direct ancestors and the direct sub directories are displayed, first in the tree screen. In the directories which are direct ancestors, the other sub directories (if exists) are grouped as "......". These grouped sub directories will be expanded automatically when a cursor is placed on its posi- tion. The sub directories which are not expanded yet are represented with '>>' trailing the filename, which shows as they are. Such directory is never expanded until it is required to expand explicitly, then you should expand it by the following key inputs before moving to any hidden sub directory. In the tree screen, the following key inputs are available. UUpp, DDoowwnn Move a cursor. RRiigghhtt Expand the sub directory on the cursor posi- tion. TTaabb Expand the sub directory on the cursor posi- tion recursively. PPaaggeeUUpp, PPaaggeeDDoowwnn Move a cursor by half screen. HHoommee(<), EEnndd(>) Move a cursor to the top/bottom of tree. ?? Move a cursor to the current directory. BBss Move a cursor to the parent directory. LLeefftt Group sub directories of the directory on the cursor position, or move a cursor to the parent directory. ((, )) Move a cursor to the previous/next directory among the same level sub directories. AA - ZZ Move a cursor to the directory whose name starts with the character or its lowercase. ll Change the directory tree into the specified directory. Moving to the floppy drive is also available. ^^LL Redraw the tree structure. RReettuurrnn Select the directory. EEsscc Cancel. When directories are recursively expanded, the machine operation is so late that it maybe seems to freeze. In this case, you can input any key while operating. If key input is recognized while expanding directories, expanding has been stopped at that moment in spite of not finishing. Even if key repeat keeps effective, any operation will be delayed for this function. AArrcchhiivvee BBrroowwsseerr When the launcher is invoked on the position of the file whose extension is registered to associate with an archive browser, the archive browser screen has come. In this screen, you can browse files in the archive file as well as in the normal directory. But you cannot use the following internal commands in this screen. LLOOGG_TTOOPP AATTTTRR_FFIILLEE CCOOPPYY_FFIILLEE MMOOVVEE_FFIILLEE DDEELLEETTEE_FFIILLEE DDEELLEETTEE_DDIIRR RREENNAAMMEE_FFIILLEE MMAAKKEE_DDIIRR WWRRIITTEE_DDIIRR TTRREEEE_DDIIRR EEDDIITT_FFIILLEE LLOOGG_TTRREEEE CCOOPPYY_TTRREEEE MMOOVVEE_TTRREEEE FFIINNDD_DDIIRR AATTTTRR_DDIIRR SSYYMMLLIINNKK_MMOODDEE DDOOTTFFIILLEE_MMOODDEE FFIILLEEFFLLGG_MMOODDEE SSPPLLIITT_WWIINNDDOOWW KKIILLLL_WWIINNDDOOWW When you want to register a new archive browser, you must describe the format listed by the archiver as the following representation. One format string represents the format for 1 file in the list. %%aa Field which indicates a file mode %%uu Field which indicates UID of a file %%gg Field which indicates GID of a file %%ss Field which indicates a file size %%yy Field which indicates a file creation year %%mm Field which indicates a file creation month (No concerning if numeric or alphabetical) %%dd Field which indicates a file creation day %%ww Field which indicates a file creation week (ignored) %%tt Field which indicates a file creation time ("HH:MM:SS" form, MM and SS can be lacking) %%pp Field which indicates a file creation am/pm %%BB Field which indicates a major device ID %%bb Field which indicates a minor device ID %%//_s_t_r// Field which indicates a type is directory when this field string is _s_t_r (case insensitive) %%!!_s_t_r!! 0 or more continuous fields which consists of the string _s_t_r (case insensitive) %%ff Field which indicates a filename %%xx Field which is needless (ignored) %%%% % itself \\nn Newline SSppaaccee TTaabb 0 or more characters of spaces or tabs In this description, the field means the area separated by spaces, tabs or newlines. When the string which indicates each information is separated by these characters, you can simply describe the above string which indicates that field. When the string is separated by another character, you should describe the above string with that separator. You can describe to indicate the field length as numeric, such as %_1_0_a. This example means that the field which indicates a file mode consists of 10 characters. If you describe it with a character ** as the field length instead of numeric, such as %*_f, the string to the end of line is regarded as a field, in which any space and tab will be ignored. When a field may have the different meanings according to situation, you should describe it quoted with {{ }}, such as %{_y_t}. This example means that this field indicates a crea- tion year or a creation time. When the information for 1 file consists of multiple lines, you should place a \\nn on the position of newline in the format string. For example, the following are the format strings for the list of some archivers. While some spaces are used here for easiness to see, these spaces are not always necessary because any space between fields is ignored. `llhhaa ll' "%9a %u/%g %s %x %m %d %{yt} %f" `llhhaa vv' (MS-DOS) "%f\n%s %x %x %y-%m-%d %t" `ttaarr ttvvff' (BSD) "%9a %u/%g %s %m %d %t %y %f" `ttaarr ttvvff' (SVR4) "%a %u/%g %s %m %d %t %y %f" If you register archive browsers with above format, in the builtin command of EEXXEECCUUTTEE_SSHH or in the initial configura- tion file, you can use the archive browser which is not prepared by default. But, if you want to execute or view files in the archive file, you must register the archiver command for the archive file, too, don't forget this. On some OS, ttaarr(1) may output the Japanese timestamp when _j_a_p_a_n_e_s_e is substituted for LLAANNGG the environment variable. Since ffdd cannot analyze the representation like this, you should describe `_e_x_p_o_r_t _L_A_N_G=_C' in the initial configuration file, or specify LLAANNGG in the description of listing command, such as `_L_A_N_G=_C _t_a_r _t_v_f'. FFllooppppyy DDrriivvee ((UUNNIIXX)) You can access the MS-DOS formatted floppy disk, by representing to prefix "_c::" to the directory name. But, it is necessary to register the floppy drive and set DDOOSSDDRRIIVVEE the internal variable which makes this function effective, in advance. Each registered drive is distinguished with the drive name. You should tag the physically different drive as the dif- ferent drive name. When the same physical drive supports multiple formats, you can register each format with the same drive name, or the different drive name each other. If you tag the same drive name, the justice of the format is tried in registered order, so that you should register the format which you often use in the first place. Each drive of the floppy drive has the its own current directory. The default value of this is a root directory, and the current directory is moved back to a root directory again whenever you change a floppy disk. When you describe the directory name as starting with '/' after '::', it means the absolute path representation of that drive. If this '/' is not exist, it means the relative path representation from the current directory of that drive, don't forget this. Regrettably, some internal commands like as WWRRIITTEE_DDIIRR, IINNFFOO_FFIILLEESSYYSS cannot support the floppy drive. Some filenames are renamed when they are copied from UNIX for reason of the filename length limit. When you use a lowercase letter as the drive name, you can access it as the floppy drive which can treat the Long File Name (LFN) for MS-Windows formatted floppy disk. In this case, you can copy a file with a long filename on UNIX as it is. But, when the UNICODE translation table ffdd--uunniiccdd..ttbbll does not exist in the same directory as the invoked ffdd ex- ists, any Kanji filename cannot be treated as LFN representa- tion. Reversely, when you use a uppercase letter as the drive name, LFN is ignored and 8+3 formed filename is treat- ed. MS-DOS version inherits this specification by the case of a drive name. UURRLL DDrriivvee ((UUNNIIXX)) You can access remote services on the network, by represent- ing the URL string as the directory name. The URL format is _s_c_h_e_m_e::////[_u_s_e_r[::_p_a_s_s_w_o_r_d]@@]_h_o_s_t[::_p_o_r_t]//_d_i_r_e_c_t_o_r_y//. You can specify ffttpp or hhttttpp as _s_c_h_e_m_e. You can specify the name or IP address of the remote host as _h_o_s_t. You can specify the TCP port number as _p_o_r_t. If _p_o_r_t is omitted, the default port number is used. The default port number for ffttpp is 2211, and the default port number for hhttttpp is 8800. You can specify account information to connect the remote host as _u_s_e_r and _p_a_s_s_w_o_r_d. If _u_s_e_r is omitted, the anonymous FTP connection will be used with ffttpp, or you will be queried as needed with hhttttpp. If _p_a_s_s_w_o_r_d is omitted, you will be queried as needed. But, it is necessary to set UURRLLDDRRIIVVEE the internal variable which makes this function effective, in advance. Regrettably, some internal commands cannot support the URL drive, for the sake of restrictions of the FTP and HTTP pro- tocols or settings of the host side. SSttrriinngg IInnppuutt When you input the string, such as the pathname, the follow- ing key inputs are available. The kind of referred history differs with the input string required. In the split window mode, the current directory of another window is always placed on the top of the pathname history. LLeefftt, RRiigghhtt Move a cursor. UUpp, DDoowwnn Refer the previous histories (only commands and pathnames), or move a cursor. BBeegg Move a cursor to the beginning of string. EEooll Move a cursor to the end of string. IInnss Switch a input method to the insert/overwrite mode. (Default value is the insert mode.) DDeell Delete a character on the cursor position. BBss Delete a character before the cursor position. DDeellLLiinnee Delete a string after the cursor position. IInnssLLiinnee Treat the next input character as it is, effective to input control characters. EEnntteerr Insert a filename of the file on the cursor posi- tion. PPaaggeeUUpp Convert a character on the cursor position to uppercase. PPaaggeeDDoowwnn Convert a character on the cursor position to lowercase. TTaabb Complete a pathname, a command name or a variable name on the cursor position. When there are two or more completion choices, inputting this continuously can display the com- pletion choice list. Except for command line in the internal shell, you can make a choice from this list with cursor keys and [RReettuurrnn]. ^^LL Redraw the input string. ^^SS, ^^RR Search the previous histories (only commands and pathnames) incrementally. RReettuurrnn Decide the input, or decide the choice in the com- pletion choice list. EEsscc Cancel. The inputted string is expanded before evaluation as follow- ing. These expansions are also valid in the string of com- mand macros. But these expansions are restrained in the string quoted with the quotation mark ''. ~~ Indicate your home directory, when it is the begin- ning of filename. ~~_u_s_e_r Indicate _u_s_e_r's home directory, when it is the beginning of filename. ((UUNNIIXX)) ~~FFDD Indicate the directory where the invoked ffdd is exists, when it is the beginning of filename. $$_N_A_M_E $${{_N_A_M_E}} Indicate the value of _N_A_M_E the internal variable or the environment variable. When both are defined, the internal variable is prior. When both are unde- fined, it is replaced a null. The brace {{ }} separates _N_A_M_E from its trailing characters. When _N_A_M_E is the following character, it is replaced by the value substituted automatically by the shell. 00 The executable filename when invoked. [11-99] The positional parameter. ** The all positional parameters which starts from $$11. ""$$**"" is replaced by ""$$11 $$22 ..."". @@ The all positional parameters which starts from $$11. ""$$@@"" is replaced by ""$$11"" ""$$22"" ... . ## The number of positional parameters. -- The option flags which is set by options when invoked or sseett the builtin command. ?? The exit status of the last executed command. $$ The process number of the current shell. !! The process number of the last executed back- ground process. $${{_N_A_M_E::--_w_o_r_d}} If the value except a null is substituted for _N_A_M_E the internal variable or the environment variable, it is replaced by the value, otherwise it is replaced by _w_o_r_d. $${{_N_A_M_E::==_w_o_r_d}} If the value except a null is substituted for _N_A_M_E the internal variable or the environment variable, it is replaced by the value, otherwise _w_o_r_d is sub- stituted for _N_A_M_E the internal variable, and this expression itself is replaced by _w_o_r_d. But you can- not substitute the value for any positional parame- ter. $${{_N_A_M_E::??_w_o_r_d}} If the value except a null is substituted for _N_A_M_E the internal variable or the environment variable, it is replaced by the value, otherwise display _w_o_r_d and exit from the shell. If _w_o_r_d is omitted, the string ``ppaarraammeetteerr nnuullll oorr nnoott sseett'' is displayed in its place. $${{_N_A_M_E::++_w_o_r_d}} If the value except a null is substituted for _N_A_M_E the internal variable or the environment variable, it is replaced by _w_o_r_d, otherwise it is replaced by a null. $${{_N_A_M_E--_w_o_r_d}} If any value is substituted for _N_A_M_E the internal variable or the environment variable, it is replaced by the value, otherwise it is replaced by _w_o_r_d. $${{_N_A_M_E==_w_o_r_d}} If any value is substituted for _N_A_M_E the internal variable or the environment variable, it is replaced by the value, otherwise _w_o_r_d is substituted for _N_A_M_E the internal variable, and this expression itself is replaces by _w_o_r_d. But you cannot substitute the value for any positional parameter. $${{_N_A_M_E??_w_o_r_d}} If any value is substituted for _N_A_M_E the internal variable or the environment variable, it is replaced by the value, otherwise display _w_o_r_d and exit from the shell. If _w_o_r_d is omitted, the string ``ppaarraammee-- tteerr nnuullll oorr nnoott sseett'' is displayed in its place. $${{_N_A_M_E++_w_o_r_d}} If any value is substituted for _N_A_M_E the internal variable or the environment variable, it is replaced by _w_o_r_d, otherwise it is replaced by a null. $${{##_N_A_M_E}} It is replaced by the length in characters of the value of _N_A_M_E the internal variable or the environ- ment variable. If _N_A_M_E is ** or @@, it is replaced by the number of positional parameters instead of the length of characters. $${{_N_A_M_E%%_w_o_r_d}} It is replaced by the string in which the smallest portion of the suffix matched by the _w_o_r_d pattern is deleted from the value of _N_A_M_E the internal variable or the environment variable. If _N_A_M_E is ** or @@, each positional parameter is replaced. ( \\ is used instead of %% on MS-DOS version.) $${{_N_A_M_E%%%%_w_o_r_d}} It is replaced by the string in which the largest portion of the suffix matched by the _w_o_r_d pattern is deleted from the value of _N_A_M_E the internal variable or the environment variable. If _N_A_M_E is ** or @@, each positional parameter is replaced. ( \\\\ is used instead of %%%% on MS-DOS version.) $${{_N_A_M_E##_w_o_r_d}} It is replaced by the string in which the smallest portion of the prefix matched by the _w_o_r_d pattern is deleted from the value of _N_A_M_E the internal variable or the environment variable. If _N_A_M_E is ** or @@, each positional parameter is replaced. $${{_N_A_M_E####_w_o_r_d}} It is replaced by the string in which the largest portion of the prefix matched by the _w_o_r_d pattern is deleted from the value of _N_A_M_E the internal variable or the environment variable. If _N_A_M_E is ** or @@, each positional parameter is replaced. \\_c It indicates a character _c itself. You can use it when you want to use the preceding meta-character as a character with no evaluation, such as ~~ or $$. You can describe \\ itself as "\\\\". But, on MS-DOS ver- sion, because \\ which is used as the pathname delim- iter must be treat as well as the normal character, %%_c is expediently used in place of \\. The following is replaced only in the shell which is exe- cuted by EEXXEECCUUTTEE_SSHH and EEXXEECCUUTTEE_FFIILLEE. ``_l_i_s_t`` _L_i_s_t is executed and this string is replaced by its standard output. $$((_l_i_s_t)) _L_i_s_t is executed and this string is replaced by its standard output like as ``_l_i_s_t``. This differs from ``_l_i_s_t`` in the point that nested expressions are allowed. And any meta-characters such as quotes in _l_i_s_t are evaluated as it is. $$((((_e_x_p_r_e_s_s_i_o_n)))) _E_x_p_r_e_s_s_i_o_n the arithmetic expression is evaluated and this string is replaced by its result value. You can specify numeric values, variables and integral calculations with the following operators in _e_x_p_r_e_s_s_i_o_n. (unary) (binary) arithmetic ++ -- ++ -- ** // %% boolean !! ==== !!== << >> <<== >>== &&&& |||| bit operator ~~ && || ^^ <<<< >>>> parenthesis (( )) ?? ** [[ ]] The string including these letters is pattern- matched with existent files. When it is matched, it is replaced by all of the matched filenames which are sorted in alphabetical order. ?? Match any single character except //. ** Match any 0 or more length string not including //. **** Match any 0 or more length string including //. [[...]] Match any one of the characters enclosed by [[ ]]. When enclosed characters include --, it matches any character whose character code is between characters before/after --. [[!!...]] Match any one of the characters not enclosed by [[ ]]. But, when the first character of the filename is .., ??, ** and **** don't match it. EEddiitt MMooddee When you want to use some functions bound to special keys, such as a cursor key or a scroll key, such a key doesn't exist in some terminals. In such a case, substituting the string for EEDDIITTMMOODDEE the internal variable can make you use some control keys as alternative to these special keys. Since this alternative key function is prior to the key binding by the builtin command, the key binding is invalid for the control characters used as the alternative keys. The prepared edit modes are the following 3 modes. eemmaaccss ^^PP = UUpp ^^AA = BBeegg ^^NN = DDoowwnn ^^EE = EEooll ^^DD = DDeell ^^FF = RRiigghhtt ^^QQ = IInnssLLiinnee ^^BB = LLeefftt ^^KK = DDeellLLiinnee ^^VV = PPaaggeeDDnn ^^YY = PPaaggeeUUpp ^^OO = EEnntteerr ^^MM = RReettuurrnn ^^II = TTaabb ^^HH = BBss ^^[[ = EEsscc ^^GG = EEsscc wwoorrddssttaarr ^^EE = UUpp ^^AA = BBeegg ^^VV = IInnss ^^NN = DDoowwnn ^^FF = EEooll ^^GG = DDeell ^^FF = RRiigghhtt ^^WW = HHoommee ^^]] = IInnssLLiinnee ^^SS = LLeefftt ^^ZZ = EEnndd ^^YY = DDeellLLiinnee ^^CC = PPaaggeeDDnn ^^RR = PPaaggeeUUpp ^^NN = EEnntteerr ^^MM = RReettuurrnn ^^II = TTaabb ^^HH = BBss ^^[[ = EEsscc vvii VVii mode has the 2 local modes: "insert mode" and "command mode", and the function of keys are quite different with each mode. You are in the command mode when you start to input, then you must input any key among 4 keys which switch to the insert mode, in order to input normal keys. (command mode) kk = UUpp 00 = BBeegg jj = DDoowwnn $$ = EEooll xx = DDeell ll = RRiigghhtt gg = HHoommee hh = LLeefftt GG = EEnndd DD = DDeellLLiinnee ^^FF = PPaaggeeDDnn ^^BB = PPaaggeeUUpp oo = EEnntteerr ^^MM = RReettuurrnn ^^II = TTaabb ^^HH = BBss ^^[[ = EEsscc (from command mode to insert mode) ii, :: = only switch its mode II = + BBeegg aa = + RRiigghhtt AA = + EEooll RR = overwrite rr = overwrite once (insert mode) ^^VV = IInnssLLiinnee EEsscc = to command mode This key binding is so particular that it is not suitable for those who don't use vvii editor everyday. KKaannaa--KKaannjjii IIMMEE ((UUNNIIXX)) You can input strings in the Kana-Kanji IME mode, if you in- put the key specified by IIMMEEKKEEYY or select "Kanji" from the pseudo terminal menu. The translation performance will depend on the Kana-Kanji translation dictionary ffdd-iddiicctt..ttbbll. When it does not exist in the same directory as the invoked ffdd exists, translation to Kanji will not be available. The standard installed dic- tionary file is the Tan-Kanji dictionary, which can support only the Tan-Kanji translation. The dictionaly such as the pubdic, which includes the Hinsi information, will bring you the Tan-Bunsetsu translation. The Ren-Bunsetsu translation is not be supported. In the Kana-Kanji IME mode, the following key inputs are available. SSppaaccee Trancelate to Kanji, or select the next trans- lation candidate. LLeefftt, RRiigghhtt UUpp, DDoowwnn Move a cursor in the list of the translation candidate. BBss, DDeell Delete a character before the cursor position. TTaabb Toggle Hiragana, Katakana, Hankaku-Kana and the direct input. ^^LL Redraw the input string. RReettuurrnn Decide the translation result. EEsscc Cancel. When you translate the string of the capital 4 digit hexa- decimal prefixed by a capital letter, it is regarded as the hexadecimal showing the following Kanji code respectively. Then the menu will be displayed to select Kanji next to the Kanji code number. SS Shift JIS EE EUC-JP JJ JIS code (JIS X0208) KK Kuten code UU UNICODE (UCS2) When you input [SSppaaccee] in the state where you decide an un- translated Kana, it is regarded as the initial reading of Kanji. Then the menu will be desplayed to select Kanji whose reading starts with the Kana. PPaarraammeetteerr MMaaccrrooss You can use the following parameter macros in the string which is used for the registration of command macros and for executing command. But, you cannot use them in the func- tions, the input file for ssoouurrccee command, and the initial configuration file, then you should use eevvaallmmaaccrroo command when you want to use any parameter macro in them. %%CC The filename on the cursor position. Or, it indi- cates the archive filename, in the macro to register the archiver command. %%XX The filename except its extension on the cursor position. Or, it indicates the archive filename except its extension, in the macro to register the archiver command. Only the last one extension is removed. TT, TTAA, MM trailing %%XX are replaced by %%TT, %%TTAA, %%MM except its extension respectively. On MS- DOS version, you can describe a trailing SS as well as them. %%PP The pathname of the current directory. %%KK Prompt and return to ffdd after a command is finished. But, the meaning of %%KK is reverse in EEXXEECCUUTTEE_FFIILLEE and EEXXEECCUUTTEE_SSHH; it prompts by default and doesn't prompt if %%KK is specified. You can never specify to prompt in macros to register the archive browser of the launcher and macros to register the archiver command. %%TT List marked files separated by spaces as possible. When files are so many that the command line length exceeds the OS limitation, the rest of marked files are ignored. %%TTAA List marked files as well as %%TT, and repeat the same command for spilt files to complete all marked files. %%MM Execute the same command as many times as marked files, sending the marked file one by one. It is useful to mark files by MMAARRKK_FFIINNDD and execute "mv %M %XM.bak" by EEXXEECCUUTTEE_SSHH. %%NN Restrain the filename addition even if the parameter is omitted. %%RR Make you input the additional parameter in executing a macro, if the length of command string has enough margin. The cursor position in input is placed on the position of %%RR in a macro. But, %%RR is ignored in macros to register the archive browser of the launcher, macros to register the archiver command, and EEXXEECCUUTTEE_FFIILLEE, EEXXEECCUUTTEE_SSHH. %%SS The 8+3 formed filename with which the LFN formed filename on the cursor position is replaced. You can use it when you use external commands which can treat only 8+3 formed arguments. TT, TTAA, MM trailing %%SS can be described as well as %%XX. ((DDOOSS)) %%JJSS The Kanji code of the string enclosed by this macro is converted into Shift JIS. ((UUNNIIXX)) %%JJEE The Kanji code of the string enclosed by this macro is converted into EUC-JP. ((UUNNIIXX)) %%JJ77 The Kanji code of the string enclosed by this macro is converted into 7bit JIS. ((UUNNIIXX)) %%JJ88 The Kanji code of the string enclosed by this macro is converted into 8bit JIS. ((UUNNIIXX)) %%JJJJ The Kanji code of the string enclosed by this macro is converted into ISO-2022-JP. ((UUNNIIXX)) %%JJHH The Kanji code of the string enclosed by this macro is converted into HEX. ((UUNNIIXX)) %%JJCC The Kanji code of the string enclosed by this macro is converted into CAP. ((UUNNIIXX)) %%JJUU The Kanji code of the string enclosed by this macro is converted into UTF-8. ((UUNNIIXX)) %%JJMM The Kanji code of the string enclosed by this macro is converted into UTF-8 for Mac OS X. ((UUNNIIXX)) %%JJII The Kanji code of the string enclosed by this macro is converted into UTF-8 for iconv, which is used on environments using iconv-based UTF-8 such as Linux. ((UUNNIIXX)) %%JJAA The Kanji code of the string enclosed by this macro is converted into the Kanji code which is used in the pathname indicated by the string. The variables SSJJIISSPPAATTHH, EEUUCCPPAATTHH, etc. can specify what kanji code is used in each pathname. ((UUNNIIXX)) When no filename parameter, such as %%CC and %%TT, is taken with the result to expand parameter macros in a command macro, the filename on the cursor position is automatically added to the last of expanded string, as ./_f_i_l_e_n_a_m_e form. This addition is not done, in case of the input string for exe- cuting command, or when %%NN macro is specified. CCuussttoommiizzee You can customize ffdd as the following ways. If you specify some configuration in multiple ways overlapped, it is prior in this order. EExxeeccuuttiinngg bbuuiillttiinn ccoommmmaannddss wwiitthh EEXXEECCUUTTEE_SSHH You can execute builtin commands for each registration for the internal variable defini- tion, the environment variable definition, the alias definition, the function definition, the key binding, the keymap changing, the launcher registration, the archiver command registra- tion, and the floppy drive registration. CCuussttoommiizzeerr EEDDIITT_CCOONNFFIIGG command is available for the inter- nal variable definition, the key binding, the keymap changing, the launcher registration, the archiver command registration, and the floppy drive registration. CCoommmmaanndd lliinnee ooppttiioonnss You can specify the command line options as `--_N_A_M_E==_v_a_l_u_e' form, to define the internal variables. ..ffdd22rrcc You can prepare the initial configuration file ..ffdd22rrcc on your home directory, to execute the command which is written in this file, before the startup of ffdd. You can describe builtin commands and external commands in it to set up each configuration. Yet, when ffddsshh is invoked as a login shell, ..ffddsshhrrcc is read instead of ..ffdd22rrcc. The initial configuration file //eettcc//ffdd22rrcc which is prepared by a system administrator is read preceding ..ffdd22rrcc and ..ffddsshhrrcc. If this file exists, the initial configurations prepared by a system administrator are valid unless you intentionally delete them in ..ffdd22rrcc and ..ffddsshhrrcc. (On MS-DOS version, these filenames are $$HHOOMMEE\\ffdd22..rrcc, $$HHOOMMEE\\ffddsshh..rrcc and ~~FFDD\\ffdd22rrcc.) EEnnvviirroonnmmeenntt vvaarriiaabblleess Any valid variable name as the internal vari- able can be valid to be defined as the environ- ment variable in advance. But the internal variable is always prior to the environment variable in ffdd. When the same named environ- ment variable is used in another application, you can also use the name which FFDD_ is prefixed to each environment variable for ffdd only. This environment variable with FFDD_ is always prior to the environment variable without it, then the definition of the environment variable with FFDD_ is prior to the definition of the internal variable without FFDD_. CCuussttoommiizzeerr EEDDIITT_CCOONNFFIIGG command invokes the customizer to set up confi- gurations interactively. You can select the category with the right/left cursor key, and select the item with the up/down cursor key, and change its content with [RReettuurrnn]. When you finish to change, exit from the customizer with [EEsscc]. The following categories are prepared. VVaarriiaabblleess Change the value of internal variables. The input method is different with the variable, then you should input following the guidance on screen. KKeeyy bbiinndd Change the command bound to each key. When you newly bind a command to the key with no bind- ing, you should select "NewEntry". If you select "Delete bind", the existent key binding is deleted. KKeeyy mmaapp Change the key code mapping for each special key. If you push [EEsscc] when you are prompted to push the key, the existent key mapping is deleted. ((UUNNIIXX)) LLaauunncchheerr Change the launcher registration for each extension. When you newly register a launcher for the extension with no registration, you should select "NewEntry". If you input a null line when you input a command for the launcher, the existent launcher registration is deleted. AArrcchhiivveerr Change the archiver command registration for each extension. When you newly register a archiver command for the extension with no registration, you should select "NewEntry". If you input a null line both when you input a command for pack/unpack, the existent archiver command registration is deleted. DDOOSS ddrriivvee Change the floppy drive registration. When you newly register a floppy drive for the drive name with no registration, you should select "NewEntry". If you input a null line when you input a device name, the existent floppy drive registration is deleted. ((UUNNIIXX)) SSaavvee Save the configurations changed with the cus- tomizer into a file, or cancel configurations to restore to the previous state. Cancel Cancel the changed configurations within the specified categories, and restore to the state before the cus- tomizer is invoked. Clear Cancel all the configurations within the specified categories, and restore to the default state. Load Load configurations from the speci- fied file. Save Save all the configurations within the specified categories to the specified file. Overwrite Overwrite all the configurations within the specified categories to the specified existent file. The original configurations which has existed in the file are parsed, and the configuration for the same target is overwritten at the same place as possible. The configurations which are not set up at present and the configurations which are not sup- ported by the customizer are remains as it is. When you specify the range of categories, all categories are selected by default, then you should turn on/off each selection with [SSppaaccee] and decide with [RReettuurrnn]. If you try to exit from the customizer without saving after changing any configuration, you will be confirmed whether if it is right to exit without saving. While the changed con- figurations themselves are valid even if you exit without saving, when you want them to be valid in the next invoked ffdd, you must save them into the initial configuration file. EENNVVIIRROONNMMEENNTT VVAARRIIAABBLLEESS The following environment variables are valid in ffdd. These environment variables can be valid if they are defined as the internal variables. You can specify them as the command line options in `--_N_A_M_E==_v_a_l_u_e' form. But the variables followed by * cannot be use with the prefix FFDD_ as the environment variables. AADDJJTTTTYY Reset the terminal mode forcedly to the normal state, when ffdd is finished. Invoking ffdd can adjust the terminal rightly from the state displaying broken characters. Any value except 00 and null effects valid. ((UUNNIIXX)) AANNSSIICCOOLLOORR Colorize the file display. When the terminal which you use supports the color control escape sequence of ANSI standard, each file is displayed with color according to its file type. If the value is 11, it is colorized. If the value is 22, the background color is forced to be black, for the case that the foreground color is the same as the background color and indistinguishable. If the value is 33, the foreground color is forced to be black. AANNSSIIPPAALLEETTTTEE Specify color palette according to file type when the file display is colorized. This variable value consists of a numeric value whose maximum columns are 1111 columns. The number of each column shows a color number, which specifies the color of file type corresponding with its column. The following are correspondence of the column number to the file type. 11 normal file 22 background 33 directory 44 unwritable file 55 unreadable file 66 symbolic link 77 socket (or system file on MS-DOS) 88 FIFO (or label on MS-DOS) 99 block device 1100 character device 1111 executable file The following are the meaning of color number specified on each column. 00 black 11 red 22 green 33 yellow 44 blue 55 magenta 66 cyan 77 white 88 default color for foreground 99 default color for background The color number 88 is forced to be black, if the value of AANNSSIICCOOLLOORR the variable is 33. The color number 99 is forced to be black, if the value of AANNSSIICCOOLLOORR the variable is 22. When the columns are less than 1111 or this variable is not set, the standard color palette will be applied for the file type corresponding with the following columns. The standard color palette is described with the above color number as 8899662244335511888888. AAUUTTOOUUPPDDAATTEE Specify the interval in seconds to update auto- matically the browser screen or the tree screen. When the key input idles for the spec- ified seconds, the current information of file list will be updated. If this value is 00, the screen will never updated automatically. The default value is 00. BBAASSIICCCCUUSSTTOOMM Limit the internal variables for configuration only to basic variables in the customizer, to hide advanced variables. Any value except 00 and null effects valid. CCDDPPAATTHH* Specify the search path when an argument of ccdd the builtin command does not start with //. You can specify multiple paths separating with '::'. No search path is specified by default. CCOOLLUUMMNNSS* The variable for the columns of a terminal screen. If some value is set, this value will be replaced automatically according to chang- ing the screen size. If no value is set, this value will remain unset. CCOOMMSSPPEECC Specify the shell used to invoke a batch file. If undefined, the shell defined by SSHHEELLLL the internal variable or \COMMAND.COM is used. ((DDOOSS)) CCOOPPYYCCMMDD* Specify the default options used by ccooppyy the builtin command. DDEEFFCCOOLLUUMMNNSS Specify the columns displayed in the screen when ffdd is invoked. The default value is 22. If you specify the value except 11, 22, 33 and 55, it is ignored. DDEEFFKKCCOODDEE Specify the system default Kanji code. The arguments passed to external commands invoked from ffdd will be converted into the specified Kanji code. When you use macros such as %%CC and %%JJJJ, it will be converted into the Kanji code according to each macro. JJIISS88, JJUUNNEETT, HHEEXX, CCAAPP, etc. among them are the Kanji codes used in Samba. ((UUNNIIXX)) SSJJIISS, ssjjiiss Shift JIS EEUUCC, eeuucc EUC-JP JJIISS, jjiiss 7bit JIS JJIISS88, jjiiss88 8bit JIS JJUUNNEETT, jjuunneett ISO-2022-JP OOJJIISS, oojjiiss 7bit JIS (JIS C6226-1978 + roman) OOJJIISS88, oojjiiss88 8bit JIS (JIS C6226-1978 + roman) OOJJUUNNEETT, oojjuunneett ISO-2022-JP (JIS C6226-1978 + roman) HHEEXX, hheexx HEX CCAAPP, ccaapp CAP UUTTFF88, uuttff88 UTF-8 UUTTFF88--mmaacc, mmaacc UTF-8 for Mac OS X UUTTFF88--iiccoonnvv UTF-8 for iconv default no convert DDIIRRCCOOUUNNTTLLIIMMIITT Specify the maximum number of files read from the directory in the tree screen. When the directory trailed by '>>' has no sub directory, the expanded result is not changed. If the number of files (including directories) in the directory is within this value, the directory with no sub directory is not trailed '>>' from the first. Moreover, the file list in the directory displayed on the right of screen is not displayed over this value. If this value is 00, you can realize a comfortable operation speed even in the slow machine. The default value is 5500 files. DDIIRRCCMMDD* Specify the default options used by ddiirr the builtin command. DDIIRRHHIISSTT Specify the maximum number of the directory histories which can be referred by the direc- tory input line. The default value is 5500. If this value is 00, you can refer to no directory history. DDIIRRHHIISSTTFFIILLEE Specify the name of the directory history file which can be referred by the directory input line. Unless you specify it, the directory history is not loaded nor saved. The default value is not specified. DDIIRRHHIISSTTUUMMAASSKK Specify the file creation mask with octal expression for the directory history file. It is used only if no existent file exists. But the mask value set by uummaasskk the builtin com- mand is prior, then actual mask value is the logical OR of this value and uummaasskk value. DDIISSPPLLAAYYMMOODDEE Specify the filename display mode of the file list when ffdd is invoked. Each of the symbolic link mode, the file type symbol mode and the dot file display mode can be selected indivi- dually. The default value is 00. The follow- ing are specifiable values. 00 standard 11 SYMLINK 22 FILETYPE 33 SYMLINK & FILETYPE 44 DOTFILE 55 SYMLINK & DOTFILE 66 FILETYPE & DOTFILE 77 SYMLINK & FILETYPE & DOTFILE Moreover, on the OS which supports the file flag, if you specify the value adding 88 to each value, you can select the file flag display mode. DDOOSSDDRRIIVVEE Validate the access function to the MS-DOS floppy. If no floppy drive is registered, this validation cannot make you access the floppy. Any value except 00 and null effects valid. On MS-DOS version, This definition can make you treat the LFN formed filename in the old DOS before Ver. 6.xx. In this case, you don't have to register any floppy drive. the access speed may be slow or some functions may be restricted for the reason to operate the disk I/O not by way of OS. DDUUMMBBSSHHEELLLL Don't use any control sequences to edit com- mand line in the internal shell. In the internal shell, the cursor addressing of ter- minal mode is not valid. In case of some ter- minal such as a console terminal, the cursor addressing cannot work correctly in this ter- minal mode, and the editing string is displayed incorrectly. When this variable is valid, while no control sequence is used to edit command line, an inefficient cursor addressing will cause restriction of some functions and failure of response. Any value except 00 and null effects valid. EEDDIITTMMOODDEE Specify the edit mode of key input as the string. The default value is eemmaaccss. The value except eemmaaccss, wwoorrddssttaarr and vvii or null are specified, any control character is not converted and will be sent as it is. EEDDIITTOORR Specify the editor command used for editing files. EENNVV* Specify the additional initial configuration file when invoked as ffddsshh. You must specify its filename as fullpath. When this variable is set, the initial configuration file is read after //eettcc//ffdd22rrcc, and before ..ffdd22rrcc or ..ffddsshhrrcc. This value will be ignored if your real and effective UIDs or real and effective GIDs are different. FFCCEEDDIITT Specify the editor command used for ffcc the builtin command. FFDD_VVEERRSSIIOONN A version string of the running ffdd. FFNNAAMMEEKKCCOODDEE Specify the Kanji code for filename. Any filename is converted into the specified Kanji code at the point of accessing the file, then you can refer to the file which has a Kanji filename from another machine on network which use a different Kanji code. The archive browser and bbrroowwssee the builtin command also refer the specified Kanji code. JJIISS88, JJUUNNEETT, HHEEXX, CCAAPP, etc. among them are the Kanji codes used in Samba. ((UUNNIIXX)) SSJJIISS, ssjjiiss Shift JIS EEUUCC, eeuucc EUC-JP JJIISS, jjiiss 7bit JIS JJIISS88, jjiiss88 8bit JIS JJUUNNEETT, jjuunneett ISO-2022-JP OOJJIISS, oojjiiss 7bit JIS (JIS C6226-1978 + roman) OOJJIISS88, oojjiiss88 8bit JIS (JIS C6226-1978 + roman) OOJJUUNNEETT, oojjuunneett ISO-2022-JP (JIS C6226-1978 + roman) HHEEXX, hheexx HEX CCAAPP, ccaapp CAP UUTTFF88, uuttff88 UTF-8 UUTTFF88--mmaacc, mmaacc UTF-8 for Mac OS X UUTTFF88--iiccoonnvv UTF-8 for iconv default no convert FFRREEQQFFIILLEE Specify the translation frequency file for the users Kana-Kanji translation learning. If the filename is not defined, the frequency infor- mation will not be saved nor be referred. The default value is ~~//..ffdd_ffrreeqq. ((UUNNIIXX)) FFRREEQQUUMMAASSKK Specify the file creation mask with octal expression for the translation frequency file for the users Kana-Kanji translation learning. The updated translation frequency file will be rebuilt, not be overwritten, so that it is used even if existent file exists. But the mask value set by uummaasskk the builtin command is prior, then actual mask value is the logical OR of this value and uummaasskk value. ((UUNNIIXX)) FFTTPPAADDDDRREESSSS Specify the mail address used as the password for anonymous FTP, when the URL drive connects the FTP host. The default value is FFDDcclloonnee@@. ((UUNNIIXX)) FFTTPPLLOOGGFFIILLEE Specify the filename to which communication logs are outputted, when the URL drive communi- cates with the FTP host. If it is not specifi- ed as fullpath nor you don't prepare the direc- tory in which the log file is stored, no log will be outputted. ((UUNNIIXX)) FFTTPPPPRROOXXYY Specify the URL used as the proxy server, when the URL drive connects the FTP host. The URL format is _s_c_h_e_m_e::////[_u_s_e_r[::_p_a_s_s_w_o_r_d]@@]_h_o_s_t[:: _p_o_r_t]. You can specify ffttpp or hhttttpp as _s_c_h_e_m_e. You can specify account information to con- nect the proxy server as _u_s_e_r and _p_a_s_s_w_o_r_d. The default value is not specified. ((UUNNIIXX)) FFUUNNCCLLAAYYOOUUTT Specify the layout of the function line, as the form of _n * 100 + _s_i_z_e. _N means the num- ber of function keys to be displayed in the function line. _S_i_z_e means the block size of function keys to be displayed. The default value is 11000055. (It means 10 function keys will be displayed, 5 of which are grouped.) HHIIDDEEPPAASSSSWWDD Suppress displaying ** as a replacement for the inputted letter, when the URL drive requires you to input a password. Any value except 00 and null effects valid. ((UUNNIIXX)) HHIISSTTFFIILLEE Specify the name of the command history file which can be referred by EEXXEECCUUTTEE_FFIILLEE and EEXXEE-- CCUUTTEE_SSHH. Unless you specify it, the directory history is not loaded nor saved. The default value is ~~//..ffdd_hhiissttoorryy. (On MS-DOS version, The default value is $$HHOOMMEE\\ffdd..hhsstt.) HHIISSTTSSIIZZEE Specify the maximum number of the command his- tories which can be referred by EEXXEECCUUTTEE_FFIILLEE and EEXXEECCUUTTEE_SSHH. The default value is 5500. If this value is 00, you can refer to no command history. HHIISSTTUUMMAASSKK Specify the file creation mask with octal expression for the command history file. It is used only if no existent file exists. But the mask value set by uummaasskk the builtin com- mand is prior, then actual mask value is the logical OR of this value and uummaasskk value. HHOOMMEE* Specify the default value when no argument of ccdd the builtin command is specified. When invoked as a login shell, if this variable is specified that directory becomes the current directory, otherwise your home directory is automatically defined as this value. HHTTMMLLLLOOGGFFIILLEE Specify the filename to which received HTML data log are outputted, when the URL drive com- municates with the HTTP host. If it is not specified as fullpath nor you don't prepare the directory in which the log file is stored, no log will be outputted. ((UUNNIIXX)) HHTTTTPPLLOOGGFFIILLEE Specify the filename to which communication logs are outputted, when the URL drive communi- cates with the HTTP host. If it is not speci- fied as fullpath nor you don't prepare the di- rectory in which the log file is stored, no log will be outputted. ((UUNNIIXX)) HHTTTTPPPPRROOXXYY Specify the URL used as the proxy server, when the URL drive connects the HTTP host. The URL format is _s_c_h_e_m_e::////[_u_s_e_r[::_p_a_s_s_w_o_r_d]@@]_h_o_s_t[:: _p_o_r_t]. You can specify hhttttpp as _s_c_h_e_m_e. You can specify account information to connect the proxy server as _u_s_e_r and _p_a_s_s_w_o_r_d. The default value is not specified. ((UUNNIIXX)) IIFFSS* Specify the internal field separators. They are used in EEXXEECCUUTTEE_SSHH to separate command and arguments. Space, tab and newline are speci- fied by default. IIGGNNOORREECCAASSEE Ignore uppercase/lowercase when filenames are compared. Any value except 00 and null effects valid. ((UUNNIIXX)) IIMMEEBBUUFFFFEERR Specify whether if the Kana-Kanji translation table is held on memory or not. It will be fast to translate strings from Kana to Kanji. You should set this if you have enough memory. The following are specifiable values. ((UUNNIIXX)) 00 not hold on memory 11 only the Hinsi information table 22 also includes the index tables 33 hold all tables IIMMEELLEEAARRNNIINNGG Specify the learning level with the trans- lation frequency file for the users Kana-Kanji translation learning. The larger value will increase the importance of the frequency infor- mation. If the value is 00, the frequency information is only saved, without any refer- ence. The default value is 1166. ((UUNNIIXX)) IIMMEEKKEEYY Specify the key to toggle the direct input mode and the Kana-Kanji IME mode when you in- put some strings. You can describe the same key name as bbiinndd command. The default value is not specified. ((UUNNIIXX)) IINNHHEERRIITTCCOOPPYY Inherit the destination timestamp from the source timestamp when CCOOPPYY_FFIILLEE command is executed. Any value except 00 and null effects valid. ((UUNNIIXX)) (On MS-DOS version, the destination timestamp is always inherited, if this variable is effective or not.) IINNPPUUTTKKCCOODDEE Specify the Kanji code for input from key- board. When the value except the following is specified, the Kanji code specified in compile is valid. ((UUNNIIXX)) SSJJIISS, ssjjiiss Shift JIS EEUUCC, eeuucc EUC-JP UUTTFF88, uuttff88 UTF-8 UUTTFF88--mmaacc, mmaacc UTF-8 for Mac OS X UUTTFF88--iiccoonnvv UTF-8 for iconv LLAANNGGUUAAGGEE Specify the language for display character. It means not only each messages displayed by ffdd, but also a Kanji code of filename to be converted. The following is the kind of languages, it doesn't have to be the string itself and is enough to contain the string, the value of LLAANNGG the environment variable also can be used. JJIISS88, JJUUNNEETT, etc. among them are the Kanji codes used in Samba. SSJJIISS, ssjjiiss Shift JIS EEUUCC, eeuucc EUC-JP JJIISS, jjiiss 7bit JIS JJIISS88, jjiiss88 8bit JIS JJUUNNEETT, jjuunneett ISO-2022-JP OOJJIISS, oojjiiss 7bit JIS (JIS C6226-1978 + roman) OOJJIISS88, oojjiiss88 8bit JIS (JIS C6226-1978 + roman) OOJJUUNNEETT, oojjuunneett ISO-2022-JP (JIS C6226-1978 + roman) UUTTFF88, uuttff88 UTF-8 UUTTFF88--mmaacc, mmaacc UTF-8 for Mac OS X UUTTFF88--iiccoonnvv UTF-8 for iconv eenn, CC, PPOOSSIIXX English (message only) default no convert (On MS-DOS version, only the English is valid.) LLIINNEENNOO* Indicate the current line number. When not in a script nor function, this value cannot be guaranteed to make sense. If you uunnsseett or reset this value, this variable will lose its special meaning to be treated as a general variable. LLIINNEESS* The variable for the lines of a terminal screen. If some value is set, this value will be replaced automatically according to chang- ing the screen size. If no value is set, this value will remain unset. LLOOGGFFIILLEE Specify the log filename with the level spaci- fied by LLOOGGLLEEVVEELL or RROOOOTTLLOOGGLLEEVVEELL. If it is not specified as fullpath, it will be regarded as the path under your home directory. You must prepare the directory in which the log file is stored, because any directories are not created automatically. The default value is not specified. LLOOGGLLEEVVEELL Specify the priority for the log contents. The default value is 00. 00 no log 11 only warning such as writing 22 notice such as changing, and over 33 info. such as refering, and over >= 44 debug level, and over The same operation can result as an error to output the log in the lower priority by 1 lev- el. LLOOGGSSIIZZEE Specify the maximum kilobyte size for the log file specified by LLOOGGFFIILLEE. If the size ex- ceeds this value, the last log file will be re- named as the filename followed by the exten- sion ..oolldd to create another new log file. The default value is 11002244(1MB). If this value is 00, the log file will not be renamed. LLOOOOPPCCUURRSSOORR Loop a cursor moving within the same page, when you move a cursor. Any value except 00 and null effects valid. MMAAIILL* Specify the spool filename when the internal shell will check new mails. If MMAAIILLPPAATTHH is set, it is prior to this. ((UUNNIIXX)) MMAAIILLCCHHEECCKK* Specify the interval of checking new mails in seconds, for the spool files specified by MMAAIILLPPAATTHH or MMAAIILL. The default value is 660000 seconds. If this value is 00, it will be checked before each prompt. ((UUNNIIXX)) MMAAIILLPPAATTHH* Specify the multiple spool filenames, as the list separated by ::, when the internal shell will check new mails. The any specified files will be checked. Each filenames can be fol- lowed by %% and a arrival message of new mails. The default message is yyoouu hhaavvee mmaaiill. ((UUNNIIXX)) MMEESSSSAAGGEELLAANNGG Specify the language for display character. The language of messages specified by this will be prior to the one specified by LLAANNGGUUAAGGEE. When the message is Japanese, the Kanji code will be defined by the value of LLAANNGGUUAAGGEE. The following is the kind of languages, it doesn't have to be the string itself and is enough to contain the string, the value of LLAANNGG the envi- ronment variable also can be used. Otherwise, In case of some additional message catalogs are prepared, you can specify its extension as the catalog name for MMEESSSSAAGGEELLAANNGG to replace messages. eenn, CC, PPOOSSIIXX English jjaa Japanese default the value of LLAANNGGUUAAGGEE MMIINNFFIILLEENNAAMMEE Specify the minimum character length of filename display area in the file list. When the area enough to be specified here cannot be obtained, the information is reduced in the order of UID, GID, timestamp, size. The default value is 1122 characters. OOPPTTAARRGG* An option argument is substituted in ggeettooppttss the builtin command. OOPPTTIINNDD* Specify the index of the next parameter in ggeettooppttss the builtin command. PPAAGGEERR Specify the pager command used for viewing files. PPAATTHH* Specify the search path for executing external commands. You can specify multiple paths separating with '::'. PPPPIIDD* Indicate the process ID of the parent proccess for ffdd which is invoked first. ((UUNNIIXX)) PPRREECCEEDDEEPPAATTHH Specify the file preceding function, which displays only filenames before obtaining their file information, for the directory which has a lot of files like as /dev. You can specify multiple pathnames separating with '::'. You are enough to specify only the top directory where you want to realize the file preceding function, then the file preceding function is valid in all of the directories under that directory. When the file preceding function is effective, any files are not sorted in that directory, and file information is obtained file by file while waiting the key input. No pathname is specified by default. PPRREECCOOPPYYMMEENNUU Display the menu in advance, which ask you what do you want with the same named files and the restricted files, when you copy, move, or delete multiple files. In case of too many target files, it avoids the occurrence of que- ry after waiting for a moment. Any value ex- cept 00 and null effects valid. PPRROOGGRREESSSSBBAARR Display the progress bar, which indicates the progress, when you copy, move, or delete files. It needs the time to calculate the progress, to make the processing time a little longer than no progress bar. Any value except 00 and null effects valid. PPSS11 Specify the prompt string of input line in EEXXEECCUUTTEE_SSHH. The default value is "$$ ". The following escape sequences are available. \\uu username ((UUNNIIXX)) \\hh hostname ((UUNNIIXX)) \\HH hostname (including domain name) ((UUNNIIXX)) \\ww fullpath of current directory \\~~ fullpath of current directory (to simplify home directory with ~~) \\WW current directory name \\!! command history number \\$$ if UID is 0, a ##, otherwise a $$ ((UUNNIIXX)) \\[[ beginning of non-printing sequence (terminal control character etc.) \\]] ending of non-printing sequence \\ee ESC (\033) \\_o_o_o character indicated by the octal _o_o_o \\\\ \ itself PPSS22 Specify the prompt string when more continuous input is needed in EEXXEECCUUTTEE_SSHH. The default value is ">> ". PPSS44* Specify the prompt string with which command strings are displayed when you do sseett --xx. PPTTYYIINNKKCCOODDEE Specify the Kanji code for the string passed to the pseudo terminal. The string, which is converted from the Kanji code specified by IINNPPUUTTKKCCOODDEE to the Kanji code specified by this command, is inputted to any processes running on the pseudo terminal. This variable has the individual value for each pseudo terminal, so that you should change value of the variable on the pseudo terminal to change the input Kanji code of the pseudo terminal running al- ready. ((UUNNIIXX)) SSJJIISS, ssjjiiss Shift JIS EEUUCC, eeuucc EUC-JP UUTTFF88, uuttff88 UTF-8 UUTTFF88--mmaacc, mmaacc UTF-8 for Mac OS X UUTTFF88--iiccoonnvv UTF-8 for iconv default no convert PPTTYYMMEENNUUKKEEYY Specify the key to open the pseudo terminal menu while you are handling the pseudo termi- nal. You can describe the same key name as bbiinndd command. You can select the following items in the pseudo terminal menu: "SendAsIs", "InputCode", "Break", "NextWindow" and "Kanji". Each item means respectively: sending the pseu- do terminal menu key as is, inputting the key name to be sent, terminating forcedly the pro- cess running in the pseudo terminal, changing to the next window, invoking the Kana-Kanji IME. In "InputCode", you can use the key name like as bbiinndd command, and also the Kanji code number used in the Kana-Kanji IME mode. But you cannot select "NextWindow" in the non- split window mode. The default value is not specified. ((UUNNIIXX)) PPTTYYMMOODDEE Use the pseudo terminal to invoke external com- mands. In the split window mode, the independ- ent pseudo terminals for every windows will be opened and enable you to handle simultaneously multiple external commands via terminals. If the terminal in use can not provide some func- tions required for the terminal emulation, the pseudo terminal may not work correctly. Any value except 00 and null effects valid. ((UUNNIIXX)) PPTTYYOOUUTTKKCCOODDEE Specify the Kanji code for the string passed from the pseudo terminal. The string, which is converted from the Kanji code specified by this command to the Kanji code specified by LLAANNGGUUAAGGEE, is displayed from any processes run- ning on the pseudo terminal. This variable has the individual value for each pseudo termi- nal, so that you should change value of the variable on the pseudo terminal to change the output Kanji code of the pseudo terminal run- ning already. ((UUNNIIXX)) SSJJIISS, ssjjiiss Shift JIS EEUUCC, eeuucc EUC-JP UUTTFF88, uuttff88 UTF-8 UUTTFF88--mmaacc, mmaacc UTF-8 for Mac OS X UUTTFF88--iiccoonnvv UTF-8 for iconv default no convert PPTTYYTTEERRMM Specify the value of TTEERRMM the environment vari- able to be passed to external commands, when you use the pseudo terminal. Some tteerrmmccaapp(5) or tteerrmmiinnffoo(5) may cause unexpected behavior of the pseudo terminal, you should specify the effective terminal name in your environment. The default value is vvtt110000. ((UUNNIIXX)) PPWWDD* The variable for the current directory with the absolute representation. If some value is set, this value will be replaced automatically according to changing the current directory. If no value is set, this value will remain un- set. If this is passed as an environment var- iable when invoked, and this value and the cur- rent directory indicate the same directory log- ically, then it is used as the default value for the current directory. It is useful when you want to specify the logical pathname fol- lowing symbolic links. RROOOOTTLLOOGGLLEEVVEELL Specify the priority for the log contents of the super user. The default value is 11. ((UUNNIIXX)) 00 no log 11 only warning such as writing 22 notice such as changing, and over 33 info. such as refering, and over >= 44 debug level, and over The same operation can result as an error to output the log in the lower priority by 1 lev- el. RRRRPPAATTHH Display files under the directory mounted by CD-ROM, with the pseudo ISO 9660 RockRidge Extension, for the OS which cannot support RockRidge Extension. You can specify multiple mount points separating with '::'. You are enough to specify only the top directory mounted by CD-ROM, then the pseudo RockRidge Extension function is valid in all of the directories under that directory. This is no more than a pseudo extension, which only replaces filenames according to TRANS.TBL, and cannot handle some CD-ROM which has an incon- sistent TRANS.TBL. No mount point is speci- fied by default. SSAAVVEEDDIIRRHHIISSTT Specify the maximum number saved to the direc- tory history file. The default value is 5500. If this value is 00, no directory history file is saved. SSAAVVEEHHIISSTT Specify the maximum number saved to the com- mand history file. The default value is 5500. If this value is 00, no command history file is saved. SSEECCOONNDD Display the second in the clock of the title line. But the clock is adjusted correctly every 1100 seconds, and some gap from the real time will be occurred in this span. Any value except 00 and null effects valid. SSHHEELLLL When the filename part of this specified value is rrffdd or rrffddsshh, the shell becomes a res- tricted shell as well as --rr option when invoked. This variable also specify the shell which can be invoked from EEXXEECCUUTTEE_SSHH. SSIIZZEEIINNFFOO Display the file size information line at the top of screen. The total size displayed here is not the sum of bytes but the sum of disk block size occupied actually. Any value except 00 and null effects valid. SSIIZZEEUUNNIITT Represent the huge file size which overflows the displayed digit with the prefix of the SI unit, as "KB", "MB" and so on. Any value ex- cept 00 and null effects valid. SSOORRTTTTRREEEE Sort directories in the tree screen. The sorted type specified by SSOORRTT_DDIIRR is used, but they can not be sorted when it is "by size" or "by timestamp". The directory included in the current directory path is always placed on the top of directory tree, with no regard to the sorted type. Any value except 00 and null effects valid. SSOORRTTTTYYPPEE The file list in the browser screen is not sorted by default, but placed in order registered in the directory. This variable specify it to be sorted by default. The fol- lowing are specifiable values. 00 not sort 11 by filename 99 by filename(reverse) 22 by extension 1100 by extension(reverse) 33 by size 1111 by size(reverse) 44 by timestamp 1122 by timestamp(reverse) 55 by length 1133 by length(reverse) 110000--111133 keep the last sorted type 220000--221133 keep it also in archive browser If you specify the value of 100-113, it is sorted according to the value indicated by lower 2 digits just after invoked, the last specified sorted type is kept when moving directory. If you specify the value of 200- 213, the last sort type will be kept also after invoking the archive browser. TTEERRMM* Specity the terminal name. When this value is dduummbb, uunnkknnoowwnn or uunn, it is regarded as the dumb terminal to suppress any escape sequences in the internal shell in spite of DDUUMMBBSSHHEELLLL. If this value does not exist in tteerrmmccaapp(5) and tteerrmmiinnffoo(5) entry, it is exe- cutable only when it is invoked as ffddsshh. The terminal name will be variable dynami- cally, then you can re-specify the suitable one as this value after invoked for some strange terminal display and key input. TTHHRRUUAARRGGSS Pass through the pathnames as is, which is specified as the startup arguments. FFdd ex- pands the meta character such as ~~ and $${{##}} in the given pathname by itself, because the ob- solete low-level shell cannot support these expansion extended by POSIX. FFdd can sometimes expand the pathname given by the shell into the unexpected string as a result of duplicate expansion, because the latest high-level shell generally support these expansion. This vari- able will be suppress the expansion of argu- ments. Any value except 00 and null effects valid. TTMMPPDDIIRR Specify the working directory where the archiver command temporarily unpack files in the archive file. The default value is //ttmmpp. (On MS-DOS version, The default value is `..'.) TTMMPPUUMMAASSKK Specify the file creation mask with octal expression for files and directories created temporarily in TTMMPPDDIIRR. But the mask value set by uummaasskk the builtin command is prior, then actual mask value is the logical OR of this value and uummaasskk value. TTRRAADDLLAAYYOOUUTT Use the traditional screen layout based on the original "FD". In this layout, the file size information will be always displayed, whether SSIIZZEEIINNFFOO is set or not. When the screen width is less than 8800 columns, this specification is invalid. Any value except 00 and null effects valid. UUNNIICCOODDEEBBUUFFFFEERR Hold the UNICODE translation table on memory. It will be fast to access the floppy drive and to translate from/to UTF-8. You should set this if you have enough memory. Any value except 00 and null effects valid. UURRLLDDRRIIVVEE Validate the function of the URL drive. Any value except 00 and null effects valid. ((UUNNIIXX)) UURRLLKKCCOODDEE Specify the Kanji code for filename on the host with the URL drive. JJIISS88, JJUUNNEETT, HHEEXX, CCAAPP, etc. among them are the Kanji codes used in Samba. ((UUNNIIXX)) SSJJIISS, ssjjiiss Shift JIS EEUUCC, eeuucc EUC-JP JJIISS, jjiiss 7bit JIS JJIISS88, jjiiss88 8bit JIS JJUUNNEETT, jjuunneett ISO-2022-JP OOJJIISS, oojjiiss 7bit JIS (JIS C6226-1978 + roman) OOJJIISS88, oojjiiss88 8bit JIS (JIS C6226-1978 + roman) OOJJUUNNEETT, oojjuunneett ISO-2022-JP (JIS C6226-1978 + roman) HHEEXX, hheexx HEX CCAAPP, ccaapp CAP UUTTFF88, uuttff88 UTF-8 UUTTFF88--mmaacc, mmaacc UTF-8 for Mac OS X UUTTFF88--iiccoonnvv UTF-8 for iconv default no convert UURRLLOOPPTTIIOONNSS Specify communication options, when the URL drive communicates with the host. You can se- lect individually whether if PASV, PORT, MDTM, FEAT each commands for the FTP communication are limited or not, or whether if the exact file information is need or not. On the HTTP protocol, you will get the timestamp and size of files with some rounding error in bulk. If you need the exact information, the opera- tions by file will spend the more communica- tion time. The default value is 00. The fol- lowing are specifiable values. ((UUNNIIXX)) 00 standard 11 PASV 22 PORT 33 PASV & PORT 44 MDTM 55 PASV & MDTM 66 PORT & MDTM 77 PASV & PORT & MDTM 88 FEAT 99 PASV & FEAT 1100 PORT & FEAT 1111 PASV & PORT & FEAT 1122 MDTM & FEAT 1133 PASV & MDTM & FEAT 1144 PORT & MDTM & FEAT 1155 PASV & PORT & MDTM & FEAT 1166 HTTP 1177 PASV & HTTP 1188 PORT & HTTP 1199 PASV & PORT & HTTP 2200 MDTM & HTTP 2211 PASV & MDTM & HTTP 2222 PORT & MDTM & HTTP 2233 PASV & PORT & MDTM & HTTP 2244 FEAT & HTTP 2255 PASV & FEAT & HTTP 2266 PORT & FEAT & HTTP 2277 PASV & PORT & FEAT & HTTP 2288 MDTM & FEAT & HTTP 2299 PASV & MDTM & FEAT & HTTP 3300 PORT & MDTM & FEAT & HTTP 3311 PASV & PORT & MDTM & FEAT & HTTP UURRLLTTIIMMEEOOUUTT Specify the timeout in seconds, when the URL drive communicates with the host. If the com- munication from the host is lost for the time specified, the communication is regarded as invalid and its connection will be shutdown forcedly. If this value is 00 second, the time- out operation is invalid to continue waiting response forever. The default value is 00 sec- ond. ((UUNNIIXX)) UUSSEEGGEETTCCUURRSSOORR Use the VT100 compatible escape sequence get- ting the cursor position in order to get the terminal size. When the screen size of ffdd doesn't correspond with the terminal size, this variable can be sometimes valid. On some terminals which don't support the escape sequence getting the cursor position, the operation may be stopped. In this case, it is continued by inputting 'R' from the keyboard. Any value except 00 and null effects valid. ((UUNNIIXX)) UUSSEESSYYSSLLOOGG Send the log to ssyyssllooggdd(8) the system logger with the level spacified by LLOOGGLLEEVVEELL or RROOOOTTLLOOGGLLEEVVEELL. The log priority is LOG_ERR only some errors are caused, otherwise the log priority is always LOG_INFO. LOG_USER is used as the facirity if it can be specified. Any value except 0 and null effects valid. ((UUNNIIXX)) WWIIDDEEDDIIGGIITT Widen the displayed digits for the number of pages and files. The standard displayed dig- its for the number of pages and files are 22 and 44 respectively. This expands them into 44 and 55 respectively. Any value except 00 and null effects valid. WWRRIITTEEFFSS Forbid use of WWRRIITTEE_DDIIRR command. If the value is 11, the directory is written only when the command is executed intentionally, and you are not confirmed after arranging the file order. If the value is 22, even writing by the command is invalid, the directory writing is quite forbidden. SSJJIISSPPAATTHH EEUUCCPPAATTHH JJIISSPPAATTHH JJIISS88PPAATTHH JJUUNNEETTPPAATTHH OOJJIISSPPAATTHH OOJJIISS88PPAATTHH OOJJUUNNEETTPPAATTHH HHEEXXPPAATTHH CCAAPPPPAATTHH UUTTFF88PPAATTHH UUTTFF88MMAACCPPAATTHH UUTTFF88IICCOONNVVPPAATTHH NNOOCCOONNVVPPAATTHH Specify the Kanji code for filename per direc- tory, which is prior to FFNNAAMMEEKKCCOODDEE. You can specify multiple pathnames separating with '::'. You are enough to specify only the top directory where you want to use the Kanji code, then you can use the Kanji code in all of the directories under that directory. In the directory which is described in NNOOCCOONNVVPPAATTHH, no Kanji code is converted ignor- ing the value of FFNNAAMMEEKKCCOODDEE. No pathname is specified by default. ((UUNNIIXX)) MMUULLTTII LLAANNGGUUAAGGEE SSUUPPPPOORRTT FFdd processes the Kanji character-set to input/output as "EUC-JP" or "Shift JIS" according to setting in compile. The the pathname including Kanji is displayed in considera- tion for the 2nd byte character in Kanji. You can dynami- cally select Kanji code to input/output with LLAANNGGUUAAGGEE, IINNPPUUTTKKCCOODDEE and FFNNAAMMEEKKCCOODDEE the internal variable. You can input Japanese string with the Kana-Kanji IME mode. You can use Kanji in the command macro and the command string, but cannot use Kanji as the value of the internal variables. You cannot use the multibyte symbol character as the meta character, such as '%%' and '""' and so on, Kanji character is not counted as 1 character in the wildcard search. And when you give the non-standard Kanji code for the OS to the shell with the parameter macro such as %%JJJJ, some Kanji is converted into the code including the meta character such as '$$' and '\\' and so on, to cause unexpected behavior. In that case, you can probably avoid it by quoting the string to be converted with %%''. AAUUTTHHOORR Takashi SHIRAI The original "FD" for MS-DOS was created and released by A.Idei for the first time, in 1989. FFdd was created for UNIX from scratch following that implementation, in 1995. FFIILLEESS //eettcc//ffdd22rrcc The systemwide initial configuration file for ffdd ~~//..ffdd22rrcc The individual initial configuration file for ffdd ~~//..ffddsshhrrcc The individual initial configuration file for ffddsshh ~~//..ffdd_hhiissttoorryy The command history file by default ~~//..ffdd_ffrreeqq The translation frequency file by default for the users Kana-Kanji translation learning Kanji translation learning //bbiinn//sshh The user shell when SSHHEELLLL the environment variable is undefined //bbiinn//rrmm The command to remove temporary files when abort //ttmmpp//ffdd** The temporary directory to unpack the archive file ffdd--uunniiccdd..ttbbll The UNICODE translation table, which is installed in the same directory as the executable binary of ffdd ffdd--ddiicctt..ttbbll The Kana-Kanji translation dictionary file, which is installed in the same directory as the execut- able binary of ffdd ffdd22rrcc The systemwide initial configuration file for ffdd on MS-DOS version, which must be prepared in the same directory as the executable binary of ffdd $$HHOOMMEE\\ffdd22..rrcc The individual initial configuration file for ffdd on MS-DOS version $$HHOOMMEE\\ffddsshh..rrcc The individual initial configuration file for ffddsshh on MS-DOS version $$HHOOMMEE\\ffdd..hhsstt The command history file on MS-DOS version by default LLIIMMIITTAATTIIOONNSS Some terminals cannot send the input of certain function keys and special keys. The sequence compatible with VVTT220000 is assigned as the default sequence which is not registered in tteerrmmccaapp(5), and when the terminal cannot support this, the key receipt or the screen control due to be brought by this is not available. SSEEEE AALLSSOO sshh(1), eecchhoo(1), tteesstt(1), llss(1), rrmm(1), ttaarr(1), ccoommpprreessss(1), zzccaatt(1), ggzziipp(1), gguunnzziipp(1), llhhaa(1), llooggiinn(1), nneewwggrrpp(1), ssttttyy(1), uummaasskk(2), tteerrmmccaapp(5), tteerrmmiinnffoo(5), ssyyssllooggdd(8) BBUUGGSS When files in an archive file are packed with a pathname including "..", the archive browser cannot work normally. The symbolic links in an archive file cannot be unpacked individually. The user interface is cheap. CCOOPPYYRRIIGGHHTT Copyright (C) 1995-2019 by Takashi SHIRAI FD-3.01j/Configur100755 2105 1751 50231 13516612560 12404 0ustar shiraiuser#!/bin/sh echo "Don't exec me!" exit 0 CC="__cc__" CPP="$CC -E" TAR=tar GREP=grep LIBDIR= #LIBDIR=-L/usr/local/lib INCLUDEDIR= #INCLUDEDIR=-I/usr/local/include TMPSRC=tmptest.c TMPEXE=tmptest LIBS= trap "rm -f $TMPSRC $TMPEXE; exit 0" 0 1 2 15 docc='$CC $TMPSRC -o $TMPEXE $INCLUDEDIR $LIBDIR $LIBS >/dev/null 2>&1' docpp='$CPP $TMPSRC $INCLUDEDIR >$TMPEXE 2>/dev/null' testcpp='$CPP $TMPSRC $INCLUDEDIR 2>&1 >/dev/null' i_unistdh= STDC= K_R= ANSI= type egrep >/dev/null 2>&1 && GREP=egrep ok() { [ "$1" = 0 ] && echo "ok" || echo "ng" } catheader() { HEADS= for i in $2""; do [ -n "$i" ] && HEADS="$HEADS <${i}.h>" done [ -n "$HEADS" ] && HEADS=" $1$HEADS" echo "$HEADS" } prettyfunc() { case "$1" in *"("*")"|*"("*");") IDENT=`echo "$1" | tr -d ",0;"` ;; *";") OIFS="$IFS" IFS=" " set - $1 IFS="$OIFS" IDENT= SEP=\" while [ "$#" -gt 1 ]; do IDENT="$IDENT$SEP$1" SEP=" " shift done case "$1" in "*"*) IDENT="$IDENT$SEP*" ;; esac IDENT="$IDENT\"" ;; *) IDENT="$1" ;; esac echo "$IDENT" } setheader() { echo "${i_unistdh}" > $TMPSRC for i in $1""; do [ -n "$i" ] && echo "#include <${i}.h>" >> $TMPSRC done } compile() { (setheader "$2") case "$1" in *";") decl="$1" ret=0 ;; *) decl= ret="$1" ;; esac echo "$3 int test(x) int x; { $decl; return((int)($ret)); }" >> $TMPSRC echo "int main(argc, argv)" >> $TMPSRC echo "int argc; char *argv[];" >> $TMPSRC echo "{ return(test(0)); }" >> $TMPSRC if eval $docc; then return 0; else return 1; fi } useheader() { echo "Checking"`(catheader for "$1")`"..." 1>&2 (setheader "$1") if [ -z "`eval $testcpp`" ]; then ret=0; else ret=1; fi (ok $ret) 1>&2 return $ret } noheader() { if (useheader "$1"); then return 1; else return 0; fi } inheader() { re="$1" func="$3" if [ -z "$3" ]; then echo "Checking for \"$1\""`(catheader in "$2")`"..." 1>&2 else echo "Checking for \"$3\""`(catheader in "$2")`"..." 1>&2 re="CONFIGURE\($re\)" func="CONFIGURE($func)" fi (setheader "$2") echo "int test(x) int x; { return((int)($func)); }" >> $TMPSRC echo "int main(argc, argv)" >> $TMPSRC echo "int argc; char *argv[];" >> $TMPSRC echo "{ return(test(0)); }" >> $TMPSRC eval $docpp if $GREP "$re" $TMPEXE >/dev/null 2>&1; then ret=0; else ret=1; fi (ok $ret) 1>&2 rm -f $TMPEXE return $ret } noinheader() { if (inheader "$1" "$2" "$3"); then return 1; else return 0; fi } gettypesize() { re=$1 echo "Checking for \"$1\""`(catheader in "$2")`"..." 1>&2 (setheader "$2") echo "#include " >> $TMPSRC echo "$3" >> $TMPSRC echo "int main(argc, argv)" >> $TMPSRC echo "int argc; char *argv[];" >> $TMPSRC echo "{ printf(\"%d\", sizeof($1)); }" >> $TMPSRC if eval $docc; then ret=`./$TMPEXE`; else ret=0; fi (ok $ret) 1>&2 rm -f $TMPEXE return $ret } isexist() { echo "Checking for "`(prettyfunc "$1")`"..." 1>&2 if (compile "$1" "$2" "$3"); then ret=0; else ret=1; fi (ok $ret) 1>&2 rm -f $TMPEXE return $ret } noexist() { if (isexist "$1" "$2" "$3"); then return 1; else return 0; fi } havelib() { echo "Checking for -l$1..." 1>&2 ORGLIBS=$LIBS LIBS="$LIBS -l$1" if (compile "$2" "$3" "$4"); then ret=0; else ret=1; fi (ok $ret) 1>&2 LIBS=$ORGLIBS rm -f $TMPEXE return $ret } cat ./config.hin for i in TARUSESPACE CPP7BIT OLDARGINT USETERMINFO \ TERMCAPLIB REGEXPLIB SOCKETLIB EXTENDLIB \ NOFILEMACRO NOFUNCMACRO NOLINEMACRO \ FORCEDSTDC STRICTSTDC NOSTDC NOCONST NOVOID NOUINT NOLONGLONG HAVELONGLONG \ NOUID_T USEPID_T DECLSIGLIST NOSIGLIST \ DECLERRLIST PWNEEDERROR NOERRNO NOFILEMODE NOUNISTDH NOSTDLIBH NOTZFILEH \ USELEAPCNT USESELECTH USESYSDIRH USETIMEH \ USESTDARGH USEMKDEVH USEMKNODH USELOCKFH \ USESGTTY USETERMIO USETERMIOS HAVECLINE USEDEVPTMX USEDEVPTY \ USEDIRECT SYSVDIRENT NODNAMLEN NODRECLEN DNAMESIZE \ HAVETIMEZONE NOTMGMTOFF NOSTBLKSIZE NOFLAGS NOFTPH USEINSYSTMH NOHADDRLIST \ USESTATVFSH USESTATFSH USEVFSH USEMOUNTH USEFSDATA \ USEFFSIZE NOFBLOCKS NOFBFREE NOFFILES \ USESTATVFS_T STATFSARGS USEFSTATFS \ USEMNTENTH USEMNTTABH USEGETFSSTAT USEGETVFSTAT USEMNTCTL \ USEMNTINFOR USEMNTINFO USEGETMNT USEGETFSENT USEREADMTAB \ USEPROCMNT USEVFCNAME USEFFSTYPE \ USERE_COMP USEREGCOMP USEREGCMP \ USERAND48 USESETENV NOSELECT DEFFDSETSIZE SELECTRWONLY NOVSPRINTF NOTERMVAR \ USEUTIME USEGETWD ULONGIOCTL \ NOFTRUNCATE USEFCNTLOCK USELOCKF NOFLOCK NOSYSLOG \ USETIMELOCAL USEMKTIME USESYSCONF USELLSEEK USEUNAME \ NOKILLPG USEWAITPID USESIGACTION USESIGPMASK \ NODTABLESIZE USERESOURCEH USEULIMITH USEGETRUSAGE USETIMES \ GETPGRPVOID USESETPGID NOSETPGRP USETCGETPGRP USESETVBUF SIGARGINT SIGFNCINT \ USESTRERROR GETTODARGS GETTODNULL USESETSID USEMMAP \ NOGETPASS USESOCKLEN NOSENDFLAGS USEINETATON USEINETPTON \ NOGETPWENT NOGETGRENT \ USESETREUID USESETRESUID USESETREGID USESETRESGID USEGETGROUPS do echo "#undef $i" done echo echo "/*" echo " * OS Oriented Definitions" echo " */" echo case "$LANG" in ja_JP.EUC*|ja_JP.euc*|ja_JP.ujis) echo "#ifndef CODEEUC" echo "#define CODEEUC" echo "#endif" if [ -d /usr/man/$LANG ]; then echo "#ifndef USEMANLANG" echo "#define USEMANLANG" echo "#endif" fi ;; ja_JP.SJIS) echo "#ifdef CODEEUC" echo "#undef CODEEUC" echo "#endif" if [ -d /usr/man/$LANG ]; then echo "#ifndef USEMANLANG" echo "#define USEMANLANG" echo "#endif" fi ;; esac echo "Checking for tar(1)..." 1>&2 touch $TMPSRC $TAR cfo $TMPEXE $TMPSRC >/dev/null 2>&1 set dummy `$TAR tvf $TMPEXE 2>/dev/null` ORGIFS=$IFS ret=1 if echo $3 | $GREP "/" >/dev/null 2>&1; then IFS=/ set dummy $3 if expr "$2" \> 100 >/dev/null 2>&1; then echo "#define TARUSESPACE" ret=0 fi fi (ok $ret) 1>&2 IFS=$ORGIFS rm -f $TMPEXE echo "Checking for K&R C..." 1>&2 echo "int main(int, char *[]);" > $TMPSRC echo "int main(argc, argv)" >> $TMPSRC echo "int argc; char *argv[];" >> $TMPSRC echo "{ return(0); }" >> $TMPSRC if eval $docc; then K_R=0; fi (ok $K_R) 1>&2 rm -f $TMPEXE echo "Checking for ANSI C..." 1>&2 echo "int main(int, char *[]);" > $TMPSRC echo "int main(int argc, char *argv[])" >> $TMPSRC echo "{ return(0); }" >> $TMPSRC if eval $docc; then ANSI=0; fi (ok $ANSI) 1>&2 rm -f $TMPEXE echo "Checking for cpp(1)..." 1>&2 echo "#define test \"01\"" | tr "01" "\376\376" > $TMPSRC echo "int main(argc, argv)" >> $TMPSRC echo "int argc; char *argv[];" >> $TMPSRC echo "{ char *cp; cp=test; return(0); }" >> $TMPSRC if [ -z "`eval $testcpp`" ]; then ret=0; else ret=1; fi if [ "$ret" != 0 ]; then echo "#define CPP7BIT" fi (ok $ret) 1>&2 rm -f $TMPEXE echo "Checking for NON-int argument..." 1>&2 echo "int test(short x);" > $TMPSRC echo "int test(x) short x; { return(0); }" >> $TMPSRC echo "int main(argc, argv)" >> $TMPSRC echo "int argc; char *argv[];" >> $TMPSRC echo "{ return(0); }" >> $TMPSRC if eval $docc; then ret=0; else ret=1; fi if [ "$ret" != 0 ]; then echo "#define OLDARGINT" fi (ok $ret) 1>&2 rm -f $TMPEXE lib= if havelib termlib "tgetent(b,\"T\")" "" "char b[1024];"; then lib=-ltermlib elif havelib ncurses "setupterm(\"T\",0,0)" "curses term"; then lib=-lncurses echo "#define USETERMINFO" elif havelib ncurses "tgetent(b,\"T\")" "" "char b[1024];"; then lib=-lncurses elif havelib termcap "tgetent(b,\"T\")" "" "char b[1024];"; then lib=-ltermcap elif havelib curses "setupterm(\"T\",0,0)" "curses term"; then lib=-lcurses echo "#define USETERMINFO" elif havelib curses "tgetent(b,\"T\")" "" "char b[1024];"; then lib=-lcurses elif havelib "curses -ltermcap" "tgetent(b,\"T\")" "" "char b[1024];"; then lib=-l"curses -ltermcap" fi if [ -n "$lib" ]; then echo "#define TERMCAPLIB \"$lib\"" LIBS="$LIBS $lib" fi lib= if isexist "socket(0,0,0)" "sys/types sys/socket"; then : elif havelib inet "socket(0,0,0)" "sys/types sys/socket"; then lib="$lib${lib:+ }-linet" elif havelib socket "socket(0,0,0)" "sys/types sys/socket"; then lib="$lib${lib:+ }-lsocket" fi if isexist "inet_ntoa(0)" "sys/types sys/socket"; then : elif havelib nsl_s "inet_ntoa(0)" "sys/types sys/socket"; then lib="$lib${lib:+ }-lnsl_s" elif havelib nsl "inet_ntoa(0)" "sys/types sys/socket"; then lib="$lib${lib:+ }-lnsl" fi if [ -n "$lib" ]; then echo "#define SOCKETLIB \"$lib\"" LIBS="$LIBS $lib" fi lib= if noexist "getmntent(0)" "stdio mntent" \ && havelib sun "getmntent(0)" "stdio mntent"; then lib="$lib -lsun" fi if noexist "getmntinfo_r(0,0,0,0)" "stdio sys/mount" \ && havelib c_r "getmntinfo_r(0,0,0,0)" "stdio sys/mount"; then lib="$lib -lc_r" fi if [ -n "$lib" ]; then echo "#define EXTENDLIB \"$lib\"" LIBS="$LIBS $lib" fi if noexist __FILE__; then echo "#define NOFILEMACRO" fi if noexist __FUNCTION__; then echo "#define NOFUNCMACRO" fi if noexist __LINE__; then echo "#define NOLINEMACRO" fi if noinheader __STDC__ "" __STDC__; then STDC=0 fi if [ -z "$STDC" ]; then if [ -n "$ANSI" ]; then echo "#define FORCEDSTDC" fi else if [ -z "$ANSI" ]; then echo "#define NOSTDC" fi fi if [ -z "$K_R" ]; then echo "#define STRICTSTDC" fi if noexist "const int n;"; then echo "#define NOCONST" fi if noexist "void *p;"; then echo "#define NOVOID" fi if noexist "u_int ui;"; then echo "#define NOUINT" fi if isexist "long long n;"; then if [ -z "$STDC" ]; then echo "#define HAVELONGLONG" fi else if [ -n "$STDC" ]; then echo "#define NOLONGLONG" fi fi if noinheader uid_t sys/types; then echo "#define NOUID_T" fi if inheader pid_t sys/types; then echo "#define USEPID_T" fi if isexist "sys_siglist[0]" signal; then echo "#define DECLSIGLIST" elif noexist "sys_siglist[0]" signal "extern char *sys_siglist[];"; then echo "#define NOSIGLIST" fi if isexist "sys_errlist[0]" "stdio errno"; then echo "#define DECLERRLIST" fi if noexist "errno" errno; then echo "#define NOERRNO" fi if noinheader " *\(* *[0-7]+.*, *\(* *[0-7]+.*, *\(* *[0-7]+.*" sys/stat \ "S_IRUSR,S_IWGRP,S_IXOTH"; then echo "#define NOFILEMODE" fi if noheader unistd; then echo "#define NOUNISTDH" else i_unistdh="#include " fi if noheader stdlib; then echo "#define NOSTDLIBH" fi if noheader tzfile; then echo "#define NOTZFILEH" elif isexist "t.tzh_leapcnt" tzfile "struct tzhead t;"; then echo "#define USELEAPCNT" fi if isexist "fd_set fds;" "sys/types sys/select" \ && noexist "fd_set fds;" sys/types; then echo "#define USESELECTH" fi if noinheader " *0*x*[0-9a-fA-F ]* *" sys/param DEV_BSIZE \ && inheader " *0*x*[0-9a-fA-F ]* *" sys/dir DEV_BSIZE; then echo "#define USESYSDIRH" fi if isexist "struct tm t;" "sys/types sys/time time" \ && noexist "struct tm t;" "sys/types sys/time"; then echo "#define USETIMEH" fi if isexist "va_list args;" stdarg "extern int Xprintf(int, int, ...);"; then echo "#define USESTDARGH" fi if isexist "major(0)" sys/sysmacros; then : elif isexist "major(0)" sys/mkdev; then echo "#define USEMKDEVH" elif isexist "major(0)" sys/mknod; then echo "#define USEMKNODH" fi if useheader sgtty \ && noinheader "TIOCFLUSH" sgtty "TIOCFLUSH"; then echo "#define USESGTTY" else if useheader termios; then echo "#define USETERMIOS" else echo "#define USETERMIO" fi fi if isexist "t.c_line" termios "struct termios t;"; then echo "#define HAVECLINE" fi if [ -c /dev/ptmx -a -d /dev/pts ]; then echo "#define USEDEVPTMX" elif [ -c /dev/ptyp0 -a -c /dev/ttyp0 ]; then echo "#define USEDEVPTY" fi if useheader dirent; then if isexist "d.d_ino" "sys/types dirent" "struct dirent d;" \ && noexist "d.d_fileno" "sys/types dirent" "struct dirent d;"; then echo "#define SYSVDIRENT" fi if noexist "d.d_namlen" "sys/types dirent" "struct dirent d;"; then echo "#define NODNAMLEN" fi if isexist "d.d_fd" "sys/types dirent" "struct dirent d;" \ && noexist "d.d_reclen" "sys/types dirent" "struct dirent d;"; then echo "#define NODRECLEN" fi gettypesize "d.d_name" "sys/types dirent" "struct dirent d;" echo "#define DNAMESIZE $ret" elif useheader sys/dir; then echo "#define USEDIRECT" gettypesize "d.d_name" "sys/types sys/dir" "struct direct d;" echo "#define DNAMESIZE $ret" else echo "#define DNAMESIZE 0" fi if (inheader "extern.*[^a-zA-Z0-9_]timezone[^a-zA-Z0-9_]" sys/time \ && isexist "timezone" "sys/types sys/time" "extern time_t timezone;") \ || (inheader "extern.*[^a-zA-Z0-9_]timezone[^a-zA-Z0-9_]" time \ && isexist "timezone" "sys/types time" "extern time_t timezone;"); then echo "#define HAVETIMEZONE" fi if (noexist "t.tm_gmtoff" "sys/types sys/time" "struct tm t;" \ && noexist "t.tm_gmtoff" "sys/types time" "struct tm t;"); then echo "#define NOTMGMTOFF" fi if noexist "s.st_blksize" "sys/types sys/stat" "struct stat s;"; then echo "#define NOSTBLKSIZE" fi if isexist "s.st_flags" "sys/types sys/stat" "struct stat s;" \ && noexist "chflags(0,0)" "sys/stat"; then echo "#define NOFLAGS" fi if noheader arpa/ftp; then echo "#define NOFTPH" fi if useheader netinet/in_systm; then echo "#define USEINSYSTMH" fi if noexist "h.h_addr_list" "netdb" "struct hostent h;"; then echo "#define NOHADDRLIST" fi statvfs_t= arg=2 fstatfs= if inheader "struct.*[^a-zA-Z0-9_]fs_data[^a-zA-Z0-9_]" sys/mount; then echo "#define USEFSDATA" elif inheader "struct.*[^a-zA-Z0-9_]statfs[^a-zA-Z0-9_]" sys/vfs; then echo "#define USEVFSH" elif inheader "struct.*[^a-zA-Z0-9_]statfs[^a-zA-Z0-9_]" sys/mount; then echo "#define USEMOUNTH" if inheader MOUNT_UFS sys/mount; then echo "#define USEFFSIZE" elif isexist "statfs(0,0,0)" sys/mount; then arg=3 fi elif inheader "struct.*[^a-zA-Z0-9_]statvfs[^a-zA-Z0-9_]" \ "sys/types sys/statvfs" \ && { { isexist "statvfs(0,&f)" "sys/types sys/statvfs" "statvfs_t f;" \ && statvfs_t=1; } \ || isexist "statvfs(0,&f)" "sys/types sys/statvfs" "struct statvfs f;"; }; then echo "#define USESTATVFSH" elif inheader "struct.*[^a-zA-Z0-9_]statfs[^a-zA-Z0-9_]" \ "sys/types sys/statfs" \ && { { isexist "statfs(0,&f,0,0)" "sys/types sys/statfs" "struct statfs f;" \ && arg=4; } \ || isexist "statfs(0,&f)" "sys/types sys/statfs" "struct statfs f;" \ || { isexist "fstatfs(0,&f)" "sys/types sys/statfs" "struct statfs f;" \ && fstatfs=1; } }; then echo "#define USESTATFSH" if noexist "f.f_blocks" "sys/types sys/statfs" "struct statfs f;"; then echo "#define NOFBLOCKS" fi if noexist "f.f_bfree" "sys/types sys/statfs" "struct statfs f;"; then echo "#define NOFBFREE" fi if noexist "f.f_files" "sys/types sys/statfs" "struct statfs f;"; then echo "#define NOFFILES" fi fi if [ -n "$statvfs_t" ]; then echo "#define USESTATVFS_T" fi if [ "$arg" != "2" ]; then echo "#define STATFSARGS $arg" fi if [ -n "$fstatfs" ]; then echo "#define USEFSTATFS" fi statfs= if isexist "getmntent(0)" "stdio mntent"; then echo "#define USEMNTENTH" elif isexist "getmntent(0,0)" "stdio sys/mnttab"; then echo "#define USEMNTTABH" elif isexist "mntctl(0,0,0)"; then echo "#define USEMNTCTL" elif isexist "getvfsstat(0,0,0)" sys/statvfs; then echo "#define USEGETVFSTAT" statfs=statvfs elif isexist "getmntinfo_r(0,0,0,0)"; then echo "#define USEMNTINFOR" elif isexist "getmntinfo(0,0)"; then echo "#define USEMNTINFO" statfs=statfs elif isexist "getfsstat(0,0,0)"; then echo "#define USEGETFSSTAT" elif isexist "getmnt(0,0,0,0,0)"; then echo "#define USEGETMNT" elif isexist "getfsent()" \ && inheader "char.*[^a-zA-Z0-9_]fs_mntops[^a-zA-Z0-9_]" fstab; then echo "#define USEGETFSENT" elif [ -e /etc/mtab -o -e /proc/mounts ]; then echo "#define USEREADMTAB" fi if [ -e /proc/mounts -a ! -e /etc/mtab -a ! -e /etc/mnttab ]; then echo "#define USEPROCMNT" fi if [ -z "$statfs" ]; then : elif isexist "getvfsbytype(0); return(*(c.vfc_name));" \ "sys/param sys/mount" "struct vfsconf c;"; then echo "#define USEVFCNAME" elif isexist "f.f_fstypename" \ "sys/param sys/mount" "struct $statfs f;"; then echo "#define USEFFSTYPE" fi lib= if isexist "re_comp(0)" ctype "extern char *re_comp();" \ || { havelib compat "re_comp(0)" ctype "extern char *re_comp();" \ && lib=-lcompat; }; then echo "#define USERE_COMP" elif isexist "regfree(re)" "sys/types regex" "regex_t *re;"; then echo "#define USEREGCOMP" elif isexist "regcmp(0,0)" ctype "extern char *regcmp();" \ || { havelib gen "regcmp(0,0)" ctype "extern char *regcmp();" && lib=-lgen; } \ || { havelib PW "regcmp(0,0)" ctype "extern char *regcmp();" && lib=-lPW; } \ || { havelib PW "regcmp(0,0)" ctype "extern char *regcmp(); char Error[1024];" \ && lib=-lPW && echo "#define PWNEEDERROR"; }; then echo "#define USEREGCMP" fi if [ -n "$lib" ]; then echo "#define REGEXPLIB \"$lib\"" LIBS="$LIBS $lib" fi if isexist "rand48()"; then echo "#define USERAND48" fi if isexist "setenv(0,0,0)"; then echo "#define USESETENV" fi if noexist "select(0,0,0,0,0)"; then echo "#define NOSELECT" fi if noexist "vsprintf(0,0,0)" "stdio varargs" \ && noexist "vsprintf(0,0,0)" "stdio stdarg"; then echo "#define NOVSPRINTF" fi if noexist "ospeed" "" "extern short ospeed;" \ || noexist "BC" "" "extern char *BC;"; then echo "#define NOTERMVAR" fi if noexist "utimes(0,0)"; then echo "#define USEUTIME" fi if noexist "getcwd(0,0)"; then echo "#define USEGETWD" fi if inheader "[^a-zA-Z0-9_]ioctl([^,]*, *unsigned long *,.*) *;" sys/ioctl; then echo "#define ULONGIOCTL" fi if noexist "ftruncate(0,0)"; then echo "#define NOFTRUNCATE" fi if isexist "fcntl(0,F_SETLKW,0)" fcntl; then echo "#define USEFCNTLOCK" elif isexist "flock(0,0)" sys/file; then : elif isexist "lockf(0,0,0)"; then echo "#define USELOCKF" elif isexist "lockf(0,0,0)" sys/lockf; then echo "#define USELOCKFH" echo "#define USELOCKF" else echo "#define NOFLOCK" fi if noexist "syslog(0,0,0);" syslog; then echo "#define NOSYSLOG" fi if isexist "mktime(0)" time; then echo "#define USEMKTIME" elif isexist "timelocal(0)" time; then echo "#define USETIMELOCAL" fi if isexist "sysconf(0)"; then echo "#define USESYSCONF" fi if isexist "_llseek(0,0,0,0,0)" linux/unistd "static _syscall5(int, _llseek, unsigned int, fd, unsigned long, ofs_h, unsigned long, ofs_l, long long *, result, unsigned int, whence); "; then echo "#define USELLSEEK" fi if noexist "gethostname(0,0)" && isexist "uname(0)" sys/utsname; then echo "#define USEUNAME" fi if noexist "killpg(0,0)" "sys/types signal"; then echo "#define NOKILLPG" fi if isexist "waitpid(0,0,0)" sys/wait; then echo "#define USEWAITPID" fi if isexist "sigaction(0,0,0)" signal; then echo "#define USESIGACTION" fi if isexist "sigprocmask(0,0,0)" signal; then echo "#define USESIGPMASK" fi if noexist "getdtablesize()"; then echo "#define NODTABLESIZE" fi if isexist "getrlimit(0,0)" "sys/types sys/time sys/resource" \ && isexist "setrlimit(0,0)" "sys/types sys/time sys/resource"; then echo "#define USERESOURCEH" elif isexist "ulimit(0,0)" ulimit; then echo "#define USEULIMITH" fi if isexist "getrusage(0,0)" "sys/types sys/time sys/resource"; then echo "#define USEGETRUSAGE" elif isexist "times(0)" "sys/types sys/times"; then echo "#define USETIMES" fi if noexist "getpgrp(0)" && isexist "getpgrp()"; then echo "#define GETPGRPVOID" fi if isexist "setpgid(0,0)"; then echo "#define USESETPGID" elif noexist "setpgrp(0,0)"; then echo "#define NOSETPGRP" fi if isexist "tcgetpgrp(0)" && isexist "tcsetpgrp(0,0)"; then echo "#define USETCGETPGRP" fi if isexist "setvbuf(0,0,0,0)" stdio; then echo "#define USESETVBUF" fi if inheader "int.*[^a-zA-Z0-9_]signal[^a-zA-Z0-9_]" signal; then echo "#define SIGARGINT" fi if inheader "[^a-zA-Z0-9_]signal([^a-zA-Z0-9_].*\(|\()[ (]*int[ ),].*\) *;" \ signal; then echo "#define SIGFNCINT" fi if isexist "strerror(0)" string; then echo "#define USESTRERROR" fi if isexist "gettimeofday(0,0)" "sys/time time"; then : elif isexist "gettimeofday(0)" "sys/time time"; then echo "#define GETTODARGS 1" fi if isexist "setsid()"; then echo "#define USESETSID" fi if noexist "getpass(0)"; then echo "#define NOGETPASS" fi if inheader socklen_t "sys/types sys/socket"; then echo "#define USESOCKLEN" fi if isexist "mmap(0,0,0,0,0,0)" "sys/types sys/mman"; then echo "#define USEMMAP" fi if isexist "inet_aton(0,0)" "sys/socket netinet/in arpa/inet"; then echo "#define USEINETATON" elif isexist "inet_pton(0,0,0)" "sys/socket netinet/in arpa/inet"; then echo "#define USEINETPTON" fi if noexist "getpwent()" "sys/types pwd"; then echo "#define NOGETPWENT" fi if noexist "getgrent()" "sys/types grp"; then echo "#define NOGETGRENT" fi if isexist "seteuid(0)"; then : elif isexist "setreuid(0)"; then echo "#define USESETREUID" elif isexist "setresuid(0)"; then echo "#define USESETRESUID" fi if isexist "setegid(0)"; then : elif isexist "setregid(0)"; then echo "#define USESETREGID" elif isexist "setresgid(0)"; then echo "#define USESETRESGID" fi if isexist "getgroups(0,0)"; then echo "#define USEGETGROUPS" fi FD-3.01j/Makefile100644 2105 1751 13150 13516612560 12341 0ustar shiraiuser# # Makefile for fd # VERSION = 3 VERMAJ = $(VERSION) PREFIX = /usr/local CONFDIR = /etc BUILD = SHELL = /bin/sh MAKE = make CC = cc HOSTCC = $(CC) CPP = $(CC) -E CFLAGS = HOSTCFLAGS = CPPFLAGS = HOSTCPPFLAGS = LDFLAGS = HOSTLDFLAGS = SED = sed ECHO = echo CP = cp RM = rm -f TAR = tar LHA = lha SHAR = shar DICTSRC = DEFCFLAGS = -DPREFIX='"'$(PREFIX)'"' \ -DCONFDIR='"'$(CONFDIR)'"' \ -DDICTSRC='"''$(DICTSRC)''"' \ -DFD=$(VERMAJ) \ -DCCCOMMAND='"'$(CC)'"' \ -DHOSTCCCOMMAND='"'$(HOSTCC)'"' \ -DCFLAGS='"''$(CFLAGS)''"' \ -DHOSTCFLAGS='"''$(HOSTCFLAGS)''"' \ -DCPPFLAGS='"''$(CPPFLAGS)''"' \ -DHOSTCPPFLAGS='"''$(HOSTCPPFLAGS)''"' \ -DLDFLAGS='"''$(LDFLAGS)''"' \ -DHOSTLDFLAGS='"''$(HOSTLDFLAGS)''"' DEFAR = TAR=$(TAR) \ LHA=$(LHA) \ SHAR=$(SHAR) PREDEF = alpha __alpha __alpha__ \ ia64 __ia64 __ia64__ x86_64 __x86_64 __x86_64__ \ amd64 __amd64 __amd64__ LP64 __LP64 __LP64__ \ arm64 __arm64 __arm64__ aarch64 __aarch64 __aarch64__ \ s390x __s390x __s390x__ CONFIG_ARCH_S390X \ PPC __powerpc__ _COMPILER_VERSION \ SYSTYPE_BSD SYSTYPE_SYSV SYSTYPE_SVR4 _SYSTYPE_SVR4 \ USGr4 __svr4__ __SVR4 BSD bsd43 __WIN32__ \ sun __SUNPRO_C sony __sony sgi \ hpux __hpux __H3050 __H3050R __H3050RX \ __CLASSIC_C__ __STDC_EXT__ __HP_cc \ nec_ews _nec_ews nec_ews_svr4 _nec_ews_svr4 \ uniosu uniosb luna88k _IBMR2 _AIX41 _AIX43 \ ultrix _AUX_SOURCE DGUX __DGUX__ \ __uxpm__ __uxps__ NeXT __CYGWIN__ linux \ __FreeBSD__ __BOW__ __NetBSD__ NetBSD1_0 __NetBSD_Version__ \ __bsdi__ __386BSD__ __BSD_NET2 __OpenBSD__ \ __APPLE__ __MACH__ __minix _VCS_REVISION __ANDROID__ __BIONIC__ mips \ __ANDROID_API__ \ __GNUC__ __GNUC_MINOR__ __clang__ __clang_major__ __clang_minor__ HPREFIX = H_ MAKES = makefile.gpc makefile.g98 \ makefile.dpc makefile.d98 \ makefile.lpc makefile.l98 \ makefile.bpc makefile.b98 all: Makefile.tmp $(MAKE) -f Makefile.tmp debug: Makefile.tmp $(MAKE) CC=gcc DEBUG=-DDEBUG ALLOC='-L. -lmalloc' -f Makefile.tmp shdebug: Makefile.tmp $(MAKE) CC=gcc DEBUG=-DDEBUG ALLOC='-L. -lmalloc' -f Makefile.tmp sh Makefile.tmp: Makefile.in mkmf.sed $(SED) -f mkmf.sed Makefile.in > $@ || \ ($(RM) $@; exit 1) makefile.gpc: Makefile.in mkmfdosg.sed mkmf.sed $(SED) -f mkmfdosg.sed Makefile.in | \ $(SED) "s:__OSTYPE__:DOSV:g" | \ $(SED) -f mkmf.sed > $@ || \ ($(RM) $@; exit 1) makefile.g98: Makefile.in mkmfdosg.sed mkmf.sed $(SED) -f mkmfdosg.sed Makefile.in | \ $(SED) "s:__OSTYPE__:PC98:g" | \ $(SED) -f mkmf.sed > $@ || \ ($(RM) $@; exit 1) makefile.dpc: Makefile.in mkmfdosd.sed mkmf.sed $(SED) -f mkmfdosd.sed Makefile.in | \ $(SED) "s:__OSTYPE__:DOSV:g" | \ $(SED) -f mkmf.sed > $@ || \ ($(RM) $@; exit 1) makefile.d98: Makefile.in mkmfdosd.sed mkmf.sed $(SED) -f mkmfdosd.sed Makefile.in | \ $(SED) "s:__OSTYPE__:PC98:g" | \ $(SED) -f mkmf.sed > $@ || \ ($(RM) $@; exit 1) makefile.lpc: Makefile.in mkmfdosl.sed mkmf.sed $(SED) -f mkmfdosl.sed Makefile.in | \ $(SED) "s:__OSTYPE__:DOSV:g" | \ $(SED) -f mkmf.sed > $@ || \ ($(RM) $@; exit 1) makefile.l98: Makefile.in mkmfdosl.sed mkmf.sed $(SED) -f mkmfdosl.sed Makefile.in | \ $(SED) "s:__OSTYPE__:PC98:g" | \ $(SED) -f mkmf.sed > $@ || \ ($(RM) $@; exit 1) makefile.bpc: Makefile.in mkmfdosb.sed mkmf.sed $(SED) -f mkmfdosb.sed Makefile.in | \ $(SED) "s:__OSTYPE__:DOSV:g" | \ $(SED) -f mkmf.sed > $@ || \ ($(RM) $@; exit 1) makefile.b98: Makefile.in mkmfdosb.sed mkmf.sed $(SED) -f mkmfdosb.sed Makefile.in | \ $(SED) "s:__OSTYPE__:PC98:g" | \ $(SED) -f mkmf.sed > $@ || \ ($(RM) $@; exit 1) mkmf.sed: mkmfsed ./mkmfsed > mkmf.sed mkmfsed: mkmfsed.c $(HOSTCC) $(HOSTCFLAGS) $(HOSTCPPFLAGS) $(DEFCFLAGS) -o $@ mkmfsed.c mkmfsed: hmachine.h config.h fd.h headers.h machine.h mkmfsed: depend.h version.h fd.h: -[ -f $@ ] || $(CP) headers.h $@ config.h: config.hin $(CP) config.hin config.h hmachine.h: Makefile machine.h hmachine.sed $(SED) -n -e 's:machine.h:$@:g' -e '1,/^$$/p' machine.h > $@ @if [ "$(CC)" != "$(HOSTCC)" ]; then \ ( \ $(ECHO) "#define H___CROSS_CC__ 1" >> $@; \ $(ECHO) "#if defined (__ANDROID__) || defined (__BIONIC__)"; \ $(ECHO) "#include "; \ $(ECHO) "#endif"; \ for i in $(PREDEF); do \ $(ECHO) "#ifdef $${i}"; \ $(ECHO) "__DEFINE__ $(HPREFIX)$${i} $${i}"; \ $(ECHO) "#endif"; \ done ) | $(CPP) $(CFLAGS) - | \ $(SED) -n -e 's:__DEFINE__:#define:p' >> $@; \ $(ECHO) >> $@; \ fi $(SED) -f hmachine.sed machine.h >> $@ hmachine.sed: Makefile $(ECHO) '1,/^$$/d' > $@ @if [ "$(CC)" != "$(HOSTCC)" ]; then \ for i in $(PREDEF); do \ $(ECHO) "s:($${i}):($(HPREFIX)$${i}):g"; \ done >> $@; \ fi install install-bin install-runcom \ install-table install-man install-jman \ catman catman-b compman compman-b \ jcatman jcatman-b jcompman jcompman-b: Makefile.tmp $(MAKE) BUILD=$(BUILD) -f Makefile.tmp $@ sh bsh nsh \ fd.doc README.doc HISTORY.doc FAQ.doc LICENSES.doc \ depend lint: Makefile.tmp $(MAKE) -f Makefile.tmp $@ config: rmconfig Makefile.tmp $(MAKE) SHELL=$(SHELL) -f Makefile.tmp $@ rmconfig: $(CP) config.hin config.h ipk: Makefile.tmp $(MAKE) STRIP=$(STRIP) -f Makefile.tmp $@ everything: Makefile.tmp $(MAKE) -f Makefile.tmp sh bsh nsh all makes: $(MAKES) tar gtar shtar lzh shar: Makefile.tmp $(MAKES) $(MAKE) $(DEFAR) -f Makefile.tmp $@ rmdict: Makefile.tmp $(MAKE) -f Makefile.tmp $@ -$(RM) Makefile.tmp mkmf.sed -$(RM) mkmfsed mkmfsed.exe clean: Makefile.tmp $(MAKE) -f Makefile.tmp $@ -$(RM) Makefile.tmp mkmf.sed -$(RM) mkmfsed mkmfsed.exe -$(RM) hmachine.h hmachine.sed distclean: clean -$(RM) config.h realclean: distclean -$(RM) makefile.gpc makefile.g98 -$(RM) makefile.dpc makefile.d98 -$(RM) makefile.lpc makefile.l98 -$(RM) makefile.bpc makefile.b98 FD-3.01j/Makefile.in100644 2105 1751 156507 13516612560 13004 0ustar shiraiuser# # Makefile for fd # TITLE = FD- VERMAJ = __VERMAJ__ VERSION = __VERSION__ PREFIX = __PREFIX__ CONFDIR = __CONFDIR__ BUILD = MANSEC = 1 BINTOP = $(PREFIX)/bin BINDIR = $(BUILD)$(BINTOP) DATATOP = $(PREFIX)/share DATADIR = $(BUILD)$(DATATOP)/fd MANTOP = $(PREFIX)/man MANDIR = $(BUILD)$(MANTOP)/man$(MANSEC) CATDIR = $(BUILD)$(MANTOP)/cat$(MANSEC) JMANDIR = $(BUILD)$(MANTOP)__LANGDIR__/man$(MANSEC) JCATDIR = $(BUILD)$(MANTOP)__LANGDIR__/cat$(MANSEC) IPKWDIR = ./ipk.work IPKTDIR = ./ipk.tmp DEPDIR = ./depend.tmp DIST = __DIST__ DEFRC = $(CONFDIR)/fd__RCVERSION__rc BLDRC = $(BUILD)$(DEFRC) DOSRC = ~FD\\fd__RCVERSION__rc UNITBL = fd-unicd.tbl DICTTBL = fd-dict.tbl DICTTXT = fd-dict.txt DICTSRC = __DICTSRC__ CATTBL = fd-cat.ja ECATTBL = fd-cat.C TABLES = __TABLES__ SRC = main.c printf.c termio.c term.c stream.c \ string.c malloc.c time.c \ pathname.c system.c posixsh.c doscom.c \ log.c sysemu.c dosdisk.c unixdisk.c \ realpath.c encode.c \ libc.c file.c mntinfo.c statfs.c apply.c \ pty.c termemu.c frontend.c backend.c \ parse.c builtin.c shell.c \ socket.c url.c auth.c \ ftp.c html.c http.c urldisk.c \ catalog.c \ kconv.c input.c ime.c dict.c roman.c \ info.c rockridg.c tree.c \ lsparse.c archive.c \ custom.c command.c browse.c HSRC = evalopt.c gentbl.c \ mkunitbl.c mkdict.c mktankan.c \ mkkanji.c mkcat.c mkdir_p.c \ kanjicnv.c expfunc.c \ mkfuncno.c DSRC = $(DEPDIR)/unitbl.c $(DEPDIR)/dicttbl.c HEADER = fd.h \ headers.h machine.h \ depend.h \ printf.h kctype.h typesize.h \ string.h malloc.h time.h \ dirent.h sysemu.h log.h \ pathname.h system.h posixsh.h wait.h \ termio.h term.h stream.h \ types.h namelist.h \ dosdisk.h unixdisk.h unixemu.h \ realpath.h encode.h termemu.h \ mntinfo.h fsinfo.h device.h parse.h lsparse.h \ socket.h url.h auth.h html.h urldisk.h \ catalog.h \ evalopt.h gentbl.h \ kconv.h roman.h hinsi.h \ func.h functabl.h SSRC = printf.c termio.c stream.c \ string.c malloc.c time.c \ pathname.c system.c posixsh.c doscom.c \ sysemu.c BSRC = printf.c termio.c stream.c \ string.c malloc.c \ pathname.c system.c doscom.c \ sysemu.c NSRC = printf.c termio.c stream.c \ string.c malloc.c time.c \ pathname.c system.c posixsh.c doscom.c \ sysemu.c \ realpath.c encode.c \ parse.c \ socket.c url.c auth.c \ ftp.c html.c http.c urldisk.c \ lsparse.c TSRC = string.c roman.c kconv.c evalopt.c gentbl.c unitbl.c DOC = README.eng HISTORY.eng FAQ.eng TECHKNOW.eng \ Install.eng ToAdmin.eng LICENSES.eng JDOC = README HISTORY FAQ TECHKNOW \ Install ToAdmin LICENSES MANSRC = fd_e.man MANCAT = fd_e.cat JMANSRC = fd.man JMANCAT = fd.cat RUNCOM = fdrc ARGS = object.arg SARGS = sobject.arg NARGS = nobject.arg SRCS = $(DOC) $(MANSRC) $(MANCAT) \ Configur Makefile Makefile.in $(SRC) $(HSRC) $(HEADER) \ makefile.gpc makefile.g98 \ makefile.dpc makefile.d98 \ makefile.lpc makefile.l98 \ makefile.bpc makefile.b98 \ mkmfdosg.sed mkmfdosd.sed mkmfdosl.sed mkmfdosb.sed \ mkmfsed.c \ config.hin version.h \ _fdrc _fdrc.dif fd.spec JSRCS = $(JDOC) $(JMANSRC) $(JMANCAT) \ kanji.hin SOURCES = $(SRCS) $(JSRCS) SHSOURCES = $(NSRC) \ headers.h machine.h \ depend.h \ printf.h kctype.h typesize.h \ string.h malloc.h time.h \ dirent.h sysemu.h log.h \ pathname.h system.h posixsh.h wait.h \ termio.h stream.h \ namelist.h \ unixemu.h \ realpath.h encode.h \ device.h parse.h lsparse.h \ socket.h url.h auth.h html.h urldisk.h \ kanjicnv.c expfunc.c mkmfsed.c \ Configur Makefile Makefile.in \ makefile.gpc makefile.g98 \ makefile.dpc makefile.d98 \ makefile.lpc makefile.l98 \ makefile.bpc makefile.b98 \ mkmfdosg.sed mkmfdosd.sed mkmfdosl.sed mkmfdosb.sed \ config.hin version.h CC = __CC__ HOSTCC = __HOSTCC__ INSTALL = __INSTALL__ MAKE = make SHELL = /bin/sh SED = sed ECHO = __ECHO__ CP = __COPY__ RM = __RM__ LN = __LN__ MV = mv CHMOD = chmod LINT = lint TAR = tar LHA = lha SHAR = shar EXE = __EXE__ OBJ = __OBJ__ PROGRAM = fd ALIAS = fdsh DOSOBJS = unixdisk$(OBJ) IMEOBJS = ime$(OBJ) dict$(OBJ) roman$(OBJ) __DICTTBLOBJ__ SCKOBJS = socket$(OBJ) url$(OBJ) auth$(OBJ) \ ftp$(OBJ) html$(OBJ) http$(OBJ) urldisk$(OBJ) OBJ1 = main$(OBJ) printf$(OBJ) termio$(OBJ) term$(OBJ) stream$(OBJ) \ string$(OBJ) malloc$(OBJ) time$(OBJ) OBJ2 = pathname$(OBJ) system$(OBJ) posixsh$(OBJ) doscom$(OBJ) \ log$(OBJ) sysemu$(OBJ) dosdisk$(OBJ) __DOSOBJS__ OBJ3 = realpath$(OBJ) encode$(OBJ) \ libc$(OBJ) file$(OBJ) mntinfo$(OBJ) statfs$(OBJ) apply$(OBJ) \ pty$(OBJ) termemu$(OBJ) frontend$(OBJ) backend$(OBJ) OBJ4 = parse$(OBJ) builtin$(OBJ) shell$(OBJ) __SOCKETOBJS__ OBJ5 = catalog$(OBJ) \ kconv$(OBJ) input$(OBJ) __IMEOBJS__ __UNITBLOBJ__ OBJ6 = info$(OBJ) rockridg$(OBJ) tree$(OBJ) \ lsparse$(OBJ) archive$(OBJ) \ custom$(OBJ) command$(OBJ) browse$(OBJ) SOBJ1 = sprintf$(OBJ) stermio$(OBJ) sstream$(OBJ) \ sstring$(OBJ) smalloc$(OBJ) stime$(OBJ) SOBJ2 = spathnam$(OBJ) ssystem$(OBJ) sposixsh$(OBJ) sdoscom$(OBJ) \ ssysemu$(OBJ) BOBJ = bprintf$(OBJ) btermio$(OBJ) bstream$(OBJ) \ bstring$(OBJ) bmalloc$(OBJ) \ bpathnam$(OBJ) bsystem$(OBJ) bdoscom$(OBJ) \ bsysemu$(OBJ) NOBJ1 = nprintf$(OBJ) ntermio$(OBJ) nstream$(OBJ) \ nstring$(OBJ) nmalloc$(OBJ) ntime$(OBJ) NOBJ2 = npathnam$(OBJ) nsystem$(OBJ) nposixsh$(OBJ) ndoscom$(OBJ) \ nsysemu$(OBJ) \ nrealpat$(OBJ) nencode$(OBJ) NOBJ3 = nparse$(OBJ) \ nsocket$(OBJ) nurl$(OBJ) nauth$(OBJ) \ nftp$(OBJ) nhtml$(OBJ) nhttp$(OBJ) nurldisk$(OBJ) \ nlsparse$(OBJ) KOBJ = tevalopt$(OBJ) __TUNITBLOBJ__ COBJ = tevalopt$(OBJ) tgentbl$(OBJ) UOBJ = tevalopt$(OBJ) tgentbl$(OBJ) TOBJ = tstring$(OBJ) troman$(OBJ) tkconv$(OBJ) tevalopt$(OBJ) tgentbl$(OBJ) ALLOC = DEBUG = CFLAGS = __CFLAGS__ HOSTCFLAGS = __HOSTCFLAGS__ CPPFLAGS = __CPPFLAGS__ HOSTCPPFLAGS = __HOSTCPPFLAGS__ LDFLAGS = __LDFLAGS__ HOSTLDFLAGS = __HOSTLDFLAGS__ OSOPTS = -D__OSTYPE__ COPTS = __COPTS__ HOSTCOPTS = __HOSTCOPTS__ FLDFLAGS = __FLDFLAGS__ SLDFLAGS = __SLDFLAGS__ NLDFLAGS = __NLDFLAGS__ BUILDFLAGS = $(COPTS) $(CPPFLAGS) FDCFLAGS = $(BUILDFLAGS) __MEM__ -DFD=$(VERMAJ) SHCFLAGS = $(BUILDFLAGS) __SHMEM__ -DFDSH=$(VERMAJ) BSHCFLAGS = $(BUILDFLAGS) __BSHMEM__ -DFDSH=$(VERMAJ) -DMINIMUMSHELL NSHCFLAGS = $(BUILDFLAGS) __NSHMEM__ -DFDSH=$(VERMAJ) -DWITHNETWORK DEFCFLAGS = -DDEFRC=__DEFRC__ .SUFFIXES: .h .c __OBJ__ __EXE__ ############################################################ # Dependency Rules ############################################################ all: $(PROGRAM)$(EXE) $(PROGRAM).$(MANSEC) $(TABLES) $(PROGRAM)$(EXE): $(OBJ1) $(OBJ2) $(OBJ3) $(OBJ4) $(OBJ5) $(OBJ6) $(ARGS) __SLEEP__ @sleep 1 $(CC) __MEM__ __LNK__ __OBJLIST__ $(FLDFLAGS) __DJGPP1__ @ren $@ $(PROGRAM) __DJGPP1__ @aout2exe $(PROGRAM) __DJGPP1__ @del $(PROGRAM) $(ARGS): $(OBJ1) $(OBJ2) $(OBJ3) $(OBJ4) $(OBJ5) $(OBJ6) __SLEEP__ @sleep 1 @$(ECHO) $(OBJ1) > $(ARGS) @$(ECHO) $(OBJ2) >> $(ARGS) @$(ECHO) $(OBJ3) >> $(ARGS) @$(ECHO) $(OBJ4) >> $(ARGS) @$(ECHO) $(OBJ5) >> $(ARGS) @$(ECHO) $(OBJ6) >> $(ARGS) __SLEEP__ @sleep 1 main$(OBJ): main.c $(CC) $(FDCFLAGS) $(DEFCFLAGS) __TBLPATH__ -c __OUT__ $*.c termio$(OBJ): termio.c $(CC) $(FDCFLAGS) __FDSETSIZE__ -c __OUT__ $*.c system$(OBJ): system.c $(CC) $(FDCFLAGS) $(DEFCFLAGS) -c __OUT__ $*.c custom$(OBJ): custom.c $(CC) $(FDCFLAGS) __PRESETKCODE__ -c __OUT__ $*.c .c__OBJ__: $(CC) $(FDCFLAGS) -c __OUT__ $*.c ############################################################ # kanji using module $(PROGRAM).$(MANSEC): kanjicnv$(EXE) $(JMANSRC) ./kanjicnv$(EXE) __KDOCOPTION__ __PREFIXOPTION__ $(JMANSRC) $@ $(PROGRAM).$(MANSEC)c: kanjicnv$(EXE) $(JMANCAT) ./kanjicnv$(EXE) __KDOCOPTION__ $(JMANCAT) $@ $(PROGRAM).eng: kanjicnv$(EXE) $(MANCAT) ./kanjicnv$(EXE) -b $(MANCAT) $@ $(PROGRAM).doc: kanjicnv$(EXE) $(JMANCAT) ./kanjicnv$(EXE) __KDOCOPTION__ -b $(JMANCAT) $@ README.doc: kanjicnv$(EXE) README ./kanjicnv$(EXE) __KDOCOPTION__ README $@ HISTORY.doc: kanjicnv$(EXE) HISTORY ./kanjicnv$(EXE) __KDOCOPTION__ HISTORY $@ FAQ.doc: kanjicnv$(EXE) FAQ ./kanjicnv$(EXE) __KDOCOPTION__ FAQ $@ LICENSES.doc: kanjicnv$(EXE) LICENSES ./kanjicnv$(EXE) __KDOCOPTION__ LICENSES $@ kanjicnv$(EXE): kanjicnv$(OBJ) $(KOBJ) __SLEEP__ @sleep 1 $(HOSTCC) $(HOSTCOPTS) $(HOSTLDFLAGS) __LNK__ kanjicnv$(OBJ) $(KOBJ) __DJGPP1__ @ren $@ kanjicnv __DJGPP1__ @aout2exe kanjicnv __DJGPP1__ @del kanjicnv __SLEEP__ @sleep 1 kanjicnv$(OBJ): kanjicnv.c $(HOSTCC) $(HOSTCOPTS) $(HOSTCPPFLAGS) __WITHUTF8__ -c __OUT__ $*.c ############################################################ # message catalog module kanji.h: mkkanji$(EXE) kanjicnv$(EXE) kanji.hin ./mkkanji$(EXE) kanji.hin | \ ./kanjicnv$(EXE) __KCODEOPTION__ __PREFIXOPTION__ __MSBOPTION__ - $@ __SLEEP__ @sleep 1 mkkanji$(EXE): mkkanji$(OBJ) __SLEEP__ @sleep 1 $(HOSTCC) $(HOSTCOPTS) $(HOSTLDFLAGS) __LNK__ mkkanji$(OBJ) __DJGPP1__ @ren $@ mkkanji __DJGPP1__ @aout2exe mkkanji __DJGPP1__ @del mkkanji __SLEEP__ @sleep 1 mkkanji$(OBJ): mkkanji.c $(HOSTCC) $(HOSTCOPTS) $(HOSTCPPFLAGS) -c __OUT__ $*.c _fd-cat.ja: mkcat$(EXE) kanji.h ./mkcat$(EXE) -c 1 kanji.h $@ __SLEEP__ @sleep 1 _fd-cat.C: mkcat$(EXE) kanji.h ./mkcat$(EXE) -c 2 kanji.h $@ __SLEEP__ @sleep 1 fd-cat.ja: mkcat$(EXE) _fd-cat.ja ./mkcat$(EXE) _fd-cat.ja $@ fd-cat.C: mkcat$(EXE) _fd-cat.C ./mkcat$(EXE) _fd-cat.C $@ mkcat$(EXE): mkcat$(OBJ) $(COBJ) __SLEEP__ @sleep 1 $(HOSTCC) $(HOSTCOPTS) $(HOSTLDFLAGS) __LNK__ mkcat$(OBJ) $(COBJ) __DJGPP1__ @ren $@ mkcat __DJGPP1__ @aout2exe mkcat __DJGPP1__ @del mkcat __SLEEP__ @sleep 1 mkcat$(OBJ): mkcat.c $(HOSTCC) $(HOSTCOPTS) $(HOSTCPPFLAGS) -c __OUT__ $*.c ############################################################ # function list using module funcno.h: mkfuncno$(EXE) ./mkfuncno$(EXE) $@ __SLEEP__ @sleep 1 mkfuncno$(EXE): mkfuncno$(OBJ) __SLEEP__ @sleep 1 $(HOSTCC) $(HOSTCOPTS) $(HOSTLDFLAGS) __LNK__ mkfuncno$(OBJ) __DJGPP1__ @ren $@ mkfuncno __DJGPP1__ @aout2exe mkfuncno __DJGPP1__ @del mkfuncno __SLEEP__ @sleep 1 mkfuncno$(OBJ): mkfuncno.c $(HOSTCC) $(HOSTCOPTS) $(HOSTCPPFLAGS) -DFD=$(VERMAJ) -c __OUT__ $*.c ############################################################ # UNICODE table generating module $(UNITBL): mkunitbl$(EXE) ./mkunitbl$(EXE) $@ unitbl.c: mkunitbl$(EXE) ./mkunitbl$(EXE) -t $@ $(DEPDIR)/unitbl.c: mkunitbl$(EXE) [ -d $(DEPDIR) ] || mkdir $(DEPDIR) ./mkunitbl$(EXE) -t -n $@ mkunitbl$(EXE): mkunitbl$(OBJ) $(UOBJ) __SLEEP__ @sleep 1 $(HOSTCC) $(HOSTCOPTS) $(HOSTLDFLAGS) __LNK__ mkunitbl$(OBJ) $(UOBJ) __DJGPP1__ @ren $@ mkunitbl __DJGPP1__ @aout2exe mkunitbl __DJGPP1__ @del mkunitbl __SLEEP__ @sleep 1 mkunitbl$(OBJ): mkunitbl.c $(HOSTCC) $(HOSTCOPTS) $(HOSTCPPFLAGS) -c __OUT__ $*.c tunitbl$(OBJ): unitbl.c $(HOSTCC) $(HOSTCOPTS) $(HOSTCPPFLAGS) -c __OUT__ unitbl.c ############################################################ # Kanji transfer table generating module $(DICTTBL): mkdict$(EXE) $(DICTSRC) ./mkdict$(EXE) __MKDICTOPTION__ $@ $(DICTSRC) dicttbl.c: mkdict$(EXE) $(DICTSRC) ./mkdict$(EXE) __MKDICTOPTION__ -t $@ $(DICTSRC) $(DEPDIR)/dicttbl.c: mkdict$(EXE) $(DICTSRC) [ -d $(DEPDIR) ] || mkdir $(DEPDIR) ./mkdict$(EXE) __MKDICTOPTION__ -t -n $@ $(DICTSRC) mkdict$(EXE): mkdict$(OBJ) $(TOBJ) __SLEEP__ @sleep 1 $(HOSTCC) $(HOSTCOPTS) $(HOSTLDFLAGS) __LNK__ mkdict$(OBJ) $(TOBJ) __DJGPP1__ @ren $@ mkdict __DJGPP1__ @aout2exe mkdict __DJGPP1__ @del mkdict __SLEEP__ @sleep 1 mktankan$(EXE): mktankan$(OBJ) $(TOBJ) __SLEEP__ @sleep 1 $(HOSTCC) $(HOSTCOPTS) $(HOSTLDFLAGS) __LNK__ mktankan$(OBJ) $(TOBJ) __DJGPP1__ @ren $@ mktankan __DJGPP1__ @aout2exe mktankan __DJGPP1__ @del mktankan __SLEEP__ @sleep 1 mkdict$(OBJ): mkdict.c $(HOSTCC) $(HOSTCOPTS) $(HOSTCPPFLAGS) -c __OUT__ $*.c mktankan$(OBJ): mktankan.c $(HOSTCC) $(HOSTCOPTS) $(HOSTCPPFLAGS) -c __OUT__ $*.c tstring$(OBJ): string.c $(HOSTCC) $(HOSTCOPTS) $(HOSTCPPFLAGS) -c __OUT__ string.c troman$(OBJ): roman.c $(HOSTCC) $(HOSTCOPTS) $(HOSTCPPFLAGS) -c __OUT__ roman.c tkconv$(OBJ): kconv.c $(HOSTCC) $(HOSTCOPTS) $(HOSTCPPFLAGS) -c __OUT__ kconv.c tevalopt$(OBJ): evalopt.c $(HOSTCC) $(HOSTCOPTS) $(HOSTCPPFLAGS) -c __OUT__ evalopt.c tgentbl$(OBJ): gentbl.c $(HOSTCC) $(HOSTCOPTS) $(HOSTCPPFLAGS) -c __OUT__ gentbl.c rmdict: -$(RM) $(DICTTBL) $(DICTTXT): mktankan$(EXE) ./mktankan$(EXE) $@ __SLEEP__ @sleep 1 ############################################################ # Directory generating module mkdir_p$(EXE): mkdir_p$(OBJ) __SLEEP__ @sleep 1 $(HOSTCC) $(HOSTCOPTS) $(HOSTLDFLAGS) __LNK__ mkdir_p$(OBJ) __DJGPP1__ @ren $@ mkdir_p __DJGPP1__ @aout2exe mkdir_p __DJGPP1__ @del mkdir_p __SLEEP__ @sleep 1 mkdir_p$(OBJ): mkdir_p.c $(HOSTCC) $(HOSTCOPTS) $(HOSTCPPFLAGS) -c __OUT__ $*.c ############################################################ # to install all install: install-bin install-runcom install-man install-jman install-bin: $(PROGRAM)$(EXE) mkdir_p$(EXE) install-table [ -d $(BINDIR) ] || ./mkdir_p$(EXE) $(BINDIR) $(INSTALL) __INSTSTRIP__ $(PROGRAM)$(EXE) $(BINDIR) $(CHMOD) a+rx $(BINDIR)/$(PROGRAM)$(EXE) -$(RM) $(BINDIR)/$(ALIAS)$(EXE) $(LN) $(BINDIR)/$(PROGRAM)$(EXE) $(BINDIR)/$(ALIAS)$(EXE) $(CHMOD) a+rx $(BINDIR)/$(ALIAS)$(EXE) install-runcom: -if [ -f $(RUNCOM) ]; then \ $(INSTALL) $(RUNCOM) $(BLDRC); \ $(CHMOD) a+r-x $(BLDRC); \ fi install-table: $(TABLE) mkdir_p$(EXE) -if [ -f $(UNITBL) ]; then \ [ -d __DATADIR__ ] || ./mkdir_p$(EXE) __DATADIR__; \ $(INSTALL) $(UNITBL) __DATADIR__; \ $(CHMOD) a+r-x __DATADIR__/$(UNITBL); \ fi -if [ -f $(DICTTBL) ]; then \ [ -d __DATADIR__ ] || ./mkdir_p$(EXE) __DATADIR__; \ $(INSTALL) $(DICTTBL) __DATADIR__; \ $(CHMOD) a+r-x __DATADIR__/$(DICTTBL); \ fi -if [ -f $(CATTBL) ]; then \ [ -d __DATADIR2__ ] || ./mkdir_p$(EXE) __DATADIR2__; \ $(INSTALL) $(CATTBL) __DATADIR2__; \ $(CHMOD) a+r-x __DATADIR2__/$(CATTBL); \ fi -if [ -f $(ECATTBL) ]; then \ [ -d __DATADIR2__ ] || ./mkdir_p$(EXE) __DATADIR2__; \ $(INSTALL) $(ECATTBL) __DATADIR2__; \ $(CHMOD) a+r-x __DATADIR2__/$(ECATTBL); \ fi install-man: $(MANSRC) mkdir_p$(EXE) [ -d $(MANDIR) ] || ./mkdir_p$(EXE) $(MANDIR) $(INSTALL) $(MANSRC) $(MANDIR)/$(PROGRAM).$(MANSEC) $(CHMOD) a+r-x $(MANDIR)/$(PROGRAM).$(MANSEC) -$(RM) $(MANDIR)/$(ALIAS).$(MANSEC) $(LN) $(MANDIR)/$(PROGRAM).$(MANSEC) $(MANDIR)/$(ALIAS).$(MANSEC) $(CHMOD) a+r-x $(MANDIR)/$(ALIAS).$(MANSEC) install-jman: $(PROGRAM).$(MANSEC) mkdir_p$(EXE) [ -d $(JMANDIR) ] || ./mkdir_p$(EXE) $(JMANDIR) [ "$(JMANDIR)" = "$(MANDIR)" ] || \ $(INSTALL) $(PROGRAM).$(MANSEC) $(JMANDIR)/$(PROGRAM).$(MANSEC) $(CHMOD) a+r-x $(JMANDIR)/$(PROGRAM).$(MANSEC) -$(RM) $(JMANDIR)/$(ALIAS).$(MANSEC) $(LN) $(JMANDIR)/$(PROGRAM).$(MANSEC) $(JMANDIR)/$(ALIAS).$(MANSEC) $(CHMOD) a+r-x $(JMANDIR)/$(ALIAS).$(MANSEC) catman: $(MANCAT) mkdir_p$(EXE) [ -d $(CATDIR) ] || ./mkdir_p$(EXE) $(CATDIR) $(INSTALL) $(MANCAT) $(CATDIR)/$(PROGRAM).$(MANSEC) $(CHMOD) a+r-x $(CATDIR)/$(PROGRAM).$(MANSEC) -$(RM) $(CATDIR)/$(ALIAS).$(MANSEC) $(LN) $(CATDIR)/$(PROGRAM).$(MANSEC) $(CATDIR)/$(ALIAS).$(MANSEC) $(CHMOD) a+r-x $(CATDIR)/$(ALIAS).$(MANSEC) catman-b: $(PROGRAM).eng mkdir_p$(EXE) [ -d $(CATDIR) ] || ./mkdir_p$(EXE) $(CATDIR) $(INSTALL) $(PROGRAM).eng $(CATDIR)/$(PROGRAM).$(MANSEC) $(CHMOD) a+r-x $(CATDIR)/$(PROGRAM).$(MANSEC) -$(RM) $(CATDIR)/$(ALIAS).$(MANSEC) $(LN) $(CATDIR)/$(PROGRAM).$(MANSEC) $(CATDIR)/$(ALIAS).$(MANSEC) $(CHMOD) a+r-x $(CATDIR)/$(ALIAS).$(MANSEC) compman: catman -$(RM) $(CATDIR)/$(ALIAS).$(MANSEC) compress -f $(CATDIR)/$(PROGRAM).$(MANSEC) -$(RM) $(CATDIR)/$(ALIAS).$(MANSEC).Z $(LN) $(CATDIR)/$(PROGRAM).$(MANSEC).Z $(CATDIR)/$(ALIAS).$(MANSEC).Z compman-b: catman-b -$(RM) $(CATDIR)/$(ALIAS).$(MANSEC) compress -f $(CATDIR)/$(PROGRAM).$(MANSEC) -$(RM) $(CATDIR)/$(ALIAS).$(MANSEC).Z $(LN) $(CATDIR)/$(PROGRAM).$(MANSEC).Z $(CATDIR)/$(ALIAS).$(MANSEC).Z jcatman: catman $(PROGRAM).$(MANSEC)c mkdir_p$(EXE) [ -d $(JCATDIR) ] || ./mkdir_p$(EXE) $(JCATDIR) $(INSTALL) $(PROGRAM).$(MANSEC)c $(JCATDIR)/$(PROGRAM).$(MANSEC) $(CHMOD) a+r-x $(JCATDIR)/$(PROGRAM).$(MANSEC) -$(RM) $(JCATDIR)/$(ALIAS).$(MANSEC) $(LN) $(JCATDIR)/$(PROGRAM).$(MANSEC) $(JCATDIR)/$(ALIAS).$(MANSEC) $(CHMOD) a+r-x $(JCATDIR)/$(ALIAS).$(MANSEC) jcatman-b: catman-b $(PROGRAM).doc mkdir_p$(EXE) [ -d $(JCATDIR) ] || ./mkdir_p$(EXE) $(JCATDIR) $(INSTALL) $(PROGRAM).doc $(JCATDIR)/$(PROGRAM).$(MANSEC) $(CHMOD) a+r-x $(JCATDIR)/$(PROGRAM).$(MANSEC) -$(RM) $(JCATDIR)/$(ALIAS).$(MANSEC) $(LN) $(JCATDIR)/$(PROGRAM).$(MANSEC) $(JCATDIR)/$(ALIAS).$(MANSEC) $(CHMOD) a+r-x $(JCATDIR)/$(ALIAS).$(MANSEC) jcompman: compman jcatman -$(RM) $(JCATDIR)/$(ALIAS).$(MANSEC) compress -f $(JCATDIR)/$(PROGRAM).$(MANSEC) -$(RM) $(JCATDIR)/$(ALIAS).$(MANSEC).Z $(LN) $(JCATDIR)/$(PROGRAM).$(MANSEC).Z $(JCATDIR)/$(ALIAS).$(MANSEC).Z jcompman-b: compman-b jcatman-b -$(RM) $(JCATDIR)/$(ALIAS).$(MANSEC) compress -f $(JCATDIR)/$(PROGRAM).$(MANSEC) -$(RM) $(JCATDIR)/$(ALIAS).$(MANSEC).Z $(LN) $(JCATDIR)/$(PROGRAM).$(MANSEC).Z $(JCATDIR)/$(ALIAS).$(MANSEC).Z ############################################################ # to make dependency depend: $(SRC) $(HSRC) $(DSRC) config.h kanji.h funcno.h [ -d $(DEPDIR) ] || mkdir $(DEPDIR) for f in $(SRC) $(HSRC); do \ $(SED) -e 's:^\(# *\)include "\(.*\).h":\1include "_\2.h":' \ $${f} > $(DEPDIR)/$${f}; \ done for f in $(DSRC); do \ $(SED) -e 's:^\(# *\)include "\(.*\).h":\1include "_\2.h":' \ $${f} > $${f}o; \ $(MV) $${f}o $${f}; \ done for f in $(SSRC); do \ $(RM) $(DEPDIR)/s$${f}; \ $(LN) $(DEPDIR)/$${f} $(DEPDIR)/s$${f}; \ done for f in $(BSRC); do \ $(RM) $(DEPDIR)/b$${f} && \ $(LN) $(DEPDIR)/$${f} $(DEPDIR)/b$${f}; \ done for f in $(NSRC); do \ $(RM) $(DEPDIR)/n$${f} && \ $(LN) $(DEPDIR)/$${f} $(DEPDIR)/n$${f}; \ done for f in $(TSRC); do \ $(RM) $(DEPDIR)/t$${f} && \ $(LN) $(DEPDIR)/$${f} $(DEPDIR)/t$${f}; \ done for f in $(HEADER) config.h kanji.h funcno.h version.h; do \ $(SED) -e 's:^\(# *\)include "\(.*\).h":\1include "_\2.h":' \ $${f} > $(DEPDIR)/_$${f}; \ done $(CP) Makefile.in Makefile.tmp $(DEPDIR) $(CP) Makefile.tmp $(DEPDIR)/Makefile.sh $(CP) Makefile.tmp $(DEPDIR)/Makefile.bsh $(CP) Makefile.tmp $(DEPDIR)/Makefile.nsh $(CP) Makefile.tmp $(DEPDIR)/Makefile.tr cd $(DEPDIR); makedepend \ -s "# DO NOT DELETE THIS LINE -- make depend depends on it." \ -f Makefile.tmp -- $(FDCFLAGS) -- \ $(SRC) \ `for f in $(DSRC); do $(ECHO) $${f}|$(SED) -e 's:^.*/::'; done` cd $(DEPDIR); makedepend \ -s "# DO NOT DELETE THIS LINE -- make depend depends on it." \ -f Makefile.sh -- $(SHCFLAGS) -- \ `for f in $(SSRC); do $(ECHO) s$${f}; done` cd $(DEPDIR); makedepend \ -s "# DO NOT DELETE THIS LINE -- make depend depends on it." \ -f Makefile.bsh -- $(BSHCFLAGS) -- \ `for f in $(BSRC); do $(ECHO) b$${f}; done` cd $(DEPDIR); makedepend \ -s "# DO NOT DELETE THIS LINE -- make depend depends on it." \ -f Makefile.nsh -- $(NSHCFLAGS) -- \ `for f in $(NSRC); do $(ECHO) n$${f}; done` cd $(DEPDIR); makedepend \ -s "# DO NOT DELETE THIS LINE -- make depend depends on it." \ -f Makefile.tr -- $(HOSTCOPTS) -- \ $(HSRC) \ `for f in $(TSRC); do $(ECHO) t$${f}; done` $(SED) -e '/^# DO NOT DELETE THIS LINE/,$$d' $(DEPDIR)/Makefile.in \ > Makefile.in $(ECHO) "# DO NOT DELETE THIS LINE -- make depend depends on it." \ >> Makefile.in $(SED) -e '1,/^# DO NOT DELETE THIS LINE/d' \ -e 's:^\(........\).*\.o:\1.o:' \ -e 's:\/[^ ]* *::g' \ -e 's:\.o:\$$(OBJ):g' \ -e 's:_\([^ ]*.h\):\1:g' \ -e 's: *$$::' \ -e '/: *$$/d' $(DEPDIR)/Makefile.tmp >> Makefile.in $(SED) -e '1,/^# DO NOT DELETE THIS LINE/d' \ -e 's:^\(........\).*\.o:\1.o:' \ -e 's:\/[^ ]* *::g' \ -e 's:\.o:\$$(OBJ):g' \ -e 's:_\([^ ]*.h\):\1:g' \ -e 's: *$$::' \ -e '/: *$$/d' $(DEPDIR)/Makefile.sh >> Makefile.in $(SED) -e '1,/^# DO NOT DELETE THIS LINE/d' \ -e 's:^\(........\).*\.o:\1.o:' \ -e 's:\/[^ ]* *::g' \ -e 's:\.o:\$$(OBJ):g' \ -e 's:_\([^ ]*.h\):\1:g' \ -e 's: *$$::' \ -e '/: *$$/d' $(DEPDIR)/Makefile.bsh >> Makefile.in $(SED) -e '1,/^# DO NOT DELETE THIS LINE/d' \ -e 's:^\(........\).*\.o:\1.o:' \ -e 's:\/[^ ]* *::g' \ -e 's:\.o:\$$(OBJ):g' \ -e 's:_\([^ ]*.h\):\1:g' \ -e 's: *$$::' \ -e '/: *$$/d' $(DEPDIR)/Makefile.nsh >> Makefile.in $(SED) -e '1,/^# DO NOT DELETE THIS LINE/d' \ -e 's:^\(........\).*\.o:\1.o:' \ -e 's:\/[^ ]* *::g' \ -e 's:\.o:\$$(OBJ):g' \ -e 's:_\([^ ]*.h\):\1:g' \ -e 's: *$$::' \ -e '/: *$$/d' $(DEPDIR)/Makefile.tr >> Makefile.in -rm -rf $(DEPDIR) ############################################################ # to verify sources lint: $(SRC) $(HSRC) config.h kanji.h funcno.h $(LINT) $(OSOPTS) -DFD=$(VERMAJ) `$(SED) -e "s:\$(OBJ):\.c:g" $(ARGS)` SRCS=`$(ECHO) $(UOBJ)|$(SED) -e "s:t\([^ ]*\)\$(OBJ):\1\.c:g"`; \ $(LINT) $(OSOPTS) mkunitbl.c $${SRCS} SRCS=`$(ECHO) $(TOBJ)|$(SED) -e "s:t\([^ ]*\)\$(OBJ):\1\.c:g"`; \ $(LINT) $(OSOPTS) mkdict.c $${SRCS}; \ $(LINT) $(OSOPTS) mktankan.c $${SRCS} $(LINT) $(OSOPTS) mkkanji.c SRCS=`$(ECHO) $(COBJ)|$(SED) -e "s:t\([^ ]*\)\$(OBJ):\1\.c:g"`; \ $(LINT) $(OSOPTS) mkcat.c $${SRCS} $(LINT) $(OSOPTS) mkdir_p.c SRCS=`$(ECHO) $(KOBJ)|$(SED) -e "s:t\([^ ]*\)\$(OBJ):\1\.c:g"`; \ $(LINT) $(OSOPTS) kanjicnv.c $${SRCS} $(LINT) $(OSOPTS) expfunc.c $(LINT) $(OSOPTS) mkfuncno.c ############################################################ # to make configuration file manually config: Configur expfunc.c -if ($(ECHO) 't() { echo $1; }; t test' | $(SHELL) >/dev/null 2>&1); then \ $(SED) -e "2,3d" -e "s:__cc__:__CC__:" Configur \ | $(SHELL) > config.h; \ elif $(MAKE) -f Makefile.tmp expfunc$(EXE); then \ $(SED) -e "2,3d" -e "s:__cc__:__CC__:" Configur \ | ./expfunc$(EXE) | $(SHELL) > config.h; \ fi __SLEEP__ @sleep 1 config.h: config.hin $(CP) config.hin $@ __SLEEP__ @sleep 1 expfunc$(EXE): expfunc$(OBJ) __SLEEP__ @sleep 1 $(HOSTCC) $(HOSTCOPTS) $(HOSTLDFLAGS) __LNK__ expfunc$(OBJ) __DJGPP1__ @ren $@ expfunc __DJGPP1__ @aout2exe expfunc __DJGPP1__ @del expfunc __SLEEP__ @sleep 1 expfunc$(OBJ): expfunc.c $(HOSTCC) $(HOSTCOPTS) $(HOSTCPPFLAGS) -c __OUT__ $*.c ############################################################ # sample program for pseudo system(3) sh: fdsh$(EXE) fdsh$(EXE): $(SOBJ1) $(SOBJ2) $(SARGS) __SLEEP__ @sleep 1 $(CC) __SHMEM__ __LNK__ __SOBJLIST__ $(SLDFLAGS) __DJGPP1__ @ren $@ fdsh __DJGPP1__ @aout2exe fdsh __DJGPP1__ @del fdsh $(SARGS): $(SOBJ1) $(SOBJ2) __SLEEP__ @sleep 1 @$(ECHO) $(SOBJ1) > $(SARGS) @$(ECHO) $(SOBJ2) >> $(SARGS) __SLEEP__ @sleep 1 sprintf$(OBJ): printf.c $(CC) $(SHCFLAGS) -c __OUT__ printf.c stermio$(OBJ): termio.c $(CC) $(SHCFLAGS) __FDSETSIZE__ -c __OUT__ termio.c sstream$(OBJ): stream.c $(CC) $(SHCFLAGS) -c __OUT__ stream.c sstring$(OBJ): string.c $(CC) $(SHCFLAGS) -c __OUT__ string.c smalloc$(OBJ): malloc.c $(CC) $(SHCFLAGS) -c __OUT__ malloc.c stime$(OBJ): time.c $(CC) $(SHCFLAGS) -c __OUT__ time.c spathnam$(OBJ): pathname.c $(CC) $(SHCFLAGS) -c __OUT__ pathname.c ssystem$(OBJ): system.c $(CC) $(SHCFLAGS) -c __OUT__ system.c sposixsh$(OBJ): posixsh.c $(CC) $(SHCFLAGS) -c __OUT__ posixsh.c sdoscom$(OBJ): doscom.c $(CC) $(SHCFLAGS) -c __OUT__ doscom.c ssysemu$(OBJ): sysemu.c $(CC) $(SHCFLAGS) -c __OUT__ sysemu.c ############################################################ # Bourne shell bsh: fdbsh$(EXE) fdbsh$(EXE): $(BOBJ) __SLEEP__ @sleep 1 $(CC) __BSHMEM__ __LNK__ $(BOBJ) $(SLDFLAGS) __DJGPP1__ @ren $@ fdbsh __DJGPP1__ @aout2exe fdbsh __DJGPP1__ @del fdbsh bprintf$(OBJ): printf.c $(CC) $(BSHCFLAGS) -c __OUT__ printf.c btermio$(OBJ): termio.c $(CC) $(BSHCFLAGS) __FDSETSIZE__ -c __OUT__ termio.c bstream$(OBJ): stream.c $(CC) $(BSHCFLAGS) -c __OUT__ stream.c bstring$(OBJ): string.c $(CC) $(BSHCFLAGS) -c __OUT__ string.c bmalloc$(OBJ): malloc.c $(CC) $(BSHCFLAGS) -c __OUT__ malloc.c bpathnam$(OBJ): pathname.c $(CC) $(BSHCFLAGS) -c __OUT__ pathname.c bsystem$(OBJ): system.c $(CC) $(BSHCFLAGS) -c __OUT__ system.c bdoscom$(OBJ): doscom.c $(CC) $(BSHCFLAGS) -c __OUT__ doscom.c bsysemu$(OBJ): sysemu.c $(CC) $(BSHCFLAGS) -c __OUT__ sysemu.c ############################################################ # Network shell nsh: fdnsh$(EXE) fdnsh$(EXE): $(NOBJ1) $(NOBJ2) $(NOBJ3) $(NARGS) __SLEEP__ @sleep 1 $(CC) __NSHMEM__ __LNK__ __NOBJLIST__ $(NLDFLAGS) __DJGPP1__ @ren $@ fdnsh __DJGPP1__ @aout2exe fdnsh __DJGPP1__ @del fdnsh $(NARGS): $(NOBJ1) $(NOBJ2) $(NOBJ3) __SLEEP__ @sleep 1 @$(ECHO) $(NOBJ1) > $(NARGS) @$(ECHO) $(NOBJ2) >> $(NARGS) @$(ECHO) $(NOBJ3) >> $(NARGS) __SLEEP__ @sleep 1 nprintf$(OBJ): printf.c $(CC) $(NSHCFLAGS) -c __OUT__ printf.c ntermio$(OBJ): termio.c $(CC) $(NSHCFLAGS) __FDSETSIZE__ -c __OUT__ termio.c nstream$(OBJ): stream.c $(CC) $(NSHCFLAGS) -c __OUT__ stream.c nstring$(OBJ): string.c $(CC) $(NSHCFLAGS) -c __OUT__ string.c nmalloc$(OBJ): malloc.c $(CC) $(NSHCFLAGS) -c __OUT__ malloc.c ntime$(OBJ): time.c $(CC) $(NSHCFLAGS) -c __OUT__ time.c npathnam$(OBJ): pathname.c $(CC) $(NSHCFLAGS) -c __OUT__ pathname.c nsystem$(OBJ): system.c $(CC) $(NSHCFLAGS) -c __OUT__ system.c nposixsh$(OBJ): posixsh.c $(CC) $(NSHCFLAGS) -c __OUT__ posixsh.c ndoscom$(OBJ): doscom.c $(CC) $(NSHCFLAGS) -c __OUT__ doscom.c nsysemu$(OBJ): sysemu.c $(CC) $(NSHCFLAGS) -c __OUT__ sysemu.c nrealpat$(OBJ): realpath.c $(CC) $(NSHCFLAGS) -c __OUT__ realpath.c nencode$(OBJ): encode.c $(CC) $(NSHCFLAGS) -c __OUT__ encode.c nparse$(OBJ): parse.c $(CC) $(NSHCFLAGS) -c __OUT__ parse.c nsocket$(OBJ): socket.c $(CC) $(NSHCFLAGS) -c __OUT__ socket.c nurl$(OBJ): url.c $(CC) $(NSHCFLAGS) -c __OUT__ url.c nauth$(OBJ): auth.c $(CC) $(NSHCFLAGS) -c __OUT__ auth.c nftp$(OBJ): ftp.c $(CC) $(NSHCFLAGS) -c __OUT__ ftp.c nhtml$(OBJ): html.c $(CC) $(NSHCFLAGS) -c __OUT__ html.c nhttp$(OBJ): http.c $(CC) $(NSHCFLAGS) -c __OUT__ http.c nurldisk$(OBJ): urldisk.c $(CC) $(NSHCFLAGS) -c __OUT__ urldisk.c nlsparse$(OBJ): lsparse.c $(CC) $(NSHCFLAGS) -c __OUT__ lsparse.c ############################################################ # for programer's maintenance tar: $(SOURCES) $(TAR) cvf $(TITLE)$(VERSION).tar $(SOURCES) compress -f $(TITLE)$(VERSION).tar gtar: $(SOURCES) $(TAR) cvf $(TITLE)$(VERSION).tar $(SOURCES) gzip -f $(TITLE)$(VERSION).tar shtar: $(SHSOURCES) (VER=`date '+%y%m%d'`; \ $(TAR) cvf $(TITLE)sh-$${VER}.tar $(SHSOURCES); \ gzip -f $(TITLE)sh-$${VER}.tar) lzh: $(SOURCES) -$(RM) $(TITLE)$(VERSION).lzh $(LHA) a $(TITLE)$(VERSION).lzh $(SOURCES) shar: $(SOURCES) -$(RM) $(TITLE)$(VERSION).shar.[0-9][0-9] $(SHAR) -L50 -apc -n $(TITLE)$(VERSION) -o $(TITLE)$(VERSION).shar \ -T $(SRCS) -C $(JSRCS) ipk: $(PROGRAM)$(EXE) $(TABLES) mkdir_p$(EXE) -[ -d $(IPKWDIR)/$(BINDIR) ] || ./mkdir_p$(EXE) $(IPKWDIR)/$(BINDIR) -[ -d $(IPKWDIR)/__DATADIR__ ] || ./mkdir_p$(EXE) $(IPKWDIR)/__DATADIR__ -[ -d $(IPKWDIR)/__DATADIR2__ ] || ./mkdir_p$(EXE) $(IPKWDIR)/__DATADIR2__ -[ -d $(IPKWDIR)/$(CONFDIR) ] || ./mkdir_p$(EXE) $(IPKWDIR)/$(CONFDIR) -[ -d $(IPKWDIR)/CONTROL ] || ./mkdir_p$(EXE) $(IPKWDIR)/CONTROL -[ -d $(IPKTDIR) ] || ./mkdir_p$(EXE) $(IPKTDIR) $(CP) -p $(PROGRAM)$(EXE) $(IPKWDIR)/$(BINDIR) -[ -z "$(STRIP)" ] || $(STRIP) $(IPKWDIR)/$(BINDIR)/$(PROGRAM)$(EXE) $(CHMOD) a+rx $(IPKWDIR)/$(BINDIR)/$(PROGRAM)$(EXE) -$(RM) $(IPKWDIR)/$(BINDIR)/$(ALIAS)$(EXE) $(LN) $(IPKWDIR)/$(BINDIR)/$(PROGRAM)$(EXE) \ $(IPKWDIR)/$(BINDIR)/$(ALIAS)$(EXE) $(CHMOD) a+rx $(IPKWDIR)/$(BINDIR)/$(ALIAS)$(EXE) $(SED) -e 's:#TMPDIR=.*:TMPDIR=/home/tmp:' \ -e 's:#LANGUAGE=.*:LANGUAGE=euc:' \ -e 's:#INPUTKCODE=.*:INPUTKCODE=euc:' \ -e 's:#FNAMEKCODE=.*:FNAMEKCODE=utf8:' \ -e '/# launcher definition/,/^$$/ {' \ -e '/^$$/ {' \ -e 'i \' \ -e 'launch ".tar.Z" "gzip -cd %C|tar tvf -" "%a %u/%g %s %y-%m-%d %t %*f"' \ -e 'i \' \ -e 'launch ".taZ" "gzip -cd %C|tar tvf -" "%a %u/%g %s %y-%m-%d %t %*f"' \ -e 'i \' \ -e 'launch ".ipk" "gzip -cd %C|tar xOf - ./data.tar.gz|gzip -cd|tar tvf -" \\' \ -e 'i \' \ -e ' "%a %u/%g %s %y-%m-%d %t %*f"' \ -e 'i \' \ -e 'launch ".deb" "ar -p %C data.tar.gz|gzip -cd|tar tvf -" \\' \ -e 'i \' \ -e ' "%a %u/%g %s %y-%m-%d %t %*f"' \ -e '}' \ -e '}' \ -e '/# archiver definition/,/^$$/ {' \ -e '/^$$/ {' \ -e 'i \' \ -e 'arch ".tar.Z" "echo ERROR; false" "gzip -cd %C|tar xf - %TA"' \ -e 'i \' \ -e 'arch ".taZ" "echo ERROR; false" "gzip -cd %C|tar xf - %TA"' \ -e 'i \' \ -e 'arch ".ipk" "echo ERROR; false" \\' \ -e 'i \' \ -e ' "gzip -cd %C|tar xOf - ./data.tar.gz|gzip -cd|tar xf - %TA"' \ -e 'i \' \ -e 'arch ".deb" "echo ERROR; false" \\' \ -e 'i \' \ -e ' "ar -p %C data.tar.gz|gzip -cd|tar xf - %TA"' \ -e '}' \ -e '}' \ -e '$$ {' \ -e 'a \' \ -e 'if [ " $$TERM" = " vt100" -a " $$CONSOLE" = " /dev/console" ]; then' \ -e 'a \' \ -e ' keymap BS "^?"' \ -e 'a \' \ -e ' keymap DEL "\\033[3~"' \ -e 'a \' \ -e ' keymap HOME "\\033[H"' \ -e 'a \' \ -e ' keymap END "\\033[F"' \ -e 'a \' \ -e 'fi' \ -e '}' \ _fdrc > $(IPKWDIR)/$(BLDRC) $(CHMOD) a+r-x $(IPKWDIR)/$(BLDRC) -if [ -f $(UNITBL) ]; then \ cp -p $(UNITBL) $(IPKWDIR)/__DATADIR__; \ $(CHMOD) a+r-x $(IPKWDIR)/__DATADIR__/$(UNITBL); \ fi -if [ -f $(DICTTBL) ]; then \ cp -p $(DICTTBL) $(IPKWDIR)/__DATADIR__; \ $(CHMOD) a+r-x $(IPKWDIR)/__DATADIR__/$(DICTTBL); \ fi -if [ -f $(CATTBL) ]; then \ cp -p $(CATTBL) $(IPKWDIR)/__DATADIR2__; \ $(CHMOD) a+r-x $(IPKWDIR)/__DATADIR2__/$(CATTBL); \ fi -if [ -f $(ECATTBL) ]; then \ cp -p $(ECATTBL) $(IPKWDIR)/__DATADIR2__; \ $(CHMOD) a+r-x $(IPKWDIR)/__DATADIR2__/$(ECATTBL); \ fi $(ECHO) "Package: fd" > $(IPKWDIR)/CONTROL/control $(ECHO) "Priority: optional" >> $(IPKWDIR)/CONTROL/control $(ECHO) "Section: extras" >> $(IPKWDIR)/CONTROL/control $(ECHO) "Maintainer: $(DIST)" >> $(IPKWDIR)/CONTROL/control $(ECHO) "Architecture: arm" >> $(IPKWDIR)/CONTROL/control $(ECHO) "Version: $(VERSION)-1" >> $(IPKWDIR)/CONTROL/control $(ECHO) "Depends: ncurses" >> $(IPKWDIR)/CONTROL/control $(ECHO) "Description: a file & directory maintenance tool." \ >> $(IPKWDIR)/CONTROL/control (cd $(IPKWDIR); tar cf ../data.tar --exclude=CONTROL .) (cd $(IPKWDIR)/CONTROL; tar cf ../../control.tar .) gzip ./data.tar $(MV) ./data.tar.gz $(IPKTDIR) gzip ./control.tar $(MV) ./control.tar.gz $(IPKTDIR) $(ECHO) "2.0" > $(IPKTDIR)/debian-binary (cd $(IPKTDIR); \ tar cf ../ipk.tar ./debian-binary ./data.tar.gz ./control.tar.gz) gzip ./ipk.tar $(MV) ./ipk.tar.gz ./fd_$(VERSION)-1_arm.ipk -$(RM) -r $(IPKWDIR) $(IPKTDIR) clean: -$(RM) core -$(RM) *$(OBJ) -$(RM) funcno.h -$(RM) kanji.h -$(RM) _fd-cat.ja -$(RM) _fd-cat.C -$(RM) fd-cat.* -$(RM) kanjicnv$(EXE) -$(RM) expfunc$(EXE) -$(RM) mkdir_p$(EXE) -$(RM) mkfuncno$(EXE) -$(RM) mkunitbl$(EXE) -$(RM) mkdict$(EXE) -$(RM) mktankan$(EXE) -$(RM) mkkanji$(EXE) -$(RM) mkcat$(EXE) -$(RM) fdsh$(EXE) -$(RM) fdbsh$(EXE) -$(RM) fdnsh$(EXE) -$(RM) $(PROGRAM)$(EXE) -$(RM) $(PROGRAM).$(MANSEC) -$(RM) $(PROGRAM).$(MANSEC)c -$(RM) $(PROGRAM).eng -$(RM) $(PROGRAM).doc -$(RM) $(ARGS) -$(RM) $(SARGS) -$(RM) $(NARGS) -$(RM) $(UNITBL) -$(RM) unitbl.c -$(RM) dicttbl.c -$(RM) $(DICTTXT) -$(RM) $(DICTTBL) # DO NOT DELETE THIS LINE -- make depend depends on it. main$(OBJ): fd.h headers.h machine.h config.h main$(OBJ): depend.h printf.h main$(OBJ): stream.h kctype.h main$(OBJ): string.h malloc.h time.h log.h termio.h main$(OBJ): realpath.h main$(OBJ): parse.h kconv.h func.h sysemu.h dirent.h unixemu.h main$(OBJ): pathname.h main$(OBJ): typesize.h term.h types.h lsparse.h namelist.h dosdisk.h main$(OBJ): kanji.h catalog.h version.h system.h wait.h main$(OBJ): termemu.h roman.h urldisk.h url.h auth.h printf$(OBJ): headers.h machine.h config.h printf$(OBJ): depend.h printf.h stream.h kctype.h printf$(OBJ): typesize.h string.h printf$(OBJ): kconv.h termio$(OBJ): headers.h machine.h config.h termio$(OBJ): depend.h typesize.h sysemu.h dirent.h termio$(OBJ): unixemu.h termio$(OBJ): stream.h termio.h term$(OBJ): headers.h machine.h config.h term$(OBJ): depend.h printf.h term$(OBJ): stream.h kctype.h term$(OBJ): typesize.h string.h termio.h term$(OBJ): term.h stream$(OBJ): headers.h machine.h config.h stream$(OBJ): depend.h typesize.h malloc.h sysemu.h stream$(OBJ): dirent.h unixemu.h stream$(OBJ): stream.h pathname.h termio.h stream$(OBJ): socket.h string$(OBJ): headers.h machine.h config.h string$(OBJ): kctype.h depend.h string$(OBJ): string.h malloc$(OBJ): headers.h machine.h config.h malloc$(OBJ): printf.h stream.h depend.h malloc.h malloc$(OBJ): sysemu.h dirent.h unixemu.h time$(OBJ): headers.h machine.h config.h time$(OBJ): typesize.h time$(OBJ): string.h time.h pathname$(OBJ): fd.h headers.h machine.h config.h pathname$(OBJ): depend.h printf.h stream.h kctype.h pathname$(OBJ): string.h malloc.h pathname$(OBJ): dirent.h unixemu.h pathname$(OBJ): sysemu.h pathname.h typesize.h pathname$(OBJ): url.h system$(OBJ): fd.h headers.h machine.h config.h system$(OBJ): depend.h printf.h stream.h kctype.h system$(OBJ): string.h malloc.h system$(OBJ): term.h types.h typesize.h lsparse.h namelist.h kconv.h system$(OBJ): dirent.h unixemu.h system$(OBJ): sysemu.h system.h pathname.h termio.h system$(OBJ): wait.h system$(OBJ): termemu.h posixsh.h socket.h url.h system$(OBJ): urldisk.h auth.h posixsh$(OBJ): fd.h headers.h machine.h config.h posixsh$(OBJ): depend.h printf.h stream.h kctype.h posixsh$(OBJ): string.h malloc.h posixsh$(OBJ): sysemu.h dirent.h unixemu.h posixsh$(OBJ): system.h pathname.h typesize.h posixsh$(OBJ): termio.h posixsh$(OBJ): wait.h posixsh$(OBJ): termemu.h time.h posixsh.h term.h doscom$(OBJ): fd.h headers.h machine.h config.h doscom$(OBJ): depend.h printf.h stream.h kctype.h doscom$(OBJ): string.h malloc.h doscom$(OBJ): term.h types.h typesize.h lsparse.h namelist.h dirent.h doscom$(OBJ): unixemu.h doscom$(OBJ): sysemu.h system.h pathname.h termio.h doscom$(OBJ): wait.h doscom$(OBJ): realpath.h urldisk.h url.h auth.h log$(OBJ): fd.h headers.h machine.h config.h log$(OBJ): depend.h printf.h log$(OBJ): stream.h kctype.h log$(OBJ): string.h malloc.h func.h sysemu.h dirent.h unixemu.h log$(OBJ): pathname.h log$(OBJ): typesize.h term.h types.h lsparse.h namelist.h dosdisk.h sysemu$(OBJ): fd.h headers.h machine.h config.h sysemu$(OBJ): depend.h printf.h stream.h kctype.h sysemu$(OBJ): string.h malloc.h sysemu$(OBJ): kconv.h sysemu.h dirent.h unixemu.h sysemu$(OBJ): log.h pathname.h typesize.h termio.h sysemu$(OBJ): realpath.h dosdisk.h socket.h sysemu$(OBJ): urldisk.h namelist.h url.h auth.h dosdisk$(OBJ): headers.h machine.h config.h dosdisk$(OBJ): depend.h kctype.h dosdisk$(OBJ): string.h time.h sysemu.h dirent.h dosdisk$(OBJ): unixemu.h dosdisk$(OBJ): stream.h pathname.h typesize.h dosdisk.h unixdisk.h kconv.h unixdisk$(OBJ): headers.h machine.h config.h unixdisk$(OBJ): depend.h kctype.h unixdisk$(OBJ): string.h sysemu.h dirent.h unixemu.h unixdisk$(OBJ): stream.h unixdisk$(OBJ): pathname.h typesize.h dosdisk.h unixdisk.h realpath$(OBJ): fd.h headers.h machine.h config.h realpath$(OBJ): depend.h printf.h stream.h kctype.h realpath$(OBJ): string.h malloc.h realpath$(OBJ): sysemu.h dirent.h unixemu.h realpath$(OBJ): pathname.h typesize.h realpath.h realpath$(OBJ): url.h encode$(OBJ): headers.h machine.h config.h encode$(OBJ): kctype.h depend.h encode$(OBJ): sysemu.h dirent.h unixemu.h encode$(OBJ): stream.h encode$(OBJ): pathname.h typesize.h encode.h libc$(OBJ): fd.h headers.h machine.h config.h libc$(OBJ): depend.h printf.h libc$(OBJ): stream.h kctype.h libc$(OBJ): string.h malloc.h log.h realpath.h parse.h kconv.h func.h libc$(OBJ): sysemu.h dirent.h unixemu.h libc$(OBJ): pathname.h typesize.h term.h types.h libc$(OBJ): lsparse.h namelist.h dosdisk.h kanji.h catalog.h system.h libc$(OBJ): termio.h libc$(OBJ): wait.h libc$(OBJ): termemu.h url.h file$(OBJ): fd.h headers.h machine.h config.h file$(OBJ): depend.h printf.h file$(OBJ): stream.h kctype.h file$(OBJ): string.h malloc.h time.h termio.h file$(OBJ): realpath.h file$(OBJ): kconv.h func.h sysemu.h dirent.h unixemu.h file$(OBJ): pathname.h typesize.h term.h types.h file$(OBJ): lsparse.h namelist.h dosdisk.h kanji.h catalog.h urldisk.h file$(OBJ): url.h auth.h mntinfo$(OBJ): headers.h machine.h config.h mntinfo$(OBJ): kctype.h depend.h mntinfo$(OBJ): string.h malloc.h pathname.h mntinfo$(OBJ): typesize.h mntinfo.h fsinfo.h statfs$(OBJ): headers.h machine.h config.h statfs$(OBJ): fsinfo.h apply$(OBJ): fd.h headers.h machine.h config.h apply$(OBJ): depend.h printf.h stream.h kctype.h apply$(OBJ): string.h malloc.h apply$(OBJ): time.h realpath.h parse.h func.h sysemu.h dirent.h unixemu.h apply$(OBJ): pathname.h apply$(OBJ): typesize.h term.h types.h lsparse.h namelist.h dosdisk.h apply$(OBJ): kanji.h catalog.h pty$(OBJ): fd.h headers.h machine.h config.h pty$(OBJ): depend.h printf.h pty$(OBJ): stream.h kctype.h pty$(OBJ): string.h malloc.h sysemu.h dirent.h unixemu.h pty$(OBJ): pathname.h pty$(OBJ): typesize.h termio.h termemu$(OBJ): fd.h headers.h machine.h config.h termemu$(OBJ): depend.h printf.h stream.h kctype.h termemu$(OBJ): string.h malloc.h termemu$(OBJ): wait.h unixemu.h termio.h termemu$(OBJ): func.h sysemu.h dirent.h termemu$(OBJ): pathname.h termemu$(OBJ): typesize.h term.h types.h lsparse.h namelist.h dosdisk.h termemu$(OBJ): kanji.h catalog.h system.h termemu.h frontend$(OBJ): fd.h headers.h machine.h config.h frontend$(OBJ): depend.h printf.h stream.h kctype.h frontend$(OBJ): string.h malloc.h frontend$(OBJ): wait.h unixemu.h parse.h func.h frontend$(OBJ): sysemu.h dirent.h frontend$(OBJ): pathname.h typesize.h term.h frontend$(OBJ): types.h lsparse.h namelist.h dosdisk.h funcno.h kanji.h frontend$(OBJ): catalog.h system.h termio.h frontend$(OBJ): termemu.h frontend$(OBJ): roman.h backend$(OBJ): fd.h headers.h machine.h config.h backend$(OBJ): depend.h printf.h stream.h kctype.h backend$(OBJ): string.h malloc.h backend$(OBJ): termio.h backend$(OBJ): kconv.h func.h sysemu.h backend$(OBJ): dirent.h unixemu.h backend$(OBJ): pathname.h typesize.h term.h types.h backend$(OBJ): lsparse.h namelist.h dosdisk.h system.h wait.h backend$(OBJ): termemu.h parse$(OBJ): fd.h headers.h machine.h config.h parse$(OBJ): depend.h printf.h stream.h kctype.h parse$(OBJ): string.h malloc.h parse$(OBJ): pathname.h typesize.h term.h types.h lsparse.h namelist.h parse$(OBJ): kconv.h sysemu.h dirent.h unixemu.h parse$(OBJ): realpath.h parse.h system.h termio.h parse$(OBJ): wait.h builtin$(OBJ): fd.h headers.h machine.h config.h builtin$(OBJ): depend.h printf.h stream.h kctype.h builtin$(OBJ): string.h malloc.h builtin$(OBJ): encode.h parse.h kconv.h func.h sysemu.h dirent.h unixemu.h builtin$(OBJ): pathname.h builtin$(OBJ): typesize.h term.h types.h lsparse.h namelist.h dosdisk.h builtin$(OBJ): funcno.h kanji.h catalog.h system.h termio.h builtin$(OBJ): wait.h builtin$(OBJ): termemu.h roman.h shell$(OBJ): fd.h headers.h machine.h config.h shell$(OBJ): depend.h printf.h stream.h kctype.h shell$(OBJ): string.h malloc.h shell$(OBJ): realpath.h parse.h kconv.h func.h sysemu.h dirent.h unixemu.h shell$(OBJ): pathname.h shell$(OBJ): typesize.h term.h types.h lsparse.h namelist.h dosdisk.h shell$(OBJ): kanji.h catalog.h system.h termio.h shell$(OBJ): wait.h shell$(OBJ): termemu.h socket$(OBJ): headers.h machine.h config.h socket$(OBJ): depend.h printf.h stream.h kctype.h socket$(OBJ): typesize.h malloc.h socket$(OBJ): sysemu.h dirent.h unixemu.h socket$(OBJ): termio.h socket$(OBJ): socket.h url$(OBJ): headers.h machine.h config.h url$(OBJ): depend.h printf.h url$(OBJ): stream.h kctype.h url$(OBJ): typesize.h string.h malloc.h sysemu.h dirent.h unixemu.h url$(OBJ): pathname.h url.h auth$(OBJ): headers.h machine.h config.h auth$(OBJ): depend.h printf.h auth$(OBJ): stream.h string.h malloc.h time.h pathname.h typesize.h auth$(OBJ): encode.h parse.h socket.h auth.h url.h auth$(OBJ): system.h termio.h auth$(OBJ): wait.h auth$(OBJ): unixemu.h kanji.h catalog.h ftp$(OBJ): headers.h machine.h config.h ftp$(OBJ): depend.h printf.h ftp$(OBJ): stream.h kctype.h ftp$(OBJ): string.h malloc.h time.h sysemu.h dirent.h unixemu.h ftp$(OBJ): pathname.h ftp$(OBJ): typesize.h termio.h ftp$(OBJ): parse.h ftp$(OBJ): lsparse.h namelist.h socket.h auth.h ftp$(OBJ): url.h urldisk.h html$(OBJ): headers.h machine.h config.h html$(OBJ): depend.h printf.h html$(OBJ): stream.h kctype.h html$(OBJ): typesize.h string.h malloc.h sysemu.h dirent.h unixemu.h html$(OBJ): pathname.h termio.h html$(OBJ): parse.h html.h urldisk.h html$(OBJ): namelist.h url.h auth.h http$(OBJ): headers.h machine.h config.h http$(OBJ): depend.h printf.h http$(OBJ): stream.h kctype.h http$(OBJ): string.h malloc.h time.h sysemu.h dirent.h unixemu.h http$(OBJ): pathname.h http$(OBJ): typesize.h termio.h http$(OBJ): parse.h http$(OBJ): lsparse.h namelist.h socket.h auth.h http$(OBJ): url.h html.h urldisk.h urldisk$(OBJ): headers.h machine.h config.h urldisk$(OBJ): depend.h printf.h stream.h string.h urldisk$(OBJ): malloc.h time.h sysemu.h dirent.h unixemu.h urldisk$(OBJ): pathname.h urldisk$(OBJ): typesize.h termio.h urldisk$(OBJ): realpath.h urldisk$(OBJ): lsparse.h namelist.h socket.h urldisk$(OBJ): urldisk.h url.h auth.h catalog$(OBJ): fd.h headers.h machine.h config.h catalog$(OBJ): depend.h printf.h stream.h kctype.h catalog$(OBJ): string.h malloc.h catalog$(OBJ): termio.h catalog$(OBJ): func.h sysemu.h dirent.h catalog$(OBJ): unixemu.h catalog$(OBJ): pathname.h typesize.h term.h types.h lsparse.h namelist.h catalog$(OBJ): dosdisk.h kanji.h catalog.h kconv$(OBJ): fd.h headers.h machine.h config.h kconv$(OBJ): depend.h printf.h stream.h kctype.h kconv$(OBJ): string.h malloc.h kconv$(OBJ): termio.h kconv$(OBJ): realpath.h parse.h func.h kconv$(OBJ): sysemu.h dirent.h unixemu.h kconv$(OBJ): pathname.h typesize.h term.h types.h kconv$(OBJ): lsparse.h namelist.h dosdisk.h kconv.h termemu.h input$(OBJ): fd.h headers.h machine.h config.h input$(OBJ): depend.h printf.h stream.h kctype.h input$(OBJ): string.h malloc.h input$(OBJ): wait.h unixemu.h parse.h kconv.h func.h input$(OBJ): sysemu.h dirent.h input$(OBJ): pathname.h typesize.h term.h types.h lsparse.h namelist.h input$(OBJ): dosdisk.h kanji.h catalog.h system.h termio.h input$(OBJ): termemu.h ime$(OBJ): fd.h headers.h machine.h config.h ime$(OBJ): depend.h printf.h ime$(OBJ): stream.h kctype.h ime$(OBJ): string.h malloc.h wait.h unixemu.h ime$(OBJ): parse.h kconv.h roman.h func.h sysemu.h dirent.h ime$(OBJ): pathname.h ime$(OBJ): typesize.h term.h types.h lsparse.h namelist.h dosdisk.h ime$(OBJ): kanji.h catalog.h termemu.h dict$(OBJ): fd.h headers.h machine.h config.h dict$(OBJ): depend.h printf.h dict$(OBJ): stream.h kctype.h dict$(OBJ): string.h malloc.h termio.h dict$(OBJ): roman.h dict$(OBJ): hinsi.h func.h sysemu.h dirent.h unixemu.h dict$(OBJ): pathname.h typesize.h term.h types.h dict$(OBJ): lsparse.h namelist.h dosdisk.h parse.h kconv.h roman$(OBJ): headers.h machine.h config.h roman$(OBJ): depend.h kctype.h roman$(OBJ): typesize.h string.h kconv.h roman.h info$(OBJ): fd.h headers.h machine.h config.h info$(OBJ): depend.h printf.h info$(OBJ): stream.h kctype.h info$(OBJ): string.h malloc.h dirent.h unixemu.h info$(OBJ): sysemu.h pathname.h typesize.h term.h info$(OBJ): types.h lsparse.h namelist.h funcno.h kanji.h catalog.h info$(OBJ): unixdisk.h mntinfo.h fsinfo.h rockridg$(OBJ): fd.h headers.h machine.h config.h rockridg$(OBJ): depend.h printf.h stream.h kctype.h rockridg$(OBJ): string.h malloc.h rockridg$(OBJ): device.h parse.h func.h sysemu.h dirent.h unixemu.h rockridg$(OBJ): pathname.h rockridg$(OBJ): typesize.h term.h types.h lsparse.h namelist.h dosdisk.h tree$(OBJ): fd.h headers.h machine.h config.h tree$(OBJ): depend.h printf.h tree$(OBJ): stream.h kctype.h tree$(OBJ): string.h malloc.h func.h sysemu.h dirent.h unixemu.h tree$(OBJ): pathname.h tree$(OBJ): typesize.h term.h types.h lsparse.h namelist.h dosdisk.h tree$(OBJ): kanji.h catalog.h lsparse$(OBJ): fd.h headers.h machine.h config.h lsparse$(OBJ): depend.h printf.h stream.h kctype.h lsparse$(OBJ): string.h malloc.h lsparse$(OBJ): time.h dirent.h unixemu.h lsparse$(OBJ): pathname.h typesize.h device.h lsparse$(OBJ): parse.h lsparse.h namelist.h kconv.h archive$(OBJ): fd.h headers.h machine.h config.h archive$(OBJ): depend.h printf.h stream.h kctype.h archive$(OBJ): string.h malloc.h archive$(OBJ): realpath.h kconv.h func.h sysemu.h dirent.h unixemu.h archive$(OBJ): pathname.h archive$(OBJ): typesize.h term.h types.h lsparse.h namelist.h dosdisk.h archive$(OBJ): kanji.h catalog.h system.h termio.h archive$(OBJ): wait.h archive$(OBJ): termemu.h custom$(OBJ): fd.h headers.h machine.h config.h custom$(OBJ): depend.h printf.h stream.h kctype.h custom$(OBJ): string.h malloc.h custom$(OBJ): parse.h kconv.h func.h sysemu.h dirent.h unixemu.h custom$(OBJ): pathname.h custom$(OBJ): typesize.h term.h types.h lsparse.h namelist.h dosdisk.h custom$(OBJ): funcno.h kanji.h catalog.h system.h termio.h custom$(OBJ): wait.h custom$(OBJ): termemu.h urldisk.h url.h auth.h command$(OBJ): fd.h headers.h machine.h config.h command$(OBJ): depend.h printf.h stream.h kctype.h command$(OBJ): string.h malloc.h command$(OBJ): parse.h func.h sysemu.h dirent.h unixemu.h command$(OBJ): pathname.h command$(OBJ): typesize.h term.h types.h lsparse.h namelist.h dosdisk.h command$(OBJ): funcno.h kanji.h catalog.h system.h termio.h command$(OBJ): wait.h command$(OBJ): termemu.h functabl.h browse$(OBJ): fd.h headers.h machine.h config.h browse$(OBJ): depend.h printf.h stream.h kctype.h browse$(OBJ): string.h malloc.h browse$(OBJ): device.h parse.h kconv.h func.h sysemu.h dirent.h unixemu.h browse$(OBJ): pathname.h browse$(OBJ): typesize.h term.h types.h lsparse.h namelist.h dosdisk.h browse$(OBJ): funcno.h kanji.h catalog.h termemu.h unitbl$(OBJ): headers.h machine.h config.h dicttbl$(OBJ): headers.h machine.h config.h sprintf$(OBJ): headers.h machine.h config.h sprintf$(OBJ): depend.h printf.h stream.h kctype.h sprintf$(OBJ): typesize.h string.h stermio$(OBJ): headers.h machine.h config.h stermio$(OBJ): depend.h typesize.h sysemu.h dirent.h stermio$(OBJ): unixemu.h stermio$(OBJ): stream.h termio.h sstream$(OBJ): headers.h machine.h config.h sstream$(OBJ): depend.h typesize.h malloc.h sysemu.h sstream$(OBJ): dirent.h unixemu.h sstream$(OBJ): stream.h pathname.h termio.h sstring$(OBJ): headers.h machine.h config.h sstring$(OBJ): kctype.h depend.h sstring$(OBJ): string.h smalloc$(OBJ): headers.h machine.h config.h smalloc$(OBJ): printf.h stream.h depend.h malloc.h smalloc$(OBJ): sysemu.h dirent.h unixemu.h stime$(OBJ): headers.h machine.h config.h stime$(OBJ): typesize.h string.h time.h spathnam$(OBJ): headers.h machine.h config.h spathnam$(OBJ): depend.h spathnam$(OBJ): printf.h stream.h kctype.h spathnam$(OBJ): string.h malloc.h dirent.h unixemu.h spathnam$(OBJ): sysemu.h spathnam$(OBJ): pathname.h typesize.h ssystem$(OBJ): headers.h machine.h config.h ssystem$(OBJ): depend.h printf.h stream.h kctype.h ssystem$(OBJ): string.h malloc.h ssystem$(OBJ): dirent.h unixemu.h ssystem$(OBJ): sysemu.h system.h pathname.h ssystem$(OBJ): typesize.h termio.h ssystem$(OBJ): wait.h ssystem$(OBJ): termemu.h time.h posixsh.h sposixsh$(OBJ): headers.h machine.h config.h sposixsh$(OBJ): depend.h printf.h stream.h kctype.h sposixsh$(OBJ): string.h malloc.h sposixsh$(OBJ): sysemu.h dirent.h unixemu.h sposixsh$(OBJ): system.h pathname.h typesize.h sposixsh$(OBJ): termio.h sposixsh$(OBJ): wait.h sposixsh$(OBJ): termemu.h time.h posixsh.h sdoscom$(OBJ): headers.h machine.h config.h sdoscom$(OBJ): depend.h printf.h stream.h kctype.h sdoscom$(OBJ): string.h malloc.h sdoscom$(OBJ): dirent.h unixemu.h sdoscom$(OBJ): sysemu.h system.h pathname.h sdoscom$(OBJ): typesize.h termio.h sdoscom$(OBJ): wait.h ssysemu$(OBJ): headers.h machine.h config.h ssysemu$(OBJ): depend.h printf.h stream.h kctype.h ssysemu$(OBJ): string.h malloc.h ssysemu$(OBJ): sysemu.h dirent.h unixemu.h ssysemu$(OBJ): log.h pathname.h typesize.h termio.h ssysemu$(OBJ): realpath.h bprintf$(OBJ): headers.h machine.h config.h bprintf$(OBJ): depend.h printf.h stream.h kctype.h bprintf$(OBJ): typesize.h string.h btermio$(OBJ): headers.h machine.h config.h btermio$(OBJ): depend.h typesize.h sysemu.h dirent.h btermio$(OBJ): unixemu.h btermio$(OBJ): stream.h termio.h bstream$(OBJ): headers.h machine.h config.h bstream$(OBJ): depend.h typesize.h malloc.h sysemu.h bstream$(OBJ): dirent.h unixemu.h bstream$(OBJ): stream.h pathname.h termio.h bstring$(OBJ): headers.h machine.h config.h bstring$(OBJ): kctype.h depend.h bstring$(OBJ): string.h bmalloc$(OBJ): headers.h machine.h config.h bmalloc$(OBJ): printf.h stream.h depend.h malloc.h bmalloc$(OBJ): sysemu.h dirent.h unixemu.h bpathnam$(OBJ): headers.h machine.h config.h bpathnam$(OBJ): depend.h bpathnam$(OBJ): printf.h stream.h kctype.h bpathnam$(OBJ): string.h malloc.h dirent.h unixemu.h bpathnam$(OBJ): sysemu.h bpathnam$(OBJ): pathname.h typesize.h bsystem$(OBJ): headers.h machine.h config.h bsystem$(OBJ): depend.h printf.h stream.h kctype.h bsystem$(OBJ): string.h malloc.h bsystem$(OBJ): dirent.h unixemu.h bsystem$(OBJ): sysemu.h system.h pathname.h bsystem$(OBJ): typesize.h termio.h bsystem$(OBJ): wait.h bsystem$(OBJ): termemu.h bdoscom$(OBJ): headers.h machine.h config.h bdoscom$(OBJ): depend.h printf.h stream.h kctype.h bdoscom$(OBJ): string.h malloc.h bdoscom$(OBJ): dirent.h unixemu.h bdoscom$(OBJ): sysemu.h system.h pathname.h bdoscom$(OBJ): typesize.h termio.h bdoscom$(OBJ): wait.h bsysemu$(OBJ): headers.h machine.h config.h bsysemu$(OBJ): depend.h printf.h stream.h kctype.h bsysemu$(OBJ): string.h malloc.h bsysemu$(OBJ): sysemu.h dirent.h unixemu.h bsysemu$(OBJ): log.h pathname.h typesize.h termio.h bsysemu$(OBJ): realpath.h nprintf$(OBJ): headers.h machine.h config.h nprintf$(OBJ): depend.h printf.h stream.h kctype.h nprintf$(OBJ): typesize.h string.h ntermio$(OBJ): headers.h machine.h config.h ntermio$(OBJ): depend.h typesize.h sysemu.h dirent.h ntermio$(OBJ): unixemu.h ntermio$(OBJ): stream.h termio.h nstream$(OBJ): headers.h machine.h config.h nstream$(OBJ): depend.h typesize.h malloc.h sysemu.h nstream$(OBJ): dirent.h unixemu.h nstream$(OBJ): stream.h pathname.h termio.h nstream$(OBJ): socket.h nstring$(OBJ): headers.h machine.h config.h nstring$(OBJ): kctype.h depend.h nstring$(OBJ): string.h nmalloc$(OBJ): headers.h machine.h config.h nmalloc$(OBJ): printf.h stream.h depend.h malloc.h nmalloc$(OBJ): sysemu.h dirent.h unixemu.h ntime$(OBJ): headers.h machine.h config.h ntime$(OBJ): typesize.h string.h time.h npathnam$(OBJ): headers.h machine.h config.h npathnam$(OBJ): depend.h npathnam$(OBJ): printf.h stream.h kctype.h npathnam$(OBJ): string.h malloc.h dirent.h unixemu.h npathnam$(OBJ): sysemu.h npathnam$(OBJ): pathname.h typesize.h url.h nsystem$(OBJ): headers.h machine.h config.h nsystem$(OBJ): depend.h printf.h stream.h kctype.h nsystem$(OBJ): string.h malloc.h nsystem$(OBJ): dirent.h unixemu.h nsystem$(OBJ): sysemu.h system.h pathname.h nsystem$(OBJ): typesize.h termio.h nsystem$(OBJ): wait.h nsystem$(OBJ): termemu.h time.h posixsh.h socket.h nsystem$(OBJ): url.h urldisk.h namelist.h auth.h nposixsh$(OBJ): headers.h machine.h config.h nposixsh$(OBJ): depend.h printf.h stream.h kctype.h nposixsh$(OBJ): string.h malloc.h nposixsh$(OBJ): sysemu.h dirent.h unixemu.h nposixsh$(OBJ): system.h pathname.h typesize.h nposixsh$(OBJ): termio.h nposixsh$(OBJ): wait.h nposixsh$(OBJ): termemu.h time.h posixsh.h ndoscom$(OBJ): headers.h machine.h config.h ndoscom$(OBJ): depend.h printf.h stream.h kctype.h ndoscom$(OBJ): string.h malloc.h ndoscom$(OBJ): dirent.h unixemu.h ndoscom$(OBJ): sysemu.h system.h pathname.h ndoscom$(OBJ): typesize.h termio.h ndoscom$(OBJ): wait.h ndoscom$(OBJ): realpath.h urldisk.h namelist.h url.h ndoscom$(OBJ): auth.h nsysemu$(OBJ): headers.h machine.h config.h nsysemu$(OBJ): depend.h printf.h stream.h kctype.h nsysemu$(OBJ): string.h malloc.h nsysemu$(OBJ): sysemu.h dirent.h unixemu.h nsysemu$(OBJ): log.h pathname.h typesize.h termio.h nsysemu$(OBJ): realpath.h socket.h nsysemu$(OBJ): urldisk.h namelist.h url.h auth.h nrealpat$(OBJ): headers.h machine.h config.h nrealpat$(OBJ): depend.h nrealpat$(OBJ): printf.h stream.h kctype.h nrealpat$(OBJ): string.h sysemu.h dirent.h unixemu.h nrealpat$(OBJ): pathname.h nrealpat$(OBJ): typesize.h realpath.h url.h nencode$(OBJ): headers.h machine.h config.h nencode$(OBJ): kctype.h depend.h nencode$(OBJ): sysemu.h dirent.h unixemu.h nencode$(OBJ): stream.h nencode$(OBJ): pathname.h typesize.h encode.h nparse$(OBJ): headers.h machine.h config.h nparse$(OBJ): depend.h printf.h stream.h kctype.h nparse$(OBJ): string.h malloc.h nparse$(OBJ): sysemu.h dirent.h unixemu.h nparse$(OBJ): realpath.h parse.h system.h nparse$(OBJ): pathname.h typesize.h termio.h nparse$(OBJ): wait.h nsocket$(OBJ): headers.h machine.h config.h nsocket$(OBJ): depend.h printf.h stream.h kctype.h nsocket$(OBJ): typesize.h malloc.h nsocket$(OBJ): sysemu.h dirent.h unixemu.h nsocket$(OBJ): termio.h nsocket$(OBJ): socket.h nurl$(OBJ): headers.h machine.h config.h nurl$(OBJ): depend.h printf.h nurl$(OBJ): stream.h kctype.h nurl$(OBJ): typesize.h string.h malloc.h sysemu.h dirent.h unixemu.h nurl$(OBJ): pathname.h url.h nauth$(OBJ): headers.h machine.h config.h nauth$(OBJ): depend.h printf.h stream.h string.h nauth$(OBJ): malloc.h time.h pathname.h typesize.h encode.h parse.h nauth$(OBJ): socket.h auth.h url.h system.h nauth$(OBJ): termio.h nauth$(OBJ): wait.h unixemu.h nauth$(OBJ): sysemu.h dirent.h nftp$(OBJ): headers.h machine.h config.h nftp$(OBJ): depend.h printf.h nftp$(OBJ): stream.h kctype.h nftp$(OBJ): string.h malloc.h time.h sysemu.h dirent.h unixemu.h nftp$(OBJ): pathname.h nftp$(OBJ): typesize.h termio.h nftp$(OBJ): parse.h nftp$(OBJ): lsparse.h namelist.h socket.h auth.h nftp$(OBJ): url.h urldisk.h nhtml$(OBJ): headers.h machine.h config.h nhtml$(OBJ): depend.h printf.h stream.h kctype.h nhtml$(OBJ): typesize.h string.h nhtml$(OBJ): malloc.h sysemu.h dirent.h unixemu.h nhtml$(OBJ): pathname.h termio.h nhtml$(OBJ): parse.h html.h urldisk.h nhtml$(OBJ): namelist.h url.h auth.h nhttp$(OBJ): headers.h machine.h config.h nhttp$(OBJ): depend.h printf.h stream.h kctype.h nhttp$(OBJ): string.h malloc.h nhttp$(OBJ): time.h sysemu.h dirent.h unixemu.h nhttp$(OBJ): pathname.h typesize.h termio.h nhttp$(OBJ): parse.h lsparse.h namelist.h nhttp$(OBJ): socket.h auth.h url.h html.h nhttp$(OBJ): urldisk.h nurldisk$(OBJ): headers.h machine.h config.h nurldisk$(OBJ): depend.h printf.h stream.h string.h nurldisk$(OBJ): malloc.h time.h sysemu.h dirent.h unixemu.h nurldisk$(OBJ): pathname.h nurldisk$(OBJ): typesize.h termio.h nurldisk$(OBJ): realpath.h nurldisk$(OBJ): lsparse.h namelist.h socket.h nurldisk$(OBJ): urldisk.h url.h auth.h nlsparse$(OBJ): headers.h machine.h config.h nlsparse$(OBJ): depend.h kctype.h nlsparse$(OBJ): string.h malloc.h time.h dirent.h nlsparse$(OBJ): unixemu.h nlsparse$(OBJ): pathname.h typesize.h device.h parse.h lsparse.h namelist.h evalopt$(OBJ): headers.h machine.h config.h evalopt$(OBJ): evalopt.h gentbl$(OBJ): headers.h machine.h config.h gentbl$(OBJ): gentbl.h mkunitbl$(OBJ): headers.h machine.h config.h mkunitbl$(OBJ): typesize.h evalopt.h gentbl.h mkdict$(OBJ): headers.h machine.h config.h mkdict$(OBJ): kctype.h depend.h mkdict$(OBJ): typesize.h string.h kconv.h roman.h mkdict$(OBJ): hinsi.h evalopt.h gentbl.h mktankan$(OBJ): headers.h machine.h config.h mktankan$(OBJ): kctype.h depend.h mktankan$(OBJ): typesize.h kconv.h roman.h mkkanji$(OBJ): headers.h machine.h config.h mkkanji$(OBJ): typesize.h mkcat$(OBJ): headers.h machine.h config.h mkcat$(OBJ): kctype.h depend.h mkcat$(OBJ): typesize.h version.h evalopt.h gentbl.h mkdir_p$(OBJ): headers.h machine.h config.h mkdir_p$(OBJ): kctype.h depend.h mkdir_p$(OBJ): typesize.h kanjicnv$(OBJ): headers.h machine.h config.h kanjicnv$(OBJ): evalopt.h expfunc$(OBJ): headers.h machine.h config.h mkfuncno$(OBJ): fd.h headers.h machine.h config.h mkfuncno$(OBJ): depend.h types.h typesize.h stream.h mkfuncno$(OBJ): lsparse.h namelist.h functabl.h tstring$(OBJ): headers.h machine.h config.h tstring$(OBJ): kctype.h depend.h tstring$(OBJ): string.h troman$(OBJ): headers.h machine.h config.h troman$(OBJ): depend.h kctype.h troman$(OBJ): typesize.h string.h kconv.h roman.h tkconv$(OBJ): headers.h machine.h config.h tkconv$(OBJ): depend.h kctype.h tkconv$(OBJ): typesize.h string.h unixemu.h kconv.h tkconv$(OBJ): termemu.h pathname.h tevalopt$(OBJ): headers.h machine.h config.h tevalopt$(OBJ): evalopt.h tgentbl$(OBJ): headers.h machine.h config.h tgentbl$(OBJ): gentbl.h tunitbl$(OBJ): headers.h machine.h config.h FD-3.01j/main.c100644 2105 1751 72115 13516612560 11777 0ustar shiraiuser/* * FD (File & Directory maintenance tool) * * by T.Shirai */ #include "fd.h" #include "time.h" #include "log.h" #include "termio.h" #include "realpath.h" #include "parse.h" #include "kconv.h" #include "func.h" #include "kanji.h" #include "version.h" #include "system.h" #include "termemu.h" #ifdef DEP_IME #include "roman.h" #endif #ifdef DEP_URLPATH #include "urldisk.h" #endif #if MSDOS #include # ifndef DJGPP # include # endif #endif /* !MSDOS */ #define CLOCKUPDATE 10 /* sec */ #define SWITCHUSER "su" #ifndef BINDIR #define BINDIR "/usr/local/bin" #endif #ifndef DATADIR #define DATADIR progpath #endif #ifndef DEFPATH #define DEFPATH ":/bin:/usr/bin" #endif #ifdef DEP_ORIGSHELL #define isorgpid() (mypid == orgpid) #else #define isorgpid() (1) #endif #ifdef __TURBOC__ extern u_int _stklen = 0x5800; #define harderr_t void #else #define harderr_t int #endif typedef struct _sigfunc_t { int sig; int (*func)__P_((VOID_A)); } sigfunc_t; #if MSDOS # ifndef BSPATHDELIM extern char *adjustpname __P_((char *)); # endif # if defined (DJGPP) || !defined (BSPATHDELIM) extern char *adjustfname __P_((char *)); # endif #endif /* MSDOS */ #if defined (DEP_ORIGSHELL) && !defined (NOJOB) extern VOID killjob __P_((VOID_A)); #endif #ifndef DEP_ORIGSHELL extern char **environ; extern char **environ2; #endif extern bindlist_t bindlist; extern int maxbind; #if defined (DEP_DYNAMICLIST) || !defined (_NOCUSTOMIZE) extern origbindlist_t origbindlist; extern int origmaxbind; #endif #ifndef _NOARCHIVE extern launchlist_t launchlist; extern int maxlaunch; extern archivelist_t archivelist; extern int maxarchive; # if defined (DEP_DYNAMICLIST) || !defined (_NOCUSTOMIZE) extern origlaunchlist_t origlaunchlist; extern int origmaxlaunch; extern origarchivelist_t origarchivelist; extern int origmaxarchive; # endif #endif /* !_NOARCHIVE */ extern helpindex_t helpindex; #if defined (DEP_DYNAMICLIST) || !defined (_NOCUSTOMIZE) extern orighelpindex_t orighelpindex; #endif extern int wheader; extern char fullpath[]; extern short savehist[]; extern int subwindow; extern int win_x; extern int win_y; #ifndef _NOCUSTOMIZE extern int custno; #endif extern char *deftmpdir; #ifdef DEP_IME extern char *dicttblpath; #endif #if MSDOS && !defined (PROTECTED_MODE) static harderr_t far criticalerror __P_((u_int, u_int, u_short far *)); #endif #ifndef DEP_ORIGSHELL static VOID NEAR Xexit2 __P_((int)); #endif static VOID NEAR signalexit __P_((int)); #ifdef SIGALRM static int ignore_alrm __P_((VOID_A)); #endif #ifdef SIGWINCH static int ignore_winch __P_((VOID_A)); #endif #ifdef SIGINT static int ignore_int __P_((VOID_A)); #endif #ifdef SIGQUIT static int ignore_quit __P_((VOID_A)); #endif #ifdef SIGCONT static int ignore_cont __P_((VOID_A)); #endif #ifdef SIGHUP static int hanguperror __P_((VOID_A)); #endif #ifdef SIGILL static int illerror __P_((VOID_A)); #endif #ifdef SIGTRAP static int traperror __P_((VOID_A)); #endif #ifdef SIGIOT static int ioerror __P_((VOID_A)); #endif #ifdef SIGEMT static int emuerror __P_((VOID_A)); #endif #ifdef SIGFPE static int floaterror __P_((VOID_A)); #endif #ifdef SIGBUS static int buserror __P_((VOID_A)); #endif #ifdef SIGSEGV static int segerror __P_((VOID_A)); #endif #ifdef SIGSYS static int syserror __P_((VOID_A)); #endif #ifdef SIGPIPE static int pipeerror __P_((VOID_A)); #endif #ifdef SIGTERM static int terminate __P_((VOID_A)); #endif #ifdef SIGXCPU static int xcpuerror __P_((VOID_A)); #endif #ifdef SIGXFSZ static int xsizerror __P_((VOID_A)); #endif static int NEAR minrow __P_((int)); #ifndef _NOEXTRAWIN static int NEAR biaswsize __P_((int, int)); #endif #ifdef SIGWINCH static int wintr __P_((VOID_A)); #endif static VOID NEAR printtime __P_((int)); #ifdef SIGALRM static int trapalrm __P_((VOID_A)); #endif #ifdef DEP_DOSDRIVE static int dos_intrkey __P_((VOID_A)); #endif static int read_intrkey __P_((VOID_A)); #ifdef DEP_LOGGING static VOID NEAR startlog __P_((char *CONST *)); static VOID NEAR endlog __P_((int)); #endif #ifndef DEP_ORIGSHELL static int NEAR execruncomline __P_((char *, CONST char *, int, CONST char *)); #endif static int NEAR initoption __P_((int, char *CONST [])); static int NEAR evaloption __P_((char *CONST [])); static char *NEAR searchenv __P_((CONST char *, char *CONST [])); #if !MSDOS static char *NEAR searchexecname __P_((CONST char *, char *CONST [])); #endif static VOID NEAR setexecname __P_((CONST char *)); static VOID NEAR setexecpath __P_((CONST char *, char *CONST [])); int main __P_((int, char *CONST [], char *CONST [])); char *origpath = NULL; char *progpath = NULL; char *progname = NULL; char *tmpfilename = NULL; #if !MSDOS int adjtty = 0; #endif int showsecond = 0; int hideclock = 0; #ifdef SIGALRM int noalrm = 1; #endif int fd_restricted = 0; #if !defined (_NOCUSTOMIZE) && !defined (_NOKEYMAP) keyseq_t *origkeymaplist = NULL; #endif int inruncom = 0; #ifdef DEP_ORIGSHELL int fdmode = 0; #endif static int timersec = 0; #ifdef SIGWINCH static int nowinch = 0; #endif static CONST sigfunc_t sigfunclist[] = { #ifdef SIGINT {SIGINT, ignore_int}, #endif #ifdef SIGQUIT {SIGQUIT, ignore_quit}, #endif #ifdef SIGCONT {SIGCONT, ignore_cont}, #endif #ifdef SIGHUP {SIGHUP, hanguperror}, #endif #ifdef SIGILL {SIGILL, illerror}, #endif #ifdef SIGTRAP {SIGTRAP, traperror}, #endif #ifdef SIGIOT {SIGIOT, ioerror}, #endif #ifdef SIGEMT {SIGEMT, emuerror}, #endif #ifdef SIGFPE {SIGFPE, floaterror}, #endif #ifdef SIGBUS {SIGBUS, buserror}, #endif #ifdef SIGSEGV {SIGSEGV, segerror}, #endif #ifdef SIGSYS {SIGSYS, syserror}, #endif #ifdef SIGPIPE {SIGPIPE, pipeerror}, #endif #ifdef SIGTERM {SIGTERM, terminate}, #endif #ifdef SIGXCPU {SIGXCPU, xcpuerror}, #endif #ifdef SIGXFSZ {SIGXFSZ, xsizerror}, #endif {-1, NULL} }; #if MSDOS && !defined (PROTECTED_MODE) /*ARGSUSED*/ static harderr_t far criticalerror(deverr, errval, devhdr) u_int deverr, errval; u_short far *devhdr; { if ((deverr & 0x8800) == 0x0800) _hardresume(_HARDERR_FAIL); _hardresume(_HARDERR_ABORT); } #endif VOID error(s) CONST char *s; { static int doing = 0; int duperrno; if (doing > 1) exit(2); if (doing) exit2(2); duperrno = errno; doing++; sigvecset(0); if (isorgpid()) { forcecleandir(deftmpdir, tmpfilename); #ifdef DEP_DOSDRIVE VOID_C dosallclose(); #endif #ifdef DEP_URLPATH VOID_C urlallclose(); #endif Xstdiomode(); endterm(); } if (!s) s = progname; if (dumbterm <= 2) VOID_C Xfputc('\007', Xstderr); errno = duperrno; if (errno) perror2(s); else errputs(s, 1); VOID_C Xfclose(Xstderr); doing++; if (isorgpid()) { inittty(1); keyflush(); prepareexitfd(2); #ifdef DEP_ORIGSHELL # ifndef NOJOB killjob(); # endif prepareexit(0); #endif /* DEP_ORIGSHELL */ #ifdef DEP_PTY killallpty(); #endif #ifdef DEBUG # if !MSDOS freeterment(); # endif closetty(&ttyio, &ttyout); muntrace(); #endif /* DEBUG */ } exit(2); } #ifndef DEP_ORIGSHELL static VOID NEAR Xexit2(n) int n; { prepareexitfd(n); exit2(n); } #endif /* !DEP_ORIGSHELL */ static VOID NEAR signalexit(sig) int sig; { VOID_C signal2(sig, SIG_IGN); if (isorgpid()) { printf_urgent++; forcecleandir(deftmpdir, tmpfilename); #ifdef DEP_DOSDRIVE VOID_C dosallclose(); #endif #ifdef DEP_URLPATH VOID_C urlallclose(); #endif #ifdef DEP_LOGGING endlog(sig + 128); #endif endterm(); inittty(1); keyflush(); #ifdef DEP_ORIGSHELL # if defined (SIGHUP) && !defined (NOJOB) if (sig == SIGHUP) killjob(); # endif prepareexit(0); #endif /* DEP_ORIGSHELL */ #ifdef DEP_PTY killallpty(); #endif #ifdef DEBUG # if !MSDOS freeterment(); # endif closetty(&ttyio, &ttyout); muntrace(); #endif /* DEBUG */ printf_urgent--; } VOID_C signal2(sig, SIG_DFL); VOID_C kill(getpid(), sig); } #ifdef SIGALRM static int ignore_alrm(VOID_A) { int duperrno; duperrno = errno; VOID_C signal2(SIGALRM, (sigcst_t)ignore_alrm); errno = duperrno; return(0); } #endif /* SIGALRM */ #ifdef SIGWINCH static int ignore_winch(VOID_A) { int duperrno; duperrno = errno; VOID_C signal2(SIGWINCH, (sigcst_t)ignore_winch); errno = duperrno; return(0); } #endif /* SIGWINCH */ #ifdef SIGINT static int ignore_int(VOID_A) { int duperrno; duperrno = errno; VOID_C signal2(SIGINT, (sigcst_t)ignore_int); errno = duperrno; return(0); } #endif /* SIGINT */ #ifdef SIGQUIT static int ignore_quit(VOID_A) { int duperrno; duperrno = errno; VOID_C signal2(SIGQUIT, (sigcst_t)ignore_quit); errno = duperrno; return(0); } #endif /* SIGQUIT */ #ifdef SIGCONT static int ignore_cont(VOID_A) { int duperrno; duperrno = errno; VOID_C signal2(SIGCONT, (sigcst_t)ignore_cont); # if !MSDOS suspended = 1; # ifdef DEP_ORIGSHELL sigconted = 1; # endif # endif /* !MSDOS */ errno = duperrno; return(0); } #endif /* SIGCONT */ #ifdef SIGHUP static int hanguperror(VOID_A) { signalexit(SIGHUP); return(0); } #endif #ifdef SIGILL static int illerror(VOID_A) { signalexit(SIGILL); return(0); } #endif #ifdef SIGTRAP static int traperror(VOID_A) { signalexit(SIGTRAP); return(0); } #endif #ifdef SIGIOT static int ioerror(VOID_A) { signalexit(SIGIOT); return(0); } #endif #ifdef SIGEMT static int emuerror(VOID_A) { signalexit(SIGEMT); return(0); } #endif #ifdef SIGFPE static int floaterror(VOID_A) { signalexit(SIGFPE); return(0); } #endif #ifdef SIGBUS static int buserror(VOID_A) { signalexit(SIGBUS); return(0); } #endif #ifdef SIGSEGV static int segerror(VOID_A) { signalexit(SIGSEGV); return(0); } #endif #ifdef SIGSYS static int syserror(VOID_A) { signalexit(SIGSYS); return(0); } #endif #ifdef SIGPIPE static int pipeerror(VOID_A) { signalexit(SIGPIPE); return(0); } #endif #ifdef SIGTERM static int terminate(VOID_A) { signalexit(SIGTERM); return(0); } #endif #ifdef SIGXCPU static int xcpuerror(VOID_A) { signalexit(SIGXCPU); return(0); } #endif #ifdef SIGXFSZ static int xsizerror(VOID_A) { signalexit(SIGXFSZ); return(0); } #endif VOID setlinecol(VOID_A) { char buf[MAXLONGWIDTH + 1]; if (getconstvar(ENVLINES)) { VOID_C Xsnprintf(buf, sizeof(buf), "%d", n_line); setenv2(ENVLINES, buf, 1); } if (getconstvar(ENVCOLUMNS)) { VOID_C Xsnprintf(buf, sizeof(buf), "%d", n_column); setenv2(ENVCOLUMNS, buf, 1); } } static int NEAR minrow(n) int n; { if (n == win) { #ifndef _NOTREE if (treepath) return(WFILEMINTREE); #endif #ifndef _NOCUSTOMIZE if (custno >= 0) return(WFILEMINCUSTOM); #endif } return(WFILEMIN); } #ifndef _NOEXTRAWIN static int NEAR biaswsize(n, max) int n, max; { int i, row, min; for (i = row = 0; i < n; i++) row += winvar[i].v_fileperrow + 1; min = minrow(n); if (max - row < min) { winvar[n].v_fileperrow = min; return(max - min); } winvar[n].v_fileperrow = max - row; return(0); } #endif /* !_NOEXTRAWIN */ VOID checkscreen(xmax, ymax) int xmax, ymax; { CONST char *cp; char *tty; int i, row, wastty, dupn_line, dupdumbterm; if (ttyio < 0) return; #ifdef SIGWINCH nowinch++; #endif dupn_line = -1; #ifdef DEP_PTY if (parentfd >= 0) row = WFILEMIN; else #endif { row = wheader + WFOOTER; #ifdef _NOEXTRAWIN row += (minrow(win) + 1) * windows; #else for (i = 0; i < windows; i++) row += minrow(i) + 1; #endif row--; } savetermio(ttyio, &tty, NULL); wastty = isttyiomode; Xttyiomode(1); dupdumbterm = dumbterm; if (xmax < 0 || ymax < 0) { dupn_line = n_line; xmax = WCOLUMNMIN; ymax = 0; dumbterm = 1; } for (i = 0;; i++) { if (!(cp = getwsize(xmax, ymax))) { if (n_line >= row) break; cp = "Line size is too small for operation."; } if (!i) { Xputterms(T_CLEAR); Xlocate(0, 0); keyflush(); } if (i & 1) cp = "Terminate with the ESC key, or widen a screen."; Xattrputs(cp, !(i & 1)); Xputterm(T_BELL); Xcputnl(); Xtflush(); if (kbhit2(1000000L) && getkey3(0, inputkcode, 0) == K_ESC) { errno = 0; error("Interrupted by the ESC key."); } } dumbterm = dupdumbterm; loadtermio(ttyio, tty, NULL); isttyiomode = wastty; Xfree(tty); setlinecol(); if (n_line != dupn_line) { #ifdef _NOEXTRAWIN calcwin(); #else row = fileperrow(1); for (i = windows - 1; i >= 0; i--) { if (!(row = biaswsize(i, row))) break; row--; } #endif } #ifdef SIGWINCH nowinch--; #endif } #ifdef SIGWINCH VOID pollscreen(forced) int forced; { static int winched = 0; int x, y; if (forced < 0) nowinch = winched = 0; else if (nowinch) { if (forced) winched++; } else if (winched || forced) { winched = 0; x = n_column; y = n_line; checkscreen(-1, -1); # ifdef DEP_ORIGSHELL if (shellmode || !isorgpid()) /*EMPTY*/; else # endif { if (x != n_column || y != n_line) rewritefile(1); if (subwindow) VOID_C ungetkey2(K_CTRL('L'), 1); } } } static int wintr(VOID_A) { sigblk_t old; int duperrno; duperrno = errno; suspendsignal(SIGWINCH, (sigcst_t)wintr, &old); pollscreen(1); resumesignal(SIGWINCH, &old); errno = duperrno; return(0); } #endif /* SIGWINCH */ static VOID NEAR printtime(hide) int hide; { static time_t now; struct tm *tm; int x; if (timersec) now++; else { now = Xtime(NULL); timersec = CLOCKUPDATE; } if (timersec-- < CLOCKUPDATE && !showsecond) return; #ifdef DEP_PTY if (checkallpty() < 0) rewritefile(0); if (isptymode() && !ptyinternal && hide <= 1) hide = 0; #endif if (hide) return; #ifdef DEBUG _mtrace_file = "localtime(start)"; tm = localtime(&now); if (_mtrace_file) _mtrace_file = NULL; else { _mtrace_file = "localtime(end)"; malloc(0); /* dummy malloc */ } #else tm = localtime(&now); #endif x = n_column - 15 - ((showsecond) ? 3 : 0); if (!isleftshift()) x--; Xlocate(x, L_TITLE); Xputterm(T_STANDOUT); VOID_C XXcprintf("%02d-%02d-%02d %02d:%02d", tm -> tm_year % 100, tm -> tm_mon + 1, tm -> tm_mday, tm -> tm_hour, tm -> tm_min); if (showsecond) VOID_C XXcprintf(":%02d", tm -> tm_sec); Xputterm(END_STANDOUT); Xlocate(win_x, win_y); Xtflush(); } #ifdef SIGALRM static int trapalrm(VOID_A) { sigblk_t old; int duperrno; duperrno = errno; suspendsignal(SIGALRM, (sigcst_t)trapalrm, &old); # if defined (DEP_ORIGSHELL) && defined (DEP_PTY) if (isshptymode()) { if (mypid == shellpid) printtime(hideclock); } else # endif if (isorgpid()) printtime(hideclock); # ifdef SIGWINCH pollscreen(0); # endif resumesignal(SIGALRM, &old); errno = duperrno; return(0); } #endif /* SIGALRM */ #ifdef DEP_DOSDRIVE static int dos_intrkey(VOID_A) { return(intrkey(-1)); } #endif static int read_intrkey(VOID_A) { if (isttyiomode) return(intrkey(K_ESC)); return(0); } int sigvecset(set) int set; { static int status = -1; int old; old = status; if (set == old) /*EMPTY*/; else if (set) { #ifdef SIGALRM VOID_C signal2(SIGALRM, (sigcst_t)trapalrm); noalrm = 0; #endif #ifdef SIGTSTP VOID_C signal2(SIGTSTP, SIG_IGN); #endif #ifdef SIGWINCH VOID_C signal2(SIGWINCH, (sigcst_t)wintr); #endif #ifdef DEP_DOSDRIVE doswaitfunc = waitmes; dosintrfunc = dos_intrkey; #endif #ifdef DEP_LSPARSE lsintrfunc = read_intrkey; #endif #ifndef NOSELECT readintrfunc = read_intrkey; #endif status = 1; } else { #ifdef SIGALRM VOID_C signal2(SIGALRM, (sigcst_t)ignore_alrm); noalrm = 1; #endif #ifdef SIGTSTP VOID_C signal2(SIGTSTP, SIG_DFL); #endif #ifdef SIGWINCH VOID_C signal2(SIGWINCH, (sigcst_t)ignore_winch); #endif #ifdef DEP_DOSDRIVE doswaitfunc = NULL; dosintrfunc = NULL; #endif status = 0; } return(old); } char *getversion(lenp) int *lenp; { char *cp, *eol; cp = Xstrchr(version, ' '); while (*(++cp) == ' '); if (lenp) { if (!(eol = Xstrchr(cp, ' '))) eol = cp + strlen(cp); *lenp = eol - cp; } return(cp); } VOID title(VOID_A) { CONST char *cp; int n, len; Xlocate(0, L_TITLE); Xputterm(T_STANDOUT); len = 0; if (!isleftshift()) { VOID_C XXputch(' '); len++; } XXcputs(" FD"); len += 3; if (!ishardomit()) { XXcputs("(File & Directory tool)"); len += 23; } XXcputs(" Ver."); len += 5; cp = getversion(&n); cputstr(n, cp); if (distributor) { VOID_C XXputch('#'); n++; } cp = (iswellomit()) ? nullstr : " (c)1995-2019 T.Shirai "; XXcputs(cp); n = n_column - len - strlen2(cp) - n; while (n-- > 0) VOID_C XXputch(' '); Xputterm(END_STANDOUT); timersec = 0; printtime(0); } #ifndef _NOCUSTOMIZE VOID saveorigenviron(VOID_A) { # if FD >= 3 char *cp; int n; # endif # ifndef _NOKEYMAP origkeymaplist = copykeyseq(NULL); # endif # ifndef DEP_DYNAMICLIST orighelpindex = copystrarray(NULL, helpindex, NULL, MAXHELPINDEX); origbindlist = copybind(NULL, bindlist, &origmaxbind, maxbind); # ifndef _NOARCHIVE origlaunchlist = copylaunch(NULL, launchlist, &origmaxlaunch, maxlaunch); origarchivelist = copyarch(NULL, archivelist, &origmaxarchive, maxarchive); # endif # ifdef DEP_DOSEMU origfdtype = copydosdrive(NULL, fdtype, &origmaxfdtype, maxfdtype); # endif # endif /* !DEP_DYNAMICLIST */ # if FD >= 3 cp = getversion(&n); cp = Xstrndup(cp, n); setenv2(FDVERSION, cp, 0); Xfree(cp); # endif } #endif /* !_NOCUSTOMIZE */ #ifdef DEP_LOGGING static VOID NEAR startlog(argv) char *CONST *argv; { # ifndef NOUID uid_t uid; int lvl; # endif char *cp, *tmp, buf[MAXLOGLEN + 1]; int i, len; cp = buf; for (i = 1; argv && argv[i]; i++) { if (cp > buf) *(cp++) = ' '; tmp = killmeta(argv[i]); len = Xsnprintf(cp, (int)sizeof(buf) - (cp - buf), "%s", tmp); Xfree(tmp); if (len < 0) break; #ifdef CODEEUC len = strlen(cp); #endif cp += len; } *cp = '\0'; cp = getversion(&len); # ifdef NOUID logmessage(_LOG_DEBUG_, "%s (%-*.*s) starts; PWD=%k; ARGS=%k", progname, len, len, cp, origpath, buf); # else lvl = ((uid = getuid())) ? _LOG_DEBUG_ : _LOG_WARNING_; logmessage(lvl, "%s (%-*.*s) starts; UID=%d; PWD=%k; ARGS=%k", progname, len, len, cp, (int)uid, origpath, buf); # endif } static VOID NEAR endlog(status) int status; { # ifndef NOUID uid_t uid; int lvl; # endif char cwd[MAXPATHLEN]; if (!Xgetwd(cwd)) Xstrcpy(cwd, "?"); # ifdef NOUID logmessage(_LOG_DEBUG_, "%s ends; PWD=%k; STATUS=%d", progname, cwd, status); # else lvl = ((uid = getuid())) ? _LOG_DEBUG_ : _LOG_WARNING_; logmessage(lvl, "%s ends; UID=%d; PWD=%k; STATUS=%d", progname, (int)uid, cwd, status); # endif logclose(); } #endif /* DEP_LOGGING */ #ifndef DEP_ORIGSHELL static int NEAR execruncomline(command, file, n, line) char *command; CONST char *file; int n; CONST char *line; { char *cp; int i; if (!*(cp = skipspace(command))) i = 0; else i = execpseudoshell(cp, F_IGNORELIST | F_NOCOMLINE); if (i) { Xputterm(L_CLEAR); VOID_C XXcprintf("%s, line %d: %k", file, n, ILFNC_K); Xcputnl(); Xputterm(L_CLEAR); VOID_C XXcprintf("\t%s", line); Xcputnl(); } Xfree(command); return((i) ? -1 : 0); } #endif /* !DEP_ORIGSHELL */ /*ARGSUSED*/ int loadruncom(file, exist) CONST char *file; int exist; { #ifndef DEP_ORIGSHELL # if !MSDOS struct stat st; # endif XFILE *fp; char *cp, *tmp, *fold, *line; int cont, siz; #endif /* !DEP_ORIGSHELL */ int n, er; #ifdef DEP_ORIGSHELL if ((n = isttyiomode)) Xstdiomode(); er = execruncom(file, 1); if (n) Xttyiomode(n - 1); #else /* !DEP_ORIGSHELL */ # if !MSDOS tmp = NULL; if (!exist && (tmp = getconstvar(ENVTERM))) { cp = Xmalloc(strlen(file) + strlen(tmp) + 1 + 1); Xstrcpy(Xstrcpy(Xstrcpy(cp, file), "."), tmp); tmp = evalpath(cp, 0); if (stat2(tmp, &st) < 0 || !s_isreg(&st)) { Xfree(tmp); tmp = NULL; } } if (!tmp) # endif /* !MSDOS */ tmp = evalpath(Xstrdup(file), 0); fp = Xfopen(tmp, "r"); if (!fp) { if (!exist) { Xfree(tmp); return(0); } VOID_C XXcprintf("%s: Not found", tmp); Xcputnl(); Xfree(tmp); return(-1); } fold = NULL; n = er = 0; while ((line = Xfgets(fp))) { n++; if (*line == ';' || *line == '#') { Xfree(line); continue; } cp = line + strlen(line); for (cp--; cp >= line; cp--) if (!Xisblank(*cp)) break; cp[1] = '\0'; cont = 0; if (cp >= line && *cp == ESCAPE && (cp - 1 < line || *(cp - 1) != ESCAPE) && !onkanji1(line, cp - line - 1)) { *cp = '\0'; cont = 1; } if (!fold) fold = line; else if (*line) { siz = strlen(fold) + strlen(line); fold = Xrealloc(fold, siz + 1); VOID_C Xstrlcat(fold, line, siz); } if (cont) { if (fold != line) Xfree(line); continue; } if (execruncomline(fold, tmp, n, line) < 0) er++; if (fold != line) Xfree(line); fold = NULL; } if (fold && execruncomline(fold, tmp, n, line) < 0) er++; VOID_C Xfclose(fp); Xfree(tmp); #endif /* !DEP_ORIGSHELL */ return(er ? -1 : 0); } static int NEAR initoption(argc, argv) int argc; char *CONST argv[]; { char *cp, **optv; int i, optc; optc = 1; optv = (char **)Xmalloc((argc + 1) * sizeof(char *)); optv[0] = argv[0]; for (i = 1; i < argc; i++) { if (argv[i][0] == '+') /*EMPTY*/; else if (argv[i][0] != '-' || !argv[i][1] || (argv[i][1] == '-' && !argv[i][2])) break; else if (!isidentchar(argv[i][1])) /*EMPTY*/; else { for (cp = &(argv[i][2]); *cp; cp++) if (!isidentchar2(*cp)) break; if (*cp == '=') continue; } optv[optc++] = argv[i]; memmove((char *)&(argv[i]), (char *)&(argv[i + 1]), (argc-- - i) * sizeof(char *)); i--; } optv[optc] = NULL; #ifdef DEP_ORIGSHELL if (initshell(optc, optv) < 0) Xexit2(RET_FAIL); #endif Xfree(optv); return(argc); } static int NEAR evaloption(argv) char *CONST argv[]; { char *cp, *tmp; int i; for (i = 1; argv[i]; i++) { if (argv[i][0] != '-') break; if (!argv[i][1] || (argv[i][1] == '-' && !argv[i][2])) { i++; break; } tmp = Xstrdup(&(argv[i][1])); if ((cp = Xstrchr(tmp, '='))) *(cp++) = '\0'; setenv2(tmp, cp, 0); Xfree(tmp); } return(i); } static char *NEAR searchenv(s, envp) CONST char *s; char *CONST envp[]; { int i, len; len = strlen(s); for (i = 0; envp[i]; i++) if (!strnenvcmp(envp[i], s, len) && envp[i][len] == '=') return(&(envp[i][++len])); return(NULL); } #if !MSDOS static char *NEAR searchexecname(argv, envp) CONST char *argv; char *CONST envp[]; { CONST char *s, *env; char *cp; int n; n = 0; if (!(env = searchenv(ENVPATH, envp))) env = DEFPATH; s = progname; if (*s == '-') s++; if (strpathcmp(s, SWITCHUSER)) { if ((cp = searchexecpath(argv, env))) return(cp); if (*argv == '-') { if ((cp = searchexecpath(++argv, env))) return(cp); n++; } if (*argv == 'r' && (cp = searchexecpath(++argv, env))) return(cp); if ((cp = searchexecpath(FDSHELL, env))) return(cp); if ((cp = searchexecpath(FDPROG, env))) return(cp); if (!n) return(NULL); } getlogininfo(NULL, &s); return(Xstrdup(s)); } #endif /* !MSDOS */ static VOID NEAR setexecname(argv) CONST char *argv; { #if MSDOS || defined (CYGWIN) char *cp; #endif progname = getbasename(argv); #if MSDOS || defined (CYGWIN) if ((cp = Xstrchr(progname, '.')) && cp > progname) progname = Xstrndup(progname, cp - progname); else #endif progname = Xstrdup(progname); } static VOID NEAR setexecpath(argv, envp) CONST char *argv; char *CONST envp[]; { CONST char *cp; char *tmp, buf[MAXPATHLEN]; if (!Xgetwd(buf)) { errno = 0; error("No current working directory."); } origpath = Xstrdup(buf); if ((cp = searchenv(ENVPWD, envp))) { *fullpath = '\0'; VOID_C Xrealpath(cp, fullpath, 0); VOID_C Xrealpath(fullpath, buf, RLP_READLINK); if (!strpathcmp(origpath, buf)) { Xfree(origpath); origpath = Xstrdup(fullpath); } } Xstrcpy(fullpath, origpath); tmp = NULL; #if MSDOS cp = argv; #else if (strdelim(argv, 0)) cp = argv; else cp = tmp = searchexecname(argv, envp); if (!cp) progpath = Xstrdup(BINDIR); else #endif { VOID_C Xrealpath(cp, buf, RLP_READLINK); Xfree(tmp); if ((tmp = strrdelim(buf, 0))) *tmp = '\0'; progpath = Xstrdup(buf); } } /*ARGSUSED*/ VOID initfd(argv) char *CONST *argv; { int i; #ifdef DEP_ORIGSHELL if (!interactive) /*EMPTY*/; else #endif { #if !MSDOS if (adjtty) { Xstdiomode(); inittty(0); Xttyiomode(0); } #endif /* !MSDOS */ for (i = 0; i < 2; i++) loadhistory(i); VOID_C entryhist(origpath, HST_PATH | HST_UNIQ); } #ifdef DEP_LOGGING startlog(argv); #endif } /*ARGSUSED*/ VOID prepareexitfd(status) int status; { char cwd[MAXPATHLEN]; int i; #ifdef DEP_LOGGING endlog(status); #endif #ifdef DEP_ORIGSHELL if (!interactive) /*EMPTY*/; else #endif for (i = 0; i < 2; i++) savehistory(i); cwd[0] = '\0'; if (origpath && _chdir2(origpath) < 0) { perror2(origpath); if (!Xgetwd(cwd)) *cwd = '\0'; VOID_C rawchdir(rootpath); } Xfree(origpath); Xfree(progname); #ifdef DEP_UNICODE Xfree(unitblpath); #endif #ifdef DEP_IME Xfree(dicttblpath); #endif #ifndef _NOCATALOG Xfree(cattblpath); #endif #ifdef DEP_DOSDRIVE VOID_C dosallclose(); #endif #ifdef DEP_URLPATH VOID_C urlallclose(); #endif Xfree(progpath); #ifdef DEBUG Xfree(tmpfilename); tmpfilename = NULL; # ifndef DEP_ORIGSHELL freevar(environ); freevar(environ2); # endif # ifndef _NOCUSTOMIZE # ifndef _NOKEYMAP freekeyseq(origkeymaplist); # endif # ifndef DEP_DYNAMICLIST freestrarray(orighelpindex, MAXHELPINDEX); Xfree(orighelpindex); Xfree(origbindlist); # ifndef _NOARCHIVE freelaunchlist(origlaunchlist, origmaxlaunch); Xfree(origlaunchlist); freearchlist(origarchivelist, origmaxarchive); Xfree(origarchivelist); # endif # ifdef DEP_DOSEMU freedosdrive(origfdtype, origmaxfdtype); Xfree(origfdtype); # endif # endif /* !DEP_DYNAMICLIST */ # endif /* !_NOCUSTOMIZE */ freeenvpath(); freehistory(0); freehistory(1); freedefine(); # ifndef NOUID freeidlist(); # endif chdir2(NULL); # if !defined (_NOUSEHASH) && !defined (DEP_ORIGSHELL) VOID_C searchhash(NULL, NULL, NULL); # endif # ifndef _NOROCKRIDGE detranspath(NULL, NULL); # endif # ifdef DEP_UNICODE discardunitable(); # endif # ifdef DEP_IME ime_freebuf(); freeroman(0); discarddicttable(); # endif #endif /* DEBUG */ #ifndef _NOCATALOG freecatalog(); #endif if (*cwd) VOID_C rawchdir(cwd); } int main(argc, argv, envp) int argc; char *CONST argv[], *CONST envp[]; { char *cp; int i; #ifndef NOFLOCK stream_isnfsfunc = isnfs; #endif #ifdef DEBUG mtrace(); #endif #if MSDOS && (defined (DJGPP) || !defined (BSPATHDELIM)) adjustfname(argv[0]); #endif setexecname(argv[0]); #if MSDOS && !defined (PROTECTED_MODE) _harderr(criticalerror); #endif for (i = 0; i < arraysize(sigfunclist); i++) { VOID_C signal2(sigfunclist[i].sig, (sigcst_t)(sigfunclist[i].func)); } sigvecset(0); VOID_C entryhist(NULL, HST_INIT); #ifdef DEP_DYNAMICLIST helpindex = copystrarray(NULL, orighelpindex, NULL, MAXHELPINDEX); for (i = 0; origbindlist[i].key >= 0; i++) /*EMPTY*/; origmaxbind = i; bindlist = copybind(NULL, origbindlist, &maxbind, origmaxbind); # ifndef _NOARCHIVE for (i = 0; origlaunchlist[i].ext; i++) /*EMPTY*/; origmaxlaunch = i; launchlist = copylaunch(NULL, origlaunchlist, &maxlaunch, origmaxlaunch); for (i = 0; origarchivelist[i].ext; i++) /*EMPTY*/; origmaxarchive = i; archivelist = copyarch(NULL, origarchivelist, &maxarchive, origmaxarchive); # endif # ifdef DEP_DOSEMU for (i = 0; origfdtype[i].name; i++) /*EMPTY*/; origmaxfdtype = i; fdtype = copydosdrive(NULL, origfdtype, &maxfdtype, origmaxfdtype); # endif #else /* !DEP_DYNAMICLIST */ copystrarray(helpindex, helpindex, NULL, MAXHELPINDEX); for (i = 0; i < MAXBINDTABLE && bindlist[i].key >= 0; i++) /*EMPTY*/; maxbind = i; # ifndef _NOARCHIVE for (i = 0; i < MAXLAUNCHTABLE && launchlist[i].ext; i++) /*EMPTY*/; maxlaunch = i; copylaunch(launchlist, launchlist, &maxlaunch, maxlaunch); for (i = 0; i < MAXARCHIVETABLE && archivelist[i].ext; i++) /*EMPTY*/; maxarchive = i; copyarch(archivelist, archivelist, &maxarchive, maxarchive); # endif # ifdef DEP_DOSEMU for (i = 0; i < MAXDRIVEENTRY && fdtype[i].name; i++) /*EMPTY*/; maxfdtype = i; copydosdrive(fdtype, fdtype, &maxfdtype, maxfdtype); # endif #endif /* !DEP_DYNAMICLIST */ #ifndef DEP_ORIGSHELL i = countvar(envp); environ = (char **)Xmalloc((i + 1) * sizeof(char *)); for (i = 0; envp[i]; i++) environ[i] = Xstrdup(envp[i]); environ[i] = NULL; #endif setexecpath(argv[0], envp); #ifdef DEP_UNICODE unitblpath = Xstrdup(DATADIR); #endif #ifdef DEP_IME dicttblpath = Xstrdup(DATADIR); #endif #ifndef _NOCATALOG # ifdef USEDATADIR cp = getversion(&i); cattblpath = Xmalloc(strsize(DATADIR) + 1 + i + 1); VOID_C Xsnprintf(cattblpath, strsize(DATADIR) + 1 + i + 1, "%s%c%-.*s", DATADIR, _SC_, i, cp); # else cattblpath = Xstrdup(DATADIR); # endif #endif /* !_NOCATALOG */ #ifdef DEP_ORIGSHELL cp = getshellname(progname, NULL, NULL); if (!strpathcmp(cp, FDSHELL) || !strpathcmp(cp, SWITCHUSER)) { i = main_shell(argc, argv, envp); # ifdef DEP_PTY killallpty(); # endif Xexit2(i); } interactive = fdmode = 1; setshellvar(envp); if (prepareterm() < 0) error(NULL); argc = initoption(argc, argv); if (dumbterm > 1) { errno = 0; error(NTERM_K); } #else /* !DEP_ORIGSHELL */ inittty(0); getterment(NULL); argc = initoption(argc, argv); adjustpath(); #endif /* !DEP_ORIGSHELL */ initenv(); Xttyiomode(0); initterm(); if ((cp = getwsize(WCOLUMNMIN, WHEADERMAX + WFOOTER + WFILEMIN))) { errno = 0; error(cp); } setlinecol(); #ifndef _NOCUSTOMIZE saveorigenviron(); #endif Xlocate(0, n_line - 1); inruncom = 1; i = loadruncom(DEFRC, 0); i += loadruncom(FD_RCFILE, 0); inruncom = 0; #ifdef SIGWINCH nowinch = 1; #endif sigvecset(1); if (i < 0) { hideclock = 2; warning(0, HITKY_K); } i = evaloption(argv); checkscreen(WCOLUMNMIN, WHEADERMAX + WFOOTER + WFILEMIN); initfd(argv); Xputterms(T_CLEAR); #ifdef SIGWINCH nowinch = 0; #endif main_fd(&(argv[i]), 0); sigvecset(0); Xstdiomode(); #if defined (DEP_ORIGSHELL) && !defined (NOJOB) killjob(); #endif #ifdef DEP_PTY killallpty(); #endif Xexit2(0); return(0); } FD-3.01j/printf.c100644 2105 1751 41572 13516612560 12360 0ustar shiraiuser/* * printf.c * * formatted printing module */ #include "headers.h" #include "depend.h" #include "printf.h" #include "kctype.h" #include "typesize.h" #include "string.h" #ifdef FD #include "kconv.h" #endif #define PRINTBUFUNIT 16 #define THDIGIT 3 #define MINUNITWIDTH (3 + strsize(" KB")) #define NULLSTR "(null)" #ifdef FD extern char *restorearg __P_((CONST char *)); #endif #ifndef MINIMUMSHELL static int NEAR gencntrl __P_((char *, int, printbuf_t *)); static int NEAR setcntrl __P_((int, int, printbuf_t *)); #endif static int NEAR checkchar __P_((int, printbuf_t *)); static int NEAR setint __P_((u_long_t, int, printbuf_t *, int, int)); #ifndef MINIMUMSHELL static int NEAR unitint __P_((u_long_t, int, printbuf_t *, int, int)); #endif static int NEAR setstr __P_((CONST char *, printbuf_t *, int, int)); static int NEAR commonprintf __P_((printbuf_t *, CONST char *, va_list)); CONST char printfflagchar[] = { '-', '0', '\'', #ifndef MINIMUMSHELL '+', ' ', '<', '^', '>', #endif '\0', }; CONST int printfflag[] = { VF_MINUS, VF_ZERO, VF_THOUSAND, #ifndef MINIMUMSHELL VF_PLUS, VF_SPACE, VF_STRICTWIDTH, VF_PRINTABLE, VF_SIZEUNIT, #endif }; CONST char printfsizechar[] = { 'l', 'q', 'i', #ifndef MINIMUMSHELL 'L', 'C', 'h', #endif '\0', }; CONST int printfsize[] = { sizeof(long), sizeof(off_t), sizeof(p_id_t), #ifndef MINIMUMSHELL sizeof(l_off_t), sizeof(char), sizeof(short), #endif }; int printf_urgent = 0; #ifdef DEP_FILECONV int printf_defkanji = 0; #endif #ifndef MINIMUMSHELL static CONST char printfsizeunit[] = "KMGTPEZY"; #endif #ifndef MINIMUMSHELL VOID getcharwidth(s, ptr, rwp, vwp) CONST char *s; ALLOC_T ptr; int *rwp, *vwp; { int rw, vw; rw = vw = 1; if (iskanji1(s, ptr)) rw = vw = 2; # ifdef CODEEUC else if (isekana(s, ptr)) rw++; # else else if (isskana(s, ptr)) /*EMPTY*/; # endif else if (Xiscntrl(s[ptr])) vw++; else if (ismsb(s[ptr])) vw = 4; if (rwp) *rwp = rw; if (vwp) *vwp = vw; } int strlen3(s) CONST char *s; { int r, v, rw, vw; r = v = 0; while (s[r]) { getcharwidth(s, r, &rw, &vw); r += rw; v += vw; } return(v); } static int NEAR gencntrl(buf, c, pbufp) char *buf; int c; printbuf_t *pbufp; { char *cp; int n; cp = buf; if (!(pbufp -> flags & VF_PRINTABLE)) return(0); # ifndef CODEEUC else if (Xiskana(c)) return(0); # endif else if (Xiscntrl(c)) { *(cp++) = '^'; *(cp++) = (c + '@') & 0x7f; } else if (ismsb(c)) { *(cp++) = '\\'; n = 3; c &= 0xff; while (n-- > 0) { cp[n] = '0' + (c & 7); c >>= 3; } cp += 3; } return(cp - buf); } static int NEAR setcntrl(c, len, pbufp) int c, len; printbuf_t *pbufp; { char buf[MAXCHARWID + 1]; int i, n; n = gencntrl(buf, c, pbufp); if (n <= 0) return(n); if (checkchar(n, pbufp) < 0) n = pbufp -> size - pbufp -> ptr - 1; for (i = 0; i < n; i++) { if (len >= 0 && --len < 0) break; if (setchar(buf[i], pbufp) < 0) return(-1); } return(i); } #endif /* !MINIMUMSHELL */ int getnum(s, ptrp) CONST char *s; int *ptrp; { int i, n; n = 0; for (i = *ptrp; Xisdigit(s[i]); i++) { if (n > MAXTYPE(int) / 10 || (n == MAXTYPE(int) / 10 && s[i] > (char)(MAXTYPE(int) % 10) + '0')) return(-1); n = n * 10 + (s[i] - '0'); } if (i <= *ptrp) n = -1; *ptrp = i; return(n); } static int NEAR checkchar(n, pbufp) int n; printbuf_t *pbufp; { if (pbufp -> flags & (VF_NEW | VF_FILE)) return(0); if (pbufp -> ptr + n < pbufp -> size) return(0); return(-1); } int setchar(n, pbufp) int n; printbuf_t *pbufp; { char *tmp; if (pbufp -> flags & VF_FILE) { if (pbufp -> buf && Xfputc(n, (XFILE *)(pbufp -> buf)) == EOF) return(-1); (pbufp -> ptr)++; return(1); } if (pbufp -> ptr + 1 >= pbufp -> size) { if (!(pbufp -> flags & VF_NEW)) { if (pbufp -> ptr < pbufp -> size) pbufp -> buf[pbufp -> ptr] = '\0'; return(1); } pbufp -> size += PRINTBUFUNIT; if ((tmp = (char *)realloc(pbufp -> buf, pbufp -> size))) pbufp -> buf = tmp; else { free(pbufp -> buf); pbufp -> buf = NULL; return(-1); } } pbufp -> buf[(pbufp -> ptr)++] = n; return(1); } static int NEAR setint(u, base, pbufp, width, prec) u_long_t u; int base; printbuf_t *pbufp; int width, prec; { #ifndef MINIMUMSHELL int cap; #endif char num[MAXCOLSCOMMA(THDIGIT) + 1]; long_t n; int i, c, len, ptr, sign, bit; memcpy((char *)&n, (char *)&u, sizeof(n)); bit = 0; #ifdef MINIMUMSHELL if (base != 10) { sign = 0; for (i = 1; i < base; i <<= 1) bit++; base--; } else if (n >= 0) sign = 0; #else /* !MINIMUMSHELL */ cap = 0; if (base >= 256) { cap++; base -= 256; } if (pbufp -> flags & VF_UNSIGNED) { sign = 0; pbufp -> flags &= ~(VF_PLUS | VF_SPACE); if (base != 10) { for (i = 1; i < base; i <<= 1) bit++; base--; } } else if (n >= 0) sign = (pbufp -> flags & VF_PLUS) ? 1 : 0; #endif /* !MINIMUMSHELL */ else sign = -1; #ifdef MINIMUMSHELL if (sign) width--; #else if (sign || (pbufp -> flags & VF_SPACE)) width--; #endif if ((pbufp -> flags & VF_ZERO) && prec < 0) prec = width; len = 0; if (!n) { if (prec) num[len++] = '0'; } else while (len < arraysize(num)) { if (bit) { c = (u & base); #ifdef MINIMUMSHELL c += '0'; #else c = tohexa(c); if (cap) c = Xtoupper(c); #endif } else { #ifndef MINIMUMSHELL if (pbufp -> flags & VF_UNSIGNED) c = (u % base); else #endif if ((c = (n % base)) < 0) c = -c; c += '0'; } if ((pbufp -> flags & VF_THOUSAND) && (len % (THDIGIT + 1)) == THDIGIT) num[len++] = ','; num[len++] = c; if (bit) { u >>= bit; if (!u) break; } #ifndef MINIMUMSHELL else if (pbufp -> flags & VF_UNSIGNED) { u /= base; if (!u) break; } #endif else { n /= base; if (!n) break; } } ptr = pbufp -> ptr; if (!(pbufp -> flags & VF_MINUS) && width >= 0 && len < width) { while (len < width) { if (prec >= 0 && prec > width - 1) break; width--; if (setchar(' ', pbufp) < 0) return(-1); } } c = '\0'; if (sign) c = (sign > 0) ? '+' : '-'; #ifndef MINIMUMSHELL else if (pbufp -> flags & VF_SPACE) c = ' '; #endif if (c && setchar(c, pbufp) < 0) return(-1); if (prec < 0 || len >= prec) /*EMPTY*/; else for (i = 0; i < prec - len; i++) { #ifndef MINIMUMSHELL if ((pbufp -> flags & VF_STRICTWIDTH) && width == 1) break; #endif width--; c = '0'; if ((pbufp -> flags & VF_THOUSAND) && !((prec - i) % (THDIGIT + 1))) c = (i) ? ',' : ' '; if (setchar(c, pbufp) < 0) return(-1); } i = 0; #ifndef MINIMUMSHELL if (width < 0 || width >= len) /*EMPTY*/; else if (pbufp -> flags & VF_SIZEUNIT) return(len); else if (pbufp -> flags & VF_ASPOSSIBLE) i = len - width; else if (pbufp -> flags & VF_STRICTWIDTH) for (len = 0; len < width; len++) if (Xisdigit(num[len])) num[len] = '9'; #endif while (i < len) if (setchar(num[len - ++i], pbufp) < 0) return(-1); if (width >= 0) for (; i < width; i++) { if (setchar(' ', pbufp) < 0) return(-1); } return(pbufp -> ptr - ptr); } #ifndef MINIMUMSHELL static int NEAR unitint(u, base, pbufp, width, prec) u_long_t u; int base; printbuf_t *pbufp; int width, prec; { printbuf_t pbuf; int len, unit, uwidth, frac; memcpy((char *)&pbuf, (char *)pbufp, sizeof(pbuf)); pbufp -> buf = NULL; pbufp -> flags |= VF_FILE; len = unit = uwidth = 0; frac = -1; if (pbufp -> flags & VF_STRICTWIDTH) unit++; if (width >= MINUNITWIDTH) for (;;) { if (unit) uwidth = 3; pbufp -> ptr = pbuf.ptr; len = setint(u, base, pbufp, -1, prec); if (len < 0) { len = width; break; } if (len + uwidth <= width) break; if (!(printfsizeunit[unit])) break; unit++; frac = (int)(u & (u_long_t)0x3ff); u >>= 10; } memcpy((char *)pbufp, (char *)&pbuf, sizeof(pbuf)); if ((pbufp -> flags & VF_STRICTWIDTH) || len + 2 + uwidth > width) frac = -1; if (frac < 0) len = width - uwidth; pbufp -> flags &= ~VF_SIZEUNIT; pbufp -> flags |= VF_STRICTWIDTH; len = setint(u, base, pbufp, len, prec); if (len < 0) return(-1); if (frac >= 0) { width -= len + 1 + uwidth; u = (u_long_t)frac; u *= (u_long_t)1000; u >>= 10; if (setchar('.', pbufp) < 0) return(-1); pbufp -> flags &= (VF_NEW | VF_FILE); pbufp -> flags |= (VF_ZERO | VF_ASPOSSIBLE); if (setint(u, base, pbufp, width, prec) < 0) return(-1); } if (unit > 0) { if (setchar(' ', pbufp) < 0) return(-1); if (setchar(printfsizeunit[unit - 1], pbufp) < 0) return(-1); if (setchar('B', pbufp) < 0) return(-1); } return(pbufp -> ptr - pbuf.ptr); } #endif /* !MINIMUMSHELL */ static int NEAR setstr(s, pbufp, width, prec) CONST char *s; printbuf_t *pbufp; int width, prec; { #ifdef DEP_KCONV CONST char *s2; char *cp, *tmp; int len2; #endif #ifndef MINIMUMSHELL int n; #endif int i, c, len, total; if (s) { # ifndef MINIMUMSHELL if (pbufp -> flags & VF_PRINTABLE) len = strlen3(s); else # endif len = strlen2(s); } else { s = NULLSTR; len = strsize(NULLSTR); #ifdef LINUX /* spec. of glibc */ if (prec >= 0 && len > prec) len = 0; #endif } if (prec >= 0 && len > prec) len = prec; total = len; if (!(pbufp -> flags & VF_MINUS) && width >= 0 && len < width) { total = width; while (len < width--) if (setchar(' ', pbufp) < 0) return(-1); } #ifdef DEP_KCONV if (pbufp -> flags & VF_KANJI) { if (!(tmp = (char *)malloc(len * KANAWID + 1))) return(-1); len2 = len; for (;;) { s2 = s; cp = tmp; for (i = 0; i < len2; i++, s2++) { c = *s2; if (iskanji1(s2, 0)) { if (++i >= len2) c = ' '; else { *(cp++) = c; c = *(++s2); } } # ifdef CODEEUC else if (isekana(s2, 0)) { *(cp++) = c; c = *(++s2); } # endif # ifndef MINIMUMSHELL else if ((n = gencntrl(cp, c, pbufp)) > 0) { while (n-- > 0) { if (i++ >= len2) break; cp++; } i--; continue; } # endif *(cp++) = c; } *cp = '\0'; cp = newkanjiconv(tmp, DEFCODE, getoutputkcode(), L_OUTPUT); if ((pbufp -> flags & (VF_NEW | VF_FILE)) || pbufp -> ptr + strlen(cp) < pbufp -> size) break; if (cp != tmp) free(cp); if (--len2 <= 0) { cp = NULL; break; } } if (cp != tmp) free(tmp); if (cp) { for (i = 0; cp[i]; i++) if (setchar(cp[i], pbufp) < 0) break; if (cp[i]) i = -1; free(cp); if (i < 0) return(-1); } } else #endif /* DEP_KCONV */ for (i = 0; i < len; i++, s++) { c = *s; if (iskanji1(s, 0)) { if (++i >= len || checkchar(2, pbufp) < 0) c = ' '; else { if (setchar(c, pbufp) < 0) return(-1); c = *(++s); } } #ifdef CODEEUC else if (isekana(s, 0)) { if (checkchar(2, pbufp) < 0) c = ' '; else { if (setchar(c, pbufp) < 0) return(-1); c = *(++s); } } #endif #ifndef MINIMUMSHELL else if ((n = setcntrl(c, len - i, pbufp))) { if (n < 0) return(-1); i += n - 1; continue; } #endif if (setchar(c, pbufp) < 0) return(-1); } if (width >= 0 && len < width) { total += width - len; while (len < width--) if (setchar(' ', pbufp) < 0) return(-1); } return(total); } static int NEAR commonprintf(pbufp, fmt, args) printbuf_t *pbufp; CONST char *fmt; va_list args; { #ifndef HAVELONGLONG u_long_t tmp; int hi; #endif #ifdef DEP_FILECONV char *s2; #endif u_long_t u, mask; CONST char *cp; char *s; int i, c, len, total, base, width, prec; if (pbufp -> flags & VF_NEW) { if (!(pbufp -> buf = (char *)malloc(1))) return(-1); pbufp -> size = 0; } pbufp -> ptr = total = 0; for (i = 0; fmt[i]; i++) { if (fmt[i] != '%') { total++; if (setchar(fmt[i], pbufp) < 0) return(-1); continue; } i++; pbufp -> flags &= (VF_NEW | VF_FILE); width = prec = -1; for (; fmt[i]; i++) { if (!(cp = Xstrchr(printfflagchar, fmt[i]))) break; pbufp -> flags |= printfflag[cp - printfflagchar]; } if (fmt[i] != '*') width = getnum(fmt, &i); else { i++; width = va_arg(args, int); } if (fmt[i] == '.') { i++; if (fmt[i] != '*') prec = getnum(fmt, &i); else { i++; prec = va_arg(args, int); } if (prec < 0) prec = 0; } len = sizeof(int); for (; fmt[i]; i++) { if (!(cp = Xstrchr(printfsizechar, fmt[i]))) break; len = printfsize[cp - printfsizechar]; } base = 0; switch (fmt[i]) { case 'd': base = 10; break; case 'a': #ifdef FD if (!printf_urgent) pbufp -> flags |= VF_ARGUMENT; #endif /*FALLTHRU*/ case 'k': case 'K': #ifdef DEP_KCONV if (!printf_urgent) pbufp -> flags |= VF_KANJI; #endif /*FALLTHRU*/ case 's': cp = s = va_arg(args, char *); #ifdef FD if (pbufp -> flags & VF_ARGUMENT) s = restorearg(cp); #endif #ifdef DEP_FILECONV if ((pbufp -> flags & VF_KANJI) && printf_defkanji && Xislower(fmt[i])) { s2 = newkanjiconv(s, defaultkcode, DEFCODE, L_FNAME); if (s != s2 && s != cp) free(s); s = s2; } #endif len = setstr(s, pbufp, width, prec); if (cp != s) free(s); break; case 'c': c = va_arg(args, int); #ifndef MINIMUMSHELL if ((len = setcntrl(c, -1, pbufp))) break; #endif len = setchar(c & 0xff, pbufp); break; #ifndef MINIMUMSHELL case 'u': pbufp -> flags |= VF_UNSIGNED; base = 10; break; case 'p': if ((len = setstr("0x", pbufp, -1, -1)) < 0) return(-1); total += len; len = sizeof(VOID_P); /*FALLTHRU*/ case 'x': pbufp -> flags |= VF_UNSIGNED; base = 16; break; case 'X': pbufp -> flags |= VF_UNSIGNED; base = 16 + 256; break; #endif /* !MINIMUMSHELL */ case 'o': pbufp -> flags |= VF_UNSIGNED; base = 8; break; default: len = setchar(fmt[i], pbufp); break; } if (base) { #ifndef HAVELONGLONG if (len > (int)sizeof(u_long_t)) { # ifndef HPUX /* * HP-UX always pushes arguments from lowest to uppermost, * in spite of the CPU endian. */ tmp = 0x5a; cp = (CONST char *)(&tmp); if (*cp != 0x5a) { hi = va_arg(args, u_int); len -= (int)sizeof(u_int); while (len > (int)sizeof(u_long_t)) { tmp = va_arg(args, u_int); len -= (int)sizeof(u_int); } u = va_arg(args, u_long_t); } else # endif /* !HPUX */ { hi = 0; u = va_arg(args, u_long_t); len -= (int)sizeof(u_long_t); while (len > 0) { hi = va_arg(args, u_int); len -= (int)sizeof(u_int); } } if (pbufp -> flags & VF_UNSIGNED) { if (hi) u = MAXUTYPE(u_long_t); } else { mask = (MAXUTYPE(u_long_t) >> 1); if (hi < 0) { if (++hi || !(u & ~mask)) u = ~mask; } else { if (hi || (u & ~mask)) u = mask; } } } else #endif /* !HAVELONGLONG */ if (len == (int)sizeof(u_long_t)) u = va_arg(args, u_long_t); #ifdef HAVELONGLONG else if (len == (int)sizeof(u_long)) u = va_arg(args, u_long); #endif else u = va_arg(args, u_int); if (!(pbufp -> flags & VF_UNSIGNED)) { mask = MAXUTYPE(u_long_t); if (len < (int)sizeof(u_long_t)) mask >>= ((int)sizeof(u_long_t) - len) * BITSPERBYTE; mask >>= 1; if (u & ~mask) u |= ~mask; } #ifndef MINIMUMSHELL if (pbufp -> flags & VF_SIZEUNIT) len = unitint(u, base, pbufp, width, prec); else #endif len = setint(u, base, pbufp, width, prec); } if (len < 0) return(-1); total += len; } if (pbufp -> buf && !(pbufp -> flags & VF_FILE)) pbufp -> buf[pbufp -> ptr] = '\0'; return(total); } #ifndef MINIMUMSHELL int Xvasprintf(sp, fmt, args) char **sp; CONST char *fmt; va_list args; { printbuf_t pbuf; int n; if (!sp) return(-1); pbuf.flags = VF_NEW; n = commonprintf(&pbuf, fmt, args); *sp = pbuf.buf; return(n); } # ifdef USESTDARGH /*VARARGS2*/ int Xasprintf(char **sp, CONST char *fmt, ...) # else /*VARARGS2*/ int Xasprintf(sp, fmt, va_alist) char **sp; CONST char *fmt; va_dcl # endif { va_list args; int n; VA_START(args, fmt); n = Xvasprintf(sp, fmt, args); va_end(args); return(n); } #endif /* !MINIMUMSHELL */ int Xvsnprintf(s, size, fmt, args) char *s; int size; CONST char *fmt; va_list args; { printbuf_t pbuf; if (size < 0) return(-1); pbuf.buf = s; pbuf.size = size; pbuf.flags = 0; return(commonprintf(&pbuf, fmt, args)); } #ifdef USESTDARGH /*VARARGS3*/ int Xsnprintf(char *s, int size, CONST char *fmt, ...) #else /*VARARGS3*/ int Xsnprintf(s, size, fmt, va_alist) char *s; int size; CONST char *fmt; va_dcl #endif { va_list args; int n; VA_START(args, fmt); n = Xvsnprintf(s, size, fmt, args); va_end(args); return(n); } int Xvfprintf(fp, fmt, args) XFILE *fp; CONST char *fmt; va_list args; { printbuf_t pbuf; pbuf.buf = (char *)fp; pbuf.flags = VF_FILE; return(commonprintf(&pbuf, fmt, args)); } #ifdef USESTDARGH /*VARARGS2*/ int Xfprintf(XFILE *fp, CONST char *fmt, ...) #else /*VARARGS2*/ int Xfprintf(fp, fmt, va_alist) XFILE *fp; CONST char *fmt; va_dcl #endif { va_list args; int n; VA_START(args, fmt); n = Xvfprintf(fp, fmt, args); va_end(args); return(n); } #ifdef USESTDARGH /*VARARGS1*/ int Xprintf(CONST char *fmt, ...) #else /*VARARGS1*/ int Xprintf(fmt, va_alist) CONST char *fmt; va_dcl #endif { va_list args; int n; VA_START(args, fmt); n = Xvfprintf(Xstdout, fmt, args); va_end(args); return(n); } #ifdef FD VOID kanjifputs(s, fp) CONST char *s; XFILE *fp; { VOID_C Xfprintf(fp, "%k", s); } #endif /* FD */ FD-3.01j/termio.c100644 2105 1751 34000 13516612560 12341 0ustar shiraiuser/* * termio.c * * terminal I/O */ #include "headers.h" #include "depend.h" #include "typesize.h" #include "sysemu.h" #include "termio.h" #include "unixemu.h" #ifdef USESELECTH #include #endif #if MSDOS # ifdef USERESOURCEH # include # include # endif #else /* !MSDOS */ # ifdef USERESOURCEH # include # endif # ifdef USEULIMITH # include # endif #endif /* !MSDOS */ #if defined (USESYSCONF) && defined (_SC_OPEN_MAX) #define MAXOPENFILE (int)sysconf(_SC_OPEN_MAX) #else /* !USESYSCONF || !_SC_OPEN_MAX */ # ifdef NOFILE # define MAXOPENFILE NOFILE # else /* !NOFILE */ # ifdef OPEN_MAX # define MAXOPENFILE OPEN_MAX # else /* !OPEN_MAX */ # if MSDOS # define MAXOPENFILE 20 # else # define MAXOPENFILE 64 # endif # endif /* !OPEN_MAX */ # endif /* !NOFILE */ #endif /* !USESYSCONF || !_SC_OPEN_MAX */ #ifndef UL_GDESLIM #define UL_GDESLIM 4 #endif #ifndef FD_CLOEXEC #define FD_CLOEXEC 1 #endif #if !defined (RLIMIT_NOFILE) && defined (RLIMIT_OFILE) #define RLIMIT_NOFILE RLIMIT_OFILE #endif #ifdef USETERMIO #undef VSTART #undef VSTOP #endif #define K_CTRL(c) ((c) & 037) #define MAXFDSET 256 #define MAXSELECT 16 #ifndef FD_SET typedef struct fd_set { u_int fds_bits[1]; } fd_set; # define FD_SET(n, p) (((p) -> fds_bits[0]) |= ((u_int)1 << (n))) # define FD_ISSET(n, p) (((p) -> fds_bits[0]) & ((u_int)1 << (n))) # define FD_ZERO(p) (((p) -> fds_bits[0]) = 0) # undef MAXFDSET # define MAXFDSET (BITSPERBYTE * sizeof(u_int)) #endif /* !FD_SET */ #if defined (DEP_ORIGSHELL) && !defined(MINIMUMSHELL) extern int catchsignal __P_((int)); #endif #if !MSDOS && defined (FD) && !defined (NOSELECT) extern VOID checksuspend __P_((VOID)); #endif #ifdef DEP_ORIGSHELL extern int interrupted; #endif #ifdef LSI_C extern u_char _openfile[]; #endif #if MSDOS static CONST u_short doserrlist[] = { 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 15, 17, 18, 65, 80 }; #define DOSERRLISTSIZ arraysize(doserrlist) static CONST int unixerrlist[] = { 0, EINVAL, ENOENT, ENOENT, EMFILE, EACCES, EBADF, ENOMEM, ENOMEM, ENOMEM, ENODEV, EXDEV, 0, EACCES, EEXIST }; #endif /* MSDOS */ #ifdef CYGWIN static int save_ttyio = -1; #endif #ifdef LSI_C int safe_dup(oldd) int oldd; { int fd; if ((fd = dup(oldd)) < 0) return(-1); if (fd < SYS_OPEN && oldd >= 0 && oldd < SYS_OPEN) _openfile[fd] = _openfile[oldd]; return(fd); } int safe_dup2(oldd, newd) int oldd, newd; { int fd; if (oldd == newd) return(newd); if ((fd = dup2(oldd, newd)) < 0) return(-1); if (newd >= 0 && newd < SYS_OPEN && oldd >= 0 && oldd < SYS_OPEN) _openfile[newd] = _openfile[oldd]; return(fd); } #endif /* LSI_C */ #if MSDOS VOID dosseterrno(doserr) u_int doserr; { int i; for (i = 0; i < DOSERRLISTSIZ; i++) if (doserr == doserrlist[i]) { errno = unixerrlist[i]; return; } errno = EINVAL; } int intcall(vect, regp, sregp) int vect; __dpmi_regs *regp; struct SREGS *sregp; { # ifdef __TURBOC__ struct REGPACK preg; # endif (*regp).x.flags |= FR_CARRY; # ifdef __TURBOC__ preg.r_ax = (*regp).x.ax; preg.r_bx = (*regp).x.bx; preg.r_cx = (*regp).x.cx; preg.r_dx = (*regp).x.dx; preg.r_bp = (*regp).x.bp; preg.r_si = (*regp).x.si; preg.r_di = (*regp).x.di; preg.r_ds = (*sregp).ds; preg.r_es = (*sregp).es; preg.r_flags = (*regp).x.flags; intr(vect, &preg); (*regp).x.ax = preg.r_ax; (*regp).x.bx = preg.r_bx; (*regp).x.cx = preg.r_cx; (*regp).x.dx = preg.r_dx; (*regp).x.bp = preg.r_bp; (*regp).x.si = preg.r_si; (*regp).x.di = preg.r_di; (*sregp).ds = preg.r_ds; (*sregp).es = preg.r_es; (*regp).x.flags = preg.r_flags; # else /* !__TURBOC__ */ # ifdef DJGPP (*regp).x.ds = (*sregp).ds; (*regp).x.es = (*sregp).es; __dpmi_int(vect, regp); (*sregp).ds = (*regp).x.ds; (*sregp).es = (*regp).x.es; # else int86x(vect, regp, regp, sregp); # endif # endif /* !__TURBOC__ */ if (!((*regp).x.flags & FR_CARRY)) return(0); dosseterrno((*regp).x.ax); return(-1); } #endif /* MSDOS */ int Xgetdtablesize(VOID_A) { #if !MSDOS # ifndef NODTABLESIZE int n; # else /* NODTABLESIZE */ # ifdef USERESOURCEH struct rlimit lim; # else /* !USERESOURCEH */ # ifdef USEULIMITH long n; # endif # endif /* !USERESOURCEH */ # endif /* NODTABLESIZE */ #endif /* !MSDOS */ #if !MSDOS && !defined (MINIX3) # ifndef NODTABLESIZE if ((n = getdtablesize()) >= 0) return(n); # else /* NODTABLESIZE */ # ifdef USERESOURCEH if (getrlimit(RLIMIT_NOFILE, &lim) >= 0) return(lim.rlim_cur); # else /* !USERESOURCEH */ # ifdef USEULIMITH if ((n = ulimit(UL_GDESLIM, 0L)) >= 0L) return((int)n); # endif # endif /* !USERESOURCEH */ # endif /* NODTABLESIZE */ #endif /* !MSDOS && !MINIX3 */ return(MAXOPENFILE); } int isvalidfd(fd) int fd; { #if MSDOS struct SREGS sreg; __dpmi_regs reg; #endif #if MSDOS reg.x.ax = 0x4400; reg.x.bx = fd; return(intcall(0x21, ®, &sreg)); #else return(fcntl(fd, F_GETFD, NULL)); #endif } int newdup(fd) int fd; { int n; if (fd < 0 || fd == STDIN_FILENO || fd == STDOUT_FILENO || fd == STDERR_FILENO) return(fd); #ifdef DEP_DOSDRIVE if (chkopenfd(fd) == DEV_DOS) return(fd); #endif n = Xgetdtablesize(); for (n--; n > fd; n--) if (isvalidfd(n) < 0) break; if (n <= fd || Xdup2(fd, n) < 0) return(fd); VOID_C Xclose(fd); return(n); } int sureread(fd, buf, nbytes) int fd; VOID_P buf; int nbytes; { int n; #if defined (DEP_ORIGSHELL) && !defined(MINIMUMSHELL) VOID_C catchsignal(-1); #endif for (;;) { #ifdef DEP_ORIGSHELL if (interrupted) { n = seterrno(EINTR); break; } #endif if ((n = Xread(fd, buf, nbytes)) >= 0) { errno = 0; return(n); } #ifdef EAGAIN else if (errno == EAGAIN) continue; #endif #ifdef EWOULDBLOCK else if (errno == EWOULDBLOCK) continue; #endif else if (errno != EINTR) break; #if defined (DEP_ORIGSHELL) && !defined(MINIMUMSHELL) else if (catchsignal(1) < 0) break; #endif } return(-1); } int surewrite(fd, buf, nbytes) int fd; CONST VOID_P buf; int nbytes; { char *cp; int n; cp = (char *)buf; #if defined (DEP_ORIGSHELL) && !defined(MINIMUMSHELL) VOID_C catchsignal(-1); #endif for (;;) { #ifdef DEP_ORIGSHELL if (interrupted) { n = seterrno(EINTR); break; } #endif if ((n = Xwrite(fd, cp, nbytes)) >= 0) { if (n >= nbytes) { errno = 0; return(0); } #if MSDOS if (!n) { errno = ENOSPC; break; } #endif cp += n; nbytes -= n; } #ifdef EAGAIN else if (errno == EAGAIN) continue; #endif #ifdef EWOULDBLOCK else if (errno == EWOULDBLOCK) continue; #endif else if (errno != EINTR) break; #if defined (DEP_ORIGSHELL) && !defined(MINIMUMSHELL) else if (catchsignal(1) < 0) break; #endif } return(-1); } VOID safeclose(fd) int fd; { int duperrno; if (fd < 0) return; duperrno = errno; if (fd != STDIN_FILENO && fd != STDOUT_FILENO && fd != STDERR_FILENO) VOID_C Xclose(fd); errno = duperrno; } VOID safefclose(fp) XFILE *fp; { int fd, duperrno; if (!fp) return; duperrno = errno; fd = Xfileno(fp); if (fd != STDIN_FILENO && fd != STDOUT_FILENO && fd != STDERR_FILENO) VOID_C Xfclose(fp); errno = duperrno; } int opentty(fdp, fpp) int *fdp; XFILE **fpp; { XFILE *fp; int fd, flags; #ifdef SELECTRWONLY flags = O_RDONLY; #else flags = O_RDWR; #endif if (*fdp >= 0) fd = *fdp; #ifdef MINIX else if (!isatty(STDIN_FILENO)) return(seterrno(ENOTTY)); else if ((fd = newdup(Xdup(STDIN_FILENO))) < 0) return(-1); #else else if ((fd = newdup(Xopen(_PATH_TTY, flags, 0666))) < 0) return(-1); #endif if (*fpp) fp = *fpp; #if !defined (MINIX3) && !defined (SELECTRWONLY) else if ((fp = Xfdopen(fd, "w+b"))) /*EMPTY*/; #endif else if (!(fp = Xfopen(_PATH_TTY, "w+b"))) { VOID_C Xclose(fd); return(-1); } *fdp = fd; *fpp = fp; #ifdef CYGWIN save_ttyio = fd; #endif return(0); } VOID closetty(fdp, fpp) int *fdp; XFILE **fpp; { if (*fpp) { if (Xfileno(*fpp) == *fdp) *fdp = -1; VOID_C Xfclose(*fpp); } if (*fdp >= 0) VOID_C Xclose(*fdp); *fdp = -1; *fpp = NULL; } #if !MSDOS VOID closeonexec(fd) int fd; { int n; if (fd >= 0 && (n = fcntl(fd, F_GETFD, NULL)) >= 0) VOID_C fcntl(fd, F_SETFD, n | FD_CLOEXEC); } #ifdef USESTDARGH /*VARARGS2*/ int Xioctl(int fd, ioctlreq_t request, ...) #else /*VARARGS2*/ int Xioctl(fd, request, va_alist) int fd; ioctlreq_t request; va_dcl #endif { va_list args; VOID_P argp; VA_START(args, request); argp = va_arg(args, VOID_P); # if defined (DEP_ORIGSHELL) && !defined(MINIMUMSHELL) VOID_C catchsignal(-1); # endif for (;;) { if (ioctl(fd, request, argp) >= 0) { errno = 0; return(0); } # ifdef EAGAIN else if (errno == EAGAIN) continue; # endif # ifdef EWOULDBLOCK else if (errno == EWOULDBLOCK) continue; # endif else if (errno != EINTR) break; # if defined (DEP_ORIGSHELL) && !defined(MINIMUMSHELL) else if (catchsignal(1) < 0) break; # endif } return(-1); } # ifdef USETERMIOS int Xtcgetattr(fd, t) int fd; termioctl_t *t; { # if defined (DEP_ORIGSHELL) && !defined(MINIMUMSHELL) VOID_C catchsignal(-1); # endif for (;;) { if (tcgetattr(fd, t) >= 0) { errno = 0; return(0); } # ifdef EAGAIN else if (errno == EAGAIN) continue; # endif # ifdef EWOULDBLOCK else if (errno == EWOULDBLOCK) continue; # endif else if (errno != EINTR) break; # if defined (DEP_ORIGSHELL) && !defined(MINIMUMSHELL) else if (catchsignal(1) < 0) break; # endif } return(-1); } int Xtcsetattr(fd, action, t) int fd, action; CONST termioctl_t *t; { # if defined (DEP_ORIGSHELL) && !defined(MINIMUMSHELL) VOID_C catchsignal(-1); # endif for (;;) { if (tcsetattr(fd, action, t) >= 0) { errno = 0; return(0); } # ifdef EAGAIN else if (errno == EAGAIN) continue; # endif # ifdef EWOULDBLOCK else if (errno == EWOULDBLOCK) continue; # endif else if (errno != EINTR) break; # if defined (DEP_ORIGSHELL) && !defined(MINIMUMSHELL) else if (catchsignal(1) < 0) break; # endif } return(-1); } int Xtcflush(fd, selector) int fd, selector; { # if defined (DEP_ORIGSHELL) && !defined(MINIMUMSHELL) VOID_C catchsignal(-1); # endif for (;;) { if (tcflush(fd, selector) >= 0) { errno = 0; return(0); } # ifdef EAGAIN else if (errno == EAGAIN) continue; # endif # ifdef EWOULDBLOCK else if (errno == EWOULDBLOCK) continue; # endif else if (errno != EINTR) break; # if defined (DEP_ORIGSHELL) && !defined(MINIMUMSHELL) else if (catchsignal(1) < 0) break; # endif } return(-1); } # endif /* USETERMIOS */ #endif /* !MSDOS */ #if defined (FD) || defined (CYGWIN) || !defined (NOJOB) /*ARGSUSED*/ VOID loadtermio(fd, tty, ws) int fd; CONST char *tty, *ws; { # if MSDOS # ifndef DJGPP union REGS reg; # endif # else /* !MSDOS */ ALLOC_T size; # endif /* !MSDOS */ if (fd < 0) return; # if MSDOS # ifndef DJGPP if (tty) { reg.x.ax = 0x3301; memcpy((char *)&(reg.h.dl), (char *)tty, sizeof(reg.h.dl)); int86(0x21, ®, ®); } # endif # else /* !MSDOS */ if (tty) { size = (ALLOC_T)0; VOID_C tioctl(fd, REQSETN, (termioctl_t *)&(tty[size])); # ifdef USESGTTY size += sizeof(termioctl_t); VOID_C Xioctl(fd, TIOCLSET, (int *)&(tty[size])); size += sizeof(int); VOID_C Xioctl(fd, TIOCSETC, (struct tchars *)&(tty[size])); # endif } # ifndef NOTERMWSIZE if (ws) VOID_C Xioctl(fd, REQSETWS, (termwsize_t *)ws); # endif # endif /* !MSDOS */ } VOID savetermio(fd, ttyp, wsp) int fd; char **ttyp, **wsp; { # if MSDOS # ifndef DJGPP union REGS reg; char *tty; # endif # else /* !MSDOS */ # ifndef NOTERMWSIZE char *ws; # endif ALLOC_T size; char *tty; # endif /* !MSDOS */ if (fd < 0) return; # if MSDOS if (ttyp) do { *ttyp = NULL; # ifndef DJGPP if (!(tty = (char *)malloc(TIO_BUFSIZ))) break; reg.x.ax = 0x3300; int86(0x21, ®, ®); memcpy((char *)tty, (char *)&(reg.h.dl), TIO_BUFSIZ); *ttyp = tty; # endif /* !DJGPP */ } while (0); if (wsp) *wsp = NULL; # else /* !MSDOS */ if (ttyp) do { *ttyp = NULL; if (!(tty = (char *)malloc(TIO_BUFSIZ))) break; size = (ALLOC_T)0; if (tioctl(fd, REQGETP, (termioctl_t *)&(tty[size])) < 0) { free(tty); break; } # ifdef USESGTTY size += sizeof(termioctl_t); if (Xioctl(fd, TIOCLGET, (int *)&(tty[size])) < 0) { free(tty); break; } size += sizeof(int); if (Xioctl(fd, TIOCGETC, (struct tchars *)&(tty[size])) < 0) { free(tty); break; } # endif /* USESGTTY */ *ttyp = tty; } while (0); if (wsp) do { *wsp = NULL; # ifndef NOTERMWSIZE if (!(ws = (char *)malloc(TIO_WINSIZ))) break; if (Xioctl(fd, REQGETWS, (termwsize_t *)ws) < 0) { free(ws); break; } *wsp = ws; # endif /* !NOTERMWSIZE */ } while (0); # endif /* !MSDOS */ } #endif /* FD || CYGWIN || !NOJOB */ #ifdef CYGWIN p_id_t Xfork(VOID_A) { p_id_t pid; char *buf; /* Cygwin's fork() breaks ISIG */ savetermio(save_ttyio, &buf, NULL); pid = fork(); loadtermio(save_ttyio, buf, NULL); if (buf) free(buf); return(pid); } #endif /* CYGWIN */ #ifndef NOSELECT int sureselect(nfd, fds, result, vp, flags) int nfd, fds[]; char result[]; VOID_P vp; int flags; { fd_set *readfds, *writefds, set; int i, n, max, dupfds[MAXSELECT]; if (flags & SEL_WRITE) { readfds = NULL; writefds = &set; } else { readfds = &set; writefds = NULL; } FD_ZERO(&set); max = -1; if (nfd > MAXSELECT) nfd = MAXSELECT; for (i = 0; i < nfd; i++) { dupfds[i] = fds[i]; if (result) result[i] = 0; if (fds[i] < 0) continue; if (fds[i] >= MAXFDSET && (n = safe_dup(fds[i])) >= 0) dupfds[i] = n; if (dupfds[i] > max) max = dupfds[i]; FD_SET(dupfds[i], &set); } if (max++ < 0) return(0); # if defined (DEP_ORIGSHELL) && !defined(MINIMUMSHELL) VOID_C catchsignal(-1); # endif for (;;) { # ifdef DEP_ORIGSHELL if (interrupted) { n = seterrno(EINTR); break; } # endif # if !MSDOS && defined (FD) if (flags & SEL_TTYIO) checksuspend(); # endif n = select(max, readfds, writefds, NULL, (struct timeval *)vp); if (n >= 0 || errno != EINTR) break; # if defined (DEP_ORIGSHELL) && !defined(MINIMUMSHELL) else if (catchsignal(1) < 0) break; # endif if (flags & SEL_NOINTR) break; } for (i = 0; i < nfd; i++) if (dupfds[i] != fds[i]) safeclose(dupfds[i]); if (n <= 0) return(n); if (result) for (i = 0; i < nfd; i++) { if (dupfds[i] < 0) continue; if (FD_ISSET(dupfds[i], &set)) result[i] = 1; } return(n); } #endif /* !NOSELECT */ FD-3.01j/term.c100644 2105 1751 211402 13516612560 12034 0ustar shiraiuser/* * term.c * * terminal module */ #include "headers.h" #include "depend.h" #include "printf.h" #include "kctype.h" #include "typesize.h" #include "string.h" #include "termio.h" #include "term.h" #ifdef USETERMINFO #include #include #endif #if MSDOS # ifdef PC98 # define NOTUSEBIOS # else # define USEVIDEOBIOS # define VIDEOBIOS 0x10 # define BIOSSEG 0x40 # define CURRPAGE 0x62 # define SCRHEIGHT 0x84 # define SCRWIDTH 0x4a # endif # ifdef DJGPP # define __term_regs __dpmi_regs # define intdos2(rp) __dpmi_int(0x21, rp) # define getkeybuf(o) _farpeekw(_dos_ds, KEYBUFWORKSEG * 0x10 + o) # define putkeybuf(o, n) _farpokew(_dos_ds, KEYBUFWORKSEG * 0x10 + o, n) # define intbios(v, rp) __dpmi_int(v, rp) # define getbiosbyte(o) _farpeekb(_dos_ds, BIOSSEG * 0x10 + o) # else /* !DJGPP */ typedef union REGS __term_regs; # define intdos2(rp) int86(0x21, rp, rp) # define getkeybuf(o) (*((u_short far *)MK_FP(KEYBUFWORKSEG, o))) # define putkeybuf(o, n) (*((u_short far *)MK_FP(KEYBUFWORKSEG, o)) = n) # define intbios(v, rp) int86(v, rp, rp) # define getbiosbyte(o) (*((u_char far *)MK_FP(BIOSSEG, o))) # ifdef LSI_C static int _asm_sti __P_((char *)); static int _asm_cli __P_((char *)); # define enable() _asm_sti("\n\tsti\n") # define disable() _asm_cli("\n\tcli\n") # endif # endif /* !DJGPP */ #else /* !MSDOS */ typedef struct _kstree_t { u_char key; u_char num; struct _kstree_t *next; } kstree_t; #endif /* !MSDOS */ #define WINTERMNAME "iris" #define CYGTERMNAME "cygwin" #ifdef _POSIX_VDISABLE #define K_UNDEF _POSIX_VDISABLE #else #define K_UNDEF 0xff #endif #if defined (USETERMINFO) && defined (SVR4) typedef char tputs_t; #else typedef int tputs_t; #endif #ifdef USETERMINFO #define tgetnum2(s) (s) #define tgetflag2(s) (s) #define TERM_pc pad_char #define TERM_bc NULL #define TERM_co columns #define TERM_li lines #define TERM_xn eat_newline_glitch #define TERM_xs ceol_standout_glitch #define TERM_gn generic_type #define TERM_ti enter_ca_mode #define TERM_te exit_ca_mode #define TERM_mm meta_on #define TERM_mo meta_off #define TERM_cs change_scroll_region #define TERM_ks keypad_xmit #define TERM_ke keypad_local #define TERM_ve cursor_normal #define TERM_vs cursor_visible #define TERM_vi cursor_invisible #define TERM_sc save_cursor #define TERM_rc restore_cursor #define TERM_bl bell #define TERM_vb flash_screen #define TERM_cl clear_screen #define TERM_me exit_attribute_mode #define TERM_md enter_bold_mode #define TERM_mr enter_reverse_mode #define TERM_mh enter_dim_mode #define TERM_mb enter_blink_mode #define TERM_so enter_standout_mode #define TERM_us enter_underline_mode #define TERM_se exit_standout_mode #define TERM_ue exit_underline_mode #define TERM_ce clr_eol #define TERM_al insert_line #define TERM_dl delete_line #define TERM_ic insert_character #define TERM_IC parm_ich #define TERM_dc delete_character #define TERM_DC parm_dch #define TERM_cm cursor_address #define TERM_ho cursor_home #define TERM_cr carriage_return #define TERM_nl NULL #define TERM_sf scroll_forward #define TERM_sr scroll_reverse #define TERM_up cursor_up #define TERM_UP parm_up_cursor #define TERM_do cursor_down #define TERM_DO parm_down_cursor #define TERM_nd cursor_right #define TERM_RI parm_right_cursor #define TERM_le cursor_left #define TERM_LE parm_left_cursor #define TERM_AF set_a_foreground #define TERM_AB set_a_background #define TERM_Sf set_foreground #define TERM_Sb set_background #define TERM_cb clr_bol #define TERM_as enter_alt_charset_mode #define TERM_ae exit_alt_charset_mode #define TERM_ku key_up #define TERM_kd key_down #define TERM_kr key_right #define TERM_kl key_left #define TERM_kh key_home #define TERM_kb key_backspace #define TERM_l1 lab_f1 #define TERM_l2 lab_f2 #define TERM_l3 lab_f3 #define TERM_l4 lab_f4 #define TERM_l5 lab_f5 #define TERM_l6 lab_f6 #define TERM_l7 lab_f7 #define TERM_l8 lab_f8 #define TERM_l9 lab_f9 #define TERM_la lab_f10 #define TERM_F1 key_f11 #define TERM_F2 key_f12 #define TERM_F3 key_f13 #define TERM_F4 key_f14 #define TERM_F5 key_f15 #define TERM_F6 key_f16 #define TERM_F7 key_f17 #define TERM_F8 key_f18 #define TERM_F9 key_f19 #define TERM_FA key_f20 #define TERM_k1 key_f1 #define TERM_k2 key_f2 #define TERM_k3 key_f3 #define TERM_k4 key_f4 #define TERM_k5 key_f5 #define TERM_k6 key_f6 #define TERM_k7 key_f7 #define TERM_k8 key_f8 #define TERM_k9 key_f9 #define TERM_k10 key_f10 #define TERM_k0 key_f0 #define TERM_kL key_dl #define TERM_kA key_il #define TERM_kD key_dc #define TERM_kI key_ic #define TERM_kC key_clear #define TERM_kE key_eol #define TERM_kP key_ppage #define TERM_kN key_npage #define TERM_at8 key_enter #define TERM_at1 key_beg #define TERM_at7 key_end #else /* !USETERMINFO */ #define tgetnum2 tgetnum #define tgetflag2 tgetflag #define TERM_pc "pc" #define TERM_bc "bc" #define TERM_co "co" #define TERM_li "li" #define TERM_xn "xn" #define TERM_xs "xs" #define TERM_gn "gn" #define TERM_ti "ti" #define TERM_te "te" #define TERM_mm "mm" #define TERM_mo "mo" #define TERM_cs "cs" #define TERM_ks "ks" #define TERM_ke "ke" #define TERM_ve "ve" #define TERM_vs "vs" #define TERM_vi "vi" #define TERM_sc "sc" #define TERM_rc "rc" #define TERM_bl "bl" #define TERM_vb "vb" #define TERM_cl "cl" #define TERM_me "me" #define TERM_md "md" #define TERM_mr "mr" #define TERM_mh "mh" #define TERM_mb "mb" #define TERM_so "so" #define TERM_us "us" #define TERM_se "se" #define TERM_ue "ue" #define TERM_ce "ce" #define TERM_al "al" #define TERM_dl "dl" #define TERM_ic "ic" #define TERM_IC "IC" #define TERM_dc "dc" #define TERM_DC "DC" #define TERM_cm "cm" #define TERM_ho "ho" #define TERM_cr "cr" #define TERM_nl "nl" #define TERM_sf "sf" #define TERM_sr "sr" #define TERM_up "up" #define TERM_UP "UP" #define TERM_do "do" #define TERM_DO "DO" #define TERM_nd "nd" #define TERM_RI "RI" #define TERM_le "le" #define TERM_LE "LE" #define TERM_AF "AF" #define TERM_AB "AB" #define TERM_Sf "Sf" #define TERM_Sb "Sb" #define TERM_cb "cb" #define TERM_as "as" #define TERM_ae "ae" #define TERM_ku "ku" #define TERM_kd "kd" #define TERM_kr "kr" #define TERM_kl "kl" #define TERM_kh "kh" #define TERM_kb "kb" #define TERM_l1 "l1" #define TERM_l2 "l2" #define TERM_l3 "l3" #define TERM_l4 "l4" #define TERM_l5 "l5" #define TERM_l6 "l6" #define TERM_l7 "l7" #define TERM_l8 "l8" #define TERM_l9 "l9" #define TERM_la "la" #define TERM_F1 "F1" #define TERM_F2 "F2" #define TERM_F3 "F3" #define TERM_F4 "F4" #define TERM_F5 "F5" #define TERM_F6 "F6" #define TERM_F7 "F7" #define TERM_F8 "F8" #define TERM_F9 "F9" #define TERM_FA "FA" #define TERM_k1 "k1" #define TERM_k2 "k2" #define TERM_k3 "k3" #define TERM_k4 "k4" #define TERM_k5 "k5" #define TERM_k6 "k6" #define TERM_k7 "k7" #define TERM_k8 "k8" #define TERM_k9 "k9" #define TERM_k10 "k;" #define TERM_k0 "k0" #define TERM_kL "kL" #define TERM_kA "kA" #define TERM_kD "kD" #define TERM_kI "kI" #define TERM_kC "kC" #define TERM_kE "kE" #define TERM_kP "kP" #define TERM_kN "kN" #define TERM_at8 "@8" #define TERM_at1 "@1" #define TERM_at7 "@7" #endif /* !USETERMINFO */ #define TERMCAPSIZE 2048 #ifndef FREAD # ifdef _FREAD # define FREAD _FREAD # else # define FREAD (O_RDONLY + 1) # endif #endif #if !MSDOS && !defined (USETERMINFO) extern int tgetent __P_((char *, CONST char *)); extern int tgetnum __P_((CONST char *)); extern int tgetflag __P_((CONST char *)); extern char *tgetstr __P_((CONST char *, char **)); extern int tputs __P_((CONST char *, int, int (*)__P_((tputs_t)))); #endif #ifdef DEBUG extern VOID muntrace __P_ ((VOID_A)); extern char *_mtrace_file; #endif #if !MSDOS static int NEAR chkctrl __P_((int)); static int NEAR getctrl __P_((CONST char *, CONST char *)); # ifdef USESGTTY static VOID NEAR ttymode __P_((int, int, int, int)); # else static VOID NEAR ttymode __P_((int, int, int, int, int, int, int, int)); # endif #endif /* !MSDOS */ static VOID NEAR terror __P_((CONST char *)); #if !MSDOS static char *NEAR tstrdup __P_((CONST char *)); #endif static VOID NEAR defaultterm __P_((VOID_A)); #if !MSDOS || defined (PC98) || defined (NOTUSEBIOS) static int NEAR Xungetch __P_((int)); #endif static int NEAR maxlocate __P_((int *, int *)); #if !MSDOS || !defined (USEVIDEOBIOS) static int NEAR pollterm __P_((int)); #endif static char *NEAR tparamstr __P_((CONST char *, int, int)); #if !MSDOS static char *NEAR tgetstr2 __P_((char **, CONST char *)); static char *NEAR tgetstr3 __P_((char **, CONST char *, CONST char *)); static char *NEAR tgetkeyseq __P_((int, CONST char *)); static kstree_t *NEAR newkeyseqtree __P_((kstree_t *, int)); static VOID NEAR freekeyseqtree __P_((kstree_t *, int)); static int cmpkeyseq __P_((CONST VOID_P, CONST VOID_P)); static VOID NEAR sortkeyseq __P_((VOID_A)); #endif #if MSDOS # ifdef USEVIDEOBIOS static VOID NEAR bioslocate __P_((int, int)); static VOID NEAR biosscroll __P_((int, int, int, int, int)); static VOID NEAR biosputch __P_((int, int)); static VOID NEAR bioscurstype __P_((int)); static VOID NEAR chgattr __P_((int)); static int NEAR evalcsi __P_((CONST char *)); # endif # if !defined (DJGPP) || defined (NOTUSEBIOS) || defined (PC98) static VOID NEAR dosgettime __P_((u_char [])); # endif #else /* !MSDOS */ static int putch2 __P_((tputs_t)); static kstree_t *NEAR searchkeyseq __P_((int, kstree_t *, int)); #endif /* !MSDOS */ #if !MSDOS && !defined (USETERMINFO) # ifdef NOTERMVAR # define T_EXTERN # else # define T_EXTERN extern # endif T_EXTERN short ospeed; T_EXTERN char PC; T_EXTERN char *BC; T_EXTERN char *UP; #endif int n_column = -1; int n_lastcolumn = -1; int n_line = -1; int stable_standout = 0; #if MSDOS CONST char *termstr[MAXTERMSTR]; #else char *termstr[MAXTERMSTR]; #endif u_char cc_intr = K_CTRL('C'); u_char cc_quit = K_CTRL('\\'); #if MSDOS u_char cc_eof = K_CTRL('Z'); #else u_char cc_eof = K_CTRL('D'); #endif u_char cc_eol = K_UNDEF; u_char cc_erase = K_CTRL('H'); int (*keywaitfunc)__P_((VOID_A)) = NULL; #if !MSDOS int usegetcursor = 0; int suspended = 0; char *duptty[2] = {NULL, NULL}; #endif int ttyio = -1; int isttyiomode = 0; XFILE *ttyout = NULL; int dumbterm = 0; #if MSDOS # ifdef PC98 #define KEYBUFWORKSEG 0x00 #define KEYBUFWORKSIZ 0x20 #define KEYBUFWORKMIN 0x502 #define KEYBUFWORKMAX 0x522 #define KEYBUFWORKTOP 0x524 #define KEYBUFWORKEND 0x526 #define KEYBUFWORKCNT 0x528 static CONST u_char specialkey[] = "\032:=<;89>\25667bcdefghijk\202\203\204\205\206\207\210\211\212\213?"; static CONST u_char metakey[] = "\035-+\037\022 !\"\027#$%/.\030\031\020\023\036\024\026,\021*\025)"; # else /* !PC98 */ #define KEYBUFWORKSEG 0x40 #define KEYBUFWORKSIZ 0x20 #define KEYBUFWORKMIN getkeybuf(0x80) #define KEYBUFWORKMAX (KEYBUFWORKMIN + KEYBUFWORKSIZ) #define KEYBUFWORKTOP (KEYBUFWORKMIN - 4) #define KEYBUFWORKEND (KEYBUFWORKMIN - 2) static CONST u_char specialkey[] = "\003HPMKRSGOIQ;<=>?@ABCDTUVWXYZ[\\]\206"; static CONST u_char metakey[] = "\0360. \022!\"#\027$%&21\030\031\020\023\037\024\026/\021-\025,"; # endif /* !PC98 */ # ifdef NOTUSEBIOS static u_short keybuftop = 0; # endif # ifdef USEVIDEOBIOS static u_short videoattr = 0x07; # endif static CONST int specialkeycode[] = { 0, K_UP, K_DOWN, K_RIGHT, K_LEFT, K_IC, K_DC, K_HOME, K_END, K_PPAGE, K_NPAGE, K_F(1), K_F(2), K_F(3), K_F(4), K_F(5), K_F(6), K_F(7), K_F(8), K_F(9), K_F(10), K_F(11), K_F(12), K_F(13), K_F(14), K_F(15), K_F(16), K_F(17), K_F(18), K_F(19), K_F(20), K_HELP }; #define SPECIALKEYSIZ arraysize(specialkeycode) #else /* !MSDOS */ static CONST char *dumblist[] = {"dumb", "un", "unknown"}; #define DUMBLISTSIZE arraysize(dumblist) static keyseq_t keyseq[K_MAX - K_MIN + 1]; static kstree_t *keyseqtree = NULL; static CONST char *defkeyseq[K_MAX - K_MIN + 1] = { NULL, /* K_NOKEY */ "\033OB", /* K_DOWN */ "\033OA", /* K_UP */ "\033OD", /* K_LEFT */ "\033OC", /* K_RIGHT */ "\033[1~", /* K_HOME */ "\b", /* K_BS */ NULL, /* K_F0 */ "\033[11~", /* K_F(1) */ "\033[12~", /* K_F(2) */ "\033[13~", /* K_F(3) */ "\033[14~", /* K_F(4) */ "\033[15~", /* K_F(5) */ "\033[17~", /* K_F(6) */ "\033[18~", /* K_F(7) */ "\033[19~", /* K_F(8) */ "\033[20~", /* K_F(9) */ "\033[21~", /* K_F(10) */ "\033[23~", /* K_F(11) */ "\033[24~", /* K_F(12) */ "\033[25~", /* K_F(13) */ "\033[26~", /* K_F(14) */ "\033[28~", /* K_F(15) */ "\033[29~", /* K_F(16) */ "\033[31~", /* K_F(17) */ "\033[32~", /* K_F(18) */ "\033[33~", /* K_F(19) */ "\033[34~", /* K_F(20) */ "\033OP", /* K_F(21) */ "\033OQ", /* K_F(22) */ "\033OR", /* K_F(23) */ "\033OS", /* K_F(24) */ "\033OT", /* K_F(25) */ "\033OU", /* K_F(26) */ "\033OV", /* K_F(27) */ "\033OW", /* K_F(28) */ "\033OX", /* K_F(29) */ "\033OY", /* K_F(30) */ NULL, /* 0447 */ NULL, /* 0450 */ NULL, /* 0451 */ NULL, /* 0452 */ NULL, /* 0453 */ NULL, /* 0454 */ NULL, /* 0455 */ NULL, /* 0456 */ NULL, /* 0457 */ NULL, /* 0460 */ NULL, /* 0461 */ "\033Oj", /* K_F('*') */ "\033Ok", /* K_F('+') */ "\033Ol", /* K_F(',') */ "\033Om", /* K_F('-') */ "\033On", /* K_F('.') */ "\033Oo", /* K_F('/') */ "\033Op", /* K_F('0') */ "\033Oq", /* K_F('1') */ "\033Or", /* K_F('2') */ "\033Os", /* K_F('3') */ "\033Ot", /* K_F('4') */ "\033Ou", /* K_F('5') */ "\033Ov", /* K_F('6') */ "\033Ow", /* K_F('7') */ "\033Ox", /* K_F('8') */ "\033Oy", /* K_F('9') */ NULL, /* 0502 */ NULL, /* 0503 */ NULL, /* 0504 */ "\033OX", /* K_F('=') */ NULL, /* 0506 */ "\033OM", /* K_F('?') */ "", /* K_DL */ "", /* K_IL */ "\177", /* K_DC */ "\033[2~", /* K_IC */ NULL, /* K_EIC */ "", /* K_CLR */ NULL, /* K_EOS */ NULL, /* K_EOL */ NULL, /* K_ESF */ NULL, /* K_ESR */ "\033[6~", /* K_NPAGE */ "\033[5~", /* K_PPAGE */ NULL, /* K_STAB */ NULL, /* K_CTAB */ NULL, /* K_CATAB */ "\033[9~", /* K_ENTER */ NULL, /* K_SRST */ NULL, /* K_RST */ NULL, /* K_PRINT */ NULL, /* K_LL */ NULL, /* K_A1 */ NULL, /* K_A3 */ NULL, /* K_B2 */ NULL, /* K_C1 */ NULL, /* K_C3 */ NULL, /* K_BTAB */ NULL, /* K_BEG */ NULL, /* K_CANC */ NULL, /* K_CLOSE */ NULL, /* K_COMM */ NULL, /* K_COPY */ NULL, /* K_CREAT */ "\033[4~", /* K_END */ NULL, /* K_EXIT */ NULL, /* K_FIND */ NULL, /* K_HELP */ }; #endif /* !MSDOS */ static u_char ungetbuf[16]; static int ungetnum = 0; static int termflags = 0; #define F_INITTTY 001 #define F_TERMENT 002 #define F_INITTERM 004 #define F_TTYCHANGED 010 #define F_WORKING 020 #define F_RESETTTY (F_INITTTY | F_TTYCHANGED) #ifdef CYGWIN static int cygterm = 0; #endif static CONST char *deftermstr[MAXTERMSTR] = { #ifdef PC98 "\033[>1h", /* T_INIT */ "\033[>1l", /* T_END */ "\033)3", /* T_METAMODE */ "\033)0", /* T_NOMETAMODE */ #else "", /* T_INIT */ "", /* T_END */ "", /* T_METAMODE */ "", /* T_NOMETAMODE */ #endif "", /* T_SCROLL */ #if MSDOS "", /* T_KEYPAD */ "", /* T_NOKEYPAD */ "\033[>5l", /* T_NORMALCURSOR */ "\033[>5l", /* T_HIGHCURSOR */ "\033[>5h", /* T_NOCURSOR */ "\033[s", /* T_SETCURSOR */ "\033[u", /* T_RESETCURSOR */ #else /* !MSDOS */ # ifdef BOW /* hack for bowpad */ "", /* T_KEYPAD */ "", /* T_NOKEYPAD */ "", /* T_NORMALCURSOR */ "", /* T_HIGHCURSOR */ "", /* T_NOCURSOR */ # else "\033[?1h\033=", /* T_KEYPAD */ "\033[?1l\033>", /* T_NOKEYPAD */ "\033[?25h", /* T_NORMALCURSOR */ "\033[?25h", /* T_HIGHCURSOR */ "\033[?25l", /* T_NOCURSOR */ # endif "\0337", /* T_SETCURSOR */ "\0338", /* T_RESETCURSOR */ #endif /* !MSDOS */ "\007", /* T_BELL */ "\007", /* T_VBELL */ "\033[;H\033[2J", /* T_CLEAR */ "\033[m", /* T_NORMAL */ "\033[1m", /* T_BOLD */ "\033[7m", /* T_REVERSE */ "\033[2m", /* T_DIM */ "\033[5m", /* T_BLINK */ "\033[7m", /* T_STANDOUT */ "\033[4m", /* T_UNDERLINE */ "\033[m", /* END_STANDOUT */ "\033[m", /* END_UNDERLINE */ "\033[K", /* L_CLEAR */ "\033[1K", /* L_CLEARBOL */ "\033[L", /* L_INSERT */ "\033[M", /* L_DELETE */ "", /* C_INSERT */ "", /* C_DELETE */ #if MSDOS "\033[%d;%dH", /* C_LOCATE */ #else /* !MSDOS */ # ifdef USETERMINFO "\033[%i%p1%d;%p2%dH", /* C_LOCATE */ # else "\033[%i%d;%dH", /* C_LOCATE */ # endif #endif /* !MSDOS */ "\033[H", /* C_HOME */ "\r", /* C_RETURN */ "\n", /* C_NEWLINE */ "\n", /* C_SCROLLFORW */ "", /* C_SCROLLREV */ "\033[A", /* C_UP */ "\n", /* C_DOWN */ "\033[C", /* C_RIGHT */ "\b", /* C_LEFT */ #ifdef USETERMINFO "\033[%p1%dA", /* C_NUP */ "\033[%p1%dB", /* C_NDOWN */ "\033[%p1%dC", /* C_NRIGHT */ "\033[%p1%dD", /* C_NLEFT */ "\033[3%p1%dm", /* T_FGCOLOR */ "\033[4%p1%dm", /* T_BGCOLOR */ #else "\033[%dA", /* C_NUP */ "\033[%dB", /* C_NDOWN */ "\033[%dC", /* C_NRIGHT */ "\033[%dD", /* C_NLEFT */ "\033[3%dm", /* T_FGCOLOR */ "\033[4%dm", /* T_BGCOLOR */ #endif }; #if MSDOS VOID inittty(reset) int reset; { # ifndef DJGPP static u_char dupbrk; union REGS reg; # endif static int dupin = -1; static int dupout = -1; int fd; if (termflags & F_WORKING) return; termflags |= F_WORKING; if (!reset) { if (opentty(&ttyio, &ttyout) < 0) terror("opentty()"); # ifdef NOTUSEBIOS if (!keybuftop) keybuftop = getkeybuf(KEYBUFWORKTOP); # endif # ifndef DJGPP reg.x.ax = 0x3300; int86(0x21, ®, ®); dupbrk = reg.h.dl; # endif if (!isatty(STDIN_FILENO)) { if (dupin < 0) dupin = newdup(safe_dup(STDIN_FILENO)); if (dupin < 0 || safe_dup2(ttyio, STDIN_FILENO) < 0) terror("dup2()"); } if (!isatty(STDOUT_FILENO)) { if (dupout < 0) dupout = newdup(safe_dup(STDOUT_FILENO)); if (dupout < 0 || safe_dup2(ttyio, STDOUT_FILENO) < 0) terror("dup2()"); } termflags |= F_INITTTY; } else if (termflags & F_INITTTY) { # ifndef DJGPP reg.x.ax = 0x3301; reg.h.dl = dupbrk; int86(0x21, ®, ®); # endif if (dupin >= 0) { fd = safe_dup2(dupin, STDIN_FILENO); safeclose(dupin); dupin = -1; if (fd < 0) { termflags &= ~F_INITTTY; terror("dup2()"); } } if (dupout >= 0) { fd = safe_dup2(dupout, STDOUT_FILENO); safeclose(dupout); dupout = -1; if (fd < 0) { termflags &= ~F_INITTTY; terror("dup2()"); } } } termflags &= ~F_WORKING; } VOID Xcooked(VOID_A) { # ifndef DJGPP union REGS reg; reg.x.ax = 0x3301; reg.h.dl = 1; int86(0x21, ®, ®); # endif } VOID Xcbreak(VOID_A) { # ifndef DJGPP union REGS reg; reg.x.ax = 0x3301; reg.h.dl = 0; int86(0x21, ®, ®); # endif } VOID Xraw(VOID_A) { # ifndef DJGPP union REGS reg; reg.x.ax = 0x3301; reg.h.dl = 0; int86(0x21, ®, ®); # endif } VOID Xecho(VOID_A) { } VOID Xnoecho(VOID_A) { } VOID Xnl(VOID_A) { } VOID Xnonl(VOID_A) { } VOID tabs(VOID_A) { } VOID notabs(VOID_A) { } VOID keyflush(VOID_A) { __term_regs reg; ungetnum = 0; disable(); reg.x.ax = 0x0c00; intdos2(®); # ifdef NOTUSEBIOS keybuftop = getkeybuf(KEYBUFWORKTOP); # endif enable(); } #else /* !MSDOS */ static int NEAR chkctrl(key) int key; { int i; if (!keyseqtree) return(key); for (i = 0; i < keyseqtree -> num; i++) if (key == keyseq[keyseqtree -> next[i].key].str[0]) return(K_UNDEF); return(key); } /*ARGSUSED*/ static int NEAR getctrl(buf, ccbuf) CONST char *buf, *ccbuf; { # ifdef USESGTTY struct tchars *ccp, cc; # endif static termioctl_t *ttyp, tty; if (ttyio < 0) return(-1); if (buf) ttyp = (termioctl_t *)buf; else if (tioctl(ttyio, REQGETP, &tty) < 0) return(-1); else ttyp = &tty; # ifdef USESGTTY if (ccbuf) ccp = (struct tchars *)ccbuf; else if (Xioctl(ttyio, TIOCGETC, &cc) < 0) return(-1); else ccp = &cc; cc_intr = chkctrl(ccp -> t_intrc); cc_quit = chkctrl(ccp -> t_quitc); cc_eof = chkctrl(ccp -> t_eofc); cc_eol = chkctrl(ccp -> t_brkc); cc_erase = chkctrl(ttyp -> sg_erase); # else /* !USESGTTY */ # ifdef VINTR cc_intr = chkctrl(ttyp -> c_cc[VINTR]); # endif # ifdef VQUIT cc_quit = chkctrl(ttyp -> c_cc[VQUIT]); # endif # ifdef VEOF cc_eof = chkctrl(ttyp -> c_cc[VEOF]); # endif # ifdef VEOL cc_eol = chkctrl(ttyp -> c_cc[VEOL]); # endif cc_erase = chkctrl(ttyp -> c_cc[VERASE]); # endif /* !USESGTTY */ return(0); } VOID inittty(reset) int reset; { # ifdef USESGTTY static int dupttyflag; # endif static termioctl_t dupttyio; termioctl_t tty; int n; if (termflags & F_WORKING) return; termflags |= F_WORKING; if (!reset) { if (opentty(&ttyio, &ttyout) < 0) terror("opentty()"); } else if (ttyio < 0 || (termflags & F_RESETTTY) != F_RESETTTY) { termflags &= ~F_WORKING; return; } n = 0; if (tioctl(ttyio, REQGETP, &tty) < 0) n = -2; else if (!reset) { memcpy((char *)&dupttyio, (char *)&tty, sizeof(termioctl_t)); # ifdef USESGTTY if (Xioctl(ttyio, TIOCLGET, &dupttyflag) < 0) n = -1; else # endif n = getctrl((CONST char *)&dupttyio, NULL); # ifndef USETERMINFO ospeed = getspeed(dupttyio); # endif termflags |= F_INITTTY; } else { if (tioctl(ttyio, REQSETP, &dupttyio) < 0) n = -2; # ifdef USESGTTY else if (Xioctl(ttyio, TIOCLSET, &dupttyflag) < 0) n = -2; # endif } if (n < 0) { if (n < -1) { safeclose(ttyio); ttyio = -1; } termflags &= ~F_INITTTY; terror("ioctl()"); } termflags &= ~F_WORKING; } # ifdef USESGTTY static VOID NEAR ttymode(set, reset, lset, lreset) int set, reset, lset, lreset; # else static VOID NEAR ttymode(set, reset, iset, ireset, oset, oreset, vmin, vtime) int set, reset, iset, ireset, oset, oreset, vmin, vtime; # endif { # ifdef USESGTTY int lflag; # endif termioctl_t tty; if (!(termflags & F_INITTTY) || (termflags & F_WORKING)) return; termflags |= F_WORKING; if (tioctl(ttyio, REQGETP, &tty) < 0) terror("ioctl()"); # ifdef USESGTTY if (Xioctl(ttyio, TIOCLGET, &lflag) < 0) terror("ioctl()"); if (set) tty.sg_flags |= set; if (reset) tty.sg_flags &= ~reset; if (lset) lflag |= lset; if (lreset) lflag &= ~lreset; if (Xioctl(ttyio, TIOCLSET, &lflag) < 0) terror("ioctl()"); # else /* !USESGTTY */ if (set) tty.c_lflag |= set; if (reset) tty.c_lflag &= ~reset; if (iset) tty.c_iflag |= iset; if (ireset) tty.c_iflag &= ~ireset; if (oset) tty.c_oflag |= oset; if (oreset) tty.c_oflag &= ~oreset; if (vmin) { tty.c_cc[VMIN] = vmin; tty.c_cc[VTIME] = vtime; } # endif /* !USESGTTY */ if (tioctl(ttyio, REQSETP, &tty) < 0) terror("ioctl()"); termflags |= F_TTYCHANGED; termflags &= ~F_WORKING; } VOID Xcooked(VOID_A) { # ifdef USESGTTY ttymode(0, CBREAK | RAW, LPASS8, LLITOUT | LPENDIN); # else ttymode(TIO_LCOOKED, PENDIN, TIO_ICOOKED, ~TIO_INOCOOKED, OPOST, 0, VAL_VMIN, VAL_VTIME); # endif } VOID Xcbreak(VOID_A) { # ifdef USESGTTY ttymode(CBREAK, 0, LLITOUT, 0); # else ttymode(TIO_LCBREAK, ICANON, TIO_ICOOKED, IGNBRK, OPOST, 0, 1, 0); # endif } VOID Xraw(VOID_A) { # ifdef USESGTTY ttymode(RAW, 0, LLITOUT, 0); # else ttymode(0, TIO_LCOOKED, IGNBRK, TIO_ICOOKED, 0, OPOST, 1, 0); # endif } VOID Xecho(VOID_A) { # ifdef USESGTTY ttymode(ECHO, 0, LCRTBS | LCRTERA | LCRTKIL | LCTLECH, 0); # else ttymode(TIO_LECHO, ECHONL, 0, 0, 0, 0, 0, 0); # endif } VOID Xnoecho(VOID_A) { # ifdef USESGTTY ttymode(0, ECHO, 0, LCRTBS | LCRTERA); # else ttymode(0, ~TIO_LNOECHO, 0, 0, 0, 0, 0, 0); # endif } VOID Xnl(VOID_A) { # ifdef USESGTTY ttymode(CRMOD, 0, 0, 0); # else ttymode(0, 0, ICRNL, 0, ONLCR, ~TIO_ONONL, 0, 0); # endif } VOID Xnonl(VOID_A) { # ifdef USESGTTY ttymode(0, CRMOD, 0, 0); # else ttymode(0, 0, 0, ICRNL, 0, ONLCR, 0, 0); # endif } VOID tabs(VOID_A) { # ifdef USESGTTY ttymode(0, XTABS, 0, 0); # else ttymode(0, 0, 0, 0, 0, TAB3, 0, 0); # endif } VOID notabs(VOID_A) { # ifdef USESGTTY ttymode(XTABS, 0, 0, 0); # else ttymode(0, 0, 0, 0, TAB3, 0, 0, 0); # endif } VOID keyflush(VOID_A) { int arg; ungetnum = 0; if (ttyio < 0) return; arg = FLSHIN; VOID_C ttyflush(ttyio, arg); } int savettyio(reset) int reset; { char *tty; int n; if (reset) tty = NULL; else { savetermio(ttyio, &tty, NULL); if (!tty) return(-1); # ifdef USESGTTY VOID_C getctrl(tty, &(tty[sizeof(termioctl_t) + sizeof(int)])); # else VOID_C getctrl(tty, NULL); # endif } n = (isttyiomode) ? 0 : 1; if (duptty[n]) free(duptty[n]); duptty[n] = tty; return(n); } #endif /* !MSDOS */ VOID ttyiomode(isnl) int isnl; { if (ttyio < 0) /*EMPTY*/; #if !MSDOS else if (duptty[0]) loadtermio(ttyio, duptty[0], NULL); #endif else { #if MSDOS Xraw(); #else /* !MSDOS */ # ifdef USESGTTY Xraw(); Xnoecho(); Xnonl(); notabs(); if (dumbterm > 1) ttymode(ECHO | CRMOD, 0, 0, 0); # else /* !USESGTTY */ if (isnl) ttymode(0, TIO_LCOOKED | ~TIO_LNOECHO, IGNBRK, TIO_ICOOKED | ICRNL, TIO_ONL | TAB3, 0, 1, 0); else ttymode(0, TIO_LCOOKED | ~TIO_LNOECHO, IGNBRK, TIO_ICOOKED | ICRNL, TAB3, TIO_ONL, 1, 0); if (dumbterm > 1) ttymode(ECHO, 0, ICRNL, 0, TIO_ONL, 0, 1, 0); # endif /* !USESGTTY */ #endif /* !MSDOS */ } if ((termflags & F_TERMENT) && !dumbterm) { putterm(T_KEYPAD); tflush(); } isttyiomode = isnl + 1; } VOID stdiomode(VOID_A) { #if !MSDOS && !defined (USESGTTY) int isnl; #endif if (ttyio < 0) /*EMPTY*/; #if !MSDOS else if (duptty[1]) loadtermio(ttyio, duptty[1], NULL); #endif else { #if MSDOS Xcooked(); #else /* !MSDOS */ # ifdef USESGTTY Xcooked(); Xecho(); Xnl(); tabs(); if (dumbterm > 2) ttymode(0, ECHO | CRMOD, 0, 0); # else /* !USESGTTY */ isnl = (isttyiomode) ? isttyiomode - 1 : 0; if (isnl) ttymode(TIO_LCOOKED | TIO_LECHO, PENDIN | ECHONL, TIO_ICOOKED | ICRNL, ~TIO_INOCOOKED, 0, ~TIO_ONONL | TAB3, VAL_VMIN, VAL_VTIME); else ttymode(TIO_LCOOKED | TIO_LECHO, PENDIN | ECHONL, TIO_ICOOKED | ICRNL, ~TIO_INOCOOKED, TIO_ONL, ~TIO_ONONL | TAB3, VAL_VMIN, VAL_VTIME); if (dumbterm > 2) ttymode(0, ECHO, 0, ICRNL, 0, ONLCR, VAL_VMIN, VAL_VTIME); # endif /* !USESGTTY */ #endif /* !MSDOS */ } if ((termflags & F_TERMENT) && !dumbterm) { putterm(T_NOKEYPAD); tflush(); } isttyiomode = 0; } int termmode(init) int init; { static int mode = 0; int oldmode; oldmode = mode; if (init >= 0 && mode != init) { if ((termflags & F_TERMENT) && !dumbterm) { putterms((init) ? T_INIT : T_END); tflush(); } mode = init; } return(oldmode); } VOID exit2(n) int n; { if ((termflags & F_TERMENT) && !dumbterm) putterm(T_NORMAL); endterm(); inittty(1); keyflush(); #ifdef DEBUG # if !MSDOS freeterment(); # endif VOID_C closetty(&ttyio, &ttyout); muntrace(); #endif /* DEBUG */ exit(n); } static VOID NEAR terror(mes) CONST char *mes; { int duperrno; duperrno = errno; if (termflags & F_INITTTY) { if ((termflags & F_TERMENT) && !dumbterm) putterm(T_NORMAL); endterm(); Xcooked(); Xecho(); Xnl(); tabs(); } if ((termflags & F_TERMENT) && dumbterm <= 2) VOID_C Xfputc('\007', Xstderr); VOID_C fputnl(Xstderr); errputs(mes, 0); if (duperrno) VOID_C Xfprintf(Xstderr, ": %s", Xstrerror(duperrno)); VOID_C fputnl(Xstderr); inittty(1); exit(2); } #if !MSDOS static char *NEAR tstrdup(s) CONST char *s; { char *cp; if (!s) s = ""; if (!(cp = (char *)malloc(strlen(s) + 1))) terror("malloc()"); Xstrcpy(cp, s); return(cp); } #endif /* !MSDOS */ static VOID NEAR defaultterm(VOID_A) { int i; if (dumbterm > 1) { #if MSDOS for (i = 0; i < MAXTERMSTR; i++) termstr[i] = ""; #else /* !MSDOS */ for (i = 0; i < MAXTERMSTR; i++) termstr[i] = tstrdup(NULL); # ifndef USETERMINFO PC = '\0'; BC = tstrdup(NULL); UP = tstrdup(NULL); # endif for (i = 0; i <= K_MAX - K_MIN; i++) { if (!(defkeyseq[i])) keyseq[i].str = NULL; else keyseq[i].str = tstrdup(NULL); } #endif /* !MSDOS */ } else { #if MSDOS for (i = 0; i < MAXTERMSTR; i++) termstr[i] = deftermstr[i]; #else /* !MSDOS */ for (i = 0; i < MAXTERMSTR; i++) termstr[i] = tstrdup(deftermstr[i]); # ifndef USETERMINFO PC = '\0'; BC = tstrdup("\010"); UP = tstrdup("\033[A"); # endif for (i = 0; i <= K_MAX - K_MIN; i++) { if (!(defkeyseq[i])) keyseq[i].str = NULL; else keyseq[i].str = tstrdup(defkeyseq[i]); } #endif /* !MSDOS */ } #if !MSDOS for (i = 0; i <= K_MAX - K_MIN; i++) { keyseq[i].code = K_MIN + i; keyseq[i].flags = 0; } for (i = 1; i <= 10; i++) { keyseq[K_F(i) - K_MIN].flags |= KF_HASALTER; keyseq[K_F(i + 20) - K_MIN].code = K_F(i) | K_ALTERNATE; keyseq[K_F(i + 20) - K_MIN].flags |= KF_HASALTER; } #endif } #if !MSDOS || defined (PC98) || defined (NOTUSEBIOS) static int NEAR Xungetch(c) int c; { if (c == EOF || ungetnum >= arraysize(ungetbuf)) return(EOF); ungetbuf[ungetnum++] = (u_char)c; return(c); } #endif /* !MSDOS || PC98 || NOTUSEBIOS */ #if MSDOS && defined (USEVIDEOBIOS) static int NEAR maxlocate(yp, xp) int *yp, *xp; { *xp = getbiosbyte(SCRWIDTH); *yp = getbiosbyte(SCRHEIGHT) + 1; return(0); } int getxy(xp, yp) int *xp, *yp; { __term_regs reg; reg.x.ax = 0x0300; reg.h.bh = getbiosbyte(CURRPAGE); intbios(VIDEOBIOS, ®); *xp = reg.h.dl + 1; *yp = reg.h.dh + 1; return(0); } #else /* !MSDOS || !USEVIDEOBIOS */ static int NEAR maxlocate(yp, xp) int *yp, *xp; { int i, x, y; # if !MSDOS if (!usegetcursor) return(-1); # endif if (getxy(&x, &y) < 0) x = y = 0; # if MSDOS VOID_C tputparam(C_LOCATE, 1, 999, 1); VOID_C tputparam(C_NDOWN, 999, 999, n_line); # else /* !MSDOS */ # if defined (CYGWIN) && (CYGWIN > 1007009) if (cygterm) { locate(998, 0); movecursor(-1, C_DOWN, 999); } else # endif locate(998, 998); # endif /* !MSDOS */ i = getxy(xp, yp); if (x > 0 && y > 0) locate(--x, --y); return(i); } /*ARGSUSED*/ static int NEAR pollterm(first) int first; { #if !MSDOS long usec; #endif #if MSDOS if (!(bdos(0x0b, 0, 0) & 0xff)) return(EOF); #else usec = WAITTERMINAL * 1000L; if (first) usec *= 10L; if (!kbhit2(usec)) return(EOF); #endif return(Xgetch()); } int getxy(xp, yp) int *xp, *yp; { char *format, buf[sizeof(SIZEFMT) + (MAXLONGWIDTH - 2) * 2]; int i, j, tmp, count, *val[2]; format = SIZEFMT; keyflush(); # if !MSDOS if (!usegetcursor) return(-1); # endif tputs2(GETSIZE, 1); tflush(); buf[0] = '\0'; do { if ((tmp = pollterm(1)) == EOF) break; buf[0] = tmp; } while (buf[0] != format[0]); i = 0; if (buf[0] == format[0]) for (i++; i < strsize(buf); i++) { if ((tmp = pollterm(0)) == EOF) break; buf[i] = tmp; if (buf[i] == format[strsize(SIZEFMT) - 1]) break; } keyflush(); # ifdef CYGWIN if (cygterm) /*EMPTY*/; else # endif for (;;) if (pollterm(0) == EOF) break; if (!i || buf[i++] != format[strsize(SIZEFMT) - 1]) return(-1); buf[i] = '\0'; count = 0; val[0] = yp; val[1] = xp; for (i = j = 0; format[i] && buf[j]; i++) { if (format[i] == '%' && format[i + 1] == 'd') { if ((tmp = getnum(buf, &j)) < 0) break; i++; if (count++ < 2) *(val[count - 1]) = tmp; } else if (format[i] != buf[j++]) break; } if (count != 2) return(-1); return(0); } #endif /* !MSDOS || !USEVIDEOBIOS */ #if MSDOS static char *NEAR tparamstr(s, arg1, arg2) CONST char *s; int arg1, arg2; { char *cp; if (Xasprintf(&cp, s, arg1, arg2) < 0) return(NULL); return(cp); } /*ARGSUSED*/ VOID getterment(s) CONST char *s; { if ((termflags & F_TERMENT) || (termflags & F_WORKING)) return; termflags |= F_WORKING; defaultterm(); if (n_column < 0) n_column = 80; n_lastcolumn = n_column - 1; if (n_line < 0) n_line = 25; termflags |= F_TERMENT; termflags &= ~F_WORKING; } #else /* !MSDOS */ static char *NEAR tparamstr(s, arg1, arg2) CONST char *s; int arg1, arg2; { # ifndef USETERMINFO printbuf_t pbuf; char *tmp; int i, j, n, pop, err, args[2]; # endif # ifdef USETERMINFO # ifdef DEBUG if (!s) return(NULL); _mtrace_file = "tparm(start)"; s = tparm((char *)s, arg1, arg2, 0, 0, 0, 0, 0, 0, 0); if (_mtrace_file) _mtrace_file = NULL; else { _mtrace_file = "tparm(end)"; malloc(0); /* dummy alloc */ } if (!s) return(NULL); # else if (!s || !(s = tparm((char *)s, arg1, arg2, 0, 0, 0, 0, 0, 0, 0))) return(NULL); # endif return(tstrdup(s)); # else /* !USETERMINFO */ if (!s || !(pbuf.buf = (char *)malloc(1))) return(NULL); pbuf.ptr = pbuf.size = 0; pbuf.flags = VF_NEW; args[0] = arg1; args[1] = arg2; pop = 0; for (i = n = 0; s[i]; i++) { tmp = NULL; err = 0; if (s[i] != '%' || s[++i] == '%') { if (setchar(s[i], &pbuf) < 0) return(NULL); } else if (n >= 2) err++; else switch (s[i]) { case 'd': if (Xasprintf(&tmp, "%d", args[n++]) < 0) err++; break; case '2': if (Xasprintf(&tmp, "%02d", args[n++]) < 0) err++; break; case '3': if (Xasprintf(&tmp, "%03d", args[n++]) < 0) err++; break; case '.': if (Xasprintf(&tmp, "%c", args[n++]) < 0) err++; break; case '+': if (!s[++i] || Xasprintf(&tmp, "%c", args[n++] + s[i]) < 0) err++; break; case '>': if (!s[++i] || !s[i + 1]) err++; else if (args[n] > s[i++]) args[n] += s[i]; break; case 'p': i++; if (s[i] == '1') { pop = 1; break; } else if (s[i] == '2') { if (pop) break; pop = 2; } else break; /*FALLTHRU*/ case 'r': j = args[0]; args[0] = args[1]; args[1] = j; break; case 'i': args[0]++; args[1]++; break; case 'n': args[0] ^= 0140; args[1] ^= 0140; break; case 'B': args[n] = ((args[n] / 10) << 4) | (args[n] % 10); break; case 'D': args[n] -= 2 * (args[n] % 16); break; default: err++; break; } if (err) { free(pbuf.buf); return(NULL); } if (tmp) { for (j = 0; tmp[j]; j++) if (setchar(tmp[j], &pbuf) < 0) return(NULL); free(tmp); } } pbuf.buf[pbuf.ptr] = '\0'; return(pbuf.buf); # endif /* !USETERMINFO */ } static char *NEAR tgetstr2(term, s) char **term; CONST char *s; { # ifndef USETERMINFO char strbuf[TERMCAPSIZE]; char *p; # endif # ifndef USETERMINFO p = strbuf; # ifdef DEBUG _mtrace_file = "tgetstr(start)"; s = tgetstr(s, &p); if (_mtrace_file) _mtrace_file = NULL; else { _mtrace_file = "tgetstr(end)"; malloc(0); /* dummy alloc */ } # else s = tgetstr(s, &p); # endif # endif /* !USETERMINFO */ if (s) { if (*term) free(*term); *term = tstrdup(s); } return(*term); } static char *NEAR tgetstr3(term, str1, str2) char **term; CONST char *str1, *str2; { # ifndef USETERMINFO char *p, strbuf[TERMCAPSIZE]; # endif char *str; # ifdef USETERMINFO str = (str1) ? tstrdup(str1) : tparamstr(str2, 1, 1); # else /* !USETERMINFO */ p = strbuf; # ifdef DEBUG _mtrace_file = "tgetstr(start)"; str = tgetstr(str1, &p); if (_mtrace_file) _mtrace_file = NULL; else { _mtrace_file = "tgetstr(end)"; malloc(0); /* dummy alloc */ } if (str) str = tstrdup(str); else { _mtrace_file = "tgetstr(start)"; str = tgetstr(str2, &p); if (_mtrace_file) _mtrace_file = NULL; else { _mtrace_file = "tgetstr(end)"; malloc(0); /* dummy alloc */ } str = tparamstr(str, 1, 1); } # else str = tgetstr(str1, &p); if (str) str = tstrdup(str); else { str = tgetstr(str2, &p); str = tparamstr(str, 1, 1); } # endif # endif /* !USETERMINFO */ if (str) { if (*term) free(*term); *term = str; } return(*term); } static char *NEAR tgetkeyseq(n, s) int n; CONST char *s; { char *cp; int i, j; n -= K_MIN; cp = NULL; if (!tgetstr2(&cp, s)) return(NULL); if ((keyseq[n].code & K_ALTERNATE) && *cp != '\033') return(NULL); for (i = 0; i <= K_MAX - K_MIN; i++) { if (!(keyseq[i].str)) continue; for (j = 0; cp[j]; j++) if ((cp[j] & 0x7f) != (keyseq[i].str[j] & 0x7f)) break; if (cp[j]) continue; free(keyseq[i].str); keyseq[i].str = NULL; keyseq[i].flags &= ~KF_DEFINED; } if (!(keyseq[n].str) || !(keyseq[n].flags & KF_HASALTER)) i = -1; else for (i = K_MAX - K_MIN; i >= 0; i--) { if (i == n) continue; if (alternate(keyseq[n].code) == alternate(keyseq[i].code)) break; } if (i < 0 || (keyseq[i].flags & KF_DEFINED)) /*EMPTY*/; else if (!(keyseq[n].code & K_ALTERNATE) || !(keyseq[i].str)) { if (keyseq[i].str) free(keyseq[i].str); keyseq[i].str = keyseq[n].str; keyseq[i].flags = keyseq[n].flags; keyseq[n].str = NULL; } if (keyseq[n].str) free(keyseq[n].str); keyseq[n].str = cp; keyseq[n].flags |= KF_DEFINED; return(cp); } static kstree_t *NEAR newkeyseqtree(parent, num) kstree_t *parent; int num; { kstree_t *new; int n; if (!parent || !(parent -> next)) new = (kstree_t *)malloc(num * sizeof(kstree_t)); else new = (kstree_t *)realloc(parent -> next, num * sizeof(kstree_t)); if (!new) terror("realloc()"); if (!parent) n = 0; else { n = parent -> num; parent -> num = (u_char)num; parent -> next = new; } while (n < num) { new[n].key = (u_char)-1; new[n].num = (u_char)0; new[n++].next = (kstree_t *)NULL; } return(new); } static VOID NEAR freekeyseqtree(list, n) kstree_t *list; int n; { int i; if (!list) return; for (i = (int)(list[n].num) - 1; i >= 0; i--) freekeyseqtree(list[n].next, i); if (!n) free(list); } static int cmpkeyseq(vp1, vp2) CONST VOID_P vp1; CONST VOID_P vp2; { keyseq_t *kp1, *kp2; int n; kp1 = (keyseq_t *)vp1; kp2 = (keyseq_t *)vp2; if (!(kp1 -> str)) return(-1); if (!(kp2 -> str)) return(1); n = (kp1 -> len < kp2 -> len) ? kp1 -> len : kp2 -> len; if ((n = memcmp(kp1 -> str, kp2 -> str, n))) return(n); return((int)(kp1 -> len) - (int)(kp2 -> len)); } static VOID NEAR sortkeyseq(VOID_A) { kstree_t *p; int i, j, k; qsort(keyseq, K_MAX - K_MIN + 1, sizeof(keyseq_t), cmpkeyseq); if (keyseqtree) freekeyseqtree(keyseqtree, 0); keyseqtree = newkeyseqtree(NULL, 1); for (i = 0; i <= K_MAX - K_MIN; i++) { p = keyseqtree; for (j = 0; j < keyseq[i].len; j++) { for (k = 0; k < p -> num; k++) { if (keyseq[i].str[j] == keyseq[p -> next[k].key].str[j]) break; } if (k >= p -> num) { newkeyseqtree(p, k + 1); p -> next[k].key = (u_char)i; } p = &(p -> next[k]); } } } VOID getterment(s) CONST char *s; { # ifndef USETERMINFO char buf[TERMCAPSIZE]; # endif # ifdef IRIX int winterm; /* for STUPID winterm entry */ # endif CONST char *term; char *cp; int i, j, dumb, dupdumbterm; if ((termflags & F_TERMENT) || (termflags & F_WORKING)) return; termflags |= F_WORKING; dupdumbterm = dumbterm; dumbterm = dumb = 0; term = (s) ? s : (char *)getenv(ENVTERM); if (!term || !*term) { dumbterm = 1; dumb = DUMBLISTSIZE; } else { for (i = 0; i < DUMBLISTSIZE; i++) if (!strcmp(term, dumblist[i])) break; if (i < DUMBLISTSIZE) dumbterm = 1; # ifdef IRIX winterm = !strncmp(term, WINTERMNAME, strsize(WINTERMNAME)); # endif # ifdef CYGWIN cygterm = !strcmp(term, CYGTERMNAME); # endif } for (;;) { if (dumb) term = dumblist[--dumb]; # ifdef USETERMINFO # ifdef DEBUG _mtrace_file = "setupterm(start)"; setupterm((char *)term, Xfileno(ttyout), &i); if (_mtrace_file) _mtrace_file = NULL; else { _mtrace_file = "setupterm(end)"; malloc(0); /* dummy alloc */ } # else setupterm((char *)term, Xfileno(ttyout), &i); # endif if (i == 1) break; # else /* !USETERMINFO */ # ifdef DEBUG _mtrace_file = "tgetent(start)"; i = tgetent(buf, term); if (_mtrace_file) _mtrace_file = NULL; else { _mtrace_file = "tgetent(end)"; malloc(0); /* dummy malloc */ } # else i = tgetent(buf, term); # endif if (i > 0) break; # endif /* !USETERMINFO */ else if (dumb) continue; /* retry for libncurses */ else if (s) { dumbterm = 2; break; } else { errno = 0; # ifdef USETERMINFO terror("No TERMINFO is prepared"); # else terror("No TERMCAP is prepared"); # endif } } if (dupdumbterm >= 2 || !strcmp(term, "emacs") || ((cp = getenv(ENVEMACS)) && !strcmp(cp, "t"))) dumbterm = 3; defaultterm(); termflags |= F_TERMENT; if (dumbterm > 1) { for (i = 0; i <= K_MAX - K_MIN; i++) keyseq[i].len = (keyseq[i].str) ? strlen(keyseq[i].str) : 0; sortkeyseq(); termflags &= ~F_WORKING; return; } # ifndef USETERMINFO cp = NULL; if (tgetstr2(&cp, TERM_pc)) { PC = *cp; free(cp); } tgetstr2(&BC, TERM_bc); tgetstr2(&UP, TERM_up); # endif cp = NULL; if (tgetstr2(&cp, TERM_ku) || tgetstr2(&cp, TERM_kd) || tgetstr2(&cp, TERM_kr) || tgetstr2(&cp, TERM_kl)) { free(cp); *(termstr[T_KEYPAD]) = *(termstr[T_NOKEYPAD]) = '\0'; for (i = K_DOWN; i <= K_RIGHT; i++) { if (keyseq[i - K_MIN].str) { free(keyseq[i - K_MIN].str); keyseq[i - K_MIN].str = NULL; } } } if (n_column < 0 && (n_column = tgetnum2(TERM_co)) < 0) n_column = 80; n_lastcolumn = n_column; if (!tgetflag2(TERM_xn)) n_lastcolumn--; if (n_line < 0 && (n_line = tgetnum2(TERM_li)) < 0) n_column = 24; stable_standout = tgetflag2(TERM_xs); if (dumbterm < 2 && tgetflag2(TERM_gn)) dumbterm = 2; tgetstr2(&(termstr[T_INIT]), TERM_ti); tgetstr2(&(termstr[T_END]), TERM_te); tgetstr2(&(termstr[T_METAMODE]), TERM_mm); tgetstr2(&(termstr[T_NOMETAMODE]), TERM_mo); tgetstr2(&(termstr[T_SCROLL]), TERM_cs); tgetstr2(&(termstr[T_KEYPAD]), TERM_ks); tgetstr2(&(termstr[T_NOKEYPAD]), TERM_ke); # ifdef IRIX if (winterm) /*EMPTY*/; else # endif { tgetstr2(&(termstr[T_NORMALCURSOR]), TERM_ve); tgetstr2(&(termstr[T_HIGHCURSOR]), TERM_vs); tgetstr2(&(termstr[T_NOCURSOR]), TERM_vi); } tgetstr2(&(termstr[T_SETCURSOR]), TERM_sc); tgetstr2(&(termstr[T_RESETCURSOR]), TERM_rc); tgetstr2(&(termstr[T_BELL]), TERM_bl); tgetstr2(&(termstr[T_VBELL]), TERM_vb); tgetstr2(&(termstr[T_CLEAR]), TERM_cl); tgetstr2(&(termstr[T_NORMAL]), TERM_me); tgetstr2(&(termstr[T_BOLD]), TERM_md); tgetstr2(&(termstr[T_REVERSE]), TERM_mr); tgetstr2(&(termstr[T_DIM]), TERM_mh); tgetstr2(&(termstr[T_BLINK]), TERM_mb); tgetstr2(&(termstr[T_STANDOUT]), TERM_so); tgetstr2(&(termstr[T_UNDERLINE]), TERM_us); tgetstr2(&(termstr[END_STANDOUT]), TERM_se); tgetstr2(&(termstr[END_UNDERLINE]), TERM_ue); tgetstr2(&(termstr[L_CLEAR]), TERM_ce); tgetstr2(&(termstr[L_CLEARBOL]), TERM_cb); tgetstr2(&(termstr[L_INSERT]), TERM_al); tgetstr2(&(termstr[L_DELETE]), TERM_dl); tgetstr3(&(termstr[C_INSERT]), TERM_ic, TERM_IC); tgetstr3(&(termstr[C_DELETE]), TERM_dc, TERM_DC); tgetstr2(&(termstr[C_LOCATE]), TERM_cm); tgetstr2(&(termstr[C_HOME]), TERM_ho); tgetstr2(&(termstr[C_RETURN]), TERM_cr); tgetstr2(&(termstr[C_NEWLINE]), TERM_nl); tgetstr2(&(termstr[C_SCROLLFORW]), TERM_sf); tgetstr2(&(termstr[C_SCROLLREV]), TERM_sr); tgetstr3(&(termstr[C_UP]), TERM_up, TERM_UP); tgetstr3(&(termstr[C_DOWN]), TERM_do, TERM_DO); tgetstr3(&(termstr[C_RIGHT]), TERM_nd, TERM_RI); tgetstr3(&(termstr[C_LEFT]), TERM_le, TERM_LE); tgetstr2(&(termstr[C_NUP]), TERM_UP); tgetstr2(&(termstr[C_NDOWN]), TERM_DO); tgetstr2(&(termstr[C_NRIGHT]), TERM_RI); tgetstr2(&(termstr[C_NLEFT]), TERM_LE); # if !defined (HPUX) || !defined (USETERMINFO) \ || (defined (set_a_foreground) && defined (set_foreground)) /* Hack for HP-UX 10.20 */ cp = NULL; if (tgetstr2(&cp, TERM_AF) || tgetstr2(&cp, TERM_Sf)) { if (termstr[T_FGCOLOR]) free(termstr[T_FGCOLOR]); termstr[T_FGCOLOR] = cp; } # endif # if !defined (HPUX) || !defined (USETERMINFO) \ || (defined (set_a_background) && defined (set_background)) /* Hack for HP-UX 10.20 */ cp = NULL; if (tgetstr2(&cp, TERM_AB) || tgetstr2(&cp, TERM_Sb)) { if (termstr[T_BGCOLOR]) free(termstr[T_BGCOLOR]); termstr[T_BGCOLOR] = cp; } # endif tgetkeyseq(K_UP, TERM_ku); tgetkeyseq(K_DOWN, TERM_kd); tgetkeyseq(K_RIGHT, TERM_kr); tgetkeyseq(K_LEFT, TERM_kl); tgetkeyseq(K_HOME, TERM_kh); tgetkeyseq(K_BS, TERM_kb); tgetkeyseq(K_F(1), TERM_k1); tgetkeyseq(K_F(2), TERM_k2); tgetkeyseq(K_F(3), TERM_k3); tgetkeyseq(K_F(4), TERM_k4); tgetkeyseq(K_F(5), TERM_k5); tgetkeyseq(K_F(6), TERM_k6); tgetkeyseq(K_F(7), TERM_k7); tgetkeyseq(K_F(8), TERM_k8); tgetkeyseq(K_F(9), TERM_k9); tgetkeyseq(K_F(10), TERM_k10); tgetkeyseq(K_F(11), TERM_F1); tgetkeyseq(K_F(12), TERM_F2); tgetkeyseq(K_F(13), TERM_F3); tgetkeyseq(K_F(14), TERM_F4); tgetkeyseq(K_F(15), TERM_F5); tgetkeyseq(K_F(16), TERM_F6); tgetkeyseq(K_F(17), TERM_F7); tgetkeyseq(K_F(18), TERM_F8); tgetkeyseq(K_F(19), TERM_F9); tgetkeyseq(K_F(20), TERM_FA); tgetkeyseq(K_F(21), TERM_l1); /* Hack for NEWS-OS bug */ tgetkeyseq(K_F(22), TERM_l2); /* Hack for NEWS-OS bug */ tgetkeyseq(K_F(23), TERM_l3); /* Hack for NEWS-OS bug */ tgetkeyseq(K_F(24), TERM_l4); /* Hack for NEWS-OS bug */ tgetkeyseq(K_F(25), TERM_l5); /* Hack for NEWS-OS bug */ tgetkeyseq(K_F(26), TERM_l6); /* Hack for NEWS-OS bug */ tgetkeyseq(K_F(27), TERM_l7); /* Hack for NEWS-OS bug */ tgetkeyseq(K_F(28), TERM_l8); /* Hack for NEWS-OS bug */ tgetkeyseq(K_F(29), TERM_l9); /* Hack for NEWS-OS bug */ tgetkeyseq(K_F(30), TERM_la); /* Hack for NEWS-OS bug */ tgetkeyseq(K_DL, TERM_kL); tgetkeyseq(K_IL, TERM_kA); tgetkeyseq(K_DC, TERM_kD); tgetkeyseq(K_IC, TERM_kI); tgetkeyseq(K_CLR, TERM_kC); tgetkeyseq(K_EOL, TERM_kE); tgetkeyseq(K_PPAGE, TERM_kP); tgetkeyseq(K_NPAGE, TERM_kN); # if !defined (HPUX) || !defined (USETERMINFO) \ || (defined (key_enter) && defined (key_beg) && defined (key_end)) /* Hack for HP-UX 10.20 */ # ifdef IRIX if (winterm) /*EMPTY*/; else # endif tgetkeyseq(K_ENTER, TERM_at8); tgetkeyseq(K_BEG, TERM_at1); tgetkeyseq(K_END, TERM_at7); # endif /* !HPUX || !USETERMINFO || (key_enter && key_beg && key_end) */ for (i = 0; i <= K_MAX - K_MIN; i++) { if (!(keyseq[i].str)) keyseq[i].len = 0; else { for (j = 0; keyseq[i].str[j]; j++) keyseq[i].str[j] &= 0x7f; keyseq[i].len = j; if (j == 1 && keyseq[i].str[0] == cc_erase) cc_erase = K_UNDEF; } } sortkeyseq(); termflags &= ~F_WORKING; } VOID freeterment(VOID_A) { int i; if (!(termflags & F_TERMENT)) return; # ifndef USETERMINFO if (BC) free(BC); if (UP) free(UP); # endif for (i = 0; i < MAXTERMSTR; i++) if (termstr[i]) { free(termstr[i]); termstr[i] = NULL; } for (i = 0; i <= K_MAX - K_MIN; i++) { if (keyseq[i].str) free(keyseq[i].str); keyseq[i].str = NULL; keyseq[i].len = keyseq[i].flags = 0; } if (keyseqtree) { freekeyseqtree(keyseqtree, 0); keyseqtree = NULL; } termflags &= ~F_TERMENT; } VOID regetterment(s, tty) CONST char *s; int tty; { int wastty; if ((wastty = isttyiomode) && tty) stdiomode(); freeterment(); getterment(s); if (wastty && tty) ttyiomode(wastty - 1); } VOID setdefterment(VOID_A) { freeterment(); defaultterm(); } VOID setdefkeyseq(VOID_A) { int i; for (i = 0; i <= K_MAX - K_MIN; i++) { if (keyseq[i].str) free(keyseq[i].str); if (!(defkeyseq[i])) { keyseq[i].str = NULL; keyseq[i].len = 0; } else { keyseq[i].str = tstrdup(defkeyseq[i]); keyseq[i].len = strlen(keyseq[i].str); } keyseq[i].code = K_MIN + i; keyseq[i].flags = 0; } for (i = 1; i <= 10; i++) { keyseq[K_F(i) - K_MIN].flags |= KF_HASALTER; keyseq[K_F(i + 20) - K_MIN].code = K_F(i) | K_ALTERNATE; keyseq[K_F(i + 20) - K_MIN].flags |= KF_HASALTER; } sortkeyseq(); } int getdefkeyseq(kp) keyseq_t *kp; { CONST char *cp; if (kp -> code < K_MIN || kp -> code > K_MAX) /*EMPTY*/; else if (!(cp = defkeyseq[kp -> code - K_MIN])) /*EMPTY*/; else { kp -> str = (char *)cp; kp -> len = strlen(cp); return(0); } kp -> len = 0; return(-1); } VOID setkeyseq(n, str, len) int n; char *str; int len; { int i; for (i = 0; i <= K_MAX - K_MIN; i++) if (keyseq[i].code == n) { if (keyseq[i].str) free(keyseq[i].str); keyseq[i].str = str; keyseq[i].len = len; keyseq[i].flags |= KF_DEFINED; break; } if (i > K_MAX - K_MIN) { free(str); return; } if (str) { for (i = 0; i <= K_MAX - K_MIN; i++) { if (alternate(keyseq[i].code) == n || !(keyseq[i].str) || keyseq[i].len != len) continue; if (!memcmp(str, keyseq[i].str, len)) { free(keyseq[i].str); keyseq[i].str = NULL; keyseq[i].len = 0; keyseq[i].flags &= ~KF_DEFINED; } } if (str[0] == cc_erase && !(str[1])) cc_erase = K_UNDEF; } sortkeyseq(); } int getkeyseq(kp) keyseq_t *kp; { int i; for (i = 0; i <= K_MAX - K_MIN; i++) { if (keyseq[i].code == kp -> code) { memcpy((char *)kp, (char *)&(keyseq[i]), sizeof(keyseq_t)); return(0); } } kp -> len = 0; return(-1); } keyseq_t *copykeyseq(list) keyseq_t *list; { int i; if (list) { for (i = 0; i <= K_MAX - K_MIN; i++) { keyseq[i].code = list[i].code; keyseq[i].len = list[i].len; keyseq[i].flags = list[i].flags; if (keyseq[i].str) free(keyseq[i].str); if (!(list[i].len)) keyseq[i].str = NULL; else { keyseq[i].str = (char *)malloc(list[i].len + 1); if (!keyseq[i].str) terror("malloc()"); memcpy(keyseq[i].str, list[i].str, list[i].len); } } sortkeyseq(); } else { list = (keyseq_t *)malloc((K_MAX - K_MIN + 1) * sizeof(keyseq_t)); if (!list) terror("malloc()"); for (i = 0; i <= K_MAX - K_MIN; i++) { list[i].code = keyseq[i].code; list[i].len = keyseq[i].len; list[i].flags = keyseq[i].flags; if (!(keyseq[i].len)) list[i].str = NULL; else { list[i].str = (char *)malloc(keyseq[i].len + 1); if (!list[i].str) terror("malloc()"); memcpy(list[i].str, keyseq[i].str, keyseq[i].len); } } } return(list); } VOID freekeyseq(list) keyseq_t *list; { int i; if (!list) return; for (i = 0; i <= K_MAX - K_MIN; i++) if (list[i].str) free(list[i].str); free(list); } #endif /* !MSDOS */ int tputparam(n, arg1, arg2, cnt) int n, arg1, arg2, cnt; { char *cp; if (n < 0 || n >= MAXTERMSTR) return(-1); if (!(termstr[n])) return(-1); if (!(cp = tparamstr(termstr[n], arg1, arg2))) return(-1); n = 0; if (!*cp) n = -1; else tputs2(cp, cnt); free(cp); return(n); } VOID initterm(VOID_A) { if (!(termflags & F_TERMENT)) getterment(NULL); VOID_C termmode(1); if ((termflags & F_TERMENT) && !dumbterm) { putterm(T_KEYPAD); tflush(); } termflags |= F_INITTERM; } VOID endterm(VOID_A) { if (!(termflags & F_INITTERM)) return; VOID_C termmode(0); if ((termflags & F_TERMENT) && !dumbterm) { putterm(T_NOKEYPAD); tflush(); } termflags &= ~F_INITTERM; } VOID putterm(n) int n; { if (n < 0 || n >= MAXTERMSTR) return; if (!(termstr[n])) return; tputs2(termstr[n], 1); } #if MSDOS && defined (USEVIDEOBIOS) static VOID NEAR bioslocate(x, y) int x, y; { __term_regs reg; reg.x.ax = 0x0200; reg.h.bh = getbiosbyte(CURRPAGE); reg.h.dh = y - 1; reg.h.dl = x - 1; intbios(VIDEOBIOS, ®); } static VOID NEAR biosscroll(d, sx, sy, ex, ey) int d, sx, sy, ex, ey; { __term_regs reg; if (sx > ex || sy > ey) return; if (d >= 0) { reg.h.ah = 0x06; reg.h.al = d; } else { reg.h.ah = 0x07; reg.h.al = -d; } reg.h.bh = videoattr; reg.h.ch = sy - 1; reg.h.cl = sx - 1; reg.h.dh = ey - 1; reg.h.dl = ex - 1; intbios(VIDEOBIOS, ®); } static VOID NEAR biosputch(c, n) int c, n; { __term_regs reg; reg.h.ah = 0x09; reg.h.al = (c & 0xff); reg.h.bh = getbiosbyte(CURRPAGE); reg.h.bl = videoattr; reg.x.cx = n; intbios(VIDEOBIOS, ®); } static VOID NEAR bioscurstype(n) int n; { __term_regs reg; reg.x.ax = 0x0300; reg.h.bh = getbiosbyte(CURRPAGE); intbios(VIDEOBIOS, ®); reg.x.ax = 0x0100; reg.x.cx &= 0x1f1f; reg.x.cx |= (n & 0x6000); intbios(VIDEOBIOS, ®); } int Xputch(c) int c; { static int needscroll = 0; int n, x, y, w, h; if (c == '\007') { bdos(0x06, '\007', 0); return(c); } getxy(&x, &y); w = getbiosbyte(SCRWIDTH); h = getbiosbyte(SCRHEIGHT) + 1; if (c == '\b') { if (x > 1) x--; needscroll = 0; } else if (c == '\t') { if (x >= w && y >= h && needscroll) { x = 1; biosscroll(1, 1, 1, w, h); bioslocate(x, y); } needscroll = 0; n = 8 - ((x - 1) % 8); if (x + n <= w) x += n; else { n = w - x + 1; x = 1; if (y < h) y++; else { x = w; needscroll = 1; } } biosputch(' ', n); } else if (c == '\r') { x = 1; needscroll = 0; } else if (c == '\n') { if (y < h) y++; else biosscroll(1, 1, 1, w, h); needscroll = 0; } else { if (x >= w && y >= h && needscroll) { x = 1; biosscroll(1, 1, 1, w, h); bioslocate(x, y); } needscroll = 0; if (x < w) x++; else { x = 1; if (y < h) y++; else { x = w; needscroll = 1; } } biosputch(c, 1); } bioslocate(x, y); return(c); } #else /* !MSDOS || !USEVIDEOBIOS */ int Xputch(c) int c; { c = Xfputc(c, ttyout); if (c == EOF) return(-1); return(c); } #endif /* !MSDOS || !USEVIDEOBIOS */ #if MSDOS # ifdef USEVIDEOBIOS static VOID NEAR chgattr(n) int n; { switch (n) { case 0: videoattr = 0x07; break; case 1: videoattr |= 0x08; break; case 4: videoattr &= 0xf0; videoattr |= 0x01; break; case 5: videoattr |= 0x80; break; case 7: videoattr = 0x70; break; case 8: videoattr = 0x08; break; case 30: case 31: case 32: case 33: case 34: case 35: case 36: case 37: videoattr &= 0xf0; n -= 30; if (n & 1) videoattr |= 0x04; if (n & 2) videoattr |= 0x02; if (n & 4) videoattr |= 0x01; break; case 40: case 41: case 42: case 43: case 44: case 45: case 46: case 47: videoattr &= 0x0f; n -= 40; if (n & 1) videoattr |= 0x40; if (n & 2) videoattr |= 0x20; if (n & 4) videoattr |= 0x10; break; default: break; } } static int NEAR evalcsi(s) CONST char *s; { static int savex, savey; int i, x, y, w, h, n1, n2; i = 0; if (s[i] == '>') { i++; if ((n1 = getnum(s, &i)) < 0) i = -1; else if (s[i] == 'h') { if (n1 == 5) bioscurstype(0x2000); else i = -1; } else if (s[i] == 'l') { if (n1 == 5) bioscurstype(0x0000); else i = -1; } else i = -1; } else { getxy(&x, &y); w = getbiosbyte(SCRWIDTH); h = getbiosbyte(SCRHEIGHT) + 1; n1 = getnum(s, &i); if (s[i] != ';') n2 = -1; else { i++; n2 = getnum(s, &i); } switch (s[i]) { case 'A': if (n1 <= 0) n1 = 1; if ((y -= n1) <= 0) y = 1; bioslocate(x, y); break; case 'B': if (n1 <= 0) n1 = 1; if ((y += n1) > h) y = h; bioslocate(x, y); break; case 'C': if (n1 <= 0) n1 = 1; if ((x += n1) > w) x = w; bioslocate(x, y); break; case 'D': if (n1 <= 0) n1 = 1; if ((x -= n1) <= 0) x = 1; bioslocate(x, y); break; case 'H': case 'f': x = n2; y = n1; if (x <= 0) x = 1; else if (x > w) x = w; if (y <= 0) y = 1; else if (y > h) y = h; bioslocate(x, y); break; case 'm': if (n1 < 0) chgattr(0); else { chgattr(n1); if (n2 >= 0) chgattr(n2); } break; case 's': savex = x; savey = y; break; case 'u': x = savex; y = savey; if (x <= 0) x = 1; else if (x > w) x = w; if (y <= 0) y = 1; else if (y > h) y = h; bioslocate(savex, savey); break; case 'L': if (n1 <= 0) n1 = 1; biosscroll(-n1, 1, y, w, h); bioslocate(1, y); break; case 'M': if (n1 <= 0) n1 = 1; biosscroll(n1, 1, y, w, h); bioslocate(1, y); break; case 'J': switch (n1) { case -1: case 0: biosscroll(0, x, y, w, y); biosscroll(0, 1, y + 1, w, h); break; case 1: biosscroll(0, 1, y, x, y); biosscroll(0, 1, 1, w, y - 1); break; case 2: biosscroll(0, 1, 1, w, h); bioslocate(1, 1); break; default: break; } break; case 'K': switch (n1) { case -1: case 0: biosscroll(0, x, y, w, y); break; case 1: biosscroll(0, 1, y, x, y); break; case 2: biosscroll(0, 1, y, w, y); break; default: break; } break; default: i = -1; break; } } return(i); } VOID Xcputs(s) CONST char *s; { if (!s) return; for (; *s; s++) VOID_C Xputch(*s); } /*ARGSUSED*/ VOID tputs2(s, n) CONST char *s; int n; { if (!s) return; for (; *s; s++) { if (*s != '\033' || s[1] != '[') /*EMPTY*/; else if ((n = evalcsi(&(s[2]))) >= 0) { s += n + 2; continue; } VOID_C Xputch(*s); } } # else /* !USEVIDEOBIOS */ VOID Xcputs(s) CONST char *s; { int x, y; if (!s) return; for (; *s; s++) { if (*s != '\t') { VOID_C Xputch(*s); continue; } keyflush(); if (getxy(&x, &y) < 0) x = 1; do { VOID_C Xputch(' '); } while (x++ % 8); } } /*ARGSUSED*/ VOID tputs2(s, n) CONST char *s; int n; { if (!s) return; VOID_C Xfputs(s, ttyout); } # endif /* !USEVIDEOBIOS */ /*ARGSUSED*/ int kbhit2(usec) long usec; { # if defined (NOTUSEBIOS) || defined (NOSELECT) union REGS reg; # else /* !NOTUSEBIOS && !NOSELECT */ # ifndef PC98 struct timeval tv; int n; # endif # endif /* !NOTUSEBIOS && !NOSELECT */ if (ungetnum > 0) return(1); # ifdef NOTUSEBIOS reg.x.ax = 0x4406; reg.x.bx = ttyio; putterm(T_METAMODE); int86(0x21, ®, ®); putterm(T_NOMETAMODE); return((reg.x.flags & 1) ? 0 : reg.h.al); # else /* !NOTUSEBIOS */ # ifdef PC98 reg.h.ah = 0x01; int86(0x18, ®, ®); return(reg.h.bh != 0); # else /* !PC98 */ # ifdef NOSELECT reg.h.ah = 0x01; int86(0x16, ®, ®); return((reg.x.flags & 0x40) ? 0 : 1); # else /* !NOSELECT */ tv.tv_sec = usec / 1000000L; tv.tv_usec = usec % 1000000L; if ((n = sureselect(1, &ttyio, NULL, &tv, SEL_TTYIO)) < 0) terror("select()"); return(n); # endif /* !NOSELECT */ # endif /* !PC98 */ # endif /* !NOTUSEBIOS */ } int Xgetch(VOID_A) { # ifdef NOTUSEBIOS u_short key, top; # endif # if defined (PC98) && !defined (NOTUSEBIOS) union REGS reg; # endif # if defined (PC98) || defined (NOTUSEBIOS) int ch; # endif if (ttyio < 0) return(EOF); if (ungetnum > 0) return((int)ungetbuf[--ungetnum]); # ifndef NOTUSEBIOS # ifdef PC98 reg.h.ah = 0x00; int86(0x18, ®, ®); if (!(ch = reg.h.al)) VOID_C Xungetch(reg.h.ah); return(ch); # else /* !PC98 */ return(bdos(0x07, 0x00, 0) & 0xff); # endif /* !PC98 */ # else /* NOTUSEBIOS */ disable(); top = keybuftop; for (;;) { if (top == getkeybuf(KEYBUFWORKEND)) { key = 0xffff; break; } key = getkeybuf(top); # ifdef PC98 if ((ch = (key & 0xff))) { if (ch < 0x80 || (ch > 0x9f && ch < 0xe0)) break; key &= 0xff00; if (Xstrchr(metakey, key >> 8)) break; } # else if ((ch = (key & 0xff)) && ch != 0xe0 && ch != 0xf0) break; key &= 0xff00; # endif if (Xstrchr(specialkey, key >> 8)) break; if ((top += 2) >= KEYBUFWORKMAX) top = KEYBUFWORKMIN; } putterm(T_METAMODE); ch = (bdos(0x07, 0x00, 0) & 0xff); putterm(T_NOMETAMODE); keybuftop = getkeybuf(KEYBUFWORKTOP); if (!(key & 0xff)) { while (kbhit2(1000000L / SENSEPERSEC)) { if (keybuftop != getkeybuf(KEYBUFWORKTOP)) break; putterm(T_METAMODE); bdos(0x07, 0x00, 0); putterm(T_NOMETAMODE); } ch = '\0'; VOID_C Xungetch(key >> 8); } enable(); return(ch); # endif /* NOTUSEBIOS */ } # if !defined (DJGPP) || defined (NOTUSEBIOS) || defined (PC98) static VOID NEAR dosgettime(tbuf) u_char tbuf[]; { union REGS reg; reg.x.ax = 0x2c00; intdos(®, ®); tbuf[0] = reg.h.ch; tbuf[1] = reg.h.cl; tbuf[2] = reg.h.dh; } # endif /*ARGSUSED*/ int getkey2(sig, code, timeout) int sig, code, timeout; { # if !defined (DJGPP) || defined (NOTUSEBIOS) || defined (PC98) static u_char tbuf1[3] = {0xff, 0xff, 0xff}; u_char tbuf2[3]; # endif # if defined (DJGPP) && (DJGPP >= 2) static int count = SENSEPERSEC; # endif int i, ch; timeout *= SENSEPERSEC; # if defined (DJGPP) && !defined (NOTUSEBIOS) && !defined (PC98) do { i = kbhit2(1000000L / SENSEPERSEC); # ifndef NOSELECT if (sig && !(--count)) { count = SENSEPERSEC; raise(sig); } # endif if (timeout && !--timeout) return(K_TIMEOUT); if (keywaitfunc && (ch = (*keywaitfunc)()) < 0) return(ch); } while (!i); # else /* !DJGPP || NOTUSEBIOS || PC98 */ if (tbuf1[0] == 0xff) dosgettime(tbuf1); while (!kbhit2(1000000L / SENSEPERSEC)) { dosgettime(tbuf2); if (memcmp((char *)tbuf1, (char *)tbuf2, sizeof(tbuf1))) { # if !defined (DJGPP) || (DJGPP >= 2) if (sig) raise(sig); # endif memcpy((char *)tbuf1, (char *)tbuf2, sizeof(tbuf1)); } if (keywaitfunc && (ch = (*keywaitfunc)()) < 0) return(ch); } # endif /* !DJGPP || NOTUSEBIOS || PC98 */ if ((ch = Xgetch()) == EOF) return(K_NOKEY); if (ch) switch (ch) { case '\010': ch = K_BS; break; case '\177': ch = K_DC; break; default: break; } # if defined (PC98) || defined (NOTUSEBIOS) || !defined (NOSELECT) else if (!kbhit2(WAITKEYPAD * 1000L)) /*EMPTY*/; # endif else if ((ch = Xgetch()) == EOF) ch = K_NOKEY; else { for (i = 0; i < SPECIALKEYSIZ; i++) if (ch == specialkey[i]) return(specialkeycode[i]); for (i = 0; i <= 'z' - 'a'; i++) if (ch == metakey[i]) return(mkmetakey('a' + i)); ch = K_NOKEY; } return(ch); } int ungetkey2(c, desc) int c, desc; { if (c == EOF || ttyio < 0) return(EOF); if (ungetnum >= arraysize(ungetbuf)) return(EOF); if (!desc) ungetbuf[ungetnum] = (u_char)c; else { memmove((char *)&(ungetbuf[1]), (char *)&(ungetbuf[0]), ungetnum * sizeof(u_char)); ungetbuf[0] = (u_char)c; } ungetnum++; return(c); } /*ARGSUSED*/ int setscroll(s, e) int s, e; { return(0); } VOID locate(x, y) int x, y; { tprintf(termstr[C_LOCATE], 1, ++y, ++x); } VOID tflush(VOID_A) { #ifndef USEVIDEOBIOS VOID_C Xfflush(ttyout); #endif } char *getwsize(xmax, ymax) int xmax, ymax; { int x, y; keyflush(); if (maxlocate(&y, &x) < 0) x = y = -1; if (x > 0) { n_lastcolumn = (n_lastcolumn < n_column) ? x - 1 : x; n_column = x; } if (y > 0) n_line = y; if (n_column <= 0 || (xmax > 0 && n_column < xmax)) return("Column size too small"); if (n_line <= 0 || (ymax > 0 && n_line < ymax)) return("Line size too small"); return(NULL); } /*ARGSUSED*/ VOID setwsize(fd, xmax, ymax) int fd, xmax, ymax; { } #else /* !MSDOS */ VOID Xcputs(s) CONST char *s; { if (!s) return; VOID_C Xfputs(s, ttyout); } static int putch2(c) tputs_t c; { return(Xfputc(c & 0x7f, ttyout)); } VOID tputs2(s, n) CONST char *s; int n; { tputs(s, n, putch2); } VOID putterms(n) int n; { if (n < 0 || n >= MAXTERMSTR) return; if (!(termstr[n])) return; tputs2(termstr[n], n_line); } VOID checksuspend(VOID_A) { if (suspended) ttyiomode((isttyiomode) ? isttyiomode - 1 : 0); suspended = 0; } int kbhit2(usec) long usec; { # ifndef NOSELECT struct timeval tv; int n; # endif if (ttyio < 0) return(0); if (ungetnum > 0) return(1); # ifdef NOSELECT return((usec) ? 1 : 0); # else tv.tv_sec = usec / 1000000L; tv.tv_usec = usec % 1000000L; if ((n = sureselect(1, &ttyio, NULL, &tv, SEL_TTYIO)) < 0) terror("select()"); return(n); # endif } int Xgetch(VOID_A) { u_char ch; int n; if (ttyio < 0) return(EOF); if (ungetnum > 0) return((int)ungetbuf[--ungetnum]); for (;;) { checksuspend(); n = read(ttyio, &ch, sizeof(u_char)); if (n >= 0 || errno != EINTR) break; } if (n < (int)sizeof(u_char)) return(EOF); return((int)ch); } static kstree_t *NEAR searchkeyseq(key, p, ptr) int key; kstree_t *p; int ptr; { int i; if (p && p -> next) for (i = 0; i < p -> num; i++) if (key == keyseq[p -> next[i].key].str[ptr]) return(&(p -> next[i])); return(NULL); } /*ARGSUSED*/ int getkey2(sig, code, timeout) int sig, code, timeout; { static int count = SENSEPERSEC; kstree_t *p; keyseq_t *seq; int n, ch, key, wasmeta; timeout *= SENSEPERSEC; do { key = kbhit2(1000000L / SENSEPERSEC); if (sig && !(--count)) { count = SENSEPERSEC; kill(getpid(), sig); } if (timeout && !--timeout) return(K_TIMEOUT); if (keywaitfunc && (ch = (*keywaitfunc)()) < 0) return(ch); } while (!key); if ((key = ch = Xgetch()) == EOF) return(K_NOKEY); # if defined (DEP_KCONV) || defined (CODEEUC) else if (key != C_EKANA) /*EMPTY*/; # ifdef DEP_KCONV # ifdef CODEEUC else if (code != EUC && code != NOCNV) /*EMPTY*/; # else else if (code != EUC) /*EMPTY*/; # endif # endif /* DEP_KCONV */ else { ch = (kbhit2(WAITKANJI * 1000L)) ? Xgetch() : EOF; if (ch == EOF) return(key); if (Xiskana(ch)) return(mkekana(ch)); VOID_C Xungetch(ch); return(key); } # endif /* DEP_KCONV || CODEEUC */ if (cc_erase != K_UNDEF && key == cc_erase) return(K_BS); n = wasmeta = 0; if (key == K_ESC) { ch = (kbhit2(WAITKEYPAD * 1000L)) ? Xgetch() : EOF; if (ch == EOF) return(key); if (Xisalpha(ch)) wasmeta = mkmetakey(ch); if (!(p = searchkeyseq(key, keyseqtree, n))) { if (wasmeta) return(wasmeta); VOID_C Xungetch(ch); return(key); } seq = &(keyseq[p -> key]); if (++n >= seq -> len) return(seq -> code); } else { if (!(p = searchkeyseq(key, keyseqtree, n))) return(key); seq = &(keyseq[p -> key]); if (++n >= seq -> len) return(seq -> code); ch = (kbhit2(WAITKEYPAD * 1000L)) ? Xgetch() : EOF; if (ch == EOF) return(key); } while ((p = searchkeyseq(ch, p, n))) { seq = &(keyseq[p -> key]); if (++n >= seq -> len) return(seq -> code); ch = (kbhit2(WAITKEYPAD * 1000L)) ? Xgetch() : EOF; if (ch == EOF) break; } VOID_C Xungetch(ch); while (--n > 0) VOID_C Xungetch(seq -> str[n]); if (wasmeta) { if (ungetnum) ungetnum--; return(wasmeta); } return(key); } int getkey3(sig, code, timeout) int sig, code, timeout; { int ch; if ((ch = getkey2(sig, code, timeout)) < 0) return(ch); if (ch >= K_F('*') && ch < K_DL) { if (ch == K_F('?')) ch = K_CR; else ch -= K_F0; } return(alternate(ch)); } int ungetkey2(c, desc) int c, desc; { # ifdef TIOCSTI u_char ch; # endif if (c == EOF || ttyio < 0) return(EOF); if (!desc) return(Xungetch(c)); # ifdef TIOCSTI ch = c; VOID_C Xioctl(ttyio, TIOCSTI, &ch); # else if (ungetnum >= arraysize(ungetbuf)) return(EOF); memmove((char *)&(ungetbuf[1]), (char *)&(ungetbuf[0]), ungetnum * sizeof(u_char)); ungetbuf[0] = (u_char)c; ungetnum++; # endif return(c); } int setscroll(s, e) int s, e; { return tputparam(T_SCROLL, s, e, 1); } VOID locate(x, y) int x, y; { VOID_C tputparam(C_LOCATE, y, x, 1); } VOID tflush(VOID_A) { VOID_C Xfflush(ttyout); } char *getwsize(xmax, ymax) int xmax, ymax; { # ifndef NOTERMWSIZE termwsize_t ws; # endif int x, y, tx, ty; x = y = -1; # ifndef NOTERMWSIZE memset((char *)&ws, 0, sizeof(ws)); if (Xioctl(ttyio, REQGETWS, &ws) >= 0) { # ifdef TIOCGWINSZ if (ws.ws_col > 0) x = ws.ws_col; if (ws.ws_row > 0) y = ws.ws_row; # else /* !TIOCGWINSZ */ # ifdef WIOCGETD if (ws.uw_width > 0 && ws.uw_hs > 0) x = ws.uw_width / ws.uw_hs; if (ws.uw_height > 0 && ws.uw_vs > 0) y = ws.uw_height / ws.uw_vs; # else /* !WIOCGETD */ # ifdef TIOCGSIZE if (ws.ts_cols > 0) x = ws.ts_cols; if (ws.ts_lines > 0) y = ws.ts_lines; # endif /* !TIOCGSIZE */ # endif /* !WIOCGETD */ # endif /* !TIOCGWINSZ */ } # endif /* !NOTERMWSIZE */ if (dumbterm) /*EMPTY*/; else if (usegetcursor || x < 0 || y < 0) { if (usegetcursor) VOID_C setscroll(-1, -1); else VOID_C setscroll(0, 998); if (maxlocate(&ty, &tx) >= 0 && (tx > x || ty > y)) { if (tx > x) x = tx; if (ty > y) y = ty; setwsize(ttyio, x, y); } } if (x > 0) { n_lastcolumn = (n_lastcolumn < n_column) ? x - 1 : x; n_column = x; } if (y > 0) n_line = y; if (n_column <= 0 || (xmax > 0 && n_column < xmax)) return("Column size too small"); if (n_line <= 0 || (ymax > 0 && n_line < ymax)) return("Line size too small"); if (xmax > 0 && ymax > 0) VOID_C setscroll(0, n_line - 1); return(NULL); } VOID setwsize(fd, xmax, ymax) int fd, xmax, ymax; { # ifndef NOTERMWSIZE termwsize_t ws; memset((char *)&ws, 0, sizeof(ws)); VOID_C Xioctl(fd, REQGETWS, &ws); # ifdef TIOCGWINSZ if (ws.ws_col <= 0 || ws.ws_xpixel <= 0) ws.ws_xpixel = 0; else ws.ws_xpixel += (xmax - ws.ws_col) * (ws.ws_xpixel / ws.ws_col); if (ws.ws_row <= 0 || ws.ws_ypixel <= 0) ws.ws_ypixel = 0; else ws.ws_ypixel += (ymax - ws.ws_row) * (ws.ws_ypixel / ws.ws_row); ws.ws_col = xmax; ws.ws_row = ymax; # else /* !TIOCGWINSZ */ # ifdef WIOCGETD if (ws.uw_hs <= 0 || ws.uw_vs <= 0) return; ws.uw_width = xmax * ws.uw_hs; ws.uw_height = ymax * ws.uw_vs; # else /* !WIOCGETD */ # ifdef TIOCGSIZE ws.ts_cols = xmax; ws.ts_lines = ymax; # endif /* !TIOCGSIZE */ # endif /* !WIOCGETD */ # endif /* !TIOCGWINSZ */ VOID_C Xioctl(fd, REQSETWS, &ws); # endif /* !NOTERMWSIZE */ } #endif /* !MSDOS */ int cvasprintf(sp, fmt, args) char **sp; CONST char *fmt; va_list args; { int n; n = Xvasprintf(sp, fmt, args); if (n < 0) terror("malloc()"); return(n); } #ifdef USESTDARGH /*VARARGS1*/ int Xcprintf(CONST char *fmt, ...) #else /*VARARGS1*/ int Xcprintf(fmt, va_alist) CONST char *fmt; va_dcl #endif { va_list args; char *buf; int n; VA_START(args, fmt); n = cvasprintf(&buf, fmt, args); va_end(args); Xcputs(buf); free(buf); return(n); } #ifdef USESTDARGH /*VARARGS2*/ VOID tprintf(CONST char *fmt, int cnt, ...) #else /*VARARGS2*/ VOID tprintf(fmt, cnt, va_alist) CONST char *fmt; int cnt; va_dcl #endif { va_list args; char *buf; VA_START(args, cnt); VOID_C cvasprintf(&buf, fmt, args); va_end(args); tputs2(buf, cnt); free(buf); } VOID cputnl(VOID_A) { Xcputs("\r\n"); tflush(); } int kanjiputs(s) CONST char *s; { return(Xcprintf("%k", s)); } VOID attrputs(s, isstandout) CONST char *s; int isstandout; { if (!s || !*s) return; if (isstandout) putterm(T_STANDOUT); Xcputs(s); if (isstandout) putterm(END_STANDOUT); } #ifdef USESTDARGH /*VARARGS2*/ int attrprintf(CONST char *fmt, int isstandout, ...) #else /*VARARGS2*/ int attrprintf(fmt, isstandout, va_alist) CONST char *fmt; int isstandout; va_dcl #endif { va_list args; char *buf; int n; VA_START(args, isstandout); n = cvasprintf(&buf, fmt, args); va_end(args); attrputs(buf, isstandout); free(buf); return(n); } int attrkanjiputs(s, isstandout) CONST char *s; int isstandout; { return(attrprintf("%k", isstandout, s)); } VOID chgcolor(color, reverse) int color, reverse; { int fg, bg; if (reverse) { fg = (color == ANSI_BLACK) ? ANSI_WHITE : ANSI_BLACK; bg = color; } else { fg = color; bg = -1; } if (tputparam(T_FGCOLOR, fg, 0, 1) < 0) tprintf("\033[%dm", 1, fg + ANSI_NORMAL); if (bg < 0) /*EMPTY*/; else if (tputparam(T_BGCOLOR, bg, 0, 1) < 0) tprintf("\033[%dm", 1, bg + ANSI_REVERSE); } VOID movecursor(n1, n2, c) int n1, n2, c; { if (tputparam(n1, c, c, n_line) < 0) while (c--) putterms(n2); } FD-3.01j/stream.c100644 2105 1751 47113 13516612560 12346 0ustar shiraiuser/* * stream.c * * stream I/O functions */ #include "headers.h" #include "depend.h" #include "typesize.h" #include "malloc.h" #include "sysemu.h" #include "pathname.h" #include "termio.h" #include "stream.h" #ifdef DEP_STREAMSOCKET #include "socket.h" #endif #if defined (FD) && !defined (DEP_ORIGSHELL) #include "string.h" #include "pathname.h" #include "wait.h" #include "dosdisk.h" #include "unixdisk.h" #endif #define PIPEDIR "PIPE_DIR" #define PIPEFILE "FAKEPIPE" #ifdef USECRNL #define ISCRNL(fp) (!((fp) -> status & XS_BINARY) \ || ((fp) -> flags & XF_CRNL)) #else #define ISCRNL(fp) ((fp) -> flags & XF_CRNL) #endif #if defined (FD) && !defined (DEP_ORIGSHELL) # ifdef USESIGACTION extern sigcst_t signal2 __P_((int, sigcst_t)); # else #define signal2 signal # endif # ifdef DEP_DOSLFN extern char *preparefile __P_((CONST char *, char *)); # endif #endif /* FD && !DEP_ORIGSHELL */ #ifdef FD extern char *Xstrchr __P_((CONST char *, int)); #endif #ifdef DEP_DOSDRIVE extern int dosflushbuf __P_((int)); #endif #if defined (FD) && !defined (DEP_ORIGSHELL) extern int mktmpdir __P_((char *)); extern int rmtmpdir __P_((CONST char *)); #endif #if defined (FD) && !defined (DEP_ORIGSHELL) extern char *deftmpdir; extern char *tmpfilename; #endif #ifdef DEP_ORIGSTREAM static int NEAR mode2flags __P_((CONST char *, int *)); # ifdef DEP_STREAMLOG static XFILE *NEAR fmalloc __P_((int, int, int, int, CONST char *)); # else static XFILE *NEAR fmalloc __P_((int, int, int)); # endif static int NEAR checkfp __P_((XFILE *, int)); # ifdef DEP_STREAMLOG static VOID NEAR dumplog __P_((CONST char *, ALLOC_T, XFILE *)); # endif static int NEAR fillbuf __P_((XFILE *)); static int NEAR flushbuf __P_((XFILE *)); # ifdef DEP_STREAMSOCKET static int NEAR replytelnet __P_((XFILE *)); # endif #endif /* DEP_ORIGSTREAM */ #if !defined (FD) && !defined (DEP_ORIGSTREAM) static char *NEAR fgets2 __P_((int)); #endif #ifdef DEP_ORIGSTREAM static XFILE stdiobuf[] = { {STDIN_FILENO, XS_RDONLY, 0}, {STDOUT_FILENO, XS_WRONLY, XF_LINEBUF}, {STDERR_FILENO, XS_WRONLY, XF_NOBUF}, }; #define STDIOBUFSIZ arraysize(stdiobuf) #endif /* DEP_ORIGSTREAM */ #if defined (FD) && !defined (DEP_ORIGSHELL) # if !MSDOS static p_id_t popenpid = (p_id_t)-1; # endif static int popenstat = 0; #endif /* FD && !DEP_ORIGSHELL */ #ifdef DEP_ORIGSTREAM int (*stream_isnfsfunc)__P_((CONST char *)) = NULL; XFILE *Xstdin = &(stdiobuf[0]); XFILE *Xstdout = &(stdiobuf[1]); XFILE *Xstderr = &(stdiobuf[2]); #endif #ifdef DEP_ORIGSTREAM static int NEAR mode2flags(mode, flagsp) CONST char *mode; int *flagsp; { int flags; if (!mode) { errno = EINVAL; return(-1); } flags = 0; if (flagsp) flags |= (*flagsp & ~O_ACCMODE); switch (*(mode++)) { case 'r': flags |= O_RDONLY; break; case 'w': flags |= (O_WRONLY | O_CREAT | O_TRUNC); break; case 'a': flags |= (O_WRONLY | O_APPEND | O_CREAT); break; default: errno = EINVAL; return(-1); /*NOTREACHED*/ break; } if (*mode == '+') { flags &= ~O_ACCMODE; flags |= O_RDWR; mode++; } flags |= O_BINARY; if (flagsp) *flagsp = flags; return((*mode == 'b') ? 1 : 0); } # ifdef DEP_STREAMLOG static XFILE *NEAR fmalloc(fd, flags, isbin, timeout, path) int fd, flags, isbin, timeout; CONST char *path; # else static XFILE *NEAR fmalloc(fd, flags, isbin) int fd, flags, isbin; # endif { XFILE *fp; ALLOC_T len; len = sizeof(XFILE); # ifdef DEP_STREAMLOG if (!path) path = nullstr; len += strlen(path); # endif fp = (XFILE *)Xmalloc(len); fp -> fd = fd; # ifdef DEP_STREAMTIMEOUT # ifdef DEP_STREAMLOG fp -> timeout = timeout; # else fp -> timeout = -1; # endif # endif /* DEP_STREAMTIMEOUT */ fp -> ptr = fp -> count = (ALLOC_T)0; fp -> status = fp -> flags = 0; # ifdef DEP_STREAMLOG fp -> dumpfunc = NULL; fp -> debuglvl = 0; fp -> debugmes = NULL; Xstrcpy(fp -> path, path); # endif switch (flags & O_ACCMODE) { case O_RDONLY: fp -> status |= XS_RDONLY; break; case O_WRONLY: fp -> status |= XS_WRONLY; break; default: break; } if (isbin) fp -> status |= XS_BINARY; return(fp); } XFILE *Xfopen(path, mode) CONST char *path, *mode; { # ifdef DEP_STREAMLOCK # ifndef NOFTRUNCATE int trunc; # endif int isnfs, operation; # endif /* DEP_STREAMLOCK */ XFILE *fp; int fd, flags, isbin; flags = 0; if ((isbin = mode2flags(mode, &flags)) < 0) return(NULL); # ifdef DEP_STREAMLOCK isnfs = (stream_isnfsfunc) ? (*stream_isnfsfunc)(path) : 1; # ifndef NOFTRUNCATE if (isnfs) trunc = 0; else { trunc = (flags & O_TRUNC); flags &= ~O_TRUNC; } # endif # endif /* DEP_STREAMLOCK */ fd = Xopen(path, flags, 0666); if (fd < 0) return(NULL); # ifdef DEP_STREAMLOG fp = fmalloc(fd, flags, isbin, -1, path); # else fp = fmalloc(fd, flags, isbin); # endif if (!fp) { VOID_C Xclose(fd); return(NULL); } # ifdef DEP_STREAMLOCK if (!isnfs) { operation = ((flags & O_ACCMODE) == O_RDONLY) ? LOCK_SH : LOCK_EX; if (Xflock(fd, operation | LOCK_NB) < 0) { VOID_C Xfclose(fp); return(NULL); } fp -> status |= XS_LOCKED; # ifndef NOFTRUNCATE if (trunc && Xftruncate(fd, (off_t)0) < 0) { VOID_C Xfclose(fp); return(NULL); } # endif } # endif /* DEP_STREAMLOCK */ return(fp); } XFILE *Xfdopen(fd, mode) int fd; CONST char *mode; { # if !MSDOS int n; # endif XFILE *fp; int flags, isbin; flags = 0; if ((isbin = mode2flags(mode, &flags)) < 0) return(NULL); # if !MSDOS n = fcntl(fd, F_GETFL); if (n < 0) return(NULL); if ((flags & O_APPEND) != (n & O_APPEND)) { errno = EINVAL; return(NULL); } switch (n & O_ACCMODE) { case O_RDONLY: if ((flags & O_ACCMODE) != O_RDONLY) { errno = EINVAL; return(NULL); } break; case O_WRONLY: if ((flags & O_ACCMODE) != O_WRONLY) { errno = EINVAL; return(NULL); } break; default: break; } # endif /* !MSDOS */ # ifdef DEP_STREAMLOG fp = fmalloc(fd, flags, isbin, -1, NULL); # else fp = fmalloc(fd, flags, isbin); # endif if (!fp) return(NULL); return(fp); } int Xfclose(fp) XFILE *fp; { int i, duperrno; if (!fp) { errno = EINVAL; return(EOF); } if (fp -> status & XS_CLOSED) return(0); duperrno = errno; if (flushbuf(fp) < 0) return(EOF); # ifdef DEP_STREAMLOCK if (fp -> status & XS_LOCKED) { VOID_C Xlseek(fp -> fd, (off_t)0, L_XTND); VOID_C Xflock(fp -> fd, LOCK_UN); } # endif /* DEP_STREAMLOCK */ if (!(fp -> flags & XF_NOCLOSE)) { # ifdef DEP_STREAMSOCKET if (fp -> flags & XF_CONNECTED) shutdown(fp -> fd, SHUT_RDWR); # endif if (Xclose(fp -> fd) < 0) return(EOF); } for (i = 0; i < STDIOBUFSIZ; i++) if (fp == &(stdiobuf[i])) break; if (i >= STDIOBUFSIZ) Xfree(fp); else { fp -> status |= XS_CLOSED; fp -> status &= ~(XS_EOF | XS_ERROR | XS_READ | XS_WRITTEN); fp -> ptr = fp -> count = (ALLOC_T)0; } errno = duperrno; return(0); } static int NEAR checkfp(fp, status) XFILE *fp; int status; { if (!fp) { errno = EINVAL; return(-1); } if ((status & XS_ERROR) && (fp -> status & XS_ERROR)) return(-1); if ((status & XS_RDONLY) && (fp -> status & XS_WRONLY)) { errno = EBADF; fp -> status |= XS_ERROR; return(-1); } if ((status & XS_WRONLY) && (fp -> status & XS_RDONLY)) { errno = EBADF; fp -> status |= XS_ERROR; return(-1); } return(0); } VOID Xclearerr(fp) XFILE *fp; { if (checkfp(fp, 0) < 0) return; fp -> status &= ~(XS_EOF | XS_ERROR); } int Xfeof(fp) XFILE *fp; { if (checkfp(fp, 0) < 0) return(-1); return(fp -> status & (XS_EOF | XS_CLOSED)); } int Xferror(fp) XFILE *fp; { if (checkfp(fp, 0) < 0) return(-1); return(fp -> status & XS_ERROR); } int Xfileno(fp) XFILE *fp; { if (checkfp(fp, 0) < 0) return(-1); return(fp -> fd); } VOID Xsetflags(fp, flags) XFILE *fp; int flags; { if (checkfp(fp, 0) < 0) return; fp -> flags |= flags; } # ifdef DEP_STREAMTIMEOUT VOID Xsettimeout(fp, timeout) XFILE *fp; int timeout; { if (checkfp(fp, 0) < 0) return; fp -> timeout = timeout; } # endif /* DEP_STREAMTIMEOUT */ # ifdef DEP_STREAMLOG static VOID NEAR dumplog(buf, size, fp) CONST char *buf; ALLOC_T size; XFILE *fp; { if (!(fp -> dumpfunc) || !(fp -> debuglvl)) return; if (debuglevel < fp -> debuglvl - 1) return; (*(fp -> dumpfunc))((CONST u_char *)buf, size, fp -> debugmes); } # endif /* DEP_STREAMLOG */ static int NEAR fillbuf(fp) XFILE *fp; { ALLOC_T len; int n; if (checkfp(fp, XS_ERROR | XS_RDONLY) < 0) return(-1); if (fp == Xstdin) { if (Xstdout -> flags & XF_LINEBUF) VOID_C flushbuf(Xstdout); if (Xstderr -> flags & XF_LINEBUF) VOID_C flushbuf(Xstderr); } # ifdef DEP_STREAMTIMEOUT if (fp -> status & XS_NOAHEAD) { # ifdef DEP_STREAMLOG if (fp -> status & XS_CLEARBUF) { fp -> status &= ~XS_CLEARBUF; fp -> ptr = (ALLOC_T)0; } else # endif if (fp -> ptr >= XF_BUFSIZ) { # ifdef DEP_STREAMLOG dumplog(fp -> buf, XF_BUFSIZ, fp); # endif fp -> ptr = (ALLOC_T)0; } n = checkread(fp -> fd, &(fp -> buf[fp -> ptr]), (ALLOC_T)1, fp -> timeout); } else # endif /* DEP_STREAMTIMEOUT */ { fp -> ptr = (ALLOC_T)0; len = (fp -> flags & XF_NOBUF) ? (ALLOC_T)1 : XF_BUFSIZ; n = sureread(fp -> fd, fp -> buf, len); } if (n <= 0) { if (n < 0) fp -> status |= XS_ERROR; else { fp -> status |= XS_EOF; fp -> status &= ~XS_READ; } fp -> count = (ALLOC_T)0; return(-1); } fp -> count = (ALLOC_T)n; fp -> status |= XS_READ; # ifdef DEP_STREAMLOG # ifdef DEP_STREAMTIMEOUT if (fp -> status & XS_NOAHEAD) { if (fp -> buf[fp -> ptr] == '\n') { fp -> status |= XS_CLEARBUF; dumplog(fp -> buf, fp -> ptr + 1, fp); } } else # endif dumplog(fp -> buf, (ALLOC_T)n, fp); # endif /* DEP_STREAMLOG */ return(0); } static int NEAR flushbuf(fp) XFILE *fp; { ALLOC_T len; int n; if (checkfp(fp, XS_ERROR) < 0) return(-1); fp -> status &= ~XS_WRITTEN; if (fp -> status & XS_RDONLY) return(0); len = fp -> ptr; fp -> ptr = fp -> count = (ALLOC_T)0; if (!len || (fp -> status & XS_CLOSED)) return(0); n = surewrite(fp -> fd, fp -> buf, len); if (n < 0) { fp -> status |= XS_ERROR; return(-1); } # ifdef DEP_DOSDRIVE if (chkopenfd(fp -> fd) == DEV_DOS && dosflushbuf(fp -> fd) < 0) { fp -> status |= XS_ERROR; return(-1); } # endif # ifdef DEP_STREAMLOG dumplog(fp -> buf, (ALLOC_T)n, fp); # endif return(n); } int Xfflush(fp) XFILE *fp; { return((flushbuf(fp) < 0) ? EOF : 0); } int Xfpurge(fp) XFILE *fp; { if (checkfp(fp, XS_RDONLY) < 0) return(EOF); fp -> status &= ~(XS_EOF | XS_READ); fp -> ptr = fp -> count = (ALLOC_T)0; return(0); } int Xfread(buf, size, fp) char *buf; ALLOC_T size; XFILE *fp; { ALLOC_T ptr, len; int nl, total; if (checkfp(fp, XS_ERROR | XS_RDONLY) < 0) return(-1); if ((fp -> status & XS_WRITTEN) && flushbuf(fp) < 0) return(-1); if (!(fp -> status & XS_READ)) fp -> ptr = fp -> count = (ALLOC_T)0; nl = total = 0; while (size > (ALLOC_T)0) { if (fp -> status & (XS_EOF | XS_CLOSED)) break; if (!(fp -> count) && fillbuf(fp) < 0) break; if (nl && fp -> buf[fp -> ptr] != '\n') { *(buf++) = '\r'; size--; total++; } len = fp -> count; if (len > size) len = size; nl = 0; if (ISCRNL(fp)) for (ptr = (ALLOC_T)0; ptr < len; ptr++) { # ifdef USECRNL if (fp -> buf[fp -> ptr + ptr] == CH_EOF) { fp -> status |= XS_EOF; break; } # endif if (fp -> buf[fp -> ptr + ptr] == '\r') { nl++; len = ptr; break; } } memcpy(buf, &(fp -> buf[fp -> ptr]), len); fp -> ptr += len; buf += len; size -= len; fp -> count -= len; total += len; # ifdef USECRNL if (fp -> status & XS_EOF) fp -> ptr = fp -> count = (ALLOC_T)0; else # endif if (nl) { (fp -> ptr)++; (fp -> count)--; } } return((fp -> status & XS_ERROR) ? -1 : total); } int Xfwrite(buf, size, fp) CONST char *buf; ALLOC_T size; XFILE *fp; { ALLOC_T ptr, len, max; int n, nl, prev, total; if (checkfp(fp, XS_ERROR | XS_WRONLY) < 0) return(-1); if (fp -> status & XS_READ) { fp -> status &= ~(XS_EOF | XS_READ); fp -> ptr = fp -> count = (ALLOC_T)0; } if (fp -> status & XS_CLOSED) return(0); max = (fp -> flags & XF_NOBUF) ? (ALLOC_T)1 : XF_BUFSIZ; total = 0; prev = '\0'; while (size > (ALLOC_T)0) { len = max - fp -> count; if (len > size) len = size; nl = 0; if (ISCRNL(fp)) for (ptr = (ALLOC_T)0; ptr < len; ptr++) { if (buf[ptr] == '\n' && prev != '\r') { nl++; len = ptr; break; } prev = buf[ptr]; } memcpy(&(fp -> buf[fp -> ptr]), buf, len); if (nl) fp -> buf[fp -> ptr + len++] = '\r'; total += len; fp -> ptr += len; buf += len; size -= len; fp -> count += len; fp -> status |= XS_WRITTEN; if (fp -> count >= max && flushbuf(fp) < 0) break; if (nl) { fp -> buf[(fp -> ptr)++] = '\n'; (fp -> count)++; fp -> status |= XS_WRITTEN; if (fp -> count >= max && flushbuf(fp) < 0) break; } } if (fp -> status & XS_ERROR) return(total); if (!(fp -> flags & XF_LINEBUF)) return(total); for (len = fp -> ptr; len > (ALLOC_T)0; len--) if (fp -> buf[len - 1] == '\n') break; if (len <= (ALLOC_T)0) return(total); n = surewrite(fp -> fd, fp -> buf, len); if (n < 0) { fp -> status |= XS_ERROR; total -= (int)len - n; return(total); } fp -> ptr -= len; memmove(fp -> buf, &(fp -> buf[len]), fp -> ptr); return(total); } int Xfgetc(fp) XFILE *fp; { u_char uc; int n; # ifdef DEP_STREAMTIMEOUT if (fp -> flags & XF_NONBLOCK) fp -> status |= XS_NOAHEAD; # endif n = Xfread((char *)&uc, sizeof(uc), fp); # ifdef DEP_STREAMTIMEOUT fp -> status &= ~XS_NOAHEAD; # endif return((n > 0) ? (int)uc : EOF); } int Xfputc(c, fp) int c; XFILE *fp; { u_char uc; uc = (u_char)c; if (Xfwrite((char *)&uc, sizeof(uc), fp) < (int)sizeof(uc)) return(EOF); return(c); } # ifdef DEP_STREAMSOCKET static int NEAR replytelnet(fp) XFILE *fp; { u_char buf[3]; int c, s; s = Xfileno(fp); if (issocket(s) < 0) return(0); c = Xfgetc(fp); switch (c) { case TELNET_WILL: case TELNET_WONT: c = Xfgetc(fp); buf[0] = TELNET_IAC; buf[1] = TELNET_DONT; buf[2] = c; VOID_C Xwrite(s, (char *)buf, sizeof(buf)); break; case TELNET_DO: case TELNET_DONT: c = Xfgetc(fp); buf[0] = TELNET_IAC; buf[1] = TELNET_WONT; buf[2] = c; VOID_C Xwrite(s, (char *)buf, sizeof(buf)); break; case TELNET_IAC: return(c); /*NOTREACHED*/ break; default: break; } return(0); } # endif /* DEP_STREAMSOCKET */ char *Xfgets(fp) XFILE *fp; { # ifdef DEP_STREAMLOG int dupdebuglvl; # endif char *buf; ALLOC_T len, size; int n, c; if (checkfp(fp, XS_ERROR | XS_RDONLY) < 0) return(NULL); buf = c_realloc(NULL, 0, &size); len = (ALLOC_T)0; for (;;) { # ifdef DEP_STREAMLOG dupdebuglvl = fp -> debuglvl; if (fp -> flags & XF_NONBLOCK) fp -> debuglvl = 0; # endif n = c = Xfgetc(fp); # ifdef DEP_STREAMLOG fp -> debuglvl = dupdebuglvl; # endif if (c == EOF) { if (!len || (fp -> status & XS_ERROR)) /*EMPTY*/; else break; Xfree(buf); return(NULL); } # ifdef DEP_STREAMSOCKET if ((fp -> flags & XF_TELNET) && c == TELNET_IAC) { c = replytelnet(fp); if (!c) continue; } # endif buf = c_realloc(buf, len, &size); # ifdef FD if ((fp -> flags & XF_NULLCONV) && !c) c = '\n'; # endif buf[len++] = c; if (n == '\n') break; } if (len > 0 && buf[len - 1] == '\n') len--; buf[len++] = '\0'; buf = Xrealloc(buf, len); return(buf); } int Xfputs(s, fp) CONST char *s; XFILE *fp; { # ifdef FD CONST char *eol; # endif ALLOC_T len; # ifdef FD if (fp -> flags & XF_NULLCONV) while ((eol = Xstrchr(s, '\n'))) { len = eol++ - s; if (Xfwrite(s, len, fp) < (int)len || Xfputc('\0', fp) == EOF) return(EOF); s = eol; } # endif len = strlen(s); return((Xfwrite(s, len, fp) < (int)len) ? EOF : 0); } VOID Xsetbuf(fp) XFILE *fp; { if (fp) { fp -> flags |= XF_NOBUF; fp -> flags &= ~XF_LINEBUF; fp -> ptr = fp -> count = (ALLOC_T)0; } } VOID Xsetlinebuf(fp) XFILE *fp; { if (fp && (fp == Xstdout || fp == Xstderr)) { VOID_C flushbuf(fp); fp -> flags |= XF_LINEBUF; fp -> flags &= ~XF_NOBUF; } } #endif /* DEP_ORIGSTREAM */ #if defined (FD) && !defined (DEP_ORIGSHELL) XFILE *Xpopen(command, mode) CONST char *command, *mode; { # if !MSDOS extern char **environ; int fds[2]; # endif # ifdef DEP_DOSLFN char *cp, tmp[MAXPATHLEN]; # endif char *cmdline, path[MAXPATHLEN]; int l1, l2; # if !MSDOS if (pipe(fds) < 0) popenpid = (p_id_t)-1; else if ((popenpid = Xfork()) < (p_id_t)0) { safeclose(fds[0]); safeclose(fds[1]); } else if (popenpid) { safeclose(fds[1]); return(Xfdopen(fds[0], mode)); } else { Xdup2(fds[1], STDOUT_FILENO); safeclose(fds[0]); safeclose(fds[1]); execle("/bin/sh", "sh", "-c", command, NULL, environ); _exit(1); } # endif /* !MSDOS */ Xstrcpy(path, PIPEDIR); if (mktmpdir(path) < 0) return(NULL); # ifdef DEP_DOSLFN if (!(cp = preparefile(path, tmp))) return(NULL); else if (cp == tmp) Xstrcpy(path, tmp); # endif Xstrcpy(strcatdelim(path), PIPEFILE); l1 = strlen(command); l2 = strlen(path); cmdline = Xmalloc(l1 + l2 + 3 + 1); Xstrncpy(cmdline, command, l1); Xstrcpy(&(cmdline[l1]), " > "); l1 += 3; Xstrcpy(&(cmdline[l1]), path); popenstat = system(cmdline); return(Xfopen(path, mode)); } int Xpclose(fp) XFILE *fp; { # if !MSDOS sigcst_t ivec, qvec, hvec; wait_pid_t w; p_id_t pid; # endif char *cp, path[MAXPATHLEN]; int duperrno; duperrno = 0; if (Xfclose(fp)) duperrno = errno; # if !MSDOS if (popenpid >= (p_id_t)0) { if (!popenpid) popenstat = 0; else { ivec = signal2(SIGINT, SIG_IGN); qvec = signal2(SIGQUIT, SIG_IGN); hvec = signal2(SIGHUP, SIG_IGN); VOID_C kill(popenpid, SIGPIPE); for (;;) { pid = Xwait4(popenpid, &w, WUNTRACED, NULL); if (pid == popenpid) break; else if (pid < (p_id_t)0) { duperrno = errno; break; } } VOID_C signal2(SIGINT, ivec); VOID_C signal2(SIGQUIT, qvec); VOID_C signal2(SIGHUP, hvec); if (duperrno) popenstat = seterrno(duperrno); else if (WIFSTOPPED(w)) popenstat = 128 + WSTOPSIG(w); else if (WIFSIGNALED(w)) popenstat = 128 + WTERMSIG(w); else popenstat = WEXITSTATUS(w); } popenpid = (p_id_t)-1; return(popenstat); } # endif /* !MSDOS */ if (!deftmpdir || !*deftmpdir || !tmpfilename || !*tmpfilename) return(seterrno(ENOENT)); strcatdelim2(path, deftmpdir, tmpfilename); Xstrcpy(strcatdelim(path), PIPEDIR); Xstrcpy((cp = strcatdelim(path)), PIPEFILE); if (Xunlink(path) < 0) duperrno = errno; *(--cp) = '\0'; if (rmtmpdir(path) < 0) duperrno = errno; if (duperrno) return(seterrno(duperrno)); return(popenstat); } #endif /* FD && !DEP_ORIGSHELL */ int fputnl(fp) XFILE *fp; { if (Xfputc('\n', fp) == EOF || Xfflush(fp) == EOF) return(-1); return(0); } VOID putc2(c) int c; { if (c) VOID_C Xfputc(c, Xstdout); } #ifndef FD # ifndef DEP_ORIGSTREAM static char *NEAR fgets2(fd) int fd; { char *buf; ALLOC_T len, size; u_char uc; int n; buf = c_realloc(NULL, 0, &size); len = (ALLOC_T)0; for (;;) { n = read(fd, &uc, sizeof(uc)); if (n <= 0) { if (!len || n < 0) { Xfree(buf); return(NULL); } break; } if (uc == '\n') break; buf = c_realloc(buf, len, &size); buf[len++] = uc; } buf[len++] = '\0'; return(Xrealloc(buf, len)); } # endif /* !DEP_ORIGSTREAM */ char *gets2(prompt) CONST char *prompt; { # ifdef DEP_ORIGSTREAM # ifdef DEP_ORIGSHELL extern int ttyio; int fd; # endif XFILE *fp; # endif /* DEP_ORIGSTREAM */ char *buf; errputs(prompt, 0); VOID_C Xfflush(Xstderr); # ifdef DEP_ORIGSTREAM # ifdef DEP_ORIGSHELL fd = safe_dup(ttyio); fp = (fd >= 0) ? Xfdopen(fd, "r") : NULL; if (fp) /*EMPTY*/; else # endif fp = Xstdin; buf = Xfgets(fp); safefclose(fp); # else /* !DEP_ORIGSTREAM */ buf = fgets2(STDIN_FILENO); # endif /* !DEP_ORIGSTREAM */ return(buf); } #endif /* !FD */ VOID puts2(s) CONST char *s; { if (s) VOID_C Xfputs(s, Xstdout); } VOID putnl(VOID_A) { VOID_C fputnl(Xstdout); } VOID errputs(s, nl) CONST char *s; int nl; { if (s) VOID_C Xfputs(s, Xstderr); if (nl) VOID_C fputnl(Xstderr); } FD-3.01j/string.c100644 2105 1751 7500 13516612560 12335 0ustar shiraiuser/* * string.c * * alternative string functions */ #include "headers.h" #include "kctype.h" #include "string.h" #define VT_OTHER 1 #define VT_DIGIT 2 #define VT_ALPHA 3 #ifndef _NOXSTRCHR char *Xstrchr(s, c) CONST char *s; int c; { for (; *s != c; s++) { if (!*s) return(NULL); else if (iswchar(s, 0)) s++; } return((char *)s); } char *Xstrrchr(s, c) CONST char *s; int c; { char *cp; cp = NULL; for (;; s++) { if (*s == c) cp = (char *)s; else if (iswchar(s, 0)) s++; if (!*s) break; } return(cp); } #endif /* !_NOXSTRCHR */ #ifndef _NOXMEMCHR char *Xmemchr(s, c, n) CONST char *s; int c, n; { for (; n-- > 0; s++) { if (*s == c) return((char *)s); else if (iswchar(s, 0)) { if (n-- <= 0) break; s++; } } return(NULL); } #endif /* !_NOXMEMCHR */ #ifndef _NOXSTRCPY char *Xstrcpy(s1, s2) char *s1; CONST char *s2; { int i; for (i = 0; s2[i]; i++) s1[i] = s2[i]; s1[i] = '\0'; return(&(s1[i])); } char *Xstrncpy(s1, s2, n) char *s1; CONST char *s2; int n; { int i; for (i = 0; i < n && s2[i]; i++) s1[i] = s2[i]; s1[i] = '\0'; return(&(s1[i])); } #endif /* !_NOXSTRCPY */ #ifndef _NOXSTRCAT char *Xstrlcat(s1, s2, n) char *s1; CONST char *s2; int n; { char *s; int i; i = strlen(s1); n -= i; s = &(s1[i]); for (i = 0; i < n && s2[i]; i++) s[i] = s2[i]; s[i] = '\0'; return(s1); } #endif /* !_NOXSTRCAT */ #ifndef _NOXSTRCASECMP int Xstrcasecmp(s1, s2) CONST char *s1, *s2; { int c1, c2; for (;;) { c1 = Xtoupper(*s1); c2 = Xtoupper(*s2); if (c1 != c2) return(c1 - c2); if (iswchar(s1, 0)) { s1++; s2++; if (*s1 != *s2) return((u_char)*s1 - (u_char)*s2); } if (!*s1) break; s1++; s2++; } return(0); } int Xstrncasecmp(s1, s2, n) CONST char *s1, *s2; int n; { int c1, c2; while (n-- > 0) { c1 = Xtoupper(*s1); c2 = Xtoupper(*s2); if (c1 != c2) return(c1 - c2); if (iswchar(s1, 0)) { if (n-- <= 0) break; s1++; s2++; if (*s1 != *s2) return((u_char)*s1 - (u_char)*s2); } if (!*s1) break; s1++; s2++; } return(0); } #endif /* !_NOXSTRCASECMP */ #ifndef _NOXSTRVERSCMP static int NEAR verstype(c) int c; { if (Xisdigit(c)) return(VT_DIGIT); if (Xisalpha(c)) return(VT_ALPHA); return(VT_OTHER); } int Xstrverscmp(s1, s2, nocase) CONST char *s1, *s2; int nocase; { int n, c1, c2, t1, t2, blk, last; blk = last = 0; for (;;) { c1 = *s1; c2 = *s2; if (nocase) { c1 = Xtoupper(c1); c2 = Xtoupper(c2); } n = c1 - c2; if (!c1 || !c2) return(n); t1 = verstype(c1); switch (t1) { case VT_OTHER: blk++; break; case VT_ALPHA: blk = 0; break; default: break; } if (n) break; if (iswchar(s1, 0)) { s1++; s2++; if (*s1 != *s2) return((u_char)*s1 - (u_char)*s2); } last = t1; s1++; s2++; } t2 = verstype(c2); if (blk > 0) /*EMPTY*/; else if (last == VT_DIGIT || (t1 == VT_DIGIT && t2 == VT_DIGIT)) { for (;;) { if (t1 != t2) return((t1 == VT_DIGIT) ? 1 : -1); if (t1 != VT_DIGIT) return(n); t1 = verstype(*(++s1)); t2 = verstype(*(++s2)); } } return((t1 == t2) ? n : t1 - t2); } #endif /* !_NOXSTRVERSCMP */ #if !defined (_NOSTRLEN2) && defined (CODEEUC) int strlen2(s) CONST char *s; { int i, len; for (i = len = 0; s[i]; i++, len++) if (isekana(s, i)) i++; return(len); } #endif /* !_NOSTRLEN2 && CODEEUC */ #ifndef _NOXSTRTOLOWER VOID Xstrtolower(s) char *s; { if (s) for (; *s; s++) { if (iswchar(s, 0)) s++; else *s = Xtolower(*s); } } VOID Xstrtoupper(s) char *s; { if (s) for (; *s; s++) { if (iswchar(s, 0)) s++; else *s = Xtoupper(*s); } } VOID Xstrntolower(s, n) char *s; int n; { if (s) for (; n-- > 0 && *s; s++) { if (iswchar(s, 0)) s++; else *s = Xtolower(*s); } } VOID Xstrntoupper(s, n) char *s; int n; { if (s) for (; n-- > 0 && *s; s++) { if (iswchar(s, 0)) s++; else *s = Xtoupper(*s); } } #endif /* !_NOXSTRTOLOWER */ FD-3.01j/malloc.c100644 2105 1751 4152 13516612560 12276 0ustar shiraiuser/* * malloc.c * * alternative memoly allocation functions */ #include "headers.h" #include "printf.h" #include "malloc.h" #include "sysemu.h" #ifdef FD extern VOID error __P_((CONST char *)); #else static VOID NEAR error __P_((CONST char *)); #endif #ifndef FD static VOID NEAR error(s) CONST char *s; { VOID_C Xfprintf(Xstderr, "%s: memory allocation error", s); VOID_C fputnl(Xstderr); exit(2); } #endif /* !FD */ char *Xmalloc(size) ALLOC_T size; { char *tmp; if (!size || !(tmp = (char *)malloc(size))) { error("malloc()"); #ifdef FAKEUNINIT tmp = NULL; /* fake for -Wuninitialized */ #endif } return(tmp); } char *Xrealloc(ptr, size) VOID_P ptr; ALLOC_T size; { char *tmp; if (!size || !(tmp = (ptr) ? (char *)realloc(ptr, size) : (char *)malloc(size))) { error("realloc()"); #ifdef FAKEUNINIT tmp = NULL; /* fake for -Wuninitialized */ #endif } return(tmp); } VOID Xfree(ptr) VOID_P ptr; { int duperrno; if (!ptr) return; duperrno = errno; free(ptr); errno = duperrno; } char *c_realloc(ptr, n, sizep) char *ptr; ALLOC_T n, *sizep; { if (!ptr) { *sizep = BUFUNIT; return(Xmalloc(*sizep)); } while (n + 1 >= *sizep) *sizep *= 2; return(Xrealloc(ptr, *sizep)); } char *Xstrdup(s) CONST char *s; { char *tmp; int n; if (!s) return(NULL); n = strlen(s); if (!(tmp = (char *)malloc((ALLOC_T)n + 1))) error("malloc()"); memcpy(tmp, s, n + 1); return(tmp); } char *Xstrndup(s, n) CONST char *s; int n; { char *tmp; int i; if (!s) return(NULL); for (i = 0; i < n; i++) if (!s[i]) break; if (!(tmp = (char *)malloc((ALLOC_T)i + 1))) error("malloc()"); memcpy(tmp, s, i); tmp[i] = '\0'; return(tmp); } #ifndef MINIMUMSHELL int vasprintf2(sp, fmt, args) char **sp; CONST char *fmt; va_list args; { int n; n = Xvasprintf(sp, fmt, args); if (n < 0) error("malloc()"); return(n); } # ifdef USESTDARGH /*VARARGS1*/ char *asprintf2(CONST char *fmt, ...) # else /*VARARGS1*/ char *asprintf2(fmt, va_alist) CONST char *fmt; va_dcl # endif { va_list args; char *cp; VA_START(args, fmt); VOID_C vasprintf2(&cp, fmt, args); va_end(args); return(cp); } #endif /* !MINIMUMSHELL */ FD-3.01j/time.c100644 2105 1751 14705 13516612560 12012 0ustar shiraiuser/* * time.c * * alternative time functions */ #include "headers.h" #include "typesize.h" #include "string.h" #include "time.h" #if !MSDOS && !defined (USEMKTIME) && !defined (USETIMELOCAL) #include "sysemu.h" #include "pathname.h" #include "stream.h" #endif #ifndef NOTZFILEH #include #endif #if MSDOS #include #endif #ifdef GETTODNULL #define timezonep(t) NULL #else #define timezonep(t) &(t) #endif #if !MSDOS && !defined (NOTZFILEH) \ && !defined (USEMKTIME) && !defined (USETIMELOCAL) static long NEAR char2long __P_((CONST u_char *)); static int NEAR tmcmp __P_((CONST struct tm *, CONST struct tm *)); # ifdef DEP_ORIGSTREAM static int NEAR Xfseek __P_((XFILE *, off_t, int)); # else # define Xfseek fseek # endif #endif /* !MSDOS && !NOTZFILEH && !USEMKTIME && !USETIMELOCAL */ static int NEAR getmaxday __P_((int, int)); #if !defined (USEMKTIME) && !defined (USETIMELOCAL) static long NEAR gettimezone __P_((CONST struct tm *, time_t)); #endif time_t Xtime(tp) time_t *tp; { #if MSDOS struct timeb buffer; #else /* !MSDOS */ # ifndef GETTODNULL struct timezone tz; # endif struct timeval tv; #endif /* !MSDOS */ time_t t; #if MSDOS VOID_C ftime(&buffer); t = (time_t)(buffer.time); if (tp) *tp = (time_t)(buffer.millitm); #else VOID_C Xgettimeofday(&tv, timezonep(tz)); t = (time_t)(tv.tv_sec); if (tp) *tp = (time_t)(tv.tv_usec / 1000L); #endif return(t); } #if !MSDOS && !defined (NOTZFILEH) \ && !defined (USEMKTIME) && !defined (USETIMELOCAL) static long NEAR char2long(s) CONST u_char *s; { return((long)((u_long)(s[3]) | ((u_long)(s[2]) << (BITSPERBYTE * 1)) | ((u_long)(s[1]) << (BITSPERBYTE * 2)) | ((u_long)(s[0]) << (BITSPERBYTE * 3)))); } static int NEAR tmcmp(tm1, tm2) CONST struct tm *tm1, *tm2; { if (tm1 -> tm_year != tm2 -> tm_year) return (tm1 -> tm_year - tm2 -> tm_year); if (tm1 -> tm_mon != tm2 -> tm_mon) return (tm1 -> tm_mon - tm2 -> tm_mon); if (tm1 -> tm_mday != tm2 -> tm_mday) return (tm1 -> tm_mday - tm2 -> tm_mday); if (tm1 -> tm_hour != tm2 -> tm_hour) return (tm1 -> tm_hour - tm2 -> tm_hour); if (tm1 -> tm_min != tm2 -> tm_min) return (tm1 -> tm_min - tm2 -> tm_min); return (tm1 -> tm_sec - tm2 -> tm_sec); } # ifdef DEP_ORIGSTREAM static int NEAR Xfseek(fp, offset, whence) XFILE *fp; off_t offset; int whence; { if (!fp || (fp -> flags & XF_ERROR)) return(-1); if ((fp -> flags & XF_WRITTEN) && Xfflush(fp) == EOF) return(-1); offset = Xlseek(fp -> fd, offset, whence); fp -> ptr = fp -> count = (ALLOC_T)0; fp -> flags &= ~XF_EOF; return((offset < (off_t)0) ? -1 : 0); } # endif /* DEP_ORIGSTREAM */ #endif /* !MSDOS && !NOTZFILEH && !USEMKTIME && !USETIMELOCAL */ static int NEAR getmaxday(mon, year) int mon, year; { int mday; switch (mon) { case 2: mday = 28; if (!(year % 4) && ((year % 100) || !(year % 400))) mday++; break; case 4: case 6: case 9: case 11: mday = 30; break; default: mday = 31; break; } return(mday); } time_t Xtimegm(tm) CONST struct tm *tm; { time_t t; int i, y; if (tm -> tm_year < 0) return((time_t)-1); y = (tm -> tm_year < 1900) ? tm -> tm_year + 1900 : tm -> tm_year; if (tm -> tm_mon < 0 || tm -> tm_mon > 11) return((time_t)-1); if (tm -> tm_mday < 1 || tm -> tm_mday > getmaxday(tm -> tm_mon + 1, y)) return((time_t)-1); if (tm -> tm_hour < 0 || tm -> tm_hour > 23) return((time_t)-1); if (tm -> tm_min < 0 || tm -> tm_min > 59) return((time_t)-1); if (tm -> tm_sec < 0 || tm -> tm_sec > 60) return((time_t)-1); t = ((long)y - 1970) * 365; t += ((y - 1 - 1968) / 4) - ((y - 1 - 1900) / 100) + ((y - 1 - 1600) / 400); for (i = 1; i < tm -> tm_mon + 1; i++) t += getmaxday(i, y); t += tm -> tm_mday - 1; t *= 60L * 60L * 24L; t += ((long)(tm -> tm_hour) * 60L + tm -> tm_min) * 60L + tm -> tm_sec; return(t); } #if !defined (USEMKTIME) && !defined (USETIMELOCAL) static long NEAR gettimezone(tm, t) CONST struct tm *tm; time_t t; { # if MSDOS struct timeb buffer; ftime(&buffer); return((long)(buffer.timezone) * 60L); # else /* !MSDOS */ # ifndef NOTZFILEH struct tzhead head; XFILE *fp; time_t tmp; long i, leap, nleap, ntime, ntype, nchar; char *cp, buf[MAXPATHLEN]; u_char c; # endif struct tm tmbuf; long tz; memcpy((char *)&tmbuf, (char *)tm, sizeof(struct tm)); # ifdef NOTMGMTOFF tz = (long)t - (long)Xtimegm(localtime(&t)); # else tz = -(localtime(&t) -> tm_gmtoff); # endif # ifndef NOTZFILEH cp = getenv("TZ"); if (!cp || !*cp) cp = TZDEFAULT; if (cp[0] == _SC_) Xstrcpy(buf, cp); else strcatdelim2(buf, TZDIR, cp); if (!(fp = Xfopen(buf, "rb"))) return(tz); if (Xfread((char *)&head, sizeof(head), fp) != sizeof(head)) { VOID_C Xfclose(fp); return(tz); } # ifdef USELEAPCNT nleap = char2long(head.tzh_leapcnt); # else nleap = char2long(head.tzh_timecnt - 4); # endif ntime = char2long(head.tzh_timecnt); ntype = char2long(head.tzh_typecnt); nchar = char2long(head.tzh_charcnt); for (i = 0; i < ntime; i++) { if (Xfread(buf, 4, fp) != 4) { VOID_C Xfclose(fp); return(tz); } tmp = char2long(buf); if (tmcmp(&tmbuf, localtime(&tmp)) < 0) break; } if (i > 0) { i--; i *= (int)sizeof(char); i += (int)sizeof(struct tzhead) + ntime * 4 * sizeof(char); if (Xfseek(fp, i, 0) < 0 || Xfread((char *)&c, 1, fp) != 1) { VOID_C Xfclose(fp); return(tz); } i = c; } i *= (4 + 1 + 1) * sizeof(char); i += (int)sizeof(struct tzhead) + ntime * (4 + 1) * sizeof(char); if (Xfseek(fp, i, 0) < 0 || Xfread(buf, 4, fp) != 4) { VOID_C Xfclose(fp); return(tz); } tmp = char2long(buf); tz = -tmp; i = (int)sizeof(struct tzhead) + ntime * (4 + 1) * sizeof(char) + ntype * (4 + 1 + 1) * sizeof(char) + nchar * sizeof(char); if (Xfseek(fp, i, 0) < 0) { VOID_C Xfclose(fp); return(tz); } leap = 0; for (i = 0; i < nleap; i++) { if (Xfread(buf, 4, fp) != 4) { VOID_C Xfclose(fp); return(tz); } tmp = char2long(buf); if (tmcmp(&tmbuf, localtime(&tmp)) <= 0) break; if (Xfread(buf, 4, fp) != 4) { VOID_C Xfclose(fp); return(tz); } leap = char2long(buf); } tz += leap; VOID_C Xfclose(fp); # endif /* !NOTZFILEH */ return(tz); # endif /* !MSDOS */ } #endif /* !USEMKTIME && !USETIMELOCAL */ time_t Xtimelocal(tm) struct tm *tm; { #ifdef USEMKTIME tm -> tm_isdst = -1; return(mktime(tm)); #else /* !USEMKTIME */ # ifdef USETIMELOCAL return(timelocal(tm)); # else /* !USETIMELOCAL */ time_t t; t = Xtimegm(tm); if (t == (time_t)-1) return(t); t += gettimezone(tm, t); return(t); # endif /* !USETIMELOCAL */ #endif /* !USEMKTIME */ } FD-3.01j/pathname.c100644 2105 1751 211251 13516612560 12664 0ustar shiraiuser/* * pathname.c * * path name management module */ #ifdef FD #include "fd.h" #else #include "headers.h" #include "depend.h" #include "printf.h" #include "kctype.h" #include "string.h" #include "malloc.h" #endif #include "dirent.h" #include "sysemu.h" #include "pathname.h" #ifdef DEP_URLPATH #include "url.h" #endif #if MSDOS #include # ifndef FD # include # include # endif #endif /* !MSDOS */ #ifndef NOUID #include #include #endif #ifdef FD #define FDSTR "FD" #endif #if MSDOS #define EXTWIDTH 4 #else #define EXTWIDTH 0 #endif #define getconstvar(s) (getenvvar(s, sizeof(s) - 1)) #ifdef FD extern int stat2 __P_((CONST char *, struct stat *)); extern int _chdir2 __P_((CONST char *)); extern char *getenv2 __P_((CONST char *)); # ifdef DEP_DOSLFN extern char *shortname __P_((CONST char *, char *)); # endif extern VOID demacroarg __P_((char **)); extern VOID lostcwd __P_((char *)); #else /* !FD */ #define _chdir2 Xchdir # ifdef NOSYMLINK # define stat2 Xstat # else static int NEAR stat2 __P_((CONST char *, struct stat *)); # endif #define getenv2 (char *)getenv #endif /* !FD */ #ifdef DEBUG extern char *_mtrace_file; #endif #ifdef FD extern char *progpath; #endif #if defined (DEP_PATHTOP) || defined (BSPATHDELIM) || defined (FD) static CONST char *NEAR topdelim __P_((CONST char *, int, int *, int *)); #endif static CONST char *NEAR topdelim2 __P_((CONST char *, int *)); static char *NEAR getenvvar __P_((CONST char *, int)); static int NEAR setvar __P_((CONST char *, CONST char *, int)); static int NEAR isescape __P_((CONST char *, int, int, int, int)); #ifdef _NOORIGGLOB static char *NEAR cnvregexp __P_((CONST char *, int)); #else static int NEAR _regexp_exec __P_((CONST reg_ex_t *, CONST char *)); #endif static VOID NEAR addstrbuf __P_((strbuf_t *, CONST char *, int)); static VOID NEAR duplwild __P_((wild_t *, CONST wild_t *)); static VOID NEAR freewild __P_((wild_t *)); static int NEAR _evalwild __P_((int, char ***, wild_t *)); #ifndef _NOUSEHASH static int NEAR calchash __P_((CONST char *)); static VOID NEAR inithash __P_((VOID_A)); static hashlist *NEAR newhash __P_((CONST char *, char *, int, hashlist *)); static VOID NEAR freehash __P_((hashlist **)); static hashlist *NEAR findhash __P_((CONST char *, int)); static VOID NEAR rmhash __P_((CONST char *, int)); #endif static int NEAR isexecute __P_((CONST char *, int, int)); #if MSDOS static int NEAR extaccess __P_((char *, CONST char *, int, int)); #endif #if !defined (FDSH) && !defined (_NOCOMPLETE) static int NEAR completefile __P_((CONST char *, int, int, char ***, CONST char *, int, int)); static int NEAR completeexe __P_((CONST char *, int, int, char ***)); #endif /* !FDSH && !_NOCOMPLETE */ static int NEAR addmeta __P_((char *, CONST char *, int)); static int NEAR skipvar __P_((CONST char **, int *, int *, int)); #ifdef MINIMUMSHELL static int NEAR skipvarvalue __P_((CONST char *, int *, CONST char *, int, int)); static char *NEAR evalshellparam __P_((int, int)); #else /* !MINIMUMSHELL */ static int NEAR skipvarvalue __P_((CONST char *, int *, CONST char *, int, int, int)); static char *NEAR removeword __P_((CONST char *, CONST char *, int, int)); static char **NEAR removevar __P_((char **, CONST char *, int, int)); static char *NEAR evalshellparam __P_((int, int, CONST char *, int, int *)); #endif /* !MINIMUMSHELL */ static int NEAR replacevar __P_((CONST char *, char **, int, int, int, int)); static char *NEAR insertarg __P_((char *, int, CONST char *, int, int)); static int NEAR evalvar __P_((char **, int, CONST char **, int)); static char *NEAR replacebackquote __P_((char *, int *, char *, int, int)); #ifdef BASHSTYLE static VOID replaceifs __P_((char *, int)); #endif #ifndef MINIMUMSHELL static int NEAR evalhome __P_((char **, int, CONST char **)); #endif CONST char nullstr[] = ""; CONST char rootpath[] = _SS_; CONST char curpath[] = "."; CONST char parentpath[] = ".."; char **argvar = NULL; #ifndef _NOUSEHASH hashlist **hashtable = NULL; #endif char *(*getvarfunc)__P_((CONST char *, int)) = NULL; int (*putvarfunc)__P_((char *, int)) = NULL; int (*getretvalfunc)__P_((VOID_A)) = NULL; p_id_t (*getpidfunc)__P_((VOID_A)) = NULL; p_id_t (*getlastpidfunc)__P_((VOID_A)) = NULL; char *(*getflagfunc)__P_((VOID_A)) = NULL; int (*checkundeffunc)__P_((CONST char *, CONST char *, int)) = NULL; VOID_T (*exitfunc)__P_((VOID_A)) = NULL; char *(*backquotefunc)__P_((CONST char *)) = NULL; #ifndef MINIMUMSHELL char *(*posixsubstfunc)__P_((CONST char *, int *)) = NULL; #endif #ifndef PATHNOCASE int pathignorecase = 0; #endif #ifndef _NOVERSCMP int versioncomp = 0; #endif static int skipdotfile = 0; #if !defined (USEREGCMP) && !defined (USEREGCOMP) && !defined (USERE_COMP) static char *wildsymbol1 = "?"; static char *wildsymbol2 = "*"; #endif #ifndef NOUID static uidtable *uidlist = NULL; static int maxuid = 0; static gidtable *gidlist = NULL; static int maxgid = 0; #endif /* !NOUID */ #ifndef FD # ifndef NOSYMLINK static int NEAR stat2(path, stp) CONST char *path; struct stat *stp; { int duperrno; if (Xstat(path, stp) < 0) { duperrno = errno; if (Xlstat(path, stp) < 0 || (stp -> st_mode & S_IFMT) != S_IFLNK) { errno = duperrno; return(-1); } stp -> st_mode &= ~S_IFMT; } return(0); } # endif /* !NOSYMLINK */ #endif /* !FD */ int getpathtop(s, drvp, typep) CONST char *s; int *drvp, *typep; { int n, drv, type; n = drv = 0; type = PT_NONE; if (!s) /*EMPTY*/; #ifdef DEP_DOSPATH else if ((drv = _dospath(s))) { n = 2; type = PT_DOS; } #endif #ifdef DOUBLESLASH else if ((n = isdslash(s))) type = PT_DSLASH; #endif #ifdef DEP_URLPATH else if ((n = _urlpath(s, NULL, NULL))) type = PT_URL; #endif if (drvp) *drvp = drv; if (typep) *typep = type; return(n); } #ifdef DEP_DOSPATH char *gendospath(path, drive, c) char *path; int drive, c; { *(path++) = drive; *(path++) = ':'; if (c) *(path++) = c; *path = '\0'; return(path); } #endif /* DEP_DOSPATH */ #if defined (DEP_PATHTOP) || defined (BSPATHDELIM) || defined (FD) static CONST char *NEAR topdelim(s, d, np, typep) CONST char *s; int d, *np, *typep; { if (d) { *np = getpathtop(s, NULL, typep); # ifdef DEP_DOSPATH if (*typep == PT_DOS) return(++s); # endif } else { *np = 0; *typep = PT_NONE; } return(NULL); } #endif /* DEP_PATHTOP || BSPATHDELIM || defined FD */ static CONST char *NEAR topdelim2(s, np) CONST char *s; int *np; { int type; *np = getpathtop(s, NULL, &type); s += *np; switch (type) { case PT_NONE: case PT_DOS: if (!*s) return(s); break; default: break; } if (*s == _SC_ && !s[1]) return(&(s[1])); return(NULL); } #if defined (DEP_PATHTOP) || defined (BSPATHDELIM) char *strdelim(s, d) CONST char *s; int d; { CONST char *cp; int n, type; if ((cp = topdelim(s, d, &n, &type))) return((char *)cp); for (s += n; *s; s++) { if (*s == _SC_) return((char *)s); # ifdef BSPATHDELIM if (iskanji1(s, 0)) s++; # endif } return(NULL); } char *strrdelim(s, d) CONST char *s; int d; { CONST char *cp; int n, type; cp = topdelim(s, d, &n, &type); for (s += n; *s; s++) { if (*s == _SC_) cp = s; # ifdef BSPATHDELIM if (iskanji1(s, 0)) s++; # endif } return((char *)cp); } #endif /* DEP_PATHTOP || BSPATHDELIM */ #ifdef FD char *strrdelim2(s, d, eol) CONST char *s; int d; CONST char *eol; { CONST char *cp; int n, type; cp = topdelim(s, d, &n, &type); # ifdef BSPATHDELIM for (s += n; *s && s < eol; s++) { if (*s == _SC_) cp = s; if (iskanji1(s, 0)) s++; } # else s += n; for (eol--; eol >= s; eol--) if (*eol == _SC_) return((char *)eol); # endif return((char *)cp); } #endif /* FD */ #ifndef MINIMUMSHELL int isdelim(s, ptr) CONST char *s; int ptr; { # ifdef BSPATHDELIM int i; # endif if (ptr < 0 || s[ptr] != _SC_) return(0); # ifdef BSPATHDELIM if (--ptr < 0) return(1); if (!ptr) return(!iskanji1(s, 0)); for (i = 0; s[i] && i < ptr; i++) if (iskanji1(s, i)) i++; if (!s[i] || i > ptr) return(1); return(!iskanji1(s, i)); # else return(1); # endif } #endif /* !MINIMUMSHELL */ char *strcatdelim(s) char *s; { char *cp, *eol; int n; eol = &(s[MAXPATHLEN - 1]); if ((cp = (char *)topdelim2(s, &n))) return(cp); for (s += n; *s; s++) { if (*s == _SC_) { if (!cp) cp = s; continue; } cp = NULL; #ifdef BSPATHDELIM if (iskanji1(s, 0)) s++; #endif } if (!cp) { cp = s; if (cp >= eol) return(cp); *cp = _SC_; } *(++cp) = '\0'; return(cp); } char *strcatdelim2(buf, s1, s2) char *buf; CONST char *s1, *s2; { CONST char *s; char *cp; int n, len; s = topdelim2(s1, &n); if (n > MAXPATHLEN - 1) { n = MAXPATHLEN - 1; Xstrncpy(buf, s1, n); return(&(buf[n])); } memcpy(buf, s1, n); if (s) { cp = &(buf[s - s1]); memcpy(&(buf[n]), &(s1[n]), cp - &(buf[n])); } else { cp = NULL; for (; s1[n]; n++) { if (n >= MAXPATHLEN - 1) { buf[n] = '\0'; return(&(buf[n])); } buf[n] = s1[n]; if (s1[n] == _SC_) { if (!cp) cp = &(buf[n]) + 1; continue; } cp = NULL; #ifdef BSPATHDELIM if (iskanji1(s1, n)) { if (!s1[++n]) break; buf[n] = s1[n]; } #endif } if (!cp) { cp = &(buf[n]); if (n >= MAXPATHLEN - 1) { *cp = '\0'; return(cp); } *(cp++) = _SC_; } } if (s2) { len = MAXPATHLEN - 1 - (cp - buf); for (n = 0; s2[n] && n < len; n++) *(cp++) = s2[n]; } *cp = '\0'; return(cp); } int strcatpath(path, cp, name) char *path, *cp; CONST char *name; { int len; len = strlen(name); if (len + (cp - path) >= MAXPATHLEN) { errno = ENAMETOOLONG; return(-1); } Xstrncpy(cp, name, len); return(len); } #ifndef PATHNOCASE int strpathcmp2(s1, s2) CONST char *s1, *s2; { if (pathignorecase) return(Xstrcasecmp(s1, s2)); return(strcmp(s1, s2)); } int strnpathcmp2(s1, s2, n) CONST char *s1, *s2; int n; { if (pathignorecase) return(Xstrncasecmp(s1, s2, n)); return(strncmp(s1, s2, n)); } #endif /* !PATHNOCASE */ #ifndef _NOVERSCMP int strverscmp2(s1, s2) CONST char *s1, *s2; { if (versioncomp) return(Xstrverscmp(s1, s2, pathignorecase)); return(strpathcmp2(s1, s2)); } #endif /* !_NOVERSCMP */ #ifdef FD char *underpath(path, dir, len) CONST char *path, *dir; int len; { char *cp; if (len < 0) len = strlen(dir); if ((cp = strrdelim2(dir, 1, &(dir[len]))) && !cp[1]) len = cp - dir; if (len > 0 && strnpathcmp(path, dir, len)) return(NULL); if (path[len] && path[len] != _SC_) return(NULL); return((char *)&(path[len])); } #endif /* FD */ static char *NEAR getenvvar(ident, len) CONST char *ident; int len; { #if (!defined (FD) && !defined (FDSH)) || !defined (DEP_ORIGSHELL) char *cp, *env; #endif if (getvarfunc) return((*getvarfunc)(ident, len)); #if (defined (FD) || defined (FDSH)) && defined (DEP_ORIGSHELL) return(NULL); #else if (len < 0) len = strlen(ident); cp = Xstrndup(ident, len); env = getenv2(cp); Xfree(cp); return(env); #endif } static int NEAR setvar(ident, value, len) CONST char *ident, *value; int len; { char *cp; int ret, vlen; vlen = strlen(value); cp = Xmalloc(len + 1 + vlen + 1); Xstrncpy(cp, ident, len); cp[len] = '='; Xstrncpy(&(cp[len + 1]), value, vlen); #if defined (FD) || defined (FDSH) ret = (putvarfunc) ? (*putvarfunc)(cp, len) : -1; #else ret = (putvarfunc) ? (*putvarfunc)(cp, len) : putenv(cp); #endif if (ret < 0) Xfree(cp); return(ret); } int isidentchar(c) int c; { return(c == '_' || Xisalpha(c)); } int isidentchar2(c) int c; { return(c == '_' || Xisalnum(c)); } int isdotdir(s) CONST char *s; { if (s[0] != '.') /*EMPTY*/; else if (!s[1]) return(2); else if (s[1] != '.') /*EMPTY*/; else if (!s[2]) return(1); return(0); } char *isrootdir(s) CONST char *s; { #ifdef DEP_DOSPATH if (_dospath(s)) s += 2; #endif if (*s != _SC_) return(NULL); return((char *)s); } #ifndef MINIMUMSHELL int isrootpath(s) CONST char *s; { return((s[0] == _SC_ && !s[1]) ? 1 : 0); } VOID copyrootpath(s) char *s; { *(s++) = _SC_; *s = '\0'; } #endif /* !MINIMUMSHELL */ VOID copycurpath(s) char *s; { *(s++) = '.'; *s = '\0'; } #ifdef DOUBLESLASH int isdslash(s) CONST char *s; { # if MSDOS || defined (CYGWIN) char *cp; if (s[0] != _SC_ || s[1] != _SC_ || !s[2] || s[2] == _SC_) return(0); if ((cp = strdelim(&(s[2]), 0))) return(cp - s); return(strlen(s)); # else return((s[0] == _SC_ && s[1] == _SC_) ? 2 : 0); # endif } #endif /* DOUBLESLASH */ char *getbasename(s) CONST char *s; { char *cp; if ((cp = strrdelim(s, 1))) return(&(cp[1])); return((char *)s); } char *getshellname(s, loginp, restrictedp) CONST char *s; int *loginp, *restrictedp; { if (loginp) *loginp = 0; if (restrictedp) *restrictedp = 0; if (*s == '-') { s++; if (loginp) *loginp = 1; } #ifdef PATHNOCASE if (Xtolower(*s) == 'r') #else if (*s == 'r') #endif { s++; if (restrictedp) *restrictedp = 1; } return((char *)s); } static int NEAR isescape(s, ptr, quote, len, flags) CONST char *s; int ptr, quote, len, flags; { #ifdef FAKEESCAPE return(0); #else /* !FAKEESCAPE */ if (s[ptr] != PESCAPE || quote == '\'') return(0); if (flags & EA_EOLESCAPE) /*EMPTY*/; else if (len >= 0) { if (ptr + 1 >= len) return(0); } else { if (!s[ptr + 1]) return(0); } # ifdef BSPATHDELIM if (quote == '"') { if (!Xstrchr(DQ_METACHAR, s[ptr + 1])) return(0); } else { /* if (!quote || quote == '`') */ if (!Xstrchr(METACHAR, s[ptr + 1])) return(0); } # endif return(1); #endif /* !FAKEESCAPE */ } #ifdef _NOORIGGLOB static char *NEAR cnvregexp(s, len) CONST char *s; int len; { char *re; ALLOC_T size; int i, j, paren; if (!*s) { s = "*"; len = 1; } if (len < 0) len = strlen(s); re = c_realloc(NULL, 0, &size); paren = j = 0; re[j++] = '^'; for (i = 0; i < len; i++) { re = c_realloc(re, j + 2, &size); if (paren) { if (s[i] == ']') paren = 0; re[j++] = s[i]; continue; } else if (isescape(s, i, '\0', len, 0)) { re[j++] = s[i++]; re[j++] = s[i]; } else switch (s[i]) { case '?': re[j++] = '.'; break; case '*': re[j++] = '.'; re[j++] = '*'; break; case '[': paren = 1; re[j++] = s[i]; break; case '^': case '$': case '.': re[j++] = '\\'; re[j++] = s[i]; break; default: re[j++] = s[i]; break; } } re[j++] = '$'; re[j++] = '\0'; return(re); } #endif /* _NOORIGGLOB */ #ifdef USERE_COMP extern char *re_comp __P_((CONST char *)); extern int re_exec __P_((CONST char *)); # ifdef PATHNOCASE extern int re_ignore_case; # endif reg_ex_t *regexp_init(s, len) CONST char *s; int len; { char *new; # ifdef PATHNOCASE re_ignore_case = 1; # endif skipdotfile = (*s == '*' || *s == '?' || *s == '['); new = cnvregexp(s, len); # ifdef DEBUG _mtrace_file = "re_comp(start)"; re_comp(new); if (_mtrace_file) _mtrace_file = NULL; else { _mtrace_file = "re_comp(end)"; malloc(0); /* dummy alloc */ } # else re_comp(new); # endif Xfree(new); return((reg_ex_t *)1); } /*ARGSUSED*/ int regexp_exec(re, s, fname) CONST reg_ex_t *re; CONST char *s; int fname; { if (fname && skipdotfile && *s == '.') return(0); return(re_exec(s) > 0); } /*ARGSUSED*/ VOID regexp_free(re) reg_ex_t *re; { return; } #else /* !USERE_COMP */ # ifdef USEREGCOMP reg_ex_t *regexp_init(s, len) CONST char *s; int len; { reg_ex_t *re; char *new; int n; skipdotfile = (*s == '*' || *s == '?' || *s == '['); s = new = cnvregexp(s, len); re = (reg_ex_t *)Xmalloc(sizeof(reg_ex_t)); # ifdef PATHNOCASE n = regcomp(re, s, REG_EXTENDED | REG_ICASE); # else n = regcomp(re, s, REG_EXTENDED | (pathignorecase) ? REG_ICASE : 0); # endif if (n) { Xfree(re); re = NULL; } Xfree(new); return(re); } int regexp_exec(re, s, fname) CONST reg_ex_t *re; CONST char *s; int fname; { if (!re || (fname && skipdotfile && *s == '.')) return(0); return(!regexec(re, s, 0, NULL, 0)); } VOID regexp_free(re) reg_ex_t *re; { if (re) { regfree(re); Xfree(re); } } # else /* !USEREGCOMP */ # ifdef USEREGCMP extern char *regcmp __P_((CONST char *, int)); extern char *regex __P_((CONST char *, CONST char *, ...)); reg_ex_t *regexp_init(s, len) CONST char *s; int len; { reg_ex_t *re; char *new; skipdotfile = (*s == '*' || *s == '?' || *s == '['); new = cnvregexp(s, len); re = regcmp(new, 0); Xfree(new); return(re); } int regexp_exec(re, s, fname) CONST reg_ex_t *re; CONST char *s; int fname; { if (!re || (fname && skipdotfile && *s == '.')) return(0); return(regex(re, s) ? 1 : 0); } VOID regexp_free(re) reg_ex_t *re; { Xfree(re); } # else /* !USEREGCMP */ reg_ex_t *regexp_init(s, len) CONST char *s; int len; { reg_ex_t *re; char *cp, *paren; ALLOC_T size; int i, j, n, pc, plen, metachar, quote; skipdotfile = 0; if (len < 0) len = strlen(s); re = NULL; paren = NULL; n = plen = size = 0; quote = '\0'; re = b_realloc(re, n, reg_ex_t); re[n] = NULL; for (i = 0; i < len; i++) { cp = NULL; metachar = 0; pc = parsechar(&(s[i]), len - i, '\0', 0, "e, NULL); if (pc == PC_OPQUOTE || pc == PC_CLQUOTE) continue; else if (pc == PC_ESCAPE) { metachar = 1; i++; } if (paren) { paren = c_realloc(paren, plen + 1, &size); if (quote || metachar) { #ifdef BASHSTYLE /* bash treats a character quoted by \ in "[]" as a character itself */ paren[plen++] = PESCAPE; if (iswchar(s, i)) { paren[plen++] = s[i++]; paren[plen++] = s[i]; } # ifndef PATHNOCASE else if (!pathignorecase) paren[plen++] = s[i]; # endif paren[plen++] = Xtoupper(s[i]); #endif /* BASHSTYLE */ } else if (s[i] == ']') { if (!plen) { Xfree(paren); regexp_free(re); return(NULL); } #ifndef BASHSTYLE /* bash treats "[a-]]" as "[a-]" + "]" */ if (paren[plen - 1] == '-') { paren[plen++] = s[i]; continue; } #endif paren[plen] = '\0'; cp = Xrealloc(paren, plen + 1); paren = NULL; } #ifdef BASHSTYLE /* bash treats "[^abc]" as "[!abc]" */ else if (!plen && (s[i] == '!' || s[i] == '^')) paren[plen++] = '\0'; #else else if (!plen && s[i] == '!') paren[plen++] = '\0'; #endif else if (s[i] == '-') { if (i + 1 >= len) j = '\0'; #ifndef PATHNOCASE else if (!pathignorecase) j = s[i + 1]; #endif else j = Xtoupper(s[i + 1]); #ifdef BASHSTYLE /* bash does not allow "[b-a]" */ if (plen && j && j != ']' && j < paren[plen - 1]) { Xfree(paren); regexp_free(re); return(NULL); } #else /* Bourne shell ignores "[b-a]" */ if (plen && j && j < paren[plen - 1]) { do { if (i + 1 >= len) break; i++; } while (s[i + 1] != ']'); } /* Bourne shell does not allow "[-a]" */ else if ((!plen && j != '-')) { Xfree(paren); regexp_free(re); return(NULL); } #endif else paren[plen++] = s[i]; } else if (iswchar(s, i)) { paren[plen++] = s[i++]; paren[plen++] = s[i]; } #ifndef PATHNOCASE else if (!pathignorecase) paren[plen++] = s[i]; #endif else paren[plen++] = Xtoupper(s[i]); } else if (!quote && !metachar) switch (s[i]) { case '?': cp = wildsymbol1; if (!n) skipdotfile++; break; case '*': cp = wildsymbol2; if (!n) skipdotfile++; break; case '[': paren = c_realloc(NULL, 0, &size); plen = 0; if (!n) skipdotfile++; break; default: break; } if (paren) continue; if (!cp) { cp = Xmalloc(2 + 1); j = 0; if (iswchar(s, i)) { cp[j++] = s[i++]; cp[j++] = s[i]; } #ifndef PATHNOCASE else if (!pathignorecase) cp[j++] = s[i]; #endif else cp[j++] = Xtoupper(s[i]); cp[j] = '\0'; } re[n++] = cp; re = b_realloc(re, n, reg_ex_t); re[n] = NULL; } if (paren) { Xfree(paren); if (plen) { regexp_free(re); return(NULL); } cp = Xstrdup("["); re[n++] = cp; re = b_realloc(re, n, reg_ex_t); re[n] = NULL; } return((reg_ex_t *)Xrealloc(re, (n + 1) * sizeof(reg_ex_t))); } static int NEAR _regexp_exec(re, s) CONST reg_ex_t *re; CONST char *s; { int i, n1, n2, c1, c2, beg, rev; for (n1 = n2 = 0; re[n1] && s[n2]; n1++, n2++) { c1 = (u_char)(s[i = n2]); if (iswchar(s, n2)) c1 = (c1 << 8) + (u_char)(s[++n2]); #ifndef PATHNOCASE else if (!pathignorecase) /*EMPTY*/; #endif else c1 = Xtoupper(c1); if (re[n1] == wildsymbol1) continue; if (re[n1] == wildsymbol2) { if (_regexp_exec(&(re[n1 + 1]), &(s[i]))) return(1); n1--; continue; } i = rev = 0; if (!re[n1][i]) { rev = 1; i++; } beg = -1; c2 = '\0'; for (; re[n1][i]; i++) { #ifdef BASHSTYLE /* bash treats a character quoted by \ in "[]" as a character itself */ if (re[n1][i] == PESCAPE && re[n1][i + 1]) i++; /* bash treats "[a-]]" as "[a-]" + "]" */ else if (re[n1][i] == '-' && re[n1][i + 1] && c2) #else if (re[n1][i] == '-' && c2) #endif { beg = c2; i++; } c2 = (u_char)(re[n1][i]); if (iswchar(re[n1], i)) c2 = (c2 << 8) + (u_char)(re[n1][++i]); if (beg >= 0) { if (beg && c1 >= beg && c1 <= c2) break; beg = -1; } else if (c1 == c2) break; } if (rev) { if (re[n1][i]) return(0); } else { if (!re[n1][i]) return(0); } } while (re[n1] == wildsymbol2) n1++; if (re[n1] || s[n2]) return(0); return(1); } int regexp_exec(re, s, fname) CONST reg_ex_t *re; CONST char *s; int fname; { if (!re || (fname && skipdotfile && *s == '.')) return(0); return(_regexp_exec(re, s)); } VOID regexp_free(re) reg_ex_t *re; { int i; if (re) { for (i = 0; re[i]; i++) if (re[i] != wildsymbol1 && re[i] != wildsymbol2) Xfree(re[i]); Xfree(re); } } # endif /* !USEREGCMP */ # endif /* !USEREGCOMP */ #endif /* !USERE_COMP */ static VOID NEAR addstrbuf(sp, s, len) strbuf_t *sp; CONST char *s; int len; { sp -> s = c_realloc(sp -> s, sp -> len + len, &(sp -> size)); memcpy(&(sp -> s[sp -> len]), s, len); sp -> len += len; sp -> s[sp -> len] = '\0'; } static VOID NEAR duplwild(dst, src) wild_t *dst; CONST wild_t *src; { memcpy((char *)dst, (char *)src, sizeof(wild_t)); dst -> fixed.s = Xmalloc(src -> fixed.size); memcpy(dst -> fixed.s, src -> fixed.s, src -> fixed.len + 1); dst -> path.s = Xmalloc(src -> path.size); memcpy(dst -> path.s, src -> path.s, src -> path.len + 1); #ifndef NODIRLOOP if (src -> ino) { dst -> ino = (devino_t *)Xmalloc(src -> nino * sizeof(devino_t)); memcpy((char *)(dst -> ino), (char *)(src -> ino), src -> nino * sizeof(devino_t)); } #endif /* !NODIRLOOP */ } static VOID NEAR freewild(wp) wild_t *wp; { Xfree(wp -> fixed.s); Xfree(wp -> path.s); #ifndef NODIRLOOP Xfree(wp -> ino); #endif } static int NEAR _evalwild(argc, argvp, wp) int argc; char ***argvp; wild_t *wp; { #if defined (DOUBLESLASH) || defined (DEP_URLPATH) int prefix; #endif DIR *dirp; struct dirent *dp; struct stat st; reg_ex_t *re; wild_t dupl; ALLOC_T flen, plen; CONST char *cp; char *new; int i, n, w, pc, quote, isdir; if (!*(wp -> s)) { if (!(wp -> fixed.len)) return(argc); *argvp = (char **)Xrealloc(*argvp, (argc + 2) * sizeof(char *)); (*argvp)[argc++] = wp -> fixed.s; wp -> fixed.s = NULL; return(argc); } flen = wp -> fixed.len; plen = wp -> path.len; quote = wp -> quote; if (wp -> fixed.len) addstrbuf(&(wp -> path), rootpath, 1); #if defined (DOUBLESLASH) || defined (DEP_URLPATH) if (wp -> path.len) prefix = 0; # ifdef DOUBLESLASH else if ((prefix = isdslash(wp -> s))) { addstrbuf(&(wp -> fixed), wp -> s, prefix); addstrbuf(&(wp -> path), wp -> s, prefix); wp -> s += prefix; wp -> type = WT_DOUBLESLASH; } # endif # ifdef DEP_URLPATH else if ((prefix = isurl(wp -> s, 0))) { addstrbuf(&(wp -> fixed), wp -> s, prefix); addstrbuf(&(wp -> path), wp -> s, prefix); wp -> s += prefix; wp -> type = WT_URLPATH; } # endif #endif /* DOUBLESLASH || DEP_URLPATH */ for (i = w = 0; wp -> s[i] && wp -> s[i] != _SC_; i++) { pc = parsechar(&(wp -> s[i]), -1, '\0', 0, &(wp -> quote), NULL); if (pc == PC_OPQUOTE || pc == PC_CLQUOTE) { if (!(wp -> flags & EA_STRIPQ)) addstrbuf(&(wp -> fixed), &(wp -> s[i]), 1); continue; } else if (pc == PC_WCHAR) { addstrbuf(&(wp -> fixed), &(wp -> s[i]), 1); addstrbuf(&(wp -> path), &(wp -> s[i]), 1); i++; } else if (pc == PC_ESCAPE) { if (wp -> flags & EA_KEEPESCAPE) addstrbuf(&(wp -> fixed), &(wp -> s[i]), 1); if (wp -> s[i + 1] == _SC_) continue; if (wp -> quote == '\'' || (wp -> quote == '"' && !Xstrchr(DQ_METACHAR, wp -> s[i + 1]))) { if (!(wp -> flags & EA_KEEPESCAPE)) addstrbuf(&(wp -> fixed), &(wp -> s[i]), 1); addstrbuf(&(wp -> path), &(wp -> s[i]), 1); } i++; } else if (pc == PC_NORMAL && Xstrchr("?*[", wp -> s[i])) { if (w >= 0 && wp -> s[i] == '*') w++; else w = -1; } addstrbuf(&(wp -> fixed), &(wp -> s[i]), 1); addstrbuf(&(wp -> path), &(wp -> s[i]), 1); } if (!(wp -> s[i])) isdir = 0; else { isdir = 1; addstrbuf(&(wp -> fixed), rootpath, 1); } if (!w) { if (wp -> path.len <= plen) w++; #if defined (DOUBLESLASH) || defined (DEP_URLPATH) else if (prefix || wp -> type == WT_URLPATH) w++; #endif else if (stat2(wp -> path.s, &st) < 0) return(argc); wp -> s += i; if (isdir) { if (!w && (st.st_mode & S_IFMT) != S_IFDIR) return(argc); (wp -> s)++; } #ifndef NODIRLOOP if (!w) { wp -> ino = (devino_t *)Xrealloc(wp -> ino, (wp -> nino + 1) * sizeof(devino_t)); wp -> ino[wp -> nino].dev = st.st_dev; wp -> ino[(wp -> nino)++].ino = st.st_ino; } #endif return(_evalwild(argc, argvp, wp)); } if (w != 2 || !isdir || strcmp(&(wp -> path.s[plen]), "**")) w = -1; wp -> fixed.len = flen; wp -> path.len = plen; wp -> fixed.s[flen] = wp -> path.s[plen] = '\0'; if (w > 0) { duplwild(&dupl, wp); dupl.s += i + 1; argc = _evalwild(argc, argvp, &dupl); freewild(&dupl); re = NULL; } else { new = Xmalloc(i + 2); n = 0; if (quote) new[n++] = quote; memcpy(&(new[n]), wp -> s, i); n += i; if (wp -> quote) new[n++] = wp -> quote; re = regexp_init(new, n); Xfree(new); if (!re) return(argc); wp -> s += i + 1; } if (wp -> path.len) cp = wp -> path.s; else if (wp -> fixed.len) cp = rootpath; else cp = curpath; if (!(dirp = Xopendir(cp))) { regexp_free(re); return(argc); } if (wp -> path.len || wp -> fixed.len) addstrbuf(&(wp -> path), rootpath, 1); while ((dp = Xreaddir(dirp))) { if (isdotdir(dp -> d_name)) continue; duplwild(&dupl, wp); n = strlen(dp -> d_name); addstrbuf(&(dupl.fixed), dp -> d_name, n); addstrbuf(&(dupl.path), dp -> d_name, n); if (isdir) { if (re) n = regexp_exec(re, dp -> d_name, 1); else n = (*(dp -> d_name) == '.') ? 0 : 1; if (!n || Xstat(dupl.path.s, &st) < 0 || (st.st_mode & S_IFMT) != S_IFDIR) { freewild(&dupl); continue; } #ifndef NODIRLOOP if (!re) { for (n = 0; n < dupl.nino; n++) if (dupl.ino[n].dev == st.st_dev && dupl.ino[n].ino == st.st_ino) break; if (n < dupl.nino) { freewild(&dupl); continue; } } dupl.ino = (devino_t *)Xrealloc(dupl.ino, (dupl.nino + 1) * sizeof(devino_t)); dupl.ino[dupl.nino].dev = st.st_dev; dupl.ino[(dupl.nino)++].ino = st.st_ino; #endif addstrbuf(&(dupl.fixed), rootpath, 1); argc = _evalwild(argc, argvp, &dupl); } else if (regexp_exec(re, dp -> d_name, 1)) { *argvp = (char **)Xrealloc(*argvp, (argc + 2) * sizeof(char *)); (*argvp)[argc++] = dupl.fixed.s; dupl.fixed.s = NULL; } freewild(&dupl); } VOID_C Xclosedir(dirp); regexp_free(re); return(argc); } int cmppath(vp1, vp2) CONST VOID_P vp1; CONST VOID_P vp2; { return(strverscmp2(*((char **)vp1), *((char **)vp2))); } char **evalwild(s, flags) CONST char *s; int flags; { wild_t w; char **argv; int argc; argv = (char **)Xmalloc(1 * sizeof(char *)); w.s = s; w.fixed.s = c_realloc(NULL, 0, &(w.fixed.size)); w.path.s = c_realloc(NULL, 0, &(w.path.size)); w.fixed.len = w.path.len = (ALLOC_T)0; w.quote = '\0'; #ifndef NODIRLOOP w.nino = 0; w.ino = NULL; #endif #if defined (DOUBLESLASH) || defined (DEP_URLPATH) w.type = WT_NORMAL; #endif w.flags = flags; argc = _evalwild(0, &argv, &w); freewild(&w); if (!argc) { Xfree(argv); return(NULL); } argv[argc] = NULL; if (argc > 1) qsort(argv, argc, sizeof(char *), cmppath); return(argv); } #ifndef _NOUSEHASH static int NEAR calchash(s) CONST char *s; { u_int n; int i; for (i = n = 0; s[i]; i++) n = n * 12345 + (u_char)(s[i]); return(n % MAXHASH); } static VOID NEAR inithash(VOID_A) { int i; if (hashtable) return; hashtable = (hashlist **)Xmalloc(MAXHASH * sizeof(hashlist *)); for (i = 0; i < MAXHASH; i++) hashtable[i] = NULL; } static hashlist *NEAR newhash(com, path, cost, next) CONST char *com; char *path; int cost; hashlist *next; { hashlist *new; new = (hashlist *)Xmalloc(sizeof(hashlist)); new -> command = Xstrdup(com); new -> path = path; new -> hits = 0; new -> cost = cost; new -> next = next; return(new); } static VOID NEAR freehash(htable) hashlist **htable; { hashlist *hp, *next; int i; if (!htable) { if (!hashtable) return; htable = hashtable; } for (i = 0; i < MAXHASH; i++) { next = NULL; for (hp = htable[i]; hp; hp = next) { next = hp -> next; Xfree(hp -> command); Xfree(hp -> path); Xfree(hp); } htable[i] = NULL; } Xfree(htable); if (htable == hashtable) hashtable = NULL; } hashlist **duplhash(htable) hashlist **htable; { CONST hashlist *hp; hashlist **nextp, **new; int i; if (!htable) return(NULL); new = (hashlist **)Xmalloc(MAXHASH * sizeof(hashlist *)); for (i = 0; i < MAXHASH; i++) { *(nextp = &(new[i])) = NULL; for (hp = htable[i]; hp; hp = hp -> next) { *nextp = newhash(hp -> command, Xstrdup(hp -> path), hp -> cost, NULL); (*nextp) -> type = hp -> type; (*nextp) -> hits = hp -> hits; nextp = &((*nextp) -> next); } } return(new); } static hashlist *NEAR findhash(com, n) CONST char *com; int n; { hashlist *hp; for (hp = hashtable[n]; hp; hp = hp -> next) if (!strpathcmp(com, hp -> command)) return(hp); return(NULL); } static VOID NEAR rmhash(com, n) CONST char *com; int n; { hashlist *hp, *prev; prev = NULL; for (hp = hashtable[n]; hp; hp = hp -> next) { if (!strpathcmp(com, hp -> command)) { if (!prev) hashtable[n] = hp -> next; else prev -> next = hp -> next; Xfree(hp -> command); Xfree(hp -> path); Xfree(hp); return; } prev = hp; } } #endif /* !_NOUSEHASH */ static int NEAR isexecute(path, dirok, exe) CONST char *path; int dirok, exe; { struct stat st; int d; if (stat2(path, &st) < 0) return(-1); d = ((st.st_mode & S_IFMT) == S_IFDIR); if (!exe) return(d); if (d) return(dirok ? d : -1); return(Xaccess(path, X_OK)); } #if MSDOS static int NEAR extaccess(path, ext, len, exe) char *path; CONST char *ext; int len, exe; { if (ext) { if (isexecute(path, 0, exe) >= 0) { if (!(strpathcmp(ext, EXTCOM))) return(0); else if (!(strpathcmp(ext, EXTEXE))) return(CM_EXE); else if (!(strpathcmp(ext, EXTBAT))) return(CM_BATCH); } } else { path[len++] = '.'; Xstrcpy(&(path[len]), EXTCOM); if (isexecute(path, 0, exe) >= 0) return(CM_ADDEXT); Xstrcpy(&(path[len]), EXTEXE); if (isexecute(path, 0, exe) >= 0) return(CM_ADDEXT | CM_EXE); Xstrcpy(&(path[len]), EXTBAT); if (isexecute(path, 0, exe) >= 0) return(CM_ADDEXT | CM_BATCH); } return(-1); } #endif /* MSDOS */ int searchhash(hpp, com, search) hashlist **hpp; CONST char *com, *search; { #ifndef _NOUSEHASH hashlist *hp; int n, recalc, duperrno; #endif #if MSDOS char *ext; #endif CONST char *cp, *next; char *tmp, *path; int len, dlen, cost, size, ret; #ifndef _NOUSEHASH if (!hpp || (!com && !search)) { duperrno = errno; if (!com && !search) freehash(hpp); if (!hpp && hashtable) for (n = 0; n < MAXHASH; n++) { for (hp = hashtable[n]; hp; hp = hp -> next) if (hp -> type & CM_RECALC) hp -> type |= CM_REHASH; } errno = duperrno; return(CM_NOTFOUND); } #endif /* !_NOUSEHASH */ #if MSDOS if ((ext = Xstrrchr(com, '.')) && strdelim(++ext, 0)) ext = NULL; #endif if (strdelim(com, 1)) { #if MSDOS len = strlen(com); path = Xmalloc(len + EXTWIDTH + 1); Xstrcpy(path, com); ret = extaccess(path, ext, len, 0); Xfree(path); if (ret >= 0) return(ret | CM_FULLPATH); #else if (isexecute(com, 0, 0) >= 0) return(CM_FULLPATH); #endif return(CM_NOTFOUND | CM_FULLPATH); } #ifndef _NOUSEHASH if (!hashtable) inithash(); n = calchash(com); if ((*hpp = findhash(com, n))) { if (!((*hpp) -> type & CM_REHASH) && isexecute((*hpp) -> path, 0, 1) >= 0) return((*hpp) -> type); rmhash(com, n); } #endif #ifdef CWDINPATH len = strlen(com); path = Xmalloc(len + 2 + EXTWIDTH + 1); path[0] = '.'; path[1] = _SC_; Xstrcpy(&(path[2]), com); # if MSDOS if ((ret = extaccess(path, ext, len + 2, 1)) < 0) Xfree(path); # else if ((ret = isexecute(path, 0, 0)) < 0) Xfree(path); # endif else { # ifdef _NOUSEHASH *hpp = (hashlist *)path; # else *hpp = newhash(com, path, 0, hashtable[n]); hashtable[n] = *hpp; (*hpp) -> type = (ret |= (CM_HASH | CM_RECALC)); # endif return(ret); } #endif /* CWDINPATH */ #ifndef _NOUSEHASH recalc = 0; #endif if ((next = (search) ? search : getconstvar(ENVPATH))) { len = strlen(com); size = ret = 0; path = NULL; cost = 1; for (cp = next; cp; cp = next) { next = cp; #ifdef DEP_DOSPATH if (_dospath(cp)) next += 2; #endif #ifndef _NOUSEHASH if (*next != _SC_) recalc = CM_RECALC; #endif next = Xstrchr(next, PATHDELIM); dlen = (next) ? (next++) - cp : strlen(cp); if (!dlen) tmp = NULL; else { tmp = _evalpath(cp, &(cp[dlen]), 0); dlen = strlen(tmp); } if (dlen + len + 1 + EXTWIDTH + 1 > size) { size = dlen + len + 1 + EXTWIDTH + 1; path = Xrealloc(path, size); } if (tmp) { Xstrncpy(path, tmp, dlen); Xfree(tmp); dlen = strcatdelim(path) - path; } Xstrncpy(&(path[dlen]), com, len); dlen += len; #if MSDOS if ((ret = extaccess(path, ext, dlen, 1)) >= 0) break; #else if (isexecute(path, 0, 1) >= 0) break; #endif cost++; } if (cp) { #ifdef _NOUSEHASH *hpp = (hashlist *)path; #else *hpp = newhash(com, path, cost, hashtable[n]); hashtable[n] = *hpp; (*hpp) -> type = (ret |= (CM_HASH | recalc)); #endif return(ret); } Xfree(path); } return(CM_NOTFOUND); } #ifdef FD char *searchexecpath(path, search) CONST char *path, *search; { hashlist *hp; int type; if ((type = searchhash(&hp, path, search)) & CM_NOTFOUND) return(NULL); if (type & CM_FULLPATH) return(Xstrdup(path)); # ifdef _NOUSEHASH return((char *)hp); # else return(Xstrdup(hp -> path)); # endif } #endif /* FD */ #if !defined (FDSH) && !defined (_NOCOMPLETE) int addcompletion(s, cp, argc, argvp) CONST char *s; char *cp; int argc; char ***argvp; { int n; if (!s) { if (!cp) return(argc); s = cp; } for (n = 0; n < argc; n++) if (!strpathcmp(s, (*argvp)[n])) break; if (n < argc) Xfree(cp); else { *argvp = (char **)Xrealloc(*argvp, ++argc * sizeof(char *)); (*argvp)[n] = (cp) ? cp : Xstrdup(s); } return(argc); } # ifndef NOUID # ifndef NOGETPWENT int completeuser(name, len, argc, argvp, home) CONST char *name; int len, argc; char ***argvp; int home; { struct passwd *pwd; char *new; ALLOC_T size; len = strlen(name); # ifdef DEBUG _mtrace_file = "setpwent(start)"; setpwent(); if (_mtrace_file) _mtrace_file = NULL; else { _mtrace_file = "setpwent(end)"; malloc(0); /* dummy alloc */ } for (;;) { _mtrace_file = "getpwent(start)"; pwd = getpwent(); if (_mtrace_file) _mtrace_file = NULL; else { _mtrace_file = "getpwent(end)"; malloc(0); /* dummy alloc */ } if (!pwd) break; if (strnpathcmp(name, pwd -> pw_name, len)) continue; if (!home) new = Xstrdup(pwd -> pw_name); else { size = strlen(pwd -> pw_name); new = Xmalloc(size + 2 + 1); new[0] = '~'; VOID_C strcatdelim2(&(new[1]), pwd -> pw_name, NULL); } argc = addcompletion(NULL, new, argc, argvp); } _mtrace_file = "endpwent(start)"; endpwent(); if (_mtrace_file) _mtrace_file = NULL; else { _mtrace_file = "endpwent(end)"; malloc(0); /* dummy alloc */ } # else /* !DEBUG */ setpwent(); while ((pwd = getpwent())) { if (strnpathcmp(name, pwd -> pw_name, len)) continue; if (!home) new = Xstrdup(pwd -> pw_name); else { size = strlen(pwd -> pw_name); new = Xmalloc(size + 2 + 1); new[0] = '~'; VOID_C strcatdelim2(&(new[1]), pwd -> pw_name, NULL); } argc = addcompletion(NULL, new, argc, argvp); } endpwent(); # endif /* !DEBUG */ return(argc); } # endif /* !NOGETPWENT */ # ifndef NOGETGRENT int completegroup(name, len, argc, argvp) CONST char *name; int len, argc; char ***argvp; { struct group *grp; len = strlen(name); # ifdef DEBUG _mtrace_file = "setgrent(start)"; setgrent(); if (_mtrace_file) _mtrace_file = NULL; else { _mtrace_file = "setgrent(end)"; malloc(0); /* dummy alloc */ } for (;;) { _mtrace_file = "getgrent(start)"; grp = getgrent(); if (_mtrace_file) _mtrace_file = NULL; else { _mtrace_file = "getgrent(end)"; malloc(0); /* dummy alloc */ } if (!grp) break; if (strnpathcmp(name, grp -> gr_name, len)) continue; argc = addcompletion(grp -> gr_name, NULL, argc, argvp); } _mtrace_file = "endgrent(start)"; endgrent(); if (_mtrace_file) _mtrace_file = NULL; else { _mtrace_file = "endgrent(end)"; malloc(0); /* dummy alloc */ } # else /* !DEBUG */ setgrent(); while ((grp = getgrent())) { if (strnpathcmp(name, grp -> gr_name, len)) continue; argc = addcompletion(grp -> gr_name, NULL, argc, argvp); } endgrent(); # endif /* !DEBUG */ return(argc); } # endif /* !NOGETGRENT */ # endif /* !NOUID */ static int NEAR completefile(file, len, argc, argvp, dir, dlen, exe) CONST char *file; int len, argc; char ***argvp; CONST char *dir; int dlen, exe; { DIR *dirp; struct dirent *dp; char *cp, *new, path[MAXPATHLEN]; int d, size, dirok; if (dlen >= MAXPATHLEN - 2) return(argc); Xstrncpy(path, dir, dlen); if (!(dirp = Xopendir(path))) return(argc); cp = strcatdelim(path); dirok = (exe <= 1) ? 1 : 0; while ((dp = Xreaddir(dirp))) { if ((!len && isdotdir(dp -> d_name)) || strnpathcmp(file, dp -> d_name, len)) continue; size = strcatpath(path, cp, dp -> d_name); if (size < 0) continue; if (isdotdir(dp -> d_name)) d = 1; else if ((d = isexecute(path, dirok, exe)) < 0) continue; new = Xmalloc(size + 1 + 1); Xstrncpy(new, dp -> d_name, size); if (d) new[size++] = _SC_; new[size] = '\0'; argc = addcompletion(NULL, new, argc, argvp); } VOID_C Xclosedir(dirp); return(argc); } static int NEAR completeexe(file, len, argc, argvp) CONST char *file; int len, argc; char ***argvp; { char *cp, *tmp, *next; int dlen; # ifdef CWDINPATH argc = completefile(file, len, argc, argvp, curpath, 1, 2); # endif if (!(next = getconstvar(ENVPATH))) return(argc); for (cp = next; cp; cp = next) { # ifdef DEP_DOSPATH if (_dospath(cp)) next = Xstrchr(&(cp[2]), PATHDELIM); else # endif next = Xstrchr(cp, PATHDELIM); dlen = (next) ? (next++) - cp : strlen(cp); tmp = _evalpath(cp, &(cp[dlen]), 0); dlen = strlen(tmp); argc = completefile(file, len, argc, argvp, tmp, dlen, 2); Xfree(tmp); } return(argc); } int completepath(path, len, argc, argvp, exe) CONST char *path; int len, argc; char ***argvp; int exe; { # ifdef DEP_DOSPATH char cwd[4]; # endif # if defined (DOUBLESLASH) || defined (DEP_URLPATH) int n; # endif CONST char *dir, *file; int dlen; dlen = 0; # ifdef DEP_DOSPATH if (_dospath(path)) dlen = 2; # endif dir = &(path[dlen]); if ((file = strrdelim(dir, 0))) { if (file == dir) { dlen++; file++; } # ifdef DOUBLESLASH else if ((n = isdslash(path)) && file < &(path[n])) { if (path[n - 1] != _SC_) return(argc); dlen = n; file = &(path[n]); if (*file == _SC_) file++; } # endif # ifdef DEP_URLPATH else if ((n = _urlpath(path, NULL, NULL)) && file < &(path[n])) return(argc); # endif else dlen += file++ - dir; return(completefile(file, strlen(file), argc, argvp, path, dlen, exe)); } # if !defined (NOUID) && !defined (NOGETPWENT) else if (*path == '~') return(completeuser(&(path[1]), len - 1, argc, argvp, 1)); # endif # ifdef DEP_DOSPATH else if (dir != path) { len -= dlen; dlen = gendospath(cwd, *path, '.') - cwd; return(completefile(dir, len, argc, argvp, cwd, dlen, exe)); } # endif else if (exe) return(completeexe(path, len, argc, argvp)); return(completefile(path, len, argc, argvp, curpath, 1, exe)); } char *findcommon(argc, argv) int argc; char *CONST *argv; { char *common; int i, n; if (!argv || !argv[0]) return(NULL); common = Xstrdup(argv[0]); for (n = 1; n < argc; n++) { for (i = 0; common[i]; i++) if (common[i] != argv[n][i]) break; common[i] = '\0'; } if (!common[0]) { Xfree(common); return(NULL); } return(common); } #endif /* !FDSH && !_NOCOMPLETE */ static int NEAR addmeta(s1, s2, flags) char *s1; CONST char *s2; int flags; { int i, j, c; if (!s2) return(0); if (flags & EA_INQUOTE) flags |= EA_NOEVALQ; for (i = j = 0; s2[i]; i++, j++) { c = '\0'; if (s2[i] == '\'' && !(flags & EA_NOEVALQ)) c = PESCAPE; else if (s2[i] == '"' && !(flags & EA_NOEVALDQ)) c = PESCAPE; #ifndef FAKEESCAPE else if (s2[i] == PESCAPE && !(flags & EA_STRIPESCAPE)) c = PESCAPE; #endif else if (iswchar(s2, i)) c = s2[i++]; if (c) { if (s1) s1[j] = c; j++; } if (s1) s1[j] = s2[i]; } return(j); } char *catvar(argv, delim) char *CONST *argv; int delim; { char *cp; int i, len; if (!argv) return(NULL); for (i = len = 0; argv[i]; i++) len += strlen(argv[i]); if (i < 1) return(Xstrdup(nullstr)); len += (delim) ? i - 1 : 0; cp = Xmalloc(len + 1); len = Xstrcpy(cp, argv[0]) - cp; for (i = 1; argv[i]; i++) { if (delim) cp[len++] = delim; len = Xstrcpy(&(cp[len]), argv[i]) - cp; } return(cp); } int countvar(var) char *CONST *var; { int i; if (!var) return(0); for (i = 0; var[i]; i++) /*EMPTY*/; return(i); } VOID freevar(var) char **var; { int i, duperrno; duperrno = errno; if (var) { for (i = 0; var[i]; i++) Xfree(var[i]); Xfree(var); } errno = duperrno; } char **duplvar(var, margin) char *CONST *var; int margin; { char **dupl; int i, n; if (margin < 0) { if (!var) return(NULL); margin = 0; } n = countvar(var); dupl = (char **)Xmalloc((n + margin + 1) * sizeof(char *)); for (i = 0; i < n; i++) dupl[i] = Xstrdup(var[i]); dupl[i] = NULL; return(dupl); } int parsechar(s, len, spc, flags, qp, pqp) CONST char *s; int len, spc, flags, *qp, *pqp; { if (*s == *qp) { #ifdef FD if (flags & EA_FINDMETA) return((*qp == '\'') ? PC_EXMETA : PC_META); #endif if (!pqp) *qp = '\0'; else { *qp = *pqp; *pqp = '\0'; } return(PC_CLQUOTE); } else if (iswchar(s, 0)) return(PC_WCHAR); else if (*qp == '\'') return(PC_SQUOTE); #ifdef FD else if ((flags & EA_FINDMETA) && Xstrchr(DQ_METACHAR, *s)) return(PC_META); else if ((flags & EA_FINDDELIM) && Xstrchr(CMDLINE_DELIM, *s)) return(PC_DELIM); #endif else if (isescape(s, 0, *qp, len, flags)) return(PC_ESCAPE); else if (*qp == '`') return(PC_BQUOTE); #ifdef NESTINGQUOTE else if ((flags & EA_BACKQ) && *s == '`') { if (pqp && *qp) *pqp = *qp; *qp = *s; return(PC_OPQUOTE); } #endif else if (spc && *s == spc) return(*s); else if (*qp) return(PC_DQUOTE); else if (!(flags & EA_NOEVALQ) && *s == '\'') { #ifdef FD if (flags & EA_FINDMETA) return(PC_META); #endif *qp = *s; return(PC_OPQUOTE); } else if (!(flags & EA_NOEVALDQ) && *s == '"') { *qp = *s; return(PC_OPQUOTE); } #ifndef NESTINGQUOTE else if ((flags & EA_BACKQ) && *s == '`') { if (pqp && *qp) *pqp = *qp; *qp = *s; return(PC_OPQUOTE); } #endif #ifdef FD else if ((flags & EA_FINDMETA) && Xstrchr(METACHAR, *s)) return(PC_META); #endif return(PC_NORMAL); } static int NEAR skipvar(bufp, eolp, ptrp, flags) CONST char **bufp; int *eolp, *ptrp, flags; { int i, mode; mode = '\0'; *bufp += *ptrp; *ptrp = 0; if (isidentchar((*bufp)[*ptrp])) { while ((*bufp)[++(*ptrp)]) if (!isidentchar2((*bufp)[*ptrp])) break; if (eolp) *eolp = *ptrp; return(mode); } #ifndef MINIMUMSHELL if ((*bufp)[*ptrp] == '(') { if ((*bufp)[++(*ptrp)] != '(') { if (skipvarvalue(*bufp, ptrp, ")", flags, 0, 1) < 0) return(-1); } else { (*ptrp)++; if (skipvarvalue(*bufp, ptrp, "))", flags, 0, 1) < 0) return(-1); } if (eolp) *eolp = *ptrp; return('('); } #endif if ((*bufp)[*ptrp] != '{') { if (!(flags & EA_INQUOTE) || (*bufp)[*ptrp] != '"') (*ptrp)++; if (eolp) *eolp = *ptrp; return(mode); } (*bufp)++; #ifndef MINIMUMSHELL if ((*bufp)[*ptrp] == '#' && (*bufp)[*ptrp + 1] != '}') { (*bufp)++; mode = 'n'; } #endif if (isidentchar((*bufp)[*ptrp])) { while ((*bufp)[++(*ptrp)]) if (!isidentchar2((*bufp)[*ptrp])) break; } else (*ptrp)++; if (eolp) *eolp = *ptrp; if ((i = (*bufp)[(*ptrp)++]) == '}') return(mode); #ifndef MINIMUMSHELL if (mode) return(-1); #endif if (i == ':') { mode = (*bufp)[(*ptrp)++]; if (!Xstrchr("-=?+", mode)) return(-1); mode |= 0x80; } else if (Xstrchr("-=?+", i)) mode = i; #ifndef MINIMUMSHELL else if (i != RMSUFFIX && i != '#') return(-1); else if ((*bufp)[*ptrp] != i) mode = i; else { (*ptrp)++; mode = i | 0x80; } #endif /* !MINIMUMSHELL */ #ifdef BASHSTYLE /* bash treats any meta character in ${} as just a character */ # ifdef MINIMUMSHELL if (skipvarvalue(*bufp, ptrp, "}", flags, 0) < 0) return(-1); # else if (skipvarvalue(*bufp, ptrp, "}", flags, 0, 0) < 0) return(-1); # endif #else /* !BASHSTYLE */ # ifdef MINIMUMSHELL if (skipvarvalue(*bufp, ptrp, "}", flags, 1) < 0) return(-1); # else i = (flags & EA_INQUOTE) ? 0 : 1; if (skipvarvalue(*bufp, ptrp, "}", flags, i, 0) < 0) return(-1); # endif #endif /* !BASHSTYLE */ return(mode); } #ifdef MINIMUMSHELL static int NEAR skipvarvalue(s, ptrp, next, flags, nonl) CONST char *s; int *ptrp; CONST char *next; int flags, nonl; #else static int NEAR skipvarvalue(s, ptrp, next, flags, nonl, nest) CONST char *s; int *ptrp; CONST char *next; int flags, nonl, nest; #endif { #ifdef NESTINGQUOTE int pq; #endif CONST char *cp; int pc, q, f, len; #ifdef NESTINGQUOTE pq = '\0'; #endif q = '\0'; len = strlen(next); while (s[*ptrp]) { f = flags; if (q == '"') f |= EA_INQUOTE; #ifdef NESTINGQUOTE pc = parsechar(&(s[*ptrp]), -1, '$', EA_BACKQ, &q, &pq); #else pc = parsechar(&(s[*ptrp]), -1, '$', EA_BACKQ, &q, NULL); #endif if (pc == PC_WCHAR || pc == PC_ESCAPE) (*ptrp)++; else if (pc == '$') { if (!s[++(*ptrp)]) return(0); cp = s; if (skipvar(&cp, NULL, ptrp, f) < 0) return(-1); *ptrp += (cp - s); continue; } else if (pc != PC_NORMAL) /*EMPTY*/; else if (nonl && s[*ptrp] == '\n') return(-1); #ifndef MINIMUMSHELL else if (nest && s[*ptrp] == '(') { (*ptrp)++; if (skipvarvalue(s, ptrp, ")", f, nonl, nest) < 0) return(-1); continue; } #endif else if (!strncmp(&(s[*ptrp]), next, len)) { *ptrp += len; return(0); } (*ptrp)++; } return(-1); } #ifndef MINIMUMSHELL static char *NEAR removeword(s, pattern, plen, mode) CONST char *s, *pattern; int plen, mode; { reg_ex_t *re; CONST char *cp; char *ret, *tmp, *new; int c, n, len; if (!s || !*s) return(NULL); tmp = Xstrndup(pattern, plen); new = evalarg(tmp, EA_BACKQ); Xfree(tmp); re = regexp_init(new, -1); Xfree(new); if (!re) return(NULL); ret = NULL; len = strlen(s); n = -1; if ((mode & ~0x80) != '#') { if (mode & 0x80) for (cp = s; cp < &(s[len]); cp++) { if (regexp_exec(re, cp, 0)) { n = cp - s; break; } } else for (cp = &(s[len - 1]); cp >= s; cp--) { if (regexp_exec(re, cp, 0)) { n = cp - s; break; } } if (n >= 0) ret = Xstrndup(s, n); } else { new = Xstrdup(s); if (mode & 0x80) for (tmp = &(new[len]); tmp >= new; tmp--) { *tmp = '\0'; if (regexp_exec(re, new, 0)) { n = tmp - new; break; } } else for (tmp = &(new[1]); tmp <= &(new[len]); tmp++) { c = *tmp; *tmp = '\0'; if (regexp_exec(re, new, 0)) { n = tmp - new; break; } *tmp = c; } if (n >= 0) ret = Xstrdup(&(s[n])); Xfree(new); } regexp_free(re); return(ret); } static char **NEAR removevar(var, pattern, plen, mode) char **var; CONST char *pattern; int plen, mode; { char *cp, **new; int i, n; n = countvar(var); new = (char **)Xmalloc((n + 1) * sizeof(char *)); for (i = 0; i < n; i++) { if ((cp = removeword(var[i], pattern, plen, mode))) new[i] = cp; else new[i] = Xstrdup(var[i]); } new[i] = NULL; return(new); } #endif /* !MINIMUMSHELL */ #ifdef MINIMUMSHELL static char *NEAR evalshellparam(c, flags) int c, flags; #else static char *NEAR evalshellparam(c, flags, pattern, plen, modep) int c, flags; CONST char *pattern; int plen, *modep; #endif { #ifndef MINIMUMSHELL char **new; #endif char *cp, **arglist, tmp[MAXLONGWIDTH + 1]; p_id_t pid; int i, j, sp; cp = NULL; #ifndef MINIMUMSHELL new = NULL; #endif switch (c) { case '@': if (!(arglist = argvar)) break; #ifndef MINIMUMSHELL if (modep) { new = removevar(arglist, pattern, plen, *modep); arglist = new; *modep = '\0'; } #endif sp = ' '; if (!(flags & EA_INQUOTE)) { cp = catvar(&(arglist[1]), sp); break; } #ifdef BASHSTYLE /* bash uses IFS instead of a space as a separator */ if ((cp = getconstvar(ENVIFS)) && *cp) sp = *cp; #endif for (i = j = 0; arglist[i + 1]; i++) j += addmeta(NULL, arglist[i + 1], flags); if (i <= 0) cp = Xstrdup(nullstr); else { j += (i - 1) * 3; cp = Xmalloc(j + 1); j = addmeta(cp, arglist[1], flags); for (i = 2; arglist[i]; i++) { cp[j++] = '"'; cp[j++] = sp; cp[j++] = '"'; j += addmeta(&(cp[j]), arglist[i], flags); } cp[j] = '\0'; } break; case '*': if (!(arglist = argvar)) break; #ifndef MINIMUMSHELL if (modep) { new = removevar(arglist, pattern, plen, *modep); arglist = new; *modep = '\0'; } #endif sp = ' '; #ifdef BASHSTYLE /* bash uses IFS instead of a space as a separator */ if ((flags & EA_INQUOTE) && (cp = getconstvar(ENVIFS))) sp = (*cp) ? *cp : '\0'; #endif cp = catvar(&(arglist[1]), sp); break; case '#': if (!argvar) break; VOID_C Xsnprintf(tmp, sizeof(tmp), "%d", countvar(argvar + 1)); cp = tmp; break; case '?': VOID_C Xsnprintf(tmp, sizeof(tmp), "%d", (getretvalfunc) ? (*getretvalfunc)() : 0); cp = tmp; break; case '$': if (!getpidfunc) pid = getpid(); else pid = (*getpidfunc)(); VOID_C Xsnprintf(tmp, sizeof(tmp), "%id", pid); cp = tmp; break; case '!': if (getlastpidfunc && (pid = (*getlastpidfunc)()) >= 0) { VOID_C Xsnprintf(tmp, sizeof(tmp), "%id", pid); cp = tmp; } break; case '-': if (getflagfunc) cp = (*getflagfunc)(); break; default: break; } if (cp == tmp) cp = Xstrdup(tmp); #ifndef MINIMUMSHELL freevar(new); #endif return(cp); } static int NEAR replacevar(arg, cpp, s, len, vlen, mode) CONST char *arg; char **cpp; int s, len, vlen, mode; { char *val; int i; if (!mode) return(0); if (mode == '+') { if (!*cpp) return(0); } else if (*cpp) return(0); else if (mode == '=' && !isidentchar(*arg)) return(-1); val = Xstrndup(&(arg[s]), vlen); *cpp = evalarg(val, (mode == '=' || mode == '?') ? EA_STRIPQ | EA_BACKQ : EA_BACKQ); Xfree(val); if (!*cpp) return(-1); if (mode == '=') { #ifdef FD demacroarg(cpp); #endif if (setvar(arg, *cpp, len) < 0) { Xfree(*cpp); *cpp = NULL; return(-1); } #ifdef BASHSTYLE /* bash does not evaluates a quoted string in substitution itself */ Xfree(*cpp); val = Xstrndup(&(arg[s]), vlen); *cpp = evalarg(val, EA_BACKQ); Xfree(val); if (!*cpp) return(-1); # ifdef FD demacroarg(cpp); # endif #endif } else if (mode == '?') { #ifdef FD demacroarg(cpp); #endif for (i = 0; i < len; i++) VOID_C Xfputc(arg[i], Xstderr); VOID_C Xfprintf(Xstderr, ": %k", (vlen > 0) ? *cpp : "parameter null or not set"); VOID_C fputnl(Xstderr); Xfree(*cpp); *cpp = NULL; if (exitfunc) (*exitfunc)(); return(-2); } return(mode); } static char *NEAR insertarg(buf, ptr, arg, olen, nlen) char *buf; int ptr; CONST char *arg; int olen, nlen; { if (nlen <= olen) return(buf); buf = Xrealloc(buf, ptr + nlen + (int)strlen(arg) - olen + 1); return(buf); } static int NEAR evalvar(bufp, ptr, argp, flags) char **bufp; int ptr; CONST char **argp; int flags; { #ifndef MINIMUMSHELL char tmp[MAXLONGWIDTH + 1]; #endif CONST char *arg, *top; char *cp, *new; int i, c, n, len, vlen, s, nul, mode; new = NULL; arg = *argp; top = &(arg[1]); n = 0; if ((mode = skipvar(&top, &s, &n, flags)) < 0) return(-1); *argp = &(top[n - 1]); if (!(len = s)) { (*bufp)[ptr++] = '$'; return(ptr); } nul = (mode & 0x80); if (n > 0 && top[n - 1] == '}') n--; if (!mode) vlen = 0; else { s++; if (nul) s++; vlen = n - s; } #ifdef MINIMUMSHELL mode &= ~0x80; #else if (Xstrchr("-=?+", mode & ~0x80)) mode &= ~0x80; else if (mode == '(') { if (!posixsubstfunc) return(-1); for (;;) { if ((new = (*posixsubstfunc)(top, &n))) break; if (n < 0 || !top[n]) return(-1); if (skipvarvalue(top, &n, ")", flags, 0, 1) < 0) return(-1); *argp = top + n - 1; } mode = '\0'; } else if (mode == 'n') { if (len == 1 && (*top == '*' || *top == '@')) { top--; mode = '\0'; } } else nul = -1; #endif /* !MINIMUMSHELL */ c = '\0'; if ((cp = new)) /*EMPTY*/; else if (isidentchar(*top)) cp = getenvvar(top, len); else if (Xisdigit(*top)) { if (len > 1) return(-1); if (!argvar) { (*bufp)[ptr++] = '$'; (*bufp)[ptr++] = *top; return(ptr); } i = *top - '0'; if (i < countvar(argvar)) cp = argvar[i]; } else if (len == 1) { c = *top; #ifdef MINIMUMSHELL cp = evalshellparam(c, flags); #else cp = evalshellparam(c, flags, &(top[s]), vlen, (nul < 0) ? &mode : NULL); #endif if (cp) new = cp; else { (*bufp)[ptr++] = '$'; (*bufp)[ptr++] = *top; return(ptr); } } else return(-1); if (!mode && checkundeffunc && (*checkundeffunc)(cp, top, len) < 0) return(-1); if (cp && (nul == 0x80) && !*cp) cp = NULL; #ifndef MINIMUMSHELL if (mode == 'n') { VOID_C Xsnprintf(tmp, sizeof(tmp), "%d", (cp) ? strlen(cp) : 0); cp = tmp; } else if (nul == -1) { new = removeword(cp, top + s, vlen, mode); if (new) cp = new; } else #endif /* !MINIMUMSHELL */ if ((mode = replacevar(top, &cp, s, len, vlen, mode)) < 0) { Xfree(new); return(mode); } else if (mode) { Xfree(new); new = cp; } if (!mode && (c != '@' || !(flags & EA_INQUOTE))) { vlen = addmeta(NULL, cp, flags); *bufp = insertarg(*bufp, ptr, arg, *argp - arg + 1, vlen); addmeta(&((*bufp)[ptr]), cp, flags); } else if (!cp) vlen = 0; else if (c == '@' && !*cp && (flags & EA_INQUOTE) && ptr > 0 && (*bufp)[ptr - 1] == '"' && *(*argp + 1) == '"') { vlen = 0; ptr--; (*argp)++; } else { vlen = strlen(cp); *bufp = insertarg(*bufp, ptr, arg, *argp - arg + 1, vlen); Xstrncpy(&((*bufp)[ptr]), cp, vlen); } ptr += vlen; Xfree(new); return(ptr); } #ifndef NOUID VOID getlogininfo(homep, shellp) CONST char **homep, **shellp; { struct passwd *pwd; if (homep) *homep = NULL; if (shellp) *shellp = NULL; # ifdef DEBUG _mtrace_file = "getpwuid(start)"; pwd = getpwuid(getuid()); if (_mtrace_file) _mtrace_file = NULL; else { _mtrace_file = "getpwuid(end)"; malloc(0); /* dummy alloc */ } # else pwd = getpwuid(getuid()); # endif if (!pwd) return; if (homep && pwd -> pw_dir && *(pwd -> pw_dir)) *homep = pwd -> pw_dir; if (shellp && pwd -> pw_shell && *(pwd -> pw_shell)) *shellp = pwd -> pw_shell; } uidtable *finduid(uid, name) u_id_t uid; CONST char *name; { struct passwd *pwd; int i; if (name) { for (i = 0; i < maxuid; i++) if (!strpathcmp(name, uidlist[i].name)) return(&(uidlist[i])); # ifdef DEBUG _mtrace_file = "getpwnam(start)"; pwd = getpwnam(name); if (_mtrace_file) _mtrace_file = NULL; else { _mtrace_file = "getpwnam(end)"; malloc(0); /* dummy alloc */ } # else pwd = getpwnam(name); # endif } else { for (i = 0; i < maxuid; i++) if (uid == uidlist[i].uid) return(&(uidlist[i])); # ifdef DEBUG _mtrace_file = "getpwuid(start)"; pwd = getpwuid((uid_t)uid); if (_mtrace_file) _mtrace_file = NULL; else { _mtrace_file = "getpwuid(end)"; malloc(0); /* dummy alloc */ } # else pwd = getpwuid((uid_t)uid); # endif } if (!pwd) return(NULL); uidlist = b_realloc(uidlist, maxuid, uidtable); uidlist[maxuid].uid = convuid(pwd -> pw_uid); uidlist[maxuid].name = Xstrdup(pwd -> pw_name); uidlist[maxuid].home = Xstrdup(pwd -> pw_dir); return(&(uidlist[maxuid++])); } gidtable *findgid(gid, name) g_id_t gid; CONST char *name; { struct group *grp; int i; if (name) { for (i = 0; i < maxgid; i++) if (!strpathcmp(name, gidlist[i].name)) return(&(gidlist[i])); # ifdef DEBUG _mtrace_file = "getgrnam(start)"; grp = getgrnam(name); if (_mtrace_file) _mtrace_file = NULL; else { _mtrace_file = "getgrnam(end)"; malloc(0); /* dummy alloc */ } # else grp = getgrnam(name); # endif } else { for (i = 0; i < maxgid; i++) if (gid == gidlist[i].gid) return(&(gidlist[i])); # ifdef DEBUG _mtrace_file = "getgrgid(start)"; grp = getgrgid((gid_t)gid); if (_mtrace_file) _mtrace_file = NULL; else { _mtrace_file = "getgrgid(end)"; malloc(0); /* dummy alloc */ } # else grp = getgrgid((gid_t)gid); # endif } if (!grp) return(NULL); gidlist = b_realloc(gidlist, maxgid, gidtable); gidlist[maxgid].gid = convgid(grp -> gr_gid); gidlist[maxgid].name = Xstrdup(grp -> gr_name); # ifndef USEGETGROUPS gidlist[maxgid].gr_mem = duplvar(grp -> gr_mem, -1); # endif gidlist[maxgid].ismem = 0; return(&(gidlist[maxgid++])); } int isgroupmember(gid) g_id_t gid; { # ifdef USEGETGROUPS gid_t *gidset; int n; # else uidtable *up; # endif gidtable *gp; int i; if (!(gp = findgid(gid, NULL))) return(0); if (!(gp -> ismem)) { gp -> ismem++; # ifdef USEGETGROUPS if ((n = getgroups(0, NULL)) > 0) { gidset = (gid_t *)Xmalloc(n * sizeof(*gidset)); n = getgroups(n, gidset); for (i = 0; i < n; i++) { if (gidset[i] != (gid_t)(gp -> gid)) continue; gp -> ismem++; break; } Xfree(gidset); } # else /* !USEGETGROUPS */ if (gp -> gr_mem && (up = finduid(geteuid(), NULL))) for (i = 0; gp -> gr_mem[i]; i++) { if (!strpathcmp(up -> name, gp -> gr_mem[i])) { gp -> ismem++; break; } } freevar(gp -> gr_mem); gp -> gr_mem = NULL; # endif /* !USEGETGROUPS */ } return(gp -> ismem - 1); } # ifdef DEBUG VOID freeidlist(VOID_A) { int i; if (uidlist) { for (i = 0; i < maxuid; i++) { Xfree(uidlist[i].name); Xfree(uidlist[i].home); } Xfree(uidlist); } if (gidlist) { for (i = 0; i < maxgid; i++) { Xfree(gidlist[i].name); # ifndef USEGETGROUPS freevar(gidlist[i].gr_mem); # endif } Xfree(gidlist); } uidlist = NULL; gidlist = NULL; maxuid = maxgid = 0; } # endif #endif /* !NOUID */ static char *NEAR replacebackquote(buf, ptrp, bbuf, rest, flags) char *buf; int *ptrp; char *bbuf; int rest, flags; { char *tmp; int len, size; stripquote(bbuf, EA_BACKQ); if (!(tmp = (*backquotefunc)(bbuf))) return(buf); len = addmeta(NULL, tmp, flags); size = *ptrp + len + rest + 1; buf = Xrealloc(buf, size); addmeta(&(buf[*ptrp]), tmp, flags); *ptrp += len; Xfree(tmp); return(buf); } #ifndef MINIMUMSHELL CONST char *gethomedir(VOID_A) { # ifndef NOUID # ifdef FD uidtable *up; # endif # endif /* !NOUID */ CONST char *cp; if (!(cp = getconstvar(ENVHOME))) { # ifndef NOUID # ifdef FD if ((up = finduid(getuid(), NULL))) cp = up -> home; # else getlogininfo(&cp, NULL); # endif # endif /* !NOUID */ } return(cp); } #endif /* !MINIMUMSHELL */ CONST char *getrealpath(path, resolved, cwd) CONST char *path; char *resolved, *cwd; { #ifdef DEP_PSEUDOPATH int drv; #endif CONST char *err; char buf[MAXPATHLEN]; if (cwd) /*EMPTY*/; else if (!Xgetwd(buf)) return(NULL); else cwd = buf; #ifdef DEP_PSEUDOPATH if ((drv = preparedrv(cwd, NULL, NULL)) < 0) return(cwd); #endif if (_chdir2(path) < 0) err = path; else if (!Xgetwd(resolved)) err = NULL; else if (_chdir2(cwd) < 0) { #ifdef FD lostcwd(NULL); err = resolved; #else err = cwd; #endif } else err = resolved; #ifdef DEP_PSEUDOPATH shutdrv(drv); #endif return(err); } #ifdef BASHSTYLE static VOID replaceifs(s, len) char *s; int len; { CONST char *ifs; int i; if (!(ifs = getconstvar(ENVIFS))) return; for (i = 0; i < len; i++) { if (Xstrchr(ifs, s[i]) && !Xstrchr(IFS_SET, s[i])) s[i] = ' '; else if (iswchar(s, i)) i++; } } #endif /* BASHSTYLE */ #ifndef MINIMUMSHELL static int NEAR evalhome(bufp, ptr, argp) char **bufp; int ptr; CONST char **argp; { # ifndef NOUID # ifdef FD uidtable *up; # else struct passwd *pwd; # endif char *tmp; # endif /* !NOUID */ CONST char *cp, *top; int len, vlen; top = &((*argp)[1]); len = ((cp = strdelim(top, 0))) ? (cp - top) : strlen(top); if (!len) cp = gethomedir(); # ifdef FD else if (len == strsize(FDSTR) && !strnpathcmp(top, FDSTR, len)) cp = progpath; # endif else { # ifdef NOUID cp = NULL; # else /* !NOUID */ tmp = Xstrndup(top, len); # ifdef FD up = finduid(0, tmp); cp = (up) ? up -> home : NULL; # else /* !FD */ # ifdef DEBUG _mtrace_file = "getpwnam(start)"; pwd = getpwnam(tmp); if (_mtrace_file) _mtrace_file = NULL; else { _mtrace_file = "getpwnam(end)"; malloc(0); /* dummy alloc */ } # else pwd = getpwnam(tmp); # endif cp = (pwd) ? pwd -> pw_dir : NULL; # endif /* !FD */ Xfree(tmp); # endif /* !NOUID */ } if (!cp) { vlen = len = 0; (*bufp)[ptr++] = '~'; } else { top = cp; vlen = strlen(top); *bufp = insertarg(*bufp, ptr, *argp, len + 1, vlen); } Xstrncpy(&((*bufp)[ptr]), top, vlen); ptr += vlen; *argp += len; return(ptr); } #endif /* !MINIMUMSHELL */ char *evalarg(arg, flags) char *arg; int flags; { #ifdef DEP_DOSLFN char path[MAXPATHLEN], alias[MAXPATHLEN]; #endif #ifndef MINIMUMSHELL int q2, prev; #endif #ifdef NESTINGQUOTE int pq; #endif #ifdef BASHSTYLE int top; #endif CONST char *cp; char *buf, *bbuf; int i, j, pc, q, f; #ifdef DEP_DOSLFN if (*arg == '"' && (i = strlen(arg)) > 2 && arg[i - 1] == '"') { Xstrncpy(path, &(arg[1]), i - 2); if (shortname(path, alias) == alias) { if (flags & (EA_STRIPQ | EA_STRIPQLATER)) return(Xstrdup(alias)); i = strlen(alias); buf = Xmalloc(i + 2 + 1); buf[0] = '"'; memcpy(&(buf[1]), alias, i); buf[++i] = '"'; buf[++i] = '\0'; return(buf); } } #endif i = strlen(arg) + 1; buf = Xmalloc(i); if (!backquotefunc) flags &= ~EA_BACKQ; bbuf = (flags & EA_BACKQ) ? Xmalloc(i) : NULL; #ifndef MINIMUMSHELL q2 = prev = #endif #ifdef NESTINGQUOTE pq = #endif q = '\0'; i = j = 0; cp = arg; while (*cp) { #ifdef BASHSTYLE top = i; #endif #ifdef NESTINGQUOTE pc = parsechar(cp, -1, '$', flags, &q, &pq); #else pc = parsechar(cp, -1, '$', flags, &q, NULL); #endif if (pc == PC_CLQUOTE) { if (*cp == '`') { bbuf[j] = '\0'; buf = replacebackquote(buf, &i, bbuf, strlen(&(cp[1])), flags); #ifdef BASHSTYLE /* bash replaces the IFS character to a space */ if (flags & EA_EVALIFS) replaceifs(&(buf[top]), i - top); #endif j = 0; } else if (!(flags & EA_STRIPQ)) buf[i++] = *cp; } else if (pc == PC_WCHAR) { if (q == '`') { bbuf[j++] = *cp++; bbuf[j++] = *cp; } else { buf[i++] = *cp++; buf[i++] = *cp; } } else if (pc == PC_BQUOTE) { bbuf[j++] = *cp; #ifndef MINIMUMSHELL parsechar(cp, -1, '\0', flags, &q2, NULL); #endif } else if (pc == PC_SQUOTE || pc == PC_DQUOTE) buf[i++] = *cp; else if (pc == '$') { f = flags; if (q == '"') f |= EA_INQUOTE; if (!cp[1]) buf[i++] = *cp; #ifdef FAKEESCAPE # ifdef MINIMUMSHELL else if (cp[1] == '$') cp++; # else else if (cp[1] == '$' || cp[1] == '~') cp++; # endif #endif /* FAKEESCAPE */ else if ((i = evalvar(&buf, i, &cp, f)) < 0) { Xfree(bbuf); Xfree(buf); if (i < -1) *arg = '\0'; return(NULL); } #ifdef BASHSTYLE /* bash replaces the IFS character to a space */ else if (flags & EA_EVALIFS) replaceifs(&(buf[top]), i - top); #endif } else if (pc == PC_ESCAPE) { cp++; if (flags & EA_KEEPESCAPE) pc = PC_NORMAL; else if (*cp == '$') /*EMPTY*/; else if ((flags & EA_BACKQ) && *cp == '`') /*EMPTY*/; else if ((flags & EA_STRIPQ) && (*cp == '\'' || *cp == '"')) /*EMPTY*/; else if ((flags & EA_STRIPESCAPE) && *cp == PESCAPE) /*EMPTY*/; else pc = PC_NORMAL; if (q == '`') { if (*cp == '$') /*EMPTY*/; #ifndef MINIMUMSHELL else if (q2 == '\'' && *cp == PESCAPE) /*EMPTY*/; #endif else bbuf[j++] = PESCAPE; bbuf[j++] = *cp; } else { if (pc != PC_ESCAPE) buf[i++] = PESCAPE; buf[i++] = *cp; } } else if (pc == PC_OPQUOTE) { if (*cp == '`') { j = 0; #ifndef MINIMUMSHELL q2 = '\0'; #endif } else if (!(flags & EA_STRIPQ)) buf[i++] = *cp; } else if (pc != PC_NORMAL) /*EMPTY*/; #ifndef MINIMUMSHELL else if (*cp == '~' && (!prev || prev == ':' || prev == '=')) i = evalhome(&buf, i, &cp); #endif else buf[i++] = *cp; #ifdef MINIMUMSHELL cp++; #else prev = *(cp++); #endif } #ifndef BASHSTYLE /* bash does not allow unclosed quote */ if ((flags & EA_BACKQ) && q == '`') { bbuf[j] = '\0'; buf = replacebackquote(buf, &i, bbuf, 0, flags); } #endif Xfree(bbuf); buf[i] = '\0'; if (flags & EA_STRIPQLATER) stripquote(buf, EA_STRIPQ); return(buf); } int evalifs(argc, argvp, ifs) int argc; char ***argvp; CONST char *ifs; { char *cp; int i, j, n, pc, quote; for (n = 0; n < argc; n++) { for (i = 0, quote = '\0'; (*argvp)[n][i]; i++) { pc = parsechar(&((*argvp)[n][i]), -1, '\0', 0, "e, NULL); if (pc == PC_WCHAR || pc == PC_ESCAPE) i++; else if (pc != PC_NORMAL) /*EMPTY*/; else if (Xstrchr(ifs, (*argvp)[n][i])) { for (j = i + 1; (*argvp)[n][j]; j++) if (!Xstrchr(ifs, (*argvp)[n][j])) break; if (!i) { for (i = 0; (*argvp)[n][i + j]; i++) (*argvp)[n][i] = (*argvp)[n][i + j]; (*argvp)[n][i] = '\0'; i = -1; continue; } (*argvp)[n][i] = '\0'; if (!(*argvp)[n][j]) break; cp = Xstrdup(&((*argvp)[n][j])); *argvp = (char **)Xrealloc(*argvp, (argc + 2) * sizeof(char *)); memmove((char *)(&((*argvp)[n + 2])), (char *)(&((*argvp)[n + 1])), (argc++ - n) * sizeof(char *)); (*argvp)[n + 1] = cp; break; } } if (!i) { Xfree((*argvp)[n--]); memmove((char *)(&((*argvp)[n + 1])), (char *)(&((*argvp)[n + 2])), (argc-- - n) * sizeof(char *)); } } return(argc); } int evalglob(argc, argvp, flags) int argc; char ***argvp; int flags; { char **wild; int i, n; for (n = 0; n < argc; n++) { if (!(wild = evalwild((*argvp)[n], flags))) { stripquote((*argvp)[n], flags); continue; } i = countvar(wild); if (i > 1) { *argvp = (char **)Xrealloc(*argvp, (argc + i) * sizeof(char *)); memmove((char *)(&((*argvp)[n + i])), (char *)(&((*argvp)[n + 1])), (argc - n) * sizeof(char *)); argc += i - 1; } Xfree((*argvp)[n]); memmove((char *)(&((*argvp)[n])), (char *)wild, i * sizeof(char *)); Xfree(wild); n += i - 1; } return(argc); } int stripquote(arg, flags) char *arg; int flags; { int i, j, pc, quote, stripped; stripped = 0; if (!arg) return(stripped); for (i = j = 0, quote = '\0'; arg[i]; i++) { pc = parsechar(&(arg[i]), -1, '\0', 0, "e, NULL); if (pc == PC_OPQUOTE || pc == PC_CLQUOTE) { stripped++; if (flags & EA_STRIPQ) continue; } else if (pc == PC_WCHAR) arg[j++] = arg[i++]; else if (pc == PC_ESCAPE) { i++; if (flags & EA_KEEPESCAPE) pc = PC_NORMAL; else if (!quote && !(flags & EA_BACKQ)) /*EMPTY*/; else if (!Xstrchr(DQ_METACHAR, arg[i])) pc = PC_NORMAL; if (pc != PC_ESCAPE) arg[j++] = PESCAPE; else stripped++; } arg[j++] = arg[i]; } arg[j] = '\0'; return(stripped); } char *_evalpath(path, eol, flags) CONST char *path, *eol; int flags; { #ifdef DEP_DOSLFN char alias[MAXPATHLEN]; int top, len; #endif #ifdef DOUBLESLASH int ds; #endif #ifdef DEP_URLPATH int url; #endif char *cp, *tmp; int i, j, c, pc, size, quote; if (eol) i = eol - path; else i = strlen(path); cp = Xstrndup(path, i); tmp = evalarg(cp, EA_NOEVALQ | EA_NOEVALDQ | EA_KEEPESCAPE); if (!tmp) { *cp = '\0'; return(cp); } Xfree(cp); cp = tmp; #ifdef DEP_DOSLFN top = -1; #endif #ifdef DOUBLESLASH ds = isdslash(cp); #endif #ifdef DEP_URLPATH url = isurl(cp, 0); #endif size = strlen(cp) + 1; tmp = Xmalloc(size); quote = '\0'; for (i = j = c = 0; cp[i]; c = cp[i++]) { pc = parsechar(&(cp[i]), -1, '\0', 0, "e, NULL); if (pc == PC_CLQUOTE) { #ifdef DEP_DOSLFN if ((flags & EA_NOEVALQ) && top >= 0 && ++top < j) { tmp[j] = '\0'; if (shortname(&(tmp[top]), alias) == alias) { len = strlen(alias); size += top + len - j; j = top + len; tmp = Xrealloc(tmp, size); Xstrncpy(&(tmp[top]), alias, len); } } top = -1; #endif if (!(flags & EA_NOEVALQ)) continue; } else if (pc == PC_WCHAR) tmp[j++] = cp[i++]; else if (pc == PC_ESCAPE) { i++; if ((flags & EA_KEEPESCAPE) || (quote && !Xstrchr(DQ_METACHAR, cp[i]))) tmp[j++] = PESCAPE; } else if (pc == PC_OPQUOTE) { #ifdef DEP_DOSLFN if (cp[i] == '"') top = j; #endif if (!(flags & EA_NOEVALQ)) continue; } else if (pc != PC_NORMAL) /*EMPTY*/; else if (flags & EA_NOUNIQDELIM) /*EMPTY*/; #ifdef DOUBLESLASH else if (ds && i == 1) /*EMPTY*/; #endif #ifdef DEP_URLPATH else if (url && i < url) /*EMPTY*/; #endif else if (cp[i] == _SC_ && c == _SC_) continue; tmp[j++] = cp[i]; } tmp[j] = '\0'; Xfree(cp); return(tmp); } char *evalpath(path, flags) char *path; int flags; { char *cp; if (!path || !*path) return(path); for (cp = path; Xisblank(*cp); cp++) /*EMPTY*/; cp = _evalpath(cp, NULL, flags); Xfree(path); return(cp); } FD-3.01j/system.c100644 2105 1751 731405 13516612560 12423 0ustar shiraiuser/* * system.c * * command line analysis */ #ifdef FD #include "fd.h" #include "term.h" #include "types.h" #include "kconv.h" #else #define K_EXTERN #include "headers.h" #include "depend.h" #include "printf.h" #include "kctype.h" #include "string.h" #include "malloc.h" #endif #include "dirent.h" #include "sysemu.h" #include "system.h" #include "termemu.h" #if !defined (FD) && !defined (MINIMUMSHELL) #include "time.h" #endif #if defined (DEP_ORIGSHELL) && !defined (MINIMUMSHELL) #include "posixsh.h" #endif #ifdef DEP_SOCKET #include "socket.h" #include "url.h" #endif #ifdef DEP_URLPATH #include "urldisk.h" #endif #if MSDOS #include # ifdef USERESOURCEH # include # include # endif #else /* !MSDOS */ # ifdef USERESOURCEH # include # endif # ifdef USETIMES # include # endif # ifdef USEULIMITH # include # endif #endif /* !MSDOS */ #ifndef FD typedef struct _lockbuf_t { int fd; } lockbuf_t; # ifdef PATHNOCASE # define TMPPREFIX "TM" # else # define TMPPREFIX "tm" # endif #endif /* !FD */ #ifdef GETPGRPVOID #define getpgroup getpgrp #else #define getpgroup() getpgrp(0) #endif #ifdef USESETPGID #define setpgroup setpgid #else #define setpgroup setpgrp #endif #if MSDOS #define hastty() (1) #else /* !MSDOS */ # ifdef NOJOB # define hastty() (mypid == shellpid) # else # define hastty() (ttypgrp >= (p_id_t)0 && mypid == ttypgrp) # endif #endif /* !MSDOS */ #define getwaitsig(x) ((WIFSTOPPED(x)) ? WSTOPSIG(x) : \ ((WIFSIGNALED(x)) ? (128 + WTERMSIG(x)) : -1)) #ifndef RLIM_INFINITY #define RLIM_INFINITY 0x7fffffff #endif #ifndef RLIMIT_FSIZE #define RLIMIT_FSIZE 255 #endif #ifndef UL_GETFSIZE #define UL_GETFSIZE 1 #endif #ifndef UL_SETFSIZE #define UL_SETFSIZE 2 #endif #if !defined (RLIMIT_NOFILE) && defined (RLIMIT_OFILE) #define RLIMIT_NOFILE RLIMIT_OFILE #endif #if !defined (RLIMIT_VMEM) && defined (RLIMIT_AS) #define RLIMIT_VMEM RLIMIT_AS #endif #if defined (USESYSCONF) && defined (_SC_CLK_TCK) #define CLKPERSEC sysconf(_SC_CLK_TCK) #else # ifdef CLK_TCK # define CLKPERSEC CLK_TCK # else # ifdef HZ # define CLKPERSEC HZ # else # define CLKPERSEC 60 # endif # endif #endif #if MSDOS #define LSH_DEFRC "\\etc\\profile" #define LSH_RCFILE "~\\profile.rc" #define SH_RCFILE "~\\fdsh.rc" #else /* !MSDOS */ #define LSH_DEFRC "/etc/profile" #define LSH_RCFILE "~/.profile" #define SH_RCFILE "~/.fdshrc" #endif /* !MSDOS */ #define PS1STR "$ " #define PS1ROOT "# " #define PS2STR "> " #define PS4STR "+ " #define UNLIMITED "unlimited" #define MAXTMPNAMLEN 8 #define getconstvar(s) (getshellvar(s, strsize(s))) #define constequal(s, c, l) ((l) == strsize(c) && !strnenvcmp(s, c, l)) #ifdef WITHSOCKREDIR #define TYPE_CONNECT 3 #define TYPE_ACCEPT 4 #define TYPE_BIND 5 #endif #ifdef PSIGNALSTYLE #define MESHUP "Hangup" #define MESINT "Interrupt" #define MESQUIT "Quit" #define MESILL "Illegal instruction" #define MESTRAP "Trace/BPT trap" #define MESIOT "IOT trap" #define MESABRT "Aborted" #define MESEMT "EMT trap" #define MESFPE "Floating point exception" #define MESKILL "Killed" #define MESBUS "Bus error" #define MESSEGV "Segmentation fault" #define MESSYS "Bad system call" #define MESPIPE "Broken pipe" #define MESALRM "Alarm clock" #define MESTERM "Terminated" #define MESSTKFLT "Stack fault" #define MESURG "Urgent I/O condition" #define MESSTOP "Stopped (signal)" #define MESTSTP "Stopped" #define MESCONT "Continued" #define MESCHLD "Child exited" #define MESTTIN "Stopped (tty input)" #define MESTTOU "Stopped (tty output)" #define MESIO "I/O possible" #define MESPOLL "Profiling alarm clock" #define MESXCPU "Cputime limit exceeded" #define MESXFSZ "Filesize limit exceeded" #define MESVTALRM "Virtual timer expired" #define MESPROF "Profiling timer expired" #define MESWINCH "Window changed" #define MESLOST "Resource lost" #define MESINFO "Information request" #define MESPWR "Power failure" #define MESUSR1 "User defined signal 1" #define MESUSR2 "User defined signal 2" #else /* !PSIGNALSTYLE */ #define MESHUP "Hangup" #define MESINT "" #define MESQUIT "Quit" #define MESILL "Illegal instruction" #define MESTRAP "Trace/BPT trap" #define MESIOT "IOT trap" #define MESABRT "Aborted" #define MESEMT "EMT trap" #define MESFPE "Floating exception" #define MESKILL "Killed" #define MESBUS "Bus error" #define MESSEGV "Memory fault" #define MESSYS "Bad system call" #define MESPIPE "" #define MESALRM "Alarm call" #define MESTERM "Terminated" #define MESSTKFLT "Stack fault" #define MESURG "Urgent condition" #define MESSTOP "Stopped" #define MESTSTP "Stopped from terminal" #define MESCONT "Continued" #define MESCHLD "Child terminated" #define MESTTIN "Stopped on terminal input" #define MESTTOU "Stopped on terminal output" #define MESIO "Asynchronous I/O" #define MESPOLL "Profiling alarm clock" #define MESXCPU "Exceeded cpu time limit" #define MESXFSZ "Exceeded file size limit" #define MESVTALRM "Virtual time alarm" #define MESPROF "Profiling time alarm" #define MESWINCH "Window changed" #define MESLOST "Resource lost" #define MESINFO "Information request" #define MESPWR "Power failure" #define MESUSR1 "User defined signal 1" #define MESUSR2 "User defined signal 2" #endif /* !PSIGNALSTYLE */ #ifdef DEBUG #define PSIGNALSTYLE #define SHOWSTREE #endif #ifdef USESIGACTION # ifdef FD extern sigcst_t signal2 __P_((int, sigcst_t)); # else static sigcst_t NEAR signal2 __P_((int, sigcst_t)); # endif #else /* !USESIGACTION */ #define signal2 signal #endif /* !USESIGACTION */ #ifdef DEP_ORIGSHELL /* * Notes: extension from original Bourne shell * * 1. pathname globing: wildcard `**' matches any directories recursively. * 2. `export' & `readonly' allows arguments with `=value'. * 3. redirector `<>' and `><' mean redirection for read and write. * 4. command hash is always valid. Instead, * -h option means to check command-path ahead for pipe line, * and to check command-path when a function is defined (not executed). * 5. job control: `jobs', `fg', `bg', ^Z/^Y(suspend) are valid. * -m option means to validate the job control. * this option is valid by default for the interactive shell. * 6. builtin command: `echo', `test', `kill' is builtin. * 7. job name: `%' introduces job name in `fg', `bg', `wait', `kill'. * `%%', `%', '%+' mean the current job. * `%-' means the previous job. * `%n' means the job which has job number n. * `%string' means the job whose command begins with `string'. * 8. builtin commands of COMMAND.COM for MS-DOS: * `rem', `dir', `mkdir(md)', `rmdir(rd)', `erase(del)', * `rename(ren)', `copy' is builtin on MS-DOS. * 9. aliases: `alias', `unalias' is builtin. * 10. optional POSIX utilities are added. */ #ifdef FD extern VOID calcwin __P_((VOID_A)); extern VOID main_fd __P_((char *CONST *, int)); extern VOID checkscreen __P_((int, int)); # ifdef SIGWINCH extern VOID pollscreen __P_((int)); # endif extern int sigvecset __P_((int)); # ifndef _NOCUSTOMIZE extern VOID saveorigenviron __P_((VOID_A)); # endif extern VOID initfd __P_((char *CONST *)); extern VOID prepareexitfd __P_((int)); extern int savestdio __P_((int)); extern CONST builtintable *getbuiltin __P_((CONST char *)); extern CONST functable *getinternal __P_((CONST char *)); extern int execbuiltin __P_((CONST builtintable *, int, char *CONST [])); extern int execinternal __P_((CONST functable *, int, char *CONST [])); # ifndef _NOCOMPLETE extern int completebuiltin __P_((CONST char *, int, int, char ***)); extern int completeinternal __P_((CONST char *, int, int, char ***)); # endif extern VOID initenv __P_((VOID_A)); extern VOID evalenv __P_((CONST char *, int)); extern int underhome __P_((char *)); extern int replaceargs __P_((int *, char ***, char *CONST *, int)); extern int replacearg __P_((char **)); extern VOID demacroarg __P_((char **)); extern char *inputshellstr __P_((CONST char *, int, CONST char *)); extern int evalprompt __P_((char **, CONST char *)); #endif /* !FD */ #ifdef DOSCOMMAND extern int doscomdir __P_((int, char *CONST [])); extern int doscommkdir __P_((int, char *CONST [])); extern int doscomrmdir __P_((int, char *CONST [])); extern int doscomerase __P_((int, char *CONST [])); extern int doscomrename __P_((int, char *CONST [])); extern int doscomcopy __P_((int, char *CONST [])); extern int doscomcls __P_((int, char *CONST [])); extern int doscomtype __P_((int, char *CONST [])); #endif /* DOSCOMMAND */ #ifdef DEBUG extern VOID mtrace __P_ ((VOID_A)); extern VOID muntrace __P_ ((VOID_A)); extern char *_mtrace_file; #endif #if MSDOS extern int setcurdrv __P_((int, int)); #endif #ifdef FD # ifndef _NOEDITMODE extern char *editmode; # endif extern int internal_status; extern char fullpath[]; extern char *origpath; extern int inruncom; extern int fd_restricted; extern int fdmode; extern int physical_path; extern char *deftmpdir; #else /* !FD */ # ifdef __TURBOC__ extern u_int _stklen = 0x8000; # endif # if MSDOS # define deftmpdir _SS_ # else # define deftmpdir "/tmp" # endif int ttyio = -1; XFILE *ttyout = NULL; #endif /* !FD */ #ifndef MINIMUMSHELL # ifndef NOJOB extern jobtable *joblist; extern int maxjobs; # endif # if !MSDOS extern int mailcheck; # endif # ifndef NOALIAS extern shaliastable *shellalias; # endif # ifndef NOPOSIXUTIL extern int posixoptind; # endif #endif /* !MINIMUMSHELL */ #ifdef FD extern lockbuf_t *lockopen __P_((CONST char *, int, int)); extern VOID lockclose __P_((lockbuf_t *)); extern int mktmpfile __P_((char *)); extern int rmtmpfile __P_((CONST char *)); extern int chdir2 __P_((CONST char *)); extern int chdir3 __P_((CONST char *, int)); extern int chdir4 __P_((CONST char *, int, CONST char *)); extern int setenv2 __P_((CONST char *, CONST char *, int)); extern char *getenv2 __P_((CONST char *)); # if MSDOS && !defined (BSPATHDELIM) extern char *adjustpname __P_((char *)); # endif #else /* !FD */ static lockbuf_t *NEAR lockopen __P_((CONST char *, int, int)); static VOID NEAR lockclose __P_((lockbuf_t *)); static int NEAR genrand __P_((int)); static char *NEAR genrandname __P_((char *, int)); static int NEAR mktmpfile __P_((char *)); static int NEAR rmtmpfile __P_((CONST char *)); # define chdir2 Xchdir int chdir3 __P_((CONST char *, int)); # define chdir4(p, r, a) chdir3(p, r) int setenv2 __P_((CONST char *, CONST char *, int)); # if MSDOS && !defined (BSPATHDELIM) static char *NEAR adjustpname __P_((char *)); # endif # if !MSDOS && !defined (NOJOB) static VOID NEAR stdiomode __P_((VOID_A)); # endif #endif /* !FD */ #ifndef NOJOB static VOID NEAR notifyjob __P_((VOID_A)); #endif static VOID NEAR setsignal __P_((VOID_A)); static VOID NEAR resetsignal __P_((int)); static VOID NEAR exectrapcomm __P_((VOID_A)); static VOID NEAR killmyself __P_((int)); static int NEAR trap_common __P_((int)); #ifdef SIGHUP static int trap_hup __P_((VOID_A)); #endif #ifdef SIGINT static int trap_int __P_((VOID_A)); #endif #ifdef SIGQUIT static int trap_quit __P_((VOID_A)); #endif #ifdef SIGILL static int trap_ill __P_((VOID_A)); #endif #ifdef SIGTRAP static int trap_trap __P_((VOID_A)); #endif #ifdef SIGIOT static int trap_iot __P_((VOID_A)); #else # ifdef SIGABRT static int trap_abrt __P_((VOID_A)); # endif #endif #ifdef SIGEMT static int trap_emt __P_((VOID_A)); #endif #ifdef SIGFPE static int trap_fpe __P_((VOID_A)); #endif #ifdef SIGBUS static int trap_bus __P_((VOID_A)); #endif #ifdef SIGSEGV static int trap_segv __P_((VOID_A)); #endif #ifdef SIGSYS static int trap_sys __P_((VOID_A)); #endif #ifdef SIGPIPE static int trap_pipe __P_((VOID_A)); #endif #ifdef SIGALRM static int trap_alrm __P_((VOID_A)); #endif #ifdef SIGTERM static int trap_term __P_((VOID_A)); #endif #ifdef SIGSTKFLT static int trap_stkflt __P_((VOID_A)); #endif #ifdef SIGURG static int trap_urg __P_((VOID_A)); #endif #ifdef SIGSTOP static int trap_stop __P_((VOID_A)); #endif #ifdef SIGTSTP static int trap_tstp __P_((VOID_A)); #endif #ifdef SIGCONT static int trap_cont __P_((VOID_A)); #endif #ifdef SIGCHLD static int trap_chld __P_((VOID_A)); #endif #ifdef SIGTTIN static int trap_ttin __P_((VOID_A)); #endif #ifdef SIGTTOU static int trap_ttou __P_((VOID_A)); #endif #ifdef SIGIO static int trap_io __P_((VOID_A)); #else # ifdef SIGPOLL static int trap_poll __P_((VOID_A)); # endif #endif #ifdef SIGXCPU static int trap_xcpu __P_((VOID_A)); #endif #ifdef SIGXFSZ static int trap_xfsz __P_((VOID_A)); #endif #ifdef SIGVTALRM static int trap_vtalrm __P_((VOID_A)); #endif #ifdef SIGPROF static int trap_prof __P_((VOID_A)); #endif #ifdef SIGWINCH static int trap_winch __P_((VOID_A)); #endif #ifdef SIGLOST static int trap_lost __P_((VOID_A)); #endif #ifdef SIGINFO static int trap_info __P_((VOID_A)); #endif #ifdef SIGPWR static int trap_pwr __P_((VOID_A)); #endif #ifdef SIGUSR1 static int trap_usr1 __P_((VOID_A)); #endif #ifdef SIGUSR2 static int trap_usr2 __P_((VOID_A)); #endif #ifdef FD static VOID NEAR argfputs __P_((CONST char *, XFILE *)); #else #define argfputs VOID_C Xfputs #endif #ifdef DEP_FILECONV static int NEAR Kopen __P_((CONST char *, int, int)); #else #define Kopen Xopen #endif static VOID NEAR syntaxerror __P_((CONST char *)); #if !MSDOS && !defined (NOJOB) && defined (DEP_PTY) && defined (CYGWIN) static VOID NEAR addmychild __P_((p_id_t)); #endif #if !MSDOS static VOID NEAR setstopsig __P_((int)); static p_id_t NEAR makechild __P_((int, p_id_t)); #endif static VOID NEAR safermtmpfile __P_((CONST char *)); static int NEAR getoption __P_((int, char *CONST *, int)); static CONST opetable *NEAR getoperator __P_((int)); #ifdef MINIMUMSHELL static shbuiltintable *NEAR getshbuiltin __P_((CONST char *)); #define getshbuiltin2(s, i, f) getshbuiltin(s) #else static shbuiltintable *NEAR getshbuiltin __P_((CONST char *, int, int)); #define getshbuiltin2 getshbuiltin #endif static shfunctable *NEAR getshfunc __P_((CONST char *)); static ALLOC_T NEAR c_allocsize __P_((int)); static int NEAR readchar __P_((int)); static char *NEAR readline __P_((int, int)); static char *NEAR readfile __P_((int, ALLOC_T *)); static heredoc_t *NEAR newheredoc __P_((char *, char *, int, int)); static redirectlist *NEAR newrlist __P_((int, char *, int, redirectlist *)); static command_t *NEAR newcomm __P_((VOID_A)); static syntaxtree *NEAR eldeststree __P_((syntaxtree *)); static syntaxtree *NEAR childstree __P_((syntaxtree *, int)); static syntaxtree *NEAR skipfuncbody __P_((syntaxtree *)); static syntaxtree *NEAR insertstree __P_((syntaxtree *, syntaxtree *, int)); static syntaxtree *NEAR linkstree __P_((syntaxtree *, int)); #if !MSDOS || defined (DEP_PTY) || !defined (USEFAKEPIPE) static VOID NEAR nownstree __P_((syntaxtree *)); #endif static int NEAR evalfiledesc __P_((CONST char *)); static int NEAR redmode __P_((int)); static int NEAR cancelredirect __P_((redirectlist *)); static VOID NEAR closeredirect __P_((redirectlist *)); static heredoc_t *NEAR searchheredoc __P_((syntaxtree *, int)); static int NEAR saveheredoc __P_((CONST char *, syntaxtree *)); static int NEAR openheredoc __P_((heredoc_t *, int)); #ifdef DEP_DOSDRIVE static int NEAR fdcopy __P_((int, int)); static int NEAR openpseudofd __P_((redirectlist *)); static int NEAR closepseudofd __P_((redirectlist *)); #endif #ifdef WITHSOCKREDIR static int NEAR parsesocket __P_((CONST char *, char **, int *)); #endif static redirectlist *NEAR doredirect __P_((redirectlist *)); static heredoc_t *NEAR heredoc __P_((char *, int)); static int NEAR redirect __P_((syntaxtree *, int, char *, int)); #if !MSDOS && defined (MINIMUMSHELL) static VOID NEAR checkmail __P_((int)); #endif static int NEAR searchvar __P_((char *CONST *, CONST char *, int, int)); static char *NEAR searchvar2 __P_((int, CONST char **, CONST char *, int)); static char **NEAR expandvar __P_((char **, CONST char *, int)); static char *NEAR getvar __P_((char *CONST *, CONST char *, int)); static char **NEAR putvar __P_((char **, char *, int)); static int NEAR checkprimal __P_((CONST char *, int)); static int NEAR checkrestrict __P_((CONST char *, int)); static int NEAR checkronly __P_((CONST char *, int)); static int NEAR _putshellvar __P_((char *, int)); #ifndef MINIMUMSHELL static VOID NEAR setshlineno __P_((long)); #endif static heredoc_t *NEAR duplheredoc __P_((heredoc_t *)); static redirectlist *NEAR duplrlist __P_((redirectlist *)); static shfunctable *NEAR duplfunc __P_((shfunctable *)); static VOID NEAR freefunc __P_((shfunctable *)); static int cmpfunc __P_((CONST VOID_P, CONST VOID_P)); static char *NEAR getifs __P_((VOID_A)); static int getretval __P_((VOID_A)); static p_id_t getorgpid __P_((VOID_A)); static p_id_t getlastpid __P_((VOID_A)); static char *getflagstr __P_((VOID_A)); static int checkundefvar __P_((CONST char *, CONST char *, int)); static VOID safeexit __P_((VOID_A)); static int NEAR getstatid __P_((syntaxtree *)); static int NEAR getparenttype __P_((syntaxtree *)); static int NEAR parsestatement __P_((syntaxtree **, int, int, int)); static syntaxtree *NEAR _addarg __P_((syntaxtree *, CONST char *)); static int NEAR addarg __P_((syntaxtree **, redirectlist *, char *, int *, int)); static int NEAR evalredprefix __P_((syntaxtree **, redirectlist *, int *)); static syntaxtree *NEAR rparen __P_((syntaxtree *)); static syntaxtree *NEAR semicolon __P_((syntaxtree *, redirectlist *, CONST char *, int *)); static syntaxtree *NEAR ampersand __P_((syntaxtree *, redirectlist *, CONST char *, int *)); static syntaxtree *NEAR vertline __P_((syntaxtree *, CONST char *, int *)); static syntaxtree *NEAR lessthan __P_((syntaxtree *, redirectlist *, CONST char *, int *)); static syntaxtree *NEAR morethan __P_((syntaxtree *, redirectlist *, CONST char *, int *)); #if defined (BASHSTYLE) || !defined (MINIMUMSHELL) static syntaxtree *NEAR endvar __P_((syntaxtree *, redirectlist *, CONST char *, int *, int *, ALLOC_T *, int)); static syntaxtree *NEAR addvar __P_((syntaxtree *, CONST char *, int *, CONST char *, int *, int)); #endif static syntaxtree *NEAR normaltoken __P_((syntaxtree *, redirectlist *, CONST char *, int *, int *, ALLOC_T *)); static syntaxtree *NEAR casetoken __P_((syntaxtree *, redirectlist *, CONST char *, int *, int *)); #if !defined (BASHBUG) && !defined (MINIMUMSHELL) static int NEAR cmpstatement __P_((CONST char *, int)); static syntaxtree *NEAR comsubtoken __P_((syntaxtree *, redirectlist *, CONST char *, int *, int *, ALLOC_T *)); #endif static syntaxtree *NEAR analyzeloop __P_((syntaxtree *, redirectlist *, CONST char *, int)); static syntaxtree *NEAR analyzeeof __P_((syntaxtree *)); static syntaxtree *NEAR statementcheck __P_((syntaxtree *, int)); static int NEAR check_statement __P_((syntaxtree *)); static int NEAR check_command __P_((syntaxtree *)); static int NEAR check_stree __P_((syntaxtree *)); static syntaxtree *NEAR analyzeline __P_((CONST char *)); #ifdef DEBUG static VOID NEAR Xexecve __P_((CONST char *, char *[], char *[], int)); #define Xexecve2 Xexecve #else static VOID NEAR Xexecve __P_((CONST char *, char *[], char *[])); #define Xexecve2(p, a, e, b) Xexecve(p, a, e) #endif #if MSDOS static char *NEAR addext __P_((char *, int)); static char **NEAR replacebat __P_((char **, char **)); #endif #ifdef USEFAKEPIPE static int NEAR openpipe __P_((p_id_t *, int, int)); #define openpipe2(p, f, n, t, pp) \ openpipe(p, f, n) #else static int NEAR openpipe __P_((p_id_t *, int, int, int, p_id_t)); #define openpipe2 openpipe #endif static pipelist **NEAR searchpipe __P_((int)); static int NEAR reopenpipe __P_((int, int)); static XFILE *NEAR fdopenpipe __P_((int)); #ifndef _NOUSEHASH static VOID NEAR disphash __P_((VOID_A)); #endif #ifdef BASHSTYLE static char *NEAR quotemeta __P_((char *)); #endif static int NEAR substvar __P_((char **, int)); static int NEAR evalargv __P_((command_t *, CONST VOID_P *, int *)); static char *NEAR evalexternal __P_((command_t *)); static VOID NEAR printindent __P_((int, XFILE *)); static VOID NEAR printnewline __P_((int, XFILE *)); static int NEAR printredirect __P_((redirectlist *, XFILE *)); #ifndef MINIMUMSHELL static VOID NEAR printheredoc __P_((redirectlist *, XFILE *)); static redirectlist **NEAR _printstree __P_((syntaxtree *, redirectlist **, int, XFILE *)); #endif static VOID NEAR printshfunc __P_((shfunctable *, XFILE *)); static int NEAR dochild __P_((syntaxtree *)); static int NEAR doif __P_((syntaxtree *)); static int NEAR dowhile __P_((syntaxtree *)); static int NEAR dountil __P_((syntaxtree *)); static int NEAR dofor __P_((syntaxtree *)); static int NEAR docase __P_((syntaxtree *)); static int NEAR dolist __P_((syntaxtree *)); static int NEAR donull __P_((syntaxtree *)); static int NEAR dobreak __P_((syntaxtree *)); static int NEAR docontinue __P_((syntaxtree *)); static int NEAR doreturn __P_((syntaxtree *)); static int NEAR execpath __P_((command_t *, int)); static int NEAR doexec __P_((syntaxtree *)); #ifndef MINIMUMSHELL static int NEAR dologin __P_((syntaxtree *)); static int NEAR dologout __P_((syntaxtree *)); #endif static int NEAR doeval __P_((syntaxtree *)); static int NEAR doexit __P_((syntaxtree *)); static int NEAR doread __P_((syntaxtree *)); static int NEAR doshift __P_((syntaxtree *)); static int NEAR doset __P_((syntaxtree *)); static int NEAR dounset __P_((syntaxtree *)); #ifndef _NOUSEHASH static int NEAR dohash __P_((syntaxtree *)); #endif static int NEAR dochdir __P_((syntaxtree *)); static int NEAR dopwd __P_((syntaxtree *)); static int NEAR dosource __P_((syntaxtree *)); static int NEAR expandlist __P_((char ***, CONST char *)); static int NEAR doexport __P_((syntaxtree *)); static int NEAR doreadonly __P_((syntaxtree *)); static int NEAR dotimes __P_((syntaxtree *)); static int NEAR dowait __P_((syntaxtree *)); static int NEAR doumask __P_((syntaxtree *)); static int NEAR doulimit __P_((syntaxtree *)); static int NEAR dotrap __P_((syntaxtree *)); #ifndef NOJOB static int NEAR dojobs __P_((syntaxtree *)); static int NEAR dofg __P_((syntaxtree *)); static int NEAR dobg __P_((syntaxtree *)); static int NEAR dodisown __P_((syntaxtree *)); #endif static int NEAR dotype __P_((syntaxtree *)); #ifdef DOSCOMMAND static int NEAR dodir __P_((syntaxtree *)); static int NEAR domkdir __P_((syntaxtree *)); static int NEAR dormdir __P_((syntaxtree *)); static int NEAR doerase __P_((syntaxtree *)); static int NEAR dorename __P_((syntaxtree *)); static int NEAR docopy __P_((syntaxtree *)); static int NEAR docls __P_((syntaxtree *)); static int NEAR dodtype __P_((syntaxtree *)); #endif #ifndef NOALIAS static int NEAR doalias __P_((syntaxtree *)); static int NEAR dounalias __P_((syntaxtree *)); #endif static int NEAR doecho __P_((syntaxtree *)); #ifndef MINIMUMSHELL static int NEAR dokill __P_((syntaxtree *)); static int NEAR dotest __P_((syntaxtree *)); #endif #ifndef NOPOSIXUTIL static int NEAR dofalse __P_((syntaxtree *)); static int NEAR docommand __P_((syntaxtree *)); static int NEAR dogetopts __P_((syntaxtree *)); static int NEAR donewgrp __P_((syntaxtree *)); # if 0 /* exists in FD original builtin */ static int NEAR dofc __P_((syntaxtree *)); # endif #endif /* !NOPOSIXUTIL */ #ifndef MINIMUMSHELL static int NEAR getworkdir __P_((char *)); static int NEAR dopushd __P_((syntaxtree *)); static int NEAR dopopd __P_((syntaxtree *)); static int NEAR dodirs __P_((syntaxtree *)); static int NEAR doenable __P_((syntaxtree *)); static int NEAR dobuiltin __P_((syntaxtree *)); static int NEAR doaddcr __P_((syntaxtree *)); #endif #ifdef WITHSOCKET static int NEAR doaccept __P_((syntaxtree *)); static int NEAR dosocketinfo __P_((syntaxtree *)); #endif #ifdef FD static int NEAR dofd __P_((syntaxtree *)); #endif static int NEAR doshfunc __P_((syntaxtree *, shfunctable *)); #ifdef SHOWSTREE static VOID NEAR show_stree __P_((syntaxtree *, int)); #endif static int NEAR dosetshfunc __P_((CONST char *, syntaxtree *)); static int NEAR exec_statement __P_((syntaxtree *)); static char **NEAR checkshellbuiltinargv __P_((int, char **)); static int NEAR checkshellbuiltin __P_((syntaxtree *)); #if MSDOS static int NEAR exec_command __P_((syntaxtree *, int *)); #define exec_command2(tr, c, b) exec_command(tr, c) #else static int NEAR exec_command __P_((syntaxtree *, int *, int)); #define exec_command2 exec_command #endif #ifdef USEFAKEPIPE static int NEAR exec_process __P_((syntaxtree *)); #define exec_process2(tr, p) exec_process(tr) #else static int NEAR exec_process __P_((syntaxtree *, p_id_t)); #define exec_process2 exec_process #endif static int NEAR exec_stree __P_((syntaxtree *, int)); static syntaxtree *NEAR execline __P_((CONST char *, syntaxtree *, syntaxtree *, int)); static int NEAR exec_line __P_((CONST char *)); static int NEAR _dosystem __P_((CONST char *)); static XFILE *NEAR _dopopen __P_((CONST char *)); #ifndef FDSH int dosystem __P_((CONST char *)); XFILE *dopopen __P_((CONST char *)); int dopclose __P_((XFILE *)); #endif static int NEAR sourcefile __P_((int, CONST char *, int)); #if MSDOS && !defined (BSPATHDELIM) static VOID NEAR adjustdelim __P_((char *CONST *)); #endif static VOID NEAR initrc __P_((int)); #ifdef FDSH int main __P_((int, char *CONST [], char *CONST [])); #endif int shellmode = 0; p_id_t mypid = (p_id_t)-1; p_id_t orgpid = (p_id_t)-1; p_id_t shellpid = (p_id_t)-1; int ret_status = RET_SUCCESS; int interactive = 0; int errorexit = 0; #ifdef DEP_PTY int shptymode = 0; #define isshptymode() (!fdmode && shptymode) #endif #ifndef NOJOB int stopped = 0; p_id_t orgpgrp = (p_id_t)-1; p_id_t childpgrp = (p_id_t)-1; p_id_t ttypgrp = (p_id_t)-1; #endif int interrupted = 0; int nottyout = 0; int syntaxerrno = 0; #if !MSDOS int sigconted = 0; #endif CONST statementtable statementlist[] = { {doif, "if", STT_NEEDLIST, {0, 0, 0, 0}}, {NULL, "then", STT_NEEDLIST, {SM_IF, SM_ELIF, 0, 0}}, {NULL, "elif", STT_NEEDLIST, {SM_THEN, 0, 0, 0}}, {NULL, "else", STT_NEEDLIST, {SM_THEN, 0, 0, 0}}, {NULL, "fi", STT_NEEDNONE, {SM_THEN, SM_ELSE, 0, 0}}, {dowhile, "while", STT_NEEDLIST, {0, 0, 0, 0}}, {dountil, "until", STT_NEEDLIST, {0, 0, 0, 0}}, {NULL, "do", STT_NEEDLIST, {SM_WHILE, SM_UNTIL, SM_FOR, SM_IN}}, {NULL, "done", STT_NEEDNONE, {SM_DO, 0, 0, 0}}, {dofor, "for", STT_NEEDIDENT | STT_FOR, {0, 0, 0, 0}}, {NULL, "in", STT_NEEDIDENT | STT_IN, {SM_FOR, SM_ANOTHER, 0, 0}}, {docase, "case", STT_NEEDIDENT | STT_CASE, {0, 0, 0, 0}}, {NULL, "in", STT_NEEDIDENT | STT_INCASE, {SM_CASE, 0, 0, 0}}, {NULL, ")", STT_NEEDLIST, {SM_INCASE, SM_CASEEND, SM_ANOTHER, 0}}, {NULL, ";;", STT_CASEEND, {SM_RPAREN, 0, 0, 0}}, {NULL, "esac", STT_NEEDNONE, {SM_CASEEND, SM_RPAREN, 0, 0}}, {NULL, "(", STT_LPAREN, {0, 0, 0, 0}}, {NULL, ")", STT_FUNC, {SM_LPAREN, 0, 0, 0}}, {dolist, "{", STT_LIST | STT_NEEDLIST, {0, 0, 0, 0}}, {NULL, "}", STT_NEEDNONE, {SM_LIST, 0, 0, 0}}, }; #define STATEMENTSIZ arraysize(statementlist) CONST signaltable signallist[] = { #ifdef SIGHUP {SIGHUP, trap_hup, "HUP", MESHUP, TR_TERM | TR_BLOCK}, #endif #ifdef SIGINT {SIGINT, trap_int, "INT", MESINT, TR_TERM | TR_BLOCK | TR_READBL}, #endif #ifdef SIGQUIT {SIGQUIT, trap_quit, "QUIT", MESQUIT, TR_TERM | TR_BLOCK}, #endif #ifdef SIGILL {SIGILL, trap_ill, "ILL", MESILL, TR_TERM}, #endif #ifdef SIGTRAP {SIGTRAP, trap_trap, "TRAP", MESTRAP, TR_TERM}, #endif #ifdef SIGIOT {SIGIOT, trap_iot, "IOT", MESIOT, TR_TERM}, #else # ifdef SIGABRT {SIGABRT, trap_abrt, "ABRT", MESABRT, TR_TERM}, # endif #endif #ifdef SIGEMT {SIGEMT, trap_emt, "EMT", MESEMT, TR_TERM}, #endif #ifdef SIGFPE {SIGFPE, trap_fpe, "FPE", MESFPE, TR_TERM}, #endif #ifdef SIGKILL {SIGKILL, NULL, "KILL", MESKILL, 0}, #endif #ifdef SIGBUS {SIGBUS, trap_bus, "BUS", MESBUS, TR_TERM}, #endif #ifdef SIGSEGV # ifdef BASHSTYLE {SIGSEGV, trap_segv, "SEGV", MESSEGV, TR_TERM}, # else {SIGSEGV, trap_segv, "SEGV", MESSEGV, TR_TERM | TR_BLOCK | TR_NOTRAP}, # endif #endif #ifdef SIGSYS {SIGSYS, trap_sys, "SYS", MESSYS, TR_TERM}, #endif #ifdef SIGPIPE {SIGPIPE, trap_pipe, "PIPE", MESPIPE, TR_TERM}, #endif #ifdef SIGALRM {SIGALRM, trap_alrm, "ALRM", MESALRM, TR_TERM | TR_READBL}, #endif #ifdef SIGTERM {SIGTERM, trap_term, "TERM", MESTERM, TR_TERM | TR_BLOCK | TR_READBL}, #endif #ifdef SIGSTKFLT {SIGSTKFLT, trap_stkflt, "STKFLT", MESSTKFLT, TR_TERM}, #endif #ifdef SIGURG {SIGURG, trap_urg, "URG", MESURG, TR_IGN}, #endif #ifdef SIGSTOP {SIGSTOP, trap_stop, "STOP", MESSTOP, TR_STOP}, #endif #ifdef SIGTSTP {SIGTSTP, trap_tstp, "TSTP", MESTSTP, TR_STOP | TR_BLOCK}, #endif #ifdef SIGCONT # if MSDOS {SIGCONT, trap_cont, "CONT", MESCONT, TR_IGN}, # else {SIGCONT, trap_cont, "CONT", MESCONT, TR_IGN | TR_BLOCK}, # endif #endif #ifdef SIGCHLD # ifdef NOJOB {SIGCHLD, trap_chld, "CHLD", MESCHLD, TR_IGN}, # else {SIGCHLD, trap_chld, "CHLD", MESCHLD, TR_IGN | TR_BLOCK}, # endif #endif #ifdef SIGTTIN {SIGTTIN, trap_ttin, "TTIN", MESTTIN, TR_STOP | TR_BLOCK}, #endif #ifdef SIGTTOU {SIGTTOU, trap_ttou, "TTOU", MESTTOU, TR_STOP | TR_BLOCK}, #endif #ifdef SIGIO {SIGIO, trap_io, "IO", MESIO, TR_IGN}, #else # ifdef SIGPOLL {SIGPOLL, trap_poll, "POLL", MESPOLL, TR_TERM}, # endif #endif #ifdef SIGXCPU {SIGXCPU, trap_xcpu, "XCPU", MESXCPU, TR_TERM}, #endif #ifdef SIGXFSZ {SIGXFSZ, trap_xfsz, "XFSZ", MESXFSZ, TR_TERM}, #endif #ifdef SIGVTALRM {SIGVTALRM, trap_vtalrm, "VTALRM", MESVTALRM, TR_TERM}, #endif #ifdef SIGPROF {SIGPROF, trap_prof, "PROF", MESPROF, TR_TERM}, #endif #ifdef SIGWINCH # ifdef FD {SIGWINCH, trap_winch, "WINCH", MESWINCH, TR_IGN | TR_BLOCK}, # else {SIGWINCH, trap_winch, "WINCH", MESWINCH, TR_IGN}, # endif #endif #ifdef SIGLOST {SIGLOST, trap_lost, "LOST", MESLOST, TR_TERM}, #endif #ifdef SIGINFO {SIGINFO, trap_info, "INFO", MESINFO, TR_IGN}, #endif #ifdef SIGPWR {SIGPWR, trap_pwr, "PWR", MESPWR, TR_TERM}, #endif #ifdef SIGUSR1 # ifdef BASHSTYLE {SIGUSR1, trap_usr1, "USR1", MESUSR1, TR_TERM}, # else {SIGUSR1, trap_usr1, "USR1", MESUSR1, TR_TERM | TR_BLOCK}, # endif #endif #ifdef SIGUSR2 # ifdef BASHSTYLE {SIGUSR2, trap_usr2, "USR2", MESUSR2, TR_TERM}, # else {SIGUSR2, trap_usr2, "USR2", MESUSR2, TR_TERM | TR_BLOCK}, # endif #endif {-1, NULL, NULL, NULL, 0} }; int verboseexec = 0; int notexec = 0; int verboseinput = 0; int terminated = 0; int forcedstdin = 0; int interactive_io = 0; int tmperrorexit = 0; int restricted = 0; int freeenviron = 0; int undeferror = 0; int hashahead = 0; #if MSDOS int noglob = 1; #else int noglob = 0; #endif int autoexport = 0; #ifndef MINIMUMSHELL int noclobber = 0; int ignoreeof = 0; #endif #ifndef NOJOB int bgnotify = 0; int jobok = -1; #endif #ifdef FD # ifndef _NOEDITMODE int emacsmode = 0; int vimode = 0; # endif # ifdef DEP_PTY int tmpshptymode = 0; # endif # if !MSDOS int autosavetty = 0; # endif #endif /* FD */ int loginshell = 0; int noruncom = 0; static char **shellvar = NULL; static char **exportvar = NULL; static u_long exportsize = (u_long)0; static char **exportlist = NULL; static char **ronlylist = NULL; static char *shellname = NULL; static int definput = -1; static int exit_status = RET_SUCCESS; #if !MSDOS static sigmask_t oldsigmask; #endif static p_id_t lastpid = (p_id_t)-1; #ifndef NOJOB static p_id_t oldttypgrp = (p_id_t)-1; #endif static int setsigflag = 0; static int trapok = 0; static shfunctable *shellfunc = NULL; static pipelist *pipetop = NULL; static int childdepth = 0; static int loopdepth = 0; static int breaklevel = 0; static int continuelevel = 0; static int shfunclevel = 0; static int returnlevel = 0; #ifndef MINIMUMSHELL static char **dirstack = NULL; static long shlineno = 0L; static int lastsig = -1; #endif static int isshellbuiltin = 0; static int execerrno = 0; #if !MSDOS && defined (DEP_PTY) && defined (CYGWIN) static p_id_t *mychildren = (p_id_t *)NULL; #endif static CONST char *CONST syntaxerrstr[] = { NULL, #define ER_UNEXPTOK 1 "unexpected token", #define ER_UNEXPNL 2 "unexpected newline or `;'", #define ER_UNEXPEOF 3 "unexpected end of file", }; #define SYNTAXERRSIZ arraysize(syntaxerrstr) static CONST char *CONST execerrstr[] = { NULL, #define ER_COMNOFOUND 1 "command not found", #define ER_NOTFOUND 2 "not found", #define ER_CANNOTEXE 3 "cannot execute", #define ER_NOTIDENT 4 "is not an identifier", #define ER_BADSUBST 5 "bad substitution", #define ER_BADNUMBER 6 "bad number", #define ER_BADDIR 7 "bad directory", #define ER_CANNOTRET 8 "cannot return when not in function", #define ER_CANNOTSTAT 9 "cannot stat .", #define ER_CANNOTUNSET 10 "cannot unset", #define ER_ISREADONLY 11 "is read only", #define ER_CANNOTSHIFT 12 "cannot shift", #define ER_BADOPTIONS 13 "bad option(s)", #define ER_PARAMNOTSET 14 "parameter not set", #define ER_RESTRICTED 15 "restricted", #define ER_BADULIMIT 16 "bad ulimit", #define ER_BADTRAP 17 "bad trap", #define ER_NUMOUTRANGE 18 "number out of range", #define ER_NOHOMEDIR 19 "no home directory", #ifdef NOALIAS NULL, #else #define ER_NOTALIAS 20 "is not an alias", #endif #ifdef NOPOSIXUTIL NULL, #else #define ER_MISSARG 21 "missing argument", #endif #ifdef NOJOB NULL, NULL, #else #define ER_NOSUCHJOB 22 "no such job", #define ER_TERMINATED 23 "job has terminated", #endif #ifdef MINIMUMSHELL NULL, NULL, NULL, #else #define ER_NOTLOGINSH 24 "not login shell", #define ER_DIREMPTY 25 "directory stack empty", #define ER_UNKNOWNSIG 26 "unknown signal; kill -l lists signals", #endif #if !MSDOS NULL, #else #define ER_INVALDRIVE 27 "invalid drive specification", #endif #ifdef WITHSOCKET #define ER_NOTSOCKET 28 "not socket", #define ER_INVALSOCKET 29 "invalid socket", #else NULL, NULL, #endif #ifdef FD #define ER_RECURSIVEFD 30 "recursive call for FDclone", #define ER_INVALTERMFD 31 "invalid terminal for FDclone", #endif }; #define EXECERRSIZ arraysize(execerrstr) static CONST opetable opelist[] = { {OP_FG, 4, ";"}, {OP_BG, 4, "&"}, #ifndef MINIMUMSHELL {OP_NOWN, 4, "&|"}, #endif {OP_AND, 3, "&&"}, {OP_OR, 3, "||"}, {OP_PIPE, 2, "|"}, #ifndef MINIMUMSHELL {OP_NOT, 2, "!"}, #endif }; #define OPELISTSIZ arraysize(opelist) #if !defined (BASHBUG) && !defined (MINIMUMSHELL) static CONST opetable delimlist[] = { {OP_NONE, 1, "{"}, {OP_NONE, 1, ";;"}, {OP_FG, 1, ";"}, {OP_NONE, 0, "&>>"}, {OP_NONE, 0, "&>|"}, {OP_NONE, 0, "&>"}, {OP_AND, 1, "&&"}, {OP_NOWN, 1, "&|"}, {OP_BG, 1, "&"}, {OP_OR, 1, "||"}, {OP_PIPE, 1, "|&"}, {OP_PIPE, 1, "|"}, {OP_NOT, 1, "!"}, {OP_NONE, 0, "<<-"}, {OP_NONE, 0, "<<"}, {OP_NONE, 0, "<>"}, {OP_NONE, 0, "<&-"}, {OP_NONE, 0, "<&"}, {OP_NONE, 0, "<-"}, {OP_NONE, 0, "<"}, {OP_NONE, 0, "><"}, {OP_NONE, 0, ">>"}, {OP_NONE, 0, ">&-"}, {OP_NONE, 0, ">&"}, {OP_NONE, 0, ">-"}, {OP_NONE, 0, ">|"}, {OP_NONE, 0, ">"}, }; #define DELIMLISTSIZ arraysize(delimlist) #endif /* !BASHBUG && !MINIMUMSHELL */ static shbuiltintable shbuiltinlist[] = { {donull, ":", BT_POSIXSPECIAL}, {dobreak, "break", BT_POSIXSPECIAL}, {docontinue, "continue", BT_POSIXSPECIAL}, {doreturn, "return", BT_POSIXSPECIAL}, {doexec, "exec", BT_POSIXSPECIAL | BT_NOKANJIFGET}, #ifndef MINIMUMSHELL {dologin, "login", 0}, {dologout, "logout", 0}, #endif {doeval, "eval", BT_POSIXSPECIAL | BT_NOKANJIFGET}, {doexit, "exit", BT_POSIXSPECIAL}, {doread, "read", 0}, {doshift, "shift", BT_POSIXSPECIAL}, {doset, "set", BT_POSIXSPECIAL}, {dounset, "unset", BT_POSIXSPECIAL}, #ifndef _NOUSEHASH {dohash, "hash", 0}, #endif {dochdir, "cd", BT_RESTRICT | BT_FILENAME}, {dopwd, "pwd", 0}, {dosource, ".", BT_POSIXSPECIAL | BT_FILENAME}, #ifndef MINIMUMSHELL {dosource, "source", BT_FILENAME}, #endif {doexport, "export", BT_POSIXSPECIAL}, {doreadonly, "readonly", BT_POSIXSPECIAL}, {dotimes, "times", BT_POSIXSPECIAL}, {dowait, "wait", 0}, {doumask, "umask", 0}, {doulimit, "ulimit", 0}, {dotrap, "trap", BT_POSIXSPECIAL}, #ifndef NOJOB {dojobs, "jobs", 0}, {dofg, "fg", 0}, {dobg, "bg", 0}, {dodisown, "disown", 0}, #endif {dotype, "type", 0}, #ifdef DOSCOMMAND {donull, "rem", 0}, {dodir, "dir", BT_NOGLOB | BT_FILENAME}, {dochdir, "chdir", BT_RESTRICT | BT_FILENAME}, # if MSDOS {domkdir, "mkdir", BT_RESTRICT | BT_FILENAME}, {dormdir, "rmdir", BT_RESTRICT | BT_FILENAME}, # endif {domkdir, "md", BT_RESTRICT | BT_FILENAME}, {dormdir, "rd", BT_RESTRICT | BT_FILENAME}, {doerase, "erase", BT_NOGLOB | BT_RESTRICT | BT_FILENAME}, {doerase, "del", BT_NOGLOB | BT_RESTRICT | BT_FILENAME}, {dorename, "rename", BT_NOGLOB | BT_RESTRICT | BT_FILENAME}, {dorename, "ren", BT_NOGLOB | BT_RESTRICT | BT_FILENAME}, {docopy, "copy", BT_NOGLOB | BT_RESTRICT | BT_FILENAME}, {docls, "cls", 0}, {dodtype, "dtype", BT_FILENAME}, #endif /* DOSCOMMAND */ #ifndef NOALIAS {doalias, "alias", 0}, {dounalias, "unalias", BT_NOGLOB}, #endif {doecho, "echo", 0}, #ifndef MINIMUMSHELL {dokill, "kill", 0}, {dotest, "test", 0}, {dotest, "[", 0}, #endif #ifndef NOPOSIXUTIL {donull, "true", 0}, {dofalse, "false", 0}, {docommand, "command", BT_NOKANJIFGET}, {dogetopts, "getopts", 0}, {donewgrp, "newgrp", BT_RESTRICT}, # if 0 /* exists in FD original builtin */ {dofc, "fc", 0}, # endif #endif #ifndef MINIMUMSHELL {dopushd, "pushd", BT_RESTRICT | BT_FILENAME}, {dopopd, "popd", 0}, {dodirs, "dirs", 0}, {doenable, "enable", 0}, {dobuiltin, "builtin", 0}, {doaddcr, "addcr", 0}, #endif #ifdef WITHSOCKET {doaccept, "accept", BT_RESTRICT}, {dosocketinfo, "socketinfo", BT_RESTRICT}, #endif #ifdef FD {dofd, "fd", BT_FILENAME}, #endif }; #define SHBUILTINSIZ arraysize(shbuiltinlist) static CONST char *primalvar[] = { ENVPATH, ENVPS1, ENVPS2, ENVIFS, #if !MSDOS && !defined (MINIMUMSHELL) ENVMAILCHECK, ENVPPID, #endif }; #define PRIMALVARSIZ arraysize(primalvar) static CONST char *restrictvar[] = { ENVPATH, #ifdef FD "FD_SHELL", #else ENVSHELL, #endif #ifndef MINIMUMSHELL ENVENV, #endif }; #define RESTRICTVARSIZ arraysize(restrictvar) #if MSDOS && !defined (BSPATHDELIM) static CONST char *adjustvar[] = { ENVPATH, ENVHOME, # ifndef MINIMUMSHELL ENVENV, # endif # ifdef FD ENVPWD, "FD_HISTFILE", # if FD >= 2 "FD_DIRHISTFILE", # endif # if FD >= 3 "FD_FREQFILE", # endif "FD_TMPDIR", # ifndef _NOROCKRIDGE "FD_RRPATH", # endif # ifndef _NOPRECEDE "FD_PRECEDEPATH", # endif # ifdef DEP_LOGGING "FD_LOGFILE", # endif # ifdef DEP_FTPPATH "FD_FTPLOGFILE", # endif # ifdef DEP_HTTPPATH "FD_HTTPLOGFILE", "FD_HTMLLOGFILE", # endif # ifdef DEP_FILECONV "FD_SJISPATH", "FD_EUCPATH", "FD_JISPATH", "FD_JIS8PATH", "FD_JUNETPATH", "FD_OJISPATH", "FD_OJIS8PATH", "FD_OJUNETPATH", "FD_HEXPATH", "FD_CAPPATH", "FD_UTF8PATH", "FD_UTF8MACPATH", "FD_UTF8ICONVPATH", "FD_NOCONVPATH", # endif "FD_PAGER", "FD_EDITOR", "FD_SHELL", # ifndef NOPOSIXUTIL "FD_FCEDIT", # endif # if MSDOS "FD_COMSPEC", # endif # else /* !FD */ ENVSHELL, # if MSDOS ENVCOMSPEC, # endif # endif /* !FD */ }; #define ADJUSTVARSIZ arraysize(adjustvar) #endif /* MSDOS && !BSPATHDELIM */ static CONST shflagtable shflaglist[] = { {"xtrace", &verboseexec, 'x'}, {"noexec", ¬exec, 'n'}, {"verbose", &verboseinput, 'v'}, {"onecmd", &terminated, 't'}, {NULL, &forcedstdin, 's'}, {NULL, &interactive_io, 'i'}, {"errexit", &tmperrorexit, 'e'}, {NULL, &restricted, 'r'}, {"keyword", &freeenviron, 'k'}, {"nounset", &undeferror, 'u'}, {"hashahead", &hashahead, 'h'}, {"noglob", &noglob, 'f'}, {"allexport", &autoexport, 'a'}, #ifndef MINIMUMSHELL {"noclobber", &noclobber, 'C'}, {"ignoreeof", &ignoreeof, '\0'}, #endif #ifndef NOJOB {"notify", &bgnotify, 'b'}, {"monitor", &jobok, 'm'}, #endif #ifdef FD {"physical", &physical_path, 'P'}, # ifndef _NOEDITMODE {"emacs", &emacsmode, '\0'}, {"vi", &vimode, '\0'}, # endif # ifdef DEP_PTY {"ptyshell", &tmpshptymode, 'T'}, # endif # if !MSDOS {"autosavetty", &autosavetty, 'S'}, # endif #endif /* FD */ {NULL, &loginshell, 'l'}, {NULL, &noruncom, 'N'}, }; #define FLAGSSIZ arraysize(shflaglist) #ifdef USERESOURCEH static CONST ulimittable ulimitlist[] = { #ifdef RLIMIT_CPU {'t', RLIMIT_CPU, 1, "time(seconds)"}, #endif #ifdef RLIMIT_FSIZE {'f', RLIMIT_FSIZE, DEV_BSIZE, "file(blocks)"}, #endif #ifdef RLIMIT_DATA {'d', RLIMIT_DATA, 1024, "data(kbytes)"}, #endif #ifdef RLIMIT_STACK {'s', RLIMIT_STACK, 1024, "stack(kbytes)"}, #endif #ifdef RLIMIT_CORE {'c', RLIMIT_CORE, DEV_BSIZE, "coredump(blocks)"}, #endif #ifdef RLIMIT_RSS {'m', RLIMIT_RSS, 1024, "memory(kbytes)"}, #endif #ifdef RLIMIT_MEMLOCK {'l', RLIMIT_MEMLOCK, 1024, "locked memory(kbytes)"}, #endif #ifdef RLIMIT_NPROC {'u', RLIMIT_NPROC, 1, "processes(units)"}, #endif #ifdef RLIMIT_NOFILE {'n', RLIMIT_NOFILE, 1, "nofiles(descriptors)"}, #endif #ifdef RLIMIT_VMEM {'v', RLIMIT_VMEM, 1024, "virtual memory(kbytes)"}, #endif }; #define ULIMITSIZ arraysize(ulimitlist) #endif /* USERESOURCEH */ static int trapmode[NSIG]; static char *trapcomm[NSIG]; static sigarg_t (*oldsigfunc[NSIG])__P_((sigfnc_t)); #ifdef WITHSOCKREDIR static scheme_t schemelist[] = { #define DEFSCHEME(i, t) {i, strsize(i), -1, t} DEFSCHEME("connect", TYPE_CONNECT), DEFSCHEME("accept", TYPE_ACCEPT), DEFSCHEME("bind", TYPE_BIND), {NULL, 0, 0}, }; #endif #ifndef FD static lockbuf_t *NEAR lockopen(path, flags, mode) CONST char *path; int flags, mode; { lockbuf_t *lck; int fd; if ((fd = newdup(Xopen(path, flags, mode))) >= 0) /*EMPTY*/; else if (errno != ENOENT) return(NULL); lck = (lockbuf_t *)Xmalloc(sizeof(lockbuf_t)); lck -> fd = fd; return(lck); } static VOID NEAR lockclose(lck) lockbuf_t *lck; { if (lck) { if (lck -> fd >= 0) VOID_C Xclose(lck -> fd); Xfree(lck); } } static int NEAR genrand(max) int max; { # ifdef MINIMUMSHELL static u_int last = 0; static int init = 0; if (!init) { init++; last = getpid(); } last = last * 12345 + 101; return(last % max); # else /* !MINIMUMSHELL */ static long last = -1L; time_t now; if (last < 0L) { now = Xtime(NULL); last = ((now & 0xff) << 16) + (now & ~0xff) + getpid(); } do { last = last * (u_long)1103515245 + 12345; } while (last < 0L); return((last / 65537L) % max); # endif /* !MINIMUMSHELL */ } static char *NEAR genrandname(buf, len) char *buf; int len; { static char seq[] = { # ifdef PATHNOCASE '0', '1', '2', '3', '4', '5', '6', '7', '8', '9', 'A', 'B', 'C', 'D', 'E', 'F', 'G', 'H', 'I', 'J', 'K', 'L', 'M', 'N', 'O', 'P', 'Q', 'R', 'S', 'T', 'U', 'V', 'W', 'X', 'Y', 'Z', '_' # else '0', '1', '2', '3', '4', '5', '6', '7', '8', '9', 'a', 'b', 'c', 'd', 'e', 'f', 'g', 'h', 'i', 'j', 'k', 'l', 'm', 'n', 'o', 'p', 'q', 'r', 's', 't', 'u', 'v', 'w', 'x', 'y', 'z', '_' # endif }; int i, j, c; if (!buf) { for (i = 0; i < arraysize(seq); i++) { j = genrand(arraysize(seq)); c = seq[i]; seq[i] = seq[j]; seq[j] = c; } } else { for (i = 0; i < len; i++) { j = genrand(arraysize(seq)); buf[i] = seq[j]; } buf[i] = '\0'; } return(buf); } static int NEAR mktmpfile(file) char *file; { char *cp, path[MAXPATHLEN]; int fd, n, len; Xstrcpy(path, deftmpdir); cp = strcatdelim(path); n = strsize(TMPPREFIX); Xstrncpy(cp, TMPPREFIX, n); len = strsize(path) - (cp - path); if (len > MAXTMPNAMLEN) len = MAXTMPNAMLEN; len -= n; genrandname(NULL, 0); for (;;) { genrandname(cp + n, len); fd = Xopen(path, O_BINARY | O_WRONLY | O_CREAT | O_EXCL, 0644); if (fd >= 0) { Xstrcpy(file, path); return(fd); } if (errno != EEXIST) break; } return(-1); } static int NEAR rmtmpfile(file) CONST char *file; { if (Xunlink(file) < 0 && errno != ENOENT) return(-1); return(0); } /*ARGSUSED*/ int chdir3(dir, raw) CONST char *dir; int raw; { if (chdir2(dir) < 0) return(-1); # ifndef _NOUSEHASH VOID_C searchhash(NULL, nullstr, nullstr); # endif return(0); } int setenv2(name, value, export) CONST char *name, *value; int export; { char *cp; int len; len = strlen(name); if (!value) return(unset(name, len)); else { cp = Xmalloc(len + strlen(value) + 2); memcpy(cp, name, len); cp[len] = '='; Xstrcpy(&(cp[len + 1]), value); } if (((export) ? putexportvar(cp, len) : putshellvar(cp, len)) < 0) { Xfree(cp); return(-1); } return(0); } # if MSDOS && !defined (BSPATHDELIM) static char *NEAR adjustpname(path) char *path; { int i; for (i = 0; path[i]; i++) { if (path[i] == '\\') path[i] = _SC_; else if (iskanji1(path, i)) i++; } return(path); } # endif /* MSDOS && !BSPATHDELIM */ # if !MSDOS && !defined (NOJOB) static VOID NEAR stdiomode(VOID_A) { # ifdef USESGTTY int lflag; # endif termioctl_t tty; if (tioctl(ttyio, REQGETP, &tty) >= 0) { # ifdef USESGTTY tty.sg_flags |= ECHO | CRMOD; tty.sg_flags &= ~(RAW | CBREAK | XTABS); # else tty.c_lflag |= (TIO_LCOOKED | TIO_LECHO); tty.c_lflag &= ~(PENDIN | ECHONL); tty.c_iflag |= (TIO_ICOOKED | ICRNL); tty.c_iflag &= TIO_INOCOOKED; tty.c_oflag |= TIO_ONL; tty.c_oflag &= (TIO_ONONL & ~TAB3); # endif VOID_C tioctl(ttyio, REQSETP, &tty); } # ifdef USESGTTY if (Xioctl(ttyio, TIOCLGET, &lflag) >= 0) { lflag |= LPASS8 | LCRTBS | LCRTERA | LCRTKIL | LCTLECH; lflag &= ~(LLITOUT | LPENDIN); VOID_C Xioctl(ttyio, TIOCLSET, &lflag); } # endif } # endif /* !MSDOS && !NOJOB */ #endif /* !FD */ #ifndef NOJOB static VOID NEAR notifyjob(VOID_A) { XFILE *fp; int fd; if ((fd = Xdup(STDERR_FILENO)) < 0) fp = Xstderr; else if (!(fp = Xfdopen(fd, "a"))) { VOID_C Xclose(fd); fp = Xstderr; } else Xsetlinebuf(fp); checkjob(fp); safefclose(fp); } #endif /* !NOJOB */ #endif /* DEP_ORIGSHELL */ #if !defined (FD) && defined (USESIGACTION) static sigcst_t NEAR signal2(sig, func) int sig; sigcst_t func; { struct sigaction act, oact; act.sa_handler = func; # ifdef SA_INTERRUPT act.sa_flags = SA_INTERRUPT; # else act.sa_flags = 0; # endif sigemptyset(&(act.sa_mask)); sigemptyset(&(oact.sa_mask)); if (sigaction(sig, &act, &oact) < 0) return(SIG_ERR); return(oact.sa_handler); } #endif /* !FD && USESIGACTION */ VOID suspendsignal(sig, func, oldp) int sig; sigcst_t func; sigblk_t *oldp; { #if MSDOS sigcst_t ofunc; #else sigmask_t mask; #endif #if MSDOS ofunc = signal2(sig, SIG_IGN); *oldp = (sigblk_t)((func) ? func : ofunc); #else Xsigemptyset(mask); if (sig) Xsigaddset(mask, sig); Xsigblock(*oldp, mask); if (func) VOID_C signal2(sig, func); #endif } /*ARGSUSED*/ VOID resumesignal(sig, oldp) int sig; sigblk_t *oldp; { #if MSDOS VOID_C signal2(sig, *oldp); #else Xsigsetmask(*oldp); #endif } #ifdef DEP_ORIGSHELL static VOID NEAR setsignal(VOID_A) { int i, sig; if (setsigflag++) return; #if defined (FD) && defined (SIGALRM) noalrm++; #endif for (i = 0; signallist[i].sig >= 0; i++) { sig = signallist[i].sig; if (signallist[i].flags & TR_BLOCK) /*EMPTY*/; else if (signallist[i].flags & TR_READBL) /*EMPTY*/; else if ((trapmode[sig] & TR_STAT) != TR_TRAP) continue; else if ((signallist[i].flags & TR_STAT) == TR_STOP) continue; VOID_C signal2(sig, (sigcst_t)(signallist[i].func)); } } static VOID NEAR resetsignal(forced) int forced; { #if !MSDOS && defined (NOJOB) p_id_t tmp; #endif #if defined (SIGCHLD) && !defined (NOJOB) int n; #endif int i, duperrno; duperrno = errno; #if !MSDOS # ifdef NOJOB do { tmp = Xwait3(NULL, WNOHANG | WUNTRACED, NULL); } while (tmp > (p_id_t)0 || (tmp < (p_id_t)0 && errno == EINTR)); # else notifyjob(); stopped = 0; # endif #endif /* !MSDOS */ if (hastty() && interrupted && interactive && !nottyout) { VOID_C Xfflush(Xstdout); VOID_C fputnl(Xstderr); } interrupted = 0; if (setsigflag) { if (forced) setsigflag = 1; if (!(--setsigflag)) { #if defined (FD) && defined (SIGALRM) noalrm--; #endif for (i = 0; i < NSIG; i++) { #if defined (SIGCHLD) && !defined (NOJOB) if (i == SIGCHLD && bgnotify) { for (n = 0; n < maxjobs; n++) if (joblist[n].pids) break; if (n < maxjobs) continue; } #endif if (oldsigfunc[i] != SIG_ERR) VOID_C signal2(i, oldsigfunc[i]); } #if !MSDOS Xsigsetmask(oldsigmask); #endif } } errno = duperrno; } static VOID NEAR exectrapcomm(VOID_A) { sigblk_t old; int i, dupinterrupted; #if !MSDOS if (!hastty()) return; #endif for (i = 0; i < NSIG; i++) { if (!(trapmode[i] & TR_CATCH)) continue; trapmode[i] &= ~TR_CATCH; if (!trapcomm[i] || !*(trapcomm[i])) continue; suspendsignal(i, NULL, &old); dupinterrupted = interrupted; interrupted = 0; _dosystem(trapcomm[i]); interrupted = dupinterrupted; resumesignal(i, &old); } } static VOID NEAR killmyself(sig) int sig; { printf_urgent++; prepareexit(0); printf_urgent--; VOID_C signal2(sig, SIG_DFL); VOID_C kill(mypid, sig); exit(sig + 128); } static int NEAR trap_common(sig) int sig; { #if !MSDOS && defined (DEP_PTY) && defined (CYGWIN) int n; #endif #if !MSDOS sigblk_t old; #endif int i, trapped, flags, duperrno, duptrapok; duperrno = errno; duptrapok = trapok; trapok = -1; #ifndef MINIMUMSHELL lastsig = -1; #endif #if !MSDOS /* for obsolete signal() */ suspendsignal(sig, NULL, &old); #endif for (i = 0; signallist[i].sig >= 0; i++) if (sig == signallist[i].sig) break; if (signallist[i].sig < 0) { VOID_C signal2(sig, SIG_DFL); #if !MSDOS resumesignal(sig, &old); #endif errno = duperrno; trapok = duptrapok; VOID_C kill(mypid, sig); return(0); } trapped = 0; flags = signallist[i].flags; if (mypid != shellpid) { if ((flags & TR_BLOCK) && (flags & TR_STAT) == TR_TERM) trapped = -1; } else if ((trapmode[sig] & TR_STAT) == TR_TRAP) trapped = 1; else if (flags & TR_BLOCK) /*EMPTY*/; else if ((flags & TR_STAT) == TR_TERM) trapped = -1; if (trapped > 0) { trapmode[sig] |= TR_CATCH; if (duptrapok > 0) exectrapcomm(); } else if (trapped < 0 && signallist[i].mes && *(signallist[i].mes)) errputs(signallist[i].mes, 1); #if !MSDOS && defined (DEP_PTY) && defined (CYGWIN) if (mychildren && (flags & TR_STAT) == TR_TERM) { for (n = 0; mychildren[n] >= (p_id_t)0; n++) { VOID_C kill(mychildren[n], sig); # ifdef SIGCONT VOID_C kill(mychildren[n], SIGCONT); # endif } Xfree(mychildren); mychildren = NULL; } #endif /* !MSDOS && DEP_PTY && CYGWIN */ if (trapped < 0) { #if !MSDOS resumesignal(sig, &old); #endif killmyself(sig); } #ifndef MINIMUMSHELL lastsig = i; #endif switch (sig) { #ifdef SIGHUP case SIGHUP: if (trapped) break; # ifndef NOJOB if (hastty()) killjob(); # endif if (oldsigfunc[sig] && oldsigfunc[sig] != SIG_ERR && oldsigfunc[sig] != SIG_DFL && oldsigfunc[sig] != SIG_IGN) { # ifdef SIGFNCINT (*oldsigfunc[sig])(sig); # else (*oldsigfunc[sig])(); # endif } #if !MSDOS resumesignal(sig, &old); #endif killmyself(sig); break; #endif /* SIGHUP */ #if !MSDOS && defined (SIGCONT) case SIGCONT: # ifdef FD suspended = 1; # endif sigconted = 1; break; #endif /* !MSDOS && SIGCONT */ #ifdef SIGINT case SIGINT: interrupted = 1; break; #endif #if defined (SIGCHLD) && (!defined (NOJOB) || defined (SYSV)) case SIGCHLD: # ifndef NOJOB if (bgnotify) { notifyjob(); break; } # endif # ifdef SYSV /* TIPS for obsolete SystemV signal() */ while (waitjob(-1, NULL, WNOHANG | WUNTRACED) > 0) /*EMPTY*/; # endif break; #endif /* SIGCHLD && (!NOJOB || SYSV) */ #if defined (FD) && defined (SIGWINCH) case SIGWINCH: pollscreen(1); break; #endif /* FD && SIGWINCH */ default: break; } if (signallist[i].func) VOID_C signal2(sig, (sigcst_t)(signallist[i].func)); #if !MSDOS resumesignal(sig, &old); #endif errno = duperrno; trapok = duptrapok; return(trapped); } #ifdef SIGHUP static int trap_hup(VOID_A) { return(trap_common(SIGHUP)); } #endif #ifdef SIGINT static int trap_int(VOID_A) { return(trap_common(SIGINT)); } #endif #ifdef SIGQUIT static int trap_quit(VOID_A) { return(trap_common(SIGQUIT)); } #endif #ifdef SIGILL static int trap_ill(VOID_A) { return(trap_common(SIGILL)); } #endif #ifdef SIGTRAP static int trap_trap(VOID_A) { return(trap_common(SIGTRAP)); } #endif #ifdef SIGIOT static int trap_iot(VOID_A) { return(trap_common(SIGIOT)); } #else # ifdef SIGABRT static int trap_abrt(VOID_A) { return(trap_common(SIGABRT)); } # endif #endif /* SIGIOT */ #ifdef SIGEMT static int trap_emt(VOID_A) { return(trap_common(SIGEMT)); } #endif #ifdef SIGFPE static int trap_fpe(VOID_A) { return(trap_common(SIGFPE)); } #endif #ifdef SIGBUS static int trap_bus(VOID_A) { return(trap_common(SIGBUS)); } #endif #ifdef SIGSEGV static int trap_segv(VOID_A) { return(trap_common(SIGSEGV)); } #endif #ifdef SIGSYS static int trap_sys(VOID_A) { return(trap_common(SIGSYS)); } #endif #ifdef SIGPIPE static int trap_pipe(VOID_A) { return(trap_common(SIGPIPE)); } #endif #ifdef SIGALRM static int trap_alrm(VOID_A) { return(trap_common(SIGALRM)); } #endif #ifdef SIGTERM static int trap_term(VOID_A) { return(trap_common(SIGTERM)); } #endif #ifdef SIGSTKFLT static int trap_stkflt(VOID_A) { return(trap_common(SIGSTKFLT)); } #endif #ifdef SIGURG static int trap_urg(VOID_A) { return(trap_common(SIGURG)); } #endif #ifdef SIGSTOP static int trap_stop(VOID_A) { return(trap_common(SIGSTOP)); } #endif #ifdef SIGTSTP static int trap_tstp(VOID_A) { return(trap_common(SIGTSTP)); } #endif #ifdef SIGCONT static int trap_cont(VOID_A) { return(trap_common(SIGCONT)); } #endif #ifdef SIGCHLD static int trap_chld(VOID_A) { return(trap_common(SIGCHLD)); } #endif #ifdef SIGTTIN static int trap_ttin(VOID_A) { return(trap_common(SIGTTIN)); } #endif #ifdef SIGTTOU static int trap_ttou(VOID_A) { return(trap_common(SIGTTOU)); } #endif #ifdef SIGIO static int trap_io(VOID_A) { return(trap_common(SIGIO)); } #else # ifdef SIGPOLL static int trap_poll(VOID_A) { return(trap_common(SIGPOLL)); } # endif #endif /* SIGIO */ #ifdef SIGXCPU static int trap_xcpu(VOID_A) { return(trap_common(SIGXCPU)); } #endif #ifdef SIGXFSZ static int trap_xfsz(VOID_A) { return(trap_common(SIGXFSZ)); } #endif #ifdef SIGVTALRM static int trap_vtalrm(VOID_A) { return(trap_common(SIGVTALRM)); } #endif #ifdef SIGPROF static int trap_prof(VOID_A) { return(trap_common(SIGPROF)); } #endif #ifdef SIGWINCH static int trap_winch(VOID_A) { return(trap_common(SIGWINCH)); } #endif #ifdef SIGLOST static int trap_lost(VOID_A) { return(trap_common(SIGLOST)); } #endif #ifdef SIGINFO static int trap_info(VOID_A) { return(trap_common(SIGINFO)); } #endif #ifdef SIGPWR static int trap_pwr(VOID_A) { return(trap_common(SIGPWR)); } #endif #ifdef SIGUSR1 static int trap_usr1(VOID_A) { return(trap_common(SIGUSR1)); } #endif #ifdef SIGUSR2 static int trap_usr2(VOID_A) { return(trap_common(SIGUSR2)); } #endif #ifndef MINIMUMSHELL int catchsignal(verbose) int verbose; { static int doing = 0; int n, len, duperrno; if (verbose < 0) { lastsig = -1; return(0); } if (lastsig < 0) return(0); switch (signallist[lastsig].sig) { # ifdef SIGTTIN case SIGTTIN: n = -1; break; # endif # ifdef SIGTTOU case SIGTTOU: n = -1; break; # endif default: n = 0; break; } if (n >= 0 || !verbose || doing) /*EMPTY*/; else if (signallist[lastsig].mes && *(signallist[lastsig].mes)) { doing++; duperrno = errno; len = strlen(signallist[lastsig].mes); VOID_C surewrite(STDERR_FILENO, signallist[lastsig].mes, len); VOID_C surewrite(STDERR_FILENO, "\n", 1); errno = duperrno; doing--; } return(n); } #endif /* !MINIMUMSHELL */ VOID prepareexit(noexit) int noexit; { #ifdef DEBUG sigblk_t old; int i; #endif int duperrno; if (noexit > 0) { resetsignal(1); return; } duperrno = errno; exectrapcomm(); if (mypid == orgpid && !noexit && (trapmode[0] & TR_STAT) == TR_TRAP) { trapmode[0] = 0; if (trapcomm[0] && *(trapcomm[0])) _dosystem(trapcomm[0]); } #ifndef NOJOB if (ttyio >= 0) VOID_C gettermio(oldttypgrp, 1); #endif #ifdef DEP_URLPATH VOID_C urlallclose(); #endif resetsignal(1); freefunc(shellfunc); shellfunc = NULL; #ifdef DEBUG if (definput >= 0) { if (definput != ttyio) safeclose(definput); definput = -1; } freevar(shellvar); shellvar = NULL; freevar(exportvar); exportvar = NULL; exportsize = (u_long)0; freevar(exportlist); exportlist = NULL; freevar(ronlylist); ronlylist = NULL; freevar(argvar); argvar = NULL; # ifndef MINIMUMSHELL freevar(dirstack); dirstack = NULL; # endif /* !MINIMUMSHELL */ # ifndef NOALIAS freealias(shellalias); shellalias = NULL; # endif # ifndef _NOUSEHASH VOID_C searchhash(NULL, NULL, NULL); # endif # if !MSDOS && !defined (MINIMUMSHELL) checkmail(1); # endif for (i = 0; i < NSIG; i++) { suspendsignal(i, oldsigfunc[i], &old); Xfree(trapcomm[i]); trapcomm[i] = NULL; resumesignal(i, &old); } # ifndef NOJOB if (joblist) { for (i = 0; i < maxjobs; i++) freejob(i); maxjobs = 0; Xfree(joblist); joblist = NULL; } # endif /* !NOJOB */ # ifdef CYGWIN freecygdrive(); # endif # if defined (DEP_KANJIPATH) || defined (DEP_ROCKRIDGE) \ || defined (DEP_PSEUDOPATH) freeopenlist(); # endif #endif /* DEBUG */ errno = duperrno; } VOID Xexit2(n) int n; { if (mypid == orgpid) { #ifndef NOJOB if (loginshell && interactive_io) killjob(); #endif #ifdef FD if (hastty() && interactive && !nottyout) { if (!dumbterm) putterm(T_NORMAL); endterm(); inittty(1); keyflush(); } #endif exec_line(NULL); _dosystem(NULL); } prepareexit(0); #ifdef FD if (mypid == orgpid) prepareexitfd(n); #endif #ifdef DEBUG if (hastty() && mypid == orgpid) { # if !MSDOS && defined (FD) freeterment(); # endif closetty(&ttyio, &ttyout); muntrace(); } #endif /* DEBUG */ exit(n); } #ifdef FD static VOID NEAR argfputs(s, fp) CONST char *s; XFILE *fp; { VOID_C Xfprintf(fp, "%a", s); } #endif /* FD */ #ifdef DEP_FILECONV static int NEAR Kopen(path, flags, mode) CONST char *path; int flags, mode; { char buf[MAXPATHLEN]; path = kanjiconv2(buf, path, MAXPATHLEN - 1, defaultkcode, DEFCODE, L_FNAME); return(Xopen(path, flags, mode)); } #endif /* DEP_FILECONV */ static VOID NEAR syntaxerror(s) CONST char *s; { if (syntaxerrno <= 0 || syntaxerrno >= SYNTAXERRSIZ) return; #ifndef BASHSTYLE /* bash shows its name, even in interective shell */ if (interactive) /*EMPTY*/; else #endif if (argvar && argvar[0]) VOID_C Xfprintf(Xstderr, "%k: ", argvar[0]); #ifndef MINIMUMSHELL if (!interactive && shlineno > 0L) VOID_C Xfprintf(Xstderr, "%ld: ", shlineno); #endif if (s) VOID_C Xfprintf(Xstderr, "%a: ", (*s && syntaxerrno != ER_UNEXPNL) ? s : "syntax error"); errputs(syntaxerrstr[syntaxerrno], 1); ret_status = RET_SYNTAXERR; if (errorexit) Xexit2(RET_SYNTAXERR); safeexit(); } /*ARGSUSED*/ VOID execerror(argv, s, n, noexit) char *CONST *argv; CONST char *s; int n, noexit; { if (n == ER_BADSUBST && (execerrno == ER_ISREADONLY || execerrno == ER_PARAMNOTSET)) return; if (!n || n >= EXECERRSIZ) return; #ifndef BASHSTYLE /* bash shows its name, even in interective shell */ if (interactive) /*EMPTY*/; else #endif if (argvar && argvar[0]) VOID_C Xfprintf(Xstderr, "%k: ", argvar[0]); #ifndef MINIMUMSHELL if (!interactive && shlineno > 0L) VOID_C Xfprintf(Xstderr, "%ld: ", shlineno); #endif if (argv && argv[0]) VOID_C Xfprintf(Xstderr, "%k: ", argv[0]); if (s) VOID_C Xfprintf(Xstderr, "%a: ", s); errputs(execerrstr[n], 1); execerrno = n; #ifndef BASHSTYLE /* bash does not break any statement on error */ if (noexit < 2) breaklevel = loopdepth; #endif #if MSDOS /* child process fake */ if (childdepth) return; #endif if (noexit < 0) safeexit(); else if (noexit) /*EMPTY*/; #if !defined (BASHSTYLE) || defined (STRICTPOSIX) /* bash does not exit on error, in non interactive shell */ else if (isshellbuiltin) safeexit(); #endif } VOID doperror(command, s) CONST char *command, *s; { int duperrno; duperrno = errno; if (errno < 0) return; if (!command) command = (argvar && argvar[0]) ? argvar[0] : shellname; VOID_C Xfprintf(Xstderr, "%k: ", command); if (s) VOID_C Xfprintf(Xstderr, "%a: ", s); errputs(Xstrerror(duperrno), 1); errno = 0; #ifndef BASHSTYLE /* bash does not break any statement on error */ breaklevel = loopdepth; #endif #if MSDOS /* child process fake */ if (childdepth) return; #endif #if !defined (BASHSTYLE) || defined (STRICTPOSIX) /* bash does not exit on error, in non interactive shell */ if (isshellbuiltin) safeexit(); #endif } int isnumeric(s) CONST char *s; { int i, n; i = 0; if ((n = getnum(s, &i)) < 0) return(-1); #ifndef BASHSTYLE /* bash always treats non numeric character as error */ if (s[i]) return(-1); #endif return(n); } #if !MSDOS VOID dispsignal(sig, width, fp) int sig, width; XFILE *fp; { int i; for (i = 0; signallist[i].sig >= 0; i++) if (sig == signallist[i].sig) break; if (signallist[i].sig < 0) { if ((width -= strsize("Signal ")) < 0) width = 0; VOID_C Xfprintf(fp, "Signal %-*d", width, sig); } else if (!signallist[i].mes || !*(signallist[i].mes)) /*EMPTY*/; else if (!width) VOID_C Xfputs(signallist[i].mes, fp); else VOID_C Xfprintf(fp, "%-*.*s", width, width, signallist[i].mes); } # ifdef NOJOB int _waitjob(pid, wp, opt) p_id_t pid; wait_pid_t *wp; int opt; # else int _waitjob(pid, wp, opt, fp) p_id_t pid; wait_pid_t *wp; int opt; XFILE *fp; # endif { # if !defined (NOJOB) || defined (SYSV) static wait_pid_t *waitlist = NULL; static p_id_t *pidlist = NULL; static int maxtrap = 0; # endif # if !defined (NOJOB) || defined (JOBTEST) int i, n, sig; # endif sigblk_t old; wait_pid_t w; p_id_t tmp; int ret; # ifdef SIGCHLD suspendsignal(SIGCHLD, NULL, &old); # else suspendsignal(0, NULL, &old); # endif for (;;) { # ifndef JOBTEST tmp = (pid < (p_id_t)0) ? Xwait3(&w, opt, NULL) : Xwait4(pid, &w, opt, NULL); # else /* JOBTEST */ tmp = Xwait3(&w, opt, NULL); if (pid >= (p_id_t)0 && tmp >= (p_id_t)0 && pid != tmp) { if ((n = searchjob(tmp, &i)) < 0) continue; sig = joblist[n].stats[i]; joblist[n].stats[i] = getwaitsig(w); # if defined (SIGCONT) && (defined (SIGTTIN) || defined (SIGTTOU)) if (sig == joblist[n].stats[i]) sig = 0; # ifdef SIGTTIN else if (joblist[n].stats[i] == SIGTTIN) /*EMPTY*/; # endif # ifdef SIGTTOU else if (joblist[n].stats[i] == SIGTTOU) /*EMPTY*/; # endif else sig = 0; if (sig) { usleep(100000L); VOID_C kill(tmp, SIGCONT); } # endif /* SIGCONT && (SIGTTIN || SIGTTOU) */ continue; } # endif /* JOBTEST */ if (tmp >= (p_id_t)0 || errno != EINTR) break; } # if !defined (NOJOB) || defined (SYSV) if (pid >= (p_id_t)0) { if (tmp < (p_id_t)0 && errno == ECHILD) { while (maxtrap-- > 0) if (pid == pidlist[maxtrap]) { tmp = pidlist[maxtrap]; w = waitlist[maxtrap]; break; } } Xfree(waitlist); waitlist = NULL; Xfree(pidlist); pidlist = NULL; maxtrap = 0; } else if (tmp >= (p_id_t)0) { waitlist = (wait_pid_t *)Xrealloc(waitlist, (maxtrap + 1) * sizeof(wait_pid_t)); pidlist = (p_id_t *)Xrealloc(pidlist, (maxtrap + 1) * sizeof(p_id_t)); pidlist[maxtrap] = tmp; waitlist[maxtrap] = w; maxtrap++; } # endif /* !NOJOB || SYSV */ resumesignal(0, &old); if (!tmp) return(0); else if (tmp < (p_id_t)0) return(-1); ret = (pid < (p_id_t)0 || tmp == pid) ? 1 : 0; if (wp) *wp = w; # ifndef NOJOB if ((n = searchjob(tmp, &i)) < 0) return(ret); sig = getwaitsig(w); if (sig == joblist[n].stats[i]) return(ret); joblist[n].stats[i] = sig; if (pid == tmp || i < joblist[n].npipe || !WIFSTOPPED(w)) /*EMPTY*/; else if (!fp) /*EMPTY*/; else if (jobok && interactive && !nottyout) dispjob(n, fp); # endif return(ret); } # if !defined (NOJOB) && defined (DEP_PTY) && defined (CYGWIN) static VOID NEAR addmychild(pid) p_id_t pid; { int n; n = 0; if (mychildren) while (mychildren[n] >= (p_id_t)0) n++; mychildren = (p_id_t *)Xrealloc(mychildren, (n + 2) * sizeof(p_id_t)); mychildren[n++] = pid; mychildren[n] = (p_id_t)-1; } # endif /* !NOJOB && DEP_PTY && CYGWIN */ static VOID NEAR setstopsig(valid) int valid; { sigcst_t func; int i; for (i = 0; signallist[i].sig >= 0; i++) { func = (valid) ? SIG_DFL : (sigcst_t)(signallist[i].func); if ((signallist[i].flags & TR_STAT) == TR_STOP) { if (valid < 0) func = SIG_IGN; } else if (!(signallist[i].flags & TR_BLOCK)) continue; VOID_C signal2(signallist[i].sig, func); } } /*ARGSUSED*/ static p_id_t NEAR makechild(tty, ppid) int tty; p_id_t ppid; { # ifdef DEBUG extern VOID (*__free_hook) __P_((VOID_P)); extern VOID_P (*__malloc_hook) __P_((ALLOC_T)); extern VOID_P (*__realloc_hook) __P_((VOID_P, ALLOC_T)); # endif sigmask_t mask, omask; p_id_t pid; int i, stop; Xsigfillset(mask); Xsigblock(omask, mask); if (!(pid = Xfork())) { # ifdef DEBUG __free_hook = NULL; __malloc_hook = NULL; __realloc_hook = NULL; # endif memcpy((char *)&omask, (char *)&oldsigmask, sizeof(sigmask_t)); # ifdef SIGCHLD Xsigdelset(omask, SIGCHLD); # endif mypid = getpid(); stop = -1; # ifdef NOJOB if (loginshell) stop = 0; # else if (jobok) stop = (tty && childpgrp != orgpgrp) ? 1 : 0; # endif setstopsig(stop); } Xsigsetmask(omask); if (pid < (p_id_t)0) return(pid); # ifndef NOJOB if (childpgrp < (p_id_t)0) childpgrp = (ppid >= (p_id_t)0) ? ppid : (pid) ? pid : mypid; if (pid) { if (jobok) VOID_C setpgroup(pid, childpgrp); if (tty && ttypgrp >= (p_id_t)0) ttypgrp = childpgrp; # if defined (DEP_PTY) && defined (CYGWIN) if (parentfd >= 0) addmychild(pid); # endif } else { if (jobok && setpgroup(mypid, childpgrp) < 0) { doperror(NULL, "fatal error"); prepareexit(-1); Xexit(RET_FATALERR); } if (tty) VOID_C gettermio(childpgrp, jobok); # if defined (DEP_PTY) && defined (CYGWIN) Xfree(mychildren); mychildren = NULL; # endif } # endif /* !NOJOB */ if (!pid) for (i = 0; shellfunc[i].ident; i++) nownstree(shellfunc[i].func); return(pid); } int waitchild(pid, trp) p_id_t pid; syntaxtree *trp; { # ifndef NOJOB int n; # endif wait_pid_t w; int ret; if (trapok >= 0) trapok = 1; sigconted = 0; for (;;) { if (interrupted) { if (trapok >= 0) trapok = 0; # ifdef FD checkscreen(-1, -1); # endif return(RET_INTR); } if ((ret = waitjob(pid, &w, WUNTRACED)) < 0) break; if (!ret) continue; if (!WIFSTOPPED(w)) break; ret = WSTOPSIG(w); if (sigconted) { sigconted = 0; # ifdef SIGSTOP if (ret == SIGSTOP) continue; # endif } # ifdef NOJOB # ifdef SIGCONT if (loginshell) VOID_C kill(pid, SIGCONT); # endif # else /* !NOJOB */ # ifdef BASHBUG /* bash cannot be suspended with +m mode */ if (!jobok) continue; # endif if (mypid != orgpgrp) continue; if (trapok >= 0) trapok = 0; VOID_C gettermio(orgpgrp, jobok); # ifdef FD checkscreen(-1, -1); # endif n = stackjob(pid, ret, -1, trp); setlastjob(n); breaklevel = loopdepth; stopped = 1; if (!jobok) return(RET_SUCCESS); Xfree(joblist[n].tty); savetermio(ttyio, &(joblist[n].tty), NULL); if (interactive && !nottyout) { stdiomode(); dispjob(n, Xstderr); } return(RET_SUCCESS); # endif /* !NOJOB */ } if (trapok >= 0) trapok = 0; # ifndef NOJOB if (childpgrp >= (p_id_t)0 && pid != childpgrp) /*EMPTY*/; else if (mypid == orgpgrp) { VOID_C gettermio(orgpgrp, jobok); # ifdef FD checkscreen(-1, -1); # endif childpgrp = (p_id_t)-1; } # endif /* !NOJOB */ if (ret < 0) { if (!trp && errno == ECHILD) ret = errno = 0; } else if (WIFSIGNALED(w)) { ret = WTERMSIG(w); # ifndef NOJOB if ((n = searchjob(pid, NULL)) >= 0) Xkillpg(joblist[n].pids[0], ret); # endif # ifdef SIGINT if (ret == SIGINT) interrupted = 1; else # endif # if defined (SIGPIPE) && !defined (PSIGNALSTYLE) if (ret == SIGPIPE) /*EMPTY*/; else # endif if (!nottyout) { if (!interactive && argvar && argvar[0]) VOID_C Xfprintf(Xstderr, "%k: %id ", argvar[0], pid); dispsignal(ret, 0, Xstderr); VOID_C fputnl(Xstderr); } ret += 128; } else ret = (WEXITSTATUS(w) & 0377); if (ret < 0) return(-1); # ifndef NOJOB if ((n = searchjob(pid, NULL)) >= 0 && statjob(n) < 0) freejob(n); # endif return((int)ret); } #endif /* !MSDOS */ static VOID NEAR safermtmpfile(file) CONST char *file; { int duperrno; duperrno = errno; rmtmpfile(file); errno = duperrno; } VOID setshflag(n, val) int n, val; { #if defined (FD) && !defined (_NOEDITMODE) CONST char *cp; #endif *(shflaglist[n].var) = val; #if defined (FD) && !defined (_NOEDITMODE) if (shflaglist[n].var == &emacsmode) cp = "emacs"; else if (shflaglist[n].var == &vimode) cp = "vi"; else cp = NULL; if (cp) { emacsmode = vimode = 0; if (editmode && !strcmp(editmode, cp)) cp = NULL; /* * The stupid HP cc says that * ternary operator with NULL is const char *, * not to be converted to char *. */ if (!val) cp = (cp) ? NULL : nullstr; if (cp) { setenv2("FD_EDITMODE", cp, 0); editmode = getconstvar("FD_EDITMODE"); } } #endif /* FD && !_NOEDITMODE */ #ifdef DEP_PTY sendparent(TE_SETSHFLAG, n, val); #endif } static int NEAR getoption(argc, argv, isopt) int argc; char *CONST *argv; int isopt; { u_long flags; CONST char *arg; int i, j, com; #if defined (FD) && !defined (_NOEDITMODE) emacsmode = vimode = 0; if (editmode) { if (!strcmp(editmode, "emacs")) emacsmode = 1; else if (!strcmp(editmode, "vi")) vimode = 1; } #endif if (argc <= 1) return(1); arg = argv[1]; if (arg[0] != '-' && arg[0] != '+') return(1); else if (arg[1] == '-') return(2); com = 0; flags = (u_long)0; for (i = 1; arg[i]; i++) { if (isopt) { #ifdef FD if (fdmode) /*EMPTY*/; else #endif if (arg[i] == 'c' && !com && argc > 2) { com = 1; continue; } } else { if (arg[i] == 'o' && !com) { com = (arg[0] == '-') ? 1 : 2; continue; } } for (j = 0; j < FLAGSSIZ; j++) { if (!isopt && !(shflaglist[j].ident)) continue; if (arg[i] == shflaglist[j].letter) break; } if (j < FLAGSSIZ) flags |= ((u_long)1 << j); else if (arg[0] == '-') { execerror(argv, arg, ER_BADOPTIONS, 0); return(-1); } } for (j = 0; j < FLAGSSIZ; j++) { if (flags & (u_long)1) setshflag(j, (arg[0] == '-') ? 1 : 0); flags >>= 1; } return(com + 2); } static CONST opetable *NEAR getoperator(type) int type; { int i; for (i = 0; i < OPELISTSIZ; i++) if (type == opelist[i].op) return(&(opelist[i])); return(NULL); } #ifdef MINIMUMSHELL static shbuiltintable *NEAR getshbuiltin(ident) CONST char *ident; #else static shbuiltintable *NEAR getshbuiltin(ident, ignore, filter) CONST char *ident; int ignore, filter; #endif { int i; for (i = 0; i < SHBUILTINSIZ; i++) { #ifndef MINIMUMSHELL if (shbuiltinlist[i].flags & ignore) continue; if (filter && !(shbuiltinlist[i].flags & filter)) continue; #endif if (!strcommcmp(ident, shbuiltinlist[i].ident)) return(&(shbuiltinlist[i])); } return(NULL); } static shfunctable *NEAR getshfunc(ident) CONST char *ident; { int i; for (i = 0; shellfunc[i].ident; i++) { if (!strcommcmp(ident, shellfunc[i].ident)) return(&(shellfunc[i])); } return(NULL); } static ALLOC_T NEAR c_allocsize(n) int n; { ALLOC_T size; n++; for (size = BUFUNIT; size < n; size *= 2) /*EMPTY*/; return(size); } static int NEAR readchar(fd) int fd; { u_char ch; int n; if (trapok >= 0) trapok = 1; #ifdef USESIGACTION n = sureread(fd, &ch, sizeof(ch)); #else n = checkread(fd, &ch, sizeof(ch), 0); #endif if (n > 0) n = (int)ch; else if (!n) n = READ_EOF; if (trapok >= 0) trapok = 0; return(n); } /*ARGSUSED*/ static char *NEAR readline(fd, opt) int fd, opt; { char *cp; ALLOC_T i, size; int c; cp = c_realloc(NULL, 0, &size); for (i = 0; (c = readchar(fd)) != '\n'; i++) { if (c < 0) { Xfree(cp); return(NULL); } if (c == READ_EOF) { if (i) break; Xfree(cp); return(vnullstr); } cp = c_realloc(cp, i, &size); cp[i] = c; } #ifndef USECRNL if (opt != 'N') /*EMPTY*/; else #endif if (c == '\n' && i > 0 && cp[i - 1] == '\r') i--; cp[i++] = '\0'; return(Xrealloc(cp, i)); } static char *NEAR readfile(fd, lenp) int fd; ALLOC_T *lenp; { char *cp; ALLOC_T i, size; int c; cp = c_realloc(NULL, 0, &size); for (i = 0; (c = readchar(fd)) != READ_EOF; i++) { if (c < 0) { Xfree(cp); return(NULL); } #ifdef USECRNL if (c == '\n' && i > 0 && cp[i - 1] == '\r') i--; #endif cp = c_realloc(cp, i, &size); cp[i] = c; } if (lenp) *lenp = i; cp[i++] = '\0'; return(Xrealloc(cp, i)); } char *evalvararg(arg, flags, noexit) char *arg; int flags, noexit; { char *tmp; if ((tmp = evalarg(arg, flags))) return(tmp); #if defined (BASHSTYLE) && defined (STRICTPOSIX) if (!noexit) noexit = -1; #endif if (*arg) execerror(NULL, arg, ER_BADSUBST, noexit); return(NULL); } static heredoc_t *NEAR newheredoc(eof, path, fd, flags) char *eof, *path; int fd, flags; { heredoc_t *new; new = (heredoc_t *)Xmalloc(sizeof(heredoc_t)); new -> eof = eof; new -> filename = path; new -> buf = NULL; new -> fd = fd; #ifndef USEFAKEPIPE new -> pipein = (p_id_t)-1; #endif new -> flags = flags; return(new); } VOID freeheredoc(hdp, nown) heredoc_t *hdp; int nown; { if (!hdp) return; Xfree(hdp -> eof); safeclose(hdp -> fd); if (hdp -> filename) { if (!nown) safermtmpfile(hdp -> filename); Xfree(hdp -> filename); } Xfree(hdp -> buf); Xfree(hdp); } static redirectlist *NEAR newrlist(fd, filename, type, next) int fd; char *filename; int type; redirectlist *next; { redirectlist *new; new = (redirectlist *)Xmalloc(sizeof(redirectlist)); new -> fd = fd; new -> filename = filename; new -> type = (u_short)type; new -> new = new -> old = -1; #ifdef DEP_DOSDRIVE new -> fakepipe = NULL; new -> dosfd = -1; #endif new -> next = next; return(new); } VOID freerlist(rp, nown) redirectlist *rp; int nown; { if (!rp) return; freerlist(rp -> next, nown); if (rp -> type & MD_HEREDOC) freeheredoc((heredoc_t *)(rp -> filename), nown); else Xfree(rp -> filename); Xfree(rp); } static command_t *NEAR newcomm() { command_t *new; new = (command_t *)Xmalloc(sizeof(command_t)); new -> hash = NULL; new -> argc = -1; new -> argv = NULL; new -> redp = NULL; new -> type = new -> id = 0; return(new); } VOID freecomm(comm, nown) command_t *comm; int nown; { int i; if (!comm) return; if (comm -> argv) { if (isstatement(comm)) freestree((syntaxtree *)(comm -> argv)); else for (i = 0; i <= comm -> argc; i++) Xfree(comm -> argv[i]); Xfree(comm -> argv); } if (comm -> redp) { closeredirect(comm -> redp); freerlist(comm -> redp, nown); } Xfree(comm); } syntaxtree *newstree(parent) syntaxtree *parent; { syntaxtree *new; new = (syntaxtree *)Xmalloc(sizeof(syntaxtree)); new -> comm = NULL; new -> parent = parent; new -> next = NULL; #ifndef MINIMUMSHELL new -> lineno = shlineno; #endif new -> type = OP_NONE; if (parent) { new -> cont = (parent -> cont & CN_INHR); new -> flags = 0; } else { new -> cont = 0; new -> flags = ST_TOP; } #ifdef DEP_FILECONV if (printf_defkanji) new -> flags |= ST_DEFKANJI; #endif return(new); } VOID freestree(trp) syntaxtree *trp; { #ifndef MINIMUMSHELL redirectlist *rp; #endif int duperrno; if (!trp) return; duperrno = errno; if (trp -> comm) { if (!(trp -> flags & ST_NODE)) freecomm(trp -> comm, trp -> flags & ST_NOWN); else { freestree((syntaxtree *)(trp -> comm)); Xfree(trp -> comm); } trp -> comm = NULL; } if (trp -> next) { #ifndef MINIMUMSHELL if (trp -> flags & ST_BUSY) { rp = (redirectlist *)(trp -> next); Xfree(rp -> filename); freestree((syntaxtree *)(rp -> next)); Xfree(rp -> next); } else #endif if (!(trp -> cont & (CN_QUOT | CN_ESCAPE))) freestree(trp -> next); else Xfree(((redirectlist *)(trp -> next)) -> filename); Xfree(trp -> next); trp -> next = NULL; } trp -> type = OP_NONE; trp -> cont = trp -> flags = 0; errno = duperrno; } static syntaxtree *NEAR eldeststree(trp) syntaxtree *trp; { syntaxtree *tmptr; while (trp) { tmptr = getparent(trp); if (!(trp -> flags & ST_NEXT)) return(tmptr); trp = tmptr; } return(NULL); } syntaxtree *parentstree(trp) syntaxtree *trp; { while ((trp = eldeststree(trp))) if (!(trp -> flags & ST_NODE) && isstatement(trp -> comm)) return(trp); return(NULL); } static syntaxtree *NEAR childstree(trp, n) syntaxtree *trp; int n; { syntaxtree *new; new = newstree(trp); if (!(trp -> comm)) trp -> comm = newcomm(); (trp -> comm) -> argc = 0; (trp -> comm) -> argv = (char **)new; (trp -> comm) -> type = CT_STATEMENT; (trp -> comm) -> id = n; trp -> type = OP_NONE; trp -> flags &= ~ST_NODE; return(new); } static syntaxtree *NEAR skipfuncbody(trp) syntaxtree *trp; { syntaxtree *tmptr; if (trp -> flags & ST_BUSY) return(trp); tmptr = statementcheck(trp -> next, SM_STATEMENT); if (getstatid(tmptr) == SM_LPAREN) trp = trp -> next; return(trp); } static syntaxtree *NEAR insertstree(trp, parent, type) syntaxtree *trp, *parent; int type; { syntaxtree *new, *tmptr; CONST opetable *opep; int l1, l2; l1 = l2 = 0; if ((opep = getoperator(type))) l1 = opep -> level; if (parent && (opep = getoperator(parent -> type))) l2 = opep -> level; if (!l1) /*EMPTY*/; else if (trp -> flags & ST_NODE) /*EMPTY*/; #ifndef BASHSTYLE /* bash does not allow the format like as "foo | ; bar" */ else if (parent && isoppipe(parent) && l1 > l2) /*EMPTY*/; #endif #ifndef MINIMUMSHELL else if (type == OP_NOT && (!l2 || l1 < l2)) /*EMPTY*/; #endif else if (!hascomm(trp)) { if (type != OP_FG) { syntaxerrno = ER_UNEXPTOK; return(trp); } #ifdef BASHSTYLE /* bash does not allow a null before ";" */ else { syntaxerrno = ER_UNEXPNL; return(trp); } #endif } /* && or || */ if (l1 == 3 && l2 == 3) l2--; if (!l1 || !l2) /*EMPTY*/; else if (l1 < l2) { new = newstree(trp); new -> comm = trp -> comm; new -> next = trp -> next; #ifndef MINIMUMSHELL new -> lineno = trp -> lineno; #endif new -> type = trp -> type; new -> cont = trp -> cont; if (trp -> flags & ST_NODE) { new -> flags = trp -> flags; trp -> flags = 0; } trp -> comm = (command_t *)new; trp -> type = OP_NONE; trp -> flags |= ST_NODE; trp = new; } else if (l1 > l2) { if (!(tmptr = eldeststree(parent))) { while (hasparent(trp)) trp = trp -> parent; new = newstree(trp); new -> comm = trp -> comm; new -> next = trp -> next; #ifndef MINIMUMSHELL new -> lineno = trp -> lineno; #endif new -> type = trp -> type; new -> cont = trp -> cont; new -> flags = trp -> flags; if (trp -> next) (trp -> next) -> parent = new; trp -> comm = (command_t *)new; trp -> type = type; trp -> cont = 0; trp -> flags = ST_NODE; } else if (tmptr -> flags & ST_NODE) trp = insertstree(tmptr, eldeststree(tmptr), type); else if (!isstatement(tmptr -> comm)) trp = insertstree(trp, tmptr, type); else { new = newstree(tmptr); new -> comm = (command_t *)((tmptr -> comm) -> argv); new -> next = trp -> next; (tmptr -> comm) -> argv = (char **)new; trp = new; trp -> type = type; trp -> cont = 0; trp -> flags = ST_NODE; } } return(trp); } static syntaxtree *NEAR linkstree(trp, type) syntaxtree *trp; int type; { syntaxtree *new, *tmptr; int cont; cont = ((trp -> cont) & CN_INHR); #ifndef MINIMUMSHELL trp -> lineno = shlineno; #endif if (trp && isstatement(trp -> comm) && (trp -> comm) -> id == SM_STATEMENT && (tmptr = statementbody(trp)) && getstatid(tmptr) == SM_LPAREN) trp = getparent(trp); tmptr = (trp -> flags & ST_NEXT) ? getparent(trp) : NULL; trp = insertstree(trp, tmptr, type); trp = skipfuncbody(trp); new = trp -> next = newstree(trp); new -> cont = cont; new -> flags = ST_NEXT; trp -> type = type; return(new); } #if !MSDOS || defined (DEP_PTY) || !defined (USEFAKEPIPE) static VOID NEAR nownstree(trp) syntaxtree *trp; { if (!trp) return; if (!(trp -> comm)) /*EMPTY*/; else if (trp -> flags & ST_NODE) nownstree((syntaxtree *)(trp -> comm)); else if (isstatement(trp -> comm)) nownstree(statementbody(trp)); trp -> flags |= ST_NOWN; nownstree(trp -> next); } #endif static int NEAR evalfiledesc(s) CONST char *s; { int i, n; i = 0; if ((n = getnum(s, &i)) < 0) return(-1); i = Xgetdtablesize(); if (n > i) n = i; return(n); } static int NEAR redmode(type) int type; { int mode; mode = O_TEXT; if (type & MD_READ) { if (type & MD_WRITE) { mode |= (O_RDWR | O_CREAT); #ifndef MINIMUMSHELL if (noclobber && !(type & MD_FORCED)) mode |= O_EXCL; #endif } else mode |= O_RDONLY; if (type & MD_APPEND) mode |= O_APPEND; } else { mode |= (O_WRONLY | O_CREAT); if (type & MD_APPEND) mode |= O_APPEND; else { mode |= O_TRUNC; #ifndef MINIMUMSHELL if (noclobber && !(type & MD_FORCED)) mode |= O_EXCL; #endif } } return(mode); } static int NEAR cancelredirect(rp) redirectlist *rp; { if (!rp) return(0); #ifdef DEP_DOSDRIVE if (rp -> fakepipe) { errno = EBADF; doperror(NULL, rp -> filename); return(-1); } #endif if (cancelredirect(rp -> next) < 0) return(-1); if ((rp -> type & MD_WITHERR) && rp -> fd != STDOUT_FILENO) { safeclose(rp -> fd); rp -> fd = STDOUT_FILENO; } if (rp -> old >= 0) safeclose(rp -> old); if (rp -> new >= 0) { if (rp -> type & MD_HEREDOC) VOID_C closepipe2(rp -> new, rp -> fd); else if (!(rp -> type & MD_FILEDESC)) safeclose(rp -> new); } #ifdef DEP_DOSDRIVE VOID_C closepseudofd(rp); #endif rp -> old = rp -> new = -1; return(0); } static VOID NEAR closeredirect(rp) redirectlist *rp; { #ifndef USEFAKEPIPE heredoc_t *hdp; #endif if (!rp) return; closeredirect(rp -> next); if (rp -> type & MD_DUPL) return; if ((rp -> type & MD_WITHERR) && rp -> fd != STDOUT_FILENO) { if (rp -> fd != STDERR_FILENO) { Xdup2(rp -> fd, STDERR_FILENO); safeclose(rp -> fd); } rp -> fd = STDOUT_FILENO; } if (rp -> old >= 0) { Xdup2(rp -> old, rp -> fd); safeclose(rp -> old); } if (rp -> new >= 0) { if (rp -> type & MD_HEREDOC) { #ifndef USEFAKEPIPE hdp = (heredoc_t *)(rp -> filename); if (hdp -> pipein >= (p_id_t)0) VOID_C waitchild(hdp -> pipein, NULL); #endif VOID_C closepipe2(rp -> new, -1); } else if (!(rp -> type & MD_FILEDESC)) safeclose(rp -> new); } #ifdef DEP_DOSDRIVE VOID_C closepseudofd(rp); #endif rp -> old = rp -> new = -1; } static heredoc_t *NEAR searchheredoc(trp, rm) syntaxtree *trp; int rm; { redirectlist *rp; heredoc_t *hdp, *hit; if (!trp) return(NULL); if (rm && (trp -> flags & ST_NOWN)) return(NULL); if (!(trp -> comm)) /*EMPTY*/; else if (trp -> flags & ST_NODE) { if ((hdp = searchheredoc((syntaxtree *)(trp -> comm), rm))) return(hdp); } else { if (isstatement(trp -> comm)) { if ((hdp = searchheredoc(statementbody(trp), rm))) return(hdp); } hit = NULL; if (!rm && !(trp -> cont & CN_HDOC)) /*EMPTY*/; else for (rp = (trp -> comm) -> redp; rp; rp = rp -> next) { if (!(rp -> type & MD_HEREDOC)) continue; if (!(hdp = (heredoc_t *)(rp -> filename))) continue; if (!rm) { if (hdp -> fd >= 0) hit = hdp; } else if (hdp -> filename) { safermtmpfile(hdp -> filename); Xfree(hdp -> filename); hdp -> filename = NULL; } } if (hit) return(hit); } if ((hdp = searchheredoc(trp -> next, rm))) return(hdp); if (!rm) trp -> cont &= ~CN_HDOC; return(NULL); } static int NEAR saveheredoc(s, trp) CONST char *s; syntaxtree *trp; { heredoc_t *hdp; char *cp; int i, len, ret; while (hasparent(trp)) trp = trp -> parent; if (!(hdp = searchheredoc(trp, 0))) return(0); cp = hdp -> buf; hdp -> buf = NULL; if (!cp) cp = Xstrdup(s); else { len = strlen(cp); if (s) { cp = Xrealloc(cp, len + strlen(s) + 1); Xstrcpy(&(cp[len]), s); } } if (cp) { if (!(hdp -> flags & HD_QUOTED)) { for (i = 0; cp[i]; i++) { if (cp[i] == PESCAPE) { if (!cp[i + 1]) break; i++; } else if (iswchar(cp, i)) i++; } if (cp[i]) { cp[i] = '\0'; if (s) { hdp -> buf = cp; return(1); } } } i = 0; if (hdp -> flags & HD_IGNORETAB) while (cp[i] == '\t') i++; if (!strcmp(&(cp[i]), hdp -> eof)) { Xfree(cp); s = cp = NULL; } } #ifdef FAKEUNINIT else i = 0; /* fake for -Wuninitialized */ #endif ret = 1; if (cp) { #ifdef FD demacroarg(&cp); #endif len = strlen(cp); cp[len++] = '\n'; len -= i; if (surewrite(hdp -> fd, &(cp[i]), len) < 0) ret = -1; Xfree(cp); } if (!s) { safeclose(hdp -> fd); hdp -> fd = -1; searchheredoc(trp, 0); } return(ret); } static int NEAR openheredoc(hdp, old) heredoc_t *hdp; int old; { char *cp, *buf; p_id_t pipein; int fd, fdin, ret; fdin = newdup(Xopen(hdp -> filename, O_BINARY | O_RDONLY, 0666)); if (fdin < 0) return(-1); if ((fd = openpipe2(&pipein, old, 1, interactive_io, mypid)) < 0) { safeclose(fdin); return(-1); } #ifdef DJGPP setmode(STDOUT_FILENO, O_TEXT); #endif if (pipein > (p_id_t)0) { #ifndef USEFAKEPIPE hdp -> pipein = pipein; #endif safeclose(fdin); return(fd); } ret = RET_SUCCESS; while ((buf = readline(fdin, '\0')) != vnullstr) { if (!buf) { VOID_C closepipe2(fd, -1); safeclose(fdin); return(-1); } if (!(hdp -> flags & HD_QUOTED) && ret == RET_SUCCESS) { cp = evalvararg(buf, EA_STRIPESCAPE | EA_NOEVALQ | EA_NOEVALDQ | EA_BACKQ, 1); if (!cp) ret = RET_FAIL; Xfree(buf); buf = cp; } if (ret == RET_SUCCESS) { puts2(buf); putnl(); } Xfree(buf); } safeclose(fdin); VOID_C Xfflush(Xstdout); if ((fd = reopenpipe(fd, ret)) < 0) return(-1); if (ret != RET_SUCCESS) { VOID_C closepipe2(fd, -1); return(seterrno(-1)); } return(fd); } #ifdef DEP_DOSDRIVE static int NEAR fdcopy(fdin, fdout) int fdin, fdout; { u_char ch; int n; for (;;) { if ((n = sureread(fdin, &ch, sizeof(ch))) <= 0) break; if (surewrite(fdout, &ch, sizeof(ch)) < 0) return(-1); } return(n); } static int NEAR openpseudofd(rp) redirectlist *rp; { # ifndef USEFAKEPIPE p_id_t pid; int fds[2]; # endif char pfile[MAXPATHLEN]; int fd; if (!(rp -> type & MD_RDWR) || (rp -> type & MD_RDWR) == MD_RDWR) return(-1); # ifndef USEFAKEPIPE if (pipe(fds) < 0) /*EMPTY*/; else if ((pid = makechild(0, mypid)) < (p_id_t)0) { safeclose(fds[0]); safeclose(fds[1]); return(-1); } else if (pid) { safeclose(rp -> new); if (rp -> type & MD_READ) { safeclose(fds[1]); rp -> new = newdup(fds[0]); } else { safeclose(fds[0]); rp -> new = newdup(fds[1]); } return(0); } else { if (rp -> type & MD_READ) { safeclose(fds[0]); fds[1] = newdup(fds[1]); fdcopy(rp -> new, fds[1]); safeclose(rp -> new); safeclose(fds[1]); } else { safeclose(fds[1]); fds[0] = newdup(fds[0]); fdcopy(fds[0], rp -> new); safeclose(rp -> new); safeclose(fds[0]); } prepareexit(1); Xexit(RET_SUCCESS); } # endif /* !USEFAKEPIPE */ if ((fd = newdup(mktmpfile(pfile))) < 0) return(-1); if (rp -> type & MD_WRITE) rp -> dosfd = rp -> new; else { fdcopy(rp -> new, fd); safeclose(rp -> new); safeclose(fd); fd = newdup(Xopen(pfile, O_BINARY | O_RDONLY, 0666)); if (fd < 0) { safermtmpfile(pfile); rp -> fakepipe = NULL; return(-1); } } rp -> new = fd; rp -> fakepipe = Xstrdup(pfile); return(0); } static int NEAR closepseudofd(rp) redirectlist *rp; { int fd; if (!(rp -> fakepipe)) return(0); if (rp -> dosfd >= 0 && rp -> type & MD_WRITE) { fd = Xopen(rp -> fakepipe, O_BINARY | O_RDONLY, 0666); if (fd >= 0) { fdcopy(fd, rp -> dosfd); safeclose(fd); } safeclose(rp -> dosfd); } safermtmpfile(rp -> fakepipe); Xfree(rp -> fakepipe); rp -> fakepipe = NULL; rp -> dosfd = -1; return(0); } #endif /* DEP_DOSDRIVE */ #ifdef WITHSOCKREDIR static int NEAR parsesocket(s, addrp, portp) CONST char *s; char **addrp; int *portp; { urlhost_t host; char *cp; int n, scheme; if ((n = urlparse(s, schemelist, &cp, &scheme, 0)) <= 0) return(0); if (s[n] == '/') n++; if (s[n]) { Xfree(cp); return(0); } n = urlgethost(cp, &host); Xfree(cp); if (n < 0) return(-1); if (host.user || host.pass) n = -1; switch (scheme) { case TYPE_CONNECT: if (!(host.host)) n = -1; if (host.port < 0) n = -1; break; case TYPE_ACCEPT: case TYPE_BIND: if (host.port < 0) host.port = 0; break; default: n = -1; break; } if (n < 0) { urlfreehost(&host); return(seterrno(EINVAL)); } *addrp = host.host; *portp = host.port; return(scheme); } #endif /* WITHSOCKREDIR */ static redirectlist *NEAR doredirect(rp) redirectlist *rp; { #ifdef WITHSOCKREDIR char *addr; int s, port, scheme, opt; #endif redirectlist *errp; char *tmp; int n, type; #ifdef FD rp -> type &= ~MD_REST; #endif if (rp -> next) { if ((errp = doredirect(rp -> next))) return(errp); #ifdef FD if (((rp -> next) -> type) & MD_REST) rp -> type |= MD_REST; #endif } type = rp -> type; if (!(rp -> filename)) tmp = NULL; else if (type & MD_HEREDOC) tmp = rp -> filename; else { tmp = evalvararg(rp -> filename, EA_BACKQ | EA_STRIPQLATER, 0); if (!tmp) { errno = -1; return(rp); } else if ((type & MD_FILEDESC) && tmp[0] == '-' && !tmp[1]) { Xfree(tmp); tmp = NULL; type &= ~MD_FILEDESC; } #ifdef FD else if ((n = replacearg(&tmp)) < 0) { Xfree(tmp); return(rp); } else if (n) rp -> type |= MD_REST; #endif } if (!tmp) /*EMPTY*/; else if (type & MD_HEREDOC) { if ((rp -> new = openheredoc((heredoc_t *)tmp, rp -> fd)) < 0) return(rp); } else if (type & MD_FILEDESC) { rp -> new = evalfiledesc(tmp); Xfree(tmp); if (rp -> new < 0) { errno = EBADF; return(rp); } if (isvalidfd(rp -> new) < 0) { rp -> new = -1; #ifdef BASHSTYLE /* bash treats ineffective descriptor as error */ errno = EBADF; return(rp); #else rp -> old = -1; rp -> type = 0; return(NULL); #endif } } else if (restricted && (type & MD_WRITE)) { Xfree(tmp); errno = 0; return(rp); } else { #ifdef WITHSOCKREDIR # ifdef FAKEUNINIT addr = NULL; port = -1; # endif if ((scheme = parsesocket(tmp, &addr, &port))) { if (scheme < 0) return(rp); opt = SCK_LOWDELAY; switch (scheme) { case TYPE_CONNECT: s = sockconnect(addr, port, 0, opt); break; case TYPE_ACCEPT: s = sockbind(addr, port, opt | SCK_REUSEADDR); if (s >= 0) s = sockaccept(s, opt); break; case TYPE_BIND: s = sockbind(addr, port, opt); break; default: s = seterrno(EINVAL); break; } rp -> new = s; Xfree(addr); } else #endif /* WITHSOCKREDIR */ rp -> new = Kopen(tmp, redmode(type), 0666); rp -> new = newdup(rp -> new); Xfree(tmp); if (rp -> new < 0) return(rp); #if MSDOS && !defined (LSI_C) # ifdef DJGPP if (isatty(rp -> new)) /*EMPTY*/; else # endif setmode(rp -> new, O_BINARY); #endif /* MSDOS && !LSI_C */ } #if !MSDOS if (rp -> new != STDIN_FILENO && rp -> new != STDOUT_FILENO && rp -> new != STDERR_FILENO) closeonexec(rp -> new); #endif if (isvalidfd(rp -> fd) < 0) rp -> old = -1; else if ((rp -> old = newdup(Xdup(rp -> fd))) < 0) return(rp); #if !MSDOS else if (rp -> old != STDIN_FILENO && rp -> old != STDOUT_FILENO && rp -> old != STDERR_FILENO) closeonexec(rp -> old); #endif if (rp -> new != rp -> fd) { if (rp -> new < 0) VOID_C Xclose(rp -> fd); else { #ifdef DEP_DOSDRIVE if (chkopenfd(rp -> new) == DEV_DOS) openpseudofd(rp); #endif if (Xdup2(rp -> new, rp -> fd) < 0) return(rp); } } if ((type & MD_WITHERR) && rp -> new != STDERR_FILENO && rp -> fd == STDOUT_FILENO) { if ((n = newdup(Xdup(STDERR_FILENO))) < 0 || Xdup2(rp -> new, STDERR_FILENO) < 0) { safeclose(n); return(rp); } rp -> fd = n; #if !MSDOS if (rp -> fd != STDIN_FILENO && rp -> fd != STDOUT_FILENO && rp -> fd != STDERR_FILENO) closeonexec(rp -> fd); #endif } return(NULL); } static heredoc_t *NEAR heredoc(eof, ignoretab) char *eof; int ignoretab; { char *cp, path[MAXPATHLEN]; int fd, flags; flags = (ignoretab) ? HD_IGNORETAB : 0; cp = Xstrdup(eof); if (stripquote(cp, EA_STRIPQ)) flags |= HD_QUOTED; #ifndef BASHSTYLE /* bash allows no variables as the EOF identifier */ Xfree(cp); if (!(cp = evalvararg(eof, EA_STRIPQLATER, 0))) { errno = -1; return(NULL); } #endif #ifdef FD demacroarg(&cp); #endif if ((fd = newdup(mktmpfile(path))) < 0) { Xfree(cp); return(NULL); } return(newheredoc(cp, Xstrdup(path), fd, flags)); } static int NEAR redirect(trp, from, to, type) syntaxtree *trp; int from; char *to; int type; { redirectlist *rp; char *cp; if (to && !*to) { syntaxerrno = ER_UNEXPTOK; return(-1); } if (!(type & MD_HEREDOC)) cp = Xstrdup(to); else { if (!(cp = (char *)heredoc(to, type & MD_APPEND))) { doperror(NULL, deftmpdir); return(-1); } trp -> cont |= CN_HDOC; } if (from < 0) from = (type & MD_READ) ? STDIN_FILENO : STDOUT_FILENO; if (!(trp -> comm)) trp -> comm = newcomm(); rp = newrlist(from, cp, type, (trp -> comm) -> redp); (trp -> comm) -> redp = rp; return(0); } #if !MSDOS /*ARGSUSED*/ VOID cmpmail(path, msg, mtimep) CONST char *path, *msg; time_t *mtimep; { struct stat st; if (!path || Xstat(path, &st) < 0) return; if (st.st_size > 0 && *mtimep && st.st_mtime > *mtimep) { # ifdef MINIMUMSHELL errputs("you have mail", 1); # else kanjifputs((msg) ? msg : "you have mail", Xstderr); VOID_C fputnl(Xstderr); # endif } *mtimep = st.st_mtime; } # ifdef MINIMUMSHELL static VOID NEAR checkmail(reset) int reset; { static time_t mtime = 0; if (reset) mtime = 0; else cmpmail(getconstvar(ENVMAIL), NULL, &mtime); } # endif /* !MINIMUMSHELL */ #endif /* !MSDOS */ int identcheck(ident, delim) CONST char *ident; int delim; { int i; if (!ident || !*ident || !isidentchar(*ident)) return(0); for (i = 1; ident[i]; i++) if (!isidentchar2(ident[i])) break; return((ident[i] == delim) ? i : ((ident[i]) ? 0 : -i)); } static int NEAR searchvar(var, ident, len, c) char *CONST *var; CONST char *ident; int len, c; { int i; if (!var) return(-1); for (i = 0; var[i]; i++) if (!strnenvcmp(ident, var[i], len) && var[i][len] == c) return(i); return(-1); } static char *NEAR searchvar2(max, var, ident, len) int max; CONST char **var, *ident; int len; { int i; if (!var) return(NULL); for (i = 0; i < max; i++) { if (!var[i]) continue; if (!strnenvcmp(ident, var[i], len) && !var[i][len]) return((char *)var[i]); #ifdef FD if (!strnenvcmp(var[i], FDENV, FDESIZ) && !strnenvcmp(ident, &(var[i][FDESIZ]), len) && !var[i][FDESIZ + len]) return((char *)&(var[i][FDESIZ])); #endif } return(NULL); } static char **NEAR expandvar(var, ident, len) char **var; CONST char *ident; int len; { int i; if (searchvar(var, ident, len, '\0') >= 0) return(var); i = countvar(var); var = (char **)Xrealloc(var, (i + 2) * sizeof(char *)); var[i] = Xstrndup(ident, len); var[++i] = NULL; return(var); } static char *NEAR getvar(var, ident, len) char *CONST *var; CONST char *ident; int len; { int i; if (len < 0) len = strlen(ident); if ((i = searchvar(var, ident, len, '=')) < 0) return(NULL); return(&(var[i][len + 1])); } char *getshellvar(ident, len) CONST char *ident; int len; { return(getvar(shellvar, ident, len)); } static char **NEAR putvar(var, s, len) char **var, *s; int len; { #if MSDOS char *cp; #endif u_long size; int i, export; export = (var == exportvar); i = searchvar(var, s, len, '='); if (i >= 0) { if (export) { size = (u_long)strlen(var[i]) + 1; if (size >= exportsize) exportsize = (u_long)0; else exportsize -= size; } Xfree(var[i]); if (!s[len]) { for (; var[i + 1]; i++) var[i] = var[i + 1]; var[i] = NULL; return(var); } } else if (!s[len]) return(var); else { i = countvar(var); var = (char **)Xrealloc(var, (i + 2) * sizeof(char *)); var[i + 1] = NULL; } var[i] = s; #ifdef ENVNOCASE Xstrntoupper(s, len); #endif if (export) { exportsize += (u_long)strlen(s) + 1; #if MSDOS if (constequal(s, ENVPATH, len)) { cp = &(s[len + 1]); if (_dospath(cp)) cp += 2; for (; *cp; cp++) { if (*cp == PATHDELIM) { *cp = ';'; if (_dospath(cp + 1)) cp += 2; } # ifndef BSPATHDELIM else if (*cp == _SC_) *cp = '\\'; # endif } } #endif /* MSDOS */ } return(var); } static int NEAR checkprimal(s, len) CONST char *s; int len; { char *cp; if ((cp = searchvar2(PRIMALVARSIZ, primalvar, s, len))) { execerror(NULL, cp, ER_CANNOTUNSET, 0); return(seterrno(EPERM)); } return(0); } static int NEAR checkrestrict(s, len) CONST char *s; int len; { char *cp; if (!restricted) return(0); if ((cp = searchvar2(RESTRICTVARSIZ, restrictvar, s, len))) { execerror(NULL, cp, ER_RESTRICTED, 0); return(seterrno(EPERM)); } return(0); } static int NEAR checkronly(s, len) CONST char *s; int len; { int i; if ((i = searchvar(ronlylist, s, len, '\0')) >= 0) { execerror(NULL, ronlylist[i], ER_ISREADONLY, 0); return(seterrno(EACCES)); } return(0); } static int NEAR _putshellvar(s, len) char *s; int len; { #if !MSDOS && defined (FD) keyseq_t *keymap; CONST char *term; #endif #if (!MSDOS && (!defined (MINIMUMSHELL) || defined (FD))) \ || !defined (NOPOSIXUTIL) \ || !defined (FD) \ && (defined (DEP_URLPATH) || defined (DEP_FTPPATH) || defined (DEP_HTTPPATH)) CONST char *cp; #endif #if (!MSDOS && (!defined (MINIMUMSHELL) || defined (FD))) \ || !defined (NOPOSIXUTIL) \ || !defined (FD) \ && (defined (DEP_URLPATH) || defined (DEP_FTPPATH) || defined (DEP_HTTPPATH)) cp = &(s[len + 1]); #endif if (checkrestrict(s, len) < 0) return(-1); #ifdef BASHSTYLE /* bash distinguishes the same named function and variable */ else if (checkronly(s, len) < 0) return(-1); #else else if (unsetshfunc(s, len) < 0) return(-1); #endif #ifndef _NOUSEHASH else if (constequal(s, ENVPATH, len)) VOID_C searchhash(NULL, NULL, NULL); #endif #if !MSDOS # ifdef MINIMUMSHELL else if (constequal(s, ENVMAIL, len)) checkmail(1); # else /* !MINIMUMSHELL */ else if (!strnenvcmp(s, ENVMAIL, strsize(ENVMAIL))) { if (len == strsize(ENVMAIL)) { if (!getconstvar(ENVMAILPATH)) replacemailpath(cp, 0); } else if (constequal(s, ENVMAILPATH, len)) replacemailpath(cp, 1); else if (constequal(s, ENVMAILCHECK, len)) { if ((mailcheck = isnumeric(cp)) < 0) mailcheck = 0; } } # endif /* !MINIMUMSHELL */ # ifdef FD else if (constequal(s, ENVTERM, len)) { keymap = copykeyseq(NULL); regetterment(cp, interactive); if (dumbterm > 1 && (!shellmode || exit_status < 0)) { if (!(term = getconstvar(ENVTERM))) term = nullstr; regetterment(term, interactive); execerror(NULL, cp, ER_INVALTERMFD, 1); copykeyseq(keymap); freekeyseq(keymap); return(seterrno(EINVAL)); } freekeyseq(keymap); } # endif /* FD */ #endif /* !MSDOS */ #ifndef NOPOSIXUTIL else if (constequal(s, ENVOPTIND, len)) { if ((posixoptind = isnumeric(cp)) <= 1) posixoptind = 0; } #endif #ifndef MINIMUMSHELL else if (constequal(s, ENVLINENO, len)) shlineno = -1L; #endif #if !defined (FD) && defined (DEP_URLPATH) else if (constequal(s, "URLTIMEOUT", len)) { if ((urltimeout = isnumeric(cp)) < 0) urltimeout = 0; } else if (constequal(s, "URLOPTIONS", len)) { if ((urloptions = isnumeric(cp)) < 0) urloptions = 0; } #endif #if !defined (FD) && defined (DEP_FTPPATH) else if (constequal(s, "FTPADDRESS", len)) ftpaddress = (char *)cp; else if (constequal(s, "FTPPROXY", len)) ftpproxy = (char *)cp; else if (constequal(s, "FTPLOGFILE", len)) ftplogfile = (char *)cp; #endif #if !defined (FD) && defined (DEP_HTTPPATH) else if (constequal(s, "HTTPPROXY", len)) httpproxy = (char *)cp; else if (constequal(s, "HTTPLOGFILE", len)) httplogfile = (char *)cp; else if (constequal(s, "HTMLLOGFILE", len)) htmllogfile = (char *)cp; #endif shellvar = putvar(shellvar, s, len); #ifdef FD evalenv(s, len); #endif return(0); } int putexportvar(s, len) char *s; int len; { char *cp; if (len < 0) { if (!(cp = Xstrchr(s, '='))) return(0); len = cp - s; } if (_putshellvar(s, len) < 0) return(-1); exportlist = expandvar(exportlist, s, len); exportvar = putvar(exportvar, Xstrdup(s), len); #ifdef DEP_PTY sendparent(TE_PUTEXPORTVAR, s, len); #endif return(0); } int putshellvar(s, len) char *s; int len; { char *cp; if (autoexport) return(putexportvar(s, len)); if (len < 0) { if (!(cp = Xstrchr(s, '='))) return(0); len = cp - s; } if (_putshellvar(s, len) < 0) return(-1); if (searchvar(exportlist, s, len, '\0') >= 0) exportvar = putvar(exportvar, Xstrdup(s), len); #ifdef DEP_PTY sendparent(TE_PUTSHELLVAR, s, len); #endif return(0); } int unset(ident, len) CONST char *ident; int len; { #if !MSDOS && !defined (MINIMUMSHELL) CONST char *cp; #endif int i; if (checkprimal(ident, len) < 0 || checkrestrict(ident, len) < 0 || checkronly(ident, len) < 0) return(-1); #if !MSDOS # ifndef MINIMUMSHELL else if (!strnenvcmp(ident, ENVMAIL, strsize(ENVMAIL))) { if (len == strsize(ENVMAIL)) { if (!getconstvar(ENVMAILPATH)) checkmail(1); } else if (constequal(ident, ENVMAILPATH, len)) { cp = getconstvar(ENVMAIL); if (cp) replacemailpath(cp, 0); else checkmail(1); } } # endif /* !MINIMUMSHELL */ # ifdef FD else if (constequal(ident, ENVTERM, len)) regetterment(nullstr, interactive); # endif #endif /* !MSDOS */ #ifndef NOPOSIXUTIL else if (constequal(ident, ENVOPTIND, len)) posixoptind = 0; #endif #ifndef MINIMUMSHELL else if (constequal(ident, ENVLINENO, len)) shlineno = -1L; #endif #if !defined (FD) && defined (DEP_URLPATH) else if (constequal(ident, "URLTIMEOUT", len)) urltimeout = 0; else if (constequal(ident, "URLOPTIONS", len)) urloptions = 0; #endif #if !defined (FD) && defined (DEP_FTPPATH) else if (constequal(ident, "FTPADDRESS", len)) ftpaddress = NULL; else if (constequal(ident, "FTPPROXY", len)) ftpproxy = NULL; else if (constequal(ident, "FTPLOGFILE", len)) ftplogfile = NULL; #endif #if !defined (FD) && defined (DEP_HTTPPATH) else if (constequal(ident, "HTTPPROXY", len)) httpproxy = NULL; else if (constequal(ident, "HTTPLOGFILE", len)) httplogfile = NULL; #endif shellvar = putvar(shellvar, (char *)ident, len); exportvar = putvar(exportvar, (char *)ident, len); if ((i = searchvar(exportlist, ident, len, '\0')) >= 0) { Xfree(exportlist[i]); for (; exportlist[i + 1]; i++) exportlist[i] = exportlist[i + 1]; exportlist[i] = NULL; } #ifdef FD evalenv(ident, len); #endif #ifdef DEP_PTY sendparent(TE_UNSET, ident, len); #endif return(0); } #ifndef MINIMUMSHELL static VOID NEAR setshlineno(n) long n; { char tmp[strsize(ENVLINENO) + 1 + MAXLONGWIDTH + 1]; if (shlineno < 0L) return; shlineno = n; VOID_C Xsnprintf(tmp, sizeof(tmp), "%s=%ld", ENVLINENO, n); shellvar = putvar(shellvar, Xstrdup(tmp), strsize(ENVLINENO)); } #endif /* !MINIMUMSHELL */ static heredoc_t *NEAR duplheredoc(hdp) heredoc_t *hdp; { heredoc_t *new; if (!hdp) return(NULL); new = newheredoc(Xstrdup(hdp -> eof), Xstrdup(hdp -> filename), hdp -> fd, hdp -> flags); new -> buf = Xstrdup(hdp -> buf); return(new); } static redirectlist *NEAR duplrlist(rp) redirectlist *rp; { redirectlist *new, *next; char *filename; if (!rp) return(NULL); next = duplrlist(rp -> next); if (rp -> type & MD_HEREDOC) filename = (char *)duplheredoc((heredoc_t *)(rp -> filename)); else filename = Xstrdup(rp -> filename); new = newrlist(rp -> fd, filename, rp -> type | MD_DUPL, next); new -> new = rp -> new; new -> old = rp -> old; #ifdef DEP_DOSDRIVE new -> fakepipe = rp -> fakepipe; new -> dosfd = rp -> dosfd; #endif return(new); } #ifdef MINIMUMSHELL syntaxtree *duplstree(trp, parent) syntaxtree *trp, *parent; #else syntaxtree *duplstree(trp, parent, top) syntaxtree *trp, *parent; long top; #endif { syntaxtree *new; redirectlist *rp; command_t *comm; new = newstree(parent); new -> type = trp -> type; new -> cont = trp -> cont; new -> flags = (trp -> flags | ST_NOWN); #ifndef MINIMUMSHELL new -> lineno = trp -> lineno - top; #endif if ((comm = trp -> comm)) { if (trp -> flags & ST_NODE) new -> comm = (command_t *)duplstree2( (syntaxtree *)comm, new, top); else { new -> comm = newcomm(); (new -> comm) -> hash = comm -> hash; (new -> comm) -> argc = comm -> argc; (new -> comm) -> type = comm -> type; (new -> comm) -> id = comm -> id; if ((trp -> comm) -> argv) { if (!isstatement(new -> comm)) (new -> comm) -> argv = duplvar(comm -> argv, 0); else (new -> comm) -> argv = (char **)duplstree2((syntaxtree *) (comm -> argv), new, top); } (new -> comm) -> redp = duplrlist(comm -> redp); } } if (trp -> next) { if (!(trp -> cont & (CN_QUOT | CN_ESCAPE))) new -> next = duplstree2(trp -> next, new, top); else { rp = (redirectlist *)Xmalloc(sizeof(redirectlist)); memcpy((char *)rp, (char *)(trp -> next), sizeof(redirectlist)); rp -> filename = Xstrdup(rp -> filename); new -> next = (syntaxtree *)rp; } } return(new); } static shfunctable *NEAR duplfunc(func) shfunctable *func; { shfunctable *dupl; int i, n; if (!func) n = 0; else for (n = 0; func[n].ident; n++) /*EMPTY*/; dupl = (shfunctable *)Xmalloc((n + 1) * sizeof(shfunctable)); for (i = 0; i < n; i++) { dupl[i].ident = Xstrdup(func[i].ident); dupl[i].func = duplstree2(func[i].func, NULL, 0L); } dupl[i].ident = NULL; return(dupl); } static VOID NEAR freefunc(func) shfunctable *func; { int i; if (func) { for (i = 0; func[i].ident; i++) { Xfree(func[i].ident); freestree(func[i].func); Xfree(func[i].func); } Xfree(func); } } static int cmpfunc(vp1, vp2) CONST VOID_P vp1; CONST VOID_P vp2; { shfunctable *fp1, *fp2; fp1 = (shfunctable *)vp1; fp2 = (shfunctable *)vp2; return(strverscmp2(fp1 -> ident, fp2 -> ident)); } static char *NEAR getifs(VOID_A) { char *ifs; return((ifs = getconstvar(ENVIFS)) ? ifs : IFS_SET); } static int getretval(VOID_A) { return(ret_status); } static p_id_t getorgpid(VOID_A) { return(orgpid); } static p_id_t getlastpid(VOID_A) { return(lastpid); } static char *getflagstr(VOID_A) { char *cp; int i, j; cp = Xmalloc(FLAGSSIZ + 1); for (i = j = 0; i < FLAGSSIZ; i++) if (*(shflaglist[i].var) && shflaglist[i].letter) cp[j++] = shflaglist[i].letter; cp[j] = '\0'; return(cp); } static int checkundefvar(cp, arg, len) CONST char *cp, *arg; int len; { char *new; if (cp || !undeferror) return(0); new = Xstrndup(arg, len); execerror(NULL, new, ER_PARAMNOTSET, 0); Xfree(new); return(-1); } static VOID safeexit(VOID_A) { if (interactive_io) return; Xexit2(RET_FAIL); } static int NEAR getstatid(trp) syntaxtree *trp; { int id; if (!trp || (trp -> flags & ST_NODE) || !isstatement(trp -> comm) || (id = (trp -> comm) -> id) <= 0 || id > STATEMENTSIZ) return(-1); return(id); } CONST statementtable *getstatement(trp) syntaxtree *trp; { int id; if ((id = getstatid(trp)) <= 0) return(NULL); return(&(statementlist[id - 1])); } static int NEAR getparenttype(trp) syntaxtree *trp; { CONST statementtable *stat; if (!(stat = getstatement(parentstree(trp)))) return(0); return(stat -> type & STT_TYPE); } static int NEAR parsestatement(trpp, n, prev, type) syntaxtree **trpp; int n, prev, type; { syntaxtree *tmptr; int i; if (!(statementlist[n].prev[0])) { if ((*trpp) -> comm) return(-1); if (prev > 0) { if ((statementlist[prev - 1].type & STT_FUNC)) { #ifdef BASHSTYLE /* bash does not allow the function definition without "{ }" */ if (n != SM_LIST - 1) return(-1); #endif } else if (!(statementlist[prev - 1].type & STT_NEEDLIST)) return(-1); } *trpp = childstree(*trpp, SM_STATEMENT); } else { if (prev <= 0 || !(tmptr = parentstree(*trpp))) return(-1); for (i = 0; i < SMPREV; i++) { if (!(statementlist[n].prev[i])) continue; if (statementlist[n].prev[i] == SM_ANOTHER) return(0); if (prev == statementlist[n].prev[i]) break; } if (i >= SMPREV) return(-1); if (!(statementlist[n].type & STT_CASEEND) && (type & STT_NEEDLIST) && !isopnot(statementbody(tmptr)) && !(statementbody(tmptr) -> comm)) return(-1); *trpp = tmptr; } if (statementlist[n].type & STT_NEEDNONE) { if (!(tmptr = parentstree(*trpp))) return(-1); *trpp = tmptr; if (getstatid(tmptr = getparent(tmptr)) == SM_FUNC) { if (!(tmptr = parentstree(tmptr))) return(-1); *trpp = tmptr; } } else { if (statementlist[n].prev[0]) { tmptr = (*trpp) -> next = newstree(*trpp); tmptr -> flags = ST_NEXT; *trpp = tmptr; } *trpp = childstree(*trpp, n + 1); } return(1); } static syntaxtree *NEAR _addarg(trp, arg) syntaxtree *trp; CONST char *arg; { syntaxtree *tmptr; command_t *comm; CONST statementtable *stat; if (trp -> flags & ST_NODE) return(trp); comm = trp -> comm; if (ischild(comm)) /*EMPTY*/; else if (comm) { if (isstatement(comm)) return(trp); comm -> argc++; if (arg) { comm -> argv = (char **)Xrealloc(comm -> argv, (comm -> argc + 2) * sizeof(char *)); comm -> argv[comm -> argc] = Xstrdup(arg); comm -> argv[comm -> argc + 1] = NULL; } } else if (arg) { if ((trp -> flags & ST_NEXT) && (stat = getstatement(parentstree(trp))) && !(stat -> type & STT_NEEDLIST)) { syntaxerrno = ER_UNEXPTOK; return(trp); } comm = trp -> comm = newcomm(); comm -> argc = 0; comm -> argv = (char **)Xmalloc(2 * sizeof(char *)); comm -> argv[0] = Xstrdup(arg); comm -> argv[1] = NULL; } if ((stat = getstatement(getparent(trp)))) switch (stat -> type & STT_TYPE) { case STT_FOR: case STT_CASE: if (!comm || comm -> argc) { syntaxerrno = ER_UNEXPNL; return(trp); } comm -> argv = (char **)Xrealloc(comm -> argv, 2 * sizeof(char *)); comm -> argv[1] = NULL; comm -> argc = 1; trp -> next = newstree(trp); (trp -> next) -> flags = ST_NEXT; trp = trp -> next; break; case STT_IN: if (!comm) { syntaxerrno = ER_UNEXPNL; return(trp); } break; case STT_FUNC: if (!arg && comm) { if (!(tmptr = parentstree(trp)) || !(tmptr = parentstree(tmptr))) { syntaxerrno = ER_UNEXPNL; return(trp); } trp = tmptr; } break; default: break; } return(trp); } static int NEAR addarg(trpp, rp, tok, lenp, notok) syntaxtree **trpp; redirectlist *rp; char *tok; int *lenp, notok; { syntaxtree *tmptr; int i, n, id, type; type = rp -> type; rp -> type = 0; if (!tok) tok = rp -> filename; if ((*trpp) -> flags & ST_NODE) { syntaxerrno = ER_UNEXPTOK; return(-1); } if (!*lenp) { if (type && notok) { syntaxerrno = ER_UNEXPTOK; return(-1); } rp -> type = type; return(0); } tok[*lenp] = '\0'; *lenp = 0; if (!type) { id = getstatid(tmptr = parentstree(*trpp)); type = (id > 0) ? statementlist[id - 1].type : 0; if ((type & STT_NEEDIDENT) && tmptr == getparent(*trpp)) /*EMPTY*/; else if (!((*trpp) -> comm) || ischild((*trpp) -> comm)) { for (i = 0; i < STATEMENTSIZ; i++) if (!strcommcmp(tok, statementlist[i].ident)) { n = parsestatement(trpp, i, id, type); if (!n) continue; else if (n > 0) return(0); syntaxerrno = ER_UNEXPTOK; return(-1); } } if (isstatement((*trpp) -> comm)) { syntaxerrno = ER_UNEXPTOK; return(-1); } *trpp = _addarg(*trpp, tok); } else if (redirect(*trpp, rp -> fd, tok, type) < 0) return(-1); return(0); } static int NEAR evalredprefix(trpp, rp, lenp) syntaxtree **trpp; redirectlist *rp; int *lenp; { int n; rp -> filename[*lenp] = '\0'; if ((n = evalfiledesc(rp -> filename)) < 0) addarg(trpp, rp, NULL, lenp, 1); else if (rp -> type) { syntaxerrno = ER_UNEXPTOK; return(-2); } *lenp = 0; return(n); } static syntaxtree *NEAR rparen(trp) syntaxtree *trp; { syntaxtree *tmptr; if ((!(trp -> comm) && !(trp -> flags & ST_NEXT)) || !(tmptr = parentstree(trp)) || !ischild(tmptr -> comm)) syntaxerrno = ER_UNEXPTOK; else { _addarg(trp, NULL); tmptr = _addarg(tmptr, NULL); tmptr -> cont |= (trp -> cont & CN_INHR); trp = tmptr; } return(trp); } static syntaxtree *NEAR semicolon(trp, rp, s, ptrp) syntaxtree *trp; redirectlist *rp; CONST char *s; int *ptrp; { char tmptok[3]; int i, id; id = getstatid(parentstree(trp)); if (s[*ptrp + 1] != ';') { if (!(trp -> comm) && !(trp -> flags & ST_NEXT) && id > 0) { syntaxerrno = ER_UNEXPNL; return(trp); } trp = _addarg(trp, NULL); trp = linkstree(trp, OP_FG); } else { if (id != SM_RPAREN) { syntaxerrno = ER_UNEXPTOK; return(trp); } if (trp -> comm) { trp = _addarg(trp, NULL); trp = linkstree(trp, OP_FG); } (*ptrp)++; i = 0; tmptok[i++] = ';'; tmptok[i++] = ';'; addarg(&trp, rp, tmptok, &i, 0); } return(trp); } static syntaxtree *NEAR ampersand(trp, rp, s, ptrp) syntaxtree *trp; redirectlist *rp; CONST char *s; int *ptrp; { switch (s[*ptrp + 1]) { case '&': trp = _addarg(trp, NULL); (*ptrp)++; trp = linkstree(trp, OP_AND); break; #ifndef MINIMUMSHELL case '>': (*ptrp)++; rp -> fd = STDOUT_FILENO; rp -> type = (MD_WRITE | MD_WITHERR); if (s[*ptrp + 1] == '>') { (*ptrp)++; rp -> type |= MD_APPEND; } else if (s[*ptrp + 1] == '|') { (*ptrp)++; rp -> type |= MD_FORCED; } break; case '|': trp = _addarg(trp, NULL); (*ptrp)++; trp = linkstree(trp, OP_NOWN); break; #endif /* !MINIMUMSHELL */ default: trp = _addarg(trp, NULL); trp = linkstree(trp, OP_BG); break; } return(trp); } static syntaxtree *NEAR vertline(trp, s, ptrp) syntaxtree *trp; CONST char *s; int *ptrp; { #ifndef MINIMUMSHELL int n; #endif trp = _addarg(trp, NULL); switch (s[*ptrp + 1]) { case '|': (*ptrp)++; trp = linkstree(trp, OP_OR); break; #ifndef MINIMUMSHELL case '&': (*ptrp)++; n = redirect(trp, STDERR_FILENO, "1", MD_WRITE | MD_FILEDESC); if (n >= 0) trp = linkstree(trp, OP_PIPE); break; #endif default: trp = linkstree(trp, OP_PIPE); break; } return(trp); } static syntaxtree *NEAR lessthan(trp, rp, s, ptrp) syntaxtree *trp; redirectlist *rp; CONST char *s; int *ptrp; { int n; rp -> type = MD_READ; n = 0; switch (s[*ptrp + 1]) { case '<': (*ptrp)++; rp -> type |= MD_HEREDOC; if (s[*ptrp + 1] == '-') { (*ptrp)++; rp -> type |= MD_APPEND; } break; #ifndef MINIMUMSHELL case '>': (*ptrp)++; rp -> type |= MD_WRITE; if (s[*ptrp + 1] == '-') n++; else if (s[*ptrp + 1] == '&') { (*ptrp)++; if (s[*ptrp + 1] == '-') n++; else rp -> type |= MD_FILEDESC; } break; #endif /* !MINIMUMSHELL */ case '&': (*ptrp)++; if (s[*ptrp + 1] == '-') n++; else rp -> type |= MD_FILEDESC; break; case '-': n++; break; default: break; } if (n) { (*ptrp)++; if (redirect(trp, rp -> fd, NULL, rp -> type) >= 0) rp -> type = 0; } return(trp); } static syntaxtree *NEAR morethan(trp, rp, s, ptrp) syntaxtree *trp; redirectlist *rp; CONST char *s; int *ptrp; { int n; rp -> type = MD_WRITE; n = 0; switch (s[*ptrp + 1]) { case '>': (*ptrp)++; rp -> type |= MD_APPEND; break; #ifndef MINIMUMSHELL case '<': if (rp -> fd < 0) rp -> fd = STDOUT_FILENO; (*ptrp)++; rp -> type |= MD_READ; if (s[*ptrp + 1] == '-') n++; else if (s[*ptrp + 1] == '&') { (*ptrp)++; if (s[*ptrp + 1] == '-') n++; else rp -> type |= MD_FILEDESC; } break; #endif /* !MINIMUMSHELL */ case '&': (*ptrp)++; if (s[*ptrp + 1] == '-') n++; else rp -> type |= MD_FILEDESC; break; case '-': n++; break; #ifndef MINIMUMSHELL case '|': (*ptrp)++; rp -> type |= MD_FORCED; break; #endif default: break; } if (n) { (*ptrp)++; if (redirect(trp, rp -> fd, NULL, rp -> type) >= 0) rp -> type = 0; } return(trp); } #if defined (BASHSTYLE) || !defined (MINIMUMSHELL) syntaxtree *startvar(trp, rp, s, ptrp, tptrp, n) syntaxtree *trp; redirectlist *rp; CONST char *s; int *ptrp, *tptrp, n; { syntaxtree *new; redirectlist *newrp; char *cp; cp = Xmalloc(*tptrp + n + 1); Xstrncpy(cp, rp -> filename, *tptrp); Xstrncpy(&(cp[*tptrp]), &(s[*ptrp]), n); *tptrp = 0; *ptrp += n - 1; new = newstree(NULL); new -> parent = trp; newrp = (redirectlist *)Xmalloc(sizeof(redirectlist)); memcpy((char *)newrp, (char *)rp, sizeof(redirectlist)); newrp -> filename = cp; newrp -> next = (redirectlist *)new; trp -> next = (syntaxtree *)newrp; trp -> flags |= ST_BUSY; rp -> type = MD_NORMAL; rp -> fd = -1; rp -> new = rp -> old = '\0'; return(new); } static syntaxtree *NEAR endvar(trp, rp, s, ptrp, tptrp, sp, n) syntaxtree *trp; redirectlist *rp; CONST char *s; int *ptrp, *tptrp; ALLOC_T *sp; int n; { syntaxtree *tmptr; char *cp; ALLOC_T size; int len; if (!(tmptr = trp -> parent) || !(tmptr -> flags & ST_BUSY) || !(tmptr -> next)) { syntaxerrno = ER_UNEXPTOK; return(trp); } trp = tmptr; tmptr = trp -> next; trp -> next = NULL; trp -> flags &= ~ST_BUSY; cp = rp -> filename; memcpy((char *)rp, (char *)tmptr, sizeof(redirectlist)); len = strlen(rp -> filename); size = c_allocsize(len + *tptrp + n + 2); if (size > *sp) cp = Xrealloc(cp, *sp = size); memmove(&(cp[len]), cp, *tptrp); memcpy(cp, rp -> filename, len); *tptrp += len; Xstrncpy(&(cp[*tptrp]), &(s[*ptrp]), n); *tptrp += n; *ptrp += n - 1; Xfree(rp -> filename); rp -> filename = cp; Xfree(rp -> next); rp -> next = NULL; Xfree(tmptr); return(trp); } static syntaxtree *NEAR addvar(trp, s, ptrp, tok, tptrp, n) syntaxtree *trp; CONST char *s; int *ptrp; CONST char *tok; int *tptrp, n; { syntaxtree *tmptr; redirectlist *rp; int len; if (!(tmptr = trp -> parent) || !(tmptr -> flags & ST_BUSY) || !(rp = (redirectlist *)(tmptr -> next))) { syntaxerrno = ER_UNEXPTOK; return(trp); } len = strlen(rp -> filename); rp -> filename = Xrealloc(rp -> filename, len + *tptrp + n + 1); Xstrncpy(&(rp -> filename[len]), tok, *tptrp); len += *tptrp; *tptrp = 0; if (n > 0) { Xstrncpy(&(rp -> filename[len]), &(s[*ptrp]), n); len += n; *ptrp += n - 1; } rp -> filename[len] = '\0'; return(trp); } #endif /* BASHSTYLE || !MINIMUMSHELL */ static syntaxtree *NEAR normaltoken(trp, rp, s, ptrp, tptrp, sp) syntaxtree *trp; redirectlist *rp; CONST char *s; int *ptrp, *tptrp; ALLOC_T *sp; { char tmptok[2]; ALLOC_T size; int i; switch (s[*ptrp]) { case '{': if (!Xstrchr(IFS_SET, s[*ptrp + 1])) { rp -> filename[(*tptrp)++] = s[*ptrp]; break; } if (addarg(&trp, rp, NULL, tptrp, 0) < 0) break; i = 0; tmptok[i++] = s[*ptrp]; addarg(&trp, rp, tmptok, &i, 0); break; case '}': rp -> filename[(*tptrp)++] = s[*ptrp]; if ((*tptrp) > 1 || getparenttype(trp) != STT_LIST) break; if (trp -> comm) { #ifdef BASHSTYLE /* bash allows the list which does not end with ";" */ trp = _addarg(trp, NULL); trp = linkstree(trp, OP_NONE); #else break; #endif } addarg(&trp, rp, NULL, tptrp, 0); break; case '(': if (hascomm(trp)) { if (rp -> type || *tptrp || (trp -> comm) -> argc) syntaxerrno = ER_UNEXPTOK; else { trp = _addarg(trp, NULL); trp = linkstree(trp, OP_NONE); i = 0; tmptok[i++] = s[*ptrp]; addarg(&trp, rp, tmptok, &i, 0); } } else if (*tptrp) { if (!*tptrp || addarg(&trp, rp, NULL, tptrp, 0) < 0) syntaxerrno = ER_UNEXPTOK; else { trp = _addarg(trp, NULL); trp = linkstree(trp, OP_NONE); i = 0; tmptok[i++] = s[*ptrp]; addarg(&trp, rp, tmptok, &i, 0); } } else if (rp -> type) syntaxerrno = ER_UNEXPTOK; #ifdef BASHSTYLE /* bash does not allow the function definition without "{ }" */ else if (getstatid(parentstree(trp)) == SM_FUNC) syntaxerrno = ER_UNEXPTOK; #endif else trp = childstree(trp, SM_CHILD); break; case ')': if (getparenttype(trp) == STT_LPAREN) { if (*tptrp || trp -> comm) syntaxerrno = ER_UNEXPTOK; else { i = 0; tmptok[i++] = s[*ptrp]; addarg(&trp, rp, tmptok, &i, 0); } break; } if (addarg(&trp, rp, NULL, tptrp, 0) < 0) break; trp = rparen(trp); break; case ';': if (addarg(&trp, rp, NULL, tptrp, 1) < 0) break; trp = semicolon(trp, rp, s, ptrp); break; case '&': if (addarg(&trp, rp, NULL, tptrp, 1) < 0) break; trp = ampersand(trp, rp, s, ptrp); break; case '|': if (addarg(&trp, rp, NULL, tptrp, 1) < 0) break; trp = vertline(trp, s, ptrp); break; #ifndef MINIMUMSHELL case '!': if (*tptrp || trp -> comm) rp -> filename[(*tptrp)++] = s[*ptrp]; else if (rp -> type || (trp -> flags & ST_NODE)) { syntaxerrno = ER_UNEXPTOK; return(trp); } else trp = linkstree(trp, OP_NOT); break; #endif case '<': if ((rp -> fd = evalredprefix(&trp, rp, tptrp)) >= -1) trp = lessthan(trp, rp, s, ptrp); break; case '>': if ((rp -> fd = evalredprefix(&trp, rp, tptrp)) >= -1) trp = morethan(trp, rp, s, ptrp); break; case '\r': #ifdef BASHSTYLE /* bash treats '\r' as just a character */ if (rp -> type) syntaxerrno = ER_UNEXPNL; else rp -> filename[(*tptrp)++] = s[*ptrp]; break; #else /*FALLTHRU*/ #endif case '\n': if (addarg(&trp, rp, NULL, tptrp, 1) < 0) break; if (trp -> comm) { trp = _addarg(trp, NULL); trp = linkstree(trp, OP_FG); } else if (!(trp -> flags & ST_NEXT) && (i = getstatid(parentstree(trp))) > 0) { if (i == SM_FOR || i == SM_CASE || i == SM_IN || *tptrp) syntaxerrno = ER_UNEXPNL; } if (trp -> cont & CN_HDOC) { i = *ptrp + 1; #ifdef BASHSTYLE /* bash treats '\r' as just a character */ while (s[*ptrp + 1] && s[*ptrp + 1] != '\n') (*ptrp)++; #else while (s[*ptrp + 1] && s[*ptrp + 1] != '\r' && s[*ptrp + 1] != '\n') (*ptrp)++; #endif *tptrp = *ptrp - i + 1; size = c_allocsize(*tptrp + 2); if (size > *sp) rp -> filename = Xrealloc(rp -> filename, *sp = size); Xstrncpy(rp -> filename, &(s[i]), *tptrp); trp -> flags |= ST_HDOC; } break; case '#': if (*tptrp) rp -> filename[(*tptrp)++] = s[*ptrp]; else { #ifdef BASHSTYLE /* bash treats '\r' as just a character */ while (s[*ptrp + 1] && s[*ptrp + 1] != '\n') (*ptrp)++; #else while (s[*ptrp + 1] && s[*ptrp + 1] != '\r' && s[*ptrp + 1] != '\n') (*ptrp)++; #endif } break; default: if (!Xstrchr(IFS_SET, s[*ptrp])) rp -> filename[(*tptrp)++] = s[*ptrp]; else addarg(&trp, rp, NULL, tptrp, 0); break; } return(trp); } static syntaxtree *NEAR casetoken(trp, rp, s, ptrp, tptrp) syntaxtree *trp; redirectlist *rp; CONST char *s; int *ptrp, *tptrp; { char tmptok[2]; int i, stype; switch (s[*ptrp]) { case ')': if (!*tptrp) /*EMPTY*/; else if (addarg(&trp, rp, NULL, tptrp, 0) < 0) break; trp = _addarg(trp, NULL); trp = linkstree(trp, OP_NONE); i = 0; tmptok[i++] = s[*ptrp]; addarg(&trp, rp, tmptok, &i, 0); break; case '|': if (!*tptrp) /*EMPTY*/; else addarg(&trp, rp, NULL, tptrp, 0); break; case ';': if (addarg(&trp, rp, NULL, tptrp, 1) < 0) break; /* for "esac;" */ if ((stype = getparenttype(trp)) != STT_INCASE && stype != STT_CASEEND) trp = semicolon(trp, rp, s, ptrp); else syntaxerrno = ER_UNEXPTOK; break; case '{': case '}': case '&': case '<': case '>': syntaxerrno = ER_UNEXPTOK; break; case '(': #ifdef STRICTPOSIX if (!*tptrp && !(trp -> comm)) break; #endif syntaxerrno = ER_UNEXPTOK; break; case '\r': #ifdef BASHSTYLE /* bash treats '\r' as just a character */ syntaxerrno = ER_UNEXPNL; break; #endif case '\n': if (getparenttype(trp) == STT_INCASE && *tptrp) { syntaxerrno = ER_UNEXPNL; break; } if (addarg(&trp, rp, NULL, tptrp, 1) < 0) break; if (trp -> comm) { trp = _addarg(trp, NULL); trp = linkstree(trp, OP_FG); } else if (!(trp -> flags & ST_NEXT) && getstatid(parentstree(trp)) > 0) { if (*tptrp) syntaxerrno = ER_UNEXPNL; } break; case '#': if (*tptrp) rp -> filename[(*tptrp)++] = s[*ptrp]; else { #ifdef BASHSTYLE /* bash treats '\r' as just a character */ while (s[*ptrp + 1] && s[*ptrp + 1] != '\n') (*ptrp)++; #else while (s[*ptrp + 1] && s[*ptrp + 1] != '\r' && s[*ptrp + 1] != '\n') (*ptrp)++; #endif } break; default: if (!Xstrchr(IFS_SET, s[*ptrp])) rp -> filename[(*tptrp)++] = s[*ptrp]; else if (*tptrp > 0) { addarg(&trp, rp, NULL, tptrp, 0); do { (*ptrp)++; } while (Xisblank(s[*ptrp])); /* for "esac " */ if ((stype = getparenttype(trp)) != STT_INCASE && stype != STT_CASEEND) (*ptrp)--; else if (!s[*ptrp] || s[*ptrp] == '\n') syntaxerrno = ER_UNEXPNL; else if (s[*ptrp] == ')' || s[*ptrp] == '|') (*ptrp)--; else if (s[*ptrp] == PESCAPE && (!s[*ptrp + 1] || s[*ptrp] == '\n')) (*ptrp)--; else syntaxerrno = ER_UNEXPTOK; } break; } return(trp); } #if !defined (BASHBUG) && !defined (MINIMUMSHELL) static int NEAR cmpstatement(s, id) CONST char *s; int id; { int len; if (--id < 0) return(-1); len = strlen(statementlist[id].ident); if (strncommcmp(s, statementlist[id].ident, len)) return(-1); return(len); } static syntaxtree *NEAR comsubtoken(trp, rp, s, ptrp, tptrp, sp) syntaxtree *trp; redirectlist *rp; CONST char *s; int *ptrp, *tptrp; ALLOC_T *sp; { int i, len; if (!*tptrp) { if ((len = cmpstatement(&(s[*ptrp]), SM_CASE)) >= 0 && (!s[*ptrp + len] || Xstrchr(IFS_SET, s[*ptrp + len]))) { trp = startvar(trp, rp, s, ptrp, tptrp, len); trp -> cont = CN_CASE; return(trp); } if ((trp -> cont & CN_SBST) == CN_CASE && (len = cmpstatement(&(s[*ptrp]), SM_ESAC)) >= 0 && (!s[*ptrp + len] || Xstrchr(IFS_SET, s[*ptrp + len]) || s[*ptrp + len] == ';' || s[*ptrp + len] == ')')) { trp = endvar(trp, rp, s, ptrp, tptrp, sp, len); return(trp); } if (Xstrchr(IFS_SET, s[*ptrp])) { for (len = 1; s[*ptrp + len]; len++) if (!Xstrchr(IFS_SET, s[*ptrp + len])) break; trp = addvar(trp, s, ptrp, rp -> filename, tptrp, len); return(trp); } } if (s[*ptrp] == '(') { trp = startvar(trp, rp, s, ptrp, tptrp, 1); trp -> cont = CN_COMM; } else if (s[*ptrp] == ')') { if ((trp -> cont & CN_SBST) == CN_CASE) rp -> filename[(*tptrp)++] = s[*ptrp]; else trp = endvar(trp, rp, s, ptrp, tptrp, sp, 1); } # ifdef BASHSTYLE /* bash treats '\r' as just a character */ else if (s[*ptrp] == '\n') # else else if (s[*ptrp] == '\n' || s[*ptrp] == '\r') # endif trp = addvar(trp, s, ptrp, rp -> filename, tptrp, 1); else { for (i = 0; i < DELIMLISTSIZ; i++) { len = strlen(delimlist[i].symbol); if (!strncmp(&(s[*ptrp]), delimlist[i].symbol, len)) break; } if (i >= DELIMLISTSIZ) rp -> filename[(*tptrp)++] = s[*ptrp]; else if (delimlist[i].level) trp = addvar(trp, s, ptrp, rp -> filename, tptrp, len); else { Xstrncpy(&(rp -> filename[*tptrp]), &(s[*ptrp]), len); *tptrp += len; *ptrp += len - 1; } } return(trp); } #endif /* !BASHBUG && !MINIMUMSHELL */ static syntaxtree *NEAR analyzeloop(trp, rp, s, quiet) syntaxtree *trp; redirectlist *rp; CONST char *s; int quiet; { #if !defined (BASHSTYLE) && !defined (MINIMUMSHELL) syntaxtree *tmptr; #endif #ifndef NOALIAS shaliastable *alias; #endif char *cp; ALLOC_T size; int i, j, n, pc, stype, hdoc; if (!rp -> filename) { j = 0; rp -> filename = c_realloc(NULL, 0, &size); } else { j = strlen(rp -> filename); size = c_allocsize(j); } hdoc = 0; for (i = 0; s && s[i]; i++) { syntaxerrno = 0; rp -> filename = c_realloc(rp -> filename, j + 2, &size); #ifndef MINIMUMSHELL if (s[i] == '\n') setshlineno(shlineno + 1L); #endif if ((trp -> cont & CN_HDOC) && (trp -> flags & ST_HDOC)) { if (s[i] != '\n') { if (hdoc) { rp -> filename[j++] = s[i]; continue; } } else { rp -> filename[j] = '\0'; n = saveheredoc(rp -> filename, trp); if (n < 0) { if (!quiet) doperror(NULL, NULL); return(NULL); } hdoc = (trp -> cont & CN_HDOC); if (n > 0) { j = 0; continue; } hdoc = 0; trp -> cont &= ~CN_HDOC; } } pc = parsechar(&(s[i]), -1, '$', EA_BACKQ | EA_EOLESCAPE, #ifdef NESTINGQUOTE &(rp -> new), &(rp -> old)); #else &(rp -> new), NULL); #endif if (pc == PC_OPQUOTE || pc == PC_CLQUOTE || pc == PC_SQUOTE) rp -> filename[j++] = s[i]; #ifdef BASHSTYLE else if (pc == PC_BQUOTE) rp -> filename[j++] = s[i]; #endif else if (pc == PC_WCHAR) { rp -> filename[j++] = s[i++]; rp -> filename[j++] = s[i]; } else if (pc == PC_ESCAPE) { if (s[++i] != '\n' || rp -> new) { rp -> filename[j++] = PESCAPE; if (s[i]) rp -> filename[j++] = s[i]; else { trp -> cont |= CN_ESCAPE; break; } } } else if (pc == '$') { if (s[i + 1] == '{') { #ifdef BASHSTYLE /* bash treats any meta character in ${} as just a character */ trp = startvar(trp, rp, s, &i, &j, 2); #else /* !BASHSTYLE */ # ifndef MINIMUMSHELL if (rp -> new == '"') trp = startvar(trp, rp, s, &i, &j, 2); else # endif { rp -> filename[j++] = s[i++]; rp -> filename[j++] = s[i]; } #endif /* !BASHSTYLE */ trp -> cont = CN_VAR; } #ifndef MINIMUMSHELL else if (s[i + 1] == '(') { if (s[i + 2] != '(') { trp = startvar(trp, rp, s, &i, &j, 2); trp -> cont = CN_COMM; } else { trp = startvar(trp, rp, s, &i, &j, 3); trp -> cont = CN_EXPR; } } #endif /* !MINIMUMSHELL */ else rp -> filename[j++] = s[i]; } else if (s[i] == '}' && (trp -> cont & CN_SBST) == CN_VAR) { #ifdef BASHSTYLE /* bash treats any meta character in ${} as just a character */ trp = endvar(trp, rp, s, &i, &j, &size, 1); #else /* !BASHSTYLE */ # ifndef MINIMUMSHELL tmptr = trp -> parent; if (tmptr) tmptr = tmptr -> next; if (tmptr && ((redirectlist *)tmptr) -> new == '"') trp = endvar(trp, rp, s, &i, &j, &size, 1); else # endif { rp -> filename[j++] = s[i]; trp -> cont &= ~CN_VAR; } #endif /* !BASHSTYLE */ } #ifndef MINIMUMSHELL else if ((trp -> cont & CN_SBST) == CN_VAR) rp -> filename[j++] = s[i]; #endif #ifndef BASHSTYLE else if (pc == PC_BQUOTE) rp -> filename[j++] = s[i]; #endif else if (pc == PC_DQUOTE) rp -> filename[j++] = s[i]; #ifndef MINIMUMSHELL # ifdef BASHBUG /* bash cannot include 'case' statement within $() */ else if ((trp -> cont & CN_SBST) == CN_COMM) { if (s[i] == '(') { trp = startvar(trp, rp, s, &i, &j, 1); trp -> cont = CN_COMM; } else if (s[i] != ')') rp -> filename[j++] = s[i]; else trp = endvar(trp, rp, s, &i, &j, &size, 1); } # else else if ((trp -> cont & CN_SBST) == CN_COMM || (trp -> cont & CN_SBST) == CN_CASE) trp = comsubtoken(trp, rp, s, &i, &j, &size); # endif else if ((trp -> cont & CN_SBST) == CN_EXPR) { if (s[i] == '(') { trp = startvar(trp, rp, s, &i, &j, 2); trp -> cont = CN_COMM; } else if (s[i] != ')' || s[i + 1] != ')') rp -> filename[j++] = s[i]; else trp = endvar(trp, rp, s, &i, &j, &size, 2); } #endif /* !MINIMUMSHELL */ else if ((stype = getparenttype(trp)) == STT_INCASE || stype == STT_CASEEND) trp = casetoken(trp, rp, s, &i, &j); else { #ifndef NOALIAS alias = checkalias(trp, rp -> filename, j, s[i]); if (alias) { trp = analyzeloop(trp, rp, alias -> comm, quiet); alias -> flags &= ~AL_USED; if (!trp) return(NULL); j = strlen(rp -> filename); i--; } else #endif /* !NOALIAS */ trp = normaltoken(trp, rp, s, &i, &j, &size); } if (syntaxerrno) { if (quiet) return(NULL); if (Xstrchr(IFS_SET, s[i])) { if (j < 0) j = 0; rp -> filename[j] = '\0'; syntaxerror(rp -> filename); return(NULL); } for (j = i + 1; s[j]; j++) { if (Xstrchr(IFS_SET, s[j])) break; else if (iswchar(s, j)) j++; } cp = Xstrndup(&(s[i]), j - i); syntaxerror(cp); Xfree(cp); return(NULL); } } if (j && (trp -> cont & CN_HDOC) && (trp -> flags & ST_HDOC)) { rp -> filename[j] = '\0'; if ((n = saveheredoc(rp -> filename, trp)) < 0) { if (!quiet) doperror(NULL, NULL); return(NULL); } if (n > 0) j = 0; else trp -> cont &= ~CN_HDOC; } rp -> filename[j] = '\0'; #ifndef NOALIAS if ((alias = checkalias(trp, rp -> filename, j, '\0'))) { trp = analyzeloop(trp, rp, alias -> comm, quiet); alias -> flags &= ~AL_USED; } #endif return(trp); } syntaxtree *analyze(s, trp, quiet) CONST char *s; syntaxtree *trp; int quiet; { syntaxtree *parent; redirectlist *rp, red; int i; syntaxerrno = 0; red.fd = -1; red.filename = NULL; red.type = MD_NORMAL; red.new = red.old = '\0'; #ifdef DEP_DOSDRIVE red.fakepipe = NULL; red.dosfd = -1; #endif red.next = NULL; if (trp -> cont & (CN_QUOT | CN_ESCAPE)) { memcpy((char *)&red, (char *)(trp -> next), sizeof(red)); Xfree(trp -> next); i = strlen(red.filename); if (i > 0) { if ((trp -> cont & CN_ESCAPE) && red.new != '\'') i--; else if (s) red.filename[i++] = '\n'; } #ifndef BASHSTYLE /* bash does not allow unclosed quote */ if (!s) { if (trp -> cont & CN_QUOT) red.filename[i++] = red.new; red.new = '\0'; } #endif red.filename[i] = '\0'; } else if ((trp -> cont & CN_HDOC)) { if ((i = saveheredoc(s, trp)) < 0) { if (!quiet) doperror(NULL, NULL); return(NULL); } else if (!i) { trp -> cont &= ~CN_HDOC; return(NULL); } return(trp); } else if (!s) return(NULL); trp -> next = NULL; trp -> cont &= CN_INHR; exectrapcomm(); if (s) { #ifndef NOALIAS for (i = 0; shellalias[i].ident; i++) shellalias[i].flags &= ~AL_USED; #endif if (!(trp = analyzeloop(trp, &red, s, quiet))) { Xfree(red.filename); return(NULL); } } i = (red.filename) ? strlen(red.filename) : 0; if (red.new) trp -> cont |= CN_QUOT; if (trp -> cont & (CN_QUOT | CN_ESCAPE)) { rp = (redirectlist *)Xmalloc(sizeof(redirectlist)); memcpy((char *)rp, (char *)&red, sizeof(red)); trp -> next = (syntaxtree *)rp; red.filename = NULL; } #if defined (BASHSTYLE) || !defined (MINIMUMSHELL) else if (trp -> cont & CN_SBST) { red.filename[i++] = '\n'; red.filename[i] = '\0'; trp = addvar(trp, NULL, NULL, red.filename, &i, 0); } #endif else if (getparenttype(trp) == STT_INCASE && (trp -> comm || i)) syntaxerrno = ER_UNEXPNL; else if (addarg(&trp, &red, NULL, &i, 1) < 0) /*EMPTY*/; else if (!(trp = _addarg(trp, NULL)) || syntaxerrno) /*EMPTY*/; else if (trp -> comm) trp = linkstree(trp, OP_FG); else if (hasparent(trp)) { #ifndef MINIMUMSHELL if (isopnot(trp -> parent)) syntaxerrno = ER_UNEXPNL; #endif if (!isopfg(trp -> parent) && !isopbg(trp -> parent) && !isopnown(trp -> parent)) trp -> cont |= CN_STAT; } if (syntaxerrno) { if (!quiet) syntaxerror(red.filename); Xfree(red.filename); return(NULL); } Xfree(red.filename); if ((parent = parentstree(trp)) && isstatement(parent -> comm)) trp -> cont |= CN_STAT; return(trp); } static syntaxtree *NEAR analyzeeof(trp) syntaxtree *trp; { while (trp && trp -> cont) { #ifdef BASHSTYLE if (trp -> cont & CN_HDOC) trp = analyze(NULL, trp, 0); #else /* bash does not allow unclosed quote */ if (trp -> cont & (CN_ESCAPE | CN_QUOT | CN_HDOC)) trp = analyze(NULL, trp, 0); /* bash does not allow the format like as "foo |" */ else if ((trp -> flags & ST_NEXT) && hasparent(trp) && isoppipe(trp -> parent)) break; #endif else { syntaxerrno = ER_UNEXPEOF; syntaxerror(nullstr); return(NULL); } } return(trp); } static syntaxtree *NEAR statementcheck(trp, id) syntaxtree *trp; int id; { if (!trp || !isstatement(trp -> comm) || (id > 0 && (trp -> comm) -> id != id) || !(trp = statementbody(trp))) { errno = EINVAL; return(NULL); } return(trp); } static int NEAR check_statement(trp) syntaxtree *trp; { syntaxtree *body; CONST statementtable *stat; int i, id; if ((trp -> comm) -> id == SM_CHILD) return(check_stree(statementbody(trp))); id = getstatid(trp = statementcheck(trp, SM_STATEMENT)); stat = (id > 0) ? &(statementlist[id - 1]) : NULL; if (!stat || !stat -> func || stat -> prev[0]) { errno = EINVAL; doperror(NULL, NULL); return(-1); } for (;;) { if (stat -> type & STT_NEEDLIST) { if (!(body = statementcheck(trp, 0))) { doperror(NULL, stat -> ident); return(-1); } if (check_stree(body)) return(-1); } if (!(trp = trp -> next) || !(trp -> comm)) break; if (!(stat = getstatement(trp))) i = SMPREV; else for (i = 0; i < SMPREV; i++) { if (!(stat -> prev[i])) continue; if (id == stat -> prev[i]) break; } if (i >= SMPREV) { errno = EINVAL; doperror(NULL, stat -> ident); return(-1); } } return(0); } static int NEAR check_command(trp) syntaxtree *trp; { command_t *comm; CONST VOID_P vp; char **argv, **subst; int id, type, argc, *len; comm = trp -> comm; argc = comm -> argc; argv = comm -> argv; if (argc <= 0) return(0); comm -> argv = duplvar(comm -> argv, 0); comm -> argc = getsubst(comm -> argc, comm -> argv, &subst, &len); if ((type = evalargv(comm, &vp, NULL)) < 0) id = -1; else if (type != CT_COMMAND) id = 0; else id = searchhash(&(comm -> hash), comm -> argv[0], NULL); freevar(subst); Xfree(len); comm -> argc = argc; freevar(comm -> argv); comm -> argv = argv; return((id >= 0) ? 0 : -1); } static int NEAR check_stree(trp) syntaxtree *trp; { syntaxtree *tmptr; if (!trp) { errno = EINVAL; doperror(NULL, NULL); return(-1); } if (!(trp -> comm)) return(0); if (trp -> flags & ST_NODE) { if (check_stree((syntaxtree *)(trp -> comm)) < 0) return(-1); } else if (isstatement(trp -> comm)) { if (check_statement(trp) < 0) return(-1); } else if (getstatid(tmptr = statementcheck(trp -> next, SM_STATEMENT)) == SM_LPAREN) { #ifndef BASHSTYLE /* bash allows any character in the function identifier */ if (identcheck((trp -> comm) -> argv[0], '\0') <= 0) { execerror(NULL, (trp -> comm) -> argv[0], ER_NOTIDENT, 0); return(-1); } #endif if (!statementcheck(tmptr -> next, 0)) { doperror(NULL, NULL); return(-1); } trp = trp -> next; } else if (check_command(trp) < 0) return(-1); return((trp -> next) ? check_stree(trp -> next) : 0); } static syntaxtree *NEAR analyzeline(command) CONST char *command; { #ifndef MINIMUMSHELL long dupshlineno; #endif syntaxtree *trp, *stree; #ifndef MINIMUMSHELL dupshlineno = shlineno; setshlineno(1L); #endif stree = newstree(NULL); trp = analyze(command, stree, 0); if (!(trp = analyzeeof(trp))) /*EMPTY*/; #ifndef _NOUSEHASH else if (hashahead && check_stree(stree) < 0) trp = NULL; #endif if (!trp) { freestree(stree); Xfree(stree); stree = NULL; } #ifndef MINIMUMSHELL setshlineno(dupshlineno); #endif return(stree); } #ifdef DEBUG static VOID NEAR Xexecve(path, argv, envp, bg) CONST char *path; char *argv[], *envp[]; int bg; #else static VOID NEAR Xexecve(path, argv, envp) CONST char *path; char *argv[], *envp[]; #endif { #ifdef DEP_PTY char *cp; int len; #endif int fd, ret; #ifdef DEP_PTY if (parentfd >= 0 && ptyterm && *ptyterm) { len = strsize(ENVTERM); cp = Xmalloc(len + strlen(ptyterm) + 2); memcpy(cp, ENVTERM, len); cp[len] = '='; Xstrcpy(&(cp[len + 1]), ptyterm); envp = putvar(envp, cp, len); } #endif /* DEP_PTY */ execve(path, argv, envp); if (errno != ENOEXEC) { if (errno == EACCES) { execerror(NULL, argv[0], ER_CANNOTEXE, 1); ret = RET_NOTEXEC; } else { doperror(NULL, argv[0]); ret = RET_FAIL; } } else if ((fd = newdup(Kopen(path, O_TEXT | O_RDONLY, 0666))) < 0) { doperror(NULL, argv[0]); ret = RET_NOTEXEC; } else { argvar = argv; sourcefile(fd, argv[0], 0); safeclose(fd); ret = ret_status; } #ifdef DEBUG if (!bg) Xexit2(ret); #endif prepareexit(1); Xexit(ret); } #if MSDOS static char *NEAR addext(path, ext) char *path; int ext; { int len; len = strlen(path); path = Xrealloc(path, len + 1 + 3 + 1); path[len++] = '.'; if (ext & CM_BATCH) Xstrcpy(&(path[len]), EXTBAT); else if (ext & CM_EXE) Xstrcpy(&(path[len]), EXTEXE); else Xstrcpy(&(path[len]), EXTCOM); return(path); } static char **NEAR replacebat(pathp, argv) char **pathp, **argv; { char *com; int i; # ifdef FD if (!(com = getenv2("FD_COMSPEC")) && !(com = getenv2("FD_SHELL"))) # else if (!(com = getconstvar(ENVCOMSPEC)) && !(com = getconstvar(ENVSHELL))) # endif # ifdef BSPATHDELIM com = "\\COMMAND.COM"; # else com = "/COMMAND.COM"; # endif i = countvar(argv); memmove((char *)(&(argv[i + 2])), (char *)(&(argv[i])), (i + 1) * sizeof(char *)); Xfree(argv[2]); argv[2] = Xstrdup(*pathp); argv[1] = Xstrdup("/C"); argv[0] = *pathp = Xstrdup(com); return(argv); } #endif /* MSDOS */ #ifdef USEFAKEPIPE static int NEAR openpipe(pidp, fdin, new) p_id_t *pidp; int fdin, new; #else static int NEAR openpipe(pidp, fdin, new, tty, ppid) p_id_t *pidp; int fdin, new, tty; p_id_t ppid; #endif { #ifndef USEFAKEPIPE p_id_t pid; int fds[2]; #endif pipelist *pl; char pfile[MAXPATHLEN]; int fd, dupl; pl = (pipelist *)Xmalloc(sizeof(pipelist)); pl -> file = NULL; pl -> fp = NULL; #ifndef USEFAKEPIPE pl -> trp = NULL; #endif pl -> fd = fdin; pl -> old = -1; #ifndef USEFAKEPIPE if (pipe(fds) < 0) { # ifdef FAKEUNINIT fd = -1; /* fake for -Wuninitialized */ # endif pid = (p_id_t)-1; } else if ((pid = makechild(tty, ppid)) < (p_id_t)0) { # ifdef FAKEUNINIT fd = -1; /* fake for -Wuninitialized */ # endif safeclose(fds[0]); safeclose(fds[1]); } else if (!pid) { if ((fd = newdup(Xdup(STDOUT_FILENO))) < 0 || fds[1] == STDOUT_FILENO || Xdup2(fds[1], STDOUT_FILENO) < 0) { prepareexit(1); Xexit(RET_NOTEXEC); } safeclose(fds[0]); safeclose(fds[1]); pl -> old = fd; } else { if (new) fd = newdup(fds[0]); else { if ((fd = newdup(Xdup(fdin))) < 0 || fds[0] == fdin || Xdup2(fds[0], fdin) < 0) { safeclose(fd); # ifndef NOJOB if (stoppedjob(pid)) /*EMPTY*/; else # endif { VOID_C kill(pid, SIGPIPE); while (!waitjob(pid, NULL, WUNTRACED)) if (interrupted) break; } pid = (p_id_t)-1; } else { # ifndef NOJOB VOID_C stackjob(pid, 0, fd, NULL); # endif pl -> old = fd; } safeclose(fds[0]); } safeclose(fds[1]); } if (pid >= (p_id_t)0) { pl -> new = fd; pl -> pid = *pidp = pid; pl -> next = pipetop; pipetop = pl; return(fd); } #endif /* !USEFAKEPIPE */ if ((dupl = newdup(Xdup(STDOUT_FILENO))) < 0) { Xfree(pl); return(-1); } if ((fd = newdup(mktmpfile(pfile))) < 0 || fd == STDOUT_FILENO || Xdup2(fd, STDOUT_FILENO) < 0) { Xfree(pl); safeclose(fd); safeclose(dupl); return(-1); } safeclose(fd); if (new) pl -> fd = -1; pl -> file = Xstrdup(pfile); pl -> new = pl -> old = dupl; pl -> pid = *pidp = (p_id_t)0; pl -> next = pipetop; pipetop = pl; return(dupl); } static pipelist **NEAR searchpipe(fd) int fd; { pipelist **prevp; if (fd < 0) return(NULL); prevp = &pipetop; while (*prevp) { if (fd == (*prevp) -> new) break; prevp = &((*prevp) -> next); } if (!*prevp) return(NULL); return(prevp); } static int NEAR reopenpipe(fd, ret) int fd, ret; { pipelist *pl, **prevp; int dupl; if (!(prevp = searchpipe(fd))) return(-1); pl = *prevp; if (pl -> pid > (p_id_t)0) return(fd); if (pl -> old >= 0) { Xdup2(pl -> old, STDOUT_FILENO); safeclose(pl -> old); pl -> old = -1; } if (!(pl -> file)) { prepareexit(1); Xexit(ret); } pl -> ret = ret; if ((fd = newdup(Xopen(pl -> file, O_BINARY | O_RDONLY, 0666))) < 0) { safermtmpfile(pl -> file); Xfree(pl -> file); *prevp = pl -> next; Xfree(pl); return(-1); } if (pl -> fd >= 0) { if ((dupl = newdup(Xdup(pl -> fd))) < 0 || fd == pl -> fd || Xdup2(fd, pl -> fd) < 0) { safeclose(fd); safermtmpfile(pl -> file); Xfree(pl -> file); *prevp = pl -> next; Xfree(pl); return(-1); } safeclose(fd); fd = pl -> old = dupl; } pl -> new = fd; return(fd); } static XFILE *NEAR fdopenpipe(fd) int fd; { pipelist *pl, **prevp; XFILE *fp; if (!(prevp = searchpipe(fd))) return(NULL); pl = *prevp; if (!(fp = Xfdopen(fd, "r"))) { safeclose(fd); safermtmpfile(pl -> file); Xfree(pl -> file); *prevp = pl -> next; Xfree(pl); return(NULL); } pl -> fp = fp; return(fp); } #ifdef DJGPP int closepipe(fd, dupl) int fd, dupl; #else int closepipe(fd) int fd; #endif { #if !MSDOS && defined (NOJOB) wait_pid_t w; #endif pipelist *pl, **prevp; int ret, duperrno; if (!(prevp = searchpipe(fd))) return(-1); duperrno = errno; pl = *prevp; #ifndef USEFAKEPIPE freestree(pl -> trp); Xfree(pl -> trp); #endif #ifndef NOJOB if (pl -> pid > (p_id_t)0 && stoppedjob(pl -> pid) > 0) { errno = duperrno; return(RET_SUCCESS); } #endif if (pl -> old >= 0) { Xdup2(pl-> old, pl -> fd); safeclose(pl -> old); } if (fd != STDIN_FILENO && fd != STDOUT_FILENO && fd != STDERR_FILENO) { if (pl -> fp) safefclose(pl -> fp); else safeclose(pl -> new); } ret = RET_SUCCESS; if (pl -> file) { if (rmtmpfile(pl -> file) < 0) { #ifdef DJGPP if (errno == EACCES && dupl >= 0 && Xclose(dupl) >= 0 && rmtmpfile(pl -> file) >= 0) /*EMPTY*/; else #endif doperror(NULL, pl -> file); } Xfree(pl -> file); ret = pl -> ret; } #if !MSDOS else if (!(pl -> pid)) { prepareexit(1); Xexit(RET_SUCCESS); } else if (pl -> pid > (p_id_t)0) { # ifdef NOJOB VOID_C kill(pl -> pid, SIGPIPE); while (!(ret = waitjob(pl -> pid, &w, WUNTRACED))) if (interrupted) break; if (ret < 0) { if (errno == ECHILD) ret = errno = 0; } else if (WIFSTOPPED(w)) ret = -1; else if (WIFSIGNALED(w) && WTERMSIG(w) != SIGPIPE) ret = -1; # else /* !NOJOB */ ret = waitchild(pl -> pid, NULL); if (ret == 128 + SIGPIPE) ret = RET_SUCCESS; # endif /* !NOJOB */ } #endif /* !MSDOS */ *prevp = pl -> next; Xfree(pl); errno = duperrno; return(ret); } #ifndef _NOUSEHASH static VOID NEAR disphash(VOID_A) { hashlist *hp; char buf[7 + 1]; int i, j; puts2("hits cost command"); putnl(); if (hashtable) for (i = 0; i < MAXHASH; i++) for (hp = hashtable[i]; hp; hp = hp -> next) { j = Xsnprintf(buf, sizeof(buf), "%d", hp -> hits); buf[j++] = (hp -> type & CM_RECALC) ? '*' : ' '; while (j < 7) buf[j++] = ' '; buf[j] = '\0'; VOID_C Xprintf("%s %-7d %k\n", buf, hp -> cost, hp -> path); } } #endif /* !_NOUSEHASH */ char *evalbackquote(arg) CONST char *arg; { XFILE *fp; char *buf; ALLOC_T len; int duptrapok; duptrapok = trapok; trapok = -1; fp = _dopopen(arg); trapok = duptrapok; if (!fp) { if (errno) doperror(NULL, NULL); buf = NULL; ret_status = RET_NOTEXEC; } else if (!(buf = readfile(Xfileno(fp), &len))) { doperror(NULL, NULL); ret_status = RET_FATALERR; } else { #if defined (BASHSTYLE) || defined (STRICTPOSIX) /* bash & POSIX ignore any following newlines */ while (len > 0 && buf[--len] == '\n') buf[len] = '\0'; #else if (len > 0 && buf[--len] == '\n') buf[len] = '\0'; #endif ret_status = closepipe2(Xfileno(fp), -1); } return(buf); } #ifdef NOALIAS int checktype(s, vpp, func) CONST char *s; CONST VOID_P *vpp; int func; #else int checktype(s, vpp, alias, func) CONST char *s; CONST VOID_P *vpp; int alias, func; #endif { if (!vpp) return(CT_NONE); else if (!s || !*s) { *vpp = NULL; return(CT_NONE); } else if (!strdelim(s, 1)) { #ifndef NOALIAS if (alias && (*vpp = getshalias(s, -1))) return(CT_ALIAS); #endif #ifdef STRICTPOSIX if ((*vpp = getshbuiltin2(s, BT_DISABLE, BT_POSIXSPECIAL))) return(CT_BUILTIN); #endif if (func && (*vpp = getshfunc(s))) return(CT_FUNCTION); #if MSDOS if (_dospath(s) && (!s[2] || (s[2] == _SC_ && !s[3]))) { *vpp = s; return(CT_LOGDRIVE); } #endif if ((*vpp = getshbuiltin2(s, BT_DISABLE | BT_POSIXSPECIAL, 0))) return(CT_BUILTIN); #ifdef FD if ((*vpp = getbuiltin(s))) return(CT_FDORIGINAL); if (!shellmode && (*vpp = getinternal(s))) return(CT_FDINTERNAL); #endif } *vpp = NULL; return(CT_COMMAND); } #if !defined (FDSH) && !defined (_NOCOMPLETE) int completeshellvar(s, len, argc, argvp) CONST char *s; int len, argc; char ***argvp; { char *cp; int i; if (shellvar) for (i = 0; shellvar[i]; i++) { if (strnenvcmp(s, shellvar[i], len) || !(cp = Xstrchr(shellvar[i], '='))) continue; argc = addcompletion(NULL, Xstrndup(shellvar[i], cp - shellvar[i]), argc, argvp); } return(argc); } int completeshellcomm(s, len, argc, argvp) CONST char *s; int len, argc; char ***argvp; { int i; # ifndef NOALIAS for (i = 0; shellalias[i].ident; i++) { if (strncommcmp(s, shellalias[i].ident, len)) continue; argc = addcompletion(shellalias[i].ident, NULL, argc, argvp); } # endif /* !NOALIAS */ for (i = 0; shellfunc[i].ident; i++) { if (strncommcmp(s, shellfunc[i].ident, len)) continue; argc = addcompletion(shellfunc[i].ident, NULL, argc, argvp); } for (i = 0; i < SHBUILTINSIZ; i++) { # ifndef MINIMUMSHELL if (shbuiltinlist[i].flags & BT_DISABLE) continue; # endif if (strncommcmp(s, shbuiltinlist[i].ident, len)) continue; argc = addcompletion(shbuiltinlist[i].ident, NULL, argc, argvp); } # ifdef FD argc = completebuiltin(s, len, argc, argvp); if (!shellmode) argc = completeinternal(s, len, argc, argvp); # endif for (i = 0; i < STATEMENTSIZ; i++) { if (strncommcmp(s, statementlist[i].ident, len)) continue; argc = addcompletion(statementlist[i].ident, NULL, argc, argvp); } return(argc); } #endif /* !FDSH && !_NOCOMPLETE */ #ifdef BASHSTYLE static char *NEAR quotemeta(s) char *s; { char *cp, *buf; ALLOC_T ptr, len; cp = Xstrchr(s, '='); if (!cp || !strpbrk(++cp, METACHAR)) return(s); len = strlen(s) + 2; buf = Xmalloc(len + 1); ptr = cp - s; memcpy(buf, s, ptr); buf[ptr++] = '\''; while (*cp) { if (*cp != '\'') buf[ptr++] = *(cp++); else { len += 3; buf = Xrealloc(buf, len + 1); buf[ptr++] = '\''; buf[ptr++] = PESCAPE; buf[ptr++] = *(cp++); buf[ptr++] = '\''; } } buf[ptr++] = '\''; buf[ptr] = '\0'; Xfree(s); return(buf); } #endif /* BASHSTYLE */ int getsubst(argc, argv, substp, lenp) int argc; char **argv, ***substp; int **lenp; { int i, n, len; *substp = (char **)Xmalloc((argc + 1) * sizeof(char *)); *lenp = (int *)Xmalloc(argc * sizeof(int)); len = 1; for (i = n = 0; i < argc; i++) { len = (freeenviron || len > 0) ? identcheck(argv[i], '=') : 0; if (len > 0) { (*substp)[n] = argv[i]; (*lenp)[n] = len; memmove((char *)(&(argv[i])), (char *)(&(argv[i + 1])), (argc-- - i) * sizeof(char *)); n++; i--; } } (*substp)[n] = NULL; return(argc); } static int NEAR substvar(argv, flags) char **argv; int flags; { char *tmp, *arg; int i; for (i = 0; argv[i]; i++) { if (trapok >= 0) trapok = 1; tmp = evalarg(argv[i], flags); if (trapok >= 0) trapok = 0; if (!tmp) { arg = argv[i]; if (i && *arg && (flags & EA_EVALIFS)) { while (argv[i]) i++; argv = duplvar(argv, 2); argv = checkshellbuiltinargv(i, argv); freevar(argv); } execerror(NULL, arg, ER_BADSUBST, 0); return(-1); } Xfree(argv[i]); argv[i] = tmp; } return(i); } static int NEAR evalargv(comm, vpp, contp) command_t *comm; CONST VOID_P *vpp; int *contp; { char *tmp; int i, glob, type; if (!comm || !vpp) return(-1); else if (comm -> type) { *vpp = &(comm -> id); /* never used */ return(comm -> type); } if (contp && substvar(comm -> argv, EA_BACKQ | EA_EVALIFS) < 0) return(-1); if (trapok >= 0) trapok = 1; #ifdef BASHSTYLE /* bash does not use IFS as a command separator */ comm -> argc = evalifs(comm -> argc, &(comm -> argv), IFS_SET); #else comm -> argc = evalifs(comm -> argc, &(comm -> argv), getifs()); #endif if (!(comm -> argc)) { type = CT_NONE; *vpp = NULL; } else { stripquote(tmp = Xstrdup(comm -> argv[0]), EA_STRIPQ); type = checktype2(tmp, vpp, 0, 1); Xfree(tmp); } #ifdef FD if (contp) { i = replaceargs(&(comm -> argc), &(comm -> argv), exportvar, (type == CT_COMMAND) ? 1 : 0); if (i < 0) { doperror(NULL, comm -> argv[0]); return(-1); } *contp = i; } #endif if (noglob) glob = 0; #ifdef FD else if (type == CT_FDINTERNAL) glob = 0; #endif else if (type != CT_BUILTIN) glob = 1; else if (((shbuiltintable *)(*vpp)) -> flags & BT_NOGLOB) glob = 0; else glob = 1; if (glob) { #ifdef DEP_FILECONV if (type == CT_FDORIGINAL) i = 0; else if (type != CT_BUILTIN) i = 1; else if (((shbuiltintable *)(*vpp)) -> flags & BT_NOKANJIFGET) i = 1; else i = 0; if (i) nokanjifconv++; #endif #if MSDOS comm -> argc = evalglob(comm -> argc, &(comm -> argv), (type == CT_COMMAND) ? 0 : EA_STRIPQ); #else comm -> argc = evalglob(comm -> argc, &(comm -> argv), EA_STRIPQ); #endif #ifdef DEP_FILECONV if (i) nokanjifconv--; #endif } else { i = 0; #if MSDOS stripquote(comm -> argv[i++], EA_STRIPQ); if (type == CT_COMMAND) while (i < comm -> argc) stripquote(comm -> argv[i++], 0); else #endif while (i < comm -> argc) stripquote(comm -> argv[i++], EA_STRIPQ); } if (trapok >= 0) trapok = 0; return(type); } static char *NEAR evalexternal(comm) command_t *comm; { char *path; int type; type = searchhash(&(comm -> hash), comm -> argv[0], NULL); if (type & CM_NOTFOUND) { execerror(NULL, comm -> argv[0], ER_COMNOFOUND, 1); ret_status = RET_NOTFOUND; return(NULL); } if (restricted && (type & CM_FULLPATH)) { execerror(NULL, comm -> argv[0], ER_RESTRICTED, 2); ret_status = RET_FAIL; return(NULL); } if (type & CM_FULLPATH) { #if MSDOS if (type & CM_ADDEXT) path = comm -> argv[0] = addext(comm -> argv[0], type); else #endif path = comm -> argv[0]; } else { #ifdef _NOUSEHASH path = (char *)(comm -> hash); #else ((comm -> hash) -> hits)++; path = (comm -> hash) -> path; #endif } #if MSDOS if (type & CM_BATCH) comm -> argv = replacebat(&path, comm -> argv); #endif return(path); } static VOID NEAR printindent(n, fp) int n; XFILE *fp; { while (n-- > 0) VOID_C Xfputs(" ", fp); } static VOID NEAR printnewline(n, fp) int n; XFILE *fp; { if (n < 0) VOID_C Xfputc(' ', fp); else { VOID_C fputnl(fp); printindent(n, fp); } } static int NEAR printredirect(rp, fp) redirectlist *rp; XFILE *fp; { heredoc_t *hdp; int ret; if (!rp) return(0); ret = printredirect(rp -> next, fp); VOID_C Xfputc(' ', fp); switch (rp -> type & MD_RDWR) { case MD_READ: if (rp -> fd != STDIN_FILENO) VOID_C Xfprintf(fp, "%d", rp -> fd); VOID_C Xfputc('<', fp); if (rp -> type & MD_HEREDOC) { VOID_C Xfputc('<', fp); if (rp -> type & MD_APPEND) VOID_C Xfputc('-', fp); } break; case MD_WRITE: if (rp -> fd != STDOUT_FILENO) VOID_C Xfprintf(fp, "%d", rp -> fd); if (rp -> type & MD_WITHERR) VOID_C Xfputc('&', fp); VOID_C Xfputc('>', fp); if (rp -> type & MD_APPEND) VOID_C Xfputc('>', fp); #ifndef MINIMUMSHELL else if (rp -> type & MD_FORCED) VOID_C Xfputc('|', fp); #endif break; case MD_RDWR: if (rp -> fd != STDOUT_FILENO) VOID_C Xfprintf(fp, "%d", rp -> fd); VOID_C Xfputs("<>", fp); break; default: break; } if (!(rp -> filename)) VOID_C Xfputc('-', fp); else { if (rp -> type & MD_FILEDESC) VOID_C Xfputc('&', fp); else VOID_C Xfputc(' ', fp); if (!(rp -> type & MD_HEREDOC)) argfputs(rp -> filename, fp); else { hdp = (heredoc_t *)(rp -> filename); #ifdef MINIMUMSHELL argfputs(hdp -> filename, fp); #else argfputs(hdp -> eof, fp); #endif ret = 1; } } return(ret); } VOID printstree(trp, indent, fp) syntaxtree *trp; int indent; XFILE *fp; #ifndef MINIMUMSHELL { redirectlist **rlist; int i; rlist = _printstree(trp, NULL, indent, fp); if (rlist) { for (i = 0; rlist[i]; i++) printheredoc(rlist[i], fp); Xfree(rlist); } } static VOID NEAR printheredoc(rp, fp) redirectlist *rp; XFILE *fp; { heredoc_t *hdp; char *buf; int fd; if (!rp) return; printheredoc(rp -> next, fp); if (!(rp -> type & MD_HEREDOC)) return; hdp = (heredoc_t *)(rp -> filename); fd = newdup(Xopen(hdp -> filename, O_BINARY | O_RDONLY, 0666)); if (fd >= 0) { putnl(); while ((buf = readline(fd, '\0')) != vnullstr) { if (!buf) break; puts2(buf); putnl(); Xfree(buf); } safeclose(fd); argfputs(hdp -> eof, fp); } } static redirectlist **NEAR _printstree(trp, rlist, indent, fp) syntaxtree *trp; redirectlist **rlist; int indent; XFILE *fp; #endif /* !MINIMUMSHELL */ { #ifndef MINIMUMSHELL redirectlist **rlist2; int nl; #endif syntaxtree *tmptr; CONST opetable *opep; int i, j, id, prev, ind2; #ifdef MINIMUMSHELL if (!trp) return; #else if (!trp) return(rlist); #endif prev = getstatid(tmptr = parentstree(trp)); #ifndef MINIMUMSHELL if (isopnot(trp)) { VOID_C Xfputc('!', fp); return(_printstree(trp -> next, rlist, indent, fp)); } rlist2 = NULL; #endif if (trp -> flags & ST_NODE) #ifdef MINIMUMSHELL printstree((syntaxtree *)(trp -> comm), indent, fp); #else rlist2 = _printstree((syntaxtree *)(trp -> comm), NULL, indent, fp); #endif else if (!(trp -> comm)) { if (tmptr && !(tmptr -> next) && prev > 0) { for (i = 0; i < STATEMENTSIZ; i++) { if (!(statementlist[i].type & STT_NEEDNONE)) continue; for (j = 0; j < SMPREV; j++) { if (!(statementlist[i].prev[j])) continue; if (prev == statementlist[i].prev[j]) break; } if (j < SMPREV) break; } if (i < STATEMENTSIZ) { printnewline(indent - 1, fp); VOID_C Xfputs(statementlist[i].ident, fp); } } } else { if (isstatement(trp -> comm)) { id = (trp -> comm) -> id; i = id - 1; if (id == SM_CHILD) { VOID_C Xfputs("( ", fp); #ifdef MINIMUMSHELL printstree(statementbody(trp), indent, fp); #else rlist2 = _printstree(statementbody(trp), NULL, indent, fp); #endif VOID_C Xfputs(" )", fp); } else if (id == SM_STATEMENT) #ifdef MINIMUMSHELL printstree(statementbody(trp), indent, fp); #else rlist2 = _printstree(statementbody(trp), NULL, indent, fp); #endif else { VOID_C Xfputs(statementlist[i].ident, fp); switch (id) { case SM_THEN: case SM_ELSE: case SM_DO: case SM_RPAREN: case SM_LIST: ind2 = 1; break; case SM_INCASE: if (indent >= 0) indent++; ind2 = 0; break; case SM_CASEEND: if (trp -> next) ind2 = 0; else ind2 = -1; break; case SM_FUNC: #ifdef BASHSTYLE /* bash type pretty print */ ind2 = 0; break; #endif case SM_LPAREN: ind2 = -1; break; default: ind2 = -1; VOID_C Xfputc(' ', fp); break; } tmptr = statementbody(trp); if (ind2 < 0) ind2 = indent; else { if (indent < 0) ind2 = indent; else ind2 += indent; if (tmptr && tmptr -> comm) printnewline(ind2, fp); } #ifdef MINIMUMSHELL printstree(tmptr, ind2, fp); #else rlist2 = _printstree(tmptr, NULL, ind2, fp); #endif switch (id) { case SM_IF: case SM_ELIF: case SM_WHILE: case SM_UNTIL: case SM_IN: #ifdef BASHSTYLE /* bash type pretty print */ VOID_C Xfputc(' ', fp); break; #endif case SM_THEN: case SM_RPAREN: if (!(trp -> next)) break; printnewline(indent, fp); break; case SM_FOR: case SM_CASE: VOID_C Xfputc(' ', fp); break; default: break; } } } else if ((trp -> comm) -> argc > 0) { argfputs((trp -> comm) -> argv[0], fp); for (i = 1; i < (trp -> comm) -> argc; i++) { VOID_C Xfputc(' ', fp); if (prev == SM_INCASE || prev == SM_CASEEND) VOID_C Xfputs("| ", fp); argfputs((trp -> comm) -> argv[i], fp); } } #ifdef MINIMUMSHELL printredirect((trp -> comm) -> redp, fp); #else if (printredirect((trp -> comm) -> redp, fp)) { if (!rlist) i = 0; else for (i = 0; rlist[i]; i++) /*EMPTY*/; rlist = (redirectlist **)Xrealloc(rlist, (i + 2) * sizeof(redirectlist *)); rlist[i++] = (trp -> comm) -> redp; rlist[i] = NULL; } #endif } #ifndef MINIMUMSHELL if (rlist2) { if (!rlist) i = 0; else for (i = 0; rlist[i]; i++) /*EMPTY*/; for (j = 0; rlist2[j]; j++) /*EMPTY*/; rlist = (redirectlist **)Xrealloc(rlist, (i + j + 1) * sizeof(redirectlist *)); for (j = 0; rlist2[j]; j++) rlist[i + j] = rlist2[j]; rlist[i + j] = NULL; Xfree(rlist2); } #endif opep = getoperator(trp -> type); if (opep && !isopfg(trp)) VOID_C Xfprintf(fp, " %s", opep -> symbol); #ifndef MINIMUMSHELL if (!rlist || !opep || opep -> level < 4) nl = 0; else { for (i = 0; rlist[i]; i++) printheredoc(rlist[i], fp); Xfree(rlist); rlist = NULL; nl = 1; } #endif if (trp -> next && (trp -> next) -> comm) { #ifndef MINIMUMSHELL if (nl) { VOID_C fputnl(fp); printindent(indent, fp); } else #endif if (isopfg(trp)) { #ifdef BASHSTYLE /* bash type pretty print */ VOID_C Xfputc(';', fp); printnewline(indent, fp); #else if (indent < 0) VOID_C Xfputc(';', fp); else { VOID_C fputnl(fp); printindent(indent, fp); } #endif } else if (opep) { #ifndef BASHSTYLE /* bash type pretty print */ if (opep -> level >= 4) printnewline(indent, fp); else #endif VOID_C Xfputc(' ', fp); } } #ifndef MINIMUMSHELL else if (nl) /*EMPTY*/; #endif else if (isopfg(trp)) { #ifdef BASHSTYLE /* bash type pretty print */ VOID_C Xfputc(';', fp); #else if (indent < 0) VOID_C Xfputc(';', fp); #endif } #ifdef MINIMUMSHELL if (trp -> next) printstree(trp -> next, indent, fp); VOID_C Xfflush(fp); #else if (trp -> next) rlist = _printstree(trp -> next, rlist, indent, fp); VOID_C Xfflush(fp); return(rlist); #endif } static VOID NEAR printshfunc(f, fp) shfunctable *f; XFILE *fp; { #ifdef BASHSTYLE /* bash type pretty print */ VOID_C Xfprintf(fp, "%k ()\n", f -> ident); #else VOID_C Xfprintf(fp, "%k()", f -> ident); #endif if (getstatid(statementcheck(f -> func, SM_STATEMENT)) == SM_LIST) printstree(f -> func, 0, fp); else { VOID_C Xfputs("{\n", fp); if (f -> func) { printindent(1, fp); printstree(f -> func, 1, fp); } VOID_C Xfputs("\n}", fp); } } int tinygetopt(trp, opt, nump) syntaxtree *trp; CONST char *opt; int *nump; { char **argv; int i, n, f, argc, noopt; argv = (trp -> comm) -> argv; argc = (trp -> comm) -> argc; f = '\0'; noopt = 0; if (*opt == '-') { opt++; noopt++; } for (n = 1; n < argc; n++) { if (!argv[n] || argv[n][0] != '-') break; if (argv[n][1] == '-' && !(argv[n][2])) { n++; break; } for (i = 1; argv[n][i]; i++) { if (Xstrchr(opt, argv[n][i])) /*EMPTY*/; else if (noopt) break; else { execerror(argv, argv[n], ER_BADOPTIONS, 2); return(-1); } f = argv[n][i]; } if (!f) break; } if (nump) *nump = n; return(f); } static int NEAR dochild(trp) syntaxtree *trp; { #if MSDOS # ifdef DEP_PSEUDOPATH int drv; # endif char **svar, **evar, **elist, **rlist, cwd[MAXPATHLEN]; u_long esize; int blevel, clevel; #else /* !MSDOS */ syntaxtree *body; p_id_t pid; #endif /* !MSDOS */ int ret; #if MSDOS if (!Xgetwd(cwd)) return(RET_FAIL); # ifdef DEP_PSEUDOPATH if ((drv = preparedrv(cwd, NULL, NULL)) < 0) { doperror(NULL, cwd); return(RET_FAIL); } # endif svar = shellvar; evar = exportvar; esize = exportsize; elist = exportlist; rlist = ronlylist; blevel = breaklevel; clevel = continuelevel; shellvar = duplvar(shellvar, 0); exportvar = duplvar(exportvar, 0); exportlist = duplvar(exportlist, 0); ronlylist = duplvar(ronlylist, 0); breaklevel = continuelevel = 0; childdepth++; ret = exec_stree(statementbody(trp), 0); childdepth--; freevar(shellvar); freevar(exportvar); freevar(exportlist); freevar(ronlylist); shellvar = svar; exportvar = evar; exportsize = esize; exportlist = elist; ronlylist = rlist; breaklevel = blevel; continuelevel = clevel; if (chdir3(cwd, 1) < 0) ret = RET_FAIL; # ifdef DEP_PSEUDOPATH shutdrv(drv); # endif return(ret); #else /* !MSDOS */ body = statementbody(trp); if ((pid = makechild(1, (p_id_t)-1)) < (p_id_t)0) return(-1); else if (!pid) { childdepth++; # ifndef NOJOB VOID_C stackjob(mypid, 0, -1, body); # endif ret = exec_stree(body, 0); prepareexit(1); Xexit((ret >= 0) ? ret : RET_NOTEXEC); } else { # ifndef NOJOB VOID_C stackjob(pid, 0, -1, body); # endif if (isopbg(trp) || isopnown(trp)) return(RET_SUCCESS); ret = waitchild(pid, trp); if (ret == RET_NOTEXEC) ret = -1; if (ret < 0) breaklevel = loopdepth; } return(ret); #endif /* !MSDOS */ } static int NEAR doif(trp) syntaxtree *trp; { syntaxtree *cond, *body; int ret; cond = statementbody(trp); if (!(body = statementcheck(trp -> next, SM_THEN))) return(-1); if ((ret = exec_stree(cond, 1)) < 0 || returnlevel) return(ret); if (interrupted) return(RET_INTR); if (ret_status == RET_SUCCESS) return(exec_stree(body, 0)); if (!(trp = (trp -> next) -> next)) return(RET_SUCCESS); body = statementbody(trp); if (interrupted) return(RET_INTR); if ((trp -> comm) -> id == SM_ELSE) return(exec_stree(body, 0)); if ((trp -> comm) -> id == SM_ELIF) return(doif(trp)); return(seterrno(EINVAL)); } static int NEAR dowhile(trp) syntaxtree *trp; { syntaxtree *cond, *body; int ret, tmp; cond = statementbody(trp); if (!(body = statementcheck(trp -> next, SM_DO))) return(-1); ret = RET_SUCCESS; loopdepth++; for (;;) { if ((tmp = exec_stree(cond, 1)) < 0 || returnlevel) { ret = tmp; break; } if (ret_status != RET_SUCCESS) break; if (interrupted) { ret = RET_INTR; break; } if ((ret = exec_stree(body, 0)) < 0 || returnlevel) break; if (interrupted) { ret = RET_INTR; break; } if (breaklevel) { breaklevel--; break; } if (continuelevel && --continuelevel) break; } loopdepth--; return(ret); } static int NEAR dountil(trp) syntaxtree *trp; { syntaxtree *cond, *body; int ret, tmp; cond = statementbody(trp); if (!(body = statementcheck(trp -> next, SM_DO))) return(-1); ret = RET_SUCCESS; loopdepth++; for (;;) { if ((tmp = exec_stree(cond, 1)) < 0 || returnlevel) { ret = tmp; break; } #ifndef BASHSTYLE /* bash ignores "break" in the "until" condition */ if (breaklevel) { breaklevel--; break; } #endif if (ret_status == RET_SUCCESS) break; if (interrupted) { ret = RET_INTR; break; } if ((ret = exec_stree(body, 0)) < 0 || returnlevel) break; if (interrupted) { ret = RET_INTR; break; } #ifdef BASHSTYLE /* bash ignores "break" in the "until" condition */ if (breaklevel) { breaklevel--; break; } #endif if (continuelevel && --continuelevel) break; } loopdepth--; return(ret); } static int NEAR dofor(trp) syntaxtree *trp; { syntaxtree *var, *body; command_t *comm; char *tmp, *ident, **argv; int i, argc, ret; var = statementbody(trp); body = statementbody(trp -> next); comm = var -> comm; ident = comm -> argv[0]; if (identcheck(ident, '\0') <= 0) { execerror(NULL, ident, ER_NOTIDENT, 0); return(RET_FAIL); } trp = trp -> next; if ((trp -> comm) -> id != SM_IN) argv = duplvar(&(argvar[1]), 0); else { if (!(comm = body -> comm)) return(seterrno(EINVAL)); trp = trp -> next; argv = (char **)Xmalloc((comm -> argc + 1) * sizeof(char *)); for (i = 0; i < comm -> argc; i++) { tmp = evalvararg(comm -> argv[i], EA_BACKQ, 0); if (!tmp) { while (--i >= 0) Xfree(argv[i]); Xfree(argv); return(RET_FAIL); } argv[i] = tmp; } argv[i] = NULL; argc = evalifs(comm -> argc, &argv, getifs()); if (!noglob) { #ifdef DEP_FILECONV nokanjifconv++; #endif argc = evalglob(argc, &argv, EA_STRIPQ); #ifdef DEP_FILECONV nokanjifconv--; #endif } else for (i = 0; i < argc; i++) stripquote(argv[i], EA_STRIPQ); #ifdef FD if (replaceargs(&argc, &argv, NULL, -1) < 0) { freevar(argv); return(-1); } #endif } if (!(body = statementcheck(trp, SM_DO))) { freevar(argv); return(-1); } ret = RET_SUCCESS; loopdepth++; for (i = 0; argv[i]; i++) { if (interrupted) { ret = RET_INTR; break; } if (setenv2(ident, argv[i], 0) < 0) break; if ((ret = exec_stree(body, 0)) < 0 || returnlevel) break; if (interrupted) { ret = RET_INTR; break; } if (breaklevel) { breaklevel--; break; } if (continuelevel && --continuelevel) break; } loopdepth--; freevar(argv); return(ret); } static int NEAR docase(trp) syntaxtree *trp; { syntaxtree *var, *body; command_t *comm; reg_ex_t *re; char *tmp, *key; int i, n, ret; var = statementbody(trp); comm = var -> comm; key = evalvararg(comm -> argv[0], EA_BACKQ | EA_STRIPQLATER, 0); if (!key) return(RET_FAIL); #ifdef FD demacroarg(&key); #endif ret = RET_SUCCESS; for (trp = trp -> next; trp; trp = (trp -> next) -> next) { if (!(trp -> next)) break; if (interrupted) { ret = RET_INTR; break; } var = statementbody(trp); if (!(body = statementcheck(trp -> next, SM_RPAREN))) { ret = -1; break; } if (!(comm = var -> comm)) break; ret = -1; for (i = 0; i < comm -> argc; i++) { tmp = evalvararg(comm -> argv[i], EA_BACKQ, 0); if (!tmp) { ret = RET_FAIL; break; } #ifdef FD demacroarg(&tmp); #endif re = regexp_init(tmp, -1); Xfree(tmp); if (!re) continue; n = regexp_exec(re, key, 0); regexp_free(re); if (n) { ret = exec_stree(body, 0); break; } if (interrupted) { ret = RET_INTR; break; } } if (ret >= 0) break; ret = RET_SUCCESS; } Xfree(key); return(ret); } static int NEAR dolist(trp) syntaxtree *trp; { return(exec_stree(statementbody(trp), 0)); } /*ARGSUSED*/ static int NEAR donull(trp) syntaxtree *trp; { return(RET_SUCCESS); } static int NEAR dobreak(trp) syntaxtree *trp; { int n; if (!loopdepth) return(RET_FAIL); else if ((trp -> comm) -> argc <= 1) breaklevel = 1; else if ((n = isnumeric((trp -> comm) -> argv[1])) < 0) { execerror((trp -> comm) -> argv, (trp -> comm) -> argv[1], ER_BADNUMBER, 0); return(RET_FAIL); } #ifndef BASHSTYLE /* bash ignores "break 0" */ else if (!n) breaklevel = -1; #endif else if (n > loopdepth) breaklevel = loopdepth; else breaklevel = n; return(RET_SUCCESS); } static int NEAR docontinue(trp) syntaxtree *trp; { int n; if (!loopdepth) return(RET_FAIL); else if ((trp -> comm) -> argc <= 1) continuelevel = 1; else if ((n = isnumeric((trp -> comm) -> argv[1])) < 0) { execerror((trp -> comm) -> argv, (trp -> comm) -> argv[1], ER_BADNUMBER, 0); return(RET_FAIL); } #ifndef BASHSTYLE /* bash ignores "break 0" */ else if (!n) continuelevel = -1; #endif else if (n > loopdepth) continuelevel = loopdepth; else continuelevel = n; return(RET_SUCCESS); } static int NEAR doreturn(trp) syntaxtree *trp; { int ret; if (!shfunclevel) { execerror((trp -> comm) -> argv, NULL, ER_CANNOTRET, 0); return(RET_FAIL); } if ((trp -> comm) -> argc <= 1) ret = ret_status; else if ((ret = isnumeric((trp -> comm) -> argv[1])) < 0) { execerror((trp -> comm) -> argv, (trp -> comm) -> argv[1], ER_BADNUMBER, 0); ret = RET_FAIL; #ifdef BASHSTYLE /* bash ignores "return -1" */ return(ret); #endif } returnlevel = shfunclevel; return(ret); } static int NEAR execpath(comm, errexit) command_t *comm; int errexit; { char *path, **evar; path = evalexternal(comm); if (!errexit && !path) return(RET_NOTFOUND); path = Xstrdup(path); evar = exportvar; exportvar = NULL; if (errexit && !path) { #ifdef DEBUG freevar(evar); #endif Xexit2(RET_FAIL); } #ifndef NOJOB if (loginshell && interactive_io) killjob(); #endif prepareexit(1); #ifdef FD prepareexitfd(0); #endif Xexecve2(path, comm -> argv, evar, 0); return(RET_NOTEXEC); } static int NEAR doexec(trp) syntaxtree *trp; { command_t *comm; comm = trp -> comm; if (cancelredirect(comm -> redp) < 0) return(RET_FAIL); if (comm -> argc >= 2) { if (restricted) { execerror(comm -> argv, comm -> argv[1], ER_RESTRICTED, 2); return(RET_FAIL); } Xfree(comm -> argv[0]); memmove((char *)(&(comm -> argv[0])), (char *)(&(comm -> argv[1])), (comm -> argc)-- * sizeof(char *)); searchheredoc(trp, 1); #ifdef BASHSTYLE /* bash ignores the unexecutable external command */ return(execpath(comm, 0)); #else return(execpath(comm, 1)); #endif } if (!isopbg(trp) && !isopnown(trp) && comm -> redp) { if (ttyio < 0) /*EMPTY*/; else if (definput == ttyio && !isatty(STDIN_FILENO)) definput = STDIN_FILENO; else if (definput == STDIN_FILENO && isatty(STDIN_FILENO)) definput = ttyio; } return(RET_SUCCESS); } #ifndef MINIMUMSHELL /*ARGSUSED*/ static int NEAR dologin(trp) syntaxtree *trp; { # if MSDOS return(RET_SUCCESS); # else /* !MSDOS */ searchheredoc(trp, 1); return(execpath(trp -> comm, 0)); # endif /* !MSDOS */ } static int NEAR dologout(trp) syntaxtree *trp; { if ((!loginshell && interactive_io) || exit_status < 0) { execerror((trp -> comm) -> argv, NULL, ER_NOTLOGINSH, 0); return(RET_FAIL); } return(doexit(trp)); } #endif /* !MINIMUMSHELL */ static int NEAR doeval(trp) syntaxtree *trp; { #ifndef MINIMUMSHELL long dupshlineno; #endif syntaxtree *stree; char *cp; int ret; if ((trp -> comm) -> argc <= 1 || !(cp = catvar(&((trp -> comm) -> argv[1]), ' '))) return(RET_SUCCESS); #ifdef BASHSTYLE /* bash displays arguments of "eval", in -v mode */ if (verboseinput) { argfputs(cp, Xstderr); VOID_C fputnl(Xstderr); } #endif #ifndef MINIMUMSHELL dupshlineno = shlineno; setshlineno(1L); #endif trp = stree = newstree(NULL); #ifndef NOJOB childpgrp = (p_id_t)-1; #endif trp = execline(cp, stree, trp, 1); execline((char *)-1, stree, trp, 1); ret = (syntaxerrno) ? RET_SYNTAXERR : ret_status; Xfree(stree); Xfree(cp); #ifndef MINIMUMSHELL setshlineno(dupshlineno); #endif return(ret); } static int NEAR doexit(trp) syntaxtree *trp; { int ret; if ((trp -> comm) -> argc <= 1) ret = ret_status; else if ((ret = isnumeric((trp -> comm) -> argv[1])) < 0) { execerror((trp -> comm) -> argv, (trp -> comm) -> argv[1], ER_BADNUMBER, 0); ret = RET_FAIL; #ifdef BASHSTYLE /* bash ignores "exit -1" */ return(ret); #endif } if (exit_status < 0) exit_status = ret; else Xexit2(ret); return(RET_SUCCESS); } static int NEAR doread(trp) syntaxtree *trp; { char *cp, *next, *buf, *ifs; int n, top, opt, ret; if ((opt = tinygetopt(trp, "N", &top)) < 0) return(RET_FAIL); for (n = top; n < (trp -> comm) -> argc; n++) { if (identcheck((trp -> comm) -> argv[n], '\0') <= 0) { execerror((trp -> comm) -> argv, (trp -> comm) -> argv[n], ER_NOTIDENT, 0); return(RET_FAIL); } } ifs = getifs(); ret = RET_SUCCESS; buf = readline(STDIN_FILENO, opt); if (buf == vnullstr) ret = RET_FAIL; else if (!buf) { if (errno != EINTR) doperror((trp -> comm) -> argv[0], NULL); ret = RET_FAIL; } else if ((trp -> comm) -> argc > top) { cp = buf; for (n = top; n < (trp -> comm) -> argc - 1; n++) { if (!*cp) next = cp; else if (!(next = strpbrk(cp, ifs))) next = cp + strlen(cp); else do { *(next++) = '\0'; } while (Xstrchr(ifs, *next)); if (setenv2((trp -> comm) -> argv[n], cp, 0) < 0) { ret = RET_FAIL; cp = NULL; break; } cp = next; } if (cp && setenv2((trp -> comm) -> argv[n], cp, 0) < 0) ret = RET_FAIL; } #ifdef BASHSTYLE /* bash set the variable REPLY without any argument */ else if (setenv2(ENVREPLY, buf, 0) < 0) ret = RET_FAIL; #endif if (buf != vnullstr) Xfree(buf); return(ret); } static int NEAR doshift(trp) syntaxtree *trp; { int i, n, ret; if ((trp -> comm) -> argc <= 1) n = 1; else if ((n = isnumeric((trp -> comm) -> argv[1])) < 0) { execerror((trp -> comm) -> argv, (trp -> comm) -> argv[1], ER_BADNUMBER, 0); return(RET_FAIL); } else if (!n) return(RET_SUCCESS); for (i = 0; i < n; i++) { if (!argvar[i + 1]) break; Xfree(argvar[i + 1]); } ret = (i >= n) ? RET_SUCCESS : RET_FAIL; n = i; for (i = 0; argvar[i + n + 1]; i++) argvar[i + 1] = argvar[i + n + 1]; argvar[i + 1] = NULL; if (ret != RET_SUCCESS) execerror((trp -> comm) -> argv, NULL, ER_CANNOTSHIFT, 0); return(ret); } static int NEAR doset(trp) syntaxtree *trp; { shfunctable *func; char **var, **argv; int i, n, argc; argc = (trp -> comm) -> argc; argv = (trp -> comm) -> argv; if (argc <= 1) { var = duplvar(shellvar, 0); i = countvar(var); if (i > 1) qsort(var, i, sizeof(char *), cmppath); for (i = 0; var[i]; i++) { #ifdef BASHSTYLE /* bash's "set" quotes the value which includes any meta chacters */ var[i] = quotemeta(var[i]); #endif kanjifputs(var[i], Xstdout); putnl(); } freevar(var); func = duplfunc(shellfunc); for (i = 0; func[i].ident; i++) /*EMPTY*/; if (i > 1) qsort(func, i, sizeof(shfunctable), cmpfunc); for (i = 0; func[i].ident; i++) { printshfunc(&(func[i]), Xstdout); putnl(); } freefunc(func); return(RET_SUCCESS); } if ((n = getoption(argc, argv, 0)) < 0) return(RET_FAIL); #ifdef BASHSTYLE /* bash makes -e option effective immediately */ errorexit = tmperrorexit; #endif if (n > 2) { if (argc <= 2) { for (i = 0; i < FLAGSSIZ; i++) { if (!(shflaglist[i].ident)) continue; VOID_C Xprintf("%-16.16s%s\n", shflaglist[i].ident, (*(shflaglist[i].var)) ? "on" : "off"); } } else { for (i = 0; i < FLAGSSIZ; i++) { if (!(shflaglist[i].ident)) continue; if (!strcmp(argv[2], shflaglist[i].ident)) break; } if (i >= FLAGSSIZ) { execerror(argv, argv[2], ER_BADOPTIONS, 0); return(RET_FAIL); } setshflag(i, (n <= 3) ? 1 : 0); } n = 3; } if (n >= argc) return(RET_SUCCESS); var = argvar; argvar = (char **)Xmalloc((argc - n + 2) * sizeof(char *)); argvar[0] = Xstrdup(var[0]); for (i = 1; n < argc; i++, n++) argvar[i] = Xstrdup(argv[n]); argvar[i] = NULL; freevar(var); #ifdef DEP_PTY sendparent(TE_SETVAR, &argvar, argvar); #endif return(RET_SUCCESS); } static int NEAR dounset(trp) syntaxtree *trp; { char **argv; int i, n, len, ret; argv = (trp -> comm) -> argv; ret = RET_SUCCESS; for (i = 1; i < (trp -> comm) -> argc; i++) { len = strlen(argv[i]); if (getshellvar(argv[i], len)) n = unset(argv[i], len); else n = unsetshfunc(argv[i], len); if (n < 0) { ret = RET_FAIL; ERRBREAK; } } return(ret); } #ifndef _NOUSEHASH static int NEAR dohash(trp) syntaxtree *trp; { hashlist *hp; int i, n, ret; if ((trp -> comm) -> argc <= 1) { disphash(); return(RET_SUCCESS); } if (!strcmp((trp -> comm) -> argv[1], "-r")) { VOID_C searchhash(NULL, NULL, NULL); return(RET_SUCCESS); } ret = RET_SUCCESS; for (i = 1; i < (trp -> comm) -> argc; i++) { n = searchhash(&hp, (trp -> comm) -> argv[i], NULL); if (n & CM_NOTFOUND) { execerror((trp -> comm) -> argv, (trp -> comm) -> argv[i], ER_NOTFOUND, 1); ret = RET_FAIL; ERRBREAK; } if (!(n & CM_HASH)) continue; hp -> hits = 0; } return(ret); } #endif /* !_NOUSEHASH */ static int NEAR dochdir(trp) syntaxtree *trp; { #ifdef FD int opt, dupphysical_path; #endif char *cp, *tmp, *dir, *path, *next; int n, dlen, len, size; #ifdef FD if ((opt = tinygetopt(trp, "LP", &n)) < 0) return(RET_FAIL); #else n = 1; #endif /* !FD */ if (n < (trp -> comm) -> argc) dir = (trp -> comm) -> argv[n]; else if (!(dir = getconstvar(ENVHOME))) { execerror((trp -> comm) -> argv, (trp -> comm) -> argv[0], ER_NOHOMEDIR, 0); return(RET_FAIL); } else if (!*dir) return(RET_SUCCESS); #ifdef FD dupphysical_path = physical_path; if (opt) physical_path = (opt == 'P') ? 1 : 0; #endif if (isrootdir(dir)) next = NULL; #ifdef DEP_DOSPATH else if (_dospath(dir)) next = NULL; #endif #ifdef FD # ifdef DEP_DOSDRIVE else if (dir[0] && !dir[1] && Xstrchr(".?-@", dir[0])) next = NULL; # else else if (dir[0] && !dir[1] && Xstrchr(".?-", dir[0])) next = NULL; # endif #endif /* FD */ else if ((next = getconstvar(ENVCDPATH))) { tmp = ((cp = strdelim(dir, 0))) ? Xstrndup(dir, cp - dir) : dir; if (isdotdir(tmp)) next = NULL; if (tmp != dir) Xfree(tmp); } if (!next) { if (chdir4(dir, 0, NULL) >= 0) { #ifdef FD physical_path = dupphysical_path; #endif return(RET_SUCCESS); } } else { len = strlen(dir); size = 0; path = NULL; for (cp = next; cp; cp = next) { #ifdef DEP_DOSPATH if (_dospath(cp)) next = Xstrchr(&(cp[2]), PATHDELIM); else #endif next = Xstrchr(cp, PATHDELIM); dlen = (next) ? (next++) - cp : strlen(cp); if (!dlen) tmp = NULL; else { tmp = _evalpath(cp, cp + dlen, 0); dlen = strlen(tmp); } if (dlen + len + 1 + 1 > size) { size = dlen + len + 1 + 1; path = Xrealloc(path, size); } if (tmp) { Xstrncpy(path, tmp, dlen); Xfree(tmp); dlen = strcatdelim(path) - path; } Xstrncpy(&(path[dlen]), dir, len); if (chdir4(path, 1, NULL) >= 0) { kanjifputs(path, Xstdout); putnl(); Xfree(path); #ifdef FD physical_path = dupphysical_path; #endif return(RET_SUCCESS); } } Xfree(path); } execerror((trp -> comm) -> argv, dir, ER_BADDIR, 0); #ifdef FD physical_path = dupphysical_path; #endif return(RET_FAIL); } static int NEAR dopwd(trp) syntaxtree *trp; { #ifdef FD int opt; #endif char buf[MAXPATHLEN]; #ifdef FD if ((opt = tinygetopt(trp, "LP", NULL)) < 0) return(RET_FAIL); if (!((opt) ? (opt == 'P') : physical_path)) Xstrcpy(buf, fullpath); else #endif if (!Xgetwd(buf)) { execerror((trp -> comm) -> argv, NULL, ER_CANNOTSTAT, 0); return(RET_FAIL); } kanjifputs(buf, Xstdout); putnl(); return(RET_SUCCESS); } static int NEAR dosource(trp) syntaxtree *trp; { #ifdef BASHSTYLE char **var, **dupargvar; #endif hashlist *hp; CONST char *fname; int n, fd; if ((trp -> comm) -> argc <= 1) return(RET_SUCCESS); fname = (trp -> comm) -> argv[1]; n = searchhash(&hp, fname, NULL); if (restricted && (n & CM_FULLPATH)) { execerror((trp -> comm) -> argv, fname, ER_RESTRICTED, 2); return(RET_FAIL); } if (n & CM_NOTFOUND) { execerror((trp -> comm) -> argv, fname, ER_NOTFOUND, 1); return(RET_FAIL); } if ((fd = newdup(Kopen(fname, O_TEXT | O_RDONLY, 0666))) < 0) { doperror((trp -> comm) -> argv[0], fname); return(RET_FAIL); } #ifdef BASHSTYLE /* bash sets positional parameters with source arguments */ if ((trp -> comm) -> argc > 2) { dupargvar = argvar; argvar = (char **)Xmalloc((trp -> comm) -> argc * sizeof(char *)); argvar[0] = Xstrdup(dupargvar[0]); for (n = 1; n < (trp -> comm) -> argc - 1; n++) argvar[n] = Xstrdup((trp -> comm) -> argv[n + 1]); argvar[n] = NULL; var = argvar; sourcefile(fd, fname, 0); safeclose(fd); if (var != argvar) freevar(dupargvar); else { freevar(argvar); argvar = dupargvar; } } else #endif /* BASHSTYLE */ { sourcefile(fd, fname, 0); safeclose(fd); } return(ret_status); } static int NEAR expandlist(varp, ident) char ***varp; CONST char *ident; { #ifndef MINIMUMSHELL char *cp; #endif int len; #ifdef MINIMUMSHELL len = identcheck(ident, '\0'); #else len = identcheck(ident, '='); #endif if (!len) { execerror(NULL, ident, ER_NOTIDENT, 0); return(-1); } #ifndef MINIMUMSHELL else if (len < 0) len = -len; else if (_putshellvar(cp = Xstrdup(ident), len) < 0) { Xfree(cp); return(-1); } #endif *varp = expandvar(*varp, ident, len); return(len); } int setexport(ident) CONST char *ident; { int i, len; if ((len = expandlist(&exportlist, ident)) < 0) return(-1); if ((i = searchvar(shellvar, ident, len, '=')) >= 0) exportvar = putvar(exportvar, Xstrdup(shellvar[i]), len); return(len); } int setronly(ident) CONST char *ident; { return(expandlist(&ronlylist, ident)); } static int NEAR doexport(trp) syntaxtree *trp; { char **argv; int i, n, ret; argv = (trp -> comm) -> argv; if ((trp -> comm) -> argc <= 1) { for (i = 0; exportlist[i]; i++) VOID_C Xprintf("export %k\n", exportlist[i]); return(RET_SUCCESS); } ret = RET_SUCCESS; for (n = 1; n < (trp -> comm) -> argc; n++) { if (setexport(argv[n]) < 0) { ret = RET_FAIL; ERRBREAK; } #ifdef DEP_PTY sendparent(TE_SETEXPORT, argv[n]); #endif } return(ret); } static int NEAR doreadonly(trp) syntaxtree *trp; { char **argv; int i, n, ret; argv = (trp -> comm) -> argv; if ((trp -> comm) -> argc <= 1) { for (i = 0; ronlylist[i]; i++) { VOID_C Xprintf("readonly %k\n", ronlylist[i]); } return(RET_SUCCESS); } ret = RET_SUCCESS; for (n = 1; n < (trp -> comm) -> argc; n++) { if (setronly(argv[n]) < 0) { ret = RET_FAIL; ERRBREAK; } #ifdef DEP_PTY sendparent(TE_SETRONLY, argv[n]); #endif } return(ret); } /*ARGSUSED*/ static int NEAR dotimes(trp) syntaxtree *trp; { time_t usrtime, systime; #ifdef USEGETRUSAGE struct rusage ru; getrusage(RUSAGE_CHILDREN, &ru); usrtime = ru.ru_utime.tv_sec; systime = ru.ru_stime.tv_sec; #else /* !USEGETRUSAGE */ # ifdef USETIMES struct tms buf; int clk; times(&buf); clk = CLKPERSEC; usrtime = buf.tms_cutime / clk; if (buf.tms_cutime % clk > clk / 2) usrtime++; systime = buf.tms_cstime / clk; if (buf.tms_cstime % clk > clk / 2) systime++; # else usrtime = systime = (time_t)0; # endif #endif /* !USEGETRUSAGE */ VOID_C Xprintf("%dm%ds %dm%ds\n", (int)(usrtime / 60), (int)(usrtime % 60), (int)(systime / 60), (int)(systime % 60)); return(RET_SUCCESS); } /*ARGSUSED*/ static int NEAR dowait(trp) syntaxtree *trp; { #if MSDOS return(RET_SUCCESS); #else /* !MSDOS */ char *s; p_id_t pid; # ifndef NOJOB int i, n; # endif if ((trp -> comm) -> argc <= 1) { # ifdef NOJOB pid = lastpid; # else for (;;) { for (n = 0; n < maxjobs; n++) { if (!(joblist[n].pids)) continue; i = joblist[n].npipe; if (!(joblist[n].stats[i])) break; } if (n >= maxjobs) return(RET_SUCCESS); VOID_C waitchild(joblist[n].pids[i], NULL); } # endif } else { s = (trp -> comm) -> argv[1]; # ifndef NOJOB if (*s == '%') { checkjob(NULL); if ((n = getjob(s)) < 0) pid = (p_id_t)-1; else { i = joblist[n].npipe; pid = joblist[n].pids[i]; } } else # endif /* !NOJOB */ if ((pid = isnumeric(s)) < (p_id_t)0) { execerror((trp -> comm) -> argv, s, ER_BADNUMBER, 0); return(RET_FAIL); } # ifndef NOJOB else { checkjob(NULL); if (!joblist || (n = searchjob(pid, &i)) < 0) { pid = (p_id_t)-1; # ifdef FAKEUNINIT n = -1; /* fake for -Wuninitialized */ # endif } } if (pid < (p_id_t)0) { execerror((trp -> comm) -> argv, s, ER_NOSUCHJOB, 2); return(RET_FAIL); } if (joblist[n].stats[i]) return(RET_SUCCESS); # endif /* !NOJOB */ } return(waitchild(pid, NULL)); #endif /* !MSDOS */ } static int NEAR doumask(trp) syntaxtree *trp; { char *s; int i, n; if ((trp -> comm) -> argc <= 1) { n = umask(022); VOID_C umask(n); #ifdef BASHSTYLE VOID_C Xprintf("%03o\n", n & 0777); #else VOID_C Xprintf("%04o\n", n & 0777); #endif } else { s = (trp -> comm) -> argv[1]; n = 0; for (i = 0; s[i] >= '0' && s[i] <= '7'; i++) n = (n << 3) + s[i] - '0'; #ifdef BASHSTYLE if (n & ~0777) { execerror((trp -> comm) -> argv, s, ER_NUMOUTRANGE, 0); return(RET_FAIL); } #else n &= 0777; #endif VOID_C umask(n); } return(RET_SUCCESS); } /*ARGSUSED*/ static int NEAR doulimit(trp) syntaxtree *trp; { #ifdef USERESOURCEH struct rlimit lim; XFILE *fp; u_long flags; int i, j, n, err, hs, res, inf; #endif #if defined (USERESOURCEH) || defined (USEULIMITH) long val; char **argv; int argc; #endif #if !defined (USERESOURCEH) && !defined (USEULIMITH) execerror((trp -> comm) -> argv, NULL, ER_BADULIMIT, 1); return(RET_FAIL); #else /* USERESOURCEH || USEULIMITH */ argc = (trp -> comm) -> argc; argv = (trp -> comm) -> argv; # ifdef USERESOURCEH flags = (u_long)0; err = hs = 0; n = 1; if (argc > 1 && argv[1][0] == '-') { for (i = 1; !err && argv[1][i]; i++) switch (argv[1][i]) { case 'a': flags = ((u_long)1 << ULIMITSIZ) - 1; break; case 'H': hs |= 1; break; case 'S': hs |= 2; break; default: for (j = 0; j < ULIMITSIZ; j++) if (argv[1][i] == ulimitlist[j].opt) break; if (j >= ULIMITSIZ) err = 1; else flags |= ((u_long)1 << j); break; } n++; } res = -1; if (!flags) for (i = 0, flags = (u_long)1; i < ULIMITSIZ; i++, flags <<= 1) { if (ulimitlist[i].res == RLIMIT_FSIZE) { res = i; break; } } else for (i = 0; i < ULIMITSIZ; i++) { if (flags & ((u_long)1 << i)) { if (res < 0) res = i; else { res = -1; break; } } } # ifdef FAKEUNINIT val = 0L; /* fake for -Wuninitialized */ # endif if (n >= argc) { # ifdef FAKEUNINIT inf = 0; /* fake for -Wuninitialized */ # endif if (!hs) hs = 2; } else { inf = 0; if (!hs) hs = (1 | 2); if (res < 0) err = 1; else if (!strcmp(argv[n], UNLIMITED)) inf = 1; else { if ((val = isnumeric(argv[n])) < 0L) { execerror(argv, argv[n], ER_BADULIMIT, 1); return(RET_FAIL); } val *= ulimitlist[res].unit; } } if (err) { # ifdef BASHSTYLE fp = Xstderr; # else fp = Xstdout; # endif VOID_C Xfprintf(fp, "usage: %k [ -HSa", argv[0]); for (j = 0; j < ULIMITSIZ; j++) VOID_C Xfputc(ulimitlist[j].opt, fp); VOID_C Xfputs(" ] [ limit ]", fp); VOID_C fputnl(fp); # ifdef BASHSTYLE return(RET_SYNTAXERR); # else return(RET_SUCCESS); # endif } if (n >= argc) { for (i = 0; i < ULIMITSIZ; i++) if (flags & ((u_long)1 << i)) { if (res < 0) VOID_C Xprintf("%s ", ulimitlist[i].mes); if (getrlimit(ulimitlist[i].res, &lim) < 0) { execerror(argv, NULL, ER_BADULIMIT, 1); return(RET_FAIL); } if (hs & 2) { if (lim.rlim_cur == RLIM_INFINITY) puts2(UNLIMITED); else if (lim.rlim_cur) VOID_C Xprintf("%ld", lim.rlim_cur / ulimitlist[i].unit); } if (hs & 1) { if (hs & 2) putc2(':'); if (lim.rlim_max == RLIM_INFINITY) puts2(UNLIMITED); else if (lim.rlim_max) VOID_C Xprintf("%ld", lim.rlim_max / ulimitlist[i].unit); } putnl(); } } else { if (getrlimit(ulimitlist[res].res, &lim) < 0) { execerror(argv, NULL, ER_BADULIMIT, 1); return(RET_FAIL); } if (hs & 1) lim.rlim_max = (inf) ? RLIM_INFINITY : val; if (hs & 2) lim.rlim_cur = (inf) ? RLIM_INFINITY : val; if (setrlimit(ulimitlist[res].res, &lim) < 0) { execerror(argv, NULL, ER_BADULIMIT, 1); return(RET_FAIL); } } # else /* !USERESOURCEH */ if (argc <= 1) { if ((val = ulimit(UL_GETFSIZE, 0L)) < 0L) { execerror(argv, NULL, ER_BADULIMIT, 1); return(RET_FAIL); } if (val == RLIM_INFINITY) puts2(UNLIMITED); else VOID_C Xprintf("%ld", val * 512L); putnl(); } else { if (!strcmp(argv[1], UNLIMITED)) val = RLIM_INFINITY; else { if ((val = isnumeric(argv[1])) < 0L) { execerror(argv, argv[1], ER_BADULIMIT, 1); return(RET_FAIL); } val /= 512L; } if (ulimit(UL_SETFSIZE, val) < 0L) { execerror(argv, NULL, ER_BADULIMIT, 1); return(RET_FAIL); } } # endif /* !USERESOURCEH */ return(RET_SUCCESS); #endif /* USERESOURCEH || USEULIMITH */ } static int NEAR dotrap(trp) syntaxtree *trp; { sigcst_t func; char *comm, **argv; int i, n, sig; argv = (trp -> comm) -> argv; if ((trp -> comm) -> argc <= 1) { for (i = 0; i < NSIG; i++) { if ((trapmode[i] & TR_STAT) != TR_TRAP) continue; VOID_C Xprintf("%d: %k\n", i, trapcomm[i]); } return(RET_SUCCESS); } n = 1; comm = (isnumeric(argv[n]) < 0) ? argv[n++] : NULL; for (; n < (trp -> comm) -> argc; n++) { if ((sig = isnumeric(argv[n])) < 0) { execerror(argv, argv[n], ER_BADNUMBER, 0); return(RET_FAIL); } if (sig >= NSIG) { execerror(argv, argv[n], ER_BADTRAP, 0); return(RET_FAIL); } if (!sig) { trapmode[0] = (comm) ? TR_TRAP : 0; Xfree(trapcomm[0]); trapcomm[0] = Xstrdup(comm); continue; } for (i = 0; signallist[i].sig >= 0; i++) if (sig == signallist[i].sig) break; if (signallist[i].sig < 0 || (signallist[i].flags & TR_NOTRAP)) { execerror(argv, argv[n], ER_BADTRAP, 0); return(RET_FAIL); } VOID_C signal2(sig, SIG_IGN); Xfree(trapcomm[sig]); func = (sigcst_t)(signallist[i].func); if (!comm) { trapmode[sig] = signallist[i].flags; trapcomm[sig] = NULL; if (!(trapmode[sig] & TR_BLOCK)) func = oldsigfunc[sig]; } else { trapmode[sig] = TR_TRAP; trapcomm[sig] = Xstrdup(comm); if ((signallist[i].flags & TR_STAT) == TR_STOP) func = SIG_DFL; } VOID_C signal2(sig, func); } return(RET_SUCCESS); } #ifndef NOJOB static int NEAR dojobs(trp) syntaxtree *trp; { return(posixjobs(trp)); } static int NEAR dofg(trp) syntaxtree *trp; { return(posixfg(trp)); } static int NEAR dobg(trp) syntaxtree *trp; { return(posixbg(trp)); } static int NEAR dodisown(trp) syntaxtree *trp; { char *s; int n; s = ((trp -> comm) -> argc > 1) ? (trp -> comm) -> argv[1] : NULL; checkjob(NULL); if ((n = getjob(s)) < 0) { execerror((trp -> comm) -> argv, (trp -> comm) -> argv[1], (n < -1) ? ER_TERMINATED : ER_NOSUCHJOB, 2); return(RET_FAIL); } freejob(n); return(RET_SUCCESS); } #endif /* !NOJOB */ int typeone(s, fp) CONST char *s; XFILE *fp; { hashlist *hp; CONST VOID_P vp; int type; kanjifputs(s, fp); type = checktype2(s, &vp, 1, 1); if (type == CT_BUILTIN) VOID_C Xfputs(" is a shell builtin", fp); #ifdef FD else if (type == CT_FDORIGINAL) VOID_C Xfputs(" is a FDclone builtin", fp); else if (type == CT_FDINTERNAL) VOID_C Xfputs(" is a FDclone internal", fp); #endif #if MSDOS else if (type == CT_LOGDRIVE) VOID_C Xfputs(" is a change drive command", fp); #endif else if (type == CT_FUNCTION) { VOID_C Xfputs(" is a function\n", fp); printshfunc((shfunctable *)vp, fp); } #ifndef NOALIAS else if (type == CT_ALIAS) VOID_C Xfprintf(fp, " is a aliased to `%k'", ((shaliastable *)vp) -> comm); #endif else { type = searchhash(&hp, s, NULL); #ifdef _NOUSEHASH if (!(type & CM_FULLPATH)) s = (char *)hp; #else if (type & CM_HASH) s = hp -> path; #endif if (restricted && (type & CM_FULLPATH)) VOID_C Xfputs(": restricted", fp); else if ((type & CM_NOTFOUND) || Xaccess(s, X_OK) < 0) { VOID_C Xfputs(" not found", fp); VOID_C fputnl(fp); return(-1); } else VOID_C Xfprintf(fp, " is %k", s); } VOID_C fputnl(fp); return(0); } static int NEAR dotype(trp) syntaxtree *trp; { int i, ret; if ((trp -> comm) -> argc <= 1) return(RET_SUCCESS); #ifdef BASHSTYLE ret = RET_FAIL; #else ret = RET_SUCCESS; #endif for (i = 1; i < (trp -> comm) -> argc; i++) { if (typeone((trp -> comm) -> argv[i], Xstdout) >= 0) #ifdef BASHSTYLE ret = RET_SUCCESS; #else /*EMPTY*/; else ret = RET_FAIL; #endif } return(ret); } #ifdef DOSCOMMAND static int NEAR dodir(trp) syntaxtree *trp; { return(doscomdir((trp -> comm) -> argc, (trp -> comm) -> argv)); } static int NEAR domkdir(trp) syntaxtree *trp; { return(doscommkdir((trp -> comm) -> argc, (trp -> comm) -> argv)); } static int NEAR dormdir(trp) syntaxtree *trp; { return(doscomrmdir((trp -> comm) -> argc, (trp -> comm) -> argv)); } static int NEAR doerase(trp) syntaxtree *trp; { return(doscomerase((trp -> comm) -> argc, (trp -> comm) -> argv)); } static int NEAR dorename(trp) syntaxtree *trp; { return(doscomrename((trp -> comm) -> argc, (trp -> comm) -> argv)); } static int NEAR docopy(trp) syntaxtree *trp; { return(doscomcopy((trp -> comm) -> argc, (trp -> comm) -> argv)); } static int NEAR docls(trp) syntaxtree *trp; { return(doscomcls((trp -> comm) -> argc, (trp -> comm) -> argv)); } static int NEAR dodtype(trp) syntaxtree *trp; { return(doscomtype((trp -> comm) -> argc, (trp -> comm) -> argv)); } #endif /* DOSCOMMAND */ #ifndef NOALIAS static int NEAR doalias(trp) syntaxtree *trp; { return(posixalias(trp)); } static int NEAR dounalias(trp) syntaxtree *trp; { return(posixunalias(trp)); } #endif /* NOALIAS */ static int NEAR doecho(trp) syntaxtree *trp; { int i, n, opt; n = 1; if ((opt = tinygetopt(trp, "-nN", NULL)) < 0) return(RET_FAIL); if (opt) n++; for (i = n; i < (trp -> comm) -> argc; i++) { if (i > n) putc2(' '); if ((trp -> comm) -> argv[i]) argfputs((trp -> comm) -> argv[i], Xstdout); } if (opt == 'n') /*EMPTY*/; else if (opt == 'N') puts2("\r\n"); else putnl(); VOID_C Xfflush(Xstdout); return(RET_SUCCESS); } #ifndef MINIMUMSHELL static int NEAR dokill(trp) syntaxtree *trp; { return(posixkill(trp)); } static int NEAR dotest(trp) syntaxtree *trp; { return(posixtest(trp)); } #endif /* !MINIMUMSHELL */ #ifndef NOPOSIXUTIL /*ARGSUSED*/ static int NEAR dofalse(trp) syntaxtree *trp; { return(RET_FAIL); } static int NEAR docommand(trp) syntaxtree *trp; { return(posixcommand(trp)); } static int NEAR dogetopts(trp) syntaxtree *trp; { return(posixgetopts(trp)); } /*ARGSUSED*/ static int NEAR donewgrp(trp) syntaxtree *trp; { #if MSDOS return(RET_SUCCESS); #else /* !MSDOS */ searchheredoc(trp, 1); return(execpath(trp -> comm, 0)); #endif /* !MSDOS */ } # if 0 /* exists in FD original builtin */ static int NEAR dofc(trp) syntaxtree *trp; { return(RET_SUCCESS); } # endif #endif /* NOPOSIXUTIL */ #ifndef MINIMUMSHELL static int NEAR getworkdir(path) char *path; { # ifdef FD if (underhome(&(path[1]))) path[0] = '~'; else Xstrcpy(path, fullpath); # else if (!Xgetwd(path)) { execerror(NULL, NULL, ER_CANNOTSTAT, 0); return(-1); } # endif return(0); } static int NEAR dopushd(trp) syntaxtree *trp; { char *cp, path[MAXPATHLEN]; int n; if (getworkdir(path) < 0) return(RET_FAIL); if ((trp -> comm) -> argc < 2) { if (!dirstack || !dirstack[0]) { execerror((trp -> comm) -> argv, NULL, ER_DIREMPTY, 2); return(RET_FAIL); } cp = evalpath(Xstrdup(dirstack[0]), 0); n = chdir4(cp, 1, NULL); Xfree(cp); if (n < 0) { execerror((trp -> comm) -> argv, dirstack[0], ER_BADDIR, 0); return(RET_FAIL); } Xfree(dirstack[0]); # ifdef DEP_PTY sendparent(TE_POPVAR, &dirstack); # endif } else { if (chdir4((trp -> comm) -> argv[1], 0, NULL) < 0) { execerror((trp -> comm) -> argv, (trp -> comm) -> argv[1], ER_BADDIR, 0); return(RET_FAIL); } n = countvar(dirstack); dirstack = (char **)Xrealloc(dirstack, (n + 1 + 1) * sizeof(char *)); memmove((char *)&(dirstack[1]), (char *)&(dirstack[0]), n * sizeof(char *)); dirstack[n + 1] = NULL; } dirstack[0] = Xstrdup(path); dodirs(trp); # ifdef DEP_PTY sendparent(TE_PUSHVAR, &dirstack, path); # endif return(RET_SUCCESS); } static int NEAR dopopd(trp) syntaxtree *trp; { char *cp; int n; if (!dirstack || !dirstack[0]) { execerror((trp -> comm) -> argv, NULL, ER_DIREMPTY, 2); return(RET_FAIL); } cp = evalpath(Xstrdup(dirstack[0]), 0); n = chdir4(cp, 1, NULL); Xfree(cp); if (n < 0) { execerror((trp -> comm) -> argv, dirstack[0], ER_BADDIR, 0); return(RET_FAIL); } n = countvar(dirstack); Xfree(dirstack[0]); memmove((char *)&(dirstack[0]), (char *)&(dirstack[1]), n * sizeof(char *)); dodirs(trp); # ifdef DEP_PTY sendparent(TE_POPVAR, &dirstack); # endif return(RET_SUCCESS); } /*ARGSUSED*/ static int NEAR dodirs(trp) syntaxtree *trp; { char path[MAXPATHLEN]; int i; if (getworkdir(path) < 0) return(RET_FAIL); kanjifputs(path, Xstdout); if (dirstack) for (i = 0; dirstack[i]; i++) VOID_C Xprintf(" %k", dirstack[i]); putnl(); return(RET_SUCCESS); } static int NEAR doenable(trp) syntaxtree *trp; { shbuiltintable *built; char **argv; int i, j, n, ret; argv = (trp -> comm) -> argv; n = 1; if ((trp -> comm) -> argc > 1 && argv[n][0] == '-' && argv[n][1] == 'n' && !(argv[n][2])) n++; ret = RET_SUCCESS; if (n >= (trp -> comm) -> argc) for (j = 0; j < SHBUILTINSIZ; j++) { if (n == 1) { if (shbuiltinlist[j].flags & BT_DISABLE) continue; } else { if (!(shbuiltinlist[j].flags & BT_DISABLE)) continue; } for (i = 0; i < (trp -> comm) -> argc; i++) VOID_C Xprintf("%k ", argv[i]); VOID_C Xprintf("%k\n", shbuiltinlist[j].ident); } else for (i = n; i < (trp -> comm) -> argc; i++) { if (!(built = getshbuiltin2(argv[i], 0, 0))) { execerror(argv, argv[i], ER_COMNOFOUND, 1); ret = RET_FAIL; continue; } if (n == 1) built -> flags &= ~BT_DISABLE; else built -> flags |= BT_DISABLE; } return(ret); } static int NEAR dobuiltin(trp) syntaxtree *trp; { shbuiltintable *built; char **argv; int ret, argc; argc = (trp -> comm) -> argc; argv = (trp -> comm) -> argv; if (interrupted) return(RET_INTR); if (argc <= 1) return(ret_status); built = getshbuiltin2(argv[1], BT_DISABLE, 0); if (!built) { execerror(argv, argv[1], ER_COMNOFOUND, 1); return(RET_FAIL); } if (restricted && (built -> flags & BT_RESTRICT)) { execerror(argv, argv[1], ER_RESTRICTED, 0); return(RET_FAIL); } if (!(built -> func)) return(RET_FAIL); (trp -> comm) -> argc--; (trp -> comm) -> argv++; ret = (*(built -> func))(trp); (trp -> comm) -> argc = argc; (trp -> comm) -> argv = argv; return(ret); } static int NEAR doaddcr(trp) syntaxtree *trp; { CONST char *fname; char *buf; int n, fd, ret, opt; if ((opt = tinygetopt(trp, "1", &n)) < 0) return(RET_FAIL); fname = (trp -> comm) -> argv[n]; if (!fname) fd = STDIN_FILENO; else if ((fd = newdup(Kopen(fname, O_TEXT | O_RDONLY, 0666))) < 0) { doperror((trp -> comm) -> argv[0], fname); return(RET_FAIL); } ret = RET_SUCCESS; while ((buf = readline(fd, 'N')) != vnullstr) { if (!buf) { if (errno != EINTR) doperror((trp -> comm) -> argv[0], fname); ret = RET_FAIL; break; } puts2(buf); Xfree(buf); puts2("\r\n"); VOID_C Xfflush(Xstdout); if (opt == '1') break; } safeclose(fd); return(ret); } #endif /* !MINIMUMSHELL */ #ifdef WITHSOCKET static int NEAR doaccept(trp) syntaxtree *trp; { CONST char *cp; int s, fd; if (!(cp = (trp -> comm) -> argv[1])) s = STDIN_FILENO; else if ((s = isnumeric(cp)) < 0) { execerror((trp -> comm) -> argv, cp, ER_BADNUMBER, 0); return(RET_FAIL); } if (issocket(s) < 0) { execerror((trp -> comm) -> argv, cp, ER_NOTSOCKET, 2); return(RET_FAIL); } if ((fd = sockaccept(s, SCK_THROUGHPUT)) < 0) { doperror((trp -> comm) -> argv[0], cp); return(RET_FAIL); } s = Xdup2(fd, s); safeclose(fd); if (s < 0) { doperror((trp -> comm) -> argv[0], cp); return(RET_FAIL); } return(RET_SUCCESS); } static int NEAR dosocketinfo(trp) syntaxtree *trp; { char addr[SCK_ADDRSIZE + 1]; CONST char *cp; int n, s, opt, port; if ((opt = tinygetopt(trp, "apAP", &n)) < 0) return(RET_FAIL); if (!(cp = (trp -> comm) -> argv[n])) s = STDIN_FILENO; else if ((s = isnumeric(cp)) < 0) { execerror((trp -> comm) -> argv, cp, ER_BADNUMBER, 0); return(RET_FAIL); } if (issocket(s) < 0) { execerror((trp -> comm) -> argv, NULL, ER_NOTSOCKET, 2); return(RET_FAIL); } if (!Xisupper(opt)) { if (getsockinfo(s, addr, sizeof(addr), &port, 1) >= 0) { if (opt == 'a') VOID_C Xprintf("%s\n", addr); else if (opt == 'p') VOID_C Xprintf("%d\n", port); else VOID_C Xprintf("Remote: %s:%d\n", addr, port); } # ifdef ENOTCONN else if (errno == ENOTCONN) { if (opt) VOID_C Xprintf("%s\n", nullstr); else VOID_C Xprintf("Remote: (not connected)\n"); } # endif else { execerror((trp -> comm) -> argv, NULL, ER_INVALSOCKET, 2); return(RET_FAIL); } } if (!Xislower(opt)) { if (getsockinfo(s, addr, sizeof(addr), &port, 0) >= 0) { if (opt == 'A') VOID_C Xprintf("%s\n", addr); else if (opt == 'P') VOID_C Xprintf("%d\n", port); else VOID_C Xprintf("Local: %s:%d\n", addr, port); } else { execerror((trp -> comm) -> argv, NULL, ER_INVALSOCKET, 2); return(RET_FAIL); } } return(RET_SUCCESS); } #endif /* WITHSOCKET */ #ifdef FD static int NEAR dofd(trp) syntaxtree *trp; { # ifdef DEP_FILECONV int dupkanji; # endif int n, mode; if (!shellmode || exit_status < 0) { execerror((trp -> comm) -> argv, NULL, ER_RECURSIVEFD, 0); return(RET_FAIL); } else if (dumbterm > 1) { execerror((trp -> comm) -> argv, getconstvar(ENVTERM), ER_INVALTERMFD, 1); return(RET_FAIL); } else if (!interactive || nottyout) { execerror((trp -> comm) -> argv, NULL, ER_INVALTERMFD, 1); return(RET_FAIL); } else { n = sigvecset(1); ttyiomode(0); mode = termmode(1); shellmode = 0; # ifdef DEP_FILECONV dupkanji = printf_defkanji; printf_defkanji = 0; # endif main_fd(&((trp -> comm) -> argv[1]), 1); # ifdef DEP_FILECONV printf_defkanji = dupkanji; # endif shellmode = 1; VOID_C termmode(mode); stdiomode(); VOID_C fputnl(Xstderr); sigvecset(n); } return(RET_SUCCESS); } #endif /* FD */ static int NEAR doshfunc(trp, func) syntaxtree *trp; shfunctable *func; { #ifndef MINIMUMSHELL long dupshlineno; #endif char **avar; int ret; #ifndef MINIMUMSHELL dupshlineno = shlineno; #endif avar = argvar; argvar = duplvar((trp -> comm) -> argv, 0); shfunclevel++; ret = exec_stree(func -> func, 0); if (returnlevel >= shfunclevel) returnlevel = 0; shfunclevel--; freevar(argvar); argvar = avar; #ifndef MINIMUMSHELL setshlineno(dupshlineno); #endif return(ret); } #ifndef FDSH char **getsimpleargv(trp) syntaxtree *trp; { char **argv; if ((trp -> flags & ST_NODE) || trp -> cont) return(NULL); if (!(trp -> comm) || isstatement(trp -> comm)) return(NULL); argv = (trp -> comm) -> argv; while (trp -> next) { trp = trp -> next; if ((trp -> flags & ST_NODE) || trp -> comm) return(NULL); } return(argv); } #endif /* !FDSH */ #ifdef SHOWSTREE static VOID NEAR show_stree(trp, lvl) syntaxtree *trp; int lvl; { redirectlist *rp; CONST opetable *opep; int i, id; if (!trp) { printindent(lvl, Xstdout); puts2("(null):"); putnl(); return; } if (trp -> flags & ST_NODE) { printindent(lvl, Xstdout); puts2("node:\n"); show_stree((syntaxtree *)(trp -> comm), lvl + 1); } else if (!(trp -> comm)) { printindent(lvl, Xstdout); puts2("body: NULL"); putnl(); } else { printindent(lvl, Xstdout); if (isstatement(trp -> comm)) { id = (trp -> comm) -> id; i = id - 1; if (id == SM_CHILD) puts2("sub shell"); else if ((id == SM_STATEMENT)) puts2("statement"); else puts2(statementlist[i].ident); puts2(":\n"); show_stree(statementbody(trp), lvl + 1); } else for (i = 0; i <= (trp -> comm) -> argc; i++) { if (!((trp -> comm) -> argv) || !((trp -> comm) -> argv[i])) puts2("NULL"); else if (!i && isbuiltin(trp -> comm)) argfputs((trp -> comm) -> argv[i], Xstdout); else VOID_C Xprintf("\"%a\"", (trp -> comm) -> argv[i]); putc2((i < (trp -> comm) -> argc) ? ' ' : '\n'); } for (rp = (trp -> comm) -> redp; rp; rp = rp -> next) { printindent(lvl, Xstdout); VOID_C Xprintf("redirect %d", rp -> fd); if (!(rp -> filename)) puts2(">-: "); else if (rp -> type & MD_HEREDOC) VOID_C Xprintf(">> \"%a\": ", ((heredoc_t *)(rp -> filename)) -> eof); else VOID_C Xprintf("> \"%a\": ", rp -> filename); VOID_C Xprintf("%06o\n", (int)(rp -> type)); } } if (trp -> type && (opep = getoperator(trp -> type))) { printindent(lvl, Xstdout); puts2(opep -> symbol); putnl(); } if (trp -> next) { if (trp -> cont & (CN_QUOT | CN_ESCAPE)) { rp = (redirectlist *)(trp -> next); printindent(lvl, Xstdout); VOID_C Xprintf("continuing...\"%a\"\n", rp -> filename); } # ifndef MINIMUMSHELL else if (trp -> flags & ST_BUSY); # endif else show_stree(trp -> next, lvl); } } #endif /* SHOWSTREE */ VOID setshfunc(ident, trp) char *ident; syntaxtree *trp; { shfunctable *func; int i; if ((func = getshfunc(ident))) { Xfree(func -> ident); freestree(func -> func); Xfree(func -> func); } else { for (i = 0; shellfunc[i].ident; i++) /*EMPTY*/; shellfunc = (shfunctable *)Xrealloc(shellfunc, (i + 2) * sizeof(shfunctable)); shellfunc[i + 1].ident = NULL; func = &(shellfunc[i]); } func -> ident = ident; func -> func = trp; #ifndef _NOUSEHASH if (hashahead) check_stree(trp); #endif } static int NEAR dosetshfunc(ident, trp) CONST char *ident; syntaxtree *trp; { syntaxtree *functr; char *new; int len; #ifndef BASHSTYLE /* bash allows any character in the function identifier */ if (identcheck(ident, '\0') <= 0) { execerror(NULL, ident, ER_NOTIDENT, 0); return(-1); } #endif new = Xstrdup(ident); stripquote(new, EA_STRIPQ); len = strlen(new); #ifndef BASHSTYLE /* bash distinguishes the same named function and variable */ if (unset(new, len) < 0) { Xfree(new); return(RET_FAIL); } #endif trp = trp -> next; if (!(functr = statementbody(trp))) { Xfree(new); return(RET_FAIL); } (trp -> comm) -> argv = (char **)duplstree2(functr, NULL, functr -> lineno); functr -> flags |= ST_TOP; setshfunc(new, functr); #ifdef DEP_PTY if (parentfd >= 0 && mypid == shellpid) { sendparent(TE_ADDFUNCTION, ident, functr); nownstree(functr); } #endif return(RET_SUCCESS); } int unsetshfunc(ident, len) CONST char *ident; int len; { int i, max; if (checkronly(ident, len) < 0) return(-1); for (i = 0; shellfunc[i].ident; i++) { if (strncommcmp(ident, shellfunc[i].ident, len)) continue; if (!shellfunc[i].ident[len]) break; } if (!shellfunc[i].ident) return(0); Xfree(shellfunc[i].ident); freestree(shellfunc[i].func); Xfree(shellfunc[i].func); for (max = i + 1; shellfunc[max].ident; max++) /*EMPTY*/; memmove((char *)&(shellfunc[i]), (char *)&(shellfunc[i + 1]), (max - i) * sizeof(shfunctable)); #ifdef DEP_PTY sendparent(TE_DELETEFUNCTION, ident, len); #endif return(0); } static int NEAR exec_statement(trp) syntaxtree *trp; { CONST statementtable *stat; if (!(stat = getstatement(trp = statementbody(trp)))) return(seterrno(EINVAL)); return((*(stat -> func))(trp)); } #if MSDOS int exec_simplecom(trp, type, vp) syntaxtree *trp; int type; CONST VOID_P vp; #else int exec_simplecom(trp, type, vp, bg) syntaxtree *trp; int type; CONST VOID_P vp; int bg; #endif { #if !MSDOS p_id_t pid; #endif #if defined (FD) && defined (DEP_FILECONV) int dupkanji; #endif #ifdef DEP_FILECONV int i; #endif command_t *comm; char *path; int ret; comm = trp -> comm; #ifdef DEP_FILECONV if (defaultkcode == NOCNV || defaultkcode == DEFCODE) /*EMPTY*/; else if (type == CT_FDORIGINAL || type == CT_FDINTERNAL || (type == CT_BUILTIN && (((shbuiltintable *)vp) -> flags & BT_FILENAME))) { for (i = 1; i < comm -> argc; i++) renewkanjiconv(&(comm -> argv[i]), defaultkcode, DEFCODE, L_FNAME); } #endif if (type == CT_NONE) return(ret_status); if (type == CT_BUILTIN) { if (!((shbuiltintable *)vp) -> func) return(RET_FAIL); if (!restricted || !(((shbuiltintable *)vp) -> flags & BT_RESTRICT)) return((*(((shbuiltintable *)vp) -> func))(trp)); execerror(comm -> argv, NULL, ER_RESTRICTED, 0); return(RET_FAIL); } #ifdef FD if (type == CT_FDORIGINAL) { # ifdef DEP_FILECONV dupkanji = printf_defkanji; printf_defkanji = 0; # endif ret = execbuiltin((builtintable *)vp, comm -> argc, comm -> argv); # ifdef DEP_FILECONV printf_defkanji = dupkanji; # endif return(ret); } if (type == CT_FDINTERNAL) { if (shellmode) return(RET_FAIL); resetsignal(0); # ifdef DEP_FILECONV dupkanji = printf_defkanji; printf_defkanji = 0; # endif ret = execinternal((functable *)vp, comm -> argc, comm -> argv); # ifdef DEP_FILECONV printf_defkanji = dupkanji; # endif setsignal(); return(ret); } #endif /* FD */ #if MSDOS if (type == CT_LOGDRIVE) { if (setcurdrv(*((char *)vp), 1) >= 0) return(RET_SUCCESS); execerror(comm -> argv, NULL, ER_INVALDRIVE, 2); return(RET_FAIL); } #endif if (type == CT_FUNCTION) { if (!((shfunctable *)vp) -> func) return(RET_FAIL); return(doshfunc(trp, ((shfunctable *)vp))); } if (!(path = evalexternal(trp -> comm))) return(ret_status); #if MSDOS if ((ret = spawnve(P_WAIT, path, comm -> argv, exportvar)) < 0 && errno == ENOENT) { execerror(comm -> argv, NULL, ER_COMNOFOUND, 1); return(RET_NOTFOUND); } #else /* !MSDOS */ # ifndef BASHSTYLE /* bash does fork() all processes even in a sub shell */ if (childdepth && !(trp -> next)) bg = 1; # endif if (bg || isopbg(trp) || isopnown(trp)) { searchheredoc(trp, 1); Xexecve2(path, comm -> argv, exportvar, 1); } if ((pid = makechild(1, (p_id_t)-1)) < (p_id_t)0) return(-1); if (!pid) Xexecve2(path, comm -> argv, exportvar, 1); ret = waitchild(pid, trp); #endif /* !MSDOS */ return(ret); } static char **NEAR checkshellbuiltinargv(argc, argv) int argc; char **argv; { CONST VOID_P vp; char *tmp; int type; isshellbuiltin = 0; #ifdef BASHSTYLE /* bash does not use IFS as a command separator */ argc = evalifs(argc, &argv, " \t"); #else argc = evalifs(argc, &argv, getifs()); #endif if (!argc) return(argv); stripquote(tmp = Xstrdup(argv[0]), EA_STRIPQ); type = checktype2(tmp, &vp, 0, 1); Xfree(tmp); #ifdef STRICTPOSIX if (type == CT_BUILTIN && (((shbuiltintable *)vp) -> flags & BT_POSIXSPECIAL)) isshellbuiltin = 1; #else if (type != CT_NONE && type != CT_COMMAND) isshellbuiltin = 1; #endif return(argv); } static int NEAR checkshellbuiltin(trp) syntaxtree *trp; { syntaxtree *next; char **argv, **subst; int ret, *len, argc, duperrno; duperrno = errno; isshellbuiltin = 0; if (!trp || !(trp -> comm) || isstatement(trp -> comm)) return(0); next = statementcheck(trp -> next, SM_STATEMENT); if (getstatid(next) == SM_LPAREN) { errno = duperrno; return(0); } argv = duplvar((trp -> comm) -> argv, 2); argc = getsubst((trp -> comm) -> argc, argv, &subst, &len); if (substvar(argv, EA_BACKQ | EA_EVALIFS) < 0) ret = -1; else { argv = checkshellbuiltinargv(argc, argv); ret = 0; } freevar(subst); Xfree(len); freevar(argv); errno = duperrno; return(ret); } #if MSDOS static int NEAR exec_command(trp, contp) syntaxtree *trp; int *contp; #else static int NEAR exec_command(trp, contp, bg) syntaxtree *trp; int *contp, bg; #endif { #ifndef _NOUSEHASH hashlist **htable; char *pathvar; #endif #ifdef FD int lastptr; #endif command_t *comm; CONST VOID_P vp; char *ps, **argv, **subst, **svar, **evar; u_long esize; int i, ret, type, argc, nsubst, keepvar, *len; isshellbuiltin = execerrno = 0; comm = trp -> comm; argc = comm -> argc; argv = comm -> argv; if (interrupted) return(RET_INTR); if (argc <= 0) return(ret_status); type = 0; comm -> argv = duplvar(comm -> argv, 2); comm -> argc = getsubst(comm -> argc, comm -> argv, &subst, &len); type = evalargv(comm, &vp, contp); if (type < 0 || (nsubst = substvar(subst, EA_BACKQ)) < 0) { freevar(subst); Xfree(len); comm -> argc = argc; freevar(comm -> argv); comm -> argv = argv; return(RET_FAIL); } if (nsubst > 0 && type == CT_NONE) ret_status = RET_SUCCESS; keepvar = 0; #ifdef BASHSTYLE /* bash treats the substitution before builtin as ineffective */ if (type == CT_BUILTIN) keepvar = -1; else if (type != CT_NONE) keepvar = 1; #else if (type == CT_COMMAND) keepvar = 1; /* bash treats the substitution before a function as effective */ else if (type == CT_FUNCTION) keepvar = -1; #endif #ifdef STRICTPOSIX if (type == CT_BUILTIN) { if (((shbuiltintable *)vp) -> flags & BT_POSIXSPECIAL) isshellbuiltin = 1; else keepvar = -1; } #else if (type != CT_NONE && type != CT_COMMAND) isshellbuiltin = 1; #endif if (keepvar < 0) { for (i = 0; subst[i]; i++) Xfree(subst[i]); subst[0] = NULL; keepvar = nsubst = 0; } if (keepvar) { shellvar = duplvar(svar = shellvar, 0); exportvar = duplvar(evar = exportvar, 0); esize = exportsize; #ifndef _NOUSEHASH htable = duplhash(hashtable); pathvar = getconstvar(ENVPATH); #endif } #ifdef FAKEUNINIT else { /* fake for -Wuninitialized */ svar = evar = NULL; esize = 0L; # ifndef _NOUSEHASH htable = NULL; pathvar = NULL; # endif } #endif #ifdef MINIMUMSHELL ps = PS4STR; #else /* !MINIMUMSHELL */ # ifdef FD if ((ps = getconstvar(ENVPS4))) evalprompt(&ps, ps); # else if ((ps = getconstvar(ENVPS4))) ps = evalvararg(ps, EA_BACKQ, 0); # endif #endif /* !MINIMUMSHELL */ while (nsubst--) { #ifdef FD demacroarg(&(subst[nsubst])); #endif stripquote(subst[nsubst], EA_STRIPQ); if (putshellvar(subst[nsubst], len[nsubst]) < 0) { while (nsubst >= 0) Xfree(subst[nsubst--]); Xfree(subst); Xfree(len); comm -> argc = argc; freevar(comm -> argv); comm -> argv = argv; return(RET_FAIL); } if (type == CT_COMMAND) exportvar = putvar(exportvar, Xstrdup(subst[nsubst]), len[nsubst]); if (verboseexec) { #ifdef BASHSTYLE /* bash displays "+ " with substitutions, in -x mode */ errputs(ps, 0); argfputs(subst[nsubst], Xstderr); #else argfputs(subst[nsubst], Xstderr); if (nsubst) VOID_C Xfputc(' ', Xstderr); else #endif VOID_C fputnl(Xstderr); } } Xfree(subst); Xfree(len); if (verboseexec && comm -> argc) { errputs(ps, 0); argfputs(comm -> argv[0], Xstderr); for (i = 1; i < comm -> argc; i++) VOID_C Xfprintf(Xstderr, " %a", comm -> argv[i]); VOID_C fputnl(Xstderr); } #ifndef MINIMUMSHELL Xfree(ps); #endif #ifdef FD VOID_C replaceargs(&lastptr, NULL, NULL, 0); #endif ret = exec_simplecom2(trp, type, vp, bg); #ifdef FD VOID_C replaceargs(NULL, NULL, NULL, lastptr); #endif Xclearerr(Xstdin); Xclearerr(Xstdout); Xclearerr(Xstderr); Xfpurge(Xstdin); VOID_C Xfflush(Xstdout); VOID_C Xfflush(Xstderr); if (keepvar) { #ifndef _NOUSEHASH if (pathvar != getconstvar(ENVPATH)) { VOID_C searchhash(NULL, NULL, NULL); hashtable = htable; } else if (htable) VOID_C searchhash(htable, NULL, NULL); #endif freevar(shellvar); freevar(exportvar); shellvar = svar; exportvar = evar; exportsize = esize; } #ifdef FD if (type != CT_NONE && type != CT_FDINTERNAL && type != CT_FUNCTION) internal_status = FNC_FAIL; #endif comm -> argc = argc; freevar(comm -> argv); comm -> argv = argv; #if !MSDOS && defined (FD) if (autosavetty) savestdio(0); #endif return(ret); } #ifdef USEFAKEPIPE static int NEAR exec_process(trp) syntaxtree *trp; #else static int NEAR exec_process(trp, pipein) syntaxtree *trp; p_id_t pipein; #endif { #if !MSDOS syntaxtree *tmptr; p_id_t pid; int bg, sub; #endif #ifndef MINIMUMSHELL long dupshlineno; #endif syntaxtree *next; int cont, ret; next = statementcheck(trp -> next, SM_STATEMENT); if (getstatid(next) != SM_LPAREN) { #if !MSDOS tmptr = trp; #endif next = NULL; } #if !MSDOS else tmptr = trp -> next; #endif #if !MSDOS sub = 0; # if !defined (BASHSTYLE) && !defined (USEFAKEPIPE) /* bash does not treat the end of pipeline as sub shell */ if (tmptr -> next || !(tmptr -> flags & ST_NEXT)) /*EMPTY*/; else if ((tmptr = getparent(trp)) && isoppipe(tmptr)) sub = 1; # endif if (!isstatement(trp -> comm)) /*EMPTY*/; else if ((trp -> comm) -> id == SM_CHILD) sub = 0; # if !defined (NOJOB) && defined (CHILDSTATEMENT) else if (jobok && mypid == orgpgrp) sub = 1; # endif # ifndef BASHSTYLE /* bash does not treat redirected statements as sub shell */ else if ((trp -> comm) -> redp) sub = 1; # endif if (!sub) /*EMPTY*/; else if ((pid = makechild(1, (p_id_t)-1)) < (p_id_t)0) return(-1); else if (pid) { # ifndef NOJOB VOID_C stackjob(pid, 0, -1, trp); # endif return(waitchild(pid, trp)); } # ifndef NOJOB else VOID_C stackjob(mypid, 0, -1, trp); # endif #endif /* !MSDOS */ if (isstatement(trp -> comm)) { if ((trp -> comm) -> id == SM_CHILD) ret = dochild(trp); else ret = exec_statement(trp); } else if (next) ret = dosetshfunc((trp -> comm) -> argv[0], next); else for (;;) { cont = 0; #ifndef MINIMUMSHELL dupshlineno = shlineno; setshlineno(trp -> lineno); #endif #if !MSDOS if (sub) bg = 1; # ifndef USEFAKEPIPE else if (!pipein) bg = 1; # endif # ifndef NOJOB else if (ttypgrp < (p_id_t)0 && !(trp -> next)) bg = 1; # endif else bg = 0; #endif /* !MSDOS */ ret = exec_command2(trp, &cont, bg); #ifndef MINIMUMSHELL setshlineno(dupshlineno); #endif if (ret < 0) break; #ifdef FD if (cont) continue; #endif break; } #if !MSDOS if (sub) { prepareexit(1); Xexit((ret >= 0) ? ret : RET_NOTEXEC); } #endif return(ret); } static int NEAR exec_stree(trp, cond) syntaxtree *trp; int cond; { #if !MSDOS p_id_t pid; # ifndef NOJOB int n; # endif #endif /* !MSDOS */ syntaxtree *tmptr; redirectlist *errp; p_id_t pipein; char *tmp; int ret, fd; exectrapcomm(); if (breaklevel || continuelevel) { ret_status = RET_SUCCESS; return(ret_status); } #ifndef MINIMUMSHELL if (isopnot(trp)) { trp = skipfuncbody(trp); if (!(trp -> next)) return(RET_FAIL); if ((ret = exec_stree(trp -> next, cond)) < 0) return(-1); ret_status = (ret_status != RET_SUCCESS) ? RET_SUCCESS : RET_FAIL; return(ret_status); } #endif fd = -1; #if !MSDOS if (!isopbg(trp) && !isopnown(trp)) pid = (p_id_t)-1; else if ((pid = makechild(0, (p_id_t)-1)) < (p_id_t)0) return(-1); else if (!pid) { nownstree(trp -> next); # ifndef NOJOB ttypgrp = (p_id_t)-1; if (!isopnown(trp)) VOID_C stackjob(mypid, 0, -1, trp); if (jobok) /*EMPTY*/; else # endif fd = Xopen(_PATH_DEVNULL, O_BINARY | O_RDONLY, 0666); if (fd >= 0) { Xdup2(fd, STDIN_FILENO); safeclose(fd); } } else { tmptr = trp -> next; trp -> next = NULL; nownstree(trp); trp -> next = tmptr; # ifndef NOJOB childpgrp = (p_id_t)-1; n = -1; if (!isopnown(trp)) { n = stackjob(pid, 0, -1, trp); setlastjob(n); } # endif if (interactive && !nottyout) { # ifndef NOJOB if (jobok && n >= 0) { if (mypid == orgpgrp) VOID_C Xfprintf(Xstderr, "[%d] %id\n", jobid(n), pid); } else # endif VOID_C Xfprintf(Xstderr, "%id\n", pid); } lastpid = pid; trp = skipfuncbody(trp); ret_status = RET_SUCCESS; if (!(trp -> next)) return(ret_status); return(exec_stree(trp -> next, cond)); } #endif /* !MSDOS */ tmptr = skipfuncbody(trp); if (!isoppipe(tmptr)) pipein = (p_id_t)-1; else if ((fd = openpipe2(&pipein, STDIN_FILENO, 0, 1, (p_id_t)-1)) < 0) return(-1); #ifdef FD VOID_C replaceargs(NULL, NULL, NULL, 0); #endif if (!(trp -> comm) || pipein > (p_id_t)0) { #ifndef NOJOB if (pipein > (p_id_t)0) VOID_C stackjob(pipein, 0, fd, trp); #endif ret = ret_status; } else if (trp -> flags & ST_NODE) ret = exec_stree((syntaxtree *)(trp -> comm), cond); else if (!((trp -> comm) -> redp)) { ret = exec_process2(trp, pipein); ret_status = (ret >= 0) ? ret : RET_FAIL; } else for (;;) { if (!(errp = doredirect((trp -> comm) -> redp))) ret = exec_process2(trp, pipein); else { if (checkshellbuiltin(trp) < 0) /*EMPTY*/; else if (errno < 0) /*EMPTY*/; else if (errp -> type & MD_HEREDOC) doperror(NULL, NULL); else { if (!(errp -> filename)) tmp = Xstrdup("-"); else tmp = evalvararg(errp -> filename, EA_BACKQ | EA_STRIPQLATER, 0); if (tmp && !*tmp && *(errp -> filename)) { Xfree(tmp); tmp = Xstrdup(errp -> filename); } if (tmp) { if (errno) doperror(NULL, tmp); else execerror(NULL, tmp, ER_RESTRICTED, 2); Xfree(tmp); } } ret = RET_FAIL; } closeredirect((trp -> comm) -> redp); ret_status = (ret >= 0) ? ret : RET_FAIL; #ifdef FD if (!errp && ((trp -> comm) -> redp) -> type & MD_REST) continue; #endif break; } trp = tmptr; if (returnlevel || ret < 0) /*EMPTY*/; else if (pipein >= (p_id_t)0 && (fd = reopenpipe(fd, RET_SUCCESS)) < 0) { pipein = (p_id_t)-1; ret = -1; } else { #if !MSDOS if (!pid) { searchheredoc(trp, 1); prepareexit(1); Xexit(RET_SUCCESS); } #endif #ifndef NOJOB if (pipein > (p_id_t)0) VOID_C stackjob(pipein, 0, fd, trp); #endif if (interrupted) { breaklevel = loopdepth; ret = RET_INTR; } else if (!(trp -> next)) /*EMPTY*/; else if (errorexit && !cond && isopfg(trp) && ret_status) breaklevel = loopdepth; else if (isopand(trp) && ret_status) { if (errorexit && !cond) { breaklevel = loopdepth; ret = RET_SUCCESS; } } else if (isopor(trp) && !ret_status) /*EMPTY*/; else ret = exec_stree(trp -> next, cond); } if (pipein >= (p_id_t)0) VOID_C closepipe2(fd, -1); exectrapcomm(); return(ret); } static syntaxtree *NEAR execline(command, stree, trp, noexit) CONST char *command; syntaxtree *stree, *trp; int noexit; { int ret; if (command == (char *)-1) { if (!(trp = analyzeeof(trp))) { freestree(stree); return(NULL); } } else { if (!(trp = analyze(command, trp, 0))) { freestree(stree); if (errorexit && !noexit) { Xfree(stree); Xexit2(RET_SYNTAXERR); } return(NULL); } if (trp -> cont) return(trp); } if (notexec) { ret = RET_SUCCESS; #ifdef SHOWSTREE show_stree(stree, 0); #endif } #ifndef _NOUSEHASH else if (hashahead && check_stree(stree) < 0) ret = ret_status = RET_FAIL; #endif else ret = exec_stree(stree, 0); errorexit = tmperrorexit; freestree(stree); if (ret < 0 && errno) doperror(NULL, NULL); if ((errorexit && ret && !noexit) || terminated) { Xfree(stree); Xexit2(ret); } return(NULL); } static int NEAR exec_line(command) CONST char *command; { static syntaxtree *stree = NULL; static syntaxtree *trp = NULL; int ret; if (!command) { freestree(stree); Xfree(stree); stree = trp = NULL; return(0); } setsignal(); if (verboseinput && command != (char *)-1) { argfputs(command, Xstderr); VOID_C fputnl(Xstderr); } if (!stree) trp = stree = newstree(NULL); #ifndef NOJOB childpgrp = (p_id_t)-1; #endif if ((trp = execline(command, stree, trp, 0))) ret = trp -> cont; else { Xfree(stree); stree = trp = NULL; ret = 0; } resetsignal(0); return(ret); } static int NEAR _dosystem(command) CONST char *command; { static syntaxtree *trp = NULL; int ret; if (!command) ret = 0; else if (!(trp = analyzeline(command))) ret = RET_SYNTAXERR; else { if (notexec) { ret = RET_SUCCESS; #ifdef SHOWSTREE show_stree(trp, 0); #endif } #ifndef _NOUSEHASH else if (hashahead && check_stree(trp) < 0) ret = RET_FAIL; #endif else ret = exec_stree(trp, 0); errorexit = tmperrorexit; } freestree(trp); Xfree(trp); trp = NULL; return((ret >= 0) ? ret : RET_FAIL); } #ifndef FDSH int dosystem(command) CONST char *command; { int ret; shellpid = mypid; # ifndef NOJOB orgpgrp = mypid; childpgrp = (p_id_t)-1; # endif # ifdef DEP_PTY if (!command) return(shell_loop((isshptymode()) ? 0 : 1)); # else if (!command) return(shell_loop(1)); # endif setsignal(); ret = _dosystem(command); resetsignal(0); return(ret); } #endif /* !FDSH */ static XFILE *NEAR _dopopen(command) CONST char *command; { #ifndef USEFAKEPIPE pipelist **prevp; #endif #ifdef CYGWIN struct timeval tv; #endif syntaxtree *trp; p_id_t pipein; int fd; trp = (command) ? analyzeline(command) : NULL; nottyout++; fd = openpipe2(&pipein, STDIN_FILENO, 1, 1, mypid); #ifndef USEFAKEPIPE prevp = searchpipe(fd); #endif if (fd < 0) /*EMPTY*/; else if (pipein) { #ifdef CYGWIN /* a trick for buggy terminal emulation */ tv.tv_sec = 0L; tv.tv_usec = 500000L; /* maybe enough waiting limit */ VOID_C readselect(1, &fd, NULL, &tv); #endif } else { #ifndef USEFAKEPIPE if (prevp && !((*prevp) -> file)) nownstree(trp); prevp = NULL; #endif if (!trp) ret_status = RET_SYNTAXERR; else if (!(trp -> comm)) ret_status = RET_SUCCESS; else if (notexec) { #ifdef SHOWSTREE show_stree(trp, 0); #endif pipein = (p_id_t)-1; } #ifndef _NOUSEHASH else if (hashahead && check_stree(trp) < 0) pipein = (p_id_t)-1; #endif else if (exec_stree(trp, 0) < 0) pipein = (p_id_t)-1; searchheredoc(trp, 1); if (pipein >= (p_id_t)0) fd = reopenpipe(fd, ret_status); else { VOID_C closepipe2(fd, -1); fd = -1; } } #ifndef USEFAKEPIPE if (prevp) (*prevp) -> trp = trp; else #endif { freestree(trp); Xfree(trp); } errorexit = tmperrorexit; nottyout--; return((fd >= 0) ? fdopenpipe(fd) : NULL); } #ifndef FDSH XFILE *dopopen(command) CONST char *command; { XFILE *fp; shellpid = mypid; # ifndef NOJOB orgpgrp = mypid; childpgrp = (p_id_t)-1; # endif setsignal(); fp = _dopopen(command); resetsignal(0); return(fp); } int dopclose(fp) XFILE *fp; { return(closepipe2(Xfileno(fp), -1)); } #endif /* !FDSH */ static int NEAR sourcefile(fd, fname, verbose) int fd; CONST char *fname; int verbose; { #ifndef MINIMUMSHELL long dupshlineno; #endif syntaxtree *stree, *trp; char *buf; long n; int ret, dupinteractive; dupinteractive = interactive; interactive = 0; #ifndef MINIMUMSHELL dupshlineno = shlineno; setshlineno(1L); #endif trp = stree = newstree(NULL); n = 0L; ret = errno = 0; #if !MSDOS closeonexec(fd); #endif while ((buf = readline(fd, '\0')) != vnullstr) { if (!buf) { if (errno != EINTR) doperror(NULL, fname); ret++; ret_status = RET_FAIL; break; } if (!trp) trp = stree; trp = execline(buf, stree, trp, 1); n++; if (ret_status == RET_NOTICE || syntaxerrno || execerrno) { ret++; if (verbose) VOID_C Xfprintf(Xstderr, "%k:%ld: %s\n", fname, n, buf); ret_status = RET_FAIL; } Xfree(buf); if (syntaxerrno) break; #ifndef BASHSTYLE if (execerrno) break; #endif #ifndef MINIMUMSHELL setshlineno(shlineno + 1L); #endif } execline((char *)-1, stree, trp, 1); if (syntaxerrno) ret_status = RET_SYNTAXERR; Xfree(stree); interactive = dupinteractive; #ifndef MINIMUMSHELL setshlineno(dupshlineno); #endif return(ret); } int execruncom(fname, verbose) CONST char *fname; int verbose; { #ifdef MINIMUMSHELL char *cp, path[MAXPATHLEN]; #endif lockbuf_t *lck; char *new, **dupargvar; int ret, duprestricted; setsignal(); #ifdef MINIMUMSHELL if (*fname == '~' && fname[1] == _SC_ && (cp = getconstvar(ENVHOME))) { strcatdelim2(path, cp, &(fname[2])); fname = path; } #endif new = Xstrdup(fname); #if MSDOS && !defined (BSPATHDELIM) new = adjustpname(new); #endif fname = new = evalpath(new, 0); ret = RET_SUCCESS; if (noruncom || !isrootdir(fname)) lck = NULL; else if (!(lck = lockopen(fname, O_TEXT | O_RDONLY, 0666))) { doperror(NULL, fname); ret = RET_FAIL; } else if (lck -> fd >= 0) { #ifdef FD inruncom = 1; #endif duprestricted = restricted; restricted = 0; dupargvar = argvar; argvar = (char **)Xmalloc(2 * sizeof(char *)); argvar[0] = Xstrdup(fname); argvar[1] = NULL; ret = sourcefile(lck -> fd, fname, verbose); freevar(argvar); argvar = dupargvar; restricted = duprestricted; #ifdef FD inruncom = 0; #endif } lockclose(lck); resetsignal(0); Xfree(new); return(ret); } #if MSDOS && !defined (BSPATHDELIM) static VOID NEAR adjustdelim(var) char *CONST *var; { char *cp; int i; if (!var) return; for (i = 0; var[i]; i++) { if (!(cp = Xstrchr(var[i], '='))) continue; if (searchvar2(ADJUSTVARSIZ, adjustvar, var[i], cp - var[i])) adjustpname(cp); } } #endif /* MSDOS && !BSPATHDELIM */ VOID setshellvar(envp) char *CONST *envp; { char *cp; int i, len; shellvar = duplvar(envp, 0); exportvar = duplvar(envp, 0); #if MSDOS && !defined (BSPATHDELIM) adjustdelim(shellvar); adjustdelim(exportvar); #endif exportsize = (u_long)0; for (i = 0; exportvar[i]; i++) exportsize += (u_long)strlen(exportvar[i]) + 1; exportlist = (char **)Xmalloc((i + 1) * sizeof(char *)); for (i = 0; exportvar[i]; i++) { len = ((cp = Xstrchr(exportvar[i], '='))) ? cp - exportvar[i] : strlen(exportvar[i]); exportlist[i] = Xstrndup(exportvar[i], len); } exportlist[i] = NULL; ronlylist = duplvar(NULL, 0); } int prepareterm(VOID_A) { #ifdef FD CONST char *term; #endif if (ttyio >= 0 && ttyout) return(0); if (opentty(&ttyio, &ttyout) < 0) { closetty(&ttyio, &ttyout); nottyout++; if (interactive) return(-1); } #ifndef NOJOB if (!interactive) oldttypgrp = (p_id_t)-1; else if (gettcpgrp(ttyio, &oldttypgrp) < (p_id_t)0) { closetty(&ttyio, &ttyout); if ((ttyio = newdup(Xdup(STDIN_FILENO))) < 0 || opentty(&ttyio, &ttyout) < 0) { closetty(&ttyio, &ttyout); return(-1); } } #endif /* !NOJOB */ #ifdef FD if (ttyio >= 0) inittty(0); if (!(term = getconstvar(ENVTERM))) term = nullstr; getterment(term); #endif return(0); } static VOID NEAR initrc(verbose) int verbose; { #if !defined (MINIMUMSHELL) \ || (MSDOS && defined (FD) && !defined (BSPATHDELIM)) CONST char *cp; #endif #ifdef FD execruncom(DEFRC, verbose); #else if (loginshell) { execruncom(LSH_DEFRC, verbose); execruncom(LSH_RCFILE, verbose); } #endif #ifndef MINIMUMSHELL # if !MSDOS if (getuid() != geteuid() || getgid() != getegid()) /*EMPTY*/; else # endif if ((cp = getconstvar(ENVENV))) execruncom(cp, verbose); #endif /* !MINIMUMSHELL */ #ifdef FD if (loginshell) execruncom(SH_RCFILE, verbose); else execruncom(FD_RCFILE, verbose); # ifdef DEP_PTY if (interactive) shptymode = tmpshptymode; # endif #endif /* FD */ } int initshell(argc, argv) int argc; char *CONST *argv; { #if MSDOS char *tmp; #else /* !MSDOS */ # if !defined (NOJOB) && defined (NTTYDISC) && defined (ldisc) ldiscioctl_t tty; # endif # ifndef MINIMUMSHELL char buf[MAXLONGWIDTH + 1]; # endif sigmask_t mask; #endif /* !MSDOS */ CONST char *cp, *cp2; int i, n, isstdin, tmprestricted; shellname = argv[0]; getshellname(getbasename(shellname), &loginshell, &tmprestricted); definput = STDIN_FILENO; if (!interactive && isatty(STDIN_FILENO) && isatty(STDOUT_FILENO)) interactive = 1; orgpid = shellpid = mypid = getpid(); #ifndef NOJOB ttypgrp = mypid; if ((orgpgrp = getpgroup()) < (p_id_t)0) { doperror(NULL, NULL); return(-1); } #endif if ((n = getoption(argc, argv, 1)) < 0) return(-1); #if !defined (MINIMUMSHELL) && defined (BASHSTYLE) noclobber = 0; #endif errorexit = tmperrorexit; #ifdef DEP_PTY shptymode = tmpshptymode; #endif isstdin = forcedstdin; if (n > 2) { shellmode = 1; interactive = interactive_io; } else if (n >= argc || isstdin) isstdin = 1; else { definput = newdup(Xopen(argv[n], O_BINARY | O_RDONLY, 0666)); if (definput < 0) { VOID_C Xfprintf(Xstderr, "%k: cannot open\n", argv[n]); return(-1); } if (!interactive_io || !isatty(definput)) { interactive = 0; #if !MSDOS closeonexec(definput); #endif } else { if (Xdup2(definput, STDIN_FILENO) < 0) { VOID_C Xfprintf(Xstderr, "%k: cannot open\n", argv[n]); return(-1); } safeclose(definput); definput = STDIN_FILENO; } } interactive_io = interactive; if (prepareterm() < 0) { doperror(NULL, NULL); return(-1); } #if !MSDOS && defined (FD) if (autosavetty) savestdio(0); #endif Xsetbuf(Xstdin); Xsetlinebuf(Xstderr); Xsetlinebuf(Xstdout); #if !MSDOS Xsigemptyset(mask); Xsigblock(oldsigmask, mask); #endif if (ttyio >= 0 && definput == STDIN_FILENO && isatty(STDIN_FILENO)) definput = ttyio; getvarfunc = getshellvar; putvarfunc = putshellvar; getretvalfunc = getretval; getpidfunc = getorgpid; getlastpidfunc = getlastpid; getflagfunc = getflagstr; checkundeffunc = checkundefvar; exitfunc = safeexit; backquotefunc = evalbackquote; #ifndef MINIMUMSHELL posixsubstfunc = evalposixsubst; #endif shellfunc = (shfunctable *)Xmalloc(1 * sizeof(shfunctable)); shellfunc[0].ident = NULL; #ifndef NOALIAS shellalias = (shaliastable *)Xmalloc(1 * sizeof(shaliastable)); shellalias[0].ident = NULL; #endif #ifndef _NOUSEHASH VOID_C searchhash(NULL, NULL, NULL); #endif if ((!interactive || isstdin) && n < argc) { argvar = (char **)Xmalloc((argc - n + 1 + isstdin) * sizeof(char *)); for (i = 0; i < argc - n + 1; i++) argvar[i + isstdin] = Xstrdup(argv[i + n]); if (isstdin) argvar[0] = Xstrdup(argv[0]); } else { argvar = (char **)Xmalloc(2 * sizeof(char *)); argvar[0] = Xstrdup(argv[0]); argvar[1] = NULL; } #if MSDOS if (!(tmp = getconstvar(ENVPATH))) setenv2(ENVPATH, DEFPATH, 1); else for (i = 0; tmp[i]; i++) if (tmp[i] == ';') tmp[i] = PATHDELIM; #else if (!getconstvar(ENVPATH)) setenv2(ENVPATH, DEFPATH, 1); if (!getconstvar(ENVTERM)) setenv2(ENVTERM, DEFTERM, 1); #endif if (interactive) { if (getconstvar(ENVPS1)) /*EMPTY*/; #if !MSDOS else if (!getuid()) setenv2(ENVPS1, PS1ROOT, 0); #endif else setenv2(ENVPS1, PS1STR, 0); if (!getconstvar(ENVPS2)) setenv2(ENVPS2, PS2STR, 0); } else { for (i = 0; i < PRIMALVARSIZ; i++) if (!strenvcmp(primalvar[i], ENVPS1) || !strenvcmp(primalvar[i], ENVPS2)) primalvar[i] = NULL; unset(ENVPS1, strsize(ENVPS1)); unset(ENVPS2, strsize(ENVPS2)); } #ifndef MINIMUMSHELL if (!getconstvar(ENVPS4)) setenv2(ENVPS4, PS4STR, 0); setshlineno(1L); # if !MSDOS VOID_C Xsnprintf(buf, sizeof(buf), "%id", getppid()); setenv2(ENVPPID, buf, 0); # endif #endif setenv2(ENVIFS, IFS_SET, 0); if (loginshell) { #ifndef NOUID getlogininfo(&cp, &cp2); #endif if (!getconstvar(ENVHOME)) { #ifndef NOUID if (cp) /*EMPTY*/; else #endif cp = rootpath; setenv2(ENVHOME, cp, 1); } if (!getconstvar(ENVSHELL)) { #ifndef NOUID if (cp2) /*EMPTY*/; else #endif cp2 = shellname; setenv2(ENVSHELL, cp2, 1); } } #if !MSDOS && !defined (MINIMUMSHELL) # ifdef BASHSTYLE if (!getconstvar(ENVMAILCHECK)) setenv2(ENVMAILCHECK, "60", 0); # else if (!getconstvar(ENVMAILCHECK)) setenv2(ENVMAILCHECK, "600", 0); # endif if ((cp = getconstvar(ENVMAILPATH))) replacemailpath(cp, 1); else if ((cp = getconstvar(ENVMAIL))) replacemailpath(cp, 0); #endif /* !MSDOS && !MINIMUMSHELL */ #ifndef NOPOSIXUTIL setenv2(ENVOPTIND, "1", 0); #endif for (i = 0; i < NSIG; i++) { trapmode[i] = 0; trapcomm[i] = NULL; if ((oldsigfunc[i] = (sigcst_t)signal2(i, SIG_DFL)) == SIG_ERR) oldsigfunc[i] = SIG_DFL; else VOID_C signal2(i, oldsigfunc[i]); } for (i = 0; signallist[i].sig >= 0; i++) trapmode[signallist[i].sig] = signallist[i].flags; #ifndef NOJOB if (!interactive || ttyio < 0) jobok = 0; else { if (!orgpgrp) { orgpgrp = mypid; if (setpgroup(0, mypid) < (p_id_t)0 || settcpgrp(ttyio, orgpgrp) < 0) { doperror(NULL, NULL); return(-1); } } VOID_C gettcpgrp(ttyio, &ttypgrp); # ifdef SIGTTIN while (ttypgrp >= (p_id_t)0 && ttypgrp != orgpgrp) { VOID_C signal2(SIGTTIN, SIG_DFL); VOID_C kill(0, SIGTTIN); VOID_C signal2(SIGTTIN, oldsigfunc[SIGTTIN]); VOID_C gettcpgrp(ttyio, &ttypgrp); } # endif # if defined (NTTYDISC) && defined (ldisc) if (tioctl(ttyio, REQGETD, &tty) < 0) { doperror(NULL, NULL); return(-1); } else if (ldisc(tty) != NTTYDISC && (ldisc(tty) = NTTYDISC) > 0 && tioctl(ttyio, REQSETD, &tty) < 0) { # ifdef USESGTTY doperror(NULL, NULL); return(-1); # else /* !USESGTTY */ # ifdef ENODEV if (errno == ENODEV) /*EMPTY*/; else # endif jobok = 0; # endif /* !USESGTTY */ } # endif /* NTTYDISC && ldisc */ if (orgpgrp != mypid) { orgpgrp = mypid; if (setpgroup(0, mypid) < (p_id_t)0 || (mypid != ttypgrp && gettermio(orgpgrp, 1) < 0)) { doperror(NULL, NULL); return(-1); } } if (jobok < 0) jobok = 1; } #endif /* !NOJOB */ #if !MSDOS closeonexec(ttyio); #endif if (n > 2) { #ifdef FD initenv(); # ifdef DEP_PTY if (isshptymode()) checkscreen(0, 0); # endif # ifndef _NOCUSTOMIZE saveorigenviron(); # endif #endif /* FD */ initrc(0); #ifdef FD initfd(argv); #endif if (verboseinput) { kanjifputs(argv[2], Xstderr); #ifdef BASHSTYLE /* bash displays a newline with single string command, in -v mode */ VOID_C fputnl(Xstderr); #endif VOID_C Xfflush(Xstderr); } #ifdef DEP_PTY if (isshptymode()) { shellpid = (p_id_t)-1; n = ptymacro(argv[2], NULL, F_DOSYSTEM); } else #endif { setsignal(); n = _dosystem(argv[2]); resetsignal(0); } Xexit2(n); } n = 0; #ifdef BASHSTYLE /* bash changes the current directory if the variable PWD is set */ if ((cp = getconstvar(ENVPWD))) n = chdir2(cp); else #endif if (loginshell && interactive) n = chdir2(getconstvar(ENVHOME)); if (n < 0) { #ifdef FD initfd(argv); #endif errputs("No directory", 1); Xexit2(RET_FAIL); } if (!restricted) restricted = tmprestricted; if (!restricted) { #ifdef FD cp = getenv2("FD_SHELL"); #else cp = getconstvar(ENVSHELL); #endif if (cp) getshellname(getbasename(cp), NULL, &restricted); } #ifdef FD fd_restricted = restricted; #endif return(0); } int shell_loop(pseudoexit) int pseudoexit; { char *ps, *buf; int cont; shellmode = 1; setsignal(); cont = 0; if (pseudoexit) exit_status = -1; for (;;) { if (trapok >= 0) trapok = 1; if (!interactive) buf = readline(definput, '\0'); else { Xclearerr(Xstderr); #if !MSDOS checkmail(0); #endif ps = (cont) ? getconstvar(ENVPS2) : getconstvar(ENVPS1); #ifdef FD if (dumbterm > 1) { evalprompt(&buf, ps); kanjifputs(buf, Xstderr); Xfree(buf); VOID_C Xfflush(Xstderr); buf = readline(definput, '\0'); } else { ttyiomode(1); buf = inputshellstr(ps, -1, NULL); stdiomode(); if (!buf) continue; } #else /* !FD */ kanjifputs(ps, Xstderr); VOID_C Xfflush(Xstderr); buf = readline(definput, '\0'); #endif /* !FD */ } if (trapok >= 0) trapok = 0; if (!buf) { if (errno != EINTR) doperror(NULL, "stdin"); exec_line(NULL); break; } if (buf == vnullstr) { #ifndef MINIMUMSHELL if (interactive && ignoreeof) { if (cont) { exec_line(NULL); syntaxerrno = ER_UNEXPEOF; syntaxerror(nullstr); } else VOID_C Xfprintf(Xstderr, "Use \"%s\" to leave to the shell.\n", (loginshell) ? "logout" : "exit"); cont = 0; continue; } #endif /* !MINIMUMSHELL */ if (!cont) break; exec_line((char *)-1); cont = 0; ERRBREAK; } #ifdef DEP_FILECONV renewkanjiconv(&buf, DEFCODE, defaultkcode, L_FNAME); printf_defkanji++; #endif cont = exec_line(buf); #ifdef DEP_FILECONV printf_defkanji--; #endif Xfree(buf); if (pseudoexit && exit_status >= 0) break; #ifndef MINIMUMSHELL setshlineno(shlineno + 1L); #endif } resetsignal(0); if (exit_status >= 0) ret_status = exit_status; shellmode = 0; return(ret_status); } int main_shell(argc, argv, envp) int argc; char *CONST *argv, *CONST *envp; { shellmode = 1; setshellvar(envp); if (initshell(argc, argv) < 0) return(RET_FAIL); #ifdef FD initenv(); # if MSDOS inittty(1); # endif if (interactive) checkscreen(0, 0); # ifndef _NOCUSTOMIZE saveorigenviron(); # endif #endif /* FD */ #if defined (DEP_URLPATH) && defined (WITHNETWORK) urldrive = 1; #endif ret_status = RET_SUCCESS; initrc(!loginshell); #ifdef FD initfd(argv); #endif #ifdef DEP_PTY if (isshptymode()) { shellpid = (p_id_t)-1; ret_status = ptymacro(NULL, NULL, F_DOSYSTEM); } else #endif shell_loop(0); return(ret_status); } #ifdef FDSH int main(argc, argv, envp) int argc; char *CONST argv[], *CONST envp[]; { int ret; # ifdef DEBUG mtrace(); # endif ret = main_shell(argc, argv, envp); Xexit2(ret); return(0); } #endif /* FDSH */ #endif /* DEP_ORIGSHELL */ FD-3.01j/posixsh.c100644 2105 1751 112164 13516612560 12567 0ustar shiraiuser/* * posixsh.c * * XSH command for POSIX */ #ifdef FD #include "fd.h" #else #include "headers.h" #include "depend.h" #include "printf.h" #include "kctype.h" #include "string.h" #include "malloc.h" #endif #include "sysemu.h" #include "unixemu.h" #include "system.h" #include "termemu.h" #if !MSDOS #include "time.h" #endif #if defined (DEP_ORIGSHELL) && !defined (MINIMUMSHELL) #include "posixsh.h" #endif #ifdef FD #include "term.h" #endif #define ALIASDELIMIT "();&|<>" #define getconstvar(s) (getshellvar(s, strsize(s))) #define ER_COMNOFOUND 1 #define ER_NOTFOUND 2 #define ER_NOTIDENT 4 #define ER_BADOPTIONS 13 #define ER_NUMOUTRANGE 18 #define ER_NOTALIAS 20 #define ER_MISSARG 21 #define ER_NOSUCHJOB 22 #define ER_TERMINATED 23 #define ER_UNKNOWNSIG 26 #ifdef STRICTPOSIX /* POSIX needs that suspended job is prior for current job */ #define cmpjob(n1, n2) ((statjob(n1) > 0) > (statjob(n2) > 0) \ || ((statjob(n1) > 0) == (statjob(n2) > 0) \ && joblist[n1].order > joblist[n2].order)) #else #define cmpjob(n1, n2) (joblist[n1].order > joblist[n2].order) #endif #if !MSDOS typedef struct _mailpath_t { char *path; char *msg; time_t mtime; } mailpath_t; #endif #if defined (DEP_ORIGSHELL) && !defined (MINIMUMSHELL) extern int setenv2 __P_((CONST char *, CONST char *, int)); #ifdef DEP_PTY extern VOID sendparent __P_((int, ...)); #endif #ifndef FD extern int ttyio; extern XFILE *ttyout; #endif #ifndef NOJOB static CONST char *NEAR headstree __P_((syntaxtree *)); static int NEAR getmaxorder __P_((int *)); static int NEAR getlastjob __P_((int *)); #endif #ifndef NOALIAS static shaliastable *NEAR duplalias __P_((shaliastable *)); static int cmpalias __P_((CONST VOID_P, CONST VOID_P)); #endif static int NEAR _evalexpression __P_((CONST char *, int, long *)); static int NEAR evalexpression __P_((CONST char *, int, long *, int)); #if !MSDOS static VOID NEAR addmailpath __P_((CONST char *, char *, time_t)); #endif static int NEAR testsub1 __P_((int, CONST char *, int *)); static int NEAR testsub2 __P_((int, char *CONST *, int *)); static int NEAR testsub3 __P_((int, char *CONST *, int *, int)); #ifndef NOJOB jobtable *joblist = NULL; int maxjobs = 0; #endif #if !MSDOS int mailcheck = 0; #endif #ifndef NOALIAS shaliastable *shellalias = NULL; #endif #ifndef NOPOSIXUTIL int posixoptind = 0; #endif #if !MSDOS static mailpath_t *mailpathlist = NULL; static int maxmailpath = 0; #endif #ifndef NOJOB int gettermio(pgrp, job) p_id_t pgrp; int job; { int ret; sigmask_t mask, omask; if (ttypgrp < (p_id_t)0 || pgrp < (p_id_t)0) return(0); else if (!job) { ttypgrp = pgrp; return(0); } Xsigemptyset(mask); # ifdef SIGTSTP Xsigaddset(mask, SIGTSTP); # endif # ifdef SIGCHLD Xsigaddset(mask, SIGCHLD); # endif # ifdef SIGTTIN Xsigaddset(mask, SIGTTIN); # endif # ifdef SIGTTOU Xsigaddset(mask, SIGTTOU); # endif Xsigblock(omask, mask); # ifdef JOBVERBOSE VOID_C Xfprintf(ttyout, "gettermio: %id: %id -> %id\n", mypid, ttypgrp, pgrp); # endif if ((ret = settcpgrp(ttyio, pgrp)) >= 0) ttypgrp = pgrp; Xsigsetmask(omask); return(ret); } static CONST char *NEAR headstree(trp) syntaxtree *trp; { int id; if (!trp) return(NULL); if (trp -> flags & ST_NODE) return("{"); if (!(trp -> comm)) return(NULL); if (!isstatement(trp -> comm)) return((trp -> comm) -> argv[0]); id = (trp -> comm) -> id; if (id != SM_STATEMENT) return(NULL); trp = statementbody(trp); if (!trp || !(trp -> comm)) return(NULL); id = (trp -> comm) -> id; if (id == SM_CHILD || id == SM_STATEMENT) return(NULL); return(statementlist[id - 1].ident); } /*ARGSUSED*/ static int NEAR getmaxorder(idp) int *idp; { int n, order, id; order = id = -1; for (n = 0; n < maxjobs; n++) { if (!(joblist[n].pids)) continue; if (order < joblist[n].order) order = joblist[n].order; # ifdef BASHSTYLE if (id < joblist[n].id) id = joblist[n].id; # endif } if (idp) *idp = id; return(order); } static int NEAR getlastjob(prevp) int *prevp; { int n, last, prev; last = prev = -1; for (n = 0; n < maxjobs; n++) { if (!(joblist[n].pids)) continue; if (last < 0 || cmpjob(n, last)) { prev = last; last = n; } else if (!prevp) continue; else if (prev < 0 || cmpjob(n, prev)) { prev = n; } } if (prevp) *prevp = prev; return last; } VOID setlastjob(n) int n; { int order; if (n < 0 || n >= maxjobs) return; order = getmaxorder(NULL); if (order > joblist[n].order) joblist[n].order = ++order; } VOID dispjob(n, fp) int n; XFILE *fp; { int i, sig, last, prev; last = getlastjob(&prev); if (n < 0 || n >= maxjobs || !(joblist[n].pids)) return; i = joblist[n].npipe; VOID_C Xfprintf(fp, "[%d]%c %id ", jobid(n), (n == last) ? '+' : ((n == prev) ? '-' : ' '), joblist[n].pids[i]); sig = joblist[n].stats[i]; if (sig <= 0) VOID_C Xfprintf(fp, "%-28.28s", (sig) ? "Done" : "Running"); else dispsignal((sig >= 128) ? sig - 128 : sig, 28, fp); if (joblist[n].trp) { # ifdef DEP_FILECONV if (joblist[n].trp -> flags & ST_DEFKANJI) printf_defkanji++; # endif if (!isopbg(joblist[n].trp) && !isopnown(joblist[n].trp) && !isoppipe(joblist[n].trp)) joblist[n].trp -> type = OP_NONE; # ifdef BASHSTYLE /* bash always strips trailing '&' from stopped job. */ else if (sig <= 0 || sig >= 128) /*EMPTY*/; else if (isopbg(joblist[n].trp) || isopnown(joblist[n].trp)) joblist[n].trp -> type = OP_NONE; # endif printstree(joblist[n].trp, -1, fp); # ifdef DEP_FILECONV if (joblist[n].trp -> flags & ST_DEFKANJI) printf_defkanji--; # endif } VOID_C fputnl(fp); } int statjob(n) int n; { int i, sig; if (n < 0 || n >= maxjobs || !(joblist[n].pids)) return(-1); sig = -1; for (i = 0; i <= joblist[n].npipe; i++) { if (joblist[n].stats[i] < 0 || joblist[n].stats[i] >= 128) continue; if (sig < joblist[n].stats[i]) sig = joblist[n].stats[i]; } return(sig); } VOID freejob(n) int n; { if (n < 0 || n >= maxjobs) return; if (!(joblist[n].pids)) return; Xfree(joblist[n].pids); Xfree(joblist[n].stats); Xfree(joblist[n].fds); if (joblist[n].trp) { freestree(joblist[n].trp); Xfree(joblist[n].trp); } Xfree(joblist[n].tty); # ifdef BASHSTYLE /* bash does not reuse job number. */ memmove((char *)&(joblist[n]), (char *)&(joblist[n + 1]), (maxjobs - n - 1) * sizeof(jobtable)); n = maxjobs - 1; # endif joblist[n].pids = NULL; } int searchjob(pid, np) p_id_t pid; int *np; { int i, n; for (n = 0; n < maxjobs; n++) { if (!(joblist[n].pids)) continue; for (i = 0; i <= joblist[n].npipe; i++) { if (joblist[n].pids[i] != pid) continue; if (np) *np = i; return(n); } } return(-1); } int getjob(s) CONST char *s; { CONST char *cp; int n, id, len; if (!jobok) return(-1); if (!s) n = getlastjob(NULL); else { if (s[0] != '%') return(-1); if (!s[1] || ((s[1] == '%' || s[1] == '+') && !s[2])) n = getlastjob(NULL); else if (s[1] == '-' && !s[2]) VOID_C getlastjob(&n); else if ((id = isnumeric(&(s[1]))) >= 0) { # ifdef BASHSTYLE /* bash does not reuse job number. */ for (n = 0; n < maxjobs; n++) if (joblist[n].id == id) break; # else n = --id; # endif } else { len = strlen(&(s[1])); for (n = 0; n < maxjobs; n++) { if (!(joblist[n].pids) || !(joblist[n].trp) || !(cp = headstree(joblist[n].trp))) continue; if (!strnpathcmp(&(s[1]), cp, len)) break; } } } if (n < 0 || n >= maxjobs || !joblist || !(joblist[n].pids)) return(-1); if (statjob(n) < 0) return(-2); return(n); } int stackjob(pid, sig, fd, trp) p_id_t pid; int sig, fd; syntaxtree *trp; { int i, n, min; # ifdef FAKEUNINIT i = 0; /* fake for -Wuninitialized */ # endif if (!joblist) { joblist = (jobtable *)Xmalloc(BUFUNIT * sizeof(jobtable)); maxjobs = BUFUNIT; n = 0; for (i = 0; i < maxjobs; i++) joblist[i].pids = NULL; } else { min = -1; for (n = 0; n < maxjobs; n++) { if (!(joblist[n].pids)) { if (min < 0) min = n; continue; } for (i = 0; i <= joblist[n].npipe; i++) if (joblist[n].pids[i] == pid) break; if (i <= joblist[n].npipe) break; else if (joblist[n].pids[0] == childpgrp) { i = joblist[n].npipe + 1; break; } } if (n < maxjobs) /*EMPTY*/; else if (min >= 0) n = min; else { joblist = (jobtable *)Xrealloc(joblist, (maxjobs + BUFUNIT) * sizeof(jobtable)); maxjobs += BUFUNIT; for (i = n; i < maxjobs; i++) joblist[i].pids = NULL; } } if (!(joblist[n].pids)) { joblist[n].order = getmaxorder(&i) + 1; # ifdef BASHSTYLE /* bash does not reuse job number. */ joblist[n].id = i + 1; # endif joblist[n].pids = (p_id_t *)Xmalloc(BUFUNIT * sizeof(p_id_t)); joblist[n].stats = (int *)Xmalloc(BUFUNIT * sizeof(int)); joblist[n].fds = (int *)Xmalloc(BUFUNIT * sizeof(int)); joblist[n].npipe = 0; joblist[n].trp = NULL; joblist[n].tty = NULL; i = 0; } else if (i > joblist[n].npipe) { if (!(i % BUFUNIT)) { joblist[n].pids = (p_id_t *)Xrealloc(joblist[n].pids, (i + BUFUNIT) * sizeof(p_id_t)); joblist[n].stats = (int *)Xrealloc(joblist[n].stats, (i + BUFUNIT) * sizeof(int)); joblist[n].fds = (int *)Xrealloc(joblist[n].fds, (i + BUFUNIT) * sizeof(int)); } joblist[n].npipe = i; } else if (fd < 0) fd = joblist[n].fds[i]; joblist[n].pids[i] = pid; joblist[n].stats[i] = sig; joblist[n].fds[i] = fd; if (!i && !(joblist[n].trp) && trp) { joblist[n].trp = duplstree2(trp, NULL, 0L); if (!isoppipe(joblist[n].trp) && joblist[n].trp -> next) { freestree(joblist[n].trp -> next); joblist[n].trp -> next = NULL; } } # ifdef JOBVERBOSE VOID_C Xfprintf(ttyout, "stackjob: %id: %id, %d:", mypid, pid, n); for (i = 0; i <= joblist[n].npipe; i++) VOID_C Xfprintf(ttyout, "%id ", joblist[n].pids[i]); VOID_C fputnl(ttyout); # endif return(n); } int stoppedjob(pid) p_id_t pid; { int i, n; if (stopped) return(1); if ((n = searchjob(pid, &i)) < 0) /*EMPTY*/; else for (; i <= joblist[n].npipe; i++) { if (joblist[n].stats[i] < 0 || joblist[n].stats[i] >= 128) continue; return((joblist[n].stats[i]) ? 1 : 0); } return(-1); } VOID checkjob(fp) XFILE *fp; { int n; while (waitjob2(-1, NULL, WNOHANG | WUNTRACED, fp) > 0) /*EMPTY*/; if (fp) for (n = 0; n < maxjobs; n++) { if (!(joblist[n].pids) || statjob(n) >= 0) continue; if (joblist[n].trp && (isopbg(joblist[n].trp) || isopnown(joblist[n].trp))) joblist[n].trp -> type = OP_NONE; if (jobok && interactive && !nottyout) dispjob(n, fp); freejob(n); # ifdef BASHSTYLE /* bash does not reuse job number. */ n--; # endif } } VOID killjob(VOID_A) { int n, sig; for (n = 0; n < maxjobs; n++) { if (!(joblist[n].pids) || (sig = statjob(n)) < 0) continue; Xkillpg(joblist[n].pids[0], SIGHUP); if (sig > 0) Xkillpg(joblist[n].pids[0], SIGCONT); } } #endif /* !NOJOB */ #ifndef NOALIAS shaliastable *getshalias(ident, len) CONST char *ident; int len; { int i; if (len < 0) len = strlen(ident); for (i = 0; shellalias[i].ident; i++) { if (strncommcmp(ident, shellalias[i].ident, len)) continue; if (!(shellalias[i].ident[len])) return(&(shellalias[i])); } return(NULL); } int addalias(ident, comm) char *ident, *comm; { shaliastable *alias; int i; if ((alias = getshalias(ident, -1))) { Xfree(alias -> ident); Xfree(alias -> comm); } else { for (i = 0; shellalias[i].ident; i++) /*EMPTY*/; shellalias = (shaliastable *)Xrealloc(shellalias, (i + 2) * sizeof(shaliastable)); shellalias[i + 1].ident = NULL; alias = &(shellalias[i]); } alias -> ident = ident; alias -> comm = comm; # ifdef DEP_PTY sendparent(TE_ADDALIAS, ident, comm); # endif return(0); } int deletealias(ident) CONST char *ident; { reg_ex_t *re; int i, n, max; n = 0; re = regexp_init(ident, -1); for (max = 0; shellalias[max].ident; max++) /*EMPTY*/; for (i = 0; i < max; i++) { if (re) { if (!regexp_exec(re, shellalias[i].ident, 0)) continue; } else if (strcommcmp(ident, shellalias[i].ident)) continue; Xfree(shellalias[i].ident); Xfree(shellalias[i].comm); memmove((char *)&(shellalias[i]), (char *)&(shellalias[i + 1]), (max-- - i) * sizeof(shaliastable)); i--; n++; } regexp_free(re); if (!n) return(-1); # ifdef DEP_PTY sendparent(TE_DELETEALIAS, ident); # endif return(0); } static shaliastable *NEAR duplalias(alias) shaliastable *alias; { shaliastable *dupl; int i, n; if (!alias) n = 0; else for (n = 0; alias[n].ident; n++) /*EMPTY*/; dupl = (shaliastable *)Xmalloc((n + 1) * sizeof(shaliastable)); for (i = 0; i < n; i++) { dupl[i].ident = Xstrdup(alias[i].ident); dupl[i].comm = Xstrdup(alias[i].comm); } dupl[i].ident = NULL; return(dupl); } VOID freealias(alias) shaliastable *alias; { int i; if (alias) { for (i = 0; alias[i].ident; i++) { Xfree(alias[i].ident); Xfree(alias[i].comm); } Xfree(alias); } } static int cmpalias(vp1, vp2) CONST VOID_P vp1; CONST VOID_P vp2; { shaliastable *ap1, *ap2; ap1 = (shaliastable *)vp1; ap2 = (shaliastable *)vp2; return(strverscmp2(ap1 -> ident, ap2 -> ident)); } shaliastable *checkalias(trp, ident, len, delim) syntaxtree *trp; char *ident; int len, delim; { CONST statementtable *stat; shaliastable *alias; if (!trp || (trp -> flags & ST_NODE) || hascomm(trp) || !interactive || ((stat = getstatement(parentstree(trp))) && !(stat -> type & STT_NEEDLIST))) return(NULL); if (delim && (!Xstrchr(IFS_SET, delim) && !Xstrchr(ALIASDELIMIT, delim))) return(NULL); alias = getshalias(ident, len); if (!alias || (alias -> flags & AL_USED)) return(NULL); *ident = '\0'; alias -> flags |= AL_USED; return(alias); } #endif /* NOALIAS */ static int NEAR _evalexpression(s, ptr, resultp) CONST char *s; int ptr; long *resultp; { long n; int i, c, base; while (s[ptr] && Xstrchr(IFS_SET, s[ptr])) ptr++; if (!s[ptr]) return(-1); if (s[ptr] == '+') { if ((ptr = _evalexpression(s, ptr + 1, resultp)) < 0) return(-1); } else if (s[ptr] == '-') { if ((ptr = _evalexpression(s, ptr + 1, resultp)) < 0) return(-1); *resultp = -(*resultp); } else if (s[ptr] == '~') { if ((ptr = _evalexpression(s, ptr + 1, resultp)) < 0) return(-1); *resultp = ~(*resultp); } else if (s[ptr] == '!' && s[ptr + 1] != '=') { if ((ptr = _evalexpression(s, ptr + 1, resultp)) < 0) return(-1); *resultp = (*resultp) ? 0L : 1L; } else if (s[ptr] == '(') { if ((ptr = evalexpression(s, ptr + 1, resultp, 9)) < 0) return(-1); while (s[ptr] && Xstrchr(IFS_SET, s[ptr])) ptr++; if (s[ptr++] != ')') return(-1); } else if (Xisdigit(s[ptr])) { if (s[ptr] != '0') base = 10; else if (Xtoupper(s[++ptr]) != 'X') base = 8; else { base = 16; ptr++; } n = 0; for (i = ptr; s[i]; i++) { c = s[i]; if (Xisdigit(c)) c -= '0'; else if (Xislower(c)) c -= 'a' - 10; else if (Xisupper(c)) c -= 'A' - 10; else c = -1; if (c < 0 || c >= base) break; if (n > MAXTYPE(long) / base || (n == MAXTYPE(long) / base && c > MAXTYPE(long) % base)) return(-1); n = n * base + c; } if (i <= ptr) return(-1); ptr = i; *resultp = n; } else return(-1); while (s[ptr] && Xstrchr(IFS_SET, s[ptr])) ptr++; return(ptr); } static int NEAR evalexpression(s, ptr, resultp, lvl) CONST char *s; int ptr; long *resultp; int lvl; { long n; if (lvl < 1) { if ((ptr = _evalexpression(s, ptr, resultp)) < 0) return(-1); } else { if ((ptr = evalexpression(s, ptr, resultp, lvl - 1)) < 0) return(-1); } while (s[ptr]) { if (lvl < 1) { if (s[ptr] == '*') { ptr = _evalexpression(s, ptr + 1, &n); if (ptr < 0) return(-1); *resultp *= n; } else if (s[ptr] == '/') { ptr = _evalexpression(s, ptr + 1, &n); if (ptr < 0 || !n) return(-1); *resultp /= n; } else if (s[ptr] == '%') { ptr = _evalexpression(s, ptr + 1, &n); if (ptr < 0 || !n) return(-1); *resultp %= n; } else break; } else if (lvl < 2) { if (s[ptr] == '+') { ptr = evalexpression(s, ptr + 1, &n, lvl - 1); if (ptr < 0) return(-1); *resultp += n; } else if (s[ptr] == '-') { ptr = evalexpression(s, ptr + 1, &n, lvl - 1); if (ptr < 0) return(-1); *resultp -= n; } else break; } else if (lvl < 3) { if (s[ptr] == '<' && s[ptr + 1] == '<') { ptr = evalexpression(s, ptr + 2, &n, lvl - 1); if (ptr < 0) return(-1); *resultp <<= n; } else if (s[ptr] == '>' && s[ptr + 1] == '>') { ptr = evalexpression(s, ptr + 2, &n, lvl - 1); if (ptr < 0) return(-1); *resultp >>= n; } else break; } else if (lvl < 4) { if ((s[ptr] == '<' && s[ptr + 1] == '=') || (s[ptr] == '=' && s[ptr + 1] == '<')) { ptr = evalexpression(s, ptr + 2, &n, lvl - 1); if (ptr < 0) return(-1); *resultp = (long)(*resultp <= n); } else if ((s[ptr] == '>' && s[ptr + 1] == '=') || (s[ptr] == '=' && s[ptr + 1] == '>')) { ptr = evalexpression(s, ptr + 2, &n, lvl - 1); if (ptr < 0) return(-1); *resultp = (long)(*resultp >= n); } else if (s[ptr] == '>') { ptr = evalexpression(s, ptr + 1, &n, lvl - 1); if (ptr < 0) return(-1); *resultp = (long)(*resultp > n); } else if (s[ptr] == '<') { ptr = evalexpression(s, ptr + 1, &n, lvl - 1); if (ptr < 0) return(-1); *resultp = (long)(*resultp < n); } else break; } else if (lvl < 5) { if (s[ptr] == '=' && s[ptr + 1] == '=') { ptr = evalexpression(s, ptr + 2, &n, lvl - 1); if (ptr < 0) return(-1); *resultp = (long)(*resultp == n); } else if (s[ptr] == '!' && s[ptr + 1] == '=') { ptr = evalexpression(s, ptr + 2, &n, lvl - 1); if (ptr < 0) return(-1); *resultp = (long)(*resultp != n); } else break; } else if (lvl < 6) { if (s[ptr] == '&' && s[ptr + 1] != '&') { ptr = evalexpression(s, ptr + 1, &n, lvl - 1); if (ptr < 0) return(-1); *resultp = (*resultp & n); } else break; } else if (lvl < 7) { if (s[ptr] == '^') { ptr = evalexpression(s, ptr + 1, &n, lvl - 1); if (ptr < 0) return(-1); *resultp = (*resultp ^ n); } else break; } else if (lvl < 8) { if (s[ptr] == '|' && s[ptr + 1] != '|') { ptr = evalexpression(s, ptr + 1, &n, lvl - 1); if (ptr < 0) return(-1); *resultp = (*resultp | n); } else break; } else if (lvl < 9) { if (s[ptr] == '&' && s[ptr + 1] == '&') { ptr = evalexpression(s, ptr + 2, &n, lvl - 1); if (ptr < 0) return(-1); *resultp = (long)(*resultp && n); } else break; } else { if (s[ptr] == '|' && s[ptr + 1] == '|') { ptr = evalexpression(s, ptr + 2, &n, lvl - 1); if (ptr < 0) return(-1); *resultp = (long)(*resultp || n); } else break; } } return(ptr); } char *evalposixsubst(s, ptrp) CONST char *s; int *ptrp; { #ifndef BASHBUG syntaxtree *trp, *stree; redirectlist red; #endif char *cp, *new; long n; int i, len; i = 1; if (s[i] == '(') i++; s += i; len = *ptrp - i * 2; s = new = Xstrndup(s, len); if (i <= 1) { #ifndef BASHBUG /* bash cannot include 'case' statement within $() */ red.fd = red.type = red.new = 0; red.filename = vnullstr; i = len = 0; stree = newstree(NULL); trp = startvar(stree, &red, nullstr, &i, &len, 0); trp -> cont = CN_COMM; trp = analyze(s, trp, -1); if (trp && (trp -> cont & CN_SBST) != CN_CASE) trp = NULL; freestree(stree); Xfree(stree); if (trp) cp = NULL; else #endif /* !BASHBUG */ if (!(cp = evalbackquote(s))) *ptrp = -1; } else { n = 0L; cp = evalvararg(new, EA_STRIPESCAPE | EA_NOEVALQ | EA_NOEVALDQ | EA_BACKQ, 0); if (!cp) *ptrp = -1; else { for (i = 0; cp[i]; i++) if (!Xstrchr(IFS_SET, cp[i])) break; if (cp[i]) { i = evalexpression(cp, i, &n, 9); if (i < 0 || cp[i]) *ptrp = -1; } Xfree(cp); } cp = (*ptrp < 0) ? NULL : asprintf2("%ld", n); } Xfree(new); return(cp); } #if !MSDOS static VOID NEAR addmailpath(path, msg, mtime) CONST char *path; char *msg; time_t mtime; { int i; for (i = 0; i < maxmailpath; i++) if (!strpathcmp(path, mailpathlist[i].path)) break; if (i < maxmailpath) Xfree(mailpathlist[i].msg); else { mailpathlist = (mailpath_t *)Xrealloc(mailpathlist, (i + 1) * sizeof(mailpath_t)); maxmailpath = i + 1; mailpathlist[i].path = Xstrdup(path); } mailpathlist[i].msg = msg; mailpathlist[i].mtime = mtime; } VOID replacemailpath(s, multi) CONST char *s; int multi; { mailpath_t *mailpath; time_t mtime; CONST char *cp; char *msg, path[MAXPATHLEN]; int i, max, len; mailpath = mailpathlist; max = maxmailpath; mailpathlist = NULL; maxmailpath = 0; if (!multi) { for (i = 0; i < max; i++) if (!strpathcmp(s, mailpath[i].path)) break; mtime = (i < max) ? mailpath[i].mtime : 0; addmailpath(s, NULL, mtime); } else while (*s) { if ((cp = Xstrchr(s, ':'))) len = (cp++) - s; else { len = strlen(s); cp = &(s[len]); } if ((msg = Xstrchr(s, '%'))) { if (msg > s + len) msg = NULL; else { i = s + len - (msg + 1); len = msg - s; msg = Xstrndup(&(s[len + 1]), i); } } Xstrncpy(path, s, len); s = cp; for (i = 0; i < max; i++) if (!strpathcmp(path, mailpath[i].path)) break; mtime = (i < max) ? mailpath[i].mtime : 0; addmailpath(path, msg, mtime); } for (i = 0; i < max; i++) { Xfree(mailpath[i].path); Xfree(mailpath[i].msg); } Xfree(mailpath); } VOID checkmail(reset) int reset; { static time_t lastchecked = 0; time_t now; int i; if (reset) { for (i = 0; i < maxmailpath; i++) { Xfree(mailpathlist[i].path); Xfree(mailpathlist[i].msg); } Xfree(mailpathlist); mailpathlist = NULL; maxmailpath = 0; return; } if (mailcheck > 0) { now = Xtime(NULL); if (now < lastchecked + mailcheck) return; lastchecked = now; } for (i = 0; i < maxmailpath; i++) cmpmail(mailpathlist[i].path, mailpathlist[i].msg, &(mailpathlist[i].mtime)); } #endif /* !MSDOS */ #ifndef NOJOB /*ARGSUSED*/ int posixjobs(trp) syntaxtree *trp; { int n; if (mypid != orgpgrp) return(RET_SUCCESS); checkjob(NULL); for (n = 0; n < maxjobs; n++) { if (!(joblist[n].pids)) continue; if (statjob(n) >= 0) dispjob(n, Xstdout); else { if (isopbg(joblist[n].trp) || isopnown(joblist[n].trp)) joblist[n].trp -> type = OP_NONE; dispjob(n, Xstdout); freejob(n); # ifdef BASHSTYLE /* bash does not reuse job number. */ n--; # endif } } return(RET_SUCCESS); } /*ARGSUSED*/ int posixfg(trp) syntaxtree *trp; { char *s, *tty; int i, n, ret; s = ((trp -> comm) -> argc > 1) ? (trp -> comm) -> argv[1] : NULL; checkjob(NULL); if ((n = getjob(s)) < 0) { execerror((trp -> comm) -> argv, (trp -> comm) -> argv[1], (n < -1) ? ER_TERMINATED : ER_NOSUCHJOB, 2); return(RET_FAIL); } savetermio(ttyio, &tty, NULL); VOID_C Xfprintf(Xstderr, "[%d] %id\n", n + 1, joblist[n].pids[joblist[n].npipe]); loadtermio(ttyio, joblist[n].tty, NULL); VOID_C gettermio(joblist[n].pids[0], jobok); childpgrp = joblist[n].pids[0]; if (statjob(n) > 0) Xkillpg(joblist[n].pids[0], SIGCONT); for (i = 0; i <= joblist[n].npipe; i++) { if (joblist[n].stats[i] < 0 || joblist[n].stats[i] >= 128) continue; joblist[n].stats[i] = 0; } if (isopbg(joblist[n].trp) || isopnown(joblist[n].trp)) joblist[n].trp -> type = OP_NONE; i = joblist[n].npipe; ret = waitchild(joblist[n].pids[i], NULL); while (i-- > 0) { if (joblist[n].fds[i] < 0) continue; VOID_C closepipe2(joblist[n].fds[i], -1); } VOID_C gettermio(orgpgrp, jobok); loadtermio(ttyio, tty, NULL); Xfree(tty); return(ret); } /*ARGSUSED*/ int posixbg(trp) syntaxtree *trp; { char *s; int i, n; s = ((trp -> comm) -> argc > 1) ? (trp -> comm) -> argv[1] : NULL; checkjob(NULL); if ((n = getjob(s)) < 0) { execerror((trp -> comm) -> argv, (trp -> comm) -> argv[1], (n < -1) ? ER_TERMINATED : ER_NOSUCHJOB, 2); return(RET_FAIL); } if (statjob(n) > 0) Xkillpg(joblist[n].pids[0], SIGCONT); for (i = 0; i <= joblist[n].npipe; i++) { if (joblist[n].stats[i] < 0 || joblist[n].stats[i] >= 128) continue; joblist[n].stats[i] = 0; } if (!isopbg(joblist[n].trp) || !isopnown(joblist[n].trp)) joblist[n].trp -> type = OP_BG; if (interactive && !nottyout) dispjob(n, Xstderr); setlastjob(n); return(RET_SUCCESS); } #endif /* !NOJOB */ #ifndef NOALIAS int posixalias(trp) syntaxtree *trp; { shaliastable *alias; char **argv; int i, n, len, set, ret; argv = (trp -> comm) -> argv; if ((trp -> comm) -> argc <= 1) { alias = duplalias(shellalias); for (i = 0; alias[i].ident; i++) /*EMPTY*/; if (i > 1) qsort(alias, i, sizeof(shaliastable), cmpalias); for (i = 0; alias[i].ident; i++) VOID_C Xprintf("alias %k='%k'\n", alias[i].ident, alias[i].comm); freealias(alias); return(RET_SUCCESS); } ret = RET_SUCCESS; for (n = 1; n < (trp -> comm) -> argc; n++) { set = 0; for (len = 0; argv[n][len]; len++) if (argv[n][len] == '=') { set = 1; break; } if (set) VOID_C addalias(Xstrndup(argv[n], len), Xstrdup(&(argv[n][len + 1]))); else { if (!(alias = getshalias(argv[n], len))) { if (interactive) { errputs("alias: ", 0); execerror(argv, argv[n], ER_NOTFOUND, 2); } ret = RET_FAIL; ERRBREAK; } VOID_C Xprintf("alias %k='%k'\n", alias -> ident, alias -> comm); } } return(ret); } int posixunalias(trp) syntaxtree *trp; { char **argv; int n, ret; argv = (trp -> comm) -> argv; ret = RET_SUCCESS; for (n = 1; n < (trp -> comm) -> argc; n++) { if (deletealias(argv[n]) < 0) { if (interactive) { errputs("alias: ", 0); execerror(argv, argv[n], ER_NOTALIAS, 2); } ret = RET_FAIL; ERRBREAK; } } return(ret); } #endif /* NOALIAS */ int posixkill(trp) syntaxtree *trp; { char *s; p_id_t pid; int i, n, sig; if ((trp -> comm) -> argc <= 1) { errputs("usage: kill [ -sig ] pid ...", 1); errputs("for a list of signals: kill -l", 1); return(RET_SYNTAXERR); } #ifdef SIGTERM sig = SIGTERM; #else sig = 0; #endif s = (trp -> comm) -> argv[1]; if (s[0] != '-') i = 1; else { if (s[1] == 'l') { for (sig = n = 0; sig < NSIG; sig++) { for (i = 0; signallist[i].sig >= 0; i++) if (sig == signallist[i].sig) break; if (signallist[i].sig < 0) continue; VOID_C Xprintf("%s%c", signallist[i].ident, (++n % 16) ? ' ' : '\n'); } if (n % 16) putnl(); VOID_C Xfflush(Xstdout); return(RET_SUCCESS); } if ((sig = isnumeric(&(s[1]))) < 0) { for (i = 0; signallist[i].sig >= 0; i++) if (!strcmp(&(s[1]), signallist[i].ident)) break; if (signallist[i].sig < 0) { execerror((trp -> comm) -> argv, &(s[1]), ER_UNKNOWNSIG, 1); return(RET_FAIL); } sig = signallist[i].sig; } if (sig < 0 || sig >= NSIG) { execerror((trp -> comm) -> argv, s, ER_NUMOUTRANGE, 1); return(RET_FAIL); } i = 2; } #ifndef NOJOB checkjob(NULL); #endif for (; i < (trp -> comm) -> argc; i++) { s = (trp -> comm) -> argv[i]; #ifndef NOJOB if (*s == '%') { if ((n = getjob(s)) < 0) { execerror((trp -> comm) -> argv, s, (n < -1) ? ER_TERMINATED : ER_NOSUCHJOB, 2); return(RET_FAIL); } n = Xkillpg(joblist[n].pids[0], sig); } else #endif /* !NOJOB */ if ((pid = isnumeric(s)) < (p_id_t)0) { errputs("usage: kill [ -sig ] pid ...", 1); errputs("for a list of signals: kill -l", 1); return(RET_SYNTAXERR); } #if MSDOS else if (pid && pid != mypid) n = seterrno(EPERM); #endif else n = kill(pid, sig); if (n < 0) { doperror((trp -> comm) -> argv[0], s); return(RET_FAIL); } } return(RET_SUCCESS); } static int NEAR testsub1(c, s, ptrp) int c; CONST char *s; int *ptrp; { struct stat st; int ret; ret = -1; switch (c) { case 'r': if (s) ret = (Xaccess(s, R_OK) >= 0) ? RET_SUCCESS : RET_FAIL; break; case 'w': if (s) ret = (Xaccess(s, W_OK) >= 0) ? RET_SUCCESS : RET_FAIL; break; case 'x': if (s) ret = (Xaccess(s, X_OK) >= 0) ? RET_SUCCESS : RET_FAIL; break; case 'f': #if defined (BASHSTYLE) || defined (STRICTPOSIX) /* "test" on bash & POSIX regards -f as checking if regular file. */ if (s) ret = (*s && Xstat(s, &st) >= 0 && (st.st_mode & S_IFMT) == S_IFREG) #else if (s) ret = (*s && Xstat(s, &st) >= 0 && (st.st_mode & S_IFMT) != S_IFDIR) #endif ? RET_SUCCESS : RET_FAIL; break; case 'd': if (s) ret = (*s && Xstat(s, &st) >= 0 && (st.st_mode & S_IFMT) == S_IFDIR) ? RET_SUCCESS : RET_FAIL; break; case 'c': if (s) ret = (*s && Xstat(s, &st) >= 0 && (st.st_mode & S_IFMT) == S_IFCHR) ? RET_SUCCESS : RET_FAIL; break; case 'b': if (s) ret = (*s && Xstat(s, &st) >= 0 && (st.st_mode & S_IFMT) == S_IFBLK) ? RET_SUCCESS : RET_FAIL; break; case 'p': if (s) ret = (*s && Xstat(s, &st) >= 0 && (st.st_mode & S_IFMT) == S_IFIFO) ? RET_SUCCESS : RET_FAIL; break; case 'u': if (s) ret = (*s && Xstat(s, &st) >= 0 && st.st_mode & S_ISUID) ? RET_SUCCESS : RET_FAIL; break; case 'g': if (s) ret = (*s && Xstat(s, &st) >= 0 && st.st_mode & S_ISGID) ? RET_SUCCESS : RET_FAIL; break; case 'k': if (s) ret = (*s && Xstat(s, &st) >= 0 && st.st_mode & S_ISVTX) ? RET_SUCCESS : RET_FAIL; break; #if defined (BASHSTYLE) || defined (STRICTPOSIX) /* "test" on bash & POSIX has -e & -L option */ case 'e': if (s) ret = (*s && Xlstat(s, &st) >= 0) ? RET_SUCCESS : RET_FAIL; break; case 'L': #endif case 'h': if (s) ret = (*s && Xlstat(s, &st) >= 0 && (st.st_mode & S_IFMT) == S_IFLNK) ? RET_SUCCESS : RET_FAIL; break; case 's': if (s) ret = (*s && Xstat(s, &st) >= 0 && st.st_size > 0) ? RET_SUCCESS : RET_FAIL; break; case 't': if (s) { #ifdef BASHBUG /* Maybe bash's bug. */ if ((ret = isnumeric(s)) < 0) ret = 1; #else if ((ret = isnumeric(s)) < 0) ret = 0; #endif ret = (isatty(ret)) ? RET_SUCCESS : RET_FAIL; } else { (*ptrp)++; #ifdef BASHBUG /* Maybe bash's bug. */ ret = 0; #else ret = 1; #endif return((isatty(ret)) ? RET_SUCCESS : RET_FAIL); } break; case 'z': if (s) ret = (!*s) ? RET_SUCCESS : RET_FAIL; break; case 'n': if (s) ret = (*s) ? RET_SUCCESS : RET_FAIL; break; default: ret = -2; break; } if (ret >= 0) *ptrp += 2; return(ret); } static int NEAR testsub2(argc, argv, ptrp) int argc; char *CONST *argv; int *ptrp; { CONST char *s, *a1, *a2; int ret, v1, v2; if (*ptrp >= argc) return(-1); if (argv[*ptrp][0] == '(' && !argv[*ptrp][1]) { (*ptrp)++; if ((ret = testsub3(argc, argv, ptrp, 0)) < 0) return(ret); if (*ptrp >= argc || argv[*ptrp][0] != ')' || argv[*ptrp][1]) return(-1); (*ptrp)++; return(ret); } if (*ptrp + 2 < argc) { s = argv[*ptrp + 1]; a1 = argv[*ptrp]; a2 = argv[*ptrp + 2]; ret = -1; if (s[0] == '!' && s[1] == '=' && !s[2]) ret = (strcmp(a1, a2)) ? RET_SUCCESS : RET_FAIL; #ifdef BASHSTYLE /* bash's "test" allows "==" as same as "=" */ else if (s[0] == '=' && s[1] == '=' && !s[2]) ret = (!strcmp(a1, a2)) ? RET_SUCCESS : RET_FAIL; #endif else if (s[0] == '=' && !s[1]) ret = (!strcmp(a1, a2)) ? RET_SUCCESS : RET_FAIL; else if (s[0] == '-') { if ((v1 = isnumeric(a1)) < 0) { #ifdef BASHSTYLE /* bash's "test" does not allow arithmetic comparison with strings */ return(-3); #else v1 = 0; #endif } if ((v2 = isnumeric(a2)) < 0) { #ifdef BASHSTYLE /* bash's "test" does not allow arithmetic comparison with strings */ *ptrp += 2; return(-3); #else v2 = 0; #endif } if (s[1] == 'e' && s[2] == 'q' && !s[3]) ret = (v1 == v2) ? RET_SUCCESS : RET_FAIL; else if (s[1] == 'n' && s[2] == 'e' && !s[3]) ret = (v1 != v2) ? RET_SUCCESS : RET_FAIL; else if (s[1] == 'g' && s[2] == 't' && !s[3]) ret = (v1 > v2) ? RET_SUCCESS : RET_FAIL; else if (s[1] == 'g' && s[2] == 'e' && !s[3]) ret = (v1 >= v2) ? RET_SUCCESS : RET_FAIL; else if (s[1] == 'l' && s[2] == 't' && !s[3]) ret = (v1 < v2) ? RET_SUCCESS : RET_FAIL; else if (s[1] == 'l' && s[2] == 'e' && !s[3]) ret = (v1 <= v2) ? RET_SUCCESS : RET_FAIL; else { (*ptrp)++; return(-2); } } if (ret >= 0) { *ptrp += 3; return(ret); } } if (argv[*ptrp][0] == '-' && !argv[*ptrp][2]) { a1 = (*ptrp + 1 < argc) ? argv[*ptrp + 1] : NULL; ret = testsub1(argv[*ptrp][1], a1, ptrp); if (ret >= -1) return(ret); } ret = (argv[*ptrp][0]) ? RET_SUCCESS : RET_FAIL; (*ptrp)++; return(ret); } static int NEAR testsub3(argc, argv, ptrp, lvl) int argc; char *CONST *argv; int *ptrp, lvl; { int ret1, ret2; if (lvl > 2) { if (*ptrp >= argc) return(-1); if (argv[*ptrp][0] == '!' && !argv[*ptrp][1]) { (*ptrp)++; if ((ret1 = testsub2(argc, argv, ptrp)) < 0) return(ret1); return(1 - ret1); } return(testsub2(argc, argv, ptrp)); } if ((ret1 = testsub3(argc, argv, ptrp, lvl + 1)) < 0) return(ret1); if (*ptrp >= argc || argv[*ptrp][0] != '-' || argv[*ptrp][1] != ((lvl) ? 'a' : 'o') || argv[*ptrp][2]) return(ret1); (*ptrp)++; if ((ret2 = testsub3(argc, argv, ptrp, lvl)) < 0) return(ret2); ret1 = ((lvl) ? (ret1 != RET_FAIL && ret2 != RET_FAIL) : (ret1 != RET_FAIL || ret2 != RET_FAIL)) ? RET_SUCCESS : RET_FAIL; return(ret1); } int posixtest(trp) syntaxtree *trp; { char *CONST *argv; int ret, ptr, argc; argc = (trp -> comm) -> argc; argv = (trp -> comm) -> argv; if (argc <= 0) return(RET_FAIL); if (argv[0][0] == '[' && !argv[0][1] && (--argc <= 0 || argv[argc][0] != ']' || argv[argc][1])) { errputs("] missing", 1); return(RET_NOTICE); } if (argc <= 1) return(RET_FAIL); ptr = 1; ret = testsub3(argc, argv, &ptr, 0); if (!ret && ptr < argc) ret = -1; if (ret >= 0) return(ret); switch (ret) { case -1: errputs("argument expected", 0); break; case -2: VOID_C Xfprintf(Xstderr, "unknown operator %k", argv[ptr]); break; default: errputs("syntax error", 0); break; } VOID_C fputnl(Xstderr); return(RET_NOTICE); } #ifndef NOPOSIXUTIL int posixcommand(trp) syntaxtree *trp; { hashlist *hp; CONST VOID_P vp; char *cp, **argv, *path; int i, n, flag, ret, type, argc; argc = (trp -> comm) -> argc; argv = (trp -> comm) -> argv; if ((flag = tinygetopt(trp, "pvV", &n)) < 0) return(RET_FAIL); if (interrupted) return(RET_INTR); if (argc <= n) return(ret_status); # ifdef BASHSTYLE ret = RET_FAIL; # else ret = RET_SUCCESS; # endif if (flag == 'V') { for (i = n; i < argc; i++) { if (typeone(argv[i], Xstdout) >= 0) { # ifdef BASHSTYLE ret = RET_SUCCESS; # endif } } return(ret); } else if (flag == 'v') { for (i = n; i < argc; i++) { type = checktype2(argv[i], &vp, 0, 0); cp = argv[i]; if (type == CT_COMMAND) { type = searchhash(&hp, cp, NULL); # ifdef _NOUSEHASH if (!(type & CM_FULLPATH)) cp = (char *)hp; # else if (type & CM_HASH) cp = hp -> path; # endif if ((type & CM_NOTFOUND) || Xaccess(cp, X_OK) < 0) { execerror(argv, cp, ER_COMNOFOUND, 1); cp = NULL; } } if (cp) { kanjifputs(cp, Xstdout); putnl(); # ifdef BASHSTYLE ret = RET_SUCCESS; # endif } } return(ret); } type = checktype2(argv[n], &vp, 0, 0); if (verboseexec) { VOID_C Xfprintf(Xstderr, "+ %k", argv[n]); for (i = n + 1; i < argc; i++) VOID_C Xfprintf(Xstderr, " %k", argv[i]); VOID_C fputnl(Xstderr); } (trp -> comm) -> argc -= n; (trp -> comm) -> argv += n; if (flag != 'p') ret = exec_simplecom2(trp, type, vp, 0); else { path = Xstrdup(getconstvar(ENVPATH)); setenv2(ENVPATH, DEFPATH, 1); ret = exec_simplecom2(trp, type, vp, 0); setenv2(ENVPATH, path, 1); Xfree(path); } (trp -> comm) -> argc = argc; (trp -> comm) -> argv = argv; return(ret); } int posixgetopts(trp) syntaxtree *trp; { static int ptr = 0; char *cp, *optstr, *posixoptarg, *name, **argv, buf[MAXLONGWIDTH + 1]; int n, ret, quiet, argc; argc = (trp -> comm) -> argc; argv = (trp -> comm) -> argv; if (argc <= 2) { execerror(argv, NULL, ER_MISSARG, 1); return(RET_FAIL); } if (identcheck(argv[2], '\0') <= 0) { execerror(argv, argv[2], ER_NOTIDENT, 0); return(RET_FAIL); } optstr = argv[1]; name = argv[2]; quiet = 0; if (*optstr == ':') { quiet = 1; optstr++; } if (argc > 3) { argv = &(argv[2]); argc -= 2; } else { argv = argvar; argc = countvar(argv); } if (posixoptind <= 0) { ptr = 0; posixoptind = 1; } ret = RET_SUCCESS; posixoptarg = NULL; if (posixoptind >= argc || !argv[posixoptind]) ret = RET_FAIL; else if (ptr >= strlen(argv[posixoptind])) { if (++posixoptind < argc && argv[posixoptind]) ptr = 0; else ret = RET_FAIL; } if (ret == RET_SUCCESS && !ptr) { if (argv[posixoptind][0] != '-') ret = RET_FAIL; else if (argv[posixoptind][1] == '-' && !(argv[posixoptind][2])) { posixoptind++; ret = RET_FAIL; } else if (!(argv[posixoptind][ptr + 1])) ret = RET_FAIL; else ptr++; } if (ret != RET_SUCCESS) n = '?'; else { n = argv[posixoptind][ptr++]; if (n == ':' || ismsb(n) || !(cp = Xstrchr(optstr, n))) { buf[0] = n; buf[1] = '\0'; n = '?'; if (quiet) posixoptarg = buf; else execerror((trp -> comm) -> argv, buf, ER_BADOPTIONS, 2); } else if (*(cp + 1) == ':') { if (argv[posixoptind][ptr]) posixoptarg = &(argv[posixoptind++][ptr]); else if (++posixoptind < argc && argv[posixoptind]) posixoptarg = argv[posixoptind++]; else { buf[0] = n; buf[1] = '\0'; if (quiet) { n = ':'; posixoptarg = buf; } else { n = '?'; execerror((trp -> comm) -> argv, buf, ER_MISSARG, 2); } } ptr = 0; } } if (posixoptarg) setenv2(ENVOPTARG, posixoptarg, 0); else if (ret == RET_SUCCESS) unset(ENVOPTARG, strsize(ENVOPTARG)); buf[0] = n; buf[1] = '\0'; setenv2(name, buf, 0); n = posixoptind; VOID_C Xsnprintf(buf, sizeof(buf), "%d", n); setenv2(ENVOPTIND, buf, 0); posixoptind = n; return(ret); } #endif /* NOPOSIXUTIL */ #endif /* DEP_ORIGSHELL && !MINIMUMSHELL */ FD-3.01j/doscom.c100644 2105 1751 133144 13516612560 12357 0ustar shiraiuser/* * doscom.c * * builtin commands for DOS */ #ifdef FD #include "fd.h" #include "term.h" #include "types.h" #else #include "headers.h" #include "depend.h" #include "printf.h" #include "kctype.h" #include "string.h" #include "malloc.h" #endif #include "dirent.h" #include "sysemu.h" #include "system.h" #if defined (FD) || defined (WITHNETWORK) #include "realpath.h" #endif #ifdef DEP_URLPATH #include "urldisk.h" #endif #if MSDOS && !defined (FD) #define gettext dummy_gettext /* fake for DJGPP gcc-3.3 */ #include #endif #if MSDOS && !defined (FD) #define VOL_FAT32 "FAT32" # ifdef DOUBLESLASH # define MNTDIRSIZ MAXPATHLEN # else # define MNTDIRSIZ (3 + 1) # endif #endif /* MSDOS && !FD */ #if MSDOS #define DOSCOMOPT '/' #define C_EOF K_CTRL('Z') #else #define DOSCOMOPT '-' #define C_EOF K_CTRL('D') #endif #define COPYRETRY 10 #define DIRSORTFLAG "NSEDGA" #define DIRATTRFLAG "DRHSA" #define DEFDIRATTR "-H-S" #define dir_isdir(sp) (((((sp) -> mod) & S_IFMT) == S_IFDIR) ? 1 : 0) #if !defined (FD) && !defined (WITHNETWORK) # if MSDOS # define Xrealpath(p, r, f) \ unixrealpath(p, r) # else # define Xrealpath(p, r, f) \ realpath(p, r) # endif #endif /* !FD && !WITHNETWORK */ struct filestat_t { char *nam; #ifdef DEP_DOSLFN char *d_alias; #else #define d_alias nam #endif #ifndef NOSYMLINK char *lnam; #endif u_short mod; off_t siz; time_t mtim; time_t atim; u_char flags; }; #define FS_NOTMATCH 0001 #define FS_BADATTR 0002 #if defined (DOSCOMMAND) && defined (DEP_ORIGSHELL) #ifdef FD #define c_left termstr[C_LEFT] #else /* !FD */ # if MSDOS # define cc_intr K_CTRL('C') # define K_CR '\r' # else /* !MSDOS */ extern int ttyio; static int cc_intr = -1; # define K_CR '\n' # endif /* !MSDOS */ #define K_CTRL(c) ((c) & 037) #define K_BS 010 #define n_line 24 #define t_clear "\033[;H\033[2J" #define c_left "\010" #endif /* !FD */ #ifndef FD # if MSDOS typedef struct _statfs_t { u_short f_type; u_short f_version; u_long f_clustsize; u_long f_sectsize; u_long f_bavail; u_long f_blocks; u_long f_real_bavail_sect; u_long f_real_blocks_sect; u_long f_real_bavail; u_long f_real_blocks; u_char reserved[8]; } X_attr_packed statfs_t; # else /* !MSDOS */ # ifdef USESTATVFSH #include # ifdef USESTATVFS_T typedef statvfs_t statfs_t; # else typedef struct statvfs statfs_t; # endif # define statfs2 statvfs # define blocksize(fs) ((fs).f_frsize ? (fs).f_frsize : (fs).f_bsize) # endif /* USESTATVFSH */ # ifdef USESTATFSH #include typedef struct statfs statfs_t; # define f_bavail f_bfree # define blocksize(fs) (fs).f_bsize # endif /* USESTATFSH */ # ifdef USEVFSH #include typedef struct statfs statfs_t; # define blocksize(fs) (fs).f_bsize # endif /* USEVFSH */ # ifdef USEMOUNTH #include typedef struct statfs statfs_t; # define blocksize(fs) (fs).f_bsize # endif /* USEMOUNTH */ # ifdef USEFSDATA #include typedef struct fs_data statfs_t; # define statfs2(p, b) (statfs(p, b) - 1) # define blocksize(fs) 1024 # define f_blocks fd_req.btot # define f_bavail fd_req.bfreen # endif /* USEFSDATA */ # ifdef USEFFSIZE # define f_bsize f_fsize # endif # if defined (USESTATFSH) || defined (USEVFSH) || defined (USEMOUNTH) # if (STATFSARGS >= 4) # define statfs2(p, b) statfs(p, b, sizeof(statfs_t), 0) # else /* STATFSARGS < 4 */ # if (STATFSARGS == 3) # define statfs2(p, b) statfs(p, b, sizeof(statfs_t)) # else /* STATFSARGS != 3 */ # ifdef USEFSTATFS static int NEAR statfs2 __P_((CONST char *, statfs_t *)); # else # define statfs2 statfs # endif # endif /* STATFSARGS != 3 */ # endif /* STATFSARGS < 4 */ # endif /* USESTATFSH || USEVFSH || USEMOUNTH */ # endif /* !MSDOS */ #endif /* !FD */ #ifdef DEBUG extern char *_mtrace_file; #endif #ifdef FD extern int getinfofs __P_((CONST char *, off_t *, off_t *, off_t *)); extern int touchfile __P_((CONST char *, struct stat *)); #ifndef NODIRLOOP extern int issamebody __P_((CONST char *, CONST char *)); #endif #ifndef NOSYMLINK extern int cpsymlink __P_((CONST char *, CONST char *)); #endif extern char *inputstr __P_((CONST char *, int, int, CONST char *, int)); #else /* !FD */ static int NEAR getinfofs __P_((CONST char *, off_t *, off_t *, off_t *)); # if MSDOS # define ttyiomode(n) # define stdiomode() # define getkey3(n, c, t) \ getch(); # else /* !MSDOS */ static VOID NEAR ttymode __P_((int)); # define ttyiomode(n) (ttymode(1)) # define stdiomode() (ttymode(0)) static int NEAR getkey3 __P_((int, int, int)); # endif /* !MSDOS */ static int NEAR touchfile __P_((CONST char *, struct stat *)); # ifndef NODIRLOOP static int NEAR issamebody __P_((CONST char *, CONST char *)); # endif # ifndef NOSYMLINK static int NEAR cpsymlink __P_((CONST char *, CONST char *)); # endif #endif /* !FD */ static VOID NEAR doserror __P_((CONST char *, int)); static VOID NEAR dosperror __P_((CONST char *)); static VOID NEAR putsize __P_((off_t *, off_t *)); static int NEAR inputkey __P_((VOID_A)); static int cmpdirent __P_((CONST VOID_P, CONST VOID_P)); static int NEAR filterattr __P_((CONST struct filestat_t *)); static VOID NEAR evalenvopt __P_((CONST char *, CONST char *, int (NEAR *)__P_((int, char *CONST [])))); static int NEAR adddirflag __P_((char *, CONST char *, CONST char *)); static int NEAR getdiropt __P_((int, char *CONST [])); static int NEAR showstr __P_((char *, int, int)); #ifdef MINIMUMSHELL static VOID NEAR showfname __P_((struct filestat_t *, off_t *)); #else static VOID NEAR showfname __P_((struct filestat_t *, off_t *, int)); #endif static VOID NEAR showfnamew __P_((struct filestat_t *)); static VOID NEAR showfnameb __P_((struct filestat_t *)); #ifdef MINIMUMSHELL static int NEAR _checkline __P_((VOID_A)); #define checkline(n) _checkline() #else static int NEAR _checkline __P_((int)); #define checkline _checkline #endif static VOID NEAR dosdirheader __P_((VOID_A)); #ifdef MINIMUMSHELL static VOID NEAR dosdirfooter __P_((off_t *, int, int, off_t *, off_t *)); static int NEAR dosdir __P_((reg_ex_t *, off_t *, int *, int *, off_t *)); #else static VOID NEAR dosdirfooter __P_((off_t *, int, int, off_t *, off_t *, off_t *, off_t *)); static int NEAR dosdir __P_((reg_ex_t *, off_t *, int *, int *, off_t *, off_t *)); #endif int doscomdir __P_((int, char *CONST [])); static int NEAR checkarg __P_((int, char *CONST [])); int doscommkdir __P_((int, char *CONST [])); int doscomrmdir __P_((int, char *CONST [])); int doscomerase __P_((int, char *CONST [])); static char *NEAR convwild __P_((char *, CONST char *, CONST char *, CONST char *)); int doscomrename __P_((int, char *CONST [])); static int NEAR getcopyopt __P_((int, char *CONST [])); static int NEAR getbinmode __P_((CONST char *, int)); static int NEAR writeopen __P_((CONST char *, CONST char *)); static int NEAR textread __P_((int, char *, int, int, int, off_t *, off_t)); static VOID NEAR textclose __P_((int, int)); static int NEAR doscopy __P_((CONST char *, CONST char *, struct stat *, int, int, int)); int doscomcopy __P_((int, char *CONST [])); int doscomcls __P_((int, char *CONST [])); int doscomtype __P_((int, char *CONST [])); static CONST char *doserrstr[] = { NULL, #define ER_REQPARAM 1 "Required parameter missing", #define ER_TOOMANYPARAM 2 "Too many parameters", #define ER_FILENOTFOUND 3 "File not found", #define ER_INVALIDPARAM 4 "Invalid parameter", #define ER_DUPLFILENAME 5 "Duplicate file name or file in use", #define ER_COPIEDITSELF 6 "File cannot be copied onto itself", #define ER_INVALIDSW 7 "Invalid switch", }; #define DOSERRSIZ arraysize(doserrstr) static char dirsort[strsize(DIRSORTFLAG) * 2 + 1] = ""; static char dirattr[strsize(DIRATTRFLAG) * 2 + 1] = ""; static int dirline = 0; static char *dirwd = NULL; static int dirtype = '\0'; static int dirflag = 0; #define DF_LOWER 001 #define DF_PAUSE 002 #define DF_SUBDIR 004 #define DF_CANCEL 010 static int copyflag = 0; #define CF_BINARY 001 #define CF_TEXT 002 #define CF_VERIFY 004 #define CF_NOCONFIRM 010 #define CF_VERBOSE 020 #define CF_CANCEL 040 #ifndef FD # ifdef USEFSTATFS static int NEAR statfs2(path, buf) CONST char *path; statfs_t *buf; { int n, fd; if ((fd = Xopen(path, O_RDONLY, 0666)) < 0) return(-1); n = fstatfs(fd, buf); Xclose(fd); return(n); } # endif /* USEFSTATFS */ static int NEAR getinfofs(path, totalp, freep, bsizep) CONST char *path; off_t *totalp, *freep, *bsizep; { # if MSDOS # ifdef DOUBLESLASH char *cp; int len; # endif struct SREGS sreg; __dpmi_regs reg; char drv[MNTDIRSIZ], buf[128]; # else /* !MSDOS */ struct stat st; # endif /* !MSDOS */ statfs_t fsbuf; int n; n = 0; *totalp = *freep = *bsizep = (off_t)0; # if MSDOS # ifdef DOUBLESLASH if ((len = isdslash(path))) { if ((cp = strdelim(&(path[len]), 0))) { len = cp - path; if (!(cp = strdelim(&(path[len + 1]), 0))) cp += strlen(cp); len = cp - path; } Xstrncpy(drv, path, len); } else # endif VOID_C gendospath(drv, Xtoupper(path[0]), _SC_); reg.x.ax = 0x71a0; reg.x.bx = 0; reg.x.cx = sizeof(buf); # ifdef DJGPP dos_putpath(drv, sizeof(buf)); # endif sreg.ds = PTR_SEG(drv); reg.x.dx = PTR_OFF(drv, sizeof(buf)); sreg.es = PTR_SEG(buf); reg.x.di = PTR_OFF(buf, 0); if (intcall(0x21, ®, &sreg) >= 0 && (reg.x.bx & 0x4000) # ifdef DJGPP && (dosmemget(__tb, sizeof(buf), buf), 1) # endif && !strcmp(buf, VOL_FAT32)) { reg.x.ax = 0x7303; reg.x.cx = sizeof(fsbuf); # ifdef DJGPP dos_putpath(path, sizeof(fsbuf)); # endif sreg.es = PTR_SEG(&fsbuf); reg.x.di = PTR_OFF(&fsbuf, 0); sreg.ds = PTR_SEG(path); reg.x.dx = PTR_OFF(path, sizeof(fsbuf)); if (intcall(0x21, ®, &sreg) < 0) n = -1; else { # ifdef DJGPP dosmemget(__tb, sizeof(fsbuf), &fsbuf); # endif *totalp = (off_t)(fsbuf.f_blocks); *freep = (off_t)(fsbuf.f_bavail); *bsizep = (off_t)(fsbuf.f_clustsize) * (off_t)(fsbuf.f_sectsize); } } else { reg.x.ax = 0x3600; reg.h.dl = drv[0] - 'A' + 1; intcall(0x21, ®, &sreg); if (reg.x.ax == 0xffff) n = seterrno(ENOENT); else { *totalp = (off_t)(reg.x.dx); *freep = (off_t)(reg.x.bx); *bsizep = (off_t)(reg.x.ax) * (off_t)(reg.x.cx); } } if (!*totalp || !*bsizep || *totalp < *freep) n = seterrno(EIO); # else /* !MSDOS */ if (statfs2(path, &fsbuf) < 0) n = -1; else { # ifndef NOFBLOCKS *totalp = fsbuf.f_blocks; # endif # ifndef NOFBFREE *freep = fsbuf.f_bavail; # endif *bsizep = blocksize(fsbuf); } # endif /* !MSDOS */ if (n < 0) { # if MSDOS *bsizep = (off_t)1024; # else /* !MSDOS */ # ifndef NOSTBLKSIZE if (Xstat(path, &st) >= 0) *bsizep = (off_t)(st.st_blksize); else # endif *bsizep = (off_t)DEV_BSIZE; # endif /* !MSDOS */ } return(n); } # if !MSDOS static VOID NEAR ttymode(on) int on; { # if !defined (USETERMIOS) && !defined (USETERMIO) struct tchars cc; # endif termioctl_t tty; if (ttyio < 0 || tioctl(ttyio, REQGETP, &tty) < 0) return; # if defined (USETERMIOS) || defined (USETERMIO) if (cc_intr < 0) cc_intr = tty.c_cc[VINTR]; if (on) tty.c_lflag &= ~(ECHO | ICANON | ISIG); else tty.c_lflag |= (ECHO | ICANON | ISIG); # else /* !USETERMIO && !USETERMIO */ if (cc_intr < 0) { if (tioctl(ttyio, TIOCGETC, &cc) < 0) cc_intr = K_CTRL('C'); else cc_intr = cc.t_intrc; } if (on) { tty.sg_flags |= RAW; tty.sg_flags &= ~ECHO; } else { tty.sg_flags &= ~RAW; tty.sg_flags |= ECHO; } # endif /* !USETERMIOS && !USETERMIO */ VOID_C tioctl(ttyio, REQSETP, &tty); } /*ARGSUSED*/ static int NEAR getkey3(sig, code, timeout) int sig, code, timeout; { u_char uc; int i; if (ttyio < 0) return(EOF); while ((i = read(ttyio, &uc, sizeof(uc))) < 0 && errno == EINTR); if (i < (int)sizeof(uc)) return(EOF); return((int)uc); } # endif /* !MSDOS */ static int NEAR touchfile(path, stp) CONST char *path; struct stat *stp; { struct utimes_t ut; ut.actime = stp -> st_atime; ut.modtime = stp -> st_mtime; return(Xutimes(path, &ut)); } # ifndef NODIRLOOP static int NEAR issamebody(src, dest) CONST char *src, *dest; { struct stat st1, st2; if (Xstat(src, &st1) < 0 || Xstat(dest, &st2) < 0) return(0); if (st1.st_dev != st2.st_dev || st1.st_ino != st2.st_ino) return(0); # ifdef DEP_URLPATH if (st1.st_dev == (dev_t)-1 || st1.st_ino == (ino_t)-1) return(0); # endif return(1); } # endif /* !NODIRLOOP */ # ifndef NOSYMLINK static int NEAR cpsymlink(src, dest) CONST char *src, *dest; { struct stat st; char path[MAXPATHLEN]; int len; if ((len = Xreadlink(src, path, strsize(path))) < 0) return(-1); if (Xlstat(dest, &st) >= 0) { # ifndef NODIRLOOP if (issamebody(src, dest)) return(0); # endif if (Xunlink(dest) < 0) return(-1); } path[len] = '\0'; if (Xsymlink(path, dest) < 0) return(-1); return(1); } # endif /* !NOSYMLINK */ #endif /* !FD */ static VOID NEAR doserror(s, n) CONST char *s; int n; { if (!n || n >= DOSERRSIZ) return; if (s) { kanjifputs(s, Xstderr); VOID_C fputnl(Xstderr); } errputs(doserrstr[n], 1); } static VOID NEAR dosperror(s) CONST char *s; { int duperrno; duperrno = errno; if (errno < 0) return; if (s) { kanjifputs(s, Xstderr); VOID_C fputnl(Xstderr); } errputs(Xstrerror(duperrno), 1); errno = 0; } static VOID NEAR putsize(np, bsizep) off_t *np, *bsizep; { off_t s, mb; if (*np < (off_t)0 || !*bsizep) { VOID_C Xprintf("%15.15s bytes", "?"); return; } s = ((off_t)1024 * (off_t)1024 + (*bsizep / 2)) / *bsizep; mb = *np / s; if (mb < (off_t)1024) VOID_C Xprintf("%'15qd bytes", *np * *bsizep); else VOID_C Xprintf("%'12qd.%02qd MB", mb, ((*np - mb * s) * (off_t)100) / s); } static int NEAR inputkey(VOID_A) { int c; ttyiomode(1); c = getkey3(0, inputkcode, 0); stdiomode(); if (c == EOF) c = -1; else if (c == cc_intr) { puts2("^C"); putnl(); c = -1; } return(c); } static int cmpdirent(vp1, vp2) CONST VOID_P vp1; CONST VOID_P vp2; { struct filestat_t *sp1, *sp2; char *cp1, *cp2; int i, r, ret; sp1 = (struct filestat_t *)vp1; sp2 = (struct filestat_t *)vp2; if (!Xstrchr(dirsort, 'E')) cp1 = cp2 = NULL; else { if ((cp1 = Xstrrchr(sp1 -> nam, '.'))) *cp1 = '\0'; if ((cp2 = Xstrrchr(sp2 -> nam, '.'))) *cp2 = '\0'; } ret = 0; for (i = 0; dirsort[i]; i++) { r = 0; if (dirsort[i] == '-') { i++; r = 1; } switch (dirsort[i]) { case 'N': ret = strpathcmp2(sp1 -> nam, sp2 -> nam); break; case 'S': if (sp1 -> siz == sp2 -> siz) ret = 0; else ret = (sp1 -> siz > sp2 -> siz) ? 1 : -1; break; case 'E': if (cp1) ret = (cp2) ? strpathcmp2(cp1 + 1, cp2 + 1) : 1; else ret = (cp2) ? -1 : 0; break; case 'D': if (sp1 -> mtim == sp2 -> mtim) ret = 0; else ret = (sp1 -> mtim > sp2 -> mtim) ? 1 : -1; break; case 'G': ret = dir_isdir(sp2) - dir_isdir(sp1); break; case 'A': if (sp1 -> atim == sp2 -> atim) ret = 0; else ret = (sp1 -> atim > sp2 -> atim) ? 1 : -1; break; default: break; } if (r) ret = -ret; if (ret) break; } if (cp1) *cp1 = '.'; if (cp2) *cp2 = '.'; return(ret); } static int NEAR filterattr(dp) CONST struct filestat_t *dp; { int i, f; for (i = 0; dirattr[i]; i++) { f = 0; if (dirattr[i] == '-') { i++; f++; } switch (dirattr[i]) { case 'D': if (!(dir_isdir(dp))) f ^= 1; break; case 'R': if (dp -> mod & S_IWUSR) f ^= 1; break; case 'H': if (dp -> mod & S_IRUSR) f ^= 1; break; case 'S': if ((dp -> mod & S_IFMT) != S_IFSOCK) f ^= 1; break; case 'A': if (!(dp -> mod & S_ISVTX)) f ^= 1; break; default: break; } if (f) return(-1); } return(0); } static VOID NEAR evalenvopt(cmd, env, getoptcmd) CONST char *cmd, *env; int (NEAR *getoptcmd)__P_((int, char *CONST [])); { char *cp, **argv; int n, er, argc; if (!(cp = getshellvar(env, -1)) || !*cp) return; argv = (char **)Xmalloc(3 * sizeof(char *)); argc = 2; argv[0] = Xstrdup(cmd); argv[1] = Xstrdup(cp); argv[2] = NULL; argc = evalifs(argc, &argv, IFS_SET); er = 0; if ((n = (*getoptcmd)(argc, argv)) < 0) er++; else if (argc > n) { er++; doserror(argv[n], ER_TOOMANYPARAM); } if (er) puts2("(Error occurred in environment variable)\n\n"); freevar(argv); } static int NEAR adddirflag(buf, arg, flags) char *buf; const char *arg, *flags; { int i, n, r; n = r = 0; arg += 2; for (i = 0; arg[i]; i++) { if (Xstrchr(flags, arg[i])) { if (!Xmemchr(buf, arg[i], n)) buf[n++] = arg[i]; r = 0; } else if (arg[i] == '-' && !r) { buf[n++] = '-'; r = 1; } else { doserror(arg, ER_INVALIDSW); return(-1); } } if (r) { doserror(arg, ER_INVALIDSW); return(-1); } return(n); } static int NEAR getdiropt(argc, argv) int argc; char *CONST argv[]; { char *arg; int i, n, r; for (i = 1; i < argc; i++) { arg = argv[i]; if (arg[0] != DOSCOMOPT) break; Xstrtoupper(&(arg[1])); r = (arg[1] == '-') ? 1 : 0; switch (arg[1 + r]) { case 'P': if (r) dirflag &= ~DF_PAUSE; else dirflag |= DF_PAUSE; break; case 'W': if (r) { if (dirtype == 'W') dirtype = '\0'; break; } if (dirtype != 'B') dirtype = 'W'; break; case 'A': if (r) { Xstrcpy(dirattr, DEFDIRATTR); break; } n = adddirflag(dirattr, arg, DIRATTRFLAG); if (n < 0) return(-1); dirattr[n] = '\0'; continue; /*NOTREACHED*/ break; case 'O': if (r) { dirsort[0] = '\0'; break; } n = adddirflag(dirsort, arg, DIRSORTFLAG); if (n < 0) return(-1); if (!n) dirsort[n++] = 'N'; dirsort[n] = '\0'; continue; /*NOTREACHED*/ break; case 'S': if (r) dirflag &= ~DF_SUBDIR; else dirflag |= DF_SUBDIR; break; case 'B': if (r) { if (dirtype == 'B') dirtype = '\0'; break; } dirtype = 'B'; break; case 'L': if (r) dirflag &= ~DF_LOWER; else dirflag |= DF_LOWER; break; #ifndef MINIMUMSHELL case 'V': if (r) { if (dirtype == 'V') dirtype = '\0'; break; } if (!dirtype) dirtype = 'V'; break; case '4': if (r) { if (dirtype == '4') dirtype = '\0'; break; } if (!dirtype) dirtype = '4'; break; #endif /* !MINIMUMSHELL */ default: doserror(argv[i], ER_INVALIDSW); return(-1); /*NOTREACHED*/ break; } if (*(arg += 2 + r)) { doserror(arg, ER_INVALIDSW); return(-1); } } return(i); } static int NEAR showstr(s, len, lower) char *s; int len, lower; { int i, olen; olen = len; if (len < 0) len = -len; for (i = 0; s[i] && len > 0; i++, len--) { if (iskanji1(s, i)) { if (len <= 1) break; i++; len--; } #ifdef CODEEUC else if (isekana(s, i)) i++; #endif } if (olen >= 0) while (len-- > 0) s[i++] = ' '; else olen = -olen - len; s[i] = '\0'; if (lower) Xstrtolower(s); else Xstrtoupper(s); Xprintf("%K", s); return(olen); } #ifdef MINIMUMSHELL static VOID NEAR showfname(dirp, bsizep) struct filestat_t *dirp; off_t *bsizep; #else static VOID NEAR showfname(dirp, bsizep, verbose) struct filestat_t *dirp; off_t *bsizep; int verbose; #endif { struct tm *tm; char *ext, buf[MAXNAMLEN + 1]; int i; Xstrcpy(buf, dirp -> d_alias); if (isdotdir(buf)) ext = NULL; else if ((ext = Xstrrchr(buf, '.'))) { if (ext == buf) { ext = NULL; Xstrcpy(buf, &(dirp -> d_alias[1])); } else { *(ext++) = '\0'; i = ext - buf; ext = &(dirp -> d_alias[i]); } } showstr(buf, 8, (dirflag & DF_LOWER)); putc2(' '); if (!ext) puts2(" "); else { Xstrcpy(buf, ext); showstr(buf, 3, (dirflag & DF_LOWER)); } putc2(' '); switch (dirp -> mod & S_IFMT) { case S_IFREG: #ifndef NOSYMLINK case S_IFLNK: #endif VOID_C Xprintf("%'13qd", dirp -> siz); break; case S_IFDIR: puts2(" "); break; default: puts2(" "); break; } #ifndef MINIMUMSHELL if (verbose > 0) { if ((dirp -> mod & S_IFMT) != S_IFREG) puts2(" "); else { dirp -> siz = ((dirp -> siz + *bsizep - 1) / *bsizep) * *bsizep; VOID_C Xprintf("%'14qd", dirp -> siz); } } #endif /* !MINIMUMSHELL */ #ifdef DEBUG _mtrace_file = "localtime(start)"; tm = localtime(&(dirp -> mtim)); if (_mtrace_file) _mtrace_file = NULL; else { _mtrace_file = "localtime(end)"; malloc(0); /* dummy malloc */ } #else tm = localtime(&(dirp -> mtim)); #endif puts2(" "); #ifndef MINIMUMSHELL if (verbose < 0) VOID_C Xprintf("%04d-%02d-%02d %2d:%02d ", tm -> tm_year + 1900, tm -> tm_mon + 1, tm -> tm_mday, tm -> tm_hour, tm -> tm_min); else #endif VOID_C Xprintf("%02d-%02d-%02d %2d:%02d ", tm -> tm_year % 100, tm -> tm_mon + 1, tm -> tm_mday, tm -> tm_hour, tm -> tm_min); #ifndef MINIMUMSHELL if (verbose > 0) { # ifdef DEBUG _mtrace_file = "localtime(start)"; tm = localtime(&(dirp -> atim)); if (_mtrace_file) _mtrace_file = NULL; else { _mtrace_file = "localtime(end)"; malloc(0); /* dummy malloc */ } # else tm = localtime(&(dirp -> atim)); # endif VOID_C Xprintf(" %02d-%02d-%02d ", tm -> tm_year % 100, tm -> tm_mon + 1, tm -> tm_mday); Xstrcpy(buf, " "); if (!(dirp -> mod & S_IWUSR)) buf[0] = 'R'; if (!(dirp -> mod & S_IRUSR)) buf[1] = 'H'; if ((dirp -> mod & S_IFMT) == S_IFSOCK) buf[2] = 'S'; if ((dirp -> mod & S_IFMT) == S_IFIFO) buf[3] = 'L'; if (dir_isdir(dirp)) buf[4] = 'D'; if (dirp -> mod & S_ISVTX) buf[5] = 'A'; puts2(buf); } #endif /* !MINIMUMSHELL */ Xprintf("%K", dirp -> nam); #ifndef NOSYMLINK if (dirp -> lnam) VOID_C Xprintf(" -> %s", dirp -> lnam); #endif putnl(); } static VOID NEAR showfnamew(dirp) struct filestat_t *dirp; { char *ext, buf[MAXNAMLEN + 1]; int i, len; if (dir_isdir(dirp)) putc2('['); Xstrcpy(buf, dirp -> d_alias); if (isdotdir(buf)) ext = NULL; else if ((ext = Xstrrchr(buf, '.'))) { if (ext == buf) { ext = NULL; Xstrcpy(buf, &(dirp -> d_alias[1])); } else { *(ext++) = '\0'; i = ext - buf; ext = &(dirp -> d_alias[i]); } } len = showstr(buf, -8, (dirflag & DF_LOWER)); if (ext) { putc2('.'); len++; Xstrcpy(buf, ext); len += showstr(buf, -3, (dirflag & DF_LOWER)); } if (dir_isdir(dirp)) putc2(']'); for (; len < 8 + 1 + 3; len++) putc2(' '); } static VOID NEAR showfnameb(dirp) struct filestat_t *dirp; { char *cp, buf[MAXPATHLEN]; if (dirflag & DF_SUBDIR) { cp = dirwd; if (dirflag & DF_LOWER) { Xstrcpy(buf, dirwd); Xstrtolower(buf); cp = buf; } VOID_C Xprintf("%K%c", cp, _SC_); } if (dirflag & DF_LOWER) Xstrtolower(dirp -> nam); Xprintf("%K\n", dirp -> nam); } #ifdef MINIMUMSHELL #define n_incline 1 static int NEAR _checkline(VOID_A) #else static int NEAR _checkline(n_incline) int n_incline; #endif { if (!(dirflag & DF_PAUSE)) return(0); if (dirflag & DF_CANCEL) return(-1); if ((dirline += n_incline) >= n_line - 2) { puts2("Press any key to continue . . ."); putnl(); if (inputkey() < 0) { dirflag |= DF_CANCEL; return(-1); } VOID_C Xprintf("\n(continuing %K)\n", dirwd); dirline = n_incline; } return(0); } static VOID NEAR dosdirheader(VOID_A) { if (dirtype != 'B') { if (checkline(1) < 0) return; if (dirflag & DF_SUBDIR) { putnl(); if (checkline(1) < 0) return; } else putc2(' '); VOID_C Xprintf("Directory of %K\n", dirwd); } #ifndef MINIMUMSHELL if (dirtype == 'V') { if (checkline(1) < 0) return; puts2("File Name Size Allocated "); puts2("Modified Accessed Attrib\n"); if (checkline(1) < 0) return; putnl(); if (checkline(1) < 0) return; putnl(); } #endif /* !MINIMUMSHELL */ if (dirtype != 'B') { if (checkline(1) < 0) return; putnl(); } } #ifdef MINIMUMSHELL static VOID NEAR dosdirfooter(bsizep, nf, nd, sump, fp) off_t *bsizep; int nf, nd; off_t *sump, *fp; #else static VOID NEAR dosdirfooter(bsizep, nf, nd, sump, bsump, fp, tp) off_t *bsizep; int nf, nd; off_t *sump, *bsump, *fp, *tp; #endif { if (dirtype == 'B') return; if (!nf && !nd) { if (!fp) return; if (checkline(1) < 0) return; puts2("File not found\n"); nd = -1; } else { if (fp && (dirflag & DF_SUBDIR)) { if (checkline(1) < 0) return; putnl(); if (checkline(1) < 0) return; puts2("Total files listed:\n"); } if (checkline(1) < 0) return; VOID_C Xprintf("%10d file(s)%'15qd bytes\n", nf, *sump); #ifndef MINIMUMSHELL if (dirtype == 'V') { if (checkline(1) < 0) return; VOID_C Xprintf("%10d dir(s) ", nd); putsize(bsump, bsizep); puts2(" allocated\n"); nd = -1; } #endif /* !MINIMUMSHELL */ } if (!fp) return; if (checkline(1) < 0) return; if (nd < 0) puts2(" "); else VOID_C Xprintf("%10d dir(s) ", nd); putsize(fp, bsizep); puts2(" free\n"); #ifndef MINIMUMSHELL if (tp && dirtype == 'V') { if (checkline(1) < 0) return; puts2(" "); putsize(tp, bsizep); VOID_C Xprintf(" total disk space, %3d%% in use\n", (int)(((*tp - *fp) * (off_t)100) / *tp)); } #endif /* !MINIMUMSHELL */ } #ifdef MINIMUMSHELL static int NEAR dosdir(re, bsizep, nfp, ndp, sump) reg_ex_t *re; off_t *bsizep; int *nfp, *ndp; off_t *sump; #else static int NEAR dosdir(re, bsizep, nfp, ndp, sump, bsump) reg_ex_t *re; off_t *bsizep; int *nfp, *ndp; off_t *sump, *bsump; #endif { #ifndef MINIMUMSHELL off_t bsum; #endif #ifndef NOSYMLINK char lnam[MAXPATHLEN]; int llen; #endif struct filestat_t *dirlist; DIR *dirp; struct dirent *dp; struct stat st; char *file; off_t sum; int c, n, nf, nd, len, max; if (!(dirp = Xopendir(dirwd))) return(-1); n = nf = nd = 0; #ifndef MINIMUMSHELL bsum = #endif sum = (off_t)0; len = strlen(dirwd); file = strcatdelim(dirwd); dirlist = NULL; while ((dp = Xreaddir(dirp))) { if (strcatpath(dirwd, file, dp -> d_name) < 0) continue; #ifndef NOSYMLINK if (Xlstat(dirwd, &st) < 0 || (st.st_mode & S_IFMT) != S_IFLNK) llen = -1; else llen = Xreadlink(dirwd, lnam, sizeof(lnam) - 1); #endif if (Xstat(dirwd, &st) < 0) continue; dirlist = b_realloc(dirlist, n, struct filestat_t); dirlist[n].nam = Xstrdup(dp -> d_name); #ifdef DEP_DOSLFN dirlist[n].d_alias = (dp -> d_alias[0]) ? Xstrdup(dp -> d_alias) : dirlist[n].nam; #endif #ifndef NOSYMLINK if (llen < 0) dirlist[n].lnam = NULL; else { lnam[llen] = '\0'; dirlist[n].lnam = Xstrdup(lnam); } #endif dirlist[n].mod = st.st_mode; dirlist[n].siz = st.st_size; dirlist[n].mtim = st.st_mtime; dirlist[n].atim = st.st_atime; dirlist[n].flags = 0; if (filterattr(&(dirlist[n])) < 0) dirlist[n].flags |= FS_BADATTR; else if (re && !regexp_exec(re, dirlist[n].nam, 0)) dirlist[n].flags |= FS_NOTMATCH; else if ((st.st_mode & S_IFMT) == S_IFDIR) nd++; else { nf++; if ((st.st_mode & S_IFMT) == S_IFREG) { sum += dirlist[n].siz; #ifndef MINIMUMSHELL bsum += (dirlist[n].siz + *bsizep - 1) / *bsizep; #endif } } n++; } VOID_C Xclosedir(dirp); dirwd[len] = '\0'; max = n; if (*dirsort) qsort(dirlist, max, sizeof(*dirlist), cmpdirent); *nfp += nf; *ndp += nd; *sump += sum; #ifndef MINIMUMSHELL *bsump += bsum; #endif dosdirheader(); for (n = c = 0; n < max; n++) { if (dirflag & DF_CANCEL) break; if (dirlist[n].flags & (FS_NOTMATCH | FS_BADATTR)) continue; switch (dirtype) { case 'W': if (!(c % 5) && checkline(1) < 0) break; showfnamew(&(dirlist[n])); if (c != (nf + nd - 1) && (c % 5) != 5 - 1) putc2('\t'); else putnl(); break; case 'B': if (isdotdir(dirlist[n].nam)) break; if (checkline(1) >= 0) showfnameb(&(dirlist[n])); break; #ifndef MINIMUMSHELL case 'V': if (checkline(2) >= 0) showfname(&(dirlist[n]), bsizep, 1); break; #endif default: if (checkline(1) >= 0) #ifdef MINIMUMSHELL showfname(&(dirlist[n]), bsizep); #else showfname(&(dirlist[n]), bsizep, (dirtype == '4') ? -1 : 0); #endif break; } c++; } if (dirflag & DF_SUBDIR) for (;;) { #ifdef MINIMUMSHELL dosdirfooter(bsizep, nf, nd, &sum, NULL); #else dosdirfooter(bsizep, nf, nd, &sum, &bsum, NULL, NULL); #endif file = strcatdelim(dirwd); for (n = 0; n < max; n++) { if (dirflag & DF_CANCEL) break; if (!dir_isdir(&(dirlist[n])) || isdotdir(dirlist[n].nam)) continue; Xstrcpy(file, dirlist[n].nam); #ifdef MINIMUMSHELL c = dosdir(re, bsizep, nfp, ndp, sump); #else c = dosdir(re, bsizep, nfp, ndp, sump, bsump); #endif if (c < 0) { dosperror(dirwd); break; } } break; /*NOTREACHED*/ } dirwd[len] = '\0'; for (n = 0; n < max; n++) { Xfree(dirlist[n].nam); #ifdef DEP_DOSLFN if (dirlist[n].d_alias != dirlist[n].nam) Xfree(dirlist[n].d_alias); #endif #ifndef NOSYMLINK Xfree(dirlist[n].lnam); #endif } Xfree(dirlist); return(max); } int doscomdir(argc, argv) int argc; char *CONST argv[]; { #ifndef MINIMUMSHELL off_t bsum; #endif #ifdef DEP_PSEUDOPATH int drv; #endif reg_ex_t *re; struct stat st; CONST char *cp, *dir, *file; char *tmp, wd[MAXPATHLEN], cwd[MAXPATHLEN], buf[MAXPATHLEN]; off_t sum, total, fre, bsize; int i, n, nf, nd; Xstrcpy(dirattr, DEFDIRATTR); dirsort[0] = dirtype = '\0'; dirflag = 0; evalenvopt(argv[0], "DIRCMD", getdiropt); if ((n = getdiropt(argc, argv)) < 0) return(RET_FAIL); #ifdef DEP_PSEUDOPATH drv = -1; #endif dir = buf; file = "*"; if (argc <= n) dir = curpath; else if (argc > n + 1) { doserror(argv[n + 1], ER_TOOMANYPARAM); return(RET_FAIL); } else { Xstrcpy(buf, argv[n]); #ifdef DEP_PSEUDOPATH if ((drv = preparedrv(buf, NULL, NULL)) < 0) { dosperror(buf); return(RET_FAIL); } #endif if (Xstat(buf, &st) >= 0 && (st.st_mode & S_IFMT) == S_IFDIR) /*EMPTY*/; else if ((tmp = strrdelim(buf, 1))) { i = tmp - buf; if (isrootdir(buf) || *tmp != _SC_) tmp++; *tmp = '\0'; if (argv[n][++i]) file = &(argv[n][i]); } #ifdef DEP_URLPATH else if (checkdrv(drv, NULL) == DEV_URL) VOID_C Xrealpath(buf, buf, 0); #endif else { dir = curpath; file = argv[n]; } } if (!Xgetwd(cwd)) { #ifdef DEP_PSEUDOPATH shutdrv(drv); #endif dosperror(NULL); return(RET_FAIL); } if (dir != buf) Xstrcpy(wd, cwd); else if ((cp = getrealpath(buf, wd, cwd)) == wd) /*EMPTY*/; #ifdef DOUBLESLASH else if (cp == buf && isdslash(buf)) VOID_C Xrealpath(buf, wd, RLP_READLINK); #endif else { #ifdef DEP_PSEUDOPATH shutdrv(drv); #endif dosperror(cp); return(RET_FAIL); } if (getinfofs(wd, &total, &fre, &bsize) < 0) total = fre = (off_t)-1; if (dirtype != 'B') putnl(); dirline = nf = nd = 0; #ifndef MINIMUMSHELL bsum = #endif sum = (off_t)0; dirwd = wd; re = regexp_init(file, -1); #ifdef MINIMUMSHELL n = dosdir(re, &bsize, &nf, &nd, &sum); #else n = dosdir(re, &bsize, &nf, &nd, &sum, &bsum); #endif #ifdef DEP_PSEUDOPATH shutdrv(drv); #endif regexp_free(re); if (n < 0) { dosperror(dir); return(RET_FAIL); } #ifdef MINIMUMSHELL dosdirfooter(&bsize, nf, nd, &sum, &fre); #else dosdirfooter(&bsize, nf, nd, &sum, &bsum, &fre, &total); #endif VOID_C Xfflush(Xstdout); return(RET_SUCCESS); } static int NEAR checkarg(argc, argv) int argc; char *CONST argv[]; { if (argc <= 1) { doserror(NULL, ER_REQPARAM); return(-1); } else if (argc > 2) { doserror(argv[2], ER_TOOMANYPARAM); return(-1); } return(0); } int doscommkdir(argc, argv) int argc; char *CONST argv[]; { if (checkarg(argc, argv) < 0) return(RET_FAIL); if (Xmkdir(argv[1], 0777) < 0) { dosperror(argv[1]); return(RET_FAIL); } return(RET_SUCCESS); } int doscomrmdir(argc, argv) int argc; char *CONST argv[]; { if (checkarg(argc, argv) < 0) return(RET_FAIL); if (Xrmdir(argv[1]) < 0) { dosperror(argv[1]); return(RET_FAIL); } return(RET_SUCCESS); } int doscomerase(argc, argv) int argc; char *CONST argv[]; { char *buf, **wild; int i, n, c, flag, ret; flag = 0; for (n = 1; n < argc; n++) { if (argv[n][0] != DOSCOMOPT) break; if (n > 1) { doserror(argv[n], ER_TOOMANYPARAM); return(RET_FAIL); } if ((argv[n][1] == 'P' || argv[n][1] == 'p') && !argv[n][2]) flag = 1; else { doserror(argv[n], ER_INVALIDSW); return(RET_FAIL); } } if (argc <= n) { doserror(argv[1], ER_REQPARAM); return(RET_FAIL); } else if (argc > n + 1) { doserror(argv[n + 1], ER_TOOMANYPARAM); return(RET_FAIL); } buf = strrdelim(argv[n], 1); if (buf) buf++; else buf = argv[n]; if (!flag && (!strcmp(buf, "*") || !strcmp(buf, "*.*"))) { do { puts2("All files in directory will be deleted!"); putnl(); #ifdef FD ttyiomode(1); buf = inputstr("Are you sure (Y/N)?", 0, 0, NULL, -1); stdiomode(); #else buf = gets2("Are you sure (Y/N)?"); #endif if (!buf) return(RET_SUCCESS); if (!isatty(STDIN_FILENO)) putnl(); c = *buf; Xfree(buf); } while (!Xstrchr("ynYN", c)); if (c == 'n' || c == 'N') return(RET_SUCCESS); } if (!(wild = evalwild(argv[n], 0))) { doserror(argv[n], ER_FILENOTFOUND); return(RET_FAIL); } ret = RET_SUCCESS; for (i = 0; wild[i]; i++) { if (flag) { do { VOID_C Xprintf("%K, Delete (Y/N)?", wild[i]); VOID_C Xfflush(Xstdout); if ((c = inputkey()) < 0) { freevar(wild); return(ret); } if (c <= (int)MAXUTYPE(u_char) && Xisprint(c)) putc2(c); putnl(); } while (!Xstrchr("ynYN", c)); if (c == 'n' || c == 'N') continue; } if (Xunlink(wild[i]) < 0) { dosperror(wild[i]); ret = RET_FAIL; ERRBREAK; } } freevar(wild); return(ret); } static char *NEAR convwild(dest, src, wild, swild) char *dest; CONST char *src, *wild, *swild; { int i, j, n, rest, w; for (i = j = n = 0; wild[i]; i++) { if (wild[i] == '?') { if (src[j]) dest[n++] = src[j]; } else if (wild[i] != '*') dest[n++] = wild[i]; else if (!src[j]) continue; else { for (rest = j; src[rest]; rest++) /*EMPTY*/; for (w = strlen(swild); w > 0 && rest > 0; w--, rest--) if (src[rest - 1] != swild[w - 1]) break; for (; j < rest; j++) dest[n++] = src[j]; if (wild[i + 1] != '.') break; } if (src[j]) j++; } dest[n] = '\0'; return(dest); } int doscomrename(argc, argv) int argc; char *CONST argv[]; { char *cp, **wild, new[MAXPATHLEN]; int i, j, ret; if (argc <= 2) { doserror(NULL, ER_REQPARAM); return(RET_FAIL); } #if 0 else if (argc > 3) { doserror(argv[3], ER_TOOMANYPARAM); return(RET_FAIL); } #endif if (strdelim(argv[2], 1)) { doserror(argv[2], ER_INVALIDPARAM); return(RET_FAIL); } if (!(wild = evalwild(argv[1], 0))) { doserror(argv[1], ER_FILENOTFOUND); return(RET_FAIL); } ret = RET_SUCCESS; for (i = 0; wild[i]; i++) { Xstrcpy(new, wild[i]); cp = getbasename(new); j = cp - new; convwild(cp, &(wild[i][j]), argv[2], argv[1]); if (Xaccess(new, F_OK) >= 0) { doserror(new, ER_DUPLFILENAME); ret = RET_FAIL; ERRBREAK; } if (errno != ENOENT || Xrename(wild[i], new) < 0) { dosperror(wild[i]); ret = RET_FAIL; ERRBREAK; } } freevar(wild); return(ret); } static int NEAR getcopyopt(argc, argv) int argc; char *CONST argv[]; { char *arg; int i; for (i = 1; i < argc; i++) { arg = argv[i]; if (arg[0] != DOSCOMOPT) break; Xstrtoupper(&(arg[1])); if (!arg[1] || (arg[2] && arg[3])) { doserror(arg, ER_INVALIDSW); return(-1); } if (arg[1] == '-') switch (arg[2]) { case 'Y': copyflag &= ~CF_NOCONFIRM; break; default: doserror(arg, ER_INVALIDSW); return(-1); /*NOTREACHED*/ break; } else switch (arg[1]) { case 'A': copyflag &= ~CF_BINARY; copyflag |= CF_TEXT; break; case 'B': copyflag |= CF_BINARY; copyflag &= ~CF_TEXT; break; case 'V': copyflag |= CF_VERIFY; break; case 'Y': copyflag |= CF_NOCONFIRM; break; default: break; } } return(i); } static int NEAR getbinmode(name, bin) CONST char *name; int bin; { char *cp; if (bin < 0) return(-1); if (!(cp = Xstrchr(name, DOSCOMOPT)) || !cp[1] || cp[2]) /*EMPTY*/; else if (Xtoupper(*cp) == 'B') bin = CF_BINARY; else if (Xtoupper(*cp) == 'A') bin = CF_TEXT; return(bin); } static int NEAR writeopen(file, src) CONST char *file, *src; { struct stat st; char buf[MAXPATHLEN], buf2[MAXPATHLEN]; int c, fd, key, flags; if ((copyflag & CF_NOCONFIRM) || Xstat(file, &st) < 0) c = 0; else { if (src && Xrealpath(src, buf, RLP_READLINK) && Xrealpath(file, buf2, RLP_READLINK) && !strpathcmp(buf, buf2)) return(seterrno(0)); if ((fd = Xopen(file, O_RDONLY, 0666)) < 0) return(fd); c = (isatty(fd)) ? 0 : 1; VOID_C Xclose(fd); } if (c) { VOID_C Xfprintf(Xstderr, "Overwrite %K (Yes/No/All)?", file); VOID_C Xfflush(Xstderr); key = -1; for (;;) { if ((c = inputkey()) < 0) { copyflag |= CF_CANCEL; return(0); } if (c == K_CR && key >= 0) break; if (!Xstrchr("ynaYNA", c)) continue; key = Xtoupper(c); VOID_C Xfprintf(Xstderr, "%c%s", c, c_left); VOID_C Xfflush(Xstderr); } VOID_C fputnl(Xstderr); if (key == 'N') return(0); else if (key == 'A') copyflag |= CF_NOCONFIRM; } else if (src && (copyflag & CF_VERBOSE)) Xprintf("%K\n", src); flags = (copyflag & CF_VERIFY) ? O_RDWR : O_WRONLY; flags |= (O_BINARY | O_CREAT | O_TRUNC); #ifndef NODIRLOOP if (src && issamebody(src, file)) { flags |= O_EXCL; if (Xunlink(file) < 0) return(-1); } #endif return(Xopen(file, flags, 0666)); } static int NEAR textread(fd, buf, size, bin, timeout, totalp, max) int fd; char *buf; int size, bin, timeout; off_t *totalp, max; { off_t total; u_char uc; int i, n; if (!(bin & (CF_BINARY | CF_TEXT))) bin = copyflag; if (!totalp) total = (off_t)0; else { total = *totalp; if (total == max || (max >= (off_t)0 && total > max)) return(0); } if (!(bin & CF_TEXT)) { i = checkread(fd, buf, size, timeout); if (i < 0) return(-1); total += (off_t)i; n = i; } else for (n = i = 0; n < size; n++) { i = checkread(fd, &uc, sizeof(uc), timeout); if (i < 0) return(-1); total += (off_t)i; #if MSDOS if (!i) /*EMPTY*/; #else if (!i) break; #endif else if (uc != C_EOF) { buf[n] = uc; continue; } for (;;) { i = checkread(fd, &uc, sizeof(uc), timeout); if (i < 0) return(-1); total = max; if (!i || uc == '\n') break; } break; } if (totalp) { if (i) /*EMPTY*/; else if (total < max) return(seterrno(ETIMEDOUT)); else total = max; *totalp = total; } return(n); } static VOID NEAR textclose(fd, bin) int fd, bin; { u_char uc; int duperrno; duperrno = errno; if (!(bin & (CF_BINARY | CF_TEXT))) bin = copyflag; if (bin & CF_TEXT) { uc = C_EOF; VOID_C surewrite(fd, &uc, sizeof(uc)); } safeclose(fd); errno = duperrno; } static int NEAR doscopy(src, dest, stp, sbin, dbin, dfd) CONST char *src, *dest; struct stat *stp; int sbin, dbin, dfd; { char *cp, buf[BUFSIZ], buf2[BUFSIZ]; off_t ofs, total; int n, nread, retry, size, duperrno; int fd1, fd2, tty1, tty2, timeout1, timeout2; #ifndef NOSYMLINK if ((stp -> st_mode & S_IFMT) == S_IFLNK) { if (dfd < 0) { # ifdef DEP_URLPATH fd1 = urlpath(src, NULL, NULL, NULL); fd2 = urlpath(dest, NULL, NULL, NULL); if (fd1 != fd2) /*EMPTY*/; else # endif return(cpsymlink(src, dest)); } if (Xstat(src, stp) < 0) return(-1); } #endif /* !NOSYMLINK */ if ((fd1 = Xopen(src, O_TEXT | O_RDONLY, stp -> st_mode)) < 0) return(-1); if (dfd >= 0) fd2 = dfd; else if ((fd2 = writeopen(dest, src)) <= 0) { VOID_C Xclose(fd1); return(fd2); } tty1 = isatty(fd1); tty2 = isatty(fd2); #if MSDOS && !defined (LSI_C) # ifdef DJGPP if (tty1) setmode(fd2, O_TEXT); else # endif { setmode(fd1, O_BINARY); setmode(fd2, O_BINARY); } #endif /* MSDOS && !LSI_C */ if (tty1 || tty2) sbin = CF_TEXT; timeout1 = timeout2 = 0; #ifdef DEP_URLPATH switch (chkopenfd(fd1)) { case DEV_URL: case DEV_HTTP: timeout1 = urltimeout; VOID_C urlfstat(fd1, stp); break; default: break; } switch (chkopenfd(fd2)) { case DEV_URL: case DEV_HTTP: timeout2 = urltimeout; default: break; } #endif total = (off_t)0; if (tty1) stp -> st_size = (off_t)-1; for (;;) { for (retry = n = 0; retry < COPYRETRY; retry++) { ofs = Xlseek(fd1, (off_t)0, L_INCR); n = textread(fd1, buf, sizeof(buf), sbin, timeout1, &total, stp -> st_size); if (n >= 0) break; duperrno = errno; if (Xlseek(fd1, ofs, L_SET) < (off_t)0) { errno = duperrno; break; } } if (n <= 0) break; nread = n; for (retry = n = 0; retry < COPYRETRY; retry++) { ofs = Xlseek(fd2, (off_t)0, L_INCR); n = surewrite(fd2, buf, nread); if (n < 0) /*EMPTY*/; else if (tty2 || !(copyflag & CF_VERIFY)) break; else if (Xlseek(fd2, ofs, L_SET) < (off_t)0) break; else { cp = buf2; size = nread; while (size > 0) { n = checkread(fd2, cp, size, timeout2); if (n <= 0) break; cp += n; size -= n; } if (size || memcmp(buf, buf2, nread)) n = seterrno(EINVAL); else { n = 0; break; } } duperrno = errno; if (Xlseek(fd2, ofs, L_SET) < (off_t)0) { errno = duperrno; break; } } if (n < 0) break; } if (dfd < 0) textclose(fd2, dbin); safeclose(fd1); if (n < 0) { duperrno = errno; VOID_C Xunlink(dest); errno = duperrno; return(dfd < 0 ? -1 : -2); } #ifdef FD stp -> st_nlink = (TCH_ATIME | TCH_MTIME | TCH_IGNOREERR); if (!tty2 && touchfile(dest, stp) < 0) return(-1); #else if (!tty2) VOID_C touchfile(dest, stp); #endif return(1); } int doscomcopy(argc, argv) int argc; char *CONST argv[]; { struct stat sst, dst; char *cp, *file, *form, **arg, *src, **wild; char dest[MAXPATHLEN]; int i, j, n, nf, nc, *sbin, dbin, size, fd, ret; copyflag = 0; evalenvopt(argv[0], "COPYCMD", getcopyopt); if ((n = getcopyopt(argc, argv)) < 0) return(RET_FAIL); if (argc <= n) { doserror(NULL, ER_REQPARAM); return(RET_FAIL); } size = strlen(argv[n]) + 1; src = Xmalloc(size); Xstrcpy(src, argv[n]); for (n++; n < argc; n++) { if ((cp = Xstrchr(&(argv[n - 1][1]), '+')) && !*(++cp)) /*EMPTY*/; else if (argv[n][0] != '+' && argv[n][0] != DOSCOMOPT) break; j = strlen(argv[n]); src = Xrealloc(src, size + j); Xstrcpy(&(src[size - 1]), argv[n]); size += j; } for (cp = src, nf = 0; cp; nf++) { if ((cp = Xstrchr(cp, '+'))) { *(cp++) = '\0'; if (!*cp) { if (nf++) break; doserror(src, ER_COPIEDITSELF); Xfree(src); return(RET_FAIL); } } } arg = (char **)Xmalloc(nf * sizeof(char *)); sbin = (int *)Xmalloc(nf * sizeof(int)); arg[0] = src; sbin[0] = copyflag; for (i = 1; i < nf; i++) { arg[i] = arg[i - 1] + strlen(arg[i - 1]) + 1; sbin[i - 1] = getbinmode(arg[i - 1], sbin[i - 1]); sbin[i] = sbin[i - 1]; } sbin[i - 1] = getbinmode(arg[i - 1], sbin[i - 1]); if (n >= argc) { dest[0] = '\0'; dbin = sbin[i - 1]; } #if 0 else if (n + 1 < argc) { doserror(argv[n + 1], ER_TOOMANYPARAM); Xfree(arg[0]); Xfree(arg); Xfree(sbin); return(RET_FAIL); } #endif else { Xstrcpy(dest, argv[n]); dbin = getbinmode(dest, sbin[i - 1]); } if (dbin < 0) { Xfree(arg[0]); Xfree(arg); Xfree(sbin); return(RET_FAIL); } file = form = NULL; if (!*dest) file = dest; else if (Xstat(dest, &dst) >= 0) { if ((dst.st_mode & S_IFMT) == S_IFDIR) file = strcatdelim(dest); } else { file = getbasename(dest); if (strpbrk(file, "*?")) form = &(argv[n][file - dest]); else if (*file) file = NULL; } if (nf <= 1) { if (Xlstat(arg[0], &sst) < 0) /*EMPTY*/; else if ((sst.st_mode & S_IFMT) == S_IFDIR) { arg[0] = Xrealloc(arg[0], size + 2); Xstrcpy(strcatdelim(arg[0]), "*"); } else if (!*dest) { doserror(arg[0], ER_COPIEDITSELF); Xfree(arg[0]); Xfree(arg); Xfree(sbin); return(RET_FAIL); } } ret = RET_SUCCESS; nc = 0; fd = -1; if (nf > 1 || strpbrk(arg[0], "*?")) { if (nf > 1 || !file) { if (!(copyflag & (CF_BINARY | CF_TEXT))) copyflag |= CF_TEXT; if ((fd = writeopen(dest, NULL)) <= 0) { if (fd < 0) ret = RET_FAIL; nf = 0; } } copyflag |= CF_VERBOSE; } for (n = 0; n < nf; n++) { if (!(wild = evalwild(arg[n], 0))) { if (nf > 1) continue; doserror(arg[n], ER_FILENOTFOUND); ret = RET_FAIL; ERRBREAK; } for (i = 0; wild[i]; i++) { if (Xlstat(wild[i], &sst) < 0) { dosperror(wild[i]); ret = RET_FAIL; ERRBREAK; } if ((sst.st_mode & S_IFMT) == S_IFDIR) continue; src = getbasename(wild[i]); if (form) convwild(file, src, form, arg[n]); else if (!n && file) Xstrcpy(file, src); j = doscopy(wild[i], dest, &sst, sbin[n], dbin, fd); if (j < 0) { if (errno) dosperror(wild[i]); else doserror(wild[i], ER_COPIEDITSELF); ret = RET_FAIL; ERRBREAK; } if (j > 0) nc++; if (copyflag & CF_CANCEL) break; } freevar(wild); if (ret == RET_FAIL) ERRBREAK; } Xfree(arg[0]); Xfree(arg); Xfree(sbin); if (fd >= 0) { if (fd > 0) textclose(fd, dbin); if (nc > 0) nc = 1; } if (!(copyflag & CF_CANCEL)) VOID_C Xprintf("%9d file(s) copied\n", nc); return(ret); } /*ARGSUSED*/ int doscomcls(argc, argv) int argc; char *CONST argv[]; { #ifdef FD putterms(T_CLEAR); tflush(); #else puts2(t_clear); VOID_C Xfflush(Xstdout); #endif VOID_C fputnl(Xstderr); return(RET_SUCCESS); } int doscomtype(argc, argv) int argc; char *CONST argv[]; { #if MSDOS && !defined (LSI_C) int omode; #endif struct stat st; char *cp; u_char uc; off_t total; ALLOC_T size; int i, n, fd, tty, timeout; if (checkarg(argc, argv) < 0) return(RET_FAIL); if (Xlstat(argv[1], &st) < 0 || (fd = Xopen(argv[1], O_TEXT | O_RDONLY, 0666)) < 0) { dosperror(argv[1]); return(RET_FAIL); } tty = isatty(fd); #if MSDOS && !defined (LSI_C) # ifdef DJGPP if (tty) omode = setmode(STDOUT_FILENO, O_TEXT); else # endif { setmode(fd, O_BINARY); omode = setmode(STDOUT_FILENO, O_BINARY); } #endif /* MSDOS && !LSI_C */ timeout = 0; #ifdef DEP_URLPATH if (chkopenfd(fd) == DEV_URL) { timeout = urltimeout; VOID_C urlfstat(fd, &st); } #endif cp = c_realloc(NULL, 0, &size); i = 0; total = (off_t)0; if (tty) st.st_size = (off_t)-1; for (;;) { n = textread(fd, (char *)&uc, sizeof(uc), CF_TEXT, timeout, &total, st.st_size); if (n < 0) break; if (!n) { n = surewrite(STDOUT_FILENO, cp, i); break; } else if (uc == '\n') { cp[i++] = '\n'; n = surewrite(STDOUT_FILENO, cp, i); if (n < 0) break; i = 0; } else { cp = c_realloc(cp, i, &size); cp[i++] = uc; } } Xfree(cp); safeclose(fd); #if MSDOS && !defined (LSI_C) if (omode >= 0) setmode(STDOUT_FILENO, omode); #endif if (n < 0) { dosperror(argv[1]); return(RET_FAIL); } return(RET_SUCCESS); } #endif /* DOSCOMMAND && DEP_ORIGSHELL */ FD-3.01j/log.c100644 2105 1751 10237 13516612560 11631 0ustar shiraiuser/* * log.c * * system logging */ #include "fd.h" #include "func.h" #if MSDOS #include #endif #ifndef NOSYSLOG #include #endif #ifndef LOG_PID #define LOG_PID 0 #endif #ifndef LOG_ERR #define LOG_ERR 3 #endif #ifndef LOG_INFO #define LOG_INFO 6 #endif #ifdef DEP_LOGGING extern char *progname; static lockbuf_t *NEAR openlogfile __P_((VOID_A)); static VOID NEAR writelog __P_((int, int, CONST char *)); char *logfile = NULL; int logsize = 0; #ifndef NOSYSLOG int usesyslog = 0; #endif int loglevel = 0; #ifndef NOUID int rootloglevel = 0; #endif static char *logfname = NULL; #ifndef NOSYSLOG static int syslogged = 0; #endif static lockbuf_t *NEAR openlogfile(VOID_A) { lockbuf_t *lck; struct stat st; CONST char *home; char *cp, *top, path[MAXPATHLEN]; ALLOC_T size; cp = logfname; if (logfname) { if (!*logfname) return(NULL); } else { if (!logfile || !*logfile) return(NULL); logfname = vnullstr; top = logfile; #ifdef DEP_DOSPATH if (_dospath(top)) top += 2; #endif if (*top == _SC_) cp = Xstrdup(logfile); else { if (!(home = gethomedir())) return(NULL); strcatdelim2(path, home, top); if (!*path) return(NULL); cp = Xstrdup(path); } } size = (ALLOC_T)logsize * (ALLOC_T)1024; if (size > 0 && Xstat(cp, &st) >= 0 && st.st_size > size) { VOID_C Xsnprintf(path, sizeof(path), "%s.old", cp); if (Xrename(cp, path) < 0) VOID_C Xunlink(cp); } lck = lockopen(cp, O_TEXT | O_WRONLY | O_CREAT | O_APPEND, 0666); if (!lck) { Xfree(cp); return(NULL); } logfname = cp; return(lck); } VOID logclose(VOID_A) { if (logfname != vnullstr) Xfree(logfname); logfname = vnullstr; #ifndef NOSYSLOG if (syslogged > 0) closelog(); syslogged = -1; #endif } /*ARGSUSED*/ static VOID NEAR writelog(lvl, p, buf) int lvl, p; CONST char *buf; { static int doing = 0; lockbuf_t *lck; struct tm *tm; char hbuf[MAXLOGLEN + 1]; time_t t; u_char uc; int n; if (doing) return; #ifndef NOUID if (!getuid()) { n = rootloglevel; lvl--; } else #endif n = loglevel; if (!n || n < lvl) return; doing++; if ((lck = openlogfile())) { t = time(NULL); tm = localtime(&t); #ifdef NOUID VOID_C Xsnprintf(hbuf, sizeof(hbuf), "%04u/%02u/%02u %02u:%02u:%02u %s[%d]:\n ", tm -> tm_year + 1900, tm -> tm_mon + 1, tm -> tm_mday, tm -> tm_hour, tm -> tm_min, tm -> tm_sec, progname, getpid()); #else VOID_C Xsnprintf(hbuf, sizeof(hbuf), "%04u/%02u/%02u %02u:%02u:%02u uid=%d %s[%d]:\n ", tm -> tm_year + 1900, tm -> tm_mon + 1, tm -> tm_mday, tm -> tm_hour, tm -> tm_min, tm -> tm_sec, getuid(), progname, getpid()); #endif VOID_C Xwrite(lck -> fd, hbuf, strlen(hbuf)); VOID_C Xwrite(lck -> fd, buf, strlen(buf)); uc = '\n'; VOID_C Xwrite(lck -> fd, (char *)&uc, sizeof(uc)); lockclose(lck); } doing--; #ifndef NOSYSLOG if (usesyslog && syslogged >= 0) { if (!syslogged) { syslogged++; # ifdef LOG_USER openlog(progname, LOG_PID, LOG_USER); # else openlog(progname, LOG_PID); # endif } syslog(p, "%s", buf); } #endif /* !NOSYSLOG */ } #ifdef USESTDARGH /*VARARGS3*/ VOID logsyscall(int lvl, int val, CONST char *fmt, ...) #else /*VARARGS3*/ VOID logsyscall(lvl, val, fmt, va_alist) int lvl, val; CONST char *fmt; va_dcl #endif { va_list args; char buf[MAXLOGLEN + 1]; int n, len, duperrno; duperrno = errno; if (val >= 0) lvl++; VA_START(args, fmt); len = Xvsnprintf(buf, sizeof(buf), fmt, args); va_end(args); if (len >= 0) { #ifdef CODEEUC len = strlen(buf); #endif if (val >= 0) n = Xsnprintf(&(buf[len]), (int)sizeof(buf) - len, " succeeded"); else n = Xsnprintf(&(buf[len]), (int)sizeof(buf) - len, " -- FAILED -- (%k)", Xstrerror(duperrno)); if (n < 0) buf[len] = '\0'; writelog(lvl, (val < 0) ? LOG_ERR : LOG_INFO, buf); } errno = duperrno; } #ifdef USESTDARGH /*VARARGS2*/ VOID logmessage(int lvl, CONST char *fmt, ...) #else /*VARARGS2*/ VOID logmessage(lvl, fmt, va_alist) int lvl; CONST char *fmt; va_dcl #endif { va_list args; char buf[MAXLOGLEN + 1]; int len, duperrno; duperrno = errno; VA_START(args, fmt); len = Xvsnprintf(buf, sizeof(buf), fmt, args); va_end(args); if (len >= 0) writelog(lvl, LOG_INFO, buf); errno = duperrno; } #endif /* DEP_LOGGING */ FD-3.01j/sysemu.c100644 2105 1751 125662 13516612560 12426 0ustar shiraiuser/* * sysemu.c * * system call emulations */ #ifdef FD #include "fd.h" #include "kconv.h" #else #include "headers.h" #include "depend.h" #include "printf.h" #include "kctype.h" #include "string.h" #include "malloc.h" #endif #include "sysemu.h" #include "log.h" #include "pathname.h" #include "unixemu.h" #include "termio.h" #include "realpath.h" #if MSDOS #include #endif #ifdef DEP_DOSDRIVE #include "dosdisk.h" #endif #if MSDOS && defined (FD) #include "unixdisk.h" #endif #ifdef DEP_SOCKET #include "socket.h" #endif #ifdef DEP_URLPATH #include "urldisk.h" #endif #ifdef CYGWIN #include #endif #if MSDOS && !defined (FD) #define DS_IRDONLY 001 #define DS_IHIDDEN 002 #define DS_IFSYSTEM 004 #define DS_IFLABEL 010 #define DS_IFDIR 020 #define DS_IARCHIVE 040 #define SEARCHATTRS (DS_IRDONLY | DS_IHIDDEN | DS_IFSYSTEM \ | DS_IFDIR | DS_IARCHIVE) # if defined (DJGPP) && DJGPP < 2 # define find_t ffblk # define _dos_findfirst(p, a, f) \ findfirst(p, f, a) # define _dos_findnext findnext # define _ENOENT_ ENMFILE # else /* !DJGPP || DJGPP >= 2 */ # define ff_attrib attrib # define ff_ftime wr_time # define ff_fdate wr_date # define ff_fsize size # define ff_name name # define _ENOENT_ ENOENT # endif /* !DJGPP || DJGPP >= 2 */ #endif /* MSDOS && !FD */ #if !MSDOS #define unixopendir opendir #define unixclosedir(d) (closedir(d), 0) #define unixreaddir readdir #define unixrewinddir rewinddir # ifdef USEGETWD # define unixgetcwd(p, s) \ (char *)getwd(p) # else # define unixgetcwd (char *)getcwd # endif #define unixstat2(p, s) ((stat(p, s)) ? -1 : 0) #define unixlstat2(p, s) ((lstat(p, s)) ? -1 : 0) #define unixchmod(p, m) ((chmod(p, m)) ? -1 : 0) #define unixutimes rawutimes #define unixunlink(p) ((unlink(p)) ? -1 : 0) #define unixrename(f, t) ((rename(f, t)) ? -1 : 0) #define unixrmdir(p) ((rmdir(p)) ? -1 : 0) #endif /* !MSDOS */ #if MSDOS && !defined (DJGPP) && !defined (FD) #define unixmkdir(p, m) ((mkdir(p)) ? -1 : 0) #endif #if !MSDOS || (defined (DJGPP) && !defined (FD)) #define unixmkdir(p, m) ((mkdir(p, m)) ? -1 : 0) #endif #ifndef FD #define convput(b, p, rp, f) (p) #define convget(b, p, d) (p) #endif #ifdef CYGWIN #define opendir_saw_u_cygdrive (1 << (8 * sizeof(dirp -> __flags) - 2)) #define opendir_saw_s_cygdrive (1 << (8 * sizeof(dirp -> __flags) - 3)) #endif typedef struct _openstat_t { u_char type; u_char dev; #ifdef FORCEDSTDC union { DIR *dirp; int fd; } body; #else DIR *dirp; int fd; #endif #if defined (DEP_KANJIPATH) || defined (DEP_ROCKRIDGE) char *path; #endif } openstat_t; #define OP_DIRP 1 #define OP_FD 2 #ifdef FORCEDSTDC #define body_dirp(n) (openlist[n].body.dirp) #define body_fd(n) (openlist[n].body.fd) #else #define body_dirp(n) (openlist[n].dirp) #define body_fd(n) (openlist[n].fd) #endif #ifdef DEP_DOSDRIVE #define DEVMAX_DOS DOSNOFILE #else #define DEVMAX_DOS 0 #endif #ifdef DEP_URLPATH #define DEVMAX_URL URLNOFILE #else #define DEVMAX_URL 0 #endif #define DEVOFS_NORMAL 0 #define DEVOFS_DOS (DEVOFS_NORMAL + 1) #define DEVOFS_URL (DEVOFS_DOS + DEVMAX_DOS) #ifdef DEP_ROCKRIDGE extern int rrlstat __P_((CONST char *, struct stat *)); extern int rrreadlink __P_((CONST char *, char *, int)); #endif #if defined (FD) && defined (DEP_URLPATH) extern char fullpath[]; #endif #if MSDOS && defined (DEP_DOSDRIVE) static int NEAR checkpath __P_((CONST char *, char *)); #endif #ifdef CYGWIN static VOID NEAR getcygdrive __P_((VOID_A)); #endif #if defined (DEP_KANJIPATH) || defined (DEP_ROCKRIDGE) \ || defined (DEP_PSEUDOPATH) static int NEAR getopenlist __P_((int, VOID_P)); static VOID NEAR putopenlist __P_((int, int, VOID_P, CONST char *)); static int NEAR chkopenlist __P_((int, VOID_P)); static int NEAR delopenlist __P_((int, VOID_P)); #endif #if MSDOS && !defined (FD) static DIR *NEAR unixopendir __P_((CONST char *)); static int NEAR unixclosedir __P_((DIR *)); static struct dirent *NEAR unixreaddir __P_((DIR *)); static int NEAR unixrewinddir __P_((DIR *)); static int NEAR unixchdir __P_((CONST char *)); static char *NEAR unixgetcwd __P_((char *, ALLOC_T)); static int NEAR unixstat __P_((CONST char *, struct stat *)); #define unixutimes rawutimes #endif /* MSDOS && !FD */ #ifdef DEP_DIRENT # ifdef CYGWIN static struct dirent *NEAR pseudoreaddir __P_((DIR *)); # else #define pseudoreaddir unixreaddir # endif #endif /* DEP_DIRENT */ #ifdef DEP_DOSDRIVE static int NEAR checkchdir __P_((int, CONST char *)); #endif #if MSDOS static int NEAR unixstat2 __P_((CONST char *, struct stat *)); #define unixlstat2 unixstat2 #endif #ifdef DEP_PSEUDOPATH int lastdrv = -1; #endif #ifdef DEP_DOSDRIVE int dosdrive = 0; #endif #ifdef DEP_URLPATH int urldrive = 0; int urlkcode = NOCNV; #endif #ifndef NOSELECT int (*readintrfunc)__P_((VOID_A)) = NULL; #endif #if defined (DEP_DOSEMU) || defined (DEP_URLPATH) static char cachecwd[MAXPATHLEN] = ""; #endif #if defined (DEP_KANJIPATH) || defined (DEP_ROCKRIDGE) \ || defined (DEP_PSEUDOPATH) static openstat_t *openlist = NULL; static int maxopenlist = 0; #endif #ifdef CYGWIN static char *cygdrive_user = NULL; static char *cygdrive_system = NULL; #endif int seterrno(n) int n; { errno = n; return(-1); } #if MSDOS && defined (DJGPP) int dos_putpath(path, offset) CONST char *path; int offset; { int i; i = strlen(path) + 1; dosmemput(path, i, __tb + offset); return(i); } #endif /* MSDOS && DJGPP */ #if MSDOS && !defined (FD) int getcurdrv(VOID) { return((bdos(0x19, 0, 0) & 0xff) + 'a'); } /*ARGSUSED*/ int setcurdrv(drive, nodir) int drive, nodir; { int drv, olddrv; drv = Xtoupper(drive) - 'A'; olddrv = (bdos(0x19, 0, 0) & 0xff); if ((bdos(0x0e, drv, 0) & 0xff) < drv && (bdos(0x19, 0, 0) & 0xff) != drv) { bdos(0x0e, olddrv, 0); return(seterrno(EINVAL)); } return(0); } char *unixrealpath(path, resolved) CONST char *path; char *resolved; { struct SREGS sreg; __dpmi_regs reg; # ifdef DJGPP int i; # endif reg.x.ax = 0x6000; reg.x.cx = 0; # ifdef DJGPP i = dos_putpath(path, 0); # endif sreg.ds = PTR_SEG(path); reg.x.si = PTR_OFF(path, 0); sreg.es = PTR_SEG(resolved); reg.x.di = PTR_OFF(resolved, i); if (intcall(0x21, ®, &sreg) < 0) return(NULL); # ifdef DJGPP dosmemget(__tb + i, MAXPATHLEN, resolved); # endif return(resolved); } #endif /* !MSDOS && !FD */ #ifdef DEP_DOSPATH int _dospath(path) CONST char *path; { # if !MSDOS if (!dosdrive) return(0); # endif return((Xisalpha(*path) && path[1] == ':') ? *path : 0); } int dospath(path, buf) CONST char *path; char *buf; { # if !MSDOS char *s; # ifdef CODEEUC int len; # endif # endif /* !MSDOS */ CONST char *cp; char tmp[MAXPATHLEN]; int drive; cp = path; if ((drive = _dospath(path))) /*EMPTY*/; # if MSDOS # ifdef DOUBLESLASH else if (isdslash(path)) drive = '_'; # endif else drive = getcurdrv(); # else else if (*path != _SC_ && (drive = _dospath(cachecwd))) cp = cachecwd; else return(0); # endif if (!buf) return(drive); if (cp == buf) { VOID_C Xsnprintf(tmp, sizeof(tmp), cp); cp = tmp; } # if MSDOS # ifdef DEP_DOSLFN if (shortname(path, buf) == buf) /*EMPTY*/; else # endif unixrealpath(path, buf); # else /* !MSDOS */ # ifdef CODEEUC if (!noconv || cp != path) buf[ujis2sjis(buf, (u_char *)cp, sizeof(tmp) - 1)] = '\0'; else # endif VOID_C Xsnprintf(buf, MAXPATHLEN, cp); if (cp == cachecwd && *path) { s = strcatdelim(buf); # ifdef CODEEUC len = MAXPATHLEN - (s - buf); if (!noconv) s[ujis2sjis(s, (u_char *)path, len - 1)] = '\0'; else # endif VOID_C Xsnprintf(s, MAXPATHLEN - (s - buf), path); } # endif /* !MSDOS */ return(drive); } #endif /* DEP_DOSPATH */ #if MSDOS && defined (DEP_DOSDRIVE) int dospath2(path) CONST char *path; { int drv, drive; if (!(drive = _dospath(path))) drive = getcurdrv(); drv = Xtoupper(drive) - 'A'; if (drv < 0 || drv > 'Z' - 'A' || checkdrive(drv) <= 0) return(0); return(drive); } int dospath3(path) CONST char *path; { int i, drive; if ((i = supportLFN(path)) >= 0 || i <= -3) return(0); return((drive = _dospath(path)) ? drive : getcurdrv()); } static int NEAR checkpath(path, buf) CONST char *path; char *buf; { CONST char *cp; char tmp[MAXPATHLEN]; int i, drive; # ifdef DOUBLESLASH if (isdslash(path)) return(0); # endif if ((drive = _dospath(path))) cp = path + 2; else { cp = path; drive = getcurdrv(); } i = Xtoupper(drive) - 'A'; if (i < 0 || i > 'Z' - 'A' || checkdrive(i) <= 0) return(0); if (!buf) return(drive); if (path == buf) { Xstrcpy(tmp, cp); cp = tmp; } if (*cp == _SC_) buf = gendospath(buf, drive, '\0'); else { if (!dosgetcwd(buf, MAXPATHLEN)) return(0); buf = strcatdelim(buf); } Xstrcpy(buf, cp); return(drive); } #endif /* MSDOS && DEP_DOSDRIVE */ #ifdef DEP_URLPATH int _urlpath(path, hostp, typep) CONST char *path; char **hostp; int *typep; { int n; if (!urldrive) return(0); n = urlparse(path, NULL, hostp, typep, 0); return((n > 0) ? n : 0); } int urlpath(path, hostp, buf, typep) CONST char *path; char **hostp, *buf; int *typep; { CONST char *cp; char *s, tmp[MAXPATHLEN]; int n; if ((n = _urlpath(path, hostp, typep))) cp = path; else if (*path != _SC_ && (n = _urlpath(cachecwd, hostp, typep))) cp = cachecwd; else return(0); if (!buf) return(n); if (cp == buf) { VOID_C Xsnprintf(tmp, sizeof(tmp), cp); cp = tmp; } if (cp[n]) VOID_C Xsnprintf(buf, MAXPATHLEN, &(cp[n])); else copyrootpath(buf); if (cp == cachecwd && *path) { s = strcatdelim(buf); VOID_C Xsnprintf(s, MAXPATHLEN - (s - buf), path); } VOID_C Xrealpath(buf, tmp, RLP_PSEUDOPATH); VOID_C Xsnprintf(buf, MAXPATHLEN, "%.*s%s", n, cp, tmp); return(n); } #endif /* DEP_URLPATH */ #ifdef CYGWIN static VOID NEAR getcygdrive(VOID_A) { char upath[MAXPATHLEN], spath[MAXPATHLEN]; cygwin_internal(CW_GET_CYGDRIVE_PREFIXES, upath, spath); if (*upath && !strpathcmp(spath, upath)) *spath = '\0'; cygdrive_user = Xstrdup(upath); cygdrive_system = Xstrdup(spath); } char *getcygdrive_user(VOID_A) { if (!cygdrive_user) getcygdrive(); return(cygdrive_user); } char *getcygdrive_system(VOID_A) { if (!cygdrive_system) getcygdrive(); return(cygdrive_system); } # ifdef DEBUG VOID freecygdrive(VOID_A) { Xfree(cygdrive_user); cygdrive_system = NULL; Xfree(cygdrive_system); cygdrive_user = NULL; } # endif /* DEBUG */ #endif /* CYGWIN */ #if defined (DEP_KANJIPATH) || defined (DEP_ROCKRIDGE) \ || defined (DEP_PSEUDOPATH) static int NEAR getopenlist(type, bodyp) int type; VOID_P bodyp; { int n; for (n = maxopenlist - 1; n >= 0; n--) { if (type != openlist[n].type) continue; switch (type) { case OP_DIRP: if (body_dirp(n) == (DIR *)bodyp) return(n); break; case OP_FD: if (body_fd(n) == *((int *)bodyp)) return(n); break; default: break; } } return(-1); } /*ARGSUSED*/ static VOID NEAR putopenlist(type, dev, bodyp, path) int type, dev; VOID_P bodyp; CONST char *path; { int n; if (!bodyp) return; if (type == OP_FD && *((int *)bodyp) < 0) return; if ((n = getopenlist(type, bodyp)) < 0) { n = maxopenlist++; openlist = (openstat_t *)Xrealloc(openlist, maxopenlist * sizeof(openstat_t)); } # if defined (DEP_KANJIPATH) || defined (DEP_ROCKRIDGE) else Xfree(openlist[n].path); # endif openlist[n].type = type; openlist[n].dev = dev; # if defined (DEP_KANJIPATH) || defined (DEP_ROCKRIDGE) openlist[n].path = Xstrdup(path); # endif switch (type) { case OP_DIRP: body_dirp(n) = (DIR *)bodyp; break; case OP_FD: body_fd(n) = *((int *)bodyp); break; default: break; } } static int NEAR chkopenlist(type, bodyp) int type; VOID_P bodyp; { int n; if ((n = getopenlist(type, bodyp)) < 0) return(DEV_NORMAL); return(openlist[n].dev); } static int NEAR delopenlist(type, bodyp) int type; VOID_P bodyp; { int n, dev; if ((n = getopenlist(type, bodyp)) < 0) return(-1); dev = openlist[n].dev; # if defined (DEP_KANJIPATH) || defined (DEP_ROCKRIDGE) Xfree(openlist[n].path); # endif memmove((char *)(&(openlist[n])), (char *)(&(openlist[n + 1])), (--maxopenlist - n) * sizeof(openstat_t)); if (maxopenlist <= 0) { maxopenlist = 0; Xfree(openlist); openlist = NULL; } return(dev); } # ifdef DEBUG VOID freeopenlist(VOID_A) { # if defined (DEP_KANJIPATH) || defined (DEP_ROCKRIDGE) while (maxopenlist > 0) Xfree(openlist[--maxopenlist].path); # endif maxopenlist = 0; Xfree(openlist); openlist = NULL; } # endif /* DEBUG */ #endif /* DEP_KANJIPATH || DEP_ROCKRIDGE || DEP_PSEUDOPATH */ #ifdef DEP_PSEUDOPATH int checkdrv(drv, drvp) int drv, *drvp; { int dev; if (drv < 0) dev = -1; else if (drv < DEVOFS_NORMAL + 1) { dev = DEV_NORMAL; drv -= DEVOFS_NORMAL; } # ifdef DEP_DOSDRIVE else if (drv >= DEVOFS_DOS && drv < DEVOFS_DOS + DEVMAX_DOS) { dev = DEV_DOS; drv -= DEVOFS_DOS; } # endif # ifdef DEP_URLPATH else if (drv >= DEVOFS_URL && drv < DEVOFS_URL + DEVMAX_URL) { dev = DEV_URL; drv -= DEVOFS_URL; } # endif else dev = drv = -1; if (drvp) *drvp = drv; return(dev); } /*ARGSUSED*/ int preparedrv(path, drivep, buf) CONST char *path; int *drivep; char *buf; { # ifdef DEP_URLPATH char *host; int type; # endif int n, drv; # ifdef DEP_DOSDRIVE if ((n = dospath3(path))) { drv = dosopendev(n); if (drv < 0) return(-1); if (drivep) *drivep = n; drv += DEVOFS_DOS; } else # endif # ifdef DEP_URLPATH if ((n = urlpath(path, &host, buf, &type))) { drv = urlopendev(host, type); Xfree(host); if (drv < 0) return(-1); if (drivep) *drivep = n; drv += DEVOFS_URL; } else # endif drv = DEVOFS_NORMAL; return(drv); } VOID shutdrv(drv) int drv; { int duperrno; duperrno = errno; switch (checkdrv(drv, &drv)) { # ifdef DEP_DOSDRIVE case DEV_DOS: dosclosedev(drv); break; # endif # ifdef DEP_URLPATH case DEV_URL: urlclosedev(drv); break; # endif default: break; } errno = duperrno; } #endif /* DEP_PSEUDOPATH */ #ifdef DEP_DOSPATH u_int getunixmode(attr) u_int attr; { u_int mode; mode = 0; if (!(attr & DS_IHIDDEN)) mode |= S_IRUSR; if (!(attr & DS_IRDONLY)) mode |= S_IWUSR; mode |= (mode >> 3) | (mode >> 6); # if MSDOS if (attr & DS_IARCHIVE) mode |= S_ISVTX; # endif if (attr & DS_IFDIR) mode |= (S_IFDIR | S_IEXEC_ALL); else if (attr & DS_IFLABEL) mode |= S_IFIFO; else if (attr & DS_IFSYSTEM) mode |= S_IFSOCK; else mode |= S_IFREG; return(mode); } time_t getunixtime(d, t) u_int d, t; { struct tm tm; tm.tm_year = 1980 + ((d >> 9) & 0x7f); tm.tm_year -= 1900; tm.tm_mon = ((d >> 5) & 0x0f) - 1; tm.tm_mday = (d & 0x1f); tm.tm_hour = ((t >> 11) & 0x1f); tm.tm_min = ((t >> 5) & 0x3f); tm.tm_sec = ((t << 1) & 0x3e); tm.tm_isdst = -1; return(mktime(&tm)); } u_short getdosmode(mode) u_int mode; { u_short attr; attr = (u_short)0; # if MSDOS if (mode & S_ISVTX) attr |= DS_IARCHIVE; # endif if (!(mode & S_IRUSR)) attr |= DS_IHIDDEN; if (!(mode & S_IWUSR)) attr |= DS_IRDONLY; if ((mode & S_IFMT) == S_IFDIR) attr |= DS_IFDIR; else { attr |= DS_IARCHIVE; if ((mode & S_IFMT) == S_IFIFO) attr |= DS_IFLABEL; else if ((mode & S_IFMT) == S_IFSOCK) attr |= DS_IFSYSTEM; } return(attr); } int getdostime(dp, tp, t) u_short *dp, *tp; time_t t; { struct tm *tm; tm = localtime(&t); *dp = (((tm -> tm_year - 80) & 0x7f) << 9) + (((tm -> tm_mon + 1) & 0x0f) << 5) + (tm -> tm_mday & 0x1f); *tp = ((tm -> tm_hour & 0x1f) << 11) + ((tm -> tm_min & 0x3f) << 5) + ((tm -> tm_sec & 0x3e) >> 1); return(tm -> tm_sec); } #endif /* DEP_DOSPATH */ #if MSDOS && !defined (FD) static DIR *NEAR unixopendir(path) CONST char *path; { DIR *dirp; char *cp; int n; dirp = (DIR *)Xmalloc(sizeof(DIR)); dirp -> dd_off = 0; dirp -> dd_buf = Xmalloc(sizeof(struct find_t)); dirp -> dd_path = Xmalloc(strlen(path) + 1 + 3 + 1); cp = strcatdelim2(dirp -> dd_path, path, NULL); dirp -> dd_id = DID_IFNORMAL; Xstrcpy(cp, "*.*"); if (&(cp[-1]) > &(path[3])) n = -1; else n = _dos_findfirst(dirp -> dd_path, DS_IFLABEL, (struct find_t *)(dirp -> dd_buf)); if (n == 0) dirp -> dd_id = DID_IFLABEL; else n = _dos_findfirst(dirp -> dd_path, (SEARCHATTRS | DS_IFLABEL), (struct find_t *)(dirp -> dd_buf)); if (n < 0) { if (!errno || errno == _ENOENT_) dirp -> dd_off = -1; else { VOID_C unixclosedir(dirp); return(NULL); } } return(dirp); } static int NEAR unixclosedir(dirp) DIR *dirp; { Xfree(dirp -> dd_buf); Xfree(dirp -> dd_path); Xfree(dirp); return(0); } static struct dirent *NEAR unixreaddir(dirp) DIR *dirp; { static struct dirent d; struct find_t *findp; int n; if (dirp -> dd_off < 0) return(NULL); d.d_off = dirp -> dd_off; findp = (struct find_t *)(dirp -> dd_buf); Xstrcpy(d.d_name, findp -> ff_name); if (!(dirp -> dd_id & DID_IFLABEL)) n = _dos_findnext(findp); else n = _dos_findfirst(dirp -> dd_path, SEARCHATTRS, findp); if (n == 0) dirp -> dd_off++; else dirp -> dd_off = -1; dirp -> dd_id &= ~DID_IFLABEL; return(&d); } static int NEAR unixrewinddir(dirp) DIR *dirp; { return(0); } static int NEAR unixchdir(path) CONST char *path; { struct SREGS sreg; __dpmi_regs reg; reg.x.ax = 0x3b00; # ifdef DJGPP dos_putpath(path, 0); # endif sreg.ds = PTR_SEG(path); reg.x.dx = PTR_OFF(path, 0); return(intcall(0x21, ®, &sreg)); } static char *NEAR unixgetcwd(path, size) char *path; ALLOC_T size; { # ifdef DJGPP int i; # endif char *cp; # ifdef USEGETWD cp = (char *)getwd(path); # else cp = (char *)getcwd(path, size); # endif if (!cp) return(NULL); # ifdef DJGPP for (i = 0; cp[i]; i++) if (cp[i] == '/') cp[i] = _SC_; # endif return(cp); } static int NEAR unixstat(path, stp) CONST char *path; struct stat *stp; { struct find_t find; if (_dos_findfirst(path, SEARCHATTRS, &find) != 0) return(-1); stp -> st_mode = getunixmode(find.ff_attrib); stp -> st_mtime = getunixtime(find.ff_fdate, find.ff_ftime); stp -> st_size = find.ff_fsize; stp -> st_ctime = stp -> st_atime = stp -> st_mtime; stp -> st_dev = stp -> st_ino = 0; stp -> st_nlink = 1; stp -> st_uid = (uid_t)-1; stp -> st_gid = (gid_t)-1; return(0); } #endif /* MSDOS && !FD */ #ifdef DEP_DIRENT DIR *Xopendir(path) CONST char *path; { # if defined (DEP_KANJIPATH) || defined (DEP_ROCKRIDGE) \ || defined (DEP_URLPATH) || defined (CYGWIN) char tmp[MAXPATHLEN]; # endif # if defined (DEP_KANJIPATH) || defined (DEP_ROCKRIDGE) \ || defined (DEP_DOSEMU) || defined (DEP_URLPATH) int dev; # endif # ifdef DEP_URLPATH char *host; int n, type; # endif # ifdef FD char conv[MAXPATHLEN]; # endif DIR *dirp; CONST char *cp; # if defined (DEP_KANJIPATH) || defined (DEP_ROCKRIDGE) \ || defined (DEP_DOSEMU) || defined (DEP_URLPATH) dev = DEV_NORMAL; # endif cp = convput(conv, path, NULL, CVP_NEEDFILE | CVP_READLINK); # ifdef DEP_DOSEMU if (_dospath(cp)) { dev = DEV_DOS; dirp = dosopendir(cp); } else # endif # ifdef DEP_URLPATH if ((n = urlpath(cp, &host, tmp, &type))) { dev = DEV_URL; dirp = urlopendir(host, type, &(tmp[n])); Xfree(host); } else # endif dirp = unixopendir(cp); if (!dirp) return(NULL); # if defined (DEP_KANJIPATH) || defined (DEP_ROCKRIDGE) || defined (CYGWIN) cp = Xrealpath(path, tmp, RLP_READLINK); # ifdef CYGWIN if (tmp[0] != _SC_ || tmp[1]) dirp -> __flags |= (opendir_saw_u_cygdrive | opendir_saw_s_cygdrive); # endif # endif /* DEP_KANJIPATH || DEP_ROCKRIDGE || CYGWIN */ # if defined (DEP_KANJIPATH) || defined (DEP_ROCKRIDGE) \ || defined (DEP_DOSEMU) || defined (DEP_URLPATH) cp = convput(conv, cp, NULL, CVP_READLINK); putopenlist(OP_DIRP, dev, dirp, cp); # endif return(dirp); } int Xclosedir(dirp) DIR *dirp; { # if defined (DEP_KANJIPATH) || defined (DEP_ROCKRIDGE) \ || defined (DEP_DOSEMU) || defined (DEP_URLPATH) switch (delopenlist(OP_DIRP, dirp)) { # ifdef DEP_DOSEMU case DEV_DOS: return(dosclosedir(dirp)); /*NOTREACHED*/ break; # endif # ifdef DEP_URLPATH case DEV_URL: return(urlclosedir(dirp)); /*NOTREACHED*/ break; # endif default: break; } # endif /* DEP_KANJIPATH || DEP_ROCKRIDGE || DEP_DOSEMU || DEP_URLPATH */ return(unixclosedir(dirp)); } # ifdef CYGWIN static struct dirent *NEAR pseudoreaddir(dirp) DIR *dirp; { static char *upath = NULL; static char *spath = NULL; struct dirent *dp; if (!upath) { upath = getcygdrive_user(); while (*upath == _SC_) upath++; } if (!spath) { spath = getcygdrive_system(); while (*spath == _SC_) spath++; } dp = readdir(dirp); if (dirp -> __d_cookie != __DIRENT_COOKIE) return(dp); if (!*upath) dirp -> __flags |= opendir_saw_u_cygdrive; if (!*spath) dirp -> __flags |= opendir_saw_s_cygdrive; if (dp) { if (*upath && !(dirp -> __flags & opendir_saw_u_cygdrive) && !strpathcmp(dp -> d_name, upath)) dirp -> __flags |= opendir_saw_u_cygdrive; else if (*spath && !(dirp -> __flags & opendir_saw_s_cygdrive) && !strpathcmp(dp -> d_name, spath)) dirp -> __flags |= opendir_saw_s_cygdrive; } else { if (!(dirp -> __flags & opendir_saw_u_cygdrive)) { dp = dirp -> __d_dirent; Xstrcpy(dp -> d_name, upath); dirp -> __flags |= opendir_saw_u_cygdrive; dirp -> __d_position++; } else if (!(dirp -> __flags & opendir_saw_s_cygdrive)) { dp = dirp -> __d_dirent; Xstrcpy(dp -> d_name, spath); dirp -> __flags |= opendir_saw_s_cygdrive; dirp -> __d_position++; } } return(dp); } # endif /* CYGWIN */ struct dirent *Xreaddir(dirp) DIR *dirp; { # if !defined (DEP_DOSEMU) && !defined (DEP_URLPATH) \ && !defined (DEP_KANJIPATH) && !defined (DEP_ROCKRIDGE) return(pseudoreaddir(dirp)); # else /* DEP_DOSEMU || DEP_URLPATH || DEP_KANJIPATH || DEP_ROCKRIDGE */ # if defined (DEP_KANJIPATH) || defined (DEP_ROCKRIDGE) char path[MAXPATHLEN], conv[MAXPATHLEN]; # endif static st_dirent buf; struct dirent *dp; char *src, *dest; int n, dev; n = getopenlist(OP_DIRP, dirp); dev = (n >= 0) ? openlist[n].dev : DEV_NORMAL; switch (dev) { # ifdef DEP_DOSEMU case DEV_DOS: dp = (struct dirent *)dosreaddir(dirp); break; # endif # ifdef DEP_URLPATH case DEV_URL: dp = urlreaddir(dirp); break; # endif default: dp = pseudoreaddir(dirp); break; } if (!dp) return(NULL); dest = ((struct dirent *)&buf) -> d_name; # if defined (CYGWIN) && defined (DEP_DOSEMU) /* Some versions of Cygwin have neither d_fileno nor d_ino */ if (dev == DEV_DOS) { src = ((struct dosdirent *)dp) -> d_name; wrap_reclen(&buf) = ((struct dosdirent *)dp) -> d_reclen; } else # endif { src = dp -> d_name; memcpy((char *)(&buf), (char *)dp, dest - (char *)&buf); } # if MSDOS && defined (FD) memcpy(&(buf.d_alias), dp -> d_alias, sizeof(dp -> d_alias)); # endif if (isdotdir(src)) { Xstrcpy(dest, src); return((struct dirent *)&buf); } # if defined (DEP_KANJIPATH) || defined (DEP_ROCKRIDGE) if (n >= 0) { strcatdelim2(path, openlist[n].path, src); if (convget(conv, path, dev) == conv) { if ((src = strrdelim(conv, 0))) src++; else src = conv; } Xstrcpy(dest, src); } else # endif /* DEP_KANJIPATH || DEP_ROCKRIDGE */ # if defined (DEP_DOSEMU) && defined (CODEEUC) if (dev == DEV_DOS && !noconv) dest[sjis2ujis(dest, (u_char *)src, MAXNAMLEN)] = '\0'; else # endif Xstrcpy(dest, src); return((struct dirent *)&buf); # endif /* DEP_DOSEMU || DEP_URLPATH || DEP_KANJIPATH || DEP_ROCKRIDGE */ } VOID Xrewinddir(dirp) DIR *dirp; { # if defined (DEP_DOSEMU) || defined (DEP_URLPATH) switch (chkopenlist(OP_DIRP, dirp)) { # ifdef DEP_DOSEMU case DEV_DOS: dosrewinddir(dirp); return; /*NOTREACHED*/ break; # endif # ifdef DEP_URLPATH case DEV_URL: urlrewinddir(dirp); return; /*NOTREACHED*/ break; # endif } # endif /* DEP_DOSEMU || DEP_URLPATH */ unixrewinddir(dirp); } #endif /* DEP_DIRENT */ #if MSDOS int rawchdir(path) CONST char *path; { if (setcurdrv(dospath(path, NULL), 1) < 0 || unixchdir(path) < 0) return(-1); return(0); } #endif /* MSDOS */ #ifdef DEP_DOSDRIVE /*ARGSUSED*/ static int NEAR checkchdir(drive, path) int drive; CONST char *path; { # if MSDOS char tmp[MAXPATHLEN]; # endif # if MSDOS if (setcurdrv(drive, 1) < 0) return(-1); if (checkpath(path, tmp)) path = tmp; else return(unixchdir(path)); # endif return(doschdir(path)); } #endif /* DEP_DOSDRIVE */ int Xchdir(path) CONST char *path; { #ifdef DEP_PSEUDOPATH char tmp[MAXPATHLEN]; int dd, drv, drive, dev, lastdev; #endif #ifdef FD char conv[MAXPATHLEN]; #endif int n; path = convput(conv, path, NULL, CVP_NEEDFILE | CVP_READLINK); #ifndef DEP_PSEUDOPATH n = rawchdir(path); #else /* DEP_PSEUDOPATH */ lastdev = checkdrv(lastdrv, NULL); if ((drv = preparedrv(path, &drive, tmp)) < 0) n = dev = -1; else switch ((dev = checkdrv(drv, &dd))) { # ifdef DEP_DOSDRIVE case DEV_DOS: n = checkchdir(drive, path); break; # endif # ifdef DEP_URLPATH case DEV_URL: n = urlchdir(dd, &(tmp[drive])); if (n >= 0) { if (n != dd) { shutdrv(drv); drv = n + DEVOFS_URL; } n = 0; } break; # endif case DEV_NORMAL: n = rawchdir(path); break; default: n = seterrno(ENOENT); break; } if (n < 0) shutdrv(drv); else { switch (lastdev) { case DEV_DOS: case DEV_URL: shutdrv(lastdrv); break; default: # if !MSDOS if (dev != DEV_NORMAL) VOID_C rawchdir(rootpath); # endif break; } lastdrv = drv; } #endif /* DEP_PSEUDOPATH */ LOG1(_LOG_INFO_, n, "chdir(\"%k\");", path); #if defined (DEP_DOSEMU) || defined (DEP_URLPATH) if (n < 0) return(-1); else if (n) /*EMPTY*/; else if (!Xgetwd(cachecwd)) { *cachecwd = '\0'; if (dev != DEV_NORMAL) n = -1; } # if defined (FD) && defined (DEP_URLPATH) else if (dev == DEV_URL) Xstrcpy(fullpath, cachecwd); # endif #endif /* DEP_DOSEMU || DEP_URLPATH */ return(n); } char *Xgetwd(path) char *path; { #ifdef DEP_URLPATH int drv; #endif #ifdef FD char conv[MAXPATHLEN]; #endif char *cp; #if defined (DEP_DOSEMU) || defined (DEP_URLPATH) if (path == cachecwd || !*cachecwd) /*EMPTY*/; # ifdef DEP_DOSEMU else if (_dospath(cachecwd)) /*EMPTY*/; # endif else { Xstrcpy(path, cachecwd); return(path); } #endif /* DEP_DOSEMU || DEP_URLPATH */ #ifdef DEP_DOSEMU if (dosdrive && checkdrv(lastdrv, NULL) == DEV_DOS) { if (!(cp = dosgetcwd(path, MAXPATHLEN))) return(NULL); if (Xisupper(cp[0])) Xstrtolower(&(cp[2])); cp = convget(conv, cp, DEV_DOS); } else #endif #ifdef DEP_URLPATH if (urldrive && checkdrv(lastdrv, &drv) == DEV_URL) { if (!(cp = urlgetcwd(drv, path, MAXPATHLEN))) return(NULL); else cp = convget(conv, cp, DEV_URL); } else #endif if (!(cp = unixgetcwd(path, MAXPATHLEN))) return(NULL); else cp = convget(conv, cp, DEV_NORMAL); if (cp == path) return(cp); Xstrcpy(path, cp); return(path); } #if MSDOS static int NEAR unixstat2(path, stp) CONST char *path; struct stat *stp; { char *cp; u_short mode; if (unixstat(path, stp) < 0) return(-1); mode = (u_short)(stp -> st_mode); if ((mode & S_IFMT) != S_IFDIR && (cp = Xstrrchr(path, '.')) && strlen(++cp) == 3) { if (!Xstrcasecmp(cp, EXTCOM) || !Xstrcasecmp(cp, EXTEXE) || !Xstrcasecmp(cp, EXTBAT)) mode |= S_IXUSR; } mode &= (S_IRUSR | S_IWUSR | S_IXUSR); mode |= (mode >> 3) | (mode >> 6); stp -> st_mode |= mode; return(0); } #endif /* MSDOS */ #ifdef DEP_DIRENT int Xstat(path, stp) CONST char *path; struct stat *stp; { #ifdef DEP_URLPATH char *host, tmp[MAXPATHLEN]; int type; #endif #ifdef FD char conv[MAXPATHLEN]; #endif int n; path = convput(conv, path, NULL, CVP_NEEDFILE | CVP_READLINK); #ifdef DEP_DOSEMU if (_dospath(path)) n = dosstat(path, stp); else #endif #ifdef DEP_URLPATH if ((n = urlpath(path, &host, tmp, &type))) { n = urlstat(host, type, &(tmp[n]), stp); Xfree(host); } else #endif n = unixstat2(path, stp); return(n); } int Xlstat(path, stp) CONST char *path; struct stat *stp; { #ifdef DEP_ROCKRIDGE char rpath[MAXPATHLEN]; #endif #ifdef DEP_URLPATH char *host, tmp[MAXPATHLEN]; int type; #endif #ifdef FD char conv[MAXPATHLEN]; #endif int n; #ifdef DEP_ROCKRIDGE path = convput(conv, path, rpath, CVP_NEEDFILE); #else path = convput(conv, path, NULL, CVP_NEEDFILE); #endif #ifdef DEP_DOSEMU if (_dospath(path)) n = doslstat(path, stp); else #endif #ifdef DEP_URLPATH if ((n = urlpath(path, &host, tmp, &type))) { n = urllstat(host, type, &(tmp[n]), stp); Xfree(host); } else #endif n = unixlstat2(path, stp); #ifdef DEP_ROCKRIDGE if (n >= 0 && *rpath) rrlstat(rpath, stp); #endif return(n); } #endif /* DEP_DIRENT */ #ifdef DEP_BIASPATH int Xaccess(path, mode) CONST char *path; int mode; { #if defined (DEP_DOSLFN) || defined (DEP_URLPATH) char tmp[MAXPATHLEN]; #endif #ifdef DEP_URLPATH char *host; int type; #endif #ifdef FD char conv[MAXPATHLEN]; #endif #if MSDOS struct stat st; #endif CONST char *cp; int n; cp = convput(conv, path, NULL, CVP_NEEDFILE | CVP_READLINK); #ifdef DEP_DOSEMU if (_dospath(cp)) n = dosaccess(cp, mode); else #endif #ifdef DEP_URLPATH if ((n = urlpath(cp, &host, tmp, &type))) { n = urlaccess(host, type, &(tmp[n]), mode); Xfree(host); } else #endif #ifdef DEP_DOSLFN # ifdef DEP_DOSDRIVE if (checkpath(cp, tmp)) n = dosaccess(tmp, mode); else # endif if (!(cp = preparefile(cp, tmp))) n = -1; else #endif /* DEP_DOSLFN */ if ((n = (access(cp, mode)) ? -1 : 0) < 0) /*EMPTY*/; #if MSDOS else if (!(mode & X_OK)) /*EMPTY*/; else if (stat(path, &st) < 0 || !(st.st_mode & S_IXUSR)) n = seterrno(EACCES); #endif return(n); } int Xsymlink(name1, name2) CONST char *name1, *name2; { #ifdef FD char conv2[MAXPATHLEN]; #endif #ifdef DEP_KANJIPATH char *cp, conv1[MAXPATHLEN]; #endif int n; name2 = convput(conv2, name2, NULL, CVP_NEEDFILE); #ifdef DEP_KANJIPATH cp = symrealpath(name2, name1, conv1, RLP_READLINK); if (cp) name1 = kanjiconv2(conv1, name1, strsize(conv1), DEFCODE, getkcode(cp), L_FNAME); #endif #ifdef DEP_DOSEMU if (_dospath(name2)) n = dossymlink(name1, name2); else #endif #ifdef DEP_URLPATH if (urlpath(name2, NULL, NULL, NULL)) n = seterrno(EACCES); else #endif #if MSDOS n = seterrno(EACCES); #else n = (symlink(name1, name2)) ? -1 : 0; #endif LOG2(_LOG_WARNING_, n, "symlink(\"%k\", \"%k\");", name1, name2); return(n); } int Xreadlink(path, buf, bufsiz) CONST char *path; char *buf; int bufsiz; { #ifdef FD char conv2[MAXPATHLEN]; #endif #ifdef DEP_KANJIPATH char *cp, conv1[MAXPATHLEN]; #endif #ifdef DEP_URLPATH char *host, tmp[MAXPATHLEN]; int type; #endif char lbuf[MAXPATHLEN]; int n; path = convput(conv2, path, lbuf, CVP_NEEDFILE); #ifdef DEP_ROCKRIDGE if (*lbuf && (n = rrreadlink(lbuf, lbuf, sizeof(lbuf) - 1)) >= 0) /*EMPTY*/; else #endif #ifdef DEP_DOSEMU if (_dospath(path)) n = dosreadlink(path, lbuf, sizeof(lbuf) - 1); else #endif #ifdef DEP_URLPATH if ((n = urlpath(path, &host, tmp, &type))) { n = urlreadlink(host, type, &(tmp[n]), lbuf, sizeof(lbuf) - 1); Xfree(host); } else #endif #if MSDOS n = seterrno(EINVAL); #else n = readlink(path, lbuf, sizeof(lbuf) - 1); #endif if (n >= 0) { lbuf[n] = '\0'; path = lbuf; #ifdef DEP_KANJIPATH cp = symrealpath(path, lbuf, conv1, RLP_READLINK); if (cp) path = kanjiconv2(conv1, lbuf, strsize(conv1), getkcode(cp), DEFCODE, L_FNAME); #endif for (n = 0; n < bufsiz && path[n]; n++) buf[n] = path[n]; } return(n); } int Xchmod(path, mode) CONST char *path; int mode; { #ifdef DEP_URLPATH char *host, tmp[MAXPATHLEN]; int type; #endif #ifdef FD char conv[MAXPATHLEN]; #endif int n; path = convput(conv, path, NULL, CVP_NEEDFILE | CVP_READLINK); #ifdef DEP_DOSEMU if (_dospath(path)) n = doschmod(path, mode); else #endif #ifdef DEP_URLPATH if ((n = urlpath(path, &host, tmp, &type))) { n = urlchmod(host, type, &(tmp[n]), mode); Xfree(host); } else #endif n = unixchmod(path, mode); LOG2(_LOG_NOTICE_, n, "chmod(\"%k\", %05o);", path, mode); return(n); } #endif /* DEP_BIASPATH */ int rawutimes(path, utp) CONST char *path; CONST struct utimes_t *utp; { # if MSDOS __dpmi_regs reg; struct SREGS sreg; time_t t; int fd; # else /* !MSDOS */ # ifdef USEUTIME struct utimbuf times; # else struct timeval tvp[2]; # endif # endif /* !MSDOS */ int n; # if MSDOS t = utp -> modtime; if ((fd = open(path, O_RDONLY, 0666)) < 0) return(-1); reg.x.ax = 0x5701; reg.x.bx = fd; VOID_C getdostime(&(reg.x.dx), &(reg.x.cx), t); n = intcall(0x21, ®, &sreg); VOID_C close(fd); # else /* !MSDOS */ # ifdef USEUTIME times.actime = utp -> actime; times.modtime = utp -> modtime; n = utime(path, ×); # else tvp[0].tv_sec = utp -> actime; tvp[0].tv_usec = 0L; tvp[1].tv_sec = utp -> modtime; tvp[1].tv_usec = 0L; n = utimes(path, tvp); # endif if (n != 0) n = -1; # endif /* !MSDOS */ return(n); } int Xutimes(path, utp) CONST char *path; CONST struct utimes_t *utp; { #ifdef FD char conv[MAXPATHLEN]; #endif int n; path = convput(conv, path, NULL, CVP_NEEDFILE | CVP_READLINK); #ifdef DEP_DOSEMU if (_dospath(path)) n = dosutimes(path, utp); else #endif #ifdef DEP_URLPATH if (urlpath(path, NULL, NULL, NULL)) n = seterrno(EACCES); else #endif n = unixutimes(path, utp); LOG1(_LOG_NOTICE_, n, "utimes(\"%k\");", path); return(n); } #ifdef DEP_BIASPATH #ifdef HAVEFLAGS int Xchflags(path, flags) CONST char *path; u_long flags; { # ifdef FD char conv[MAXPATHLEN]; # endif int n; path = convput(conv, path, NULL, CVP_NEEDFILE | CVP_READLINK); # ifdef DEP_DOSEMU if (_dospath(path)) n = seterrno(EACCES); else # endif # ifdef DEP_URLPATH if (urlpath(path, NULL, NULL, NULL)) n = seterrno(EACCES); else # endif # if MSDOS n = seterrno(EACCES); # else n = (chflags(path, flags)) ? -1 : 0; # endif LOG2(_LOG_WARNING_, n, "chflags(\"%k\", %05o);", path, flags); return(n); } #endif /* !HAVEFLAGS */ #ifndef NOUID int Xchown(path, uid, gid) CONST char *path; u_id_t uid; g_id_t gid; { # ifdef FD char conv[MAXPATHLEN]; # endif int n; path = convput(conv, path, NULL, CVP_NEEDFILE | CVP_READLINK); # ifdef DEP_DOSEMU if (_dospath(path)) n = seterrno(EACCES); else # endif # ifdef DEP_URLPATH if (urlpath(path, NULL, NULL, NULL)) n = seterrno(EACCES); else # endif # if MSDOS n = seterrno(EACCES); # else n = (chown(path, (uid_t)uid, (gid_t)gid)) ? -1 : 0; # endif LOG3(_LOG_WARNING_, n, "chown(\"%k\", %d, %d);", path, (int)uid, (int)gid); return(n); } #endif /* !NOUID */ int Xunlink(path) CONST char *path; { #ifdef DEP_URLPATH char *host, tmp[MAXPATHLEN]; int type; #endif #ifdef FD char conv[MAXPATHLEN]; #endif int n; path = convput(conv, path, NULL, CVP_NEEDFILE | CVP_READLINK); #ifdef DEP_DOSEMU if (_dospath(path)) n = dosunlink(path); else #endif #ifdef DEP_URLPATH if ((n = urlpath(path, &host, tmp, &type))) { n = urlunlink(host, type, &(tmp[n])); Xfree(host); } else #endif { n = unixunlink(path); #if MSDOS if (n >= 0 || errno != EACCES) /*EMPTY*/; else if (unixchmod(path, (S_IRUSR | S_IWUSR | S_ISVTX)) >= 0) n = unixunlink(path); #endif } LOG1(_LOG_WARNING_, n, "unlink(\"%k\");", path); return(n); } int Xrename(from, to) CONST char *from, *to; { #ifdef DEP_URLPATH char *host1, *host2, tmp1[MAXPATHLEN], tmp2[MAXPATHLEN]; int n2, type1, type2; #endif #ifdef FD char conv1[MAXPATHLEN], conv2[MAXPATHLEN]; #endif int n; from = convput(conv1, from, NULL, CVP_NEEDFILE); to = convput(conv2, to, NULL, CVP_NEEDFILE); #ifdef DEP_DOSEMU if (_dospath(from)) { if (_dospath(to)) n = dosrename(from, to); else n = seterrno(EXDEV); } else if (_dospath(to)) n = seterrno(EXDEV); else #endif #ifdef DEP_URLPATH if ((n = urlpath(from, &host1, tmp1, &type1))) { if ((n2 = urlpath(to, &host2, tmp2, &type2))) { if (type1 != type2 || cmpsockaddr(host1, host2)) n = seterrno(EXDEV); else n = urlrename(host1, type1, &(tmp1[n]), &(tmp2[n2])); Xfree(host2); } else n = seterrno(EXDEV); Xfree(host1); } else if (urlpath(to, NULL, NULL, NULL)) n = seterrno(EXDEV); else #endif #if MSDOS if (dospath(from, NULL) != dospath(to, NULL)) n = seterrno(EXDEV); else #endif n = unixrename(from, to); LOG2(_LOG_WARNING_, n, "rename(\"%k\", \"%k\");", from, to); return(n); } int Xopen(path, flags, mode) CONST char *path; int flags, mode; { #if defined (DEP_URLPATH) || defined (DEP_DOSLFN) char tmp[MAXPATHLEN]; #endif #ifdef DEP_URLPATH char *host; int n, type; #endif #ifdef FD char conv[MAXPATHLEN]; #endif #ifdef DEP_PSEUDOPATH int dev; #endif int fd; #ifdef DEP_PSEUDOPATH dev = DEV_NORMAL; #endif path = convput(conv, path, NULL, CVP_NEEDFILE | CVP_READLINK); #ifdef DEP_DOSEMU if (_dospath(path)) { dev = DEV_DOS; fd = dosopen(path, flags, mode); } else #endif #ifdef DEP_URLPATH if ((n = urlpath(path, &host, tmp, &type))) { dev = DEV_URL; fd = urlopen(host, type, &(tmp[n]), flags); Xfree(host); } else #endif #ifdef DEP_DOSLFN # ifdef DEP_DOSDRIVE if (checkpath(path, tmp)) { dev = DEV_DOS; fd = dosopen(tmp, flags, mode); } else # endif if (flags & O_CREAT) fd = unixopen(path, flags, mode); else if (!(path = preparefile(path, tmp))) fd = -1; else #endif /* DEP_DOSLFN */ fd = open(path, flags, mode); #ifdef DEP_PSEUDOPATH putopenfd(dev, fd); #endif #ifdef DEP_LOGGING switch (flags & O_ACCMODE) { case O_WRONLY: LOG2(_LOG_WARNING_, fd, "open(\"%k\", O_WRONLY, %05o);", path, mode); break; case O_RDWR: LOG2(_LOG_WARNING_, fd, "open(\"%k\", O_RDWR, %05o);", path, mode); break; default: LOG2(_LOG_INFO_, fd, "open(\"%k\", O_RDONLY, %05o);", path, mode); break; } #endif /* DEP_LOGGING */ return(fd); } #endif /* DEP_BIASPATH */ #ifdef DEP_PSEUDOPATH VOID putopenfd(dev, fd) int dev, fd; { putopenlist(OP_FD, dev, &fd, NULL); } int chkopenfd(fd) int fd; { return(chkopenlist(OP_FD, &fd)); } int delopenfd(fd) int fd; { return(delopenlist(OP_FD, &fd)); } int Xclose(fd) int fd; { int n; switch (delopenfd(fd)) { # ifdef DEP_DOSDRIVE case DEV_DOS: n = dosclose(fd); break; # endif # ifdef DEP_URLPATH case DEV_URL: case DEV_HTTP: n = urlclose(fd); break; # endif default: n = (close(fd)) ? -1 : 0; break; } return(n); } int Xread(fd, buf, nbytes) int fd; char *buf; int nbytes; { int n; switch (chkopenfd(fd)) { # ifdef DEP_DOSDRIVE case DEV_DOS: n = dosread(fd, buf, nbytes); break; # endif # ifdef DEP_URLPATH case DEV_URL: case DEV_HTTP: n = urlread(fd, buf, nbytes); break; # endif default: n = read(fd, buf, nbytes); break; } return(n); } int Xwrite(fd, buf, nbytes) int fd; CONST char *buf; int nbytes; { int n; switch (chkopenfd(fd)) { # ifdef DEP_DOSDRIVE case DEV_DOS: n = doswrite(fd, buf, nbytes); break; # endif # ifdef DEP_URLPATH case DEV_URL: case DEV_HTTP: n = urlwrite(fd, buf, nbytes); break; # endif default: n = write(fd, buf, nbytes); break; } return(n); } off_t Xlseek(fd, offset, whence) int fd; off_t offset; int whence; { off_t ofs; switch (chkopenfd(fd)) { # ifdef DEP_DOSDRIVE case DEV_DOS: ofs = doslseek(fd, offset, whence); break; # endif default: ofs = lseek(fd, offset, whence); break; } return(ofs); } #ifndef NOFTRUNCATE int Xftruncate(fd, len) int fd; off_t len; { # ifdef __TURBOC__ char buf[BUFSIZ]; off_t ofs, eofs; int size, duperrno; # endif int n; switch (chkopenfd(fd)) { # ifdef DEP_DOSDRIVE case DEV_DOS: n = dosftruncate(fd, len); break; # endif default: # ifdef __TURBOC__ if ((ofs = lseek(fd, 0L, L_INCR)) < (off_t)0) { n = -1; break; } memset(buf, 0, sizeof(buf)); n = 0; if ((eofs = lseek(fd, 0L, L_XTND)) < (off_t)0) n = -1; else if (eofs > len) { eofs = lseek(fd, len, L_SET); if (eofs < (off_t)0) n = -1; else if (eofs != len) n = seterrno(EIO); else n = write(fd, buf, 0); } else while (eofs < len) { size = sizeof(buf); if (eofs + size > len) size = len - eofs; if ((n = write(fd, buf, size)) < 0) break; eofs += len; } duperrno = errno; VOID_C lseek(fd, ofs, L_SET); errno = duperrno; # else /* !__TURBOC__ */ n = ftruncate(fd, len); # endif /* !__TURBOC__ */ break; } return(n); } #endif /* !NOFTRUNCATE */ int Xdup(old) int old; { int fd, dev; dev = chkopenfd(old); switch (dev) { # ifdef DEP_DOSDRIVE case DEV_DOS: fd = seterrno(EBADF); break; # endif default: fd = safe_dup(old); break; } if (fd >= 0) { # ifdef DEP_URLPATH if (dev == DEV_URL) VOID_C urldup2(old, fd); # endif putopenfd(dev, fd); } return(fd); } int Xdup2(old, new) int old, new; { int fd, odev, ndev; if (old == new) return(new); odev = chkopenfd(old); ndev = chkopenfd(old); # ifdef DEP_DOSDRIVE if (odev == DEV_DOS || ndev == DEV_DOS) fd = seterrno(EBADF); else # endif fd = safe_dup2(old, new); if (fd >= 0) { # ifdef DEP_URLPATH if (odev == DEV_URL || ndev == DEV_URL || odev == DEV_HTTP || ndev == DEV_HTTP) VOID_C urldup2(old, fd); # endif putopenfd(odev, fd); } return(fd); } #endif /* DEP_PSEUDOPATH */ int Xmkdir(path, mode) CONST char *path; int mode; { #ifdef DEP_URLPATH char *host, tmp[MAXPATHLEN]; int type; #endif #ifdef FD char conv[MAXPATHLEN]; #endif int n; path = convput(conv, path, NULL, CVP_NEEDFILE | CVP_READLINK); #ifdef DEP_DOSEMU if (_dospath(path)) n = dosmkdir(path, mode); else #endif #ifdef DEP_URLPATH if ((n = urlpath(path, &host, tmp, &type))) { n = urlmkdir(host, type, &(tmp[n])); Xfree(host); } else #endif #if MSDOS && !defined (DJGPP) if (Xaccess(path, F_OK) >= 0) n = seterrno(EEXIST); else #endif n = unixmkdir(path, mode); LOG2(_LOG_WARNING_, n, "mkdir(\"%k\", %05o);", path, mode); return(n); } #ifdef DEP_BIASPATH int Xrmdir(path) CONST char *path; { #ifdef DEP_URLPATH char *host, tmp[MAXPATHLEN]; int type; #endif #ifdef FD char conv[MAXPATHLEN]; #endif int n; path = convput(conv, path, NULL, CVP_NEEDFILE | CVP_READLINK); #ifdef DEP_DOSEMU if (_dospath(path)) n = dosrmdir(path); else #endif #ifdef DEP_URLPATH if ((n = urlpath(path, &host, tmp, &type))) { n = urlrmdir(host, type, &(tmp[n])); Xfree(host); } else #endif n = unixrmdir(path); LOG1(_LOG_WARNING_, n, "rmdir(\"%k\");", path); return(n); } #endif /* DEP_BIASPATH */ #ifndef NOFLOCK int Xflock(fd, operation) int fd, operation; { # ifdef USEFCNTLOCK struct flock lock; int cmd; # endif int n; # ifdef USEFCNTLOCK switch (operation & (LOCK_SH | LOCK_EX | LOCK_UN)) { case LOCK_SH: lock.l_type = F_RDLCK; break; case LOCK_EX: lock.l_type = F_WRLCK; break; default: lock.l_type = F_UNLCK; break; } cmd = (operation & LOCK_NB) ? F_SETLK : F_SETLKW; lock.l_start = lock.l_len = (off_t)0; lock.l_whence = L_SET; n = fcntl(fd, cmd, &lock); # else /* !USEFCNTLOCK */ # ifdef USELOCKF switch (operation & (LOCK_SH | LOCK_EX | LOCK_UN)) { case LOCK_SH: operation = F_TEST; break; case LOCK_EX: operation = (operation & LOCK_NB) ? F_TLOCK : F_LOCK; break; default: operation = F_ULOCK; break; } n = lockf(fd, operation, (off_t)0); # else /* !USELOCKF */ n = flock(fd, operation); # endif /* !USELOCKF */ # endif /* !USEFCNTLOCK */ if (n >= 0) { errno = 0; return(0); } return(-1); } #endif /* !NOFLOCK */ #ifndef NOSELECT int checkread(fd, buf, nbytes, timeout) int fd; VOID_P buf; int nbytes, timeout; { struct timeval tv; int i, n; n = 1; # ifdef DEP_PSEUDOPATH switch (chkopenfd(fd)) { # ifdef DEP_DOSDRIVE case DEV_DOS: n = 0; break; # endif # ifdef DEP_URLPATH case DEV_URL: case DEV_HTTP: if ((n = urlselect(fd)) <= 0) return(n); break; # endif default: break; } # endif /* DEP_PSEUDOPATH */ # if MSDOS if (n && isatty(fd)) n = 0; # endif if (!n) i = timeout = 0; else for (i = 0; timeout <= 0 || i < timeout * 10; i++) { if (readintrfunc && (*readintrfunc)()) return(seterrno(EINTR)); tv.tv_sec = 0L; tv.tv_usec = 1000000L / 10; if ((n = readselect(1, &fd, NULL, &tv)) < 0) return(-1); else if (n) break; } if (timeout > 0 && i >= timeout * 10) return(0); return(sureread(fd, buf, nbytes)); } #endif /* !NOSELECT */ FD-3.01j/dosdisk.c100644 2105 1751 263574 13516612560 12546 0ustar shiraiuser/* * dosdisk.c * * MSDOS disk accessing module */ #include "headers.h" #include "depend.h" #include "kctype.h" #include "string.h" #include "time.h" #include "sysemu.h" #include "pathname.h" #include "dosdisk.h" #include "unixdisk.h" #include "kconv.h" #if MSDOS #include #include #endif #ifdef LINUX #include "mntinfo.h" #include #include # ifndef BLKFLSBUF # include # endif # if defined (USELLSEEK) && !defined (_syscall5) # include # undef _syscall5 # endif #endif /* LINUX */ #ifdef HDDMOUNT #include # ifdef BSD4 # ifdef NETBSD # define OMIT_FSTYPENUMS /* For NetBSD >=3.1 */ # endif # include # else /* !BSD4 */ # ifdef SOLARIS # include # include # endif # ifdef LINUX # include # endif # ifdef MINIX32 # include # endif # endif /* !BSD4 */ #endif /* HDDMOUNT */ #ifdef SOLARIS #define DIOCGDINFO DKIOCGGEOM #define disklabel dk_geom #define d_ntracks dkg_nhead #define d_nsectors dkg_nsect #endif #ifdef LINUX #define D_SECSIZE(dl) 512 #define DIOCGDINFO HDIO_GETGEO #define disklabel hd_geometry #define d_ntracks heads #define d_nsectors sectors #else #define D_SECSIZE(dl) (dl).d_secsize #endif #if defined (USELLSEEK) && !defined (_syscall5) # if defined (__NR__llseek) && !defined (SYS__llseek) # define SYS__llseek __NR__llseek # endif # ifdef SYS__llseek # define _llseek(f, h, l, r, w) \ syscall(SYS__llseek, f, h, l, r, w) # endif #endif /* USELLSEEK && !_syscall5 */ #define KC_SJIS1 0001 #define KC_SJIS2 0002 #define KC_EUCJP 0010 #define EXTCOM "COM" #define EXTEXE "EXE" #define EXTBAT "BAT" #define strsizecmp(s1, s2) strncmp(s1, s2, sizeof(s1)) #define ENDCLUST ((long)(0x0fffffff)) #define ERRCLUST ((long)(0x0ffffff7)) #define ROOTCLUST ((long)(0x10000000)) #ifndef _NODOSDRIVE #if MSDOS && defined (FD) extern int _dospath __P_((CONST char *)); #define __dospath _dospath #else #define __dospath(p) ((Xisalpha(*(p)) && (p)[1] == ':') ? *(p) : 0) #endif #ifdef FD extern int newdup __P_((int)); #else #define newdup(n) (n) #endif #ifdef USELLSEEK static l_off_t NEAR Xllseek __P_((int, l_off_t, int)); #else #define Xllseek lseek #endif #if !MSDOS static int NEAR sectseek __P_((CONST devstat *, u_long)); #endif static int NEAR realread __P_((CONST devstat *, u_long, u_char *, int)); static int NEAR realwrite __P_((CONST devstat *, u_long, CONST u_char *, int)); static int NEAR killcache __P_((CONST devstat *, int, int)); static int NEAR flushcache __P_((CONST devstat *)); static int NEAR shiftcache __P_((CONST devstat *, int, int)); static int NEAR cachecpy __P_((int, int, int, int)); static int NEAR uniqcache __P_((CONST devstat *, int, u_long, u_long)); static int NEAR appendcache __P_((int, CONST devstat *, u_long, CONST u_char *, int, int)); static int NEAR insertcache __P_((int, CONST devstat *, u_long, CONST u_char *, int, int)); static int NEAR overwritecache __P_((int, CONST devstat *, u_long, CONST u_char *, int, int)); static int NEAR savecache __P_((CONST devstat *, u_long, CONST u_char *, int, int)); static int NEAR loadcache __P_((CONST devstat *, u_long, u_char *, int)); static long NEAR sectread __P_((CONST devstat *, u_long, u_char *, int)); static long NEAR sectwrite __P_((CONST devstat *, u_long, CONST u_char *, int)); static int NEAR availfat __P_((CONST devstat *)); static int NEAR readfat __P_((devstat *)); static int NEAR writefat __P_((CONST devstat *)); static long NEAR getfatofs __P_((CONST devstat *, long)); static u_char *NEAR readtmpfat __P_((CONST devstat *, long, int)); static long NEAR getfatent __P_((CONST devstat *, long)); static int NEAR putfatent __P_((devstat *, long, long)); static u_long NEAR clust2sect __P_((CONST devstat *, long)); static long NEAR clust32 __P_((CONST devstat *, CONST dent_t *)); static long NEAR newclust __P_((CONST devstat *)); static long NEAR clustread __P_((CONST devstat *, u_char *, long)); static long NEAR clustwrite __P_((devstat *, CONST u_char *, long)); static long NEAR clustexpand __P_((devstat *, long, int)); static int NEAR clustfree __P_((devstat *, long)); #if !MSDOS static int NEAR _readbpb __P_((devstat *, CONST bpb_t *)); #endif static int NEAR readbpb __P_((devstat *, int)); #if defined (HDDMOUNT) && defined (DIOCGDINFO) static l_off_t *NEAR _readpt __P_((l_off_t, l_off_t, int, int, int, int)); #endif static int NEAR _dosopendev __P_((int)); static int NEAR _dosclosedev __P_((int)); static int NEAR calcsum __P_((CONST u_char *)); static u_int NEAR lfnencode __P_((u_int, u_int)); static u_int NEAR lfndecode __P_((u_int, u_int)); #if !MSDOS static int NEAR transchar __P_((int)); static int NEAR detranschar __P_((int)); #endif static int NEAR sfntranschar __P_((int)); static int NEAR cmpdospath __P_((CONST char *, CONST char *, int, int)); static char *NEAR getdosname __P_((char *, CONST u_char *, CONST u_char *)); static u_char *NEAR putdosname __P_((u_char *, CONST char *, int)); static int NEAR putdostime __P_((u_char *, time_t)); static int NEAR getdrive __P_((CONST char *)); static char *NEAR addpath __P_((char *, int, CONST char *, int)); static int NEAR parsepath __P_((char *, CONST char *, int)); static int NEAR seekdent __P_((dosDIR *, dent_t *, long, long)); static int NEAR readdent __P_((dosDIR *, dent_t *, int)); static dosDIR *NEAR _dosopendir __P_((CONST char *, char *, int)); static int NEAR _dosclosedir __P_((dosDIR *)); static struct dosdirent *NEAR _dosreaddir __P_((dosDIR *, int)); static struct dosdirent *NEAR finddirent __P_((dosDIR *, CONST char *, int, int)); static dosDIR *NEAR splitpath __P_((CONST char **, char *, int)); static int NEAR getdent __P_((CONST char *, int *)); static int NEAR writedent __P_((int)); static int NEAR expanddent __P_((int)); static int NEAR creatdent __P_((CONST char *, int)); static int NEAR unlinklfn __P_((int, long, long, int)); static long NEAR dosfilbuf __P_((int, int)); static long NEAR dosflsbuf __P_((int)); #if MSDOS int dependdosfunc = 0; #else /* !MSDOS */ int maxfdtype = 0; #if defined (DEP_DYNAMICLIST) || !defined (_NOCUSTOMIZE) int origmaxfdtype = 0; #endif #ifdef DEP_DYNAMICLIST fdtype_t fdtype = NULL; origfdtype_t origfdtype #else /* !DEP_DYNAMICLIST */ # ifndef _NOCUSTOMIZE origfdtype_t origfdtype = NULL; # endif fdtype_t fdtype #endif /* !DEP_DYNAMICLIST */ = { #if defined (SOLARIS) || defined (SUN_OS) {'A', "/dev/rfd0c", 2, 18, 80}, {'A', "/dev/rfd0c", 2, 9, 80}, {'A', "/dev/rfd0c", 2, 8 + 100, 80}, #endif #if defined (NEWS_OS3) || defined (NEWS_OS4) # if defined (news800) || defined (news900) \ || defined (news1800) || defined (news1900) || defined (news3800) {'A', "/dev/rfh0a", 2, 18, 80}, {'A', "/dev/rfd0a", 2, 9, 80}, {'A', "/dev/rfd0a", 2, 8 + 100, 80}, # else # if defined (news3100) || defined (news5000) {'A', "/dev/rfd00a", 2, 18, 80}, {'A', "/dev/rfd00a", 2, 9, 80}, {'A', "/dev/rfd00a", 2, 8 + 100, 80}, # else {'A', "/dev/rfd00a", 2, 18, 80}, {'A', "/dev/rfd01a", 2, 9, 80}, {'A', "/dev/rfd03a", 2, 8, 80}, # endif # endif #endif #if defined (NEWS_OS6) {'A', "/dev/rfloppy/c0d0u0p0", 2, 18, 80}, {'A', "/dev/rfloppy/c0d0u1p0", 2, 9, 80}, {'A', "/dev/rfloppy/c0d0u3p0", 2, 8, 80}, #endif #if defined (HPUX) # if defined (__hp9000s700) {'A', "/dev/rfloppy/c201d0s0", 2, 18, 80}, {'A', "/dev/rfloppy/c201d0s0", 2, 9, 80}, {'A', "/dev/rfloppy/c201d0s0", 2, 8 + 100, 80}, # endif #endif #if defined (EWSUXV) {'A', "/dev/if/f0h18", 2, 18, 80}, {'A', "/dev/if/f0h8", 2, 8, 77}, {'A', "/dev/if/f0c15", 2, 15, 80}, {'A', "/dev/if/f0d9", 2, 9, 80}, {'A', "/dev/if/f0d8", 2, 8, 80}, #endif #if defined (AIX) {'A', "/dev/rfd0h", 2, 18, 80}, {'A', "/dev/rfd0l", 2, 9, 80}, {'A', "/dev/rfd0l", 2, 8 + 100, 80}, #endif #if defined (ULTRIX) {'A', "/dev/rfh0a", 2, 18, 80}, {'A', "/dev/rfd0a", 2, 9, 80}, {'A', "/dev/rfd0a", 2, 8 + 100, 80}, #endif #if defined (UXPDS) {'A', "/dev/fpd0", 2, 18, 80}, {'A', "/dev/fpd0", 2, 9, 80}, {'A', "/dev/fpd0", 2, 8 + 100, 80}, #endif #if defined (CYGWIN) {'A', "/dev/fd0", 2, 18, 80}, {'A', "/dev/fd0", 2, 9, 80}, {'A', "/dev/fd0", 2, 8 + 100, 80}, #endif #if defined (LINUX) {'A', "/dev/fd0", 2, 18, 80}, {'A', "/dev/fd0", 2, 9, 80}, {'A', "/dev/fd0", 2, 8 + 100, 80}, #endif #if defined (JCCBSD) {'A', "/dev/rfd0a", 2, 18, 80}, {'A', "/dev/rfd0b", 2, 8, 77}, {'A', "/dev/rfd0c", 2, 9, 80}, {'A', "/dev/rfd0d", 2, 8, 80}, #endif #if defined (FREEBSD) # if __FreeBSD__ < 5 {'A', "/dev/rfd0.1440", 2, 18, 80}, {'A', "/dev/rfd0.720", 2, 9, 80}, {'A', "/dev/rfd0.720", 2, 8 + 100, 80}, # else /* FreeBSD >=5.0 has not any buffered device */ {'A', "/dev/fd0.1440", 2, 18, 80}, {'A', "/dev/fd0.720", 2, 9, 80}, {'A', "/dev/fd0.720", 2, 8 + 100, 80}, # endif #endif #if defined (NETBSD) # if defined (i386) {'A', "/dev/rfd0a", 2, 18, 80}, {'A', "/dev/rfd0a", 2, 15, 80}, {'A', "/dev/rfd0c", 2, 9, 80}, {'A', "/dev/rfd0c", 2, 8 + 100, 80}, # endif #endif #if defined (BSDOS) # if defined (i386) {'A', "/dev/rfd0c", 2, 18, 80}, {'A', "/dev/rfd0c", 2, 9, 80}, {'A', "/dev/rfd0c", 2, 8 + 100, 80}, # endif #endif #if defined (OPENBSD) {'A', "/dev/rfd0Bc", 2, 18, 80}, {'A', "/dev/rfd0Fc", 2, 9, 80}, {'A', "/dev/rfd0Fc", 2, 8 + 100, 80}, #endif #if defined (MINIX) # if defined (i386) {'A', "/dev/rfd0", 2, 18, 80}, {'A', "/dev/rfd0", 2, 9, 80}, {'A', "/dev/rfd0", 2, 8 + 100, 80}, # endif #endif #if defined (ORG_386BSD) # if defined (i386) {'A', "/dev/fd0a", 2, 18, 80}, {'A', "/dev/fd0a", 2, 15, 80}, {'A', "/dev/fd0b", 2, 8, 77}, {'A', "/dev/fd0c", 2, 9, 80}, {'A', "/dev/fd0c", 2, 8 + 100, 80}, # endif #endif {'\0', NULL, 0, 0, 0} }; #if 0 devinfo CONST mediadescr[] = { {0xff, "2D-8SECT", 2, 8, 40}, {0xfe, "1D-8SECT", 1, 8, 40}, {0xfd, "2D-9SECT", 2, 9, 40}, {0xfc, "1D-9SECT", 1, 9, 40}, {0xfb, "2DD-8SECT", 2, 8 + 100, 80}, {0xf9, "2DD-9SECT", 2, 9, 80}, {0xf9, "2HD-15SECT", 2, 15, 80}, {0xf8, "HDD", 0, 0, 0}, {0xf0, "2HD-18SECT", 2, 18, 80}, {0x02, "2HD-15SECT", 2, 15, 80}, {0x01, "2HD-8SECT", 2, 8, 77}, {0x00, NULL, 0, 0, 0} }; #endif #endif /* !MSDOS */ int lastdrive = -1; int needbavail = 0; VOID_T (*doswaitfunc)__P_((VOID_A)) = NULL; int (*dosintrfunc)__P_((VOID_A)) = NULL; static char *curdir['Z' - 'A' + 1]; static devstat devlist[DOSNOFILE]; static int maxdev = 0; static int devorder[DOSNOFILE]; static int maxorder = 0; static dosFILE dosflist[DOSNOFILE]; static int maxdosf = 0; static u_char cachedrive[SECTCACHESIZE]; static u_long sectno[SECTCACHESIZE]; static u_char *sectcache[SECTCACHESIZE]; static u_char cachesize[SECTCACHESIZE]; static u_char cachewrite[SECTCACHESIZE]; static int maxsectcache = 0; static long maxcachemem = 0L; static long lfn_clust = -1L; static long lfn_offset = 0L; static int doserrno = 0; #if !MSDOS static CONST short sectsizelist[] = SECTSIZE; #define SLISTSIZ arraysize(sectsizelist) #endif static CONST char *inhibitname[] = INHIBITNAME; #define INHIBITNAMESIZ arraysize(inhibitname) #ifdef USELLSEEK # ifdef _syscall5 # undef _llseek static _syscall5(int, _llseek, u_int, fd, u_long, ofs_h, u_long, ofs_l, l_off_t *, result, u_int, whence); # endif static l_off_t NEAR Xllseek(fd, offset, whence) int fd; l_off_t offset; int whence; { l_off_t result; u_long ofs_h, ofs_l; ofs_h = (u_long)(offset >> 32); ofs_l = (u_long)(offset & (u_long)0xffffffff); if (_llseek(fd, ofs_h, ofs_l, &result, whence) < 0) return((l_off_t)-1); return(result); } #endif /* USELLSEEK */ #if !MSDOS static int NEAR sectseek(devp, sect) CONST devstat *devp; u_long sect; { l_off_t offset; int duperrno; duperrno = errno; if (devp -> flags & F_8SECT) sect += sect / 8; offset = (l_off_t)sect * (l_off_t)(devp -> sectsize); # ifdef HDDMOUNT offset += devp -> offset; # endif if (Xllseek(devp -> fd, offset, L_SET) < (l_off_t)0) { doserrno = errno; errno = duperrno; return(-1); } errno = duperrno; return(0); } #endif /* !MSDOS */ static int NEAR realread(devp, sect, buf, n) CONST devstat *devp; u_long sect; u_char *buf; int n; { int duperrno; duperrno = errno; #if MSDOS n = rawdiskio(devp -> drive, sect, buf, n, devp -> sectsize, 0); if (n < 0) { doserrno = errno; return(-1); } #else if (sectseek(devp, sect) < 0) return(-1); while (read(devp -> fd, buf, (long)n * devp -> sectsize) < 0) { if (errno == EINTR) errno = duperrno; else { doserrno = errno; return(-1); } } #endif errno = duperrno; return(0); } static int NEAR realwrite(devp, sect, buf, n) CONST devstat *devp; u_long sect; CONST u_char *buf; int n; { int duperrno; duperrno = errno; #if MSDOS n = rawdiskio(devp -> drive, sect, (u_char *)buf, n, devp -> sectsize, 1); if (n < 0) { doserrno = errno; return(-1); } #else if (sectseek(devp, sect) < 0) return(-1); while (write(devp -> fd, buf, (long)n * devp -> sectsize) < 0) { if (errno == EINTR) errno = duperrno; else { doserrno = errno; return(-1); } } #endif errno = duperrno; return(0); } static int NEAR killcache(devp, n, size) CONST devstat *devp; int n, size; { int i, top; top = n - size; for (i = n; i > top; i--) { if (cachewrite[i]) { if (devp -> flags & F_RONLY) { doserrno = EROFS; n = -1; } if (realwrite(devp, sectno[i], sectcache[i], 1) < 0) n = -1; } free(sectcache[i]); cachewrite[i] = 0; } return(n); } static int NEAR flushcache(devp) CONST devstat *devp; { int i, n; n = 0; for (i = maxsectcache - 1; i >= 0; i--) { if (cachedrive[i] != devp -> drive) continue; if (cachewrite[i] && !(devp -> flags & F_RONLY) && realwrite(devp, sectno[i], sectcache[i], 1) < 0) n = -1; cachewrite[i] = 0; } return(n); } static int NEAR shiftcache(devp, n, nsect) CONST devstat *devp; int n, nsect; { u_char *cachebuf[SECTCACHESIZE], wrtbuf[SECTCACHESIZE]; u_long no; int i, drive, size; for (; n < maxsectcache - 1; n++) if (cachesize[n + 1] <= 1) break; drive = cachedrive[n]; no = sectno[n]; size = cachesize[n]; if (!devp) { for (i = 0; i < maxdev; i++) if (devlist[i].drive == drive) { devp = &(devlist[i]); break; } } if (nsect < 0) { if (killcache(devp, n, size) < 0) return(SECTCACHESIZE + 1); } else for (i = 0; i < size; i++) { cachebuf[i] = sectcache[n - i]; wrtbuf[i] = cachewrite[n - i]; } for (i = n - size + 1; i < maxsectcache - size; i++) { cachedrive[i] = cachedrive[i + size]; sectno[i] = sectno[i + size]; sectcache[i] = sectcache[i + size]; cachesize[i] = cachesize[i + size]; cachewrite[i] = cachewrite[i + size]; } maxsectcache -= size; maxcachemem -= size * devp -> sectsize; n = size; if (nsect < 0) return(n); if (!nsect) nsect = size; while (maxsectcache > 0 && (maxsectcache + nsect > SECTCACHESIZE || maxcachemem + nsect * devp -> sectsize > SECTCACHEMEM)) { if ((i = shiftcache(NULL, 0, -1)) > SECTCACHESIZE) return(SECTCACHESIZE + 1); n += i; } maxsectcache += nsect; maxcachemem += nsect * devp -> sectsize; n -= nsect; for (i = 0; i < nsect; i++) { cachedrive[maxsectcache - i - 1] = drive; sectno[maxsectcache - i - 1] = no + i; sectcache[maxsectcache - i - 1] = cachebuf[i]; cachesize[maxsectcache - i - 1] = nsect - i; cachewrite[maxsectcache - i - 1] = wrtbuf[i]; } return(n); } static int NEAR cachecpy(n, ofs1, ofs2, size) int n, ofs1, ofs2, size; { int i; if (ofs1 <= ofs2) for (i = 0; i < size; i++) { sectcache[n - ofs1 - i] = sectcache[n - ofs2 - i]; cachewrite[n - ofs1 - i] = cachewrite[n - ofs2 - i]; } else for (i = size - 1; i >= 0; i--) { sectcache[n - ofs1 - i] = sectcache[n - ofs2 - i]; cachewrite[n - ofs1 - i] = cachewrite[n - ofs2 - i]; } return(size); } static int NEAR uniqcache(devp, n, min, max) CONST devstat *devp; int n; u_long min, max; { int i, j, size; if (min >= max) return(0); for (i = n - cachesize[n]; i >= 0; i -= cachesize[i]) { if (devp -> drive != cachedrive[i]) continue; if (min <= sectno[i] && max >= sectno[i] + cachesize[i]) return(shiftcache(devp, i, -1)); if (min > sectno[i] && min < sectno[i] + cachesize[i]) { size = min - sectno[i]; for (j = 0; j < size; j++) cachesize[i - j] = size - j; return(shiftcache(devp, i - size, -1)); } if (max > sectno[i] && max < sectno[i] + cachesize[i]) { size = max - sectno[i]; for (j = 0; j < size; j++) cachesize[i - j] = size - j; return(shiftcache(devp, i, -1)); } } return(0); } static int NEAR appendcache(dst, devp, sect, buf, n, wrt) int dst; CONST devstat *devp; u_long sect; CONST u_char *buf; int n, wrt; { u_long min, max; int i, size, duperrno; duperrno = errno; min = sectno[dst]; max = min + cachesize[dst]; size = sect + n - min; if (devp -> sectsize > STDSECTSIZE && size * devp -> sectsize > SECTCACHEMEM) { size = SECTCACHEMEM / devp -> sectsize; min = sect + n - size; if (killcache(devp, dst, (int)(min - sectno[dst])) < 0) return(-1); cachecpy(dst, 0, (int)(min - sectno[dst]), (int)(max - min)); } else if (size > SECTCACHESIZE) { min += size - SECTCACHESIZE; size = SECTCACHESIZE; if (killcache(devp, dst, (int)(min - sectno[dst])) < 0) return(-1); cachecpy(dst, 0, (int)(min - sectno[dst]), (int)(max - min)); } else if (size < cachesize[dst]) size = cachesize[dst]; if ((i = uniqcache(devp, dst, max, sect + n)) > SECTCACHESIZE) return(-1); dst -= i; sectno[dst] = min; if (shiftcache(devp, dst, size) > SECTCACHESIZE) return(-1); dst = maxsectcache - 1 - (sect - min); for (i = 0; i < n; i++) { if (i + sect < max) cachewrite[dst - i] |= wrt; else { sectcache[dst - i] = (u_char *)malloc(devp -> sectsize); if (!sectcache[dst - i]) { doserrno = errno; errno = duperrno; return(-1); } cachewrite[dst - i] = wrt; } memcpy((char *)sectcache[dst - i], (char *)buf, devp -> sectsize); buf += devp -> sectsize; } return(0); } static int NEAR insertcache(dst, devp, sect, buf, n, wrt) int dst; CONST devstat *devp; u_long sect; CONST u_char *buf; int n, wrt; { u_long min, max; int i, size, duperrno; duperrno = errno; min = sectno[dst]; max = min + cachesize[dst]; size = max - sect; if (devp -> sectsize > STDSECTSIZE && size * devp -> sectsize > SECTCACHEMEM) { size = SECTCACHEMEM / devp -> sectsize; max = sect + size; i = dst - (max - min); if (killcache(devp, i, cachesize[i]) < 0) return(-1); } else if (size > SECTCACHESIZE) { size = SECTCACHESIZE; max = sect + size; i = dst - (max - min); if (killcache(devp, i, cachesize[i]) < 0) return(-1); } else if (size < cachesize[dst]) size = cachesize[dst]; if ((i = uniqcache(devp, dst, sect, min)) > SECTCACHESIZE) return(-1); dst -= i; sectno[dst] = sect; if (shiftcache(devp, dst, size) > SECTCACHESIZE) return(-1); dst = maxsectcache - 1; cachecpy(dst, (int)(min - sect), 0, (int)(max - min)); for (i = 0; i < n; i++) { if (i + sect >= min) cachewrite[dst - i] |= wrt; else { sectcache[dst - i] = (u_char *)malloc(devp -> sectsize); if (!sectcache[dst - i]) { doserrno = errno; errno = duperrno; return(-1); } cachewrite[dst - i] = wrt; } memcpy((char *)sectcache[dst - i], (char *)buf, devp -> sectsize); buf += devp -> sectsize; } return(0); } static int NEAR overwritecache(dst, devp, sect, buf, n, wrt) int dst; CONST devstat *devp; u_long sect; CONST u_char *buf; int n, wrt; { u_long min, max; int i, size, duperrno; duperrno = errno; min = sectno[dst]; max = min + cachesize[dst]; size = n; if (size < cachesize[dst]) size = cachesize[dst]; if ((i = uniqcache(devp, dst, sect, min)) > SECTCACHESIZE) return(-1); dst -= i; if ((i = uniqcache(devp, dst, max, sect + n)) > SECTCACHESIZE) return(-1); dst -= i; sectno[dst] = sect; if (shiftcache(devp, dst, size) > SECTCACHESIZE) return(-1); dst = maxsectcache - 1; cachecpy(dst, (int)(min - sect), 0, (int)(max - min)); for (i = 0; i < n; i++) { if (i + sect >= min && i + sect < max) cachewrite[dst - i] |= wrt; else { sectcache[dst - i] = (u_char *)malloc(devp -> sectsize); if (!sectcache[dst - i]) { doserrno = errno; errno = duperrno; return(-1); } cachewrite[dst - i] = wrt; } memcpy((char *)sectcache[dst - i], (char *)buf, devp -> sectsize); buf += devp -> sectsize; } return(0); } static int NEAR savecache(devp, sect, buf, n, wrt) CONST devstat *devp; u_long sect; CONST u_char *buf; int n, wrt; { int i, duperrno; if (n > SECTCACHESIZE || n * devp -> sectsize > SECTCACHEMEM) return(-1); for (i = maxsectcache - 1; i >= 0; i -= cachesize[i]) { if (devp -> drive != cachedrive[i]) continue; if (sect >= sectno[i] && sect <= sectno[i] + cachesize[i]) return(appendcache(i, devp, sect, buf, n, wrt)); if (sect + n >= sectno[i] && sect + n <= sectno[i] + cachesize[i]) return(insertcache(i, devp, sect, buf, n, wrt)); if (sect <= sectno[i] && sect + n >= sectno[i] + cachesize[i]) return(overwritecache(i, devp, sect, buf, n, wrt)); } duperrno = errno; while (maxsectcache > 0 && (maxsectcache + n > SECTCACHESIZE || maxcachemem + n * devp -> sectsize > SECTCACHEMEM)) { if (shiftcache(NULL, 0, -1) > SECTCACHESIZE) return(-1); } maxsectcache += n; maxcachemem += n * devp -> sectsize; for (i = 0; i < n; i++) { cachedrive[maxsectcache - i - 1] = devp -> drive; sectno[maxsectcache - i - 1] = sect + i; sectcache[maxsectcache - i - 1] = (u_char *)malloc(devp -> sectsize); if (!sectcache[maxsectcache - i - 1]) { doserrno = errno; errno = duperrno; return(-1); } cachesize[maxsectcache - i - 1] = n - i; cachewrite[maxsectcache - i - 1] = wrt; memcpy((char *)sectcache[maxsectcache - i - 1], (char *)buf, devp -> sectsize); buf += devp -> sectsize; } return(0); } static int NEAR loadcache(devp, sect, buf, n) CONST devstat *devp; u_long sect; u_char *buf; int n; { u_char *cp; int i, j, src, size; if (n <= 0) return(0); for (i = maxsectcache - 1; i >= 0; i -= cachesize[i]) { if (devp -> drive != cachedrive[i]) continue; if (sect >= sectno[i] && sect + n <= sectno[i] + cachesize[i]) { src = i - (sect - sectno[i]); for (j = 0; j < n; j++) { memcpy((char *)buf, (char *)sectcache[src - j], devp -> sectsize); buf += devp -> sectsize; } if (shiftcache(devp, i, 0) > SECTCACHESIZE) return(-1); return(0); } if (sect >= sectno[i] && sect < sectno[i] + cachesize[i]) { size = sectno[i] + cachesize[i] - sect; src = i - (sect - sectno[i]); cp = buf + (long)size * devp -> sectsize; for (j = 0; j < size; j++) { memcpy((char *)buf, (char *)sectcache[src - j], devp -> sectsize); buf += devp -> sectsize; } if (shiftcache(devp, i, 0) > SECTCACHESIZE) return(-1); return(loadcache(devp, sect + size, cp, n - size)); } if (sect + n > sectno[i] && sect + n <= sectno[i] + cachesize[i]) { size = sect + n - sectno[i]; src = i; cp = buf + (long)(n - size) * devp -> sectsize; if (loadcache(devp, sect, buf, n - size) < 0) return(-1); for (j = 0; j < size; j++) { memcpy((char *)cp, (char *)sectcache[src - j], devp -> sectsize); cp += devp -> sectsize; } if (shiftcache(devp, i, 0) > SECTCACHESIZE) return(-1); return(0); } if (sect <= sectno[i] && sect + n >= sectno[i] + cachesize[i]) { size = sectno[i] - sect; src = i; cp = buf + (long)size * devp -> sectsize; if (loadcache(devp, sect, buf, size) < 0) return(-1); for (j = 0; j < cachesize[i]; j++) { memcpy((char *)cp, (char *)sectcache[src - j], devp -> sectsize); cp += devp -> sectsize; } if (shiftcache(devp, i, 0) > SECTCACHESIZE) return(-1); size = sect + n - sectno[i] + cachesize[i]; cp += (long)cachesize[i] * devp -> sectsize; return(loadcache(devp, sect + size, cp, n - size) < 0); } } if (realread(devp, sect, buf, n) < 0) return(-1); savecache(devp, sect, buf, n, 0); return(0); } static long NEAR sectread(devp, sect, buf, n) CONST devstat *devp; u_long sect; u_char *buf; int n; { if (loadcache(devp, sect, buf, n) < 0) return(-1); return((long)n * devp -> sectsize); } static long NEAR sectwrite(devp, sect, buf, n) CONST devstat *devp; u_long sect; CONST u_char *buf; int n; { if (devp -> flags & F_RONLY) { doserrno = EROFS; return(-1); } if (savecache(devp, sect, buf, n, 1) < 0 && realwrite(devp, sect, buf, n) < 0) return(-1); return((long)n * devp -> sectsize); } static int NEAR availfat(devp) CONST devstat *devp; { u_char *buf; u_long i, n, clust; int j, gap, duperrno; if (!needbavail || devp -> availsize != (u_long)0xffffffff) return(0); duperrno = errno; if (!(buf = (u_char *)malloc(devp -> sectsize))) { doserrno = errno; errno = duperrno; return(-1); } if (doswaitfunc) (*doswaitfunc)(); n = 0; clust = devp -> totalsize + 2; if (devp -> flags & F_FAT32) for (i = 0; i < devp -> fatsize; i++) { if (dosintrfunc && (*dosintrfunc)()) { free(buf); return(0); } if (sectread(devp, devp -> fatofs + i, buf, 1) < 0L) { free(buf); return(-1); } for (j = 0; j < devp -> sectsize; j += 4) { if (clust) clust--; else break; if (!buf[j] && !buf[j + 1] && !buf[j + 2] && !buf[j + 3]) n++; } if (!clust) break; } else if (devp -> flags & F_16BIT) for (i = 0; i < devp -> fatsize; i++) { if (dosintrfunc && (*dosintrfunc)()) { free(buf); return(0); } if (sectread(devp, devp -> fatofs + i, buf, 1) < 0L) { free(buf); return(-1); } for (j = 0; j < devp -> sectsize; j += 2) { if (clust) clust--; else break; if (!buf[j] && !buf[j + 1]) n++; } if (!clust) break; } else for (i = gap = 0; i < devp -> fatsize; i++) { if (dosintrfunc && (*dosintrfunc)()) { free(buf); return(0); } if (sectread(devp, devp -> fatofs + i, buf, 1) < 0L) { free(buf); return(-1); } if ((gap & 4)) { if (clust) clust--; else break; if (((gap & 3) == 2 && !buf[0]) || ((gap & 3) == 1 && !(buf[0] & 0x0f))) n++; } for (j = (gap & 3); j < (devp -> sectsize - 1) * 2; j += 3) { if (clust) clust--; else break; if (j % 2) { if (!(buf[j / 2] & 0xf0) && !buf[j / 2 + 1]) n++; } else { if (!buf[j / 2] && !(buf[j / 2 + 1] & 0x0f)) n++; } } if (!clust) break; if (j >= devp -> sectsize * 2) gap = 0; else if (j % 2) gap = (buf[j / 2] & 0xf0) ? 6 : 2; else gap = (buf[j / 2]) ? 5 : 1; } for (i = 0; i < maxdev; i++) if (devlist[i].drive == devp -> drive) devlist[i].availsize = n; free(buf); return(0); } static int NEAR readfat(devp) devstat *devp; { long size; int duperrno; duperrno = errno; size = (long)(devp -> fatsize) * (long)(devp -> sectsize); if (size > MAXFATMEM) devp -> fatbuf = NULL; else if ((devp -> fatbuf = (char *)malloc(size)) && sectread(devp, devp -> fatofs, (u_char *)(devp -> fatbuf), devp -> fatsize) < 0L) { doserrno = errno; free(devp -> fatbuf); errno = duperrno; return(-1); } errno = duperrno; return(0); } static int NEAR writefat(devp) CONST devstat *devp; { char *buf; long i; int n; n = 0; buf = devp -> fatbuf; for (i = 0; i < maxdev; i++) { if (devlist[i].drive != devp -> drive) continue; n |= devlist[i].flags & F_WRFAT; if (!buf) buf = devlist[i].fatbuf; devlist[i].flags &= ~F_WRFAT; } if (!n || !buf) return(0); for (i = devp -> fatofs; i < devp -> dirofs; i += devp -> fatsize) if (sectwrite(devp, i, (u_char *)buf, devp -> fatsize) < 0L) return(-1); return(0); } static long NEAR getfatofs(devp, clust) CONST devstat *devp; long clust; { long ofs, bit; if (!clust) clust = devp -> rootdir; bit = (devp -> flags & F_FAT32) ? 8 : ((devp -> flags & F_16BIT) ? 4 : 3); ofs = (clust * bit) / 2; if (ofs < bit || ofs >= (long)(devp -> fatsize) * (long)(devp -> sectsize)) { doserrno = EIO; return(-1L); } return(ofs); } static u_char *NEAR readtmpfat(devp, ofs, nsect) CONST devstat *devp; long ofs; int nsect; { u_char *buf; int duperrno; duperrno = errno; if (!(buf = (u_char *)malloc((devp -> sectsize) * nsect))) { doserrno = errno; errno = duperrno; return(NULL); } ofs /= (devp -> sectsize); if (sectread(devp, (u_long)(devp -> fatofs) + ofs, buf, nsect) < 0L) { free(buf); return(NULL); } return(buf); } static long NEAR getfatent(devp, clust) CONST devstat *devp; long clust; { u_char *fatp, *buf; long ofs; int nsect; if ((ofs = getfatofs(devp, clust)) < 0L) return(-1L); if ((devp -> fatbuf)) { buf = NULL; fatp = (u_char *)&(devp -> fatbuf[ofs]); } else { nsect = 1; if (!(devp -> flags & (F_16BIT | F_FAT32)) && (ofs % devp -> sectsize) >= devp -> sectsize - 1) nsect = 2; if (!(buf = readtmpfat(devp, ofs, nsect))) return(-1L); fatp = buf + (ofs % (devp -> sectsize)); } if (devp -> flags & F_FAT32) { ofs = (*fatp & 0xff) + ((u_long)(*(fatp + 1) & 0xff) << 8) + ((u_long)(*(fatp + 2) & 0xff) << 16) + ((u_long)(*(fatp + 3) & 0xff) << 24); if (ofs >= (u_long)0x0ffffff8) ofs = ENDCLUST; } else if (devp -> flags & F_16BIT) { ofs = (*fatp & 0xff) + ((long)(*(fatp + 1) & 0xff) << 8); if (ofs >= 0x0fff8) ofs = ENDCLUST; else if (ofs == 0x0fff7) ofs = ERRCLUST; } else { if (clust % 2) ofs = (((*fatp) & 0xf0) >> 4) + ((long)(*(fatp + 1) & 0xff) << 4); else ofs = (*fatp & 0xff) + ((long)(*(fatp + 1) & 0x0f) << 8); if (ofs >= 0x0ff8) ofs = ENDCLUST; else if (ofs == 0x0ff7) ofs = ERRCLUST; } if (buf) free(buf); return(ofs); } static int NEAR putfatent(devp, clust, n) devstat *devp; long clust, n; { u_char *fatp, *buf; u_long avail; long l, ofs; int i, old, nsect; if ((ofs = getfatofs(devp, clust)) < 0L) return(-1); if ((devp -> fatbuf)) { buf = NULL; #ifdef FAKEUNINIT nsect = 0; /* fake for -Wuninitialized */ #endif fatp = (u_char *)&(devp -> fatbuf[ofs]); } else { nsect = 1; if (!(devp -> flags & (F_16BIT | F_FAT32)) && (ofs % devp -> sectsize) >= devp -> sectsize - 1) nsect = 2; if (!(buf = readtmpfat(devp, ofs, nsect))) return(-1); fatp = buf + (ofs % (devp -> sectsize)); } if (devp -> flags & F_FAT32) { old = (*fatp || *(fatp + 1) || *(fatp + 2) || *(fatp + 3)); *fatp = n & 0xff; *(fatp + 1) = (n >> 8) & 0xff; *(fatp + 2) = (n >> 16) & 0xff; *(fatp + 3) = (n >> 24) & 0xff; } else if (devp -> flags & F_16BIT) { old = (*fatp || *(fatp + 1)); *fatp = n & 0xff; *(fatp + 1) = (n >> 8) & 0xff; } else if (clust % 2) { old = ((*fatp & 0xf0) || *(fatp + 1)); *fatp &= 0x0f; *fatp |= (n << 4) & 0xf0; *(fatp + 1) = (n >> 4) & 0xff; } else { old = (*fatp || (*(fatp + 1) & 0x0f)); *fatp = n & 0xff; *(fatp + 1) &= 0xf0; *(fatp + 1) |= (n >> 8) & 0x0f; } if (!buf) devp -> flags |= F_WRFAT; else { for (l = devp -> fatofs; l < devp -> dirofs; l += devp -> fatsize) { if (sectwrite(devp, l + (ofs / (devp -> sectsize)), buf, nsect) < 0L) { free(buf); return(-1); } } free(buf); } if (devp -> availsize != (u_long)0xffffffff) { avail = devp -> availsize; if (!n && old) avail++; else if (n && !old && avail) avail--; if (avail != devp -> availsize) for (i = 0; i < maxdev; i++) if (devlist[i].drive == devp -> drive) devlist[i].availsize = avail; } return(0); } static u_long NEAR clust2sect(devp, clust) CONST devstat *devp; long clust; { u_long sect; if (devp -> flags & F_FAT32) { if (!clust) clust = devp -> rootdir; } else if (!clust || clust >= ROOTCLUST) { sect = (clust) ? clust - ROOTCLUST : devp -> dirofs; if (sect >= devp -> dirofs + (u_long)(devp -> dirsize)) { doserrno = 0; return((u_long)0); } return(sect); } if (clust == ENDCLUST) { doserrno = 0; return((u_long)0); } if (clust == ERRCLUST) { doserrno = EIO; return((u_long)0); } sect = ((clust - MINCLUST) * (u_long)(devp -> clustsize)) + (devp -> dirofs + (u_long)(devp -> dirsize)); return(sect); } static long NEAR clust32(devp, dentp) CONST devstat *devp; CONST dent_t *dentp; { long clust; clust = (long)byte2word(dentp -> clust); if (devp -> flags & F_FAT32) clust += (long)byte2word(dentp -> clust_h) << 16; return(clust); } static long NEAR newclust(devp) CONST devstat *devp; { long clust, used; for (clust = MINCLUST; (used = getfatent(devp, clust)) >= 0L; clust++) if (!used) break; if (used < 0 || clust > devp -> totalsize) { doserrno = ENOSPC; return(-1L); } return(clust); } static long NEAR clustread(devp, buf, clust) CONST devstat *devp; u_char *buf; long clust; { u_long sect; long next; if (!(sect = clust2sect(devp, clust))) return(-1L); if (!(devp -> flags & F_FAT32) && sect < devp -> dirofs + (u_long)(devp -> dirsize)) next = ROOTCLUST + sect + (long)(devp -> clustsize); else next = getfatent(devp, clust); if (buf && sectread(devp, sect, buf, devp -> clustsize) < 0L) return(-1L); return(next); } static long NEAR clustwrite(devp, buf, prev) devstat *devp; CONST u_char *buf; long prev; { u_long sect; long clust; if ((clust = newclust(devp)) < 0L) return(-1L); if (!(sect = clust2sect(devp, clust))) { doserrno = EIO; return(-1L); } if (buf && sectwrite(devp, sect, buf, devp -> clustsize) < 0L) return(-1L); if ((prev && putfatent(devp, prev, clust) < 0) || putfatent(devp, clust, ENDCLUST) < 0) return(-1L); return(clust); } static long NEAR clustexpand(devp, clust, fill) devstat *devp; long clust; int fill; { u_char *buf; long n, new, size; int duperrno; if (!fill) buf = NULL; else { duperrno = errno; size = (long)(devp -> clustsize) * (long)(devp -> sectsize); if (!(buf = (u_char *)malloc(size))) { doserrno = errno; errno = duperrno; return(-1L); } for (n = 0; n < size; n++) buf[n] = 0; } new = clustwrite(devp, buf, clust); if (buf) free(buf); return(new); } static int NEAR clustfree(devp, clust) devstat *devp; long clust; { long next; if (clust) for (;;) { next = getfatent(devp, clust); if (next < 0L || putfatent(devp, clust, 0) < 0) return(-1); if (next == ENDCLUST || next == ERRCLUST) break; clust = next; } return(0); } #if MSDOS static int NEAR readbpb(devp, drv) devstat *devp; int drv; #else static int NEAR _readbpb(devp, bpbcache) devstat *devp; CONST bpb_t *bpbcache; #endif { #if !MSDOS int i, cc, fd, nh, ns, nsect; #endif #ifdef LINUX struct stat st1, st2; mnt_t *mntp, mnt; FILE *fp; #endif CONST bpb_t *bpb; char *buf; long total; int duperrno; duperrno = errno; #if MSDOS if (!(buf = (char *)malloc(MAXSECTSIZE))) { doserrno = errno; errno = duperrno; return(-1); } bpb = (bpb_t *)buf; if (rawdiskio(drv, 0, (u_char *)buf, 1, MAXSECTSIZE, 0) < 0) { doserrno = errno; free(buf); errno = duperrno; return(-1); } memset((char *)devp, 0, sizeof(*devp)); devp -> drive = drv; #else /* !MSDOS */ buf = NULL; if (!(devp -> ch_head) || !(nsect = devp -> ch_sect)) return(0); # ifdef HDDMOUNT if (!(devp -> ch_cyl)); else # endif if (nsect <= 100) devp -> flags &= ~F_8SECT; else { nsect %= 100; devp -> flags |= F_8SECT; } if (bpbcache -> nfat) bpb = bpbcache; else { devp -> fd = -1; i = (O_BINARY | O_RDWR); # ifdef HDDMOUNT if (!(devp -> ch_cyl) && Xtoupper(devp -> ch_head) != 'W') { i = (O_BINARY | O_RDONLY); devp -> flags |= F_RONLY; } # endif # ifdef LINUX if (i != (O_BINARY | O_RDWR)) /*EMPTY*/; else if (stat(devp -> ch_name, &st1) < 0) { doserrno = errno; errno = duperrno; return(-1); } else if ((fp = Xsetmntent(MOUNTED, "r"))) { # ifdef FAKEUNINIT mntp = &mnt; # endif while ((mntp = Xgetmntent(fp, &mnt))) { # if 1 if (Xhasmntopt(mntp, "ro")) continue; # endif if (stat(mntp -> Xmnt_fsname, &st2) < 0) continue; if (st1.st_ino == st2.st_ino) { i = (O_BINARY | O_RDONLY); devp -> flags |= F_RONLY; break; } } Xendmntent(fp); } # endif /* LINUX */ if ((fd = open(devp -> ch_name, i, 0666)) < 0) { # ifdef EFORMAT if (errno == EFORMAT) { errno = duperrno; return(0); } # endif if (errno == EIO) errno = ENODEV; if ((errno != EROFS && errno != EACCES) || i == (O_BINARY | O_RDONLY) || (fd = open(devp -> ch_name, O_BINARY | O_RDONLY, 0666)) < 0) { doserrno = errno; errno = duperrno; return(-1); } devp -> flags |= F_RONLY; } # if defined (LINUX) && defined (BLKFLSBUF) VOID_C ioctl(fd, BLKFLSBUF, 0); # endif cc = 0; for (i = 0; i < SLISTSIZ; i++) if (cc < sectsizelist[i]) cc = sectsizelist[i]; if (!(buf = (char *)malloc(cc))) { VOID_C close(fd); doserrno = errno; errno = duperrno; return(-1); } for (i = 0; i < SLISTSIZ; i++) { # ifdef HDDMOUNT if (Xllseek(fd, devp -> offset, L_SET) < (l_off_t)0) # else if (Xllseek(fd, (l_off_t)0, L_SET) < (l_off_t)0) # endif { i = SLISTSIZ; break; } while ((cc = read(fd, buf, sectsizelist[i])) < 0) { if (dosintrfunc && (*dosintrfunc)()) { VOID_C close(fd); doserrno = EINTR; errno = duperrno; return(-1); } if (errno != EINTR) break; } if (cc >= 0) break; } if (i >= SLISTSIZ) { VOID_C close(fd); free(buf); errno = duperrno; return(0); } bpb = (bpb_t *)buf; devp -> fd = newdup(fd); } #endif /* !MSDOS */ total = byte2word(bpb -> total); if (!total) total = byte2dword(bpb -> bigtotal); #if !MSDOS # ifdef HDDMOUNT if (devp -> ch_cyl) # endif { nh = byte2word(bpb -> nhead); ns = byte2word(bpb -> secttrack); if (!nh || !ns || nh != devp -> ch_head || ns != nsect || (total + (nh * ns / 2)) / (nh * ns) != devp -> ch_cyl) { if (bpb != bpbcache) memcpy((char *)bpbcache, (char *)bpb, sizeof(*bpbcache)); if (buf) free(buf); errno = duperrno; return(0); } } #endif /* !MSDOS */ devp -> clustsize = bpb -> clustsize; devp -> sectsize = byte2word(bpb -> sectsize); if (!(devp -> clustsize) || !(devp -> sectsize)) { if (buf) free(buf); errno = duperrno; return(-1); } devp -> fatofs = byte2word(bpb -> bootsect); devp -> fatsize = byte2word(bpb -> fatsize); devp -> dirsize = (u_long)byte2word(bpb -> maxdir) * DOSDIRENT / (u_long)(devp -> sectsize); if (devp -> fatsize && devp -> dirsize) devp -> rootdir = 0L; else { if (!(devp -> fatsize)) devp -> fatsize = byte2dword(bpb -> bigfatsize); devp -> dirsize = 0; devp -> rootdir = byte2dword(bpb -> rootdir); devp -> flags |= F_FAT32; } devp -> dirofs = devp -> fatofs + (devp -> fatsize * bpb -> nfat); total -= devp -> dirofs + (u_long)(devp -> dirsize); devp -> totalsize = total / (devp -> clustsize); devp -> availsize = (u_long)0xffffffff; if (!(devp -> flags & F_FAT32)) { if (!strsizecmp(bpb -> fsname, FS_FAT) || !strsizecmp(bpb -> fsname, FS_FAT12)) devp -> flags &= ~F_16BIT; else if (!strsizecmp(bpb -> fsname, FS_FAT16) || devp -> totalsize > MAX12BIT) devp -> flags |= F_16BIT; } if (buf) free(buf); errno = duperrno; return(1); } #if !MSDOS static int NEAR readbpb(devp, drv) devstat *devp; int drv; { bpb_t bpb; CONST char *cp; int i, n; cp = NULL; devp -> fd = -1; for (i = 0; i < maxfdtype; i++) { if (drv != (int)fdtype[i].drive) continue; if (!cp || strcmp(cp, fdtype[i].name)) { bpb.nfat = 0; if ((devp -> fd) >= 0) VOID_C close(devp -> fd); memset((char *)devp, 0, sizeof(*devp)); devp -> fd = -1; } memcpy((char *)devp, (char *)&(fdtype[i]), sizeof(*fdtype)); cp = fdtype[i].name; if ((n = _readbpb(devp, &bpb)) < 0) return(-1); if (n > 0) break; } if (i >= maxfdtype) { if ((devp -> fd) >= 0) VOID_C close(devp -> fd); doserrno = ENODEV; return(-1); } return(0); } #endif /* !MSDOS */ #ifdef HDDMOUNT # ifdef DIOCGDINFO static l_off_t *NEAR _readpt(offset, extoffset, fd, head, sect, secsiz) l_off_t offset, extoffset; int fd, head, sect, secsiz; { partition_t *pt; partition98_t *pt98; u_char *cp, *buf; l_off_t ofs, *sp, *tmp, *slice; int i, n, nslice, pofs, ps, pn, beg, siz; if (head) { ps = PART98_SIZE; pofs = PART98_TABLE; pn = PART98_NUM; } else { ps = PART_SIZE; pofs = PART_TABLE; pn = PART_NUM; } beg = (pofs / DEV_BSIZE) * DEV_BSIZE; siz = ((pofs + ps * pn - 1) / DEV_BSIZE + 1) * DEV_BSIZE - beg; if (!(slice = (l_off_t *)malloc(2 * sizeof(l_off_t)))) return(NULL); slice[nslice = 0] = (l_off_t)secsiz; slice[++nslice] = (l_off_t)0; if (Xllseek(fd, offset + beg, L_SET) < (l_off_t)0) return(slice); if (!(buf = (u_char *)malloc(siz))) { free(slice); return(NULL); } while ((i = read(fd, buf, siz)) < 0 && errno == EINTR) /*EMPTY*/; if (i < 0 || (!head && (buf[siz - 2] != 0x55 || buf[siz - 1] != 0xaa))) { free(buf); return(slice); } cp = &(buf[pofs - beg]); for (i = 0; i < pn; i++, cp += ps) { if (head) { pt98 = (partition98_t *)cp; if (pt98 -> filesys != PT98_FAT12 && pt98 -> filesys != PT98_FAT16 && pt98 -> filesys != PT98_FAT16X && pt98 -> filesys != PT98_FAT32) continue; ofs = byte2word(pt98 -> s_cyl); ofs = ofs * head + pt98 -> s_head; ofs = ofs * sect + pt98 -> s_sect; ofs *= secsiz; } else { pt = (partition_t *)cp; ofs = byte2dword(pt -> f_sect); ofs *= secsiz; if (pt -> filesys == PTAT_EXTEND || pt -> filesys == PTAT_EXTENDLBA) { if (extoffset) ofs += extoffset; else extoffset = ofs; sp = _readpt(ofs, extoffset, fd, 0, 0, secsiz); if (!sp) { free(buf); free(slice); return(NULL); } for (n = 0; sp[n + 1]; n++) /*EMPTY*/; if (!n) { free(sp); continue; } siz = (nslice + n + 1) * sizeof(l_off_t); if (!(tmp = (l_off_t *)realloc(slice, siz))) { free(buf); free(slice); free(sp); return(NULL); } slice = tmp; memcpy((char *)&(slice[nslice]), (char *)&(sp[1]), n * sizeof(l_off_t)); slice[nslice += n] = (l_off_t)0; free(sp); continue; } else if (pt -> filesys != PTAT_FAT12 && pt -> filesys != PTAT_FAT16 && pt -> filesys != PTAT_FAT16X && pt -> filesys != PTAT_FAT32 && pt -> filesys != PTAT_FAT32LBA && pt -> filesys != PTAT_FAT16XLBA) continue; ofs += offset; } siz = (nslice + 1 + 1) * sizeof(l_off_t); if (!(tmp = (l_off_t *)realloc(slice, siz))) { free(buf); free(slice); return(NULL); } slice = tmp; slice[nslice++] = ofs; slice[nslice] = (l_off_t)0; } free(buf); return(slice); } # endif /* DIOCGDINFO */ l_off_t *readpt(devfile, pc98) CONST char *devfile; int pc98; { # ifdef DIOCGDINFO struct disklabel dl; l_off_t *slice; int fd, head, sect, size; # endif # ifdef SOLARIS struct vtoc toc; # endif # ifdef DIOCGDINFO if ((fd = open(devfile, O_BINARY | O_RDONLY, 0666)) < 0) { if (errno == EIO) errno = ENODEV; return(NULL); } /* hack for disk initialize */ read(fd, &head, sizeof(head)); head = sect = 0; if (ioctl(fd, DIOCGDINFO, &dl) < 0) { VOID_C close(fd); return(NULL); } if (pc98) { head = dl.d_ntracks; sect = dl.d_nsectors; } # ifdef SOLARIS { if (ioctl(fd, DKIOCGVTOC, &toc) < 0) { VOID_C close(fd); return(NULL); } size = toc.v_sectorsz; } # else size = D_SECSIZE(dl); # endif slice = _readpt((l_off_t)0, (l_off_t)0, fd, head, sect, size); VOID_C close(fd); return(slice); # else /* !DIOCGDINFO */ errno = ENODEV; return(NULL); # endif /* !DIOCGDINFO */ } #endif /* HDDMOUNT */ static int NEAR _dosopendev(drive) int drive; { devstat dev; int i, new, drv; if (!drive) { doserrno = ENODEV; return(-1); } for (new = 0; new < maxdev; new++) if (!(devlist[new].drive)) break; if (new >= DOSNOFILE || maxorder >= DOSNOFILE) { doserrno = EMFILE; return(-1); } drv = Xtoupper(drive); for (i = maxorder - 1; i >= 0; i--) if (drv == (int)devlist[devorder[i]].drive) break; if (i >= 0) { memcpy((char *)&dev, (char *)&(devlist[devorder[i]]), sizeof(dev)); dev.flags |= F_DUPL; dev.flags &= ~(F_CACHE | F_WRFAT); } else { if (readbpb(&dev, drv) < 0) return(-1); dev.dircache = NULL; if (readfat(&dev) < 0) { #if !MSDOS VOID_C close(dev.fd); #endif return(-1); } } if (Xislower(drive)) dev.flags |= F_LFN; else dev.flags &= ~F_LFN; memcpy((char *)&(devlist[new]), (char *)&dev, sizeof(*devlist)); devlist[new].nlink = 1; if (new >= maxdev) maxdev++; devorder[maxorder++] = new; return(new); } static int NEAR _dosclosedev(dd) int dd; { int i, n, duperrno; if (dd < 0 || dd >= maxdev || !devlist[dd].drive) { doserrno = EBADF; return(-1); } if (devlist[dd].nlink > 0) devlist[dd].nlink--; if (devlist[dd].nlink > 0) return(0); duperrno = errno; n = 0; if (!(devlist[dd].flags & F_DUPL)) { for (i = 0; i < maxdev; i++) if (i != dd && devlist[i].drive == devlist[dd].drive && (devlist[i].flags & F_DUPL)) break; if (i < maxdev) { devlist[i].flags &= ~F_DUPL; if ((devlist[dd].flags & F_CACHE) && !(devlist[i].flags & F_CACHE)) { devlist[i].dircache = devlist[dd].dircache; devlist[i].flags |= F_CACHE; devlist[dd].flags &= ~F_CACHE; } devlist[i].flags |= (devlist[dd].flags & F_WRFAT); devlist[dd].flags |= F_DUPL; devlist[dd].flags &= ~F_WRFAT; } } if (writefat(&(devlist[dd])) < 0) n = -1; if (devlist[dd].flags & F_CACHE) free(devlist[dd].dircache); if (devlist[dd].flags & F_DUPL) flushcache(&(devlist[dd])); else { for (i = maxsectcache - 1; i >= 0; i -= cachesize[i]) { if (cachedrive[i] == devlist[dd].drive && shiftcache(&(devlist[dd]), i, -1) > SECTCACHESIZE) n = -1; } if (devlist[dd].fatbuf) free(devlist[dd].fatbuf); #if !MSDOS VOID_C close(devlist[dd].fd); #endif } for (i = maxorder - 1; i >= 0; i--) if (devorder[i] == dd) break; if (i >= 0) memmove((char *)&(devorder[i]), (char *)&(devorder[i + 1]), (--maxorder - i) * sizeof(*devorder)); devlist[dd].drive = '\0'; while (maxdev > 0 && !devlist[maxdev - 1].drive) maxdev--; errno = duperrno; return(n); } int dosopendev(drive) int drive; { int i, drv; drv = Xtoupper(drive); for (i = maxdev - 1; i >= 0; i--) if (drv == (int)devlist[i].drive) break; if (i >= 0) { devlist[i].nlink++; return(i); } if (doswaitfunc) (*doswaitfunc)(); if ((i = _dosopendev(drive)) < 0) return(seterrno(doserrno)); return(i); } VOID dosclosedev(dd) int dd; { int duperrno; duperrno = errno; VOID_C _dosclosedev(dd); errno = duperrno; } int flushdrv(drive, func) int drive; VOID_T (*func)__P_((VOID_A)); { devstat dev; u_long avail; int i, n, dd, drv, duperrno; drv = Xtoupper(drive); duperrno = errno; n = 0; dd = -1; for (i = maxorder - 1; i >= 0; i--) { if (drv != (int)devlist[devorder[i]].drive) continue; if (writefat(&(devlist[devorder[i]])) < 0) { duperrno = doserrno; n = -1; } if (!(devlist[devorder[i]].flags & F_DUPL)) dd = devorder[i]; if (devlist[devorder[i]].flags & F_CACHE) { free(devlist[devorder[i]].dircache); devlist[devorder[i]].dircache = NULL; devlist[devorder[i]].flags &= ~F_CACHE; } } if (dd < 0) { if (func) (*func)(); errno = duperrno; return(n); } for (i = maxsectcache - 1; i >= 0; i -= cachesize[i]) { if (drv != cachedrive[i]) continue; if (shiftcache(&(devlist[dd]), i, -1) > SECTCACHESIZE) { duperrno = doserrno; n = -1; } } if (devlist[dd].fatbuf) free(devlist[dd].fatbuf); if (devlist[dd].dircache) free(devlist[dd].dircache); avail = devlist[dd].availsize; #if !MSDOS VOID_C close(devlist[dd].fd); #endif if (func) (*func)(); #if !MSDOS sync(); sync(); #endif if (readbpb(&dev, drv) < 0) { duperrno = doserrno; n = -1; } else { dev.dircache = NULL; dev.availsize = avail; if (readfat(&dev) < 0) { #if !MSDOS VOID_C close(dev.fd); #endif return(-1); } } if (Xislower(drive)) dev.flags |= F_LFN; else dev.flags &= ~F_LFN; memcpy((char *)&(devlist[dd]), (char *)&dev, sizeof(*devlist)); errno = duperrno; return(n); } static int NEAR calcsum(name) CONST u_char *name; { int i, sum; for (i = sum = 0; i < 8 + 3; i++) { sum = (((sum & 0x01) << 7) | ((sum & 0xfe) >> 1)); sum += name[i]; } return(sum & 0xff); } static u_int NEAR lfnencode(c1, c2) u_int c1, c2; { c1 &= 0xff; c2 &= 0xff; #if MSDOS if (!c1 && (c2 < ' ' || Xstrchr(NOTINLFN, c2))) return(0xffff); #else if (!c1 && (c2 < ' ' || Xstrchr(NOTINLFN, c2))) return('_'); #endif return(cnvunicode((c1 << 8) | c2, 1)); } static u_int NEAR lfndecode(c1, c2) u_int c1, c2; { c1 &= 0xff; c2 &= 0xff; return(cnvunicode((c1 << 8) | c2, 0)); } #if !MSDOS static int NEAR transchar(c) int c; { if (c == '+') return('`'); if (c == ',') return('\''); if (c == '[') return('&'); if (c == '.') return('$'); return('\0'); } static int NEAR detranschar(c) int c; { if (c == '`') return('+'); if (c == '\'') return(','); if (c == '&') return('['); if (c == '$') return('.'); return('\0'); } #endif /* !MSDOS */ static int NEAR sfntranschar(c) int c; { if ((u_char)c < ' ' || Xstrchr(NOTINLFN, c)) return(-2); if (Xstrchr(NOTINALIAS, c)) return(-1); if (Xstrchr(PACKINALIAS, c)) return(0); return(Xtoupper(c)); } static int NEAR cmpdospath(path1, path2, len, part) CONST char *path1, *path2; int len, part; { CONST char *cp; u_int w1, w2; int i, c1, c2; if (len < 0) len = strlen(path1); if ((cp = strrdelim(path1, 1))) cp++; else cp = path1; if (!isdotdir(cp)) while (len > 0 && Xstrchr(PACKINALIAS, path1[len - 1])) len--; for (i = 0; i < len; i++) { c1 = (u_char)(path1[i]); c2 = (u_char)(path2[i]); if (!issjis1(c1) || !issjis2(c2)) { if (!c1 || !c2 || Xtoupper(c1) != Xtoupper(c2)) return(c1 - c2); } else { if (++i >= len) return(-path2[i]); if (!path1[i] || !path2[i]) return(path1[i] - path2[i]); w1 = unifysjis((c1 << 8) | (u_char)(path1[i]), 0); w2 = unifysjis((c2 << 8) | (u_char)(path2[i]), 0); if (w1 != w2) return(w1 - w2); } } if (!path2[i]) return(0); else if (part && path2[i] == _SC_) return(0); return(-path2[i]); } static char *NEAR getdosname(buf, name, ext) char *buf; CONST u_char *name, *ext; { int i, len; for (i = 0; i < 8 && name[i] != ' '; i++) buf[i] = name[i]; len = i; if (*ext != ' ') { buf[len++] = '.'; for (i = 0; i < 3 && ext[i] != ' '; i++) buf[len + i] = ext[i]; len += i; } buf[len] = '\0'; if (buf[0] == 0x05) ((u_char *)buf)[0] = 0xe5; return(buf); } static u_char *NEAR putdosname(buf, file, vol) u_char *buf; CONST char *file; int vol; { CONST char *cp, *eol; char num[7]; u_int w; int i, j, c, cnv; if (isdotdir(file)) { Xstrcpy((char *)buf, file); return(buf); } for (i = strlen(file); i > 0; i--) if (!Xstrchr(PACKINALIAS, file[i - 1])) break; if (i <= 0) return(NULL); eol = &(file[i]); for (cp = eol - 1; cp > file; cp--) if (*cp == '.') break; if (cp <= file) cp = NULL; cnv = 0; for (i = 0; i < 8; i++) { if (file == cp || file == eol || !*file) buf[i] = ' '; else if (iswsjis(file, 0)) { w = ((u_int)(*file) << 8) | (u_char)(file[1]); w = unifysjis(w, vol); buf[i++] = (w >> 8) & 0xff; buf[i] = w & 0xff; file += 2; } #if !MSDOS else if (!vol && (c = transchar(*file)) > 0) { buf[i] = c; file++; } #endif else { if ((c = sfntranschar(*(file++))) > 0) buf[i] = c; #if MSDOS else if (c < -1) { dependdosfunc = 1; return(NULL); } #endif else { cnv = 1; if (!c) i--; else buf[i] = '_'; } } } if (file != cp && file < eol && *file) cnv = 1; if (cp) cp++; for (i = 8; i < 11; i++) { if (!cp || cp == eol || !*cp) buf[i] = ' '; else if (iswsjis(cp, 0)) { buf[i++] = *((u_char *)(cp++)); buf[i] = *((u_char *)(cp++)); } #if !MSDOS else if (!vol && (c = transchar(*cp)) > 0) { buf[i] = c; cp++; } #endif else { if ((c = sfntranschar(*(cp++))) > 0) buf[i] = c; #if MSDOS else if (c < -1) { dependdosfunc = 1; return(NULL); } #endif else { cnv = 1; if (!c) i--; else buf[i] = '_'; } } } if (cp && cp < eol && *cp) cnv = 1; buf[i] = '\0'; if (vol > 1 || (vol > 0 && cnv)) { for (j = 0; j < arraysize(num); j++) { if (!vol) break; num[j] = (vol % 10) + '0'; vol /= 10; } for (i = arraysize(num) - j; i > 0; i--) if (buf[i - 1] != ' ') break; buf[i++] = '~'; while (j-- > 0) buf[i++] = num[j]; } if (buf[0] == 0xe5) buf[0] = 0x05; return(buf); } static int NEAR putdostime(buf, t) u_char *buf; time_t t; { time_t mt; u_short date, time; int sec, isnow; mt = (time_t)0; isnow = 0; if (t == (time_t)-1) { t = Xtime(&mt); isnow++; } sec = getdostime(&date, &time, t); if (isnow) { if (!time) time = 0x0001; mt += (sec & 0x01) * 1000L; } buf[0] = time & 0xff; buf[1] = (time >> 8) & 0xff; buf[2] = date & 0xff; buf[3] = (date >> 8) & 0xff; return((int)mt); } static int NEAR getdrive(path) CONST char *path; { int i, drive; if (!(drive = __dospath(path))) { doserrno = ENOENT; return(-1); } if (lastdrive < 0) { for (i = 0; i < 'Z' - 'A' + 1; i++) curdir[i] = NULL; lastdrive = drive; } return(drive); } static char *NEAR addpath(buf, ptr, path, len) char *buf; int ptr; CONST char *path; int len; { char *cp; cp = &(buf[ptr]); if (len && path[len - 1] == '.') len--; if (ptr + 1 + len >= DOSMAXPATHLEN - 2 - 1) { doserrno = ENAMETOOLONG; return(NULL); } *(cp++) = _SC_; memcpy(cp, path, len); cp += len; return(cp); } static int NEAR parsepath(buf, path, class) char *buf; CONST char *path; int class; { char *cp; int i, drv, drive; cp = buf; if ((drive = getdrive(path)) < 0) return(-1); drv = Xtoupper(drive) - 'A'; path += 2; #if MSDOS if (*path != '/' && *path != '\\') { *buf = _SC_; if (checkdrive(drv) <= 0) { if (!unixgetcurdir(&(buf[1]), drv + 1)) buf[1] = '\0'; } else if (curdir[drv]) Xstrcpy(&(buf[1]), curdir[drv]); else *buf = '\0'; #else if (*path != '/' && *path != '\\' && curdir[drv] && *(curdir[drv])) { *buf = _SC_; Xstrcpy(&(buf[1]), curdir[drv]); #endif cp += strlen(buf); } while (*path) { for (i = 0; path[i] && path[i] != '/' && path[i] != '\\'; i++) if (iswsjis(path, i)) i++; if (class && !path[i]) { if ((i == 1 && path[0] == '.') || (i == 2 && path[0] == '.' && path[1] == '.')) { *(cp++) = _SC_; memcpy(cp, path, i); cp += i; } else if (!(cp = addpath(buf, cp - buf, path, i))) return(-1); } else if (!i || (i == 1 && path[0] == '.')) /*EMPTY*/; else if (i == 2 && path[0] == '.' && path[1] == '.') { cp = strrdelim2(buf, 0, cp); if (!cp) cp = buf; } else if (!(cp = addpath(buf, cp - buf, path, i))) return(-1); if (*(path += i)) path++; } if (cp == buf) *(cp++) = _SC_; else if (isdelim(buf, cp - 1 - buf)) cp--; *cp = '\0'; return(drive); } static dosDIR *NEAR _dosopendir(path, resolved, needlfn) CONST char *path; char *resolved; int needlfn; { dosDIR *xdirp; struct dosdirent *dp; dent_t *dentp; cache_t *cache; CONST char *cp; char *cachepath, name[8 + 1 + 3 + 1], buf[DOSMAXPATHLEN - 2]; int len, dd, drive, flen, rlen, duperrno; rlen = 0; duperrno = errno; if ((drive = parsepath(buf, path, 0)) < 0 || (dd = _dosopendev(drive)) < 0) return(NULL); path = buf + 1; if (!devlist[dd].dircache) { cache = NULL; cp = NULL; } else { cache = devlist[dd].dircache; cp = cache -> path; } if (!(devlist[dd].dircache = (cache_t *)malloc(sizeof(cache_t)))) { dosclosedev(dd); doserrno = errno; errno = duperrno; return(NULL); } devlist[dd].flags |= F_CACHE; cachepath = dd2path(dd); if (!(xdirp = (dosDIR *)malloc(sizeof(dosDIR)))) { dosclosedev(dd); doserrno = errno; errno = duperrno; return(NULL); } xdirp -> dd_id = DID_IFDOSDRIVE; xdirp -> dd_fd = dd; xdirp -> dd_top = xdirp -> dd_off = 0L; xdirp -> dd_loc = 0L; xdirp -> dd_size = (long)(devlist[dd].clustsize) * (long)(devlist[dd].sectsize); if (!(xdirp -> dd_buf = (char *)malloc(xdirp -> dd_size))) { VOID_C _dosclosedir(xdirp); doserrno = errno; errno = duperrno; return(NULL); } if (resolved) rlen = gendospath(resolved, drive, _SC_) - resolved; if (cp && (len = strlen(cp)) > 0) { if (isdelim(cp, len - 1)) len--; if (!cmpdospath(cp, path, len, 1)) { xdirp -> dd_top = xdirp -> dd_off = clust32(&(devlist[dd]), &(cache -> dent)); memcpy((char *)devlist[dd].dircache, (char *)cache, sizeof(*cache)); cachepath += len; *(cachepath++) = _SC_; path += len; if (*path) path++; if (resolved) { if (rlen > 3) resolved[rlen++] = _SC_; memcpy(&(resolved[rlen]), cp, len); rlen += len; resolved[rlen] = '\0'; } } } *cachepath = '\0'; while (*path) { cp = path; if ((path = strdelim(path, 0))) len = (path++) - cp; else { len = strlen(cp); path = cp + len; } if (!len || (len == 1 && *cp == '.')) continue; if (!(dp = finddirent(xdirp, cp, len, needlfn))) { errno = (doserrno) ? doserrno : ENOENT; VOID_C _dosclosedir(xdirp); doserrno = errno; errno = duperrno; return(NULL); } if (resolved) { if (needlfn) cp = dp -> d_name; else { getdosname(name, dd2dentp(xdirp -> dd_fd) -> name, dd2dentp(xdirp -> dd_fd) -> ext); cp = name; } flen = strlen(cp); if (rlen + 1 + flen >= DOSMAXPATHLEN) { VOID_C _dosclosedir(xdirp); doserrno = ENAMETOOLONG; errno = duperrno; return(NULL); } if (rlen > 3) resolved[rlen++] = _SC_; Xstrcpy(&(resolved[rlen]), cp); rlen += flen; } dentp = (dent_t *)&(xdirp -> dd_buf[dp -> d_fileno]); xdirp -> dd_top = xdirp -> dd_off = clust32(&(devlist[dd]), dentp); xdirp -> dd_loc = 0L; cachepath += len; *(cachepath++) = _SC_; *cachepath = '\0'; } if (*(dd2path(dd)) && !(dd2dentp(dd) -> attr & DS_IFDIR)) { VOID_C _dosclosedir(xdirp); doserrno = ENOTDIR; errno = duperrno; return(NULL); } errno = duperrno; return(xdirp); } static int NEAR _dosclosedir(xdirp) dosDIR *xdirp; { int n, duperrno; duperrno = errno; if (xdirp -> dd_id != DID_IFDOSDRIVE) return(0); if (xdirp -> dd_buf) free(xdirp -> dd_buf); n = _dosclosedev(xdirp -> dd_fd); free(xdirp); errno = duperrno; return(n); } DIR *dosopendir(path) CONST char *path; { dosDIR *xdirp; if (!(xdirp = _dosopendir(path, NULL, 0))) { errno = doserrno; return(NULL); } return((DIR *)xdirp); } int dosclosedir(dirp) DIR *dirp; { if (_dosclosedir((dosDIR *)dirp) < 0) return(seterrno(doserrno)); return(0); } static int NEAR seekdent(xdirp, dentp, clust, offset) dosDIR *xdirp; dent_t *dentp; long clust, offset; { long next; if (xdirp -> dd_id != DID_IFDOSDRIVE) { doserrno = EINVAL; return(-1); } xdirp -> dd_off = clust; next = clustread(&(devlist[xdirp -> dd_fd]), (u_char *)(xdirp -> dd_buf), xdirp -> dd_off); if (next < 0L) return(-1); dd2clust(xdirp -> dd_fd) = xdirp -> dd_off; xdirp -> dd_off = next; dd2offset(xdirp -> dd_fd) = xdirp -> dd_loc = offset; if (dentp) memcpy((char *)dentp, (char *)&(xdirp -> dd_buf[xdirp -> dd_loc]), sizeof(*dentp)); xdirp -> dd_loc += DOSDIRENT; if (xdirp -> dd_loc >= xdirp -> dd_size) xdirp -> dd_loc = 0L; return(0); } static int NEAR readdent(xdirp, dentp, force) dosDIR *xdirp; dent_t *dentp; int force; { long next; if (xdirp -> dd_id != DID_IFDOSDRIVE) { doserrno = EINVAL; return(-1); } if (!xdirp -> dd_loc) { next = clustread(&(devlist[xdirp -> dd_fd]), (u_char *)(xdirp -> dd_buf), xdirp -> dd_off); if (next < 0L) return(-1); dd2clust(xdirp -> dd_fd) = xdirp -> dd_off; xdirp -> dd_off = next; } dd2offset(xdirp -> dd_fd) = xdirp -> dd_loc; memcpy((char *)dentp, (char *)&(xdirp -> dd_buf[xdirp -> dd_loc]), sizeof(*dentp)); if (force || dentp -> name[0]) { xdirp -> dd_loc += DOSDIRENT; if (xdirp -> dd_loc >= xdirp -> dd_size) xdirp -> dd_loc = 0L; } return(0); } static struct dosdirent *NEAR _dosreaddir(xdirp, all) dosDIR *xdirp; int all; { dent_t *dentp; static st_dosdirent d; struct dosdirent *dp; char *cp, buf[LFNENTSIZ * 2 + 1]; long loc, clust, offset; u_int ch; int i, j, cnt, sum; dp = (struct dosdirent *)&d; dentp = dd2dentp(xdirp -> dd_fd); dp -> d_name[0] = '\0'; dp -> d_reclen = DOSDIRENT; cnt = -1; clust = -1; offset = 0L; sum = -1; for (;;) { loc = xdirp -> dd_loc; if (readdent(xdirp, dentp, 0) < 0 || !(dentp -> name[0])) { *dd2path(xdirp -> dd_fd) = '\0'; doserrno = 0; cnvunicode(0, -1); return(NULL); } if (dentp -> name[0] == 0xe5) { dp -> d_name[0] = '\0'; dp -> d_reclen = DOSDIRENT; cnt = -1; continue; } if (dentp -> attr != DS_IFLFN) break; cp = (char *)dentp; if (cnt > 0 && cnt == *cp + 1 && sum == dentp -> checksum) cnt--; else { dp -> d_name[0] = '\0'; dp -> d_reclen = DOSDIRENT; if ((cnt = *cp - '@') < 0) continue; lfn_clust = dd2clust(xdirp -> dd_fd); lfn_offset = dd2offset(xdirp -> dd_fd); sum = dentp -> checksum; } if (!(devlist[xdirp -> dd_fd].flags & F_LFN)) continue; dp -> d_reclen += DOSDIRENT; for (i = 1, j = 0; i < DOSDIRENT; i += 2, j++) { if (cp + i == (char *)&(dentp -> attr)) i += 3; else if (cp + i == (char *)(dentp -> clust)) i += 2; if (!(ch = lfndecode(cp[i + 1], cp[i]))) break; if (ch & 0xff00) buf[j++] = (ch >> 8) & 0xff; buf[j] = ch & 0xff; } i = strlen(dp -> d_name); if (i + j > MAXNAMLEN && (j = MAXNAMLEN - i) < 0) j = 0; buf[j] = '\0'; if (j > 0) { memmove(&(dp -> d_name[j]), dp -> d_name, strlen(dp -> d_name) + 1); memcpy(dp -> d_name, buf, j); } clust = xdirp -> dd_off; offset = xdirp -> dd_loc; } dp -> d_fileno = loc; if (cnt != 1) dp -> d_name[0] = '\0'; else if (sum != calcsum(dd2dentp(xdirp -> dd_fd) -> name)) { cnt = -1; dp -> d_name[0] = '\0'; } if (cnt <= 0) lfn_clust = -1; if (!dp -> d_name[0]) { getdosname(dp -> d_name, dd2dentp(xdirp -> dd_fd) -> name, dd2dentp(xdirp -> dd_fd) -> ext); #if MSDOS dp -> d_alias[0] = '\0'; #endif } else { #if MSDOS getdosname(dp -> d_alias, dd2dentp(xdirp -> dd_fd) -> name, dd2dentp(xdirp -> dd_fd) -> ext); #endif if (all) { xdirp -> dd_off = clust; xdirp -> dd_loc = offset; } } if ((cp = strrdelim(dd2path(xdirp -> dd_fd), 0))) cp++; else cp = dd2path(xdirp -> dd_fd); Xstrcpy(cp, dp -> d_name); cnvunicode(0, -1); return(dp); } struct dosdirent *dosreaddir(dirp) DIR *dirp; { dosDIR *xdirp; struct dosdirent *dp; int i; #if !MSDOS int c; #endif xdirp = (dosDIR *)dirp; if (!(dp = _dosreaddir(xdirp, 0))) { errno = doserrno; return(NULL); } if (!(devlist[xdirp -> dd_fd].flags & F_LFN)) { for (i = 0; dp -> d_name[i]; i++) { if (iswsjis(dp -> d_name, i)) i++; #if !MSDOS else if ((c = detranschar(dp -> d_name[i]))) dp -> d_name[i] = c; else dp -> d_name[i] = Xtolower(dp -> d_name[i]); #endif } } return(dp); } static struct dosdirent *NEAR finddirent(xdirp, fname, len, needlfn) dosDIR *xdirp; CONST char *fname; int len, needlfn; { struct dosdirent *dp; u_char dosname[8 + 3 + 1]; char tmp[8 + 1 + 3 + 1]; if (len <= 0) len = strlen(fname); if (devlist[xdirp -> dd_fd].flags & F_LFN) { if (needlfn) while ((dp = _dosreaddir(xdirp, 1))) { getdosname(tmp, dd2dentp(xdirp -> dd_fd) -> name, dd2dentp(xdirp -> dd_fd) -> ext); if (!cmpdospath(fname, tmp, len, 0) || !cmpdospath(fname, dp -> d_name, len, 0)) return(dp); } else while ((dp = _dosreaddir(xdirp, 1))) if (!cmpdospath(fname, dp -> d_name, len, 0)) return(dp); } else { if (!putdosname(dosname, fname, 0)) { doserrno = ENOENT; return(NULL); } getdosname(tmp, dosname, dosname + 8); while ((dp = _dosreaddir(xdirp, 1))) if (!cmpdospath(tmp, dp -> d_name, len, 0)) return(dp); } return(NULL); } int dosrewinddir(dirp) DIR *dirp; { dosDIR *xdirp; xdirp = (dosDIR *)dirp; if (xdirp -> dd_id != DID_IFDOSDRIVE) return(seterrno(EINVAL)); xdirp -> dd_loc = 0L; xdirp -> dd_off = xdirp -> dd_top; return(0); } int doschdir(path) CONST char *path; { dosDIR *xdirp; char *tmp, buf[DOSMAXPATHLEN]; int drv, drive, needlfn; if ((drive = getdrive(path)) < 0) return(seterrno(doserrno)); drv = Xtoupper(drive); needlfn = Xislower(drive); if (!(xdirp = _dosopendir(path, buf, needlfn))) { if (path[2] == '/' || path[2] == '\\' || !(tmp = curdir[drv - 'A'])) return(seterrno(doserrno)); curdir[drv - 'A'] = NULL; xdirp = _dosopendir(path, buf, needlfn); curdir[drv - 'A'] = tmp; if (!xdirp) return(seterrno(doserrno)); } VOID_C _dosclosedir(xdirp); if (!buf[2]) buf[3] = '\0'; if (!(tmp = (char *)malloc(strlen(&(buf[3])) + 1))) return(-1); if (curdir[drv - 'A']) free(curdir[drv - 'A']); curdir[drv - 'A'] = tmp; Xstrcpy(curdir[drv - 'A'], &(buf[3])); lastdrive = drive; return(0); } char *dosgetcwd(pathname, size) char *pathname; int size; { char *cp; int i; if (!pathname && !(pathname = (char *)malloc(size))) return(NULL); i = Xtoupper(lastdrive) - 'A'; if (lastdrive < 0) { errno = EFAULT; return(NULL); } if (!(cp = curdir[i])) { errno = EFAULT; return(NULL); } if (strlen(cp) + 3 > size) { errno = ERANGE; return(NULL); } Xstrcpy(gendospath(pathname, lastdrive, _SC_), cp); return(pathname); } static dosDIR *NEAR splitpath(pathp, resolved, needlfn) CONST char **pathp; char *resolved; int needlfn; { char dir[DOSMAXPATHLEN]; int i, j; Xstrcpy(dir, *pathp); for (i = 1, j = 2; dir[j]; j++) { if (iswsjis(dir, j)) j++; else if (dir[j] == '/' || dir[j] == '\\') i = j; } *pathp += i + 1; if (i < 3) dir[i++] = _SC_; dir[i] = '\0'; if (i <= 3 && isdotdir(*pathp)) { doserrno = ENOENT; return(NULL); } return(_dosopendir(dir, resolved, needlfn)); } static int NEAR getdent(path, ddp) CONST char *path; int *ddp; { dosDIR *xdirp; char buf[DOSMAXPATHLEN]; int dd, drive, duperrno; if (ddp) *ddp = -1; if ((drive = parsepath(&(buf[2]), path, 1)) < 0 || (dd = _dosopendev(drive)) < 0) return(-1); if (devlist[dd].dircache && buf[2] && buf[3] && !cmpdospath(dd2path(dd), &(buf[3]), -1, 0)) return(dd); buf[0] = drive; buf[1] = ':'; duperrno = errno; path = buf; if (!(xdirp = splitpath(&path, NULL, 0))) { errno = (doserrno) ? doserrno : ENOTDIR; dosclosedev(dd); doserrno = errno; errno = duperrno; return(-1); } if (!(devlist[dd].dircache = (cache_t *)malloc(sizeof(cache_t)))) { VOID_C _dosclosedir(xdirp); dosclosedev(dd); doserrno = errno; errno = duperrno; return(-1); } devlist[dd].flags |= F_CACHE; memcpy((char *)(devlist[dd].dircache), (char *)(devlist[xdirp -> dd_fd].dircache), sizeof(cache_t)); if (!*path || (isdotdir(path) && path <= &(buf[4]))) { VOID_C _dosclosedir(xdirp); dd2dentp(dd) -> attr |= DS_IFDIR; errno = duperrno; return(dd); } if (!finddirent(xdirp, path, 0, 0)) { errno = (doserrno) ? doserrno : ENOENT; VOID_C _dosclosedir(xdirp); if (ddp && !doserrno) *ddp = dd; else dosclosedev(dd); doserrno = errno; errno = duperrno; return(-1); } memcpy((char *)(devlist[dd].dircache), (char *)(devlist[xdirp -> dd_fd].dircache), sizeof(cache_t)); VOID_C _dosclosedir(xdirp); errno = duperrno; return(dd); } static int NEAR writedent(dd) int dd; { u_char *buf; u_long sect; long offset; int n; if (!(sect = clust2sect(&(devlist[dd]), dd2clust(dd)))) { doserrno = EIO; return(-1); } offset = dd2offset(dd); while (offset >= (long)(devlist[dd].sectsize)) { sect++; offset -= (long)(devlist[dd].sectsize); } if (!(buf = (u_char *)malloc(devlist[dd].sectsize))) return(-1); n = 0; if (sectread(&(devlist[dd]), sect, buf, 1) < 0L) n = -1; else { memcpy((char *)&(buf[offset]), (char *)dd2dentp(dd), sizeof(dent_t)); if (sectwrite(&(devlist[dd]), sect, buf, 1) < 0L) n = -1; } free(buf); return(n); } static int NEAR expanddent(dd) int dd; { long prev; prev = dd2clust(dd); if (!(devlist[dd].flags & F_FAT32) && (!prev || prev >= ROOTCLUST)) { doserrno = ENOSPC; return(-1); } if ((dd2clust(dd) = clustexpand(&(devlist[dd]), prev, 1)) < 0L) return(-1); memset((char *)dd2dentp(dd), 0, sizeof(dent_t)); dd2offset(dd) = 0L; return(0); } static int NEAR creatdent(path, mode) CONST char *path; int mode; { dosDIR *xdirp; dent_t *dentp; u_char *cp, fname[8 + 3 + 1], longfname[DOSMAXNAMLEN + 1]; CONST char *file; char tmp[8 + 1 + 3 + 1], buf[DOSMAXPATHLEN]; long clust, offset; u_int c; int i, j, n, len, cnt, sum, lfn; if ((n = parsepath(&(buf[2]), path, 1)) < 0) return(-1); buf[0] = n; buf[1] = ':'; file = buf; if (!(xdirp = splitpath(&file, NULL, 0))) { if (doserrno == ENOENT) doserrno = ENOTDIR; return(-1); } if (!*file) { VOID_C _dosclosedir(xdirp); doserrno = EEXIST; return(-1); } if (isdotdir(file)) { VOID_C _dosclosedir(xdirp); doserrno = EACCES; return(-1); } if (!(devlist[xdirp -> dd_fd].flags & F_LFN)) { lfn = 0; n = 0; cnt = 1; len = 0; } else { lfn = 1; n = -1; for (i = j = 0; file[i]; i++, j += 2) { if (!Xstrchr(PACKINALIAS, file[i])) n = -1; else if (n < 0) n = i; if (!iswsjis(file, i)) c = lfnencode(0, file[i]); else { c = lfnencode(file[i], file[i + 1]); lfn = 2; i++; } longfname[j] = c & 0xff; longfname[j + 1] = (c >> 8) & 0xff; } cnvunicode(0, -1); if (n >= 0) j = n * 2; n = 1; cnt = j / (LFNENTSIZ * 2); len = j; if (j > cnt * LFNENTSIZ * 2) { longfname[j] = longfname[j + 1] = '\0'; len += 2; cnt++; } cnt++; } sum = -1; dentp = dd2dentp(xdirp -> dd_fd); if (!putdosname(fname, file, n)) { VOID_C _dosclosedir(xdirp); doserrno = EACCES; return(-1); } for (i = 0; i < INHIBITNAMESIZ; i++) if (!strncmp((char *)fname, inhibitname[i], 8)) break; if (i < INHIBITNAMESIZ || (!strncmp((char *)fname, INHIBITCOM, strsize(INHIBITCOM)) && fname[strsize(INHIBITCOM)] > '0' && fname[strsize(INHIBITCOM)] <= '0' + INHIBITCOMMAX && fname[strsize(INHIBITCOM) + 1] == ' ') || (!strncmp((char *)fname, INHIBITLPT, strsize(INHIBITLPT)) && fname[strsize(INHIBITLPT)] > '0' && fname[strsize(INHIBITLPT)] <= '0' + INHIBITLPTMAX && fname[strsize(INHIBITLPT) + 1] == ' ')) { VOID_C _dosclosedir(xdirp); doserrno = EINVAL; return(-1); } if (lfn == 1 && !strcmp(getdosname(tmp, fname, fname + 8), file)) { lfn = 0; cnt = 1; } if (lfn) sum = calcsum(fname); i = j = 0; clust = -1; offset = 0L; for (;;) { if (readdent(xdirp, dentp, 1) < 0) { if (clust >= 0) break; if (doserrno || expanddent(xdirp -> dd_fd) < 0) { *dd2path(xdirp -> dd_fd) = '\0'; VOID_C _dosclosedir(xdirp); return(-1); } clust = dd2clust(xdirp -> dd_fd); offset = 0L; break; } if (!(dentp -> name[0])) break; if (dentp -> name[0] == 0xe5) { i++; if (clust < 0) { clust = dd2clust(xdirp -> dd_fd); offset = dd2offset(xdirp -> dd_fd); } continue; } if (j < i) j = i; if (j < cnt) clust = -1; i = 0; if (dentp -> attr == DS_IFLFN) continue; if (!strncmp((char *)(dentp -> name), (char *)fname, 8 + 3)) { if (!n) { *dd2path(xdirp -> dd_fd) = '\0'; VOID_C _dosclosedir(xdirp); doserrno = EEXIST; return(-1); } n++; if (!putdosname(fname, file, n)) { *dd2path(xdirp -> dd_fd) = '\0'; VOID_C _dosclosedir(xdirp); doserrno = EACCES; return(-1); } sum = calcsum(fname); i = j = 0; clust = -1; dosrewinddir((DIR *)xdirp); } } if (clust >= 0 && seekdent(xdirp, NULL, clust, offset) < 0) { *dd2path(xdirp -> dd_fd) = '\0'; VOID_C _dosclosedir(xdirp); return(-1); } cp = (u_char *)dentp; while (--cnt > 0) { memset((char *)dentp, 0, sizeof(*dentp)); cp[0] = cnt; n = (cnt - 1) * (LFNENTSIZ * 2); if (n + (LFNENTSIZ * 2) >= len) cp[0] += '@'; dentp -> checksum = sum; dentp -> attr = DS_IFLFN; for (i = 1, j = 0; i < DOSDIRENT; i += 2, j += 2) { if (cp + i == (u_char *)&(dentp -> attr)) i += 3; else if (cp + i == (u_char *)(dentp -> clust)) i += 2; if (n + j >= len) cp[i] = cp[i + 1] = 0xff; else { cp[i] = longfname[n + j]; cp[i + 1] = longfname[n + j + 1]; } } if (writedent(xdirp -> dd_fd) < 0 || (readdent(xdirp, dentp, 1) < 0 && (doserrno || expanddent(xdirp -> dd_fd) < 0))) { *dd2path(xdirp -> dd_fd) = '\0'; VOID_C _dosclosedir(xdirp); return(-1); } } memset((char *)dentp, 0, sizeof(*dentp)); memcpy(dentp -> name, (char *)fname, 8 + 3); dentp -> attr = getdosmode((u_int)mode) | DS_IARCHIVE; i = putdostime(dentp -> time, (time_t)-1); if (devlist[xdirp -> dd_fd].flags & F_LFN) { dentp -> checksum = i / 10; dentp -> ctime[0] = dentp -> time[0]; dentp -> ctime[1] = dentp -> time[1]; dentp -> cdate[0] = dentp -> adate[0] = dentp -> date[0]; dentp -> cdate[1] = dentp -> adate[1] = dentp -> date[1]; } if (writedent(xdirp -> dd_fd) < 0 || writefat(&(devlist[xdirp -> dd_fd])) < 0) n = -1; else { n = xdirp -> dd_fd; if ((cp = (u_char *)strrdelim(dd2path(n), 0))) cp++; else cp = (u_char *)dd2path(n); Xstrcpy((char *)cp, file); } free(xdirp -> dd_buf); free(xdirp); return(n); } static int NEAR unlinklfn(dd, clust, offset, sum) int dd; long clust, offset; int sum; { dosDIR xdir; long dupclust, dupoffset; if (clust < 0) return(0); dupclust = dd2clust(dd); dupoffset = dd2offset(dd); sum &= 0xff; xdir.dd_id = DID_IFDOSDRIVE; xdir.dd_fd = dd; xdir.dd_loc = 0L; xdir.dd_size = (long)(devlist[dd].clustsize) * (long)(devlist[dd].sectsize); xdir.dd_top = xdir.dd_off = clust; if (!(xdir.dd_buf = (char *)malloc(xdir.dd_size))) return(-1); seekdent(&xdir, dd2dentp(dd), clust, offset); *(dd2dentp(dd) -> name) = 0xe5; writedent(dd); while (readdent(&xdir, dd2dentp(dd), 0) >= 0) { if (!dd2dentp(dd) -> name[0] || dd2dentp(dd) -> name[0] == 0xe5 || (dd2clust(dd) == dupclust && dd2offset(dd) == dupoffset) || dd2dentp(dd) -> attr != 0x0f || dd2dentp(dd) -> checksum != sum) break; *(dd2dentp(dd) -> name) = 0xe5; writedent(dd); } free(xdir.dd_buf); return(0); } #if MSDOS char *dosshortname(path, alias) CONST char *path; char *alias; { dosDIR *xdirp; char *cp, buf[DOSMAXPATHLEN], name[8 + 1 + 3 + 1]; int dd, drive; name[0] = '\0'; if ((drive = parsepath(&(buf[2]), path, 1)) < 0 || (dd = _dosopendev(drive)) < 0) { errno = doserrno; return(NULL); } if (devlist[dd].dircache && buf[2] && buf[3] && !cmpdospath(dd2path(dd), &(buf[3]), -1, 0)) getdosname(name, dd2dentp(dd) -> name, dd2dentp(dd) -> ext); buf[0] = drive; buf[1] = ':'; path = buf; *alias = '\0'; if (!(xdirp = splitpath(&path, alias, 0))) { errno = (doserrno) ? doserrno : ENOTDIR; dosclosedev(dd); return(NULL); } cp = strcatdelim(alias); if (!*path); else if (*name) Xstrcpy(cp, name); else if (isdotdir(path)) Xstrcpy(cp, path); else if (finddirent(xdirp, path, 0, 0)) getdosname(cp, dd2dentp(xdirp -> dd_fd) -> name, dd2dentp(xdirp -> dd_fd) -> ext); else { errno = (doserrno) ? doserrno : ENOENT; alias = NULL; } VOID_C _dosclosedir(xdirp); dosclosedev(dd); return(alias); } char *doslongname(path, resolved) CONST char *path; char *resolved; { dosDIR *xdirp; struct dosdirent *dp; char *cp, buf[DOSMAXPATHLEN]; int dd, drive; if ((drive = parsepath(&(buf[2]), path, 1)) < 0 || (dd = _dosopendev(drive)) < 0) { errno = doserrno; return(NULL); } buf[0] = drive; buf[1] = ':'; path = buf; *resolved = '\0'; if (!(xdirp = splitpath(&path, resolved, 1))) { errno = (doserrno) ? doserrno : ENOTDIR; dosclosedev(dd); return(NULL); } cp = strcatdelim(resolved); if (!*path); else if ((dp = finddirent(xdirp, path, 0, 1))) Xstrcpy(cp, dp -> d_name); else { errno = (doserrno) ? doserrno : ENOENT; resolved = NULL; } VOID_C _dosclosedir(xdirp); dosclosedev(dd); return(resolved); } #endif /* MSDOS */ int dosstatfs(drive, buf) int drive; char *buf; { long block, total, avail; int dd; if ((dd = _dosopendev(drive)) < 0) return(seterrno(doserrno)); block = (long)(devlist[dd].clustsize) * (long)(devlist[dd].sectsize); total = (long)(devlist[dd].totalsize); if (availfat(&(devlist[dd])) < 0) { dosclosedev(dd); return(seterrno(doserrno)); } avail = (long)(devlist[dd].availsize); *((long *)&(buf[0 * sizeof(long)])) = block; *((long *)&(buf[1 * sizeof(long)])) = total; *((long *)&(buf[2 * sizeof(long)])) = avail; buf[3 * sizeof(long)] = 0; if (devlist[dd].flags & F_FAT32) buf[3 * sizeof(long)] |= 001; dosclosedev(dd); return(0); } int dosstat(path, stp) CONST char *path; struct stat *stp; { char *cp; int dd; if ((dd = getdent(path, NULL)) < 0) return(seterrno(doserrno)); stp -> st_dev = dd; stp -> st_ino = clust32(&(devlist[dd]), dd2dentp(dd)); stp -> st_mode = getunixmode(dd2dentp(dd) -> attr); stp -> st_nlink = 1; stp -> st_uid = (uid_t)-1; stp -> st_gid = (gid_t)-1; stp -> st_size = byte2dword(dd2dentp(dd) -> size); stp -> st_atime = stp -> st_mtime = stp -> st_ctime = getunixtime(byte2word(dd2dentp(dd) -> date), byte2word(dd2dentp(dd) -> time)); #if !MSDOS && defined (UF_SETTABLE) && defined (SF_SETTABLE) stp -> st_flags = (u_long)0; #endif dosclosedev(dd); if ((stp -> st_mode & S_IFMT) != S_IFDIR && (cp = Xstrrchr(path, '.')) && strlen(++cp) == 3) { if (!Xstrcasecmp(cp, EXTCOM) || !Xstrcasecmp(cp, EXTEXE) || !Xstrcasecmp(cp, EXTBAT)) stp -> st_mode |= S_IEXEC_ALL; } return(0); } int doslstat(path, stp) CONST char *path; struct stat *stp; { return(dosstat(path, stp)); } int dosaccess(path, mode) CONST char *path; int mode; { struct stat st; char buf[DOSMAXPATHLEN - 2]; int dd, drive; if (dosstat(path, &st) < 0) { if (errno != ENOENT) return(-1); if ((drive = parsepath(buf, path, 1)) < 0 || (dd = _dosopendev(drive)) < 0) return(seterrno(ENOENT)); dosclosedev(dd); if (*buf != _SC_ || isdotdir(&(buf[1])) != 2) return(seterrno(ENOENT)); st.st_dev = dd; st.st_mode = (S_IFDIR | S_IRUSR | S_IWUSR | S_IXUSR); } if (((mode & R_OK) && !(st.st_mode & S_IRUSR)) || ((mode & W_OK) && (!(st.st_mode & S_IWUSR) || (devlist[st.st_dev].flags & F_RONLY))) || ((mode & X_OK) && !(st.st_mode & S_IXUSR))) return(seterrno(EACCES)); return(0); } #ifndef NOSYMLINK /*ARGSUSED*/ int dossymlink(name1, name2) CONST char *name1, *name2; { return(seterrno(EACCES)); } /*ARGSUSED*/ int dosreadlink(path, buf, bufsiz) CONST char *path; char *buf; int bufsiz; { return(seterrno(EINVAL)); } #endif /* !NOSYMLINK */ int doschmod(path, mode) CONST char *path; int mode; { int n, dd; if ((dd = getdent(path, NULL)) < 0) return(seterrno(doserrno)); dd2dentp(dd) -> attr = getdosmode((u_int)mode); if ((n = writedent(dd)) < 0) errno = doserrno; dosclosedev(dd); return(n); } int dosutimes(path, utp) CONST char *path; CONST struct utimes_t *utp; { time_t t; int n, dd; t = utp -> modtime; if ((dd = getdent(path, NULL)) < 0) return(seterrno(doserrno)); VOID_C putdostime(dd2dentp(dd) -> time, t); if ((n = writedent(dd)) < 0) errno = doserrno; dosclosedev(dd); return(n); } int dosunlink(path) CONST char *path; { int n, dd, sum; if ((dd = getdent(path, NULL)) < 0) return(seterrno(doserrno)); if (dd2dentp(dd) -> attr & DS_IFDIR) return(seterrno(EPERM)); sum = calcsum(dd2dentp(dd) -> name); *(dd2dentp(dd) -> name) = 0xe5; *dd2path(dd) = '\0'; n = 0; if (writedent(dd) < 0 || clustfree(&(devlist[dd]), clust32(&(devlist[dd]), dd2dentp(dd))) < 0 || unlinklfn(dd, lfn_clust, lfn_offset, sum) < 0 || writefat(&(devlist[dd])) < 0) { errno = doserrno; n = -1; } dosclosedev(dd); return(n); } int dosrename(from, to) CONST char *from, *to; { char buf[DOSMAXPATHLEN]; long clust, rmclust, offset; int i, n, dd, fd, sum; if ((i = parsepath(buf, to, 0)) < 0) return(seterrno(doserrno)); if (Xtoupper(i) != Xtoupper(getdrive(from))) return(seterrno(EXDEV)); if ((dd = getdent(from, NULL)) < 0) return(seterrno(doserrno)); clust = lfn_clust; offset = lfn_offset; i = strlen(dd2path(dd)); if (buf[0] && buf[1] && !cmpdospath(dd2path(dd), &(buf[1]), i, 1)) { dosclosedev(dd); return(seterrno(EINVAL)); } if (*(dd2dentp(dd) -> name) == '.') { dosclosedev(dd); return(seterrno(EACCES)); } if ((fd = dosopen(to, O_BINARY | O_RDWR | O_CREAT, 0666)) < 0) { dosclosedev(dd); return(-1); } fd -= DOSFDOFFSET; rmclust = clust32(fd2devp(fd), fd2dentp(fd)); sum = calcsum(dd2dentp(dd) -> name); memcpy((char *)&(fd2dentp(fd) -> attr), (char *)&(dd2dentp(dd) -> attr), (int)sizeof(dent_t) - (8 + 3)); *(dd2dentp(dd) -> name) = 0xe5; *dd2path(dd) = '\0'; free(dosflist[fd]._base); dosflist[fd]._base = NULL; while (maxdosf > 0 && !dosflist[maxdosf - 1]._base) maxdosf--; fd2clust(fd) = dosflist[fd]._clust; fd2offset(fd) = dosflist[fd]._offset; n = 0; if (writedent(dosflist[fd]._file) < 0 || writedent(dd) < 0 || unlinklfn(dd, clust, offset, sum) < 0 || (rmclust && clustfree(&(devlist[dd]), rmclust) < 0) || writefat(&(devlist[dd])) < 0) { errno = doserrno; n = -1; } dosclosedev(dosflist[fd]._file); dosclosedev(dd); return(n); } int dosopen(path, flags, mode) CONST char *path; int flags, mode; { int fd, dd, tmp; for (fd = 0; fd < maxdosf; fd++) if (!dosflist[fd]._base) break; if (fd >= DOSNOFILE) return(seterrno(EMFILE)); if ((dd = getdent(path, &tmp)) < 0) { if (doserrno != ENOENT || tmp < 0 || !(flags & O_CREAT) || (dd = creatdent(path, mode & 0777)) < 0) { errno = doserrno; if (tmp >= 0) dosclosedev(tmp); return(-1); } else { if (!(devlist[tmp].flags & F_DUPL)) devlist[dd].flags &= ~F_DUPL; devlist[tmp].flags |= F_DUPL; dosclosedev(tmp); } } else if ((flags & O_CREAT) && (flags & O_EXCL)) { dosclosedev(dd); return(seterrno(EEXIST)); } if ((flags & O_ACCMODE) != O_RDONLY) { tmp = 0; if (devlist[dd].flags & F_RONLY) tmp = EROFS; else if (dd2dentp(dd) -> attr & DS_IFDIR) tmp = EISDIR; if (tmp) { errno = tmp; dosclosedev(dd); return(-1); } } if (flags & O_TRUNC) { if ((flags & O_ACCMODE) != O_RDONLY && clustfree(&(devlist[dd]), clust32(&(devlist[dd]), dd2dentp(dd))) < 0) { errno = doserrno; dosclosedev(dd); return(-1); } dd2dentp(dd) -> size[0] = dd2dentp(dd) -> size[1] = dd2dentp(dd) -> size[2] = dd2dentp(dd) -> size[3] = 0; dd2dentp(dd) -> clust[0] = dd2dentp(dd) -> clust[1] = dd2dentp(dd) -> clust_h[0] = dd2dentp(dd) -> clust_h[1] = 0; } dosflist[fd]._base = (char *)malloc((long)(devlist[dd].clustsize) * (long)(devlist[dd].sectsize)); if (!dosflist[fd]._base) { dosclosedev(dd); return(-1); } dosflist[fd]._cnt = 0L; dosflist[fd]._ptr = dosflist[fd]._base; dosflist[fd]._bufsize = (long)(devlist[dd].clustsize) * (long)(devlist[dd].sectsize); dosflist[fd]._flag = flags; dosflist[fd]._file = dd; dosflist[fd]._top = dosflist[fd]._next = clust32(&(devlist[dd]), dd2dentp(dd)); dosflist[fd]._off = 0L; dosflist[fd]._loc = (off_t)0; dosflist[fd]._size = (off_t)byte2dword(dd2dentp(dd) -> size); memcpy((char *)&(dosflist[fd]._dent), (char *)dd2dentp(dd), sizeof(dent_t)); dosflist[fd]._clust = dd2clust(dd); dosflist[fd]._offset = dd2offset(dd); if (fd >= maxdosf) maxdosf = fd + 1; if ((flags & O_ACCMODE) != O_RDONLY && (flags & O_APPEND)) doslseek(fd + DOSFDOFFSET, (off_t)0, L_XTND); return(fd + DOSFDOFFSET); } int dosclose(fd) int fd; { int n; fd -= DOSFDOFFSET; if (fd < 0 || fd >= maxdosf || !dosflist[fd]._base) return(seterrno(EBADF)); free(dosflist[fd]._base); dosflist[fd]._base = NULL; while (maxdosf > 0 && !dosflist[maxdosf - 1]._base) maxdosf--; n = 0; if ((dosflist[fd]._flag & O_ACCMODE) != O_RDONLY) { dosflist[fd]._dent.size[0] = dosflist[fd]._size & 0xff; dosflist[fd]._dent.size[1] = (dosflist[fd]._size >> 8) & 0xff; dosflist[fd]._dent.size[2] = (dosflist[fd]._size >> 16) & 0xff; dosflist[fd]._dent.size[3] = (dosflist[fd]._size >> 24) & 0xff; if (!(dosflist[fd]._dent.attr & DS_IFDIR)) VOID_C putdostime(dosflist[fd]._dent.time, (time_t)-1); memcpy((char *)fd2dentp(fd), (char *)&(dosflist[fd]._dent), sizeof(dent_t)); fd2clust(fd) = dosflist[fd]._clust; fd2offset(fd) = dosflist[fd]._offset; if (writedent(dosflist[fd]._file) < 0 || writefat(fd2devp(fd)) < 0) { errno = doserrno; n = -1; } } dosclosedev(dosflist[fd]._file); return(n); } static long NEAR dosfilbuf(fd, wrt) int fd, wrt; { long size, new, prev; size = dosflist[fd]._bufsize; if (!wrt && (off_t)size > dosflist[fd]._size - dosflist[fd]._loc) size = dosflist[fd]._size - dosflist[fd]._loc; prev = dosflist[fd]._off; if ((dosflist[fd]._off = dosflist[fd]._next)) dosflist[fd]._next = clustread(fd2devp(fd), (u_char *)(dosflist[fd]._base), dosflist[fd]._next); else { doserrno = 0; dosflist[fd]._next = -1L; } if (dosflist[fd]._next < 0L) { if (doserrno) return(-1L); if (!wrt) return(0L); if ((new = clustexpand(fd2devp(fd), prev, 0)) < 0L) return(-1L); if (!dosflist[fd]._off) { dosflist[fd]._dent.clust[0] = new & 0xff; dosflist[fd]._dent.clust[1] = (new >> 8) & 0xff; if (fd2devp(fd) -> flags & F_FAT32) { dosflist[fd]._dent.clust_h[0] = (new >> 16) & 0xff; dosflist[fd]._dent.clust_h[1] = (new >> 24) & 0xff; } } dosflist[fd]._off = new; dosflist[fd]._next = ENDCLUST; memset(dosflist[fd]._base, 0, dosflist[fd]._bufsize); } dosflist[fd]._cnt = size; dosflist[fd]._ptr = dosflist[fd]._base; return(size); } static long NEAR dosflsbuf(fd) int fd; { u_long sect; long l; if (!(sect = clust2sect(fd2devp(fd), dosflist[fd]._off))) { doserrno = EIO; return(-1L); } l = sectwrite(fd2devp(fd), sect, (u_char *)(dosflist[fd]._base), fd2devp(fd) -> clustsize); if (l < 0L) return(-1L); return(dosflist[fd]._bufsize); } int dosread(fd, buf, nbytes) int fd; char *buf; int nbytes; { long size, total; int wrt; fd -= DOSFDOFFSET; if (fd < 0 || fd >= maxdosf || (buf && (dosflist[fd]._flag & O_ACCMODE) == O_WRONLY)) return(seterrno(EBADF)); wrt = ((dosflist[fd]._flag & O_ACCMODE) != O_RDONLY) ? 1 : 0; total = 0; while (nbytes > 0 && dosflist[fd]._loc < dosflist[fd]._size) { if (dosflist[fd]._cnt <= 0L && dosfilbuf(fd, wrt) < 0L) return(seterrno(doserrno)); if (!(size = dosflist[fd]._cnt)) return(total); if (size > nbytes) size = nbytes; memcpy(buf, dosflist[fd]._ptr, size); buf += size; dosflist[fd]._ptr += size; dosflist[fd]._cnt -= size; dosflist[fd]._loc += size; nbytes -= size; total += size; } return(total); } int doswrite(fd, buf, nbytes) int fd; CONST char *buf; int nbytes; { long size, total; fd -= DOSFDOFFSET; if (fd < 0 || fd >= maxdosf || (dosflist[fd]._flag & O_ACCMODE) == O_RDONLY) return(seterrno(EBADF)); total = 0; while (nbytes > 0) { if (dosflist[fd]._cnt <= 0L && dosfilbuf(fd, 1) < 0L) { #if MSDOS if (doserrno == ENOSPC) return(total); #endif return(seterrno(doserrno)); } size = dosflist[fd]._cnt; if (size > nbytes) size = nbytes; memcpy(dosflist[fd]._ptr, buf, size); buf += size; dosflist[fd]._ptr += size; if ((dosflist[fd]._cnt -= size) < 0L) dosflist[fd]._cnt = 0L; if ((dosflist[fd]._loc += size) > dosflist[fd]._size) dosflist[fd]._size = dosflist[fd]._loc; nbytes -= size; total += size; if (dosflsbuf(fd) < 0L) return(seterrno(doserrno)); } return(total); } off_t doslseek(fd, offset, whence) int fd; off_t offset; int whence; { long size; int wrt; fd -= DOSFDOFFSET; if (fd < 0 || fd >= maxdosf) return(seterrno(EBADF)); wrt = ((dosflist[fd]._flag & O_ACCMODE) != O_RDONLY) ? 1 : 0; switch (whence) { case L_SET: break; case L_INCR: offset += dosflist[fd]._loc; break; case L_XTND: offset += dosflist[fd]._size; break; default: return(seterrno(EINVAL)); /*NOTREACHED*/ break; } if (offset >= dosflist[fd]._loc) offset -= dosflist[fd]._loc; else { dosflist[fd]._cnt = 0L; dosflist[fd]._ptr = dosflist[fd]._base; dosflist[fd]._loc = (off_t)0; dosflist[fd]._off = 0L; dosflist[fd]._next = dosflist[fd]._top; } while (offset > (off_t)0) { if (!wrt && dosflist[fd]._loc >= dosflist[fd]._size) break; if (dosflist[fd]._cnt <= 0L && dosfilbuf(fd, wrt) < 0L) return(seterrno(doserrno)); if (!(size = dosflist[fd]._cnt)) break; if (size > offset) size = offset; dosflist[fd]._ptr += size; dosflist[fd]._cnt -= size; dosflist[fd]._loc += size; if (dosflist[fd]._size < dosflist[fd]._loc) dosflist[fd]._size = dosflist[fd]._loc; offset -= size; } return(dosflist[fd]._loc); } int dosftruncate(fd, size) int fd; off_t size; { off_t offset; int n; fd -= DOSFDOFFSET; if (fd < 0 || fd >= maxdosf) return(seterrno(EBADF)); if ((dosflist[fd]._flag & O_ACCMODE) == O_RDONLY) return(seterrno(EINVAL)); n = 0; offset = dosflist[fd]._loc; if (doslseek(fd + DOSFDOFFSET, size, L_SET) < (off_t)0) n = -1; else if (dosflist[fd]._next != ENDCLUST) { clustfree(fd2devp(fd), dosflist[fd]._next); dosflist[fd]._next = ENDCLUST; } dosflist[fd]._size = size; doslseek(fd + DOSFDOFFSET, offset, L_SET); return(n); } int dosmkdir(path, mode) CONST char *path; int mode; { dent_t dent[2]; long clust; int fd, tmp; fd = dosopen(path, O_BINARY | O_RDWR | O_CREAT | O_EXCL, mode & 0777); if (fd < 0) return(-1); fd -= DOSFDOFFSET; dosflist[fd]._dent.attr |= DS_IFDIR; dosflist[fd]._dent.attr &= ~DS_IARCHIVE; memcpy((char *)&(dent[0]), (char *)&(dosflist[fd]._dent), sizeof(*dent)); memset(dent[0].name, ' ', 8 + 3); dent[0].name[0] = '.'; if ((clust = newclust(fd2devp(fd))) < 0L) { errno = doserrno; dosflist[fd]._dent.name[0] = 0xe5; *fd2path(fd) = '\0'; VOID_C dosclose(fd + DOSFDOFFSET); return(-1); } dent[0].clust[0] = clust & 0xff; dent[0].clust[1] = (clust >> 8) & 0xff; if (fd2devp(fd) -> flags & F_FAT32) { dent[0].clust_h[0] = (clust >> 16) & 0xff; dent[0].clust_h[1] = (clust >> 24) & 0xff; } memcpy((char *)&(dent[1]), (char *)&(dosflist[fd]._dent), sizeof(*dent)); memset(dent[1].name, ' ', 8 + 3); dent[1].name[0] = dent[1].name[1] = '.'; clust = fd2clust(fd); dent[1].clust[0] = clust & 0xff; dent[1].clust[1] = (clust >> 8) & 0xff; if (fd2devp(fd) -> flags & F_FAT32) { dent[1].clust_h[0] = (clust >> 16) & 0xff; dent[1].clust_h[1] = (clust >> 24) & 0xff; } if (doswrite(fd + DOSFDOFFSET, (char *)dent, 2 * sizeof(*dent)) < 0) { tmp = errno; if ((clust = clust32(fd2devp(fd), &(dosflist[fd]._dent)))) clustfree(fd2devp(fd), clust); dosflist[fd]._dent.name[0] = 0xe5; *fd2path(fd) = '\0'; VOID_C dosclose(fd + DOSFDOFFSET); errno = tmp; return(-1); } dosflist[fd]._size = (off_t)0; VOID_C dosclose(fd + DOSFDOFFSET); return(0); } int dosrmdir(path) CONST char *path; { dosDIR *xdirp; struct dosdirent *dp; cache_t cache; long clust, offset; int n, sum; if (!(xdirp = _dosopendir(path, NULL, 0))) return(seterrno(doserrno)); memcpy((char *)&cache, (char *)(devlist[xdirp -> dd_fd].dircache), sizeof(cache)); clust = lfn_clust; offset = lfn_offset; while ((dp = _dosreaddir(xdirp, 0))) { if (isdotdir(dp -> d_name)) continue; VOID_C _dosclosedir(xdirp); return(seterrno(ENOTEMPTY)); } n = 0; if (doserrno) { errno = doserrno; n = -1; } else { memcpy((char *)(devlist[xdirp -> dd_fd].dircache), (char *)&cache, sizeof(cache)); sum = calcsum(dd2dentp(xdirp -> dd_fd) -> name); *(dd2dentp(xdirp -> dd_fd) -> name) = 0xe5; *dd2path(xdirp -> dd_fd) = '\0'; if (writedent(xdirp -> dd_fd) < 0 || clustfree(&(devlist[xdirp -> dd_fd]), clust32(&(devlist[xdirp -> dd_fd]), dd2dentp(xdirp -> dd_fd))) < 0 || unlinklfn(xdirp -> dd_fd, clust, offset, sum) < 0 || writefat(&(devlist[xdirp -> dd_fd])) < 0) { errno = doserrno; n = -1; } } VOID_C _dosclosedir(xdirp); return(n); } int dosflushbuf(fd) int fd; { fd -= DOSFDOFFSET; if (fd < 0 || fd >= maxdosf || !dosflist[fd]._base) return(seterrno(EBADF)); if (flushcache(&(devlist[dosflist[fd]._file])) < 0) return(seterrno(doserrno)); return(0); } int dosallclose(VOID_A) { int i, n; n = 0; for (i = maxdosf - 1; i >= 0; i--) if (dosflist[i]._base && dosclose(i + DOSFDOFFSET) < 0) n = -1; for (i = maxdev - 1; i >= 0; i--) { if (!(devlist[i].drive)) continue; devlist[i].nlink = 0; if (_dosclosedev(i) < 0) n = seterrno(doserrno); } return(n); } #endif /* !_NODOSDRIVE */ FD-3.01j/unixdisk.c100644 2105 1751 142642 13516612560 12734 0ustar shiraiuser/* * unixdisk.c * * UNIX-like disk accessing module */ #include "headers.h" #include "depend.h" #include "kctype.h" #include "string.h" #include "sysemu.h" #include "pathname.h" #include "dosdisk.h" #include "unixdisk.h" #if MSDOS #include #endif #define KC_SJIS1 0001 #define KC_SJIS2 0002 #define KC_EUCJP 0010 #define int21call(reg, sreg) intcall(0x21, reg, sreg) static char *NEAR duplpath __P_((CONST char *)); #ifndef _NOUSELFN static int NEAR isreserved __P_((CONST char *)); #endif #ifndef _NODOSDRIVE static char *NEAR regpath __P_((CONST char *, char *)); static VOID NEAR biosreset __P_((int)); static int NEAR _biosdiskio __P_((int, int, int, int, u_char *, int, int, int)); #ifndef PC98 static int NEAR xbiosdiskio __P_((int, u_long, u_long, u_char *, int, int, int)); #endif static int NEAR getdrvparam __P_((int, drvinfo *)); static int NEAR _checkdrive __P_((int, int, int, u_long, u_long)); static int NEAR biosdiskio __P_((int, u_long, u_char *, int, int, int)); static int NEAR lockdrive __P_((int)); static int NEAR unlockdrive __P_((int, int)); static int NEAR dosrawdiskio __P_((int, u_long, u_char *, int, int, int)); #endif static int NEAR dos_findfirst __P_((CONST char *, u_int, struct dosfind_t *)); static int NEAR dos_findnext __P_((struct dosfind_t *)); #ifndef _NOUSELFN static int NEAR lfn_findfirst __P_((u_int *, CONST char *, u_int, struct lfnfind_t *)); static int NEAR lfn_findnext __P_((u_int, struct lfnfind_t *)); static int NEAR lfn_findclose __P_((u_int)); #endif #ifndef _NOUSELFN static int NEAR gendosname __P_((char *)); static int NEAR unixrenamedir __P_((CONST char *, CONST char *)); #endif static int NEAR alter_findfirst __P_((CONST char *, u_int *, struct dosfind_t *, struct lfnfind_t *)); #ifndef _NODOSDRIVE static drvinfo drvlist['Z' - 'A' + 1]; static int maxdrive = -1; #endif static int dos7access = 0; #define D7_DOSVER 017 #define D7_CAPITAL 020 #define D7_NTARCH 040 #if !defined (DJGPP) && !defined (_NODOSDRIVE) static u_char int25bin[] = { 0x1e, /* 0000: push ds */ 0x06, /* 0001: push es */ 0x55, /* 0002: push bp */ 0x53, /* 0003: push bx */ 0x51, /* 0004: push cx */ 0x52, /* 0005: push dx */ 0x56, /* 0006: push di */ 0x57, /* 0007: push si */ 0xb8, 0x00, 0x00, /* 0008: mov ax, 0 */ 0x8e, 0xd8, /* 000b: mov ds,ax */ 0xb8, 0x00, 0x00, /* 000d: mov ax, 0 */ 0xbb, 0x00, 0x00, /* 0010: mov bx, 0 */ 0xb9, 0x00, 0x00, /* 0013: mov cx, 0 */ 0xba, 0x00, 0x00, /* 0016: mov dx, 0 */ 0xfb, /* 0019: sti */ 0xcd, 0x25, /* 001a: int 25h */ 0xfa, /* 001c: cli */ 0x5a, /* 001d: pop dx */ 0x5f, /* 001e: pop si */ 0x5e, /* 001f: pop di */ 0x5a, /* 0020: pop dx */ 0x59, /* 0021: pop cx */ 0x5b, /* 0022: pop bx */ 0x5d, /* 0023: pop bp */ 0x07, /* 0024: pop es */ 0x1f, /* 0025: pop ds */ 0x72, 0x02, /* 0026: jb $+2 */ 0x31, 0xc0, /* 0028: xor ax,ax */ 0xcb /* 002a: retf */ }; static int (far *doint25)__P_((VOID_A)) = NULL; #endif /* !DJGPP && !_NODOSDRIVE */ #ifdef DOUBLESLASH static int dsdrive = 0; #endif #ifndef _NOUSELFN static CONST char *inhibitname[] = INHIBITNAME; #define INHIBITNAMESIZ arraysize(inhibitname) #endif static char *NEAR duplpath(path) CONST char *path; { static char buf[MAXPATHLEN]; int i, j, ps, len, type; if (path == buf) return((char *)path); i = j = ps = 0; if ((len = getpathtop(path, NULL, &type))) { memcpy(buf, path, len); i = j = len; } switch (type) { case PT_NONE: case PT_DOS: if (path[i] == _SC_) buf[j++] = path[i++]; break; default: break; } for (; path[i]; i++) { if (path[i] == _SC_) ps = 1; else { if (ps) { ps = 0; buf[j++] = _SC_; } buf[j++] = path[i]; if (iskanji1(path, i)) buf[j++] = path[++i]; } } buf[j] = '\0'; return(buf); } int getcurdrv(VOID_A) { int drive; #ifdef DOUBLESLASH if (dsdrive) return(dsdrive); #endif drive = (dos7access & D7_CAPITAL) ? 'A' : 'a'; #ifndef _NODOSDRIVE if (lastdrive >= 0) drive += Xtoupper(lastdrive) - 'A'; else #endif drive += (bdos(0x19, 0, 0) & 0xff); return(drive); } int setcurdrv(drive, nodir) int drive, nodir; { #ifndef _NODOSDRIVE char tmp[3]; #endif struct SREGS sreg; __dpmi_regs reg; CONST char *path; int drv, olddrv; #ifdef DOUBLESLASH if (drive == '_') { dsdrive = drive; return(0); } dsdrive = '\0'; #endif errno = EINVAL; if (Xislower(drive)) { drv = drive - 'a'; dos7access &= ~D7_CAPITAL; } else { drv = drive - 'A'; dos7access |= D7_CAPITAL; } if (drv < 0) return(-1); #ifndef _NODOSDRIVE if (checkdrive(drv) > 0) { VOID_C gendospath(tmp, drive, '\0'); return(doschdir(tmp)); } #endif olddrv = (bdos(0x19, 0, 0) & 0xff); if ((bdos(0x0e, drv, 0) & 0xff) < drv || (drive = (bdos(0x19, 0, 0) & 0xff)) != drv) { bdos(0x0e, olddrv, 0); dosseterrno(0x0f); /* Invarid drive */ return(-1); } if (!nodir) { path = curpath; reg.x.ax = 0x3b00; #ifdef DJGPP dos_putpath(path, 0); #endif sreg.ds = PTR_SEG(path); reg.x.dx = PTR_OFF(path, 0); if (int21call(®, &sreg) < 0) { drv = errno; bdos(0x0e, olddrv, 0); errno = drv; return(-1); } } #ifndef _NODOSDRIVE lastdrive = drive + 'a'; #endif return(0); } #ifndef _NOUSELFN static int NEAR isreserved(path) CONST char *path; { int i, len; if (strdelim(path, 0)) return(0); len = strlen(path); for (i = 0; i < INHIBITNAMESIZ; i++) { if (strnpathcmp(path, inhibitname[i], len)) continue; if (!inhibitname[i][len] || inhibitname[i][len] == ' ') return(1); } if (!strnpathcmp(path, INHIBITCOM, strsize(INHIBITCOM))) { if (path[strsize(INHIBITCOM)] > '0' && path[strsize(INHIBITCOM)] <= '0' + INHIBITCOMMAX && !path[strsize(INHIBITCOM) + 1]) return(1); } else if (!strnpathcmp(path, INHIBITLPT, strsize(INHIBITLPT))) { if (path[strsize(INHIBITLPT)] > '0' && path[strsize(INHIBITLPT)] <= '0' + INHIBITLPTMAX && !path[strsize(INHIBITLPT) + 1]) return(1); } return(0); } int getdosver(VOID_A) { struct SREGS sreg; __dpmi_regs reg; int ver; if (!(dos7access & D7_DOSVER)) { reg.x.ax = 0x3000; int21call(®, &sreg); ver = reg.h.al; if (reg.x.ax == 0x0005) { reg.x.ax = 0x3306; int21call(®, &sreg); if (reg.h.al != 0xff && reg.x.bx == 0x3205) { /* Windows NT/2000/XP command prompt */ ver = 7; dos7access |= D7_NTARCH; } } dos7access |= (ver & D7_DOSVER); } return(dos7access & D7_DOSVER); } /* * 3: enable LFN access, but shared folder * 2: enable LFN access, but FAT32 * 1: enable LFN access * 0: do SFN access * -1: raw device access * -2: BIOS access * -3: cannot use LFN with any method * -4: illegal drive error */ int supportLFN(path) CONST char *path; { struct SREGS sreg; __dpmi_regs reg; char drive, drv[4], buf[128]; if (!path) drive = 0; # ifdef DOUBLESLASH else if (isdslash(path)) return(3); # endif else drive = _dospath(path); if (!drive) drive = getcurdrv(); # ifdef DOUBLESLASH if (drive == '_') return(3); # endif # ifndef _NODOSDRIVE if (checkdrive(Xtoupper(drive) - 'A') > 0) return(-2); # endif if (getdosver() < 7) { # ifndef _NODOSDRIVE if ((dosdrive & 1) && Xislower(drive)) return(-1); # endif return(-3); } if (Xisupper(drive)) return(0); VOID_C gendospath(drv, drive, _SC_); reg.x.ax = 0x71a0; reg.x.bx = 0; reg.x.cx = sizeof(buf); # ifdef DJGPP dos_putpath(drv, 0); # endif sreg.ds = PTR_SEG(drv); reg.x.dx = PTR_OFF(drv, 0); sreg.es = PTR_SEG(buf); reg.x.di = PTR_OFF(buf, sizeof(drv)); if (int21call(®, &sreg) < 0 || !(reg.x.bx & 0x4000)) { if (reg.x.ax == 15) return(-4); # ifndef _NODOSDRIVE if (dosdrive & 1) return(-1); # endif return(-3); } # ifdef DJGPP dosmemget(__tb + sizeof(drv), sizeof(buf), buf); # endif if (!strcmp(buf, VOL_FAT32)) return(2); return(1); } #endif /* !_NOUSELFN */ char *unixgetcurdir(pathname, drive) char *pathname; int drive; { struct SREGS sreg; __dpmi_regs reg; #ifdef _NOUSELFN reg.x.ax = 0x4700; #else reg.x.ax = (supportLFN(NULL) > 0) ? 0x7147 : 0x4700; #endif reg.h.dl = drive; sreg.ds = PTR_SEG(pathname); reg.x.si = PTR_OFF(pathname, 0); if (int21call(®, &sreg) < 0) return(NULL); #ifdef DJGPP dosmemget(__tb, MAXPATHLEN - 3, pathname); #endif #ifndef BSPATHDELIM adjustpname(pathname); #endif return(pathname); } #ifndef _NOUSELFN # ifndef _NODOSDRIVE static char *NEAR regpath(path, buf) CONST char *path; char *buf; { CONST char *cp; int drive; cp = path; if (!(drive = _dospath(path))) drive = getcurdrv(); else if (*(cp += 2)) return((char *)path); Xstrcpy(gendospath(buf, drive, (*cp) ? '\0' : '.'), cp); return(buf); } # endif /* !_NODOSDRIVE */ char *shortname(path, alias) CONST char *path; char *alias; { # ifndef _NODOSDRIVE char buf[MAXPATHLEN]; # endif struct SREGS sreg; __dpmi_regs reg; int i; path = duplpath(path); if ((i = supportLFN(path)) <= 0) { # ifndef _NODOSDRIVE if (i == -1) { dependdosfunc = 0; if (dosshortname(regpath(path, buf), alias)) return(alias); else if (!dependdosfunc) return(NULL); } # endif /* !_NODOSDRIVE */ return((char *)path); } reg.x.ax = 0x7160; reg.x.cx = 0x8001; # ifdef DJGPP i = dos_putpath(path, 0); # endif sreg.ds = PTR_SEG(path); reg.x.si = PTR_OFF(path, 0); sreg.es = PTR_SEG(alias); reg.x.di = PTR_OFF(alias, i); if (int21call(®, &sreg) < 0) { /* Windows NT/2000/XP cannot support reserved filenames */ if ((dos7access & D7_NTARCH) && isreserved(path)) return((char *)path); return(NULL); } # ifdef DJGPP dosmemget(__tb + i, MAXPATHLEN, alias); # endif # ifndef BSPATHDELIM adjustpname(alias); # endif # ifdef DOUBLESLASH if (isdslash(alias)) return(alias); # endif if (!path || !(i = _dospath(path))) i = getcurdrv(); if (Xislower(i)) *alias = Xtolower(*alias); return(alias); } #endif /* !_NOUSELFN */ char *unixrealpath(path, resolved) CONST char *path; char *resolved; { #ifndef _NODOSDRIVE char buf[MAXPATHLEN]; #endif struct SREGS sreg; __dpmi_regs reg; int i, j; path = duplpath(path); #ifdef _NOUSELFN reg.x.ax = 0x6000; reg.x.cx = 0; #else /* !_NOUSELFN */ switch (supportLFN(path)) { case 3: case 2: case 1: reg.x.ax = 0x7160; reg.x.cx = 0x8002; break; case 0: reg.x.ax = 0x7160; reg.x.cx = 0x8001; break; # ifndef _NODOSDRIVE case -1: case -2: dependdosfunc = 0; if (doslongname(regpath(path, buf), resolved)) return(resolved); else if (!dependdosfunc) { Xstrcpy(resolved, path); return(resolved); } /*FALLTHRU*/ # endif /* !_NODOSDRIVE */ default: reg.x.ax = 0x6000; reg.x.cx = 0; break; } #endif /* !_NOUSELFN */ #ifdef DJGPP i = dos_putpath(path, 0); #endif sreg.ds = PTR_SEG(path); reg.x.si = PTR_OFF(path, 0); sreg.es = PTR_SEG(resolved); reg.x.di = PTR_OFF(resolved, i); if (int21call(®, &sreg) < 0) { /* Windows NT/2000/XP cannot support reserved filenames */ if ((dos7access & D7_NTARCH) && isreserved(path)) { Xstrcpy(resolved, path); return(resolved); } return(NULL); } #ifdef DJGPP dosmemget(__tb + i, MAXPATHLEN, resolved); #endif #ifndef BSPATHDELIM adjustpname(resolved); #endif #ifdef DOUBLESLASH if (isdslash(resolved)) return(resolved); #endif if (!path || !(i = _dospath(path))) i = getcurdrv(); else path += 2; if (!_dospath(resolved) || resolved[2] != _SC_) { if (resolved[0] == _SC_ && resolved[1] == _SC_) { resolved[0] = i; resolved[1] = ':'; i = 2; if (Xisalpha(resolved[2]) && resolved[3] == '.' && resolved[4] == _SC_) i = 5; while (resolved[i]) if (resolved[i++] == _SC_) break; resolved[2] = _SC_; for (j = 0; resolved[i + j]; j++) resolved[j + 3] = resolved[i + j]; resolved[j + 3] = '\0'; } else { VOID_C gendospath(resolved, i, _SC_); if (path && *path == _SC_) Xstrcpy(&(resolved[2]), path); } } else *resolved = (Xisupper(i)) ? Xtoupper(*resolved) : Xtolower(*resolved); return(resolved); } #ifndef BSPATHDELIM char *adjustpname(path) char *path; { int i; for (i = 0; path[i]; i++) { if (path[i] == '\\') path[i] = _SC_; else if (iskanji1(path, i)) i++; } return(path); } #endif /* !BSPATHDELIM */ #if defined (DJGPP) || !defined (BSPATHDELIM) char *adjustfname(path) char *path; { # ifndef _NOUSELFN char tmp[MAXPATHLEN]; # endif int i; # ifndef _NOUSELFN if (supportLFN(path) > 0 && unixrealpath(path, tmp)) { Xstrcpy(path, tmp); return(path); } # endif i = (_dospath(path)) ? 2 : 0; Xstrtoupper(&(path[i])); for (; path[i]; i++) { # ifdef BSPATHDELIM if (path[i] == '/') path[i] = _SC_; # else if (path[i] == '\\') path[i] = _SC_; # endif if (iswchar(path, i)) i++; } return(path); } #endif /* DJGPP || !BSPATHDELIM */ #ifndef _NOUSELFN char *preparefile(path, alias) CONST char *path; char *alias; { int i; path = duplpath(path); i = supportLFN(path); #ifdef _NODOSDRIVE if (i < 0) return((char *)path); #else /* !_NODOSDRIVE */ if (i < -2) return((char *)path); #endif /* !_NODOSDRIVE */ if ((alias = shortname(path, alias))) return(alias); #ifndef _NODOSDRIVE else if (i < 0 && errno == EACCES) return((char *)path); #endif return(NULL); } #ifndef _NODOSDRIVE static VOID NEAR biosreset(drive) int drive; { struct SREGS sreg; __dpmi_regs reg; reg.h.ah = BIOS_RESET; #ifdef PC98 reg.h.al = drvlist[drive].drv; #else reg.h.dl = drvlist[drive].drv; #endif intcall(DISKBIOS, ®, &sreg); } /*ARGSUSED*/ static int NEAR _biosdiskio(drive, head, sect, cyl, buf, nsect, mode, retry) int drive, head, sect, cyl; u_char *buf; int nsect, mode, retry; { struct SREGS sreg; __dpmi_regs reg; u_long size, min, max; u_char *cp; int i, n, ofs; n = nsect; size = (u_long)n * drvlist[drive].sectsize; cp = buf; ofs = 0; for (i = 0; i < retry; i++) { reg.h.ah = mode; #ifdef PC98 reg.h.al = drvlist[drive].drv; reg.x.bx = size; reg.x.cx = cyl; reg.h.dl = sect; reg.h.dh = head; sreg.es = PTR_SEG(cp + ofs); reg.x.bp = PTR_OFF(cp + ofs, ofs); #else reg.h.al = n; reg.h.cl = ((cyl >> 2) & 0xc0) | ((sect + 1) & 0x3f); reg.h.ch = (cyl & 0xff); reg.h.dl = drvlist[drive].drv; reg.h.dh = (head & 0xff); sreg.es = PTR_SEG(cp + ofs); reg.x.bx = PTR_OFF(cp + ofs, ofs); #endif #ifdef DJGPP if (mode != BIOS_READ) dosmemput(buf, size, __tb + ofs); #endif if (intcall(DISKBIOS, ®, &sreg) >= 0) { #ifdef DJGPP if (mode == BIOS_READ) dosmemget(__tb + ofs, size, buf); #else if (cp != buf) { if (mode == BIOS_READ) memcpy((char *)buf, (char *)&(cp[ofs]), size); free(cp); } #endif if (n >= nsect) return(0); cp = (buf += size); ofs = 0; sect += n; while (sect >= drvlist[drive].sect) { sect -= drvlist[drive].sect; if ((++head) >= drvlist[drive].head) { head = 0; if ((++cyl) >= drvlist[drive].cyl) return(seterrno(EACCES)); } } n = (nsect -= n); size = (u_long)n * drvlist[drive].sectsize; i = -1; continue; } if (sect + n > drvlist[drive].sect) { n = drvlist[drive].sect - sect; size = (u_long)n * drvlist[drive].sectsize; i = -1; continue; } min = PTR_FAR(cp + ofs); max = min + size - 1; if (reg.h.ah != BIOS_DMAERR || cp != buf || (min & ~((u_long)0xffff)) == (max & ~((u_long)0xffff))) { biosreset(drive); continue; } n = ((u_long)0x10000 - (min & 0xffff)) / drvlist[drive].sectsize; if (n > 0) { size = (u_long)n * drvlist[drive].sectsize; i = -1; continue; } n = 1; size = drvlist[drive].sectsize; #ifndef DJGPP if (!(cp = (u_char *)malloc(size * 2))) { cp = buf; biosreset(drive); continue; } #endif min = PTR_FAR(cp); max = min + size - 1; ofs = ((min & ~((u_long)0xffff)) == (max & ~((u_long)0xffff))) ? 0 : size; #ifndef DJGPP if (mode != BIOS_READ) memcpy((char *)&(cp[ofs]), (char *)buf, size); #endif i = -1; } if (cp != buf) free(cp); return(seterrno(EACCES)); } #ifndef PC98 /*ARGSUSED*/ static int NEAR xbiosdiskio(drive, sect, f_sect, buf, nsect, mode, retry) int drive; u_long sect, f_sect; u_char *buf; int nsect, mode, retry; { struct SREGS sreg; __dpmi_regs reg; xpacket_t pac; u_long fs, ls, size, min, max; u_char *cp; int i, j, cy, n, ofs; if (!(drvlist[drive].flags & DI_LBA)) return(seterrno(EACCES)); n = nsect; size = (u_long)n * drvlist[drive].sectsize; cp = buf; ofs = 0; for (i = 0; i < retry; i++) { pac.size = XPACKET_SIZE; pac.nsect[0] = (n & 0xff); pac.nsect[1] = (n >> 8); pac.bufptr[0] = (PTR_OFF(cp + ofs, ofs + sizeof(xpacket_t)) & 0xff); pac.bufptr[1] = (PTR_OFF(cp + ofs, ofs + sizeof(xpacket_t)) >> 8); pac.bufptr[2] = (PTR_SEG(cp + ofs) & 0xff); pac.bufptr[3] = (PTR_SEG(cp + ofs) >> 8); fs = f_sect; ls = sect; for (j = cy = 0; j < 8; j++) { cy += (fs & 0xff) + (ls & 0xff); pac.sect[j] = (cy & 0xff); cy >>= 8; fs >>= 8; ls >>= 8; } reg.h.ah = mode; reg.h.al = 0; /* without verify */ reg.h.dl = drvlist[drive].drv; sreg.ds = PTR_SEG(&pac); reg.x.si = PTR_OFF(&pac, 0); #ifdef DJGPP dosmemput(&pac, sizeof(xpacket_t), __tb); if (mode != BIOS_XREAD) dosmemput(buf, size, __tb + ofs + sizeof(xpacket_t)); #endif if (intcall(DISKBIOS, ®, &sreg) >= 0) { #ifdef DJGPP if (mode == BIOS_XREAD) dosmemget(__tb + ofs + sizeof(xpacket_t), size, buf); #else if (cp != buf) { if (mode == BIOS_XREAD) memcpy((char *)buf, (char *)&(cp[ofs]), size); free(cp); } #endif if (n >= nsect) return(0); cp = (buf += size); ofs = 0; sect += n; n = (nsect -= n); size = (u_long)n * drvlist[drive].sectsize; i = -1; continue; } min = PTR_FAR(cp + ofs); max = min + size - 1; if (reg.h.ah != BIOS_DMAERR || cp != buf || (min & ~((u_long)0xffff)) == (max & ~((u_long)0xffff))) { biosreset(drive); continue; } n = ((u_long)0x10000 - (min & 0xffff)) / drvlist[drive].sectsize; if (n > 0) { size = (u_long)n * drvlist[drive].sectsize; i = -1; continue; } n = 1; size = drvlist[drive].sectsize; #ifndef DJGPP if (!(cp = (u_char *)malloc(size * 2))) { cp = buf; biosreset(drive); continue; } #endif min = PTR_FAR(cp); max = min + size - 1; ofs = ((min & ~((u_long)0xffff)) == (max & ~((u_long)0xffff))) ? 0 : size; #ifndef DJGPP if (mode != BIOS_XREAD) memcpy((char *)cp + ofs + sizeof(xpacket_t), (char *)buf, size); #endif i = -1; } if (cp != buf) free(cp); return(seterrno(EACCES)); } #endif /* !PC98 */ static int NEAR getdrvparam(drv, buf) int drv; drvinfo *buf; { struct SREGS sreg; __dpmi_regs reg; buf -> flags = 0; #ifndef PC98 reg.h.ah = BIOS_TYPE; reg.h.dl = drv; if (intcall(DISKBIOS, ®, &sreg) < 0) return(-1); if (reg.h.ah != DT_HARDDISK) return(0); reg.h.ah = BIOS_XCHECK; reg.x.bx = 0x55aa; reg.h.dl = drv; if (intcall(DISKBIOS, ®, &sreg) >= 0 && reg.x.bx == 0xaa55 && (reg.x.cx & 1)) { xparam_t pbuf; pbuf.size[0] = (XPARAM_SIZE & 0xff); pbuf.size[1] = (XPARAM_SIZE >> 8); reg.h.ah = BIOS_XPARAM; reg.h.dl = drv; sreg.ds = PTR_SEG(&pbuf); reg.x.si = PTR_OFF(&pbuf, 0); if (intcall(DISKBIOS, ®, &sreg) >= 0 && !(reg.h.ah)) { #ifdef DJGPP dosmemget(__tb, sizeof(xparam_t), &pbuf); #endif buf -> flags |= DI_LBA; if (!(pbuf.flags[0] & 2)) buf -> flags |= DI_INVALIDCHS; } } #endif reg.h.ah = BIOS_PARAM; #ifdef PC98 reg.h.al = drv; #else reg.h.dl = drv; #endif if (intcall(DISKBIOS, ®, &sreg) < 0) return(-1); #ifdef PC98 buf -> head = reg.h.dh; buf -> sect = reg.h.dl; buf -> cyl = reg.x.cx; buf -> sectsize = reg.x.bx; #else buf -> head = reg.h.dh + 1; buf -> sect = (reg.h.cl & 0x3f); buf -> cyl = reg.h.ch + ((u_short)(reg.h.cl & 0xc0) << 2) + 1; buf -> sectsize = BOOTSECTSIZE; #endif if (!(buf -> head) || !(buf -> sect) || !(buf -> cyl)) return(0); buf -> secthead = buf -> head * buf -> sect; buf -> drv = drv; return(1); } /*ARGSUSED*/ static int NEAR _checkdrive(head, sect, cyl, l_sect, e_sect) int head, sect, cyl; u_long l_sect, e_sect; { partition_t *pt; u_char *buf; int i, j, sh, ss, sc, ofs, size; #ifndef PC98 u_long ls, ps; ps = l_sect; #endif ofs = size = drvlist[maxdrive].sectsize; if (!(buf = (u_char *)malloc(size))) return(0); for (i = 0; i < PART_NUM; i++, ofs += PART_SIZE) { if (PART_TABLE + ofs >= size) { #ifndef PC98 if (ps) { if (xbiosdiskio(maxdrive, ps++, (u_long)0, buf, 1, BIOS_XREAD, BIOSRETRY) < 0 && ((drvlist[maxdrive].flags & DI_INVALIDCHS) || _biosdiskio(maxdrive, head, sect, cyl, buf, 1, BIOS_READ, BIOSRETRY) < 0)) { free(buf); return(-1); } } else #endif if (_biosdiskio(maxdrive, head, sect, cyl, buf, 1, BIOS_READ, BIOSRETRY) < 0) { free(buf); return(-1); } #ifndef PC98 if (buf[size - 2] != 0x55 || buf[size - 1] != 0xaa) { free(buf); return(0); } #endif sect++; ofs = 0; } for (j = 0; j < PART_SIZE; j++) if (buf[PART_TABLE + ofs + j]) break; if (j >= PART_SIZE) continue; pt = (partition_t *)&(buf[PART_TABLE + ofs]); sh = pt -> s_head; #ifdef PC98 ss = pt -> s_sect; sc = byte2word(pt -> s_cyl); if (!(pt -> filesys & 0x80)) continue; #else /* !PC98 */ ss = (pt -> s_sect & 0x3f) - 1; sc = pt -> s_cyl + ((u_short)(pt -> s_sect & 0xc0) << 2); ls = byte2dword(pt -> f_sect); if (pt -> filesys == PT_EXTENDLBA) { if (e_sect) ls += e_sect; else e_sect = ls; if (_checkdrive(sh, ss, sc, ls, e_sect) < 0) { free(buf); return(-1); } continue; } if (pt -> filesys == PT_EXTEND) { if (_checkdrive(sh, ss, sc, (u_long)0, (u_long)0) < 0) { free(buf); return(-1); } continue; } drvlist[maxdrive].f_sect = (u_long)0; if (pt -> filesys == PT_FAT16XLBA || pt -> filesys == PT_FAT32LBA) drvlist[maxdrive].f_sect = ls + l_sect; else #endif /* !PC98 */ if (pt -> filesys != PT_FAT12 && pt -> filesys != PT_FAT16 && pt -> filesys != PT_FAT16X && pt -> filesys != PT_FAT32) continue; drvlist[maxdrive].s_head = sh; drvlist[maxdrive].s_sect = ss; drvlist[maxdrive].s_cyl = sc; drvlist[maxdrive].flags |= (DI_PSEUDO | DI_CHECKED); drvlist[maxdrive].filesys = pt -> filesys; if (maxdrive++ >= 'Z' - 'A') return(0); drvlist[maxdrive].drv = drvlist[maxdrive - 1].drv; drvlist[maxdrive].head = drvlist[maxdrive - 1].head; drvlist[maxdrive].sect = drvlist[maxdrive - 1].sect; drvlist[maxdrive].cyl = drvlist[maxdrive - 1].cyl; drvlist[maxdrive].sectsize = drvlist[maxdrive - 1].sectsize; drvlist[maxdrive].secthead = drvlist[maxdrive - 1].secthead; drvlist[maxdrive].flags = drvlist[maxdrive - 1].flags; } free(buf); return(1); } int checkdrive(drive) int drive; { struct SREGS sreg; __dpmi_regs reg; int i; #ifndef PC98 int j, n; #endif if (!(dosdrive & 2)) return(0); if (maxdrive < 0) { maxdrive = 0; for (i = 0; i < 'Z' - 'A' + 1; i++) { reg.x.ax = 0x4408; reg.h.bl = i + 1; if (int21call(®, &sreg) >= 0) drvlist[i].flags = (reg.h.al) ? DI_FIXED : DI_REMOVABLE; else { reg.x.ax = 0x4409; reg.h.bl = i + 1; if (int21call(®, &sreg) >= 0) drvlist[i].flags = DI_MISC; else drvlist[i].flags = DI_NOPLOVED; } if (drvlist[i].flags & DI_TYPE) maxdrive = i + 1; drvlist[i].flags |= DI_CHECKED; } if (maxdrive >= 'Z' - 'A' + 1) return(-1); #ifdef PC98 for (i = 0; i < MAX_HDD && maxdrive < 'Z' - 'A' + 1; i++) { if (getdrvparam(BIOS_HDD | i, &(drvlist[maxdrive])) <= 0) continue; if (_checkdrive(0, 1, 0, (u_long)0, (u_long)0) < 0) return(-1); } for (i = 0; i < MAX_SCSI && maxdrive < 'Z' - 'A' + 1; i++) { if (getdrvparam(BIOS_SCSI | i, &(drvlist[maxdrive])) <= 0) continue; if (_checkdrive(0, 1, 0, (u_long)0, (u_long)0) < 0) return(-1); } #else reg.h.ah = BIOS_PARAM; reg.h.dl = BIOS_HDD; if (intcall(DISKBIOS, ®, &sreg) < 0) return(-1); n = reg.h.dl; for (i = 0; i < n && maxdrive < 'Z' - 'A' + 1; i++) { j = getdrvparam(BIOS_HDD | i, &(drvlist[maxdrive])); if (!j) continue; if (j < 0 || _checkdrive(0, 0, 0, (u_long)0, (u_long)0) < 0) return(-1); } #endif } if (drive >= 0 && drive < maxdrive && (drvlist[drive].flags & DI_PSEUDO)) return(drvlist[drive].filesys); return(0); } /*ARGSUSED*/ static int NEAR biosdiskio(drive, sect, buf, n, size, iswrite) int drive; u_long sect; u_char *buf; int n, size, iswrite; { int head, cyl; #ifdef PC98 int i; if (sect && (i = size / drvlist[drive].sectsize) > 1) { sect *= i; n *= i; } #else if (drvlist[drive].f_sect) { if (!iswrite) { if (xbiosdiskio(drive, sect, drvlist[drive].f_sect, buf, n, BIOS_XREAD, BIOSRETRY) >= 0) return(0); } else { if (xbiosdiskio(drive, sect, drvlist[drive].f_sect, buf, n, BIOS_XWRITE, BIOSRETRY) >= 0 && xbiosdiskio(drive, sect, drvlist[drive].f_sect, buf, n, BIOS_XVERIFY, 1) >= 0) return(0); } if ((drvlist[drive].flags & DI_INVALIDCHS)) return(-1); } #endif sect += ((u_long)(drvlist[drive].s_cyl) * drvlist[drive].secthead) + ((u_long)(drvlist[drive].s_head) * drvlist[drive].sect) + (u_long)(drvlist[drive].s_sect); cyl = sect / drvlist[drive].secthead; sect %= drvlist[drive].secthead; head = sect / drvlist[drive].sect; sect %= drvlist[drive].sect; if (!iswrite) return(_biosdiskio(drive, head, sect, cyl, buf, n, BIOS_READ, BIOSRETRY)); else if (_biosdiskio(drive, head, sect, cyl, buf, n, BIOS_WRITE, BIOSRETRY) < 0) return(-1); else return(_biosdiskio(drive, head, sect, cyl, buf, n, BIOS_VERIFY, 1)); } static int NEAR lockdrive(drv) int drv; { struct SREGS sreg; __dpmi_regs reg; int i, start, end; if (getdosver() < 7) return(0); reg.x.ax = 0x1600; intcall(0x2f, ®, &sreg); if (reg.h.al == 0xff || reg.h.al == 0x80 || reg.h.al < 3) start = end = 4; else { start = 1; end = 2; } for (i = start; i <= end; i++) { reg.x.ax = 0x440d; reg.h.bl = drv + 1; reg.h.bh = i; reg.x.cx = 0x084a; reg.x.dx = 0x0001; if (int21call(®, &sreg) < 0) { while (--i >= start) { reg.x.ax = 0x440d; reg.h.bl = drv + 1; reg.x.cx = 0x086a; if (int21call(®, &sreg) < 0) break; } return(-1); } } return(end); } static int NEAR unlockdrive(drv, level) int drv, level; { struct SREGS sreg; __dpmi_regs reg; int i, start, end; if (level < 1) return(0); start = level; end = (level <= 3) ? 1 : level; for (i = start; i >= end; i--) { reg.x.ax = 0x440d; reg.h.bl = drv + 1; reg.x.cx = 0x086a; if (int21call(®, &sreg) < 0) return(-1); } return(0); } /*ARGSUSED*/ static int NEAR dosrawdiskio(drv, sect, buf, n, size, iswrite) int drv; u_long sect; u_char *buf; int n, size, iswrite; { struct SREGS sreg; __dpmi_regs reg; struct iopacket_t pac; int err; size *= n; #ifdef DJGPP reg.x.ax = (iswrite) ? 0x3526 : 0x3525; __dpmi_int(0x21, ®); reg.x.cs = reg.x.es; reg.x.ip = reg.x.bx; #else int25bin[0x1b] = (iswrite) ? 0x26 : 0x25; doint25 = (int (far *)__P_((VOID_A)))int25bin; #endif err = 0x0207; if (sect <= 0xffff) { #ifdef DJGPP reg.x.ax = drv; reg.x.cx = n; reg.x.dx = (u_short)sect; reg.x.ds = PTR_SEG(buf); reg.x.bx = PTR_OFF(buf, sizeof(struct iopacket_t)); reg.x.ss = reg.x.sp = 0; if (iswrite) dosmemput(buf, size, __tb + sizeof(struct iopacket_t)); _go32_dpmi_simulate_fcall(®); err = (reg.x.flags & FR_CARRY) ? reg.x.ax : 0; #else int25bin[0x09] = (PTR_SEG(buf) & 0xff); int25bin[0x0a] = ((PTR_SEG(buf) >> 8) & 0xff); int25bin[0x0e] = (drv & 0xff); int25bin[0x0f] = ((drv >> 8) & 0xff); int25bin[0x11] = (PTR_OFF(buf, sizeof(struct iopacket_t)) & 0xff); int25bin[0x12] = ((PTR_OFF(buf, sizeof(struct iopacket_t)) >> 8) & 0xff); int25bin[0x14] = (n & 0xff); int25bin[0x15] = ((n >> 8) & 0xff); int25bin[0x17] = ((u_short)sect & 0xff); int25bin[0x18] = (((u_short)sect >> 8) & 0xff); err = doint25(); #endif } if (err == 0x0207) { pac.sect = sect; pac.size = n; pac.buf_seg = PTR_SEG(buf); pac.buf_off = PTR_OFF(buf, sizeof(struct iopacket_t)); #ifdef DJGPP dosmemput(&pac, sizeof(struct iopacket_t), __tb); if (iswrite) dosmemput(buf, size, __tb + sizeof(struct iopacket_t)); reg.x.ax = drv; reg.x.cx = 0xffff; reg.x.ds = PTR_SEG(&pac); reg.x.bx = PTR_OFF(&pac, 0); reg.x.ss = reg.x.sp = 0; _go32_dpmi_simulate_fcall(®); err = (reg.x.flags & FR_CARRY) ? reg.x.ax : 0; #else int25bin[0x09] = (PTR_SEG(&pac) & 0xff); int25bin[0x0a] = ((PTR_SEG(&pac) >> 8) & 0xff); int25bin[0x0e] = (drv & 0xff); int25bin[0x0f] = ((drv >> 8) & 0xff); int25bin[0x11] = (PTR_OFF(&pac, 0) & 0xff); int25bin[0x12] = ((PTR_OFF(&pac, 0) >> 8) & 0xff); int25bin[0x14] = (0xffff & 0xff); int25bin[0x15] = ((0xffff >> 8) & 0xff); err = doint25(); #endif if (err == 0x0207) err = 0x0001; } if (err == 0x0001) { pac.sect = sect; pac.size = n; pac.buf_seg = PTR_SEG(buf); pac.buf_off = PTR_OFF(buf, sizeof(struct iopacket_t)); #ifdef DJGPP dosmemput(&pac, sizeof(struct iopacket_t), __tb); if (iswrite) dosmemput(buf, size, __tb + sizeof(struct iopacket_t)); #endif reg.x.ax = 0x7305; reg.x.cx = 0xffff; reg.h.dl = drv + 1; reg.x.si = (iswrite) ? 0x0001 : 0x0000; sreg.ds = PTR_SEG(&pac); reg.x.bx = PTR_OFF(&pac, 0); if (int21call(®, &sreg) < 0) return(-1); } else if (err) { switch (err & 0xff) { case 0: case 10: case 11: errno = EACCES; break; case 1: case 2: errno = ENODEV; break; default: errno = EINVAL; break; } return(-1); } #ifdef DJGPP if (!iswrite) dosmemget(__tb + sizeof(struct iopacket_t), size, buf); #endif return(0); } int rawdiskio(drive, sect, buf, n, size, iswrite) int drive; u_long sect; u_char *buf; int n, size, iswrite; { int drv, ret, level; drv = Xtoupper(drive) - 'A'; if (drv < 0 || drv > 'Z' - 'A') return(seterrno(EINVAL)); ret = 0; #ifdef FAKEUNINIT level = 0; /* fake for -Wuninitialized */ #endif #ifdef DJGPP if ((long)size * n > tbsize / 2) { if (checkdrive(drv) > 0) while (n-- > 0) { ret = biosdiskio(drv, sect, buf, 1, size, iswrite); if (ret < 0) break; buf += size; sect++; } else { if (iswrite && (level = lockdrive(drv)) < 0) return(-1); while (n-- > 0) { ret = dosrawdiskio(drv, sect, buf, 1, size, iswrite); if (ret < 0) break; buf += size; sect++; } if (iswrite && unlockdrive(drv, level) < 0) return(-1); } } else #endif if (checkdrive(drv) > 0) ret = biosdiskio(drv, sect, buf, n, size, iswrite); else { if (iswrite && (level = lockdrive(drv)) < 0) return(-1); ret = dosrawdiskio(drv, sect, buf, n, size, iswrite); if (iswrite && unlockdrive(drv, level) < 0) return(-1); } return(ret); } #endif /* !_NODOSDRIVE */ #endif /* !_NOUSELFN */ static int NEAR dos_findfirst(path, attr, result) CONST char *path; u_int attr; struct dosfind_t *result; { struct SREGS sreg; __dpmi_regs reg; path = duplpath(path); reg.x.ax = 0x1a00; sreg.ds = PTR_SEG(result); reg.x.dx = PTR_OFF(result, 0); int21call(®, &sreg); reg.x.ax = 0x4e00; reg.x.cx = attr; #ifdef DJGPP dos_putpath(path, sizeof(struct dosfind_t)); #endif sreg.ds = PTR_SEG(path); reg.x.dx = PTR_OFF(path, sizeof(struct dosfind_t)); if (int21call(®, &sreg) < 0) { if (!errno) errno = ENOENT; return(-1); } #ifdef DJGPP dosmemget(__tb, sizeof(struct dosfind_t), result); #endif return(0); } static int NEAR dos_findnext(result) struct dosfind_t *result; { struct SREGS sreg; __dpmi_regs reg; reg.x.ax = 0x1a00; sreg.ds = PTR_SEG(result); reg.x.dx = PTR_OFF(result, 0); #ifdef DJGPP dosmemput(result, sizeof(struct dosfind_t), __tb); #endif int21call(®, &sreg); reg.x.ax = 0x4f00; if (int21call(®, &sreg) < 0) return(-1); #ifdef DJGPP dosmemget(__tb, sizeof(struct dosfind_t), result); #endif return(0); } #ifndef _NOUSELFN static int NEAR lfn_findfirst(fdp, path, attr, result) u_int *fdp; CONST char *path; u_int attr; struct lfnfind_t *result; { struct SREGS sreg; __dpmi_regs reg; path = duplpath(path); reg.x.ax = 0x714e; reg.x.cx = attr; reg.x.si = DATETIMEFORMAT; #ifdef DJGPP dos_putpath(path, sizeof(struct lfnfind_t)); #endif sreg.ds = PTR_SEG(path); reg.x.dx = PTR_OFF(path, sizeof(struct lfnfind_t)); sreg.es = PTR_SEG(result); reg.x.di = PTR_OFF(result, 0); if (int21call(®, &sreg) < 0) { if (!errno) errno = ENOENT; return(-1); } *fdp = reg.x.ax; #ifdef DJGPP dosmemget(__tb, sizeof(struct lfnfind_t), result); #endif return(0); } static int NEAR lfn_findnext(fd, result) u_int fd; struct lfnfind_t *result; { struct SREGS sreg; __dpmi_regs reg; reg.x.ax = 0x714f; reg.x.bx = fd; reg.x.si = DATETIMEFORMAT; sreg.es = PTR_SEG(result); reg.x.di = PTR_OFF(result, 0); if (int21call(®, &sreg) < 0) return(-1); #ifdef DJGPP dosmemget(__tb, sizeof(struct lfnfind_t), result); #endif return(0); } static int NEAR lfn_findclose(fd) u_int fd; { struct SREGS sreg; __dpmi_regs reg; reg.x.ax = 0x71a1; reg.x.bx = fd; return(int21call(®, &sreg)); } #endif /* !_NOUSELFN */ DIR *unixopendir(dir) CONST char *dir; { DIR *dirp; char *cp, path[MAXPATHLEN]; int i; #ifndef _NODOSDRIVE if ((i = supportLFN(dir)) < 0 && i > -3) { dependdosfunc = 0; if ((dirp = dosopendir(regpath(dir, path)))) return(dirp); else if (!dependdosfunc) return(NULL); } #endif if (!unixrealpath(dir, path)) return(NULL); cp = strcatdelim(path); if (!(dirp = (DIR *)malloc(sizeof(DIR)))) return(NULL); dirp -> dd_off = 0; #ifndef _NOUSELFN if (supportLFN(path) > 0) { dirp -> dd_id = DID_IFLFN; Xstrcpy(cp, "*"); dirp -> dd_buf = (char *)malloc(sizeof(struct lfnfind_t)); if (!dirp -> dd_buf) { free(dirp); return(NULL); } if (cp - 1 > &(path[3])) i = -1; else i = dos_findfirst(path, DS_IFLABEL, (struct dosfind_t *)(dirp -> dd_buf)); if (i >= 0) dirp -> dd_id |= DID_IFLABEL; else { u_int fd; i = lfn_findfirst(&fd, path, SEARCHATTRS, (struct lfnfind_t *)(dirp -> dd_buf)); if (i >= 0) dirp -> dd_fd = fd; else dirp -> dd_id &= ~DID_IFLFN; } } else #endif /* !_NOUSELFN */ { dirp -> dd_id = DID_IFNORMAL; Xstrcpy(cp, "*.*"); dirp -> dd_buf = (char *)malloc(sizeof(struct dosfind_t)); if (!dirp -> dd_buf) { free(dirp); return(NULL); } if (cp - 1 > &(path[3])) i = -1; else i = dos_findfirst(path, DS_IFLABEL, (struct dosfind_t *)(dirp -> dd_buf)); if (i >= 0) dirp -> dd_id |= DID_IFLABEL; else i = dos_findfirst(path, (SEARCHATTRS | DS_IFLABEL), (struct dosfind_t *)(dirp -> dd_buf)); } if (i < 0) { if (!errno || errno == ENOENT) dirp -> dd_off = -1; else { #ifndef _NOUSELFN if (dirp -> dd_id & DID_IFLFN) VOID_C lfn_findclose(dirp -> dd_fd); #endif free(dirp -> dd_buf); free(dirp); return(NULL); } } if (!(dirp -> dd_path = (char *)malloc(strlen(dir) + 1))) { #ifndef _NOUSELFN if (dirp -> dd_id & DID_IFLFN) VOID_C lfn_findclose(dirp -> dd_fd); #endif free(dirp -> dd_buf); free(dirp); return(NULL); } Xstrcpy(dirp -> dd_path, dir); return(dirp); } int unixclosedir(dirp) DIR *dirp; { #ifndef _NODOSDRIVE if (dirp -> dd_id == DID_IFDOSDRIVE) return(dosclosedir(dirp)); #endif #ifndef _NOUSELFN if (dirp -> dd_id & DID_IFLFN) VOID_C lfn_findclose(dirp -> dd_fd); #endif free(dirp -> dd_buf); free(dirp -> dd_path); free(dirp); return(0); } struct dirent *unixreaddir(dirp) DIR *dirp; { #ifndef _NOUSELFN struct lfnfind_t *lbufp; u_int fd; #endif struct dosfind_t *dbufp; static struct dirent d; char *cp, path[MAXPATHLEN]; int i; #ifndef _NODOSDRIVE if (dirp -> dd_id == DID_IFDOSDRIVE) return(dosreaddir(dirp)); #endif if (dirp -> dd_off < 0) return(NULL); d.d_off = dirp -> dd_off; #ifndef _NOUSELFN if ((dirp -> dd_id & DID_IFLFN) && !(dirp -> dd_id & DID_IFLABEL)) { lbufp = (struct lfnfind_t *)(dirp -> dd_buf); Xstrcpy(d.d_name, lbufp -> name); Xstrcpy(d.d_alias, lbufp -> alias); } else #endif /* !_NOUSELFN */ { dbufp = (struct dosfind_t *)(dirp -> dd_buf); Xstrcpy(d.d_name, dbufp -> name); d.d_alias[0] = '\0'; } if (!(dirp -> dd_id & DID_IFLABEL)) { #ifndef _NOUSELFN if (dirp -> dd_id & DID_IFLFN) i = lfn_findnext(dirp -> dd_fd, (struct lfnfind_t *)(dirp -> dd_buf)); else #endif /* !_NOUSELFN */ i = dos_findnext((struct dosfind_t *)(dirp -> dd_buf)); } else { cp = strcatdelim2(path, dirp -> dd_path, NULL); #ifndef _NOUSELFN if (dirp -> dd_id & DID_IFLFN) { Xstrcpy(cp, "*"); i = lfn_findfirst(&fd, path, SEARCHATTRS, (struct lfnfind_t *)(dirp -> dd_buf)); if (i >= 0) dirp -> dd_fd = fd; else dirp -> dd_id &= ~DID_IFLFN; } else #endif /* !_NOUSELFN */ { Xstrcpy(cp, "*.*"); i = dos_findfirst(path, SEARCHATTRS, (struct dosfind_t *)(dirp -> dd_buf)); } } if (i >= 0) dirp -> dd_off++; else { dirp -> dd_off = -1; #ifndef _NOUSELFN if (dirp -> dd_id & DID_IFLABEL) dirp -> dd_id &= ~DID_IFLFN; #endif } dirp -> dd_id &= ~DID_IFLABEL; return(&d); } int unixrewinddir(dirp) DIR *dirp; { DIR *dupdirp; char *cp; #ifndef _NODOSDRIVE if (dirp -> dd_id == DID_IFDOSDRIVE) return(dosrewinddir(dirp)); #endif #ifndef _NOUSELFN if (dirp -> dd_id & DID_IFLFN) VOID_C lfn_findclose(dirp -> dd_fd); #endif if (!(dupdirp = unixopendir(dirp -> dd_path))) return(-1); free(dirp -> dd_buf); free(dupdirp -> dd_path); cp = dirp -> dd_path; memcpy((char *)dirp, (char *)dupdirp, sizeof(DIR)); dirp -> dd_path = cp; free(dupdirp); return(0); } #ifdef _NOUSELFN # ifndef DJGPP /*ARGSUSED*/ int unixmkdir(path, mode) CONST char * path; int mode; { struct stat st; if (unixstat(path, &st) >= 0) return(seterrno(EEXIST)); return(mkdir(path) ? -1 : 0); } # endif #else /* !_NOUSELFN */ int unixunlink(path) CONST char *path; { #ifndef _NODOSDRIVE char buf[MAXPATHLEN]; #endif struct SREGS sreg; __dpmi_regs reg; int i; path = duplpath(path); i = supportLFN(path); #ifndef _NODOSDRIVE if (i < 0 && i > -3) { if (dosunlink(regpath(path, buf)) >= 0) return(0); } #endif /* !_NODOSDRIVE */ if (i <= 0) reg.x.ax = 0x4100; else { reg.x.ax = 0x7141; reg.x.cx = SEARCHATTRS & ~DS_IFDIR; reg.x.si = 0; /* forbid wild card */ } #ifdef DJGPP dos_putpath(path, 0); #endif sreg.ds = PTR_SEG(path); reg.x.dx = PTR_OFF(path, 0); return(int21call(®, &sreg)); } static int NEAR gendosname(s) char *s; { char *cp; int i; if ((cp = strrdelim(s, 1))) s = &(cp[1]); for (i = 0; i < 8 && s[i]; i++) { if (s[i] == ' ') return(0); if (s[i] == '.') break; if (iswchar(s, i)) { if (i + 1 >= 8) break; i++; } } if (!i) return(-1); s += i; if (!*s) return(1); if (*s == '.') cp = &(s[1]); else if ((cp = Xstrchr(&(s[1]), '.'))) cp++; for (i = 0; i < 3 && cp && cp[i]; i++) { if (cp[i] == ' ') return(0); if (cp[i] == '.') return(-1); if (iswchar(cp, i)) { if (i + 1 >= 3) break; s[i + 1] = cp[i]; i++; } s[i + 1] = cp[i]; } if (i) *(s++) = '.'; s[i] = '\0'; Xstrtoupper(s); return(1); } static int NEAR unixrenamedir(from, to) CONST char *from, *to; { DIR *dirp; struct dirent *dp; CONST char *cp; char *fp, *tp, fbuf[MAXPATHLEN], tbuf[MAXPATHLEN]; int i; Xstrcpy(fbuf, to); if (!(tp = strrdelim(fbuf, 1))) { cp = to; Xstrcpy(fbuf, curpath); } else { if (*tp == _SC_) tp++; *tp = '\0'; cp = &(to[tp - fbuf]); } if (!(to = unixrealpath(fbuf, tbuf)) || !(from = unixrealpath(from, fbuf))) return(-1); Xstrcpy(strcatdelim(tbuf), cp); for (i = 0; from[i]; i++) if (from[i] != to[i]) break; if (!strdelim(&(from[i]), 0) && !strdelim(&(to[i]), 0)) return(-1); if (unixmkdir(to, 0777) < 0) return(-1); if (!(dirp = unixopendir(from))) { VOID_C unixrmdir(to); return(-1); } i = strlen(from); fp = strcatdelim(fbuf); tp = strcatdelim(tbuf); while ((dp = unixreaddir(dirp))) { if (isdotdir(dp -> d_name)) continue; Xstrcpy(fp, dp -> d_name); Xstrcpy(tp, dp -> d_name); if (unixrename(from, to) < 0) { VOID_C unixclosedir(dirp); return(-1); } } VOID_C unixclosedir(dirp); fbuf[i] = '\0'; if (unixrmdir(from) < 0) return(-1); return(0); } int unixrename(from, to) CONST char *from, *to; { #ifndef _NODOSDRIVE char buf1[MAXPATHLEN], buf2[MAXPATHLEN]; #endif struct dosfind_t dbuf; struct SREGS sreg; __dpmi_regs reg; char fbuf[MAXPATHLEN], tbuf[MAXPATHLEN]; int i, ax, f, t; Xstrcpy(fbuf, duplpath(from)); from = fbuf; Xstrcpy(tbuf, duplpath(to)); to = tbuf; f = supportLFN(from); t = supportLFN(to); #ifndef _NODOSDRIVE if (((f < 0 && f > -3) || (t < 0 && t > -3)) && (f != -3 && t != -3)) { dependdosfunc = 0; if (dosrename(regpath(from, buf1), regpath(to, buf2)) >= 0) return(0); else if (!dependdosfunc) return(-1); } #endif /* !_NODOSDRIVE */ ax = ((f > 0 || t > 0) && (f >= 0 && t >= 0)) ? 0x7156 : 0x5600; if (f < t) t = f; for (i = 0; i < 3; i++) { reg.x.ax = ax; #ifdef DJGPP f = dos_putpath(from, 0); dos_putpath(to, f); #endif sreg.ds = PTR_SEG(from); reg.x.dx = PTR_OFF(from, 0); sreg.es = PTR_SEG(to); reg.x.di = PTR_OFF(to, f); if (int21call(®, &sreg) >= 0) return(0); if (reg.x.ax != 0x05) return(-1); if (i == 0 && unixunlink(to) < 0) i++; if (i == 1) { if (ax != 0x5600 || dos_findfirst(from, SEARCHATTRS, &dbuf) < 0 || !(dbuf.attr & DS_IFDIR)) break; if (t > -3) { if ((f = gendosname(tbuf)) < 0) break; if (f > 0) { ax = 0x7156; continue; } } if (unixrenamedir(from, to) < 0) break; return(0); } } return(seterrno(EACCES)); } /*ARGSUSED*/ int unixmkdir(path, mode) CONST char *path; int mode; { #ifndef _NODOSDRIVE char buf[MAXPATHLEN]; #endif struct SREGS sreg; __dpmi_regs reg; int i; path = duplpath(path); i = supportLFN(path); #ifndef _NODOSDRIVE if (i < 0 && i > -3) { dependdosfunc = 0; if (dosmkdir(regpath(path, buf), mode) >= 0) return(0); else if (!dependdosfunc) return(-1); } #endif /* !_NODOSDRIVE */ reg.x.ax = (i > 0) ? 0x7139 : 0x3900; #ifdef DJGPP dos_putpath(path, 0); #endif sreg.ds = PTR_SEG(path); reg.x.dx = PTR_OFF(path, 0); if (int21call(®, &sreg) >= 0) return(0); if (reg.x.ax == 5) errno = EEXIST; return(-1); } int unixrmdir(path) CONST char *path; { #ifndef _NODOSDRIVE char buf[MAXPATHLEN]; #endif struct SREGS sreg; __dpmi_regs reg; int i; path = duplpath(path); i = supportLFN(path); #ifndef _NODOSDRIVE if (i < 0 && i > -3) { if (dosrmdir(regpath(path, buf)) >= 0) return(0); } #endif /* !_NODOSDRIVE */ reg.x.ax = (i > 0) ? 0x713a : 0x3a00; #ifdef DJGPP dos_putpath(path, 0); #endif sreg.ds = PTR_SEG(path); reg.x.dx = PTR_OFF(path, 0); return(int21call(®, &sreg)); } int unixchdir(path) CONST char *path; { #ifndef _NODOSDRIVE char buf[MAXPATHLEN]; #endif struct SREGS sreg; __dpmi_regs reg; int i; path = duplpath(path); if (!path[(_dospath(path)) ? 2 : 0]) return(0); i = supportLFN(path); #ifndef _NODOSDRIVE if (i == -1) { if (!(path = preparefile(path, buf))) return(-1); } #endif /* !_NODOSDRIVE */ reg.x.ax = (i > 0) ? 0x713b : 0x3b00; #ifdef DJGPP dos_putpath(path, 0); #endif sreg.ds = PTR_SEG(path); reg.x.dx = PTR_OFF(path, 0); return(int21call(®, &sreg)); } #endif /* !_NOUSELFN */ char *unixgetcwd(pathname, size) char *pathname; int size; { #ifdef DJGPP char tmp[MAXPATHLEN]; #endif char *cp; int drive; drive = getcurdrv(); #ifndef _NODOSDRIVE if (checkdrive(Xtoupper(drive) - 'A') > 0) { if (!dosgetcwd(pathname, size)) return(NULL); } else #endif if (!pathname && !(pathname = (char *)malloc(size))) return(NULL); else { #ifdef DOUBLESLASH if (drive == '_') cp = pathname; else #endif cp = gendospath(pathname, drive, _SC_); if (!unixgetcurdir(cp, 0)) return(NULL); } *pathname = (dos7access & D7_CAPITAL) ? Xtoupper(*pathname) : Xtolower(*pathname); #ifdef DJGPP if (unixrealpath(pathname, tmp)) Xstrcpy(pathname, tmp); #endif return(pathname); } int unixstatfs(path, buf) CONST char *path; statfs_t *buf; { #ifndef _NOUSELFN # ifndef _NODOSDRIVE char tmp[3 * sizeof(long) + 1]; # endif struct fat32statfs_t fsbuf; int i; #endif /* !_NOUSELFN */ struct SREGS sreg; __dpmi_regs reg; int drv, drive; if (!path || !(drive = _dospath(path))) drive = getcurdrv(); drv = Xtoupper(drive) - 'A'; if (drv < 0 || drv > 'Z' - 'A') return(seterrno(ENOENT)); #ifndef _NOUSELFN i = supportLFN(path); # ifndef _NODOSDRIVE if (i == -2) { if (dosstatfs(drive, tmp) < 0) return(-1); buf -> Xf_bsize = *((u_long *)&(tmp[0 * sizeof(long)])); buf -> Xf_blocks = *((u_long *)&(tmp[1 * sizeof(long)])); buf -> Xf_bfree = buf -> Xf_bavail = *((u_long *)&(tmp[2 * sizeof(long)])); } else # endif if (i >= 2) { reg.x.ax = 0x7303; reg.x.cx = sizeof(fsbuf); # ifdef DJGPP dos_putpath(path, sizeof(fsbuf)); # endif sreg.es = PTR_SEG(&fsbuf); reg.x.di = PTR_OFF(&fsbuf, 0); sreg.ds = PTR_SEG(path); reg.x.dx = PTR_OFF(path, sizeof(fsbuf)); if (int21call(®, &sreg) < 0) return(-1); # ifdef DJGPP dosmemget(__tb, sizeof(fsbuf), &fsbuf); # endif buf -> Xf_bsize = (u_long)fsbuf.f_clustsize * (long)fsbuf.f_sectsize; buf -> Xf_blocks = (u_long)fsbuf.f_blocks; buf -> Xf_bfree = buf -> Xf_bavail = (u_long)fsbuf.f_bavail; } else #endif /* !_NOUSELFN */ { reg.x.ax = 0x3600; reg.h.dl = (u_char)drv + 1; int21call(®, &sreg); if (reg.x.ax == 0xffff) return(seterrno(ENOENT)); buf -> Xf_bsize = (u_long)(reg.x.ax) * (u_long)(reg.x.cx); buf -> Xf_blocks = (u_long)(reg.x.dx); buf -> Xf_bfree = buf -> Xf_bavail = (u_long)(reg.x.bx); } if (!(buf -> Xf_blocks) || !(buf -> Xf_bsize) || buf -> Xf_blocks < buf -> Xf_bavail) return(seterrno(EIO)); buf -> Xf_files = -1L; return(0); } /*ARGSUSED*/ static int NEAR alter_findfirst(path, fdp, dbuf, lbuf) CONST char *path; u_int *fdp; struct dosfind_t *dbuf; struct lfnfind_t *lbuf; { CONST char *cp; char tmp[MAXPATHLEN]; int n, len; #ifndef _NOUSELFN if (fdp) n = lfn_findfirst(fdp, path, SEARCHATTRS, lbuf); else #endif n = dos_findfirst(path, SEARCHATTRS, dbuf); if (n >= 0) return(n); if (errno != ENOENT) return(-1); if ((cp = strrdelim(path, 1))) cp++; else cp = path; if (isdotdir(cp) == 1) { len = cp - path; memcpy(tmp, path, len); Xstrcpy(&(tmp[len]), curpath); #ifndef _NOUSELFN if (fdp) n = lfn_findfirst(fdp, tmp, SEARCHATTRS, lbuf); else #endif n = dos_findfirst(tmp, SEARCHATTRS, dbuf); } else { #ifdef DOUBLESLASH if (isdslash(path)) return(-1); else if (_dospath(path)) /*EMPTY*/; else if (getcurdrv() == '_') return(-1); #endif n = dos_findfirst(path, DS_IFLABEL, dbuf); } return(n); } int unixstat(path, stp) CONST char *path; struct stat *stp; { #ifndef _NOUSELFN # ifndef _NODOSDRIVE char buf[MAXPATHLEN]; # endif struct lfnfind_t lbuf; u_int fd; #endif /* !_NOUSELFN */ struct dosfind_t dbuf; int i, n; if (strpbrk(path, "*?")) return(seterrno(ENOENT)); #ifdef _NOUSELFN n = alter_findfirst(path, NULL, &dbuf, NULL); #else /* !_NOUSELFN */ fd = (u_int)-1; i = supportLFN(path); # ifndef _NODOSDRIVE if (i < 0 && i > -3) { dependdosfunc = 0; if (dosstat(regpath(path, buf), stp) >= 0) return(0); else if (!dependdosfunc) return(-1); } # endif if (i <= 0) n = alter_findfirst(path, NULL, &dbuf, &lbuf); else n = alter_findfirst(path, &fd, &dbuf, &lbuf); #endif /* !_NOUSELFN */ if (n < 0) return(-1); #ifndef _NOUSELFN if (fd != (u_int)-1) { stp -> st_mode = getunixmode(lbuf.attr); stp -> st_mtime = getunixtime(lbuf.wrdate, lbuf.wrtime); stp -> st_size = lbuf.size_l; VOID_C lfn_findclose(fd); } else #endif /* !_NOUSELFN */ { stp -> st_mode = getunixmode(dbuf.attr); stp -> st_mtime = getunixtime(dbuf.wrdate, dbuf.wrtime); stp -> st_size = dbuf.size_l; } stp -> st_ctime = stp -> st_atime = stp -> st_mtime; stp -> st_dev = stp -> st_ino = 0; stp -> st_nlink = 1; stp -> st_uid = stp -> st_gid = -1; return(0); } int unixchmod(path, mode) CONST char *path; int mode; { struct SREGS sreg; __dpmi_regs reg; #ifndef _NOUSELFN char buf[MAXPATHLEN]; int i; #endif path = duplpath(path); #ifdef _NOUSELFN reg.x.ax = 0x4301; #else /* !_NOUSELFN */ i = supportLFN(path); if (i <= 0) { # ifndef _NODOSDRIVE if (i == -2) return(doschmod(path, mode)); # endif if (!(path = preparefile(path, buf))) return(-1); reg.x.ax = 0x4301; } else { reg.x.ax = 0x7143; reg.h.bl = 0x01; } #endif /* !_NOUSELFN */ reg.x.cx = getdosmode(mode); #ifdef DJGPP dos_putpath(path, 0); #endif sreg.ds = PTR_SEG(path); reg.x.dx = PTR_OFF(path, 0); return(int21call(®, &sreg)); } #ifndef _NOUSELFN int unixutimes(path, utp) CONST char *path; CONST struct utimes_t *utp; { time_t t; __dpmi_regs reg; struct SREGS sreg; char buf[MAXPATHLEN]; int i, fd; t = utp -> modtime; path = duplpath(path); i = supportLFN(path); if (i < 0 && i > -3) { # ifndef _NODOSDRIVE return(dosutimes(regpath(path, buf), utp)); # else if (!(path = preparefile(path, buf))) return(-1); # endif } if (i <= 0) { if ((fd = open(path, O_RDONLY, 0666)) >= 0) { reg.x.ax = 0x5701; reg.x.bx = (u_short)fd; VOID_C getdostime(&(reg.x.dx), &(reg.x.cx), t); i = int21call(®, &sreg); VOID_C close(fd); return(i); } if (i || errno != EACCES) return(-1); } reg.x.ax = 0x7143; reg.h.bl = 0x03; VOID_C getdostime(&(reg.x.di), &(reg.x.cx), t); # ifdef DJGPP dos_putpath(path, 0); # endif sreg.ds = PTR_SEG(path); reg.x.dx = PTR_OFF(path, 0); return(int21call(®, &sreg)); } int unixopen(path, flags, mode) CONST char *path; int flags, mode; { struct SREGS sreg; __dpmi_regs reg; char buf[MAXPATHLEN]; int i; path = duplpath(path); i = supportLFN(path); # ifndef _NODOSDRIVE if (i < 0 && i > -3) { dependdosfunc = 0; if ((i = dosopen(regpath(path, buf), flags, mode)) >= 0) return(i); else if (!dependdosfunc) return(-1); } # endif /* !_NODOSDRIVE */ if (i <= 0) return(open(path, flags, mode)); reg.x.ax = 0x716c; reg.x.bx = 0x0110; /* SH_DENYRW | NO_BUFFER */ if ((flags & O_ACCMODE) == O_WRONLY) reg.x.bx |= 0x0001; else if ((flags & O_ACCMODE) == O_RDWR) reg.x.bx |= 0x0002; reg.x.cx = getdosmode(mode); if (flags & O_CREAT) { if (flags & O_EXCL) { reg.x.dx = 0x0010; flags &= ~(O_CREAT | O_EXCL); } else if (flags & O_TRUNC) reg.x.dx = 0x0012; else reg.x.dx = 0x0011; } else if (flags & O_TRUNC) reg.x.dx = 0x0002; else reg.x.dx = 0x0001; # ifdef DJGPP dos_putpath(path, 0); # endif sreg.ds = PTR_SEG(path); reg.x.si = PTR_OFF(path, 0); if (int21call(®, &sreg) < 0) return(-1); reg.x.bx = reg.x.ax; reg.x.ax = 0x3e00; int21call(®, &sreg); if (!(path = shortname(path, buf))) return(-1); return(open(path, flags, mode)); } #endif /* !_NOUSELFN */ FD-3.01j/realpath.c100644 2105 1751 12473 13516612560 12654 0ustar shiraiuser/* * realpath.c * * alternative pathname parser */ #ifdef FD #include "fd.h" #else #include "headers.h" #include "depend.h" #include "printf.h" #include "kctype.h" #include "string.h" #endif #include "sysemu.h" #include "pathname.h" #include "unixemu.h" #include "realpath.h" #if MSDOS && !defined (FD) #include "termio.h" #endif #ifdef DEP_URLPATH #include "url.h" #endif #if defined (FD) && (defined (DEP_DOSDRIVE) || defined (DEP_FTPPATH)) extern int reallstat __P_((CONST char *, struct stat *)); #else #define reallstat Xlstat #endif #if MSDOS # ifdef FD extern int setcurdrv __P_((int, int)); extern VOID error __P_((CONST char *)); extern VOID lostcwd __P_((char *)); # else static VOID NEAR error __P_((CONST char *)); # endif #endif /* MSDOS */ #ifdef DEP_DOSEMU extern char *dosgetcwd __P_((char *, int)); #endif #ifdef FD extern char fullpath[]; #endif #ifdef DEP_DOSEMU extern int lastdrive; #endif #ifndef NOSYMLINK static int NEAR evallink __P_((char *, int, int)); #endif static int NEAR _Xrealpath __P_((CONST char *, int, char *, int, int, int)); int norealpath = 0; #if MSDOS && !defined (FD) static VOID NEAR error(s) CONST char *s; { VOID_C Xfprintf(Xstderr, "%s: Error(%d).\n", errno); exit(2); } #endif /* MSDOS && !FD */ #ifndef NOSYMLINK static int NEAR evallink(path, tlen, rlen) char *path; int tlen, rlen; { struct stat st; char buf[MAXPATHLEN]; int n, duperrno; duperrno = errno; if (reallstat(path, &st) < 0) { errno = duperrno; return(-1); } if ((st.st_mode & S_IFMT) != S_IFLNK) { errno = duperrno; return(0); } if ((n = Xreadlink(path, buf, sizeof(buf) - 1)) < 0) { errno = duperrno; return(-1); } buf[n] = '\0'; if (*buf != _SC_ && rlen) path[rlen] = '\0'; else { copyrootpath(&(path[tlen])); rlen = tlen + 1; } rlen = _Xrealpath(buf, n, path, tlen, rlen, RLP_READLINK); errno = duperrno; return(rlen); } #endif /* !NOSYMLINK */ /*ARGSUSED*/ static int NEAR _Xrealpath(path, plen, resolved, tlen, rlen, flags) CONST char *path; int plen; char *resolved; int tlen, rlen, flags; { #ifndef NOSYMLINK int n; #endif char *cp, *top; int len; if (plen <= 0) return(rlen); else if (path[0] != '.') /*EMPTY*/; else if (plen == 1) return(rlen); else if (path[1] != '.') /*EMPTY*/; else if (plen == 2) { top = &(resolved[tlen]); cp = strrdelim(top, 0); if (!cp || cp <= top) { copyrootpath(top); return(++tlen); } *cp = '\0'; return(cp - top); } if ((cp = Xmemchr(path, _SC_, plen))) { len = cp++ - path; rlen = _Xrealpath(path, len, resolved, tlen, rlen, flags); plen -= ++len; return(_Xrealpath(cp, plen, resolved, tlen, rlen, flags)); } len = Xsnprintf(&(resolved[rlen]), MAXPATHLEN - rlen, "%s%-.*s", (rlen > tlen + 1) ? _SS_ : nullstr, plen, path); #ifdef CODEEUC len = strlen(&(resolved[rlen])); #endif #ifndef NOSYMLINK if ((flags & RLP_READLINK) && (n = evallink(resolved, tlen, rlen)) > 0) { rlen = n; len = 0; } #endif rlen += len; return(rlen); } char *Xrealpath(path, resolved, flags) CONST char *path; char *resolved; int flags; { #ifdef DEP_DOSEMU int duplastdrive; #endif #ifdef DEP_PATHTOP int drv; #endif #if MSDOS int drive; #endif char *cp, tmp[MAXPATHLEN]; int tlen, rlen; Xstrcpy(tmp, path); path = tmp; cp = NULL; tlen = rlen = 0; #ifdef DEP_DOSPATH drv = 0; #endif #ifdef DEP_PATHTOP if (!(flags & RLP_PSEUDOPATH) && (tlen = getpathtop(path, &drv, NULL))) { # ifdef DEP_DOSEMU if (drv) { if (path[tlen] != _SC_) { duplastdrive = lastdrive; lastdrive = drv; cp = dosgetcwd(resolved, MAXPATHLEN - 1); lastdrive = duplastdrive; } } else # endif rlen = Xsnprintf(resolved, MAXPATHLEN, "%-.*s%c", tlen, path, _SC_); path += tlen; flags &= ~RLP_READLINK; } else #endif /* DEP_PATHTOP */ { #if MSDOS tlen = 2; drive = dospath(nullstr, NULL); if ((drv = _dospath(path))) path += 2; else drv = drive; #endif if (*path == _SC_) /*EMPTY*/; #if MSDOS else if (Xtoupper(drv) != Xtoupper(drive)) { if (setcurdrv(drv, 0) >= 0) { cp = Xgetwd(resolved); if (setcurdrv(drive, 0) < 0) error("setcurdrv()"); # ifdef FD if (!cp) lostcwd(resolved); # else if (!cp) /*EMPTY*/; else # endif cp = resolved; } } #endif /* MSDOS */ #ifdef FD else if (!(flags & RLP_READLINK) && resolved != fullpath && *fullpath) { cp = Xstrcpy(resolved, fullpath); # ifdef DEP_PATHTOP tlen = getpathtop(resolved, NULL, NULL); # endif } #endif /* FD */ else cp = Xgetwd(resolved); } if (rlen > 0) { #ifdef CODEEUC rlen = strlen(resolved); #else /*EMPTY*/; #endif } else if (cp) rlen = strlen(cp); #ifdef DEP_DOSPATH else if (drv) { cp = gendospath(resolved, drv, _SC_); rlen = cp - resolved; } #endif else { copyrootpath(resolved); rlen = 1; } norealpath++; VOID_C _Xrealpath(path, strlen(path), resolved, tlen, strlen(resolved), flags); norealpath--; return(resolved); } #ifndef NOSYMLINK char *symrealpath(path, linkname, resolved, flags) CONST char *path, *linkname; char *resolved; int flags; { CONST char *cp; char buf[MAXPATHLEN]; int n; if (*linkname == _SC_) n = 0; else if ((cp = strrdelim(path, 0)) && cp > path) n = cp - path; else { path = rootpath; n = 1; } cp = (n) ? _SS_ : nullstr; n = Xsnprintf(buf, sizeof(buf), "%-.*s%s%s", n, path, cp, linkname); if (n < 0) return(NULL); return(Xrealpath(buf, resolved, flags)); } #endif /* !NOSYMLINK */ FD-3.01j/encode.c100644 2105 1751 16167 13516612560 12315 0ustar shiraiuser/* * encode.c * * MD5 message digest in RFC1321 & BASE64 encoding in RFC3548 */ #include "headers.h" #include "kctype.h" #include "sysemu.h" #include "pathname.h" #include "encode.h" static VOID NEAR voidmd5 __P_((u_long, u_long, u_long, u_long)); static VOID NEAR calcmd5 __P_((md5_t *)); static VOID NEAR initmd5 __P_((md5_t *)); static VOID NEAR addmd5 __P_((md5_t *, CONST u_char *, ALLOC_T)); static VOID NEAR endmd5 __P_((md5_t *, u_char *, ALLOC_T *)); static VOID NEAR base64encodechar __P_((char *, int, int)); static CONST char encode64table[64] = { 'A', 'B', 'C', 'D', 'E', 'F', 'G', 'H', 'I', 'J', 'K', 'L', 'M', 'N', 'O', 'P', 'Q', 'R', 'S', 'T', 'U', 'V', 'W', 'X', 'Y', 'Z', 'a', 'b', 'c', 'd', 'e', 'f', 'g', 'h', 'i', 'j', 'k', 'l', 'm', 'n', 'o', 'p', 'q', 'r', 's', 't', 'u', 'v', 'w', 'x', 'y', 'z', '0', '1', '2', '3', '4', '5', '6', '7', '8', '9', '+', '/', }; /*ARGSUSED*/ static VOID NEAR voidmd5(a, b, c, d) u_long a, b, c, d; { /* For bugs on NEWS-OS optimizer */ } static VOID NEAR calcmd5(md5p) md5_t *md5p; { u_long a, b, c, d, tmp, t[MD5_BLOCKS]; int i, s[MD5_BUFSIZ]; a = md5p -> sum[0]; b = md5p -> sum[1]; c = md5p -> sum[2]; d = md5p -> sum[3]; s[0] = 7; s[1] = 12; s[2] = 17; s[3] = 22; t[0] = 0xd76aa478; /* floor(4294967296.0 * fabs(sin(1.0))) */ t[1] = 0xe8c7b756; t[2] = 0x242070db; t[3] = 0xc1bdceee; t[4] = 0xf57c0faf; t[5] = 0x4787c62a; t[6] = 0xa8304613; t[7] = 0xfd469501; t[8] = 0x698098d8; t[9] = 0x8b44f7af; t[10] = 0xffff5bb1; t[11] = 0x895cd7be; t[12] = 0x6b901122; t[13] = 0xfd987193; t[14] = 0xa679438e; t[15] = 0x49b40821; for (i = 0; i < MD5_BLOCKS; i++) { a += ((b & c) | (~b & d)) + (md5p -> x[i]) + t[i]; a &= (u_long)0xffffffff; tmp = b + ((a << s[i % MD5_BUFSIZ]) | a >> (32 - s[i % MD5_BUFSIZ])); tmp &= (u_long)0xffffffff; a = d; d = c; c = b; b = tmp; voidmd5(a, b, c, d); } s[0] = 5; s[1] = 9; s[2] = 14; s[3] = 20; t[0] = 0xf61e2562; /* floor(4294967296.0 * fabs(sin(16.0))) */ t[1] = 0xc040b340; t[2] = 0x265e5a51; t[3] = 0xe9b6c7aa; t[4] = 0xd62f105d; t[5] = 0x02441453; t[6] = 0xd8a1e681; t[7] = 0xe7d3fbc8; t[8] = 0x21e1cde6; t[9] = 0xc33707d6; t[10] = 0xf4d50d87; t[11] = 0x455a14ed; t[12] = 0xa9e3e905; t[13] = 0xfcefa3f8; t[14] = 0x676f02d9; t[15] = 0x8d2a4c8a; for (i = 0; i < MD5_BLOCKS; i++) { a += ((b & d) | (c & ~d)) + (md5p -> x[(i * 5 + 1) % MD5_BLOCKS]) + t[i]; a &= (u_long)0xffffffff; tmp = b + ((a << s[i % MD5_BUFSIZ]) | a >> (32 - s[i % MD5_BUFSIZ])); tmp &= (u_long)0xffffffff; a = d; d = c; c = b; b = tmp; voidmd5(a, b, c, d); } s[0] = 4; s[1] = 11; s[2] = 16; s[3] = 23; t[0] = 0xfffa3942; /* floor(4294967296.0 * fabs(sin(32.0))) */ t[1] = 0x8771f681; t[2] = 0x6d9d6122; t[3] = 0xfde5380c; t[4] = 0xa4beea44; t[5] = 0x4bdecfa9; t[6] = 0xf6bb4b60; t[7] = 0xbebfbc70; t[8] = 0x289b7ec6; t[9] = 0xeaa127fa; t[10] = 0xd4ef3085; t[11] = 0x04881d05; t[12] = 0xd9d4d039; t[13] = 0xe6db99e5; t[14] = 0x1fa27cf8; t[15] = 0xc4ac5665; for (i = 0; i < MD5_BLOCKS; i++) { a += (b ^ c ^ d) + (md5p -> x[(i * 3 + 5) % MD5_BLOCKS]) + t[i]; a &= (u_long)0xffffffff; tmp = b + ((a << s[i % MD5_BUFSIZ]) | a >> (32 - s[i % MD5_BUFSIZ])); tmp &= (u_long)0xffffffff; a = d; d = c; c = b; b = tmp; voidmd5(a, b, c, d); } s[0] = 6; s[1] = 10; s[2] = 15; s[3] = 21; t[0] = 0xf4292244; /* floor(4294967296.0 * fabs(sin(48.0))) */ t[1] = 0x432aff97; t[2] = 0xab9423a7; t[3] = 0xfc93a039; t[4] = 0x655b59c3; t[5] = 0x8f0ccc92; t[6] = 0xffeff47d; t[7] = 0x85845dd1; t[8] = 0x6fa87e4f; t[9] = 0xfe2ce6e0; t[10] = 0xa3014314; t[11] = 0x4e0811a1; t[12] = 0xf7537e82; t[13] = 0xbd3af235; t[14] = 0x2ad7d2bb; t[15] = 0xeb86d391; for (i = 0; i < MD5_BLOCKS; i++) { a += (c ^ (b | ~d)) + (md5p -> x[(i * 7) % MD5_BLOCKS]) + t[i]; a &= (u_long)0xffffffff; tmp = b + ((a << s[i % MD5_BUFSIZ]) | a >> (32 - s[i % MD5_BUFSIZ])); tmp &= (u_long)0xffffffff; a = d; d = c; c = b; b = tmp; voidmd5(a, b, c, d); } md5p -> sum[0] = (md5p -> sum[0] + a) & (u_long)0xffffffff; md5p -> sum[1] = (md5p -> sum[1] + b) & (u_long)0xffffffff; md5p -> sum[2] = (md5p -> sum[2] + c) & (u_long)0xffffffff; md5p -> sum[3] = (md5p -> sum[3] + d) & (u_long)0xffffffff; } static VOID NEAR initmd5(md5p) md5_t *md5p; { md5p -> cl = md5p -> ch = (u_long)0; md5p -> sum[0] = (u_long)0x67452301; md5p -> sum[1] = (u_long)0xefcdab89; md5p -> sum[2] = (u_long)0x98badcfe; md5p -> sum[3] = (u_long)0x10325476; memset((char *)(md5p -> x), 0, sizeof(md5p -> x)); md5p -> n = md5p -> b = 0; } static VOID NEAR addmd5(md5p, s, len) md5_t *md5p; CONST u_char *s; ALLOC_T len; { while (len--) { if (md5p -> cl <= (u_long)0xffffffff - (u_long)BITSPERBYTE) md5p -> cl += (u_long)BITSPERBYTE; else { md5p -> cl -= (u_long)0xffffffff - (u_long)BITSPERBYTE + 1; (md5p -> ch)++; md5p -> ch &= (u_long)0xffffffff; } md5p -> x[md5p -> n] |= ((u_long)(*(s++)) << (md5p -> b)); if ((md5p -> b += BITSPERBYTE) >= BITSPERBYTE * 4) { md5p -> b = 0; if (++(md5p -> n) >= MD5_BLOCKS) { md5p -> n = 0; calcmd5(md5p); memset((char *)(md5p -> x), 0, sizeof(md5p -> x)); } } } } static VOID NEAR endmd5(md5p, buf, sizep) md5_t *md5p; u_char *buf; ALLOC_T *sizep; { ALLOC_T ptr; int i, n; md5p -> x[md5p -> n] |= (1 << ((md5p -> b) + BITSPERBYTE - 1)); if (md5p -> n >= 14) { calcmd5(md5p); memset((char *)(md5p -> x), 0, sizeof(md5p -> x)); } md5p -> x[14] = md5p -> cl; md5p -> x[15] = md5p -> ch; calcmd5(md5p); ptr = (ALLOC_T)0; for (i = 0; i < MD5_BUFSIZ; i++) for (n = 0; n < 4; n++) { if (ptr >= *sizep) break; buf[ptr++] = (md5p -> sum[i] & 0xff); md5p -> sum[i] >>= BITSPERBYTE; } *sizep = ptr; } VOID md5encode(buf, sizep, s, len) u_char *buf; ALLOC_T *sizep; CONST u_char *s; ALLOC_T len; { md5_t md5; if (!s) s = (u_char *)nullstr; if (len == (ALLOC_T)-1) len = strlen((char *)s); initmd5(&md5); addmd5(&md5, s, len); endmd5(&md5, buf, sizep); } int md5fencode(buf, sizep, fp) u_char *buf; ALLOC_T *sizep; XFILE *fp; { md5_t md5; u_char tmp[MD5_FILBUFSIZ]; int n; initmd5(&md5); if (fp) for (;;) { n = Xfread((char *)tmp, sizeof(tmp), fp); if (n < 0) return(-1); else if (!n) break; addmd5(&md5, tmp, n); } endmd5(&md5, buf, sizep); return(0); } static VOID NEAR base64encodechar(s, n, val) char *s; int n, val; { val &= 0x3f; s[n] = encode64table[val]; } int base64encode(buf, size, s, len) char *buf; ALLOC_T size; CONST u_char *s; ALLOC_T len; { int i, j, n; if (len == (ALLOC_T)-1) len = strlen((char *)s); for (i = j = 0; i < len; i++) { if (j + BASE64_ENCSIZ >= size) { errno = ERANGE; return(-1); } base64encodechar(buf, j++, s[i] >> 2); n = ((s[i] << 4) & 0x30); if (i + 1 >= len) { base64encodechar(buf, j++, n); buf[j++] = '='; buf[j++] = '='; } else { base64encodechar(buf, j++, n | ((s[++i] >> 4) & 0x0f)); n = ((s[i] << 2) & 0x3c); if (i + 1 >= len) { base64encodechar(buf, j++, n); buf[j++] = '='; } else { base64encodechar(buf, j++, n | ((s[++i] >> 6) & 0x03)); base64encodechar(buf, j++, s[i]); } } } buf[j] = '\0'; errno = 0; return(0); } FD-3.01j/libc.c100644 2105 1751 27671 13516612560 11773 0ustar shiraiuser/* * libc.c * * arrangememt of library functions */ #include "fd.h" #include "log.h" #include "realpath.h" #include "parse.h" #include "kconv.h" #include "func.h" #include "kanji.h" #include "system.h" #include "termemu.h" #ifdef DEP_URLPATH #include "url.h" #endif #ifdef CYGWIN #include #endif #if MSDOS extern char *unixrealpath __P_((CONST char *, char *)); #endif #ifndef DEP_ORIGSHELL extern char **environ; #endif extern char fullpath[]; extern char *origpath; extern int hideclock; #ifndef DEP_ORIGSHELL static int NEAR _getenv2 __P_((CONST char *, int, char **)); static char **NEAR _putenv2 __P_((char *, char **)); #endif #ifdef PWNEEDERROR char Error[1024]; #endif #ifndef DEP_ORIGSHELL char **environ2 = NULL; #endif int physical_path = 0; #ifdef DEP_PSEUDOPATH char *unixpath = NULL; #endif int lostcount = 0; static char *lastpath = NULL; static int wasttyflags = 0; int stat2(path, stp) CONST char *path; struct stat *stp; { #ifdef NOSYMLINK return(Xstat(path, stp)); #else /* !NOSYMLINK */ int duperrno; if (Xstat(path, stp) < 0) { duperrno = errno; # ifdef DEP_DOSDRIVE if (dospath2(path)) { errno = duperrno; return(-1); } # endif # ifdef DEP_URLPATH if (urlpath(path, NULL, NULL, NULL)) { errno = duperrno; return(-1); } # endif if (reallstat(path, stp) < 0 || !s_islnk(stp)) { errno = duperrno; return(-1); } stp -> st_mode &= ~S_IFMT; } return(0); #endif /* !NOSYMLINK */ } int _chdir2(path) CONST char *path; { #if !MSDOS int fd, duperrno; #endif #ifdef CYGWIN char *cygdrive, tmp[MAXPATHLEN]; int len; #endif char cwd[MAXPATHLEN]; if (!Xgetwd(cwd)) copyrootpath(cwd); if (Xchdir(path) < 0) return(-1); #if !MSDOS # ifdef DEP_DOSDRIVE if (dospath2(nullstr)) /*EMPTY*/; else # endif # ifdef DEP_URLPATH if (urlpath(nullstr, NULL, NULL, NULL)) /*EMPTY*/; else # endif if ((fd = open(curpath, O_RDONLY, 0666)) >= 0) VOID_C close(fd); else { # ifdef CYGWIN if (Xgetwd(tmp)) { len = strlen(tmp); cygdrive = getcygdrive_user(); if ((*cygdrive && !strnpathcmp(tmp, cygdrive, len) && (!cygdrive[len] || cygdrive[len] == _SC_))) return(0); cygdrive = getcygdrive_system(); if ((*cygdrive && !strnpathcmp(tmp, cygdrive, len) && (!cygdrive[len] || cygdrive[len] == _SC_))) return(0); } # endif /* CYGWIN */ duperrno = errno; if (Xchdir(cwd) < 0) { lostcwd(cwd); lostcount++; } errno = duperrno; return(-1); } #endif /* !MSDOS */ return(0); } int chdir2(path) CONST char *path; { char cwd[MAXPATHLEN], tmp[MAXPATHLEN]; int duperrno; #ifdef DEBUG if (!path) { Xfree(lastpath); lastpath = NULL; # ifdef DEP_PSEUDOPATH Xfree(unixpath); unixpath = NULL; # endif return(0); } #endif /* DEBUG */ VOID_C Xrealpath(path, tmp, (physical_path) ? RLP_READLINK : 0); Xstrcpy(cwd, fullpath); Xstrcpy(fullpath, tmp); if (_chdir2(fullpath) < 0) { duperrno = errno; if (_chdir2(cwd) < 0) { lostcwd(fullpath); lostcount++; } else Xstrcpy(fullpath, cwd); errno = duperrno; return(-1); } Xfree(lastpath); lastpath = Xstrdup(cwd); #ifdef DEP_PSEUDOPATH switch (checkdrv(lastdrv, NULL)) { # ifdef DEP_DOSDRIVE case DEV_DOS: if (!unixpath) unixpath = Xstrdup(cwd); if (Xgetwd(cwd)) Xstrcpy(fullpath, cwd); VOID_C Xrealpath(fullpath, fullpath, 0); break; # endif # ifdef DEP_URLPATH case DEV_URL: if (!unixpath) unixpath = Xstrdup(cwd); break; # endif default: Xfree(unixpath); unixpath = NULL; break; } #endif /* DEP_PSEUDOPATH */ if (getconstvar(ENVPWD)) setenv2(ENVPWD, fullpath, 1); #if MSDOS if (unixrealpath(fullpath, tmp)) Xstrcpy(fullpath, tmp); #endif VOID_C entryhist(fullpath, HST_PATH | HST_UNIQ); #ifdef DEP_PTY sendparent(TE_CHDIR, fullpath); #endif return(0); } int chdir3(path, raw) CONST char *path; int raw; { #ifdef DEP_DOSDRIVE int drive; #endif CONST char *cwd; cwd = path; if (!raw && path[0] && !path[1]) switch (path[0]) { case '.': cwd = NULL; break; case '?': path = origpath; break; case '-': if (!lastpath) return(seterrno(ENOENT)); path = lastpath; break; #ifdef DEP_PSEUDOPATH case '@': if (!unixpath) return(seterrno(ENOENT)); path = unixpath; break; #endif default: break; } #ifdef DEP_DOSDRIVE if ((drive = dospath3(fullpath))) flushdrv(drive, NULL); #endif if (chdir2(path) < 0) return(-1); if (!cwd && !Xgetwd(fullpath)) lostcwd(fullpath); #ifndef _NOUSEHASH else VOID_C searchhash(NULL, nullstr, nullstr); #endif return(0); } int chdir4(path, raw, arcf) CONST char *path; int raw; CONST char *arcf; { char *eol, dupfullpath[MAXPATHLEN]; CONST char *cp; #ifndef _NOARCHIVE if (!arcf || getpathtop(path, NULL, NULL)) /*EMPTY*/; else if (!path || *path != _SC_) { if (!(cp = archchdir(path))) return(-1); if (cp != (char *)-1) { if (*cp) setlastfile(cp); } else { setlastfile(arcf); escapearch(0); } return(0); } #endif /* !_NOARCHIVE */ if (!path) return(0); Xstrcpy(dupfullpath, fullpath); if (chdir3(path, raw) < 0) return(-1); if (!filelist) return(0); else if (!(cp = underpath(dupfullpath, fullpath, -1))) setlastfile(parentpath); else if (!*(cp++)) return(0); else { if ((eol = strdelim(cp, 0))) *eol = '\0'; setlastfile(cp); } Xfree(findpattern); findpattern = NULL; #ifndef _NOARCHIVE if (archivefile) { Xstrcpy(dupfullpath, fullpath); while (archivefile) escapearch(1); Xstrcpy(fullpath, dupfullpath); } #endif /* !_NOARCHIVE */ return(0); } int mkdir2(path, mode) char *path; int mode; { char *cp1, *cp2, *eol; eol = &(path[(int)strlen(path) - 1]); while (eol > path && *eol == _SC_) eol--; #ifdef BSPATHDELIM if (onkanji1(path, eol - path)) eol++; #endif *(++eol) = '\0'; cp1 = eol; cp2 = strrdelim(path, 0); for (;;) { if (Xmkdir(path, mode) >= 0) break; if (errno != ENOENT || !cp2 || cp2 <= path) return(-1); *cp2 = '\0'; if (cp1 < eol) *cp1 = _SC_; cp1 = cp2; cp2 = strrdelim(path, 0); } while (cp1 && cp1 < eol) { cp2 = strdelim(cp1 + 1, 0); *cp1 = _SC_; if (cp2) *cp2 = '\0'; if (Xmkdir(path, mode) < 0 && errno != EEXIST) return(-1); cp1 = cp2; } return(0); } /* * strncpy2(buf, s, &(x), n): like as sprintf(buf + n, "%-*.*s", x, x, s); * strncpy2(buf, s, &(-x), n): like as sprintf(buf + n, "%s", s); */ int strncpy2(s1, s2, lenp, ptr) char *s1; CONST char *s2; int *lenp, ptr; { int i, j, r, v; for (i = j = 0; i < ptr && s2[j]; i++, j++) { if (iskanji1(s2, j)) { i++; j++; } #ifdef CODEEUC else if (isekana(s2, j)) j++; #endif } if (!i || i <= ptr) i = 0; else { s1[0] = ' '; i = 1; } v = Xsnprintf(&(s1[i]), *lenp * KANAWID + 1 - i, "%^.*s", *lenp - i, &(s2[j])); #ifdef CODEEUC r = strlen(&(s1[i])); #else r = v; #endif v += i; r += i; if (ptr >= 0) { *lenp += r - v; for (i = r; i < *lenp; i++) s1[i] = ' '; s1[i] = '\0'; } return(r); } VOID perror2(s) CONST char *s; { int duperrno; duperrno = errno; if (s) VOID_C Xfprintf(Xstderr, "%k: ", s); errputs(Xstrerror(duperrno), 0); if (isttyiomode) VOID_C Xfputc('\r', Xstderr); VOID_C fputnl(Xstderr); } #ifndef DEP_ORIGSHELL static int NEAR _getenv2(name, len, envp) CONST char *name; int len; char **envp; { int i; if (!envp) return(-1); for (i = 0; envp[i]; i++) if (!strnenvcmp(envp[i], name, len) && envp[i][len] == '=') break; return(i); } static char **NEAR _putenv2(s, envp) char *s, **envp; { char *cp, **new; int i, n, len; if ((cp = Xstrchr(s, '='))) len = (int)(cp - s); else len = strlen(s); if ((n = _getenv2(s, len, envp)) < 0) n = 0; else if (envp[n]) { Xfree(envp[n]); if (cp) envp[n] = s; else for (i = n; envp[i]; i++) envp[i] = envp[i + 1]; return(envp); } if (!cp) return(envp); new = (char **)Xrealloc(envp, (n + 2) * sizeof(char *)); new[n] = s; new[n + 1] = (char *)NULL; return(new); } #endif /* !DEP_ORIGSHELL */ char *getenv2(name) CONST char *name; { #ifdef DEP_ORIGSHELL char *cp; #else char **envpp[2]; int i, n, len; #endif #ifdef DEP_ORIGSHELL if ((cp = getshellvar(name, -1))) return(cp); if (!strnenvcmp(name, FDENV, FDESIZ) && (cp = getshellvar(&(name[FDESIZ]), -1))) return(cp); #else /* !DEP_ORIGSHELL */ len = strlen(name); envpp[0] = environ2; envpp[1] = environ; for (i = 0; i < 2; i++) { n = _getenv2(name, len, envpp[i]); if (n >= 0 && envpp[i][n]) return(&(envpp[i][n][len + 1])); if (strnenvcmp(name, FDENV, FDESIZ)) continue; n = _getenv2(&(name[FDESIZ]), len - FDESIZ, envpp[i]); if (n >= 0 && envpp[i][n]) return(&(envpp[i][n][len - FDESIZ + 1])); } #endif /* !DEP_ORIGSHELL */ return(NULL); } int setenv2(name, value, export) CONST char *name, *value; int export; { char *cp; int len; len = strlen(name); if (!value) { #ifdef DEP_ORIGSHELL return(unset(name, len)); #else cp = (char *)name; #endif } else { cp = Xmalloc(len + strlen(value) + 2); memcpy(cp, name, len); #if defined (ENVNOCASE) && !defined (DEP_ORIGSHELL) Xstrntoupper(cp, len); #endif cp[len] = '='; Xstrcpy(&(cp[len + 1]), value); } #ifdef DEP_ORIGSHELL if (((export) ? putexportvar(cp, len) : putshellvar(cp, len)) < 0) { Xfree(cp); return(-1); } #else /* !DEP_ORIGSHELL */ if (export) environ = _putenv2(cp, environ); else environ2 = _putenv2(cp, environ2); evalenv(name, len); # ifdef DEP_PTY sendparent(TE_PUTSHELLVAR, name, value, export); # endif #endif /* !DEP_ORIGSHELL */ return(0); } #ifdef USESIGACTION sigcst_t signal2(sig, func) int sig; sigcst_t func; { struct sigaction act, oact; act.sa_handler = func; # ifdef SA_INTERRUPT act.sa_flags = SA_INTERRUPT; # else act.sa_flags = 0; # endif sigemptyset(&(act.sa_mask)); sigemptyset(&(oact.sa_mask)); if (sigaction(sig, &act, &oact) < 0) return(SIG_ERR); return(oact.sa_handler); } #endif /* USESIGACTION */ int system2(command, flags) CONST char *command; int flags; { int n, wastty, mode, ret; if (!command || !*command) return(0); #ifdef FAKEUNINIT mode = 0; /* fake for -Wuninitialized */ #endif n = sigvecset(0); if ((wastty = isttyiomode)) { if (!(flags & F_ISARCH)) { Xlocate(0, n_line - 1); Xputterm(L_CLEAR); } if (n && (flags & F_NOCONFIRM)) mode = Xtermmode(0); Xstdiomode(); } #ifdef DEP_FILECONV if (!(flags & F_NOKANJICONV)) printf_defkanji++; #endif ret = dosystem(command); #ifdef DEP_FILECONV if (!(flags & F_NOKANJICONV)) printf_defkanji--; #endif LOG1(_LOG_NOTICE_, ret, "system(\"%s\");", command); #ifndef DEP_ORIGSHELL checkscreen(-1, -1); #endif sigvecset(n); if (ret >= 127 && (flags & F_NOCONFIRM)) { if (dumbterm <= 2) VOID_C Xfputc('\007', Xstderr); VOID_C Xfprintf(Xstderr, "\n%k", HITKY_K); VOID_C Xfflush(Xstderr); Xttyiomode(1); keyflush(); getkey3(0, inputkcode, 0); Xstdiomode(); VOID_C fputnl(Xstderr); } if (wastty) { Xttyiomode(wastty - 1); if (n && (flags & F_NOCONFIRM)) VOID_C Xtermmode(mode); if (!(flags & (F_NOCONFIRM | F_ISARCH)) || ((flags & F_ISARCH) && ret >= 127)) { hideclock = 1; warning(0, HITKY_K); } } return(ret); } XFILE *popen2(command, flags) CONST char *command; int flags; { XFILE *fp; int n; if (!command || !*command) return(NULL); n = sigvecset(0); wasttyflags = 0; if (isttyiomode) { wasttyflags |= F_TTYIOMODE; if (isttyiomode > 1) wasttyflags |= F_TTYNL; Xstdiomode(); } #ifdef DEP_FILECONV if (!(flags & F_NOKANJICONV)) printf_defkanji++; #endif fp = dopopen(command); #ifdef DEP_FILECONV if (!(flags & F_NOKANJICONV)) printf_defkanji--; #endif sigvecset(n); if (fp) { if (wasttyflags & F_TTYIOMODE) { Xputterm(T_KEYPAD); Xtflush(); } } else { if (dumbterm <= 2) VOID_C Xfputc('\007', Xstderr); VOID_C fputnl(Xstderr); perror2(command); VOID_C Xfflush(Xstderr); Xttyiomode(1); keyflush(); getkey3(0, inputkcode, 0); Xstdiomode(); VOID_C fputnl(Xstderr); if (wasttyflags & F_TTYIOMODE) Xttyiomode((wasttyflags & F_TTYNL) ? 1 : 0); } return(fp); } int pclose2(fp) XFILE *fp; { int ret; ret = dopclose(fp); if (wasttyflags & F_TTYIOMODE) Xttyiomode((wasttyflags & F_TTYNL) ? 1 : 0); return(ret); } char *getwd2(VOID_A) { char cwd[MAXPATHLEN]; if (!Xgetwd(cwd)) lostcwd(cwd); return(Xstrdup(cwd)); } FD-3.01j/file.c100644 2105 1751 115202 13516612560 12005 0ustar shiraiuser/* * file.c * * file accessing module */ #include "fd.h" #include "time.h" #include "termio.h" #include "realpath.h" #include "kconv.h" #include "func.h" #include "kanji.h" #ifdef DEP_URLPATH #include "urldisk.h" #endif #if MSDOS #include #endif #define MAXTMPNAMLEN 8 #define LOCKEXT "LCK" #ifndef DEP_DOSDRIVE #define DOSDIRENT 32 #define LFNENTSIZ 13 #endif #define LFNONLY " +,;=[]" #define DOSBODYLEN 8 #define DOSEXTLEN 3 #define FAT_NONE 0 #define FAT_PRIMAL 1 #define FAT_LFN 2 #define FAT_DOSDRIVE 3 #if MSDOS extern int getcurdrv __P_((VOID_A)); #endif #if defined (DEP_DOSDRIVE) && defined (DEP_DOSLFN) extern int checkdrive __P_((int)); #endif extern int mark; extern char fullpath[]; extern char *tmpfilename; extern int physical_path; #ifdef DEP_PSEUDOPATH extern char *unixpath; #endif #ifndef NOFLOCK static int NEAR fcntllock __P_((int, int)); #endif static char *NEAR excllock __P_((CONST char *, int)); #ifdef DEP_PSEUDOPATH static int NEAR pushswap __P_((VOID_A)); static VOID NEAR popswap __P_((int)); static int NEAR realchdir __P_((CONST char *)); static char *NEAR realgetwd __P_((char *)); static int NEAR realmkdir __P_((CONST char *, int)); static int NEAR realrmdir __P_((CONST char *)); #else #define realchdir Xchdir #define realgetwd Xgetwd #define realmkdir Xmkdir #define realrmdir Xrmdir #endif static int NEAR retrievecwd __P_((char *, CONST char *)); static int NEAR cpfile __P_((CONST char *, CONST char *, struct stat *, struct stat *)); static VOID changemes __P_((VOID_A)); static int NEAR genrand __P_((int)); static int dounlink __P_((CONST char *)); static int dormdir __P_((CONST char *)); #ifndef _NOWRITEFS static int NEAR isexist __P_((CONST char *)); static int NEAR realdirsiz __P_((CONST char *, int, int, int, int)); static int NEAR getnamlen __P_((int, int, int, int, int)); static int NEAR saferename __P_((CONST char *, CONST char *)); static char *NEAR maketmpfile __P_((int, int, CONST char *, CONST char *)); #if !MSDOS static off_t NEAR getdirblocksize __P_((CONST char *)); static u_char *NEAR getentnum __P_((CONST char *, off_t)); #endif static VOID NEAR restorefile __P_((char *, char *, char *)); #endif /* !_NOWRITEFS */ char *deftmpdir = NULL; #if !defined (_USEDOSCOPY) && !defined (_NOEXTRACOPY) int inheritcopy = 0; #endif short tmpumask = (short)0; #ifdef DEP_PSEUDOPATH static int pseudodrv = -1; static int *swaplist[] = { # ifdef DEP_DOSDRIVE &dosdrive, # endif # ifdef DEP_URLPATH &urldrive, # endif }; #define SWAPLISTSIZ arraysize(swaplist) #endif /* DEP_PSEUDOPATH */ #ifdef DEP_DOSEMU CONST char *nodospath(path, file) char *path; CONST char *file; { if (!_dospath(file)) return(file); path[0] = '.'; path[1] = _SC_; Xstrcpy(&(path[2]), file); return(path); } #endif /* DEP_DOSEMU */ int getstatus(namep) namelist *namep; { #ifdef DEP_DOSEMU char path[MAXPATHLEN]; #endif struct stat st, lst; CONST char *cp; cp = nodospath(path, namep -> name); if (Xlstat(cp, &lst) < 0 || stat2(cp, &st) < 0) return(-1); namep -> flags = 0; if (s_isdir(&st)) namep -> flags |= F_ISDIR; if (s_islnk(&lst)) namep -> flags |= F_ISLNK; if (isdisplnk(dispmode)) memcpy((char *)&lst, (char *)&st, sizeof(struct stat)); #if !MSDOS if (s_ischr(&lst) || s_isblk(&lst)) namep -> flags |= F_ISDEV; #endif namep -> st_mode = lst.st_mode; namep -> st_nlink = lst.st_nlink; #ifndef NOUID namep -> st_uid = lst.st_uid; namep -> st_gid = lst.st_gid; #endif #if MSDOS namep -> st_size = lst.st_size; #else namep -> st_size = isdev(namep) ? (off_t)(lst.st_rdev) : lst.st_size; #endif #ifdef HAVEFLAGS namep -> st_flags = lst.st_flags; #endif namep -> st_mtim = lst.st_mtime; namep -> flags |= logical_access2(&st); namep -> tmpflags |= F_STAT; return(0); } int cmplist(vp1, vp2) CONST VOID_P vp1; CONST VOID_P vp2; { namelist *namep1, *namep2; char *cp1, *cp2; int tmp; namep1 = (namelist *)vp1; namep2 = (namelist *)vp2; if (!sorton) return(namep1 -> ent - namep2 -> ent); #ifndef _NOPRECEDE if (!hasstat(namep1) && getstatus(namep1) < 0) return(1); if (!hasstat(namep2) && getstatus(namep2) < 0) return(-1); #endif if (!isdir(namep1) && isdir(namep2)) return(1); if (isdir(namep1) && !isdir(namep2)) return(-1); tmp = isdotdir(namep2 -> name) - isdotdir(namep1 -> name); if (tmp) return(tmp); cp1 = namep1 -> name; cp2 = namep2 -> name; tmp = 0; switch (sorton & SRT_TYPE) { case SRT_LENGTH: tmp = (int)strlen(cp1) - (int)strlen(cp2); if (tmp) break; /*FALLTHRU*/ case SRT_FILENAME: tmp = strverscmp2(cp1, cp2); break; case SRT_EXTENSION: if (isdir(namep1)) { tmp = strverscmp2(cp1, cp2); break; } cp1 += strlen(cp1); cp2 += strlen(cp2); for (;;) { while (cp1 > namep1 -> name) if (*(--cp1) == '.') break; while (cp2 > namep2 -> name) if (*(--cp2) == '.') break; if (cp2 <= namep2 -> name) { tmp = (cp1 > namep1 -> name) ? 1 : 0; break; } if (cp1 <= namep1 -> name) { tmp = -1; break; } tmp = strverscmp2(cp1 + 1, cp2 + 1); if (tmp) break; } break; case SRT_SIZE: if (isdir(namep1)) tmp = strverscmp2(cp1, cp2); else if (namep1 -> st_size < namep2 -> st_size) tmp = -1; else if (namep1 -> st_size > namep2 -> st_size) tmp = 1; break; case SRT_DATE: if (namep1 -> st_mtim < namep2 -> st_mtim) tmp = -1; else if (namep1 -> st_mtim > namep2 -> st_mtim) tmp = 1; break; default: break; } if (sorton & SRT_DESC) tmp = -tmp; if (!tmp) tmp = namep1 -> ent - namep2 -> ent; return(tmp); } #ifndef _NOTREE int cmptree(vp1, vp2) CONST VOID_P vp1; CONST VOID_P vp2; { treelist *tp1, *tp2; CONST char *cp1, *cp2; int tmp; tp1 = (treelist *)vp1; tp2 = (treelist *)vp2; if (!(tp1 -> name)) return((tp2 -> name) ? 1 : 0); if (!(tp2 -> name)) return(-1); cp1 = tp1 -> name; cp2 = tp2 -> name; tmp = 0; switch (sorton & SRT_TYPE) { case SRT_LENGTH: tmp = (int)strlen(cp1) - (int)strlen(cp2); if (tmp) break; /*FALLTHRU*/ case SRT_FILENAME: case SRT_EXTENSION: tmp = strverscmp2(cp1, cp2); break; default: break; } if (sorton & SRT_DESC) tmp = -tmp; return(tmp); } #endif /* !_NOTREE */ /*ARGSUSED*/ struct dirent *searchdir(dirp, regexp, arcregstr) DIR *dirp; CONST reg_ex_t *regexp; CONST char *arcregstr; { struct dirent *dp; #ifndef _NOARCHIVE struct stat st; namelist tmp; int i; #endif if (regexp) while ((dp = Xreaddir(dirp))) { if (regexp_exec(regexp, dp -> d_name, 1)) break; } #ifndef _NOARCHIVE else if (arcregstr) while ((dp = Xreaddir(dirp))) { if (stat2(dp -> d_name, &st) < 0 || s_isdir(&st)) continue; tmp.name = dp -> d_name; tmp.flags = 0; tmp.tmpflags = F_STAT; i = searcharcf(arcregstr, &tmp, 1, -1); if (i < 0) return(NULL); if (i) break; } #endif else dp = Xreaddir(dirp); return(dp); } int underhome(buf) char *buf; { static char *homedir = NULL; CONST char *cp; char tmp[MAXPATHLEN], cwd[MAXPATHLEN]; int len; #if MSDOS if (!buf) return(1); #endif if (!Xgetwd(cwd)) { lostcwd(cwd); return(-1); } if (!homedir) { if (!(cp = gethomedir())) return(-1); #ifdef DEP_DOSDRIVE if (dospath2(cp)) return(-1); #endif #ifdef DEP_URLPATH if (urlpath(cp, NULL, NULL, NULL)) return(-1); #endif if (getrealpath(cp, tmp, cwd) != tmp) return(-1); homedir = Xstrdup(tmp); } if (buf && !physical_path) Xstrcpy(cwd, fullpath); len = strlen(homedir); #if MSDOS if (len <= 3) cp = NULL; #else if (len <= 1) cp = NULL; #endif else cp = underpath(cwd, homedir, len); if (buf) Xstrcpy(buf, (cp) ? cp : nullstr); #ifdef DEBUG Xfree(homedir); homedir = NULL; #endif return((cp) ? 1 : 0); } int preparedir(dir) CONST char *dir; { struct stat st; char tmp[MAXPATHLEN]; CONST char *cp; cp = dir; #ifdef DEP_DOSPATH if (_dospath(dir)) cp += 2; #endif if (!isdotdir(cp)) { if (stat2(dir, &st) < 0) { if (errno != ENOENT) return(-1); if (Xmkdir(dir, 0777) < 0) { #if MSDOS if (errno != EEXIST) return(-1); if (cp[0] != _SC_ || cp[1]) { cp = getbasename(dir); if (cp[0] != '.' || cp[1]) return(-1); } st.st_mode = S_IFDIR; #else return(-1); #endif } else if (stat2(dir, &st) < 0) return(-1); } if (!s_isdir(&st)) return(seterrno(ENOTDIR)); } VOID_C entryhist(Xrealpath(dir, tmp, 0), HST_PATH | HST_UNIQ); return(0); } #ifndef NOFLOCK static int NEAR fcntllock(fd, operation) int fd, operation; { int i, n; # ifdef DEP_PSEUDOPATH if (chkopenfd(fd) != DEV_NORMAL) return(1); # endif n = -1; errno = 0; for (i = 0; i < LCK_MAXRETRY; i++) { n = Xflock(fd, operation); if (n >= 0) { n = 1; break; } # ifdef EACCES else if (errno == EACCES) /*EMPTY*/; # endif # ifdef EAGAIN else if (errno == EAGAIN) /*EMPTY*/; # endif # ifdef EWOULDBLOCK else if (errno == EWOULDBLOCK) /*EMPTY*/; # endif else break; if (intrkey(-1)) { errno = EINTR; break; } # if !MSDOS || defined (DJGPP) usleep(100000L); # endif } if (i >= LCK_MAXRETRY) return(0); return(n); } #endif /* !NOFLOCK */ static char *NEAR excllock(file, operation) CONST char *file; int operation; { #if MSDOS char *ext; #endif static char **locklist = NULL; struct stat st; char *cp, path[MAXPATHLEN]; int i, fd; if (!file) { if (locklist) { for (i = 0; locklist[i]; i++) { VOID_C unlink(locklist[i]); Xfree(locklist[i]); } Xfree(locklist); } return(NULL); } if (operation & LOCK_UN) { VOID_C Xunlink(file); if (locklist) { for (i = 0; locklist[i]; i++) if (file == locklist[i]) break; if (locklist[i]) { for (; locklist[i + 1]; i++) locklist[i] = locklist[i + 1]; locklist[i] = NULL; } if (!i) { Xfree(locklist); locklist = NULL; } } return(NULL); } #if MSDOS cp = getbasename(file); for (i = 0; cp[i]; i++) if (cp[i] == '.') break; ext = &(cp[i]); if (i > DOSBODYLEN - strsize(LOCKEXT)) i = DOSBODYLEN - strsize(LOCKEXT); i += cp - file; VOID_C Xsnprintf(path, sizeof(path), "%-.*s%s%s", i, file, LOCKEXT, ext); #else VOID_C Xsnprintf(path, sizeof(path), "%s.%s", file, LOCKEXT); #endif fd = -1; for (i = 0; i < LCK_MAXRETRY; i++) { if (!(operation & LOCK_SH)) fd = Xopen(path, O_BINARY | O_WRONLY | O_CREAT | O_EXCL, 0666 & ~tmpumask); else if (Xlstat(path, &st) >= 0) fd = seterrno(EEXIST); else fd = (errno == ENOENT) ? 0 : -1; if (fd >= 0 || errno != EEXIST) break; if (intrkey(-1)) { errno = EINTR; break; } #if !MSDOS || defined (DJGPP) usleep(100000L); #endif } if (i >= LCK_MAXRETRY) return(vnullstr); if (fd < 0) return(NULL); if (operation & LOCK_SH) return((char *)file); VOID_C Xclose(fd); cp = Xstrdup(path); i = countvar(locklist); locklist = (char **)Xrealloc(locklist, (i + 2) * sizeof(char *)); locklist[i] = cp; locklist[++i] = NULL; return(cp); } lockbuf_t *lockopen(path, flags, mode) CONST char *path; int flags, mode; { #ifndef NOFLOCK int n; #endif char *lckname; lockbuf_t *lck; int fd, err, lckflags, operation, duperrno; #ifdef FAKEUNINIT fd = -1; /* fake for -Wuninitialized */ #endif lckname = NULL; lckflags = 0; operation = ((flags & O_ACCMODE) == O_RDONLY) ? LOCK_SH : LOCK_EX; operation |= LOCK_NB; err = 0; #ifndef NOFLOCK if (isnfs(path) <= 0) { lckflags |= LCK_FLOCK; # ifdef NOFTRUNCATE fd = newdup(Xopen(path, flags, mode)); # else fd = newdup(Xopen(path, flags & ~O_TRUNC, mode)); # endif if (fd < 0) { if ((flags & O_ACCMODE) == O_WRONLY || errno != ENOENT) return(NULL); } else if ((n = fcntllock(fd, operation)) <= 0) { VOID_C Xclose(fd); if (n < 0) return(NULL); err++; lckflags &= ~LCK_FLOCK; } # ifndef NOFTRUNCATE else if ((flags & O_TRUNC) && Xftruncate(fd, (off_t)0) < 0) { duperrno = errno; VOID_C fcntllock(fd, LOCK_UN); VOID_C Xclose(fd); errno = duperrno; return(NULL); } # endif } #endif /* !NOFLOCK */ if (!(lckflags & LCK_FLOCK)) { if (!(lckname = excllock(path, operation))) return(NULL); else if (operation & LOCK_SH) { if (lckname == vnullstr) err++; lckname = NULL; } else if (lckname == vnullstr) return(NULL); if ((fd = newdup(Xopen(path, flags, mode))) >= 0) /*EMPTY*/; else if ((flags & O_ACCMODE) == O_WRONLY || errno != ENOENT) { duperrno = errno; if (lckname) { VOID_C excllock(lckname, LOCK_UN); Xfree(lckname); } errno = duperrno; return(NULL); } } if (fd < 0) lckflags |= LCK_INVALID; else if (err) { VOID_C Xfprintf(Xstderr, "%k: %k\r\n", path, NOLCK_K); if (isttyiomode) warning(0, HITKY_K); } lck = (lockbuf_t *)Xmalloc(sizeof(lockbuf_t)); lck -> fd = fd; lck -> fp = NULL; lck -> name = lckname; lck -> flags = lckflags; return(lck); } lockbuf_t *lockfopen(path, type, flags, umask) CONST char *path, *type; int flags, umask; { lockbuf_t *lck; XFILE *fp; if (!(lck = lockopen(path, flags, 0666 & ~umask))) return(NULL); if (!(lck -> flags & LCK_INVALID)) { if (!(fp = Xfdopen(lck -> fd, type))) { lockclose(lck); return(NULL); } lck -> fp = fp; } lck -> flags |= LCK_STREAM; return(lck); } VOID lockclose(lck) lockbuf_t *lck; { int duperrno; if (!lck) return; duperrno = errno; if (lck -> name) { VOID_C excllock(lck -> name, LOCK_UN); Xfree(lck -> name); } if (!(lck -> flags & LCK_INVALID)) { #ifndef NOFLOCK if (lck -> flags & LCK_FLOCK) VOID_C fcntllock(lck -> fd, LOCK_UN); #endif if (lck -> flags & LCK_STREAM) VOID_C Xfclose(lck -> fp); else VOID_C Xclose(lck -> fd); } errno = duperrno; Xfree(lck); } int touchfile(path, stp) CONST char *path; struct stat *stp; { #ifndef _NOEXTRAATTR int i; #endif #ifndef NOUID u_id_t uid; g_id_t gid; #endif struct utimes_t ut; struct stat st; u_int mode; int ret, duperrno; if (!(stp -> st_nlink)) return(0); if (Xlstat(path, &st) < 0) return(-1); if (s_islnk(&st)) return(1); ret = 0; #if MSDOS if (!(st.st_mode & S_IWUSR)) Xchmod(path, (st.st_mode | S_IWUSR)); #endif if (stp -> st_nlink & (TCH_ATIME | TCH_MTIME)) { if (!(stp -> st_nlink & TCH_ATIME)) stp -> st_atime = st.st_atime; if (!(stp -> st_nlink & TCH_MTIME)) stp -> st_mtime = st.st_mtime; ut.actime = stp -> st_atime; ut.modtime = stp -> st_mtime; duperrno = errno; if (Xutimes(path, &ut) >= 0) errno = duperrno; else ret = -1; } #ifdef HAVEFLAGS if (stp -> st_nlink & TCH_FLAGS) { duperrno = errno; if (Xchflags(path, stp -> st_flags) >= 0) errno = duperrno; else ret = -1; } #endif if (stp -> st_nlink & TCH_MODE) { mode = stp -> st_mode; mode &= ~S_IFMT; mode |= (st.st_mode & S_IFMT); #ifndef _NOEXTRAATTR if ((stp -> st_nlink & TCH_MODEEXE) && !s_isdir(&st) && !(st.st_mode & S_IEXEC_ALL)) { for (i = 0; i < 3; i++) { if (!(stp -> st_mode & (1 << (i + 12)))) continue; mode &= ~(1 << (i * 3)); mode |= (st.st_mode & (1 << (i * 3))); } } if (stp -> st_nlink & TCH_MASK) { mode &= ~(stp -> st_size); mode |= (st.st_mode & (stp -> st_size)); } #endif /* !_NOEXTRAATTR */ duperrno = errno; if (Xchmod(path, mode) >= 0) errno = duperrno; else ret = -1; } #if MSDOS else if (!(st.st_mode & S_IWUSR)) { duperrno = errno; Xchmod(path, st.st_mode); errno = duperrno; } #endif #ifndef NOUID if (stp -> st_nlink & (TCH_UID | TCH_GID)) { if (!(stp -> st_nlink & TCH_UID)) stp -> st_uid = (uid_t)-1; if (!(stp -> st_nlink & TCH_GID)) stp -> st_gid = (gid_t)-1; uid = convuid(stp -> st_uid); gid = convgid(stp -> st_gid); duperrno = errno; if (Xchown(path, uid, gid) >= 0) errno = duperrno; else if (!(stp -> st_nlink & TCH_CHANGE)) { Xchown(path, (u_id_t)-1, gid); errno = duperrno; } else ret = -1; } #endif /* !NOUID */ if (stp -> st_nlink & TCH_IGNOREERR) ret = 0; return(ret); } #ifdef DEP_PSEUDOPATH static int NEAR pushswap(VOID_A) { int i, flags; flags = 0; for (i = 0; i < SWAPLISTSIZ; i++) { flags <<= 2; flags |= (*(swaplist[i]) & 3); *(swaplist[i]) = 0; } return(flags); } static VOID NEAR popswap(flags) int flags; { int i; for (i = SWAPLISTSIZ - 1; i >= 0; i--) { *(swaplist[i]) = (flags & 3); flags >>= 2; } } static int NEAR realchdir(path) CONST char *path; { int n, flags; flags = pushswap(); n = Xchdir(path); popswap(flags); return(n); } static char *NEAR realgetwd(path) char *path; { char *cp; int flags; flags = pushswap(); cp = Xgetwd(path); popswap(flags); return(cp); } int reallstat(path, stp) CONST char *path; struct stat *stp; { int n, flags; flags = pushswap(); n = Xlstat(path, stp); popswap(flags); return(n); } static int NEAR realmkdir(path, mode) CONST char *path; int mode; { int n, flags; flags = pushswap(); n = Xmkdir(path, mode); popswap(flags); return(n); } static int NEAR realrmdir(path) CONST char *path; { int n, flags; flags = pushswap(); n = Xrmdir(path); popswap(flags); return(n); } #endif /* DEP_PSEUDOPATH */ static int NEAR retrievecwd(cwd, path) char *cwd; CONST char *path; { if (!path || realchdir(path) < 0 || !realgetwd(cwd)) return(-1); return(0); } VOID lostcwd(path) char *path; { CONST char *cp; char buf[MAXPATHLEN]; int duperrno; duperrno = errno; if (!path) path = buf; #ifdef FAKEUNINIT cp = NULL; /* fake for -Wuninitialized */ #endif if (path != fullpath && retrievecwd(path, fullpath) >= 0) cp = NOCWD_K; #ifdef DEP_PSEUDOPATH else if (retrievecwd(path, unixpath) >= 0) cp = NOPSU_K; #endif else if (retrievecwd(path, gethomedir()) >= 0) cp = GOHOM_K; else if (retrievecwd(path, rootpath) >= 0) cp = GOROT_K; else error(rootpath); if (path != fullpath) Xstrncpy(fullpath, path, MAXPATHLEN - 1); warning(0, cp); #ifndef _NOUSEHASH VOID_C searchhash(NULL, nullstr, nullstr); #endif errno = duperrno; } #ifndef NODIRLOOP int issamebody(src, dest) CONST char *src, *dest; { struct stat st1, st2; if (Xstat(src, &st1) < 0 || Xstat(dest, &st2) < 0) return(0); if (st1.st_dev != st2.st_dev || st1.st_ino != st2.st_ino) return(0); # ifdef DEP_URLPATH if (st1.st_dev == (dev_t)-1 || st1.st_ino == (ino_t)-1) return(0); # endif return(1); } #endif /* !NODIRLOOP */ #ifndef NOSYMLINK int cpsymlink(src, dest) CONST char *src, *dest; { struct stat st; char path[MAXPATHLEN]; int len; if ((len = Xreadlink(src, path, strsize(path))) < 0) return(-1); if (Xlstat(dest, &st) >= 0) { # ifndef NODIRLOOP if (issamebody(src, dest)) return(0); # endif if (Xunlink(dest) < 0) return(-1); } path[len] = '\0'; if (Xsymlink(path, dest) < 0) return(-1); return(1); } #endif /* !NOSYMLINK */ /*ARGSUSED*/ static int NEAR cpfile(src, dest, stp1, stp2) CONST char *src, *dest; struct stat *stp1, *stp2; { #if MSDOS struct stat st; #endif #ifndef NODIRLOOP int issame; #endif #ifndef _NOEXTRACOPY off_t size; #endif char buf[BUFSIZ]; off_t total; int n, fd1, fd2, tty, flags, mode, timeout, duperrno; #if MSDOS if (!stp2 && Xlstat(dest, &st) >= 0) stp2 = &st; if (stp2 && !(stp2 -> st_mode & S_IWUSR)) Xchmod(src, stp2 -> st_mode | S_IWUSR); #endif #ifndef NOSYMLINK if (s_islnk(stp1)) { # ifdef DEP_URLPATH fd1 = urlpath(src, NULL, NULL, NULL); fd2 = urlpath(dest, NULL, NULL, NULL); if (fd1 != fd2) { if (Xstat(src, stp1) < 0) return(-1); } else # endif if (cpsymlink(src, dest) < 0) return(-1); else return(0); } #endif /* !NOSYMLINK */ flags = (O_BINARY | O_RDONLY); mode = stp1 -> st_mode; #ifndef NODIRLOOP issame = issamebody(src, dest); #endif if ((fd1 = Xopen(src, flags, mode)) < 0) return(-1); flags = (O_BINARY | O_WRONLY | O_CREAT | O_TRUNC); #if MSDOS mode |= S_IWUSR; #endif #ifndef NODIRLOOP if (issame) { flags |= O_EXCL; if (Xunlink(dest) < 0) { VOID_C Xclose(fd1); return(-1); } } #endif if ((fd2 = Xopen(dest, flags, mode)) < 0) { VOID_C Xclose(fd1); return(-1); } tty = isatty(fd1); timeout = 0; #ifdef DEP_URLPATH switch (chkopenfd(fd1)) { case DEV_URL: case DEV_HTTP: timeout = urltimeout; VOID_C urlfstat(fd1, stp1); break; default: break; } #endif total = (off_t)0; if (tty) stp1 -> st_size = (off_t)-1; for (;;) { if (stp1 -> st_size >= (off_t)0 && total >= stp1 -> st_size) n = 0; else n = checkread(fd1, buf, sizeof(buf), timeout); if (n < 0) break; total += (off_t)n; if (!n) { if (total < stp1 -> st_size) n = seterrno(ETIMEDOUT); break; } #ifndef _NOEXTRACOPY size = (off_t)n; showprogress(&size); #endif if ((n = surewrite(fd2, buf, n)) < 0) break; } safeclose(fd2); safeclose(fd1); #ifndef _NOEXTRACOPY fshowprogress(dest); #endif if (n < 0) { duperrno = errno; VOID_C Xunlink(dest); errno = duperrno; return(-1); } stp1 -> st_nlink = (TCH_ATIME | TCH_MTIME | TCH_IGNOREERR); #if defined (_USEDOSCOPY) || !defined (_NOEXTRACOPY) # ifndef _USEDOSCOPY if (!inheritcopy) /*EMPTY*/; else # endif if (touchfile(dest, stp1) < 0) return(-1); #endif /* _USEDOSCOPY || !_NOEXTRACOPY */ return(0); } static VOID changemes(VOID_A) { warning(0, CHGFD_K); } int safecpfile(src, dest, stp1, stp2) CONST char *src, *dest; struct stat *stp1, *stp2; { #ifdef DEP_DOSDRIVE int drive; #endif for (;;) { if (cpfile(src, dest, stp1, stp2) >= 0) break; if (errno && errno != ENOSPC) return(-1); for (;;) { if (!yesno(NOSPC_K)) return(seterrno(ENOSPC)); #ifdef DEP_DOSDRIVE if ((drive = dospath3(dest))) { if (flushdrv(drive, changemes) < 0) continue; } else #endif changemes(); break; } } return(0); } int safemvfile(src, dest, stp1, stp2) CONST char *src, *dest; struct stat *stp1, *stp2; { if (Xrename(src, dest) >= 0) { #ifndef _NOEXTRACOPY fshowprogress(dest); #endif return(0); } if (errno != EXDEV || s_isdir(stp1)) return(-1); if (safecpfile(src, dest, stp1, stp2) < 0 || Xunlink(src) < 0) return(-1); stp1 -> st_nlink = (TCH_MODE | TCH_UID | TCH_GID | TCH_ATIME | TCH_MTIME | TCH_IGNOREERR); return (touchfile(dest, stp1)); } static int NEAR genrand(max) int max; { static long last = -1L; time_t now; if (last < 0L) { now = Xtime(NULL); last = ((now & 0xff) << 16) + (now & ~0xff) + getpid(); } do { last = last * (u_long)1103515245 + 12345; } while (last < 0L); return((last / 65537L) % max); } char *genrandname(buf, len) char *buf; int len; { static char seq[] = { #ifdef PATHNOCASE '0', '1', '2', '3', '4', '5', '6', '7', '8', '9', 'A', 'B', 'C', 'D', 'E', 'F', 'G', 'H', 'I', 'J', 'K', 'L', 'M', 'N', 'O', 'P', 'Q', 'R', 'S', 'T', 'U', 'V', 'W', 'X', 'Y', 'Z', '_' #else '0', '1', '2', '3', '4', '5', '6', '7', '8', '9', 'a', 'b', 'c', 'd', 'e', 'f', 'g', 'h', 'i', 'j', 'k', 'l', 'm', 'n', 'o', 'p', 'q', 'r', 's', 't', 'u', 'v', 'w', 'x', 'y', 'z', '_' #endif }; int i, j, c; if (!buf) { for (i = 0; i < arraysize(seq); i++) { j = genrand(arraysize(seq)); c = seq[i]; seq[i] = seq[j]; seq[j] = c; } } else { for (i = 0; i < len; i++) { j = genrand(arraysize(seq)); buf[i] = seq[j]; } buf[i] = '\0'; } return(buf); } int mktmpdir(dir) char *dir; { char *cp, path[MAXPATHLEN]; int n, len, mask; if (!deftmpdir || !*deftmpdir || !dir) return(seterrno(ENOENT)); VOID_C Xrealpath(deftmpdir, path, RLP_READLINK); Xfree(deftmpdir); #if defined (DEP_DOSDRIVE) && defined (DEP_DOSLFN) if (checkdrive(Xtoupper(path[0]) - 'A') && !realgetwd(path)) { lostcwd(path); deftmpdir = NULL; return(-1); } #endif deftmpdir = Xstrdup(path); #if MSDOS *path = (Xisupper(getcurdrv())) ? Xtoupper(*path) : Xtolower(*path); #endif mask = 0777 & ~tmpumask; cp = strcatdelim(path); if (tmpfilename) { Xstrcpy(cp, tmpfilename); if (Xaccess(path, R_OK | W_OK | X_OK) < 0) { Xfree(tmpfilename); tmpfilename = NULL; } } if (!tmpfilename) { n = strsize(TMPPREFIX); Xstrncpy(cp, TMPPREFIX, n); len = strsize(path) - (cp - path); if (len > MAXTMPNAMLEN) len = MAXTMPNAMLEN; len -= n; genrandname(NULL, 0); for (;;) { genrandname(&(cp[n]), len); if (realmkdir(path, mask) >= 0) break; if (errno != EEXIST) return(-1); } tmpfilename = Xstrdup(cp); } if (!(n = strlen(dir))) { Xstrcpy(dir, path); return(0); } Xstrncpy((cp = strcatdelim(path)), dir, n); len = strsize(path) - (cp - path); if (len > MAXTMPNAMLEN) len = MAXTMPNAMLEN; len -= n; genrandname(NULL, 0); for (;;) { genrandname(&(cp[n]), len); if (realmkdir(path, mask) >= 0) { Xstrcpy(dir, path); return(0); } if (errno != EEXIST) break; } if (cp > path) { *(--cp) = '\0'; n = errno; realrmdir(path); errno = n; } return(-1); } int rmtmpdir(dir) CONST char *dir; { char path[MAXPATHLEN]; if (dir && *dir && realrmdir(dir) < 0) return(-1); if (!deftmpdir || !*deftmpdir || !tmpfilename || !*tmpfilename) return(seterrno(ENOENT)); strcatdelim2(path, deftmpdir, tmpfilename); if (realrmdir(path) >= 0) { Xfree(tmpfilename); tmpfilename = NULL; } else if (errno != ENOTEMPTY && errno != EEXIST && errno != EACCES) return(-1); return(0); } int opentmpfile(path, mode) CONST char *path; int mode; { char *cp; int fd, len; cp = getbasename(path); len = MAXPATHLEN - (cp - path) - 1; if (len > MAXTMPNAMLEN) len = MAXTMPNAMLEN; genrandname(NULL, 0); for (;;) { genrandname(cp, len); fd = Xopen(path, O_BINARY | O_WRONLY | O_CREAT | O_EXCL, mode); if (fd >= 0) break; if (errno != EEXIST) return(-1); } return(fd); } int mktmpfile(file) char *file; { char path[MAXPATHLEN]; int fd, duperrno; path[0] = '\0'; if (mktmpdir(path) < 0) return(-1); VOID_C strcatdelim(path); if ((fd = opentmpfile(path, 0666 & ~tmpumask)) >= 0) { Xstrcpy(file, path); return(fd); } duperrno = errno; rmtmpdir(NULL); errno = duperrno; return(-1); } int rmtmpfile(file) CONST char *file; { if ((Xunlink(file) < 0 && errno != ENOENT) || rmtmpdir(NULL) < 0) return(-1); return(0); } static int dounlink(path) CONST char *path; { if (Xunlink(path) < 0) return(APL_ERROR); return(APL_OK); } static int dormdir(path) CONST char *path; { if (isdotdir(path)) return(APL_OK); if (Xrmdir(path) < 0) return(APL_ERROR); return(APL_OK); } VOID removetmp(dir, file) char *dir; CONST char *file; { #ifdef DEP_DOSEMU char path[MAXPATHLEN]; #endif if (!dir || !*dir) /*EMPTY*/; else if (_chdir2(dir) < 0) { warning(-1, dir); *dir = '\0'; } else if (!file) VOID_C applydir(NULL, dounlink, NULL, dormdir, ORD_NOPREDIR, NULL); else if (Xunlink(nodospath(path, file)) < 0) warning(-1, file); if (_chdir2(fullpath) < 0) lostcwd(fullpath); #ifdef DEP_PSEUDOPATH shutdrv(pseudodrv); pseudodrv = -1; #endif if (dir) { if (*dir && rmtmpdir(dir) < 0) warning(-1, dir); Xfree(dir); } } int forcecleandir(dir, file) CONST char *dir, *file; { #if !MSDOS p_id_t pid; #endif extern char **environ; char *argv[4], buf[MAXPATHLEN]; VOID_C excllock(NULL, LOCK_UN); if (!dir || !*dir || !file || !*file) return(0); strcatdelim2(buf, dir, file); if (rawchdir(buf) < 0) return(0); VOID_C rawchdir(rootpath); #if MSDOS argv[0] = "DELTREE"; argv[1] = "/Y"; #else argv[0] = "rm"; argv[1] = "-rf"; #endif argv[2] = buf; argv[3] = NULL; #if MSDOS spawnve(P_WAIT, "DELTREE.EXE", argv, environ); #else if ((pid = fork()) < (p_id_t)0) return(-1); else if (!pid) { execve("/bin/rm", argv, environ); _exit(1); } #endif return(0); } #ifdef DEP_PSEUDOPATH char *dostmpdir(drive) int drive; { char path[MAXPATHLEN]; path[0] = DOSTMPPREFIX; path[1] = drive; path[2] = '\0'; if (mktmpdir(path) < 0) return(NULL); return(Xstrdup(path)); } int tmpdosdupl(dir, dirp, single) CONST char *dir; char **dirp; int single; { # ifdef DEP_DOSEMU char tmp[MAXPATHLEN]; # endif struct stat st; char *cp, *tmpdir, path[MAXPATHLEN]; int i, drive; # ifdef DEP_DOSDRIVE if ((drive = dospath2(dir))) /*EMPTY*/; else # endif # ifdef DEP_URLPATH if (urlpath(dir, NULL, NULL, &drive)) drive += '0'; else # endif return(0); if (!(tmpdir = dostmpdir(drive))) { warning(-1, dir); return(-1); } Xstrcpy(path, tmpdir); cp = strcatdelim(path); waitmes(); if (single || mark <= 0) { Xstrcpy(cp, filelist[filepos].name); st.st_mode = filelist[filepos].st_mode; st.st_atime = st.st_mtime = filelist[filepos].st_mtim; st.st_size = filelist[filepos].st_size; if (cpfile(fnodospath(tmp, filepos), path, &st, NULL) < 0) { warning(-1, filelist[filepos].name); removetmp(tmpdir, NULL); return(-1); } } else for (i = 0; i < maxfile; i++) { if (!ismark(&(filelist[i]))) continue; Xstrcpy(cp, filelist[i].name); st.st_mode = filelist[i].st_mode; st.st_atime = st.st_mtime = filelist[i].st_mtim; st.st_size = filelist[i].st_size; if (cpfile(fnodospath(tmp, i), path, &st, NULL) < 0) { warning(-1, filelist[i].name); removetmp(tmpdir, NULL); return(-1); } } if ((pseudodrv = preparedrv(fullpath, NULL, NULL)) < 0) { warning(-1, fullpath); removetmp(tmpdir, NULL); return(-1); } if (_chdir2(tmpdir) < 0) { warning(-1, tmpdir); removetmp(tmpdir, NULL); return(-1); } *dirp = tmpdir; return(drive); } int tmpdosrestore(drive, file) int drive; CONST char *file; { struct stat st; char path[MAXPATHLEN]; # ifdef DEP_DOSEMU char tmp[MAXPATHLEN]; # endif # ifdef DEP_DOSDRIVE if (isalpha(drive)) Xstrcpy(gendospath(path, drive, '\0'), file); else # endif strcatdelim2(path, fullpath, file); # ifdef DEP_DOSEMU file = nodospath(tmp, file); # endif waitmes(); if (Xlstat(file, &st) < 0 || cpfile(file, path, &st, NULL) < 0) return(-1); return(0); } #endif /* DEP_PSEUDOPATH */ #ifndef _NOWRITEFS static int NEAR isexist(file) CONST char *file; { struct stat st; if (Xlstat(file, &st) < 0 && errno == ENOENT) return(0); return(1); } static int NEAR realdirsiz(s, fat, boundary, dirsize, ofs) CONST char *s; int fat, boundary, dirsize, ofs; { int i, len, lfn, dot; if (fat == FAT_NONE) { len = (strlen(s) + ofs + boundary) & ~(boundary - 1); return(len + dirsize); } if (fat > FAT_PRIMAL && !isdotdir(s)) { lfn = dot = 0; for (i = len = 0; s[i]; i++, len++) { if (s[i] == '.') { if (dot || !i || i > DOSBODYLEN) lfn = 1; dot = i + 1; } else if (iswsjis(s, i)) { i++; lfn = 1; } else if (lfn) /*EMPTY*/; else if (Xislower(s[i])) lfn = 1; else if (Xstrchr(LFNONLY, s[i])) lfn = 1; } if (lfn) /*EMPTY*/; else if (dot) { if (i - dot > DOSEXTLEN) lfn = 1; } else if (i > DOSBODYLEN) lfn = 1; len += ofs; if (lfn) return((len / LFNENTSIZ + 1) * DOSDIRENT + DOSDIRENT); } return(DOSDIRENT); } static int NEAR getnamlen(size, fat, boundary, dirsize, ofs) int size, fat, boundary, dirsize, ofs; { if (fat == FAT_NONE) { size -= dirsize; size = (size & ~(boundary - 1)) - 1 - ofs; if (size > MAXNAMLEN) size = MAXNAMLEN; } else if (size <= DOSDIRENT) size = DOSBODYLEN; else { size -= DOSDIRENT; size = (size / DOSDIRENT) * LFNENTSIZ - 1; if (size > DOSMAXNAMLEN) size = DOSMAXNAMLEN; } return(size); } static int NEAR saferename(from, to) CONST char *from, *to; { #ifdef DEP_DOSEMU char fpath[MAXPATHLEN], tpath[MAXPATHLEN]; #endif if (!strpathcmp2(from, to)) return(0); #ifdef DEP_DOSEMU from = nodospath(fpath, from); to = nodospath(tpath, to); #endif return(Xrename(from, to)); } /*ARGSUSED*/ static char *NEAR maketmpfile(len, fat, tmpdir, old) int len, fat; CONST char *tmpdir, *old; { char *fname, path[MAXPATHLEN]; int l, fd; if (len < 0) return(NULL); fname = Xmalloc(len + 1); genrandname(NULL, 0); if (tmpdir) l = strcatdelim2(path, tmpdir, NULL) - path; #ifdef FAKEUNINIT else l = 0; /* fake for -Wuninitialized */ #endif for (;;) { genrandname(fname, len); #ifndef PATHNOCASE if (fat != FAT_NONE) Xstrtoupper(fname); #endif if (tmpdir) { Xstrcpy(&(path[l]), fname); if (!isexist(path)) { if (old) { #if !MSDOS if (isexist(fname)) /*EMPTY*/; else #endif if (saferename(old, fname) >= 0) return(fname); #if MSDOS else if (errno == EACCES) /*EMPTY*/; #endif else break; } else { fd = Xopen(fname, O_WRONLY | O_CREAT | O_EXCL, 0600); if (fd >= 0) { VOID_C Xclose(fd); return(fname); } if (errno != EEXIST) break; } } } else { if (Xmkdir(fname, 0777) >= 0) return(fname); if (errno != EEXIST) break; } } Xfree(fname); return(NULL); } #if !MSDOS static off_t NEAR getdirblocksize(dir) CONST char *dir; { struct stat st; if (Xlstat(dir, &st) < 0) return(getblocksize(dir)); return((off_t)st.st_size); } static u_char *NEAR getentnum(dir, bsiz) CONST char *dir; off_t bsiz; { struct stat st; u_char ch, *tmp; int i, n, fd; if (Xlstat(dir, &st) < 0 || (fd = Xopen(dir, O_BINARY | O_RDONLY, 0666)) < 0) return(NULL); n = (off_t)(st.st_size) / bsiz; tmp = (u_char *)Xmalloc(n + 1); for (i = 0; i < n; i++) { if (Xlseek(fd, (off_t)(i * bsiz + 3), L_SET) < 0) { Xfree(tmp); return(NULL); } if (sureread(fd, &ch, sizeof(ch)) < 0) { Xfree(tmp); return(NULL); } tmp[i] = ch + 1; } tmp[i] = 0; VOID_C Xclose(fd); return(tmp); } #endif /* !MSDOS */ static VOID NEAR restorefile(dir, path, fnamp) char *dir, *path, *fnamp; { DIR *dirp; struct dirent *dp; int n; if (!(dirp = Xopendir(dir))) warning(-1, dir); else { while ((dp = Xreaddir(dirp))) { if (isdotdir(dp -> d_name)) continue; n = strcatpath(path, fnamp, dp -> d_name); if (n < 0 || saferename(path, dp -> d_name) < 0) warning(-1, path); } VOID_C Xclosedir(dirp); } if (Xrmdir(dir) < 0) warning(-1, dir); Xfree(dir); } VOID arrangedir(fs) int fs; { #if !MSDOS off_t persec, totalent, dirblocksize; u_char *entnum; char **tmpfiles; int tmpno, block, ptr, totalptr, headbyte; #endif #ifndef PATHNOCASE int duppathignorecase; #endif DIR *dirp; struct dirent *dp; int fat, boundary, dirsize, namofs; int i, n, top, size, len, ent; CONST char *cp; char *tmp, *tmpdir, *fnamp, **fnamelist, path[MAXPATHLEN]; switch (fs) { #if !MSDOS case FSID_EFS: /* IRIX File System */ fat = FAT_NONE; headbyte = 4; boundary = 2; dirsize = sizeof(u_long); namofs = 0; break; case FSID_SYSV: /* SystemV R3 File System */ fat = FAT_NONE; headbyte = 0; boundary = 8; dirsize = sizeof(u_short); namofs = 0; break; case FSID_LINUX: /* Linux File System */ fat = FAT_NONE; headbyte = 0; boundary = 4; dirsize = 4; /* short + short */ namofs = 3; break; # ifdef DEP_DOSDRIVE case FSID_DOSDRIVE: /* Windows95 File System on DOSDRIVE */ fat = FAT_DOSDRIVE; headbyte = -1; boundary = LFNENTSIZ; dirsize = DOSDIRENT; namofs = 0; break; # endif #endif /* !MSDOS */ case FSID_FAT: /* MS-DOS File System */ fat = FAT_PRIMAL; #if !MSDOS headbyte = -1; #endif boundary = 1; dirsize = DOSDIRENT; namofs = 0; break; case FSID_LFN: /* Windows95 File System */ fat = FAT_LFN; #if !MSDOS headbyte = -1; #endif boundary = LFNENTSIZ; dirsize = DOSDIRENT; namofs = 0; break; default: fat = FAT_NONE; #if !MSDOS headbyte = 0; #endif boundary = 4; dirsize = 8; /* long + short + short */ namofs = 0; break; } top = -1; fnamelist = (char **)Xmalloc((maxfile + 1) * sizeof(char *)); for (i = 0; i < maxfile; i++) { if (isdotdir(filelist[i].name)) cp = filelist[i].name; else { if (top < 0) top = i; cp = convput(path, filelist[i].name, NULL, CVP_NEEDFILE); } #ifdef DEP_DOSEMU if (_dospath(cp)) cp += 2; #endif fnamelist[i] = Xstrdup(cp); } fnamelist[i] = NULL; if (top < 0) { freevar(fnamelist); return; } #ifndef PATHNOCASE duppathignorecase = pathignorecase; pathignorecase = (fat != FAT_NONE) ? 1 : 0; #endif noconv++; size = realdirsiz(fnamelist[top], fat, boundary, dirsize, namofs); len = getnamlen(size, fat, boundary, dirsize, namofs); if (!(tmpdir = maketmpfile(len, fat, NULL, NULL))) { warning(0, NOWRT_K); freevar(fnamelist); #ifndef PATHNOCASE pathignorecase = duppathignorecase; #endif noconv--; return; } #if !MSDOS persec = getblocksize(tmpdir); dirblocksize = getdirblocksize(tmpdir); #endif fnamp = strcatdelim2(path, tmpdir, NULL); waitmes(); if (!(dirp = Xopendir(curpath))) { freevar(fnamelist); #ifndef PATHNOCASE pathignorecase = duppathignorecase; #endif noconv--; lostcwd(path); return; } i = ent = 0; while ((dp = Xreaddir(dirp))) { if (isdotdir(dp -> d_name)) continue; else if (!strpathcmp2(dp -> d_name, tmpdir)) { #if MSDOS if (!(dp -> d_alias[0])) len = DOSBODYLEN; #else /* !MSDOS */ # ifdef DEP_DOSDRIVE if (fat == FAT_DOSDRIVE && wrap_reclen(dp) == DOSDIRENT) len = DOSBODYLEN; # endif #endif /* !MSDOS */ ent = i; } else { n = strcatpath(path, fnamp, dp -> d_name); if (n < 0 || saferename(dp -> d_name, path) < 0) { warning(-1, dp -> d_name); VOID_C Xclosedir(dirp); restorefile(tmpdir, path, fnamp); freevar(fnamelist); #ifndef PATHNOCASE pathignorecase = duppathignorecase; #endif noconv--; return; } } i++; } VOID_C Xclosedir(dirp); if (ent > 0) { if (!(tmp = maketmpfile(len, fat, tmpdir, tmpdir))) { warning(-1, tmpdir); restorefile(tmpdir, path, fnamp); freevar(fnamelist); #ifndef PATHNOCASE pathignorecase = duppathignorecase; #endif noconv--; return; } Xfree(tmpdir); tmpdir = tmp; fnamp = strcatdelim2(path, tmpdir, NULL); } #if !MSDOS if (fs != FSID_EFS) entnum = NULL; /* except IRIX File System */ else if (!(entnum = getentnum(curpath, persec))) { warning(-1, curpath); restorefile(tmpdir, path, fnamp); freevar(fnamelist); #ifndef PATHNOCASE pathignorecase = duppathignorecase; #endif noconv--; return; } totalent = headbyte + realdirsiz(tmpdir, fat, boundary, dirsize, namofs) + realdirsiz(curpath, fat, boundary, dirsize, namofs) + realdirsiz(parentpath, fat, boundary, dirsize, namofs); block = tmpno = 0; ptr = 3; totalptr = 0; if (entnum) totalptr = entnum[block]; tmpfiles = NULL; #endif /* !MSDOS */ for (i = 0; i < maxfile; i++) { if (isdotdir(fnamelist[i]) || i == top) continue; #if !MSDOS ent = dirblocksize - totalent; size = realdirsiz(fnamelist[i], fat, boundary, dirsize, namofs); switch (fs) { case FSID_EFS: /* IRIX File System */ if (totalptr > ptr + 1) ent -= totalptr; else ent -= ptr + 1; break; case FSID_SYSV: /* SystemV R3 File System */ case FSID_FAT: /* MS-DOS File System */ case FSID_LFN: /* Windows95 File System */ ent = size; break; default: break; } if (ent < size) { n = getnamlen(ent, fat, boundary, dirsize, namofs); if (n > 0) { tmpfiles = b_realloc(tmpfiles, tmpno, char *); tmpfiles[tmpno++] = maketmpfile(n, fat, tmpdir, NULL); } ptr = 0; totalent = headbyte; if (entnum) totalptr = entnum[++block]; } #endif /* !MSDOS */ n = strcatpath(path, fnamp, fnamelist[i]); if (n < 0 || saferename(path, fnamelist[i]) < 0) { warning(-1, path); break; } #if !MSDOS totalent += size; ptr++; #endif } #if !MSDOS Xfree(entnum); if (tmpfiles) { for (i = 0; i < tmpno; i++) if (tmpfiles[i]) { if (Xunlink(tmpfiles[i]) < 0) warning(-1, tmpfiles[i]); Xfree(tmpfiles[i]); } Xfree(tmpfiles); } #endif if (!(tmp = maketmpfile(len, fat, tmpdir, tmpdir))) warning(-1, tmpdir); else { Xfree(tmpdir); tmpdir = tmp; } fnamp = strcatdelim2(path, tmpdir, NULL); n = strcatpath(path, fnamp, fnamelist[top]); if (n < 0 || saferename(path, fnamelist[top]) < 0) warning(-1, path); restorefile(tmpdir, path, fnamp); freevar(fnamelist); #ifndef PATHNOCASE pathignorecase = duppathignorecase; #endif noconv--; } #endif /* !_NOWRITEFS */ FD-3.01j/mntinfo.c100644 2105 1751 16531 13516612560 12525 0ustar shiraiuser/* * mntinfo.c * * mount information module */ #include "headers.h" #include "kctype.h" #include "string.h" #include "malloc.h" #include "pathname.h" #include "mntinfo.h" #include "fsinfo.h" #ifdef USEREADMTAB static char *NEAR getmntfield __P_((char **)); #endif #if defined (USEGETFSSTAT) || defined (USEGETVFSTAT) \ || defined (USEMNTCTL) || defined (USEMNTINFOR) || defined (USEMNTINFO) \ || defined (USEGETMNT) static int mnt_ptr = 0; static int mnt_size = 0; #endif #ifdef HAVEPROCMNT int hasmounted(VOID_A) { static int mounted = -1; if (mounted < 0) mounted = (access(MOUNTED, F_OK)) ? 0 : 1; return(mounted); } char *getmounted(VOID_A) { return((hasmounted()) ? MOUNTED : PROCMOUNTS); } #endif /* HAVEPROCMNT */ #ifdef USEMNTCTL /*ARGSUSED*/ FILE *Xsetmntent(file, mode) CONST char *file, *mode; { char *buf; mntctl(MCTL_QUERY, sizeof(int), (struct vmount *)&mnt_size); buf = Xmalloc(mnt_size); mntctl(MCTL_QUERY, mnt_size, (struct vmount *)buf); mnt_ptr = 0; return((FILE *)buf); } mnt_t *Xgetmntent(fp, mntp) FILE *fp; mnt_t *mntp; { static char *fsname = NULL; static char *dir = NULL; static char *type = NULL; struct vfs_ent *entp; struct vmount *vmntp; char *cp, *buf, *host; ALLOC_T len; if (mnt_ptr >= mnt_size) return(NULL); buf = (char *)fp; vmntp = (struct vmount *)&(buf[mnt_ptr]); cp = &(buf[mnt_ptr + vmntp -> vmt_data[VMT_OBJECT].vmt_off]); len = strlen(cp) + 1; if (!(vmntp -> vmt_flags & MNT_REMOTE)) { fsname = Xrealloc(fsname, len); memcpy(fsname, cp, len); } else { host = &(buf[mnt_ptr + vmntp -> vmt_data[VMT_HOSTNAME].vmt_off]); len += strlen(host) + 1; fsname = Xrealloc(fsname, len); Xstrcpy(Xstrcpy(Xstrcpy(fsname, host), ":"), cp); } cp = &(buf[mnt_ptr + vmntp -> vmt_data[VMT_STUB].vmt_off]); len = strlen(cp) + 1; dir = Xrealloc(dir, len); memcpy(dir, cp, len); entp = getvfsbytype(vmntp -> vmt_gfstype); if (entp) { cp = entp -> vfsent_name; len = strlen(cp) + 1; type = Xrealloc(type, len); memcpy(type, cp, len); } else if (type) { Xfree(type); type = NULL; } mntp -> Xmnt_fsname = fsname; mntp -> Xmnt_dir = dir; mntp -> Xmnt_type = (type) ? type : "???"; mntp -> Xmnt_opts = (vmntp -> vmt_flags & MNT_READONLY) ? "ro" : nullstr; mnt_ptr += vmntp -> vmt_length; return(mntp); } #endif /* USEMNTCTL */ #if defined (USEMNTINFOR) || defined (USEMNTINFO) \ || defined (USEGETFSSTAT) || defined (USEGETVFSTAT) # ifdef USEGETVFSTAT # define f_flags f_flag # define getfsstat2 getvfsstat typedef struct statvfs mntinfo_t; # else # define getfsstat2 getfsstat typedef struct statfs mntinfo_t; # endif # if !defined (MNT_RDONLY) && defined (M_RDONLY) # define MNT_RDONLY M_RDONLY # endif /*ARGSUSED*/ FILE *Xsetmntent(file, mode) CONST char *file, *mode; { # ifndef USEMNTINFO int size; # endif mntinfo_t *buf; buf = NULL; mnt_ptr = mnt_size = 0; # ifdef DEBUG _mtrace_file = "getmntinfo(start)"; # endif # ifdef USEMNTINFO mnt_size = getmntinfo(&buf, MNT_NOWAIT); # else /* !USEMNTINFO */ # ifdef USEMNTINFOR size = 0; getmntinfo_r(&buf, MNT_WAIT, &mnt_size, &size); # else size = (getfsstat2(NULL, 0, MNT_WAIT) + 1) * sizeof(mntinfo_t); if (size > 0) { buf = (mntinfo_t *)Xmalloc(size); mnt_size = getfsstat2(buf, size, MNT_WAIT); } # endif # endif /* !USEMNTINFO */ # ifdef DEBUG if (_mtrace_file) _mtrace_file = NULL; else { _mtrace_file = "getmntinfo(end)"; malloc(0); /* dummy malloc */ } # endif return((FILE *)buf); } mnt_t *Xgetmntent(fp, mntp) FILE *fp; mnt_t *mntp; { # if defined (USEMNTINFO) || defined (USEGETVFSTAT) # ifdef USEVFCNAME struct vfsconf *conf; # define getvfsbynumber(n) \ ((conf = getvfsbytype(n)) \ ? conf -> vfc_name : NULL) # else /* !USEVFCNAME */ # ifdef USEFFSTYPE # define getvfsbynumber(n) \ (buf[mnt_ptr].f_fstypename) # else /* !USEFFSTYPE */ # ifdef INITMOUNTNAMES static char *mnt_names[] = INITMOUNTNAMES; # define getvfsbynumber(n) \ (((n) <= MOUNT_MAXTYPE) \ ? mnt_names[n] : NULL) # else # define getvfsbynumber(n) \ (NULL) # endif # endif /* !USEFFSTYPE */ # endif /* !USEVFCNAME */ # else /* !USEMNTINFO && !USEGETVFSTAT */ # ifdef USEGETFSSTAT # define getvfsbynumber(n) \ (((n) <= MOUNT_MAXTYPE) \ ? mnt_names[n] : NULL) # endif # endif /* !USEMNTINFO && !USEGETVFSTAT */ static char *fsname = NULL; static char *dir = NULL; static char *type = NULL; mntinfo_t *buf; char *cp; ALLOC_T len; if (mnt_ptr >= mnt_size) return(NULL); buf = (mntinfo_t *)fp; # ifdef DEBUG _mtrace_file = "getmntent(start)"; # endif len = strlen(buf[mnt_ptr].f_mntfromname) + 1; fsname = Xrealloc(fsname, len); memcpy(fsname, buf[mnt_ptr].f_mntfromname, len); len = strlen(buf[mnt_ptr].f_mntonname) + 1; dir = Xrealloc(dir, len); memcpy(dir, buf[mnt_ptr].f_mntonname, len); cp = (char *)getvfsbynumber(buf[mnt_ptr].f_type); if (cp) { len = strlen(cp) + 1; type = Xrealloc(type, len); memcpy(type, cp, len); } else if (type) { Xfree(type); type = NULL; } # ifdef DEBUG if (_mtrace_file) _mtrace_file = NULL; else { _mtrace_file = "getmntent(end)"; malloc(0); /* dummy malloc */ } # endif mntp -> Xmnt_fsname = fsname; mntp -> Xmnt_dir = dir; mntp -> Xmnt_type = (type) ? type : "???"; mntp -> Xmnt_opts = (buf[mnt_ptr].f_flags & MNT_RDONLY) ? "ro" : nullstr; mnt_ptr++; return(mntp); } #endif /* USEMNTINFOR || USEMNTINFO || USEGETFSSTAT || USEGETVFSTAT */ #ifdef USEGETMNT /*ARGSUSED*/ FILE *Xsetmntent(file, mode) CONST char *file, *mode; { mnt_ptr = 0; return((FILE *)1); } /*ARGSUSED*/ mnt_t *Xgetmntent(fp, mntp) FILE *fp; mnt_t *mntp; { static char *fsname = NULL; static char *dir = NULL; static char *type = NULL; struct fs_data buf; ALLOC_T len; if (getmnt(&mnt_ptr, &buf, sizeof(buf), NOSTAT_MANY, NULL) <= 0) return(NULL); len = strlen(buf.fd_req.devname) + 1; fsname = Xrealloc(fsname, len); memcpy(fsname, buf.fd_req.devname, len); len = strlen(buf.fd_req.path) + 1; dir = Xrealloc(dir, len); memcpy(dir, buf.fd_req.path, len); len = strlen(gt_names[buf.fd_req.fstype]) + 1; type = Xrealloc(type, len); memcpy(type, gt_names[buf.fd_req.fstype], len); mntp -> Xmnt_fsname = fsname; mntp -> Xmnt_dir = dir; mntp -> Xmnt_type = type; mntp -> Xmnt_opts = (buf.fd_req.flags & M_RONLY) ? "ro" : nullstr; return(mntp); } #endif /* USEGETMNT */ #ifdef USEREADMTAB static char *NEAR getmntfield(cpp) char **cpp; { char *s; if (!cpp || !*cpp || !**cpp) return(vnullstr); while (Xisspace(**cpp)) (*cpp)++; if (!**cpp) return(vnullstr); s = *cpp; while (**cpp && !Xisspace(**cpp)) (*cpp)++; if (**cpp) *((*cpp)++) = '\0'; return(s); } FILE *Xsetmntent(file, mode) CONST char *file, *mode; { return(fopen(file, mode)); } mnt_t *Xgetmntent(fp, mntp) FILE *fp; mnt_t *mntp; { static char buf[BUFSIZ]; char *cp; if (!(cp = fgets(buf, sizeof(buf), fp))) return(NULL); mntp -> Xmnt_fsname = mntp -> Xmnt_dir = mntp -> Xmnt_type = mntp -> Xmnt_opts = NULL; mntp -> Xmnt_fsname = getmntfield(&cp); mntp -> Xmnt_dir = getmntfield(&cp); mntp -> Xmnt_type = getmntfield(&cp); mntp -> Xmnt_opts = getmntfield(&cp); return(mntp); } #endif /* USEREADMTAB */ char *Xhasmntopt(mntp, opt) mnt_t *mntp; CONST char *opt; { CONST char *cp; ALLOC_T len; len = strlen(opt); for (cp = mntp -> Xmnt_opts; cp && *cp;) { if (!strncmp(cp, opt, len) && (!cp[len] || cp[len] == ',')) return((char *)cp); if ((cp = Xstrchr(cp, ','))) cp++; } return(NULL); } FD-3.01j/statfs.c100644 2105 1751 477 13516612560 12321 0ustar shiraiuser/* * statfs.c * * file system information module */ #include "headers.h" #include "fsinfo.h" #ifdef USEFSTATFS int Xstatfs(path, buf) CONST char *path; statfs_t *buf; { int n, fd; if ((fd = open(path, O_RDONLY, 0666)) < 0) return(-1); n = fstatfs(fd, buf); close(fd); return(n); } #endif /* USEFSTATFS */ FD-3.01j/apply.c100644 2105 1751 127554 13516612560 12230 0ustar shiraiuser/* * apply.c * * apply function to files */ #include "fd.h" #include "time.h" #include "realpath.h" #include "parse.h" #include "func.h" #include "kanji.h" #define MAXTIMESTR 8 #define ATTRWIDTH 10 #define AT_MODE 0 #define AT_FLAG 1 #define AT_DATE 2 #define AT_TIME 3 #define AW_FILENAME 16 #define AW_OMITNAME 12 #define AW_MODE (WMODE - 1) #define AW_FLAG 8 #define AW_DATE 8 #define AW_TIME 8 #if MSDOS #define DIRENTSIZ(s) DOSDIRENT #else #define DIRENTSIZ(s) (sizeof(struct dirent) \ - DNAMESIZE + strlen(s) + 1) #endif #ifdef _NOEXTRACOPY #define MAXCOPYITEM 4 #define FLAG_SAMEDIR 0 #else #define MAXCOPYITEM 5 #define FLAG_SAMEDIR 8 #endif typedef struct _attrib_t { short nlink; u_int mode; #ifdef HAVEFLAGS u_long flags; #endif #ifndef _NOEXTRAATTR u_int mask; # ifndef NOUID u_id_t uid; g_id_t gid; # endif #endif /* !_NOEXTRAATTR */ char timestr[2][MAXTIMESTR + 1]; } attrib_t; extern reg_ex_t *findregexp; extern int subwindow; extern int win_x; extern int win_y; extern int lcmdline; extern int maxcmdline; extern int mark; #ifdef HAVEFLAGS extern CONST u_long fflaglist[]; #endif #if !defined (_USEDOSCOPY) && !defined (_NOEXTRACOPY) extern int inheritcopy; #endif static int NEAR issamedir __P_((CONST char *, CONST char *)); static int NEAR islowerdir __P_((VOID_A)); static char *NEAR getdestdir __P_((CONST char *, CONST char *)); static int NEAR getdestpath __P_((CONST char *, char *, struct stat *)); static int NEAR getcopypolicy __P_((CONST char *)); static int NEAR getremovepolicy __P_((CONST char *, int)); static int NEAR checkdupl __P_((CONST char *, char *, struct stat *, struct stat *)); static int NEAR checkrmv __P_((CONST char *, int)); #ifndef _NOEXTRACOPY static int NEAR isxdev __P_((CONST char *, struct stat *)); static VOID NEAR addcopysize __P_((off_t *)); static VOID NEAR _showprogress __P_((int)); static int countcopysize __P_((CONST char *)); static int countmovesize __P_((CONST char *)); static int NEAR prepareprogress __P_((int, int (*)(CONST char *))); #endif static int NEAR preparecopy __P_((int, int)); static int NEAR preparemove __P_((int, int)); static int safecopy __P_((CONST char *)); static int safemove __P_((CONST char *)); static int cpdir __P_((CONST char *)); static int touchdir __P_((CONST char *)); #ifndef _NOEXTRACOPY static int mvdir1 __P_((CONST char *)); static int mvdir2 __P_((CONST char *)); static int countremovesize __P_((CONST char *)); #endif static VOID NEAR showmode __P_((attrib_t *, int, int)); static int NEAR getattrcolumn __P_((int *)); static int NEAR getattrtype __P_((int, int *)); static VOID NEAR showattr __P_((namelist *, attrib_t *, int)); #if !defined (_NOEXTRAATTR) && !defined (NOUID) static int NEAR inputuid __P_((attrib_t *, int)); static int NEAR inputgid __P_((attrib_t *, int)); #endif static char **NEAR getdirtree __P_((char *, char **, int *, int)); static int NEAR _applydir __P_((CONST char *, int (*)(CONST char *), int (*)(CONST char *), int (*)(CONST char *), int, CONST char *, int)); static int forcecpfile __P_((CONST char *)); static int forcecpdir __P_((CONST char *)); static int forcetouchdir __P_((CONST char *)); char *destpath = NULL; #ifndef _NOEXTRACOPY int progressbar = 0; int precopymenu = 0; #endif static int copypolicy = 0; static int removepolicy = 0; static short attrnlink = 0; static u_short attrmode = 0; #ifdef HAVEFLAGS static u_long attrflags = 0; #endif #ifndef _NOEXTRAATTR static u_short attrmask = 0; # ifndef NOUID static u_id_t attruid = (u_id_t)-1; static g_id_t attrgid = (g_id_t)-1; # endif #endif /* !_NOEXTRAATTR */ static time_t attrtime = (time_t)0; static char *destdir = NULL; static short destnlink = (short)0; static u_short destmode = (u_short)0; static time_t destmtime = (time_t)-1; static time_t destatime = (time_t)-1; #ifndef _NOEXTRACOPY static char *forwardpath = NULL; #endif #ifdef DEP_PSEUDOPATH static int destdrive = -1; #endif #if !defined (_NOEXTRACOPY) && defined (DEP_DOSDRIVE) static int forwarddrive = -1; #endif #ifndef _NOEXTRACOPY static int copycolumn = -1; static int copyline = 0; static long copyunit = 0L; static long maxcopyunit = 0L; static off_t copysize = (off_t)0; static off_t maxcopysize = (off_t)0; #endif static int NEAR issamedir(path, org) CONST char *path, *org; { char path2[MAXPATHLEN], org2[MAXPATHLEN]; org = (org) ? getrealpath(org, org2, NULL) : Xgetwd(org2); if (org != org2) return(0); #ifdef DEP_DOSPATH if (dospath(path, NULL) != dospath(org2, NULL)) return(0); #endif if (getrealpath(path, path2, NULL) != path2) return(0); if (strpathcmp(path2, org2)) return(0); return(1); } static int NEAR islowerdir(VOID_A) { #ifdef DEP_DOSEMU char orgpath[MAXPATHLEN]; #endif CONST char *org; char *cp, *top, path[MAXPATHLEN], buf[MAXPATHLEN]; int len; if (!isdir(&(filelist[filepos])) || islink(&(filelist[filepos]))) return(0); org = filelist[filepos].name; #ifdef DEP_DOSEMU org = nodospath(orgpath, org); #endif Xstrcpy(path, destpath); top = path; #ifdef DEP_DOSPATH if (dospath(path, NULL) != dospath(org, NULL)) return(0); if (_dospath(path)) top += 2; #endif while ((cp = (char *)getrealpath(path, buf, NULL)) != buf) { if (cp != path) return(0); cp = strrdelim(top, 0); if (!cp || cp <= top) return(0); *cp = '\0'; } if (getrealpath(org, path, NULL) != path) return(0); len = strlen(path); if (strnpathcmp(path, buf, len) || buf[len] != _SC_) len = 0; return(len); } static char *NEAR getdestdir(mes, arg) CONST char *mes, *arg; { char *dir; if (arg && *arg) dir = Xstrdup(arg); else if (!(dir = inputstr(mes, 1, -1, NULL, HST_PATH))) return(NULL); else if (!*(dir = evalpath(dir, 0))) { dir = Xrealloc(dir, 2); dir[0] = '.'; dir[1] = '\0'; } #ifdef DEP_DOSPATH else if (_dospath(dir) && !dir[2]) { dir = Xrealloc(dir, 4); dir[2] = '.'; dir[3] = '\0'; } #endif #ifdef DEP_PSEUDOPATH if ((destdrive = preparedrv(dir, NULL, NULL)) < 0) { warning(-1, dir); Xfree(dir); return(NULL); } #endif if (preparedir(dir) < 0) { warning(-1, dir); Xfree(dir); #ifdef DEP_DOSDRIVE shutdrv(destdrive); destdrive = -1; #endif return(NULL); } return(dir); } static int NEAR getdestpath(file, dest, stp) CONST char *file; char *dest; struct stat *stp; { CONST char *cp; char *tmp; int n; Xstrcpy(dest, destpath); cp = file; if (destdir) { for (n = 0; (tmp = strdelim(cp, 0)); n++) cp = tmp + 1; for (tmp = destdir; n > 0 && (tmp = strdelim(tmp, 0)); tmp++) n--; if (tmp) *tmp = '\0'; if (*destdir) Xstrcpy(strcatdelim(dest), destdir); } Xstrcpy(strcatdelim(dest), cp); if (Xlstat(file, stp) < 0) { warning(-1, file); return(-1); } return(0); } static int NEAR getcopypolicy(s) CONST char *s; { #ifndef _NOEXTRACOPY # ifdef DEP_PSEUDOPATH int dupdestdrive; # endif char *cp; #endif /* !_NOEXTRACOPY */ CONST char *str[MAXCOPYITEM]; int n, ch, val[MAXCOPYITEM]; for (;;) { Xlocate(0, L_CMDLINE); Xputterm(L_CLEAR); VOID_C Xkanjiputs(s); str[0] = UPDAT_K; val[0] = CPP_UPDATE; str[1] = RENAM_K; val[1] = CPP_RENAME; str[2] = OVERW_K; val[2] = CPP_OVERWRITE; str[3] = NOCPY_K; val[3] = CPP_NOCOPY; #ifndef _NOEXTRACOPY str[4] = FORWD_K; val[4] = CPP_FORWUPDATE; #endif n = CPP_UPDATE; ch = selectstr(&n, MAXCOPYITEM, 0, str, val); if (ch == K_ESC) return(CHK_ERROR); else if (ch != K_CR) return(CHK_CANCEL); #ifndef _NOEXTRACOPY if (n == CPP_FORWUPDATE) { str[0] = UPDAT_K; str[1] = OVERW_K; val[0] = CPP_FORWUPDATE; val[1] = CPP_FORWOVERWRITE; if (selectstr(&n, 2, 0, str, val) != K_CR) continue; # ifdef DEP_PSEUDOPATH dupdestdrive = destdrive; destdrive = -1; # endif if (!(cp = getdestdir(FRWDD_K, NULL))) continue; # ifdef DEP_PSEUDOPATH # if !defined (_NOEXTRACOPY) && defined (DEP_DOSDRIVE) forwarddrive = destdrive; # endif destdrive = dupdestdrive; # endif /* DEP_PSEUDOPATH */ if (issamedir(cp, NULL) || issamedir(cp, destpath)) { warning(EINVAL, cp); Xfree(cp); continue; } forwardpath = cp; } #endif /* !_NOEXTRACOPY */ copypolicy = n; break; } return(copypolicy); } static int NEAR getremovepolicy(s, pre) CONST char *s; int pre; { CONST char *str[4]; int i, n, ch, val[4]; Xlocate(0, L_CMDLINE); Xputterm(L_CLEAR); VOID_C Xkanjiputs(s); i = 0; if (pre) { str[i] = ANCNF_K; val[i++] = CHK_OK; } else { str[i] = ANYES_K; val[i++] = CHK_OK; str[i] = ANNO_K; val[i++] = CHK_ERROR; } str[i] = ANALL_K; val[i++] = RMP_REMOVEALL; str[i] = ANKEP_K; val[i++] = RMP_KEEPALL; n = CHK_OK; ch = selectstr(&n, i, 0, str, val); if (ch == K_ESC) return(CHK_ERROR); else if (ch != K_CR) return(CHK_CANCEL); else if (n <= 0) return(n); removepolicy = n; return(removepolicy); } static int NEAR checkdupl(file, dest, stp1, stp2) CONST char *file; char *dest; struct stat *stp1, *stp2; { #ifndef _NOEXTRACOPY char path[MAXPATHLEN]; #endif CONST char *s; char *cp, *tmp; int i, n; if (getdestpath(file, dest, stp1) < 0) return(CHK_ERROR); if (Xlstat(dest, stp2) < 0) { stp2 -> st_mode = S_IWUSR; if (errno == ENOENT) return(CHK_OK); warning(-1, dest); return(CHK_ERROR); } if (!s_isdir(stp2)) n = (copypolicy & ~FLAG_SAMEDIR); else if (!s_isdir(stp1)) n = CPP_RENAME; #ifdef _NOEXTRACOPY else return(CHK_EXIST); #else else if (!(copypolicy & FLAG_SAMEDIR)) return(CHK_EXIST); else { n = (copypolicy &= ~FLAG_SAMEDIR); copypolicy = 0; } #endif for (;;) { if (!n || n == CPP_RENAME) { s = SAMEF_K; i = strlen2(s) - strsize("%.*s"); cp = asprintf2(s, n_column - i, dest); #ifndef _NOEXTRACOPY copycolumn = -1; #endif if (!n) n = getcopypolicy(cp); else { Xlocate(0, L_CMDLINE); Xputterm(L_CLEAR); VOID_C Xkanjiputs(cp); } Xfree(cp); if (n < 0) return(n); } switch (n) { case CPP_UPDATE: if (stp1 -> st_mtime < stp2 -> st_mtime) return(CHK_ERROR); return(CHK_EXIST); /*NOTREACHED*/ break; case CPP_RENAME: lcmdline = L_INFO; tmp = inputstr(NEWNM_K, 1, -1, NULL, -1); if (!tmp) return(CHK_ERROR); Xstrcpy(getbasename(dest), tmp); Xfree(tmp); if (Xlstat(dest, stp2) < 0) { stp2 -> st_mode = S_IWUSR; if (errno == ENOENT) return(CHK_OK); warning(-1, dest); return(CHK_ERROR); } if (s_isdir(stp1) && s_isdir(stp2)) return(CHK_EXIST); Xputterm(T_BELL); break; case CPP_OVERWRITE: return(CHK_OVERWRITE); /*NOTREACHED*/ break; #ifndef _NOEXTRACOPY case CPP_FORWUPDATE: if (stp1 -> st_mtime < stp2 -> st_mtime) return(CHK_ERROR); /*FALLTHRU*/ case CPP_FORWOVERWRITE: strcatdelim2(path, forwardpath, file); cp = strrdelim(path, 0); *cp = '\0'; if (mkdir2(path, 0777) < 0 && errno != EEXIST) { warning(-1, path); return(CHK_ERROR); } *cp = _SC_; if (safemvfile(dest, path, stp2, NULL) < 0) { warning(-1, path); return(CHK_ERROR); } return(CHK_OVERWRITE); /*NOTREACHED*/ break; #endif /* !_NOEXTRACOPY */ default: return(CHK_ERROR); /*NOTREACHED*/ break; } } /*NOTREACHED*/ return(CHK_OK); } static int NEAR checkrmv(path, mode) CONST char *path; int mode; { #if !MSDOS struct stat *stp, st; char *tmp, dir[MAXPATHLEN]; int duperrno; #endif CONST char *s; char *cp; int n, len; #if MSDOS if (Xaccess(path, mode) >= 0) return(CHK_OK); #else /* !MSDOS */ # ifdef DEP_DOSDRIVE if (dospath2(path)) { if (Xaccess(path, mode) >= 0) return(CHK_OK); stp = NULL; } else # endif # ifdef DEP_URLPATH if (urlpath(path, NULL, NULL, NULL)) { if (Xaccess(path, mode) >= 0) return(CHK_OK); stp = NULL; } else # endif { if (reallstat(path, &st) < 0) { warning(-1, path); return(CHK_ERROR); } if (s_islnk(&st)) return(CHK_OK); if (!(tmp = strrdelim(path, 0))) copycurpath(dir); else if (tmp == path) copyrootpath(dir); else Xstrncpy(dir, path, tmp - path); if (reallstat(dir, &st) < 0) { warning(-1, dir); return(CHK_ERROR); } if (Xaccess(path, mode) >= 0) return(CHK_OK); stp = &st; } #endif /* !MSDOS */ if (errno == ENOENT) return(CHK_OK); if (errno != EACCES) { warning(-1, path); return(CHK_ERROR); } #if !MSDOS if (stp) { duperrno = errno; mode = logical_access2(stp); if (!(mode & F_ISWRI)) { errno = duperrno; warning(-1, path); return(CHK_ERROR); } } #endif /* !MSDOS */ if (removepolicy > 0) n = removepolicy; else { s = DELPM_K; len = strlen2(s) - strsize("%.*s"); cp = asprintf2(s, n_column - len, path); #ifndef _NOEXTRACOPY copycolumn = -1; #endif n = getremovepolicy(cp, 0); Xfree(cp); } if (n > 0) n -= RMP_BIAS; return(n); } #ifndef _NOEXTRACOPY /*ARGSUSED*/ static int NEAR isxdev(path, stp) CONST char *path; struct stat *stp; { # if !MSDOS struct stat st1, st2; # endif # ifdef DEP_DOSPATH if (dospath(path, NULL) != dospath(destpath, NULL)) { if (stp && Xlstat(path, stp) < 0) return(-1); return(1); } # endif # if !MSDOS if (!stp) stp = &st1; if (Xlstat(path, stp) < 0 || Xlstat(destpath, &st2) < 0) return(-1); if (stp -> st_dev != st2.st_dev) return(1); # endif return(0); } static VOID NEAR addcopysize(sizep) off_t *sizep; { if (*sizep <= MAXTYPE(off_t) - maxcopysize) maxcopysize += *sizep; else { maxcopysize -= MAXTYPE(off_t) - *sizep; maxcopyunit++; } } static VOID NEAR _showprogress(n) int n; { int i, max, duperrno; duperrno = errno; max = n_column - 1; Xlocate(0, copyline); for (i = 0; i < n; i++) VOID_C XXputch('o'); for (; i < max; i++) VOID_C XXputch('.'); Xlocate(n, copyline); Xtflush(); errno = duperrno; } VOID showprogress(sizep) off_t *sizep; { off_t size; long unit; int n, max; if (!maxcopysize && !maxcopyunit) return; size = *sizep; max = n_column - 1; for (n = 0; n < max; n++) { if (size <= MAXTYPE(off_t) - copysize) copysize += size; else { copysize -= MAXTYPE(off_t) - size + 1; copyunit++; } } size = copysize; unit = copyunit; for (n = 0; n < max; n++) { if (maxcopysize <= size) size -= maxcopysize; else if (!unit) break; else { size += MAXTYPE(off_t) - maxcopysize + 1; unit--; } if (unit < maxcopyunit) break; unit -= maxcopyunit; } if (n > copycolumn) _showprogress(copycolumn = n); } VOID fshowprogress(path) CONST char *path; { CONST char *cp; off_t size; if (!(cp = strrdelim(path, 1))) cp = path; size = (off_t)DIRENTSIZ(cp); showprogress(&size); } static int countcopysize(path) CONST char *path; { struct stat st; CONST char *cp; off_t size; if (!(cp = strrdelim(path, 1))) cp = path; size = (off_t)DIRENTSIZ(cp); addcopysize(&size); if (Xlstat(path, &st) < 0) return(APL_ERROR); size = (off_t)(st.st_size); addcopysize(&size); return(APL_OK); } static int countmovesize(path) CONST char *path; { struct stat st; CONST char *cp; off_t size; int n; if (!(cp = strrdelim(path, 1))) cp = path; size = (off_t)DIRENTSIZ(cp); addcopysize(&size); if ((n = isxdev(path, &st)) < 0) return(APL_ERROR); else if (n && !s_isdir(&st)) { size = (off_t)(st.st_size); addcopysize(&size); } return(APL_OK); } static int NEAR prepareprogress(isdir, func) int isdir; int (*func)__P_((CONST char *)); { int ret; copycolumn = -1; copyline = 0; copyunit = maxcopyunit = 0L; copysize = maxcopysize = (off_t)0; if (progressbar) { if (!isdir) { copyline = L_CMDLINE; VOID_C applyfile(func, NULL); } else { copyline = L_STACK; ret = applydir(filelist[filepos].name, func, NULL, func, ORD_NOPREDIR, NULL); if (ret == APL_ERROR) return(-1); if (ret == APL_CANCEL) { maxcopyunit = 0L; maxcopysize = (off_t)0; } } } return(0); } #endif /* !_NOEXTRACOPY */ /*ARGSUSED*/ static int NEAR preparecopy(isdir, narg) int isdir, narg; { copypolicy = (issamedir(destpath, NULL)) ? (FLAG_SAMEDIR | CPP_RENAME) : 0; #ifndef _NOEXTRACOPY if (precopymenu && !copypolicy && (isdir || narg > 1)) if (getcopypolicy(PRECP_K) < 0) return(-1); if (prepareprogress(isdir, countcopysize)) return(-1); #endif /* !_NOEXTRACOPY */ #ifdef DEP_DOSDRIVE if (dospath3(nullstr)) waitmes(); #endif return(0); } /*ARGSUSED*/ static int NEAR preparemove(isdir, narg) int isdir, narg; { copypolicy = removepolicy = 0; #ifndef _NOEXTRACOPY if (precopymenu && (isdir || narg > 1)) { if (getcopypolicy(PRECP_K) < 0) return(-1); if (getremovepolicy(PRERM_K, 1) < 0) return(-1); } if (prepareprogress(isdir, countmovesize) < 0) return(-1); #endif /* !_NOEXTRACOPY */ return(0); } static int safecopy(path) CONST char *path; { struct stat st1, st2; char dest[MAXPATHLEN]; int n; if ((n = checkdupl(path, dest, &st1, &st2)) < 0) return((n == CHK_CANCEL) ? APL_CANCEL : APL_IGNORE); if (safecpfile(path, dest, &st1, &st2) < 0) return(APL_ERROR); return(APL_OK); } static int safemove(path) CONST char *path; { struct stat st1, st2; char dest[MAXPATHLEN]; int n; if ((n = checkdupl(path, dest, &st1, &st2)) < 0 || (n = checkrmv(path, W_OK)) < 0) return((n == CHK_CANCEL) ? APL_CANCEL : APL_IGNORE); if (safemvfile(path, dest, &st1, &st2) < 0) return(APL_ERROR); return(APL_OK); } static int cpdir(path) CONST char *path; { struct stat st1, st2; char dest[MAXPATHLEN]; switch (checkdupl(path, dest, &st1, &st2)) { case CHK_OVERWRITE: /* Already exist, but not directory */ if (Xunlink(dest) < 0) return(APL_ERROR); /*FALLTHRU*/ case CHK_OK: /* Not exist */ if (Xmkdir(dest, st1.st_mode & 0777) < 0) return(APL_ERROR); destnlink = (TCH_UID | TCH_GID | TCH_ATIME | TCH_MTIME); destmode = st1.st_mode; destmtime = st1.st_mtime; destatime = st1.st_atime; break; case CHK_ERROR: case CHK_CANCEL: /* Abandon copy */ return(APL_CANCEL); /*NOTREACHED*/ break; default: /* Already exist */ destnlink = (TCH_ATIME | TCH_MTIME); destmode = st2.st_mode; destmtime = st2.st_mtime; destatime = st2.st_atime; break; } if (!(destmode & S_IWUSR)) { st1.st_nlink = TCH_MODE; st1.st_mode = (destmode | S_IWUSR); if (touchfile(dest, &st1) >= 0) destnlink |= TCH_MODE; } Xfree(destdir); destdir = &(dest[strlen(destpath)]); while (*destdir == _SC_) destdir++; destdir = Xstrdup(destdir); return(APL_OK); } /*ARGSUSED*/ static int touchdir(path) CONST char *path; { struct stat st; char dest[MAXPATHLEN]; if (getdestpath(path, dest, &st) < 0) return(APL_CANCEL); st.st_nlink = (destnlink | TCH_IGNOREERR); st.st_mode = destmode; st.st_mtime = destmtime; st.st_atime = destatime; #ifndef _USEDOSCOPY # ifndef _NOEXTRACOPY if (inheritcopy) /*EMPTY*/; else # endif st.st_nlink &= ~(TCH_ATIME | TCH_MTIME); #endif /* !_USEDOSCOPY */ if (touchfile(dest, &st) < 0) return(APL_ERROR); return(APL_OK); } #ifndef _NOEXTRACOPY static int mvdir1(path) CONST char *path; { struct stat st; int n; if ((n = checkrmv(path, R_OK | W_OK | X_OK)) < 0) { errno = EACCES; return((n == CHK_CANCEL) ? APL_CANCEL : APL_ERROR); } if ((n = cpdir(path)) < 0) return(n); if (Xlstat(path, &st) < 0) return(APL_ERROR); if (!(st.st_mode & S_IWUSR)) { st.st_nlink = TCH_MODE; st.st_mode |= S_IWUSR; if (touchfile(path, &st) < 0) return(APL_ERROR); } return(n); } static int mvdir2(path) CONST char *path; { struct stat st; char dest[MAXPATHLEN]; if (getdestpath(path, dest, &st) < 0) return(APL_CANCEL); st.st_nlink = (destnlink | TCH_IGNOREERR); st.st_mode = destmode; st.st_mtime = destmtime; st.st_atime = destatime; if (touchfile(dest, &st) < 0) return(APL_ERROR); if (Xrmdir(path) < 0) return(APL_ERROR); #ifndef _NOEXTRACOPY fshowprogress(path); #endif return(APL_OK); } static int countremovesize(path) CONST char *path; { CONST char *cp; off_t size; if (!(cp = strrdelim(path, 1))) cp = path; size = (off_t)DIRENTSIZ(cp); addcopysize(&size); return(APL_OK); } #endif /* !_NOEXTRACOPY */ /*ARGSUSED*/ int prepareremove(isdir, narg) int isdir, narg; { removepolicy = 0; #ifndef _NOEXTRACOPY if (precopymenu && (isdir || narg > 1)) if (getremovepolicy(PRERM_K, 1) < 0) return(-1); if (prepareprogress(isdir, countremovesize)) return(-1); #endif /* !_NOEXTRACOPY */ return(0); } int rmvfile(path) CONST char *path; { int n; if ((n = checkrmv(path, W_OK)) < 0) return((n == CHK_CANCEL) ? APL_CANCEL : APL_IGNORE); if (Xunlink(path) < 0) return(APL_ERROR); #ifndef _NOEXTRACOPY fshowprogress(path); #endif return(APL_OK); } int rmvdir(path) CONST char *path; { int n; if ((n = checkrmv(path, R_OK | W_OK | X_OK)) < 0) return((n == CHK_CANCEL) ? APL_CANCEL : APL_IGNORE); if (Xrmdir(path) < 0) return(APL_ERROR); #ifndef _NOEXTRACOPY fshowprogress(path); #endif return(APL_OK); } int findfile(path) CONST char *path; { if (regexp_exec(findregexp, getbasename(path), 1)) { if (path[0] == '.' && path[1] == _SC_) path += 2; Xlocate(0, L_CMDLINE); Xputterm(L_CLEAR); VOID_C XXcprintf("[%^.*k]", n_column - 2, path); if (yesno(FOUND_K)) { destpath = Xstrdup(path); return(APL_CANCEL); } } return(APL_OK); } int finddir(path) CONST char *path; { if (regexp_exec(findregexp, getbasename(path), 1)) { if (yesno(FOUND_K)) { destpath = Xstrdup(path); return(APL_CANCEL); } } return(APL_OK); } static VOID NEAR showmode(attr, x, y) attrib_t *attr; int x, y; { #ifndef _NOEXTRAATTR # if !MSDOS u_int tmp; # endif char mask[WMODE + 1]; int i; #endif /* !_NOEXTRAATTR */ char buf[WMODE + 1]; Xlocate(x, y); putmode(buf, attr -> mode, 1); #ifndef _NOEXTRAATTR putmode(mask, attr -> mask, 1); for (i = 0; buf[i] && mask[i]; i++) { if (mask[i] != '-') buf[i] = '*'; # if !MSDOS else if (!((i + 1) % 3)) { tmp = (1 << (12 + 3 - ((i + 1) / 3))); if (attr -> mode & tmp) { if (buf[i] == '-') buf[i] = '!'; else buf[i] = 'X'; } } # endif } #endif /* !_NOEXTRAATTR */ XXcputs(buf); } static int NEAR getattrcolumn(xp) int *xp; { int x1, x2; x1 = n_column / 2 - 20; x2 = n_column / 2; if (isbestomit()) { x1 += AW_FILENAME - AW_OMITNAME; x2 -= 3; } #if !defined (_NOEXTRAATTR) && !defined (NOUID) else if (iswellomit()) { x1 -= WOWNER / 2; x2 -= WOWNER / 2; } #endif if (xp) *xp = x1; return(x2); } static int NEAR getattrtype(y, wp) int y, *wp; { int typ, w; if (!y) { typ = AT_MODE; w = AW_MODE; } #ifdef HAVEFLAGS else if (y == WMODELINE - 1) { typ = AT_FLAG; w = AW_FLAG; } #endif else if (y == WMODELINE) { typ = AT_DATE; w = AW_DATE; } else { typ = AT_TIME; w = AW_TIME; } if (wp) *wp = w; return(typ); } static VOID NEAR showattr(namep, attr, yy) namelist *namep; attrib_t *attr; int yy; { struct tm *tm; char buf[WMODE + 1]; int x1, x2, y, w; tm = localtime(&(namep -> st_mtim)); x2 = getattrcolumn(&x1); w = (isbestomit()) ? AW_OMITNAME : AW_FILENAME; y = yy; Xlocate(0, y); Xputterm(L_CLEAR); Xlocate(0, ++y); Xputterm(L_CLEAR); Xlocate(x1, y); VOID_C XXcprintf("[%^-*.*k]", w, w, namep -> name); Xlocate(x2 + 3, y); VOID_C Xkanjiputs(TOLD_K); Xlocate(x2 + 13, y); VOID_C Xkanjiputs(TNEW_K); Xlocate(0, ++y); Xputterm(L_CLEAR); Xlocate(x1, y); VOID_C Xkanjiputs(TMODE_K); Xlocate(x2, y); putmode(buf, namep -> st_mode, 1); XXcputs(buf); showmode(attr, x2 + ATTRWIDTH, y); #ifdef HAVEFLAGS Xlocate(0, ++y); Xputterm(L_CLEAR); Xlocate(x1, y); VOID_C Xkanjiputs(TFLAG_K); Xlocate(x2, y); putflags(buf, namep -> st_flags); XXcputs(buf); Xlocate(x2 + ATTRWIDTH, y); putflags(buf, attr -> flags); XXcputs(buf); #endif Xlocate(0, ++y); Xputterm(L_CLEAR); Xlocate(x1, y); VOID_C Xkanjiputs(TDATE_K); Xlocate(x2, y); VOID_C XXcprintf("%02d-%02d-%02d", tm -> tm_year % 100, tm -> tm_mon + 1, tm -> tm_mday); Xlocate(x2 + ATTRWIDTH, y); XXcputs(attr -> timestr[0]); Xlocate(0, ++y); Xputterm(L_CLEAR); Xlocate(x1, y); VOID_C Xkanjiputs(TTIME_K); Xlocate(x2, y); VOID_C XXcprintf("%02d:%02d:%02d", tm -> tm_hour, tm -> tm_min, tm -> tm_sec); Xlocate(x2 + ATTRWIDTH, y); XXcputs(attr -> timestr[1]); Xlocate(0, ++y); Xputterm(L_CLEAR); #if !defined (_NOEXTRAATTR) && !defined (NOUID) if (ishardomit()) return; y = yy + 1; x2 += 20; Xlocate(x2, y++); VOID_C Xkanjiputs(TOWN_K); Xlocate(x2, y++); putowner(buf, attr -> uid); VOID_C XXputch('<'); Xattrkanjiputs(buf, attr -> nlink & TCH_UID); VOID_C XXputch('>'); # ifdef HAVEFLAGS y++; # endif Xlocate(x2, y++); VOID_C Xkanjiputs(TGRP_K); Xlocate(x2, y++); putgroup(buf, attr -> gid); VOID_C XXputch('<'); Xattrkanjiputs(buf, attr -> nlink & TCH_GID); VOID_C XXputch('>'); #endif /* !_NOEXTRAATTR && !NOUID */ } #if !defined (_NOEXTRAATTR) && !defined (NOUID) static int NEAR inputuid(attr, yy) attrib_t *attr; int yy; { uidtable *up; char *cp, *s, buf[MAXLONGWIDTH + 1]; u_id_t uid; up = finduid(attr -> uid, NULL); if (up) cp = up -> name; else { VOID_C Xsnprintf(buf, sizeof(buf), "%-d", (int)(attr -> uid)); cp = buf; } yy += 2 + WMODELINE + 2; lcmdline = yy; maxcmdline = 1; if (!(s = inputstr(AOWNR_K, 0, -1, cp, HST_USER))) return(-1); if ((cp = Xsscanf(s, "%-<*d%$", sizeof(u_id_t), &uid))) /*EMPTY*/; else if ((up = finduid((u_id_t)0, s))) uid = up -> uid; else { lcmdline = yy; warning(ENOENT, s); Xfree(s); return(-1); } Xfree(s); if (uid != attr -> uid) { attr -> uid = uid; attr -> nlink |= TCH_UID; } return(0); } static int NEAR inputgid(attr, yy) attrib_t *attr; int yy; { gidtable *gp; char *cp, *s, buf[MAXLONGWIDTH + 1]; g_id_t gid; gp = findgid(attr -> gid, NULL); if (gp) cp = gp -> name; else { VOID_C Xsnprintf(buf, sizeof(buf), "%-d", (int)(attr -> gid)); cp = buf; } yy += 2 + WMODELINE + 2; lcmdline = yy; maxcmdline = 1; if (!(s = inputstr(AGRUP_K, 0, -1, cp, HST_GROUP))) return(-1); if ((cp = Xsscanf(s, "%-<*d%$", sizeof(g_id_t), &gid))) /*EMPTY*/; else if ((gp = findgid((g_id_t)0, s))) gid = gp -> gid; else { lcmdline = yy; warning(ENOENT, s); Xfree(s); return(-1); } Xfree(s); if (gid != attr -> gid) { attr -> gid = gid; attr -> nlink |= TCH_GID; } return(0); } #endif /* !_NOEXTRAATTR && !NOUID */ int inputattr(namep, flag) namelist *namep; int flag; { #if !MSDOS u_int tmp; #endif #ifdef HAVEFLAGS char buf[WMODE + 1]; #endif attrib_t attr; struct tm *tm; time_t t; u_int mask; int ch, x, y, xx, yy, ymin, ymax, typ, w, dupwin_x, dupwin_y, excl; dupwin_x = win_x; dupwin_y = win_y; subwindow = 1; Xgetkey(-1, 0, 0); yy = filetop(win); while (yy + WMODELINE + 5 > n_line - 1) yy--; if (yy <= L_TITLE) yy = L_TITLE + 1; xx = getattrcolumn(NULL) + ATTRWIDTH; excl = (flag & ATR_EXCLUSIVE); attr.nlink = TCH_CHANGE; if (flag & ATR_MULTIPLE) attr.nlink |= (TCH_MODE | TCH_MTIME); attr.mode = namep -> st_mode; #ifndef _NOEXTRAATTR attr.mode &= ~S_IFMT; attr.mask = 0; # if !MSDOS if ((flag & ATR_RECURSIVE) && excl == ATR_MODEONLY) { for (x = 0; x < 3; x++) attr.mode |= (1 << (x + 12)); attr.nlink |= TCH_MODEEXE; } # endif # ifndef NOUID attr.uid = namep -> st_uid; attr.gid = namep -> st_gid; # endif #endif /* !_NOEXTRAATTR */ #ifdef HAVEFLAGS attr.flags = namep -> st_flags; #endif tm = localtime(&(namep -> st_mtim)); VOID_C Xsnprintf(attr.timestr[0], sizeof(attr.timestr[0]), "%02d-%02d-%02d", tm -> tm_year % 100, tm -> tm_mon + 1, tm -> tm_mday); VOID_C Xsnprintf(attr.timestr[1], sizeof(attr.timestr[1]), "%02d:%02d:%02d", tm -> tm_hour, tm -> tm_min, tm -> tm_sec); showattr(namep, &attr, yy); y = ymin = (excl == ATR_TIMEONLY) ? WMODELINE : 0; ymax = (excl == ATR_MODEONLY) ? 0 : WMODELINE + 1; #if !defined (_NOEXTRAATTR) && !defined (NOUID) if (excl == ATR_OWNERONLY) x = ATTRWIDTH + 1; else #endif x = 0; do { win_x = xx + x; win_y = yy + y + 2; Xlocate(win_x, win_y); Xtflush(); keyflush(); #if MSDOS if (x == 3) mask = S_ISVTX; else #endif mask = (1 << (8 - x)); switch (ch = Xgetkey(1, 0, 0)) { case K_UP: #if !defined (_NOEXTRAATTR) && !defined (NOUID) if (x > ATTRWIDTH) { y = (y) ? 0 : WMODELINE + 1; break; } #endif if (y > ymin) y--; else y = ymax; VOID_C getattrtype(y, &w); if (x >= w) x = w - 1; break; case K_DOWN: #if !defined (_NOEXTRAATTR) && !defined (NOUID) if (x > ATTRWIDTH) { y = (y) ? 0 : WMODELINE + 1; break; } #endif if (y < ymax) y++; else y = ymin; VOID_C getattrtype(y, &w); if (x >= w) x = w - 1; break; case 'a': case 'A': if (excl && excl != ATR_MODEONLY) break; x = y = 0; break; case 'd': case 'D': if (excl && excl != ATR_TIMEONLY) break; x = 0; y = WMODELINE; break; case 't': case 'T': if (excl && excl != ATR_TIMEONLY) break; x = 0; y = WMODELINE + 1; break; #ifdef HAVEFLAGS case 'f': case 'F': if (excl) break; x = 0; y = WMODELINE - 1; break; #endif #if !defined (_NOEXTRAATTR) && !defined (NOUID) case 'o': case 'O': if (excl && excl != ATR_OWNERONLY) break; if (ishardomit()) break; x = ATTRWIDTH + 1; y = 0; break; case 'g': case 'G': if (excl && excl != ATR_OWNERONLY) break; if (ishardomit()) break; x = ATTRWIDTH + 1; y = WMODELINE + 1; break; #endif /* !_NOEXTRAATTR && !NOUID */ case '0': case '1': case '2': case '3': case '4': case '5': case '6': case '7': case '8': case '9': if (y < WMODELINE) break; VOID_C XXputch(ch); attr.timestr[y - WMODELINE][x] = ch; attr.nlink |= TCH_MTIME; /*FALLTHRU*/ case K_RIGHT: typ = getattrtype(y, &w); if (x < w - 1) { x++; switch (typ) { case AT_DATE: case AT_TIME: if ((++x) % 3) x--; break; default: break; } } else switch (typ) { case AT_DATE: y++; x = 0; break; #if !defined (_NOEXTRAATTR) && !defined (NOUID) case AT_MODE: case AT_TIME: if (excl) break; if (ishardomit()) break; x = ATTRWIDTH + 1; break; #endif default: break; } break; case K_BS: if (y < WMODELINE) break; /*FALLTHRU*/ case K_LEFT: typ = getattrtype(y, &w); #if !defined (_NOEXTRAATTR) && !defined (NOUID) if (x > ATTRWIDTH) { if (excl || ch == K_BS) break; if (ishardomit()) break; x = w - 1; } else #endif if (x > 0) { switch (typ) { case AT_DATE: case AT_TIME: if (!(x % 3)) x--; break; default: break; } x--; } else switch (typ) { case AT_TIME: y--; x = w - 1; break; default: break; } break; case K_CTRL('L'): yy = filetop(win); while (yy + WMODELINE + 5 > n_line - 1) yy--; if (yy <= L_TITLE) yy = L_TITLE + 1; xx = getattrcolumn(NULL) + ATTRWIDTH; showattr(namep, &attr, yy); break; case ' ': typ = getattrtype(y, &w); #if !defined (_NOEXTRAATTR) && !defined (NOUID) if (x > ATTRWIDTH) { switch (typ) { case AT_MODE: inputuid(&attr, yy); break; case AT_TIME: inputgid(&attr, yy); break; default: break; } showattr(namep, &attr, yy); break; } #endif #ifdef HAVEFLAGS if (typ == AT_FLAG) { attr.flags ^= fflaglist[x]; Xlocate(xx, yy + y + 2); putflags(buf, attr.flags); XXcputs(buf); attr.nlink |= TCH_FLAGS; break; } #endif if (typ != AT_MODE) break; #if MSDOS if (x == 2) break; #else /* !MSDOS */ if (!((x + 1) % 3) && (attr.mode & mask)) { tmp = (1 << (12 - ((x + 1) / 3))); # ifndef _NOEXTRAATTR if (flag & ATR_RECURSIVE) tmp <<= 3; # endif if (attr.mode & tmp) { # ifndef _NOEXTRAATTR if (flag & ATR_RECURSIVE) /*EMPTY*/; else # endif attr.mode ^= tmp; } # ifndef _NOEXTRAATTR else if (flag & ATR_RECURSIVE) { mask = (tmp >> 3); if (attr.mode & mask) attr.mode ^= tmp; } # endif else mask = tmp; } # ifndef _NOEXTRAATTR else { tmp = (1 << (15 - ((x + 1) / 3))); if (attr.mode & tmp) mask = tmp; } # endif #endif /* !MSDOS */ attr.mode ^= mask; showmode(&attr, xx, yy + y + 2); attr.nlink |= TCH_MODE; break; #ifndef _NOEXTRAATTR case 'm': case 'M': # ifndef NOUID if (x > ATTRWIDTH) break; # endif if (!(flag & ATR_MULTIPLE)) break; if (getattrtype(y, NULL) != AT_MODE) break; # if MSDOS if (x == 2) break; # else if (!((x + 1) % 3)) mask |= (1 << (12 - ((x + 1) / 3))); # endif attr.mask ^= mask; showmode(&attr, xx, yy + y + 2); attr.nlink |= TCH_MASK; break; #endif /* !_NOEXTRAATTR */ default: break; } } while (ch != K_ESC && ch != K_CR); win_x = dupwin_x; win_y = dupwin_y; subwindow = 0; Xgetkey(-1, 0, 0); if (ch == K_ESC) return(0); tm -> tm_year = (attr.timestr[0][0] - '0') * 10 + attr.timestr[0][1] - '0'; if (tm -> tm_year < 70) tm -> tm_year += 100; tm -> tm_mon = (attr.timestr[0][3] - '0') * 10 + attr.timestr[0][4] - '0'; tm -> tm_mon--; tm -> tm_mday = (attr.timestr[0][6] - '0') * 10 + attr.timestr[0][7] - '0'; tm -> tm_hour = (attr.timestr[1][0] - '0') * 10 + attr.timestr[1][1] - '0'; tm -> tm_min = (attr.timestr[1][3] - '0') * 10 + attr.timestr[1][4] - '0'; tm -> tm_sec = (attr.timestr[1][6] - '0') * 10 + attr.timestr[1][7] - '0'; if (tm -> tm_mon < 0 || tm -> tm_mon > 11 || tm -> tm_mday < 1 || tm -> tm_mday > 31 || tm -> tm_hour > 23 || tm -> tm_min > 59 || tm -> tm_sec > 60) return(-1); if ((t = Xtimelocal(tm)) == (time_t)-1) return(-1); mask = (TCH_CHANGE | TCH_MASK | TCH_MODEEXE); switch (excl) { case ATR_MODEONLY: mask |= TCH_MODE; break; case ATR_TIMEONLY: mask |= TCH_MTIME; break; #if !defined (_NOEXTRAATTR) && !defined (NOUID) case ATR_OWNERONLY: mask |= (TCH_UID | TCH_GID); break; #endif default: if (attr.mode != (namep -> st_mode & ~S_IFMT)) mask |= TCH_MODE; #ifdef HAVEFLAGS if (attr.flags != namep -> st_flags) mask |= TCH_FLAGS; #endif #if !defined (_NOEXTRAATTR) && !defined (NOUID) if (attr.uid != namep -> st_uid) mask |= TCH_UID; if (attr.gid != namep -> st_gid) mask |= TCH_GID; #endif if (t != namep -> st_mtim) mask |= TCH_MTIME; break; } attrnlink = (attr.nlink & mask); attrmode = attr.mode; #ifdef HAVEFLAGS attrflags = attr.flags; #endif #ifndef _NOEXTRAATTR attrmask = attr.mask; # ifndef NOUID attruid = attr.uid; attrgid = attr.gid; # endif #endif /* !_NOEXTRAATTR */ attrtime = t; return(1); } int setattr(path) CONST char *path; { struct stat st; st.st_nlink = attrnlink; st.st_mode = attrmode; #ifdef HAVEFLAGS st.st_flags = attrflags; #endif #ifndef _NOEXTRAATTR st.st_size = (off_t)attrmask; # ifndef NOUID st.st_uid = attruid; st.st_gid = attrgid; # endif #endif /* !_NOEXTRAATTR */ st.st_mtime = attrtime; if (touchfile(path, &st) < 0) return(APL_ERROR); return(APL_OK); } int applyfile(func, endmes) int (*func)__P_((CONST char *)); CONST char *endmes; { #ifdef DEP_DOSEMU char path[MAXPATHLEN]; #endif int i, ret, old, dupfilepos; dupfilepos = filepos; ret = old = filepos; if (mark <= 0) { i = (*func)(fnodospath(path, filepos)); if (i == APL_ERROR) warning(-1, filelist[filepos].name); else if (i == APL_OK) ret++; #ifndef _NOEXTRACOPY if (endmes && copyline > 0) _showprogress(n_column); #endif return(ret); } helpbar(); for (filepos = 0; filepos < maxfile; filepos++) { if (intrkey(K_ESC)) { endmes = NULL; break; } if (!ismark(&(filelist[filepos]))) continue; movepos(old, 0); Xlocate(win_x, win_y); Xtflush(); i = (*func)(fnodospath(path, filepos)); if (i == APL_CANCEL) { endmes = NULL; break; } else if (i == APL_ERROR) warning(-1, filelist[filepos].name); else if (i == APL_OK && ret == filepos) ret++; old = filepos; } if (endmes) { #ifndef _NOEXTRACOPY if (copyline > 0) _showprogress(n_column); #endif warning(0, endmes); } filepos = dupfilepos; movepos(old, 0); Xlocate(win_x, win_y); Xtflush(); return(ret); } static char **NEAR getdirtree(dir, dirlist, maxp, depth) char *dir, **dirlist; int *maxp, depth; { DIR *dirp; struct dirent *dp; struct stat st; char *cp; int d; if (!(dirp = Xopendir(dir))) return(dirlist); cp = strcatdelim(dir); while ((dp = Xreaddir(dirp))) { if (isdotdir(dp -> d_name)) continue; if (strcatpath(dir, cp, dp -> d_name) < 0) continue; if (Xlstat(dir, &st) < 0 || !s_isdir(&st)) continue; dirlist = b_realloc(dirlist, *maxp, char *); dirlist[(*maxp)++] = Xstrdup(dir); if (!(d = depth)) /*EMPTY*/; else if (d > 1) d--; else continue; dirlist = getdirtree(dir, dirlist, maxp, d); } if (cp > dir) *(cp - 1) = '\0'; VOID_C Xclosedir(dirp); return(dirlist); } static int NEAR _applydir(dir, funcf, funcd1, funcd2, order, endmes, verbose) CONST char *dir; int (*funcf)__P_((CONST char *)); int (*funcd1)__P_((CONST char *)); int (*funcd2)__P_((CONST char *)); int order; CONST char *endmes; int verbose; { DIR *dirp; struct dirent *dp; struct stat st; time_t dupmtime, dupatime; u_short dupmode; CONST char *cp; char *fname, path[MAXPATHLEN], **dirlist; int ret, ndir, max, dupnlink; if (intrkey(K_ESC)) return(APL_CANCEL); if (verbose) { Xlocate(0, L_CMDLINE); Xputterm(L_CLEAR); cp = (dir[0] == '.' && dir[1] == _SC_) ? &(dir[2]) : dir; VOID_C XXcprintf("[%^.*k]", n_column - 2, cp); Xtflush(); } #ifdef FAKEUNINIT else cp = NULL; /* fake for -Wuninitialized */ #endif if (!funcd1) order = (funcd2) ? ORD_NOPREDIR : ORD_NODIR; Xstrcpy(path, dir); ret = APL_OK; max = 0; if (!order) dirlist = NULL; else dirlist = getdirtree(path, NULL, &max, (order == ORD_LOWER) ? 0 : 1); fname = strcatdelim(path); destnlink = 0; if ((order == ORD_NORMAL || order == ORD_LOWER) && (ret = (*funcd1)(dir)) < 0) { if (ret == APL_ERROR) warning(-1, dir); if (dirlist) { for (ndir = 0; ndir < max; ndir++) Xfree(dirlist[ndir]); Xfree(dirlist); } return(ret); } dupnlink = destnlink; dupmode = destmode; dupmtime = destmtime; dupatime = destatime; if (order != ORD_NODIR) for (ndir = 0; ndir < max; ndir++) { if (order != ORD_LOWER) ret = _applydir(dirlist[ndir], funcf, funcd1, funcd2, order, NULL, verbose); else if ((ret = (*funcd1)(dirlist[ndir])) < 0) { if (ret == APL_ERROR) warning(-1, dir); ret = APL_CANCEL; } else ret = _applydir(dirlist[ndir], funcf, funcd1, funcd2, ORD_NODIR, NULL, verbose); if (ret == APL_CANCEL) { for (; ndir < max; ndir++) Xfree(dirlist[ndir]); Xfree(dirlist); return(ret); } Xfree(dirlist[ndir]); if (verbose) { Xlocate(0, L_CMDLINE); Xputterm(L_CLEAR); VOID_C XXcprintf("[%^.*k]", n_column - 2, cp); Xtflush(); } } Xfree(dirlist); if (!(dirp = Xopendir(dir))) warning(-1, dir); else { while ((dp = Xreaddir(dirp))) { if (intrkey(K_ESC)) { ret = APL_CANCEL; break; } if (isdotdir(dp -> d_name)) continue; if (strcatpath(path, fname, dp -> d_name) < 0) continue; if (Xlstat(path, &st) < 0) warning(-1, path); else if (s_isdir(&st)) continue; else if ((ret = (*funcf)(path)) < 0) { if (ret == APL_CANCEL) break; warning(-1, path); } } VOID_C Xclosedir(dirp); if (ret == APL_CANCEL) return(ret); } destnlink = dupnlink; destmode = dupmode; destmtime = dupmtime; destatime = dupatime; if (funcd2 && (ret = (*funcd2)(dir)) < 0) { if (ret == APL_CANCEL) return(ret); warning(-1, dir); } if (endmes) { #ifndef _NOEXTRACOPY if (copyline > 0) _showprogress(n_column); #endif warning(0, endmes); } return(ret); } int applydir(dir, funcf, funcd1, funcd2, order, endmes) CONST char *dir; int (*funcf)__P_((CONST char *)); int (*funcd1)__P_((CONST char *)); int (*funcd2)__P_((CONST char *)); int order; CONST char *endmes; { char path[MAXPATHLEN]; int verbose; verbose = 1; if (!dir) { dir = curpath; verbose = 0; } else if (isdotdir(dir) == 1) { VOID_C Xrealpath(dir, path, 0); dir = path; } #ifdef DEP_DOSEMU else dir = nodospath(path, dir); #endif return(_applydir(dir, funcf, funcd1, funcd2, order, endmes, verbose)); } /*ARGSUSED*/ int copyfile(arg, tr) CONST char *arg; int tr; { int order; if (!mark && isdotdir(filelist[filepos].name)) { Xputterm(T_BELL); return(FNC_NONE); } #ifdef _NOTREE destpath = getdestdir(COPYD_K, arg); #else # ifdef DEP_PSEUDOPATH destpath = (tr) ? tree(1, &destdrive) : getdestdir(COPYD_K, arg); # else destpath = (tr) ? tree(1, NULL) : getdestdir(COPYD_K, arg); # endif #endif /* !_NOTREE */ if (!destpath) return((tr) ? FNC_UPDATE : FNC_CANCEL); destdir = NULL; if (mark > 0 || (!isdir(&(filelist[filepos])) || islink(&(filelist[filepos])))) { if (preparecopy(0, mark) < 0) { Xfree(destpath); return(FNC_CANCEL); } VOID_C applyfile(safecopy, ENDCP_K); } #ifdef _NOEXTRACOPY else if (issamedir(destpath, NULL)) { warning(EEXIST, filelist[filepos].name); Xfree(destpath); return((tr) ? FNC_UPDATE : FNC_CANCEL); } #endif else { if (preparecopy(1, 1) < 0) { Xfree(destpath); return(FNC_CANCEL); } order = (islowerdir()) ? ORD_LOWER : ORD_NORMAL; VOID_C applydir(filelist[filepos].name, safecopy, cpdir, touchdir, order, ENDCP_K); } Xfree(destpath); Xfree(destdir); #ifndef _NOEXTRACOPY Xfree(forwardpath); forwardpath = NULL; #endif #ifdef DEP_PSEUDOPATH shutdrv(destdrive); destdrive = -1; #endif #if !defined (_NOEXTRACOPY) && defined (DEP_DOSDRIVE) shutdrv(forwarddrive); forwarddrive = -1; #endif return(FNC_EFFECT); } /*ARGSUSED*/ int movefile(arg, tr) CONST char *arg; int tr; { #ifdef DEP_DOSEMU char path[MAXPATHLEN]; #endif int ret; if (!mark && isdotdir(filelist[filepos].name)) { Xputterm(T_BELL); return(FNC_NONE); } #ifdef _NOTREE destpath = getdestdir(MOVED_K, arg); #else # ifdef DEP_PSEUDOPATH destpath = (tr) ? tree(1, &destdrive) : getdestdir(MOVED_K, arg); # else destpath = (tr) ? tree(1, NULL) : getdestdir(MOVED_K, arg); # endif #endif /* !_NOTREE */ if (!destpath) return((tr) ? FNC_UPDATE : FNC_CANCEL); if (issamedir(destpath, NULL)) { Xfree(destpath); return((tr) ? FNC_UPDATE : FNC_CANCEL); } destdir = NULL; if (mark > 0) { if (preparemove(0, mark) < 0) { Xfree(destpath); return(FNC_CANCEL); } filepos = applyfile(safemove, ENDMV_K); } else if (islowerdir()) warning(EINVAL, filelist[filepos].name); else { #ifndef _NOEXTRACOPY if (!isdir(&(filelist[filepos])) || islink(&(filelist[filepos]))) ret = 0; else ret = isxdev(fnodospath(path, filepos), NULL); if (ret < 0) warning(-1, filelist[filepos].name); else if (ret) { if (preparemove(1, 1) < 0) { Xfree(destpath); return(FNC_CANCEL); } # ifdef DEP_DOSDRIVE if (dospath3(nullstr)) waitmes(); # endif ret = applydir(filelist[filepos].name, safemove, mvdir1, mvdir2, ORD_NORMAL, ENDMV_K); } else #endif /* !_NOEXTRACOPY */ { if (preparemove(0, 1) < 0) { Xfree(destpath); return(FNC_CANCEL); } ret = safemove(fnodospath(path, filepos)); if (ret == APL_ERROR) warning(-1, filelist[filepos].name); } if (ret == APL_OK) filepos++; } if (filepos >= maxfile) filepos = maxfile - 1; Xfree(destpath); Xfree(destdir); #ifndef _NOEXTRACOPY Xfree(forwardpath); forwardpath = NULL; #endif #ifdef DEP_PSEUDOPATH shutdrv(destdrive); destdrive = -1; #endif #if !defined (_NOEXTRACOPY) && defined (DEP_DOSDRIVE) shutdrv(forwarddrive); forwarddrive = -1; #endif return(FNC_EFFECT); } static int forcecpfile(path) CONST char *path; { struct stat st; char dest[MAXPATHLEN]; if (getdestpath(path, dest, &st) < 0) return(APL_OK); if (safecpfile(path, dest, &st, NULL) < 0) return(APL_ERROR); #ifdef HAVEFLAGS st.st_flags = (u_long)-1; #endif st.st_nlink = (TCH_MODE | TCH_UID | TCH_GID | TCH_ATIME | TCH_MTIME | TCH_IGNOREERR); if (touchfile(dest, &st) < 0) return(APL_ERROR); return(APL_OK); } static int forcecpdir(path) CONST char *path; { struct stat st; char dest[MAXPATHLEN]; int mode; if (isdotdir(path)) return(APL_OK); if (getdestpath(path, dest, &st) < 0) return(APL_OK); mode = ((st.st_mode & 0777) | S_IWUSR); if (Xmkdir(dest, mode) >= 0) return(APL_OK); if (errno != EEXIST) return(APL_ERROR); if (stat2(dest, &st) >= 0) { if (s_isdir(&st)) return(APL_OK); if (Xunlink(dest) >= 0 && Xmkdir(dest, mode) >= 0) return(APL_OK); } errno = EEXIST; return(APL_ERROR); } static int forcetouchdir(path) CONST char *path; { struct stat st; char dest[MAXPATHLEN]; if (isdotdir(path)) return(APL_OK); if (getdestpath(path, dest, &st) < 0) return(APL_CANCEL); #ifdef HAVEFLAGS st.st_flags = (u_long)-1; #endif st.st_nlink = (TCH_MODE | TCH_UID | TCH_GID | TCH_ATIME | TCH_MTIME | TCH_IGNOREERR); if (touchfile(dest, &st) < 0) return(APL_ERROR); return(APL_OK); } int forcemovefile(dest) char *dest; { int ret; destpath = dest; ret = applydir(NULL, forcecpfile, forcecpdir, forcetouchdir, ORD_NORMAL, NULL); destpath = NULL; return(ret); } FD-3.01j/pty.c100644 2105 1751 14107 13516612560 11664 0ustar shiraiuser/* * pty.c * * pseudo terminal access */ #if defined (CYGWIN) && (CYGWIN > 2005001) #define _GNU_SOURCE #endif #include "fd.h" #include "sysemu.h" #include "pathname.h" #include "termio.h" #if !MSDOS #include #endif #ifdef SYSV #include #endif #ifdef GETPGRPVOID #define getpgroup getpgrp #else #define getpgroup() getpgrp(0) #endif #ifdef USESETPGID #define setpgroup setpgid #else #define setpgroup setpgrp #endif #define TTY_GROUP "tty" #ifndef _PATH_DEVNULL #define _PATH_DEVNULL "/dev/null" #endif #ifndef _PATH_PTY #define _PATH_PTY "/dev/pty" #endif #ifndef _PATH_DEVPTMX #define _PATH_DEVPTMX "/dev/ptmx" #endif #ifndef _PATH_DEVPTS #define _PATH_DEVPTS "/dev/pts" #endif #if defined (CYGWIN) && (CYGWIN > 1007009) && (CYGWIN < 2009000) /* for Cygwin buggy ioctl */ #undef TIOCSCTTY #endif #ifdef DEP_PTY #ifndef USESETSID static p_id_t NEAR Xsetsid __P_((VOID_A)); #endif static VOID NEAR Xgrantpt __P_((int, CONST char *)); static VOID NEAR Xunlockpt __P_((int, CONST char *)); static int NEAR Xptsname __P_((int, CONST char *, char *, ALLOC_T)); int Xopenpty __P_((int *, int *, char *, ALLOC_T)); int Xlogin_tty __P_((CONST char *, CONST char *, CONST char *)); p_id_t Xforkpty __P_((int *, CONST char *, CONST char *)); #ifndef USEDEVPTMX static CONST char pty_char1[] = "pqrstuvwxyzPQRST"; static CONST char pty_char2[] = "0123456789abcdefghijklmnopqrstuv"; #endif #ifndef USESETSID static p_id_t NEAR Xsetsid(VOID_A) { p_id_t pid; int fd; pid = getpid(); if (pid == getpgroup()) { errno = EPERM; return((p_id_t)-1); } if (setpgroup(0, pid) < 0) return((p_id_t)-1); # ifdef TIOCNOTTY if ((fd = Xopen(_PATH_TTY, O_RDWR, 0)) >= 0) { VOID_C Xioctl(fd, TIOCNOTTY, NULL); safeclose(fd); } # else if ((fd = Xopen(_PATH_DEVNULL, O_RDWR, 0)) >= 0) { VOID_C Xdup2(fd, STDIN_FILENO); VOID_C Xdup2(fd, STDOUT_FILENO); VOID_C Xdup2(fd, STDERR_FILENO); safeclose(fd); } # endif return(pid); } #endif /* !USESETSID */ /*ARGSUSED*/ static VOID NEAR Xgrantpt(fd, path) int fd; CONST char *path; { #ifdef USEDEVPTMX extern int grantpt __P_((int)); /* for Linux */ #else struct group *grp; gid_t gid; #endif #ifdef USEDEVPTMX VOID_C grantpt(fd); #else gid = ((grp = getgrnam(TTY_GROUP))) ? grp -> gr_gid : (gid_t)-1; VOID_C chown(path, getuid(), gid); VOID_C chmod(path, 0620); #endif } /*ARGSUSED*/ static VOID NEAR Xunlockpt(fd, path) int fd; CONST char *path; { #if defined (USEDEVPTMX) && defined (TIOCSPTLCK) int n; #endif #ifdef USEDEVPTMX # ifdef TIOCSPTLCK n = 0; VOID_C Xioctl(fd, TIOCSPTLCK, &n); # else VOID_C unlockpt(fd); # endif #else /* !USEDEVPTMX */ # ifdef BSD44 VOID_C revoke(path); # endif #endif /* !USEDEVPTMX */ } /*ARGSUSED*/ static int NEAR Xptsname(fd, path, spath, size) int fd; CONST char *path; char *spath; ALLOC_T size; { #if !defined (USEDEVPTMX) || !defined (TIOCGPTN) char *cp; #endif #if defined (USEDEVPTMX) && defined (TIOCGPTN) int n; #endif #ifdef USEDEVPTMX # ifdef TIOCGPTN if (Xioctl(fd, TIOCGPTN, &n) < 0) return(-1); VOID_C Xsnprintf(spath, size, "%s/%d", _PATH_DEVPTS, n); # else if (!(cp = ptsname(fd))) return(-1); VOID_C Xsnprintf(spath, size, "%s", cp); # endif #else /* !USEDEVPTMX */ VOID_C Xsnprintf(spath, size, "%s", path); if ((cp = Xstrrchr(spath, '/'))) *(++cp) = 't'; #endif /* !USEDEVPTMX */ return(0); } int Xopenpty(amaster, aslave, spath, size) int *amaster, *aslave; char *spath; ALLOC_T size; { #ifndef USEDEVPTMX CONST char *cp1, *cp2; int n; #endif char path[MAXPATHLEN]; int master, slave; #ifdef USEDEVPTMX VOID_C Xsnprintf(path, sizeof(path), "%s", _PATH_DEVPTMX); if ((master = Xopen(path, O_RDWR, 0)) < 0) return(-1); Xgrantpt(master, path); Xunlockpt(master, path); if (Xptsname(master, path, spath, size) < 0 || (slave = Xopen(spath, O_RDWR | O_NOCTTY, 0)) < 0) { safeclose(master); return(-1); } #else /* !USEDEVPTMX */ n = Xsnprintf(path, sizeof(path), "%sXX", _PATH_PTY); n -= 2; master = slave = -1; for (cp1 = pty_char1; *cp1; cp1++) { path[n] = *cp1; for (cp2 = pty_char2; *cp2; cp2++) { path[n + 1] = *cp2; master = Xopen(path, O_RDWR, 0); if (master < 0) { if (errno == ENOENT) break; continue; } VOID_C Xptsname(master, path, spath, size); Xgrantpt(master, spath); Xunlockpt(master, spath); slave = Xopen(spath, O_RDWR, 0); if (slave >= 0) break; safeclose(master); } if (master >= 0 && slave >= 0) break; } if (!*cp1) return(seterrno(ENOENT)); #endif /* !USEDEVPTMX */ *amaster = master; *aslave = slave; return(0); } #if defined (IRIX) || defined (DECOSF1V2) || defined (DECOSF1V3) #undef I_PUSH #endif int Xlogin_tty(path, tty, ws) CONST char *path, *tty, *ws; { int fd; #ifndef USESETSID VOID_C Xsetsid(); #endif VOID_C Xclose(STDIN_FILENO); VOID_C Xclose(STDOUT_FILENO); VOID_C Xclose(STDERR_FILENO); if ((fd = Xopen(path, O_RDWR, 0)) < 0) return(-1); #ifdef USESETSID VOID_C setsid(); #endif #ifdef I_PUSH if (Xioctl(fd, I_PUSH, "ptem") < 0 || Xioctl(fd, I_PUSH, "ldterm") < 0) { VOID_C Xclose(fd); return(-1); } # if defined (SOLARIS) || defined (NEWS_OS6) VOID_C Xioctl(fd, I_PUSH, "ttcompat"); # endif #endif /* I_PUSH */ #ifdef TIOCSCTTY if (Xioctl(fd, TIOCSCTTY, NULL) < 0) { VOID_C Xclose(fd); return(-1); } #endif VOID_C Xdup2(fd, STDIN_FILENO); VOID_C Xdup2(fd, STDOUT_FILENO); VOID_C Xdup2(fd, STDERR_FILENO); loadtermio(fd, tty, ws); safeclose(fd); return(0); } p_id_t Xforkpty(amaster, tty, ws) int *amaster; CONST char *tty, *ws; { char path[MAXPATHLEN]; p_id_t pid; u_char uc; int n, master, slave, fds[2]; if (pipe(fds) < 0) return((p_id_t)-1); if (Xopenpty(&master, &slave, path, sizeof(path)) < 0) { pid = (p_id_t)-1; } else if ((pid = Xfork()) < (p_id_t)0) { safeclose(master); safeclose(slave); master = -1; } else if (pid) { VOID_C sureread(fds[0], &uc, sizeof(uc)); safeclose(slave); } else { safeclose(master); safeclose(slave); master = -1; n = Xlogin_tty(path, tty, ws); uc = '\n'; VOID_C surewrite(fds[1], &uc, sizeof(uc)); if (n < 0) _exit(1); } safeclose(fds[0]); safeclose(fds[1]); *amaster = master; return(pid); } #endif /* DEP_PTY */ FD-3.01j/termemu.c100644 2105 1751 44316 13516612560 12533 0ustar shiraiuser/* * termemu.c * * terminal emulation */ #include "fd.h" #include "wait.h" #include "termio.h" #include "func.h" #include "kanji.h" #include "system.h" #include "termemu.h" #ifdef DEP_PTY extern char fullpath[]; extern int hideclock; extern int fdmode; #if defined (DEP_ORIGSHELL) && !defined (NOJOB) extern jobtable *joblist; extern int maxjobs; #endif int ptymode = 0; int ptyinternal = 0; char *ptyterm = NULL; int ptymenukey = -1; ptyinfo_t ptylist[MAXWINDOWS]; p_id_t emupid = (p_id_t)0; int emufd = -1; int parentfd = -1; char *ptytmpfile = NULL; static VOID NEAR doscroll __P_((int, int, int, int)); #ifdef CYGWIN static VOID NEAR closeallpty __P_((VOID_A)); #endif static int NEAR genbackend __P_((VOID_A)); static VOID NEAR sendvar __P_((int, char **)); #ifdef DEP_ORIGSHELL static VOID NEAR sendheredoc __P_((int, heredoc_t *)); static VOID NEAR sendrlist __P_((int, redirectlist *)); static VOID NEAR sendcommand __P_((int, command_t *, syntaxtree *)); static VOID NEAR sendstree __P_((int, syntaxtree *)); #endif static VOID NEAR awakechild __P_((CONST char *, CONST char *, int)); #if defined (DEP_ORIGSHELL) && !defined (NOJOB) static int trap_hup __P_((VOID_A)); static int NEAR recvmacro __P_((char **, char **, int *)); #endif static int NEAR callmacro __P_((CONST char *, CONST char *, int)); static VOID NEAR doscroll(n, c, x, y) int n, c, x, y; { Xlocate(x, y); while (c--) Xputterms(n); } VOID regionscroll(n, c, x, y, min, max) int n, c, x, y, min, max; { int y1, y2; if (min < 0) min = 0; if (max < 0) max = n_line - 1; if (min <= 0 && max >= n_line - 1) { doscroll(n, c, x, y); return; } if (Xsetscroll(min, max) >= 0) { doscroll(n, c, x, y); Xsetscroll(0, n_line - 1); Xlocate(x, y); return; } y1 = y2 = -1; switch (n) { case C_DOWN: case C_SCROLLFORW: case C_NEWLINE: if (y != max) break; y1 = min; if (max < n_line - 1) y2 = max - c + 1; break; case C_UP: case C_SCROLLREV: if (y != min) break; if (max < n_line - 1) y1 = max - c + 1; y2 = min; break; case L_DELETE: if (max >= n_line - 1) break; y1 = y; y2 = max - c + 1; break; case L_INSERT: if (max >= n_line - 1) break; y1 = max - c + 1; y2 = y; break; default: break; } if (y1 < 0 && y2 < 0) doscroll(n, c, x, y); else { n = (y1 < y2) ? y1 : y2; if (c > max - n + 1) c = max - n + 1; if (y1 > 0) doscroll(L_DELETE, c, 0, y1); if (y2 > 0) doscroll(L_INSERT, c, 0, y2); Xlocate(x, y); } } int selectpty(max, fds, result, timeout) int max, fds[]; char result[]; long timeout; { struct timeval tv, *t; if (timeout < 0L) t = NULL; else if (!timeout) { tv.tv_sec = 0L; tv.tv_usec = 1L; t = &tv; } else { tv.tv_sec = timeout / 1000000L; tv.tv_usec = timeout % 1000000L; t = &tv; } return(readselect(max, fds, result, t)); } #ifdef CYGWIN static VOID NEAR closeallpty(VOID_A) { int i; for (i = 0; i < MAXWINDOWS; i++) { safeclose(ptylist[i].fd); ptylist[i].fd = -1; } } #endif /* CYGWIN */ static int NEAR genbackend(VOID_A) { char path[MAXPATHLEN]; p_id_t pid; int i, n, fds[2], slave[MAXWINDOWS]; if (emupid) return(0); if (pipe(fds) < 0) return(-1); VOID_C fcntl(fds[0], F_SETFL, O_NONBLOCK); VOID_C fcntl(fds[1], F_SETFL, O_NONBLOCK); for (i = 0; i < MAXWINDOWS; i++) { n = Xopenpty(&(ptylist[i].fd), &(slave[i]), path, sizeof(path)); if (n < 0) break; ptylist[i].pid = (p_id_t)0; ptylist[i].path = Xstrdup(path); ptylist[i].pipe = -1; ptylist[i].status = 0; } if (i < MAXWINDOWS || (pid = Xfork()) < (p_id_t)0) { safeclose(fds[0]); safeclose(fds[1]); while (--i >= 0) { safeclose(ptylist[i].fd); ptylist[i].fd = -1; safeclose(slave[i]); Xfree(ptylist[i].path); ptylist[i].path = NULL; } return(-1); } if (!pid) { #ifdef DEP_ORIGSHELL mypid = getpid(); #endif safeclose(fds[1]); emufd = fds[0]; emupid = (p_id_t)0; for (i = 0; i < MAXWINDOWS; i++) { Xfree(ptylist[i].path); ptylist[i].path = NULL; resetptyterm(i, 1); } resetptyterm(i, 1); backend(); for (i = 0; i < MAXWINDOWS; i++) { safeclose(ptylist[i].fd); ptylist[i].fd = -1; safeclose(slave[i]); } _exit(0); } safeclose(fds[0]); emufd = newdup(fds[1]); emupid = pid; for (i = 0; i < MAXWINDOWS; i++) { #ifdef CYGWIN ptylist[i].fd = newdup(ptylist[i].fd); #else safeclose(ptylist[i].fd); ptylist[i].fd = -1; #endif safeclose(slave[i]); } return(0); } VOID syncptyout(fd, cmd) int fd, cmd; { char *tty; u_char uc; if (parentfd < 0) return; savetermio(ttyio, &tty, NULL); keyflush(); Xnoecho(); if (fd < 0) { tputs2("\033[99n", 1); tflush(); } else { uc = cmd; sendbuf(fd, &uc, sizeof(uc)); } VOID_C Xgetch(); keyflush(); loadtermio(ttyio, tty, NULL); Xfree(tty); } int recvbuf(fd, buf, nbytes) int fd; VOID_P buf; int nbytes; { char *cp; int n; cp = (char *)buf; for (;;) { if ((n = sureread(fd, cp, nbytes)) >= nbytes) { errno = 0; return(0); } else if (n <= 0) break; cp += n; nbytes -= n; } return(-1); } VOID sendbuf(fd, buf, nbytes) int fd; CONST VOID_P buf; int nbytes; { VOID_C surewrite(fd, buf, nbytes); } int recvword(fd, np) int fd, *np; { short w; if (recvbuf(fd, &w, sizeof(w)) < 0) return(-1); *np = (int)w; return(0); } VOID sendword(fd, n) int fd, n; { short w; w = (short)n; sendbuf(fd, &w, sizeof(w)); } int recvstring(fd, cpp) int fd; char **cpp; { char *cp; ALLOC_T len; if (recvbuf(fd, &cp, sizeof(cp)) < 0) return(-1); if (cp) { if (recvbuf(fd, &len, sizeof(len)) < 0) return(-1); cp = Xmalloc(len + 1); if (recvbuf(fd, cp, len) < 0) { Xfree(cp); return(-1); } cp[len] = '\0'; } *cpp = cp; return(0); } VOID sendstring(fd, s) int fd; CONST char *s; { ALLOC_T len; sendbuf(fd, &s, sizeof(s)); if (!s) return; len = strlen(s); sendbuf(fd, &len, sizeof(len)); if (len) sendbuf(fd, s, len); } static VOID NEAR sendvar(fd, var) int fd; char **var; { int i, c; sendbuf(fd, &var, sizeof(var)); if (!var) return; c = countvar(var); sendbuf(fd, &c, sizeof(c)); for (i = 0; i < c; i++) sendstring(fd, var[i]); } #ifdef DEP_ORIGSHELL static VOID NEAR sendheredoc(fd, hdp) int fd; heredoc_t *hdp; { sendbuf(fd, &hdp, sizeof(hdp)); if (!hdp) return; sendbuf(fd, hdp, sizeof(*hdp)); sendstring(fd, hdp -> eof); sendstring(fd, hdp -> filename); sendstring(fd, hdp -> buf); } static VOID NEAR sendrlist(fd, rp) int fd; redirectlist *rp; { sendbuf(fd, &rp, sizeof(rp)); if (!rp) return; sendbuf(fd, rp, sizeof(*rp)); if (rp -> type & MD_HEREDOC) sendheredoc(fd, (heredoc_t *)(rp -> filename)); else sendstring(fd, rp -> filename); sendrlist(fd, rp -> next); } static VOID NEAR sendcommand(fd, comm, trp) int fd; command_t *comm; syntaxtree *trp; { sendbuf(fd, &comm, sizeof(comm)); if (!comm) return; if (trp -> flags & ST_NODE) { sendstree(fd, (syntaxtree *)comm); return; } sendbuf(fd, comm, sizeof(*comm)); if (!isstatement(comm)) sendvar(fd, comm -> argv); else sendstree(fd, (syntaxtree *)(comm -> argv)); sendrlist(fd, comm -> redp); } static VOID NEAR sendstree(fd, trp) int fd; syntaxtree *trp; { sendbuf(fd, &trp, sizeof(trp)); if (!trp) return; sendbuf(fd, trp, sizeof(*trp)); sendcommand(fd, trp -> comm, trp); sendstree(fd, trp -> next); } #endif /* DEP_ORIGSHELL */ #ifdef USESTDARGH /*VARARGS1*/ VOID sendparent(int cmd, ...) #else /*VARARGS1*/ VOID sendparent(cmd, va_alist) int cmd; va_dcl #endif { #ifdef DEP_ORIGSHELL syntaxtree *trp; #endif #ifndef _NOARCHIVE lsparse_t *lp; archive_t *ap; #endif #ifdef DEP_DOSEMU devinfo *devp; #endif bindtable *bindp; keyseq_t *keyp; va_list args; char *cp, *func1, *func2, ***varp, **var; u_char uc; int n, fd, val; if (parentfd < 0) return; #ifdef DEP_ORIGSHELL if (mypid != shellpid) return; #endif fd = parentfd; syncptyout(fd, TE_LOCKFRONT); uc = cmd; sendbuf(fd, &uc, sizeof(uc)); VA_START(args, cmd); switch (cmd) { case TE_SETVAR: varp = va_arg(args, char ***); var = va_arg(args, char **); sendbuf(fd, &varp, sizeof(varp)); sendvar(fd, var); break; case TE_PUSHVAR: varp = va_arg(args, char ***); cp = va_arg(args, char *); sendbuf(fd, &varp, sizeof(varp)); sendstring(fd, cp); break; case TE_POPVAR: varp = va_arg(args, char ***); sendbuf(fd, &varp, sizeof(varp)); break; case TE_CHDIR: #ifdef DEP_ORIGSHELL case TE_SETEXPORT: case TE_SETRONLY: #endif #if !defined (DEP_ORIGSHELL) || !defined (NOALIAS) case TE_DELETEALIAS: #endif #ifndef DEP_ORIGSHELL case TE_DELETEFUNCTION: #endif cp = va_arg(args, char *); sendstring(fd, cp); break; #ifdef DEP_ORIGSHELL case TE_PUTEXPORTVAR: case TE_PUTSHELLVAR: case TE_UNSET: case TE_DELETEFUNCTION: cp = va_arg(args, char *); n = va_arg(args, int); sendbuf(fd, &n, sizeof(n)); sendstring(fd, cp); break; case TE_SETSHFLAG: n = va_arg(args, int); val = va_arg(args, int); sendbuf(fd, &n, sizeof(n)); sendbuf(fd, &val, sizeof(val)); break; case TE_ADDFUNCTION: cp = va_arg(args, char *); trp = va_arg(args, syntaxtree *); sendstring(fd, cp); sendstree(fd, trp); break; #else /* !DEP_ORIGSHELL */ case TE_PUTSHELLVAR: cp = va_arg(args, char *); func1 = va_arg(args, char *); n = va_arg(args, int); sendbuf(fd, &n, sizeof(n)); sendstring(fd, func1); sendstring(fd, cp); break; case TE_ADDFUNCTION: cp = va_arg(args, char *); var = va_arg(args, char **); sendvar(fd, var); sendstring(fd, cp); break; #endif /* !DEP_ORIGSHELL */ #if !defined (DEP_ORIGSHELL) || !defined (NOALIAS) case TE_ADDALIAS: cp = va_arg(args, char *); func1 = va_arg(args, char *); sendstring(fd, func1); sendstring(fd, cp); break; #endif case TE_SETHISTORY: cp = va_arg(args, char *); n = va_arg(args, int); sendbuf(fd, &n, sizeof(n)); sendstring(fd, cp); break; case TE_ADDKEYBIND: n = va_arg(args, int); bindp = va_arg(args, bindtable *); func1 = va_arg(args, char *); func2 = va_arg(args, char *); cp = va_arg(args, char *); sendbuf(fd, &n, sizeof(n)); sendbuf(fd, bindp, sizeof(*bindp)); sendstring(fd, func1); sendstring(fd, func2); sendstring(fd, cp); break; case TE_DELETEKEYBIND: #ifndef _NOARCHIVE case TE_DELETELAUNCH: case TE_DELETEARCH: #endif #ifdef DEP_DOSEMU case TE_DELETEDRV: #endif #if defined (DEP_ORIGSHELL) && !defined (NOJOB) case TE_CHANGESTATUS: #endif #ifdef DEP_IME case TE_FREEROMAN: #endif n = va_arg(args, int); sendbuf(fd, &n, sizeof(n)); break; case TE_SETKEYSEQ: keyp = va_arg(args, keyseq_t *); sendbuf(fd, &(keyp -> code), sizeof(keyp -> code)); sendbuf(fd, &(keyp -> len), sizeof(keyp -> len)); sendstring(fd, keyp -> str); break; #ifndef _NOARCHIVE case TE_ADDLAUNCH: n = va_arg(args, int); lp = va_arg(args, lsparse_t *); sendbuf(fd, &n, sizeof(n)); sendbuf(fd, lp, sizeof(*lp)); sendstring(fd, lp -> ext); sendstring(fd, lp -> comm); # ifndef OLDPARSE sendvar(fd, lp -> format); sendvar(fd, lp -> lignore); sendvar(fd, lp -> lerror); # endif break; case TE_ADDARCH: n = va_arg(args, int); ap = va_arg(args, archive_t *); sendbuf(fd, &n, sizeof(n)); sendbuf(fd, &(ap -> flags), sizeof(ap -> flags)); sendstring(fd, ap -> ext); sendstring(fd, ap -> p_comm); sendstring(fd, ap -> u_comm); break; #endif /* !_NOARCHIVE */ #ifdef DEP_DOSEMU case TE_INSERTDRV: n = va_arg(args, int); devp = va_arg(args, devinfo *); sendbuf(fd, &n, sizeof(n)); sendbuf(fd, devp, sizeof(*devp)); sendstring(fd, devp -> name); break; #endif case TE_SAVETTYIO: n = va_arg(args, int); val = (n >= 0 && duptty[n]) ? TIO_BUFSIZ : 0; sendbuf(fd, &n, sizeof(n)); sendbuf(fd, &val, sizeof(val)); if (n >= 0 && duptty[n]) sendbuf(fd, duptty[n], val); break; #ifdef DEP_IME case TE_ADDROMAN: cp = va_arg(args, char *); func1 = va_arg(args, char *); sendstring(fd, cp); sendstring(fd, func1); break; #endif case TE_INTERNAL: n = va_arg(args, int); cp = va_arg(args, char *); sendbuf(fd, &n, sizeof(n)); sendstring(fd, cp); break; default: break; } va_end(args); syncptyout(fd, TE_UNLOCKFRONT); } static VOID NEAR awakechild(command, arg, flags) CONST char *command, *arg; int flags; { if (isttyiomode) { flags |= F_TTYIOMODE; if (isttyiomode > 1) flags |= F_TTYNL; } sendword(emufd, TE_AWAKECHILD); sendword(emufd, win); sendbuf(emufd, &flags, sizeof(flags)); sendstring(emufd, command); sendstring(emufd, arg); sendstring(emufd, fullpath); } #if defined (DEP_ORIGSHELL) && !defined (NOJOB) static int trap_hup(VOID_A) { int i; for (i = 0; i < maxjobs; i++) { if (!(joblist[i].pids)) continue; Xkillpg(joblist[i].pids[0], SIGHUP); # ifdef SIGCONT Xkillpg(joblist[i].pids[0], SIGCONT); # endif } VOID_C signal2(SIGHUP, SIG_DFL); VOID_C kill(mypid, SIGHUP); _exit(SIGHUP + 128); return(0); } static int NEAR recvmacro(commandp, argp, flagsp) char **commandp, **argp; int *flagsp; { char *command, *arg, *cwd; int flags; Xttyiomode(1); if (recvbuf(ttyio, &flags, sizeof(flags)) < 0 || recvstring(ttyio, &command) < 0) return(-1); if (recvstring(ttyio, &arg) < 0) { Xfree(command); return(-1); } if (recvstring(ttyio, &cwd) >= 0 && cwd) { VOID_C chdir2(cwd); Xfree(cwd); } keyflush(); if (!(flags & F_TTYIOMODE)) Xstdiomode(); else if (!(flags & F_TTYNL)) Xttyiomode(0); Xfree(*commandp); Xfree(*argp); *commandp = command; *argp = arg; *flagsp = flags; return(0); } #endif /* DEP_ORIGSHELL && !NOJOB */ static int NEAR callmacro(command, arg, flags) CONST char *command, *arg; int flags; { int i, n; if (parentfd < 0) { changewin(MAXWINDOWS, (p_id_t)-1); if (ptymode) { hideclock = 2; warning(0, NOPTY_K); } killpty(win, NULL); for (i = 0; i < MAXWINDOWS; i++) if (ptylist[i].pid) break; if (i < MAXWINDOWS) { hideclock = 2; if (!yesno(KILL_K)) return(-1); } killallpty(); } if (flags & F_DOSYSTEM) n = dosystem(command); #ifndef DEP_ORIGSHELL else if (flags & F_EVALMACRO) n = execusercomm(command, arg, flags); #endif else n = execmacro(command, arg, flags); return(n); } int ptymacro(command, arg, flags) CONST char *command, *arg; int flags; { #if defined (DEP_ORIGSHELL) && !defined (NOJOB) char *command2, *arg2; #endif p_id_t pid; char *tty, *ws, path[MAXPATHLEN], buf[TIO_BUFSIZ + TIO_WINSIZ]; u_char uc; int i, n, fd, fds[2]; #ifdef DEP_ORIGSHELL if (isshptymode()) n = (flags & F_DOSYSTEM) ? 0 : -1; else #endif n = (ptymode && !ptyinternal && ttyio >= 0) ? 0 : -1; if (n < 0) return(callmacro(command, arg, flags)); if (ptylist[win].pid && emufd >= 0) { awakechild(command, arg, flags); return(frontend()); } savetermio(ttyio, &tty, &ws); if (tty) { memcpy(buf, tty, TIO_BUFSIZ); Xfree(tty); tty = buf; } if (ws) { memcpy(&(buf[TIO_BUFSIZ]), ws, TIO_WINSIZ); Xfree(ws); ws = &(buf[TIO_BUFSIZ]); } if (genbackend() < 0 || pipe(fds) < 0) return(callmacro(command, arg, flags)); VOID_C fcntl(fds[0], F_SETFL, O_NONBLOCK); VOID_C fcntl(fds[1], F_SETFL, O_NONBLOCK); if (ptytmpfile) fd = -1; else if ((fd = mktmpfile(path)) >= 0) { ptytmpfile = Xstrdup(path); VOID_C Xclose(fd); } #ifdef DEP_KCONV changeinkcode(); changeoutkcode(); #endif n = sigvecset(0); if ((pid = Xfork()) < (p_id_t)0) { if (fd >= 0 && ptytmpfile) { rmtmpfile(ptytmpfile); Xfree(ptytmpfile); ptytmpfile = NULL; } sigvecset(n); safeclose(fds[0]); safeclose(fds[1]); return(callmacro(command, arg, flags)); } if (!pid) { #ifdef DEP_ORIGSHELL mypid = getpid(); #endif #ifdef CYGWIN closeallpty(); #endif if (Xlogin_tty(ptylist[win].path, tty, ws) < 0) _exit(1); #ifdef DEP_ORIGSHELL if (isshptymode()) /*EMPTY*/; else #endif n_line = FILEPERROW; setwsize(STDIN_FILENO, n_column, n_line); for (i = 0; i < MAXWINDOWS; i++) { ptylist[i].pid = (p_id_t)0; Xfree(ptylist[i].path); ptylist[i].path = NULL; ptylist[i].pipe = -1; ptylist[i].status = 0; } emupid = (p_id_t)0; safeclose(emufd); emufd = -1; if (Xfileno(ttyout) == ttyio) Xdup2(STDIN_FILENO, ttyio); else { fd = Xfileno(ttyout); closetty(&fd, &ttyout); opentty(&fd, &ttyout); Xdup2(fd, ttyio); safeclose(fd); } setdefterment(); setdefkeyseq(); safeclose(fds[0]); parentfd = newdup(fds[1]); closeonexec(parentfd); uc = '\n'; sendbuf(parentfd, &uc, sizeof(uc)); #if defined (DEP_ORIGSHELL) && !defined (NOJOB) command2 = arg2 = NULL; #endif for (;;) { syncptyout(-1, -1); setlinecol(); n = evalstatus(callmacro(command, arg, flags)); #if defined (DEP_ORIGSHELL) && !defined (NOJOB) for (i = 0; i < maxjobs; i++) if (joblist[i].pids) break; if (i >= maxjobs) break; VOID_C signal2(SIGHUP, (sigcst_t)trap_hup); sendparent(TE_CHANGESTATUS, n); if (recvmacro(&command2, &arg2, &flags) < 0) break; command = command2; arg = arg2; #else /* !DEP_ORIGSHELL || NOJOB */ break; #endif /* !DEP_ORIGSHELL || NOJOB */ } safeclose(parentfd); _exit(n); } safeclose(fds[1]); ptylist[win].pid = pid; ptylist[win].pipe = newdup(fds[0]); ptylist[win].status = -1; sigvecset(n); if (recvbuf(ptylist[win].pipe, &uc, sizeof(uc)) < 0) return(callmacro(command, arg, flags)); return(frontend()); } VOID killpty(n, statusp) int n, *statusp; { if (ptylist[n].pid) { VOID_C Xkillpg(ptylist[n].pid, SIGHUP); #ifdef SIGCONT VOID_C Xkillpg(ptylist[n].pid, SIGCONT); #endif VOID_C waitstatus(ptylist[n].pid, 0, statusp); ptylist[n].pid = (p_id_t)0; ptylist[n].status = 0; } changewin(n, (p_id_t)0); changewin(MAXWINDOWS, (p_id_t)-1); safeclose(ptylist[n].pipe); ptylist[n].pipe = -1; } VOID killallpty(VOID_A) { int i; for (i = 0; i < MAXWINDOWS; i++) { killpty(i, NULL); Xfree(ptylist[i].path); ptylist[i].path = NULL; } #ifdef CYGWIN closeallpty(); #endif if (emupid) { VOID_C kill(emupid, SIGHUP); #ifdef SIGCONT VOID_C kill(emupid, SIGCONT); #endif VOID_C waitstatus(emupid, 0, NULL); emupid = (p_id_t)0; } if (ptytmpfile) { rmtmpfile(ptytmpfile); Xfree(ptytmpfile); ptytmpfile = NULL; } safeclose(emufd); emufd = -1; } int checkpty(n) int n; { int status; if (!(ptylist[n].pid)) return(0); if (waitstatus(ptylist[n].pid, WNOHANG, &status) < 0) return(0); ptylist[n].pid = (p_id_t)0; ptylist[n].status = status; killpty(n, &status); return(-1); } int checkallpty(VOID_A) { int i, n; n = 0; for (i = 0; i < MAXWINDOWS; i++) if (checkpty(i) < 0) n = -1; return(n); } #endif /* DEP_PTY */ FD-3.01j/frontend.c100644 2105 1751 53700 13516612560 12671 0ustar shiraiuser/* * frontend.c * * frontend of terminal emulation */ #include "fd.h" #include "wait.h" #include "parse.h" #include "func.h" #include "funcno.h" #include "kanji.h" #include "system.h" #include "termemu.h" #ifdef DEP_IME #include "roman.h" #endif #ifdef DEP_IME #define MAXPTYMENU 5 #else #define MAXPTYMENU 4 #endif #ifdef DEP_PTY #if defined (DEP_ORIGSHELL) && !defined (NOALIAS) extern int addalias __P_((char *, char *)); extern int deletealias __P_((CONST char *)); #endif extern CONST functable funclist[]; extern int internal_status; extern int fdmode; extern int fdflags; extern int wheader; extern int lcmdline; extern int maxcmdline; extern p_id_t emupid; extern int emufd; extern char *ptytmpfile; #ifdef DEP_IME extern int ime_cont; #endif static int waitpty __P_((VOID_A)); static VOID NEAR _XXcputs __P_((CONST char *, int)); static VOID NEAR _Xattrputs __P_((CONST char *, int, int)); static int NEAR ptygetkey __P_((VOID_A)); static int NEAR recvvar __P_((int, char ***)); #ifdef DEP_ORIGSHELL static int NEAR recvheredoc __P_((int, heredoc_t **)); static int NEAR recvrlist __P_((int, redirectlist **)); static int NEAR recvcommand __P_((int, command_t **, syntaxtree *)); static int NEAR recvstree __P_((int, syntaxtree **, syntaxtree *)); #endif static VOID NEAR recvchild __P_((int)); static VOID NEAR sendkey __P_((int)); static int (*lastfunc)__P_((VOID_A)) = NULL; static u_long lockflags = 0; int waitstatus(pid, options, statusp) p_id_t pid; int options, *statusp; { wait_pid_t w; p_id_t tmp; tmp = Xwait4(pid, &w, options, NULL); if (tmp < (p_id_t)0 || tmp != pid) return(-1); if (statusp) *statusp = (WIFSIGNALED(w)) ? WTERMSIG(w) + 128 : (WEXITSTATUS(w) & 0377); return(0); } static int waitpty(VOID_A) { char result[MAXWINDOWS]; int i, oldwin, fds[MAXWINDOWS]; if (lastfunc && (*lastfunc)() < 0) return(-1); oldwin = win; for (i = 0; i < MAXWINDOWS; i++) fds[i] = (ptylist[i].pid) ? ptylist[i].pipe : -1; if (selectpty(MAXWINDOWS, fds, result, 0L) > 0) { for (i = 0; i < MAXWINDOWS; i++) if (result[i] && ptylist[i].pid) recvchild(i); } if (win != oldwin || !emupid) { recvchild(oldwin); return(-2); } if (!(ptylist[win].pid)) return(0); if (ptylist[win].status >= 0) return(-1); return(checkpty(win)); } VOID Xttyiomode(isnl) int isnl; { int dupdumbterm; if (!emupid) { syncptyout(-1, -1); ttyiomode(isnl); } else { dupdumbterm = dumbterm; dumbterm = 1; ttyiomode(isnl); dumbterm = dupdumbterm; if (!dumbterm) Xputterm(T_KEYPAD); } } VOID Xstdiomode(VOID_A) { int dupdumbterm; if (!emupid) { syncptyout(-1, -1); stdiomode(); } else { dupdumbterm = dumbterm; dumbterm = 1; stdiomode(); dumbterm = dupdumbterm; if (!dumbterm) Xputterm(T_NOKEYPAD); } } int Xtermmode(init) int init; { int mode, dupdumbterm; dupdumbterm = dumbterm; #ifdef DEP_ORIGSHELL if (isshptymode()) dumbterm = 1; #endif if (isptymode()) dumbterm = 1; mode = termmode(init); dumbterm = dupdumbterm; return(mode); } int XXputch(c) int c; { if (!emupid) return(Xputch(c)); else { sendword(emufd, TE_XPUTCH); sendword(emufd, c); return(c); } } static VOID NEAR _XXcputs(s, n) CONST char *s; int n; { int len; if (!emupid) Xcputs(s); else { if (!s) return; sendword(emufd, TE_XCPUTS); len = strlen(s); sendword(emufd, len); sendword(emufd, n); sendbuf(emufd, s, len); } } VOID XXcputs(s) CONST char *s; { _XXcputs(s, -1); } VOID Xputterm(n) int n; { if (!emupid) putterm(n); else { sendword(emufd, TE_PUTTERM); sendword(emufd, n); } } VOID Xputterms(n) int n; { if (!emupid) putterms(n); else { sendword(emufd, TE_PUTTERMS); sendword(emufd, n); } } int Xsetscroll(min, max) int min, max; { if (!emupid) return(setscroll(min, max)); else { sendword(emufd, TE_SETSCROLL); sendword(emufd, min); sendword(emufd, max); return(0); } } VOID Xlocate(x, y) int x, y; { if (!emupid) locate(x, y); else { sendword(emufd, TE_LOCATE); sendword(emufd, x); sendword(emufd, y); } } VOID Xtflush(VOID_A) { if (!emupid) tflush(); } #ifdef USESTDARGH /*VARARGS1*/ int XXcprintf(CONST char *fmt, ...) #else /*VARARGS1*/ int XXcprintf(fmt, va_alist) CONST char *fmt; va_dcl #endif { va_list args; char *buf; int n; VA_START(args, fmt); n = Xvasprintf(&buf, fmt, args); va_end(args); if (n < 0) error("malloc()"); _XXcputs(buf, n); Xfree(buf); return(n); } VOID Xcputnl(VOID_A) { if (!emupid) cputnl(); else { sendword(emufd, TE_CPUTNL); sendword(emufd, 0); } } int Xkanjiputs(s) CONST char *s; { return(XXcprintf("%k", s)); } static VOID NEAR _Xattrputs(s, isstandout, n) CONST char *s; int isstandout, n; { if (!s || !*s) return; if (isstandout) Xputterm(T_STANDOUT); _XXcputs(s, n); if (isstandout) Xputterm(END_STANDOUT); } VOID Xattrputs(s, isstandout) CONST char *s; int isstandout; { _Xattrputs(s, isstandout, -1); } #ifdef USESTDARGH /*VARARGS2*/ int Xattrprintf(CONST char *fmt, int isstandout, ...) #else /*VARARGS2*/ int Xattrprintf(fmt, isstandout, va_alist) CONST char *fmt; int isstandout; va_dcl #endif { va_list args; char *buf; int n; VA_START(args, isstandout); n = cvasprintf(&buf, fmt, args); va_end(args); _Xattrputs(buf, isstandout, n); free(buf); return(n); } int Xattrkanjiputs(s, isstandout) CONST char *s; int isstandout; { return(Xattrprintf("%k", isstandout, s)); } VOID Xchgcolor(color, reverse) int color, reverse; { if (!emupid) chgcolor(color, reverse); else { sendword(emufd, TE_CHGCOLOR); sendword(emufd, color); sendword(emufd, reverse); } } VOID Xmovecursor(n1, n2, c) int n1, n2, c; { if (!emupid) movecursor(n1, n2, c); else { sendword(emufd, TE_MOVECURSOR); sendword(emufd, n1); sendword(emufd, n2); sendword(emufd, c); } } VOID changewin(n, pid) int n; p_id_t pid; { int i; if (!emupid) return; sendword(emufd, TE_CHANGEWIN); sendword(emufd, n); sendbuf(emufd, &pid, sizeof(pid)); if (pid) return; for (i = 0; i < MAXWINDOWS; i++) if (ptylist[i].pid) return; VOID_C waitstatus(emupid, 0, NULL); emupid = (p_id_t)0; killallpty(); } VOID changewsize(h, n) int h, n; { int i; if (!emupid) return; sendword(emufd, TE_CHANGEWSIZE); sendword(emufd, h); sendword(emufd, n); for (i = 0; i < n; i++) sendword(emufd, winvar[i].v_fileperrow); } VOID insertwin(n, max) int n, max; { ptyinfo_t tmp; memcpy((char *)&tmp, (char *)&(ptylist[max - 1]), sizeof(ptyinfo_t)); memmove((char *)&(ptylist[n + 1]), (char *)&(ptylist[n]), (max - 1 - n) * sizeof(ptyinfo_t)); memcpy((char *)&(ptylist[n]), (char *)&tmp, sizeof(ptyinfo_t)); if (!emupid) return; sendword(emufd, TE_INSERTWIN); sendword(emufd, n); sendword(emufd, max); } VOID deletewin(n, max) int n, max; { ptyinfo_t tmp; memcpy((char *)&tmp, (char *)&(ptylist[n]), sizeof(ptyinfo_t)); memmove((char *)&(ptylist[n]), (char *)&(ptylist[n + 1]), (max - n) * sizeof(ptyinfo_t)); memcpy((char *)&(ptylist[max]), (char *)&tmp, sizeof(ptyinfo_t)); killpty(max, NULL); if (!emupid) return; sendword(emufd, TE_DELETEWIN); sendword(emufd, n); sendword(emufd, max); } #ifdef DEP_KCONV VOID changekcode(VOID_A) { if (!emupid) return; sendword(emufd, TE_CHANGEKCODE); sendword(emufd, inputkcode); sendword(emufd, outputkcode); } VOID changeinkcode(VOID_A) { ptylist[win].incode = (u_char)ptyinkcode; if (!emupid) return; sendword(emufd, TE_CHANGEINKCODE); sendword(emufd, win); sendword(emufd, ptyinkcode); } VOID changeoutkcode(VOID_A) { ptylist[win].outcode = (u_char)ptyoutkcode; if (!emupid) return; sendword(emufd, TE_CHANGEOUTKCODE); sendword(emufd, win); sendword(emufd, ptyoutkcode); } #endif /* DEP_KCONV */ static int NEAR ptygetkey(VOID_A) { #ifdef DEP_IME static char buf[MAXKANJIBUF + 1] = ""; static int next = 0; u_int w; #endif CONST char *str[MAXPTYMENU]; char *cp, *new; int n, c, ch, val[MAXPTYMENU]; #ifdef DEP_IME if (next > 0) { if (next >= sizeof(buf) || !(c = (u_char)(buf[next++]))) next = 0; else return(c); } if (ime_cont) { c = ime_inputkanji(sigalrm(1), buf); if (c < 0 || !ime_cont) movepos(filepos, 0); if (c != K_ESC) { if (c < 0) { next = 0; ime_inputkanji(0, NULL); } else if (!c && (c = (u_char)(buf[0]))) next = 1; return(c); } } #endif /* DEP_IME */ for (;;) { n = -1; c = getkey2(sigalrm(1), inputkcode, 0); while (lockflags & (1 << win)) { kbhit2(1000000L / SENSEPERSEC); waitpty(); } #ifdef DEP_ORIGSHELL if (isshptymode()) break; #endif if (c < 0 || ptymenukey < 0 || alternate(c) != ptymenukey) break; str[0] = new = asprintf2(PTYAI_K, getkeysym(ptymenukey, 0)); str[1] = PTYIC_K; str[2] = PTYBR_K; #ifdef DEP_IME str[3] = PTYKJ_K; #endif str[MAXPTYMENU - 1] = PTYNW_K; val[0] = 0; val[1] = 1; val[2] = 2; #ifdef DEP_IME val[3] = 3; #endif val[MAXPTYMENU - 1] = 4; n = 0; changewin(MAXWINDOWS, (p_id_t)-1); ch = selectstr(&n, (windows > 1) ? MAXPTYMENU : MAXPTYMENU - 1, 0, str, val); movepos(filepos, 0); changewin(win, (p_id_t)-1); Xfree(new); if (ch != K_CR) continue; else if (!n) break; else if (n == 2) { killpty(win, NULL); rewritefile(1); c = -1; break; } #ifdef DEP_IME else if (n == 3) { c = ime_inputkanji(sigalrm(1), buf); if (c < 0 || !ime_cont) movepos(filepos, 0); if (c != K_ESC) { if (c < 0) { next = 0; ime_inputkanji(0, NULL); } else if (!c && (c = (u_char)(buf[0]))) next = 1; break; } } #endif /* DEP_IME */ #ifndef _NOSPLITWIN else if (n == 4) { VOID_C nextwin(); c = -2; break; } #endif else { changewin(MAXWINDOWS, (p_id_t)-1); lcmdline = -1; maxcmdline = 1; cp = inputstr(PTYKC_K, 1, -1, NULL, -1); movepos(filepos, 0); changewin(win, (p_id_t)-1); if (!cp) continue; #ifdef DEP_IME w = ime_getkeycode(cp); Xfree(cp); if (!w) /*EMPTY*/; else if (!(w & ~01777)) { c = w; break; } else if ((c = ime_inkanjiconv(buf, w)) < 0) /*EMPTY*/; else if (c || !(c = (u_char)(buf[0]))) break; else { next = 1; break; } #else /* !DEP_IME */ c = getkeycode(cp, 0); Xfree(cp); if (c >= 0) break; #endif /* !DEP_IME */ changewin(MAXWINDOWS, (p_id_t)-1); warning(0, VALNG_K); movepos(filepos, 0); changewin(win, (p_id_t)-1); } } #ifdef DEP_IME if (c < 0) { next = 0; ime_inputkanji(0, NULL); } #endif return(c); } static int NEAR recvvar(fd, varp) int fd; char ***varp; { char *cp, **var; int i, c; if (recvbuf(fd, &var, sizeof(var)) < 0) return(-1); if (var) { if (recvbuf(fd, &c, sizeof(c)) < 0) return(-1); var = (char **)Xmalloc((c + 1) * sizeof(char *)); for (i = 0; i < c; i++) { if (recvstring(fd, &cp) < 0) { var[i] = NULL; freevar(var); return(-1); } var[i] = cp; } var[i] = NULL; } *varp = var; return(0); } #ifdef DEP_ORIGSHELL static int NEAR recvheredoc(fd, hdpp) int fd; heredoc_t **hdpp; { heredoc_t *hdp; if (recvbuf(fd, &hdp, sizeof(hdp)) < 0) return(-1); if (hdp) { hdp = (heredoc_t *)Xmalloc(sizeof(heredoc_t)); if (recvbuf(fd, hdp, sizeof(*hdp)) < 0) { Xfree(hdp); return(-1); } hdp -> eof = hdp -> filename = hdp -> buf = NULL; if (recvstring(fd, &(hdp -> eof)) < 0 || recvstring(fd, &(hdp -> filename)) < 0 || recvstring(fd, &(hdp -> buf)) < 0) { freeheredoc(hdp, 0); return(-1); } } *hdpp = hdp; return(0); } static int NEAR recvrlist(fd, rpp) int fd; redirectlist **rpp; { redirectlist *rp; int n; if (recvbuf(fd, &rp, sizeof(rp)) < 0) return(-1); if (rp) { rp = (redirectlist *)Xmalloc(sizeof(redirectlist)); if (recvbuf(fd, rp, sizeof(*rp)) < 0) { Xfree(rp); return(-1); } rp -> filename = NULL; rp -> next = NULL; if (rp -> type & MD_HEREDOC) n = recvheredoc(fd, (heredoc_t **)&(rp -> filename)); else n = recvstring(fd, &(rp -> filename)); if (n < 0 || recvrlist(fd, &(rp -> next)) < 0) { freerlist(rp, 0); return(-1); } } *rpp = rp; return(0); } static int NEAR recvcommand(fd, commp, trp) int fd; command_t **commp; syntaxtree *trp; { command_t *comm; char **argv; int n; if (recvbuf(fd, &comm, sizeof(comm)) < 0) return(-1); if (comm) { if (trp -> flags & ST_NODE) return(recvstree(fd, (syntaxtree **)commp, trp)); comm = (command_t *)Xmalloc(sizeof(command_t)); if (recvbuf(fd, comm, sizeof(*comm)) < 0) { Xfree(comm); return(-1); } argv = comm -> argv; comm -> argv = NULL; comm -> redp = NULL; if (!argv) n = 0; else if (!isstatement(comm)) n = recvvar(fd, &(comm -> argv)); else n = recvstree(fd, (syntaxtree **)&(comm -> argv), trp); if (n < 0 || recvrlist(fd, &(comm -> redp)) < 0) { freecomm(comm, 0); return(-1); } } *commp = comm; return(0); } static int NEAR recvstree(fd, trpp, parent) int fd; syntaxtree **trpp, *parent; { syntaxtree *trp; if (recvbuf(fd, &trp, sizeof(trp)) < 0) return(-1); if (trp) { trp = newstree(parent); if (recvbuf(fd, trp, sizeof(*trp)) < 0) { Xfree(trp); return(-1); } trp -> comm = NULL; trp -> next = NULL; if (recvcommand(fd, &(trp -> comm), trp) < 0 || recvstree(fd, &(trp -> next), trp) < 0) { freestree(trp); return(-1); } } *trpp = trp; return(0); } #endif /* DEP_ORIGSHELL */ static VOID NEAR recvchild(w) int w; { #ifdef DEP_ORIGSHELL syntaxtree *trp; #endif #ifndef _NOARCHIVE lsparse_t launch; archive_t arch; #endif #ifdef DEP_DOSEMU devinfo dev; #endif bindtable bind; keyseq_t key; char *cp, *func1, *func2, ***varp, **var; u_char uc; int n, fd, val, wastty; fd = ptylist[w].pipe; if (recvbuf(fd, &uc, sizeof(uc)) < 0) return; switch (uc) { case TE_SETVAR: if (recvbuf(fd, &varp, sizeof(varp)) < 0 || recvvar(fd, &var) < 0) break; freevar(*varp); *varp = var; break; case TE_PUSHVAR: if (recvbuf(fd, &varp, sizeof(varp)) < 0 || recvstring(fd, &cp) < 0) break; n = countvar(*varp); (*varp) = (char **)Xrealloc(*varp, (n + 1 + 1) * sizeof(char *)); memmove((char *)&((*varp)[1]), (char *)&((*varp)[0]), n * sizeof(char *)); (*varp)[0] = cp; (*varp)[n + 1] = NULL; break; case TE_POPVAR: if (recvbuf(fd, &varp, sizeof(varp)) < 0 || (n = countvar(*varp)) <= 0) break; Xfree((*varp)[0]); memmove((char *)&((*varp)[0]), (char *)&((*varp)[1]), n * sizeof(char *)); break; case TE_CHDIR: if (recvstring(fd, &cp) < 0 || !cp) break; VOID_C chdir2(cp); Xfree(cp); break; #ifdef DEP_ORIGSHELL case TE_PUTEXPORTVAR: if (recvbuf(fd, &n, sizeof(n)) < 0 || recvstring(fd, &cp) < 0 || !cp) break; if (putexportvar(cp, n) < 0) Xfree(cp); break; case TE_PUTSHELLVAR: if (recvbuf(fd, &n, sizeof(n)) < 0 || recvstring(fd, &cp) < 0 || !cp) break; if (putshellvar(cp, n) < 0) Xfree(cp); break; case TE_UNSET: if (recvbuf(fd, &n, sizeof(n)) < 0 || recvstring(fd, &cp) < 0 || !cp) break; VOID_C unset(cp, n); Xfree(cp); break; case TE_SETEXPORT: if (recvstring(fd, &cp) < 0 || !cp) break; VOID_C setexport(cp); Xfree(cp); break; case TE_SETRONLY: if (recvstring(fd, &cp) < 0 || !cp) break; VOID_C setronly(cp); Xfree(cp); break; case TE_SETSHFLAG: if (recvbuf(fd, &n, sizeof(n)) < 0 || recvbuf(fd, &val, sizeof(val)) < 0) break; setshflag(n, val); errorexit = tmperrorexit; break; case TE_ADDFUNCTION: if (recvstring(fd, &cp) < 0) break; if (recvstree(fd, &trp, NULL) < 0 || !trp) { Xfree(cp); break; } if (cp) setshfunc(cp, trp); break; case TE_DELETEFUNCTION: if (recvbuf(fd, &n, sizeof(n)) < 0 || recvstring(fd, &cp) < 0 || !cp) break; VOID_C unsetshfunc(cp, n); Xfree(cp); break; #else /* !DEP_ORIGSHELL */ case TE_PUTSHELLVAR: if (recvbuf(fd, &n, sizeof(n)) < 0 || recvstring(fd, &func1) < 0) break; if (recvstring(fd, &cp) < 0 || !cp) { Xfree(func1); break; } setenv2(cp, func1, n); Xfree(cp); Xfree(func1); break; case TE_ADDFUNCTION: if (recvvar(fd, &var) < 0) break; if (recvstring(fd, &cp) < 0 || !cp) { freevar(var); break; } VOID_C addfunction(cp, var); break; case TE_DELETEFUNCTION: if (recvstring(fd, &cp) < 0 || !cp) break; VOID_C deletefunction(cp); Xfree(cp); break; #endif /* !DEP_ORIGSHELL */ #if !defined (DEP_ORIGSHELL) || !defined (NOALIAS) case TE_ADDALIAS: if (recvstring(fd, &func1) < 0) break; if (recvstring(fd, &cp) < 0 || !cp) { Xfree(func1); break; } VOID_C addalias(cp, func1); break; case TE_DELETEALIAS: if (recvstring(fd, &cp) < 0 || !cp) break; VOID_C deletealias(cp); Xfree(cp); break; #endif /* !DEP_ORIGSHELL || !NOALIAS */ case TE_SETHISTORY: if (recvbuf(fd, &n, sizeof(n)) < 0 || recvstring(fd, &cp) < 0 || !cp) break; VOID_C entryhist(cp, n); Xfree(cp); break; case TE_ADDKEYBIND: if (recvbuf(fd, &n, sizeof(n)) < 0 || recvbuf(fd, &bind, sizeof(bind)) < 0 || recvstring(fd, &func1) < 0) break; if (recvstring(fd, &func2) < 0) { Xfree(func1); break; } if (recvstring(fd, &cp) < 0) { Xfree(func1); Xfree(func2); break; } VOID_C addkeybind(n, &bind, func1, func2, cp); break; case TE_DELETEKEYBIND: if (recvbuf(fd, &n, sizeof(n)) < 0) break; deletekeybind(n); break; case TE_SETKEYSEQ: if (recvbuf(fd, &(key.code), sizeof(key.code)) < 0 || recvbuf(fd, &(key.len), sizeof(key.len)) < 0 || recvstring(fd, &(key.str)) < 0) break; setkeyseq(key.code, key.str, key.len); break; #ifndef _NOARCHIVE case TE_ADDLAUNCH: launch.ext = launch.comm = NULL; # ifndef OLDPARSE launch.format = launch.lignore = launch.lerror = NULL; # endif if (recvbuf(fd, &n, sizeof(n)) < 0 || recvbuf(fd, &launch, sizeof(launch)) < 0 || recvstring(fd, &(launch.ext)) < 0 || recvstring(fd, &(launch.comm)) < 0 # ifndef OLDPARSE || recvvar(fd, &(launch.format)) < 0 || recvvar(fd, &(launch.lignore)) < 0 || recvvar(fd, &(launch.lerror)) < 0 # endif ) { freelaunch(&launch); break; } addlaunch(n, &launch); break; case TE_DELETELAUNCH: if (recvbuf(fd, &n, sizeof(n)) < 0) break; deletelaunch(n); break; case TE_ADDARCH: arch.ext = arch.p_comm = arch.u_comm = NULL; if (recvbuf(fd, &n, sizeof(n)) < 0 || recvbuf(fd, &(arch.flags), sizeof(arch.flags)) < 0 || recvstring(fd, &(arch.ext)) < 0 || recvstring(fd, &(arch.p_comm)) < 0 || recvstring(fd, &(arch.u_comm)) < 0) { freearch(&arch); break; } addarch(n, &arch); break; case TE_DELETEARCH: if (recvbuf(fd, &n, sizeof(n)) < 0) break; deletearch(n); break; #endif /* !_NOARCHIVE */ #ifdef DEP_DOSEMU case TE_INSERTDRV: if (recvbuf(fd, &n, sizeof(n)) < 0 || recvbuf(fd, &dev, sizeof(dev)) < 0 || recvstring(fd, &(dev.name)) < 0) break; VOID_C insertdrv(n, &dev); break; case TE_DELETEDRV: if (recvbuf(fd, &n, sizeof(n)) < 0) break; VOID_C deletedrv(n); break; #endif /* DEP_DOSEMU */ case TE_LOCKFRONT: lockflags |= (1 << w); if (!emupid) break; sendword(emufd, TE_LOCKBACK); sendword(emufd, w); break; case TE_UNLOCKFRONT: lockflags &= ~(1 << w); if (!emupid) break; sendword(emufd, TE_UNLOCKBACK); sendword(emufd, w); break; case TE_SAVETTYIO: if (recvbuf(fd, &n, sizeof(n)) < 0 || recvbuf(fd, &val, sizeof(val)) < 0) break; if (!val) cp = NULL; else { cp = Xmalloc(val); if (recvbuf(fd, cp, val) < 0) { Xfree(cp); break; } } if (n >= 0) { Xfree(duptty[n]); duptty[n] = cp; } else Xfree(cp); break; #ifdef DEP_IME case TE_ADDROMAN: if (recvstring(fd, &cp) < 0 || !cp) break; if (recvstring(fd, &func1) < 0) { Xfree(cp); break; } VOID_C addroman(cp, func1); break; case TE_FREEROMAN: if (recvbuf(fd, &n, sizeof(n)) < 0) break; freeroman(n); break; #endif /* DEP_IME */ case TE_INTERNAL: if (recvbuf(fd, &n, sizeof(n)) < 0 || recvstring(fd, &cp) < 0) break; if (n < 0 || n >= FUNCLISTSIZ) { Xfree(cp); break; } keywaitfunc = lastfunc; changewin(MAXWINDOWS, (p_id_t)-1); if (!(wastty = isttyiomode)) Xttyiomode(0); ptyinternal++; VOID_C dointernal(n, cp, ICM_CMDLINE, NULL); ptyinternal--; if (!wastty) Xstdiomode(); changewin(win, (p_id_t)-1); rewritefile(0); keywaitfunc = waitpty; Xfree(cp); break; case TE_CHANGESTATUS: if (recvbuf(fd, &n, sizeof(n)) < 0) break; ptylist[w].status = n; break; default: break; } } static VOID NEAR sendkey(c) int c; { static char buf[MAXUTF8LEN * sizeof(short)]; static int index = 0; static int max = 0; #ifdef DEP_KCONV int code; #endif short w; #ifdef DEP_KCONV code = (inputkcode != NOCNV) ? inputkcode : DEFCODE; #endif if (c >= 0) { w = c; memcpy(&(buf[index++ * sizeof(w)]), (char *)&w, sizeof(w)); } if (c < 0 || c & 0xff00) /*EMPTY*/; else if (max && index >= max) /*EMPTY*/; #ifdef DEP_KCONV else if (code == EUC && c == C_EKANA) { max = 2; return; } else if (code >= UTF8) { if (index > 1) { if ((c & 0xc0) == 0x80) return; } else if (ismsb(c)) { max = ((c & 0xf0) == 0xe0) ? 3 : 2; return; } } #else /* !DEP_KCONV */ # ifdef CODEEUC else if (c == C_EKANA) { max = 2; return; } # endif #endif /* !DEP_KCONV */ else if (isinkanji1(c, code)) { max = 2; return; } if (index) sendbuf(emufd, buf, index * sizeof(w)); index = max = 0; } int frontend(VOID_A) { int n, ch, wastty, status; ptylist[win].status = -1; n = sigvecset(1); lastfunc = keywaitfunc; keywaitfunc = waitpty; changewsize(wheader, windows); changewin(win, ptylist[win].pid); internal_status = FNC_FAIL; if (!(wastty = isttyiomode)) Xttyiomode(1); while ((ch = ptygetkey()) >= 0) sendkey(ch); sendkey(-1); if (!wastty) Xstdiomode(); if (ch < -1) { status = 0; internal_status = FNC_CANCEL; } else { status = ptylist[win].status; if (!(ptylist[win].pid)) { ptylist[win].status = -1; recvchild(win); killpty(win, &status); } if (internal_status == FNC_FAIL && status < 128) internal_status = status; } sigvecset(n); keywaitfunc = lastfunc; if (!(ptylist[win].pid)) { changewin(win, (p_id_t)0); if (!emupid && ptytmpfile) { rmtmpfile(ptytmpfile); Xfree(ptytmpfile); ptytmpfile = NULL; } } changewin(MAXWINDOWS, (p_id_t)-1); setlinecol(); return(status); } #endif /* DEP_PTY */ FD-3.01j/backend.c100644 2105 1751 112252 13516612560 12457 0ustar shiraiuser/* * backend.c * * backend of terminal emulation */ #include "fd.h" #include "termio.h" #include "kconv.h" #include "func.h" #include "system.h" #include "termemu.h" #define MAXESCPARAM 16 #define MAXESCCHAR 4 #define MAXTABSTOP 255 #define MAXLASTUCS2 (MAXNFLEN - 1) typedef struct _ptystat_t { short x, y; short fg, bg; u_short attr; } ptystat_t; typedef struct _ptyterm_t { ptystat_t cur, save; short min_x, min_y; short max_x, max_y; short min_scroll, max_scroll; short last1, last2; u_char escmode; u_char nparam; u_char nchar; u_char ntabstop; short escparam[MAXESCPARAM]; u_char escchar[MAXESCCHAR]; u_short tabstop[MAXTABSTOP]; #ifdef DEP_KCONV u_short last_ucs2[MAXLASTUCS2]; #endif u_short termflags; char codeselect[MAXESCCHAR + 2]; } ptyterm_t; #define A_BOLD 00001 #define A_REVERSE 00002 #define A_DIM 00004 #define A_BLINK 00010 #define A_STANDOUT 00020 #define A_UNDERLINE 00040 #define A_INVISIBLE 00100 #define T_NOAUTOMARGIN 00001 #define T_MULTIBYTE 00002 #define T_NOAPPLIKEY 00004 #define T_NOAPPLICURSOR 00010 #define T_CODEALT 00020 #define T_LOCKED 00040 #ifdef DEP_PTY extern int hideclock; extern int fdmode; extern int wheader; extern int emufd; static VOID NEAR resettermattr __P_((int)); static VOID NEAR resettermcode __P_((int)); static VOID NEAR resettabstop __P_((int)); static VOID NEAR biasxy __P_((int, short *, short *)); static VOID NEAR settermattr __P_((int)); static VOID NEAR settermcode __P_((int)); static VOID NEAR surelocate __P_((int, int)); static VOID NEAR reallocate __P_((int, int, int)); #ifdef SIGWINCH static int wintr __P_((VOID_A)); static VOID NEAR evalsignal __P_((VOID_A)); #endif static int NEAR convkey __P_((int, keyseq_t *)); #ifdef DEP_KCONV static int NEAR ptyrecvbuf __P_((VOID_P, int)); static int NEAR ptyrecvword __P_((int *)); static int NEAR ptyrecvstring __P_((char **)); static VOID NEAR ptyungetch __P_((int)); static int NEAR ptygetch __P_((VOID_A)); static u_int NEAR ptygetucs2 __P_((int)); static VOID NEAR getiocode __P_((int, int *, int *)); static CONST char *NEAR ptykconv __P_((char *, char *, int, int)); static u_int NEAR evalnf __P_((int, char *)); #else /* !DEP_KCONV */ #define ptyrecvbuf(b, n) recvbuf(emufd, b, n) #define ptyrecvword(n) recvword(emufd, n) #define ptyrecvstring(c) recvstring(emufd, c) #endif /* !DEP_KCONV */ static VOID NEAR evalscroll __P_((int, int, int)); static VOID NEAR evallf __P_((int)); static VOID NEAR outputnormal __P_((int, char *, int)); static VOID NEAR evalnormal __P_((int, int)); static VOID NEAR evalcontrol __P_((int, int)); static VOID NEAR evalescape __P_((int, int)); static VOID NEAR evalcsi __P_((int, int, int)); static VOID NEAR evalcodeselect __P_((int, int)); static VOID NEAR evaloutput __P_((int)); static int NEAR chgattr __P_((int, int)); static int NEAR directoutput __P_((int)); static int NEAR evalinput __P_((VOID_A)); static ptyterm_t pty[MAXWINDOWS + 1]; static short last_x = (short)-1; static short last_y = (short)-1; static short last_fg = (short)-1; static short last_bg = (short)-1; static u_short last_attr = (u_short)0; static u_short last_termflags = (u_short)0; static char last_codeselect[MAXESCCHAR + 3] = "\033(B"; #ifdef SIGWINCH static int ptywinched = 0; #endif #ifdef DEP_KCONV static u_char ptyungetbuf[MAXUTF8LEN * MAXNFLEN * sizeof(short)]; static int ptyungetnum = 0; #endif static VOID NEAR resettermattr(w) int w; { if (w >= 0) { pty[w].cur.attr = (u_short)0; pty[w].cur.fg = pty[w].cur.bg = (short)-1; } else if (last_attr || last_fg >= (short)0 || last_bg >= (short)0) { putterm(T_NORMAL); last_attr = (u_short)0; last_fg = last_bg = (short)-1; } } static VOID NEAR resettermcode(w) int w; { pty[w].termflags &= ~T_CODEALT; Xstrcpy(pty[w].codeselect, "(B"); } static VOID NEAR resettabstop(w) int w; { int x; pty[w].ntabstop = (u_char)0; for (x = pty[w].min_x; x < pty[w].max_x; x += 8) { if (pty[w].ntabstop >= (u_char)MAXTABSTOP) break; pty[w].tabstop[(pty[w].ntabstop)++] = x; } } VOID resetptyterm(w, clean) int w, clean; { #ifdef DEP_KCONV int i; #endif int min_x, min_y, max_y; last_x = last_y = (short)-1; if (w < 0 || w >= MAXWINDOWS + 1) return; min_x = pty[w].min_x; min_y = pty[w].min_y; max_y = pty[w].max_y; pty[w].min_x = (short)0; pty[w].max_x = n_column; #ifdef DEP_ORIGSHELL if (w == MAXWINDOWS || isshptymode()) #else if (w == MAXWINDOWS) #endif { pty[w].min_y = (short)0; pty[w].max_y = n_line; } else { pty[w].min_y = filetop(w); pty[w].max_y = pty[w].min_y + winvar[w].v_fileperrow; } if (clean) { pty[w].cur.x = pty[w].min_x; pty[w].cur.y = pty[w].max_y - 1; pty[w].min_scroll = pty[w].min_y; pty[w].max_scroll = pty[w].max_y - 1; pty[w].escmode = '\0'; pty[w].last1 = pty[w].last2 = (short)-1; #ifdef DEP_KCONV for (i = 0; i < MAXLASTUCS2; i++) pty[w].last_ucs2[i] = (u_short)0; #endif pty[w].termflags = (u_short)0; resettermattr(w); resettermcode(w); resettabstop(w); memcpy((char *)&(pty[w].save), (char *)&(pty[w].cur), sizeof(pty[w].save)); } else { pty[w].cur.x += pty[w].min_x - min_x; pty[w].cur.y += pty[w].min_y - min_y; pty[w].save.x += pty[w].min_x - min_x; pty[w].save.y += pty[w].min_y - min_y; pty[w].min_scroll += pty[w].min_y - min_y; pty[w].max_scroll += pty[w].max_y - max_y; biasxy(w, &(pty[w].cur.x), &(pty[w].cur.y)); biasxy(w, &(pty[w].save.x), &(pty[w].save.y)); biasxy(w, NULL, &(pty[w].min_scroll)); biasxy(w, NULL, &(pty[w].max_scroll)); } } static VOID NEAR biasxy(w, xp, yp) int w; short *xp, *yp; { if (xp) { if (*xp < pty[w].min_x) *xp = pty[w].min_x; else if (*xp >= pty[w].max_x) *xp = pty[w].max_x - 1; } if (yp) { if (*yp < pty[w].min_y) *yp = pty[w].min_y; else if (*yp >= pty[w].max_y) *yp = pty[w].max_y - 1; } } static VOID NEAR settermattr(w) int w; { if ((last_fg >= (short)0 && pty[w].cur.fg < (short)0) || (last_bg >= (short)0 && pty[w].cur.bg < (short)0)) resettermattr(-1); if (last_attr != pty[w].cur.attr) { putterm(T_NORMAL); last_fg = last_bg = (short)-1; if (pty[w].cur.attr & A_BOLD) putterm(T_BOLD); if (pty[w].cur.attr & A_REVERSE) putterm(T_REVERSE); if (pty[w].cur.attr & A_DIM) putterm(T_DIM); if (pty[w].cur.attr & A_BLINK) putterm(T_BLINK); if (pty[w].cur.attr & A_STANDOUT) putterm(T_STANDOUT); if (pty[w].cur.attr & A_UNDERLINE) putterm(T_UNDERLINE); last_attr = pty[w].cur.attr; } if (last_fg != pty[w].cur.fg && pty[w].cur.fg >= (short)0) { if (tputparam(T_FGCOLOR, pty[w].cur.fg, 0, 1) < 0) tprintf("\033[%dm", 1, pty[w].cur.fg + ANSI_NORMAL); last_fg = pty[w].cur.fg; } if (last_bg != pty[w].cur.bg && pty[w].cur.bg >= (short)0) { if (tputparam(T_BGCOLOR, pty[w].cur.bg, 0, 1) < 0) tprintf("\033[%dm", 1, pty[w].cur.bg + ANSI_REVERSE); last_bg = pty[w].cur.bg; } } static VOID NEAR settermcode(w) int w; { if ((last_termflags & T_CODEALT) != (pty[w].termflags & T_CODEALT)) { if (pty[w].termflags & T_CODEALT) { VOID_C Xputch('\016'); last_termflags |= T_CODEALT; } else { VOID_C Xputch('\017'); last_termflags &= ~T_CODEALT; } } if (strcmp(&(last_codeselect[1]), pty[w].codeselect)) { last_codeselect[0] = '\033'; Xstrcpy(&(last_codeselect[1]), pty[w].codeselect); tputs2(last_codeselect, 1); } } static VOID NEAR surelocate(w, forced) int w, forced; { if (!forced && pty[w].cur.x == last_x && pty[w].cur.y == last_y) return; resettermattr(-1); locate(pty[w].cur.x, pty[w].cur.y); last_x = pty[w].cur.x; last_y = pty[w].cur.y; } static VOID NEAR reallocate(w, x, y) int w, x, y; { if (pty[w].cur.attr || pty[w].cur.fg >= (short)0 || pty[w].cur.bg >= (short)0) { surelocate(w, 1); settermattr(w); } pty[w].cur.x = x; pty[w].cur.y = y; biasxy(w, &(pty[w].cur.x), &(pty[w].cur.y)); locate(pty[w].cur.x, pty[w].cur.y); tflush(); last_x = pty[w].cur.x; last_y = pty[w].cur.y; } #ifdef SIGWINCH static int wintr(VOID_A) { sigblk_t old; int duperrno; duperrno = errno; suspendsignal(SIGWINCH, (sigcst_t)wintr, &old); pollscreen(1); ptywinched++; resumesignal(SIGWINCH, &old); errno = duperrno; return(0); } static VOID NEAR evalsignal(VOID_A) { int i, xmax, ymax; if (!ptywinched) return; pollscreen(0); for (i = 0; i < MAXWINDOWS; i++) { xmax = pty[i].max_x - pty[i].min_x; ymax = pty[i].max_y - pty[i].min_y; resetptyterm(i, 0); setwsize(ptylist[i].fd, pty[i].max_x - pty[i].min_x, pty[i].max_y - pty[i].min_y); if (xmax != pty[i].max_x - pty[i].min_x || ymax != pty[i].max_y - pty[i].min_y) { pty[i].cur.x = pty[i].save.x = pty[i].min_x; pty[i].cur.y = pty[i].save.y = pty[i].max_y - 1; } } resetptyterm(i, 0); ptywinched = 0; } #endif /* SIGWINCH */ static int NEAR convkey(w, kp) int w; keyseq_t *kp; { kp -> str = NULL; if (pty[w].termflags & T_NOAPPLICURSOR) switch (kp -> code) { case K_UP: kp -> str = "\033[A"; break; case K_DOWN: kp -> str = "\033[B"; break; case K_RIGHT: kp -> str = "\033[C"; break; case K_LEFT: kp -> str = "\033[D"; break; default: break; } if (kp -> str) { kp -> len = (u_char)strlen(kp -> str); return(0); } if ((pty[w].termflags & T_NOAPPLIKEY) && (kp -> code >= K_F('*') && kp -> code < K_DL)) { if (kp -> code == K_F('?')) kp -> code = K_CR; else kp -> code -= K_F0; kp -> len = (u_char)0; return(-1); } return((getdefkeyseq(kp) < 0) ? getkeyseq(kp) : 0); } #ifdef DEP_KCONV static int NEAR ptyrecvbuf(buf, nbytes) VOID_P buf; int nbytes; { char *cp; int len; cp = (char *)buf; if (ptyungetnum) { len = nbytes; if (len > ptyungetnum) len = ptyungetnum; memcpy(cp, (char *)ptyungetbuf, len * sizeof(u_char)); cp += len; nbytes -= len; ptyungetnum -= len; memmove((char *)ptyungetbuf, (char *)&(ptyungetbuf[len]), ptyungetnum * sizeof(u_char)); } return(recvbuf(emufd, cp, nbytes)); } static int NEAR ptyrecvword(np) int *np; { short w; if (ptyrecvbuf(&w, sizeof(w)) < 0) return(-1); *np = (int)w; return(0); } static int NEAR ptyrecvstring(cpp) char **cpp; { char *cp; ALLOC_T len; if (ptyrecvbuf(&cp, sizeof(cp)) < 0) return(-1); if (cp) { if (ptyrecvbuf(&len, sizeof(len)) < 0) return(-1); cp = Xmalloc(len + 1); if (ptyrecvbuf(cp, len) < 0) { Xfree(cp); return(-1); } cp[len] = '\0'; } *cpp = cp; return(0); } static VOID NEAR ptyungetch(c) int c; { u_short ch; ch = c; if (ptyungetnum + sizeof(ch) > arraysize(ptyungetbuf)) return; memmove((char *)&(ptyungetbuf[sizeof(ch)]), (char *)&(ptyungetbuf[0]), ptyungetnum * sizeof(u_char)); memcpy((char *)ptyungetbuf, (char *)&ch, sizeof(ch)); ptyungetnum += sizeof(ch); } static int NEAR ptygetch(VOID_A) { u_short ch; if (ptyrecvbuf(&ch, sizeof(ch)) < 0) return(-1); if (ch & 0xff00) { ptyungetch(ch); return(-1); } return(ch); } static u_int NEAR ptygetucs2(ch) int ch; { char buf[MAXUTF8LEN + 1]; int n; n = 0; buf[n++] = ch; if (!ismsb(ch)) /*EMPTY*/; else if ((ch = ptygetch()) < 0) return((u_int)-1); else { buf[n++] = ch; if (isutf2(buf[0], buf[1])) /*EMPTY*/; else if ((ch = ptygetch()) < 0) { ptyungetch((u_char)(buf[1])); return((u_int)-1); } else buf[n++] = ch; } buf[n] = '\0'; return(ucs2fromutf8((u_char *)buf, NULL)); } static VOID NEAR getiocode(w, incodep, outcodep) int w, *incodep, *outcodep; { int incode, outcode; outcode = (outputkcode != NOCNV) ? outputkcode : DEFCODE; incode = (w < MAXWINDOWS && ptylist[w].outcode != NOCNV) ? ptylist[w].outcode : outcode; if (incodep) *incodep = incode; if (outcodep) *outcodep = outcode; } static CONST char *NEAR ptykconv(buf, buf2, incode, outcode) char *buf, *buf2; int incode, outcode; { CONST char *cp, *tmp; tmp = kanjiconv2(buf2, buf, MAXKANJIBUF, incode, DEFCODE, L_TERMINAL); if (kanjierrno) return(buf); if (tmp == buf) buf = buf2; cp = kanjiconv2(buf, tmp, MAXKANJIBUF, DEFCODE, outcode, L_TERMINAL); if (kanjierrno) return(tmp); return(cp); } static u_int NEAR evalnf(w, buf) int w; char *buf; { u_short ubuf[MAXLASTUCS2 + 1 + 1]; char tmp[MAXUTF8LEN + 1]; u_int u; int i, n, next, width, incode; getiocode(w, &incode, NULL); for (i = 0; i < MAXLASTUCS2 && pty[w].last_ucs2[i]; i++) ubuf[i] = pty[w].last_ucs2[i]; if (!buf) { next = 0; buf = tmp; } else { u = ucs2fromutf8((u_char *)buf, NULL); if (incode != M_UTF8) return(u); ubuf[i++] = u; next = selectpty(1, &(ptylist[w].fd), NULL, WAITKANJI * 1000L); } ubuf[i] = (u_short)0; pty[w].last1 = pty[w].last2 = (short)-1; n = 0; while (ubuf[n]) { u = ucs2denormalization(ubuf, &n, incode - UTF8, L_TERMINAL); if (next > 0 && n <= 1 && i <= MAXLASTUCS2) { n = 0; break; } buf[ucs2toutf8(buf, 0, u)] = '\0'; width = (iswucs2(u)) ? 2 : 1; outputnormal(w, buf, width); if (next > 0) break; } for (i = 0; i < MAXLASTUCS2; i++) if ((pty[w].last_ucs2[i] = ubuf[n])) n++; return((u_int)0); } #endif /* DEP_KCONV */ static VOID NEAR evalscroll(w, n, c) int w, n, c; { resettermattr(-1); regionscroll(n, c, pty[w].cur.x, pty[w].cur.y, pty[w].min_scroll, pty[w].max_scroll); tflush(); last_x = pty[w].cur.x; last_y = pty[w].cur.y; } static VOID NEAR evallf(w) int w; { if (pty[w].cur.y < pty[w].max_y && pty[w].cur.y == pty[w].max_scroll) evalscroll(w, C_SCROLLFORW, 1); else reallocate(w, pty[w].cur.x, pty[w].cur.y + 1); } static VOID NEAR outputnormal(w, buf, width) int w; char *buf; int width; { #ifdef DEP_KCONV char buf2[MAXKANJIBUF + 1]; int incode, outcode; #endif CONST char *cp; if (pty[w].cur.x + width > pty[w].max_x) { pty[w].cur.x = pty[w].min_x; evallf(w); } surelocate(w, 0); settermattr(w); settermcode(w); cp = buf; if (pty[w].cur.attr & A_INVISIBLE) { memset(buf, ' ', width); buf[width] = '\0'; } #ifdef DEP_KCONV else if (!(pty[w].termflags & T_MULTIBYTE)) { getiocode(w, &incode, &outcode); if (incode != outcode) cp = ptykconv(buf, buf2, incode, outcode); } #endif Xcputs(cp); tflush(); pty[w].cur.x += width; last_x += width; if (n_lastcolumn < n_column && pty[w].cur.x >= pty[w].max_x) { pty[w].cur.x = pty[w].min_x; evallf(w); } } static VOID NEAR evalnormal(w, c) int w, c; { #ifdef DEP_KCONV u_int u; int incode; #endif char buf[MAXKANJIBUF + 1]; int i, width; #ifdef DEP_KCONV getiocode(w, &incode, NULL); #endif if ((pty[w].termflags & T_NOAUTOMARGIN) && pty[w].cur.x >= pty[w].max_x - 1) return; i = 0; width = 1; if (pty[w].last1 >= (short)0) { buf[i++] = pty[w].last1; if (pty[w].termflags & T_MULTIBYTE) width++; #ifdef DEP_KCONV else if (incode == EUC) { if (pty[w].last1 != C_EKANA) width++; } else if (incode >= UTF8) { if (!ismsb(c)) i = 0; else if (pty[w].last2 >= (short)0) buf[i++] = pty[w].last2; else if (!isutf2(pty[w].last1, c)) { pty[w].last2 = c; return; } } #else /* !DEP_KCONV */ # ifdef CODEEUC else if (pty[w].last1 == C_EKANA) /*EMPTY*/; # endif #endif /* !DEP_KCONV */ else width++; } #ifdef DEP_KCONV else if ((pty[w].termflags & T_MULTIBYTE) || (incode == EUC && (c == C_EKANA || iseuc(c))) || (incode == SJIS && issjis1(c)) || (incode >= UTF8 && ismsb(c))) #else /* !DEP_KCONV */ # ifdef CODEEUC else if (c == C_EKANA || iseuc(c)) # else else if (issjis1(c)) # endif #endif /* !DEP_KCONV */ { pty[w].last1 = c; pty[w].last2 = (short)-1; return; } buf[i++] = c; buf[i] = '\0'; #ifdef DEP_KCONV if (incode >= UTF8) { if (!(u = evalnf(w, buf))) return; if (iswucs2(u)) width++; } #endif outputnormal(w, buf, width); pty[w].last1 = pty[w].last2 = (short)-1; #ifdef DEP_KCONV for (i = 0; i < MAXLASTUCS2; i++) pty[w].last_ucs2[i] = (u_short)0; #endif } static VOID NEAR evalcontrol(w, c) int w, c; { int i; switch (c) { case '\b': reallocate(w, pty[w].cur.x - 1, pty[w].cur.y); break; case '\t': for (i = 0; i < pty[w].ntabstop; i++) if (pty[w].cur.x < pty[w].tabstop[i]) break; i = (i < pty[w].ntabstop) ? pty[w].tabstop[i] : pty[w].max_x - 1; reallocate(w, i, pty[w].cur.y); break; case '\r': reallocate(w, pty[w].min_x, pty[w].cur.y); break; case '\n': case '\v': case '\f': evallf(w); break; case '\007': putterm(T_BELL); tflush(); break; case '\033': pty[w].escmode = c; break; case '\016': pty[w].termflags |= T_CODEALT; break; case '\017': pty[w].termflags &= ~T_CODEALT; break; default: break; } } static VOID NEAR evalescape(w, c) int w, c; { int i; pty[w].escmode = '\0'; switch (c) { case '7': memcpy((char *)&(pty[w].save), (char *)&(pty[w].cur), sizeof(pty[w].save)); break; case '8': memcpy((char *)&(pty[w].cur), (char *)&(pty[w].save), sizeof(pty[w].cur)); biasxy(w, &(pty[w].cur.x), &(pty[w].cur.y)); surelocate(w, 1); tflush(); break; case '=': pty[w].termflags &= ~T_NOAPPLIKEY; break; case '>': pty[w].termflags |= T_NOAPPLIKEY; break; case 'D': evallf(w); break; case 'E': pty[w].cur.x = pty[w].min_x; evallf(w); break; case 'H': if (pty[w].ntabstop >= (u_char)MAXTABSTOP) break; for (i = 0; i < pty[w].ntabstop; i++) if (pty[w].cur.x <= pty[w].tabstop[i]) break; if (i >= pty[w].ntabstop) pty[w].tabstop[(pty[w].ntabstop)++] = pty[w].cur.x; else if (pty[w].cur.x == pty[w].tabstop[i]) break; else { memmove((char *)&(pty[w].tabstop[i + 1]), (char *)&(pty[w].tabstop[i]), ((pty[w].ntabstop)++ - i) * sizeof(u_short)); pty[w].tabstop[i] = pty[w].cur.x; } break; case 'M': if (pty[w].cur.y >= pty[w].min_y && pty[w].cur.y == pty[w].min_scroll) evalscroll(w, L_INSERT, 1); else reallocate(w, pty[w].cur.x, pty[w].cur.y - 1); break; case 'c': pty[w].termflags = (u_short)0; resettermattr(w); resettermcode(w); resettabstop(w); memcpy((char *)&(pty[w].save), (char *)&(pty[w].cur), sizeof(pty[w].save)); surelocate(w, 1); tflush(); pty[w].min_scroll = pty[w].min_y; pty[w].max_scroll = pty[w].max_y - 1; break; case '[': case '$': case '(': case ')': case '*': case '+': case '&': pty[w].escmode = c; pty[w].nparam = pty[w].nchar = (u_char)0; pty[w].escparam[0] = (short)-1; break; default: break; } } static VOID NEAR evalcsi(w, c, fd) int w, c, fd; { char buf[sizeof(SIZEFMT) + (MAXLONGWIDTH - 2) * 2]; short min, max; int i, n, x, y; if (pty[w].escmode == '[') pty[w].escmode = ']'; if (c >= '0' && c <= '9') { if (pty[w].nparam >= MAXESCPARAM) return; if (pty[w].escparam[pty[w].nparam] < (short)0) pty[w].escparam[pty[w].nparam] = (short)0; if (pty[w].escparam[pty[w].nparam] < (short)1000) { pty[w].escparam[pty[w].nparam] *= 10; pty[w].escparam[pty[w].nparam] += c - '0'; } return; } else if (c == ';') { if (++(pty[w].nparam) >= MAXESCPARAM) pty[w].nparam = MAXESCPARAM; else pty[w].escparam[pty[w].nparam] = (short)-1; return; } else if (c >= ' ' && c <= '/') { if (pty[w].nchar < MAXESCCHAR) pty[w].escchar[(pty[w].nchar)++] = c; return; } switch (c) { case 'A': if (pty[w].escmode != ']') break; n = pty[w].escparam[0]; if (n <= 0) n = 1; reallocate(w, pty[w].cur.x, pty[w].cur.y - n); break; case 'B': if (pty[w].escmode != ']') break; n = pty[w].escparam[0]; if (n <= 0) n = 1; reallocate(w, pty[w].cur.x, pty[w].cur.y + n); break; case 'C': if (pty[w].escmode != ']') break; n = pty[w].escparam[0]; if (n <= 0) n = 1; reallocate(w, pty[w].cur.x + n, pty[w].cur.y); break; case 'D': if (pty[w].escmode != ']') break; n = pty[w].escparam[0]; if (n <= 0) n = 1; reallocate(w, pty[w].cur.x - n, pty[w].cur.y); break; case 'H': case 'f': if (pty[w].escmode != ']') break; x = pty[w].min_x + ((pty[w].nparam <= (u_char)0) ? 0 : pty[w].escparam[1] - 1); y = pty[w].min_y + (pty[w].escparam[0] - 1); reallocate(w, x, y); break; case 'm': if (pty[w].escmode != ']') break; for (i = 0; i <= pty[w].nparam; i++) switch (pty[w].escparam[i]) { case -1: case 0: pty[w].cur.attr = (u_short)0; pty[w].cur.fg = pty[w].cur.bg = (short)-1; break; case 1: pty[w].cur.attr |= A_BOLD; break; case 2: pty[w].cur.attr |= A_DIM; break; case 4: pty[w].cur.attr |= A_UNDERLINE; break; case 5: pty[w].cur.attr |= A_BLINK; break; case 7: pty[w].cur.attr |= A_REVERSE; break; case 8: pty[w].cur.attr |= A_INVISIBLE; break; case 22: pty[w].cur.attr &= ~A_BOLD; break; case 24: pty[w].cur.attr &= ~A_UNDERLINE; break; case 25: pty[w].cur.attr &= ~A_BLINK; break; case 27: pty[w].cur.attr &= ~A_REVERSE; break; case 28: pty[w].cur.attr &= ~A_INVISIBLE; break; case 100: pty[w].cur.fg = pty[w].cur.bg = (short)-1; break; default: n = pty[w].escparam[i]; if (n >= 30 && n <= 37) pty[w].cur.fg = n % 10; else if (n >= 40 && n <= 47) pty[w].cur.bg = n % 10; break; } tflush(); break; case 's': if (pty[w].escmode != ']') break; memcpy((char *)&(pty[w].save), (char *)&(pty[w].cur), sizeof(pty[w].save)); break; case 'u': if (pty[w].escmode != ']') break; memcpy((char *)&(pty[w].cur), (char *)&(pty[w].save), sizeof(pty[w].cur)); biasxy(w, &(pty[w].cur.x), &(pty[w].cur.y)); surelocate(w, 1); tflush(); break; case 'L': if (pty[w].escmode != ']') break; n = pty[w].escparam[0]; if (n <= 0) n = 1; else if (n > pty[w].max_y - pty[w].min_y) n = pty[w].max_y - pty[w].min_y; evalscroll(w, L_INSERT, n); break; case 'M': if (pty[w].escmode != ']') break; n = pty[w].escparam[0]; if (n <= 0) n = 1; else if (n > pty[w].max_y - pty[w].min_y) n = pty[w].max_y - pty[w].min_y; evalscroll(w, L_DELETE, n); break; case 'J': if (pty[w].escmode != ']') break; switch (pty[w].escparam[0]) { case -1: case 0: min = pty[w].cur.y; max = pty[w].max_y; break; case 1: min = pty[w].min_y; max = pty[w].cur.y + 1; break; case 2: min = pty[w].min_y; max = pty[w].max_y; break; default: min = max = (short)-1; break; } if (min < (short)0 || max < (short)0) break; for (i = min; i < max; i++) { locate(pty[w].min_x, i); putterm(L_CLEAR); } surelocate(w, 1); tflush(); break; case 'K': if (pty[w].escmode != ']' && pty[w].escmode != '?') break; switch (pty[w].escparam[0]) { case -1: case 0: surelocate(w, 1); putterm(L_CLEAR); break; case 1: surelocate(w, 1); putterm(L_CLEARBOL); break; case 2: locate(pty[w].min_x, pty[w].cur.y); putterm(L_CLEAR); surelocate(w, 1); break; default: break; } tflush(); break; case '@': if (pty[w].escmode != ']') break; n = pty[w].escparam[0]; if (n <= 0) n = 1; surelocate(w, 1); if (*termstr[C_INSERT]) while (n--) putterm(C_INSERT); else while (n--) tputs2("\033[@", 1); tflush(); break; case 'P': if (pty[w].escmode != ']') break; n = pty[w].escparam[0]; if (n <= 0) n = 1; surelocate(w, 1); if (*termstr[C_DELETE]) while (n--) putterm(C_DELETE); else while (n--) tputs2("\033[P", 1); tflush(); break; case 'h': if (pty[w].escmode != '?') break; for (i = 0; i <= pty[w].nparam; i++) switch (pty[w].escparam[i]) { case 1: pty[w].termflags &= ~T_NOAPPLICURSOR; break; case 3: resettabstop(w); pty[w].min_scroll = pty[w].min_y; pty[w].max_scroll = pty[w].max_y - 1; break; case 7: pty[w].termflags &= ~T_NOAUTOMARGIN; break; case 25: putterm(T_NORMALCURSOR); tflush(); break; default: break; } break; case 'l': if (pty[w].escmode != '?') break; for (i = 0; i <= pty[w].nparam; i++) switch (pty[w].escparam[i]) { case 1: pty[w].termflags |= T_NOAPPLICURSOR; break; case 3: resettabstop(w); pty[w].min_scroll = pty[w].min_y; pty[w].max_scroll = pty[w].max_y - 1; break; case 7: pty[w].termflags |= T_NOAUTOMARGIN; break; case 25: putterm(T_NOCURSOR); tflush(); break; default: break; } break; case 'g': if (pty[w].escmode != ']') break; switch (pty[w].escparam[0]) { case 0: if (pty[w].ntabstop <= (u_char)0) break; for (i = 0; i < pty[w].ntabstop; i++) if (pty[w].cur.x <= pty[w].tabstop[i]) break; if (pty[w].cur.x != pty[w].tabstop[i]) break; memmove((char *)&(pty[w].tabstop[i]), (char *) &(pty[w].tabstop[i + 1]), (--(pty[w].ntabstop) - i) * sizeof(u_short)); break; case 3: pty[w].ntabstop = (u_char)0; break; default: break; } break; case 'n': if (pty[w].escmode != ']') break; i = 0; switch (pty[w].escparam[0]) { case 5: i = Xsnprintf(buf, sizeof(buf), "\033[0n"); break; case 6: i = Xsnprintf(buf, sizeof(buf), SIZEFMT, pty[w].cur.y - pty[w].min_y + 1, pty[w].cur.x - pty[w].min_x + 1); break; case 99: buf[i++] = '\n'; break; default: break; } if (i > 0) sendbuf(fd, buf, i); break; case 'r': if (pty[w].escmode != ']') break; min = pty[w].min_y + (pty[w].escparam[0] - 1); if (pty[w].nparam <= (u_char)0 || pty[w].escparam[1] <= (short)0) max = pty[w].max_y - 1; else max = pty[w].min_y + (pty[w].escparam[1] - 1); biasxy(w, NULL, &min); biasxy(w, NULL, &max); if (min < max) { pty[w].min_scroll = min; pty[w].max_scroll = max; } break; default: break; } pty[w].escmode = '\0'; } static VOID NEAR evalcodeselect(w, c) int w, c; { if (c >= ' ' && c <= '/') { if (pty[w].nchar < MAXESCCHAR) pty[w].escchar[(pty[w].nchar)++] = c; return; } if (c < 0x30 || c > 0x7e) return; switch (pty[w].escmode) { case '$': if (pty[w].nchar > (u_char)1 || (pty[w].nchar && (pty[w].escchar[0] < '(' || pty[w].escchar[0] > '+'))) { pty[w].escmode = '\0'; return; } pty[w].termflags |= T_MULTIBYTE; break; default: if (pty[w].nchar) { pty[w].escmode = '\0'; return; } pty[w].termflags &= ~T_MULTIBYTE; break; } pty[w].codeselect[0] = pty[w].escmode; memcpy(&(pty[w].codeselect[1]), (char *)(pty[w].escchar), pty[w].nchar); pty[w].codeselect[++(pty[w].nchar)] = c; pty[w].codeselect[++(pty[w].nchar)] = '\0'; pty[w].escmode = '\0'; } static VOID NEAR evaloutput(w) int w; { u_char uc; if (pty[w].termflags & T_LOCKED) return; if (recvbuf(ptylist[w].fd, &uc, sizeof(uc)) < 0) return; switch (pty[w].escmode) { case '\033': #ifdef DEP_KCONV VOID_C evalnf(w, NULL); #endif evalescape(w, uc); break; case '[': if (uc == '<' || uc == '?') { pty[w].escmode = uc; break; } /*FALLTHRU*/ case ']': case '>': case '?': evalcsi(w, uc, ptylist[w].fd); break; case '$': case '(': case ')': case '*': case '+': case '&': evalcodeselect(w, uc); break; default: if (uc >= ' ' && uc != '\177') evalnormal(w, uc); else { #ifdef DEP_KCONV VOID_C evalnf(w, NULL); #endif evalcontrol(w, uc); } break; } } static int NEAR chgattr(n, c) int n, c; { switch (n) { case L_CLEAR: surelocate(MAXWINDOWS, 1); putterm(L_CLEAR); break; case T_NORMAL: pty[MAXWINDOWS].cur.attr = (u_short)0; pty[MAXWINDOWS].cur.fg = pty[MAXWINDOWS].cur.bg = (short)-1; break; case T_BOLD: pty[MAXWINDOWS].cur.attr |= A_BOLD; break; case T_REVERSE: pty[MAXWINDOWS].cur.attr |= A_REVERSE; break; case T_DIM: pty[MAXWINDOWS].cur.attr |= A_DIM; break; case T_BLINK: pty[MAXWINDOWS].cur.attr |= A_BLINK; break; case T_STANDOUT: pty[MAXWINDOWS].cur.attr |= A_STANDOUT; break; case T_UNDERLINE: pty[MAXWINDOWS].cur.attr |= A_UNDERLINE; break; case END_STANDOUT: pty[MAXWINDOWS].cur.attr &= ~A_STANDOUT; break; case END_UNDERLINE: pty[MAXWINDOWS].cur.attr &= ~A_UNDERLINE; break; case L_INSERT: case L_DELETE: case C_SCROLLFORW: case C_SCROLLREV: evalscroll(MAXWINDOWS, n, c); break; case C_INSERT: case C_DELETE: surelocate(MAXWINDOWS, 1); while (c--) putterm(n); tflush(); break; case C_HOME: pty[MAXWINDOWS].cur.x = pty[MAXWINDOWS].cur.y = (short)0; reallocate(MAXWINDOWS, 0, 0); break; case C_RETURN: reallocate(MAXWINDOWS, pty[MAXWINDOWS].min_x, pty[MAXWINDOWS].cur.y); break; case C_NEWLINE: while (c--) evallf(MAXWINDOWS); break; case C_UP: case C_NUP: reallocate(MAXWINDOWS, pty[MAXWINDOWS].cur.x, pty[MAXWINDOWS].cur.y - c); break; case C_DOWN: case C_NDOWN: reallocate(MAXWINDOWS, pty[MAXWINDOWS].cur.x, pty[MAXWINDOWS].cur.y + c); break; case C_RIGHT: case C_NRIGHT: reallocate(MAXWINDOWS, pty[MAXWINDOWS].cur.x + c, pty[MAXWINDOWS].cur.y); break; case C_LEFT: case C_NLEFT: reallocate(MAXWINDOWS, pty[MAXWINDOWS].cur.x - c, pty[MAXWINDOWS].cur.y); break; default: return(n); /*NOTREACHED*/ break; } return(-1); } static int NEAR directoutput(n) int n; { ptyinfo_t tmp; char *s, *arg, *cwd; p_id_t pid; short w1, w2, row[MAXWINDOWS]; int i; if (ptyrecvbuf(&w1, sizeof(w1)) < 0) return(0); switch (n) { case TE_XPUTCH: surelocate(MAXWINDOWS, 0); settermattr(MAXWINDOWS); settermcode(MAXWINDOWS); i = Xcprintf("%c", w1); pty[MAXWINDOWS].cur.x += i; last_x += i; tflush(); break; case TE_XCPUTS: if (ptyrecvbuf(&w2, sizeof(w2)) < 0) break; s = Xmalloc(w1 + 1); if (ptyrecvbuf(s, w1) >= 0) { surelocate(MAXWINDOWS, 0); settermattr(MAXWINDOWS); settermcode(MAXWINDOWS); s[w1] = '\0'; i = Xcprintf("%s", s); if (w2 >= 0) i = w2; pty[MAXWINDOWS].cur.x += i; last_x += i; tflush(); } Xfree(s); break; case TE_PUTTERM: if ((n = chgattr(w1, 1)) < 0) break; surelocate(MAXWINDOWS, 0); putterm(n); tflush(); break; case TE_PUTTERMS: if ((n = chgattr(w1, 1)) < 0) break; surelocate(MAXWINDOWS, 0); putterms(n); tflush(); break; case TE_SETSCROLL: if (ptyrecvbuf(&w2, sizeof(w2)) < 0) break; if (w2 <= (short)0) w2 = pty[MAXWINDOWS].max_y - 1; biasxy(MAXWINDOWS, NULL, &w1); biasxy(MAXWINDOWS, NULL, &w2); if (w1 < w2) { pty[MAXWINDOWS].min_scroll = w1; pty[MAXWINDOWS].max_scroll = w2; } break; case TE_LOCATE: if (ptyrecvbuf(&w2, sizeof(w2)) < 0) break; reallocate(MAXWINDOWS, w1, w2); for (i = 0; i < MAXWINDOWS; i++) { if (ptylist[i].pid) continue; pty[i].cur.x = w1; pty[i].cur.y = w2; biasxy(i, &(pty[i].cur.x), &(pty[i].cur.y)); } break; case TE_CPUTNL: pty[MAXWINDOWS].cur.x = (short)0; evallf(MAXWINDOWS); break; case TE_CHGCOLOR: if (ptyrecvword(&n) < 0) break; if (n) { pty[MAXWINDOWS].cur.fg = (w1 == ANSI_BLACK) ? ANSI_WHITE : ANSI_BLACK; pty[MAXWINDOWS].cur.bg = w1; } else { pty[MAXWINDOWS].cur.fg = w1; } break; case TE_MOVECURSOR: if (ptyrecvbuf(&w2, sizeof(w2)) < 0 || ptyrecvword(&n) < 0) break; if (w1 < (short)0) w1 = w2; if ((n = chgattr(w1, n)) < 0) break; surelocate(MAXWINDOWS, 0); putterms(n); tflush(); break; case TE_CHANGEWIN: if (ptyrecvbuf(&pid, sizeof(pid)) < 0) break; win = w1; if (pid < (p_id_t)0) break; resetptyterm(win, (ptylist[win].pid) ? 0 : 1); biasxy(win, &(pty[win].cur.x), &(pty[win].cur.y)); ptylist[win].pid = pid; surelocate(win, 1); tflush(); if (pid) { setwsize(ptylist[win].fd, pty[win].max_x - pty[win].min_x, pty[win].max_y - pty[win].min_y); break; } for (i = 0; i < MAXWINDOWS; i++) if (ptylist[i].pid) break; if (i >= MAXWINDOWS) return(-1); break; case TE_CHANGEWSIZE: if (ptyrecvword(&n) < 0) break; if (n > MAXWINDOWS) n = MAXWINDOWS; for (i = 0; i < n; i++) if (ptyrecvbuf(&(row[i]), sizeof(row[i])) < 0) break; wheader = w1; #ifndef _NOSPLITWIN windows = n; #endif for (i = 0; i < n; i++) { winvar[i].v_fileperrow = row[i]; resetptyterm(i, 0); setwsize(ptylist[i].fd, pty[i].max_x - pty[i].min_x, pty[i].max_y - pty[i].min_y); } break; case TE_INSERTWIN: if (ptyrecvword(&n) < 0) break; memcpy((char *)&tmp, (char *)&(ptylist[n - 1]), sizeof(ptyinfo_t)); memmove((char *)&(ptylist[w1 + 1]), (char *)&(ptylist[w1]), (n - 1 - w1) * sizeof(ptyinfo_t)); memcpy((char *)&(ptylist[w1]), (char *)&tmp, sizeof(ptyinfo_t)); memmove((char *)&(pty[w1 + 1]), (char *)&(pty[w1]), (n - 1 - w1) * sizeof(ptyterm_t)); resetptyterm(w1, 1); return(1); /*NOTREACHED*/ break; case TE_DELETEWIN: if (ptyrecvword(&n) < 0) break; memcpy((char *)&tmp, (char *)&(ptylist[w1]), sizeof(ptyinfo_t)); memmove((char *)&(ptylist[w1]), (char *)&(ptylist[w1 + 1]), (n - w1) * sizeof(ptyinfo_t)); memcpy((char *)&(ptylist[n]), (char *)&tmp, sizeof(ptyinfo_t)); memmove((char *)&(pty[w1]), (char *)&(pty[w1 + 1]), (n - w1) * sizeof(ptyterm_t)); return(1); /*NOTREACHED*/ break; case TE_LOCKBACK: pty[w1].termflags |= T_LOCKED; sendbuf(ptylist[w1].fd, "\n", 1); break; case TE_UNLOCKBACK: pty[w1].termflags &= ~T_LOCKED; sendbuf(ptylist[w1].fd, "\n", 1); break; #ifdef DEP_KCONV case TE_CHANGEKCODE: if (ptyrecvbuf(&w2, sizeof(w2)) < 0) break; inputkcode = w1; outputkcode = w2; break; case TE_CHANGEINKCODE: if (ptyrecvbuf(&w2, sizeof(w2)) < 0) break; ptylist[w1].incode = (u_char)w2; break; case TE_CHANGEOUTKCODE: if (ptyrecvbuf(&w2, sizeof(w2)) < 0) break; ptylist[w1].outcode = (u_char)w2; break; #endif /* DEP_KCONV */ case TE_AWAKECHILD: if (ptyrecvbuf(&n, sizeof(n)) < 0 || ptyrecvstring(&s) < 0) break; if (ptyrecvstring(&arg) < 0) { Xfree(s); break; } if (ptyrecvstring(&cwd) < 0) cwd = NULL; resetptyterm(w1, 1); sendbuf(ptylist[w1].fd, &n, sizeof(n)); sendstring(ptylist[w1].fd, s); sendstring(ptylist[w1].fd, arg); sendstring(ptylist[w1].fd, cwd); Xfree(s); Xfree(arg); Xfree(cwd); break; default: break; } return(0); } static int NEAR evalinput(VOID_A) { #ifdef DEP_KCONV u_short ubuf[MAXNFLEN]; char buf[MAXKANJIBUF + 1], buf2[MAXKANJIBUF + 1]; u_int u; int i, ch, len, cnv, incode, outcode; #else char buf[MAXKLEN]; #endif keyseq_t key; int n; if (ptyrecvbuf(&(key.code), sizeof((key.code))) < 0) return(0); #ifdef DEP_KCONV cnv = 0; incode = (inputkcode != NOCNV) ? inputkcode : DEFCODE; outcode = (win < MAXWINDOWS && ptylist[win].incode != NOCNV) ? ptylist[win].incode : incode; #endif if (ismetakey(key.code)) { key.len = (u_char)2; key.str = buf; buf[0] = K_ESC; buf[1] = (key.code & 0xff); } #ifdef DEP_KCONV else if (incode == EUC && isekana2(key.code)) { if (incode != outcode) cnv++; key.len = (u_char)2; key.str = buf; buf[0] = (char)C_EKANA; buf[1] = (key.code & 0xff); } #else /* !DEP_KCONV */ # ifdef CODEEUC else if (isekana2(key.code)) { key.len = (u_char)2; key.str = buf; buf[0] = (char)C_EKANA; buf[1] = (key.code & 0xff); } # endif #endif /* !DEP_KCONV */ else if (!(key.code & K_ALTERNATE) && key.code > K_MAX) { n = directoutput(key.code); if (win < MAXWINDOWS) { surelocate(win, 1); last_x = last_y = (short)-1; tflush(); } return(n); } else if (convkey(win, &key) < 0 || !(key.len)) { key.len = (u_char)1; key.str = buf; buf[0] = key.code; #ifdef DEP_KCONV if (incode == outcode) /*EMPTY*/; else if (incode == SJIS && Xiskana(key.code)) cnv++; else if (incode == EUC && key.code == C_EKANA && (n = ptygetch()) >= 0) { if (!Xiskana(n)) ptyungetch((u_char)n); else { cnv++; buf[1] = n; (key.len)++; } } else if (incode >= UTF8) { cnv++; i = 0; ch = key.code; for (;;) { if ((u = ptygetucs2(ch)) == (u_int)-1) { if (i) ptyungetch((u_char)ch); break; } ubuf[i++] = u; if (i >= MAXNFLEN) break; if (incode != M_UTF8 || (ch = ptygetch()) < 0) break; } len = i; i = 0; if (!len) { u = key.code; cnv = 0; } else if (incode != M_UTF8) u = ubuf[i++]; else u = ucs2denormalization(ubuf, &i, incode - UTF8, L_TERMINAL); while (len-- > i) { n = ucs2toutf8(buf, 0, ubuf[len]); while (n-- > 0) ptyungetch((u_char)(buf[n])); } key.len = ucs2toutf8(buf, 0, u); if (key.len <= 1) cnv = 0; } else if (isinkanji1(key.code, incode) && (n = ptygetch()) >= 0) { cnv++; buf[1] = n; (key.len)++; } #endif /* DEP_KCONV */ } #ifdef DEP_KCONV if (cnv) { buf[key.len] = '\0'; key.str = (char *)ptykconv(buf, buf2, incode, outcode); key.len = (u_char)strlen(key.str); } #endif if (win < MAXWINDOWS) sendbuf(ptylist[win].fd, key.str, key.len); return(0); } int backend(VOID_A) { char result[MAXWINDOWS + 1]; int i, n, x, y, fds[MAXWINDOWS + 1]; hideclock = -1; dumbterm = 1; sigvecset(0); #ifdef SIGWINCH ptywinched = 0; pollscreen(-1); VOID_C signal2(SIGWINCH, (sigcst_t)wintr); #endif ttyiomode(0); n = 0; while (n >= 0) { #ifdef SIGWINCH evalsignal(); #endif for (i = 0; i < MAXWINDOWS; i++) fds[i] = (ptylist[i].pid) ? ptylist[i].fd : -1; fds[i] = emufd; if (selectpty(MAXWINDOWS + 1, fds, result, -1L) <= 0) continue; if (result[MAXWINDOWS] && (n = evalinput()) > 0) continue; x = last_x; y = last_y; for (i = 0; i < MAXWINDOWS; i++) if (result[i] && ptylist[i].pid) evaloutput(i); if (win < MAXWINDOWS) /* EMPTY*/; else if (x != last_x || y != last_y) { surelocate(MAXWINDOWS, 0); tflush(); } } surelocate(MAXWINDOWS, 0); settermattr(MAXWINDOWS); settermcode(MAXWINDOWS); tflush(); return(0); } #endif /* DEP_PTY */ FD-3.01j/parse.c100644 2105 1751 50262 13516612560 12164 0ustar shiraiuser/* * parse.c * * command line parser */ #ifdef FD #include "fd.h" #include "pathname.h" #include "term.h" #include "types.h" #include "kconv.h" #else #include "headers.h" #include "depend.h" #include "printf.h" #include "kctype.h" #include "string.h" #include "malloc.h" #endif #include "sysemu.h" #include "unixemu.h" #include "realpath.h" #include "parse.h" #include "system.h" #ifdef USEUNAME #include #endif #ifdef FD # ifndef DEP_ORIGSHELL extern int setenv2 __P_((CONST char *, CONST char *, int)); # endif extern int underhome __P_((char *)); #endif /* !FD */ #ifdef FD extern char fullpath[]; extern short histno[]; extern int physical_path; #endif static int NEAR asc2int __P_((int)); #if defined (FD) && !defined (DEP_ORIGSHELL) static char *NEAR strtkbrk __P_((CONST char *, CONST char *, int)); static char *NEAR geteostr __P_((CONST char **)); #endif #ifdef FD CONST strtable keyidentlist[] = { {K_DOWN, "DOWN"}, {K_UP, "UP"}, {K_LEFT, "LEFT"}, {K_RIGHT, "RIGHT"}, {K_HOME, "HOME"}, {K_BS, "BS"}, {'*', "ASTER"}, {'+', "PLUS"}, {',', "COMMA"}, {'-', "MINUS"}, {'.', "DOT"}, {'/', "SLASH"}, {'0', "TK0"}, {'1', "TK1"}, {'2', "TK2"}, {'3', "TK3"}, {'4', "TK4"}, {'5', "TK5"}, {'6', "TK6"}, {'7', "TK7"}, {'8', "TK8"}, {'9', "TK9"}, {'=', "EQUAL"}, {K_CR, "RET"}, {K_ESC, "ESC"}, {'\t', "TAB"}, {' ', "SPACE"}, {K_DL, "DELLIN"}, {K_IL, "INSLIN"}, {K_DC, "DEL"}, {K_IC, "INS"}, {K_EIC, "EIC"}, {K_CLR, "CLR"}, {K_EOS, "EOS"}, {K_EOL, "EOL"}, {K_ESF, "ESF"}, {K_ESR, "ESR"}, {K_NPAGE, "NPAGE"}, {K_PPAGE, "PPAGE"}, {K_STAB, "STAB"}, {K_CTAB, "CTAB"}, {K_CATAB, "CATAB"}, {K_ENTER, "ENTER"}, {K_SRST, "SRST"}, {K_RST, "RST"}, {K_PRINT, "PRINT"}, {K_LL, "LL"}, {K_A1, "A1"}, {K_A3, "A3"}, {K_B2, "B2"}, {K_C1, "C1"}, {K_C3, "C3"}, {K_BTAB, "BTAB"}, {K_BEG, "BEG"}, {K_CANC, "CANC"}, {K_CLOSE, "CLOSE"}, {K_COMM, "COMM"}, {K_COPY, "COPY"}, {K_CREAT, "CREAT"}, {K_END, "END"}, {K_EXIT, "EXIT"}, {K_FIND, "FIND"}, {K_HELP, "HELP"}, {0, NULL} }; #define KEYIDENTSIZ (arraysize(keyidentlist) - 1) #endif /* FD */ static CONST char escapechar[] = "abefnrtv"; static CONST char escapevalue[] = { 0x07, 0x08, 0x1b, 0x0c, 0x0a, 0x0d, 0x09, 0x0b, }; char *skipspace(cp) CONST char *cp; { while (Xisblank(*cp)) cp++; return((char *)cp); } static int NEAR asc2int(c) int c; { if (c < 0) return(-1); else if (Xisdigit(c)) return(c - '0'); else if (Xislower(c)) return(c - 'a' + 10); else if (Xisupper(c)) return(c - 'A' + 10); return(-1); } #ifdef USESTDARGH /*VARARGS2*/ char *Xsscanf(CONST char *s, CONST char *fmt, ...) #else /*VARARGS2*/ char *Xsscanf(s, fmt, va_alist) CONST char *s, *fmt; va_dcl #endif { #ifndef HAVELONGLONG char *buf; u_long_t tmp; int hi; #endif va_list args; CONST char *cp; long_t n; u_long_t u, mask; int i, c, len, base, width, flags; if (!s || !fmt) return(NULL); VA_START(args, fmt); for (i = 0; fmt[i]; i++) { if (fmt[i] != '%') { if (*(s++) != fmt[i]) { s = NULL; break; } continue; } i++; flags = 0; for (; fmt[i]; i++) { if (!(cp = Xstrchr(printfflagchar, fmt[i]))) break; flags |= printfflag[cp - printfflagchar]; } width = getnum(fmt, &i); len = sizeof(int); for (; fmt[i]; i++) { if (!(cp = Xstrchr(printfsizechar, fmt[i]))) break; len = printfsize[cp - printfsizechar]; } if (fmt[i] == '*') { i++; len = va_arg(args, int); } base = 0; switch (fmt[i]) { case 'd': base = 10; break; case 'u': flags |= VF_UNSIGNED; base = 10; break; case 'o': flags |= VF_UNSIGNED; base = 8; break; case 'x': case 'X': flags |= VF_UNSIGNED; base = 16; break; case 'c': if (*(s++) != va_arg(args, int)) s = NULL; break; case '$': if (*s) s = NULL; break; default: if (*(s++) != fmt[i]) s = NULL; break; } if (!s) break; if (!base) continue; cp = s; n = (long_t)0; u = (u_long_t)0; if (*s == '-') { if (!(flags & VF_MINUS)) { s = NULL; break; } for (s++; *s; s++) { #ifdef LSI_C /* for buggy LSI-C */ long_t minlong; minlong = MINTYPE(long_t); #else #define minlong MINTYPE(long_t) #endif if (width >= 0 && --width < 0) break; if ((c = asc2int(*s)) < 0 || c >= base) break; if (n == MINTYPE(long_t)) /*EMPTY*/; else if (n < minlong / base || (n == minlong / base && -c < MINTYPE(long_t) % base)) n = MINTYPE(long_t); else n = n * base - c; } if ((flags & VF_UNSIGNED) && n) s = NULL; } else if (flags & VF_UNSIGNED) { for (; *s; s++) { if (width >= 0 && --width < 0) break; if ((c = asc2int(*s)) < 0 || c >= base) break; if (u == MAXUTYPE(u_long_t)) /*EMPTY*/; else if (u > MAXUTYPE(u_long_t) / base || (u == MAXUTYPE(u_long_t) / base && c > MAXUTYPE(u_long_t) % base)) u = MAXTYPE(u_long_t); else u = u * base + c; } if ((flags & VF_PLUS) && !u) s = NULL; } else { for (; *s; s++) { if (width >= 0 && --width < 0) break; if ((c = asc2int(*s)) < 0 || c >= base) break; if (n == MAXTYPE(long_t)) /*EMPTY*/; else if (n > MAXTYPE(long_t) / base || (n == MAXTYPE(long_t) / base && c > MAXTYPE(long_t) % base)) n = MAXTYPE(long_t); else n = n * base + c; } if ((flags & VF_PLUS) && !n) s = NULL; } if (!s || s <= cp || ((flags & VF_ZERO) && width > 0)) { s = NULL; break; } mask = MAXUTYPE(u_long_t); if (len < (int)sizeof(u_long_t)) mask >>= ((int)sizeof(u_long_t) - len) * BITSPERBYTE; if (flags & VF_UNSIGNED) { if (u & ~mask) { u = mask; if (flags & VF_STRICTWIDTH) { s = NULL; break; } } } else { mask >>= 1; if (n >= 0) { if ((u_long_t)n & ~mask) { n = mask; if (flags & VF_STRICTWIDTH) s = NULL; } } else if (((u_long_t)n & ~mask) != ~mask) { n = ~mask; if (flags & VF_STRICTWIDTH) s = NULL; } if (!s) break; memcpy(&u, &n, sizeof(u)); } #ifndef HAVELONGLONG if (len > (int)sizeof(u_long_t)) { hi = 0; if (!(flags & VF_UNSIGNED)) { mask = (MAXUTYPE(u_long_t) >> 1); if (u & ~mask) hi = MAXUTYPE(char); } buf = va_arg(args, char *); memset(buf, hi, len); tmp = 0x5a; cp = (char *)(&tmp); if (*cp != 0x5a) buf += len - sizeof(u_long_t); memcpy(buf, (char *)(&u), sizeof(u)); } else #endif /* !HAVELONGLONG */ if (len == (int)sizeof(u_long_t)) *(va_arg(args, u_long_t *)) = u; #ifdef HAVELONGLONG else if (len == (int)sizeof(u_long)) *(va_arg(args, u_long *)) = u; #endif else if (len == (int)sizeof(u_short)) *(va_arg(args, u_short *)) = u; else if (len == (int)sizeof(u_char)) *(va_arg(args, u_char *)) = u; else *(va_arg(args, u_int *)) = u; } va_end(args); return((char *)s); } int Xatoi(s) CONST char *s; { int n; if (!Xsscanf(s, "%= *argcp) return(vnullstr); cp = skipspace(argv[i]); } if (*cp != '=') return(vnullstr); *(cp++) = '\0'; if (!*cp) { if (++i >= *argcp) return(NULL); cp = argv[i]; } *argcp = i + 1; return(evalpath(Xstrdup(cp), EA_NOUNIQDELIM)); } char *evalcomstr(path, delim) CONST char *path, *delim; { CONST char *cp, *next; char *new, *epath; int i, len, size; next = epath = NULL; size = 0; for (cp = path; cp && *cp; cp = next) { if ((next = strtkbrk(cp, delim, 0))) { len = next - cp; for (i = 1; next[i]; i++) if (!Xstrchr(delim, next[i])) break; } else { len = strlen(cp); i = 0; } next = cp + len; if (len) { new = _evalpath(cp, next, EA_NOEVALQ | EA_NOUNIQDELIM); # ifdef DEP_FILECONV renewkanjiconv(&new, DEFCODE, getkcode(new), L_FNAME); # endif cp = new; len = strlen(cp); } # ifdef FAKEUNINIT else new = NULL; /* fake for -Wuninitialized */ # endif epath = Xrealloc(epath, size + len + i + 1); if (len) { Xstrcpy(&(epath[size]), cp); Xfree(new); size += len; } if (i) { Xstrncpy(&(epath[size]), next, i); size += i; next += i; } } if (!epath) return(Xstrdup(nullstr)); epath[size] = '\0'; return(epath); } #endif /* FD && !DEP_ORIGSHELL */ char *evalpaths(paths, delim) CONST char *paths; int delim; { CONST char *cp, *next; char *new, *epath, buf[MAXPATHLEN]; int len, size; next = epath = NULL; size = 0; for (cp = paths; cp; cp = next) { new = NULL; next = cp; #ifdef DEP_DOSPATH if (_dospath(next)) next += 2; #endif next = Xstrchr(next, delim); len = (next) ? (next++) - cp : strlen(cp); if (len) { new = _evalpath(cp, &(cp[len]), 0); cp = (isrootdir(new)) ? Xrealpath(new, buf, RLP_READLINK) : new; len = strlen(cp); } epath = Xrealloc(epath, size + len + 1 + 1); memcpy(&(epath[size]), cp, len); Xfree(new); size += len; if (next) epath[size++] = delim; } if (!epath) return(Xstrdup(nullstr)); epath[size] = '\0'; return(epath); } #if !MSDOS || !defined (FD) || defined (DEP_ORIGSHELL) char *killmeta(name) CONST char *name; { CONST char *cp; char *buf, *new; int i; buf = Xmalloc(strlen(name) * 2 + 2 + 1); *buf = (*name == '~') ? '"' : '\0'; for (cp = name, i = 1; *cp; cp++, i++) { if (iswchar(cp, 0)) buf[i++] = *(cp++); else if (*cp == PESCAPE) { *buf = '"'; if (Xstrchr(DQ_METACHAR, *(cp + 1))) buf[i++] = PESCAPE; } else if (Xstrchr(METACHAR, *cp)) { *buf = '"'; if (Xstrchr(DQ_METACHAR, *cp)) buf[i++] = PESCAPE; } buf[i] = *cp; } if (*(cp = buf)) buf[i++] = *cp; else cp++; buf[i] = '\0'; new = Xstrdup(cp); Xfree(buf); return(new); } #endif /* !MSDOS || !FD || DEP_ORIGSHELL */ #if defined (FD) && !defined (DEP_ORIGSHELL) VOID adjustpath(VOID_A) { char *cp, *path; if (!(cp = (char *)getenv(ENVPATH))) return; path = evalpaths(cp, PATHDELIM); if (strpathcmp(path, cp)) setenv2(ENVPATH, path, 1); Xfree(path); } #endif /* FD && !DEP_ORIGSHELL */ #ifdef FD char *includepath(path, plist) CONST char *path, *plist; { CONST char *cp, *next; char *tmp; int len; if (!plist || !*plist) return(NULL); next = plist; for (cp = next; cp && *cp; cp = next) { # ifdef DEP_DOSPATH if (_dospath(cp)) next += 2; # endif next = Xstrchr(next, PATHDELIM); len = (next) ? (next++) - cp : strlen(cp); if ((tmp = underpath(path, cp, len))) return(tmp); } return(NULL); } #endif /* FD */ #if defined (OLDPARSE) && !defined (_NOARCHIVE) char *getrange(cp, delim, fp, dp, wp) CONST char *cp; int delim; u_char *fp, *dp, *wp; { char *tmp; u_char c; *fp = *dp = *wp = 0; if (!(cp = Xsscanf(cp, "%c%Cu", delim, &c))) return(NULL); *fp = (c) ? c - 1 : FLD_NONE; if (*cp == '[') { if (!(cp = Xsscanf(++cp, "%Cu]", &c))) return(NULL); if (c && c <= MAXUTYPE(u_char) - 128 + 1) *dp = c - 1 + 128; } else if (*cp == '-') { if (cp[1] == ',' || cp[1] == ':') *dp = *(cp++); else if (cp[1] == '-' && cp[2] && cp[2] != ',' && cp[2] != ':') *dp = *(cp++); } else if (*cp && *cp != ',' && *cp != ':') *dp = *(cp++); if (*cp == '-') { if ((tmp = Xsscanf(++cp, "%Cu", &c))) { cp = tmp; if (c && c <= MAXUTYPE(u_char) - 128) *wp = c + 128; } else if (*cp && *cp != ',' && *cp != ':') *wp = *(cp++) % 128; else return(NULL); } return((char *)cp); } #endif /* OLDPARSE && !_NOARCHIVE */ int getprintable(buf, size, s, ptr, rwp) char *buf; ALLOC_T size; CONST char *s; ALLOC_T ptr; int *rwp; { char tmp[2 + 1]; int rw; getcharwidth(s, ptr, &rw, NULL); memcpy(tmp, &(s[ptr]), rw); tmp[rw] = '\0'; if (rwp) *rwp = rw; return(Xsnprintf(buf, size, "%^s", tmp)); } int evalprompt(bufp, prompt) char **bufp; CONST char *prompt; { #ifndef NOUID uidtable *up; #endif #if !MSDOS && defined (USEUNAME) struct utsname uts; #endif char *cp, *tmp, *new, line[MAXPATHLEN]; ALLOC_T size; int i, j, k, rw, v, len, unprint; cp = Xstrdup(prompt); #if defined (FD) && !defined (DEP_ORIGSHELL) prompt = new = evalpath(cp, EA_NOUNIQDELIM); #else prompt = new = evalvararg(cp, EA_BACKQ | EA_KEEPESCAPE, 0); Xfree(cp); #endif unprint = 0; #ifdef FAKEUNINIT size = 0; /* fake for -Wuninitialized */ #endif *bufp = c_realloc(NULL, 0, &size); for (i = j = len = 0; prompt[i]; i++) { cp = NULL; line[0] = '\0'; if (prompt[i] != ESCAPE) { k = 0; line[k++] = prompt[i]; if (iswchar(prompt, i)) line[k++] = prompt[++i]; line[k] = '\0'; } else switch (prompt[++i]) { case '\0': i--; *line = ESCAPE; line[1] = '\0'; break; #ifdef FD case '!': VOID_C Xsnprintf(line, sizeof(line), "%d", (int)histno[0] + 1); break; #endif #ifndef NOUID case 'u': if ((up = finduid(getuid(), NULL))) cp = up -> name; break; #endif #if !MSDOS case 'h': case 'H': # ifdef USEUNAME uname(&uts); Xstrcpy(line, uts.nodename); # else gethostname(line, MAXPATHLEN); # endif if (prompt[i] == 'h' && (tmp = Xstrchr(line, '.'))) *tmp = '\0'; break; case '$': *line = (getuid()) ? '$' : '#'; line[1] = '\0'; break; #endif /* !MSDOS */ case '~': #ifdef FD if (underhome(&(line[1]))) { line[0] = '~'; break; } #endif /*FALLTHRU*/ case 'w': #ifdef FD if (!physical_path || !Xgetwd(line)) cp = fullpath; #else if (!Xgetwd(line)) cp = vnullstr; #endif break; case 'W': #ifdef FD if (!physical_path || !Xgetwd(line)) tmp = fullpath; #else if (!Xgetwd(line)) tmp = vnullstr; #endif else tmp = line; #ifdef DEP_DOSPATH if (_dospath(tmp)) tmp += 2; #endif cp = strrdelim(tmp, 0); if (cp && (cp != tmp || cp[1])) cp++; else cp = tmp; break; case 'e': *line = '\033'; line[1] = '\0'; break; case '[': unprint = 1; break; case ']': unprint = 0; break; default: tmp = Xsscanf(&(prompt[i]), "%<3Co", line); if (tmp) i = (tmp - prompt) - 1; else *line = prompt[i]; line[1] = '\0'; break; } if (!cp) cp = line; while (*cp) { *bufp = c_realloc(*bufp, j + MAXCHARWID - 1, &size); if (unprint) { (*bufp)[j] = *cp; rw = v = 1; } else { v = getprintable(&((*bufp)[j]), MAXCHARWID + 1, cp, 0, &rw); len += v; #ifdef CODEEUC v = strlen(&((*bufp)[j])); #endif } cp += rw; j += v; } } (*bufp)[j] = '\0'; Xfree(new); return(len); } #if defined (FD) && !defined (_NOARCHIVE) char *getext(ext, flagsp) CONST char *ext; u_char *flagsp; { char *tmp; *flagsp = 0; # ifndef OLDPARSE if (*ext == '/') { ext++; *flagsp |= LF_IGNORECASE; } # endif if (*ext == '*') tmp = Xstrdup(ext); else { tmp = Xmalloc(strlen(ext) + 2); *tmp = '*'; Xstrcpy(&(tmp[1]), ext); } return(tmp); } /*ARGSUSED*/ int extcmp(ext1, flags1, ext2, flags2, strict) CONST char *ext1; int flags1; CONST char *ext2; int flags2, strict; { if (*ext1 == '*') ext1++; if (*ext2 == '*') ext2++; if (!strict && *ext1 != '.' && *ext2 == '.') ext2++; # ifndef PATHNOCASE if ((flags1 & LF_IGNORECASE) || (flags2 & LF_IGNORECASE)) return(Xstrcasecmp(ext1, ext2)); # endif return(strpathcmp(ext1, ext2)); } #endif /* FD && !_NOARCHIVE */ #ifdef FD int getkeycode(cp, identonly) CONST char *cp; int identonly; { char *tmp; int i, ch; if (!cp || !*cp) return(-1); ch = (*(cp++) & 0xff); if (!*cp) { if (identonly) return(-1); return(ch); } switch (ch) { case '\\': if (identonly) return(-1); if ((tmp = Xsscanf(cp, "%3o", &ch))) cp = tmp; else { for (i = 0; escapechar[i]; i++) if (*cp == escapechar[i]) break; ch = (escapechar[i]) ? escapevalue[i] : *cp; cp++; } break; case '^': if (identonly) return(-1); ch = Xtoupper(*(cp++)); if (ch < '?' || ch > '_') return(-1); ch = ((ch - '@') & 0x7f); break; case '@': if (identonly) return(-1); ch = (Xisalpha(*cp)) ? mkmetakey(*(cp++)) : -1; break; # ifdef CODEEUC case C_EKANA: if (identonly) return(-1); ch = (Xiskana(*cp)) ? mkekana(*(cp++)) : -1; break; # endif case 'F': if ((i = Xatoi(cp)) >= 1 && i <= 20) return(K_F(i)); /*FALLTHRU*/ default: cp--; for (i = 0; i < KEYIDENTSIZ; i++) if (!strcmp(keyidentlist[i].str, cp)) return(keyidentlist[i].no); ch = -1; break; } if (*cp) ch = -1; return(ch); } CONST char *getkeysym(c, tenkey) int c, tenkey; { static char buf[MAXCHARWID + 1]; int i; for (i = 0; i < KEYIDENTSIZ; i++) if ((u_short)(c) == keyidentlist[i].no) break; if (i < KEYIDENTSIZ) { if (c > (int)MAXUTYPE(u_char) || tenkey || c == ' ' || Xiscntrl(c)) return(keyidentlist[i].str); } i = 0; if (c >= K_F(1) && c <= K_F(20)) VOID_C Xsnprintf(buf, sizeof(buf), "F%d", c - K_F0); else if (ismetakey(c)) { buf[i++] = '@'; buf[i++] = c & 0x7f; } # ifdef CODEEUC else if (isekana2(c)) { buf[i++] = (char)C_EKANA; buf[i++] = c & 0xff; } # else else if (Xiskana(c)) buf[i++] = c; # endif else if (c > (int)MAXUTYPE(u_char)) { buf[i++] = '?'; buf[i++] = '?'; } else if (Xiscntrl(c) || ismsb(c)) { for (i = 0; escapechar[i]; i++) if (c == escapevalue[i]) break; if (escapechar[i]) VOID_C Xsnprintf(buf, sizeof(buf), "\\%c", escapechar[i]); else VOID_C Xsnprintf(buf, sizeof(buf), "%^c", c); } else buf[i++] = c; if (i > 0) buf[i] = '\0'; return(buf); } #endif /* FD */ char *decodestr(s, lenp, evalhat) CONST char *s; u_char *lenp; int evalhat; { char *cp, *tmp; int i, j, n; cp = Xmalloc(strlen(s) + 1); for (i = j = 0; s[i]; i++, j++) { if (s[i] == '\\') { i++; if ((tmp = Xsscanf(&(s[i]), "%<3Co", &(cp[j])))) { i = (tmp - s) - 1; continue; } for (n = 0; escapechar[n]; n++) if (s[i] == escapechar[n]) break; cp[j] = (escapechar[n]) ? escapevalue[n] : s[i]; } else if (evalhat && s[i] == '^' && (n = Xtoupper(s[i + 1])) >= '?' && n <= '_') { i++; cp[j] = ((n - '@') & 0x7f); } else cp[j] = s[i]; } tmp = Xmalloc(j + 1); memcpy(tmp, cp, j); tmp[j] = '\0'; Xfree(cp); if (lenp) *lenp = j; return(tmp); } #if defined (FD) && !defined (_NOKEYMAP) char *encodestr(s, len) CONST char *s; int len; { char *cp, *tmp; ALLOC_T size; int i, n; size = len * MAXCHARWID + 1; cp = tmp = Xmalloc(size); if (s) for (i = 0; i < len; i++) { if (iswchar(s, i)) { *(cp++) = s[i++]; size--; } # ifndef CODEEUC else if (isskana(s, i)) /*EMPTY*/; # endif else if (Xiscntrl(s[i]) || ismsb(s[i])) { for (n = 0; escapechar[n]; n++) if (s[i] == escapevalue[n]) break; if (escapechar[n]) { *(cp++) = '\\'; *(cp++) = escapechar[n]; size -= 2; } else { n = Xsnprintf(cp, size, "%^c", s[i]); #ifdef CODEEUC n = strlen(cp); #endif cp += n; size -= n; } continue; } *(cp++) = s[i]; size--; } *cp = '\0'; return(tmp); } #endif /* FD && !_NOKEYMAP */ FD-3.01j/builtin.c100644 2105 1751 211337 13516612560 12542 0ustar shiraiuser/* * builtin.c * * builtin commands */ #include "fd.h" #include "encode.h" #include "parse.h" #include "kconv.h" #include "func.h" #include "funcno.h" #include "kanji.h" #include "system.h" #include "termemu.h" #ifdef DEP_IME #include "roman.h" #endif #define STRHDD "HDD" #define STRHDD98 "98" #ifndef DEP_ORIGSHELL #define RET_SUCCESS 0 #define RET_FAIL 1 #define RET_NOTICE 255 #endif #if FD >= 2 #define BINDCOMMENT ':' #define DRIVESEP ' ' #define ALIASSEP '=' #define FUNCNAME 0 #else #define BINDCOMMENT ';' #define DRIVESEP ',' #define ALIASSEP '\t' #define FUNCNAME 1 #endif extern macrolist_t macrolist; extern int maxmacro; extern bindlist_t bindlist; extern int maxbind; #ifndef _NOARCHIVE extern launchlist_t launchlist; extern int maxlaunch; extern archivelist_t archivelist; extern int maxarchive; # ifndef _NOBROWSE extern char **browsevar; # endif #endif /* !_NOARCHIVE */ extern CONST strtable keyidentlist[]; extern CONST functable funclist[]; extern char **history[]; extern short histsize[]; extern short histno[]; #if FD >= 3 extern char *freqfile; #endif extern helpindex_t helpindex; #ifndef _NOCUSTOMIZE extern orighelpindex_t orighelpindex; #endif extern int fd_restricted; #if FD >= 2 extern char *progpath; extern char *progname; extern CONST char *promptstr; extern int lcmdline; #endif extern int internal_status; #ifndef DEP_ORIGSHELL extern char **environ2; extern aliastable aliaslist[]; extern int maxalias; extern userfunctable userfunclist[]; extern int maxuserfunc; extern int win_x; extern int win_y; extern int hideclock; #endif extern int inruncom; static VOID NEAR builtinerror __P_((char *CONST [], CONST char *, int)); #ifdef DEP_ORIGSHELL #define hitkey(n) #else static VOID NEAR hitkey __P_((int)); #endif static VOID NEAR fputsmeta __P_((CONST char *, XFILE *)); #if (!defined (_NOARCHIVE) && !defined (_NOBROWSE)) || defined (DEP_IME) static char **NEAR file2argv __P_((XFILE *, CONST char *, int)); #endif #ifndef _NOARCHIVE # ifndef OLDPARSE static int NEAR getlaunchopt __P_((int, char *CONST [], CONST char *, lsparse_t *)); # endif static int NEAR setlaunch __P_((int, char *CONST [])); static int NEAR setarch __P_((int, char *CONST [])); static int NEAR printlaunch __P_((int, char *CONST [])); static int NEAR printarch __P_((int, char *CONST [])); # ifndef _NOBROWSE static char **NEAR readargv __P_((char *CONST *, char **)); static int NEAR custbrowse __P_((int, char *CONST [])); # endif #endif /* !_NOARCHIVE */ static int NEAR setmacro __P_((char *)); static int NEAR setkeybind __P_((int, char *CONST [])); static int NEAR printbind __P_((int, char *CONST [])); #ifdef DEP_DOSEMU static int NEAR _setdrive __P_((int, char *CONST [], int)); static int NEAR setdrive __P_((int, char *CONST [])); static int NEAR unsetdrive __P_((int, char *CONST [])); static int NEAR printdrive __P_((int, char *CONST [])); #endif #ifndef _NOKEYMAP static int NEAR setkeymap __P_((int, char *CONST [])); static int NEAR keytest __P_((int, char *CONST [])); #endif static int NEAR printhist __P_((int, char *CONST [])); #if FD >= 2 # ifndef NOPOSIXUTIL static int NEAR fixcommand __P_((int, char *CONST [])); # endif static int NEAR printmd5 __P_((CONST char *, XFILE *)); static int NEAR md5sum __P_((int, char *CONST [])); static int NEAR evalmacro __P_((int, char *CONST [])); # ifdef DEP_KCONV static int NEAR kconv __P_((int, char *CONST [])); # endif static int NEAR getinputstr __P_((int, char *CONST [])); static int NEAR getyesno __P_((int, char *CONST [])); #endif /* FD >= 2 */ #if !MSDOS && (FD >= 2) static int NEAR savetty __P_((int, char *CONST [])); #endif #ifdef DEP_IME static int NEAR setroman __P_((int, char *CONST [])); static VOID NEAR disproman __P_((char *, int, XFILE *)); static int NEAR printroman __P_((int, char *CONST [])); # if FD >= 3 static int NEAR getfreq __P_((int, char *CONST [])); static int NEAR setfreq __P_((int, char *CONST [])); # endif #endif /* DEP_IME */ #ifndef DEP_ORIGSHELL static int NEAR printenv __P_((int, char *CONST [])); static int NEAR setalias __P_((int, char *CONST [])); static int NEAR unalias __P_((int, char *CONST [])); static int NEAR checkuserfunc __P_((int, char *CONST [])); static int NEAR setuserfunc __P_((int, char *CONST [])); static int NEAR exportenv __P_((int, char *CONST [])); static int NEAR dochdir __P_((int, char *CONST [])); static int NEAR loadsource __P_((int, char *CONST [])); #endif /* !DEP_ORIGSHELL */ static CONST char *CONST builtinerrstr[] = { NULL, #define ER_FEWMANYARG 1 "Too few or many arguments", #define ER_OUTOFLIMIT 2 "Out of limits", #define ER_NOENTRY 3 "No such entry", #define ER_SYNTAXERR 4 "Syntax error", #define ER_EXIST 5 "Entry already exists", #define ER_INVALDEV 6 "Invalid device", #define ER_EVENTNOFOUND 7 "Event not found", #define ER_UNKNOWNOPT 8 "Unknown option", #define ER_NOARGSPEC 9 "No argument is specified", #define ER_NOTINSHELL 10 "Cannot execute in shell mode", #define ER_NOTINRUNCOM 11 "Cannot execute in startup file", #define ER_NOTRECURSE 12 "Cannot execute recursively", #define ER_NOTDUMBTERM 13 "Cannot execute on dumb term", }; #define BUILTINERRSIZ arraysize(builtinerrstr) static CONST builtintable builtinlist[] = { #ifndef _NOARCHIVE {setlaunch, BL_LAUNCH}, {setarch, BL_ARCH}, {printlaunch, BL_PLAUNCH}, {printarch, BL_PARCH}, # ifndef _NOBROWSE {custbrowse, BL_BROWSE}, # endif #endif /* !_NOARCHIVE */ {setkeybind, BL_BIND}, {printbind, BL_PBIND}, #ifdef DEP_DOSEMU {setdrive, BL_SDRIVE}, {unsetdrive, BL_UDRIVE}, {printdrive, BL_PDRIVE}, #endif #ifndef _NOKEYMAP {setkeymap, BL_KEYMAP}, {keytest, BL_GETKEY}, #endif {printhist, BL_HISTORY}, #if FD >= 2 # ifndef NOPOSIXUTIL {fixcommand, BL_FC}, # endif {md5sum, BL_CHECKID}, {evalmacro, BL_EVALMACRO}, # ifdef DEP_KCONV {kconv, BL_KCONV}, # endif {getinputstr, BL_READLINE}, {getyesno, BL_YESNO}, #endif /* FD >= 2 */ #if !MSDOS && (FD >= 2) {savetty, BL_SAVETTY}, #endif #ifdef DEP_IME {setroman, BL_SETROMAN}, {printroman, BL_PRINTROMAN}, # if FD >= 3 {getfreq, BL_GETFREQ}, {setfreq, BL_SETFREQ}, # endif #endif /* DEP_IME */ #ifndef DEP_ORIGSHELL # if FD >= 2 {printenv, BL_SET}, # else {printenv, BL_PENV}, # endif {setalias, BL_ALIAS}, {unalias, BL_UALIAS}, # if FD < 2 {setuserfunc, BL_FUNCTION}, # endif {exportenv, BL_EXPORT}, # if MSDOS || (FD < 2) {dochdir, BL_CHDIR}, # endif {dochdir, BL_CD}, {loadsource, BL_SOURCE}, # if FD >= 2 {loadsource, BL_DOT}, # endif #endif /* !DEP_ORIGSHELL */ }; #define BUILTINSIZ arraysize(builtinlist) static VOID NEAR builtinerror(argv, s, n) char *CONST argv[]; CONST char *s; int n; { int duperrno; duperrno = errno; if (n >= BUILTINERRSIZ || (n < 0 && !errno)) return; if (argv && argv[0]) VOID_C Xfprintf(Xstderr, "%k: ", argv[0]); if (s) VOID_C Xfprintf(Xstderr, "%k: ", s); VOID_C Xfprintf(Xstderr, "%s.\n", (n >= 0 && builtinerrstr[n]) ? builtinerrstr[n] : Xstrerror(duperrno)); } #ifndef DEP_ORIGSHELL static VOID NEAR hitkey(init) int init; { static int n = 0; if (init) { if (init < 0) n = init; else if (init == 1) n = 0; else if (init == 2) { if (n >= 0) n = 1; } else if (n > 0 && n < n_line) { hideclock = 1; warning(0, HITKY_K); } return; } if (n <= 0) return; if (n >= n_line) n = 1; if (++n >= n_line) { VOID_C Xfflush(Xstdout); ttyiomode(1); win_x = 0; win_y = n_line - 1; hideclock = 1; warning(0, HITKY_K); stdiomode(); } } #endif /* !DEP_ORIGSHELL */ static VOID NEAR fputsmeta(arg, fp) CONST char *arg; XFILE *fp; { char *cp; if (!*arg) VOID_C Xfputs("\"\"", fp); else { cp = killmeta(arg); kanjifputs(cp, fp); Xfree(cp); } } #if (!defined (_NOARCHIVE) && !defined (_NOBROWSE)) || defined (DEP_IME) static char **NEAR file2argv(fp, s, whole) XFILE *fp; CONST char *s; int whole; { char *cp, *line, **argv; ALLOC_T size; int i, j, pc, argc, escape, quote, pqoute, quoted; argc = 1; argv = (char **)Xmalloc(2 * sizeof(char *)); argv[0] = Xstrdup(s); argv[1] = NULL; j = escape = 0; quote = pqoute = quoted = '\0'; cp = c_realloc(NULL, 0, &size); while ((line = Xfgets(fp))) { if (!escape && !quote && *line == '#') { Xfree(line); continue; } escape = 0; for (i = 0; line[i]; i++) { cp = c_realloc(cp, j + 2, &size); pc = parsechar(&(line[i]), -1, '\0', EA_EOLESCAPE, "e, &pqoute); if (pc == PC_CLQUOTE) quoted = line[i]; else if (pc == PC_WCHAR) { cp[j++] = line[i++]; cp[j++] = line[i]; } else if (pc == PC_SQUOTE || pc == PC_DQUOTE) cp[j++] = line[i]; else if (pc == PC_ESCAPE) { if (!line[++i]) { escape = 1; break; } cp[j++] = line[i]; } else if (pc == PC_OPQUOTE) quoted = '\0'; else if (pc != PC_NORMAL) /*EMPTY*/; else if (!Xstrchr(IFS_SET, line[i])) cp[j++] = line[i]; else if (j || quoted) { quoted = cp[j] = '\0'; argv = (char **)Xrealloc(argv, (argc + 2) * sizeof(*argv)); argv[argc++] = Xstrdup(cp); argv[argc] = NULL; j = 0; } } if (escape) /*EMPTY*/; else if (quote) cp[j++] = '\n'; else if (j || quoted) { quoted = cp[j] = '\0'; argv = (char **)Xrealloc(argv, (argc + 2) * sizeof(*argv)); argv[argc++] = Xstrdup(cp); argv[argc] = NULL; j = 0; } Xfree(line); if (!whole && !escape && !quote) break; } if (j) { cp[j] = '\0'; argv = (char **)Xrealloc(argv, (argc + 2) * sizeof(*argv)); argv[argc++] = Xstrdup(cp); argv[argc] = NULL; } Xfree(cp); return(argv); } #endif /* (!_NOARCHIVE && !_NOBROWSE) || DEP_IME */ #ifndef _NOARCHIVE # ifndef OLDPARSE static int NEAR getlaunchopt(n, argv, opts, lp) int n; char *CONST argv[]; CONST char *opts; lsparse_t *lp; { CONST char *cp; int i, c; if (argv[n][0] != '-') return(0); c = argv[n][1]; if (!c || c == '-') return(++n); else if (!Xstrchr(opts, c)) { lp -> topskip = ER_UNKNOWNOPT; lp -> bottomskip = n; return(-1); } if (argv[n][2]) cp = &(argv[n][2]); else if (argv[n + 1]) cp = argv[++n]; else { lp -> topskip = ER_NOARGSPEC; lp -> bottomskip = n; return(-1); } if (c == 'f') { i = countvar(lp -> format); lp -> format = (char **)Xrealloc(lp -> format, (i + 2) * sizeof(*(lp -> format))); lp -> format[i++] = Xstrdup(cp); lp -> format[i] = NULL; } else if (c == 'i') { i = countvar(lp -> lignore); lp -> lignore = (char **)Xrealloc(lp -> lignore, (i + 2) * sizeof(*(lp -> lignore))); lp -> lignore[i++] = Xstrdup(cp); lp -> lignore[i] = NULL; } else if (c == 'e') { i = countvar(lp -> lerror); lp -> lerror = (char **)Xrealloc(lp -> lerror, (i + 2) * sizeof(*(lp -> lerror))); lp -> lerror[i++] = Xstrdup(cp); lp -> lerror[i] = NULL; } else if (c == 't' || c == 'b') { if ((i = Xatoi(cp)) < 0) { lp -> topskip = ER_SYNTAXERR; lp -> bottomskip = n; return(-1); } if (c == 't') lp -> topskip = i; else lp -> bottomskip = i; } else if (c == 'p') { Xfree(lp -> ext); lp -> ext = Xstrdup(cp); } else { if (!strcmp(cp, "loop")) i = (c == 'd') ? LF_DIRLOOP : LF_FILELOOP; else if (!strcmp(cp, "noprep")) i = (c == 'd') ? LF_DIRNOPREP : LF_FILENOPREP; else { lp -> topskip = ER_SYNTAXERR; lp -> bottomskip = n; return(-1); } lp -> flags |= i; } n++; return(n); } # endif /* FD >= 2 */ VOID freelaunch(lp) lsparse_t *lp; { Xfree(lp -> ext); Xfree(lp -> comm); # ifndef OLDPARSE freevar(lp -> format); freevar(lp -> lignore); freevar(lp -> lerror); # endif } int searchlaunch(lp, list, max) CONST lsparse_t *lp, *list; int max; { int i, n; for (i = 0; i < max; i++) { n = extcmp(lp -> ext, lp -> flags, list[i].ext, list[i].flags, 1); if (!n) break; } return(i); } int parselaunch(argc, argv, lp) int argc; char *CONST argv[]; lsparse_t *lp; { # ifdef OLDPARSE char *cp, *tmp; u_char c; int ch; # else int j, opt, err; # endif int i, n; lp -> comm = NULL; # ifndef OLDPARSE lp -> format = lp -> lignore = lp -> lerror = NULL; # endif if (argc <= 1) { lp -> topskip = ER_FEWMANYARG; lp -> bottomskip = 0; return(-1); } lp -> ext = getext(argv[1], &(lp -> flags)); n = searchlaunch(lp, launchlist, maxlaunch); # ifndef DEP_DYNAMICLIST if (n >= MAXLAUNCHTABLE) { Xfree(lp -> ext); lp -> topskip = ER_OUTOFLIMIT; lp -> bottomskip = 0; return(-1); } # endif if (argc < 3) return(n); # ifdef OLDPARSE lp -> comm = Xstrdup(argv[2]); if (argc <= 3) lp -> topskip = lp -> bottomskip = SKP_NONE; else { cp = tmp = catvar(&(argv[3]), '\0'); if (!(cp = Xsscanf(cp, "%Cu,", &c))) { lp -> topskip = ER_SYNTAXERR; lp -> bottomskip = SKP_NONE; Xfree(lp -> ext); Xfree(lp -> comm); lp -> ext = tmp; return(-1); } lp -> topskip = c; if (!(cp = Xsscanf(cp, "%Cu", &c))) { lp -> topskip = ER_SYNTAXERR; lp -> bottomskip = SKP_NONE; Xfree(lp -> ext); Xfree(lp -> comm); lp -> ext = tmp; return(-1); } lp -> bottomskip = c; ch = ':'; for (i = 0; i < MAXLSPARSEFIELD; i++) { cp = getrange(cp, ch, &(lp -> field[i]), &(lp -> delim[i]), &(lp -> width[i])); if (!cp) { lp -> topskip = ER_SYNTAXERR; lp -> bottomskip = SKP_NONE; Xfree(lp -> ext); Xfree(lp -> comm); lp -> ext = tmp; return(-1); } ch = ','; } ch = ':'; for (i = 0; i < MAXLSPARSESEP; i++) { if (*cp != ch) break; if (!(cp = Xsscanf(++cp, "%Cu", &c))) { lp -> topskip = ER_SYNTAXERR; lp -> bottomskip = SKP_NONE; Xfree(lp -> ext); Xfree(lp -> comm); lp -> ext = tmp; return(-1); } lp -> sep[i] = (c) ? c - 1 : SEP_NONE; ch = ','; } for (; i < MAXLSPARSESEP; i++) lp -> sep[i] = SEP_NONE; if (!*cp) lp -> lines = 1; else { if (!Xsscanf(cp, ":%Cu%$", &c)) { lp -> topskip = ER_SYNTAXERR; lp -> bottomskip = SKP_NONE; Xfree(lp -> ext); Xfree(lp -> comm); lp -> ext = tmp; return(-1); } lp -> lines = (c) ? c : 1; } Xfree(tmp); } # else /* !OLDPARSE */ lp -> topskip = lp -> bottomskip = 0; opt = err = 0; for (i = 2; i < argc; i++) { j = getlaunchopt(i, argv, "fietb", lp); if (!j) { if (lp -> comm) break; lp -> comm = Xstrdup(argv[i]); } else if (j > 0) { opt++; i = j - 1; } else { err++; break; } } if (err) /*EMPTY*/; else if (!(lp -> comm)) { lp -> topskip = ER_FEWMANYARG; lp -> bottomskip = 0; err++; } else if (i + 3 < argc) { lp -> topskip = ER_FEWMANYARG; lp -> bottomskip = i + 3; err++; } else if (i < argc && opt) { lp -> topskip = ER_FEWMANYARG; lp -> bottomskip = i; err++; } if (err) { freelaunch(lp); return(-1); } if (i < argc) { lp -> format = (char **)Xmalloc(2 * sizeof(*(lp -> format))); lp -> format[0] = Xstrdup(argv[i]); lp -> format[1] = NULL; } if (i + 1 >= argc) /*EMPTY*/; else if ((j = Xatoi(argv[i + 1])) >= 0) lp -> topskip = j; else { lp -> topskip = ER_SYNTAXERR; lp -> bottomskip = i + 1; freelaunch(lp); return(-1); } if (i + 2 >= argc) /*EMPTY*/; else if ((j = Xatoi(argv[i + 2])) >= 0) lp -> bottomskip = j; else { lp -> topskip = ER_SYNTAXERR; lp -> bottomskip = i + 2; freelaunch(lp); return(-1); } # endif /* !OLDPARSE */ return(n); } VOID addlaunch(n, lp) int n; lsparse_t *lp; { if (n < maxlaunch) freelaunch(&(launchlist[n])); else { maxlaunch = n + 1; # ifdef DEP_DYNAMICLIST launchlist = (launchlist_t)Xrealloc(launchlist, maxlaunch * sizeof(*launchlist)); # endif } memcpy((char *)&(launchlist[n]), (char *)lp, sizeof(*launchlist)); } VOID deletelaunch(n) int n; { if (n >= maxlaunch) return; freelaunch(&(launchlist[n])); memmove((char *)&(launchlist[n]), (char *)&(launchlist[n + 1]), (--maxlaunch - n) * sizeof(*launchlist)); } static int NEAR setlaunch(argc, argv) int argc; char *CONST argv[]; { lsparse_t launch; int n; if ((n = parselaunch(argc, argv, &launch)) < 0) { # ifdef OLDPARSE if (launch.bottomskip == SKP_NONE) { builtinerror(argv, launch.ext, launch.topskip); Xfree(launch.ext); } else # endif builtinerror(argv, (launch.bottomskip) ? argv[launch.bottomskip] : NULL, launch.topskip); return(-1); } if (!(launch.comm)) { Xfree(launch.ext); if (n >= maxlaunch) { builtinerror(argv, argv[1], ER_NOENTRY); return(-1); } deletelaunch(n); # ifdef DEP_PTY sendparent(TE_DELETELAUNCH, n); # endif return(0); } addlaunch(n, &launch); # ifdef DEP_PTY sendparent(TE_ADDLAUNCH, n, &launch); # endif return(0); } VOID freearch(ap) archive_t *ap; { Xfree(ap -> ext); Xfree(ap -> p_comm); Xfree(ap -> u_comm); } int searcharch(ap, list, max) CONST archive_t *ap, *list; int max; { int i, n; for (i = 0; i < max; i++) { n = extcmp(ap -> ext, ap -> flags, list[i].ext, list[i].flags, 1); if (!n) break; } return(i); } int parsearch(argc, argv, ap) int argc; char *CONST argv[]; archive_t *ap; { int n; ap -> p_comm = ap -> u_comm = NULL; if (argc <= 1 || argc >= 5) { ap -> flags = ER_FEWMANYARG; ap -> ext = NULL; return(-1); } ap -> ext = getext(argv[1], &(ap -> flags)); n = searcharch(ap, archivelist, maxarchive); # ifndef DEP_DYNAMICLIST if (n >= MAXARCHIVETABLE) { Xfree(ap -> ext); ap -> flags = ER_OUTOFLIMIT; ap -> ext = NULL; return(-1); } # endif if (argc < 3) return(n); if (argv[2][0]) ap -> p_comm = Xstrdup(argv[2]); if (argc > 3 && argv[3][0]) ap -> u_comm = Xstrdup(argv[3]); if (!(ap -> p_comm) && !(ap -> u_comm)) { Xfree(ap -> ext); ap -> flags = ER_FEWMANYARG; ap -> ext = NULL; return(-1); } return(n); } VOID addarch(n, ap) int n; archive_t *ap; { if (n < maxarchive) freearch(&(archivelist[n])); else { maxarchive = n + 1; # ifdef DEP_DYNAMICLIST archivelist = (archivelist_t)Xrealloc(archivelist, maxarchive * sizeof(*archivelist)); # endif } memcpy((char *)&(archivelist[n]), (char *)ap, sizeof(*archivelist)); } VOID deletearch(n) int n; { if (n >= maxarchive) return; freearch(&(archivelist[n])); memmove((char *)&(archivelist[n]), (char *)&(archivelist[n + 1]), (--maxarchive - n) * sizeof(*archivelist)); } static int NEAR setarch(argc, argv) int argc; char *CONST argv[]; { archive_t arch; int n; if ((n = parsearch(argc, argv, &arch)) < 0) { builtinerror(argv, arch.ext, arch.flags); return(-1); } if (!(arch.p_comm) && !(arch.u_comm)) { Xfree(arch.ext); if (n >= maxarchive) { builtinerror(argv, argv[1], ER_NOENTRY); return(-1); } deletearch(n); # ifdef DEP_PTY sendparent(TE_DELETEARCH, n); # endif return(0); } addarch(n, &arch); # ifdef DEP_PTY sendparent(TE_ADDARCH, n, &arch); # endif return(0); } /*ARGSUSED*/ VOID printlaunchcomm(list, n, isset, omit, fp) CONST lsparse_t *list; int n, isset, omit; XFILE *fp; { int i, ch; VOID_C Xfprintf(fp, "%s ", BL_LAUNCH); # ifndef OLDPARSE if (list[n].flags & LF_IGNORECASE) VOID_C Xfputc('/', fp); # endif fputsmeta(&(list[n].ext[1]), fp); if (isset) for (;;) { VOID_C Xfputc('\t', fp); fputsmeta(list[n].comm, fp); # ifdef OLDPARSE if (list[n].topskip == SKP_NONE) break; if (omit) { VOID_C Xfputs("\t(Arch)", fp); break; } VOID_C Xfprintf(fp, "\t%d,%d", (int)(list[n].topskip), (int)(list[n].bottomskip)); ch = ':'; for (i = 0; i < MAXLSPARSEFIELD; i++) { VOID_C Xfputc(ch, fp); if (list[n].field[i] == FLD_NONE) VOID_C Xfputc('0', fp); else VOID_C Xfprintf(fp, "%d", (int)(list[n].field[i]) + 1); if (list[n].delim[i] >= 128) VOID_C Xfprintf(fp, "[%d]", (int)(list[n].delim[i]) - 128 + 1); else if (list[n].delim[i]) VOID_C Xfprintf(fp, "'%c'", (int)(list[n].delim[i])); if (!(list[n].width[i])) /*EMPTY*/; else if (list[n].width[i] >= 128) VOID_C Xfprintf(fp, "-%d", (int)(list[n].width[i]) - 128); else VOID_C Xfprintf(fp, "-'%c'", (int)(list[n].width[i])); ch = ','; } ch = ':'; for (i = 0; i < MAXLSPARSESEP; i++) { if (list[n].sep[i] == SEP_NONE) break; VOID_C Xfprintf(fp, "%c%d", ch, (int)(list[n].sep[i]) + 1); ch = ','; } if (list[n].lines > 1) { if (!i) VOID_C Xfputc(':', fp); VOID_C Xfprintf(fp, "%d", (int)(list[n].lines)); } # else /* !OLDPARSE */ if (!list[n].format) break; ch = 0; for (i = 0; list[n].format[i]; i++) { if (i) { VOID_C Xfputs(" \\\n", fp); ch++; } VOID_C Xfputs("\t-f ", fp); fputsmeta(list[n].format[i], fp); } if (list[n].lignore) for (i = 0; list[n].lignore[i]; i++) { VOID_C Xfputs(" \\\n\t-i ", fp); ch++; fputsmeta(list[n].lignore[i], fp); } if (list[n].lerror) for (i = 0; list[n].lerror[i]; i++) { VOID_C Xfputs(" \\\n\t-e ", fp); ch++; fputsmeta(list[n].lerror[i], fp); } if (!list[n].topskip && !list[n].bottomskip) break; if (list[n].topskip) { if (ch) VOID_C Xfputs(" \\\n", fp); VOID_C Xfprintf(fp, "\t-t %d", (int)(list[n].topskip)); } if (list[n].bottomskip) { if (list[n].topskip) VOID_C Xfputc(' ', fp); else if (ch) VOID_C Xfputs(" \\\n\t", fp); else VOID_C Xfputc('\t', fp); VOID_C Xfprintf(fp, "-b %d", (int)(list[n].bottomskip)); } # endif /* !OLDPARSE */ break; /*NOTREACHED*/ } VOID_C fputnl(fp); } static int NEAR printlaunch(argc, argv) int argc; char *CONST argv[]; { char *ext; int i, n; u_char flags; if (argc >= 3) { builtinerror(argv, NULL, ER_FEWMANYARG); return(-1); } hitkey(2); if (argc <= 1) for (i = 0; i < maxlaunch; i++) { printlaunchcomm(launchlist, i, 1, 1, Xstdout); hitkey(0); } else { ext = getext(argv[1], &flags); for (i = 0; i < maxlaunch; i++) { n = extcmp(ext, flags, launchlist[i].ext, launchlist[i].flags, 0); if (!n) break; } Xfree(ext); if (i >= maxlaunch) { builtinerror(argv, argv[1], ER_NOENTRY); return(-1); } printlaunchcomm(launchlist, i, 1, 0, Xstdout); } return(0); } VOID printarchcomm(list, n, isset, fp) CONST archive_t *list; int n, isset; XFILE *fp; { VOID_C Xfprintf(fp, "%s ", BL_ARCH); # ifndef OLDPARSE if (list[n].flags & LF_IGNORECASE) VOID_C Xfputc('/', fp); # endif fputsmeta(&(list[n].ext[1]), fp); if (isset) { VOID_C Xfputc('\t', fp); if (list[n].p_comm) fputsmeta(list[n].p_comm, fp); if (!list[n].u_comm) return; VOID_C Xfputc('\t', fp); fputsmeta(list[n].u_comm, fp); } VOID_C fputnl(fp); } static int NEAR printarch(argc, argv) int argc; char *CONST argv[]; { char *ext; int i, n; u_char flags; if (argc >= 3) { builtinerror(argv, NULL, ER_FEWMANYARG); return(-1); } hitkey(2); if (argc <= 1) for (i = 0; i < maxarchive; i++) { printarchcomm(archivelist, i, 1, Xstdout); hitkey(0); } else { ext = getext(argv[1], &flags); for (i = 0; i < maxarchive; i++) { n = extcmp(ext, flags, archivelist[i].ext, archivelist[i].flags, 0); if (!n) break; } Xfree(ext); if (i >= maxarchive) { builtinerror(argv, argv[1], ER_NOENTRY); return(-1); } printarchcomm(archivelist, i, 1, Xstdout); } return(0); } # ifndef _NOBROWSE static char **NEAR readargv(sargv, dargv) char *CONST *sargv, **dargv; { XFILE *fp; CONST char *cp; char **argv; int n, dargc; dargc = countvar(dargv); for (n = 1; sargv[n]; n++) { if (sargv[n][0] != '-' || sargv[n][1] != '@') { dargv = (char **)Xrealloc(dargv, (dargc + 2) * sizeof(*dargv)); dargv[dargc++] = Xstrdup(sargv[n]); dargv[dargc] = NULL; continue; } if (sargv[n][2]) cp = &(sargv[n][2]); else if (sargv[n + 1]) cp = sargv[++n]; else { builtinerror(sargv, sargv[n], ER_NOARGSPEC); freevar(dargv); return(NULL); } if (cp[0] == '-' && !cp[1]) fp = Xstdin; else if (!(fp = Xfopen(cp, "r"))) { builtinerror(sargv, cp, -1); freevar(dargv); return(NULL); } argv = file2argv(fp, sargv[0], 1); if (fp != Xstdin) VOID_C Xfclose(fp); else Xclearerr(fp); dargv = readargv(argv, dargv); freevar(argv); if (!dargv) return(NULL); dargc = countvar(dargv); } return(dargv); } VOID freebrowse(list) lsparse_t *list; { int i; browselevel = 0; freevar(browsevar); browsevar = NULL; if (argvar) { for (i = 1; argvar[i]; i++) { Xfree(argvar[i]); argvar[i] = NULL; } } if (!list) return; for (i = 0; list[i].comm; i++) freelaunch(&(list[i])); Xfree(list); } /*ARGSUSED*/ static int NEAR custbrowse(argc, argv) int argc; char *CONST argv[]; { lsparse_t *list; char **argv2; int i, n, lvl; # ifdef DEP_ORIGSHELL if (shellmode) { builtinerror(argv, NULL, ER_NOTINSHELL); return(-1); } # endif if (inruncom) { builtinerror(argv, NULL, ER_NOTINRUNCOM); return(-1); } if (browselist) { builtinerror(argv, NULL, ER_NOTRECURSE); return(-1); } argv2 = (char **)Xmalloc(2 * sizeof(char *)); argv2[0] = Xstrdup(argv[0]); argv2[1] = NULL; if (!(argv2 = readargv(argv, argv2))) return(-1); list = NULL; lvl = 0; n = 1; while (argv2[n]) { list = (lsparse_t *)Xrealloc(list, (lvl + 2) * sizeof(*list)); list[lvl].topskip = list[lvl].bottomskip = 0; list[lvl].comm = Xstrdup(argv2[n++]); list[lvl].flags = 0; list[lvl].ext = list[lvl + 1].comm = NULL; list[lvl].format = list[lvl].lignore = list[lvl].lerror = NULL; while (argv2[n]) { i = getlaunchopt(n, argv2, "fietbpdn", &(list[lvl])); if (!i) break; else if (i > 0) n = i; else { builtinerror(argv, (list[lvl].bottomskip) ? argv[list[lvl].bottomskip] : NULL, list[lvl].topskip); freevar(argv2); freebrowse(list); return(-1); /*NOTREACHED*/ break; } } lvl++; } for (i = 0; i < lvl; i++) if ((!i || i < lvl - 1) && !list[i].format) break; if (!lvl || i < lvl) { builtinerror(argv, NULL, ER_FEWMANYARG); freevar(argv2); freebrowse(list); return(-1); } freevar(argv2); if (list) { freebrowse(browselist); n = dolaunch(&(list[0]), F_NOCONFIRM | F_ARGSET | F_NOADDOPT | F_IGNORELIST); if (n < 0) { freebrowse(list); return(-1); } browselist = list; } return(0); } # endif /* !_NOBROWSE */ #endif /* !_NOARCHIVE */ int ismacro(n) int n; { if (n < FUNCLISTSIZ || n >= FUNCLISTSIZ + maxmacro) return(0); return(1); } CONST char *getmacro(n) int n; { if (ismacro(n)) return(macrolist[n - FUNCLISTSIZ]); return(nullstr); } static int NEAR setmacro(cp) char *cp; { #ifdef DEP_DYNAMICLIST macrolist = (macrolist_t)Xrealloc(macrolist, (maxmacro + 1) * sizeof(*macrolist)); #else if (maxmacro >= MAXMACROTABLE) return(-1); #endif macrolist[maxmacro] = cp; return(FUNCLISTSIZ + maxmacro++); } int freemacro(n) int n; { int i; if (!ismacro(n)) return(-1); for (i = 0; i < maxbind; i++) { if (ismacro(ffunc(i)) && ffunc(i) > n) ffunc(i)--; if (ismacro(dfunc(i)) && dfunc(i) > n) dfunc(i)--; } Xfree(macrolist[n - FUNCLISTSIZ]); memmove((char *)&(macrolist[n - FUNCLISTSIZ]), (char *)&(macrolist[n - FUNCLISTSIZ + 1]), (--maxmacro - (n - FUNCLISTSIZ)) * sizeof(*macrolist)); return(0); } int searchkeybind(bindp, list, max) CONST bindtable *bindp, *list; int max; { int i; for (i = 0; i < max; i++) if (list[i].key == bindp -> key) break; return(i); } int parsekeybind(argc, argv, bindp) int argc; char *CONST argv[]; bindtable *bindp; { int i, n; if (argc <= 1 || argc >= 6) { bindp -> key = ER_FEWMANYARG; bindp -> f_func = 0; return(-1); } if ((i = getkeycode(argv[1], 0)) < 0 || i == '\033') { bindp -> key = ER_SYNTAXERR; bindp -> f_func = 1; return(-1); } bindp -> key = i; n = searchkeybind(bindp, bindlist, maxbind); #ifndef DEP_DYNAMICLIST if (n >= MAXBINDTABLE) { bindp -> key = ER_OUTOFLIMIT; bindp -> f_func = 0; return(-1); } #endif if (argc == 2) { bindp -> f_func = bindp -> d_func = FNO_NONE; return(n); } for (i = 0; i < FUNCLISTSIZ; i++) if (!strcommcmp(argv[2], funclist[i].ident)) break; bindp -> f_func = (i < FUNCLISTSIZ) ? (funcno_t)i : FNO_SETMACRO; if (argc <= 3 || argv[3][0] == BINDCOMMENT) { bindp -> d_func = FNO_NONE; i = 3; } else { for (i = 0; i < FUNCLISTSIZ; i++) if (!strcommcmp(argv[3], funclist[i].ident)) break; bindp -> d_func = (i < FUNCLISTSIZ) ? (funcno_t)i : FNO_SETMACRO; i = 4; } if (argc > i + 1) { bindp -> key = ER_FEWMANYARG; bindp -> f_func = 0; return(-1); } else if (argc > i) { if (argv[i][0] != BINDCOMMENT || bindp -> key < K_F(1) || bindp -> key > K_F(MAXHELPINDEX)) { bindp -> key = ER_SYNTAXERR; bindp -> f_func = (funcno_t)i; return(-1); } } return(n); } int addkeybind(n, bindp, func1, func2, cp) int n; CONST bindtable *bindp; char *func1, *func2, *cp; { bindtable bind; int n1, n2; memcpy((char *)&bind, (char *)bindp, sizeof(bind)); if (bind.f_func != FNO_SETMACRO) Xfree(func1); else { n1 = setmacro(func1); #ifndef DEP_DYNAMICLIST if (n1 < 0) { Xfree(func1); Xfree(func2); Xfree(cp); return(-1); } #endif bind.f_func = (funcno_t)n1; } if (bind.d_func != FNO_SETMACRO) Xfree(func2); else { n2 = setmacro(func2); #ifndef DEP_DYNAMICLIST if (n2 < 0) { freemacro(bind.f_func); Xfree(func2); Xfree(cp); return(-2); } #endif bind.d_func = (funcno_t)n2; } if (bind.key < K_F(1) || bind.key > K_F(MAXHELPINDEX)) Xfree(cp); else if (cp) { Xfree(helpindex[bind.key - K_F(1)]); helpindex[bind.key - K_F(1)] = cp; } if (n < maxbind) { n1 = ffunc(n); n2 = dfunc(n); } else { maxbind = n + 1; #ifdef DEP_DYNAMICLIST bindlist = (bindlist_t)Xrealloc(bindlist, maxbind * sizeof(*bindlist)); #endif n1 = n2 = -1; } memcpy((char *)&(bindlist[n]), (char *)&bind, sizeof(*bindlist)); freemacro(n1); freemacro(n2); return(0); } VOID deletekeybind(n) int n; { if (n >= maxbind) return; freemacro(ffunc(n)); freemacro(dfunc(n)); if (bindlist[n].key >= K_F(1) && bindlist[n].key <= K_F(MAXHELPINDEX)) { Xfree(helpindex[bindlist[n].key - K_F(1)]); helpindex[bindlist[n].key - K_F(1)] = Xstrdup(nullstr); } memmove((char *)&(bindlist[n]), (char *)&(bindlist[n + 1]), (--maxbind - n) * sizeof(*bindlist)); } static int NEAR setkeybind(argc, argv) int argc; char *CONST argv[]; { bindtable bind; char *cp, *func1, *func2; int n, no; if ((no = parsekeybind(argc, argv, &bind)) < 0) { builtinerror(argv, (bind.f_func) ? argv[bind.f_func] : NULL, bind.key); return(-1); } if (bind.f_func == FNO_NONE) { if (no >= maxbind) { builtinerror(argv, argv[1], ER_NOENTRY); return(-1); } deletekeybind(no); #ifdef DEP_PTY sendparent(TE_DELETEKEYBIND, no); #endif return(0); } func1 = (bind.f_func == FNO_SETMACRO) ? Xstrdup(argv[2]) : NULL; func2 = (bind.d_func == FNO_SETMACRO) ? Xstrdup(argv[3]) : NULL; n = (bind.d_func == FNO_NONE) ? 3 : 4; cp = (argc > n) ? Xstrdup(&(argv[n][1])) : NULL; if ((n = addkeybind(no, &bind, func1, func2, cp)) < 0) { builtinerror(argv, argv[1 - n], ER_OUTOFLIMIT); return(-1); } #ifdef DEP_PTY sendparent(TE_ADDKEYBIND, no, &bind, func1, func2, cp); #endif return(0); } char *gethelp(bindp) CONST bindtable *bindp; { int n; if (bindp -> key < K_F(1) || bindp -> key > K_F(MAXHELPINDEX)) return(NULL); n = bindp -> key - K_F(1); #ifndef _NOCUSTOMIZE if (!strcmp(helpindex[n], orighelpindex[n])) return(NULL); #endif return(helpindex[n]); } VOID printmacro(list, n, isset, fp) CONST bindtable *list; int n, isset; XFILE *fp; { char *cp; VOID_C Xfprintf(fp, "%s ", BL_BIND); fputsmeta(getkeysym(list[n].key, 0), fp); if (isset) { VOID_C Xfputc('\t', fp); if (list[n].f_func < FUNCLISTSIZ) VOID_C Xfputs(funclist[list[n].f_func].ident, fp); else if (ismacro(list[n].f_func)) fputsmeta(getmacro(list[n].f_func), fp); else VOID_C Xfputs("\"\"", fp); if (list[n].d_func < FUNCLISTSIZ) VOID_C Xfprintf(fp, "\t%s", funclist[list[n].d_func].ident); else if (ismacro(list[n].d_func)) { VOID_C Xfputc('\t', fp); fputsmeta(getmacro(list[n].d_func), fp); } if ((cp = gethelp(&(list[n])))) VOID_C Xfprintf(fp, "\t%c%k", BINDCOMMENT, cp); } VOID_C fputnl(fp); } static int NEAR printbind(argc, argv) int argc; char *CONST argv[]; { int i, c; if (argc >= 3) { builtinerror(argv, NULL, ER_FEWMANYARG); return(-1); } hitkey(2); if (argc <= 1) for (i = 0; i < maxbind; i++) { if (!ismacro(ffunc(i)) && !ismacro(dfunc(i))) continue; printmacro(bindlist, i, 1, Xstdout); hitkey(0); } else if ((c = getkeycode(argv[1], 0)) < 0) { builtinerror(argv, argv[1], ER_SYNTAXERR); return(-1); } else { for (i = 0; i < maxbind; i++) if (c == bindlist[i].key) break; if (i >= maxbind) { builtinerror(argv, argv[1], ER_NOENTRY); return(-1); } printmacro(bindlist, i, 1, Xstdout); } return(0); } #ifdef DEP_DOSEMU /*ARGSUSED*/ int searchdrv(devp, list, max, isset) CONST devinfo *devp, *list; int max, isset; { int i; for (i = 0; i < max; i++) { if (devp -> drive != list[i].drive) continue; # ifdef HDDMOUNT if (!list[i].cyl && isset) break; # endif if (devp -> head == list[i].head && devp -> sect == list[i].sect && devp -> cyl == list[i].cyl && !strpathcmp(devp -> name, list[i].name)) break; } return(i); } int deletedrv(no) int no; { # ifdef HDDMOUNT CONST char *dev; int s; # endif int i, n; if (no >= maxfdtype) return(no); n = 1; # ifdef HDDMOUNT if (!fdtype[no].cyl) { dev = fdtype[no].name; for (s = 0; s < no; s++) { if (fdtype[no - s - 1].cyl || fdtype[no - s - 1].drive + 1 != fdtype[no - s].drive || strpathcmp(dev, fdtype[no - s - 1].name)) break; } for (n = 1; fdtype[no + n].name; n++) { if (fdtype[no + n].cyl || fdtype[no + n].drive != fdtype[no + n - 1].drive + 1 || strpathcmp(dev, fdtype[no + n].name)) break; } no -= s; n += s; } # endif /* HDDMOUNT */ for (i = 0; i < n; i++) Xfree(fdtype[no + i].name); memmove((char *)&(fdtype[no]), (char *)&(fdtype[no + n]), (--maxfdtype - no - n) * sizeof(*fdtype)); return(no); } int insertdrv(no, devp) int no; devinfo *devp; { # ifdef HDDMOUNT l_off_t *sp; char *drvlist; int j, drive; # endif int i, n, min, max; min = -1; # ifdef FAKEUNINIT max = -1; /* fake for -Wuninitialized */ # endif for (i = 0; i < maxfdtype; i++) { if (strpathcmp(devp -> name, fdtype[i].name)) continue; if (min < 0) min = i; max = i; } if (min < 0) { if (no > 0 && no < maxfdtype && !strpathcmp(fdtype[no - 1].name, fdtype[no].name)) no = maxfdtype; } else if (no < min) no = min; else if (no > max + 1) no = max + 1; n = 1; # ifdef HDDMOUNT sp = NULL; if (!(devp -> cyl)) { if (!(sp = readpt(devp -> name, devp -> sect))) return(-1); for (n = 0; sp[n + 1]; n++) /*EMPTY*/; if (!n) { Xfree(sp); return(-1); } # ifndef DEP_DYNAMICLIST else if (n >= MAXDRIVEENTRY - no) { Xfree(sp); return(-2); } # endif devp -> sect = sp[0]; drvlist = Xmalloc(n); drvlist[0] = devp -> drive; for (i = 0; i < n - 1; i++) { for (drive = drvlist[i] + 1; drive <= 'Z'; drive++) { for (j = 0; j < maxfdtype; j++) if (drive == fdtype[j].drive) break; if (j >= maxfdtype) break; } if (drive > 'Z') break; drvlist[i + 1] = drive; } if (i < n - 1) { Xfree(sp); Xfree(drvlist); return(-2); } } # ifdef FAKEUNINIT else drvlist = NULL; /* fake for -Wuninitialized */ # endif # endif /* HDDMOUNT */ maxfdtype += n; # ifdef DEP_DYNAMICLIST fdtype = (fdtype_t)Xrealloc(fdtype, maxfdtype * sizeof(*fdtype)); # endif memmove((char *)&(fdtype[maxfdtype - 1]), (char *)&(fdtype[maxfdtype - n - 1]), (maxfdtype - n - no) * sizeof(*fdtype)); # ifdef HDDMOUNT if (!(devp -> cyl)) { for (i = 0; i < n; i++) { memcpy((char *)&(fdtype[no + i]), (char *)devp, sizeof(*fdtype)); fdtype[no + i].drive = drvlist[i]; fdtype[no + i].name = Xstrdup(devp -> name); fdtype[no + i].offset = sp[i + 1]; } Xfree(sp); Xfree(drvlist); Xfree(devp -> name); return(no); } fdtype[no].offset = 0; # endif /* HDDMOUNT */ memcpy((char *)&(fdtype[no]), (char *)devp, sizeof(*fdtype)); fdtype[no].name = devp -> name; return(no); } int parsesetdrv(argc, argv, devp) int argc; char *CONST argv[]; devinfo *devp; { # if FD < 2 char *cp, *tmp; u_char c; # endif int head, sect, cyl; if (argc <= 3) { devp -> drive = ER_FEWMANYARG; devp -> head = 0; return(-1); } # if FD >= 2 if (argc >= 7) { devp -> drive = ER_FEWMANYARG; devp -> head = 0; return(-1); } # endif devp -> drive = Xtoupper(argv[1][0]); devp -> name = argv[2]; if (!Xisalpha(devp -> drive)) { devp -> drive = ER_SYNTAXERR; devp -> head = 1; return(-1); } # ifdef HDDMOUNT if (!strncmp(argv[3], STRHDD, strsize(STRHDD))) { if (argc > 5) { devp -> drive = ER_FEWMANYARG; devp -> head = 0; return(-1); } cyl = 0; if (!argv[3][3]) sect = 0; else if (!strcmp(&(argv[3][3]), STRHDD98)) sect = 98; else { devp -> drive = ER_SYNTAXERR; devp -> head = 3; return(-1); } if (argc < 5) head = 'n'; else if (!strcmp(argv[4], "ro")) head = 'r'; else if (!strcmp(argv[4], "rw")) head = 'w'; else { devp -> drive = ER_SYNTAXERR; devp -> head = 4; return(-1); } if (sect) head = Xtoupper(head); } else # endif /* HDDMOUNT */ # if FD >= 2 if (argc != 6) { devp -> drive = ER_FEWMANYARG; devp -> head = 0; return(-1); } else if ((head = Xatoi(argv[3])) <= 0) { devp -> drive = ER_SYNTAXERR; devp -> head = 3; return(-1); } else if (head > MAXUTYPE(u_char)) { devp -> drive = ER_OUTOFLIMIT; devp -> head = 3; return(-1); } else if ((sect = Xatoi(argv[4])) <= 0) { devp -> drive = ER_SYNTAXERR; devp -> head = 4; return(-1); } else if (sect > MAXUTYPE(u_short)) { devp -> drive = ER_OUTOFLIMIT; devp -> head = 4; return(-1); } else if ((cyl = Xatoi(argv[5])) <= 0) { devp -> drive = ER_SYNTAXERR; devp -> head = 5; return(-1); } else if (cyl > MAXUTYPE(u_short)) { devp -> drive = ER_OUTOFLIMIT; devp -> head = 5; return(-1); } # else /* FD < 2 */ { cp = tmp = catvar(&(argv[3]), '\0'); if (!(cp = Xsscanf(cp, "%+Cu%c", &c, DRIVESEP))) { devp -> drive = ER_SYNTAXERR; devp -> head = (u_char)-1; devp -> name = tmp; return(-1); } head = c; if (!(cp = Xsscanf(cp, "%+Cu%c", &c, DRIVESEP))) { devp -> drive = ER_SYNTAXERR; devp -> head = (u_char)-1; devp -> name = tmp; return(-1); } sect = c; if (!Xsscanf(cp, "%+Cu%$", &c)) { devp -> drive = ER_SYNTAXERR; devp -> head = (u_char)-1; devp -> name = tmp; return(-1); } cyl = c; if (head > MAXUTYPE(u_char) || sect > MAXUTYPE(u_short) || cyl > MAXUTYPE(u_short)) { devp -> drive = ER_OUTOFLIMIT; devp -> head = (u_char)-1; devp -> name = tmp; return(-1); } Xfree(tmp); } # endif /* FD < 2 */ devp -> head = head; devp -> sect = sect; devp -> cyl = cyl; return(0); } static int NEAR _setdrive(argc, argv, isset) int argc; char *CONST argv[]; int isset; { devinfo dev; int i, n; if (parsesetdrv(argc, argv, &dev) < 0) { # if FD < 2 if (dev.head == (u_char)-1) { builtinerror(argv, dev.name, dev.drive); Xfree(dev.name); } else # endif builtinerror(argv, (dev.head) ? argv[dev.head] : NULL, dev.drive); return(-1); } # ifdef HDDMOUNT if (!(dev.cyl)) { for (i = 0; i < maxfdtype; i++) if (dev.drive == fdtype[i].drive) break; } else # endif i = searchdrv(&dev, fdtype, maxfdtype, isset); if (!isset) { if (i >= maxfdtype) { builtinerror(argv, argv[2], ER_NOENTRY); return(-1); } # ifdef HDDMOUNT if (!(dev.cyl) && (fdtype[i].cyl || strpathcmp(argv[2], fdtype[i].name))) { builtinerror(argv, argv[2], ER_NOENTRY); return(-1); } # endif VOID_C deletedrv(i); # ifdef DEP_PTY sendparent(TE_DELETEDRV, i); # endif } else { if (i < maxfdtype) { builtinerror(argv, argv[1], ER_EXIST); return(-1); } # ifndef DEP_DYNAMICLIST if (i >= MAXDRIVEENTRY - 1) { builtinerror(argv, NULL, ER_OUTOFLIMIT); return(-1); } # endif dev.name = Xstrdup(dev.name); n = insertdrv(i, &dev); if (n < -1) { builtinerror(argv, NULL, ER_OUTOFLIMIT); Xfree(dev.name); return(-1); } if (!inruncom && n < 0) { builtinerror(argv, argv[2], ER_INVALDEV); Xfree(dev.name); return(-1); } # ifdef DEP_PTY sendparent(TE_INSERTDRV, i, &dev); # endif } return(0); } static int NEAR setdrive(argc, argv) int argc; char *CONST argv[]; { return(_setdrive(argc, argv, 1)); } static int NEAR unsetdrive(argc, argv) int argc; char *CONST argv[]; { return(_setdrive(argc, argv, 0)); } /*ARGSUSED*/ VOID printsetdrv(fdlist, n, isset, verbose, fp) CONST devinfo *fdlist; int n, isset, verbose; XFILE *fp; { VOID_C Xfprintf(fp, "%s %c\t", (isset) ? BL_SDRIVE : BL_UDRIVE, fdlist[n].drive); fputsmeta(fdlist[n].name, fp); VOID_C Xfputc('\t', fp); # ifdef HDDMOUNT if (!fdlist[n].cyl) { VOID_C Xfputs(STRHDD, fp); if (Xisupper(fdlist[n].head)) VOID_C Xfputs(STRHDD98, fp); if (verbose) VOID_C Xfprintf(fp, " #offset=%'Ld", fdlist[n].offset / fdlist[n].sect); } else # endif /* HDDMOUNT */ VOID_C Xfprintf(fp, "%d%c%d%c%d\n", (int)(fdlist[n].head), DRIVESEP, (int)(fdlist[n].sect), DRIVESEP, (int)(fdlist[n].cyl)); } static int NEAR printdrive(argc, argv) int argc; char *CONST argv[]; { int i, n; if (argc >= 3) { builtinerror(argv, NULL, ER_FEWMANYARG); return(-1); } hitkey(2); if (argc <= 1) for (i = 0; i < maxfdtype; i++) { printsetdrv(fdtype, i, 1, 1, Xstdout); hitkey(0); } else { for (i = n = 0; i < maxfdtype; i++) if (Xtoupper(argv[1][0]) == fdtype[i].drive) { n++; printsetdrv(fdtype, i, 1, 1, Xstdout); hitkey(0); } if (!n) { builtinerror(argv, argv[1], ER_NOENTRY); return(-1); } } return(0); } #endif /* DEP_DOSEMU */ #ifndef _NOKEYMAP VOID printkeymap(kp, isset, fp) keyseq_t *kp; int isset; XFILE *fp; { char *cp; VOID_C Xfprintf(fp, "%s ", BL_KEYMAP); fputsmeta(getkeysym(kp -> code, 1), fp); if (isset) { VOID_C Xfputc('\t', fp); cp = encodestr(kp -> str, kp -> len); fputsmeta(cp, fp); Xfree(cp); } VOID_C fputnl(fp); } int parsekeymap(argc, argv, kp) int argc; char *CONST argv[]; keyseq_t *kp; { kp -> code = (short)-1; kp -> len = (u_char)0; kp -> str = NULL; if (argc >= 4) { kp -> code = ER_FEWMANYARG; kp -> len = (u_char)0; return(-1); } if (argc <= 1) return(0); if ((kp -> code = getkeycode(argv[1], 1)) < 0) { kp -> code = ER_SYNTAXERR; kp -> len = (u_char)1; return(-1); } if (argc == 2) return(0); if (!(argv[2][0])) { kp -> len = (u_char)-1; return(0); } kp -> str = decodestr(argv[2], &(kp -> len), 1); if (!(kp -> len)) { Xfree(kp -> str); kp -> code = ER_SYNTAXERR; kp -> len = (u_char)2; return(-1); } return(0); } static int NEAR setkeymap(argc, argv) int argc; char *CONST argv[]; { keyseq_t key; int i; if (parsekeymap(argc, argv, &key) < 0) { builtinerror(argv, (key.len) ? argv[key.len] : NULL, key.code); return(-1); } if (key.code < 0) { hitkey(2); for (i = 1; i <= 20; i++) { key.code = K_F(i); if (getkeyseq(&key) < 0 || !(key.len)) continue; printkeymap(&key, 1, Xstdout); hitkey(0); } for (i = 0; (key.code = keyidentlist[i].no) > 0; i++) { if (getkeyseq(&key) < 0 || !(key.len)) continue; printkeymap(&key, 1, Xstdout); hitkey(0); } return(0); } if (!(key.len)) { if (getkeyseq(&key) < 0 || !(key.len)) { builtinerror(argv, argv[1], ER_NOENTRY); return(-1); } hitkey(2); printkeymap(&key, 1, Xstdout); return(0); } if (!(key.str)) { setkeyseq(key.code, NULL, 0); # ifdef DEP_PTY key.len = (u_char)0; sendparent(TE_SETKEYSEQ, &key); # endif return(0); } setkeyseq(key.code, key.str, key.len); # ifdef DEP_PTY sendparent(TE_SETKEYSEQ, &key); # endif return(0); } static int NEAR keytest(argc, argv) int argc; char *CONST argv[]; { char *cp, buf[2]; int i, n, ch, next; if (dumbterm > 1) { builtinerror(argv, NULL, ER_NOTDUMBTERM); return(-1); } if (argc >= 3) { builtinerror(argv, NULL, ER_FEWMANYARG); return(-1); } n = (argc >= 2) ? Xatoi(argv[1]) : 1; if (n < 0) { builtinerror(argv, argv[1], ER_SYNTAXERR); return(-1); } hitkey(2); ttyiomode(1); i = 0; for (;;) { kanjiputs(GETKY_K); if (n != 1) kanjiputs(SPCED_K); tflush(); next = 0; while (!kbhit2(1000000L / SENSEPERSEC)); Xcputs("\r\""); putterm(L_CLEAR); buf[1] = '\0'; do { if ((ch = Xgetch()) == EOF) break; next = kbhit2(WAITKEYPAD * 1000L); buf[0] = ch; cp = encodestr(buf, 1); Xcputs(cp); Xfree(cp); } while (next); VOID_C Xputch('"'); cputnl(); if (n) { if (++i >= n) break; } if (n != 1 && ch == ' ') break; } stdiomode(); return(0); } #endif /* !_NOKEYMAP */ static int NEAR printhist(argc, argv) int argc; char *CONST argv[]; { int i, n, max, size; if (argc >= 3) { builtinerror(argv, NULL, ER_FEWMANYARG); return(-1); } size = (int)histsize[0]; if (argc < 2) n = size; else if ((n = Xatoi(argv[1])) < 1) { builtinerror(argv, argv[1], ER_SYNTAXERR); return(-1); } else if (n > size) n = size; if (!history[0]) return(0); if (--n > (int)MAXHISTNO) n = (int)MAXHISTNO; for (max = n; max >= 0; max--) if (history[0][max]) break; if (max < (int)histno[0]) n = (int)histno[0] - max - 1; else n = (int)MAXHISTNO - (max - (int)histno[0]); hitkey(2); for (i = max; i >= 0; i--) { VOID_C Xprintf("%5d %k\n", n + 1, history[0][i]); if (n++ >= (int)MAXHISTNO) n = 0; hitkey(0); } return(0); } #if FD >= 2 # ifndef NOPOSIXUTIL static int NEAR fixcommand(argc, argv) int argc; char *CONST argv[]; { XFILE *fp; CONST char *r, *editor; char *cp, *s, *tmp, path[MAXPATHLEN]; int i, j, n, f, fd, l, l1, l2, len, max, skip, list, nonum, rev, exe; editor = NULL; skip = list = nonum = rev = exe = 0; for (n = 1; n < argc && argv[n][0] == '-'; n++) { skip = 0; for (i = 1; argv[n][i]; i++) { skip = 0; switch (argv[n][i]) { case 'e': if (argv[n][i + 1]) { editor = &(argv[n][i + 1]); skip = 1; } else if (n + 1 < argc) { editor = argv[++n]; skip = 1; } else skip = -1; break; case 'l': list = 1; break; case 'n': nonum = 1; break; case 'r': rev = 1; break; case 's': exe = 1; break; default: skip = -1; break; } if (skip) { skip--; break; } } if (skip) { skip--; break; } } if (skip) { VOID_C Xfprintf(Xstderr, "%k: usage: %k [-ls] [-nr] [-e editor] [old=new] [first] [last]\n", argv[0], argv[0]); return(-1); } if (!history[0]) return(0); tmp = removehist(0); if (exe) { i = n; for (; n < argc; n++) if (!Xstrchr(argv[n], '=')) break; f = parsehist((n < argc) ? argv[n] : "!", NULL, '\0'); if (f < 0) { builtinerror(argv, argv[n], ER_EVENTNOFOUND); VOID_C entryhist(tmp, HST_COMM); Xfree(tmp); return(-1); } Xfree(tmp); s = Xstrdup(history[0][f]); max = len = strlen(s); for (; i < n; i++) { if (!(r = Xstrchr(argv[i], '='))) continue; l1 = r - argv[i]; for (cp = s; (cp = Xstrchr(cp, argv[i][0])); cp++) if (!strncmp(cp, argv[i], l1)) break; if (!cp) continue; r++; l2 = strlen(r); len += l2 - l1; if (len > max) { max = len; j = cp - s; s = Xrealloc(s, max + 1); cp = s + j; } memmove(&(cp[l2]), &(cp[l1]), &(s[len]) - &(cp[l2]) + 1); memcpy(cp, r, l2); } kanjifputs(s, Xstdout); putnl(); VOID_C entryhist(s, HST_COMM); n = execmacro(s, NULL, F_NOCONFIRM | F_ARGSET | F_IGNORELIST); if (n < 0) n = 0; Xfree(s); return(n); } if (!editor) editor = getenv2("FD_FCEDIT"); if (!editor) editor = getenv2("FD_EDITOR"); if (!editor) editor = EDITOR; if (list) { f = parsehist((n < argc) ? argv[n] : "-16", NULL, '\0'); l = parsehist((n + 1 < argc) ? argv[n + 1] : "!", NULL, '\0'); } else { f = parsehist((n < argc) ? argv[n] : "!", NULL, '\0'); l = (n + 1 < argc) ? parsehist(argv[n + 1], NULL, '\0') : f; } if (f < 0 || l < 0) { if (f < 0) builtinerror(argv, argv[n], ER_EVENTNOFOUND); else builtinerror(argv, (n + 1 < argc) ? argv[n + 1] : NULL, ER_EVENTNOFOUND); VOID_C entryhist(tmp, HST_COMM); Xfree(tmp); return(-1); } if (rev) { n = f; f = l; l = n; } if (f < (int)histno[0]) n = (int)histno[0] - f - 1; else n = (int)MAXHISTNO - (f - (int)histno[0]); if (list) { fp = Xstdout; hitkey(2); } else { if ((fd = mktmpfile(path)) < 0) { builtinerror(argv, argv[0], -1); Xfree(tmp); return(-1); } if (!(fp = Xfdopen(fd, "w"))) { builtinerror(argv, path, -1); VOID_C Xclose(fd); rmtmpfile(path); Xfree(tmp); return(-1); } nonum = 1; } if (f >= l) for (i = f; i >= l; i--) { if (history[0][i]) { if (!nonum) { VOID_C Xfprintf(fp, "%5d ", n + 1); if (n++ >= (int)MAXHISTNO) n = 0; } kanjifputs(history[0][i], fp); VOID_C fputnl(fp); # ifndef DEP_ORIGSHELL if (list) hitkey(0); # endif } } else for (i = f; i <= l; i++) { if (history[0][i]) { if (!nonum) { VOID_C Xfprintf(fp, "%5d ", n + 1); if (--n < 0) n = (int)MAXHISTNO; } kanjifputs(history[0][i], fp); VOID_C fputnl(fp); # ifndef DEP_ORIGSHELL if (list) hitkey(0); # endif } } if (list) { VOID_C Xfflush(Xstdout); VOID_C entryhist(tmp, HST_COMM); Xfree(tmp); return(0); } VOID_C Xfclose(fp); n = execmacro(editor, path, F_NOCONFIRM | F_IGNORELIST); if (n < 0) n = 0; if (n) { builtinerror(argv, editor, -1); rmtmpfile(path); Xfree(tmp); return(-1); } if (!(fp = Xfopen(path, "r"))) { builtinerror(argv, path, -1); rmtmpfile(path); Xfree(tmp); return(-1); } Xfree(tmp); for (; (cp = Xfgets(fp)); Xfree(cp)) { if (!*cp) continue; kanjifputs(cp, Xstdout); putnl(); VOID_C entryhist(cp, HST_COMM); n = execmacro(cp, NULL, F_NOCONFIRM | F_ARGSET | F_IGNORELIST); } VOID_C Xfclose(fp); rmtmpfile(path); return(n); } # endif /* !NOPOSIXUTIL */ static int NEAR printmd5(path, fp) CONST char *path; XFILE *fp; { XFILE *fpin; ALLOC_T size; u_char buf[MD5_BUFSIZ * 4]; int i, n; if (!(fpin = Xfopen(path, "rb"))) return(-1); size = sizeof(buf); n = md5fencode(buf, &size, fpin); VOID_C Xfclose(fpin); if (n < 0) return(-1); VOID_C Xfprintf(fp, "MD5 (%k) = ", path); for (i = 0; i < size; i++) VOID_C Xfprintf(fp, "%02x", buf[i]); return(fputnl(fp)); } static int NEAR md5sum(argc, argv) int argc; char *CONST argv[]; { char path[MAXPATHLEN]; int i, n; hitkey(2); if (argc < 2) { # if MSDOS || defined (CYGWIN) Xstrcpy(strcatdelim2(path, progpath, progname), ".EXE"); # else strcatdelim2(path, progpath, progname); # endif if (printmd5(path, Xstdout) < 0) { builtinerror(argv, path, -1); return(-1); } return(0); } n = 0; for (i = 1; i < argc; i++) { if (printmd5(argv[i], Xstdout) < 0) { builtinerror(argv, argv[i], -1); n = -1; continue; } hitkey(0); } return(n); } static int NEAR evalmacro(argc, argv) int argc; char *CONST argv[]; { char *cp; int n; if (argc <= 1 || !(cp = catvar(&(argv[1]), ' '))) return(0); n = execmacro(cp, NULL, F_NOCONFIRM | F_ARGSET | F_NOKANJICONV); if (n < 0) n = 0; Xfree(cp); return(n); } # ifdef DEP_KCONV static int NEAR kconv(argc, argv) int argc; char *CONST argv[]; { XFILE *fpin, *fpout; char *cp; int i, in, out, err; err = 0; in = out = DEFCODE; for (i = 1; i < argc; i++) { if (argv[i][0] != '-') break; if (argv[i][1] == '-' && !argv[i][2]) { i++; break; } switch (argv[i][1]) { case 'i': if (argv[i][2]) cp = &(argv[i][2]); else if (!(cp = argv[++i]) || !*cp) { err = 1; break; } if ((in = getlang(cp, L_FNAME)) == NOCNV) in = DEFCODE; break; case 'o': if (argv[i][2]) cp = &(argv[i][2]); else if (!(cp = argv[++i]) || !*cp) { err = 1; break; } if ((out = getlang(cp, L_FNAME)) == NOCNV) out = DEFCODE; break; default: err = 1; break; } if (err) { VOID_C Xfprintf(Xstderr, "Usage: %s [-i inputcode] [-o outputcode] [filename]\n", argv[0]); return(-1); } } if (i >= argc || !*(argv[i])) { fpin = Xstdin; fpout = Xstdout; } else if (!(fpin = Xfopen(argv[i], "r"))) { builtinerror(argv, argv[i], -1); return(-1); } else if (i + 1 >= argc || !*(argv[i + 1])) fpout = Xstdout; else if (!(fpout = Xfopen(argv[i + 1], "w"))) { builtinerror(argv, argv[i + 1], -1); VOID_C Xfclose(fpin); return(-1); } # if defined (DEP_UNICODE) && !defined (DEP_EMBEDUNITBL) if ((i = (in > out) ? in : out) >= UTF8) readunitable(i - UTF8); # endif while ((cp = Xfgets(fpin))) { if (in != DEFCODE) renewkanjiconv(&cp, in, DEFCODE, L_OUTPUT); renewkanjiconv(&cp, DEFCODE, out, L_OUTPUT); VOID_C Xfputs(cp, fpout); VOID_C fputnl(fpout); Xfree(cp); } # if defined (DEP_UNICODE) && !defined (DEP_EMBEDUNITBL) if (!unicodebuffer) discardunitable(); # endif if (fpin != Xstdin) VOID_C Xfclose(fpin); else Xclearerr(fpin); if (fpout != Xstdout) VOID_C Xfclose(fpout); return(0); } # endif /* DEP_KCONV */ static int NEAR getinputstr(argc, argv) int argc; char *CONST argv[]; { CONST char *duppromptstr; char *s; int wastty; if (dumbterm > 1) { builtinerror(argv, NULL, ER_NOTDUMBTERM); return(-1); } if (!(wastty = isttyiomode)) ttyiomode(1); duppromptstr = promptstr; if (argc >= 2) promptstr = argv[1]; else promptstr = nullstr; s = inputstr(NULL, 0, -1, NULL, -1); promptstr = duppromptstr; if (!wastty) stdiomode(); if (!s) return(-1); kanjifputs(s, Xstdout); putnl(); Xfree(s); return(0); } static int NEAR getyesno(argc, argv) int argc; char *CONST argv[]; { CONST char *s; int n, wastty; if (dumbterm > 1) { builtinerror(argv, NULL, ER_NOTDUMBTERM); return(-1); } if (argc < 2) s = nullstr; else s = argv[1]; if (!(wastty = isttyiomode)) ttyiomode(1); lcmdline = -1; n = yesno(s); if (!wastty) stdiomode(); return((n) ? 0 : -1); } #endif /* FD >= 2 */ #if !MSDOS int savestdio(reset) int reset; { int n; if (isttyiomode) return(0); n = savettyio(reset); # ifdef DEP_PTY sendparent(TE_SAVETTYIO, reset); # endif return(n); } # if FD >= 2 static int NEAR savetty(argc, argv) int argc; char *CONST argv[]; { int n; n = 0; if (argc > 1 && argv[1][0] == '-' && argv[1][1] == 'n' && !(argv[1][2])) n++; return(savestdio(n)); } # endif /* FD >= 2 */ #endif /* !MSDOS */ #ifdef DEP_IME static int NEAR setroman(argc, argv) int argc; char *CONST argv[]; { XFILE *fp; char *file, **args; int i, n, skip, clean; file = NULL; skip = clean = 0; for (n = 1; n < argc && argv[n][0] == '-'; n++) { skip = 0; for (i = 1; argv[n][i]; i++) { skip = 0; switch (argv[n][i]) { case 'c': clean = 2; break; case 'r': clean = 1; break; case 'f': if (argv[n][i + 1]) { file = &(argv[n][i + 1]); skip = 1; } else if (n + 1 < argc) { file = argv[++n]; skip = 1; } else skip = -1; break; default: skip = -1; break; } if (skip) { skip--; break; } } if (skip) { skip--; break; } } if (skip || (!file && !clean && n >= argc)) { VOID_C Xfprintf(Xstderr, "%k: usage: %k [-c] [-r] [-f file] [roman [kanji]]]\n", argv[0], argv[0]); return(-1); } if (clean) { freeroman(clean - 1); # ifdef DEP_PTY sendparent(TE_FREEROMAN, clean - 1); # endif } if (!file) fp = NULL; else if (!(fp = Xfopen(file, "r"))) { builtinerror(argv, file, -1); return(-1); } else for (;;) { args = file2argv(fp, argv[0], 0); i = 1; if (args[i] && !strcommcmp(args[i], BL_SETROMAN)) i++; if (!args[i]) /*EMPTY*/; else if (addroman(args[i], args[i + 1]) < 0) builtinerror(argv, args[i], ER_SYNTAXERR); # ifdef DEP_PTY else sendparent(TE_ADDROMAN, args[i], args[i + 1]); # endif freevar(args); if (Xfeof(fp)) break; } if (fp) VOID_C Xfclose(fp); if (n >= argc) /*EMPTY*/; else if (addroman(argv[n], argv[n + 1]) < 0) { builtinerror(argv, argv[n], ER_SYNTAXERR); return(-1); } # ifdef DEP_PTY else sendparent(TE_ADDROMAN, argv[n], argv[n + 1]); # endif return(0); } static VOID NEAR disproman(s, n, fp) char *s; int n; XFILE *fp; { char buf[2 + 1]; int i; if (s && *s) VOID_C Xfprintf(fp, "%s ", s); VOID_C Xfprintf(fp, "%s \"", romanlist[n].str); for (i = 0; i < R_MAXKANA; i++) { if (!romanlist[n].code[i]) break; VOID_C jis2str(buf, romanlist[n].code[i]); VOID_C Xfprintf(fp, "%K", buf); } VOID_C Xfputc('"', fp); VOID_C fputnl(fp); } static int NEAR printroman(argc, argv) int argc; char *CONST argv[]; { int i, n, ret; initroman(); ret = -1; if (argc < 2) { for (i = 0; i < maxromanlist; i++) disproman(BL_SETROMAN, i, Xstdout); ret = 0; } else for (n = 1; n < argc; n++) { if (!*(argv[n]) || (i = searchroman(argv[n], strlen(argv[n]))) < 0) { builtinerror(argv, argv[n], ER_NOENTRY); continue; } disproman(BL_PRINTROMAN, i, Xstdout); ret = 0; } return(ret); } # if FD >= 3 static int NEAR getfreq(argc, argv) int argc; char *CONST argv[]; { CONST char *path; int ret; path = (argc < 2) ? freqfile : argv[1]; ret = fgetuserfreq(path, Xstdout); if (ret < 0) builtinerror(argv, path, -1); return(ret); } static int NEAR setfreq(argc, argv) int argc; char *CONST argv[]; { CONST char *path; int ret; path = (argc < 2) ? freqfile : argv[1]; ret = fputuserfreq(path, Xstdin); if (ret < 0) builtinerror(argv, path, -1); return(ret); } # endif /* FD >= 3 */ #endif /* DEP_IME */ #ifndef DEP_ORIGSHELL static int NEAR printenv(argc, argv) int argc; char *CONST argv[]; { # if FD < 2 int len; # endif int i; # if FD >= 2 if (argc >= 2) { builtinerror(argv, NULL, ER_FEWMANYARG); return(-1); } # else if (argc >= 3) { builtinerror(argv, NULL, ER_FEWMANYARG); return(-1); } if (argc > 1) { hitkey(2); len = strlen(argv[1]); for (i = 0; environ2[i]; i++) if (!strnenvcmp(environ2[i], argv[1], len) && environ2[i][len] == '=') break; if (!environ2[i]) { builtinerror(argv, argv[1], ER_NOENTRY); return(-1); } kanjifputs(environ2[i], Xstdout); putnl(); return(0); } # endif hitkey(2); if (environ2) for (i = 0; environ2[i]; i++) { kanjifputs(environ2[i], Xstdout); putnl(); hitkey(0); } # if FD >= 2 for (i = 0; i < maxuserfunc; i++) { printfunction(i, 0, Xstdout); putnl(); hitkey(0); } # endif return(0); } int searchalias(ident, len) CONST char *ident; int len; { int i; if (len < 0) len = strlen(ident); for (i = 0; i < maxalias; i++) if (!strncommcmp(ident, aliaslist[i].alias, len) && !(aliaslist[i].alias[len])) break; return(i); } int addalias(ident, comm) char *ident, *comm; { int i; if ((i = searchalias(ident, -1)) >= MAXALIASTABLE) { Xfree(ident); Xfree(comm); return(-1); } else if (i < maxalias) { Xfree(aliaslist[i].alias); Xfree(aliaslist[i].comm); } else maxalias++; aliaslist[i].alias = ident; aliaslist[i].comm = comm; # ifdef COMMNOCASE Xstrtolower(ident); # endif # ifdef DEP_PTY sendparent(TE_ADDALIAS, ident, comm); # endif return(0); } int deletealias(ident) CONST char *ident; { reg_ex_t *re; int i, n; n = 0; re = regexp_init(ident, -1); for (i = 0; i < maxalias; i++) { if (re) { if (!regexp_exec(re, aliaslist[i].alias, 0)) continue; } else if (strcommcmp(ident, aliaslist[i].alias)) continue; Xfree(aliaslist[i].alias); Xfree(aliaslist[i].comm); memmove((char *)&(aliaslist[i]), (char *)&(aliaslist[i + 1]), (--maxalias - i) * sizeof(*aliaslist)); i--; n++; } regexp_free(re); if (!n) return(-1); # ifdef DEP_PTY sendparent(TE_DELETEALIAS, ident); # endif return(0); } VOID printalias(n, fp) int n; XFILE *fp; { VOID_C Xfprintf(fp, "%s %k%c", BL_ALIAS, aliaslist[n].alias, ALIASSEP); fputsmeta(aliaslist[n].comm, fp); } static int NEAR setalias(argc, argv) int argc; char *CONST argv[]; { char *cp; int i, len; # if FD >= 2 if (argc >= 3) { builtinerror(argv, NULL, ER_FEWMANYARG); return(-1); } # else if (argc >= 4) { builtinerror(argv, NULL, ER_FEWMANYARG); return(-1); } # endif if (argc <= 1) { hitkey(2); for (i = 0; i < maxalias; i++) { printalias(i, Xstdout); putnl(); hitkey(0); } return(0); } # if FD >= 2 if (!(cp = gettoken(argv[1])) || (*cp && *cp != ALIASSEP)) { builtinerror(argv, argv[1], ER_SYNTAXERR); return(-1); } len = cp - argv[1]; # else if (!(cp = gettoken(argv[1])) || *cp) { builtinerror(argv, argv[1], ER_SYNTAXERR); return(-1); } len = strlen(argv[1]); # endif # if FD >= 2 if (*cp) cp++; # else if (argc > 2) cp = argv[2]; # endif else { if ((i = searchalias(argv[1], len)) >= maxalias) { builtinerror(argv, argv[1], ER_NOENTRY); return(-1); } hitkey(2); printalias(i, Xstdout); putnl(); return(0); } if (addalias(Xstrndup(argv[1], len), Xstrdup(cp)) < 0) { builtinerror(argv, NULL, ER_OUTOFLIMIT); return(-1); } return(0); } /*ARGSUSED*/ static int NEAR unalias(argc, argv) int argc; char *CONST argv[]; { if (argc != 2) { builtinerror(argv, NULL, ER_FEWMANYARG); return(-1); } if (deletealias(argv[1]) < 0) { builtinerror(argv, argv[1], ER_NOENTRY); return(-1); } return(0); } int searchfunction(ident) CONST char *ident; { int i; for (i = 0; i < maxuserfunc; i++) if (!strcommcmp(ident, userfunclist[i].func)) break; return(i); } int addfunction(ident, comm) char *ident, **comm; { int i; if ((i = searchfunction(ident)) >= MAXFUNCTABLE) { Xfree(ident); freevar(comm); return(-1); } else if (i < maxuserfunc) { Xfree(userfunclist[i].func); freevar(userfunclist[i].comm); } else maxuserfunc++; userfunclist[i].func = ident; userfunclist[i].comm = comm; # ifdef COMMNOCASE Xstrtolower(ident); # endif # ifdef DEP_PTY sendparent(TE_ADDFUNCTION, ident, comm); # endif return(0); } int deletefunction(ident) CONST char *ident; { int i; if ((i = searchfunction(ident)) >= maxuserfunc) return(-1); Xfree(userfunclist[i].func); freevar(userfunclist[i].comm); memmove((char *)&(userfunclist[i]), (char *)&(userfunclist[i + 1]), (--maxuserfunc - i) * sizeof(*userfunclist)); # ifdef DEP_PTY sendparent(TE_DELETEFUNCTION, ident); # endif return(0); } VOID printfunction(no, verbose, fp) int no, verbose; XFILE *fp; { int i; # if FD < 2 VOID_C Xfprintf(fp, "%s ", BL_FUNCTION); # endif VOID_C Xfprintf(fp, "%k() {", userfunclist[no].func); if (verbose) VOID_C fputnl(fp); for (i = 0; userfunclist[no].comm[i]; i++) { if (verbose) VOID_C Xfprintf(fp, "\t%k;\n", userfunclist[no].comm[i]); else VOID_C Xfprintf(fp, " %k;", userfunclist[no].comm[i]); } VOID_C Xfputs(" }", fp); } static int NEAR checkuserfunc(argc, argv) int argc; char *CONST argv[]; { char *cp; int i, n; n = 0; if (n >= argc) return(-1); if (!(cp = gettoken(argv[n]))) return(-1); if (!*cp) cp = argv[++n]; if (!cp || *cp != '(') return(-1); *(cp++) = '\0'; if (!*cp) cp = argv[++n]; if (!cp || *(cp++) != ')') return(-1); if (!*cp) cp = argv[++n]; if (!cp) return(0); if (*(cp++) != '{' || *cp) return(-2); if (n > 0) { for (i = 1; i <= n; i++) Xfree(argv[i]); memmove((char *)&(argv[1]), (char *)&(argv[n + 1]), (argc -= n) * sizeof(*argv)); } return(argc); } static int NEAR setuserfunc(argc, argv) int argc; char *CONST argv[]; { char *cp, *tmp, *line, **var, *list[MAXFUNCLINES + 1]; int i, j, n; if (argc <= 1) { # if FD >= 2 builtinerror(argv, NULL, ER_SYNTAXERR); return(-1); # else /* FD < 2 */ hitkey(2); for (i = 0; i < maxuserfunc; i++) { printfunction(i, 0, Xstdout); putnl(); hitkey(0); } return(0); # endif /* FD < 2 */ } # if FD < 2 if ((n = checkuserfunc(argc - 1, &(argv[FUNCNAME]))) < 0) { builtinerror(argv, argv[FUNCNAME], ER_SYNTAXERR); return(-1); } # endif # if FD < 2 if (!n) { if ((i = searchfunction(argv[FUNCNAME])) >= maxuserfunc) { builtinerror(argv, argv[FUNCNAME], ER_NOENTRY); return(-1); } hitkey(2); printfunction(i, 1, Xstdout); putnl(); return(0); } # endif /* FD < 2 */ cp = line = catvar(&(argv[FUNCNAME + 1]), ' '); for (n = 0; n < MAXFUNCLINES && *cp; n++) { if (!(tmp = strtkchr(cp, ';', 0))) break; *(tmp++) = '\0'; list[n] = Xstrdup(cp); cp = skipspace(tmp); } if (!(tmp = strtkchr(cp, '}', 0)) || *(tmp + 1)) { builtinerror(argv, line, ER_SYNTAXERR); for (j = 0; j < n; j++) Xfree(list[j]); Xfree(line); return(-1); } if (tmp > cp) { *tmp = '\0'; list[n++] = Xstrdup(cp); } else if (!n) { Xfree(line); if (deletefunction(argv[FUNCNAME]) < 0) { builtinerror(argv, argv[FUNCNAME], ER_NOENTRY); return(-1); } return(0); } Xfree(line); var = (char **)Xmalloc((n + 1) * sizeof(*var)); for (i = 0; i < n; i++) var[i] = list[i]; var[i] = NULL; if (addfunction(Xstrdup(argv[FUNCNAME]), var) < 0) { builtinerror(argv, NULL, ER_OUTOFLIMIT); return(-1); } return(0); } static int NEAR exportenv(argc, argv) int argc; char *CONST argv[]; { char *cp; int i; if (argc <= 1) { builtinerror(argv, NULL, ER_FEWMANYARG); return(-1); } i = argc - 1; if ((cp = getenvval(&i, &(argv[1]))) == vnullstr) { builtinerror(argv, argv[1], ER_SYNTAXERR); return(-1); } if (i + 1 < argc) { builtinerror(argv, NULL, ER_FEWMANYARG); return(-1); } setenv2(argv[1], cp, 1); Xfree(cp); adjustpath(); return(0); } static int NEAR dochdir(argc, argv) int argc; char *CONST argv[]; { if (argc != 2) { builtinerror(argv, NULL, ER_FEWMANYARG); return(-1); } if (chdir4(argv[1], 0, NULL) < 0) { builtinerror(argv, argv[1], -1); return(-1); } return(0); } static int NEAR loadsource(argc, argv) int argc; char *CONST argv[]; { int n; if (argc != 2) { builtinerror(argv, NULL, ER_FEWMANYARG); return(-1); } ttyiomode(1); n = loadruncom(argv[1], 1); stdiomode(); if (n < 0) { builtinerror(argv, argv[1], ER_SYNTAXERR); return(-1); } return(0); } #endif /* !DEP_ORIGSHELL */ CONST builtintable *getbuiltin(ident) CONST char *ident; { int i; for (i = 0; i < BUILTINSIZ; i++) if (!strcommcmp(ident, builtinlist[i].ident)) return(&(builtinlist[i])); return(NULL); } CONST functable *getinternal(ident) CONST char *ident; { int i; for (i = 0; i < FUNCLISTSIZ; i++) if (!strcommcmp(ident, funclist[i].ident)) return(&(funclist[i])); return(NULL); } int execbuiltin(built, argc, argv) CONST builtintable *built; int argc; char *CONST argv[]; { return(((*(built -> func))(argc, argv) < 0) ? RET_NOTICE : RET_SUCCESS); } int execinternal(func, argc, argv) CONST functable *func; int argc; char *CONST argv[]; { int n; if (dumbterm > 1) { builtinerror(argv, NULL, ER_NOTDUMBTERM); return(-1); } if (argc > 2 || !filelist) { VOID_C Xfprintf(Xstderr, "%s: %K\n", argv[0], ILFNC_K); return(RET_NOTICE); } for (n = 0; n < FUNCLISTSIZ; n++) if (func == &(funclist[n])) break; #ifdef DEP_PTY if (parentfd >= 0) { sendparent(TE_INTERNAL, n, argv[1]); return(RET_SUCCESS); } #endif ttyiomode(0); n = dointernal(n, argv[1], ICM_CMDLINE, NULL); locate(0, n_line - 1); stdiomode(); if (n == FNC_FAIL) return(RET_FAIL); return(RET_SUCCESS); } #ifndef DEP_ORIGSHELL int execpseudoshell(command, flags) CONST char *command; int flags; { CONST builtintable *built; CONST functable *func; char *cp, **argv; int i, n, argc, wastty; n = -1; command = skipspace(command); internal_status = FNC_FAIL; if (!(argc = getargs(command, &argv))) { freevar(argv); return(-1); } # ifdef DEP_FILECONV if (!(flags & F_NOKANJICONV)) printf_defkanji++; # endif if ((built = getbuiltin(argv[0]))) { if (!(flags & F_NOCOMLINE)) { locate(0, n_line - 1); tflush(); } hitkey((flags & F_NOCOMLINE) ? -1 : 1); if ((wastty = isttyiomode)) stdiomode(); n = execbuiltin(built, argc, argv); if (wastty) ttyiomode(wastty - 1); if (n == RET_SUCCESS) hitkey(3); else if (!(flags & F_NOCOMLINE)) { hideclock = 1; warning(0, ILFNC_K); } } else if (!(flags & F_IGNORELIST) && (func = getinternal(argv[0])) >= 0) { if (!(flags & F_NOCOMLINE)) { locate(0, n_line - 1); tflush(); } if ((wastty = isttyiomode)) stdiomode(); n = execinternal(func, argc, argv); if (wastty) ttyiomode(wastty - 1); if (n == RET_SUCCESS) /*EMPTY*/; else if (!(flags & F_NOCOMLINE)) { hideclock = 1; warning(0, ILFNC_K); } } # if FD >= 2 else if ((i = checkuserfunc(argc, argv)) != -1) { if (!(flags & F_NOCOMLINE)) { locate(0, n_line - 1); tflush(); } if ((wastty = isttyiomode)) stdiomode(); n = setuserfunc(i, argv); n = (n < 0) ? RET_NOTICE : RET_SUCCESS; if (wastty) ttyiomode(wastty - 1); if (n == RET_SUCCESS); else if (!(flags & F_NOCOMLINE)) { hideclock = 1; warning(0, ILFNC_K); } } # endif else if (isidentchar(*command)) { i = argc; if ((cp = getenvval(&i, argv)) != vnullstr && i == argc) { if (setenv2(argv[0], cp, 0) < 0) error(argv[0]); Xfree(cp); n = RET_SUCCESS; } } # ifdef DEP_FILECONV if (!(flags & F_NOKANJICONV)) printf_defkanji--; # endif freevar(argv); return(n); } #endif /* !DEP_ORIGSHELL */ #ifndef _NOCOMPLETE int completebuiltin(com, len, argc, argvp) CONST char *com; int len, argc; char ***argvp; { int i; for (i = 0; i < BUILTINSIZ; i++) { if (strncommcmp(com, builtinlist[i].ident, len)) continue; argc = addcompletion(builtinlist[i].ident, NULL, argc, argvp); } return(argc); } int completeinternal(com, len, argc, argvp) CONST char *com; int len, argc; char ***argvp; { int i; for (i = 0; i < FUNCLISTSIZ; i++) { if (strncommcmp(com, funclist[i].ident, len)) continue; argc = addcompletion(funclist[i].ident, NULL, argc, argvp); } return(argc); } #endif /* !_NOCOMPLETE */ #ifdef DEBUG VOID freedefine(VOID_A) { # ifndef DEP_ORIGSHELL int i, j; # endif freestrarray(macrolist, maxmacro); freestrarray(helpindex, MAXHELPINDEX); # ifdef DEP_DYNAMICLIST Xfree(macrolist); Xfree(helpindex); Xfree(bindlist); # endif # ifndef _NOARCHIVE freelaunchlist(launchlist, maxlaunch); freearchlist(archivelist, maxarchive); # ifdef DEP_DYNAMICLIST Xfree(launchlist); Xfree(archivelist); # endif # endif /* !_NOARCHIVE */ # ifdef DEP_DOSEMU freedosdrive(fdtype, maxfdtype); # ifdef DEP_DYNAMICLIST Xfree(fdtype); # endif # endif /* DEP_DOSEMU */ # ifndef DEP_ORIGSHELL for (i = 0; i < maxalias; i++) { Xfree(aliaslist[i].alias); Xfree(aliaslist[i].comm); } for (i = 0; i < maxuserfunc; i++) { Xfree(userfunclist[i].func); for (j = 0; userfunclist[i].comm[j]; j++) Xfree(userfunclist[i].comm[j]); Xfree(userfunclist[i].comm); } # endif /* !DEP_ORIGSHELL */ } #endif /* DEBUG */ FD-3.01j/shell.c100644 2105 1751 113176 13516612560 12205 0ustar shiraiuser/* * shell.c * * shell command module */ #include "fd.h" #include "realpath.h" #include "parse.h" #include "kconv.h" #include "func.h" #include "kanji.h" #include "system.h" #include "termemu.h" typedef struct _localetable { CONST char *env; CONST char *val; char *org; } localetable; #define HISTTYPES 2 #if 0 #define MACROMETA ((char)-1) #endif #ifdef ARG_MAX #define MAXARGNUM ARG_MAX #else /* !ARG_MAX */ # ifdef NCARGS # define MAXARGNUM NCARGS # else # define MAXARGNUM (20 * 1024) # endif #endif /* !ARG_MAX */ #if defined (_NOEXTRAMACRO) && !defined (MAXCOMMSTR) #define MAXCOMMSTR 1023 #endif #ifdef DEP_DOSLFN extern char *shortname __P_((CONST char *, char *)); #endif extern int mark; extern off_t marksize; extern char fullpath[]; #ifndef _NOARCHIVE extern char archivedir[]; #endif extern int lcmdline; extern int hideclock; extern int internal_status; static int NEAR checksc __P_((CONST char *, int, CONST char *)); #ifdef DEP_KCONV static int NEAR extconv __P_((char **, int, int, ALLOC_T *, int)); #endif static int NEAR isneedargs __P_((CONST char *, int, int *)); static int NEAR setarg __P_((char **, int, ALLOC_T *, CONST char *, CONST char *, int)); static int NEAR flag2str __P_((char *, int, int)); static int NEAR skipquote __P_((CONST char *, int *)); #if !defined (MACROMETA) || !defined (_NOEXTRAMACRO) static char *NEAR _restorearg __P_((CONST char *)); static char *NEAR _demacroarg __P_((char *)); #endif #ifdef _NOEXTRAMACRO static int NEAR setargs __P_((char **, int, ALLOC_T *, int, int, int, macrostat *, int)); static char *NEAR insertarg __P_((CONST char *, CONST char *, int)); #else static int NEAR _replaceargs __P_((int *, char ***, char *CONST *, int)); #endif static char *NEAR addoption __P_((char *, CONST char *, macrostat *)); #ifndef DEP_ORIGSHELL static int NEAR system3 __P_((CONST char *, int)); static char *NEAR evalargs __P_((CONST char *, int, char *CONST *)); static char *NEAR evalalias __P_((CONST char *)); #else #define system3 system2 #endif static int NEAR newhistory __P_((int)); #ifdef DEP_ORIGSHELL CONST char *promptstr2 = NULL; #else aliastable aliaslist[MAXALIASTABLE]; int maxalias = 0; userfunctable userfunclist[MAXFUNCTABLE]; int maxuserfunc = 0; #endif CONST char *promptstr = NULL; char **history[HISTTYPES]; char *histfile[HISTTYPES]; short histno[HISTTYPES]; short histumask[HISTTYPES]; short histsize[HISTTYPES]; short savehist[HISTTYPES]; int n_args = 0; static short histbufsize[HISTTYPES]; static localetable localelist[] = { {"LC_COLLATE", "C", NULL}, {"LC_CTYPE", "", NULL}, {"LC_MESSAGES", "C", NULL}, {"LC_MONETARY", "C", NULL}, {"LC_NUMERIC", "C", NULL}, {"LC_TIME", "C", NULL}, {"LC_ALL", NULL, NULL}, {"LANG", "C", NULL}, }; #define LOCALELISTSIZ arraysize(localelist) static int NEAR checksc(buf, ptr, arg) CONST char *buf; int ptr; CONST char *arg; { if (!arg || !*arg) /*EMPTY*/; else if (*arg == _SC_ || isdotdir(arg)) /*EMPTY*/; #if MSDOS else if (_dospath(arg)) /*EMPTY*/; #endif else return(ptr); if (buf) { if (ptr < 2) return(ptr); if (buf[ptr - 1] != _SC_ || buf[ptr - 2] != '.') return(ptr); if (ptr > 2 && !Xstrchr(IFS_SET, buf[ptr - 3])) return(ptr); } return(ptr - 2); } #ifdef DEP_KCONV static int NEAR extconv(bufp, ptr, eol, sizep, code) char **bufp; int ptr, eol; ALLOC_T *sizep; int code; { # ifdef DEP_FILECONV char rpath[MAXPATHLEN]; # endif char *cp; int len; # ifdef DEP_FILECONV if (code < 0) { cp = _evalpath(&((*bufp)[ptr]), &((*bufp)[eol]), EA_NOEVALQ | EA_NOUNIQDELIM); VOID_C Xrealpath(cp, rpath, RLP_READLINK); Xfree(cp); code = getkcode(rpath); } # endif (*bufp)[eol] = '\0'; cp = newkanjiconv(&((*bufp)[ptr]), DEFCODE, code, L_FNAME); if (cp == &((*bufp)[ptr])) return(eol); len = strlen(cp); *bufp = c_realloc(*bufp, ptr + len + 1, sizep); memcpy(&((*bufp)[ptr]), cp, len); Xfree(cp); return(ptr + len); } #endif /* DEP_KCONV */ static int NEAR isneedargs(s, n, flagsp) CONST char *s; int n, *flagsp; { int i; i = n; *flagsp = 0; #ifdef MACROMETA if (s[i++] != MACROMETA) return(0); *flagsp = (u_char)(s[i++]); #else /* !MACROMETA */ if (s[i++] != '%') return(0); if (s[i] == '%') return(2); if (s[i] == 'X') { i++; *flagsp |= F_NOEXT; } # if MSDOS if (s[i] == 'S') { i++; *flagsp |= F_TOSFN; } # endif if (s[i] == 'M') { i++; *flagsp |= F_MARK; } else if (s[i] == 'T') { i++; *flagsp |= F_BURST; if (s[i] == 'A') { i++; *flagsp |= F_REMAIN; } } else return(0); #endif /* !MACROMETA */ return(i - n); } static int NEAR setarg(bufp, ptr, sizep, dir, arg, flags) char **bufp; int ptr; ALLOC_T *sizep; CONST char *dir, *arg; int flags; { char *cp, *new, path[MAXPATHLEN], conv[MAXPATHLEN]; int len, optr; if (!arg || !*arg) return(checksc(*bufp, ptr, NULL) - ptr); if (!dir) { #ifdef DEP_DOSLFN if ((flags & F_TOSFN) && shortname(arg, path) == path) arg = path; else #endif arg = convput(conv, arg, NULL, CVP_NEEDFILE); } else { strcatdelim2(path, dir, arg); arg = path; #if defined (BSPATHDELIM) && !defined (_NOARCHIVE) if (flags & F_ISARCH) for (len = 0; path[len]; len++) { if (iskanji1(path, len)) len++; if (path[len] == _SC_) path[len] = '/'; } #endif #ifdef DEP_FILECONV arg = kanjiconv2(conv, arg, MAXPATHLEN - 1, DEFCODE, fnamekcode, L_FNAME); #endif } optr = ptr; ptr = checksc(*bufp, ptr, arg); arg = new = killmeta(arg); if ((flags & F_NOEXT) && (cp = Xstrrchr(arg, '.')) && cp != arg) len = cp - arg; else len = strlen(arg); *bufp = c_realloc(*bufp, ptr + len + 1, sizep); memcpy(&((*bufp)[ptr]), arg, len); Xfree(new); return(len + ptr - optr); } static int NEAR flag2str(s, ptr, flags) char *s; int ptr, flags; { s[ptr++] = '%'; if (flags & F_NOEXT) s[ptr++] = 'X'; #if MSDOS if (flags & F_TOSFN) s[ptr++] = 'S'; #endif if (flags & F_MARK) s[ptr++] = 'M'; else if (flags & F_BURST) { s[ptr++] = 'T'; if (flags & F_REMAIN) s[ptr++] = 'A'; } else s[ptr++] = '%'; return(ptr); } static int NEAR skipquote(s, ptrp) CONST char *s; int *ptrp; { static int q = '\0'; int pc; if (!*ptrp) q = '\0'; pc = parsechar(&(s[*ptrp]), -1, '\0', 0, &q, NULL); if (pc == PC_NORMAL) return(0); if (pc == PC_WCHAR || pc == PC_ESCAPE) { (*ptrp)++; return(2); } return(1); } #if !defined (MACROMETA) || !defined (_NOEXTRAMACRO) static char *NEAR _restorearg(s) CONST char *s; { char *buf; int i, j, m, flags; if (!s) return(NULL); i = strlen(s); # ifdef MACROMETA buf = Xmalloc(i * 3 + 1); /* MACROMETA+flags -> %XSTA (x2.5) */ # else buf = Xmalloc(i + 1); # endif flags = 0; for (i = j = 0; s[i]; i++) { # ifdef MACROMETA if (!(m = isneedargs(s, i, &flags))) buf[j++] = s[i]; else { i += m - 1; j = flag2str(buf, j, flags); } # else if ((m = skipquote(s, &i)) == 2) buf[j++] = s[i - 1]; else if (!m && s[i] == '%' && s[i + 1] == '%') { i++; flags++; } buf[j++] = s[i]; # endif } if (!flags) { Xfree(buf); return((char *)s); } buf[j] = '\0'; return(buf); } static char *NEAR _demacroarg(s) char *s; { char *cp; if ((cp = _restorearg(s)) != s) Xfree(s); return(cp); } #endif /* !MACROMETA || !_NOEXTRAMACRO */ #ifdef _NOEXTRAMACRO /*ARGSUSED*/ static int NEAR setargs(bufp, ptr, sizep, blen, mlen, eol, stp, flags) char **bufp; int ptr; ALLOC_T *sizep; int blen, mlen, eol; macrostat *stp; int flags; { char *cp, *s, *dir, *tmp; int i, n, m, f, len, flen, rlen, optr; # ifdef _NOARCHIVE dir = NULL; # else dir = (archivefile) ? archivedir : NULL; # endif len = eol - ptr; tmp = Xstrndup(&((*bufp)[ptr]), len); tmp[len] = '\0'; cp = &(tmp[blen + mlen]); for (s = cp; *s; s++) { if (Xstrchr(CMDLINE_DELIM, *s)) break; if (iskanji1(s, 0)) s++; } flen = s - cp; rlen = len - (s - tmp); ptr += blen; if (!n_args) { len = setarg(bufp, ptr, sizep, dir, filelist[filepos].name, flags); ptr += len; if (ptr + flen > MAXCOMMSTR) { Xfree(tmp); return(-1); } *bufp = c_realloc(*bufp, ptr + flen + 1, sizep); memcpy(&((*bufp)[ptr]), cp, flen); ptr += flen; } else for (i = n = 0; i < maxfile; i++) { if (!isarg(&(filelist[i]))) continue; optr = ptr; if (n) { if (ptr + blen + 1 > MAXCOMMSTR) break; *bufp = c_realloc(*bufp, ptr + blen + 1 + 1, sizep); (*bufp)[ptr++] = ' '; memcpy(&((*bufp)[ptr]), tmp, blen); ptr += blen; } len = setarg(bufp, ptr, sizep, dir, filelist[i].name, flags); ptr += len; if (ptr + flen > MAXCOMMSTR) { if (!n) { Xfree(tmp); return(-1); } ptr = optr; break; } *bufp = c_realloc(*bufp, ptr + flen + 1, sizep); memcpy(&((*bufp)[ptr]), cp, flen); ptr += flen; filelist[i].tmpflags &= ~F_ISARG; n_args--; n++; } if (ptr + rlen > MAXCOMMSTR) { cp = &(s[MAXCOMMSTR - ptr]); len = rlen - (MAXCOMMSTR - ptr); for (i = 0; i < len; i++) { # ifndef MACROMETA if (skipquote(cp, &i)) continue; # endif if ((m = isneedargs(cp, i, &f))) { if (f & F_MARK) (stp -> needmark)--; i += m - 1; } } rlen = MAXCOMMSTR - ptr; } *bufp = c_realloc(*bufp, ptr + rlen + 1, sizep); memcpy(&((*bufp)[ptr]), s, rlen); ptr += rlen; Xfree(tmp); return(ptr - eol); } static char *NEAR insertarg(format, arg, needmark) CONST char *format, *arg; int needmark; { # ifdef DEP_DOSLFN CONST char *org; char alias[MAXPATHLEN]; # endif CONST char *src, *ins; char *cp, *new, *buf, conv[MAXPATHLEN]; ALLOC_T size; int i, j, m, len, flags; # ifdef DEP_DOSLFN org = arg; alias[0] = '\0'; # endif arg = convput(conv, arg, NULL, CVP_NEEDFILE); # ifdef FAKEUNINIT m = 0; /* fake for -Wuninitialized */ # endif for (j = 0; format[j]; j++) { # ifndef MACROMETA if (skipquote(format, &j)) continue; # endif if ((m = isneedargs(format, j, &flags))) { if (flags & F_MARK) break; j += m - 1; } } if (!(format[j])) return(Xstrdup(format)); buf = c_realloc(NULL, 0, &size); if (j > MAXCOMMSTR) i = j = 0; else { buf = c_realloc(buf, j + 1, &size); memcpy(buf, format, j); src = &(format[j + m]); for (i = 0; i < needmark; i++) { ins = arg; # ifdef DEP_DOSLFN if (flags & F_TOSFN) { if (!alias[0]) { if (shortname(org, alias) == alias) org = alias; else Xstrcpy(alias, org); } ins = alias; } # endif j = checksc(buf, j, ins); ins = new = killmeta(ins); if ((flags & F_NOEXT) && (cp = Xstrrchr(ins, '.'))) len = cp - ins; else len = strlen(ins); if (j + len > MAXCOMMSTR) break; buf = c_realloc(buf, j + len + 1, &size); Xstrncpy(&(buf[j]), ins, len); Xfree(new); j += len; for (len = 0; src[len]; len++) { # ifndef MACROMETA if (skipquote(src, &len)) continue; # endif if ((m = isneedargs(src, len, &flags))) { if (flags & F_MARK) break; len += m - 1; } } if (j + len > MAXCOMMSTR) break; buf = c_realloc(buf, j + len + 1, &size); memcpy(&(buf[j]), src, len); j += len; src += len + m; } } buf[j] = '\0'; if (i < needmark) { Xfree(buf); return(NULL); } return(buf); } #endif /* _NOEXTRAMACRO */ char *evalcommand(command, arg, stp) CONST char *command, *arg; macrostat *stp; { #ifdef DEP_KCONV int code, cnvcode, defcode, cnvptr; #endif #ifdef _NOEXTRAMACRO int m, f; #endif macrostat st; char *cp, *line, *new, conv[MAXPATHLEN]; ALLOC_T size; int i, j, c, pc, len, setflag, flags; if (stp) flags = stp -> flags; else { stp = &st; flags = 0; } stp -> addopt = -1; stp -> needmark = stp -> needburst = 0; #ifdef DEP_KCONV # ifdef DEP_FILECONV cnvcode = defcode = (flags & F_NOKANJICONV) ? NOCNV : defaultkcode; # else cnvcode = defcode = NOCNV; # endif cnvptr = 0; #endif /* DEP_KCONV */ line = c_realloc(NULL, 0, &size); for (i = j = 0; command[i]; i++) { line = c_realloc(line, j + 1, &size); c = '\0'; if ((pc = skipquote(command, &i)) == 1) /*EMPTY*/; else if (pc) line[j++] = command[i - 1]; else if (command[i] == '%') c = command[++i]; else if (flags & (F_NOEXT | F_TOSFN)) c = command[i]; if (!c) { line[j++] = command[i]; continue; } #ifdef DEP_KCONV if (cnvcode != NOCNV) j = extconv(&line, cnvptr, j, &size, cnvcode); #endif len = setflag = 0; switch (c) { case 'P': len = setarg(&line, j, &size, NULL, fullpath, flags); break; #if MSDOS case 'S': flags |= F_TOSFN; c = command[i + 1]; if (c == 'T' || c == 'M') { setflag++; break; } /*FALLTHRU*/ #endif case 'C': len = setarg(&line, j, &size, NULL, arg, flags); flags |= F_ARGSET; break; case 'X': flags |= F_NOEXT; c = command[i + 1]; #if MSDOS if (c == 'T' || c == 'M' || c == 'S') { #else if (c == 'T' || c == 'M') { #endif setflag++; break; } len = setarg(&line, j, &size, NULL, arg, flags); flags |= F_ARGSET; break; case 'T': c = command[i + 1]; if (c == 'A') { flags |= F_REMAIN; i++; } if (!(flags & F_IGNORELIST)) { #ifdef MACROMETA line[j++] = MACROMETA; line[j++] = flags | F_BURST; #else j = flag2str(line, j, flags | F_BURST); #endif (stp -> needburst)++; flags |= F_ARGSET; } break; case 'M': if (!(flags & F_IGNORELIST)) { #ifdef MACROMETA line[j++] = MACROMETA; line[j++] = flags | F_MARK; #else j = flag2str(line, j, flags | F_MARK); #endif (stp -> needmark)++; flags |= F_ARGSET; } break; case 'N': flags |= F_ARGSET; break; case 'R': stp -> addopt = j; break; case 'K': if (!(flags & F_ISARCH)) flags ^= F_NOCONFIRM; break; #ifdef DEP_KCONV case 'J': c = command[i + 1]; if (c == 'S') code = SJIS; else if (c == 'E') code = EUC; # if FD < 2 else if (c == 'J') code = JIS7; # else /* FD >= 2 */ else if (c == '7') code = JIS7; else if (c == '8') code = JIS8; else if (c == 'J') code = JUNET; else if (c == 'H') code = HEX; else if (c == 'C') code = CAP; else if (c == 'U') code = UTF8; else if (c == 'M') code = M_UTF8; else if (c == 'I') code = I_UTF8; # ifdef DEP_FILECONV else if (c == 'A') code = -1; # endif # endif /* FD >= 2 */ else { line[j++] = command[i]; break; } i++; cnvcode = (cnvcode == code) ? defcode : code; break; #endif /* DEP_KCONV */ case '%': #ifndef MACROMETA line[j++] = '%'; #endif line[j++] = c; break; default: line[j++] = '%'; line[j++] = c; break; } if (!setflag) flags &= ~(F_NOEXT | F_TOSFN); j += len; #ifdef DEP_KCONV cnvptr = j; #endif } #ifdef _NOEXTRAMACRO if (j > MAXCOMMSTR) { if (isttyiomode) warning(E2BIG, command); else { errno = E2BIG; perror2(command); } Xfree(line); return(NULL); } #endif #ifdef DEP_KCONV if (cnvcode != NOCNV) j = extconv(&line, cnvptr, j, &size, cnvcode); #endif #ifdef _NOEXTRAMACRO if (stp -> needburst) for (i = c = 0; i < j; i++) { # ifndef MACROMETA if (skipquote(line, &i)) continue; # endif if (Xstrchr(CMDLINE_DELIM, line[i])) c = -1; else if (c < 0) c = i; if (!(m = isneedargs(line, i, &f))) continue; else if (!(f & F_BURST)) { i += m - 1; continue; } if (stp -> needburst <= 0) { memmove(&(line[i]), &(line[i + m]), j - i - m); j -= m; i--; continue; } (stp -> needburst)--; len = setargs(&line, c, &size, i - c, m, j, stp, f); if (len < 0) { for (i += m; i < j; i++) { # ifndef MACROMETA if (skipquote(line, &i)) continue; # endif if ((m = isneedargs(line, i, &f))) { if (f & F_MARK) (stp -> needmark)--; i += m - 1; } } j = c; break; } j += len; i += len + 1; } #endif /* _NOEXTRAMACRO */ if (!(flags & F_ARGSET) && arg && *arg) { arg = convput(conv, arg, NULL, CVP_NEEDFILE | CVP_READLINK); if (checksc(NULL, 0, arg) < 0) cp = NULL; else { cp = Xmalloc(strlen(arg) + 2 + 1); cp[0] = '.'; cp[1] = _SC_; Xstrcpy(&(cp[2]), arg); arg = cp; } arg = new = killmeta(arg); Xfree(cp); len = strlen(arg); #ifdef _NOEXTRAMACRO if (j + len + 1 > MAXCOMMSTR) /*EMPTY*/; else #endif { line = c_realloc(line, j + len + 1, &size); line[j++] = ' '; Xstrncpy(&(line[j]), arg, len); j += len; } Xfree(new); } if (!(flags & F_IGNORELIST) && !(stp -> needburst) && !(stp -> needmark)) { for (i = 0; i < maxfile; i++) filelist[i].tmpflags &= ~F_ISARG; n_args = 0; } if ((flags & F_REMAIN) && !n_args) flags &= ~F_REMAIN; stp -> flags = flags; cp = Xstrndup(line, j); Xfree(line); return(cp); } #ifdef _NOEXTRAMACRO /*ARGSUSED*/ int replaceargs(argcp, argvp, env, iscomm) int *argcp; char ***argvp, *CONST *env; int iscomm; { return(0); } /*ARGSUSED*/ int replacearg(argp) char **argp; { return(0); } #else /* !_NOEXTRAMACRO */ static int NEAR _replaceargs(argcp, argvp, env, iscomm) int *argcp; char ***argvp, *CONST *env; int iscomm; { static int lastptr = 0; char *cp, *arg, *buf, *dir, **argv, **argv2; ALLOC_T size; int i, j, n, m, argc, argc2, len, min, next, ret, hit, flags; int argmax, arglen; if (!argvp) { if (argcp) *argcp = lastptr; else lastptr = iscomm; return(-1); } argc = *argcp; argv = *argvp; ret = 0; if (!filelist) return(ret); # ifdef _NOARCHIVE dir = NULL; # else dir = (archivefile) ? archivedir : NULL; # endif arglen = 0; for (n = i = 0; n < argc; n++) { for (len = 0; argv[n][len]; len++) { # ifndef MACROMETA if ((m = skipquote(argv[n], &len))) { arglen += m; continue; } # endif if ((m = isneedargs(argv[n], len, &flags))) { if (flags) i++; len += m - 1; } else arglen++; } arglen++; } if (!i) return(ret); # ifdef MAXCOMMSTR argmax = MAXCOMMSTR + 1; # else /* !MAXCOMMSTR */ # if defined (USESYSCONF) && defined (_SC_ARG_MAX) if ((argmax = sysconf(_SC_ARG_MAX)) > 0) argmax -= 2048; else # endif argmax = MAXARGNUM - 2048; # endif /* !MAXCOMMSTR */ if (iscomm > 0 && arglen > argmax) return(seterrno(E2BIG)); argc2 = 0; argv2 = NULL; buf = c_realloc(NULL, 0, &size); min = -1; for (next = lastptr; next < maxfile; next++) if (isarg(&(filelist[next]))) { if (min < 0) min = next; else break; } arg = (min >= 0) ? filelist[min].name : filelist[filepos].name; for (n = 0; n < argc; n++) { hit = 0; for (i = j = 0; argv[n][i]; i++) { # ifndef MACROMETA if ((m = skipquote(argv[n], &i))) { buf = c_realloc(buf, j + m - 1, &size); memcpy(&(buf[j]), &(argv[n][i - m + 1]), m); j += m; continue; } # endif m = isneedargs(argv[n], i, &flags); if (iscomm < 0 && (flags & F_MARK)) flags |= F_BURST; if (!m) { buf = c_realloc(buf, j, &size); buf[j++] = argv[n][i]; } else if (!(flags & F_BURST)) { buf = c_realloc(buf, j + m - 1, &size); memcpy(&(buf[j]), &(argv[n][i]), m); i += m - 1; j += m; } else { hit++; i += m - 1; cp = (iscomm < 0 || n) ? arg : NULL; len = setarg(&buf, j, &size, dir, cp, flags); arglen += len; if (iscomm > 0 && arglen > argmax) { Xfree(buf); freevar(argv2); return(seterrno(E2BIG)); } j += len; } } buf[j++] = '\0'; argv2 = (char **)Xrealloc(argv2, (argc2 + 2) * sizeof(char *)); argv2[argc2++] = Xstrdup(buf); argv2[argc2] = NULL; if (min < 0 || !hit || (iscomm >= 0 && !n)) continue; while (next < maxfile) { arg = filelist[next].name; for (i = j = 0; argv[n][i]; i++) { # ifndef MACROMETA if ((m = skipquote(argv[n], &i))) { buf = c_realloc(buf, j + m - 1, &size); memcpy(&(buf[j]), &(argv[n][i - m + 1]), m); j += m; continue; } # endif m = isneedargs(argv[n], i, &flags); if (iscomm < 0 && (flags & F_MARK)) flags |= F_BURST; if (!m) { buf = c_realloc(buf, j, &size); buf[j++] = argv[n][i]; } else if (!(flags & F_BURST)) { buf = c_realloc(buf, j + m - 1, &size); memcpy(&(buf[j]), &(argv[n][i]), m); i += m - 1; j += m; } else { i += m - 1; len = setarg(&buf, j, &size, dir, arg, flags); arglen += len; if (iscomm > 0 && arglen > argmax) break; j += len; } } if (argv[n][i]) { if (flags & F_REMAIN) ret++; break; } buf[j++] = '\0'; argv2 = (char **)Xrealloc(argv2, (argc2 + 2) * sizeof(char *)); argv2[argc2++] = Xstrdup(buf); argv2[argc2] = NULL; for (next++; next < maxfile; next++) if (isarg(&(filelist[next]))) break; } } if (ret) lastptr = next; freevar(argv); *argcp = argc = argc2; *argvp = argv = argv2; if (iscomm < 0) { Xfree(buf); return(ret); } min = -1; for (next = lastptr; next < maxfile; next++) { if (!isarg(&(filelist[next]))) continue; if (min >= 0) break; min = next; } arg = (min >= 0) ? filelist[min].name : filelist[filepos].name; hit = 0; for (n = 0; n < argc; n++) { for (i = j = 0; argv[n][i]; i++) { # ifndef MACROMETA if ((m = skipquote(argv[n], &i))) { buf = c_realloc(buf, j + m - 1, &size); memcpy(&(buf[j]), &(argv[n][i - m + 1]), m); j += m; continue; } # endif if (!(m = isneedargs(argv[n], i, &flags))) { buf = c_realloc(buf, j, &size); buf[j++] = argv[n][i]; } else if (!(flags & F_MARK)) { buf = c_realloc(buf, j + m - 1, &size); memcpy(&(buf[j]), &(argv[n][i]), m); i += m - 1; j += m; } else { hit++; i += m - 1; cp = (!env || n) ? arg : NULL; if (min >= 0 && next < maxfile) ret++; len = setarg(&buf, j, &size, NULL, cp, flags); arglen += len; if (iscomm > 0 && arglen > argmax) { Xfree(buf); freevar(argv); return(seterrno(E2BIG)); } j += len; } } buf[j++] = '\0'; Xfree(argv[n]); argv[n] = Xstrdup(buf); } if (hit) lastptr = next; Xfree(buf); return(ret); } int replaceargs(argcp, argvp, env, iscomm) int *argcp; char ***argvp, *CONST *env; int iscomm; { # ifndef MACROMETA int n, ret; # endif # ifdef MACROMETA return(_replaceargs(argcp, argvp, env, iscomm)); # else if ((ret = _replaceargs(argcp, argvp, env, iscomm)) < 0) return(-1); for (n = 0; n < *argcp; n++) (*argvp)[n] = _demacroarg((*argvp)[n]); return(ret); # endif } int replacearg(argp) char **argp; { char **argv; int n, argc; argv = (char **)Xmalloc(2 * sizeof(char *)); argv[0] = *argp; argv[1] = NULL; argc = 1; n = replaceargs(&argc, &argv, NULL, 0); *argp = argv[0]; Xfree(argv); return(n); } #endif /* !_NOEXTRAMACRO */ char *restorearg(s) CONST char *s; { #if defined (MACROMETA) && !defined (_NOEXTRAMACRO) return(_restorearg(s)); #else return((char *)s); #endif } /*ARGSUSED*/ VOID demacroarg(argp) char **argp; { #if defined (MACROMETA) && !defined (_NOEXTRAMACRO) *argp = _demacroarg(*argp); #endif } char *inputshellstr(prompt, ptr, def) CONST char *prompt; int ptr; CONST char *def; { CONST char *duppromptstr; char *cp, *tmp; int wastty; duppromptstr = promptstr; if (prompt) promptstr = prompt; cp = inputstr(NULL, 0, ptr, def, HST_COMM); promptstr = duppromptstr; if (!cp) return(vnullstr); if ((wastty = isttyiomode)) Xstdiomode(); tmp = evalhistory(cp); if (wastty) Xttyiomode(wastty - 1); if (!tmp) { Xfree(cp); return(NULL); } VOID_C entryhist(tmp, HST_COMM); return(tmp); } char *inputshellloop(ptr, def) int ptr; CONST char *def; { #ifdef DEP_ORIGSHELL syntaxtree *trp, *stree; char *buf; int l, len; #endif char *cp; cp = inputshellstr(NULL, ptr, def); if (cp == vnullstr) return(NULL); else if (!cp) { hideclock = 1; warning(0, HITKY_K); rewritefile(1); return(NULL); } #ifdef DEP_ORIGSHELL l = -1; len = strlen(cp); buf = Xmalloc(len + 1); Xstrcpy(buf, cp); trp = stree = newstree(NULL); for (;;) { if (cp) { trp = analyze(cp, trp, 1); Xfree(cp); if (!trp || !(trp -> cont)) break; } lcmdline = -1; hideclock = 1; cp = inputshellstr(promptstr2, -1, NULL); if (cp == vnullstr) break; else if (!cp) continue; l = strlen(cp); buf = Xrealloc(buf, len + l + 1 + 1); buf[len++] = '\n'; Xstrcpy(&(buf[len]), cp); len += l; } freestree(stree); Xfree(stree); cp = buf; if (l >= 0) rewritefile(1); #endif /* DEP_ORIGSHELL */ return(cp); } static char *NEAR addoption(command, arg, stp) char *command; CONST char *arg; macrostat *stp; { char *cp; int p, wastty; #ifdef MACROMETA char *line; ALLOC_T size; int i, j, pc, m, nb, nm, flags; nb = stp -> needburst; nm = stp -> needmark; p = -1; line = c_realloc(NULL, 0, &size); for (i = j = 0; command[i]; i++) { if (i >= stp -> addopt && p < 0) p = j; m = flags = 0; line = c_realloc(line, j + 1, &size); if ((pc = skipquote(command, &i)) == 1); else if (pc) line[j++] = command[i - 1]; else if (command[i] == '%') line[j++] = command[i]; else if ((m = isneedargs(command, i, &flags))) { if (flags & F_BURST) { if (nb > 0) nb--; else flags = 0; } else if (flags & F_MARK) { if (nm > 0) nm--; else flags = 0; } } if (!flags) { if (!m) line[j++] = command[i]; else { line = c_realloc(line, j + m - 1, &size); memcpy(&(line[j]), &(command[i]), m); i += m - 1; j += m; } continue; } i += m - 1; line = c_realloc(line, j + 4, &size); j = flag2str(line, j, flags); } line[j] = '\0'; Xfree(command); if (p < 0) p = strlen(line); command = line; #else /* MACROMETA */ p = stp -> addopt; #endif /* MACROMETA */ if (!(wastty = isttyiomode)) Xttyiomode(1); cp = inputstr(nullstr, 0, p, command, HST_COMM); if (!wastty) Xstdiomode(); Xfree(command); if (!cp) { if (!wastty) putnl(); return(NULL); } if (!*cp) { Xfree(cp); return(NULL); } command = evalcommand(cp, arg, stp); Xfree(cp); if (!command) return(NULL); if (!*command) { Xfree(command); return(NULL); } return(command); } #ifndef DEP_ORIGSHELL static int NEAR system3(command, flags) CONST char *command; int flags; { char *cp, *tmp; int n, ret; command = skipspace(command); if ((cp = evalalias(command))) command = cp; n = sigvecset(0); if ((ret = execpseudoshell(command, flags)) < 0) { tmp = evalcomstr(command, CMDLINE_DELIM); ret = system2(tmp, flags); Xfree(tmp); } sigvecset(n); Xfree(cp); return(ret); } #endif /* !DEP_ORIGSHELL */ int isinternalcomm(command) CONST char *command; { #ifdef DEP_ORIGSHELL syntaxtree *stree; char **subst; int i, *len; #endif char **argv; int ret; ret = 1; #ifdef DEP_ORIGSHELL stree = newstree(NULL); if (analyze(command, stree, 1)) { if ((argv = getsimpleargv(stree))) { i = (stree -> comm) -> argc; (stree -> comm) -> argc = getsubst(i, argv, &subst, &len); stripquote(argv[0], EA_STRIPQ); if (argv[0] && !getinternal(argv[0])) ret = 0; freevar(subst); Xfree(len); } } freestree(stree); Xfree(stree); #else /* !DEP_ORIGSHELL */ if (getargs(command, &argv) > 0 && !getinternal(argv[0])) ret = 0; freevar(argv); #endif /* !DEP_ORIGSHELL */ return(ret); } int execmacro(command, arg, flags) CONST char *command, *arg; int flags; { #ifdef _NOEXTRAMACRO char *buf; int r, status; #endif static CONST char *duparg = NULL; macrostat st; char *tmp; int i, haslist, ret; if (arg) duparg = arg; haslist = (filelist && !(flags & F_IGNORELIST)); ret = 0; internal_status = FNC_FAIL; if (!haslist || !mark) n_args = 0; else { for (i = 0; i < maxfile; i++) { if (ismark(&(filelist[i]))) filelist[i].tmpflags |= F_ISARG; else filelist[i].tmpflags &= ~F_ISARG; } n_args = mark; } st.flags = flags; if (isinternalcomm(command)) st.flags |= F_ARGSET; if (!(tmp = evalcommand(command, duparg, &st))) { if (arg) duparg = NULL; return(-1); } st.flags |= F_ARGSET; while (st.addopt >= 0 && !(st.flags & F_NOADDOPT)) { if (!(tmp = addoption(tmp, duparg, &st))) { if (arg) duparg = NULL; return(-1); } } #ifdef _NOEXTRAMACRO status = internal_status; if (!haslist || !st.needmark) for (;;) { # ifndef MACROMETA tmp = _demacroarg(tmp); # endif r = system3(tmp, st.flags); Xfree(tmp); tmp = NULL; if (!(flags & F_ARGSET)) st.flags &= ~F_ARGSET; if (r > ret && (ret = r) >= 127) break; if (internal_status <= FNC_FAIL) status = FNC_EFFECT; else if (internal_status > status) status = internal_status; if (!(st.flags & F_REMAIN) || !(tmp = evalcommand(command, duparg, &st))) break; while (st.addopt >= 0 && !(st.flags & F_NOADDOPT)) if (!(tmp = addoption(tmp, duparg, &st))) break; } else if (n_args <= 0) { buf = insertarg(tmp, filelist[filepos].name, st.needmark); if (buf) { # ifndef MACROMETA buf = _demacroarg(buf); # endif ret = system3(buf, st.flags); Xfree(buf); status = internal_status; } } else for (i = 0; i < maxfile; i++) if (isarg(&(filelist[i]))) { buf = insertarg(tmp, filelist[i].name, st.needmark); if (buf) { # ifndef MACROMETA buf = _demacroarg(buf); # endif r = system3(buf, st.flags); Xfree(buf); if (r > ret && (ret = r) >= 127) break; if (internal_status <= FNC_FAIL) status = FNC_EFFECT; else if (internal_status > status) status = internal_status; } } internal_status = status; #else /* !_NOEXTRAMACRO */ ret = system3(tmp, st.flags); if (internal_status <= FNC_FAIL) internal_status = FNC_EFFECT; #endif /* !_NOEXTRAMACRO */ Xfree(tmp); if (haslist && internal_status <= FNC_FAIL) { for (i = 0; i < maxfile; i++) filelist[i].tmpflags &= ~(F_ISARG | F_ISMRK); mark = 0; marksize = (off_t)0; } if (arg) duparg = NULL; return(ret); } XFILE *popenmacro(command, arg, flags) CONST char *command, *arg; int flags; { macrostat st; XFILE *fp; char *tmp, *lang; int i; internal_status = FNC_FAIL; st.flags = flags; if (isinternalcomm(command)) st.flags |= F_ARGSET; if (!(tmp = evalcommand(command, arg, &st))) return(NULL); for (i = 0; i < LOCALELISTSIZ; i++) { localelist[i].org = Xstrdup(getenv2(localelist[i].env)); if (!(localelist[i].val) || *(localelist[i].val)) { setenv2(localelist[i].env, localelist[i].val, 1); continue; } lang = getenv2("LC_ALL"); if (!lang || !*lang) lang = getenv2(localelist[i].env); if (!lang || !*lang) lang = getenv2("LANG"); setenv2(localelist[i].env, lang, 1); } fp = popen2(tmp, flags); for (i = 0; i < LOCALELISTSIZ; i++) { setenv2(localelist[i].env, localelist[i].org, 1); Xfree(localelist[i].org); } Xfree(tmp); return(fp); } #ifndef DEP_ORIGSHELL static char *NEAR evalargs(command, argc, argv) CONST char *command; int argc; char *CONST *argv; { char *cp, *line; ALLOC_T size; int i, j, n, len; i = j = 0; line = c_realloc(NULL, 0, &size); while ((cp = strtkchr(&(command[i]), '$', 1))) { len = cp - &(command[i]); line = c_realloc(line, j + len + 2, &size); memcpy(&(line[j]), &(command[i]), len); i += len + 1; j += len; if (!Xisdigit(command[i])) { line[j++] = '$'; line[j++] = command[i++]; } else if ((n = command[i++] - '0') < argc) { len = strlen(argv[n]); line = c_realloc(line, j + len, &size); memcpy(&(line[j]), argv[n], len); j += len; } } len = strlen(&(command[i])); line = c_realloc(line, j + len, &size); memcpy(&(line[j]), &(command[i]), len); j += len; line[j] = '\0'; return(line); } int execusercomm(command, arg, flags) CONST char *command, *arg; int flags; { char *cp, **argv; int i, j, r, ret, status, argc; argc = getargs(command, &argv); i = (argc) ? searchfunction(argv[0]) : maxuserfunc; if (i >= maxuserfunc) ret = execmacro(command, arg, flags); else { ret = 0; status = internal_status = FNC_FAIL; for (j = 0; userfunclist[i].comm[j]; j++) { cp = evalargs(userfunclist[i].comm[j], argc, argv); r = execmacro(cp, arg, flags); Xfree(cp); if (r > ret && (ret = r) >= 127) break; if (internal_status <= FNC_FAIL) status = FNC_EFFECT; else if (internal_status > status) status = internal_status; } internal_status = status; } freevar(argv); return(ret); } static char *NEAR evalalias(command) CONST char *command; { char *cp; int i, len; len = (cp = strpbrk(command, " \t")) ? cp - command : strlen(command); if ((i = searchalias(command, len)) >= maxalias) return(NULL); cp = Xmalloc((int)strlen(command) - len + strlen(aliaslist[i].comm) + 1); Xstrcpy(Xstrcpy(cp, aliaslist[i].comm), &(command[len])); return(cp); } #endif /* !DEP_ORIGSHELL */ static int NEAR newhistory(n) int n; { int i, size; if (n < 0 || n >= HISTTYPES) return(-1); size = (int)histsize[n]; if (size > histbufsize[n]) { i = (history[n]) ? histbufsize[n] + 1 : 0; history[n] = (char **)Xrealloc(history[n], (size + 1) * sizeof(char *)); while (i <= size) history[n][i++] = NULL; histbufsize[n] = size; } return(size); } int entryhist(s, flags) CONST char *s; int flags; { char *new; int i, n, size; if (flags & HST_INIT) { for (n = 0; n < HISTTYPES; n++) { history[n] = NULL; histfile[n] = NULL; histno[n] = histumask[n] = histsize[n] = savehist[n] = histbufsize[n] = (short)0; } return(0); } n = (flags & HST_TYPE); if ((size = newhistory(n)) < 0) return(0); if (!s || !*s) return(0); new = (n == HST_PATH) ? killmeta(s) : Xstrdup(s); if (histno[n]++ >= MAXHISTNO) histno[n] = (short)0; if (flags & HST_UNIQ) { for (i = 0; i <= size; i++) { if (!history[n][i]) continue; #if defined (PATHNOCASE) && defined (DEP_DOSPATH) if (n != HST_PATH) /*EMPTY*/; else if (_dospath(new) != _dospath(history[n][i])) continue; #endif if (!strpathcmp(new, history[n][i])) break; } if (i < size) size = i; } Xfree(history[n][size]); memmove((char *)&(history[n][1]), (char *)&(history[n][0]), size * sizeof(char *)); history[n][0] = new; #ifdef DEP_PTY sendparent(TE_SETHISTORY, s, flags); #endif return(1); } char *removehist(n) int n; { char *tmp; int size; if (n < 0 || n >= HISTTYPES) return(NULL); size = (int)histsize[n]; if (!history[n] || size > histbufsize[n] || size <= 0) return(NULL); if (--histno[n] < (short)0) histno[n] = MAXHISTNO; tmp = history[n][0]; memmove((char *)&(history[n][0]), (char *)&(history[n][1]), size * sizeof(char *)); history[n][size] = NULL; return(tmp); } int loadhistory(n) int n; { lockbuf_t *lck; char *line; int i, size; if (n < 0 || n >= HISTTYPES) return(0); if (!histfile[n] || !*(histfile[n])) return(0); lck = lockfopen(histfile[n], "r", O_BINARY | O_RDONLY, 0); if (!lck || !(lck -> fp)) { lockclose(lck); return(-1); } if ((size = newhistory(n)) < 0) return(0); histno[n] = (short)0; i = -1; Xsetflags(lck -> fp, XF_NULLCONV); while ((line = Xfgets(lck -> fp))) { if (histno[n]++ >= MAXHISTNO) histno[n] = (short)0; if (i < size) i++; else Xfree(history[n][i]); memmove((char *)&(history[n][1]), (char *)&(history[n][0]), i * sizeof(char *)); history[n][0] = line; } lockclose(lck); return(0); } int savehistory(n) int n; { lockbuf_t *lck; int i, size; if (n < 0 || n >= HISTTYPES) return(0); if (!histfile[n] || !*(histfile[n]) || savehist[n] <= 0) return(0); if (!history[n] || !history[n][0]) return(-1); lck = lockfopen(histfile[n], "w", O_BINARY | O_WRONLY | O_CREAT | O_TRUNC, histumask[n]); if (!lck || !(lck -> fp)) { lockclose(lck); return(-1); } Xsetflags(lck -> fp, XF_NULLCONV); size = (savehist[n] > histsize[n]) ? (int)histsize[n] : (int)savehist[n]; for (i = size - 1; i >= 0; i--) { if (!history[n][i] || !*(history[n][i])) continue; if (Xfputs(history[n][i], lck -> fp) == EOF) break; if (Xfputc('\n', lck -> fp) == EOF) break; } lockclose(lck); return((i < 0) ? 0 : -1); } int parsehist(str, ptrp, quote) CONST char *str; int *ptrp, quote; { char *cp; int i, n, pc, ptr, size; ptr = (ptrp) ? *ptrp : 0; size = (int)histsize[0]; if (str[ptr] == '!') n = 0; else if (str[ptr] == '=' || Xstrchr(IFS_SET, str[ptr])) n = ptr = -1; else if ((cp = Xsscanf(&(str[ptr]), "%-d", &n))) { if (!n) n = -1; else if (n < 0) { if ((n = -1 - n) > (int)MAXHISTNO) n = -1; } else if (n - 1 > (int)MAXHISTNO) n = -1; else if (n <= (int)(histno[0])) n = (int)histno[0] - n; else n = MAXHISTNO - (n - (int)histno[0]) + 1; ptr = (cp - str) - 1; } else { for (i = 0; str[ptr + i]; i++) { pc = parsechar(&(str[ptr + i]), -1, '!', EA_FINDDELIM, "e, NULL); if (pc == PC_WCHAR || pc == PC_ESCAPE) i++; else if (pc != PC_NORMAL && pc != PC_DQUOTE) break; } if (!i) n = ptr = -1; else { for (n = 0; n < size; n++) { if (!history[0][n]) break; cp = skipspace(history[0][n]); if (!strnpathcmp(&(str[ptr]), cp, i)) break; } ptr += i - 1; } } if (ptrp) *ptrp = ptr; if (n < 0 || n >= size) return(-1); if (ptrp) { if (!history[0][n]) return(-1); } else { while (!history[0][n]) if (--n < 0) return(-1); } return((int)n); } char *evalhistory(command) char *command; { char *cp; ALLOC_T size; int i, j, n, pc, len, quote, hit; hit = 0; cp = c_realloc(NULL, 0, &size); for (i = j = 0, quote = '\0'; command[i]; i++) { cp = c_realloc(cp, j + 1, &size); pc = parsechar(&(command[i]), -1, '!', 0, "e, NULL); if (pc == PC_WCHAR || pc == PC_ESCAPE) cp[j++] = command[i++]; else if (pc == '!') { len = i++; if ((n = parsehist(command, &i, quote)) < 0) { if (i < 0) { cp[j++] = '!'; i = len; continue; } command[++i] = '\0'; VOID_C Xfprintf(Xstderr, "%k: Event not found.\n", &(command[len])); Xfree(cp); return(NULL); } hit++; len = strlen(history[0][n]); cp = c_realloc(cp, j + len + 1, &size); Xstrncpy(&cp[j], history[0][n], len); j += len; continue; } cp[j++] = command[i]; } cp[j] = '\0'; if (hit) { kanjifputs(cp, Xstderr); VOID_C fputnl(Xstderr); Xfree(command); return(cp); } Xfree(cp); return(command); } #ifdef DEBUG VOID freehistory(n) int n; { int i; if (n < 0 || n >= HISTTYPES) return; if (!history[n] || !history[n][0]) return; for (i = 0; i <= histbufsize[n]; i++) Xfree(history[n][i]); Xfree(history[n]); history[n] = NULL; } #endif #if !defined (_NOCOMPLETE) && !defined (DEP_ORIGSHELL) int completealias(com, len, argc, argvp) CONST char *com; int len, argc; char ***argvp; { int i; for (i = 0; i < maxalias; i++) { if (strncommcmp(com, aliaslist[i].alias, len)) continue; argc = addcompletion(aliaslist[i].alias, NULL, argc, argvp); } return(argc); } int completeuserfunc(com, len, argc, argvp) CONST char *com; int len, argc; char ***argvp; { int i; for (i = 0; i < maxuserfunc; i++) { if (strncommcmp(com, userfunclist[i].func, len)) continue; argc = addcompletion(userfunclist[i].func, NULL, argc, argvp); } return(argc); } #endif /* !_NOCOMPLETE && !DEP_ORIGSHELL */ FD-3.01j/socket.c100644 2105 1751 20234 13516612560 12336 0ustar shiraiuser/* * socket.c * * socket module */ #include "headers.h" #include "depend.h" #include "printf.h" #include "kctype.h" #include "typesize.h" #include "malloc.h" #include "sysemu.h" #include "termio.h" #include "socket.h" #ifdef USEINSYSTMH #include #endif #if !MSDOS #include # ifndef MINIX # include # endif #include #include #endif /* !MSDOS */ #define PROTONAME_TCP "tcp" #ifdef DEP_SOCKET static int NEAR getport __P_((int, struct sockaddr_in *)); static int NEAR getaddr __P_((CONST char *, struct in_addr **)); static int NEAR setsockopt2 __P_((int, int, int, int)); static int NEAR preconnect __P_((int, int)); static int NEAR preaccept __P_((int, struct sockaddr_in *, sock_len_t, int)); # ifdef SO_ERROR static int NEAR checkprogress __P_((int, long)); # endif static int NEAR sureconnect __P_((int, struct sockaddr_in *, int)); static int NEAR getport(port, sinp) int port; struct sockaddr_in *sinp; { if (port < 0 || port > MAXUTYPE(u_short)) return(seterrno(EINVAL)); sinp -> sin_port = htons(port); return(0); } static int NEAR getaddr(s, listp) CONST char *s; struct in_addr **listp; { struct sockaddr_in sin; struct hostent *hp; struct in_addr *new; char *cp, **addr; int n, naddr; if (!s || !*s) return(seterrno(EINVAL)); # ifdef USEINETATON n = (inet_aton(s, &(sin.sin_addr))) ? 0 : -1; # else /* !USEINETATON */ # ifdef USEINETPTON n = (inet_pton(AF_INET, s, &(sin.sin_addr)) > 0) ? 0: -1; # else sin.sin_addr.s_addr = inet_addr(s); n = (sin.sin_addr.s_addr != INADDR_NONE) ? 0 : -1; # endif # endif /* !USEINETATON */ if (n >= 0) { naddr = 1; cp = (char *)&(sin.sin_addr); addr = &cp; } else if (!(hp = gethostbyname(s)) || hp -> h_addrtype != AF_INET) return(seterrno(ENOENT)); else { # ifdef NOHADDRLIST naddr = 1; addr = &(hp -> h_addr); # else for (n = 0; hp -> h_addr_list[n]; n++) /*EMPTY*/; naddr = n; addr = hp -> h_addr_list; # endif } new = (struct in_addr *)Xmalloc(naddr * sizeof(struct in_addr)); for (n = 0; n < naddr; n++) memcpy((char *)&(new[n]), addr[n], sizeof(struct in_addr)); *listp = new; return(n); } int cmpsockaddr(s1, s2) CONST char *s1, *s2; { struct in_addr *addr1, *addr2; int i, j, n, n1, n2; if (!strcmp(s1, s2)) return(0); if ((n1 = getaddr(s1, &addr1)) < 0) return(-1); if ((n2 = getaddr(s2, &addr2)) < 0) return(-1); n = -1; for (i = 0; i < n1; i++) { for (j = 0; j < n2; j++) { n = memcmp((char *)&(addr1[i]), (char *)&(addr2[j]), sizeof(struct in_addr)); if (!n) break; } if (!n) break; } Xfree(addr1); Xfree(addr2); return(n); } int issocket(s) int s; { # if defined (SOL_SOCKET) && defined (SO_TYPE) sock_len_t len; int n; len = sizeof(n); return(getsockopt(s, SOL_SOCKET, SO_TYPE, &n, &len)); # else return(-1); # endif } int getsockinfo(s, buf, size, portp, peer) int s; char *buf; ALLOC_T size; int *portp, peer; { struct sockaddr *sp; struct sockaddr_in sin; sock_len_t len; u_char *cp; int n; len = sizeof(sin); sp = (struct sockaddr *)&sin; n = (peer) ? getpeername(s, sp, &len) : getsockname(s, sp, &len); if (n < 0) return(-1); cp = (u_char *)&(sin.sin_addr.s_addr); n = Xsnprintf(buf, size, "%u.%u.%u.%u", cp[0], cp[1], cp[2], cp[3]); if (n < 0) return(-1); if (portp) *portp = ntohs(sin.sin_port); return(0); } static int NEAR setsockopt2(s, level, name, val) int s, level, name, val; { return(setsockopt(s, level, name, &val, sizeof(val))); } int chgsockopt(s, opt) int s, opt; { # if defined (IPPROTO_IP) && defined (IP_TOS) int tos; # endif int n; n = 0; # if defined (IPPROTO_IP) && defined (IP_TOS) switch (opt & SCK_TOSTYPE) { # ifdef IPTOS_LOWDELAY case SCK_LOWDELAY: tos = IPTOS_LOWDELAY; break; # endif # ifdef IPTOS_THROUGHPUT case SCK_THROUGHPUT: tos = IPTOS_THROUGHPUT; break; # endif # ifdef IPTOS_RELIABILITY case SCK_RELIABILITY: tos = IPTOS_RELIABILITY; break; # endif # ifdef IPTOS_MINCOST case SCK_MINCOST: tos = IPTOS_MINCOST; break; # endif case SCK_NORMAL: tos = 0; break; default: tos = -1; break; } if (tos >= 0) { if (setsockopt2(s, IPPROTO_IP, IP_TOS, tos) < 0) n = -1; } # endif /* IPPROTO_IP && IP_TOS */ # ifdef SOL_SOCKET # ifdef SO_KEEPALIVE if (opt & SCK_KEEPALIVE) { if (setsockopt2(s, SOL_SOCKET, SO_KEEPALIVE, 1) < 0) n = -1; } # endif if (opt & SCK_REUSEADDR) { # ifdef SO_REUSEADDR if (setsockopt2(s, SOL_SOCKET, SO_REUSEADDR, 1) < 0) n = -1; # endif # ifdef SO_REUSEPORT if (setsockopt2(s, SOL_SOCKET, SO_REUSEPORT, 1) < 0) n = -1; # endif } # endif /* SOL_SOCKET */ return(n); } static int NEAR preconnect(s, opt) int s, opt; { int n; closeonexec(s); if (chgsockopt(s, opt) < 0) return(-1); if ((n = fcntl(s, F_GETFL, 0)) < 0) return(-1); if (fcntl(s, F_SETFL, n | O_NONBLOCK) < 0) return(-1); return(n); } static int NEAR preaccept(s, sinp, len, opt) int s; struct sockaddr_in *sinp; sock_len_t len; int opt; { if (chgsockopt(s, opt) < 0) return(-1); if (bind(s, (struct sockaddr *)sinp, len) < 0) return(-1); if (listen(s, SCK_BACKLOG) < 0) return(-1); return(0); } # ifdef SO_ERROR static int NEAR checkprogress(s, usec) int s; long usec; { struct timeval tv; sock_len_t len; int n; tv.tv_sec = 0L; tv.tv_usec = usec; while (tv.tv_usec >= 1000000L) { tv.tv_sec++; tv.tv_usec -= 1000000L; } n = sureselect(1, &s, NULL, &tv, SEL_WRITE | SEL_NOINTR); if (n <= 0) return(n); len = sizeof(n); n = 0; if (getsockopt(s, SOL_SOCKET, SO_ERROR, &n, &len) < 0) return(-1); if (n) { errno = n; return(-1); } return(1); } # endif /* SO_ERROR */ static int NEAR sureconnect(s, sinp, timeout) int s; struct sockaddr_in *sinp; int timeout; { int i, n; n = 0; for (i = 0; timeout <= 0 || i < timeout * 10; i++) { n = connect(s, (struct sockaddr *)sinp, sizeof(struct sockaddr_in)); if (n >= 0) break; # ifdef EAGAIN else if (errno == EAGAIN) continue; # endif # ifdef EALREADY else if (errno == EALREADY) /*EMPTY*/; # endif # ifdef EINPROGRESS else if (errno == EINPROGRESS) /*EMPTY*/; # endif else return(-1); # ifdef SO_ERROR n = checkprogress(s, 1000000L / 10); if (n < 0) return(-1); if (n) break; # endif } if (timeout > 0 && i >= timeout * 10) return(seterrno(ETIMEDOUT)); return(0); } int sockconnect(host, port, timeout, opt) CONST char *host; int port, timeout, opt; { struct sockaddr_in sin; struct in_addr *addr; int i, n, s, naddr; memset((char *)&sin, 0, sizeof(sin)); if (getport(port, &sin) < 0) return(-1); if (!(sin.sin_port)) return(seterrno(EINVAL)); if ((naddr = getaddr(host, &addr)) < 0) return(-1); sin.sin_family = AF_INET; s = -1; opt |= SO_KEEPALIVE; for (i = 0; i < naddr; i++) { if ((s = socket(sin.sin_family, SOCK_STREAM, 0)) < 0) break; if ((n = preconnect(s, opt)) < 0) { safeclose(s); s = -1; break; } memcpy((char *)&(sin.sin_addr.s_addr), (char *)&(addr[i]), sizeof(struct in_addr)); if (sureconnect(s, &sin, timeout) >= 0) { VOID_C fcntl(s, F_SETFL, n & ~O_NONBLOCK); break; } safeclose(s); s = -1; } Xfree(addr); return(s); } int sockbind(host, port, opt) CONST char *host; int port, opt; { struct sockaddr_in sin; struct in_addr *addr; int s; memset((char *)&sin, 0, sizeof(sin)); if (getport(port, &sin) < 0) return(-1); if (host) { if (getaddr(host, &addr) < 0) return(-1); memcpy((char *)&(sin.sin_addr.s_addr), (char *)&(addr[0]), sizeof(struct in_addr)); Xfree(addr); } else sin.sin_addr.s_addr = htonl(INADDR_ANY); sin.sin_family = AF_INET; if ((s = socket(sin.sin_family, SOCK_STREAM, 0)) < 0) return(-1); opt |= SO_KEEPALIVE; if (preaccept(s, &sin, sizeof(sin), opt) < 0) { safeclose(s); return(-1); } return(s); } int sockaccept(s, opt) int s, opt; { struct sockaddr_in sin; sock_len_t len; int fd; len = sizeof(sin); fd = accept(s, (struct sockaddr *)&sin, &len); safeclose(s); if (fd < 0) return(-1); if (chgsockopt(fd, opt) < 0) { safeclose(fd); return(-1); } closeonexec(fd); return(fd); } int socksendoob(s, buf, size) int s; CONST VOID_P buf; ALLOC_T size; { int n; # ifdef NOSENDFLAGS n = seterrno(EIO); # else n = send(s, buf, size, MSG_OOB); if (n >= 0 && (ALLOC_T)n < size) n = seterrno(EIO); # endif return(n); } #endif /* DEP_SOCKET */ FD-3.01j/url.c100644 2105 1751 15716 13516612560 11661 0ustar shiraiuser/* * url.c * * URL parser */ #include "headers.h" #include "depend.h" #include "printf.h" #include "kctype.h" #include "typesize.h" #include "string.h" #include "malloc.h" #include "sysemu.h" #include "pathname.h" #include "url.h" #if defined (DEP_URLPATH) || defined (DEP_SOCKREDIR) static scheme_t schemelist[] = { #define DEFSCHEME(i, p, t) {i, strsize(i), p, t} DEFSCHEME(SCHEME_FTP, 21, TYPE_FTP), DEFSCHEME(SCHEME_HTTP, 80, TYPE_HTTP), {NULL, 0, 0, TYPE_UNKNOWN}, }; static CONST u_char uctypetable[256] = { 0001, 0001, 0001, 0001, 0001, 0001, 0001, 0001, /* 0x00 */ 0001, 0001, 0001, 0001, 0001, 0001, 0001, 0001, 0001, 0001, 0001, 0001, 0001, 0001, 0001, 0001, /* 0x10 */ 0001, 0001, 0001, 0001, 0001, 0001, 0001, 0001, 0001, 0000, 0001, 0040, 0000, 0001, 0000, 0000, /* 0x20 */ 0000, 0000, 0000, 0000, 0000, 0000, 0000, 0030, 0000, 0000, 0000, 0000, 0000, 0000, 0000, 0000, /* 0x30 */ 0000, 0000, 0030, 0040, 0001, 0000, 0001, 0040, 0010, 0000, 0000, 0000, 0000, 0000, 0000, 0000, /* 0x40 */ 0000, 0000, 0000, 0000, 0000, 0000, 0000, 0000, 0000, 0000, 0000, 0000, 0000, 0000, 0000, 0000, /* 0x50 */ 0000, 0000, 0000, 0001, 0001, 0001, 0001, 0000, 0001, 0000, 0000, 0000, 0000, 0000, 0000, 0000, /* 0x60 */ 0000, 0000, 0000, 0000, 0000, 0000, 0000, 0000, 0000, 0000, 0000, 0000, 0000, 0000, 0000, 0000, /* 0x70 */ 0000, 0000, 0000, 0001, 0001, 0001, 0000, 0001, 0001, 0001, 0001, 0001, 0001, 0001, 0001, 0001, /* 0x80 */ 0001, 0001, 0001, 0001, 0001, 0001, 0001, 0001, 0001, 0001, 0001, 0001, 0001, 0001, 0001, 0001, /* 0x90 */ 0001, 0001, 0001, 0001, 0001, 0001, 0001, 0001, 0001, 0001, 0001, 0001, 0001, 0001, 0001, 0001, /* 0xa0 */ 0001, 0001, 0001, 0001, 0001, 0001, 0001, 0001, 0001, 0001, 0001, 0001, 0001, 0001, 0001, 0001, /* 0xb0 */ 0001, 0001, 0001, 0001, 0001, 0001, 0001, 0001, 0001, 0001, 0001, 0001, 0001, 0001, 0001, 0001, /* 0xc0 */ 0001, 0001, 0001, 0001, 0001, 0001, 0001, 0001, 0001, 0001, 0001, 0001, 0001, 0001, 0001, 0001, /* 0xd0 */ 0001, 0001, 0001, 0001, 0001, 0001, 0001, 0001, 0001, 0001, 0001, 0001, 0001, 0001, 0001, 0001, /* 0xe0 */ 0001, 0001, 0001, 0001, 0001, 0001, 0001, 0001, 0001, 0001, 0001, 0001, 0001, 0001, 0001, 0001, /* 0xf0 */ 0001, 0001, 0001, 0001, 0001, 0001, 0001, 0001, }; char *urldecode(s, len) CONST char *s; int len; { char *cp; int i, j, n, c; if (!s) return(NULL); if (len < 0) len = strlen(s); cp = Xmalloc(len + 1); for (i = j = 0; i < len; i++, j++) { if (s[i] == '%') { cp[j] = '\0'; for (n = 1; n <= 2; n++) { c = Xtolower(s[i + n]); if (Xisdigit(c)) c -= '0'; else if (Xisxdigit(c)) c -= 'a' - 10; else break; cp[j] = ((cp[j]) << 4) + c; } if (n >= 2) { i += 2; continue; } } cp[j] = s[i]; } cp[j++] = '\0'; cp = Xrealloc(cp, j); return(cp); } char *urlencode(s, len, mask) CONST char *s; int len, mask; { char *cp; int i, j; if (!s) return(NULL); if (len < 0) len = strlen(s); cp = Xmalloc(len * 3 + 1); for (i = j = 0; i < len; i++, j++) { if (uctypetable[(u_char)(s[i])] & mask) { cp[j++] = '%'; cp[j++] = Xtoupper(tohexa((s[i] >> 4) & 0xf)); cp[j] = Xtoupper(tohexa(s[i] & 0xf)); continue; } cp[j] = s[i]; } cp[j++] = '\0'; cp = Xrealloc(cp, j); return(cp); } int urlparse(s, scheme, hostp, typep, flags) CONST char *s; scheme_t *scheme; char **hostp; int *typep, flags; { CONST char *cp, *path; int i, n; /* * scheme://user:passwd@host:port/path;params?query#fragment * scheme:/path;params?query#fragment */ if (!scheme) scheme = schemelist; if (hostp) *hostp = NULL; if (typep) *typep = TYPE_NONURL; if (!s) return(-1); for (cp = s; *cp; cp++) { if (Xisalnum(*cp)) continue; if (!Xstrchr(SCHEME_SYMBOLCHAR, *cp)) break; } n = cp - s; if (cp <= s || *(cp++) != ':' || *(cp++) != '/') return((flags & UPF_ALLOWNONURL) ? 0 : -1); for (i = 0; scheme[i].ident; i++) { if (n != scheme[i].len) continue; if (!Xstrncasecmp(s, scheme[i].ident, n)) break; } if (scheme[i].ident) { if (typep) *typep = scheme[i].type; } else { if (typep) *typep = TYPE_UNKNOWN; if (!(flags & UPF_ALLOWANYSCHEME)) return(-1); } if (*cp != '/') { if (!(flags & UPF_ALLOWABSPATH)) return(-1); n = --cp - s; } else if ((path = Xstrchr(++cp, _SC_))) { if (path == cp) return(-1); if (hostp) *hostp = Xstrndup(cp, path - cp); n = path - s; } else { if (hostp) *hostp = Xstrdup(cp); n = strlen(s); } return(n); } int urlgetport(type) int type; { int i; for (i = 0; schemelist[i].ident; i++) if (type == schemelist[i].type) break; if (!(schemelist[i].ident)) return(-1); return(schemelist[i].port); } CONST char *urlgetscheme(type) int type; { int i; for (i = 0; schemelist[i].ident; i++) if (type == schemelist[i].type) break; if (!(schemelist[i].ident)) return(NULL); return(schemelist[i].ident); } int isurl(s, flags) CONST char *s; int flags; { int n; n = urlparse(s, NULL, NULL, NULL, flags); return((n > 0) ? n : 0); } VOID urlfreehost(hp) urlhost_t *hp; { if (!hp) return; Xfree(hp -> user); Xfree(hp -> pass); Xfree(hp -> host); hp -> user = hp -> pass = hp -> host = NULL; hp -> port = -1; } int urlgethost(s, hp) CONST char *s; urlhost_t *hp; { CONST char *cp, *host, *user; int i, n, len, hlen, ulen; if (!s) return(0); if ((host = Xstrchr(s, '@'))) { user = s; ulen = host++ - s; } else { ulen = 0; user = NULL; host = s; } n = 0; cp = (user) ? Xmemchr(user, ':', ulen) : NULL; if (!cp) hp -> pass = NULL; else { len = ulen - (cp - user) - 1; ulen = cp - user; if (len <= 0) hp -> pass = NULL; else if (!(hp -> pass = urldecode(++cp, len))) n = -1; } if (!(cp = Xstrchr(host, ':'))) { hlen = strlen(host); hp -> port = -1; } else { hlen = cp++ - host; if (!*cp) hp -> port = -1; else { i = 0; hp -> port = getnum(cp, &i); if (hp -> port < 0 || cp[i]) n = seterrno(EINVAL); } } if (!host || hlen <= 0) hp -> host = NULL; else if (!(hp -> host = urldecode(host, hlen))) n = -1; if (!user || ulen <= 0) hp -> user = NULL; else if (!(hp -> user = urldecode(user, ulen))) n = -1; if (n < 0) { urlfreehost(hp); return(-1); } return(0); } int urlgetpath(s, pp) CONST char *s; urlpath_t *pp; { CONST char *cp; if (!s || *s != _SC_) return(seterrno(EINVAL)); pp -> params = pp -> query = pp -> fragment = NULL; if (!(cp = strpbrk(s, ";?#"))) { pp -> path = Xstrdup(s); pp -> params = pp -> query = pp -> fragment = NULL; return(0); } pp -> path = Xstrndup(s, cp - s); s = &(cp[1]); if (*cp != ';') pp -> params = NULL; else { if (!(cp = strpbrk(s, "?#"))) { pp -> params = Xstrdup(s); pp -> query = pp -> fragment = NULL; return(0); } pp -> params = Xstrndup(s, cp - s); s = &(cp[1]); } if (*cp != '?') pp -> query = NULL; else { if (!(cp = Xstrchr(s, '#'))) { pp -> query = Xstrdup(s); pp -> fragment = NULL; return(0); } pp -> query = Xstrndup(s, cp - s); s = &(cp[1]); } if (*cp != '#') pp -> fragment = NULL; else pp -> fragment = Xstrdup(s); return(0); } #endif /* DEP_URLPATH || DEP_SOCKREDIR */ FD-3.01j/auth.c100644 2105 1751 21336 13516612560 12013 0ustar shiraiuser/* * auth.c * * authentication for FTP/HTTP connections in RFC2617 */ #include "headers.h" #include "depend.h" #include "printf.h" #include "string.h" #include "malloc.h" #include "time.h" #include "pathname.h" #include "encode.h" #include "parse.h" #include "socket.h" #include "auth.h" #include "system.h" #ifdef MINIX #include #endif #ifdef FDSH #include "sysemu.h" #endif #ifdef FD #include "kanji.h" #endif #define REALMSTR "realm" #define NONCESTR "nonce" #define ALGORITHMSTR "algorithm" #define QOPSTR "qop" #define OPAQUESTR "opaque" #define MD5_STRSIZ (MD5_BUFSIZ * 4 * 2) typedef struct _digest_t { char *realm; char *nonce; char *algorithm; char *qop; char *opaque; char *cnonce; } digest_t; #ifdef DEP_URLPATH #ifdef FD extern VOID ttyiomode __P_((int)); extern VOID stdiomode __P_((VOID_A)); extern char *inputstr __P_((CONST char *, int, int, CONST char *, int)); extern char *inputpass __P_((VOID_A)); #endif #ifdef FD extern int isttyiomode; #endif static char **NEAR getdigestfield __P_((CONST char *)); static VOID NEAR getdigestval __P_((char **, CONST char *, CONST char *)); static VOID NEAR freedigest __P_((digest_t *)); static int NEAR genhash __P_((char *, ALLOC_T, CONST char *, ...)); static int NEAR catprintf __P_((char **, int, CONST char *, ...)); static auth_t authlist[AUTHNOFILE]; static int maxauth = 0; char *authgetuser(VOID_A) { #ifdef FD int wastty; #endif char *cp; #ifdef FD if (!(wastty = isttyiomode)) ttyiomode(1); cp = inputstr(USER_K, 1, -1, NULL, -1); if (!wastty) stdiomode(); #else cp = gets2("User: "); #endif if (cp && !*cp) { Xfree(cp); cp = NULL; } return(cp); } char *authgetpass(VOID_A) { char *cp; #ifdef FD cp = inputpass(); #else /* !FD */ # ifdef NOGETPASS errputs("Password:", 0); VOID_C Xfflush(Xstderr); if (!(cp = Xfgets(Xstdin))) cp = Xstrdup(nullstr); # else if (!(cp = getpass("Password:"))) cp = vnullstr; cp = Xstrdup(cp); # endif #endif /* !FD */ return(cp); } int authfind(hp, type, index) urlhost_t *hp; int type, index; { int i; if (index < 0 || index > maxauth) index = maxauth; for (i = index - 1; i >= 0; i--) { if (type != authlist[i].type) continue; if (hp -> port != authlist[i].host.port) continue; if (cmpsockaddr(hp -> host, authlist[i].host.host)) continue; if (!(hp -> user)) hp -> user = Xstrdup(authlist[i].host.user); else if (strcmp(hp -> user, authlist[i].host.user)) continue; Xfree(hp -> pass); hp -> pass = Xstrdup(authlist[i].host.pass); break; } return(i); } VOID authentry(hp, type) urlhost_t *hp; int type; { auth_t tmp; int i; if (!hp || !(hp -> user) || !(hp -> pass)) return; for (i = maxauth - 1; i >= 0; i--) { if (type != authlist[i].type) continue; if (hp -> port != authlist[i].host.port) continue; if (cmpsockaddr(hp -> host, authlist[i].host.host)) continue; if (strcmp(hp -> user, authlist[i].host.user)) continue; if (strcmp(hp -> pass, authlist[i].host.pass)) continue; break; } if (i >= 0) { if (i == maxauth - 1) return; memcpy((char *)&tmp, (char *)&(authlist[i]), sizeof(tmp)); memmove((char *)&(authlist[i]), (char *)&(authlist[i + 1]), (maxauth - i - 1) * sizeof(*authlist)); memcpy((char *)&(authlist[maxauth - 1]), (char *)&tmp, sizeof(tmp)); return; } if (maxauth < AUTHNOFILE) i = maxauth++; else { urlfreehost(&(authlist[0].host)); memmove((char *)&(authlist[0]), (char *)&(authlist[1]), (maxauth - 1) * sizeof(*authlist)); i = maxauth - 1; } authlist[i].host.user = Xstrdup(hp -> user); authlist[i].host.pass = Xstrdup(hp -> pass); authlist[i].host.host = Xstrdup(hp -> host); authlist[i].host.port = hp -> port; authlist[i].type = type; } VOID authfree(VOID_A) { int i; for (i = 0; i < maxauth; i++) urlfreehost(&(authlist[i].host)); maxauth = 0; } static char **NEAR getdigestfield(s) CONST char *s; { CONST char *cp; char **argv; int quote, argc; argv = (char **)Xmalloc(sizeof(*argv)); argc = 0; for (;;) { s = skipspace(s); if (!*s) break; argv = (char **)Xrealloc(argv, (argc + 2) * sizeof(*argv)); quote = '\0'; for (cp = s; *cp; cp++) { if (*cp == quote) quote = '\0'; else if (quote) /*EMPTY*/; else if (*cp == '"') quote = *cp; else if (*cp == ',') break; } argv[argc++] = Xstrndup(s, cp - s); if (*cp) cp++; s = cp; } argv[argc] = NULL; return(argv); } static VOID NEAR getdigestval(valp, s, name) char **valp; CONST char *s, *name; { CONST char *cp; ALLOC_T len; int quote; if (!valp || *valp) return; len = strlen(name); if (Xstrncasecmp(s, name, len)) return; s += len; if (*(s++) != '=') return; quote = (*s == '"') ? *(s++) : '\0'; for (cp = s; *cp; cp++) if (*cp == quote) break; *valp = Xstrndup(s, cp - s); } static VOID NEAR freedigest(dp) digest_t *dp; { int duperrno; if (!dp) return; duperrno = errno; Xfree(dp -> realm); Xfree(dp -> nonce); Xfree(dp -> algorithm); Xfree(dp -> qop); Xfree(dp -> opaque); Xfree(dp -> cnonce); errno = duperrno; } #ifdef USESTDARGH /*VARARGS3*/ static int NEAR genhash(char *buf, ALLOC_T size, CONST char *fmt, ...) #else /*VARARGS3*/ static int NEAR genhash(buf, size, fmt, va_alist) char *buf; ALLOC_T size; CONST char *fmt; va_dcl #endif { va_list args; u_char md5[MD5_BUFSIZ * 4]; char *cp; ALLOC_T ptr, len; int n; VA_START(args, fmt); n = Xvasprintf(&cp, fmt, args); va_end(args); if (n < 0) return(-1); len = sizeof(md5); md5encode(md5, &len, (u_char *)cp, (ALLOC_T)-1); Xfree(cp); cp = buf; *buf = '\0'; for (ptr = (ALLOC_T)0; ptr < len; ptr++) { n = Xsnprintf(cp, size, "%<02x", (int)(md5[ptr])); if (n < 0) break; cp += n; size -= n; } return(0); } #ifdef USESTDARGH /*VARARGS3*/ static int NEAR catprintf(char **sp, int len, CONST char *fmt, ...) #else /*VARARGS3*/ static int NEAR catprintf(sp, len, fmt, va_alist) char **sp; int len; CONST char *fmt; va_dcl #endif { va_list args; char *cp; int n; if (len < 0) return(-1); VA_START(args, fmt); n = Xvasprintf(&cp, fmt, args); va_end(args); if (n < 0) { Xfree(*sp); *sp = NULL; return(-1); } #ifdef CODEEUC n = strlen(cp); #endif *sp = Xrealloc(*sp, len + n + 1); memcpy(&((*sp)[len]), cp, n); len += n; (*sp)[len] = '\0'; Xfree(cp); return(len); } char *authencode(hp, digest, method, path) urlhost_t *hp; CONST char *digest, *method, *path; { static int count = 0; digest_t auth; char *cp, *buf, **argv, res[MD5_STRSIZ + 1]; char a1[MD5_STRSIZ + 1], a2[MD5_STRSIZ + 1], cnonce[MD5_STRSIZ + 1]; ALLOC_T size; int n; if (!digest) { n = Xasprintf(&cp, "%s:%s", hp -> user, hp -> pass); if (n < 0) return(NULL); #ifdef CODEEUC n = strlen(cp); #endif size = ((n - 1) / BASE64_ORGSIZ + 1) * BASE64_ENCSIZ; buf = Xmalloc(strsize(AUTHBASIC) + 1 + size + 1); memcpy(buf, AUTHBASIC, strsize(AUTHBASIC)); buf[strsize(AUTHBASIC)] = ' '; n = base64encode(&(buf[strsize(AUTHBASIC) + 1]), size + 1, (u_char *)cp, n); Xfree(cp); if (n < 0) { Xfree(buf); return(NULL); } return(buf); } argv = getdigestfield(digest); auth.realm = auth.nonce = auth.algorithm = auth.qop = auth.opaque = auth.cnonce = NULL; for (n = 0; argv[n]; n++) { getdigestval(&(auth.realm), argv[n], REALMSTR); getdigestval(&(auth.nonce), argv[n], NONCESTR); getdigestval(&(auth.algorithm), argv[n], ALGORITHMSTR); getdigestval(&(auth.qop), argv[n], QOPSTR); getdigestval(&(auth.opaque), argv[n], OPAQUESTR); } freevar(argv); if (!auth.realm || !auth.nonce) { freedigest(&auth); errno = EINVAL; return(NULL); } n = genhash(a1, sizeof(a1), "%s:%s:%s", hp -> user, auth.realm, hp -> pass); if (n < 0) { freedigest(&auth); return(NULL); } n = genhash(a2, sizeof(a2), "%s:%s", method, path); if (n < 0) { freedigest(&auth); return(NULL); } if (!auth.qop) n = genhash(res, sizeof(res), "%s:%s:%s", a1, auth.nonce, a2); else { n = genhash(cnonce, sizeof(cnonce), "%s:%d", hp -> host, Xtime(NULL)); if (n < 0) { freedigest(&auth); return(NULL); } n = genhash(res, sizeof(res), "%s:%s:%08x:%s:%s:%s", a1, auth.nonce, ++count, cnonce, auth.qop, a2); } if (n < 0) { freedigest(&auth); return(NULL); } buf = NULL; n = 0; n = catprintf(&buf, n, "%s username=\"%s\"", AUTHDIGEST, hp -> user); n = catprintf(&buf, n, ", %s=\"%s\"", REALMSTR, auth.realm); n = catprintf(&buf, n, ", %s=\"%s\"", NONCESTR, auth.nonce); n = catprintf(&buf, n, ", uri=\"%s\"", path); if (auth.algorithm) n = catprintf(&buf, n, ", %s=\"%s\"", ALGORITHMSTR, auth.algorithm); if (auth.qop) { n = catprintf(&buf, n, ", %s=\"%s\"", QOPSTR, auth.qop); n = catprintf(&buf, n, ", nc=%08x", count); n = catprintf(&buf, n, ", cnonce=\"%s\"", cnonce); } if (auth.opaque) n = catprintf(&buf, n, ", %s=\"%s\"", OPAQUESTR, auth.opaque); n = catprintf(&buf, n, ", response=\"%s\"", res); freedigest(&auth); return(buf); } #endif /* DEP_URLPATH */ FD-3.01j/ftp.c100644 2105 1751 44420 13516612560 11642 0ustar shiraiuser/* * ftp.c * * FTP accesing in RFC959 */ #include "headers.h" #include "depend.h" #include "printf.h" #include "kctype.h" #include "string.h" #include "malloc.h" #include "time.h" #include "sysemu.h" #include "pathname.h" #include "termio.h" #include "parse.h" #include "lsparse.h" #include "socket.h" #include "auth.h" #include "urldisk.h" #ifndef NOFTPH #include #endif #define FTP_QUIT 0 #define FTP_USER 1 #define FTP_PASS 2 #define FTP_CWD 3 #define FTP_PWD 4 #define FTP_TYPE 5 #define FTP_LIST 6 #define FTP_NLST 7 #define FTP_PORT 8 #define FTP_PASV 9 #define FTP_MDTM 10 #define FTP_CHMOD 11 #define FTP_DELE 12 #define FTP_RNFR 13 #define FTP_RNTO 14 #define FTP_RETR 15 #define FTP_STOR 16 #define FTP_MKD 17 #define FTP_RMD 18 #define FTP_FEAT 19 #define FTP_ABOR 20 #define FTP_SIZE 21 #define FTP_ASCII "A" #define FTP_IMAGE "I" #ifndef PRELIM #define PRELIM 1 #endif #ifndef COMPLETE #define COMPLETE 2 #endif #ifndef CONTINUE #define CONTINUE 3 #endif #ifndef TRANSIENT #define TRANSIENT 4 #endif #ifndef ERROR #define ERROR 5 #endif typedef struct _ftpcmd_t { int id; CONST char *cmd[2]; int argc; int flags; } ftpcmd_t; #define FFL_INT 0001 #define FFL_COMMA 0002 #define FFL_LIST 0004 #ifdef DEP_FTPPATH static VOID NEAR vftplog __P_((CONST char *, va_list)); static VOID NEAR ftplog __P_((CONST char *, ...)); static char *NEAR ftprecv __P_((XFILE *)); static int NEAR vftpsend __P_((XFILE *, int, CONST char *, va_list)); static int NEAR ftppasv __P_((int)); static int NEAR ftpdata __P_((int)); static int NEAR sendrequest __P_((int, int, CONST char *)); static int NEAR ftpopenport __P_((int, int, CONST char *, CONST char *)); static char *ftpfgets __P_((VOID_P)); static int NEAR _ftprecvlist __P_((int, CONST char *, namelist **)); static int NEAR recvpwd __P_((int, char *, ALLOC_T)); static int NEAR ftpfeat __P_((int)); static int NEAR ftpmdtm __P_((int, CONST char *, namelist *, int, int)); static int NEAR ftpsize __P_((int, CONST char *, namelist *, int, int)); char *ftpaddress = NULL; char *ftpproxy = NULL; char *ftplogfile = NULL; static char *form_ftp[] = { "%a %l %u %g %s %m %d %{yt} %*f", "%a %l %u %g %B, %b %m %d %{yt} %*f", "%a %l %u %s %m %d %{yt} %*f", "%a %l %u %B, %b %m %d %{yt} %*f", "%m-%d-%y %t %{s//} %*f", "%s %/DIR/ %m-%d-%y %t %*f", "%s %m-%d-%y %t %*f", NULL }; static char *form_nlst[] = { "%*f", NULL }; static char *ign_ftp[] = { "total *", NULL }; static lsparse_t ftpformat = { NULL, NULL, form_ftp, ign_ftp, NULL, 0, 0, LF_NOTRAVERSE }; static CONST ftpcmd_t ftpcmdlist[] = { {FTP_QUIT, {"QUIT", NULL}, 0, 0}, {FTP_USER, {"USER", NULL}, 1, 0}, {FTP_PASS, {"PASS", NULL}, 1, 0}, {FTP_CWD, {"CWD", "XCWD"}, 1, 0}, {FTP_PWD, {"PWD", "XPWD"}, 0, 0}, {FTP_TYPE, {"TYPE", NULL}, 1, 0}, {FTP_LIST, {"LIST -la", "LIST"}, 1, FFL_LIST}, {FTP_NLST, {"NLST -a", "NLST"}, 1, FFL_LIST}, {FTP_PORT, {"PORT", NULL}, 6, FFL_INT | FFL_COMMA}, {FTP_PASV, {"PASV", NULL}, 0, 0}, {FTP_MDTM, {"MDTM", NULL}, 1, 0}, {FTP_CHMOD, {"SITE CHMOD", NULL}, 2, 0}, {FTP_DELE, {"DELE", NULL}, 1, 0}, {FTP_RNFR, {"RNFR", NULL}, 1, 0}, {FTP_RNTO, {"RNTO", NULL}, 1, 0}, {FTP_RETR, {"RETR", NULL}, 1, 0}, {FTP_STOR, {"STOR", NULL}, 1, 0}, {FTP_MKD, {"MKD", "XMKD"}, 1, 0}, {FTP_RMD, {"RMD", "XRMD"}, 1, 0}, {FTP_FEAT, {"FEAT", NULL}, 0, 0}, {FTP_ABOR, {"ABOR", NULL}, 0, 0}, {FTP_SIZE, {"SIZE", NULL}, 1, 0}, }; #define FTPCMDLISTSIZ arraysize(ftpcmdlist) static VOID NEAR vftplog(fmt, args) CONST char *fmt; va_list args; { XFILE *fp; if (!ftplogfile || !isrootdir(ftplogfile)) return; if (!(fp = Xfopen(ftplogfile, "a"))) return; if (logheader) { VOID_C Xfputs(logheader, fp); Xfree(logheader); logheader = NULL; } VOID_C Xvfprintf(fp, fmt, args); VOID_C Xfclose(fp); } #ifdef USESTDARGH /*VARARGS1*/ static VOID NEAR ftplog(CONST char *fmt, ...) #else /*VARARGS1*/ static VOID NEAR ftplog(fmt, va_alist) CONST char *fmt; va_dcl #endif { va_list args; VA_START(args, fmt); vftplog(fmt, args); va_end(args); } static char *NEAR ftprecv(fp) XFILE *fp; { char *buf; buf = Xfgets(fp); if (!buf) return(NULL); ftplog("<-- \"%s\"\n", buf); return(buf); } static int NEAR vftpsend(fp, cmd, fmt, args) XFILE *fp; int cmd; CONST char *fmt; va_list args; { u_char oob[3]; char buf[URLMAXCMDLINE + 1]; int n; n = Xsnprintf(buf, sizeof(buf), "--> \"%s\"\n", fmt); if (n < 0) /*EMPTY*/; else if (cmd == FTP_PASS) ftplog(buf, "????"); else vftplog(buf, args); if (cmd == FTP_ABOR) { oob[0] = TELNET_IAC; oob[1] = TELNET_IP; oob[2] = TELNET_IAC; n = socksendoob(Xfileno(fp), oob, sizeof(oob)); if (n >= 0) VOID_C Xfputc(TELNET_DM, fp); } n = Xvfprintf(fp, fmt, args); if (n >= 0) n = fputnl(fp); return(n); } int ftpgetreply(fp, sp) XFILE *fp; char **sp; { char *cp, *buf; ALLOC_T len, size; int i, n, code; if (!(buf = ftprecv(fp))) return(-1); for (i = n = 0; i < 3; i++) { if (!Xisdigit(buf[i])) break; n *= 10; n += buf[i] - '0'; } code = n; if (i < 3) { Xfree(buf); return(seterrno(EINVAL)); } if (buf[3] == '-') { size = strlen(buf); for (;;) { if (!(cp = ftprecv(fp))) { Xfree(buf); return(-1); } for (i = n = 0; i < 3; i++) { if (!Xisdigit(cp[i])) break; n *= 10; n += cp[i] - '0'; } if (i < 3 || cp[3] != ' ') n = -1; len = strlen(cp); buf = Xrealloc(buf, size + 1 + len + 1); buf[size++] = '\n'; memcpy(&(buf[size]), cp, len + 1); size += len; Xfree(cp); if (n == code) break; } } if (sp) *sp = buf; else Xfree(buf); return(code); } int ftpseterrno(n) int n; { if (n < 0) return(-1); switch (n / 100) { case COMPLETE: n = 0; break; case PRELIM: case CONTINUE: n = seterrno(EACCES); break; case TRANSIENT: n = seterrno(EIO); break; default: switch (n) { case 550: n = seterrno(ENOENT); break; default: n = seterrno(EINVAL); break; } break; } return(n); } int vftpcommand(uh, sp, cmd, args) int uh; char **sp; int cmd; va_list args; { char *cp, buf[URLMAXCMDLINE + 1]; ALLOC_T size; int i, j, n, c, delim; if (sp) *sp = NULL; if (cmd < 0 || cmd >= FTPCMDLISTSIZ) return(seterrno(EINVAL)); n = 0; for (i = 0; i < 2; i++) { if (!(ftpcmdlist[cmd].cmd[i])) break; if (i || !(ftpcmdlist[cmd].flags & FFL_LIST)) /*EMPTY*/; else if (urlhostlist[uh].options & UOP_NOLISTOPT) continue; /* Some FTP proxy cannot allow option arguments */ if (urlhostlist[uh].flags & UFL_PROXIED) { cp = Xstrchr(ftpcmdlist[cmd].cmd[i], ' '); if (cp && *skipspace(++cp) == '-') continue; } cp = buf; size = sizeof(buf); n = Xsnprintf(cp, size, "%s", ftpcmdlist[cmd].cmd[i]); if (n < 0) break; delim = ' '; c = (ftpcmdlist[cmd].flags & FFL_INT) ? 'd' : 's'; for (j = 0; j < ftpcmdlist[cmd].argc; j++) { cp += n; size -= n; n = Xsnprintf(cp, size, "%c%%%c", delim, c); if (n < 0) break; if (ftpcmdlist[cmd].flags & FFL_COMMA) delim = ','; } if (n < 0) break; n = vftpsend(urlhostlist[uh].fp, cmd, buf, args); if (n < 0) break; if (cmd == FTP_QUIT) Xsettimeout(urlhostlist[uh].fp, URLENDTIMEOUT); n = urlgetreply(uh, sp); Xsettimeout(urlhostlist[uh].fp, urltimeout); if (n == 500) continue; if (n != 421 || cmd == FTP_USER || cmd == FTP_PASS) break; if (urlreconnect(uh) < 0) break; if (ftplogin(uh) < 0) { safefclose(urlhostlist[uh].fp); urlhostlist[uh].fp = NULL; break; } i--; } return(n); } int ftpquit(uh) int uh; { if (urlhostlist[uh].flags & UFL_LOCKED) return(0); return(urlcommand(uh, NULL, FTP_QUIT)); } int ftpabort(uh) int uh; { return(urlcommand(uh, NULL, FTP_ABOR)); } int ftplogin(uh) int uh; { CONST char *pass; char buf[URLMAXCMDLINE + 1]; int n, anon, flags; flags = (UGP_USER | UGP_ANON); if (urlhostlist[uh].flags & UFL_PROXIED) { flags |= UGP_HOST; urlhostlist[uh].options |= UOP_NOFEAT; } if (urlgenpath(uh, buf, sizeof(buf), flags) < 0) return(-1); n = urlcommand(uh, NULL, FTP_USER, buf); if (n / 100 == CONTINUE) { anon = 0; if ((pass = urlhostlist[uh].host.pass)) /*EMPTY*/; else if (urlhostlist[uh].host.user) pass = nullstr; else { anon++; pass = (ftpaddress && *ftpaddress) ? ftpaddress : FTPANONPASS; } n = urlcommand(uh, NULL, FTP_PASS, pass); if (n == 530) { if (anon) VOID_C Xfprintf(Xstderr, "%s: Invalid address.\r\n", pass); else VOID_C Xfprintf(Xstderr, "%s: Login incorrect.\r\n", buf); Xfree(urlhostlist[uh].host.pass); urlhostlist[uh].host.pass = NULL; } } if (ftpseterrno(n) < 0) return(-1); authentry(&(urlhostlist[uh].host), urlhostlist[uh].type); VOID_C ftpfeat(uh); return(0); } static int NEAR ftppasv(uh) int uh; { u_char addr[4], port[2]; char *cp, *buf, host[4 * 4]; int n; n = urlcommand(uh, &buf, FTP_PASV); if (ftpseterrno(n) < 0) { Xfree(buf); return(-1); } if ((cp = Xstrchr(buf, '('))) cp = Xsscanf(cp, "(%Cu,%Cu,%Cu,%Cu,%Cu,%Cu)", &(addr[0]), &(addr[1]), &(addr[2]), &(addr[3]), &(port[0]), &(port[1])); Xfree(buf); if (!cp) return(seterrno(EINVAL)); n = Xsnprintf(host, sizeof(host), "%u.%u.%u.%u", addr[0], addr[1], addr[2], addr[3]); if (n < 0) return(seterrno(EINVAL)); n = (port[0] << 8 | port[1]); return(sockconnect(host, n, urltimeout, SCK_THROUGHPUT)); } static int NEAR ftpdata(uh) int uh; { u_char addr[4]; char *cp, host[SCK_ADDRSIZE + 1]; int n, s, port, opt; if (!(urlhostlist[uh].options & UOP_NOPASV)) return(ftppasv(uh)); s = Xfileno(urlhostlist[uh].fp); if (getsockinfo(s, host, sizeof(host), &port, 0) < 0) return(-1); if (urlhostlist[uh].options & UOP_NOPORT) opt = (SCK_LOWDELAY | SCK_REUSEADDR); else { opt = SCK_LOWDELAY; port = 0; } if ((s = sockbind(host, port, opt)) < 0) return(-1); if (urlhostlist[uh].options & UOP_NOPORT) return(s); if (getsockinfo(s, host, sizeof(host), &port, 0) < 0) { safeclose(s); return(-1); } cp = Xsscanf(host, "%Cu.%Cu.%Cu.%Cu%$", &(addr[0]), &(addr[1]), &(addr[2]), &(addr[3])); if (!cp) return(seterrno(EINVAL)); n = urlcommand(uh, NULL, FTP_PORT, addr[0], addr[1], addr[2], addr[3], (port >> 8) & 0xff, port & 0xff); if (ftpseterrno(n) < 0) { safeclose(s); return(-1); } return(s); } static int NEAR sendrequest(uh, cmd, path) int uh, cmd; CONST char *path; { int n; if ((n = urlcommand(uh, NULL, cmd, path)) < 0) return(-1); if (n / 100 == PRELIM) return(1); if (n != 425) return(seterrno(EINVAL)); if ((urlhostlist[uh].flags & UFL_RETRYPORT) && (urlhostlist[uh].flags & UFL_RETRYPASV)) return(seterrno(EINVAL)); if (!(urlhostlist[uh].options & UOP_NOPASV) || (urlhostlist[uh].flags & UFL_RETRYPORT)) { urlhostlist[uh].flags |= UFL_RETRYPASV; urlhostlist[uh].options ^= UOP_NOPASV; } else { urlhostlist[uh].flags |= UFL_RETRYPORT; urlhostlist[uh].options ^= UOP_NOPORT; } return(0); } static int NEAR ftpopenport(uh, cmd, path, type) int uh, cmd; CONST char *path, *type; { int n, fd; n = urlcommand(uh, NULL, FTP_TYPE, type); if (ftpseterrno(n) < 0) return(-1); for (;;) { if ((fd = ftpdata(uh)) < 0) return(-1); if ((n = sendrequest(uh, cmd, path)) > 0) break; if (n < 0) { safeclose(fd); return(-1); } } if (urlhostlist[uh].options & UOP_NOPASV) fd = sockaccept(fd, SCK_THROUGHPUT); return(fd); } static char *ftpfgets(vp) VOID_P vp; { char *buf; buf = Xfgets((XFILE *)vp); if (!buf) return(NULL); ftplog(" \"%s\"\n", buf); return(buf); } static int NEAR _ftprecvlist(uh, path, listp) int uh; CONST char *path; namelist **listp; { XFILE *fp; int n, fd, cmd, max; if (urlhostlist[uh].options & UOP_USENLST) { cmd = FTP_NLST; ftpformat.format = form_nlst; ftpformat.flags |= LF_BASENAME; } else { cmd = FTP_LIST; ftpformat.format = form_ftp; ftpformat.flags &= ~LF_BASENAME; } if ((fd = ftpopenport(uh, cmd, path, FTP_ASCII)) < 0) return(-1); if (!(fp = Xfdopen(fd, "r"))) { safeclose(fd); return(-1); } Xsettimeout(fp, urltimeout); Xsetflags(fp, XF_CRNL | XF_NONBLOCK); *listp = NULL; ftplog("<-- (data)\n"); max = lsparse(fp, &ftpformat, listp, ftpfgets); safefclose(fp); if (max < 0) return(-1); n = urlgetreply(uh, NULL); if (ftpseterrno(n) < 0) { freelist(*listp, max); return(-1); } return(max); } int ftprecvlist(uh, path, listp) int uh; CONST char *path; namelist **listp; { int n; n = _ftprecvlist(uh, path, listp); if (n < 0 || (urlhostlist[uh].flags & UFL_FIXLISTOPT)) return(n); if (n > 1) { urlhostlist[uh].flags |= UFL_FIXLISTOPT; return(n); } urlhostlist[uh].options ^= UOP_NOLISTOPT; n = _ftprecvlist(uh, path, listp); urlhostlist[uh].options ^= UOP_NOLISTOPT; if (n > 1) { urlhostlist[uh].options ^= UOP_NOLISTOPT; urlhostlist[uh].flags |= UFL_FIXLISTOPT; } return(n); } static int NEAR recvpwd(uh, path, size) int uh; char *path; ALLOC_T size; { char *buf; int i, j, n, quote; if ((n = urlcommand(uh, &buf, FTP_PWD)) < 0) return(-1); if (n != 257) { Xfree(buf); return(seterrno(EACCES)); } for (i = 4; Xisblank(buf[i]); i++) /*EMPTY*/; quote = '\0'; for (j = 0; buf[i]; i++) { if (buf[i] == quote) { if (buf[i + 1] != quote) { quote = '\0'; continue; } i++; } else if (quote) /*EMPTY*/; else if (Xisblank(buf[i])) break; else if (buf[i] == '"') { quote = buf[i]; continue; } if (j >= size - 1) break; path[j++] = buf[i]; } path[j] = '\0'; Xfree(buf); return(0); } static int NEAR ftpfeat(uh) int uh; { char *cp, *next, *buf; int n, mdtm, size; if (urlhostlist[uh].options & UOP_NOFEAT) return(0); n = urlcommand(uh, &buf, FTP_FEAT); if (ftpseterrno(n) < 0) { if (n == 500 || n == 502) urlhostlist[uh].options |= UOP_NOFEAT; Xfree(buf); return(-1); } next = NULL; mdtm = size = 0; for (cp = buf; cp && *cp; cp = next) { while (Xisblank(*cp)) cp++; if (!(next = Xstrchr(cp, '\n'))) n = strlen(cp); else { n = next - cp; *(next++) = '\0'; } if (!Xstrcasecmp(cp, "MDTM")) mdtm++; if (!Xstrcasecmp(cp, "SIZE")) size++; } if (!mdtm) urlhostlist[uh].options |= UOP_NOMDTM; if (!size) urlhostlist[uh].options |= UOP_NOSIZE; Xfree(buf); return(0); } static int NEAR ftpmdtm(uh, path, namep, st, ent) int uh; CONST char *path; namelist *namep; int st, ent; { namelist *tmp; struct tm tm; char *cp, *buf; time_t t; int n, year, mon, day, hour, min, sec; if (urlhostlist[uh].options & UOP_NOMDTM) return(0); if (ismark(namep)) return(0); tmp = NULL; if (st >= 0 && st < maxurlstat && ent >= 0 && ent < urlstatlist[st].max) tmp = &(urlstatlist[st].list[ent]); n = urlcommand(uh, &buf, FTP_MDTM, path); if (n >= 0 && tmp) tmp -> tmpflags |= F_ISMRK; if (ftpseterrno(n) < 0) { Xfree(buf); if (n == 500 || n == 502) urlhostlist[uh].options |= UOP_NOMDTM; if (n == 550) { if (!isdir(namep)) todirlist(namep, (u_int)-1); if (tmp && !isdir(tmp)) todirlist(tmp, (u_int)-1); return(0); } return(-1); } if ((cp = Xstrchr(buf, ' '))) { cp = skipspace(&(cp[1])); cp = Xsscanf(cp, "%04u%02u%02u%02u%02u%02u", &year, &mon, &day, &hour, &min, &sec); } Xfree(buf); if (!cp) return(seterrno(EINVAL)); tm.tm_year = year - 1900; tm.tm_mon = mon - 1; tm.tm_mday = day; tm.tm_hour = hour; tm.tm_min = min; tm.tm_sec = sec; t = Xtimegm(&tm); if (t == (time_t)-1) return(seterrno(EINVAL)); namep -> st_mtim = t; if (tmp) tmp -> st_mtim = t; return(0); } static int NEAR ftpsize(uh, path, namep, st, ent) int uh; CONST char *path; namelist *namep; int st, ent; { namelist *tmp; char *cp, *buf; off_t size; int n; if (urlhostlist[uh].options & UOP_NOSIZE) return(0); if (wasmark(namep)) return(0); tmp = NULL; if (st >= 0 && st < maxurlstat && ent >= 0 && ent < urlstatlist[st].max) tmp = &(urlstatlist[st].list[ent]); n = urlcommand(uh, &buf, FTP_SIZE, path); if (n >= 0 && tmp) tmp -> tmpflags |= F_WSMRK; if (ftpseterrno(n) < 0) { Xfree(buf); if (n == 500 || n == 502) urlhostlist[uh].options |= UOP_NOSIZE; if (n == 550) { if (!isdir(namep)) todirlist(namep, (u_int)-1); if (tmp && !isdir(tmp)) todirlist(tmp, (u_int)-1); return(0); } return(-1); } if ((cp = Xstrchr(buf, ' '))) { cp = skipspace(&(cp[1])); cp = Xsscanf(cp, "%qu", &size); } Xfree(buf); if (!cp) return(seterrno(EINVAL)); namep -> st_size = size; if (tmp) tmp -> st_size = size; return(0); } int ftprecvstatus(uh, path, namep, n, ent) int uh; CONST char *path; namelist *namep; int n, ent; { if (ftpmdtm(uh, path, namep, n, ent) < 0) return(-1); if (!(urlhostlist[uh].options & UOP_USENLST)) /*EMPTY*/; else if (ftpsize(uh, path, namep, n, ent) < 0) return(-1); return(0); } int ftpchdir(uh, path) int uh; CONST char *path; { return(ftpseterrno(urlcommand(uh, NULL, FTP_CWD, path))); } char *ftpgetcwd(uh, path, size) int uh; char *path; ALLOC_T size; { char *cp; int n; cp = path; n = urlgenpath(uh, cp, size, UGP_SCHEME | UGP_USER | UGP_HOST); if (n < 0) return(NULL); cp += n; size -= n; if (recvpwd(uh, cp, size) < 0) return(NULL); return(path); } int ftpchmod(uh, path, mode) int uh; CONST char *path; int mode; { char buf[MAXLONGWIDTH + 1]; int n; mode &= 0777; if (Xsnprintf(buf, sizeof(buf), "%03o", mode) < 0) return(-1); n = urlcommand(uh, NULL, FTP_CHMOD, buf, path); return(ftpseterrno(n)); } int ftpunlink(uh, path) int uh; CONST char *path; { return(ftpseterrno(urlcommand(uh, NULL, FTP_DELE, path))); } int ftprename(uh, from, to) int uh; CONST char *from, *to; { int n; n = urlcommand(uh, NULL, FTP_RNFR, from); if (n / 100 != CONTINUE) { if (n >= 0) errno = ENOENT; return(-1); } return(ftpseterrno(urlcommand(uh, NULL, FTP_RNTO, to))); } int ftpopen(uh, path, flags) int uh; CONST char *path; int flags; { int cmd; switch (flags & O_ACCMODE) { case O_RDONLY: cmd = FTP_RETR; break; case O_WRONLY: cmd = FTP_STOR; break; default: return(seterrno(EACCES)); /*NOTREACHED*/ break; } return(ftpopenport(uh, cmd, path, FTP_IMAGE)); } /*ARGSUSED*/ int ftpclose(uh, fd) int uh, fd; { return(ftpseterrno(urlgetreply(uh, NULL))); } /*ARGSUSED*/ int ftpfstat(uh, stp) int uh; struct stat *stp; { return(seterrno(ENOENT)); } /*ARGSUSED*/ int ftpread(uh, fd, buf, nbytes) int uh, fd; char *buf; int nbytes; { return(read(fd, buf, nbytes)); } /*ARGSUSED*/ int ftpwrite(uh, fd, buf, nbytes) int uh, fd; CONST char *buf; int nbytes; { return(write(fd, buf, nbytes)); } int ftpmkdir(uh, path) int uh; CONST char *path; { return(ftpseterrno(urlcommand(uh, NULL, FTP_MKD, path))); } int ftprmdir(uh, path) int uh; CONST char *path; { return(ftpseterrno(urlcommand(uh, NULL, FTP_RMD, path))); } #endif /* DEP_FTPPATH */ FD-3.01j/html.c100644 2105 1751 37276 13516612560 12030 0ustar shiraiuser/* * html.c * * HTML parsing in RFC1866 */ #include "headers.h" #include "depend.h" #include "printf.h" #include "kctype.h" #include "typesize.h" #include "string.h" #include "malloc.h" #include "sysemu.h" #include "pathname.h" #include "termio.h" #include "parse.h" #include "html.h" #include "urldisk.h" #define HTTPEQUIVSTR "HTTP-EQUIV" #define CONTENTTYPESTR "Content-Type" #define CONTENTSTR "CONTENT" #define CHARSETSTR "charset=" #define HREFSTR "HREF" #define DEFTAG(s, l, n, f) {s, strsize(s), l, n, f} #define DEFAMP(s, c) {s, strsize(s), c} #define constequal(s, c) (!Xstrncasecmp(s, c, strsize(c))) #define iswcin(s) ((s)[0] == '\033' && (s)[1] == '$' && (s)[2]) #define iswcout(s) ((s)[0] == '\033' && (s)[1] == '(' && (s)[2]) typedef struct _langtable { CONST char *ident; u_char lang; } langtable; typedef struct _htmltag_t { CONST char *ident; ALLOC_T len; char level; char next; char *(NEAR *func)__P_((htmlstat_t *, char **)); } htmltag_t; typedef struct _htmlamp_t { CONST char *ident; ALLOC_T len; int ch; } htmlamp_t; #ifdef DEP_HTTPPATH static VOID NEAR vhtmllog __P_((CONST char *, va_list)); static char *NEAR fgetnext __P_((htmlstat_t *)); static char *NEAR searchchar __P_((CONST char *, int)); static char *NEAR searchstr __P_((htmlstat_t *, ALLOC_T, CONST char *)); static char *NEAR fgethtml __P_((htmlstat_t *)); static char **NEAR getattr __P_((CONST char *, ALLOC_T)); static char **NEAR getattrval __P_((CONST char *, CONST char *, int)); static int NEAR gettagid __P_((CONST char *, ALLOC_T)); static char *NEAR fgetdir __P_((htmlstat_t *)); static VOID NEAR decodeamp __P_((char *)); static char *NEAR metatag __P_((htmlstat_t *, char **)); static char *NEAR breaktag __P_((htmlstat_t *, char **)); static char *NEAR anchortag __P_((htmlstat_t *, char **)); static int NEAR isanchor __P_((htmlstat_t *, CONST char *, CONST char *)); static int NEAR _datestrconv __P_((char *, CONST char *, CONST char *)); static VOID NEAR datestrconv __P_((char *)); char *htmllogfile = NULL; static CONST langtable langlist[] = { {"Shift_JIS", SJIS}, {"MS_Kanji", SJIS}, {"csShiftJIS", SJIS}, {"Windows-31J", SJIS}, {"csWindows31J", SJIS}, {"Extended_UNIX_Code_Packed_Format_for_Japanese", EUC}, {"csEUCPkdFmtJapanese", EUC}, {"EUC-JP", EUC}, {"JIS_Encoding", JUNET}, {"csJISEncoding", JUNET}, {"ISO-2022-JP", JUNET}, {"csISO2022JP", JUNET}, {"ISO-2022-JP-2", JUNET}, {"csISO2022JP2", JUNET}, {"JIS_C6226-1978", O_JUNET}, {"iso-ir-42", O_JUNET}, {"csISO42JISC62261978", O_JUNET}, {"UTF-8", UTF8}, {"US-ASCII", ENG}, {"us", ENG}, {"csASCII", ENG}, {"ISO-8859-1", ENG}, {"latin1", ENG}, {"csISOLatin1", ENG}, }; #define LANGLISTSIZ arraysize(langlist) static CONST htmltag_t taglist[] = { DEFTAG("!DOCTYPE", HTML_NONE, HTML_NONE, NULL), DEFTAG("HTML", HTML_NONE, HTML_HTML, NULL), DEFTAG("HEAD", HTML_HTML, HTML_HEAD, NULL), DEFTAG("BODY", HTML_HTML, HTML_BODY, NULL), DEFTAG("PRE", HTML_BODY, HTML_PRE, breaktag), DEFTAG("META", HTML_HEAD, HTML_NONE, metatag), DEFTAG("BR", HTML_BODY, HTML_NONE, breaktag), DEFTAG("HR", HTML_BODY, HTML_NONE, breaktag), DEFTAG("P", HTML_BODY, HTML_NONE, breaktag), DEFTAG("TR", HTML_BODY, HTML_NONE, breaktag), DEFTAG("LI", HTML_BODY, HTML_NONE, breaktag), DEFTAG("A", HTML_BODY, HTML_NONE, anchortag), }; #define TAGLISTSIZ arraysize(taglist) static CONST htmlamp_t amplist[] = { DEFAMP("amp", '&'), DEFAMP("lt", '<'), DEFAMP("gt", '>'), DEFAMP("quot", '"'), DEFAMP("nbsp", ' '), }; #define AMPLISTSIZ arraysize(amplist) static CONST char *yearlist[] = { "/", "\307\257", /* EUC-JP */ "\224\116", /* Shift_JIS */ "\345\271\264", /* UTF-8 */ "\304\352", /* GB */ "\246\176", /* Big5 */ NULL }; static CONST char *monthlist[] = { "/", "\267\356", /* EUC-JP */ "\214\216", /* Shift_JIS */ "\346\234\210", /* UTF-8 */ "\324\302", /* GB */ "\244\353", /* Big5 */ NULL }; static CONST char *daylist[] = { "", "\306\374", /* EUC-JP */ "\223\372", /* Shift_JIS */ "\346\227\245", /* UTF-8 */ "\310\325", /* GB */ "\244\351", /* Big5 */ NULL }; static CONST char *amlist[] = { "AM", "\270\341\301\260", /* EUC-JP */ "\214\337\221\117", /* Shift_JIS */ "\345\215\210\345\211\215", /* UTF-8 (JP) */ "\311\317\316\347", /* GB */ "\244\127\244\310", /* Big5 */ "\344\270\212\345\215\210", /* UTF-8 (CN) */ NULL }; static CONST char *pmlist[] = { "PM", "\270\341\270\345", /* EUC-JP */ "\214\337\214\343", /* Shift_JIS */ "\345\215\210\345\276\214", /* UTF-8 (JP) */ "\317\302\316\347", /* GB */ "\244\125\244\310", /* Big5 */ "\344\270\213\345\215\210", /* UTF-8 (CN) */ NULL }; static CONST char **datestrlist[] = { yearlist, monthlist, daylist, amlist, pmlist, }; #define DATESTRLISTSIZ arraysize(datestrlist) static VOID NEAR vhtmllog(fmt, args) CONST char *fmt; va_list args; { XFILE *fp; if (!htmllogfile || !isrootdir(htmllogfile)) return; if (!(fp = Xfopen(htmllogfile, "a"))) return; VOID_C Xvfprintf(fp, fmt, args); VOID_C Xfclose(fp); } #ifdef USESTDARGH /*VARARGS1*/ VOID htmllog(CONST char *fmt, ...) #else /*VARARGS1*/ VOID htmllog(fmt, va_alist) CONST char *fmt; va_dcl #endif { va_list args; VA_START(args, fmt); vhtmllog(fmt, args); va_end(args); } static char *NEAR fgetnext(hp) htmlstat_t *hp; { char *buf; ALLOC_T len; buf = Xfgets(hp -> fp); if (!buf) return(NULL); htmllog("%s\n", buf); len = strlen(buf); if (!(hp -> max)) { Xfree(hp -> buf); hp -> buf = buf; } else { hp -> buf = Xrealloc(hp -> buf, hp -> max + 1 + len + 1); hp -> buf[hp -> max++] = ' '; Xstrncpy(&(hp -> buf[hp -> max]), buf, len); Xfree(buf); buf = &(hp -> buf[hp -> max]); } hp -> max += len; return(buf); } static char *NEAR searchchar(s, c) CONST char *s; int c; { int wc; wc = 0; for (;;) { if (!*s) return(NULL); if (iswcin(s)) { s += 2; wc = 1; } else if (iswcout(s)) { s += 2; wc = 0; } else if (wc) s++; else if (*s == c) break; s++; } return((char *)s); } static char *NEAR searchstr(hp, ptr, s) htmlstat_t *hp; ALLOC_T ptr; CONST char *s; { char *cp; ALLOC_T len; int quote, wc; len = strlen(s); cp = &(hp -> buf[ptr]); quote = '\0'; wc = 0; for (;;) { if (*cp) /*EMPTY*/; else if (htmllvl(hp) == HTML_PRE && *s == '<') { hp -> flags |= HTML_NEWLINE; return(NULL); } else if (!(cp = fgetnext(hp))) return(NULL); if (iswcin(cp)) { cp += 2; wc = 1; } else if (iswcout(cp)) { cp += 2; wc = 0; } else if (wc) cp++; else if (*cp == quote) quote = '\0'; else if (quote) /*EMPTY*/; else if (*cp == '"' || *cp == '\'') quote = *cp; else if (!strncmp(cp, s, len)) break; cp++; } return(&(cp[len - 1])); } static char *NEAR fgethtml(hp) htmlstat_t *hp; { char *cp; ALLOC_T top; hp -> flags &= HTML_LVL; if (hp -> buf && !(hp -> buf[hp -> ptr])) { Xfree(hp -> buf); hp -> buf = NULL; hp -> ptr = (ALLOC_T)0; } if (!(hp -> buf) || !(hp -> max)) { hp -> max = (ALLOC_T)0; if (!fgetnext(hp)) return(NULL); } top = hp -> ptr; if (hp -> buf[top] != '<') { if (!(cp = searchstr(hp, top, "<"))) cp = &(hp -> buf[hp -> max]); hp -> ptr = cp - (hp -> buf); hp -> len = hp -> ptr - top; return(&(hp -> buf[top])); } top++; if (constequal(&(hp -> buf[top]), "!--")) { cp = searchstr(hp, top, "-->"); if (!cp) { Xfree(hp -> buf); hp -> buf = NULL; hp -> max = (ALLOC_T)0; return(NULL); } hp -> flags |= HTML_COMMENT; } else { if (hp -> buf[top] == '/') { hp -> flags |= HTML_CLOSE; top++; } if (!(cp = searchstr(hp, top, ">"))) cp = &(hp -> buf[hp -> max]); else if (!cp[1] && htmllvl(hp) == HTML_PRE) hp -> flags |= HTML_NEWLINE; } hp -> ptr = cp - (hp -> buf); hp -> len = hp -> ptr - top; if (*cp) hp -> ptr++; hp -> flags |= HTML_TAG; return(&(hp -> buf[top])); } static char **NEAR getattr(s, len) CONST char *s; ALLOC_T len; { char **argv; int quote, wc, argc; ALLOC_T ptr, top; argv = (char **)Xmalloc(sizeof(*argv)); argc = 0; for (ptr = (ALLOC_T)0; ptr < len; ptr++) { for (; ptr < len; ptr++) if (!Xisblank(s[ptr])) break; if (ptr >= len) break; argv = (char **)Xrealloc(argv, (argc + 2) * sizeof(*argv)); top = ptr; quote = '\0'; wc = 0; for (; ptr < len; ptr++) { if (iswcin(&(s[ptr]))) { ptr += (ALLOC_T)2; wc = 1; } else if (iswcout(&(s[ptr]))) { ptr += (ALLOC_T)2; wc = 0; } else if (wc) /*EMPTY*/; else if (s[ptr] == quote) quote = '\0'; else if (quote) /*EMPTY*/; else if (s[ptr] == '"' || s[ptr] == '\'') quote = s[ptr]; else if (Xisblank(s[ptr])) break; } argv[argc++] = Xstrndup(&(s[top]), ptr - top); } argv[argc] = NULL; return(argv); } static char **NEAR getattrval(s, name, delim) CONST char *s, *name; int delim; { char **argv; ALLOC_T ptr, len, top; int quote, argc; len = strlen(name); if (Xstrncasecmp(s, name, len)) return(NULL); s += len; if (*(s++) != '=') return(NULL); argv = (char **)Xmalloc(sizeof(*argv)); argc = 0; quote = (*s == '"' || *s == '\'') ? *(s++) : '\0'; for (ptr = (ALLOC_T)0; s[ptr]; ptr++) { while (Xisblank(s[ptr])) ptr++; if (!s[ptr]) break; argv = (char **)Xrealloc(argv, (argc + 2) * sizeof(*argv)); top = ptr; for (; s[ptr]; ptr++) if (s[ptr] == delim || s[ptr] == quote) break; argv[argc++] = Xstrndup(&(s[top]), ptr - top); if (!s[ptr] || s[ptr] == quote) break; } argv[argc] = NULL; return(argv); } static int NEAR gettagid(s, len) CONST char *s; ALLOC_T len; { int n; for (n = 0; n < TAGLISTSIZ; n++) { if (Xstrncasecmp(s, taglist[n].ident, taglist[n].len)) continue; if (len == taglist[n].len || Xisblank(s[taglist[n].len])) return(n); } return(-1); } static char *NEAR fgetdir(hp) htmlstat_t *hp; { char *cp, **argv; int n; for (;;) { if (!(cp = fgethtml(hp))) return(NULL); if (hp -> flags & HTML_COMMENT) continue; if (!(hp -> flags & HTML_TAG)) { if (htmllvl(hp) < HTML_BODY) continue; break; } n = gettagid(cp, hp -> len); if (htmllvl(hp) > HTML_NONE || (hp -> flags & HTML_CLOSE)) /*EMPTY*/; else if (n < 0 || taglist[n].level == HTML_BODY) { hp -> flags &= ~HTML_LVL; hp -> flags |= HTML_BODY; } if (n >= 0) { if (taglist[n].next == HTML_NONE) { if (htmllvl(hp) < taglist[n].level) n = -1; } else if (hp -> flags & HTML_CLOSE) { if (htmllvl(hp) == taglist[n].next) { hp -> flags &= ~HTML_LVL; hp -> flags |= taglist[n].level; } } else { if (htmllvl(hp) == taglist[n].level) { hp -> flags &= ~HTML_LVL; hp -> flags |= taglist[n].next; } } if (n >= 0 && taglist[n].func) { cp += taglist[n].len; argv = getattr(cp, hp -> len); cp = (*(taglist[n].func))(hp, argv); freevar(argv); if (cp) break; } } } return(cp); } static VOID NEAR decodeamp(s) char *s; { char *cp, *tmp; ALLOC_T ptr, len; int i, c; if (!s) return; len = strlen(s); for (cp = s; (cp = searchchar(cp, '&')); cp++) { tmp = &(cp[1]); for (i = 0; i < AMPLISTSIZ; i++) if (!strncmp(tmp, amplist[i].ident, amplist[i].len)) break; if (i < AMPLISTSIZ) { c = amplist[i].ch; ptr = amplist[i].len; } else if (*tmp != '#') continue; else { c = 0; for (ptr = (ALLOC_T)1; ptr <= (ALLOC_T)3; ptr++) { if (!Xisdigit(tmp[ptr] )) break; c = c * 10 + tmp[ptr] - '0'; } } if (tmp[ptr++] != ';') continue; *cp = c; len -= ptr; memmove(tmp, &(tmp[ptr]), len - (tmp - s) + 1); } } int getcharset(argv) char *CONST *argv; { char *cp; int n; cp = NULL; for (n = 0; argv[n]; n++) if (constequal(argv[n], CHARSETSTR)) { cp = Xstrdup(&(argv[n][strsize(CHARSETSTR)])); break; } if (!cp) return(-1); for (n = 0; n < LANGLISTSIZ; n++) if (!Xstrcasecmp(cp, langlist[n].ident)) break; Xfree(cp); if (n >= LANGLISTSIZ) return(-1); return((int)(langlist[n].lang)); } static char *NEAR metatag(hp, argv) htmlstat_t *hp; char **argv; { char *cp, **var; int n; var = NULL; for (n = 0; argv[n]; n++) if ((var = getattrval(argv[n], HTTPEQUIVSTR, ';'))) break; if (!var) return(NULL); cp = NULL; for (n = 0; var[n]; n++) if (!Xstrcasecmp(var[n], CONTENTTYPESTR)) { cp = var[n]; break; } freevar(var); if (!cp) return(NULL); var = NULL; for (n = 0; argv[n]; n++) if ((var = getattrval(argv[n], CONTENTSTR, ';'))) break; if (!var) return(NULL); n = getcharset(var); freevar(var); if (n >= 0) hp -> charset = n; return(NULL); } /*ARGSUSED*/ static char *NEAR breaktag(hp, argv) htmlstat_t *hp; char **argv; { hp -> flags |= HTML_BREAK; return(vnullstr); } static char *NEAR anchortag(hp, argv) htmlstat_t *hp; char **argv; { char *cp, *new, **var; int n; hp -> flags |= HTML_ANCHOR; if (hp -> flags & HTML_CLOSE) return(vnullstr); var = NULL; for (n = 0; argv[n]; n++) if ((var = getattrval(argv[n], HREFSTR, '\0'))) break; if (!var || searchchar(var[0], '?')) { freevar(var); return(NULL); } if (!(cp = searchchar(var[0], '#'))) new = Xstrdup(var[0]); else new = Xstrndup(var[0], cp - var[0]); decodeamp(new); cp = urldecode(new, -1); Xfree(new); freevar(var); return(cp); } VOID htmlinit(hp, fp, path) htmlstat_t *hp; XFILE *fp; CONST char *path; { if (!hp) return; hp -> fp = fp; hp -> buf = NULL; hp -> path = Xstrdup(path); hp -> ptr = hp -> len = hp -> max = (ALLOC_T)0; hp -> charset = NOCNV; hp -> flags = 0; } VOID htmlfree(hp) htmlstat_t *hp; { hp -> fp = NULL; Xfree(hp -> buf); hp -> buf = NULL; Xfree(hp -> path); hp -> path = NULL; hp -> max = (ALLOC_T)0; } static int NEAR isanchor(hp, s1, s2) htmlstat_t *hp; CONST char *s1, *s2; { char *cp, buf[MAXPATHLEN]; ALLOC_T len; int n; if (!s2) return(-1); len = strlen(s1); if (strnpathcmp(s1, s2, len)) { cp = strcatdelim2(buf, hp -> path, s1); len = cp - buf; if (strnpathcmp(buf, s2, len)) return(-1); } n = (s2[len] == _SC_) ? 1 : 0; len += n; if (s2[len] && s2[len] != ';') return(-1); return(n); } static int NEAR _datestrconv(s, from, to) char *s; CONST char *from, *to; { char *cp; int i, conv; cp = s; conv = 0; while (*s) { for (i = 0; from[i]; i++) if (s[i] != from[i]) break; if (from[i]) *(cp++) = *(s++); else { s += i; for (i = 0; to[i]; i++) *(cp++) = to[i]; conv++; } } *cp = '\0'; return(conv); } static VOID NEAR datestrconv(s) char *s; { int i, j, n; for (i = 0; i < DATESTRLISTSIZ; i++) { for (j = 1; datestrlist[i][j]; j++) { n = _datestrconv(s, datestrlist[i][j], datestrlist[i][0]); if (n) break; } } } char *htmlfgets(hp) htmlstat_t *hp; { char *cp, *buf, *top, *new, *url; ALLOC_T len, size; int n, dir, anchored; buf = url = NULL; size = (ALLOC_T)0; anchored = 0; while ((cp = fgetdir(hp))) { if (!(hp -> flags & HTML_TAG)) { top = cp; cp = skipspace(cp); len = hp -> len - (cp - top); if (len) { new = Xstrndup(cp, len); n = isanchor(hp, new, url); if (n >= 0) cp = new; else { decodeamp(new); cp = skipspace(new); n = isanchor(hp, cp, url); } if (n < 0) { datestrconv(cp); dir = 0; } else { cp = urlencode(cp, -1, URL_UNSAFEPATH); Xfree(new); new = cp; dir = n; anchored++; } Xfree(url); url = NULL; if (size) buf[size++] = '\t'; len = strlen(cp); buf = Xrealloc(buf, size + len + dir + 1); memcpy(&(buf[size]), cp, len); size += len; if (dir) buf[size++] = _SC_; buf[size] = '\0'; Xfree(new); } } else { if (hp -> flags & HTML_ANCHOR) { Xfree(url); url = NULL; if (cp == vnullstr) /*EMPTY*/; else if (isurl(cp, UPF_ALLOWANYSCHEME)) Xfree(cp); else url = cp; } } if (!(hp -> flags & (HTML_BREAK | HTML_NEWLINE))) continue; if (buf && anchored) break; Xfree(buf); Xfree(url); buf = url = NULL; size = (ALLOC_T)0; } Xfree(url); decodeamp(buf); if (!anchored) { Xfree(buf); buf = NULL; } return(buf); } #endif /* DEP_HTTPPATH */ FD-3.01j/http.c100644 2105 1751 70465 13516612560 12040 0ustar shiraiuser/* * http.c * * HTTP accessing in RFC2616 */ #include "headers.h" #include "depend.h" #include "printf.h" #include "kctype.h" #include "string.h" #include "malloc.h" #include "time.h" #include "sysemu.h" #include "pathname.h" #include "termio.h" #include "parse.h" #include "lsparse.h" #include "socket.h" #include "auth.h" #include "html.h" #include "urldisk.h" #define HTTP_OPTIONS 0 #define HTTP_GET 1 #define HTTP_HEAD 2 #define HTTP_POST 3 #define HTTP_PUT 4 #define HTTP_DELETE 5 #define HTTP_TRACE 6 #define HTTPSTR "HTTP/" #define HTTPMAJ 1 #define HTTPMIN 1 #define MAXFLUSH (BUFSIZ * 4) #define CLOSESTR "close" #define CHUNKEDSTR "chunked" #define DEFHTTP(s, f) {s, strsize(s), f} #define HTTP_INFO 1 #define HTTP_SUCCESS 2 #define HTTP_REDIRECT 3 #define HTTP_CLIERROR 4 #define HTTP_SRVERROR 5 #define HTTP_NOREPLY 999 typedef struct _httpcmd_t { int id; CONST char *cmd; } httpcmd_t; typedef struct _httpfld_t { CONST char *ident; ALLOC_T len; int (NEAR *func)__P_((int, CONST char *)); } httpfld_t; #ifdef DEP_HTTPPATH #ifdef FD extern char *getversion __P_((int *)); #endif static VOID NEAR vhttplog __P_((CONST char *, va_list)); static VOID NEAR httplog __P_((CONST char *, ...)); static char *NEAR httprecv __P_((XFILE *)); static int NEAR httpsend __P_((XFILE *, CONST char *, ...)); static int NEAR getcode __P_((CONST char *, int *)); static VOID NEAR httpflush __P_((int)); static int NEAR server __P_((int, CONST char *)); static int NEAR contentlength __P_((int, CONST char *)); static int NEAR contenttype __P_((int, CONST char *)); static int NEAR lastmodified __P_((int, CONST char *)); static int NEAR location __P_((int, CONST char *)); static int NEAR connection __P_((int, CONST char *)); static int NEAR authenticate __P_((int, CONST char *, int)); static int NEAR www_authenticate __P_((int, CONST char *)); static int NEAR proxy_authenticate __P_((int, CONST char *)); static int NEAR chunked __P_((int, CONST char *)); static int NEAR _httpcommand __P_((int, int, CONST char *)); static int NEAR httpcommand __P_((int, int, CONST char *, int *)); static char *httpfgets __P_((VOID_P)); static int NEAR recvhead __P_((int, CONST char *, int *)); static int NEAR chunkgetc __P_((int)); static int NEAR getchunk __P_((int, int)); static int NEAR gettrailer __P_((int)); static int NEAR isredirect __P_((int)); static int NEAR reopendev __P_((int)); char *httpproxy = NULL; char *httplogfile = NULL; static char *form_http[] = { "%f %d-%m-%y %t %s %*x", /* Apache */ "%f %s %d-%m-%y %t", /* Nginx */ "%f %!.! %m %d %{yt} %{sx} %!->! %*{Lx}", /* FTP via squid */ "%s %m %d %{yt} %*f", /* FTP via delegate */ "%f %m %d %{yt} %*{sLx}", /* FTP via i-FILTER */ "%y/ %m/ %d %t %{s//} %*f", /* IIS (JP/CN) */ "%y/ %m/ %d %p %t %{s//} %*f", /* IIS (TW) */ "%w, %m %d, %y %t %p %{s//} %*f", /* IIS (US) */ "%d %m %y %t %{s//} %*f", /* IIS (GB) */ "%w, %d %m, %y %t %{s//} %*f", /* IIS (HK) */ "%m/ %d/ %y %p %t %{s//} %*f", /* IIS7 (US) */ "%d/ %m/ %y %t %{s//} %*f", /* IIS7 (GB) */ NULL }; static CONST lsparse_t httpformat = { NULL, NULL, form_http, NULL, NULL, 0, 0, LF_NOTRAVERSE }; static CONST httpcmd_t cmdlist[] = { {HTTP_OPTIONS, "OPTIONS"}, {HTTP_GET, "GET"}, {HTTP_HEAD, "HEAD"}, {HTTP_POST, "POST"}, {HTTP_PUT, "PUT"}, {HTTP_DELETE, "DELETE"}, {HTTP_TRACE, "TRACE"}, }; #define CMDLISTSIZ arraysize(cmdlist) static CONST httpfld_t fldlist[] = { DEFHTTP("Server", server), DEFHTTP("Content-Length", contentlength), DEFHTTP("Content-Type", contenttype), DEFHTTP("Last-Modified", lastmodified), DEFHTTP("Location", location), DEFHTTP("Connection", connection), DEFHTTP("Proxy-Connection", connection), DEFHTTP("WWW-Authenticate", www_authenticate), DEFHTTP("Proxy-Authenticate", proxy_authenticate), DEFHTTP("Transfer-Encoding", chunked), }; #define FLDLISTSIZ arraysize(fldlist) static char *datelist[] = { "%a, %d %b %Y %H:%M:%S %Z", /* RFC 822 */ "%A, %d-%b-%y %H:%M:%S %Z", /* RFC 850 */ "%a %b %e %H:%M:%S %Y", /* asctime() */ }; #define DATELISTSIZ arraysize(datelist) static VOID NEAR vhttplog(fmt, args) CONST char *fmt; va_list args; { XFILE *fp; if (!logheader || !htmllogfile) /*EMPTY*/; else if (!httplogfile || strpathcmp(httplogfile, htmllogfile)) htmllog(logheader); if (!httplogfile || !isrootdir(httplogfile)) return; if (!(fp = Xfopen(httplogfile, "a"))) return; if (logheader) { VOID_C Xfputs(logheader, fp); Xfree(logheader); logheader = NULL; } VOID_C Xvfprintf(fp, fmt, args); VOID_C Xfclose(fp); } #ifdef USESTDARGH /*VARARGS1*/ static VOID NEAR httplog(CONST char *fmt, ...) #else /*VARARGS1*/ static VOID NEAR httplog(fmt, va_alist) CONST char *fmt; va_dcl #endif { va_list args; VA_START(args, fmt); vhttplog(fmt, args); va_end(args); } static char *NEAR httprecv(fp) XFILE *fp; { char *buf; buf = Xfgets(fp); if (!buf) return(NULL); httplog("<-- \"%s\"\n", buf); return(buf); } #ifdef USESTDARGH /*VARARGS2*/ static int NEAR httpsend(XFILE *fp, CONST char *fmt, ...) #else /*VARARGS2*/ static int NEAR httpsend(fp, fmt, va_alist) XFILE *fp; CONST char *fmt; va_dcl #endif { va_list args; char buf[URLMAXCMDLINE + 1]; int n; VA_START(args, fmt); n = Xvsnprintf(buf, sizeof(buf), fmt, args); va_end(args); if (n < 0) return(-1); httplog("--> \"%s\"\n", buf); n = Xfputs(buf, fp); if (n >= 0) n = fputnl(fp); return(n); } static int NEAR getcode(s, verp) CONST char *s; int *verp; { int i, n; if (Xstrncasecmp(s, HTTPSTR, strsize(HTTPSTR))) return(-1); s += strsize(HTTPSTR); if (!(s = Xsscanf(s, "% flags & HFL_DISCONNECT) { safefclose(urlhostlist[uh].fp); urlhostlist[uh].fp = NULL; errno = duperrno; return; } if ((urlhostlist[uh].http) -> flags & HFL_CHUNKED) /*EMPTY*/; else if (!((urlhostlist[uh].http) -> flags & HFL_CLENGTH)) return; else if ((urlhostlist[uh].http) -> flags & HFL_BODYLESS) return; else if (!((urlhostlist[uh].http) -> clength)) return; fd = Xfileno(urlhostlist[uh].fp); urlputopenlist(fd, uh, NULL, O_RDONLY); putopenfd(DEV_HTTP, fd); Xsettimeout(urlhostlist[uh].fp, URLENDTIMEOUT); for (;;) { cp = httprecv(urlhostlist[uh].fp); if (!cp) break; Xfree(cp); } Xsettimeout(urlhostlist[uh].fp, urltimeout); VOID_C delopenfd(fd); urldelopenlist(fd); errno = duperrno; } static int NEAR server(uh, s) int uh; CONST char *s; { char *cp; ALLOC_T len; len = ((cp = Xstrchr(s, '/'))) ? cp - s : strlen(s); (urlhostlist[uh].http) -> server = Xstrndup(s, len); return(0); } static int NEAR contentlength(uh, s) int uh; CONST char *s; { off_t len; if (!Xsscanf(s, "%<*d%$", sizeof(len), &len)) return(-1); (urlhostlist[uh].http) -> clength = len; (urlhostlist[uh].http) -> flags |= HFL_CLENGTH; return(0); } static int NEAR contenttype(uh, s) int uh; CONST char *s; { char **argv; ALLOC_T ptr, top; int n, argc; argv = (char **)Xmalloc(sizeof(*argv)); argc = 0; for (ptr = (ALLOC_T)0; s[ptr]; ptr++) { while (Xisblank(s[ptr])) ptr++; if (!s[ptr]) break; argv = (char **)Xrealloc(argv, (argc + 2) * sizeof(*argv)); top = ptr; for (; s[ptr]; ptr++) if (s[ptr] == ';') break; argv[argc++] = Xstrndup(&(s[top]), ptr - top); if (!s[ptr]) break; } argv[argc] = NULL; n = getcharset(argv); freevar(argv); if (n >= 0) (urlhostlist[uh].http) -> charset = n; return(0); } static int NEAR lastmodified(uh, s) int uh; CONST char *s; { struct tm tm; time_t t; int i, tz; for (i = 0; i < DATELISTSIZ; i++) if (Xstrptime(s, datelist[i], &tm, &tz) >= 0) break; if (i >= DATELISTSIZ || (t = Xtimegm(&tm)) == (time_t)-1) return(seterrno(EINVAL)); (urlhostlist[uh].http) -> mtim = t + tz * 60; (urlhostlist[uh].http) -> flags |= HFL_MTIME; return(0); } static int NEAR location(uh, s) int uh; CONST char *s; { urlhost_t tmp; char *host; int n, ptr, type; ptr = urlparse(s, NULL, &host, &type, UPF_ALLOWNONURL | UPF_ALLOWABSPATH); if (ptr < 0) return(-1); if (host) { n = urlgethost(host, &tmp); if (n < 0 || !(tmp.host)) { Xfree(host); urlfreehost(&tmp); return(-1); } if (tmp.port < 0) tmp.port = urlgetport(type); if (tmp.port == urlhostlist[uh].host.port && type == urlhostlist[uh].type && !cmpsockaddr(tmp.host, urlhostlist[uh].host.host)) Xfree(host); else { (urlhostlist[uh].http) -> flags |= HFL_OTHERHOST; Xfree((urlhostlist[uh].http) -> location.host); (urlhostlist[uh].http) -> location.host = host; (urlhostlist[uh].http) -> location.type = type; } urlfreehost(&tmp); } Xfree((urlhostlist[uh].http) -> location.path); (urlhostlist[uh].http) -> location.path = Xstrdup(&(s[ptr])); (urlhostlist[uh].http) -> flags |= HFL_LOCATION; return(0); } static int NEAR connection(uh, s) int uh; CONST char *s; { if (Xstrcasecmp(s, CLOSESTR)) return(0); (urlhostlist[uh].http) -> flags |= HFL_DISCONNECT; return(0); } static int NEAR authenticate(uh, s, flags) int uh; CONST char *s; int flags; { CONST char *cp; for (cp = s; *cp && !Xisblank(*cp); cp++) /*EMPTY*/; if (!Xstrncasecmp(s, AUTHBASIC, cp - s)) (urlhostlist[uh].http) -> digest = NULL; else if (!Xstrncasecmp(s, AUTHDIGEST, cp - s)) (urlhostlist[uh].http) -> digest = Xstrdup(skipspace(++cp)); else return(0); (urlhostlist[uh].http) -> flags |= flags; return(0); } static int NEAR www_authenticate(uh, s) int uh; CONST char *s; { return(authenticate(uh, s, HFL_AUTHED)); } static int NEAR proxy_authenticate(uh, s) int uh; CONST char *s; { return(authenticate(uh, s, HFL_PROXYAUTHED)); } static int NEAR chunked(uh, s) int uh; CONST char *s; { if (Xstrcasecmp(s, CHUNKEDSTR)) return(0); (urlhostlist[uh].http) -> chunk = 0; (urlhostlist[uh].http) -> flags |= HFL_CHUNKED; return(0); } VOID httpreset(uh, level) int uh, level; { if (!(urlhostlist[uh].http)) return; if (level > 0) { Xfree((urlhostlist[uh].http) -> server); Xfree((urlhostlist[uh].http) -> location.host); Xfree((urlhostlist[uh].http) -> location.path); Xfree((urlhostlist[uh].http) -> digest); } (urlhostlist[uh].http) -> version = -1; (urlhostlist[uh].http) -> clength = (off_t)0; (urlhostlist[uh].http) -> server = (urlhostlist[uh].http) -> location.host = (urlhostlist[uh].http) -> location.path = (urlhostlist[uh].http) -> digest = NULL; (urlhostlist[uh].http) -> location.type = TYPE_UNKNOWN; (urlhostlist[uh].http) -> charset = NOCNV; (urlhostlist[uh].http) -> chunk = -1; (urlhostlist[uh].http) -> flags = 0; if (level > 1) { Xfree(urlhostlist[uh].http); urlhostlist[uh].http = NULL; } } int httpgetreply(uh, sp) int uh; char **sp; { char *cp, *tmp, *buf; ALLOC_T len, size; int i, code; if (!(urlhostlist[uh].http)) return(seterrno(EINVAL)); httpreset(uh, 1); buf = httprecv(urlhostlist[uh].fp); if (!buf) { if (!urlferror(urlhostlist[uh].fp)) return(HTTP_NOREPLY); return(-1); } if ((code = getcode(buf, &i)) < 0) { Xfree(buf); return(seterrno(EINVAL)); } (urlhostlist[uh].http) -> version = i; size = strlen(buf); for (;;) { cp = httprecv(urlhostlist[uh].fp); if (!cp) { Xfree(buf); if (!urlferror(urlhostlist[uh].fp)) return(HTTP_NOREPLY); return(-1); } if (!*cp) { Xfree(cp); break; } for (i = 0; i < FLDLISTSIZ; i++) { if (Xstrncasecmp(cp, fldlist[i].ident, fldlist[i].len)) continue; if (cp[fldlist[i].len] == ':') break; } if (i < FLDLISTSIZ) { tmp = skipspace(&(cp[fldlist[i].len + 1])); VOID_C (*(fldlist[i].func))(uh, tmp); } len = strlen(cp); buf = Xrealloc(buf, size + 1 + len + 1); buf[size++] = '\n'; memcpy(&(buf[size]), cp, len + 1); size += len; Xfree(cp); } if (sp) *sp = buf; else Xfree(buf); return(code); } int httpseterrno(n) int n; { if (n < 0) return(-1); switch (n / 100) { case HTTP_SUCCESS: n = 0; break; case HTTP_REDIRECT: n = seterrno(ENOENT); break; case HTTP_CLIERROR: switch (n) { case 401: case 403: case 405: case 406: case 407: n = seterrno(EACCES); break; case 404: n = seterrno(ENOENT); break; case 408: n = seterrno(ETIMEDOUT); break; default: n = seterrno(EINVAL); break; } break; default: n = seterrno(EIO); break; } return(n); } int vhttpcommand(uh, sp, cmd, args) int uh; char **sp; int cmd; va_list args; { CONST char *s, *path, *auth, *proxyauth; char *new, buf[URLMAXCMDLINE + 1]; int n, flags; if (sp) *sp = NULL; if (!(urlhostlist[uh].http) || cmd < 0 || cmd >= CMDLISTSIZ) return(seterrno(EINVAL)); path = va_arg(args, CONST char *); auth = va_arg(args, CONST char *); proxyauth = va_arg(args, CONST char *); new = NULL; if ((urlhostlist[uh].flags & UFL_PROXIED) && !isurl(path, UPF_ALLOWANYSCHEME)) { flags = (UGP_SCHEME | UGP_HOST | UGP_ENCODE); if (urlhostlist[uh].type == TYPE_FTP) flags |= UGP_USER; n = urlgenpath(uh, buf, sizeof(buf), flags); if (n < 0) return(-1); n = Xasprintf(&new, "%s%s", buf, path); if (n < 0) return(-1); path = new; } if (urlgenpath(uh, buf, sizeof(buf), UGP_HOST | UGP_ENCODE) < 0) { Xfree(new); return(-1); } for (;;) { n = httpsend(urlhostlist[uh].fp, "%s %s %s%d.%d", cmdlist[cmd].cmd, path, HTTPSTR, HTTPMAJ, HTTPMIN); if (n < 0) break; #ifdef FD s = getversion(&n); n = httpsend(urlhostlist[uh].fp, "User-Agent: FDclone/%-.*s", n, s); if (n < 0) break; #endif s = (urlhostlist[uh].flags & UFL_PROXIED) ? "Proxy-" : nullstr; n = httpsend(urlhostlist[uh].fp, "Host: %s", buf); if (n < 0) break; n = httpsend(urlhostlist[uh].fp, "Accept: */*"); if (n < 0) break; n = httpsend(urlhostlist[uh].fp, "%sConnection: Keep-Alive", s); if (n < 0) break; if (auth) { n = httpsend(urlhostlist[uh].fp, "Authorization: %s", auth); if (n < 0) break; } if (proxyauth) { n = httpsend(urlhostlist[uh].fp, "Proxy-Authorization: %s", proxyauth); if (n < 0) break; } n = httpsend(urlhostlist[uh].fp, nullstr); if (n < 0) break; n = urlgetreply(uh, sp); if (cmd == HTTP_HEAD) (urlhostlist[uh].http) -> flags |= HFL_BODYLESS; if (n != HTTP_NOREPLY) break; if (urlreconnect(uh) < 0) break; } Xfree(new); return(n); } static int NEAR _httpcommand(uh, cmd, path) int uh, cmd; CONST char *path; { urlhost_t *hp; httpstat_t *http; char *path2, *auth, *proxyauth; int i, n, cnt, dupcmd; i = -1; cnt = 0; dupcmd = cmd; hp = NULL; http = urlhostlist[uh].http; path2 = urlencode(path, -1, URL_UNSAFEPATH); auth = proxyauth = NULL; for (;;) { n = urlcommand(uh, NULL, cmd, path2, auth, proxyauth); if (n >= 0 && n != 401 && hp == &(urlhostlist[uh].host)) authentry(hp, urlhostlist[uh].type); if (urlhostlist[uh].type != TYPE_FTP) { Xfree(urlhostlist[uh].host.user); urlhostlist[uh].host.user = NULL; } Xfree(urlhostlist[uh].host.pass); urlhostlist[uh].host.pass = NULL; /* Some buggy Apache cannot authorize except with GET method */ if (!(urlhostlist[uh].flags & UFL_PROXIED) && http -> digest && cmd == HTTP_HEAD) cmd = HTTP_GET; if (n == 401) { hp = &(urlhostlist[uh].host); if (!(http -> flags & HFL_AUTHED)) break; i = authfind(hp, urlhostlist[uh].type, i); if (i < 0) { i = 0; if (urlhostlist[uh].type != TYPE_FTP) { hp -> user = authgetuser(); if (!(hp -> user)) break; } hp -> pass = authgetpass(); if (urlhostlist[uh].type == TYPE_FTP) { if (*(hp -> pass)) cnt = 0; else if (cnt++ > 0) break; } } Xfree(auth); auth = authencode(&(urlhostlist[uh].host), http -> digest, cmdlist[cmd].cmd, path2); if (!auth) break; } else if (n == 407) { hp = NULL; if (!(http -> flags & HFL_PROXYAUTHED)) break; if (!(urlhostlist[uh].proxy.user) || !(urlhostlist[uh].proxy.pass)) break; if (proxyauth) break; proxyauth = authencode(&(urlhostlist[uh].proxy), http -> digest, cmdlist[cmd].cmd, path2); if (!proxyauth) break; i = -1; } else break; httpflush(uh); } if (n >= 0 && dupcmd == HTTP_HEAD && cmd == HTTP_GET) httpflush(uh); Xfree(path2); Xfree(auth); Xfree(proxyauth); return(n); } static int NEAR httpcommand(uh, cmd, path, isdirp) int uh, cmd; CONST char *path; int *isdirp; { CONST char *cp, *s; char buf[MAXPATHLEN]; int n, isdir; isdir = (isdirp) ? *isdirp : -1; for (;;) { s = path; if (isdirp) { if (*isdirp < 1 && (cp = strrdelim(path, 0)) && (!*(++cp) || isdotdir(cp))) { if (!*isdirp) { (urlhostlist[uh].http) -> flags = 0; return(seterrno(EISDIR)); } *isdirp = 1; } if (*isdirp) { VOID_C strcatdelim2(buf, path, NULL); s = buf; } } if ((n = _httpcommand(uh, cmd, s)) < 0) break; if (n / 100 == HTTP_SUCCESS) { if (isdirp && s == buf && !lazyproxy(uh)) *isdirp = 1; break; } if (n == 404 && isdirp && *isdirp < 0 && s == buf) { httpflush(uh); *isdirp = 0; continue; } if (n / 100 != HTTP_REDIRECT || n == 305) break; if (!((urlhostlist[uh].http) -> flags & HFL_LOCATION)) break; if ((urlhostlist[uh].http) -> flags & HFL_OTHERHOST) return(n); path = (urlhostlist[uh].http) -> location.path; httpflush(uh); if (isdirp) *isdirp = isdir; } (urlhostlist[uh].http) -> flags &= ~HFL_OTHERHOST; return(n); } static char *httpfgets(vp) VOID_P vp; { char *buf; if (!(buf = htmlfgets((htmlstat_t *)vp))) return(NULL); httplog(" \"%s\"\n", buf); return(buf); } int httprecvlist(uh, path, listp) int uh; CONST char *path; namelist **listp; { htmlstat_t html; char *cp; int n, fd, max, isdir; if (!(urlhostlist[uh].http)) return(seterrno(EINVAL)); isdir = 1; n = httpcommand(uh, HTTP_GET, path, &isdir); if (httpseterrno(n) < 0) { if (n >= 0) httpflush(uh); return(-1); } *listp = NULL; httplog("<-- (body)\n"); htmlinit(&html, urlhostlist[uh].fp, path); fd = Xfileno(urlhostlist[uh].fp); urlputopenlist(fd, uh, NULL, O_RDONLY); putopenfd(DEV_HTTP, fd); max = lsparse(&html, &httpformat, listp, httpfgets); VOID_C delopenfd(fd); urldelopenlist(fd); if ((urlhostlist[uh].http) -> charset != NOCNV) /*EMPTY*/; else if (html.charset != NOCNV) (urlhostlist[uh].http) -> charset = html.charset; else (urlhostlist[uh].http) -> charset = urlkcode; htmlfree(&html); httpflush(uh); if (*listp) for (n = 0; n < max; n++) { cp = (*listp)[n].name; if (!cp) continue; (*listp)[n].name = urldecode(cp, -1); Xfree(cp); } /* * Some FTP proxy will forced to disconnect socket, * even if it says "Proxy-Connection: keep-alive". */ if (urlhostlist[uh].type == TYPE_FTP) { (urlhostlist[uh].http) -> flags |= HFL_DISCONNECT; safefclose(urlhostlist[uh].fp); urlhostlist[uh].fp = NULL; } return(max); } static int NEAR recvhead(uh, path, isdirp) int uh; CONST char *path; int *isdirp; { int n, cmd; cmd = (urlhostlist[uh].flags & UFL_PROXIED) ? HTTP_GET : HTTP_HEAD; if ((n = httpcommand(uh, cmd, path, isdirp)) < 0) return(-1); if (cmd == HTTP_HEAD) httpflush(uh); else { (urlhostlist[uh].http) -> flags |= HFL_DISCONNECT; safefclose(urlhostlist[uh].fp); urlhostlist[uh].fp = NULL; } return(n); } int httprecvstatus(uh, path, namep, st, entp) int uh; CONST char *path; namelist *namep; int st, *entp; { namelist *tmp; CONST char *cp; char buf[MAXPATHLEN]; int n, isdir; isdir = -1; if (!(urlhostlist[uh].http)) return(seterrno(EINVAL)); if (!entp) /*EMPTY*/; else if (st < 0 || st >= maxurlstat) { if (!(cp = urlsplitpath(buf, sizeof(buf), path))) return(-1); *entp = 0; st = urlnewstatlist(uh, addlist(NULL, *entp, NULL), 1, buf); initlist(&(urlstatlist[st].list[*entp]), cp); } else if (*entp < 0 || *entp >= urlstatlist[st].max) { if (urlstatlist[st].flags & UFL_FULLLIST) return(seterrno(ENOENT)); if (!(cp = urlsplitpath(NULL, (ALLOC_T)0, path))) return(-1); *entp = (urlstatlist[st].max)++; urlstatlist[st].list = addlist(urlstatlist[st].list, *entp, NULL); initlist(&(urlstatlist[st].list[*entp]), cp); } else if (!(urlhostlist[uh].options & UOP_FULLSTAT)) return(st); else isdir = (isdir(&(urlstatlist[st].list[*entp]))) ? 1 : 0; tmp = (entp) ? &(urlstatlist[st].list[*entp]): NULL; if (tmp && ismark(tmp) && wasmark(tmp)) return(st); n = recvhead(uh, path, &isdir); if (httpseterrno(n) < 0) { if (n >= 0) { if (namep) namep -> tmpflags |= (F_ISMRK | F_WSMRK); if (tmp) tmp -> tmpflags |= (F_ISMRK | F_WSMRK); } return(-1); } if (isdir > -1) /*EMPTY*/; else if ((urlhostlist[uh].http) -> flags & (HFL_CLENGTH | HFL_MTIME)) /*EMPTY*/; else if (urlhostlist[uh].type != TYPE_FTP) isdir = 1; if (isdir > 0) { if (namep) todirlist(namep, (u_int)-1); if (tmp) todirlist(tmp, (u_int)-1); } if ((urlhostlist[uh].http) -> flags & HFL_CLENGTH) { if (namep && !ismark(namep)) namep -> st_size = (urlhostlist[uh].http) -> clength; if (tmp && !ismark(tmp)) tmp -> st_size = (urlhostlist[uh].http) -> clength; } if ((urlhostlist[uh].http) -> flags & HFL_MTIME) { if (namep && !wasmark(namep)) namep -> st_mtim = (urlhostlist[uh].http) -> mtim; if (tmp && !wasmark(tmp)) tmp -> st_mtim = (urlhostlist[uh].http) -> mtim; } if (namep) namep -> tmpflags |= (F_ISMRK | F_WSMRK); if (tmp) tmp -> tmpflags |= (F_ISMRK | F_WSMRK); return(st); } int httpchdir(uh, path) int uh; CONST char *path; { namelist tmp; int n; if (!(urlhostlist[uh].http)) return(seterrno(EINVAL)); if (!strpathcmp(path, (urlhostlist[uh].http) -> cwd)) return(uh); n = urltracelink(&uh, path, &tmp, NULL); if (urlhostlist[uh].redirect) path = urlhostlist[uh].redirect; if (n < 0) return(-1); if (--n >= 0) urlfreestatlist(n); #ifndef NOSYMLINK Xfree(tmp.linkname); #endif if (!isdir(&tmp)) return(seterrno(ENOTDIR)); Xstrncpy((urlhostlist[uh].http) -> cwd, path, MAXPATHLEN - 1); return(uh); } char *httpgetcwd(uh, path, size) int uh; char *path; ALLOC_T size; { int n, flags; if (!(urlhostlist[uh].http)) { errno = EINVAL; return(NULL); } flags = (UGP_SCHEME | UGP_HOST | UGP_CWD); if (urlhostlist[uh].type == TYPE_FTP) flags |= UGP_USER; n = urlgenpath(uh, path, size, flags); if (n < 0) return(NULL); return(path); } /*ARGSUSED*/ int httpchmod(uh, path, mode) int uh; CONST char *path; int mode; { return(seterrno(EACCES)); } /*ARGSUSED*/ int httpunlink(uh, path) int uh; CONST char *path; { return(seterrno(EACCES)); } /*ARGSUSED*/ int httprename(uh, from, to) int uh; CONST char *from, *to; { if (!strpathcmp(from, to)) return(0); return(seterrno(EACCES)); } int httpopen(uh, path, flags) int uh; CONST char *path; int flags; { int n, fd, isdir; if (!(urlhostlist[uh].http)) return(seterrno(EINVAL)); switch (flags & O_ACCMODE) { case O_RDONLY: break; default: return(seterrno(EACCES)); /*NOTREACHED*/ break; } isdir = 0; n = httpcommand(uh, HTTP_GET, path, &isdir); if (httpseterrno(n) < 0) { if (n >= 0) httpflush(uh); return(-1); } fd = Xfileno(urlhostlist[uh].fp); return(fd); } int httpclose(uh, fd) int uh, fd; { char buf[BUFSIZ]; int n; if (!(urlhostlist[uh].http)) return(seterrno(EINVAL)); if (!(urlhostlist[uh].fp)) return(0); n = 0; if (((urlhostlist[uh].http) -> flags & HFL_CLENGTH)) { while ((urlhostlist[uh].http) -> clength > (off_t)0) { if ((urlhostlist[uh].http) -> clength > MAXFLUSH) break; n = checkread(fd, buf, sizeof(buf), URLENDTIMEOUT); if (n <= 0) break; (urlhostlist[uh].http) -> clength -= (off_t)n; } if ((urlhostlist[uh].http) -> clength > (off_t)0) { safefclose(urlhostlist[uh].fp); urlhostlist[uh].fp = NULL; } } httpflush(uh); return(n); } int httpfstat(uh, stp) int uh; struct stat *stp; { if (!(urlhostlist[uh].http)) return(seterrno(EINVAL)); if ((urlhostlist[uh].http) -> flags & HFL_CLENGTH) stp -> st_size = (urlhostlist[uh].http) -> clength; else stp -> st_size = (off_t)-1; if ((urlhostlist[uh].http) -> flags & HFL_MTIME) stp -> st_mtime = (urlhostlist[uh].http) -> mtim; return(0); } static int NEAR chunkgetc(fd) int fd; { u_char uc; int n; for (;;) { if ((n = read(fd, &uc, sizeof(uc))) > 0) break; else if (!n) continue; #ifdef EAGAIN else if (errno == EAGAIN) continue; #endif #ifdef EWOULDBLOCK else if (errno == EWOULDBLOCK) continue; #endif else if (errno != EINTR) return(-1); } return((int)uc); } static int NEAR getchunk(uh, fd) int uh, fd; { int n, c, ext, chunk; if ((urlhostlist[uh].http) -> chunk) return(0); n = ext = chunk = 0; for (;;) { if ((c = chunkgetc(fd)) < 0) return(-1); if (c == '\r') { if ((c = chunkgetc(fd)) < 0) return(-1); if (c != '\n' || !n) return(seterrno(EINVAL)); break; } if (c == ';') ext++; if (!ext) { c = Xtolower(c); if (Xisdigit(c)) c -= '0'; else if (Xisxdigit(c)) c -= 'a' - 10; else return(seterrno(EINVAL)); chunk = (chunk << 4) + c; n++; } } (urlhostlist[uh].http) -> chunk = chunk; return(0); } static int NEAR gettrailer(fd) int fd; { int n, c; n = 0; for (;;) { if ((c = chunkgetc(fd)) < 0) return(-1); if (c == '\r') { if ((c = chunkgetc(fd)) < 0) return(-1); if (c != '\n') return(seterrno(EINVAL)); break; } n++; } return(n); } int httpread(uh, fd, buf, nbytes) int uh, fd; char *buf; int nbytes; { int n; if (!(urlhostlist[uh].http)) return(seterrno(EINVAL)); if ((urlhostlist[uh].http) -> flags & HFL_CHUNKED) { if ((urlhostlist[uh].http) -> chunk < 0) return(0); if (getchunk(uh, fd) < 0) return(-1); if (!((urlhostlist[uh].http) -> chunk)) { (urlhostlist[uh].http) -> chunk = -1; for (;;) { if ((n = gettrailer(fd)) < 0) return(-1); if (!n) break; } return(0); } if (nbytes > (urlhostlist[uh].http) -> chunk) nbytes = (urlhostlist[uh].http) -> chunk; } if ((urlhostlist[uh].http) -> flags & HFL_CLENGTH) { if (!((urlhostlist[uh].http) -> clength)) return(0); if (nbytes > (urlhostlist[uh].http) -> clength) nbytes = (urlhostlist[uh].http) -> clength; } if ((n = read(fd, buf, nbytes)) < 0) return(n); nbytes = n; if ((urlhostlist[uh].http) -> flags & HFL_CLENGTH) (urlhostlist[uh].http) -> clength -= (off_t)nbytes; if ((urlhostlist[uh].http) -> flags & HFL_CHUNKED) { (urlhostlist[uh].http) -> chunk -= nbytes; if (!((urlhostlist[uh].http) -> chunk)) { if ((n = gettrailer(fd)) < 0) return(-1); if (n) return(seterrno(EINVAL)); } } return(nbytes); } /*ARGSUSED*/ int httpwrite(uh, fd, buf, nbytes) int uh, fd; CONST char *buf; int nbytes; { if (!(urlhostlist[uh].http)) return(seterrno(EINVAL)); return(seterrno(EACCES)); } /*ARGSUSED*/ int httpmkdir(uh, path) int uh; CONST char *path; { return(seterrno(EACCES)); } /*ARGSUSED*/ int httprmdir(uh, path) int uh; CONST char *path; { return(seterrno(EACCES)); } static int NEAR isredirect(uh) int uh; { if (uh < 0 || uh >= maxurlhost) return(-1); if (urlhostlist[uh].prototype != TYPE_HTTP) return(-1); if (!(urlhostlist[uh].http)) return(-1); if (!((urlhostlist[uh].http) -> flags & HFL_LOCATION)) return(-1); if (!((urlhostlist[uh].http) -> flags & HFL_OTHERHOST)) return(-1); if (!((urlhostlist[uh].http) -> location.host)) return(-1); if (!((urlhostlist[uh].http) -> location.path)) return(-1); return(0); } static int NEAR reopendev(uh) int uh; { httpstat_t *http; int duperrno; if (isredirect(uh) < 0) return(-1); duperrno = errno; http = urlhostlist[uh].http; uh = urlopendev(http -> location.host, http -> location.type); if (uh >= 0) { Xfree(urlhostlist[uh].redirect); urlhostlist[uh].redirect = Xstrdup(http -> location.path); } errno = duperrno; return(uh); } int httpreopen(uh, flags) int uh, flags; { httpstat_t *http; int fd, duperrno; if (isredirect(uh) < 0) return(-1); duperrno = errno; http = urlhostlist[uh].http; fd = urlopen(http -> location.host, http -> location.type, http -> location.path, flags); if (fd > 0) urlclosedev(uh); errno = duperrno; return(fd); } /*ARGSUSED*/ int httprerecvlist(uhp, listp) int *uhp; namelist **listp; { int n, uh, duperrno; if (!uhp) return(-1); if ((uh = reopendev(*uhp)) < 0) return(-1); duperrno = errno; n = urlrecvlist(&uh, urlhostlist[uh].redirect, 0); if (n < 0) urlclosedev(uh); else { urlclosedev(*uhp); *uhp = uh; } errno = duperrno; return(n); } int httprerecvstatus(uhp, namep, entp) int *uhp; namelist *namep; int *entp; { int n, uh, duperrno; if (!uhp) return(-1); if ((uh = reopendev(*uhp)) < 0) return(-1); duperrno = errno; n = urlrecvstatus(&uh, urlhostlist[uh].redirect, namep, entp, 1); if (n < 0) urlclosedev(uh); else { urlclosedev(*uhp); *uhp = uh; } errno = duperrno; return(n); } #endif /* DEP_HTTPPATH */ FD-3.01j/urldisk.c100644 2105 1751 74454 13516612560 12540 0ustar shiraiuser/* * urldisk.c * * URL disk accessing module */ #include "headers.h" #include "depend.h" #include "printf.h" #include "string.h" #include "malloc.h" #include "time.h" #include "sysemu.h" #include "pathname.h" #include "termio.h" #include "realpath.h" #include "lsparse.h" #include "socket.h" #include "urldisk.h" typedef struct _urlopen_t { int fd; int uh; char *path; int flags; } urlopen_t; #ifdef DEP_URLPATH static VOID NEAR urllog __P_((CONST char *, ...)); static int NEAR validhost __P_((int, int)); static VOID NEAR urlfreestat __P_((int)); static int NEAR validdir __P_((sockDIR *)); static VOID NEAR checkintr __P_((int, int)); static int NEAR urlconnect __P_((urldev_t *)); static int NEAR entryorder __P_((int)); static int NEAR _urlclosedev __P_((int, int)); static VOID NEAR copystat __P_((struct stat *, namelist *)); static int NEAR urlgetopenlist __P_((int)); static int NEAR _urlclose __P_((int, CONST char *)); int urloptions = 0; int urltimeout = 0; urldev_t urlhostlist[URLNOFILE]; int maxurlhost = 0; urlstat_t *urlstatlist = NULL; int maxurlstat = 0; char *logheader = NULL; static int urlorder[URLNOFILE]; static int maxurlorder = 0; static int lastst = -1; static urlopen_t *urlopenlist = NULL; static int maxurlopen = 0; #ifdef USESTDARGH /*VARARGS1*/ static VOID NEAR urllog(CONST char *fmt, ...) #else /*VARARGS1*/ static VOID NEAR urllog(fmt, va_alist) CONST char *fmt; va_dcl #endif { va_list args; struct tm *tm; time_t t; char *cp; int n; Xfree(logheader); logheader = NULL; t = Xtime(NULL); tm = localtime(&t); n = Xasprintf(&cp, "[%04d/%02d/%02d %02d:%02d:%02d]: %s", tm -> tm_year + 1900, tm -> tm_mon + 1, tm -> tm_mday, tm -> tm_hour, tm -> tm_min, tm -> tm_sec, fmt); if (n < 0) return; VA_START(args, fmt); VOID_C Xvasprintf(&logheader, cp, args); va_end(args); Xfree(cp); } VOID urlfreestatlist(n) int n; { if (n < 0 || n >= maxurlstat) return; if (urlstatlist[n].nlink > 0 && --(urlstatlist[n].nlink)) return; freelist(urlstatlist[n].list, urlstatlist[n].max); Xfree(urlstatlist[n].path); urlstatlist[n].uh = -1; urlstatlist[n].max = -1; urlstatlist[n].list = NULL; urlstatlist[n].path = NULL; while (maxurlstat > 0 && urlstatlist[maxurlstat - 1].uh < 0) maxurlstat--; if (!maxurlstat) { Xfree(urlstatlist); urlstatlist = NULL; } } static int NEAR validhost(uh, conn) int uh, conn; { if (uh < 0 || uh >= maxurlhost) return(seterrno(EBADF)); if (conn && !(urlhostlist[uh].fp)) { #ifdef DEP_HTTPPATH if (urlhostlist[uh].http && ((urlhostlist[uh].http) -> flags & HFL_DISCONNECT)) return(urlreconnect(uh)); #endif errno = (urlhostlist[uh].flags & UFL_INTRED) ? EINTR : EBADF; return(-1); } return(0); } static VOID NEAR urlfreestat(uh) int uh; { int n; if (validhost(uh, 0) < 0) return; for (n = 0; n < maxurlstat; n++) if (uh == urlstatlist[n].uh) { if (n == lastst) lastst = -1; urlstatlist[n].nlink = 0; urlfreestatlist(n); } } static int NEAR validdir(dirp) sockDIR *dirp; { if (!dirp || dirp -> dd_id != SID_IFURLDRIVE || validhost(dirp -> dd_fd, 0) < 0 || dirp -> dd_size < 0 || dirp -> dd_size >= maxurlstat) return(seterrno(EINVAL)); return(0); } int urlferror(fp) XFILE *fp; { return((errno == EINTR) ? -1 : Xferror(fp)); } static VOID NEAR checkintr(uh, val) int uh, val; { if (val >= 0 || errno != EINTR || validhost(uh, 0) < 0) return; safefclose(urlhostlist[uh].fp); urlhostlist[uh].fp = NULL; urlhostlist[uh].flags &= ~UFL_LOCKED; urlhostlist[uh].flags |= UFL_INTRED; } int urlgetreply(uh, sp) int uh; char **sp; { int n; if (validhost(uh, 1) < 0) return(-1); switch (urlhostlist[uh].prototype) { #ifdef DEP_FTPPATH case TYPE_FTP: n = ftpgetreply(urlhostlist[uh].fp, sp); break; #endif #ifdef DEP_HTTPPATH case TYPE_HTTP: n = httpgetreply(uh, sp); break; #endif default: n = 0; break; } checkintr(uh, n); return(n); } #ifdef USESTDARGH /*VARARGS3*/ int urlcommand(int uh, char **sp, int cmd, ...) #else /*VARARGS3*/ int urlcommand(uh, sp, cmd, va_alist) int uh; char **sp; int cmd; va_dcl #endif { va_list args; int n; if (validhost(uh, 1) < 0) return(-1); VA_START(args, cmd); switch (urlhostlist[uh].prototype) { #ifdef DEP_FTPPATH case TYPE_FTP: n = vftpcommand(uh, sp, cmd, args); break; #endif #ifdef DEP_HTTPPATH case TYPE_HTTP: n = vhttpcommand(uh, sp, cmd, args); break; #endif default: n = 0; break; } va_end(args); return(n); } static int NEAR urlconnect(devp) urldev_t *devp; { urlhost_t *hp; XFILE *fp; char *cp, *url; int s, type; if (devp -> proxy.port >= 0) hp = (devp -> flags & UFL_PROXIED) ? &(devp -> proxy) : &(devp -> host); else { switch (devp -> type) { #ifdef DEP_FTPPATH case TYPE_FTP: url = ftpproxy; break; #endif #ifdef DEP_HTTPPATH case TYPE_HTTP: url = httpproxy; break; #endif default: url = NULL; break; } if (urlparse(url, NULL, &cp, &type, 0) <= 0 || urlgethost(cp, &(devp -> proxy)) < 0 || !(devp -> proxy.host)) { hp = &(devp -> host); devp -> proxy.port = 0; devp -> prototype = devp -> type; } else { hp = &(devp -> proxy); switch (type) { #ifdef DEP_FTPPATH case TYPE_FTP: if (devp -> type != TYPE_FTP) hp = NULL; break; #endif #ifdef DEP_HTTPPATH case TYPE_HTTP: break; #endif default: hp = NULL; break; } if (!hp) return(seterrno(ENOENT)); devp -> prototype = type; devp -> flags |= UFL_PROXIED; if (hp -> port < 0) hp -> port = urlgetport(type); } Xfree(cp); } s = sockconnect(hp -> host, hp -> port, urltimeout, SCK_LOWDELAY); if (s < 0 || !(fp = Xfdopen(s, "r+"))) { urlfreehost(&(devp -> proxy)); safeclose(s); return(-1); } Xsettimeout(fp, urltimeout); Xsetflags(fp, XF_CRNL | XF_NONBLOCK); #ifdef DEP_FTPPATH if (devp -> prototype == TYPE_FTP) { Xsetflags(fp, XF_TELNET); if (ftpseterrno(ftpgetreply(fp, NULL)) < 0) { urlfreehost(&(devp -> proxy)); safefclose(fp); return(-1); } } #endif devp -> fp = fp; return(0); } int urlnewstatlist(uh, list, max, path) int uh; namelist *list; int max; CONST char *path; { int i; for (i = 0; i < maxurlstat; i++) if (urlstatlist[i].uh < 0) break; if (i >= maxurlstat) urlstatlist = (urlstat_t *)Xrealloc(urlstatlist, ++maxurlstat * sizeof(*urlstatlist)); urlstatlist[i].list = list; urlstatlist[i].max = max; urlstatlist[i].uh = uh; urlstatlist[i].nlink = 1; urlstatlist[i].path = Xstrdup(path); urlstatlist[i].flags = 0; return(i); } /*ARGSUSED*/ int urlrecvlist(uhp, path, cacheonly) int *uhp; CONST char *path; int cacheonly; { namelist *tmp, *list; int i, j, n, uh, max; if (!uhp) return(seterrno(EINVAL)); uh = *uhp; for (i = maxurlstat - 1; i >= 0; i--) { if (urlstatlist[i].uh < 0) continue; if (!(urlstatlist[i].path) || !(urlstatlist[i].list)) continue; if (uh != urlstatlist[i].uh) continue; if (!strpathcmp(path, urlstatlist[i].path)) break; } switch (urlhostlist[uh].prototype) { #ifdef DEP_FTPPATH case TYPE_FTP: if (i >= 0) { urlstatlist[i].nlink++; return(i); } max = ftprecvlist(uh, path, &list); break; #endif #ifdef DEP_HTTPPATH case TYPE_HTTP: if (i >= 0) { if (cacheonly || (urlstatlist[i].flags & UFL_FULLLIST)) { urlstatlist[i].nlink++; return(i); } } if (cacheonly) return(seterrno(ENOENT)); max = httprecvlist(uh, path, &list); if (max < 0) return(httprerecvlist(uhp, &list)); break; #endif default: max = -1; break; } if (max < 0) return(-1); if (i < 0) { if ((n = urlnewstatlist(uh, list, max, path)) < 0) { freelist(list, max); return(-1); } } else { n = i; for (i = 0; i < urlstatlist[n].max; i++) { tmp = &(urlstatlist[n].list[i]); for (j = 0; j < max; j++) if (!strpathcmp(tmp -> name, list[j].name)) break; if (j >= max) continue; if (ismark(tmp)) list[j].st_size = tmp -> st_size; if (wasmark(tmp)) list[j].st_mtim = tmp -> st_mtim; } freelist(urlstatlist[n].list, urlstatlist[n].max); urlstatlist[n].list = list; urlstatlist[n].max = max; } urlstatlist[n].flags |= UFL_FULLLIST; return(n); } CONST char *urlsplitpath(buf, size, path) char *buf; ALLOC_T size; CONST char *path; { CONST char *cp; if (*path != _SC_) { errno = EINVAL; return(NULL); } else if (!(cp = strrdelim(&(path[1]), 0))) { if (buf) copyrootpath(buf); cp = (path[1]) ? &(path[1]) : curpath; } else if (buf && Xsnprintf(buf, size, "%-.*s", cp - path, path) < 0) return(NULL); else if (!*(++cp)) cp = curpath; return(cp); } int urlrecvstatus(uhp, path, namep, entp, cacheonly) int *uhp; CONST char *path; namelist *namep; int *entp, cacheonly; { CONST char *cp; char buf[MAXPATHLEN]; int i, n, uh; if (!uhp) return(seterrno(EINVAL)); if (!(cp = urlsplitpath(buf, sizeof(buf), path))) return(-1); if (namep) { initlist(namep, NULL); if (cp == curpath) todirlist(namep, (u_int)-1); } if ((n = urlrecvlist(uhp, buf, cacheonly)) < 0) i = -1; else { for (i = 0; i < urlstatlist[n].max; i++) if (!strpathcmp(cp, urlstatlist[n].list[i].name)) break; if (i >= urlstatlist[n].max) i = seterrno(ENOENT); } uh = *uhp; if (i < 0 && cp != curpath) { if (n >= 0 && urlstatlist[n].flags & UFL_FULLLIST) { urlfreestatlist(n); return(-1); } #ifdef DEP_HTTPPATH if (cacheonly && urlhostlist[uh].prototype == TYPE_HTTP) { n = httprecvstatus(uh, path, namep, n, &i); if (n < 0) return(httprerecvstatus(uhp, namep, entp)); if (entp) *entp = i; return(n + 1); } #endif return(-1); } if (entp) *entp = i; if (namep && i >= 0) { memcpy((char *)namep, (char *)&(urlstatlist[n].list[i]), sizeof(*namep)); #ifndef NOSYMLINK namep -> linkname = Xstrdup(urlstatlist[n].list[i].linkname); #endif } return((n >= 0) ? n + 1 : 0); } int urltracelink(uhp, path, namep, entp) int *uhp; CONST char *path; namelist *namep; int *entp; { #ifndef NOSYMLINK char resolved[MAXPATHLEN]; #endif int n, uh, cacheonly; if (!uhp) return(seterrno(EINVAL)); cacheonly = 1; for (;;) { n = urlrecvstatus(uhp, path, namep, entp, cacheonly); if (n < 0) return(-1); uh = *uhp; #ifdef DEP_HTTPPATH if (urlhostlist[uh].redirect) path = urlhostlist[uh].redirect; /* * Some FTP proxy ignores any '/' at the end of pathname, * so that the additional '/' cannot tell if it is a directory. * Then we need to scan its parent directory. */ if (cacheonly && lazyproxy(uh) && n > 0 && !(urlstatlist[n - 1].flags & UFL_FULLLIST)) { cacheonly = 0; urlfreestatlist(--n); continue; } #endif /* DEP_HTTPPATH */ #ifdef NOSYMLINK break; #else /* !NOSYMLINK */ if (!islink(namep)) break; if (--n >= 0) urlfreestatlist(n); path = symrealpath(path, namep -> linkname, resolved, RLP_PSEUDOPATH); if (!path) return(-1); Xfree(namep -> linkname); #endif /* !NOSYMLINK */ } return(n); } int urlreconnect(uh) int uh; { safefclose(urlhostlist[uh].fp); urlhostlist[uh].fp = NULL; return(urlconnect(&(urlhostlist[uh]))); } static int NEAR entryorder(uh) int uh; { int n; for (n = maxurlorder - 1; n >= 0; n--) if (urlorder[n] == uh) break; if (n >= 0) { if (n == maxurlorder - 1) return(0); memmove((char *)&(urlorder[n]), (char *)&(urlorder[n + 1]), (maxurlorder - n - 1) * sizeof(*urlorder)); urlorder[maxurlorder - 1] = uh; return(0); } if (maxurlorder >= URLNOFILE) return(seterrno(EINVAL)); urlorder[maxurlorder++] = uh; return(0); } int urlopendev(host, type) CONST char *host; int type; { urlhost_t *hp; urldev_t tmp; int n, uh; if (urlgethost(host, &(tmp.host)) < 0) return(-1); if (!(tmp.host.host)) { urlfreehost(&(tmp.host)); return(seterrno(EINVAL)); } if (tmp.host.port < 0) tmp.host.port = urlgetport(type); for (n = maxurlorder - 1; n >= 0; n--) { uh = urlorder[n]; hp = &(urlhostlist[uh].host); if (urlhostlist[uh].flags & (UFL_CLOSED | UFL_LOCKED)) continue; if (type != urlhostlist[uh].type) continue; if (tmp.host.port != hp -> port) continue; if (cmpsockaddr(tmp.host.host, hp -> host)) continue; switch (type) { #ifdef DEP_FTPPATH case TYPE_FTP: if (!(tmp.host.user)) { if (hp -> user) continue; } else if (!(hp -> user)) continue; else if (strcmp(tmp.host.user, hp -> user)) continue; break; #endif #ifdef DEP_HTTPPATH case TYPE_HTTP: Xfree(tmp.host.user); tmp.host.user = NULL; Xfree(tmp.host.pass); tmp.host.pass = NULL; break; #endif default: return(seterrno(ENOENT)); /*NOTREACHED*/ break; } urlfreehost(&(tmp.host)); if (urlhostlist[uh].flags & UFL_INTRED) return(seterrno(EINTR)); if (!(urlhostlist[uh].fp) && urlreconnect(uh) < 0) return(-1); #ifdef DEP_HTTPPATH Xfree(urlhostlist[uh].redirect); urlhostlist[uh].redirect = NULL; #endif urlhostlist[uh].nlink++; if (entryorder(uh) < 0) return(_urlclosedev(uh, -1)); return(uh); } for (uh = 0; uh < maxurlhost; uh++) if (urlhostlist[uh].flags & UFL_CLOSED) break; if (uh >= URLNOFILE) { urlfreehost(&(tmp.host)); return(seterrno(EMFILE)); } if (!logheader) urllog("connecting %s...\n", tmp.host.host); tmp.fp = NULL; tmp.proxy.user = tmp.proxy.pass = tmp.proxy.host = NULL; tmp.proxy.port = -1; tmp.type = type; tmp.nlink = 1; tmp.options = urloptions; tmp.flags = 0; #ifdef DEP_HTTPPATH tmp.http = NULL; tmp.redirect = NULL; #endif if (urlconnect(&tmp) < 0) { urlfreehost(&(tmp.host)); urlfreehost(&(tmp.proxy)); return(-1); } memcpy((char *)&(urlhostlist[uh]), (char *)&tmp, sizeof(*urlhostlist)); if (uh >= maxurlhost) maxurlhost++; if (entryorder(uh) < 0) return(_urlclosedev(uh, -1)); switch (urlhostlist[uh].prototype) { #ifdef DEP_FTPPATH case TYPE_FTP: hp = &(urlhostlist[uh].host); if (hp -> user && !(hp -> pass)) { n = authfind(hp, type, -1); if (n < 0) hp -> pass = authgetpass(); } if (ftplogin(uh) < 0) return(_urlclosedev(uh, -1)); break; #endif #ifdef DEP_HTTPPATH case TYPE_HTTP: urlhostlist[uh].http = (httpstat_t *)Xmalloc(sizeof(httpstat_t)); copyrootpath((urlhostlist[uh].http) -> cwd); httpreset(uh, 0); break; #endif default: break; } return(uh); } static int NEAR _urlclosedev(uh, ret) int uh, ret; { int n, duperrno; duperrno = errno; if (uh < 0 || uh >= maxurlhost) return(ret); if (urlhostlist[uh].flags & UFL_CLOSED) return(ret); urlhostlist[uh].flags &= ~UFL_LOCKED; #ifdef DEP_HTTPPATH httpreset(uh, 1); Xfree(urlhostlist[uh].redirect); urlhostlist[uh].redirect = NULL; #endif if (urlhostlist[uh].nlink > 0 && --(urlhostlist[uh].nlink)) { errno = duperrno; return(ret); } urlfreestat(uh); if (urlhostlist[uh].fp) { #ifdef DEP_FTPPATH if (urlhostlist[uh].prototype == TYPE_FTP) { n = (ret >= 0) ? ftpquit(uh) : ftpabort(uh); if (n < 0) ret = n; } #endif safefclose(urlhostlist[uh].fp); urlhostlist[uh].fp = NULL; } #ifdef DEP_HTTPPATH httpreset(uh, 2); #endif urlhostlist[uh].flags |= UFL_CLOSED; for (n = 0; n < maxurlorder; n++) if (urlorder[n] == uh) break; if (n < maxurlorder) memmove((char *)&(urlorder[n]), (char *)&(urlorder[n + 1]), (--maxurlorder - n) * sizeof(*urlorder)); urlfreehost(&(urlhostlist[uh].host)); urlfreehost(&(urlhostlist[uh].proxy)); while (maxurlhost > 0) { if (!(urlhostlist[maxurlhost - 1].flags & UFL_CLOSED)) break; maxurlhost--; } errno = duperrno; return(ret); } VOID urlclosedev(uh) int uh; { VOID_C _urlclosedev(uh, 0); } int urlgenpath(uh, buf, size, flags) int uh; char *buf; ALLOC_T size; int flags; { CONST char *s; char *cp, *pass; int n, len, port; n = len = 0; if (flags & UGP_SCHEME) { s = urlgetscheme(urlhostlist[uh].type); if (!s) return(seterrno(EINVAL)); n = Xsnprintf(buf, size, "%s://", s); if (n < 0) return(-1); #ifdef CODEEUC n = strlen(buf); #endif len += n; } if (flags & UGP_USER) { cp = urlhostlist[uh].host.user; pass = urlhostlist[uh].host.pass; if ((flags & UGP_ANON) && !cp && (!(flags & UGP_PASS) || pass)) cp = FTPANONUSER; buf += n; size -= n; if (flags & UGP_ENCODE) { cp = urlencode(cp, -1, URL_UNSAFEUSER); pass = urlencode(pass, -1, URL_UNSAFEUSER); } if (!cp) buf[n = 0] = '\0'; else if ((flags & UGP_PASS) && pass) n = Xsnprintf(buf, size, "%s:%s", cp, pass); else n = Xsnprintf(buf, size, "%s", cp); if (flags & UGP_ENCODE) { Xfree(cp); Xfree(pass); } if (n < 0) return(-1); #ifdef CODEEUC n = strlen(buf); #endif len += n; if ((flags & UGP_HOST) && n) { buf += n; size -= n; n = Xsnprintf(buf, size, "@"); if (n < 0) return(-1); #ifdef CODEEUC n = strlen(buf); #endif len += n; } } if (flags & UGP_HOST) { cp = urlhostlist[uh].host.host; if (!cp) return(seterrno(EINVAL)); port = urlhostlist[uh].host.port; buf += n; size -= n; if (flags & UGP_ENCODE) cp = urlencode(cp, -1, URL_UNSAFEHOST); if (port == urlgetport(urlhostlist[uh].type)) n = Xsnprintf(buf, size, "%s", cp); else n = Xsnprintf(buf, size, "%s:%d", cp, port); if (flags & UGP_ENCODE) Xfree(cp); if (n < 0) return(-1); #ifdef CODEEUC n = strlen(buf); #endif len += n; } #ifdef DEP_HTTPPATH if ((flags & UGP_CWD) && urlhostlist[uh].http) { s = (urlhostlist[uh].http) -> cwd; if (!*s) s = rootpath; buf += n; size -= n; n = Xsnprintf(buf, size, "%s", s); if (n < 0) return(-1); #ifdef CODEEUC n = strlen(buf); #endif len += n; } #endif return(len); } int urlchdir(uh, path) int uh; CONST char *path; { int n; urllog("chdir(\"%s\")\n", path); if (validhost(uh, 0) < 0) return(-1); switch (urlhostlist[uh].prototype) { #ifdef DEP_FTPPATH case TYPE_FTP: n = ftpchdir(uh, path); break; #endif #ifdef DEP_HTTPPATH case TYPE_HTTP: n = httpchdir(uh, path); if (n >= 0) path = (urlhostlist[uh = n].http) -> cwd; break; #endif default: n = seterrno(ENOENT); break; } if (n < 0) return(-1); if ((n = urlrecvlist(&uh, path, 0)) >= 0) { if (lastst >= 0) urlfreestatlist(lastst); lastst = n; #ifdef DEP_HTTPPATH if (urlhostlist[uh].redirect && urlhostlist[uh].http) Xstrncpy((urlhostlist[uh].http) -> cwd, urlhostlist[uh].redirect, MAXPATHLEN - 1); #endif } return(uh); } char *urlgetcwd(uh, path, size) int uh; char *path; ALLOC_T size; { urllog("getcwd()\n"); if (validhost(uh, 0) < 0) return(NULL); switch (urlhostlist[uh].prototype) { #ifdef DEP_FTPPATH case TYPE_FTP: path = ftpgetcwd(uh, path, size); break; #endif #ifdef DEP_HTTPPATH case TYPE_HTTP: path = httpgetcwd(uh, path, size); break; #endif default: errno = ENOENT; path = NULL; break; } if (!path) return(NULL); return(path); } DIR *urlopendir(host, type, path) CONST char *host; int type; CONST char *path; { sockDIR *sockdirp; int n, uh; urllog("opendir(\"%s\")\n", path); if (*path != _SC_) { errno = EINVAL; return(NULL); } if ((uh = urlopendev(host, type)) < 0) return(NULL); if ((n = urlrecvlist(&uh, path, 0)) < 0) { VOID_C _urlclosedev(uh, -1); return(NULL); } sockdirp = (sockDIR *)Xmalloc(sizeof(*sockdirp)); sockdirp -> dd_id = SID_IFURLDRIVE; sockdirp -> dd_fd = uh; sockdirp -> dd_loc = 0L; sockdirp -> dd_size = n; return((DIR *)sockdirp); } int urlclosedir(dirp) DIR *dirp; { sockDIR *sockdirp; int uh; urllog("closedir()\n"); sockdirp = (sockDIR *)dirp; if (validdir(sockdirp) < 0) return(-1); uh = sockdirp -> dd_fd; urlfreestatlist(sockdirp -> dd_size); Xfree(sockdirp); urlclosedev(uh); return(0); } struct dirent *urlreaddir(dirp) DIR *dirp; { static st_dirent buf; sockDIR *sockdirp; namelist *list; int n, max; urllog("readdir()\n"); sockdirp = (sockDIR *)dirp; if (validdir(sockdirp) < 0) return(NULL); list = urlstatlist[sockdirp -> dd_size].list; max = urlstatlist[sockdirp -> dd_size].max; if (sockdirp -> dd_loc >= max) { errno = 0; return(NULL); } memset((char *)&buf, 0, sizeof(buf)); n = (sockdirp -> dd_loc)++; Xstrncpy(((struct dirent *)&buf) -> d_name, list[n].name, MAXNAMLEN); return((struct dirent *)&buf); } VOID urlrewinddir(dirp) DIR *dirp; { sockDIR *sockdirp; urllog("rewinddir()\n"); sockdirp = (sockDIR *)dirp; if (validdir(sockdirp) < 0) return; sockdirp -> dd_loc = 0L; } static VOID NEAR copystat(stp, namep) struct stat *stp; namelist *namep; { memset((char *)stp, 0, sizeof(*stp)); #ifndef NODIRLOOP stp -> st_dev = (dev_t)-1; stp -> st_ino = (ino_t)-1; #endif stp -> st_mode = namep -> st_mode; stp -> st_nlink = namep -> st_nlink; #ifndef NOUID stp -> st_uid = namep -> st_uid; stp -> st_gid = namep -> st_gid; #endif #ifdef HAVEFLAGS stp -> st_flags = namep -> st_flags; #endif stp -> st_size = namep -> st_size; memcpy((char *)&(stp -> st_atime), (char *)&(namep -> st_mtim), sizeof(stp -> st_atime)); memcpy((char *)&(stp -> st_mtime), (char *)&(namep -> st_mtim), sizeof(stp -> st_mtime)); memcpy((char *)&(stp -> st_ctime), (char *)&(namep -> st_mtim), sizeof(stp -> st_ctime)); #ifndef NOSTBLKSIZE stp -> st_blksize = DEV_BSIZE; #endif if (isdev(namep)) { stp -> st_size = (off_t)0; stp -> st_rdev = namep -> st_size; } } int urlstat(host, type, path, stp) CONST char *host; int type; CONST char *path; struct stat *stp; { namelist tmp; int i, n, uh; urllog("stat(\"%s\")\n", path); if ((uh = urlopendev(host, type)) < 0) return(-1); if ((n = urltracelink(&uh, path, &tmp, &i)) < 0) return(_urlclosedev(uh, -1)); if (--n >= 0) { switch (urlhostlist[uh].prototype) { #ifdef DEP_FTPPATH case TYPE_FTP: VOID_C ftprecvstatus(uh, path, &tmp, n, i); break; #endif #ifdef DEP_HTTPPATH case TYPE_HTTP: VOID_C httprecvstatus(uh, path, &tmp, n, &i); break; #endif default: break; } urlfreestatlist(n); } copystat(stp, &tmp); #ifndef NOSYMLINK Xfree(tmp.linkname); #endif urlclosedev(uh); return(0); } int urllstat(host, type, path, stp) CONST char *host; int type; CONST char *path; struct stat *stp; { namelist tmp; int i, n, uh; urllog("lstat(\"%s\")\n", path); if ((uh = urlopendev(host, type)) < 0) return(-1); if ((n = urlrecvstatus(&uh, path, &tmp, &i, 1)) < 0) return(_urlclosedev(uh, -1)); if (--n >= 0) { switch (urlhostlist[uh].prototype) { #ifdef DEP_FTPPATH case TYPE_FTP: VOID_C ftprecvstatus(uh, path, &tmp, n, i); break; #endif #ifdef DEP_HTTPPATH case TYPE_HTTP: VOID_C httprecvstatus(uh, path, &tmp, n, &i); break; #endif default: break; } urlfreestatlist(n); } copystat(stp, &tmp); #ifndef NOSYMLINK Xfree(tmp.linkname); #endif urlclosedev(uh); return(0); } int urlaccess(host, type, path, mode) CONST char *host; int type; CONST char *path; int mode; { namelist tmp; int n, uh; urllog("access(\"%s\")\n", path); if ((uh = urlopendev(host, type)) < 0) return(-1); if ((n = urltracelink(&uh, path, &tmp, NULL)) < 0) return(_urlclosedev(uh, -1)); if (--n >= 0) urlfreestatlist(n); #ifndef NOSYMLINK Xfree(tmp.linkname); #endif urlclosedev(uh); if (((mode & R_OK) && !(tmp.flags & F_ISRED)) || ((mode & W_OK) && !(tmp.flags & F_ISWRI)) || ((mode & X_OK) && !(tmp.flags & F_ISEXE))) return(seterrno(EACCES)); return(0); } int urlreadlink(host, type, path, buf, bufsiz) CONST char *host; int type; CONST char *path; char *buf; int bufsiz; { namelist tmp; int n, uh; urllog("readlink(\"%s\")\n", path); if ((uh = urlopendev(host, type)) < 0) return(-1); if ((n = urlrecvstatus(&uh, path, &tmp, NULL, 0)) < 0) return(_urlclosedev(uh, -1)); if (--n >= 0) urlfreestatlist(n); if (!islink(&tmp)) n = seterrno(EINVAL); else { #ifdef NOSYMLINK n = 0; #else for (n = 0; n < bufsiz && tmp.linkname[n]; n++) buf[n] = tmp.linkname[n]; #endif } #ifndef NOSYMLINK Xfree(tmp.linkname); #endif urlclosedev(uh); return(n); } int urlchmod(host, type, path, mode) CONST char *host; int type; CONST char *path; int mode; { int n, uh; urllog("chmod(\"%s\", %03o)\n", path, mode); if ((uh = urlopendev(host, type)) < 0) return(-1); switch (urlhostlist[uh].prototype) { #ifdef DEP_FTPPATH case TYPE_FTP: n = ftpchmod(uh, path, mode); break; #endif #ifdef DEP_HTTPPATH case TYPE_HTTP: n = httpchmod(uh, path, mode); break; #endif default: n = seterrno(ENOENT); break; } urlclosedev(uh); return(n); } int urlunlink(host, type, path) CONST char *host; int type; CONST char *path; { int n, uh; urllog("unlink(\"%s\")\n", path); if ((uh = urlopendev(host, type)) < 0) return(-1); switch (urlhostlist[uh].prototype) { #ifdef DEP_FTPPATH case TYPE_FTP: n = ftpunlink(uh, path); break; #endif #ifdef DEP_HTTPPATH case TYPE_HTTP: n = httpunlink(uh, path); break; #endif default: n = seterrno(ENOENT); break; } urlclosedev(uh); return(n); } int urlrename(host, type, from, to) CONST char *host; int type; CONST char *from, *to; { int n, uh; urllog("rename(\"%s\", \"%s\")\n", from, to); if ((uh = urlopendev(host, type)) < 0) return(-1); switch (urlhostlist[uh].prototype) { #ifdef DEP_FTPPATH case TYPE_FTP: n = ftprename(uh, from, to); break; #endif #ifdef DEP_HTTPPATH case TYPE_HTTP: n = httprename(uh, from, to); break; #endif default: n = seterrno(ENOENT); break; } urlclosedev(uh); return(n); } static int NEAR urlgetopenlist(fd) int fd; { int n; for (n = maxurlopen - 1; n >= 0; n--) if (fd == urlopenlist[n].fd) return(n); return(seterrno(EINVAL)); } VOID urlputopenlist(fd, uh, path, flags) int fd, uh; CONST char *path; int flags; { int n; if ((n = urlgetopenlist(fd)) >= 0) Xfree(urlopenlist[n].path); else { n = maxurlopen++; urlopenlist = (urlopen_t *)Xrealloc(urlopenlist, maxurlopen * sizeof(*urlopenlist)); } urlopenlist[n].fd = fd; urlopenlist[n].uh = uh; urlopenlist[n].path = Xstrdup(path); urlopenlist[n].flags = flags; if (validhost(uh, 0) >= 0) urlhostlist[uh].flags |= UFL_LOCKED; } int urldelopenlist(fd) int fd; { int n, uh; if ((n = urlgetopenlist(fd)) < 0) return(-1); uh = urlopenlist[n].uh; Xfree(urlopenlist[n].path); memmove((char *)&(urlopenlist[n]), (char *)&(urlopenlist[n + 1]), (--maxurlopen - n) * sizeof(*urlopenlist)); if (maxurlopen <= 0) { maxurlopen = 0; Xfree(urlopenlist); urlopenlist = NULL; } if (validhost(uh, 0) >= 0) { for (n = 0; n < maxurlopen; n++) if (uh == urlopenlist[n].uh) break; if (n >= maxurlopen) urlhostlist[uh].flags &= ~UFL_LOCKED; } return(uh); } int urlopen(host, type, path, flags) CONST char *host; int type; CONST char *path; int flags; { int uh, fd; urllog("open(\"%s\")\n", path); if ((uh = urlopendev(host, type)) < 0) return(-1); switch (urlhostlist[uh].prototype) { #ifdef DEP_FTPPATH case TYPE_FTP: fd = ftpopen(uh, path, flags); break; #endif #ifdef DEP_HTTPPATH case TYPE_HTTP: fd = httpopen(uh, path, flags); if (fd < 0) return(httpreopen(uh, flags)); break; #endif default: fd = seterrno(ENOENT); break; } if (fd < 0) return(_urlclosedev(uh, -1)); urlputopenlist(fd, uh, path, flags); return(fd); } static int NEAR _urlclose(fd, func) int fd; CONST char *func; { int n, uh; urllog("%s(\"%d\")\n", func, fd); if ((uh = urldelopenlist(fd)) < 0) return(-1); switch (urlhostlist[uh].prototype) { #ifdef DEP_FTPPATH case TYPE_FTP: n = ftpclose(uh, fd); break; #endif #ifdef DEP_HTTPPATH case TYPE_HTTP: n = httpclose(uh, fd); break; #endif default: n = seterrno(ENOENT); break; } urlclosedev(uh); return(n); } int urlclose(fd) int fd; { int n; n = Xclose(fd); if (_urlclose(fd, "close") < 0) n = -1; return(n); } int urlfstat(fd, stp) int fd; struct stat *stp; { int n, uh; urllog("fstat(\"%d\")\n", fd); if ((n = urlgetopenlist(fd)) < 0) return(-1); uh = urlopenlist[n].uh; switch (urlhostlist[uh].prototype) { #ifdef DEP_FTPPATH case TYPE_FTP: n = ftpfstat(uh, stp); break; #endif #ifdef DEP_HTTPPATH case TYPE_HTTP: n = httpfstat(uh, stp); break; #endif default: n = seterrno(ENOENT); break; } return(n); } int urlselect(fd) int fd; { int n, uh; if ((n = urlgetopenlist(fd)) < 0) return(-1); uh = urlopenlist[n].uh; switch (urlhostlist[uh].prototype) { #ifdef DEP_HTTPPATH case TYPE_HTTP: if (!urlhostlist[uh].http) return(seterrno(EINVAL)); if ((urlhostlist[uh].http) -> flags & HFL_CHUNKED) { if ((urlhostlist[uh].http) -> chunk < 0) return(0); } if ((urlhostlist[uh].http) -> flags & HFL_CLENGTH) { if (!((urlhostlist[uh].http) -> clength)) return(0); } break; #endif default: break; } return(1); } int urlread(fd, buf, nbytes) int fd; char *buf; int nbytes; { int n, uh; if (chkopenfd(fd) == DEV_URL) urllog("read(%d, , %d)\n", fd, nbytes); if ((n = urlgetopenlist(fd)) < 0) return(-1); uh = urlopenlist[n].uh; switch (urlhostlist[uh].prototype) { #ifdef DEP_FTPPATH case TYPE_FTP: n = ftpread(uh, fd, buf, nbytes); break; #endif #ifdef DEP_HTTPPATH case TYPE_HTTP: n = httpread(uh, fd, buf, nbytes); break; #endif default: n = seterrno(ENOENT); break; } return(n); } int urlwrite(fd, buf, nbytes) int fd; CONST char *buf; int nbytes; { int n, uh; if (chkopenfd(fd) == DEV_URL) urllog("write(%d, , %d)\n", fd, nbytes); if ((n = urlgetopenlist(fd)) < 0) return(-1); uh = urlopenlist[n].uh; switch (urlhostlist[uh].prototype) { #ifdef DEP_FTPPATH case TYPE_FTP: n = ftpwrite(uh, fd, buf, nbytes); break; #endif #ifdef DEP_HTTPPATH case TYPE_HTTP: n = httpwrite(uh, fd, buf, nbytes); break; #endif default: n = seterrno(ENOENT); break; } return(n); } int urldup2(old, new) int old, new; { int n; VOID_C _urlclose(new, "dup2"); if ((n = urlgetopenlist(old)) >= 0) urlputopenlist(new, urlopenlist[n].uh, urlopenlist[n].path, urlopenlist[n].flags); return(new); } int urlmkdir(host, type, path) CONST char *host; int type; CONST char *path; { int n, uh; urllog("mkdir(\"%s\")\n", path); if ((uh = urlopendev(host, type)) < 0) return(-1); switch (urlhostlist[uh].prototype) { #ifdef DEP_FTPPATH case TYPE_FTP: n = ftpmkdir(uh, path); break; #endif #ifdef DEP_HTTPPATH case TYPE_HTTP: n = httpmkdir(uh, path); break; #endif default: n = seterrno(ENOENT); break; } urlclosedev(uh); return(n); } int urlrmdir(host, type, path) CONST char *host; int type; CONST char *path; { int n, uh; urllog("rmdir(\"%s\")\n", path); if ((uh = urlopendev(host, type)) < 0) return(-1); switch (urlhostlist[uh].prototype) { #ifdef DEP_FTPPATH case TYPE_FTP: n = ftprmdir(uh, path); break; #endif #ifdef DEP_HTTPPATH case TYPE_HTTP: n = httprmdir(uh, path); break; #endif default: n = seterrno(ENOENT); break; } urlclosedev(uh); return(n); } int urlallclose(VOID_A) { int uh, n; n = 0; for (uh = maxurlhost - 1; uh >= 0; uh--) { if (urlhostlist[uh].flags & UFL_CLOSED) continue; urlhostlist[uh].nlink = 0; if (_urlclosedev(uh, 0) < 0) n = -1; } maxurlhost = 0; Xfree(logheader); logheader = NULL; authfree(); return(n); } #endif /* DEP_URLPATH */ FD-3.01j/catalog.c100644 2105 1751 10653 13516612560 12464 0ustar shiraiuser/* * catalog.c * * message catalog */ #include "fd.h" #include "termio.h" #include "func.h" #include "kanji.h" #ifdef USEMMAP #include #endif #define MAXVERBUF 8 #define CF_KANJI 0001 #define getword(s, n) (((u_short)((s)[(n) + 1]) << 8) | (s)[n]) #define CATTBL "fd-cat." #ifndef _NOCATALOG static int NEAR fgetword __P_((u_short *, int)); static int NEAR opencatalog __P_((CONST char *)); char *cattblpath = NULL; CONST char *catname = NULL; static char *catbuf = NULL; static ALLOC_T catsize = (ALLOC_T)0; static off_t catofs = (off_t)0; static u_short *catindex = NULL; static u_short catmax = (u_short)0; static CONST char *cat_ja = "ja"; static CONST char *cat_C = "C"; #endif /* !_NOCATALOG */ #ifdef _NOCATALOG # if !defined (_NOENGMES) && !defined (_NOJPNMES) CONST char *mesconv(jpn, eng) CONST char *jpn, *eng; { int n; if (outputkcode == ENG) return(eng); n = (messagelang != NOCNV) ? messagelang : outputkcode; return((n == ENG) ? eng : jpn); } # endif /* !_NOENGMES && !_NOJPNMES */ #else /* !_NOCATALOG */ static int NEAR fgetword(wp, fd) u_short *wp; int fd; { u_char buf[2]; if (sureread(fd, buf, 2) != 2) return(-1); *wp = getword(buf, 0); return(0); } static int NEAR opencatalog(lang) CONST char *lang; { char *cp, path[MAXPATHLEN], file[MAXPATHLEN], ver[MAXVERBUF]; off_t ofs; ALLOC_T size; u_short w, flags; int n, fd; VOID_C Xsnprintf(file, sizeof(file), "%s%s", CATTBL, lang); if (!cattblpath || !*cattblpath) Xstrcpy(path, file); else strcatdelim2(path, cattblpath, file); if ((fd = open(path, O_BINARY | O_RDONLY, 0666)) < 0) return(-1); cp = getversion(&n); if (read(fd, ver, sizeof(ver)) != sizeof(ver) || strncmp(cp, ver, n) || ver[n] || fgetword(&flags, fd) < 0 || ((flags & CF_KANJI) && outputkcode == ENG) || fgetword(&w, fd) < 0 || w != CAT_SUM || fgetword(&w, fd) < 0) { VOID_C close(fd); return(-1); } if (!catbuf) /*EMPTY*/; #ifdef USEMMAP else if (catbuf == (char *)MAP_FAILED) /*EMPTY*/; else if (catsize) { if (munmap(catbuf, catsize) < 0) error("munmap()"); } #endif else Xfree(catbuf); catbuf = NULL; catsize = (ALLOC_T)0; catofs = (off_t)0; catindex = (u_short *)Xrealloc(catindex, w * sizeof(u_short)); catmax = w; catindex[0] = (u_short)0; for (w = 1; w < catmax; w++) if (fgetword(&(catindex[w]), fd) < 0) { VOID_C close(fd); return(-1); } if (fgetword(&w, fd) < 0) { VOID_C close(fd); return(-1); } size = w; ofs = sizeof(ver) + 2 + 2 + 2 + 2 * catmax; #ifdef USEMMAP catbuf = (char *)mmap(NULL, (ALLOC_T)ofs + size, PROT_READ, MAP_PRIVATE, fd, (off_t)0); if (catbuf != (char *)MAP_FAILED) { catsize = (ALLOC_T)ofs + size; catofs = ofs; } else #endif { catbuf = (char *)Xmalloc(size); if (lseek(fd, ofs, L_SET) < (off_t)0 || sureread(fd, catbuf, size) != size) { VOID_C close(fd); Xfree(catbuf); Xfree(catindex); catbuf = NULL; catindex = NULL; catmax = 0; return(-1); } } VOID_C close(fd); return(0); } VOID freecatalog(VOID_A) { if (!catbuf) /*EMPTY*/; #ifdef USEMMAP else if (catbuf == (char *)MAP_FAILED) /*EMPTY*/; else if (catsize) VOID_C munmap(catbuf, catsize); #endif else Xfree(catbuf); Xfree(catindex); catbuf = NULL; catsize = (ALLOC_T)0; catofs = (off_t)0; catindex = NULL; catmax = 0; } char **listcatalog(VOID_A) { DIR *dirp; struct dirent *dp; CONST char *cp; char **argv; int argc; if (!cattblpath || !*cattblpath) cp = curpath; else cp = cattblpath; if (!(dirp = Xopendir(cp))) return(NULL); argv = NULL; argc = 0; while ((dp = Xreaddir(dirp))) { cp = dp -> d_name; if (strnpathcmp(cp, CATTBL, strsize(CATTBL))) continue; cp += strsize(CATTBL); if (!strpathcmp(cp, cat_ja)) continue; if (!strpathcmp(cp, cat_C)) continue; argv = (char **)Xrealloc(argv, (argc + 2) * sizeof(char *)); argv[argc++] = Xstrdup(cp); argv[argc] = NULL; } VOID_C Xclosedir(dirp); return(argv); } int chkcatalog(VOID_A) { CONST char *lang; if (messagelang != NOCNV) lang = (messagelang == ENG) ? cat_C : cat_ja; else if (catname && *catname) lang = catname; else lang = (outputkcode == ENG) ? cat_C : cat_ja; if (opencatalog(lang) >= 0) return(0); if (opencatalog(cat_ja) >= 0) return(0); if (opencatalog(cat_C) >= 0) return(0); return(-1); } CONST char *mesconv(id) int id; { off_t ofs; if (!catbuf && chkcatalog() < 0) return(nullstr); if (id < 0 || id >= catmax) return(nullstr); ofs = catindex[id] + catofs; return((CONST char *)&(catbuf[ofs])); } #endif /* !_NOCATALOG */ FD-3.01j/kconv.c100644 2105 1751 141604 13516612560 12213 0ustar shiraiuser/* * kconv.c * * Kanji convert functions */ #define K_EXTERN #ifdef FD #include "fd.h" #include "termio.h" #include "realpath.h" #include "parse.h" #include "func.h" #else #include "headers.h" #include "depend.h" #include "kctype.h" #include "typesize.h" #include "string.h" #endif #include "unixemu.h" #include "kconv.h" #include "termemu.h" #if MSDOS #include #endif #define ASCII 000 #define KANA 001 #define KANJI 002 #define JKANA 004 #define J_UDEF 0x222e /* GETA */ #define SJ_UDEF 0x81ac /* GETA */ #define U2_UDEF 0x3013 /* GETA */ #define UNICODETBL "fd-unicd.tbl" #define MINUNICODE 0x00a7 #define MAXUNICODE 0xffe5 #define MINKANJI 0x8140 #define MAXKANJI 0xfc4b #define jcnv(c, io) ((((io) == L_FNAME) \ && ((c) == '/')) ? ' ' : (c)) #define jdecnv(c, io) ((((io) == L_FNAME) \ && ((c) == ' ')) ? '/' : (c)) #ifndef FD #define sureread read #endif #ifdef CODEEUC #define kencode ujis2sjis #define kdecode sjis2ujis #else #define kencode sjis2ujis #define kdecode ujis2sjis #endif #ifndef _NOKANJICONV #define HC_HEX 0001 #define HC_CAP 0002 #define tobin(c) h2btable[(u_char)(c)] #define tobin2(s, i) (u_char)((tobin((s)[i]) << 4) \ | (tobin((s)[(i) + 1]))) #define HEXTAG ':' #define ishex(s, i) (((s)[i] == HEXTAG) \ && (hctypetable[(u_char)(s)[(i) + 1]] & HC_HEX) \ && (hctypetable[(u_char)(s)[(i) + 2]] & HC_HEX)) #define CAPTAG ':' #define iscap(s, i) (((s)[i] == CAPTAG) \ && (hctypetable[(u_char)(s)[(i) + 1]] & HC_CAP) \ && (hctypetable[(u_char)(s)[(i) + 2]] & HC_HEX)) #endif /* !_NOKANJICONV */ typedef struct _kconv_t { u_short start; u_short cnv; u_short range; } kconv_t; #if !defined (_NOKANJICONV) \ || (!defined (_NOENGMES) && !defined (_NOJPNMES)) typedef struct _langtable { CONST char *ident; u_char lang; } langtable; #endif #ifndef _NOKANJIFCONV typedef struct _kpathtable { char **path; u_char code; } kpathtable; #endif #ifdef DEP_ROCKRIDGE extern int norockridge; #endif #if !defined (_NOKANJICONV) \ || (!defined (_NOENGMES) && !defined (_NOJPNMES)) static CONST char *NEAR Xstrstr __P_((CONST char *, CONST char *)); #endif #if !defined (_NOKANJICONV) || (defined (DEP_DOSEMU) && defined (CODEEUC)) static VOID NEAR sj2j __P_((char *, CONST u_char *)); static VOID NEAR j2sj __P_((char *, CONST u_char *)); #endif #ifdef DEP_UNICODE # ifndef DEP_EMBEDUNITBL static int NEAR openunitbl __P_((CONST char *)); static u_char *NEAR newunitbl __P_((ALLOC_T)); # endif #define getword(s, n) (((u_short)((s)[(n) + 1]) << 8) | (s)[n]) #define skread(f, o, s, n) (Xlseek(f, o, L_SET) >= (off_t)0 \ && sureread(f, s, n) == n) #endif #ifndef _NOKANJICONV # if defined (DEP_UNICODE) && !defined (DEP_EMBEDUNITBL) static int NEAR opennftbl __P_((CONST char *, int, u_int *)); # endif static int NEAR toenglish __P_((char *, CONST u_char *, int)); static int NEAR tojis7 __P_((char *, CONST u_char *, int, int, int, int)); static int NEAR fromjis __P_((char *, CONST u_char *, int, int)); static int NEAR tojis8 __P_((char *, CONST u_char *, int, int, int, int)); static int NEAR tojunet __P_((char *, CONST u_char *, int, int, int, int)); # ifdef DEP_UNICODE static u_int NEAR toucs2 __P_((CONST u_char *, int *)); static VOID NEAR fromucs2 __P_((char *, int *, u_int)); static int NEAR toutf8 __P_((char *, CONST u_char *, int)); static int NEAR fromutf8 __P_((char *, CONST u_char *, int)); static int NEAR toutf8nf __P_((char *, CONST u_char *, int, int)); static int NEAR fromutf8nf __P_((char *, CONST u_char *, int, int, int)); # endif /* DEP_UNICODE */ static int NEAR bin2hex __P_((char *, int)); static int NEAR tohex __P_((char *, CONST u_char *, int)); static int NEAR fromhex __P_((char *, CONST u_char *, int)); static int NEAR bin2cap __P_((char *, int)); static int NEAR tocap __P_((char *, CONST u_char *, int)); static int NEAR fromcap __P_((char *, CONST u_char *, int)); static CONST char *NEAR _kanjiconv __P_((char *, CONST char *, int, int, int, int *, int)); #endif /* !_NOKANJICONV */ #ifdef FD int noconv = 0; #endif #ifndef _NOKANJIFCONV int nokanjifconv = 0; char *sjispath = NULL; char *eucpath = NULL; char *jis7path = NULL; char *jis8path = NULL; char *junetpath = NULL; char *ojis7path = NULL; char *ojis8path = NULL; char *ojunetpath = NULL; char *hexpath = NULL; char *cappath = NULL; char *utf8path = NULL; char *utf8macpath = NULL; char *utf8iconvpath = NULL; char *noconvpath = NULL; #endif /* !_NOKANJIFCONV */ #ifdef DEP_UNICODE char *unitblpath = NULL; int unicodebuffer = 0; #endif #if !defined (_NOKANJICONV) \ || (!defined (_NOENGMES) && !defined (_NOJPNMES)) static CONST langtable langlist[] = { # ifndef _NOKANJICONV {"sjis", SJIS}, {"euc", EUC}, {"ujis", EUC}, {"utf8-mac", M_UTF8}, {"mac", M_UTF8}, {"utf8-iconv", I_UTF8}, {"utf8", UTF8}, {"utf-8", UTF8}, {"ojunet", O_JUNET}, {"ojis8", O_JIS8}, {"ojis", O_JIS7}, {"junet", JUNET}, {"jis8", JIS8}, {"jis", JIS7}, {"hex", HEX}, {"cap", CAP}, # endif /* _NOKANJICONV */ # ifndef _NOENGMES {"en", ENG}, {"POSIX", ENG}, {"C", ENG}, # endif /* _NOENGMES */ }; #define LANGLISTSIZ arraysize(langlist) #endif /* !_NOKANJICONV || (!_NOENGMES && !_NOJPNMES) */ #ifdef DEP_UNICODE # ifdef DEP_EMBEDUNITBL extern CONST u_char unitblbuf[]; extern u_int unitblent; # else static u_char *unitblbuf = NULL; static u_int unitblent = 0; # endif static CONST kconv_t rsjistable[] = { {0x8470, 0x8440, 0x0f}, /* Cyrillic small letters */ {0x8480, 0x844f, 0x12}, /* Why they converted ? */ #define EXCEPTRUSS 2 {0x8754, 0xfa4a, 0x0a}, /* Roman numerals */ {0x8782, 0xfa59, 0x01}, /* numero sign */ {0x8784, 0xfa5a, 0x01}, /* telephone sign */ {0x878a, 0xfa58, 0x01}, /* parenthesized ideograph stock */ {0x8790, 0x81e0, 0x01}, /* nearly equals */ {0x8791, 0x81df, 0x01}, /* identical to */ {0x8792, 0x81e7, 0x01}, /* integral */ {0x8795, 0x81e3, 0x01}, /* square root */ {0x8796, 0x81db, 0x01}, /* up tack */ {0x8797, 0x81da, 0x01}, /* angle */ {0x879a, 0x81e6, 0x01}, /* because */ {0x879b, 0x81bf, 0x01}, /* intersection */ {0x879c, 0x81be, 0x01}, /* union */ {0xed40, 0xfa5c, 0x23}, /* NEC-selected IBM extensions */ {0xed63, 0xfa80, 0x1c}, /* NEC-selected IBM extensions */ {0xed80, 0xfa9c, 0x61}, /* NEC-selected IBM extensions */ {0xede1, 0xfb40, 0x1c}, /* NEC-selected IBM extensions */ {0xee40, 0xfb5c, 0x23}, /* NEC-selected IBM extensions */ {0xee63, 0xfb80, 0x1c}, /* NEC-selected IBM extensions */ {0xee80, 0xfb9c, 0x61}, /* NEC-selected IBM extensions */ {0xeee1, 0xfc40, 0x0c}, /* NEC-selected IBM extensions */ {0xeeef, 0xfa40, 0x0a}, /* small Roman numerals */ {0xeef9, 0x81ca, 0x01}, /* full width not sign */ {0xeefa, 0xfa55, 0x03}, /* full width broken bar */ /* full width apostrophe */ /* full width quotation mark */ {0xfa54, 0x81ca, 0x01}, /* full width not sign */ {0xfa5b, 0x81e6, 0x01}, /* because */ }; #define RSJISTBLSIZ arraysize(rsjistable) #endif /* DEP_UNICODE */ #if !defined (_NOKANJICONV) || (defined (DEP_DOSEMU) && defined (CODEEUC)) static CONST kconv_t convtable[] = { {0xfa40, 0xeeef, 0x0a}, /* small Roman numerals */ {0xfa4a, 0x8754, 0x0a}, /* Roman numerals */ {0xfa54, 0x81ca, 0x01}, /* full width not sign */ {0xfa55, 0xeefa, 0x03}, /* full width broken bar */ /* full width apostrophe */ /* full width quotation mark */ {0xfa58, 0x878a, 0x01}, /* parenthesized ideograph stock */ {0xfa59, 0x8782, 0x01}, /* numero sign */ {0xfa5a, 0x8784, 0x01}, /* telephone sign */ {0xfa5b, 0x81e6, 0x01}, /* because */ {0xfa5c, 0xed40, 0x23}, /* IBM extensions */ {0xfa80, 0xed63, 0x1c}, /* IBM extensions */ {0xfa9c, 0xed80, 0x61}, /* IBM extensions */ {0xfb40, 0xede1, 0x1c}, /* IBM extensions */ {0xfb5c, 0xee40, 0x23}, /* IBM extensions */ {0xfb80, 0xee63, 0x1c}, /* IBM extensions */ {0xfb9c, 0xee80, 0x61}, /* IBM extensions */ {0xfc40, 0xeee1, 0x0c} /* IBM extensions */ }; #define CNVTBLSIZ arraysize(convtable) static CONST u_char sj2jtable1[256] = { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, /* 0x00 */ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, /* 0x10 */ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, /* 0x20 */ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, /* 0x30 */ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, /* 0x40 */ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, /* 0x50 */ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, /* 0x60 */ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, /* 0x70 */ 0, 0x21, 0x23, 0x25, 0x27, 0x29, 0x2b, 0x2d, /* 0x80 */ 0x2f, 0x31, 0x33, 0x35, 0x37, 0x39, 0x3b, 0x3d, 0x3f, 0x41, 0x43, 0x45, 0x47, 0x49, 0x4b, 0x4d, /* 0x90 */ 0x4f, 0x51, 0x53, 0x55, 0x57, 0x59, 0x5b, 0x5d, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, /* 0xa0 */ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, /* 0xb0 */ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, /* 0xc0 */ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, /* 0xd0 */ 0x5f, 0x61, 0x63, 0x65, 0x67, 0x69, 0x6b, 0x6d, /* 0xe0 */ 0x6f, 0x71, 0x73, 0x75, 0x77, 0x79, 0x7b, 0x7d, 0x7f, 0x81, 0x83, 0x85, 0x87, 0x89, 0x8b, 0x8d, /* 0xf0 */ 0x8f, 0x91, 0x93, 0x95, 0x97, 0, 0, 0 }; static CONST u_char sj2jtable2[256] = { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, /* 0x00 */ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, /* 0x10 */ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, /* 0x20 */ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, /* 0x30 */ 0x21, 0x22, 0x23, 0x24, 0x25, 0x26, 0x27, 0x28, /* 0x40 */ 0x29, 0x2a, 0x2b, 0x2c, 0x2d, 0x2e, 0x2f, 0x30, 0x31, 0x32, 0x33, 0x34, 0x35, 0x36, 0x37, 0x38, /* 0x50 */ 0x39, 0x3a, 0x3b, 0x3c, 0x3d, 0x3e, 0x3f, 0x40, 0x41, 0x42, 0x43, 0x44, 0x45, 0x46, 0x47, 0x48, /* 0x60 */ 0x49, 0x4a, 0x4b, 0x4c, 0x4d, 0x4e, 0x4f, 0x50, 0x51, 0x52, 0x53, 0x54, 0x55, 0x56, 0x57, 0x58, /* 0x70 */ 0x59, 0x5a, 0x5b, 0x5c, 0x5d, 0x5e, 0x5f, 0x60, 0x60, 0x61, 0x62, 0x63, 0x64, 0x65, 0x66, 0x67, /* 0x80 */ 0x68, 0x69, 0x6a, 0x6b, 0x6c, 0x6d, 0x6e, 0x6f, 0x70, 0x71, 0x72, 0x73, 0x74, 0x75, 0x76, 0x77, /* 0x90 */ 0x78, 0x79, 0x7a, 0x7b, 0x7c, 0x7d, 0x7e, 0x21, 0x22, 0x23, 0x24, 0x25, 0x26, 0x27, 0x28, 0x29, /* 0xa0 */ 0x2a, 0x2b, 0x2c, 0x2d, 0x2e, 0x2f, 0x30, 0x31, 0x32, 0x33, 0x34, 0x35, 0x36, 0x37, 0x38, 0x39, /* 0xb0 */ 0x3a, 0x3b, 0x3c, 0x3d, 0x3e, 0x3f, 0x40, 0x41, 0x42, 0x43, 0x44, 0x45, 0x46, 0x47, 0x48, 0x49, /* 0xc0 */ 0x4a, 0x4b, 0x4c, 0x4d, 0x4e, 0x4f, 0x50, 0x51, 0x52, 0x53, 0x54, 0x55, 0x56, 0x57, 0x58, 0x59, /* 0xd0 */ 0x5a, 0x5b, 0x5c, 0x5d, 0x5e, 0x5f, 0x60, 0x61, 0x62, 0x63, 0x64, 0x65, 0x66, 0x67, 0x68, 0x69, /* 0xe0 */ 0x6a, 0x6b, 0x6c, 0x6d, 0x6e, 0x6f, 0x70, 0x71, 0x72, 0x73, 0x74, 0x75, 0x76, 0x77, 0x78, 0x79, /* 0xf0 */ 0x7a, 0x7b, 0x7c, 0x7d, 0x7e, 0, 0, 0 }; static CONST u_char j2sjtable1[128] = { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, /* 0x00 */ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, /* 0x10 */ 0, 0x81, 0x81, 0x82, 0x82, 0x83, 0x83, 0x84, /* 0x20 */ 0x84, 0x85, 0x85, 0x86, 0x86, 0x87, 0x87, 0x88, 0x88, 0x89, 0x89, 0x8a, 0x8a, 0x8b, 0x8b, 0x8c, /* 0x30 */ 0x8c, 0x8d, 0x8d, 0x8e, 0x8e, 0x8f, 0x8f, 0x90, 0x90, 0x91, 0x91, 0x92, 0x92, 0x93, 0x93, 0x94, /* 0x40 */ 0x94, 0x95, 0x95, 0x96, 0x96, 0x97, 0x97, 0x98, 0x98, 0x99, 0x99, 0x9a, 0x9a, 0x9b, 0x9b, 0x9c, /* 0x50 */ 0x9c, 0x9d, 0x9d, 0x9e, 0x9e, 0x9f, 0x9f, 0xe0, 0xe0, 0xe1, 0xe1, 0xe2, 0xe2, 0xe3, 0xe3, 0xe4, /* 0x60 */ 0xe4, 0xe5, 0xe5, 0xe6, 0xe6, 0xe7, 0xe7, 0xe8, 0xe8, 0xe9, 0xe9, 0xea, 0xea, 0xeb, 0xeb, 0xec, /* 0x70 */ 0xec, 0xed, 0xed, 0xee, 0xee, 0xef, 0xef, 0 }; static CONST u_char j2sjtable2[128] = { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, /* 0x00 */ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, /* 0x10 */ 0, 0x40, 0x41, 0x42, 0x43, 0x44, 0x45, 0x46, /* 0x20 */ 0x47, 0x48, 0x49, 0x4a, 0x4b, 0x4c, 0x4d, 0x4e, 0x4f, 0x50, 0x51, 0x52, 0x53, 0x54, 0x55, 0x56, /* 0x30 */ 0x57, 0x58, 0x59, 0x5a, 0x5b, 0x5c, 0x5d, 0x5e, 0x5f, 0x60, 0x61, 0x62, 0x63, 0x64, 0x65, 0x66, /* 0x40 */ 0x67, 0x68, 0x69, 0x6a, 0x6b, 0x6c, 0x6d, 0x6e, 0x6f, 0x70, 0x71, 0x72, 0x73, 0x74, 0x75, 0x76, /* 0x50 */ 0x77, 0x78, 0x79, 0x7a, 0x7b, 0x7c, 0x7d, 0x7e, 0x80, 0x81, 0x82, 0x83, 0x84, 0x85, 0x86, 0x87, /* 0x60 */ 0x88, 0x89, 0x8a, 0x8b, 0x8c, 0x8d, 0x8e, 0x8f, 0x90, 0x91, 0x92, 0x93, 0x94, 0x95, 0x96, 0x97, /* 0x70 */ 0x98, 0x99, 0x9a, 0x9b, 0x9c, 0x9d, 0x9e, 0 }; static CONST u_char j2sjtable3[128] = { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, /* 0x00 */ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, /* 0x10 */ 0, 0x9f, 0xa0, 0xa1, 0xa2, 0xa3, 0xa4, 0xa5, /* 0x20 */ 0xa6, 0xa7, 0xa8, 0xa9, 0xaa, 0xab, 0xac, 0xad, 0xae, 0xaf, 0xb0, 0xb1, 0xb2, 0xb3, 0xb4, 0xb5, /* 0x30 */ 0xb6, 0xb7, 0xb8, 0xb9, 0xba, 0xbb, 0xbc, 0xbd, 0xbe, 0xbf, 0xc0, 0xc1, 0xc2, 0xc3, 0xc4, 0xc5, /* 0x40 */ 0xc6, 0xc7, 0xc8, 0xc9, 0xca, 0xcb, 0xcc, 0xcd, 0xce, 0xcf, 0xd0, 0xd1, 0xd2, 0xd3, 0xd4, 0xd5, /* 0x50 */ 0xd6, 0xd7, 0xd8, 0xd9, 0xda, 0xdb, 0xdc, 0xdd, 0xde, 0xdf, 0xe0, 0xe1, 0xe2, 0xe3, 0xe4, 0xe5, /* 0x60 */ 0xe6, 0xe7, 0xe8, 0xe9, 0xea, 0xeb, 0xec, 0xed, 0xee, 0xef, 0xf0, 0xf1, 0xf2, 0xf3, 0xf4, 0xf5, /* 0x70 */ 0xf6, 0xf7, 0xf8, 0xf9, 0xfa, 0xfb, 0xfc, 0 }; #endif /* !_NOKANJICONV || (DEP_DOSEMU && CODEEUC) */ #ifndef _NOKANJICONV # ifdef DEP_UNICODE # ifdef DEP_EMBEDUNITBL extern int nftblnum; extern int nflen; extern CONST u_char *nftblbuf[]; extern u_int nftblent[]; # else static int nftblnum = 0; static int nflen = 0; static u_char **nftblbuf = NULL; static u_int *nftblent = 0; # endif # endif /* DEP_UNICODE */ static CONST u_char hctypetable[256] = { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, /* 0x00 */ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, /* 0x10 */ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, /* 0x20 */ 0001, 0001, 0001, 0001, 0001, 0001, 0001, 0001, /* 0x30 */ 0003, 0003, 0000, 0000, 0000, 0000, 0000, 0000, 0000, 0003, 0003, 0003, 0003, 0003, 0003, 0000, /* 0x40 */ 0000, 0000, 0000, 0000, 0000, 0000, 0000, 0000, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, /* 0x50 */ 0000, 0003, 0003, 0003, 0003, 0003, 0003, 0000, /* 0x60 */ 0000, 0000, 0000, 0000, 0000, 0000, 0000, 0000, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, /* 0x70 */ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, /* 0x80 */ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, /* 0x90 */ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, /* 0xa0 */ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, /* 0xb0 */ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, /* 0xc0 */ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, /* 0xd0 */ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, /* 0xe0 */ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 /* 0xf0 */ }; static CONST u_char h2btable[256] = { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, /* 0x00 */ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, /* 0x10 */ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, /* 0x20 */ 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 0, 0, 0, 0, 0, 0, /* 0x30 */ 0000, 0x0a, 0x0b, 0x0c, 0x0d, 0x0e, 0x0f, 0000, /* 0x40 */ 0000, 0000, 0000, 0000, 0000, 0000, 0000, 0000, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, /* 0x50 */ 0000, 0x0a, 0x0b, 0x0c, 0x0d, 0x0e, 0x0f, 0000, /* 0x60 */ 0000, 0000, 0000, 0000, 0000, 0000, 0000, 0000, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, /* 0x70 */ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, /* 0x80 */ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, /* 0x90 */ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, /* 0xa0 */ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, /* 0xb0 */ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, /* 0xc0 */ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, /* 0xd0 */ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, /* 0xe0 */ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 /* 0xf0 */ }; #endif /* !_NOKANJICONV */ #ifdef DEP_FILECONV static CONST kpathtable kpathlist[] = { {&sjispath, SJIS}, {&eucpath, EUC}, {&jis7path, JIS7}, {&jis8path, JIS8}, {&junetpath, JUNET}, {&ojis7path, O_JIS7}, {&ojis8path, O_JIS8}, {&ojunetpath, O_JUNET}, {&hexpath, HEX}, {&cappath, CAP}, {&utf8path, UTF8}, {&utf8macpath, M_UTF8}, {&utf8iconvpath, I_UTF8}, {&noconvpath, NOCNV}, }; #define KPATHLISTSIZ arraysize(kpathlist) #endif /* DEP_FILECONV */ int onkanji1(s, ptr) CONST char *s; int ptr; { int i; if (ptr < 0) return(0); if (!ptr) return(iskanji1(s, 0)); for (i = 0; i < ptr; i++) { if (!s[i]) return(0); else if (iskanji1(s, i)) i++; #ifdef CODEEUC else VOID_C iskana1(s, &i); #endif } if (i > ptr) return(0); return(iskanji1(s, i)); } #if !defined (_NOKANJICONV) \ || (!defined (_NOENGMES) && !defined (_NOJPNMES)) static CONST char *NEAR Xstrstr(s1, s2) CONST char *s1, *s2; { int i, c1, c2; while (*s1) { for (i = 0;; i++) { if (!s2[i]) return(s1); c1 = s1[i]; c2 = s2[i]; if (Xislower(c2)) { c1 = Xtoupper(c1); c2 = Xtoupper(c2); } if (c1 != c2) break; if (iswchar(s1, 0)) { if (!s2[++i]) return(s1); if (s1[i] != s2[i]) break; } if (!s1[i]) break; } if (iswchar(s1, 0)) s1++; s1++; } return(NULL); } /*ARGSUSED*/ int getlang(s, io) CONST char *s; int io; { int i, ret; ret = NOCNV; if (s) for (i = 0; i < LANGLISTSIZ; i++) { if (!(kanjiiomode[langlist[i].lang] & io)) continue; if (Xstrstr(s, langlist[i].ident)) { ret = langlist[i].lang; break; } } # ifndef _NOKANJICONV if (io == L_INPUT && ret == NOCNV) ret = DEFCODE; # endif return(ret); } #endif /* !_NOKANJICONV || (!_NOENGMES && !_NOJPNMES) */ #if !defined (_NOKANJICONV) || (defined (DEP_DOSEMU) && defined (CODEEUC)) static VOID NEAR sj2j(buf, s) char *buf; CONST u_char *s; { u_int w; int n, s1, s2, j1, j2, min, max; s1 = (s[0] & 0xff); s2 = (s[1] & 0xff); if (s1 >= 0xf0) { w = (((u_int)s1 << 8) | s2); min = -1; max = CNVTBLSIZ; for (;;) { n = (min + max) / 2; if (n <= min || n >= max) { w = SJ_UDEF; kanjierrno = SJIS; break; } if (w >= convtable[n].start + convtable[n].range) min = n; else if (w < convtable[n].start) max = n; else { w -= convtable[n].start; w += convtable[n].cnv; break; } } s1 = ((w >> 8) & 0xff); s2 = (w & 0xff); } j1 = sj2jtable1[s1]; j2 = sj2jtable2[s2]; if (!j1 || !j2) { j1 = ((J_UDEF >> 8) & 0xff); j2 = (J_UDEF & 0xff); kanjierrno = SJIS; } else if (s2 >= 0x9f) j1++; buf[0] = j1; buf[1] = j2; } static VOID NEAR j2sj(buf, s) char *buf; CONST u_char *s; { u_int w; int i, s1, s2, j1, j2; j1 = (s[0] & 0x7f); j2 = (s[1] & 0x7f); s1 = j2sjtable1[j1]; s2 = (j1 & 1) ? j2sjtable2[j2] : j2sjtable3[j2]; if (!s1 || !s2) { w = SJ_UDEF; kanjierrno = JIS7; } else w = (((u_int)s1 << 8) | s2); for (i = 0; i < CNVTBLSIZ; i++) { if (w < convtable[i].cnv || w >= convtable[i].cnv + convtable[i].range) continue; w -= convtable[i].cnv; w += convtable[i].start; s1 = ((w >> 8) & 0xff); s2 = (w & 0xff); break; } buf[0] = s1; buf[1] = s2; } int sjis2ujis(buf, s, max) char *buf; CONST u_char *s; int max; { int i, j; for (i = j = 0; s[i] && j < max; i++, j++) { if (iswsjis((CONST char *)s, i)) { if (j + 2 > max) break; sj2j(&(buf[j]), &(s[i++])); buf[j++] |= 0x80; buf[j] |= 0x80; } else if (isskana(s, i)) { if (j + 2 > max) break; buf[j++] = (char)C_EKANA; buf[j] = s[i]; } else buf[j] = s[i]; } return(j); } int ujis2sjis(buf, s, max) char *buf; CONST u_char *s; int max; { int i, j; for (i = j = 0; s[i] && j < max; i++, j++) { if (isweuc((CONST char *)s, i)) { if (j + 2 > max) break; j2sj(&(buf[j++]), &(s[i++])); } else if (isekana(s, i)) buf[j] = s[++i]; else buf[j] = s[i]; } if (kanjierrno) kanjierrno = EUC; return(j); } #endif /* !_NOKANJICONV || (DEP_DOSEMU && CODEEUC) */ #ifdef DEP_UNICODE # ifndef DEP_EMBEDUNITBL static int NEAR openunitbl(file) CONST char *file; { static int fd = -2; u_char buf[2]; char path[MAXPATHLEN]; if (!file) { if (fd >= 0) VOID_C Xclose(fd); fd = -2; return(0); } if (fd >= -1) return(fd); if (!unitblpath || !*unitblpath) Xstrcpy(path, file); else strcatdelim2(path, unitblpath, file); # ifdef FD noconv++; # endif fd = -1; if ((fd = Xopen(path, O_BINARY | O_RDONLY, 0666)) < 0) fd = -1; else if (unitblent) /*EMPTY*/; else if (sureread(fd, buf, 2) == 2) unitblent = getword(buf, 0); else { VOID_C Xclose(fd); fd = -1; } # ifdef FD noconv--; # endif return(fd); } static u_char *NEAR newunitbl(size) ALLOC_T size; { u_char *tbl; if ((tbl = (u_char *)malloc(size))) return(tbl); VOID_C openunitbl(NULL); if (unicodebuffer) unicodebuffer = 0; return(NULL); } /*ARGSUSED*/ VOID readunitable(nf) int nf; { # ifndef _NOKANJICONV u_char buf[2], **tblbuf; u_int *tblent; int i; # endif u_char *tbl; ALLOC_T size; int fd; if (!unitblbuf) /*EMPTY*/; # ifndef _NOKANJICONV else if (nf && !nftblbuf) /*EMPTY*/; # endif else return; if ((fd = openunitbl(UNICODETBL)) < 0) return; size = (ALLOC_T)unitblent * 4; if (!unitblbuf) { if (!(tbl = newunitbl(size))) return; if (!skread(fd, (off_t)2, tbl, size)) { free(tbl); VOID_C openunitbl(NULL); return; } unitblbuf = tbl; } # ifndef _NOKANJICONV if (nf && !nftblbuf) { if (!skread(fd, (off_t)size + 2, buf, 2)) { VOID_C openunitbl(NULL); return; } nftblnum = buf[0]; nflen = buf[1]; tblbuf = (u_char **)malloc(nftblnum * sizeof(u_char *)); if (!tblbuf) { VOID_C openunitbl(NULL); return; } tblent = (u_int *)malloc(nftblnum * sizeof(u_int)); if (!tblent) { free(tblbuf); VOID_C openunitbl(NULL); return; } for (i = 0; i < nftblnum; i++) { if (sureread(fd, buf, 2) != 2) { while (i > 0) free(tblbuf[--i]); free(tblbuf); free(tblent); VOID_C openunitbl(NULL); return; } tblent[i] = getword(buf, 0); size = (ALLOC_T)tblent[i] * (2 + nflen * 2); if (!(tblbuf[i] = newunitbl(size))) { while (i > 0) free(tblbuf[--i]); free(tblbuf); free(tblent); return; } if (sureread(fd, tblbuf[i], size) != size) { while (i >= 0) free(tblbuf[i--]); free(tblbuf); free(tblent); VOID_C openunitbl(NULL); return; } } nftblbuf = tblbuf; nftblent = tblent; } # endif /* !_NOKANJICONV */ VOID_C openunitbl(NULL); } VOID discardunitable(VOID_A) { # ifndef _NOKANJICONV int i; # endif if (unitblbuf) free(unitblbuf); unitblbuf = NULL; # ifndef _NOKANJICONV if (nftblbuf) { for (i = 0; i < nftblnum; i++) free(nftblbuf[i]); free(nftblbuf); } nftblbuf = NULL; if (nftblent) free(nftblent); nftblent = NULL; # endif /* !_NOKANJICONV */ } # endif /* !DEP_EMBEDUNITBL */ u_int unifysjis(wc, russ) u_int wc; int russ; { int n, min, max; wc &= 0xffff; min = ((russ) ? 0 : EXCEPTRUSS) - 1; max = RSJISTBLSIZ; for (;;) { n = (min + max) / 2; if (n <= min || n >= max) break; if (wc >= rsjistable[n].start + rsjistable[n].range) min = n; else if (wc < rsjistable[n].start) max = n; else { wc -= rsjistable[n].start; wc += rsjistable[n].cnv; break; } } return(wc); } u_int cnvunicode(wc, encode) u_int wc; int encode; { # ifndef DEP_EMBEDUNITBL int fd; # endif CONST u_char *cp; u_char buf[4]; u_int r, w, ofs, min, max; wc &= 0xffff; if (encode < 0) { # ifndef DEP_EMBEDUNITBL VOID_C openunitbl(NULL); if (!unicodebuffer) discardunitable(); # endif return(0); } if (encode) { r = U2_UDEF; if (wc < 0x0080) return(wc); if (wc >= 0x00a1 && wc <= 0x00df) return(0xff00 | (wc - 0x00a1 + 0x61)); if (wc >= 0x8260 && wc <= 0x8279) return(0xff00 | (wc - 0x8260 + 0x21)); if (wc >= 0x8281 && wc <= 0x829a) return(0xff00 | (wc - 0x8281 + 0x41)); if (wc < MINKANJI || wc > MAXKANJI) { kanjierrno = SJIS; return(r); } wc = unifysjis(wc, 0); } else { r = SJ_UDEF; switch (wc & 0xff00) { case 0: if ((wc & 0xff) < 0x80) return(wc); break; case 0xff00: w = (wc & 0xff); if (w >= 0x21 && w <= 0x3a) return(w + 0x8260 - 0x21); if (w >= 0x41 && w <= 0x5a) return(w + 0x8281 - 0x41); if (w >= 0x61 && w <= 0x9f) return(w + 0x00a1 - 0x61); break; default: break; } if (wc < MINUNICODE || wc > MAXUNICODE) { kanjierrno = UTF8; return(r); } if (wc == 0x3099) return(0x814a); if (wc == 0x309a) return(0x814b); } # ifndef DEP_EMBEDUNITBL if (unicodebuffer && !unitblbuf) readunitable(0); # endif cp = buf; ofs = min = max = 0; # ifndef DEP_EMBEDUNITBL if (unitblbuf) # endif { if (encode) { cp = unitblbuf; for (ofs = 0; ofs < unitblent; ofs++) { w = getword(cp, 2); if (wc == w) break; cp += 4; } } else { min = 0; max = unitblent + 1; for (;;) { ofs = (min + max) / 2; if (ofs <= min || ofs >= max) break; cp = &(unitblbuf[(ofs - 1) * 4]); w = getword(cp, 0); if (wc > w) min = ofs; else if (wc < w) max = ofs; else break; } } } # ifndef DEP_EMBEDUNITBL else if ((fd = openunitbl(UNICODETBL)) < 0) ofs = unitblent; else if (encode) { if (Xlseek(fd, (off_t)2, L_SET) < (off_t)0) ofs = unitblent; else for (ofs = 0; ofs < unitblent; ofs++) { if (sureread(fd, buf, 4) != 4) { ofs = unitblent; break; } w = getword(cp, 2); if (wc == w) break; } } else { min = 0; max = unitblent + 1; for (;;) { ofs = (min + max) / 2; if (ofs <= min || ofs >= max) break; if (!skread(fd, (off_t)(ofs - 1) * 4 + 2, buf, 4)) { ofs = min = max = 0; break; } w = getword(cp, 0); if (wc > w) min = ofs; else if (wc < w) max = ofs; else break; } } # endif /* !DEP_EMBEDUNITBL */ if (encode) { if (ofs < unitblent) r = getword(cp, 0); else kanjierrno = SJIS; } else { if (ofs > min && ofs < max) r = getword(cp, 2); else kanjierrno = UTF8; } return(r); } #endif /* DEP_UNICODE */ #ifndef _NOKANJICONV # if defined (DEP_UNICODE) && !defined (DEP_EMBEDUNITBL) static int NEAR opennftbl(file, nf, entp) CONST char *file; int nf; u_int *entp; { u_char buf[2]; off_t ofs; int i, fd; if ((fd = openunitbl(file)) < 0) return(-1); ofs = (off_t)unitblent * 4 + 2; if (!nftblnum) { if (!skread(fd, ofs, buf, 2)) return(-1); nftblnum = buf[0]; nflen = buf[1]; } if (nf > nftblnum) return(-1); *entp = 0; for (i = 0; i < nf; i++) { ofs += 2 + (off_t)*entp * (2 + nflen * 2); if (!skread(fd, ofs, buf, 2)) return(-1); *entp = getword(buf, 0); } return(fd); } # endif /* DEP_UNICODE && !DEP_EMBEDUNITBL */ static int NEAR toenglish(buf, s, max) char *buf; CONST u_char *s; int max; { int i, j; for (i = j = 0; s[i] && j < max; i++, j++) { if (iskanji1((char *)s, i)) { if (j + 2 > max) break; i++; buf[j++] = '?'; buf[j] = '?'; } else if (iskana1((char *)s, &i)) buf[j] = '?'; else buf[j] = s[i]; } return(j); } static int NEAR tojis7(buf, s, max, knj, asc, io) char *buf; CONST u_char *s; int max, knj, asc, io; { int i, j, len, mode; mode = ASCII; for (i = j = 0; s[i] && j < max; i++, j++) { if (iskanji1((char *)s, i)) { len = 5; if (mode & KANA) len++; if (!(mode & KANJI)) len += 3; if (j + len > max) break; if (mode & KANA) buf[j++] = '\017'; mode &= ~KANA; if (!(mode & KANJI)) { buf[j++] = '\033'; buf[j++] = '$'; buf[j++] = knj; } mode |= KANJI; # ifdef CODEEUC buf[j++] = (s[i++] & ~0x80); buf[j] = (s[i] & ~0x80); # else sj2j(&(buf[j++]), &(s[i++])); # endif buf[j] = jcnv(buf[j], io); } else if (iskana1((char *)s, &i)) { len = 2; if (!(mode & KANA)) len++; if (mode & KANJI) len += 3; if (j + len > max) break; if (!(mode & KANA)) buf[j++] = '\016'; mode |= KANA; buf[j] = (s[i] & ~0x80); buf[j] = jcnv(buf[j], io); } else { len = 1; if (mode & KANA) len++; if (mode & KANJI) len += 3; if (j + len > max) break; if (mode & KANA) buf[j++] = '\017'; mode &= ~KANA; if (mode & KANJI) { buf[j++] = '\033'; buf[j++] = '('; buf[j++] = asc; } mode &= ~KANJI; buf[j] = s[i]; } } if (mode & KANA) buf[j++] = '\017'; if (mode & KANJI) { buf[j++] = '\033'; buf[j++] = '('; buf[j++] = asc; } return(j); } static int NEAR fromjis(buf, s, max, io) char *buf; CONST u_char *s; int max, io; { # ifndef CODEEUC u_char tmp[MAXKLEN]; # endif int i, j, mode; mode = ASCII; for (i = j = 0; s[i] && j < max; i++) switch (s[i]) { case '\016': /* SO */ mode |= KANA; break; case '\017': /* SI */ mode &= ~KANA; break; case '\033': /* ESC */ if (s[i + 1] == '$') { if (s[i + 2] == '@' || s[i + 2] == 'B') { mode &= ~JKANA; mode |= KANJI; i += 2; break; } else if (s[i + 2] == '(' && (s[i + 3] == '@' || s[i + 3] == 'B' || s[i + 3] == 'O')) { mode &= ~JKANA; mode |= KANJI; i += 3; break; } } else if (s[i + 1] == '(') { if (s[i + 2] == 'J' || s[i + 2] == 'B' || s[i + 2] == 'H') { mode &= ~(KANJI | JKANA); i += 2; break; } else if (s[i + 2] == 'I') { mode &= ~KANJI; mode |= JKANA; i += 2; break; } } else if (s[i + 1] == '&') { if (s[i + 2] == '@' && s[i + 3] == '\033' && s[i + 4] == '$' && s[i + 5] == 'B') { mode &= ~JKANA; mode |= KANJI; i += 5; break; } } /*FALLTHRU*/ default: if (mode & (KANA | JKANA)) { if (!isjkana(s, i)) buf[j++] = s[i]; else { # ifdef CODEEUC if (j + 2 > max) break; buf[j++] = (char)C_EKANA; # endif buf[j++] = (jdecnv(s[i], io) | 0x80); } } else if (mode & KANJI) { if (j + 2 > max) break; if (!isjis(s[i]) || !isjis(s[i + 1])) { buf[j++] = s[i++]; buf[j++] = s[i]; } else { # ifdef CODEEUC buf[j++] = (s[i++] | 0x80); buf[j++] = (jdecnv(s[i], io) | 0x80); # else tmp[0] = s[i++]; tmp[1] = jdecnv(s[i], io); j2sj(&(buf[j]), tmp); j += 2; # endif } } # ifdef CODEEUC else if (Xiskana(s[i])) { if (j + 2 > max) break; buf[j++] = (char)C_EKANA; buf[j++] = s[i]; } # endif else buf[j++] = s[i]; break; } return(j); } static int NEAR tojis8(buf, s, max, knj, asc, io) char *buf; CONST u_char *s; int max, knj, asc, io; { int i, j, len, mode; mode = ASCII; for (i = j = 0; s[i] && j < max; i++, j++) { if (iskanji1((char *)s, i)) { len = 5; if (mode != KANJI) len += 3; if (j + len > max) break; if (mode != KANJI) { buf[j++] = '\033'; buf[j++] = '$'; buf[j++] = knj; } mode = KANJI; # ifdef CODEEUC buf[j++] = (s[i++] & ~0x80); buf[j] = (s[i] & ~0x80); # else sj2j(&(buf[j++]), &(s[i++])); # endif buf[j] = jcnv(buf[j], io); } else { len = 1; if (mode == KANJI) len += 3; if (j + len > max) break; if (mode == KANJI) { buf[j++] = '\033'; buf[j++] = '('; buf[j++] = asc; } mode = ASCII; # ifdef CODEEUC VOID_C iskana1((char *)s, &i); # endif buf[j] = s[i]; } } if (mode == KANJI) { buf[j++] = '\033'; buf[j++] = '('; buf[j++] = asc; } return(j); } static int NEAR tojunet(buf, s, max, knj, asc, io) char *buf; CONST u_char *s; int max, knj, asc, io; { int i, j, len, mode; mode = ASCII; for (i = j = 0; s[i] && j < max; i++, j++) { if (iskanji1((char *)s, i)) { len = 5; if (mode != KANJI) len += 3; if (j + len > max) break; if (mode != KANJI) { buf[j++] = '\033'; buf[j++] = '$'; buf[j++] = knj; } mode = KANJI; # ifdef CODEEUC buf[j++] = (s[i++] & ~0x80); buf[j] = (s[i] & ~0x80); # else sj2j(&(buf[j++]), &(s[i++])); # endif buf[j] = jcnv(buf[j], io); } else if (iskana1((char *)s, &i)) { len = 4; if (mode != JKANA) len += 3; if (j + len > max) break; if (mode != JKANA) { buf[j++] = '\033'; buf[j++] = '('; buf[j++] = 'I'; } mode = JKANA; buf[j] = (s[i] & ~0x80); buf[j] = jcnv(buf[j], io); } else { len = 1; if (mode != ASCII) len += 3; if (j + len > max) break; if (mode != ASCII) { buf[j++] = '\033'; buf[j++] = '('; buf[j++] = asc; } mode = ASCII; buf[j] = s[i]; } } if (mode != ASCII) { buf[j++] = '\033'; buf[j++] = '('; buf[j++] = asc; } return(j); } # ifdef DEP_UNICODE int ucs2normalization(buf, ptrp, max, wc, nf) u_short *buf; int *ptrp, max; u_int wc; int nf; { # ifndef DEP_EMBEDUNITBL int fd; # endif CONST u_char *cp; u_char *new; u_int w, ofs, ent; int n; cp = new = NULL; ofs = ent = (u_int)0; # ifndef DEP_EMBEDUNITBL if (unicodebuffer && !nftblbuf) readunitable(1); # endif if (wc < MINUNICODE || wc > MAXUNICODE) /*EMPTY*/; # ifdef DEP_EMBEDUNITBL else if (nf <= nftblnum) # else else if (nftblbuf && nf <= nftblnum) # endif { n = 2 + nflen * 2; cp = nftblbuf[nf - 1]; ent = nftblent[nf - 1]; for (ofs = 0; ofs < ent; ofs++) { w = getword(cp, 0); if (wc == w) break; cp += n; } } # ifndef DEP_EMBEDUNITBL else if ((fd = opennftbl(UNICODETBL, nf, &ent)) < 0) ent = (u_int)0; else { n = 2 + nflen * 2; cp = new = (u_char *)malloc(n); if (!new) ent = (u_int)0; else for (ofs = 0; ofs < ent; ofs++) { if (sureread(fd, new, n) != n) { ofs = ent; break; } w = getword(cp, 0); if (wc == w) break; } } # endif /* !DEP_EMBEDUNITBL */ n = (ofs < ent) ? 0 : -1; if (!buf) /*EMPTY*/; else if (n < 0) buf[(*ptrp)++] = wc; else while (n < nflen && *ptrp < max) { cp += 2; w = getword(cp, 0); if (!w) break; buf[(*ptrp)++] = w; n++; } if (new) free(new); return(n); } u_int ucs2denormalization(buf, ptrp, nf, io) CONST u_short *buf; int *ptrp, nf, io; { # ifndef DEP_EMBEDUNITBL off_t top; u_int ent; int fd; # endif CONST u_char *cp; u_char *new; u_int w, ofs, min, max; int i, j, n; cp = new = NULL; ofs = min = max = (u_int)0; i = 0; # ifndef DEP_EMBEDUNITBL if (unicodebuffer && !nftblbuf) readunitable(1); # endif if (buf[*ptrp] < MINUNICODE || buf[*ptrp] > MAXUNICODE) /*EMPTY*/; # ifdef DEP_EMBEDUNITBL else if (nf <= nftblnum) # else else if (nftblbuf && nf <= nftblnum) # endif { n = 2 + nflen * 2; max = nftblent[nf - 1] + 1; for (;;) { ofs = (min + max) / 2; if (ofs <= min || ofs >= max) break; cp = &(nftblbuf[nf - 1][(ofs - 1) * n]); w = 0xffff; for (i = 0, j = 2; i < nflen; i++, j += 2) { if (!(w = getword(cp, j))) /*EMPTY*/; else if (buf[*ptrp + i] > w) min = ofs; else if (buf[*ptrp + i] < w) max = ofs; else continue; break; } if (!w) break; } } # ifndef DEP_EMBEDUNITBL else if ((fd = opennftbl(UNICODETBL, nf, &ent)) < 0 || (top = Xlseek(fd, (off_t)0, L_INCR)) < (off_t)0) /*EMPTY*/; else { n = 2 + nflen * 2; max = ent + 1; cp = new = (u_char *)malloc(n); if (!new) max = (u_int)0; else for (;;) { ofs = (min + max) / 2; if (ofs <= min || ofs >= max) break; if (!skread(fd, (off_t)(ofs - 1) * n + top, new, n)) { ofs = min = max = (u_int)0; break; } w = 0xffff; for (i = 0, j = 2; i < nflen; i++, j += 2) { if (!(w = getword(cp, j))) /*EMPTY*/; else if (buf[*ptrp + i] > w) min = ofs; else if (buf[*ptrp + i] < w) max = ofs; else continue; break; } if (!w) break; } } # endif /* !DEP_EMBEDUNITBL */ if (ofs <= min || ofs >= max) { w = buf[(*ptrp)++]; if (io != L_FNAME) /*EMPTY*/; else if (ucs2normalization(NULL, NULL, 0, w, nf) >= 0) kanjierrno = UTF8; } else { w = getword(cp, 0); *ptrp += i; } if (new) free(new); return(w); } static u_int NEAR toucs2(s, ptrp) CONST u_char *s; int *ptrp; { # ifdef CODEEUC u_char tmp[MAXKLEN]; # endif u_int w; if (iskanji1((char *)s, *ptrp)) { # ifdef CODEEUC j2sj((char *)tmp, &(s[*ptrp])); if (kanjierrno) kanjierrno = EUC; *ptrp += 2; w = (((u_int)(tmp[0]) << 8) | tmp[1]); # else w = (((u_int)(s[*ptrp]) << 8) | s[*ptrp + 1]); *ptrp += 2; # endif } else { VOID_C iskana1((char *)s, ptrp); w = s[(*ptrp)++]; } return(cnvunicode(w, 1)); } static VOID NEAR fromucs2(buf, ptrp, wc) char *buf; int *ptrp; u_int wc; { # ifdef CODEEUC u_char tmp[MAXKLEN]; # endif int c1, c2; wc = cnvunicode(wc, 0); c1 = ((wc >> 8) & 0xff); c2 = (wc & 0xff); if (wc > 0xa0 && wc <= 0xdf) { # ifdef CODEEUC buf[(*ptrp)++] = (char)C_EKANA; # endif buf[(*ptrp)++] = wc; } else if (issjis1(c1) && issjis2(c2)) { # ifdef CODEEUC tmp[0] = c1; tmp[1] = c2; sj2j(&(buf[*ptrp]), tmp); buf[(*ptrp)++] |= 0x80; buf[(*ptrp)++] |= 0x80; # else buf[(*ptrp)++] = c1; buf[(*ptrp)++] = c2; # endif } else buf[(*ptrp)++] = wc; } int ucs2toutf8(buf, ptr, wc) char *buf; int ptr; u_int wc; { if (wc < 0x80) buf[ptr++] = wc; else if (wc < 0x800) { buf[ptr++] = (0xc0 | (wc >> 6)); buf[ptr++] = (0x80 | (wc & 0x3f)); } else { buf[ptr++] = (0xe0 | (wc >> 12)); buf[ptr++] = (0x80 | ((wc >> 6) & 0x3f)); buf[ptr++] = (0x80 | (wc & 0x3f)); } return(ptr); } u_int ucs2fromutf8(s, ptrp) CONST u_char *s; int *ptrp; { u_int w; int ptr; ptr = (ptrp) ? *ptrp : 0; w = s[ptr++]; if (w < 0x80) /*EMPTY*/; else if (isutf2(w, s[ptr])) w = (((w & 0x1f) << 6) | (s[ptr++] & 0x3f)); else if (isutf3(w, s[ptr], s[ptr + 1])) { w = (((w & 0x0f) << 6) | (s[ptr++] & 0x3f)); w = ((w << 6) | (s[ptr++] & 0x3f)); } else { w = U2_UDEF; kanjierrno = UTF8; } if (ptrp) *ptrp = ptr; return(w); } static int NEAR toutf8(buf, s, max) char *buf; CONST u_char *s; int max; { u_int c; int i, j, len; i = j = 0; while (s[i] && j < max) { c = toucs2(s, &i); len = 1; if (c >= 0x80) len++; if (c >= 0x800) len++; if (j + len > max) break; j = ucs2toutf8(buf, j, c); } cnvunicode(0, -1); if (kanjierrno) kanjierrno = DEFCODE; return(j); } static int NEAR fromutf8(buf, s, max) char *buf; CONST u_char *s; int max; { int i, j; i = j = 0; while (s[i] && j + 1 < max) fromucs2(buf, &j, ucs2fromutf8(s, &i)); cnvunicode(0, -1); return(j); } static int NEAR toutf8nf(buf, s, max, nf) char *buf; CONST u_char *s; int max, nf; { u_short *u1, *u2; int i, j, len; if (!(u1 = (u_short *)malloc((max + 1) * sizeof(u_short)))) return(toutf8(buf, s, max)); if (!(u2 = (u_short *)malloc((max + 1) * sizeof(u_short)))) { free(u1); return(toutf8(buf, s, max)); } for (i = j = 0; s[i] && j < max; j++) u1[j] = toucs2(s, &i); u1[j] = (u_short)0; for (i = j = 0; u1[i] && j < max; i++) VOID_C ucs2normalization(u2, &j, max, u1[i], nf); u2[j] = (u_short)0; for (i = j = 0; u2[i] && j < max; i++) { len = 1; if (u2[i] >= 0x80) len++; if (u2[i] >= 0x800) len++; if (j + len > max) break; j = ucs2toutf8(buf, j, u2[i]); } free(u1); free(u2); cnvunicode(0, -1); if (kanjierrno) kanjierrno = DEFCODE; return(j); } static int NEAR fromutf8nf(buf, s, max, nf, io) char *buf; CONST u_char *s; int max, nf, io; { u_short *u1, *u2; int i, j; if (!(u1 = (u_short *)malloc((max + 1) * sizeof(u_short)))) return(fromutf8(buf, s, max)); if (!(u2 = (u_short *)malloc((max + 1) * sizeof(u_short)))) { free(u1); return(fromutf8(buf, s, max)); } for (i = j = 0; s[i] && j < max; j++) u1[j] = ucs2fromutf8(s, &i); u1[j] = (u_short)0; for (i = j = 0; u1[i] && j < max; j++) u2[j] = ucs2denormalization(u1, &i, nf, io); u2[j] = (u_short)0; for (i = j = 0; u2[i] && j + 1 < max; i++) fromucs2(buf, &j, u2[i]); free(u1); free(u2); cnvunicode(0, -1); return(j); } # endif /* DEP_UNICODE */ static int NEAR bin2hex(buf, c) char *buf; int c; { int i; i = 0; buf[i++] = ':'; buf[i++] = tohexa((c >> 4) & 0xf); buf[i++] = tohexa(c & 0xf); return(i); } static int NEAR tohex(buf, s, max) char *buf; CONST u_char *s; int max; { # ifdef CODEEUC u_char tmp[MAXKLEN]; # endif int i, j; for (i = j = 0; s[i] && j < max; i++, j++) { if (iskanji1((char *)s, i)) { if (j + 6 > max) break; # ifdef CODEEUC j2sj((char *)tmp, &(s[i++])); j += bin2hex(&(buf[j]), tmp[0]); j += bin2hex(&(buf[j]), tmp[1]) - 1; # else j += bin2hex(&(buf[j]), s[i++]); j += bin2hex(&(buf[j]), s[i]) - 1; # endif } else if (iskana1((char *)s, &i)) { if (j + 3 > max) break; j += bin2hex(&(buf[j]), s[i]) - 1; } else buf[j] = s[i]; } if (kanjierrno) kanjierrno = DEFCODE; return(j); } static int NEAR fromhex(buf, s, max) char *buf; CONST u_char *s; int max; { # ifdef CODEEUC u_char tmp[MAXKLEN]; # endif int i, j, c1, c2; for (i = j = 0; s[i] && j < max; i++, j++) { if (!ishex(s, i)) buf[j] = s[i]; else { c1 = tobin2(s, i + 1); i += 2; if (Xiskana(c1)) { # ifdef CODEEUC if (j + 2 > max) break; buf[j++] = (char)C_EKANA; # endif buf[j] = c1; } else if (issjis1(c1)) { if (j + 2 > max) break; i++; if (!ishex(s, i)) c2 = s[i]; else { c2 = tobin2(s, i + 1); i += 2; } if (!issjis2(c2)) { buf[j++] = c1; buf[j] = c2; } else { # ifdef CODEEUC tmp[0] = c1; tmp[1] = c2; sj2j(&(buf[j]), tmp); buf[j++] |= 0x80; buf[j] |= 0x80; # else buf[j++] = c1; buf[j] = c2; # endif } } else buf[j] = c1; } } return(j); } static int NEAR bin2cap(buf, c) char *buf; int c; { int i; i = 0; if (c < 0x80) buf[i++] = c; else { buf[i++] = ':'; buf[i++] = tohexa((c >> 4) & 0xf); buf[i++] = tohexa(c & 0xf); } return(i); } static int NEAR tocap(buf, s, max) char *buf; CONST u_char *s; int max; { # ifdef CODEEUC u_char tmp[MAXKLEN]; # endif int i, j, len; for (i = j = 0; s[i] && j < max; i++, j++) { if (iskanji1((char *)s, i)) { len = 4; # ifdef CODEEUC j2sj((char *)tmp, &(s[i++])); if (ismsb(tmp[1])) len += 2; if (j + len > max) break; j += bin2cap(&(buf[j]), tmp[0]); j += bin2cap(&(buf[j]), tmp[1]) - 1; # else if (ismsb(s[i + 1])) len += 2; if (j + len > max) break; j += bin2cap(&(buf[j]), s[i++]); j += bin2cap(&(buf[j]), s[i]) - 1; # endif } else if (iskana1((char *)s, &i)) { if (j + 3 > max) break; j += bin2cap(&(buf[j]), s[i]) - 1; } else buf[j] = s[i]; } if (kanjierrno) kanjierrno = DEFCODE; return(j); } static int NEAR fromcap(buf, s, max) char *buf; CONST u_char *s; int max; { # ifdef CODEEUC u_char tmp[MAXKLEN]; # endif int i, j, c1, c2; for (i = j = 0; s[i] && j < max; i++, j++) { if (!iscap(s, i)) buf[j] = s[i]; else { c1 = tobin2(s, i + 1); i += 2; if (Xiskana(c1)) { # ifdef CODEEUC if (j + 2 > max) break; buf[j++] = (char)C_EKANA; # endif buf[j] = c1; } else if (issjis1(c1)) { if (j + 2 > max) break; i++; if (!iscap(s, i)) c2 = s[i]; else { c2 = tobin2(s, i + 1); i += 2; } if (!issjis2(c2)) { buf[j++] = c1; buf[j] = c2; } else { # ifdef CODEEUC tmp[0] = c1; tmp[1] = c2; sj2j(&(buf[j]), tmp); buf[j++] |= 0x80; buf[j] |= 0x80; # else buf[j++] = c1; buf[j] = c2; # endif } } else buf[j] = c1; } } return(j); } static CONST char *NEAR _kanjiconv(buf, s, max, in, out, lenp, io) char *buf; CONST char *s; int max, in, out, *lenp, io; { kanjierrno = 0; if (in == out || in == NOCNV || out == NOCNV) return(s); switch (out) { case ENG: *lenp = toenglish(buf, (u_char *)s, max); break; case JIS7: *lenp = tojis7(buf, (u_char *)s, max, 'B', 'B', io); break; case O_JIS7: *lenp = tojis7(buf, (u_char *)s, max, '@', 'J', io); break; case JIS8: *lenp = tojis8(buf, (u_char *)s, max, 'B', 'B', io); break; case O_JIS8: *lenp = tojis8(buf, (u_char *)s, max, '@', 'J', io); break; case JUNET: *lenp = tojunet(buf, (u_char *)s, max, 'B', 'B', io); break; case O_JUNET: *lenp = tojunet(buf, (u_char *)s, max, '@', 'J', io); break; # ifdef DEP_UNICODE case UTF8: *lenp = toutf8(buf, (u_char *)s, max); break; case M_UTF8: case I_UTF8: *lenp = toutf8nf(buf, (u_char *)s, max, out - UTF8); break; # endif case HEX: *lenp = tohex(buf, (u_char *)s, max); break; case CAP: *lenp = tocap(buf, (u_char *)s, max); break; case SECCODE: *lenp = kencode(buf, (u_char *)s, max); break; case DEFCODE: switch (in) { case JIS7: case O_JIS7: case JIS8: case O_JIS8: case JUNET: case O_JUNET: *lenp = fromjis(buf, (u_char *)s, max, io); break; # ifdef DEP_UNICODE case UTF8: *lenp = fromutf8(buf, (u_char *)s, max); break; case M_UTF8: case I_UTF8: *lenp = fromutf8nf(buf, (u_char *)s, max, in - UTF8, io); break; # endif case HEX: *lenp = fromhex(buf, (u_char *)s, max); break; case CAP: *lenp = fromcap(buf, (u_char *)s, max); break; case SECCODE: *lenp = kdecode(buf, (u_char *)s, max); break; default: return(s); /*NOTREACHED*/ break; } break; default: return(s); /*NOTREACHED*/ break; } if (io == L_FNAME && kanjierrno) return(s); return(buf); } int kanjiconv(buf, s, max, in, out, io) char *buf; CONST char *s; int max, in, out, io; { int len; if (_kanjiconv(buf, s, max, in, out, &len, io) != buf) for (len = 0; s[len]; len++) buf[len] = s[len]; buf[len] = '\0'; return(len); } CONST char *kanjiconv2(buf, s, max, in, out, io) char *buf; CONST char *s; int max, in, out, io; { int len; if (_kanjiconv(buf, s, max, in, out, &len, io) != buf) return(s); buf[len] = '\0'; return(buf); } char *newkanjiconv(s, in, out, io) CONST char *s; int in, out, io; { char *buf; int len; if (!s) return(NULL); len = strlen(s) * 3 + 3; if (!(buf = malloc(len + 1))) return((char *)s); if (kanjiconv2(buf, s, len, in, out, io) != buf) { free(buf); return((char *)s); } return(buf); } VOID renewkanjiconv(sp, in, out, io) char **sp; int in, out, io; { char *buf; buf = newkanjiconv(*sp, in, out, io); if (buf != *sp) { free(*sp); *sp = buf; } } #endif /* !_NOKANJICONV */ #ifdef DEP_FILECONV int getkcode(path) CONST char *path; { int i; # ifdef DEP_DOSEMU if (_dospath(path)) return(SJIS); # endif for (i = 0; i < KPATHLISTSIZ; i++) { if (includepath(path, *(kpathlist[i].path))) return(kpathlist[i].code); } return(fnamekcode); } #endif /* DEP_FILECONV */ #ifndef _NOKANJICONV int getoutputkcode(VOID_A) { # ifdef DEP_PTY if (parentfd >= 0 && ptyoutkcode != NOCNV) return(ptyoutkcode); # endif return(outputkcode); } #endif /* !_NOKANJICONV */ #ifdef FD /*ARGSUSED*/ char *convget(buf, path, drv) char *buf, *path; int drv; { # ifdef DEP_ROCKRIDGE char rbuf[MAXPATHLEN]; # endif # ifdef DEP_FILECONV int c, fgetok; # endif CONST char *cp; # ifdef DOUBLESLASH if (path[0] == _SC_ && path[1] == _SC_ && !isdslash(path)) memmove(path, &(path[1]), strlen(&(path[1])) + 1); # endif if (noconv) return(path); # ifdef DEP_FILECONV fgetok = (nokanjifconv) ? 0 : 1; # endif cp = path; # ifdef DEP_ROCKRIDGE if (!norockridge) cp = transpath(cp, rbuf); # endif # ifdef DEP_DOSEMU if (drv == DEV_DOS) { # ifdef CODEEUC buf[sjis2ujis(buf, (u_char *)cp, MAXPATHLEN - 1)] = '\0'; cp = buf; # endif # ifdef DEP_FILECONV fgetok = 0; # endif } # endif /* DEP_DOSEMU */ # ifdef DEP_FILECONV if (fgetok) { # ifdef DEP_URLPATH if (drv == DEV_URL) c = urlkcode; else # endif c = getkcode(cp); cp = kanjiconv2(buf, cp, MAXPATHLEN - 1, c, DEFCODE, L_FNAME); } # endif /* DEP_FILECONV */ # ifdef DEP_ROCKRIDGE if (cp == rbuf) { Xstrcpy(buf, rbuf); return(buf); } # endif return((char *)cp); } /*ARGSUSED*/ char *convput(buf, path, rrreal, flags) char *buf; CONST char *path; char *rrreal; int flags; { # if defined (DEP_FILECONV) || defined (DEP_DOSEMU) char kbuf[MAXPATHLEN]; # endif # ifdef DEP_ROCKRIDGE char rbuf[MAXPATHLEN]; # endif # ifdef DEP_FILECONV int c, fputok; # endif # ifdef DEP_URLPATH int url; # endif CONST char *cp, *file; char *tmp, rpath[MAXPATHLEN]; int n; if (rrreal) *rrreal = '\0'; if (noconv || isdotdir(path)) { # ifdef DEP_DOSEMU if (dospath(path, buf)) return(buf); # endif # ifdef DEP_URLPATH if (urlpath(path, NULL, buf, NULL)) return(buf); # endif return((char *)path); } # ifdef DEP_FILECONV fputok = (nokanjifconv) ? 0 : 1; # endif # ifdef DEP_URLPATH url = _urlpath(path, NULL, NULL); # endif if ((flags & CVP_NEEDFILE) && strdelim(path, 0)) flags &= ~CVP_NEEDFILE; if (norealpath) cp = path; else { if ((file = strrdelim(path, 0))) { # ifdef DOUBLESLASH if ((n = isdslash(path)) && file < &(path[n])) file = &(path[n]); else # endif # ifdef DEP_URLPATH if (url && file < &(path[url])) file = &(path[n = url]); else # endif { n = file - path; if (file++ == isrootdir(path)) n++; } Xstrncpy(rpath, path, n); } # ifdef DEP_DOSEMU else if ((n = _dospath(path))) { file = &(path[2]); VOID_C gendospath(rpath, n, '.'); } # endif else { file = path; copycurpath(rpath); } VOID_C Xrealpath(rpath, rpath, RLP_READLINK); tmp = strcatdelim(rpath); Xstrncpy(tmp, file, MAXPATHLEN - 1 - (tmp - rpath)); cp = rpath; } # ifdef DEP_DOSEMU if ((n = dospath(cp, kbuf))) { cp = kbuf; # ifdef DEP_FILECONV fputok = 0; # endif } # endif /* DEP_DOSEMU */ # ifdef DEP_FILECONV if (fputok) { # ifdef DEP_URLPATH if (url) c = urlkcode; else # endif c = getkcode(cp); cp = kanjiconv2(kbuf, cp, MAXPATHLEN - 1, DEFCODE, c, L_FNAME); } # endif /* DEP_FILECONV */ # ifdef DEP_ROCKRIDGE if (!norockridge && (cp = detranspath(cp, rbuf)) == rbuf) { if (rrreal) Xstrcpy(rrreal, rbuf); if (!(flags & CVP_READLINK)) /*EMPTY*/; else if (rrreadlink(cp, buf, MAXPATHLEN - 1) >= 0) { if ((flags & CVP_NEEDFILE) && strdelim(buf, 0)) flags &= ~CVP_NEEDFILE; if (*buf == _SC_ || !(tmp = strrdelim(rbuf, 0))) cp = buf; else { tmp++; Xstrncpy(tmp, buf, MAXPATHLEN - (tmp - rbuf)); cp = rbuf; } VOID_C Xrealpath(cp, rpath, RLP_READLINK); cp = detranspath(rpath, rbuf); } } # endif if (cp == path) return((char *)path); if ((flags & CVP_NEEDFILE) && (file = strrdelim(cp, 0))) file++; else file = cp; # ifdef DEP_DOSEMU if (Xisalpha(n) && !_dospath(file)) tmp = gendospath(buf, n, '\0'); else # endif tmp = buf; Xstrcpy(tmp, file); return(buf); } #endif /* FD */ FD-3.01j/input.c100644 2105 1751 224251 13516612560 12232 0ustar shiraiuser/* * input.c * * input module */ #include "fd.h" #include "wait.h" #include "parse.h" #include "kconv.h" #include "func.h" #include "kanji.h" #include "system.h" #include "termemu.h" #define LIMITSELECTWARN 100 #define YESNOSTR "[Y/N]" #define YESNOSIZE strsize(YESNOSTR) #define WAITAFTERWARN 360 /* msec */ #define maxscr() (maxcol * (maxline - minline) \ - plen - (n_column - n_lastcolumn)) #define within(n) ((n) < maxscr()) #define overflow(n) ((n) > maxscr()) #define ptr2col(n) (((n) + plen) % maxcol) #define ptr2line(n) (((n) + plen) / maxcol) #define iseol(n) (within(n) && !(ptr2col(n))) #define LEFTMARGIN 0 #define RIGHTMARGIN 2 extern char **history[]; extern short histsize[]; extern int curcolumns; extern int minfilename; extern int fnameofs; extern int hideclock; extern CONST char *promptstr; #ifdef DEP_ORIGSHELL extern int fdmode; extern CONST char *promptstr2; #endif #ifdef DEP_IME extern int ime_cont; extern int ime_line; extern int *ime_xposp; extern VOID (*ime_locate)__P_((int, int)); #endif #ifdef DEP_KCONV static int NEAR getinkcode __P_((VOID_A)); #else #define getinkcode() NOCNV #endif #ifndef _NOEDITMODE static int NEAR getemulatekey __P_((int, CONST char [])); #endif #ifdef DEP_IME static int NEAR getimebuf __P_((CONST char *, int *)); static int NEAR getime __P_((int, int *, int)); #endif #ifdef DEP_KCONV static int NEAR getkey4 __P_((int, int)); #else #define getkey4(s, t) getkey3(s, getinkcode(), t) #endif static char *NEAR trquote __P_((CONST char *, int, int *)); static int NEAR vlen __P_((CONST char *, int)); static int NEAR rlen __P_((CONST char *, int)); static int NEAR vonkanji1 __P_((CONST char *, int)); static int NEAR attrkanjiputs2 __P_((CONST char *, int, int)); #if FD >= 2 static VOID NEAR kanjiputs3 __P_((CONST char *, int, int, int, int)); #else #define kanjiputs3(s, n, l, p, m) \ VOID_C kanjiputs2(s, l, p) #endif static VOID NEAR putcursor __P_((int, int)); static VOID NEAR rightcursor __P_((VOID_A)); static VOID NEAR leftcursor __P_((VOID_A)); static VOID NEAR upcursor __P_((VOID_A)); static VOID NEAR downcursor __P_((VOID_A)); #ifdef DEP_ORIGSHELL static VOID NEAR forwcursor __P_((int)); static VOID NEAR backcursor __P_((int)); static VOID NEAR forwline __P_((int)); static VOID NEAR dumbputs __P_((CONST char *, int, int, int, int)); static VOID NEAR rewritecursor __P_((int, int)); static int NEAR checkcursor __P_((int, int)); #endif static VOID NEAR scrollup __P_((VOID_A)); static VOID NEAR locate2 __P_((int, int)); #ifdef DEP_IME static VOID locate3 __P_((int, int)); #endif static VOID NEAR setcursor __P_((int, int)); static VOID NEAR putstr __P_((int *, int *, int)); static VOID NEAR ringbell __P_((VOID_A)); static VOID NEAR clearline __P_((VOID_A)); static VOID NEAR newline __P_((int)); static VOID NEAR rightchar __P_((VOID_A)); static VOID NEAR leftchar __P_((VOID_A)); static VOID NEAR insertchar __P_((int, int, int)); static VOID NEAR deletechar __P_((int, int, int)); static VOID NEAR insshift __P_((int, int)); static VOID NEAR delshift __P_((int, int)); static VOID NEAR truncline __P_((VOID_A)); static VOID NEAR displaystr __P_((VOID_A)); static VOID NEAR insertbuf __P_((int)); static int NEAR preparestr __P_((int, int)); static int NEAR insertcursor __P_((int *, int *, int, int)); static int NEAR quotemeta __P_((int *, int *, int, int *, int *, int *)); static int NEAR insertstr __P_((CONST char *, int, int, int *, int *)); #ifndef _NOCOMPLETE static VOID NEAR selectfile __P_((int, char *CONST *)); static int NEAR completestr __P_((int, int, int)); #endif #ifdef DEP_KCONV static u_int NEAR getucs2 __P_((int)); static VOID NEAR ungetch3 __P_((int)); #endif static int NEAR getch3 __P_((VOID_A)); static int NEAR getkanjikey __P_((char *, int)); static VOID NEAR copyhist __P_((CONST char *, int)); static VOID NEAR _inputstr_up __P_((int *, int, char **)); static VOID NEAR _inputstr_down __P_((int *, int, char **)); static VOID NEAR _inputstr_delete __P_((VOID_A)); static VOID NEAR _inputstr_enter __P_((VOID_A)); #if FD >= 2 static VOID NEAR _inputstr_case __P_((int)); static int NEAR search_matchlen __P_((VOID_A)); static char *NEAR search_up __P_((int, int *, int, char **)); static char *NEAR search_down __P_((int, int *, int, char **)); #endif static VOID NEAR _inputstr_input __P_((CONST char *, int)); static int NEAR _inputstr __P_((int, int, int)); static VOID NEAR dispprompt __P_((CONST char *, int)); static int NEAR truncstr __P_((CONST char *)); static int NEAR yesnomes __P_((CONST char *)); static int NEAR selectcnt __P_((int, char *CONST *, int)); static int NEAR selectadj __P_((int, int, CONST char *CONST *, char **, int *, int)); static VOID NEAR selectmes __P_((int, int, int, char *CONST [], int [], int *, int)); int subwindow = 0; int win_x = 0; int win_y = 0; char *curfilename = NULL; #ifndef _NOEDITMODE char *editmode = NULL; #endif int lcmdline = 0; int maxcmdline = 0; #ifdef DEP_ORIGSHELL int dumbshell = 0; #endif #ifdef DEP_IME int imekey = 0; #endif #ifdef DEP_URLPATH int hidepasswd = 0; #endif #ifndef _NOEDITMODE static CONST int emulatekey[] = { K_UP, K_DOWN, K_RIGHT, K_LEFT, K_IC, K_DC, K_IL, K_DL, K_HOME, K_END, K_BEG, K_EOL, K_PPAGE, K_NPAGE, K_ENTER, K_ESC }; #define EMULATEKEYSIZ arraysize(emulatekey) static CONST char emacskey[] = { K_CTRL('P'), K_CTRL('N'), K_CTRL('F'), K_CTRL('B'), K_ESC, K_CTRL('D'), K_CTRL('Q'), K_CTRL('K'), K_ESC, K_ESC, K_CTRL('A'), K_CTRL('E'), K_CTRL('V'), K_CTRL('Y'), K_CTRL('O'), K_CTRL('G') }; static CONST char vikey[] = { 'k', 'j', 'l', 'h', K_ESC, 'x', K_ESC, 'D', 'g', 'G', '0', '$', K_CTRL('B'), K_CTRL('F'), 'o', K_ESC }; static CONST char wordstarkey[] = { K_CTRL('E'), K_CTRL('X'), K_CTRL('D'), K_CTRL('S'), K_CTRL('V'), K_CTRL('G'), K_CTRL(']'), K_CTRL('Y'), K_CTRL('W'), K_CTRL('Z'), K_CTRL('A'), K_CTRL('F'), K_CTRL('R'), K_CTRL('C'), K_CTRL('N'), K_ESC }; static int vistat = 0; #define VI_NEXT 001 #define VI_INSERT 002 #define VI_ONCE 004 #define VI_VIMODE 010 #define isvimode() ((vistat & (VI_VIMODE | VI_INSERT)) \ == VI_VIMODE) #endif /* !_NOEDITMODE */ static int plen = 0; static int maxcol = 0; static int minline = 0; static int maxline = 0; static char *inputbuf = NULL; static ALLOC_T inputsize = (ALLOC_T)0; static int rptr = 0; static int vptr = 0; static int inputlen = 0; #ifndef _NOCOMPLETE static namelist *selectlist = NULL; static int maxselect = 0; static int tmpfileperrow = -1; static int tmpfilepos = -1; static int tmpcolumns = -1; #endif static int xpos = 0; static int ypos = 0; static int overwritemode = 0; #ifdef DEP_ORIGSHELL static int dumbmode = 0; static int lastofs2 = 0; #endif #if FD >= 2 static int searchmode = 0; static char *searchstr = NULL; #endif #ifdef DEP_IME static int imemode = 0; #endif #ifdef DEP_KCONV static u_char ungetbuf3[MAXUTF8LEN * MAXNFLEN]; static int ungetnum3 = 0; #endif #ifdef DEP_KCONV static int NEAR getinkcode(VOID_A) { int code; code = (inputkcode != NOCNV) ? inputkcode : DEFCODE; # ifdef DEP_PTY if (parentfd >= 0 && ptyinkcode != NOCNV) code = ptyinkcode; # endif return(code); } #endif /* DEP_KCONV */ int intrkey(key) int key; { int c, duperrno; duperrno = errno; if (!kbhit2(0L)) c = EOF; else if ((c = Xgetch()) == EOF) /*EMPTY*/; else if (c != K_ESC) /*EMPTY*/; else if (kbhit2(WAITKEYPAD * 1000L)) { VOID_C ungetkey2(c, 0); c = EOF; } if (c == EOF) /*EMPTY*/; else if (c == cc_intr || (key >= 0 && c == key)) { if (isttyiomode) warning(0, INTR_K); else VOID_C Xfprintf(Xstderr, "%k\n", INTR_K); } else { VOID_C ungetkey2(c, 0); c = EOF; } errno = duperrno; return((c == EOF) ? 0 : 1); } #ifndef _NOEDITMODE static int NEAR getemulatekey(ch, table) int ch; CONST char table[]; { int i; for (i = 0; i < EMULATEKEYSIZ; i++) { if (table[i] == K_ESC) continue; if (ch == table[i]) return(emulatekey[i]); } return(ch); } #endif /* !_NOEDITMODE */ #ifdef DEP_IME static int NEAR getimebuf(buf, ptrp) CONST char *buf; int *ptrp; { int c; if (getinkcode() != EUC || !isekana(buf, *ptrp)) c = (u_char)(buf[*ptrp]); else c = mkekana((u_char)(buf[++(*ptrp)])); (*ptrp)++; return(c); } static int NEAR getime(sig, chp, nowait) int sig, *chp, nowait; { static char buf[MAXKANJIBUF + 1] = ""; static int next = 0; static int lastline = 0; int x, y, line; if (!ime_cont) next = lastline = 0; else if (next > 0) { if (next >= sizeof(buf) || !(*chp = getimebuf(buf, &next))) next = 0; else return(0); } if (nowait) return(-1); line = ptr2line(inputlen) + 1; if (line < lastline) line = lastline; ime_locate = locate3; ime_line = lastline = line; x = win_x - xpos; y = win_y - ypos; # ifdef DEP_ORIGSHELL if (shellmode) { ime_xposp = &win_x; x += xpos; y += ypos; } # endif locate2(0, line); setcursor(inputlen, -1); Xputterm(L_CLEAR); # ifdef DEP_ORIGSHELL if (shellmode) /*EMPTY*/; else # endif ime_line += ypos; locate2(x, y); *chp = ime_inputkanji(sig, buf); if (*chp < 0 || !ime_cont) { locate2(0, line); Xputterm(L_CLEAR); locate2(x, y); Xtflush(); } if (*chp != K_ESC) { if (*chp < 0) { next = lastline = 0; ime_inputkanji(0, NULL); } else if (!*chp) *chp = getimebuf(buf, &next); return(0); } imemode = lastline = 0; return(-1); } #endif /* DEP_IME */ #ifdef DEP_KCONV static int NEAR getkey4(sig, timeout) int sig, timeout; { int n; for (n = 0; n < ungetnum3; n++) VOID_C ungetkey2((int)ungetbuf3[n], 0); # ifdef DEP_IME if (imemode && !ungetnum3 && getime(sig, &n, 0) >= 0) /*EMPTY*/; else # endif n = getkey3(sig, getinkcode(), timeout); ungetnum3 = 0; return(n); } #endif /* DEP_KCONV */ int Xgetkey(sig, eof, timeout) int sig, eof, timeout; { static int prev = -1; int ch; if (sig < 0) { #ifndef _NOEDITMODE vistat = eof; #endif #ifdef DEP_IME imemode = 0; ime_inputkanji(0, NULL); #endif prev = -1; return('\0'); } sig = sigalrm(sig); ch = getkey4(sig, timeout); if (eof && (ch != cc_eof || prev == ch)) eof = 0; prev = ch; if (eof) return(-1); #ifndef _NOEDITMODE if (!editmode) /*EMPTY*/; else if (!strcmp(editmode, "emacs")) ch = getemulatekey(ch, emacskey); else if (!strcmp(editmode, "vi")) do { vistat |= VI_VIMODE; vistat &= ~VI_NEXT; if (vistat & VI_INSERT) switch (ch) { case K_CTRL('V'): if (vistat & VI_ONCE) vistat &= ~(VI_INSERT | VI_ONCE); ch = K_IL; break; case K_ESC: if (vistat & VI_ONCE) vistat |= VI_NEXT; vistat &= ~(VI_INSERT | VI_ONCE); ch = K_LEFT; break; case K_CR: vistat &= ~(VI_INSERT | VI_ONCE); break; case K_BS: if (vistat & VI_ONCE) vistat &= ~(VI_INSERT | VI_ONCE); break; default: if (vistat & VI_ONCE) vistat &= ~(VI_INSERT | VI_ONCE); if (ch < K_MIN) break; ringbell(); vistat |= VI_NEXT; break; } else if ((ch = getemulatekey(ch, vikey)) < K_MIN) switch (ch) { case ':': vistat |= (VI_NEXT | VI_INSERT); overwritemode = 0; break; case 'I': vistat |= VI_INSERT; overwritemode = 0; ch = K_BEG; break; case 'A': vistat |= VI_INSERT; overwritemode = 0; ch = K_EOL; break; case 'i': vistat |= (VI_NEXT | VI_INSERT); overwritemode = 0; break; case 'a': vistat |= VI_INSERT; overwritemode = 0; ch = K_RIGHT; break; # if FD >= 2 case 'R': vistat |= (VI_NEXT | VI_INSERT); overwritemode = 1; break; case 'r': vistat |= (VI_NEXT | VI_INSERT | VI_ONCE); overwritemode = 1; break; # endif /* FD >= 2 */ case K_BS: ch = K_LEFT; break; case ' ': ch = K_RIGHT; break; case K_ESC: case K_CR: case '\t': break; default: ringbell(); vistat |= VI_NEXT; break; } } while ((vistat & VI_NEXT) && (ch = getkey4(sig, timeout)) > 0); else if (!strcmp(editmode, "wordstar")) ch = getemulatekey(ch, wordstarkey); #endif /* !_NOEDITMODE */ return((ch >= 0) ? ch : K_ESC); } static char *NEAR trquote(s, len, widthp) CONST char *s; int len, *widthp; { char *cp, *buf; int vw; cp = Xstrndup(s, len); buf = Xmalloc(len * MAXCHARWID + 1); vw = Xsnprintf(buf, len * MAXCHARWID + 1, "%^s", cp); Xfree(cp); if (widthp) *widthp = vw; return(buf); } static int NEAR vlen(s, cx) CONST char *s; int cx; { int v, r, rw, vw; v = r = 0; while (r < cx) { getcharwidth(s, r, &rw, &vw); if (r + rw > cx) break; r += rw; v += vw; } return(v); } static int NEAR rlen(s, cx2) CONST char *s; int cx2; { int v, r, rw, vw; v = r = 0; while (v < cx2) { getcharwidth(s, r, &rw, &vw); if (v + vw > cx2) break; r += rw; v += vw; } return(r); } static int NEAR vonkanji1(s, cx2) CONST char *s; int cx2; { int v, r, rw, vw; v = r = 0; while (v < cx2) { getcharwidth(s, r, &rw, &vw); if (v + vw > cx2) return(0); r += rw; v += vw; } return(iskanji1(s, r) ? r + 1 : 0); } int kanjiputs2(s, len, ptr) CONST char *s; int len, ptr; { char *buf; int n; if (len < 0) return(0); buf = Xmalloc(len * KANAWID + 1); VOID_C strncpy2(buf, s, &len, ptr); #ifdef DEP_KCONV n = Xkanjiputs(buf); #else XXcputs(buf); n = strlen2(buf); #endif Xfree(buf); return(n); } static int NEAR attrkanjiputs2(s, len, ptr) CONST char *s; int len, ptr; { Xputterm(T_STANDOUT); len = kanjiputs2(s, len, ptr); Xputterm(END_STANDOUT); return(len); } #if FD >= 2 static VOID NEAR kanjiputs3(s, cx2, len2, ptr, top) CONST char *s; int cx2, len2, ptr, top; { int n, width; if (!searchmode || ptr + len2 <= top || ptr >= cx2) { VOID_C kanjiputs2(s, len2, ptr); return; } width = cx2 - top; n = top - ptr; if (n <= 0) width += n; else { VOID_C kanjiputs2(s, n, ptr); ptr += n; len2 -= n; } VOID_C attrkanjiputs2(s, width, ptr); ptr += width; len2 -= width; if (len2 > 0) VOID_C kanjiputs2(s, len2, ptr); } #endif /* FD >= 2 */ VOID cputspace(n) int n; { VOID_C XXcprintf("%*s", n, nullstr); } VOID cputstr(n, s) int n; CONST char *s; { if (!s) cputspace(n); else VOID_C XXcprintf("%^-*.*k", n, n, s); } VOID attrputstr(n, s, isstandout) int n; CONST char *s; int isstandout; { if (isstandout) putterm(T_STANDOUT); cputstr(n, s); if (isstandout) putterm(END_STANDOUT); } static VOID NEAR putcursor(c, n) int c, n; { win_x += n; while (n--) VOID_C XXputch(c); #ifdef DEP_ORIGSHELL if (dumbmode) /*EMPTY*/; else if (shellmode && win_x >= n_column) { VOID_C XXputch(' '); VOID_C XXputch('\r'); win_x = 0; win_y++; } #endif } static VOID NEAR rightcursor(VOID_A) { win_x++; Xputterm(C_RIGHT); } static VOID NEAR leftcursor(VOID_A) { win_x--; Xputterm(C_LEFT); } static VOID NEAR upcursor(VOID_A) { win_y--; Xputterm(C_UP); } static VOID NEAR downcursor(VOID_A) { win_y++; Xputterm(C_DOWN); } #ifdef DEP_ORIGSHELL static VOID NEAR forwcursor(x) int x; { while (win_x < x) { VOID_C XXputch(' '); win_x++; } } static VOID NEAR backcursor(x) int x; { while (win_x > x) { VOID_C XXputch(C_BS); win_x--; } } static VOID NEAR forwline(x) int x; { if (win_x < n_column) { Xcputnl(); win_y++; } else { while (win_x >= n_column) { win_x -= n_column; win_y++; } VOID_C XXputch(' '); VOID_C XXputch('\r'); } win_x = 0; forwcursor(x); } static VOID NEAR dumbputs(s, cx2, len2, max, ptr) CONST char *s; int cx2, len2, max, ptr; { len2 -= ptr; if (max <= 0) clearline(); else { if (len2 < max) { VOID_C kanjiputs2(s, len2, ptr); win_x += len2; } else { if (vonkanji1(s, ptr + max - 1)) max++; VOID_C kanjiputs2(s, max, ptr); win_x += max; putcursor('>', 1); } clearline(); backcursor(xpos + cx2 - lastofs2); } } static VOID NEAR rewritecursor(cx, cx2) int cx, cx2; { char *dupl; int i, dx, ocx, ocx2; i = (lastofs2) ? 1 : plen; dx = cx2 - lastofs2; ocx2 = win_x - xpos - i + lastofs2; if (checkcursor(cx, cx2) < 0) /*EMPTY*/; else if (cx2 <= ocx2) backcursor(xpos + i + dx); else { ocx = rlen(inputbuf, ocx2); dupl = trquote(&(inputbuf[ocx]), cx - ocx, NULL); win_x += Xkanjiputs(dupl); Xfree(dupl); } } static int NEAR checkcursor(cx, cx2) int cx, cx2; { int i, dx, orptr, ovptr; i = (lastofs2) ? 1 : plen; dx = cx2 - lastofs2; if (dx >= 0 && i + dx < maxcol) return(0); orptr = rptr; ovptr = vptr; rptr = cx; vptr = cx2; displaystr(); rptr = orptr; vptr = ovptr; return(-1); } #endif /* DEP_ORIGSHELL */ static VOID NEAR scrollup(VOID_A) { #ifdef DEP_PTY regionscroll(C_SCROLLFORW, 1, 0, maxline - 1, minline, maxline - 1); #else Xlocate(0, maxline - 1); Xputterms(C_SCROLLFORW); #endif ypos--; hideclock = 1; } static VOID NEAR locate2(x, y) int x, y; { #ifdef DEP_ORIGSHELL if (shellmode) { x += xpos; if (win_x >= n_column) { Xmovecursor(C_NLEFT, C_LEFT, win_x); win_x = 0; } if (y < win_y) Xmovecursor(C_NUP, C_UP, win_y - y); else if (y > win_y) { Xmovecursor(-1, C_SCROLLFORW, y - win_y); VOID_C XXputch('\r'); win_x = 0; } if (x < win_x) Xmovecursor(C_NLEFT, C_LEFT, win_x - x); else if (x > win_x) Xmovecursor(C_NRIGHT, C_RIGHT, x - win_x); win_x = x; win_y = y; return; } #endif /* DEP_ORIGSHELL */ while (ypos + y >= maxline) scrollup(); win_x = xpos + x; win_y = ypos + y; Xlocate(win_x, win_y); } #ifdef DEP_IME static VOID locate3(x, y) int x, y; { # ifdef DEP_ORIGSHELL if (shellmode) locate2(x, y); else # endif Xlocate(win_x = x, win_y = y); } #endif /* DEP_IME */ static VOID NEAR setcursor(cx, cx2) int cx, cx2; { int f; if (cx < 0) cx = rlen(inputbuf, cx2); if (cx2 < 0) cx2 = vlen(inputbuf, cx); #ifdef DEP_ORIGSHELL if (dumbmode) { rewritecursor(cx, cx2); return; } #endif f = within(cx2) ? 0 : 1; cx2 -= f; locate2(ptr2col(cx2), ptr2line(cx2)); if (f) rightcursor(); } static VOID NEAR putstr(cxp, cxp2, ins) int *cxp, *cxp2, ins; { char *cp, tmp[MAXCHARWID + 1]; int rw, vw; while (ins > 0) { VOID_C getprintable(tmp, sizeof(tmp), inputbuf, *cxp, &rw); *cxp += rw; ins -= rw; cp = tmp; while (*cp) { getcharwidth(cp, (ALLOC_T)0, &rw, &vw); VOID_C XXcprintf("%.*k", vw, cp); cp += rw; win_x += vw; *cxp2 += vw; #ifdef DEP_ORIGSHELL if (dumbmode) VOID_C checkcursor(*cxp, *cxp2); else #endif if (within(*cxp2) && ptr2col(*cxp2) < vw) setcursor(*cxp, *cxp2); } } } static VOID NEAR ringbell(VOID_A) { #ifdef DEP_ORIGSHELL if (dumbmode && dumbterm <= 2) VOID_C XXputch('\007'); else #endif Xputterm(T_BELL); Xtflush(); } static VOID NEAR clearline(VOID_A) { #ifdef DEP_ORIGSHELL int x; #endif #ifdef DEP_ORIGSHELL if (dumbmode) { /* abandon last 1 char because of auto newline */ for (x = win_x; x < n_column - 1; x++) VOID_C XXputch(' '); for (x = win_x; x < n_column - 1; x++) VOID_C XXputch(C_BS); } else #endif Xputterm(L_CLEAR); } static VOID NEAR newline(y) int y; { #ifdef DEP_ORIGSHELL if (dumbmode) /*EMPTY*/; else if (shellmode) forwline(xpos); else #endif locate2(0, y); } static VOID NEAR rightchar(VOID_A) { int rw, vw; getcharwidth(inputbuf, rptr, &rw, &vw); if (rptr + rw > inputlen) { ringbell(); return; } rptr += rw; vptr += vw; #ifdef DEP_ORIGSHELL if (dumbmode) rewritecursor(rptr, vptr); else #endif if (within(vptr) && ptr2col(vptr) < vw) setcursor(rptr, vptr); else while (vw--) rightcursor(); } static VOID NEAR leftchar(VOID_A) { int rw, vw, ovptr; rw = vw = 1; if (rptr >= 2 && onkanji1(inputbuf, rptr - 2)) rw = vw = 2; #ifdef CODEEUC else if (rptr >= 2 && isekana(inputbuf, rptr - 2)) rw++; #else else if (isskana(inputbuf, rptr - 1)) /*EMPTY*/; #endif else if (Xiscntrl(inputbuf[rptr - 1])) vw++; else if (ismsb(inputbuf[rptr - 1])) vw = 4; ovptr = vptr; rptr -= rw; vptr -= vw; #ifdef DEP_ORIGSHELL if (dumbmode) rewritecursor(rptr, vptr); else #endif if (ptr2col(ovptr) < vw) setcursor(rptr, vptr); else while (vw--) leftcursor(); } static VOID NEAR insertchar(cx, cx2, ins) int cx, cx2, ins; { char *dupl; int dx, dy, i, j, l, f1, ptr, len2, nlen; #if !MSDOS int f2; #endif dupl = trquote(&(inputbuf[cx]), inputlen - cx, &l); len2 = cx2 + l; nlen = len2 + ins; dy = ptr2line(cx2); i = (dy + 1) * maxcol - plen; /* prev. chars including cursor line */ j = maxcol - ptr2col(cx2); if (j > ins) j = ins; /* inserted columns in cursor line */ #ifdef DEP_ORIGSHELL if (dumbmode) { i = (lastofs2) ? 1 : plen; dx = cx2 + ins - lastofs2; if (i + dx < maxcol) { putcursor(' ', ins); dumbputs(dupl, i + cx2, l, maxcol - (i + dx), 0); } } else #endif /* DEP_ORIGSHELL */ #if !MSDOS if (*termstr[C_INSERT]) { # ifdef DEP_ORIGSHELL if (shellmode) /*EMPTY*/; else # endif if (ypos + dy >= maxline - 1 && xpos + ptr2col(cx2) + (len2 - cx2) + j >= n_column) { /* * In the case that current line is the last line, * and the end of string will reach over the last line. */ while (ypos + dy >= maxline - 1) scrollup(); setcursor(cx, cx2); } while (j--) Xputterm(C_INSERT); if (i < nlen) { while (i < nlen) { ptr = i - 1 - cx2; /* rest columns in cursor line */ /* * Whether if the end of line is kanji 1st byte * f1: after inserted * f2: before inserted */ if (ptr < ins) f1 = 0; else f1 = vonkanji1(dupl, ptr - ins); f2 = (vonkanji1(dupl, ptr)) ? 1 : 0; if (xpos + maxcol < n_column) { locate2(maxcol, dy); j = n_column - (xpos + maxcol); if (j > ins) j = ins; if (f2) j++; if (f1 && j-- > 0) rightcursor(); if (j > 0) putcursor(' ', j); } dy++; # ifdef DEP_ORIGSHELL if (shellmode) /*EMPTY*/; else # endif if (ypos + dy >= maxline - 1 && xpos + nlen - i >= n_column) while (ypos + dy >= maxline - 1) scrollup(); locate2(0, dy); for (j = 0; j < ins; j++) Xputterm(C_INSERT); l = ins; if (ptr < ins) { ptr++; locate2(ins - ptr, dy); l = ptr + f2; ptr = 0; } else { ptr -= ins - 1; if (f1) dupl[f1 - 1] = dupl[f1] = ' '; if (f2) l++; } if (ptr + l > nlen - cx2) l = nlen - cx2 - ptr; VOID_C kanjiputs2(dupl, l, ptr); win_x += l; i += maxcol; } setcursor(cx, cx2); } } else #endif /* !MSDOS */ { putcursor(' ', j); j = 0; l = i - cx2 - ins; /* rest chars following inserted str */ dx = ptr2col(cx2 + ins); /* cursor column after inserted */ while (i < nlen) { ptr = i - 1 - cx2; /* rest columns in cursor line */ /* * Whether if the end of line is kanji 1st byte * f1: after inserted */ if (ptr < ins) f1 = l = 0; else f1 = vonkanji1(dupl, ptr - ins); #ifdef DEP_ORIGSHELL if (shellmode) /*EMPTY*/; else #endif if (ypos + dy >= maxline - 1) { while (ypos + dy >= maxline - 1) scrollup(); locate2(dx, dy); } if (f1) l++; if (l > 0) { VOID_C kanjiputs2(dupl, l, j); win_x += l; } dy++; if (f1) newline(dy); else { putcursor(' ', 1); locate2(0, dy); } l = maxcol; if (ptr < ins - 1) { putcursor(' ', 1); ptr++; locate2(ins - ptr, dy); l -= ins - ptr; ptr = 0; } else { ptr -= ins - 1; if (f1) dupl[f1 - 1] = dupl[f1] = ' '; } if (ptr + l > len2 - cx2) l = len2 - cx2 - ptr; j = ptr; i += maxcol; dx = 0; } l = len2 - cx2 - j; if (l > 0) { VOID_C kanjiputs2(dupl, l, j); win_x += l; } setcursor(cx, cx2); } #ifdef DEP_ORIGSHELL if (dumbmode) /*EMPTY*/; else if (shellmode) { if (ptr2col(nlen) == 1) { setcursor(-1, nlen); Xputterm(L_CLEAR); setcursor(cx, cx2); } } else #endif if (i == nlen && within(i) && ypos + dy >= maxline - 1) { while (ypos + dy >= maxline - 1) scrollup(); setcursor(cx, cx2); } Xfree(dupl); } static VOID NEAR deletechar(cx, cx2, del) int cx, cx2, del; { char *dupl; int dy, i, j, l, f1, ptr, len2, nlen; #if !MSDOS int f2; #endif dupl = trquote(&(inputbuf[cx]), inputlen - cx, &l); len2 = cx2 + l; nlen = len2 - del; dy = ptr2line(cx2); i = (dy + 1) * maxcol - plen; /* prev. chars including cursor line */ #ifdef DEP_ORIGSHELL if (dumbmode) { i = (lastofs2) ? 1 : plen; j = cx2 - lastofs2; dumbputs(dupl, i + cx2, l, maxcol - (i + j), del); } else #endif /* DEP_ORIGSHELL */ #if !MSDOS if (*termstr[C_DELETE]) { j = maxcol - ptr2col(cx2); if (j > del) j = del; /* deleted columns in cursor line */ while (j--) Xputterm(C_DELETE); if (i < len2) { while (i < len2) { ptr = i - 1 - cx2; /* rest columns in cursor line */ /* * Whether if the end of line is kanji 1st byte * f1: after deleted */ if (ptr >= nlen - cx2) f1 = 0; else f1 = (vonkanji1(dupl, ptr + del)) ? 1 : 0; f2 = (vonkanji1(dupl, ptr)) ? 1 : 0; j = maxcol - del + f2; if (j < maxcol - (++ptr)) { j = maxcol - ptr; l = ptr + f1; ptr = del; } else { l = del - f2 + f1; ptr += f2; } locate2(j, dy); if (ptr + l > len2) l = len2 - ptr; if (l > 0) { VOID_C kanjiputs2(dupl, l, ptr); win_x += l; } if (!f1) putcursor(' ', 1); locate2(0, ++dy); for (j = 0; j < del; j++) Xputterm(C_DELETE); if (f1) putcursor(' ', 1); i += maxcol; } setcursor(cx, cx2); } } else #endif /* !MSDOS */ { j = del; l = i - cx2; /* rest chars following cursor */ while (i < len2) { ptr = i - 1 - cx2; /* rest columns in cursor line */ /* * Whether if the end of line is kanji 1st byte * f1: after deleted */ if (ptr >= nlen - cx2) f1 = 0; else f1 = vonkanji1(dupl, ptr + del); if (f1) l++; if (l > 0) { VOID_C kanjiputs2(dupl, l, j); win_x += l; } dy++; if (f1) newline(dy); else { putcursor(' ', 1); locate2(0, dy); } l = maxcol; ptr += del + 1; if (f1) dupl[f1 - 1] = dupl[f1] = ' '; if (ptr + l > len2 - cx2) l = len2 - cx2 - ptr; j = ptr; i += maxcol; } l = len2 - cx2 - j; if (l > 0) { VOID_C kanjiputs2(dupl, l, j); win_x += l; } clearline(); setcursor(cx, cx2); } Xfree(dupl); } static VOID NEAR insshift(cx, ins) int cx, ins; { if (cx >= inputlen) return; memmove(&(inputbuf[cx + ins]), &(inputbuf[cx]), inputlen - cx); } static VOID NEAR delshift(cx, del) int cx, del; { if (cx >= inputlen - del) return; memmove(&(inputbuf[cx]), &(inputbuf[cx + del]), inputlen - del - cx); } static VOID NEAR truncline(VOID_A) { int dy, i, len2; len2 = vlen(inputbuf, inputlen); #ifdef DEP_ORIGSHELL if (dumbmode) { clearline(); return; } #endif Xputterm(L_CLEAR); dy = ptr2line(vptr); i = (dy + 1) * maxcol - plen; if (i < len2) { #ifdef DEP_ORIGSHELL if (shellmode) while (i < len2) { locate2(0, ++dy); Xputterm(L_CLEAR); i += maxcol; } else #endif while (i < len2) { if (ypos + ++dy >= maxline) break; Xlocate(xpos, ypos + dy); Xputterm(L_CLEAR); i += maxcol; } setcursor(rptr, vptr); } } static VOID NEAR displaystr(VOID_A) { #if FD >= 2 int top; #endif char *dupl; int i, x, y, len2, max, vi, width, f; dupl = trquote(inputbuf, inputlen, &len2); #if FD >= 2 top = vlen(inputbuf, search_matchlen()); #endif #ifdef DEP_ORIGSHELL if (dumbmode) { backcursor(0); forwcursor(xpos); dispprompt(NULL, -1); i = plen; x = vptr - maxcol; y = (maxcol + 1) / 2; for (lastofs2 = 0; lastofs2 <= i + x; lastofs2 += y) { # if FD >= 2 if (searchmode) i = plen + 1; else # endif i = 1; } if (!lastofs2) dispprompt(NULL, 0); else { # if FD >= 2 if (searchmode) dispprompt(NULL, 0); # endif putcursor('<', 1); if ((f = vonkanji1(dupl, lastofs2 - 1))) dupl[f - 1] = dupl[f] = ' '; } dumbputs(dupl, i + vptr, len2, maxcol - i, lastofs2); Xtflush(); Xfree(dupl); return; } #endif /* DEP_ORIGSHELL */ dispprompt(NULL, 0); locate2(plen, 0); max = maxscr(); if (len2 > max) { len2 = max; inputlen = rlen(inputbuf, max); if (vptr >= len2) { vptr = len2; rptr = inputlen; } } vi = (termstr[T_NOCURSOR] && *termstr[T_NOCURSOR] && termstr[T_NORMALCURSOR] && *termstr[T_NORMALCURSOR]); if (vi) Xputterm(T_NOCURSOR); i = x = y = 0; width = maxcol - plen; while (i + width < len2) { /* * Whether if the end of line is kanji 1st byte */ f = (vonkanji1(dupl, i + width - 1)) ? 1 : 0; clearline(); if (stable_standout) Xputterm(END_STANDOUT); #ifdef DEP_ORIGSHELL if (shellmode) /*EMPTY*/; else #endif if (ypos + y >= maxline - 1) { while (ypos + y >= maxline - 1) scrollup(); locate2(x, y); } if (width + f > 0) { kanjiputs3(dupl, vptr, width + f, i, top); win_x += width + f; } i += width + f; width = maxcol - f; x = f; y++; if (f) { newline(y); putcursor(' ', 1); } else { putcursor(' ', 1); locate2(0, y); } } clearline(); if (stable_standout) Xputterm(END_STANDOUT); kanjiputs3(dupl, vptr, len2 - i, i, top); win_x += len2 - i; #ifdef DEP_ORIGSHELL if (shellmode) /*EMPTY*/; else #endif while (win_y < maxline - 1) { Xlocate(xpos, ++win_y); Xputterm(L_CLEAR); } if (vi) Xputterm(T_NORMALCURSOR); setcursor(rptr, vptr); Xtflush(); Xfree(dupl); } static VOID NEAR insertbuf(ins) int ins; { inputbuf = c_realloc(inputbuf, inputlen + ins, &inputsize); } static int NEAR preparestr(rins, vins) int rins, vins; { int rw, vw; if (overflow(vlen(inputbuf, inputlen) + vins)) return(-1); if (!overwritemode) { insertchar(rptr, vptr, vins); insertbuf(rins); insshift(rptr, rins); inputlen += rins; return(0); } if (rptr >= inputlen) rw = vw = 0; else getcharwidth(inputbuf, rptr, &rw, &vw); if (!vw) /*EMPTY*/; else if (vins > vw) insertchar(rptr, vptr, vins - vw); else if (vins < vw) deletechar(rptr, vptr, vw - vins); if (!rw) /*EMPTY*/; else if (rins > rw) { insertbuf(rins - rw); insshift(rptr, rins - rw); } else if (rins < rw) delshift(rptr, rw - rins); inputlen += rins - rw; return(0); } static int NEAR insertcursor(cxp, cxp2, ins, ch) int *cxp, *cxp2, ins, ch; { if (overflow(vlen(inputbuf, inputlen) + ins)) return(-1); setcursor(*cxp, *cxp2); insertchar(*cxp, *cxp2, ins); insertbuf(ins); insshift(*cxp, ins); inputlen += ins; if (ch) { inputbuf[*cxp] = ch; putstr(cxp, cxp2, 1); } return(0); } static int NEAR quotemeta(cxp, cxp2, ch, qtopp, qp, qedp) int *cxp, *cxp2, ch, *qtopp, *qp, *qedp; { int cx2, ocx, ocx2; ocx = *cxp; ocx2 = *cxp2; if (*qtopp < 0) return(0); if (*qp) { if (*qp != '\'' || ch != '\'') return(0); if (insertcursor(cxp, cxp2, 1, *qp) < 0) return(-1); *qtopp = *cxp; } else if (qedp && *qedp > 0 && *qedp < *cxp) { if (inputbuf[*qedp] != '\'' || ch != '\'') { *qp = inputbuf[*qedp]; cx2 = vlen(inputbuf, *qedp); setcursor(*qedp, cx2); deletechar(*qedp, cx2, 1); delshift(*qedp, 1); (*cxp)--; (*cxp2)--; if (cxp != &rptr && rptr > *qedp) rptr--; if (cxp2 != &vptr && vptr > cx2) vptr--; inputlen--; *qedp = -1; return(0); } *qtopp = *cxp; } cx2 = vlen(inputbuf, *qtopp); if (insertcursor(qtopp, &cx2, 1, *qp = '"') < 0) return(-1); (*cxp)++; (*cxp2)++; if (cxp != &rptr && rptr >= *qtopp) rptr += *cxp - ocx; if (cxp2 != &vptr && vptr >= cx2) vptr += *cxp2 - ocx2; *qtopp = -1; if (qedp) *qedp = -1; return(0); } static int NEAR insertstr(strins, ins, qtop, qp, qedp) CONST char *strins; int ins, qtop, *qp, *qedp; { int i, n, ch, pc, max; n = vlen(inputbuf, inputlen); max = maxscr(); if (n + vlen(strins, ins) > max) ins = rlen(strins, max - n); if (ins > 0) { if (onkanji1(strins, ins - 1)) ins--; #ifdef CODEEUC else if (isekana(strins, ins - 1)) ins--; #endif } if (ins <= 0) return(ins); insertchar(rptr, vptr, vlen(strins, ins)); insertbuf(ins); insshift(rptr, ins); for (i = 0; i < ins; i++) inputbuf[rptr + i] = ' '; inputlen += ins; for (i = 0; i < ins; i++) { if (*qp < '\0') pc = PC_NORMAL; else pc = parsechar(&(strins[i]), ins - i, '!', EA_FINDMETA, qp, NULL); if (pc == PC_WCHAR) { inputbuf[rptr] = strins[i++]; inputbuf[rptr + 1] = strins[i]; putstr(&rptr, &vptr, 2); } #ifndef FAKEESCAPE else if (pc == PC_EXMETA || pc == '!') { if (*qp) { n = 2; ch = *qp; *qp = '\0'; } else { n = 1; ch = '\0'; } if (insertcursor(&rptr, &vptr, n, ch) < 0) return(0); inputbuf[rptr] = PESCAPE; inputbuf[rptr + 1] = strins[i]; putstr(&rptr, &vptr, 2); qtop = rptr; } #endif /* !FAKEESCAPE */ else if (pc == PC_META) { n = quotemeta(&rptr, &vptr, strins[i], &qtop, qp, qedp); if (n < -1) return(0); setcursor(rptr, vptr); if (*qp == '\'' || !Xstrchr(DQ_METACHAR, strins[i])) { inputbuf[rptr] = strins[i]; putstr(&rptr, &vptr, 1); } else { #ifdef FAKEESCAPE ch = strins[i]; #else ch = PESCAPE; #endif if (insertcursor(&rptr, &vptr, 1, ch) < 0) return(0); inputbuf[rptr] = strins[i]; putstr(&rptr, &vptr, 1); } } else { inputbuf[rptr] = strins[i]; putstr(&rptr, &vptr, 1); } } return(0); } #ifndef _NOCOMPLETE static VOID NEAR selectfile(argc, argv) int argc; char *CONST *argv; { char *cp; int duprow, dupminfilename, dupcolumns, dupdispmode, dupfnameofs; int i, j, n, len, maxlen; duprow = FILEPERROW; dupminfilename = minfilename; dupcolumns = curcolumns; dupdispmode = dispmode; dupfnameofs = fnameofs; minfilename = n_column; dispmode = F_FILETYPE; fnameofs = 0; if (argv) { selectlist = (namelist *)Xmalloc(argc * sizeof(namelist)); maxlen = 0; for (i = 0; i < argc; i++) { memset((char *)&(selectlist[i]), 0, sizeof(namelist)); cp = strrdelim(argv[i], 0); if (cp && !cp[1]) len = cp - argv[i]; else { len = strlen(argv[i]); cp = NULL; } selectlist[i].name = Xstrndup(argv[i], len); selectlist[i].flags = (F_ISRED | F_ISWRI); selectlist[i].st_mode = (cp) ? S_IFDIR : S_IFREG; selectlist[i].tmpflags = F_STAT; len = strlen2(argv[i]); if (maxlen < len) maxlen = len; } i = sorton; sorton = SRT_FILENAME; qsort(selectlist, argc, sizeof(namelist), cmplist); sorton = i; if (lcmdline < 0) { n = 1; Xcputnl(); if (argc < LIMITSELECTWARN) i = 'Y'; else { VOID_C XXcprintf("There are %d possibilities.", argc); XXcputs(" Do you really"); Xcputnl(); XXcputs("wish to see them all? (y or n)"); Xtflush(); for (;;) { i = getkey3(0, getinkcode(), 0); if (i < K_MIN) { i = Xtoupper(i); if (i == 'Y' || i == 'N') break; } ringbell(); } Xcputnl(); n += 2; } if (i == 'N') /*EMPTY*/; else if (n_column < maxlen + 2) { n += argc; for (i = 0; i < argc; i++) { VOID_C Xkanjiputs(selectlist[i].name); Xcputnl(); } } else { tmpcolumns = n_column / (maxlen + 2); len = (argc + tmpcolumns - 1) / tmpcolumns; n += len; for (i = 0; i < len; i++) { for (j = i; j < argc; j += len) cputstr(maxlen + 2, selectlist[j].name); Xcputnl(); } } # ifdef DEP_ORIGSHELL if (dumbmode || shellmode) { win_x = xpos; win_y = 0; } else # endif if (ypos + n < maxline - 1) ypos += n; else ypos = maxline - 1; for (i = 0; i < argc; i++) Xfree(selectlist[i].name); Xfree(selectlist); selectlist = NULL; FILEPERROW = duprow; minfilename = dupminfilename; curcolumns = dupcolumns; dispmode = dupdispmode; fnameofs = dupfnameofs; return; } i = filetop(win); if (maxcmdline) tmpfileperrow = maxcmdline; else if (ypos >= i + FILEPERROW) tmpfileperrow = FILEPERROW; else { tmpfileperrow = ypos - i; if (tmpfileperrow < WFILEMIN) tmpfileperrow = WFILEMIN; } if ((n_column / 5) - 2 - 1 >= maxlen) tmpcolumns = 5; else if ((n_column / 3) - 2 - 1 >= maxlen) tmpcolumns = 3; else if ((n_column / 2) - 2 - 1 >= maxlen) tmpcolumns = 2; else tmpcolumns = 1; FILEPERROW = tmpfileperrow; curcolumns = tmpcolumns; tmpfilepos = listupfile(selectlist, argc, NULL, 1); maxselect = argc; } else if (argc < 0) { for (i = 0; i < maxselect; i++) Xfree(selectlist[i].name); Xfree(selectlist); selectlist = NULL; } else { FILEPERROW = tmpfileperrow; curcolumns = tmpcolumns; if (tmpfilepos >= maxselect) tmpfilepos %= (tmpfilepos - argc); else if (tmpfilepos < 0) tmpfilepos = maxselect - 1 - ((maxselect - 1 - argc) % (argc - tmpfilepos)); if (argc / FILEPERPAGE != tmpfilepos / FILEPERPAGE) tmpfilepos = listupfile(selectlist, maxselect, selectlist[tmpfilepos].name, 1); else if (argc != tmpfilepos) { putname(selectlist, argc, -1); putname(selectlist, tmpfilepos, 1); } } FILEPERROW = duprow; minfilename = dupminfilename; curcolumns = dupcolumns; dispmode = dupdispmode; fnameofs = dupfnameofs; } /*ARGSUSED*/ static int NEAR completestr(comline, cont, h) int comline, cont, h; { # ifdef DEP_ORIGSHELL int vartop; # endif char *cp, *tmp, **argv; int i, i2, rw, n, ch, pc, ins, top, fix, argc, qtop, quote, quoted; if (selectlist && cont > 0) { selectfile(tmpfilepos++, NULL); setcursor(rptr, vptr); ringbell(); return(-1); } quote = '\0'; # ifdef DEP_ORIGSHELL vartop = # endif top = 0; # ifndef NOUID if (h == HST_USER || h == HST_GROUP) quote = -1; else # endif for (i = 0; i < rptr; i++) { # ifdef FAKEESCAPE pc = parsechar(&(inputbuf[i]), rptr - i, '$', EA_NOEVALQ, "e, NULL); # else pc = parsechar(&(inputbuf[i]), rptr - i, '$', EA_BACKQ, "e, NULL); # endif if (pc == PC_WCHAR) i++; # ifdef DEP_ORIGSHELL else if (pc == '$') vartop = i + 1; # endif # ifndef FAKEESCAPE else if (pc == PC_ESCAPE) i++; else if (pc == PC_OPQUOTE) { if (inputbuf[i] == '`') top = i + 1; } # endif else if (pc != PC_NORMAL) /*EMPTY*/; else if (i == top && (n = getpathtop(&(inputbuf[i]), NULL, NULL))) i += n - 1; else if (inputbuf[i] == ':' || inputbuf[i] == '=' || Xstrchr(CMDLINE_DELIM, inputbuf[i])) top = i + 1; } if (comline && top > 0) { for (i = top - 1; i >= 0; i--) if (!Xisblank(inputbuf[i])) break; if (i >= 0 && !Xstrchr(SHELL_OPERAND, inputbuf[i])) comline = 0; } # ifdef DEP_ORIGSHELL if (vartop) { i = top + 1; if (quote) i++; if (vartop != i || (vartop < rptr && !isidentchar(inputbuf[vartop]))) vartop = 0; else { for (i = vartop; i < rptr; i++) if (!isidentchar2(inputbuf[i])) break; if (i < rptr) vartop = 0; else top = vartop; } } # endif /* DEP_ORIGSHELL */ cp = Xstrndup(&(inputbuf[top]), rptr - top); # ifdef DEP_ORIGSHELL if (vartop) /*EMPTY*/; else # endif # ifndef NOUID if (h == HST_USER || h == HST_GROUP) /*EMPTY*/; else # endif cp = evalpath(cp, 0); if (selectlist && cont < 0) { argv = (char **)Xmalloc(1 * sizeof(char *)); n = strlen(selectlist[tmpfilepos].name); i = (s_isdir(&(selectlist[tmpfilepos]))) ? 1 : 0; argv[0] = (char *)Xmalloc(n + i + 1); memcpy(argv[0], selectlist[tmpfilepos].name, n); if (i) argv[0][n] = _SC_; argv[0][n + i] = '\0'; argc = 1; } # ifndef NOUID # ifndef NOGETPWENT else if (h == HST_USER) { argv = NULL; n = strlen(cp); argc = completeuser(cp, n, 0, &argv, 0); } # endif # ifndef NOGETGRENT else if (h == HST_GROUP) { argv = NULL; n = strlen(cp); argc = completegroup(cp, n, 0, &argv); } # endif # endif /* !NOUID */ # ifdef DEP_ORIGSHELL else if (vartop) { argv = NULL; n = strlen(cp); argc = completeshellvar(cp, n, 0, &argv); } # endif else { argv = NULL; argc = 0; n = strlen(cp); if (comline && !strdelim(cp, 1)) { # ifdef DEP_ORIGSHELL argc = completeshellcomm(cp, n, argc, &argv); # else argc = completeuserfunc(cp, n, argc, &argv); argc = completealias(cp, n, argc, &argv); argc = completebuiltin(cp, n, argc, &argv); argc = completeinternal(cp, n, argc, &argv); # endif } # ifndef _NOARCHIVE if (archivefile && !comline && *cp != _SC_) argc = completearch(cp, n, argc, &argv); else # endif argc = completepath(cp, n, argc, &argv, comline); if (!argc && comline) argc = completepath(cp, n, argc, &argv, 0); } ins = strlen(getbasename(cp)); Xfree(cp); if (!argc) { Xfree(argv); ringbell(); return(-1); } cp = findcommon(argc, argv); if (argc != 1 || !cp) fix = '\0'; # ifndef NOUID else if (h == HST_USER || h == HST_GROUP) fix = ' '; # endif else fix = ((tmp = strrdelim(cp, 0)) && !tmp[1]) ? _SC_ : ' '; if (!cp || ((ins = (int)strlen(cp) - ins) <= 0 && fix != ' ')) { if (cont <= 0) ringbell(); else { selectfile(argc, argv); if (lcmdline < 0) displaystr(); setcursor(rptr, vptr); } for (i = 0; i < argc; i++) Xfree(argv[i]); Xfree(argv); Xfree(cp); return(-1); } for (i = 0; i < argc; i++) Xfree(argv[i]); Xfree(argv); qtop = top; if (!quote && inputbuf[top] == '~') { tmp = Xstrchr(&(inputbuf[top + 1]), _SC_); if (tmp) qtop = tmp - inputbuf + 1; } tmp = cp + (int)strlen(cp) - ins; if (fix == _SC_) ins--; # ifndef NOUID if (h == HST_USER || h == HST_GROUP) { VOID_C insertstr(tmp, ins, qtop, "e, NULL); Xfree(cp); return(0); } # endif quote = '\0'; quoted = 0; i = top; i2 = vlen(inputbuf, top); while (i < rptr) { rw = 1; pc = parsechar(&(inputbuf[i]), rptr - i, '!', 0, "e, NULL); if (pc == PC_WCHAR) rw++; else if (pc == PC_CLQUOTE) { quoted = i; qtop = i + 1; } # ifndef FAKEESCAPE else if (pc == PC_ESCAPE) { rw++; if (inputbuf[i + 1] == '!') qtop = i + 2; else if (Xstrchr(DQ_METACHAR, inputbuf[i + 1])) { n = quotemeta(&i, &i2, '\0', &qtop, "e, "ed); if (n < 0) { Xfree(cp); return(0); } } else if (inputbuf[i + 1] != '\'') { setcursor(i, i2); deletechar(i, i2, 1); delshift(i, 1); rptr--; vptr--; inputlen--; rw = 0; } } # endif /* !FAKEESCAPE */ else if (pc == '!') { if (quote) { n = 2; ch = quote; quote = '\0'; } else { n = 1; ch = '\0'; } if (insertcursor(&i, &i2, n, ch) < 0) { Xfree(cp); return(0); } inputbuf[i] = PESCAPE; inputbuf[i + 1] = '!'; putstr(&i, &i2, 2); rptr += n; vptr += n; qtop = i; rw = 0; } else if (pc == PC_OPQUOTE || pc == PC_SQUOTE) /*EMPTY*/; else if (Xstrchr(DQ_METACHAR, inputbuf[i])) { if (insertcursor(&i, &i2, 1, PESCAPE) < 0) { Xfree(cp); return(0); } rptr++; vptr++; qtop = i + 1; } else if (pc != PC_NORMAL) /*EMPTY*/; else if (Xstrchr(METACHAR, inputbuf[i])) { n = quotemeta(&i, &i2, inputbuf[i], &qtop, "e, "ed); if (n < 0) { Xfree(cp); return(0); } } i += rw; i2 += vlen(&(inputbuf[i]), rw); } setcursor(rptr, vptr); n = insertstr(tmp, ins, qtop, "e, "ed); Xfree(cp); if (n < 0) return(0); if (fix) { if (quote > '\0' && (fix != _SC_ || quoted < 0)) { if (insertcursor(&rptr, &vptr, 1, quote) < 0) return(0); } if (insertcursor(&rptr, &vptr, 1, fix) < 0) return(0); } return(0); } #endif /* !_NOCOMPLETE */ #ifdef DEP_KCONV static u_int NEAR getucs2(ch) int ch; { char buf[MAXUTF8LEN + 1]; int n; n = 0; if (ch & 0xff00) return((u_int)-1); buf[n++] = ch; if (!ismsb(ch)) /*EMPTY*/; else if ((ch = getch3()) == EOF) return((u_int)-1); else { buf[n++] = ch; if (isutf2(buf[0], buf[1])) /*EMPTY*/; else if ((ch = getch3()) == EOF) { ungetch3(buf[1]); return((u_int)-1); } else buf[n++] = ch; } buf[n] = '\0'; return(ucs2fromutf8((u_char *)buf, NULL)); } static VOID NEAR ungetch3(c) int c; { if (ungetnum3 >= arraysize(ungetbuf3)) return; memmove((char *)&(ungetbuf3[1]), (char *)&(ungetbuf3[0]), ungetnum3 * sizeof(u_char)); ungetbuf3[0] = c; ungetnum3++; } #endif /* DEP_KCONV */ static int NEAR getch3(VOID_A) { #ifdef DEP_IME int c; #endif #ifdef DEP_KCONV if (ungetnum3 > 0) return((int)ungetbuf3[--ungetnum3]); #endif #ifdef DEP_IME if (imemode) return((getime(0, &c, 1) >= 0) ? c : EOF); #endif if (!kbhit2(WAITKANJI * 1000L)) return(EOF); return(Xgetch()); } static int NEAR getkanjikey(buf, ch) char *buf; int ch; { #ifdef DEP_KCONV u_short ubuf[MAXNFLEN]; char tmp[MAXUTF8LEN + 1]; u_int u; int i, n, len, code; #endif int ch2; #ifdef DEP_KCONV code = getinkcode(); if (code == EUC && isekana2(ch)) { tmp[0] = (char)C_EKANA; tmp[1] = (ch & 0xff); tmp[2] = '\0'; kanjiconv(buf, tmp, MAXKLEN, code, DEFCODE, L_INPUT); return(1); } if (code == SJIS && Xiskana(ch)) { tmp[0] = ch; tmp[1] = '\0'; kanjiconv(buf, tmp, MAXKLEN, code, DEFCODE, L_INPUT); return(1); } if (code >= UTF8) { i = 0; for (;;) { if ((u = getucs2(ch)) == (u_int)-1) { if (i) ungetch3(ch); buf[0] = '\0'; return(-1); } ubuf[i++] = u; if (i >= MAXNFLEN) break; if (code != M_UTF8 || (ch = getch3()) == EOF) break; } len = i; i = 0; if (!len) u = ch; else if (code != M_UTF8) u = ubuf[i++]; else u = ucs2denormalization(ubuf, &i, code - UTF8, L_INPUT); while (i < len) { tmp[ucs2toutf8(tmp, 0, ubuf[i++])] = '\0'; for (n = 0; tmp[n]; n++) ungetch3(tmp[n]); } tmp[ucs2toutf8(tmp, 0, u)] = '\0'; n = kanjiconv(buf, tmp, MAXKLEN, code, DEFCODE, L_INPUT); # ifdef CODEEUC if (isekana(buf, 0)) n = 1; # endif return(n); } #else /* !DEP_KCONV */ # ifdef CODEEUC if (isekana2(ch)) { buf[0] = (char)C_EKANA; buf[1] = (ch * 0xff); buf[2] = '\0'; return(1); } # else if (Xiskana(ch)) { buf[0] = ch; buf[1] = '\0'; return(1); } # endif #endif /* !DEP_KCONV */ if (isinkanji1(ch, code)) { if ((ch2 = getch3()) == EOF || !isinkanji2(ch2, code)) { buf[0] = '\0'; return(-1); } #ifdef DEP_KCONV tmp[0] = ch; tmp[1] = ch2; tmp[2] = '\0'; kanjiconv(buf, tmp, MAXKLEN, code, DEFCODE, L_INPUT); #else buf[0] = ch; buf[1] = ch2; buf[2] = '\0'; #endif return(2); } if (ch >= K_MIN) { buf[0] = '\0'; return(-1); } buf[0] = ch; buf[1] = '\0'; return((Xiscntrl(ch) || ismsb(ch)) ? 0 : 1); } static VOID NEAR copyhist(hist, keep) CONST char *hist; int keep; { #ifdef DEP_ORIGSHELL int y1, y2, len2; len2 = vlen(inputbuf, inputlen); y1 = ptr2line(len2); if (dumbmode) { setcursor(0, 0); clearline(); } #endif /* DEP_ORIGSHELL */ if (!keep) { inputlen = (hist) ? strlen(hist) : 0; insertbuf(0); if (hist) memcpy(inputbuf, hist, inputlen + 1); else *inputbuf = '\0'; if (rptr < 0 || rptr > inputlen) { rptr = inputlen; vptr = vlen(inputbuf, rptr); } } displaystr(); #ifdef DEP_ORIGSHELL if (dumbmode) /*EMPTY*/; else if (shellmode) { y2 = ptr2line(vlen(inputbuf, inputlen)); if (y1 > y2) { while (y1 > y2) { locate2(0, y1--); Xputterm(L_CLEAR); } setcursor(rptr, vptr); } } #endif /* DEP_ORIGSHELL */ } static VOID NEAR _inputstr_up(histnop, h, tmp) int *histnop, h; char **tmp; { keyflush(); #ifndef _NOCOMPLETE if (completable(h) && selectlist) { selectfile(tmpfilepos--, NULL); setcursor(rptr, vptr); } else #endif #ifdef DEP_ORIGSHELL if (dumbmode || vptr < maxcol) #else if (vptr < maxcol) #endif { if (nohist(h) || !history[h] || *histnop >= (int)histsize[h] || !history[h][*histnop]) { ringbell(); return; } if (!*tmp) { inputbuf[inputlen] = '\0'; *tmp = Xstrdup(inputbuf); } rptr = -1; copyhist(history[h][(*histnop)++], 0); } else { if (!within(vptr) && !ptr2col(vptr)) { leftcursor(); vptr--; } vptr -= maxcol; rptr = rlen(inputbuf, vptr); upcursor(); if (onkanji1(inputbuf, rptr - 1)) { leftcursor(); vptr--; rptr--; } } } static VOID NEAR _inputstr_down(histnop, h, tmp) int *histnop, h; char **tmp; { int len2; len2 = vlen(inputbuf, inputlen); keyflush(); #ifndef _NOCOMPLETE if (completable(h) && selectlist) { selectfile(tmpfilepos++, NULL); setcursor(rptr, vptr); } else #endif #ifdef DEP_ORIGSHELL if (dumbmode || (vptr + maxcol > len2 || (vptr + maxcol == len2 && !within(len2) && !ptr2col(len2)))) #else if (vptr + maxcol > len2 || (vptr + maxcol == len2 && !within(len2) && !ptr2col(len2))) #endif { if (nohist(h) || !history[h] || *histnop <= 0) { ringbell(); return; } rptr = -1; if (--(*histnop) > 0) copyhist(history[h][*histnop - 1], 0); else { copyhist(*tmp, 0); Xfree(*tmp); *tmp = NULL; } } else { vptr += maxcol; rptr = rlen(inputbuf, vptr); downcursor(); if (onkanji1(inputbuf, rptr - 1)) { leftcursor(); vptr--; rptr--; } } } static VOID NEAR _inputstr_delete(VOID_A) { int rw, vw; if (rptr >= inputlen) { ringbell(); return; } getcharwidth(inputbuf, rptr, &rw, &vw); if (rptr + rw > inputlen) { ringbell(); return; } deletechar(rptr, vptr, vw); delshift(rptr, rw); inputlen -= rw; } static VOID NEAR _inputstr_enter(VOID_A) { int len, quote; if (!curfilename) { ringbell(); return; } quote = '\0'; keyflush(); len = strlen(curfilename); if (insertstr(curfilename, len, rptr, "e, NULL) < 0) { ringbell(); return; } if (quote > '\0') VOID_C insertcursor(&rptr, &vptr, 1, quote); if (iseol(vptr)) setcursor(rptr, vptr); return; } #if FD >= 2 static VOID NEAR _inputstr_case(upper) int upper; { int ch; keyflush(); if (rptr >= inputlen) { ringbell(); return; } if (!iswchar(inputbuf, rptr)) { ch = (upper) ? Xtoupper(inputbuf[rptr]) : Xtolower(inputbuf[rptr]); if (ch != inputbuf[rptr]) { inputbuf[rptr++] = ch; vptr++; putcursor(ch, 1); # ifdef DEP_ORIGSHELL if (dumbmode) VOID_C checkcursor(rptr, vptr); else # endif if (within(vptr) && ptr2col(vptr) < 1) setcursor(rptr, vptr); return; } } rightchar(); } static int NEAR search_matchlen(VOID_A) { int n; if (searchstr) { n = rptr - strlen(searchstr); if (n < 0) n = 0; for (; n < rptr; n++) if (!memcmp(searchstr, &(inputbuf[n]), rptr - n)) return(n); } return(rptr); } static char *NEAR search_up(bias, histnop, h, tmp) int bias, *histnop, h; char **tmp; { int n, cx, hlen, slen; searchmode = -1; if (!searchstr) return(NULL); slen = strlen(searchstr); cx = search_matchlen() - bias; if (cx > inputlen - slen) cx = inputlen - slen; for (; cx >= 0; cx--) { if (strncmp(&(inputbuf[cx]), searchstr, slen)) continue; rptr = cx + slen; vptr = vlen(inputbuf, rptr); return(NULL); } if (nohist(h) || !history[h]) { ringbell(); searchmode = -2; return(NULL); } for (n = *histnop; n < (int)histsize[h]; n++) { if (!history[h][n]) break; hlen = strlen(history[h][n]); for (cx = hlen - slen; cx >= 0; cx--) { if (strncmp(&(history[h][n][cx]), searchstr, slen)) continue; if (!*tmp) { inputbuf[inputlen] = '\0'; *tmp = Xstrdup(inputbuf); } rptr = cx + slen; vptr = vlen(history[h][n], rptr); *histnop = n + 1; return(history[h][n]); } } ringbell(); searchmode = -2; return(NULL); } static char *NEAR search_down(bias, histnop, h, tmp) int bias, *histnop, h; char **tmp; { int n, cx, hlen, slen; searchmode = 1; if (!searchstr) return(NULL); slen = strlen(searchstr); cx = search_matchlen() + bias; for (; cx <= inputlen - slen; cx++) { if (strncmp(&(inputbuf[cx]), searchstr, slen)) continue; rptr = cx + slen; vptr = vlen(inputbuf, rptr); return(NULL); } if (nohist(h) || !history[h]) { ringbell(); searchmode = 2; return(NULL); } for (n = *histnop - 2; n >= 0; n--) { hlen = strlen(history[h][n]); for (cx = 0; cx <= hlen - slen; cx++) { if (strncmp(&(history[h][n][cx]), searchstr, slen)) continue; rptr = cx + slen; vptr = vlen(history[h][n], rptr); *histnop = n + 1; return(history[h][n]); } } if (*tmp && *histnop) { hlen = strlen(*tmp); for (cx = 0; cx <= hlen - slen; cx++) { if (strncmp(&((*tmp)[cx]), searchstr, slen)) continue; rptr = cx + slen; vptr = vlen(*tmp, rptr); *histnop = 0; return(*tmp); } } ringbell(); searchmode = 2; return(NULL); } #endif /* FD >= 2 */ static VOID NEAR _inputstr_input(buf, vw) CONST char *buf; int vw; { int rw; rw = strlen(buf); if (vw <= 0 || preparestr(rw, vw) < 0) { ringbell(); keyflush(); return; } memcpy(&(inputbuf[rptr]), buf, rw); rptr += rw; VOID_C XXcprintf("%.*k", vw, buf); win_x += vw; vptr = vlen(inputbuf, rptr); #ifdef DEP_ORIGSHELL if (dumbmode) VOID_C checkcursor(rptr, vptr); else #endif if (within(vptr) && ptr2col(vptr) < vw) setcursor(rptr, vptr); } static int NEAR _inputstr(def, comline, h) int def, comline, h; { #if !MSDOS keyseq_t key; #endif #if FD >= 2 ALLOC_T searchsize; CONST char *cp; #endif char *tmphist, buf[MAXKLEN + 1]; int i, n, ch, ch2, ovptr, hist, quote, sig; subwindow = 1; #ifdef DEP_ORIGSHELL if (dumbmode) maxcol -= RIGHTMARGIN; if (shellmode) sig = 0; else #endif sig = 1; Xgetkey(-1, VI_INSERT, 0); #ifndef _NOCOMPLETE tmpfilepos = -1; #endif rptr = inputlen; if (def >= 0 && def < maxcol) { while (def > inputlen) { insertbuf(0); inputbuf[inputlen++] = ' '; } rptr = def; } vptr = vlen(inputbuf, rptr); displaystr(); keyflush(); hist = 0; tmphist = NULL; quote = 0; ch = -1; #if FD >= 2 searchmode = 0; searchstr = NULL; searchsize = (ALLOC_T)0; #endif do { Xtflush(); ch2 = ch; ovptr = vptr; if (quote) { i = ch = getkey2(sigalrm(sig), getinkcode(), 0); quote = 0; #if MSDOS switch (i) { case K_BS: i = C_BS; break; case K_DC: i = C_DEL; break; default: break; } #else key.code = i; if (getkeyseq(&key) >= 0 && key.len == 1) i = *(key.str); #endif n = getkanjikey(buf, i); if (n) { _inputstr_input(buf, n); ovptr = vptr; continue; } keyflush(); ch = '\0'; if (!*buf) continue; n = (Xiscntrl(buf[0])) ? 2 : 4; if (preparestr(1, n) < 0) { ringbell(); continue; } inputbuf[rptr] = buf[0]; putstr(&rptr, &vptr, 1); continue; } #ifdef DEP_ORIGSHELL if (shellmode && !inputlen) { if ((ch = Xgetkey(sig, 1, 0)) < 0) { ch = K_ESC; break; } } else #endif ch = Xgetkey(sig, 0, 0); #ifdef DEP_ORIGSHELL if (shellmode && !comline && ch == cc_intr) break; #endif #if FD >= 2 if (searchmode) { cp = NULL; n = 0; switch (ch) { case K_CTRL('S'): keyflush(); searchmode = 1; n++; break; case K_CTRL('R'): keyflush(); searchmode = -1; n++; break; case K_BS: keyflush(); if (searchstr && (i = strlen(searchstr)) > 0) searchstr[i - 1] = '\0'; else ringbell(); break; default: i = getkanjikey(buf, ch); if (i <= 0) { keyflush(); searchmode = 0; Xfree(searchstr); searchstr = NULL; searchsize = (ALLOC_T)0; break; } i = (searchstr) ? strlen(searchstr) : 0; searchstr = c_realloc(searchstr, i + 1, &searchsize); searchstr[i++] = buf[0]; if (buf[1]) searchstr[i++] = buf[1]; searchstr[i] = '\0'; break; } if (searchmode < 0) cp = search_up(n, &hist, h, &tmphist); else if (searchmode > 0) cp = search_down(n, &hist, h, &tmphist); copyhist(cp, (cp) ? 0 : 1); ovptr = vptr; if (searchmode) continue; } #endif /* FD >= 2 */ #ifdef DEP_IME if (!imemode && !selectlist && imekey >= 0 && ch == imekey && ch != K_ESC) { keyflush(); # ifdef DEP_ORIGSHELL if (dumbmode) ringbell(); else # endif imemode = 1; continue; } #endif /* DEP_IME */ switch (ch) { case K_RIGHT: keyflush(); #ifndef _NOCOMPLETE if (completable(h) && selectlist) { i = tmpfilepos; tmpfilepos += tmpfileperrow; selectfile(i, NULL); ovptr = -1; } else #endif if (rptr >= inputlen) ringbell(); #ifndef _NOEDITMODE else if (isvimode() && inputlen && rptr >= inputlen - 1) ringbell(); #endif else { rightchar(); ovptr = vptr; } break; case K_LEFT: keyflush(); #ifndef _NOCOMPLETE if (completable(h) && selectlist) { i = tmpfilepos; tmpfilepos -= tmpfileperrow; selectfile(i, NULL); ovptr = -1; } else #endif if (rptr <= 0) ringbell(); else { leftchar(); ovptr = vptr; } break; case K_BEG: keyflush(); rptr = vptr = 0; break; case K_EOL: keyflush(); rptr = inputlen; #ifndef _NOEDITMODE if (isvimode() && inputlen) rptr--; #endif vptr = vlen(inputbuf, rptr); break; case K_BS: keyflush(); if (rptr <= 0) { ringbell(); break; } leftchar(); ovptr = vptr; _inputstr_delete(); break; case K_DC: keyflush(); _inputstr_delete(); #ifndef _NOEDITMODE if (isvimode() && inputlen && rptr >= inputlen) { leftchar(); ovptr = vptr; } #endif break; case K_DL: keyflush(); if (rptr < inputlen) truncline(); inputlen = rptr; #ifndef _NOEDITMODE if (isvimode() && inputlen) { leftchar(); ovptr = vptr; } #endif break; case K_CTRL('L'): keyflush(); #ifdef DEP_ORIGSHELL if (dumbmode) rewritecursor(0, 0); else if (shellmode) { locate2(0, 0); Xputterm(L_CLEAR); } else #endif { #ifdef DEP_PTY if (minline > 0) { i = filetop(win) + FILEPERROW; if (maxline != i) { ypos += i - maxline; maxline = i; } } else #endif if (maxline != n_line) { ypos += n_line - maxline; maxline = n_line; } for (i = 0; i < WCMDLINE; i++) { if (ypos + i >= maxline) break; Xlocate(xpos, ypos + i); Xputterm(L_CLEAR); } } displaystr(); break; case K_UP: _inputstr_up(&hist, h, &tmphist); ovptr = vptr; break; case K_DOWN: _inputstr_down(&hist, h, &tmphist); ovptr = vptr; break; case K_IL: keyflush(); quote = 1; break; case K_ENTER: _inputstr_enter(); ovptr = vptr; break; #if FD >= 2 case K_IC: keyflush(); overwritemode = 1 - overwritemode; break; case K_PPAGE: _inputstr_case(0); ovptr = vptr; break; case K_NPAGE: _inputstr_case(1); ovptr = vptr; break; case K_CTRL('S'): keyflush(); if (nohist(h) || !history[h]) { ringbell(); break; } searchmode = 1; Xfree(searchstr); searchstr = NULL; searchsize = (ALLOC_T)0; copyhist(NULL, 1); break; case K_CTRL('R'): keyflush(); if (nohist(h) || !history[h]) { ringbell(); break; } searchmode = -1; Xfree(searchstr); searchstr = NULL; searchsize = (ALLOC_T)0; copyhist(NULL, 1); break; #endif /* FD >= 2 */ #ifndef _NOCOMPLETE case '\t': keyflush(); if (!completable(h) || selectlist) { ringbell(); break; } i = completestr(comline, (ch2 == ch) ? 1 : 0, h); if (i < 0) break; if (iseol(vptr)) ovptr = -1; break; #endif /* !_NOCOMPLETE */ case K_CR: keyflush(); #ifndef _NOCOMPLETE if (!completable(h) || !selectlist) break; ch = '\0'; i = completestr(0, -1, h); if (i >= 0 && iseol(vptr)) ovptr = -1; #endif /* !_NOCOMPLETE */ break; case K_ESC: keyflush(); break; default: i = getkanjikey(buf, ch); _inputstr_input(buf, i); ovptr = vptr; break; } #ifndef _NOCOMPLETE if (completable(h) && selectlist && ch != '\t' && ch != K_RIGHT && ch != K_LEFT && ch != K_UP && ch != K_DOWN) { selectfile(-1, NULL); if (!maxcmdline) rewritefile(0); else { n = filetop(win); for (i = 0; i < maxcmdline; i++) { Xlocate(0, n + i); Xputterm(L_CLEAR); } } n = ypos; if (!lcmdline) ypos = L_CMDLINE + maxline - n_line; else if (lcmdline > 0) ypos = lcmdline; else ypos = maxline - 1; while (ypos > n) scrollup(); displaystr(); ovptr = -1; } if (ovptr != vptr) setcursor(rptr, vptr); #endif /* !_NOCOMPLETE */ if (ch == K_ESC) { #ifdef DEP_ORIGSHELL if (shellmode) /*EMPTY*/; else #endif break; } } while (ch != K_CR); #ifndef _NOCOMPLETE if (selectlist) selectfile(-1, NULL); #endif setcursor(inputlen, -1); subwindow = 0; Xgetkey(-1, 0, 0); Xfree(tmphist); i = 0; #ifdef DEP_ORIGSHELL if (shellmode && ch == cc_intr) inputlen = 0; else #endif if (ch == K_ESC) { inputlen = 0; if (maxcmdline) i = 0; #ifdef DEP_PTY else if (minline > 0) i = 1; #endif else if (hideclock) i = 1; } inputbuf[inputlen] = '\0'; Xtflush(); hideclock = 0; if (i) rewritefile(1); return(ch); } static VOID NEAR dispprompt(s, set) CONST char *s; int set; { static CONST char *prompt = NULL; char *buf; if (set > 0) prompt = s; #if FD >= 2 else if (searchmode > 0) s = (searchmode > 1) ? SEAFF_K : SEAF_K; else if (searchmode < 0) s = (searchmode < -1) ? SEABF_K : SEAB_K; #endif else if (!s) s = prompt; if (set < 0) { if (s && *s) { plen = strlen2(s); #ifdef DEP_ORIGSHELL if (dumbmode || shellmode) /*EMPTY*/; else #endif plen++; } else { plen = evalprompt(&buf, promptstr); Xfree(buf); #ifndef DEP_ORIGSHELL plen++; #endif } return; } #ifdef DEP_ORIGSHELL if (dumbmode) { backcursor(0); forwcursor(xpos); win_y = 0; } else if (shellmode) locate2(0, 0); else #endif Xlocate(xpos, ypos); if (s && *s) { #ifdef DEP_ORIGSHELL if (dumbmode || shellmode) plen = Xkanjiputs(s); else #endif { VOID_C XXputch(' '); plen = 1 + Xattrkanjiputs(s, 1); } } else { #ifndef DEP_ORIGSHELL VOID_C XXputch(' '); Xputterm(T_STANDOUT); #endif plen = evalprompt(&buf, promptstr); VOID_C Xkanjiputs(buf); Xfree(buf); #ifdef DEP_ORIGSHELL if (dumbmode) /*EMPTY*/; else #else plen++; Xputterm(END_STANDOUT); #endif Xputterm(T_NORMAL); } win_x += plen; } char *inputstr(prompt, delsp, ptr, def, h) CONST char *prompt; int delsp, ptr; CONST char *def; int h; { int i, len, ch, pc, qtop, quote, comline, dupwin_x, dupwin_y; dupwin_x = win_x; dupwin_y = win_y; win_x = 0; xpos = LEFTMARGIN; #ifdef DEP_ORIGSHELL dumbmode = (dumbterm || dumbshell) ? !Xtermmode(-1) : 0; if (dumbmode || shellmode) lcmdline = -1; #endif if (!lcmdline) ypos = L_CMDLINE; else if (lcmdline > 0) ypos = lcmdline; else ypos = n_line - 1; maxcol = n_column - 1 - xpos; if (maxcmdline) { minline = ypos; maxline = ypos + maxcmdline; } else { minline = 0; maxline = n_line; } #ifdef DEP_PTY # ifdef DEP_ORIGSHELL if (!fdmode && shellmode) /*EMPTY*/; else # endif if (isptymode() && parentfd < 0 && !maxcmdline) { minline = filetop(win); maxline = minline + FILEPERROW; ypos -= n_line - maxline; } #endif /* DEP_PTY */ #ifdef DEP_ORIGSHELL if (dumbmode || shellmode) win_y = 0; else #endif { win_y = ypos; for (i = 0; i < WCMDLINE; i++) { if (ypos + i >= maxline) break; Xlocate(0, ypos + i); Xputterm(L_CLEAR); } } dispprompt(prompt, 1); Xtflush(); inputbuf = c_realloc(NULL, 0, &inputsize); inputlen = 0; if (def) { quote = '\0'; qtop = 0; for (i = 0; def[i]; i++, inputlen++) { insertbuf(3); pc = parsechar(&(def[i]), -1, '!', EA_FINDMETA, "e, NULL); if (pc == PC_WCHAR) inputbuf[inputlen++] = def[i++]; #ifndef FAKEESCAPE else if (prompt) /*EMPTY*/; else if (pc == PC_EXMETA || pc == '!') { if (quote) { if (ptr > inputlen) ptr += 2; inputbuf[inputlen++] = quote; quote = '\0'; } else { if (ptr > inputlen) ptr++; } inputbuf[inputlen++] = PESCAPE; qtop = inputlen + 1; } #endif /* !FAKEESCAPE */ else if (pc == PC_META) { if (ptr > inputlen) ptr++; memmove(&(inputbuf[qtop + 1]), &(inputbuf[qtop]), inputlen++ - qtop); inputbuf[qtop] = quote = '"'; if (Xstrchr(DQ_METACHAR, def[i])) { if (ptr > inputlen) ptr++; #ifdef FAKEESCAPE inputbuf[inputlen++] = def[i]; #else inputbuf[inputlen++] = PESCAPE; #endif } } inputbuf[inputlen] = def[i]; } if (quote) { if (ptr > inputlen) ptr++; inputbuf[inputlen++] = quote; } } inputbuf[inputlen] = '\0'; #ifndef _NOSPLITWIN if (h == HST_PATH && windows > 1) { if ((i = win - 1) < 0) i = windows - 1; VOID_C entryhist(winvar[i].v_fullpath, HST_PATH | HST_UNIQ); } #endif comline = (h == HST_COMM) ? 1 : 0; #ifdef DEP_ORIGSHELL if (promptstr == promptstr2) comline = 0; lastofs2 = 0; #endif ch = _inputstr(ptr, comline, h); win_x = dupwin_x; win_y = dupwin_y; len = strlen(inputbuf); #ifdef DEP_ORIGSHELL if (dumbmode || shellmode) prompt = NULL; dumbmode = 0; #endif if (!prompt || !*prompt) { if (ch != K_ESC) { if (ch == cc_intr) { XXcputs("^C"); ch = K_ESC; } #ifdef DEP_PTY if (minline > 0 && ypos + ptr2line(vlen(inputbuf, len)) >= maxline - 1) scrollup(); else #endif Xcputnl(); } } else { for (i = 0; i < WCMDLINE; i++) { if (ypos + i >= maxline) break; Xlocate(0, ypos + i); Xputterm(L_CLEAR); } Xlocate(win_x, win_y); Xtflush(); if (maxcmdline) /*EMPTY*/; else if ((!lcmdline && ypos < L_CMDLINE) || (lcmdline > 0 && ypos < lcmdline + maxline)) rewritefile(1); } lcmdline = maxcmdline = 0; if (ch == K_ESC) { Xfree(inputbuf); return(NULL); } if (delsp && len > 0 && inputbuf[len - 1] == ' ' && yesno(DELSP_K)) { for (len--; len > 0; len--) if (inputbuf[len - 1] != ' ') break; inputbuf[len] = '\0'; } return(inputbuf); } static int NEAR truncstr(s) CONST char *s; { char *cp, *tmp; int n, len; n = strlen2(s); if ((len = n + YESNOSIZE - n_lastcolumn) <= 0 || !(cp = Xstrchr(s, '[')) || !(tmp = Xstrchr(cp, ']'))) return(n); cp++; len = tmp - cp - len; if (len <= 0) len = 0; else if (onkanji1(cp, len - 1)) len--; #ifdef CODEEUC else if (isekana(cp, len - 1)) len--; #endif Xstrcpy(&(cp[len]), tmp); return(n); } static int NEAR yesnomes(mes) CONST char *mes; { int len; #ifdef DEP_ORIGSHELL if (dumbmode) forwline(xpos); else if (shellmode) locate2(0, 0); else #endif Xlocate(xpos, ypos); #ifdef DEP_ORIGSHELL if (dumbmode) /*EMPTY*/; else #endif { Xputterm(L_CLEAR); Xputterm(T_STANDOUT); } len = kanjiputs2(mes, n_lastcolumn - YESNOSIZE, -1); win_x += len; XXcputs(YESNOSTR); win_x += YESNOSIZE; #ifdef DEP_ORIGSHELL if (dumbmode) /*EMPTY*/; else #endif Xputterm(END_STANDOUT); Xtflush(); return(len); } #ifdef USESTDARGH /*VARARGS1*/ int yesno(CONST char *fmt, ...) #else /*VARARGS1*/ int yesno(fmt, va_alist) CONST char *fmt; va_dcl #endif { va_list args; int len, ch, x, dupwin_x, dupwin_y, duperrno, ret; char *buf; VA_START(args, fmt); VOID_C vasprintf2(&buf, fmt, args); va_end(args); dupwin_x = win_x; dupwin_y = win_y; duperrno = errno; win_x = xpos = 0; #ifdef DEP_ORIGSHELL dumbmode = (dumbterm || dumbshell) ? !Xtermmode(-1) : 0; if (dumbmode || shellmode) lcmdline = -1; #endif minline = 0; maxline = n_line; if (!lcmdline) ypos = L_MESLINE; else if (lcmdline > 0) ypos = lcmdline; else ypos = maxline - 1; #ifdef DEP_ORIGSHELL if (dumbmode || shellmode) win_y = 0; else #endif win_y = ypos; len = truncstr(buf); ret = yesnomes(buf); if (ret < len) len = ret; if (win_x >= n_column) win_x = n_column - 1; subwindow = 1; Xgetkey(-1, 0, 0); ret = 1; x = len + 1; do { keyflush(); #ifdef DEP_ORIGSHELL if (dumbmode) { if (xpos + x < win_x) backcursor(xpos + x); else while (xpos + x > win_x) { VOID_C XXputch(YESNOSTR[win_x - xpos - len]); win_x++; } } else #endif locate2(x, 0); Xtflush(); switch (ch = Xgetkey(1, 0, 0)) { case 'y': case 'Y': ret = 1; ch = K_CR; break; case 'n': case 'N': case ' ': case K_ESC: ret = 0; ch = K_CR; break; case K_RIGHT: ret = 0; break; case K_LEFT: ret = 1; break; case K_CTRL('L'): maxline = n_line; if (!lcmdline) ypos = L_MESLINE; else if (lcmdline > 0) ypos = lcmdline; else ypos = maxline - 1; yesnomes(buf); break; default: break; } x = len + 1 + (1 - ret) * 2; } while (ch != K_CR); Xfree(buf); #ifdef DEP_ORIGSHELL if (dumbmode) Xcputnl(); else #endif if (lcmdline) { locate2(x, 0); VOID_C XXputch((ret) ? 'Y' : 'N'); Xcputnl(); } else { locate2(0, 0); Xputterm(L_CLEAR); } #ifdef DEP_ORIGSHELL dumbmode = 0; #endif Xtflush(); lcmdline = 0; win_x = dupwin_x; win_y = dupwin_y; subwindow = 0; Xgetkey(-1, 0, 0); errno = duperrno; return(ret); } VOID warning(n, s) int n; CONST char *s; { char *tmp, *err; int y, len, siz, wastty, dupwin_x, dupwin_y; dupwin_x = win_x; dupwin_y = win_y; subwindow = 1; err = Xstrerror((n < 0) ? errno : n); tmp = NULL; if (!s) s = err; else if (n) { len = n_lastcolumn - strlen2(err) - 3; siz = n_lastcolumn * KANAWID; tmp = Xmalloc(siz + 1); VOID_C strncpy2(tmp, s, &len, -1); VOID_C Xstrlcat(tmp, ": ", siz); VOID_C Xstrlcat(tmp, err, siz); s = tmp; } ringbell(); y = (lcmdline) ? lcmdline : L_MESLINE; Xlocate(0, y); Xputterm(L_CLEAR); win_x = attrkanjiputs2(s, n_lastcolumn, -1); win_y = y; Xtflush(); if (win_x >= n_lastcolumn) win_x = n_lastcolumn - 1; if (!(wastty = isttyiomode)) Xttyiomode(1); keyflush(); do { getkey3(sigalrm(1), getinkcode(), 0); } while (kbhit2(WAITAFTERWARN * 1000L)); if (!wastty) Xstdiomode(); win_x = dupwin_x; win_y = dupwin_y; subwindow = 0; if (n && !lcmdline) rewritefile(1); else { Xlocate(0, y); Xputterm(L_CLEAR); Xlocate(win_x, win_y); Xtflush(); } Xfree(tmp); hideclock = lcmdline = 0; } static int NEAR selectcnt(max, str, multi) int max; char *CONST *str; int multi; { int i, len; for (i = len = 0; i < max; i++) if (str[i]) { len += strlen2(str[i]) + 1; if (multi) len++; } return(len); } static int NEAR selectadj(max, x, str, tmpstr, xx, multi) int max, x; CONST char *CONST *str; char **tmpstr; int *xx, multi; { char *cp, **new; int i, len, maxlen; for (i = 0; i < max; i++) { Xfree(tmpstr[i]); tmpstr[i] = Xstrdup(str[i]); } len = selectcnt(max, tmpstr, multi); if (x + len < n_lastcolumn) /*EMPTY*/; else if ((x = n_lastcolumn - 1 - len) >= 0) /*EMPTY*/; else { x = maxlen = 0; new = (char **)Xmalloc(max * sizeof(char *)); for (i = 0; i < max; i++) { if (!(cp = tmpstr[i])) { new[i] = NULL; continue; } if (Xisupper(*cp) && cp[1] == ':') for (cp += 2; *cp == ' '; cp++) /*EMPTY*/; len = strlen3(cp); if (len > maxlen) maxlen = len; new[i] = Xstrdup(cp); } for (; maxlen > 0; maxlen--) { for (i = 0; i < max; i++) if (new[i]) { len = maxlen; tmpstr[i] = Xrealloc(tmpstr[i], len * KANAWID + 1); VOID_C strncpy2(tmpstr[i], new[i], &len, -1); } if (x + selectcnt(max, tmpstr, multi) < n_lastcolumn) break; } for (i = 0; i < max; i++) Xfree(new[i]); Xfree(new); if (maxlen <= 0) return(-1); } xx[0] = 0; for (i = 0; i < max; i++) { if (!tmpstr[i]) { xx[i + 1] = xx[i]; continue; } xx[i + 1] = xx[i] + strlen2(tmpstr[i]) + 1; if (multi) (xx[i + 1])++; } return(x); } static VOID NEAR selectmes(num, max, x, str, val, xx, multi) int num, max, x; char *CONST str[]; int val[], *xx, multi; { int i; Xlocate(x, L_MESLINE); Xputterm(L_CLEAR); for (i = 0; i < max; i++) { if (!str[i]) continue; Xlocate(x + xx[i] + 1, L_MESLINE); if (multi) VOID_C XXputch((val[i]) ? '*' : ' '); VOID_C Xattrkanjiputs(str[i], i == num); } } int selectstr(num, max, x, str, val) int *num, max, x; CONST char *CONST str[]; int val[]; { char **tmpstr; int i, ch, old, new, multi, tmpx, dupwin_x, dupwin_y, *xx, *initial; dupwin_x = win_x; dupwin_y = win_y; subwindow = 1; Xgetkey(-1, 0, 0); xx = (int *)Xmalloc((max + 1) * sizeof(int)); initial = (int *)Xmalloc(max * sizeof(int)); tmpstr = (char **)Xmalloc(max * sizeof(char *)); new = 0; multi = (num) ? 0 : 1; for (i = 0; i < max; i++) { tmpstr[i] = NULL; initial[i] = (str[i] && Xisupper(*(str[i]))) ? *str[i] : -1; if (num && val[i] == *num) new = i; } tmpx = selectadj(max, x, str, tmpstr, xx, multi); selectmes(new, max, tmpx, tmpstr, val, xx, multi); win_y = L_MESLINE; do { keyflush(); win_x = tmpx + xx[new + 1]; Xlocate(win_x, win_y); Xtflush(); old = new; switch (ch = Xgetkey(1, 0, 0)) { case K_RIGHT: for (new++; new != old; new++) { if (new >= max) new = 0; if (tmpstr[new]) break; } break; case K_LEFT: for (new--; new != old; new--) { if (new < 0) new = max - 1; if (tmpstr[new]) break; } break; case K_CTRL('L'): win_y = L_MESLINE; tmpx = selectadj(max, x, str, tmpstr, xx, multi); selectmes(new, max, tmpx, tmpstr, val, xx, multi); break; case ' ': if (num) break; val[new] = (val[new]) ? 0 : 1; Xlocate(tmpx + xx[new] + 1, L_MESLINE); VOID_C XXputch((val[new]) ? '*' : ' '); break; default: if (!Xisalpha(ch)) break; ch = Xtoupper(ch); for (i = 0; i < max; i++) if (ch == initial[i]) break; if (i >= max) break; new = i; if (num) { ch = K_CR; break; } val[new] = (val[new]) ? 0 : 1; Xlocate(tmpx + xx[new] + 1, L_MESLINE); VOID_C XXputch((val[new]) ? '*' : ' '); break; } if (new != old) { i = tmpx + 1; if (!num) i++; Xlocate(i + xx[new], L_MESLINE); VOID_C Xattrkanjiputs(tmpstr[new], 1); Xlocate(i + xx[old], L_MESLINE); if (stable_standout) Xputterm(END_STANDOUT); else VOID_C Xkanjiputs(tmpstr[old]); } } while (ch != K_ESC && ch != K_CR && ch != cc_intr); win_x = dupwin_x; win_y = dupwin_y; subwindow = 0; Xgetkey(-1, 0, 0); if (stable_standout) { Xlocate(tmpx + 1, L_MESLINE); Xputterm(L_CLEAR); } if (num) { if (ch != K_CR) new = -1; else *num = val[new]; for (i = 0; i < max; i++) { if (!tmpstr[i]) continue; Xlocate(tmpx + xx[i] + 1, L_MESLINE); if (i == new) VOID_C Xkanjiputs(tmpstr[i]); else cputspace(strlen2(tmpstr[i])); } } else { if (ch != K_CR) for (i = 0; i < max; i++) val[i] = 0; for (i = 0; i < max; i++) { if (!tmpstr[i]) continue; Xlocate(tmpx + xx[i] + 1, L_MESLINE); VOID_C XXputch(' '); if (val[i]) VOID_C Xkanjiputs(tmpstr[i]); else cputspace(strlen2(tmpstr[i])); } } Xlocate(win_x, win_y); Xtflush(); Xfree(xx); Xfree(initial); for (i = 0; i < max; i++) Xfree(tmpstr[i]); Xfree(tmpstr); return(ch); } #ifdef DEP_URLPATH char *inputpass(VOID_A) { CONST char *cp; char *buf, kbuf[MAXKLEN + 1]; ALLOC_T size; int n, ch, x, y, len, max, wastty, dupwin_x, dupwin_y; dupwin_x = win_x; dupwin_y = win_y; subwindow = 1; Xgetkey(-1, 0, 0); y = L_CMDLINE; cp = PASWD_K; if (!(wastty = isttyiomode)) { x = strlen2(cp); VOID_C Xfprintf(Xstderr, "%k", cp); VOID_C Xfflush(Xstderr); } else { Xlocate(0, y); Xputterm(L_CLEAR); VOID_C XXputch(' '); x = 1 + attrkanjiputs2(cp, n_column, -1); win_x = x; win_y = y; Xtflush(); } max = n_column - 1 - x; keyflush(); buf = c_realloc(NULL, 0, &size); len = 0; for (;;) { if (!wastty) Xttyiomode(1); ch = getkey3(sigalrm(1), getinkcode(), 0); n = getkanjikey(kbuf, ch); if (!wastty) Xstdiomode(); if (ch == K_CR) break; else if (ch == K_BS) { if (!len) ch = -1; else { len--; if (!hidepasswd) { if (wastty) { VOID_C XXcprintf("%c %c", C_BS, C_BS); Xtflush(); win_x--; } else { VOID_C Xfputs("\b \b", Xstderr); VOID_C Xfflush(Xstderr); } } } } else if (ch == K_ESC) { len = 0; break; } else if (n != 1 || ismsb(ch) || kbuf[1]) ch = -1; else if (!hidepasswd && len >= max) ch = -1; else { buf = c_realloc(buf, len + 1, &size); buf[len++] = ch; if (!hidepasswd) { ch = '*'; if (wastty) { VOID_C XXputch(ch); Xtflush(); win_x++; } else { VOID_C Xfputc(ch, Xstderr); VOID_C Xfflush(Xstderr); } } } if (ch >= 0) /*EMPTY*/; else if (wastty) { ringbell(); Xtflush(); } else { VOID_C Xfputc('\007', Xstderr); VOID_C Xfflush(Xstderr); } } win_x = dupwin_x; win_y = dupwin_y; subwindow = 0; if (wastty) { Xlocate(0, y); Xputterm(L_CLEAR); Xlocate(win_x, win_y); Xtflush(); } else { VOID_C fputnl(Xstderr); VOID_C Xfflush(Xstderr); } buf = Xrealloc(buf, len + 1); buf[len] = '\0'; return(buf); } #endif /* DEP_URLPATH */ FD-3.01j/ime.c100644 2105 1751 75430 13516612560 11630 0ustar shiraiuser/* * ime.c * * tiny Input Method Editor for terminal emulation */ #include "fd.h" #include "wait.h" #include "parse.h" #include "kconv.h" #include "roman.h" #include "func.h" #include "kanji.h" #include "termemu.h" #define KN_HIRA 0 #define KN_KATA 1 #define KN_HAN 2 #define KN_DIRECT 3 #define KN_MAX 4 #define JIS_WIDTH 4 #define JIS_DIGIT 4 #define KNJ_COLUMN 16 #define isvalidbuf(jp) ((jp).buf && (jp).max > 0) #define jis_xpos(p, n) ((p) + 8 + 1 + (n) * (JIS_WIDTH + 1)) typedef struct _jisbuf { u_short *buf; int size; int max; } jisbuf; #ifdef DEP_IME extern int subwindow; extern int win_x; extern int win_y; extern int imekey; extern romantable *romanlist; extern int maxromanlist; static int NEAR inkanjiconv __P_((char *, CONST char *)); static u_int NEAR getdefcode __P_((u_int, int, int)); static VOID NEAR imeputch __P_((int, int)); static int NEAR imeputs __P_((CONST char *)); static int NEAR imeprintf __P_((CONST char *, ...)); static int NEAR jisputs __P_((u_int)); static int NEAR putjisbuf __P_((jisbuf *)); static int NEAR countjisbuf __P_((jisbuf *)); static VOID NEAR addjisbuf __P_((jisbuf *, u_int)); static VOID NEAR copyjisbuf __P_((jisbuf *, CONST u_short *, int)); static u_int NEAR zen2han __P_((u_int)); static u_int NEAR kanabias __P_((u_int)); static int NEAR romanprompt __P_((int, int *)); static int NEAR fixroman __P_((int, int, int)); static int NEAR findroman __P_((int, int, int *, int *)); static int NEAR unlimitroman __P_((int, int *, int *, int *)); static u_int NEAR getjisindex __P_((jisbuf *)); static u_int NEAR getjiscode __P_((int *, jisbuf *)); static VOID NEAR dispjiscode __P_((u_int, int)); static VOID NEAR imeputcursor __P_((int, int, int)); static int NEAR listkanji __P_((int, long, u_short **, long *, long *, long *, int [])); static int NEAR selectkanji __P_((long *, u_short **, int)); static int NEAR listjis __P_((int, u_int, int *, int)); static int NEAR selectjis __P_((u_int, int, int)); static int NEAR searchkanji __P_((long *, u_short ***, int, int, int, int *, int)); static int NEAR fixkanji __P_((int, int, int, int)); static int NEAR inputkanji __P_((int)); static int NEAR getkanjibuf __P_((char *, u_int)); int ime_cont = 0; int ime_line = 0; int *ime_xposp = NULL; VOID (*ime_locate)__P_((int, int)) = NULL; static int imewin_x = 0; static int imewin_y = 0; static int kanamode = KN_HIRA; static jisbuf rjisbuf = {NULL, 0, 0}; static jisbuf kjisbuf = {NULL, 0, 0}; static CONST u_short jislist[256] = { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, /* 0x00 */ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, /* 0x10 */ 0x2121, 0x212a, 0x2149, 0x2174, 0x2170, 0x2173, 0x2175, 0x2147, 0x214a, 0x214b, 0x2176, 0x215c, 0x2122, 0x213c, 0x2123, 0x213f, 0x2330, 0x2331, 0x2332, 0x2333, 0x2334, 0x2335, 0x2336, 0x2337, 0x2338, 0x2339, 0x2127, 0x2128, 0x2163, 0x2161, 0x2164, 0x2129, 0x2177, 0x2341, 0x2342, 0x2343, 0x2344, 0x2345, 0x2346, 0x2347, 0x2348, 0x2349, 0x234a, 0x234b, 0x234c, 0x234d, 0x234e, 0x234f, 0x2350, 0x2351, 0x2352, 0x2353, 0x2354, 0x2355, 0x2356, 0x2357, 0x2358, 0x2359, 0x235a, 0x2156, 0x2140, 0x2157, 0x2130, 0x2132, 0x2146, 0x2361, 0x2362, 0x2363, 0x2364, 0x2365, 0x2366, 0x2367, 0x2368, 0x2369, 0x236a, 0x236b, 0x236c, 0x236d, 0x236e, 0x236f, 0x2370, 0x2371, 0x2372, 0x2373, 0x2374, 0x2375, 0x2376, 0x2377, 0x2378, 0x2379, 0x237a, 0x2150, 0x2143, 0x2151, 0x2141, 0x0000, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, /* 0x80 */ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, /* 0x90 */ 0x0000, 0x2123, 0x2156, 0x2157, 0x2122, 0x2126, 0x2572, 0x2521, 0x2523, 0x2525, 0x2527, 0x2529, 0x2563, 0x2565, 0x2567, 0x2543, 0x213c, 0x2522, 0x2524, 0x2526, 0x2528, 0x252a, 0x252b, 0x252d, 0x252f, 0x2531, 0x2533, 0x2535, 0x2537, 0x2539, 0x253b, 0x253d, 0x253f, 0x2541, 0x2544, 0x2546, 0x2548, 0x254a, 0x254b, 0x254c, 0x254d, 0x254e, 0x254f, 0x2552, 0x2555, 0x2558, 0x255b, 0x255e, 0x255f, 0x2560, 0x2561, 0x2562, 0x2564, 0x2566, 0x2568, 0x2569, 0x256a, 0x256b, 0x256c, 0x256d, 0x256f, 0x2573, 0x212b, 0x212c, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, /* 0xe0 */ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, /* 0xf0 */ }; static CONST u_short hanlist[256] = { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, /* 0x00 */ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, /* 0x10 */ 0x0000, 0xa700, 0xb100, 0xa800, 0xb200, 0xa900, 0xb300, 0xaa00, 0xb400, 0xab00, 0xb500, 0xb600, 0xb6de, 0xb700, 0xb7de, 0xb800, 0xb8de, 0xb900, 0xb9de, 0xba00, 0xbade, 0xbb00, 0xbbde, 0xbc00, 0xbcde, 0xbd00, 0xbdde, 0xbe00, 0xbede, 0xbf00, 0xbfde, 0xc000, 0xc0de, 0xc100, 0xc1de, 0xaf00, 0xc200, 0xc2de, 0xc300, 0xc3de, 0xc400, 0xc4de, 0xc500, 0xc600, 0xc700, 0xc800, 0xc900, 0xca00, 0xcade, 0xcadf, 0xcb00, 0xcbde, 0xcbdf, 0xcc00, 0xccde, 0xccdf, 0xcd00, 0xcdde, 0xcddf, 0xce00, 0xcede, 0xcedf, 0xcf00, 0xd000, 0xd100, 0xd200, 0xd300, 0xac00, 0xd400, 0xad00, 0xd500, 0xae00, 0xd600, 0xd700, 0xc800, 0xd900, 0xda00, 0xdb00, 0xdc00, 0xdc00, 0xb200, 0xb400, 0xa600, 0xdd00, 0xb3de, 0xb600, 0xb900, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, /* 0x80 */ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, /* 0x90 */ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, /* 0xa0 */ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, /* 0xb0 */ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, /* 0xc0 */ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, /* 0xd0 */ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, /* 0xe0 */ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, /* 0xf0 */ }; static CONST u_char hanlist2[256] = { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, /* 0x00 */ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, /* 0x10 */ 0x00, 0x20, 0xa4, 0xa1, 0x2c, 0x2e, 0xa5, 0x3a, /* 0x20 */ 0x3b, 0x3f, 0x21, 0xde, 0xdf, 0x00, 0x00, 0x00, 0x5e, 0x00, 0x5f, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x30 */ 0x00, 0x00, 0x00, 0x00, 0xb0, 0x00, 0x00, 0x2f, 0x5c, 0x7e, 0x00, 0x7c, 0x00, 0x00, 0x60, 0x27, /* 0x40 */ 0x22, 0x22, 0x28, 0x29, 0x00, 0x00, 0x5b, 0x5d, 0x7b, 0x7d, 0x00, 0x00, 0x00, 0x00, 0xa2, 0xa3, /* 0x50 */ 0x00, 0x00, 0x00, 0x00, 0x2b, 0x2d, 0x00, 0x00, 0x00, 0x3d, 0x00, 0x3c, 0x3e, 0x00, 0x00, 0x00, /* 0x60 */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x5c, 0x24, 0x00, 0x00, 0x25, 0x23, 0x26, 0x2a, 0x40, /* 0x70 */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, /* 0x80 */ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, /* 0x90 */ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, /* 0xa0 */ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, /* 0xb0 */ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, /* 0xc0 */ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, /* 0xd0 */ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, /* 0xe0 */ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, /* 0xf0 */ }; static CONST u_short jisindex[256] = { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, /* 0x00 */ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, /* 0x10 */ 0x0000, 0x3021, 0x3021, 0x304a, 0x304a, 0x3126, 0x3126, 0x3141, 0x3141, 0x3177, 0x3177, 0x323c, 0x323c, 0x346b, 0x346b, 0x3665, 0x3665, 0x3735, 0x3735, 0x3843, 0x3843, 0x3a33, 0x3a33, 0x3b45, 0x3b45, 0x3f5a, 0x3f5a, 0x4024, 0x4024, 0x4139, 0x4139, 0x423e, 0x423e, 0x434d, 0x434d, 0x4445, 0x4445, 0x4445, 0x4462, 0x4462, 0x4546, 0x4546, 0x4660, 0x4673, 0x4728, 0x4729, 0x4735, 0x4743, 0x4743, 0x4743, 0x485b, 0x485b, 0x485b, 0x4954, 0x4954, 0x4954, 0x4a3a, 0x4a3a, 0x4a3a, 0x4a5d, 0x4a5d, 0x4a5d, 0x4b60, 0x4c23, 0x4c33, 0x4c3d, 0x4c4e, 0x4c69, 0x4c69, 0x4c7b, 0x4c7b, 0x4d3d, 0x4d3d, 0x4d65, 0x4d78, 0x4e5c, 0x4e61, 0x4f24, 0x4f41, 0x4f41, 0x304a, 0x3141, 0x5021, 0x5021, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, /* 0x80 */ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, /* 0x90 */ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, /* 0xa0 */ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, /* 0xb0 */ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, /* 0xc0 */ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, /* 0xd0 */ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, /* 0xe0 */ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, /* 0xf0 */ }; static int NEAR inkanjiconv(buf, s) char *buf; CONST char *s; { int code; code = (inputkcode != NOCNV) ? inputkcode : DEFCODE; #ifdef DEP_PTY if (parentfd >= 0 && ptyinkcode != NOCNV) code = ptyinkcode; #endif kanjiconv(buf, s, MAXKANJIBUF, DEFCODE, code, L_INPUT); if (kanjierrno) return(-1); if (!buf[1]) return((u_char)(buf[0])); return(0); } static u_int NEAR getdefcode(c, type, kana) u_int c; int type, kana; { CONST char *cp; char buf[MAXUTF8LEN + 1], tmp[MAXKLEN + 1]; int i, code; switch (type) { case 'J': code = EUC; kana = 0; c ^= 0x8080; break; case 'E': code = EUC; break; case 'S': code = SJIS; break; case 'K': code = EUC; kana = 0; VOID_C code2kanji(buf, c); tmp[0] = (buf[0] & 0xf); tmp[1] = ((buf[0] & 0xf0) >> 4); if (tmp[0] >= 10 || tmp[1] >= 10) return((u_int)0); buf[0] = tmp[1] * 10 + tmp[0]; tmp[0] = (buf[1] & 0xf); tmp[1] = ((buf[1] & 0xf0) >> 4); if (tmp[0] >= 10 || tmp[1] >= 10) return((u_int)0); buf[1] = tmp[1] * 10 + tmp[0]; buf[0] += (char)0xa0; buf[1] += (char)0xa0; buf[2] = type = '\0'; break; #ifdef DEP_UNICODE case 'U': code = UTF8; i = ucs2toutf8(buf, 0, c); buf[i] = type = '\0'; break; #endif default: return((u_int)0); /*NOTREACHED*/ break; } if (type) VOID_C code2kanji(buf, c); cp = kanjiconv2(tmp, buf, MAXKLEN, code, DEFCODE, L_INPUT); if (kanjierrno) return((u_int)0); i = 0; if (!iskanji1(cp, 0) && (!kana || !iskana1(cp, &i))) return((u_int)0); return(((u_char)(cp[0]) << 8) | (u_char)(cp[1])); } #ifdef DEP_PTY u_int ime_getkeycode(s) CONST char *s; { int n, c; if ((n = getkeycode(s, 0)) >= 0) return((u_int)n); if (!(n = *(s++)) || !Xsscanf(s, "%<0*x%$", JIS_DIGIT, &c)) return((u_int)0); return(getdefcode(c, n, 1)); } int ime_inkanjiconv(buf, c) char *buf; u_int c; { char tmp[MAXKLEN + 1]; VOID_C code2kanji(tmp, c); return(inkanjiconv(buf, tmp)); } #endif /* DEP_PTY */ static VOID NEAR imeputch(c, isstandout) int c, isstandout; { VOID_C Xattrprintf("%c", isstandout, c); if (ime_xposp) (*ime_xposp)++; } static int NEAR imeputs(s) CONST char *s; { int len; len = Xkanjiputs(s); if (ime_xposp) *ime_xposp += len; return(len); } #ifdef USESTDARGH /*VARARGS1*/ static int NEAR imeprintf(CONST char *fmt, ...) #else /*VARARGS1*/ static int NEAR imeprintf(fmt, va_alist) CONST char *fmt; va_dcl #endif { va_list args; char *buf; int n; VA_START(args, fmt); n = vasprintf2(&buf, fmt, args); va_end(args); XXcputs(buf); if (ime_xposp) *ime_xposp += n; Xfree(buf); return(n); } static int NEAR jisputs(c) u_int c; { char buf[MAXKLEN * R_MAXKANA + 1]; VOID_C jis2str(buf, c); return(imeputs(buf)); } static int NEAR putjisbuf(jp) jisbuf *jp; { int n, len; if (!jp) return(0); for (n = len = 0; n < jp -> max; n++) len += jisputs(jp -> buf[n]); return(len); } static int NEAR countjisbuf(jp) jisbuf *jp; { char buf[MAXKLEN * R_MAXKANA + 1]; int n, len; if (!jp) return(0); for (n = len = 0; n < jp -> max; n++) { if (!(jp -> buf[n])) break; VOID_C jis2str(buf, jp -> buf[n]); len += strlen2(buf); } return(len); } static VOID NEAR addjisbuf(jp, c) jisbuf *jp; u_int c; { if (!(jp -> buf) || jp -> max + 1 >= jp -> size) { jp -> size += BUFUNIT; jp -> buf = (u_short *)Xrealloc(jp -> buf, jp -> size * sizeof(u_short)); } jp -> buf[(jp -> max)++] = c; } static VOID NEAR copyjisbuf(jp, kbuf, max) jisbuf *jp; CONST u_short *kbuf; int max; { int i; jp -> max = 0; if (max < 0) for (i = 0; kbuf[i]; i++) addjisbuf(jp, kbuf[i]); else for (i = 0; i < max; i++) addjisbuf(jp, kbuf[i]); } static u_int NEAR zen2han(c) u_int c; { u_int n; switch (c & 0xff00) { case 0x2100: if ((n = hanlist2[(u_char)c])) c = n; break; case 0x2300: c &= 0xff; break; case 0x2400: case 0x2500: if ((n = hanlist[(u_char)c])) { if (!(n & 0xff)) n >>= 8; c = n; } break; default: break; } return(c); } static u_int NEAR kanabias(c) u_int c; { if (c) switch (kanamode) { case KN_KATA: if ((c & 0xff00) == 0x2400) c = (0x2500 | (c & 0xff)); break; case KN_HAN: case KN_DIRECT: c = zen2han(c); break; default: break; } return(c); } static int NEAR romanprompt(plen, llenp) int plen, *llenp; { CONST char *cp; int llen; if (plen) (*ime_locate)(plen, ime_line); else { (*ime_locate)(0, ime_line); switch (kanamode) { case KN_HIRA: cp = IMERM_K; break; case KN_KATA: cp = IMEKT_K; break; case KN_HAN: cp = IMEHN_K; break; default: cp = IMEDI_K; break; } plen = imeputs(cp); } if (isvalidbuf(kjisbuf)) llen = putjisbuf(&kjisbuf); else if (isvalidbuf(rjisbuf)) { Xputterm(T_STANDOUT); llen = putjisbuf(&rjisbuf); Xputterm(END_STANDOUT); } else llen = 0; Xputterm(L_CLEAR); Xtflush(); if (llenp) *llenp = llen; return(plen); } static int NEAR fixroman(ptr, min, max) int ptr, min, max; { u_int n, c; int i; if (min + 1 >= max || !ptr) return(-1); for (i = 0; i < ptr; i++) { c = romanlist[min + 1].str[i]; if (c == 'n' && ptr == 1) c = J_NN; else if ((n = jislist[(u_char)c])) c = n; addjisbuf(&rjisbuf, kanabias(c)); } return(0); } static int NEAR findroman(c, ptr, minp, maxp) int c, ptr, *minp, *maxp; { int n, min, max; min = *minp; max = *maxp; for (;;) { n = (min + max) / 2; if (n <= min || n >= max) return(-1); if (ptr >= romanlist[n].len) min = n; else if (c > romanlist[n].str[ptr]) min = n; else if (c < romanlist[n].str[ptr]) max = n; else break; } for (min = n - 1; min > *minp; min--) { if (ptr >= romanlist[min].len) break; if (c != romanlist[min].str[ptr]) break; } for (max = n + 1; max < *maxp; max++) { if (ptr >= romanlist[max].len) break; if (c != romanlist[max].str[ptr]) break; } *minp = min; *maxp = max; return(min + 1); } static int NEAR unlimitroman(ptr, llenp, minp, maxp) int ptr, *llenp, *minp, *maxp; { int i, n, c, min, max; min = -1; max = maxromanlist; if (ptr) { if (--ptr) { min = *minp; max = *maxp; i = ptr - 1; if ((n = min + 1) >= max || i >= romanlist[n].len) return(-1); c = romanlist[n].str[i]; for (; min >= 0; min--) { if (i >= romanlist[min].len) break; if (c != romanlist[min].str[i]) break; } for (; max < maxromanlist; max++) { if (i >= romanlist[max].len) break; if (c != romanlist[max].str[i]) break; } } } else if (isvalidbuf(kjisbuf)) { kjisbuf.max = 0; VOID_C romanprompt(0, llenp); } else if (isvalidbuf(rjisbuf)) { (rjisbuf.max)--; *llenp = countjisbuf(&rjisbuf); } else ptr = -2; *minp = min; *maxp = max; return(ptr); } static u_int NEAR getjisindex(jp) jisbuf *jp; { u_int c; c = jp -> buf[0]; if (!(c & ~0xff)) { if (!(c = jislist[(u_char)c])) return(c); } else if ((c & 0x8080) == 0x8080) { if (!(c = jislist[(u_char)(c >> 8)])) return(c); } if ((c & 0xff00) == 0x2400 || (c & 0xff00) == 0x2500) if (jisindex[(u_char)c]) c = jisindex[(u_char)c]; return(c); } static u_int NEAR getjiscode(typep, jp) int *typep; jisbuf *jp; { char buf[MAXKLEN + 1]; u_int n, c; u_short w; int i; if (jp -> max != 1 + JIS_DIGIT) return((u_int)0); *typep = jp -> buf[0] - 0x2300; n = (u_int)0; for (i = 1; i <= JIS_DIGIT; i++) { if ((c = zen2han(jp -> buf[i])) & ~0xff) return((u_int)0); c = Xtolower(c); if (Xisdigit(c)) c -= '0'; else if (Xisxdigit(c)) c -= 'a' - 10; else return((u_int)0); n = (n << 4) + c; } if (!(n = getdefcode(n, *typep, 0))) return((u_int)0); VOID_C code2kanji(buf, n); VOID_C str2jis(&w, 1, buf); return(w); } static VOID NEAR dispjiscode(c, type) u_int c; int type; { CONST char *cp; char buf[MAXUTF8LEN + 1], tmp[MAXKLEN * R_MAXKANA + 1]; cp = NULL; kanjierrno = 0; switch (type) { case 'J': break; case 'E': c |= 0x8080; break; case 'S': VOID_C jis2str(tmp, c); cp = kanjiconv2(buf, tmp, MAXKLEN, DEFCODE, SJIS, L_INPUT); break; case 'K': VOID_C code2kanji(buf, c - 0x2020); buf[0] = (((buf[0] / 10) << 4) | (buf[0] % 10)); buf[1] = (((buf[1] / 10) << 4) | (buf[1] % 10)); cp = buf; break; #ifdef DEP_UNICODE case 'U': VOID_C jis2str(tmp, c); cp = kanjiconv2(buf, tmp, MAXUTF8LEN, DEFCODE, UTF8, L_INPUT); c = ucs2fromutf8((u_char *)cp, NULL); cp = NULL; break; #endif default: kanjierrno++; break; } if (cp) c = (((u_char)(cp[0]) << 8) | (u_char)(cp[1])); if (kanjierrno) VOID_C imeprintf("[%c????]:", type); else VOID_C imeprintf("[%c%0*X]:", type, JIS_DIGIT, c); kanjierrno = 0; } static VOID NEAR imeputcursor(xpos, n, isstandout) int xpos, n, isstandout; { (*ime_locate)(xpos, ime_line); n += (n < 10) ? '0' : 'A' - 10; imeputch(n, isstandout); #ifdef DEP_PTY if (ptylist[win].pid) /*EMPTY*/; else #endif (*ime_locate)(imewin_x, imewin_y); Xtflush(); } static int NEAR listkanji(plen, argc, argv, minp, maxp, prevp, xpos) int plen; long argc; u_short **argv; long *minp, *maxp, *prevp; int xpos[]; { char buf[MAXKLEN * R_MAXKANA + 1]; long n, min, max, prev; int i, x, col, len; if (plen) (*ime_locate)(plen, ime_line); else { (*ime_locate)(0, ime_line); plen = imeputs(IMEKJ_K); } Xputterm(L_CLEAR); col = 0; x = plen + 1; min = 0L; prev = -1L; for (n = 0L; argv[n]; n++) { for (i = len = 0; argv[n][i]; i++) { VOID_C jis2str(buf, argv[n][i]); len += strlen2(buf); } if (col >= KNJ_COLUMN || x + 2 + len > n_lastcolumn) { if (argc >= min && argc < n) break; col = 0; x = plen + 1; prev = min; min = n; } xpos[col++] = x; x += 2 + len + 1; } max = n; if (min >= max) return(-1); col = 0; for (n = min; n < max; n++) { (*ime_locate)(xpos[col], ime_line); VOID_C imeprintf("%1X.", col++); for (i = 0; argv[n][i]; i++) jisputs(argv[n][i]); } Xtflush(); if (minp) *minp = min; if (maxp) *maxp = max; if (prevp) *prevp = prev; return(plen); } static int NEAR selectkanji(argcp, argv, sig) long *argcp; u_short **argv; int sig; { long n, argc, old, min, max, prev; int ch, plen, last, xpos[KNJ_COLUMN]; argc = *argcp; plen = listkanji(0, argc, argv, &min, &max, &prev, xpos); if (plen < 0) return(-1); last = '\0'; do { imeputcursor(xpos[argc - min], argc - min, 1); if ((ch = getkey3(sig, inputkcode, 0)) < 0) break; old = argc; switch (ch) { case ' ': case K_RIGHT: n = argc + 1L; if (argv[n]) /*EMPTY*/; else if (ch == ' ') n = 0L; else { Xputterm(T_BELL); Xtflush(); break; } argc = n; break; case K_BS: case K_LEFT: n = argc - 1L; if (n >= 0L) /*EMPTY*/; else if (ch == K_BS) { ch = K_ESC; break; } else { Xputterm(T_BELL); Xtflush(); break; } argc = n; break; case K_UP: n = prev; if (n < 0L) { Xputterm(T_BELL); Xtflush(); break; } argc -= min; VOID_C listkanji(plen, n, argv, &min, &max, &prev, xpos); while (n + 1 < max && argc-- > 0L) n++; old = argc = n; break; case K_DOWN: n = max; if (!(argv[n])) { Xputterm(T_BELL); Xtflush(); break; } argc -= min; VOID_C listkanji(plen, n, argv, &min, &max, &prev, xpos); while (n + 1 < max && argc-- > 0L) n++; old = argc = n; break; case K_CTRL('L'): plen = listkanji(0, argc, argv, &min, &max, &prev, xpos); if (plen < 0) return(-1); break; default: if (ch >= K_MIN) break; if (Xisdigit(ch)) ch -= '0'; else if (Xisupper(ch) && Xisxdigit(ch)) ch -= 'A' - 10; else { if (!(ch & ~0xff) && Xisprint(ch)) { last = ch; ch = K_CR; } break; } if (min + ch >= max) { Xputterm(T_BELL); Xtflush(); break; } argc = min + ch; ch = K_CR; break; } if (argc == old) continue; else if (argc >= min && argc < max) imeputcursor(xpos[old - min], old - min, 0); else VOID_C listkanji(plen, argc, argv, &min, &max, &prev, xpos); } while (ch != K_ESC && ch != K_CR); kjisbuf.max = 0; if (ch == K_CR) copyjisbuf(&kjisbuf, argv[argc], -1); *argcp = argc; return(last); } static int NEAR listjis(plen, c, colp, type) int plen; u_int c; int *colp, type; { u_int start; int i, col; if (plen) (*ime_locate)(plen, ime_line); else { (*ime_locate)(0, ime_line); plen = imeputs(IMEJS_K); } Xputterm(L_CLEAR); for (col = 16; col > 1; col /= 2) if (jis_xpos(plen, col) <= n_lastcolumn) break; if (!col) return(-1); (*ime_locate)(plen, ime_line); dispjiscode(c, type); start = (c / col) * col; for (i = 0; i < col; i++, start++) { if (!VALIDJIS(start)) continue; (*ime_locate)(jis_xpos(plen, i), ime_line); VOID_C imeprintf("%1X.", i); jisputs(start); } Xtflush(); if (colp) *colp = col; return(plen); } static int NEAR selectjis(c, sig, type) u_int c; int sig, type; { u_int i, n, old; int ch, plen, last, col; if ((plen = listjis(0, c, &col, type)) < 0) return(-1); last = '\0'; do { (*ime_locate)(plen, ime_line); dispjiscode(c, type); imeputcursor(jis_xpos(plen, c % col), c % col, 1); if ((ch = getkey3(sig, inputkcode, 0)) < 0) break; old = c; switch (ch) { case ' ': case K_RIGHT: for (n = c + 1; n <= J_MAX; n++) if (VALIDJIS(n)) break; if (n <= J_MAX) /*EMPTY*/; else if (ch == ' ') n = J_MIN; else { Xputterm(T_BELL); Xtflush(); break; } c = n; break; case K_BS: case K_LEFT: for (n = c - 1; n >= J_MIN; n--) if (VALIDJIS(n)) break; if (n >= J_MIN) /*EMPTY*/; else if (ch == K_BS) { ch = K_ESC; break; } else { Xputterm(T_BELL); Xtflush(); break; } c = n; break; case K_UP: for (n = c - col; n >= J_MIN; n -= col) { if ((n & 0xff) < 0x20) { n -= 0x100; n &= 0xff0f; n |= 0x0070; } if (VALIDJIS(n)) break; for (i = n + 1; i % col; i++) if (VALIDJIS(i)) break; if (i % col) { n = i; break; } for (i = n - 1; (i + 1) % col; i--) if (VALIDJIS(i)) break; if (i % col) { n = i; break; } } if (n < J_MIN) { Xputterm(T_BELL); Xtflush(); break; } c = n; break; case K_DOWN: for (n = c + col; n <= J_MAX; n += col) { if ((n & 0xff) > 0x7f) { n += 0x100; n &= 0xff0f; n |= 0x0020; } if (VALIDJIS(n)) break; for (i = n + 1; i % col; i++) if (VALIDJIS(i)) break; if (i % col) { n = i; break; } for (i = n - 1; (i + 1) % col; i--) if (VALIDJIS(i)) break; if (i % col) { n = i; break; } } if (n > J_MAX) { Xputterm(T_BELL); Xtflush(); break; } c = n; break; case K_CTRL('L'): if ((plen = listjis(0, c, &col, type)) < 0) ch = K_ESC; break; default: if (ch >= K_MIN) break; if (Xisdigit(ch)) ch -= '0'; else if (Xisupper(ch) && Xisxdigit(ch)) ch -= 'A' - 10; else { if (!(ch & ~0xff) && Xisprint(ch)) { last = ch; ch = K_CR; } break; } if (ch >= col) ch = 0; else { ch += (c / col) * col; if (!VALIDJIS(ch)) ch = 0; } if (!ch) { Xputterm(T_BELL); Xtflush(); break; } c = ch; ch = K_CR; break; } if (c == old) continue; else if (c / col == old / col) imeputcursor(jis_xpos(plen, old % col), old % col, 0); else VOID_C listjis(plen, c, NULL, type); } while (ch != K_ESC && ch != K_CR); kjisbuf.max = 0; if (ch == K_CR) addjisbuf(&kjisbuf, c); return(last); } static int NEAR searchkanji(argcp, argvp, ptr, min, max, lastp, sig) long *argcp; u_short ***argvp; int ptr, min, max, *lastp, sig; { u_short *kbuf, **argv; long argc; u_int c; int i, n, type; argc = *argcp; argv = *argvp; if (isvalidbuf(kjisbuf)) { n = 1; if (!argv) { if (!(c = getjisindex(&kjisbuf)) || (i = selectjis(c, sig, 'J')) < 0) n = -1; else if (i > 0) *lastp = i; } else if (*argv) { if ((i = selectkanji(&argc, argv, sig)) < 0) n = -1; else if (i > 0) *lastp = i; } } else if (fixroman(ptr, min, max) < 0 && !isvalidbuf(rjisbuf)) n = 0; else { freekanjilist(argv); argc = 0L; n = 1; if ((c = getjiscode(&type, &rjisbuf))) { if ((i = selectjis(c, sig, type)) < 0) n = -1; else if (i > 0) *lastp = i; } else { kbuf = (u_short *)Xmalloc((rjisbuf.max + 1) * sizeof(u_short)); for (i = 0; i < rjisbuf.max; i++) { c = rjisbuf.buf[i]; if (!(c & ~0xff) && !(c = jislist[(u_char)c])) c = rjisbuf.buf[i]; if ((c & 0xff00) == 0x2500 && jisindex[(u_char)c]) c = (0x2400 | (c & 0xff)); kbuf[i] = c; } kbuf[rjisbuf.max] = 0; if ((argv = searchdict(kbuf, rjisbuf.max))) { copyjisbuf(&kjisbuf, argv[argc], -1); Xfree(kbuf); } else { copyjisbuf(&kjisbuf, rjisbuf.buf, rjisbuf.max); argv = (u_short **) Xmalloc(2 * sizeof(short *)); argv[0] = kbuf; argv[1] = NULL; } } } *argcp = argc; *argvp = argv; return(n); } static int NEAR fixkanji(ptr, min, max, bias) int ptr, min, max, bias; { int i; if (isvalidbuf(kjisbuf)) return(-1); else if (fixroman(ptr, min, max) < 0 && !isvalidbuf(rjisbuf)) return(-2); if (!bias || kanamode == KN_DIRECT) { copyjisbuf(&kjisbuf, rjisbuf.buf, rjisbuf.max); if (bias) return(-1); } else for (i = 0; i < rjisbuf.max; i++) rjisbuf.buf[i] = kanabias(rjisbuf.buf[i]); return(0); } static int NEAR inputkanji(sig) int sig; { static int last = '\0'; u_short **argv; long argc; u_int w; int i, n, c, min, max, ptr, plen, llen, cont; subwindow++; min = -1; max = maxromanlist; c = '\0'; ptr = 0; argc = 0L; argv = NULL; ime_cont = 1; plen = romanprompt(0, &llen); for (;;) { if (c != ' ') { freekanjilist(argv); argc = 0L; argv = NULL; } if (last) { c = last; last = '\0'; } else { (*ime_locate)(plen + llen + ptr, ime_line); imeputch(' ', 1); #ifdef DEP_PTY if (ptylist[win].pid) /*EMPTY*/; else #endif (*ime_locate)(imewin_x, imewin_y); Xtflush(); if ((c = getkey3(sig, inputkcode, 0)) < 0) break; else if (c == imekey) { ime_cont = kjisbuf.max = 0; c = K_ESC; break; } cont = 0; switch (c) { case K_BS: case K_DC: cont = 1; n = unlimitroman(ptr, &llen, &min, &max); if (n < 0) { if (n < -1) cont = -1; break; } ptr = n; (*ime_locate)(plen + llen + ptr, ime_line); Xputterm(L_CLEAR); Xtflush(); break; case ' ': cont = 1; n = searchkanji(&argc, &argv, ptr, min, max, &last, sig); if (n < 0) { Xputterm(T_BELL); Xtflush(); break; } else if (!n) { cont = -1; if (!(w = jislist[(u_char)c])) break; w = kanabias(w); addjisbuf(&kjisbuf, w); c = '\0'; } else if (last) { cont = -1; c = '\0'; break; } ptr = 0; min = -1; max = maxromanlist; VOID_C romanprompt(0, &llen); Xtflush(); break; case '\t': if (++kanamode >= KN_MAX) kanamode = KN_HIRA; n = fixkanji(ptr, min, max, 1); if (n == -1) { cont = -1; c = '\0'; break; } /*FALLTHRU*/ case K_CTRL('L'): cont = 1; plen = romanprompt(0, &llen); if (min + 1 >= max || !ptr) break; Xputterm(T_STANDOUT); VOID_C imeprintf("%.*s", ptr, romanlist[min + 1].str); Xputterm(END_STANDOUT); Xtflush(); break; case K_ESC: cont = 1; if (!isvalidbuf(kjisbuf)) { cont = -1; ime_cont = 0; break; } kjisbuf.max = 0; ptr = 0; min = -1; max = maxromanlist; VOID_C romanprompt(plen, &llen); Xtflush(); break; case K_CR: cont = 1; n = fixkanji(ptr, min, max, 0); if (n < 0) { cont = -1; if (n >= -1) c = '\0'; break; } ptr = 0; min = -1; max = maxromanlist; VOID_C romanprompt(plen, &llen); Xtflush(); break; default: break; } if (cont < 0) break; else if (cont > 0) continue; else if (!(c & ~0xff) && Xisprint(c)) /*EMPTY*/; else if (!ptr && !isvalidbuf(kjisbuf) && !isvalidbuf(rjisbuf)) break; else { Xputterm(T_BELL); Xtflush(); continue; } } if (kanamode == KN_DIRECT) break; else if (isvalidbuf(kjisbuf)) { last = c; c = '\0'; break; } (*ime_locate)(plen + llen + ptr, ime_line); imeputch(c, 1); Xtflush(); if ((n = findroman(c, ptr, &min, &max)) < 0) { w = (ptr == 1 && min + 1 < max) ? romanlist[min + 1].str[0] : (u_int)0; if (w == 'n') w = J_NN; else if (w == (u_int)c) w = J_TSU; else if (ptr || !(w = jislist[(u_char)c])) w = (u_int)0; else c = '\0'; if (w) { w = kanabias(w); addjisbuf(&rjisbuf, w); (*ime_locate)(plen + llen, ime_line); Xputterm(T_STANDOUT); llen += jisputs(w); Xputterm(END_STANDOUT); if (c) imeputch(c, 1); last = c; ptr = 0; min = -1; max = maxromanlist; continue; } Xputterm(T_BELL); Xtflush(); } else if (ptr + 1 < romanlist[n].len) ptr++; else { (*ime_locate)(plen + llen, ime_line); Xputterm(T_STANDOUT); for (i = 0; i < R_MAXKANA; i++) { if (!(w = romanlist[n].code[i])) break; w = kanabias(w); addjisbuf(&rjisbuf, w); llen += jisputs(w); } Xputterm(END_STANDOUT); ptr = 0; min = -1; max = maxromanlist; } } if (argv && !c && isvalidbuf(rjisbuf) && isvalidbuf(kjisbuf)) saveuserfreq(rjisbuf.buf, argv[argc]); subwindow--; freekanjilist(argv); return(c); } static int NEAR getkanjibuf(buf, c) char *buf; u_int c; { char tmp[MAXKLEN * R_MAXKANA + 1]; VOID_C jis2str(tmp, c); return(inkanjiconv(buf, tmp)); } int ime_inputkanji(sig, buf) int sig; char *buf; { u_int w; int c; if (!buf) { ime_cont = kjisbuf.max = 0; VOID_C searchdict(NULL, -1); return(0); } initroman(); c = -1; if (!ime_cont) { keyflush(); kanamode = KN_HIRA; kjisbuf.max = 0; } else if (isvalidbuf(kjisbuf)) { memmove((char *)(kjisbuf.buf), (char *)&(kjisbuf.buf[1]), (kjisbuf.max)-- * sizeof(u_short)); if (!(w = kjisbuf.buf[0]) || (c = getkanjibuf(buf, w)) < 0) { kjisbuf.max = 0; c = -1; } } rjisbuf.max = 0; if (c < 0) { if (!ime_line) ime_line = L_MESLINE; if (!ime_locate) ime_locate = Xlocate; imewin_x = win_x; imewin_y = win_y; for (;;) { if ((c = inputkanji(sig))) break; else if (!isvalidbuf(kjisbuf)) { *buf = '\0'; break; } else if ((c = getkanjibuf(buf, kjisbuf.buf[0])) >= 0) { (kjisbuf.max)--; break; } } win_x = imewin_x; win_y = imewin_y; #ifdef DEP_PTY if (ptylist[win].pid) /*EMPTY*/; else #endif (*ime_locate)(win_x, win_y); } ime_line = 0; ime_xposp = NULL; ime_locate = NULL; if (!ime_cont) VOID_C searchdict(NULL, -1); return(c); } # ifdef DEBUG VOID ime_freebuf(VOID_A) { kjisbuf.max = 0; Xfree(kjisbuf.buf); kjisbuf.buf = NULL; rjisbuf.max = 0; Xfree(rjisbuf.buf); rjisbuf.buf = NULL; } # endif /* DEBUG */ #endif /* DEP_IME */ FD-3.01j/dict.c100644 2105 1751 73100 13516612560 11771 0ustar shiraiuser/* * dict.c * * dictionary accessing module */ #include "fd.h" #include "termio.h" #include "roman.h" #include "hinsi.h" #include "func.h" #if FD >= 3 #include "parse.h" #include "kconv.h" #endif #define DICTTBL "fd-dict.tbl" #define MAXHINSI 16 #define FREQMAGIC 0x4446 #define FREQVERSION 0x0100 #define dictoffset(n) ((off_t)4 + (off_t)(n) * 4) #define freqoffset(n) ((off_t)2 + 2 + 4 + (off_t)(n) * 4) #define getword(s, n) (((u_short)((s)[(n) + 1]) << 8) | (s)[n]) #define getdword(s, n) (((u_long)getword(s, (n) + 2) << 16) \ | getword(s, n)) #define skread(f, o, s, n) (Xlseek(f, o, L_SET) >= (off_t)0 \ && sureread(f, s, n) == n) typedef struct _jisbuf { u_short *buf; u_char max; } jisbuf; typedef struct _kanjitable { jisbuf k; u_char len; u_char match; u_char kmatch; u_short freq; u_short hinsi[MAXHINSI]; long ofs; } kanjitable; typedef struct _freq_t { jisbuf kana; jisbuf kanji; u_short freq; } freq_t; #ifdef DEP_IME static off_t NEAR dictlseek __P_((int, off_t, int)); static int NEAR fgetbyte __P_((u_char *, int)); static int NEAR fgetword __P_((u_short *, int)); static int NEAR fgetdword __P_((long *, int)); static int NEAR fgetstring __P_((jisbuf *, int)); # ifndef DEP_EMBEDDICTTBL static off_t NEAR fgetoffset __P_((long, int)); # endif static int NEAR fgetjisbuf __P_((jisbuf *, long, int)); static int NEAR fgethinsi __P_((u_short [], int)); static int NEAR fseekfreq __P_((long, int)); static int NEAR fgetfreqbuf __P_((freq_t *, int)); static int NEAR fputfreqbuf __P_((freq_t *, int)); static int NEAR _fchkhinsi __P_((int, CONST u_short [], int)); static int NEAR fchkhinsi __P_((u_short [], CONST u_short [], u_short [], CONST u_short [], int)); # ifndef DEP_EMBEDDICTTBL static int NEAR opendicttbl __P_((CONST char *)); static u_char *NEAR gendicttbl __P_((int, off_t, ALLOC_T, int)); static VOID NEAR readdicttable __P_((int)); # endif static int NEAR fputbyte __P_((int, int)); static int NEAR fputword __P_((u_int, int)); static int NEAR fputdword __P_((long, int)); static int NEAR fputstring __P_((CONST jisbuf *, int)); static lockbuf_t *NEAR openfreqtbl __P_((CONST char *, int)); static int NEAR findfreq __P_((freq_t *, long *)); static int NEAR copyfreq __P_((int, int)); static int NEAR copyuserfreq __P_((freq_t *, int, int)); static int NEAR adduserfreq __P_((CONST char *, freq_t *)); static int NEAR cmpjis __P_((CONST jisbuf *, CONST jisbuf *)); static int cmpdict __P_((CONST VOID_P, CONST VOID_P)); static int cmpfreq __P_((CONST VOID_P, CONST VOID_P)); static long NEAR addkanji __P_((long, kanjitable **, CONST kanjitable *)); static VOID NEAR freekanji __P_((kanjitable *)); static int NEAR fgetdict __P_((kanjitable *, CONST kanjitable *, int)); static long NEAR addkanjilist __P_((long, kanjitable **, long, kanjitable *, kanjitable *, int)); static off_t NEAR nextofs __P_((off_t, int)); static int NEAR finddict __P_((jisbuf *, int, long *)); static long NEAR _searchdict __P_((long, kanjitable **, kanjitable *, int)); static long NEAR uniqkanji __P_((long, kanjitable *)); # if FD >= 3 static VOID NEAR fgetjis __P_((jisbuf *, XFILE *)); static CONST char *parsejis __P_((jisbuf *, CONST char *)); # endif char *dicttblpath = NULL; int imebuffer = 0; short frequmask = (short)0; # if FD >= 3 char *freqfile = NULL; short imelearning = 0; # else # define imelearning IMELEARNING # endif static kanjitable *kanjilist = NULL; static long freqtblent = 0L; static off_t dictofs = (off_t)0; # ifdef DEP_EMBEDDICTTBL extern CONST u_char dictindexbuf[]; extern CONST u_char dicttblbuf[]; extern CONST u_char hinsiindexbuf[]; extern CONST u_char hinsitblbuf[]; extern long dicttblent; extern int hinsitblent; # else static u_char *dictindexbuf = NULL; static u_char *dicttblbuf = NULL; static u_char *hinsiindexbuf = NULL; static u_char *hinsitblbuf = NULL; static long dicttblent = 0L; static int hinsitblent = 0; static off_t hinsitblofs = (off_t)0; # endif static off_t NEAR dictlseek(fd, ofs, whence) int fd; off_t ofs; int whence; { if (fd >= 0) return(Xlseek(fd, ofs, whence)); switch (whence) { case L_SET: dictofs = ofs; break; case L_INCR: dictofs += ofs; break; default: break; } return(dictofs); } static int NEAR fgetbyte(cp, fd) u_char *cp; int fd; { if (fd >= 0) { if ((sureread(fd, cp, 1) != 1)) return(-1); } else *cp = dicttblbuf[dictofs++]; return(0); } static int NEAR fgetword(wp, fd) u_short *wp; int fd; { CONST u_char *cp; u_char buf[2]; if (fd >= 0) { if (sureread(fd, buf, sizeof(buf)) != sizeof(buf)) return(-1); cp = buf; } else { cp = &(dicttblbuf[dictofs]); dictofs += 2; } *wp = getword(cp, 0); return(0); } static int NEAR fgetdword(lp, fd) long *lp; int fd; { u_char buf[4]; if (sureread(fd, buf, sizeof(buf)) != sizeof(buf)) return(-1); *lp = getdword(buf, 0); return(0); } static int NEAR fgetstring(jp, fd) jisbuf *jp; int fd; { u_short *kbuf; u_char c; int i; jp -> buf = NULL; if (fgetbyte(&c, fd) < 0) return(-1); jp -> max = c; kbuf = (u_short *)Xmalloc(((int)c + 1) * sizeof(u_short)); for (i = 0; i < (int)c; i++) if (fgetword(&(kbuf[i]), fd) < 0) { Xfree(kbuf); return(-1); } kbuf[i] = (u_short)0; jp -> buf = kbuf; return(0); } # ifndef DEP_EMBEDDICTTBL static off_t NEAR fgetoffset(n, fd) long n; int fd; { u_char buf[4]; off_t ofs; ofs = dictoffset(n); if (!skread(fd, ofs, buf, sizeof(buf))) return((off_t)-1); ofs = dictoffset(dicttblent + 1) + getdword(buf, 0); return(ofs); } # endif /* !DEP_EMBEDDICTTBL */ static int NEAR fgetjisbuf(jp, n, fd) jisbuf *jp; long n; int fd; { # ifndef DEP_EMBEDDICTTBL u_char buf[4]; # endif CONST u_char *cp; off_t ofs; ofs = (off_t)n * 4; # ifndef DEP_EMBEDDICTTBL if (!dictindexbuf) { ofs += (off_t)4; if (!skread(fd, ofs, buf, sizeof(buf))) return((off_t)-1); cp = buf; } else # endif cp = &(dictindexbuf[ofs]); ofs = getdword(cp, 0); # ifndef DEP_EMBEDDICTTBL if (!dicttblbuf) ofs += dictoffset(dicttblent + 1); # endif if (dictlseek(fd, ofs, L_SET) < (off_t)0) return(-1); return(fgetstring(jp, fd)); } static int NEAR fgethinsi(hinsi, fd) u_short hinsi[MAXHINSI]; int fd; { u_char c; int i, n; if (hinsitblent <= 0) n = 0; else { if (fgetbyte(&c, fd) < 0) return(-1); if ((n = c) > MAXHINSI) n = MAXHINSI; for (i = 0; i < n; i++) if (fgetword(&(hinsi[i]), fd) < 0) return(-1); } if (n < MAXHINSI) hinsi[n] = MAXUTYPE(u_short); return(n); } static int NEAR fseekfreq(n, fd) long n; int fd; { off_t ofs; long l; ofs = freqoffset(n); if (Xlseek(fd, ofs, L_SET) < (off_t)0 || fgetdword(&l, fd) < 0) return(-1); ofs = freqoffset(freqtblent + 1) + l; if (Xlseek(fd, ofs, L_SET) < (off_t)0) return(-1); return(0); } static int NEAR fgetfreqbuf(frp, fd) freq_t *frp; int fd; { if (fgetstring(&(frp -> kana), fd) < 0) return(-1); if (fgetstring(&(frp -> kanji), fd) < 0) { Xfree(frp -> kana.buf); return(-1); } if (fgetword(&(frp -> freq), fd) < 0) { Xfree(frp -> kana.buf); Xfree(frp -> kanji.buf); return(-1); } return(0); } static int NEAR fputfreqbuf(frp, fd) freq_t *frp; int fd; { if (fputstring(&(frp -> kana), fd) < 0) return(-1); if (fputstring(&(frp -> kanji), fd) < 0) return(-1); if (fputword(frp -> freq, fd) < 0) return(-1); return(0); } static int NEAR _fchkhinsi(id, hinsi, fd) int id; CONST u_short hinsi[MAXHINSI]; int fd; { # ifndef DEP_EMBEDDICTTBL u_char buf[2]; # endif CONST u_char *cp; u_char *hbuf; off_t ofs; u_short w; int i, j, len; if (hinsitblent <= 0) return(0); if (id >= hinsitblent) return(MAXUTYPE(u_short)); ofs = (off_t)id * 2; # ifndef DEP_EMBEDDICTTBL if (!hinsiindexbuf) { ofs += hinsitblofs + 2; if (!skread(fd, ofs, buf, sizeof(buf))) return(-1); ofs = getword(buf, 0); } else # endif ofs = getword(hinsiindexbuf, ofs); # ifndef DEP_EMBEDDICTTBL if (!hinsitblbuf) { ofs += hinsitblofs + (off_t)(hinsitblent + 1) * 2 + 2; if (!skread(fd, ofs, buf, 2)) return(-1); if ((len = getword(buf, 0)) <= 0) return(MAXUTYPE(u_short)); cp = hbuf = (u_char *)Xmalloc(len * 2); if (sureread(fd, hbuf, len * 2) != len * 2) { Xfree(hbuf); return(-1); } } else # endif { cp = &(hinsitblbuf[ofs]); len = getword(cp, 0); cp += 2; hbuf = NULL; } for (i = 0; i < len; i++, cp += 2) { w = getword(cp, 0); for (j = 0; j < MAXHINSI; j++) { if (hinsi[j] == MAXUTYPE(u_short)) break; if (hinsi[j] == w) { Xfree(hbuf); return(j); } } } Xfree(hbuf); return(MAXUTYPE(u_short)); } static int NEAR fchkhinsi(fdest, fsrc, bdest, bsrc, fd) u_short fdest[MAXHINSI]; CONST u_short fsrc[MAXHINSI]; u_short bdest[MAXHINSI]; CONST u_short bsrc[MAXHINSI]; int fd; { u_short fhit[MAXHINSI], bhit[MAXHINSI]; int i, j, n; if (hinsitblent <= 0 || fsrc[0] == MAXUTYPE(u_short)) { if (fdest) memcpy((char *)fdest, (char *)fsrc, sizeof(fhit)); if (bdest) memcpy((char *)bdest, (char *)bsrc, sizeof(bhit)); return(0); } for (i = 0; i < MAXHINSI; i++) fhit[i] = bhit[i] = MAXUTYPE(u_short); for (i = j = 0; i < MAXHINSI; i++) { if (bsrc[i] == MAXUTYPE(u_short)) break; n = _fchkhinsi(bsrc[i], fsrc, fd); if (n < 0) return(-1); if (n < MAXUTYPE(u_short)) { fhit[n] = fsrc[n]; bhit[i] = bsrc[i]; j++; } } if (!j) return(-1); if (fdest) { for (i = j = 0; i < MAXHINSI; i++) if (fhit[i] < MAXUTYPE(u_short)) fdest[j++] = fhit[i]; if (j < MAXHINSI) fdest[j] = MAXUTYPE(u_short); } if (bdest) { for (i = j = 0; i < MAXHINSI; i++) if (bhit[i] < MAXUTYPE(u_short)) bdest[j++] = bhit[i]; if (j < MAXHINSI) bdest[j] = MAXUTYPE(u_short); } return(0); } # ifndef DEP_EMBEDDICTTBL static int NEAR opendicttbl(file) CONST char *file; { static int fd = -2; u_char buf[2]; char path[MAXPATHLEN]; if (!file) { if (fd >= 0) VOID_C Xclose(fd); fd = -2; return(0); } if (fd >= -1) return(fd); if (!dicttblpath || !*dicttblpath) Xstrcpy(path, file); else strcatdelim2(path, dicttblpath, file); if ((fd = Xopen(path, O_BINARY | O_RDONLY, 0666)) < 0) fd = -1; else if (!dicttblent && fgetdword(&dicttblent, fd) < 0) { VOID_C Xclose(fd); fd = -1; } else if (!hinsitblofs && (hinsitblofs = fgetoffset(dicttblent, fd)) < (off_t)0) hinsitblent = -1; else if (!hinsitblent) { if (!skread(fd, hinsitblofs, buf, sizeof(buf))) hinsitblent = -1; else hinsitblent = getword(buf, 0); } return(fd); } static u_char *NEAR gendicttbl(fd, ofs, size, lvl) int fd; off_t ofs; ALLOC_T size; int lvl; { u_char *tbl; if (ofs != (off_t)-1 && Xlseek(fd, ofs, L_SET) < (off_t)0) return(NULL); if (!(tbl = (u_char *)malloc(size))) { imebuffer = lvl; return(NULL); } if (sureread(fd, tbl, size) != size) { Xfree(tbl); return(NULL); } return(tbl); } static VOID NEAR readdicttable(fd) int fd; { u_char *tbl, buf[2]; ALLOC_T size; off_t ofs; if (!hinsiindexbuf && hinsitblent > 0) { ofs = (off_t)hinsitblofs + 2; size = (ALLOC_T)hinsitblent * 2; if (!(tbl = gendicttbl(fd, ofs, size, 0))) return; hinsiindexbuf = tbl; } if (imebuffer < 1) return; if (!hinsitblbuf && hinsitblent > 0) { ofs = (off_t)hinsitblent * 2 + 2; if (!skread(fd, hinsitblofs + ofs, buf, sizeof(buf))) return; size = getword(buf, 0); if (!(tbl = gendicttbl(fd, (off_t)-1, size, 0))) return; hinsitblbuf = tbl; } if (imebuffer < 2) return; if (!dictindexbuf && dicttblent > 0) { ofs = (off_t)4; size = (ALLOC_T)dicttblent * 4; if (!(tbl = gendicttbl(fd, ofs, size, 1))) return; dictindexbuf = tbl; } if (imebuffer < 3) return; if (!dicttblbuf && dicttblent > 0) { ofs = dictoffset(dicttblent + 1); size = (ALLOC_T)hinsitblofs - ofs; if (!(tbl = gendicttbl(fd, ofs, size, 2))) return; dicttblbuf = tbl; } } # endif /* !DEP_EMBEDDICTTBL */ VOID discarddicttable(VOID_A) { # ifndef DEP_EMBEDDICTTBL Xfree(hinsiindexbuf); hinsiindexbuf = NULL; Xfree(hinsitblbuf); hinsitblbuf = NULL; Xfree(dictindexbuf); dictindexbuf = NULL; Xfree(dicttblbuf); dicttblbuf = NULL; # endif } static int NEAR fputbyte(c, fd) int c, fd; { u_char uc; uc = c; if (surewrite(fd, &uc, sizeof(uc)) < 0) return(-1); return(0); } static int NEAR fputword(w, fd) u_int w; int fd; { u_char buf[2]; buf[0] = (w & 0xff); buf[1] = ((w >> 8) & 0xff); if (surewrite(fd, buf, sizeof(buf)) < 0) return(-1); return(0); } static int NEAR fputdword(dw, fd) long dw; int fd; { u_char buf[4]; buf[0] = (dw & 0xff); buf[1] = ((dw >> 8) & 0xff); buf[2] = ((dw >> 16) & 0xff); buf[3] = ((dw >> 24) & 0xff); if (surewrite(fd, buf, sizeof(buf)) < 0) return(-1); return(0); } static int NEAR fputstring(jp, fd) CONST jisbuf *jp; int fd; { int i; if (fputbyte(jp -> max, fd) < 0) return(-1); for (i = 0; i < jp -> max; i++) if (fputword(jp -> buf[i], fd) < 0) return(-1); return(0); } static lockbuf_t *NEAR openfreqtbl(file, flags) CONST char *file; int flags; { static lockbuf_t *lck = NULL; u_short w; if (!file) { lockclose(lck); lck = NULL; return(NULL); } if (lck) return(lck); freqtblent = 0L; lck = lockopen(file, flags, 0666 & ~frequmask); if (!lck || lck -> fd < 0) /*EMPTY*/; else if (fgetword(&w, lck -> fd) < 0 || w != FREQMAGIC || fgetword(&w, lck -> fd) < 0 || w != FREQVERSION || fgetdword(&freqtblent, lck -> fd) < 0) { lockclose(lck); lck = NULL; } if (!lck) { lck = (lockbuf_t *)Xmalloc(sizeof(lockbuf_t)); lck -> fd = -1; lck -> fp = NULL; lck -> name = NULL; lck -> flags = LCK_INVALID; } return(lck); } static int NEAR findfreq(frp, ofsp) freq_t *frp; long *ofsp; { # if FD < 3 char *freqfile; # endif freq_t tmp; lockbuf_t *lck; long ofs, min, max; int n; if (ofsp) *ofsp = -1L; # if FD < 3 freqfile = evalpath(Xstrdup(FREQFILE), 0); # endif if (!freqfile || !*freqfile) return(0); lck = openfreqtbl(freqfile, O_BINARY | O_RDONLY); # if FD < 3 Xfree(freqfile); # endif if (lck -> fd < 0) return(0); min = -1L; max = freqtblent; for (;;) { ofs = (min + max) / 2; if (ofs <= min) { if (ofsp) *ofsp = min + 1; return(0); } else if (ofs >= max) { if (ofsp) *ofsp = max; return(0); } if (fseekfreq(ofs, lck -> fd) < 0) return(-1); if (fgetfreqbuf(&tmp, lck -> fd) < 0) return(-1); if (!(n = cmpjis(&(frp -> kana), &(tmp.kana)))) n = cmpjis(&(frp -> kanji), &(tmp.kanji)); Xfree(tmp.kana.buf); Xfree(tmp.kanji.buf); if (n > 0) min = ofs; else if (n < 0) max = ofs; else break; } if (ofsp) *ofsp = ofs; frp -> freq = tmp.freq; return(1); } static int NEAR copyfreq(fdin, fdout) int fdin, fdout; { freq_t tmp; int n; if (fgetfreqbuf(&tmp, fdin) < 0) return(-1); n = (fdout < 0) ? 0 : fputfreqbuf(&tmp, fdout); Xfree(tmp.kana.buf); Xfree(tmp.kanji.buf); return(n); } static int NEAR copyuserfreq(frp, fdin, fdout) freq_t *frp; int fdin, fdout; { ALLOC_T size; long l, tmp, ofs, index, ent, freq; int n, skip; size = (ALLOC_T)1 + (frp -> kana.max * 2) + 1 + (frp -> kanji.max * 2) + 2; skip = 0; if (fdin < 0) ent = ofs = 0L; else { freq = (long)(frp -> freq); ent = freqtblent; n = findfreq(frp, &ofs); if (n < 0) return(-1); else if (n) { skip++; freq += frp -> freq; if (freq > MAXUTYPE(u_short)) freq = MAXUTYPE(u_short); frp -> freq = freq; } if (Xlseek(fdin, freqoffset(1), L_SET) < (off_t)0) return(-1); } if (fputword(FREQMAGIC, fdout) < 0) return(-1); if (fputword(FREQVERSION, fdout) < 0) return(-1); if (fputdword(ent + 1 - skip, fdout) < 0) return(-1); index = 0L; if (fputdword(index, fdout) < 0) return(-1); for (l = 1L; l <= ofs; l++) { if (fgetdword(&index, fdin) < 0) return(-1); if (fputdword(index, fdout) < 0) return(-1); } if (fputdword(index + size, fdout) < 0) return(-1); if (skip) { if (fgetdword(&tmp, fdin) < 0) return(-1); size += (ALLOC_T)(index - tmp); l++; } for (; l <= ent; l++) { if (fgetdword(&index, fdin) < 0) return(-1); index += size; if (fputdword(index, fdout) < 0) return(-1); } for (l = 0; l < ofs; l++) if (copyfreq(fdin, fdout) < 0) return(-1); if (skip) { if (copyfreq(fdin, -1) < 0) return(-1); l++; } if (fputstring(&(frp -> kana), fdout) < 0) return(-1); if (fputstring(&(frp -> kanji), fdout) < 0) return(-1); if (fputword(frp -> freq, fdout) < 0) return(-1); for (; l < ent; l++) if (copyfreq(fdin, fdout) < 0) return(-1); return(0); } static int NEAR adduserfreq(file, frp) CONST char *file; freq_t *frp; { lockbuf_t *lck; char path[MAXPATHLEN]; int n, fdin, fdout; VOID_C openfreqtbl(NULL, 0); if (!(lck = openfreqtbl(file, O_BINARY | O_RDWR))) return(-1); Xstrcpy(path, file); if ((fdin = lck -> fd) >= 0) fdout = opentmpfile(path, 0666 & ~frequmask); else { VOID_C openfreqtbl(NULL, 0); lck = lockopen(path, O_BINARY | O_WRONLY | O_CREAT | O_EXCL, 0666 & ~frequmask); fdout = (lck) ? lck -> fd : -1; } if (fdout < 0) { VOID_C openfreqtbl(NULL, 0); if (fdin < 0) lockclose(lck); return(-1); } n = copyuserfreq(frp, fdin, fdout); if (fdin < 0) { # if !MSDOS && !defined (CYGWIN) if (n < 0) VOID_C Xunlink(path); lockclose(lck); # else lockclose(lck); if (n < 0) VOID_C Xunlink(path); # endif } else { # if !MSDOS && !defined (CYGWIN) if (n >= 0) n = Xrename(path, file); VOID_C openfreqtbl(NULL, 0); VOID_C Xclose(fdout); # else /* MSDOS || CYGWIN */ VOID_C openfreqtbl(NULL, 0); VOID_C Xclose(fdout); if (n >= 0) { # if MSDOS n = Xrename(path, file); # else while ((n = Xrename(path, file)) < 0) { if (errno != EACCES) break; usleep(100000L); } # endif } # endif /* MSDOS || CYGWIN */ if (n < 0) VOID_C Xunlink(path); } return(n); } VOID saveuserfreq(kana, kbuf) CONST u_short *kana, *kbuf; { # if FD < 3 char *freqfile; # endif freq_t tmp; long argc; if (!kanjilist) return; for (argc = 0L; kanjilist[argc].k.buf; argc++) if (kbuf == kanjilist[argc].k.buf) break; if (!kanjilist[argc].k.buf) return; tmp.kana.buf = (u_short *)kana; tmp.kana.max = kanjilist[argc].match; tmp.kanji.buf = (u_short *)kbuf; tmp.kanji.max = kanjilist[argc].kmatch; tmp.freq = (u_short)1; # if FD < 3 freqfile = evalpath(Xstrdup(FREQFILE), 0); # endif if (!freqfile || !*freqfile) return; VOID_C adduserfreq(freqfile, &tmp); # if FD < 3 Xfree(freqfile); # endif } static int cmpjis(jp1, jp2) CONST jisbuf *jp1; CONST jisbuf *jp2; { int i; for (i = 0; i < jp1 -> max; i++) { if (i >= jp2 -> max) return(1); if (jp1 -> buf[i] > jp2 -> buf[i]) return(1); else if (jp1 -> buf[i] < jp2 -> buf[i]) return(-1); } return((int)(jp1 -> max) - (int)(jp2 -> max)); } static int cmpdict(vp1, vp2) CONST VOID_P vp1; CONST VOID_P vp2; { kanjitable *kp1, *kp2; kp1 = (kanjitable *)vp1; kp2 = (kanjitable *)vp2; return(cmpjis(&(kp1 -> k), &(kp2 -> k))); } static int cmpfreq(vp1, vp2) CONST VOID_P vp1; CONST VOID_P vp2; { kanjitable *kp1, *kp2; kp1 = (kanjitable *)vp1; kp2 = (kanjitable *)vp2; if (kp1 -> len < kp2 -> len) return(1); else if (kp1 -> len > kp2 -> len) return(-1); if (kp1 -> freq < kp2 -> freq) return(1); else if (kp1 -> freq > kp2 -> freq) return(-1); if (kp1 -> ofs > kp2 -> ofs) return(1); else if (kp1 -> ofs < kp2 -> ofs) return(-1); return(0); } static long NEAR addkanji(argc, argvp, kp) long argc; kanjitable **argvp; CONST kanjitable *kp; { *argvp = (kanjitable *)Xrealloc(*argvp, (argc + 2) * sizeof(kanjitable)); memcpy((char *)&((*argvp)[argc++]), kp, sizeof(kanjitable)); (*argvp)[argc].k.buf = NULL; return(argc); } static VOID NEAR freekanji(argv) kanjitable *argv; { long n; if (argv) { for (n = 0L; argv[n].k.buf; n++) Xfree(argv[n].k.buf); Xfree(argv); } } static int NEAR fgetdict(kp1, kp2, fd) kanjitable *kp1; CONST kanjitable *kp2; int fd; { freq_t tmp; long freq; if (fgetstring(&(kp1 -> k), fd) < 0) return(-1); if (fgetword(&(kp1 -> freq), fd) < 0 || fgethinsi(kp1 -> hinsi, fd) < 0) { Xfree(kp1 -> k.buf); return(-1); } # if FD >= 3 if (imelearning <= 0) return(0); # endif tmp.kana.buf = kp1 -> k.buf; tmp.kana.max = kp1 -> k.max; tmp.kanji.buf = kp2 -> k.buf; tmp.kanji.max = kp2 -> len; if (findfreq(&tmp, NULL) <= 0 || tmp.freq <= 0) return(0); freq = ((long)(tmp.freq) + imelearning) * imelearning; freq += kp1 -> freq; if (freq > MAXUTYPE(u_short)) freq = MAXUTYPE(u_short); kp1 -> freq = (u_short)freq; return(0); } static long NEAR addkanjilist(argc, argvp, argc2, argv2, kp, fd) long argc; kanjitable **argvp; long argc2; kanjitable *argv2, *kp; int fd; { kanjitable *next, tmp1, tmp2; u_short shuutan[MAXHINSI]; long n; int i; if (fgetdict(&tmp1, kp, fd) < 0) return(argc); tmp2.k.buf = tmp1.k.buf; tmp2.k.max = tmp1.k.max; tmp2.len = kp -> len; tmp2.match = kp -> len; tmp2.kmatch = tmp1.k.max; tmp2.freq = tmp1.freq; tmp2.ofs = kp -> ofs; if (hinsitblent <= 0) { if (kp -> len < kp -> k.max) { tmp2.k.max += kp -> k.max - kp -> len; tmp2.k.buf = (u_short *)Xrealloc(tmp2.k.buf, (tmp2.k.max + 1) * sizeof(u_short)); memcpy((char *)&(tmp2.k.buf[tmp1.k.max]), (char *)&(kp -> k.buf[kp -> len]), (kp -> k.max - kp -> len) * sizeof(u_short)); tmp2.k.buf[tmp2.k.max] = (u_short)0; } return(addkanji(argc, argvp, &tmp2)); } i = fchkhinsi(NULL, kp -> hinsi, tmp1.hinsi, tmp1.hinsi, fd); if (i >= 0 && kp -> len >= kp -> k.max) { shuutan[0] = SH_svkantan; shuutan[1] = MAXUTYPE(u_short); i = fchkhinsi(tmp2.hinsi, tmp1.hinsi, NULL, shuutan, fd); if (i >= 0) return(addkanji(argc, argvp, &tmp2)); } if (i < 0) { if (kp -> hinsi[0] == (u_short)HN_SENTOU && kp -> len >= kp -> k.max) { for (i = 0; i < MAXHINSI; i++) { if (tmp1.hinsi[i] == MAXUTYPE(u_short)) break; if (tmp1.hinsi[i] == (u_short)HN_TANKAN) return(addkanji(argc, argvp, &tmp2)); } } Xfree(tmp1.k.buf); return(argc); } if (!(next = argv2)) { tmp2.k.buf = &(kp -> k.buf[kp -> len]); tmp2.k.max = kp -> k.max - kp -> len; memcpy((char *)(tmp2.hinsi), (char *)(tmp1.hinsi), sizeof(tmp2.hinsi)); for (tmp2.len = kp -> k.max; tmp2.len > (u_char)0; tmp2.len--) argc2 = _searchdict(argc2, &argv2, &tmp2, fd); if (!argv2) { Xfree(tmp1.k.buf); return(argc); } } for (n = 0L; n < argc2; n++) { if (next) { i = fchkhinsi(tmp2.hinsi, tmp1.hinsi, NULL, argv2[n].hinsi, fd); if (i < 0) continue; } tmp2.k.max = tmp1.k.max + argv2[n].k.max; tmp2.k.buf = (u_short *)Xmalloc((tmp2.k.max + 1) * sizeof(u_short)); memcpy((char *)(tmp2.k.buf), (char *)(tmp1.k.buf), tmp1.k.max * sizeof(u_short)); memcpy((char *)&(tmp2.k.buf[tmp1.k.max]), (char *)(argv2[n].k.buf), argv2[n].k.max * sizeof(u_short)); tmp2.k.buf[tmp2.k.max] = (u_short)0; if (argv2[n].hinsi[0] >= (u_short)HN_MAX) { tmp2.len = kp -> len + argv2[n].len; tmp2.freq = tmp1.freq + argv2[n].freq; } else if (tmp2.hinsi[0] >= (u_short)HN_MAX) { tmp2.len = argv2[n].len; tmp2.freq = argv2[n].freq; } else if (kp -> len > argv2[n].len) { tmp2.len = kp -> len; tmp2.freq = tmp1.freq; } else if (tmp2.len < argv2[n].len) { tmp2.len = argv2[n].len; tmp2.freq = argv2[n].freq; } else { tmp2.len = kp -> len; tmp2.freq = (tmp1.freq > argv2[n].freq) ? tmp1.freq : argv2[n].freq; } argc = addkanji(argc, argvp, &tmp2); } if (!next) freekanji(argv2); Xfree(tmp1.k.buf); return(argc); } static off_t NEAR nextofs(ofs, fd) off_t ofs; int fd; { u_char c; if (dictlseek(fd, ofs, L_SET) < (off_t)0) return((off_t)-1); if (fgetbyte(&c, fd) < 0) return((off_t)-1); ofs = (off_t)c * 2 + 2; if ((ofs = dictlseek(fd, ofs, L_INCR)) < (off_t)0) return((off_t)-1); if (hinsitblent <= 0) return(ofs); if (fgetbyte(&c, fd) < 0) return((off_t)-1); ofs = (off_t)c * 2; return(dictlseek(fd, ofs, L_INCR)); } static int NEAR finddict(jp, fd, ofsp) jisbuf *jp; int fd; long *ofsp; { jisbuf tmp; long ofs, min, max; int n; if (ofsp) *ofsp = -1L; min = -1L; max = dicttblent; for (;;) { ofs = (min + max) / 2; if (ofs <= min) { if (ofsp) *ofsp = min + 1; return(0); } else if (ofs >= max) { if (ofsp) *ofsp = max; return(0); } if (fgetjisbuf(&tmp, ofs, fd) < 0) return(-1); n = cmpjis(jp, &tmp); Xfree(tmp.buf); if (n > 0) min = ofs; else if (n < 0) max = ofs; else break; } if (ofsp) *ofsp = ofs; return(1); } static long NEAR _searchdict(argc, argvp, kp, fd) long argc; kanjitable **argvp, *kp; int fd; { kanjitable *argv2, tmp; off_t curofs; long argc2; u_char c; int n; dictofs = (off_t)0; tmp.k.buf = kp -> k.buf; tmp.k.max = kp -> len; if (finddict(&(tmp.k), fd, &(kp -> ofs)) <= 0) return(argc); if (fgetbyte(&c, fd) < 0) return(argc); if (c <= 1) return(addkanjilist(argc, argvp, 0, NULL, kp, fd)); curofs = dictlseek(fd, (off_t)0, L_INCR); if (curofs < (off_t)0) return(argc); argv2 = NULL; argc2 = 0L; if (hinsitblent > 0 && kp -> len < kp -> k.max) { tmp.k.buf = &(kp -> k.buf[kp -> len]); tmp.k.max = kp -> k.max - kp -> len; tmp.hinsi[0] = MAXUTYPE(u_short); for (tmp.len = kp -> k.max; tmp.len > (u_char)0; tmp.len--) argc2 = _searchdict(argc2, &argv2, &tmp, fd); if (!argv2) return(argc); } if (dictlseek(fd, curofs, L_SET) >= (off_t)0) { for (n = 0; n < c; n++, curofs = nextofs(curofs, fd)) { if (curofs < (off_t)0) break; argc = addkanjilist(argc, argvp, argc2, argv2, kp, fd); } } freekanji(argv2); return(argc); } static long NEAR uniqkanji(argc, argv) long argc; kanjitable *argv; { long i, j; int c; for (i = 0L; i < argc - 1; i++) { for (j = i + 1L; j < argc; j++) { if (argv[i].k.max != argv[j].k.max) break; c = memcmp((char *)(argv[i].k.buf), (char *)(argv[j].k.buf), argv[i].k.max * sizeof(u_short)); if (c) break; Xfree(argv[j].k.buf); if (argv[j].len > argv[i].len) { argv[i].len = argv[j].len; argv[i].freq = argv[j].freq; } else if (argv[j].len < argv[i].len) continue; else if (argv[j].freq > argv[i].freq) argv[i].freq = argv[j].freq; } if (j <= i + 1L) continue; memmove((char *)&(argv[i + 1]), (char *)&(argv[j]), (argc + 1 - j) * sizeof(kanjitable)); argc -= --j - i; } return(argc); } VOID freekanjilist(argv) u_short **argv; { long n, argc; if (argv) { for (argc = 0L; argv[argc]; argc++) { if (kanjilist) { for (n = 0L; kanjilist[n].k.buf; n++) if (argv[argc] == kanjilist[n].k.buf) break; if (kanjilist[n].k.buf) continue; } Xfree(argv[argc]); } Xfree(argv); } freekanji(kanjilist); kanjilist = NULL; } u_short **searchdict(kana, len) u_short *kana; int len; { kanjitable tmp; u_short **list; long n, argc; int i, fd; freekanjilist(NULL); if (!kana) { # ifndef DEP_EMBEDDICTTBL VOID_C opendicttbl(NULL); # endif VOID_C openfreqtbl(NULL, 0); if (imebuffer <= 0) discarddicttable(); return(NULL); } if (len > MAXUTYPE(u_char)) len = MAXUTYPE(u_char); argc = 0L; # ifdef DEP_EMBEDDICTTBL fd = -1; # else if (dicttblbuf) fd = -1; else if ((fd = opendicttbl(DICTTBL)) < 0) return(NULL); else { readdicttable(fd); if (dicttblbuf) { VOID_C opendicttbl(NULL); fd = -1; } } # endif tmp.k.buf = kana; tmp.k.max = len; tmp.hinsi[0] = (u_short)HN_SENTOU; tmp.hinsi[1] = MAXUTYPE(u_short); for (tmp.len = len; tmp.len > (u_char)0; tmp.len--) argc = _searchdict(argc, &kanjilist, &tmp, fd); tmp.k.max = len; tmp.len = (u_char)0; tmp.freq = (u_short)0; tmp.hinsi[0] = (u_short)HN_TANKAN; tmp.hinsi[1] = MAXUTYPE(u_short); tmp.ofs = dicttblent; tmp.k.buf = (u_short *)Xmalloc((len + 1) * sizeof(u_short)); for (i = 0; i < len; i++) tmp.k.buf[i] = kana[i]; tmp.k.buf[len] = (u_short)0; argc = addkanji(argc, &kanjilist, &tmp); tmp.k.buf = (u_short *)Xmalloc((len + 1) * sizeof(u_short)); for (i = 0; i < len; i++) { if ((kana[i] & 0xff00) != 0x2400) tmp.k.buf[i] = kana[i]; else tmp.k.buf[i] = (0x2500 | (kana[i] & 0xff)); } tmp.k.buf[len] = (u_short)0; tmp.ofs++; argc = addkanji(argc, &kanjilist, &tmp); if (!argc || !kanjilist) list = NULL; else { qsort(kanjilist, argc, sizeof(kanjitable), cmpdict); argc = uniqkanji(argc, kanjilist); qsort(kanjilist, argc, sizeof(kanjitable), cmpfreq); list = (u_short **)Xmalloc((argc + 1) * sizeof(u_short *)); for (n = 0L; n < argc; n++) list[n] = kanjilist[n].k.buf; list[n] = NULL; } VOID_C openfreqtbl(NULL, 0); return(list); } # if FD >= 3 static NEAR VOID fgetjis(jp, fp) jisbuf *jp; XFILE *fp; { char buf[MAXKLEN * R_MAXKANA + 1]; int n; for (n = 0; n < jp -> max; n++) { VOID_C jis2str(buf, jp -> buf[n]); kanjifputs(buf, fp); } } int fgetuserfreq(path, fp) CONST char *path; XFILE *fp; { freq_t tmp; lockbuf_t *lck; long n; VOID_C openfreqtbl(NULL, 0); if (!(lck = openfreqtbl(path, O_BINARY | O_RDONLY))) return(-1); if (lck -> fd < 0) { VOID_C openfreqtbl(NULL, 0); errno = ENOENT; return(-1); } for (n = 0; n < freqtblent; n++) { if (fseekfreq(n, lck -> fd) < 0) break; if (fgetfreqbuf(&tmp, lck -> fd) < 0) break; fgetjis(&(tmp.kana), fp); Xfree(tmp.kana.buf); VOID_C Xfputc('\t', fp); fgetjis(&(tmp.kanji), fp); Xfree(tmp.kanji.buf); VOID_C Xfprintf(fp, "\t%d\n", tmp.freq); } VOID_C openfreqtbl(NULL, 0); return((n < freqtblent) ? -1 : 0); } static CONST char *parsejis(jp, s) jisbuf *jp; CONST char *s; { u_short *kbuf; char *cp; int n; for (n = 0; s[n] && s[n] != '\t'; n++) /*EMPTY*/; if (n <= 0) return(NULL); cp = Xstrndup(s, n); for (s += n; *s == '\t'; s++) /*EMPTY*/; renewkanjiconv(&cp, defaultkcode, DEFCODE, L_INPUT); n = strlen(cp); kbuf = (u_short *)Xmalloc(n * sizeof(u_short)); n = str2jis(kbuf, n, cp); Xfree(cp); jp -> buf = kbuf; jp -> max = n; return(s); } int fputuserfreq(path, fp) CONST char *path; XFILE *fp; { freq_t tmp; CONST char *cp; char *line; int n, freq; VOID_C openfreqtbl(NULL, 0); n = 0; while ((line = Xfgets(fp))) { tmp.kana.buf = tmp.kanji.buf = NULL; for (cp = line; *cp == '\t'; cp++) /*EMPTY*/; if ((cp = parsejis(&(tmp.kana), cp)) && (cp = parsejis(&(tmp.kanji), cp)) && (freq = Xatoi(cp)) >= 0) { if (freq > MAXUTYPE(u_short)) freq = MAXUTYPE(u_short); tmp.freq = (u_short)freq; n = adduserfreq(path, &tmp); } Xfree(tmp.kana.buf); Xfree(tmp.kanji.buf); Xfree(line); if (n < 0) break; } VOID_C openfreqtbl(NULL, 0); return(n); } # endif /* FD >= 3 */ #endif /* DEP_IME */ FD-3.01j/roman.c100644 2105 1751 22213 13516612560 12161 0ustar shiraiuser/* * roman.c * * Roman translation */ #include "headers.h" #include "depend.h" #include "kctype.h" #include "typesize.h" #include "string.h" #include "kconv.h" #include "roman.h" #define R_MAXVOWEL 5 #define DEFRM(s, c) {s, strsize(s), \ {((c) >> 8) & 0xff, (c) & 0xff}} #define DEFRM2(s, c1, c2) {s, strsize(s), {(c1), (c2)}} typedef struct _voweltable { int key; CONST u_char code[R_MAXVOWEL]; } voweltable; typedef struct _catromantable { CONST char str[R_MAXROMAN + 1]; int key; CONST u_short code; } catromantable; static int cmproman __P_((CONST VOID_P, CONST VOID_P)); static int NEAR chgroman __P_((CONST char *, int, CONST u_short *)); static int NEAR catroman __P_((int, int, CONST char *)); static u_int NEAR jis2defcode __P_((u_int)); static u_int NEAR defcode2jis __P_((CONST char *)); romantable *romanlist = NULL; int maxromanlist = 0; static CONST voweltable vowellist[] = { {'\0', {'a', 'i', 'u', 'e', 'o'}}, {'y', {0x63, 0x23, 0x65, 0x27, 0x67}}, {'h', {0x63, 0x00, 0x65, 0x27, 0x67}}, {'l', {0x21, 0x23, 0x00, 0x27, 0x29}}, {'w', {0x21, 0x23, 0x25, 0x27, 0x29}}, }; #define VOWELLISTSIZ arraysize(vowellist) static CONST romantable origromanlist[] = { DEFRM("a", 0x2200), DEFRM("i", 0x2400), DEFRM("u", 0x2600), DEFRM("e", 0x2800), DEFRM("o", 0x2a00), DEFRM("ka", 0x2b00), DEFRM("ga", 0x2c00), DEFRM("ki", 0x2d00), DEFRM("gi", 0x2e00), DEFRM("ku", 0x2f00), DEFRM("gu", 0x3000), DEFRM("ke", 0x3100), DEFRM("ge", 0x3200), DEFRM("ko", 0x3300), DEFRM("go", 0x3400), DEFRM("sa", 0x3500), DEFRM("za", 0x3600), DEFRM("si", 0x3700), DEFRM("zi", 0x3800), DEFRM("su", 0x3900), DEFRM("zu", 0x3a00), DEFRM("se", 0x3b00), DEFRM("ze", 0x3c00), DEFRM("so", 0x3d00), DEFRM("zo", 0x3e00), DEFRM("ta", 0x3f00), DEFRM("da", 0x4000), DEFRM("ti", 0x4100), DEFRM("di", 0x4200), DEFRM("tu", 0x4400), DEFRM("du", 0x4500), DEFRM("te", 0x4600), DEFRM("de", 0x4700), DEFRM("to", 0x4800), DEFRM("do", 0x4900), DEFRM("na", 0x4a00), DEFRM("ni", 0x4b00), DEFRM("nu", 0x4c00), DEFRM("ne", 0x4d00), DEFRM("no", 0x4e00), DEFRM("ha", 0x4f00), DEFRM("ba", 0x5000), DEFRM("pa", 0x5100), DEFRM("hi", 0x5200), DEFRM("bi", 0x5300), DEFRM("pi", 0x5400), DEFRM("hu", 0x5500), DEFRM("bu", 0x5600), DEFRM("pu", 0x5700), DEFRM("he", 0x5800), DEFRM("be", 0x5900), DEFRM("pe", 0x5a00), DEFRM("ho", 0x5b00), DEFRM("bo", 0x5c00), DEFRM("po", 0x5d00), DEFRM("ma", 0x5e00), DEFRM("mi", 0x5f00), DEFRM("mu", 0x6000), DEFRM("me", 0x6100), DEFRM("mo", 0x6200), DEFRM("ya", 0x6400), DEFRM("yi", 0x2400), DEFRM("yu", 0x6600), DEFRM("ye", 0x2427), DEFRM("yo", 0x6800), DEFRM("ra", 0x6900), DEFRM("ri", 0x6a00), DEFRM("ru", 0x6b00), DEFRM("re", 0x6c00), DEFRM("ro", 0x6d00), DEFRM("wa", 0x6f00), DEFRM("wya", 0x6f63), DEFRM("wi", 0x2623), DEFRM("wyi", 0x7000), DEFRM("wu", 0x2600), DEFRM("wyu", 0x6f65), DEFRM("we", 0x2627), DEFRM("wye", 0x7100), DEFRM("wo", 0x7200), DEFRM("wyo", 0x6f67), DEFRM("nn", 0x7300), DEFRM("xn", 0x7300), DEFRM("n'", 0x7300), DEFRM("xtu", 0x4300), DEFRM("ltu", 0x4300), DEFRM("xtsu", 0x4300), DEFRM("ltsu", 0x4300), DEFRM("xwa", 0x6e00), DEFRM("lwa", 0x6e00), DEFRM2("xka", 0x2575, 0x00), DEFRM2("lka", 0x2575, 0x00), DEFRM2("xke", 0x2576, 0x00), DEFRM2("lke", 0x2576, 0x00), DEFRM("ca", 0x2b00), DEFRM("ci", 0x3700), DEFRM("cu", 0x2f00), DEFRM("ce", 0x3b00), DEFRM("co", 0x3300), }; #define ROMANLISTSIZ arraysize(origromanlist) static CONST catromantable catromanlist[] = { {"ky", 'y', 0x242d}, {"gy", 'y', 0x242e}, {"sy", 'y', 0x2437}, {"zy", 'y', 0x2438}, {"ty", 'y', 0x2441}, {"dy", 'y', 0x2442}, {"ny", 'y', 0x244b}, {"hy", 'y', 0x2452}, {"by", 'y', 0x2453}, {"py", 'y', 0x2454}, {"my", 'y', 0x245f}, {"xy", 'y', 0x0000}, {"ly", 'y', 0x0000}, {"ry", 'y', 0x246a}, {"sh", 'h', 0x2437}, {"j", 'h', 0x2438}, {"jy", 'y', 0x2438}, {"ch", 'h', 0x2441}, {"cy", 'y', 0x2441}, {"ts", 'l', 0x2444}, {"th", 'y', 0x2446}, {"dh", 'y', 0x2447}, {"wh", 'l', 0x2426}, {"f", 'l', 0x2455}, {"v", 'l', 0x2574}, {"fy", 'y', 0x2455}, {"vy", 'y', 0x2574}, {"q", 'l', 0x242f}, {"qy", 'y', 0x242f}, {"x", 'w', 0x0000}, {"l", 'w', 0x0000}, {"kw", 'w', 0x242f}, {"gw", 'w', 0x2430}, {"qw", 'w', 0x242f}, {"sw", 'w', 0x2439}, {"zw", 'w', 0x243a}, {"tw", 'w', 0x2448}, {"dw", 'w', 0x2449}, {"hw", 'w', 0x2455}, {"bw", 'w', 0x2456}, {"pw", 'w', 0x2457}, {"fw", 'w', 0x2455}, {"vw", 'w', 0x2574}, }; #define CATROMANLISTSIZ arraysize(catromanlist) int code2kanji(buf, c) char *buf; u_int c; { int n; n = 0; if ((buf[n] = ((c >> 8) & 0xff))) n++; buf[n++] = (c & 0xff); buf[n] = '\0'; return(n); } static int cmproman(vp1, vp2) CONST VOID_P vp1; CONST VOID_P vp2; { romantable *rp1, *rp2; rp1 = (romantable *)vp1; rp2 = (romantable *)vp2; return(strcmp(rp1 -> str, rp2 -> str)); } int searchroman(s, len) CONST char *s; int len; { int i, n, min, max; min = -1; max = maxromanlist; for (;;) { n = (min + max) / 2; if (n <= min || n >= max) return(-1); if ((i = strncmp(s, romanlist[n].str, len)) > 0) min = n; else if (i < 0 || len < romanlist[n].len) max = n; else break; } return(n); } static int NEAR chgroman(str, len, kbuf) CONST char *str; int len; CONST u_short *kbuf; { romantable *tmp; int n; if ((n = searchroman(str, len)) < 0) { n = maxromanlist; tmp = (romantable *)realloc(romanlist, (maxromanlist + 1) * sizeof(romantable)); if (!tmp) return(-1); romanlist = tmp; maxromanlist++; } else if (!kbuf) { memmove((char *)(&romanlist[n]), (char *)(&romanlist[n + 1]), (--maxromanlist - n) * sizeof(romantable)); return(0); } Xstrcpy(romanlist[n].str, str); romanlist[n].len = len; memcpy((char *)romanlist[n].code, (char *)kbuf, R_MAXKANA * sizeof(u_short)); return(0); } static int NEAR catroman(key, top, s) int key, top; CONST char *s; { u_short kbuf[R_MAXKANA]; char str[R_MAXROMAN + 1]; int i, j, n, len; for (n = 1; n < VOWELLISTSIZ; n++) if (key == vowellist[n].key) break; if (n >= VOWELLISTSIZ) return(-1); for (i = 0; s[i]; i++) { if (i >= strsize(str) - 1) break; str[i] = s[i]; } len = i; str[len + 1] = '\0'; for (i = 0; i < R_MAXVOWEL; i++) { str[len] = vowellist[0].code[i]; memset((char *)kbuf, 0, sizeof(kbuf)); j = 0; if (top) kbuf[j++] = top; kbuf[j] = vowellist[n].code[i]; if (kbuf[j]) kbuf[j] |= 0x2400; if (chgroman(str, len + 1, kbuf) < 0) return(-1); } return(0); } VOID initroman(VOID_A) { int i, n; if (romanlist) return; if (!(romanlist = (romantable *)malloc(sizeof(origromanlist)))) return; memcpy((char *)romanlist, (char *)origromanlist, sizeof(origromanlist)); for (n = 0; n < ROMANLISTSIZ; n++) { for (i = 0; i < R_MAXKANA; i++) { if (!romanlist[n].code[i]) continue; if (romanlist[n].code[i] & ~0xff) continue; romanlist[n].code[i] |= 0x2400; } } maxromanlist = ROMANLISTSIZ; for (i = 0; i < CATROMANLISTSIZ; i++) { n = catroman(catromanlist[i].key, catromanlist[i].code, catromanlist[i].str); if (n < 0) break; } qsort(romanlist, maxromanlist, sizeof(romantable), cmproman); } static u_int NEAR jis2defcode(c) u_int c; { #ifndef CODEEUC CONST char *cp; char buf[MAXKLEN + 1], tmp[MAXKLEN + 1]; #endif if (!(c & ~0xff)) { #ifdef CODEEUC if (Xiskana(c)) c |= (C_EKANA << 8); #endif return(c); } #ifdef CODEEUC return(c | 0x8080); #else VOID_C code2kanji(tmp, c | 0x8080); cp = kanjiconv2(buf, tmp, MAXKLEN, EUC, DEFCODE, L_INPUT); if (kanjierrno) return(0); return(((u_char)(cp[0]) << 8) | (u_char)(cp[1])); #endif /* !CODEEUC */ } static u_int NEAR defcode2jis(buf) CONST char *buf; { #ifndef CODEEUC char tmp[MAXKLEN + 1]; buf = kanjiconv2(tmp, buf, MAXKLEN, DEFCODE, EUC, L_INPUT); if (kanjierrno) return((u_int)0); #endif return((((u_char)(buf[0]) << 8) | (u_char)(buf[1])) & ~0x8080); } int jis2str(buf, c) char *buf; u_int c; { int n; if ((c & 0x8080) != 0x8080) n = 0; else { n = code2kanji(buf, jis2defcode((c >> 8) & 0xff)); c &= 0xff; } n += code2kanji(&(buf[n]), jis2defcode(c)); return(n); } int str2jis(kbuf, max, buf) u_short *kbuf; int max; CONST char *buf; { u_short w; int i, j; for (i = j = 0; buf[i] && j < max; i++) { if (iskanji1(buf, i)) w = defcode2jis(&(buf[i++])); #ifdef CODEEUC else if (isekana(buf, i)) w = buf[++i]; #endif else w = buf[i]; kbuf[j++] = w; } return(j); } int addroman(s, buf) CONST char *s, *buf; { #ifdef DEP_FILECONV char tmp[R_MAXKANA * 3 + 1]; #endif char str[R_MAXROMAN + 1]; u_short kbuf[R_MAXKANA]; int i, j, len; initroman(); if (!s) return(-1); for (i = j = 0; s[i]; i++) { if (!Xisprint(s[i])) continue; if (ismsb(s[i])) return(-1); if (j >= strsize(str)) break; str[j++] = Xtolower(s[i]); } if (!j) return(-1); str[j] = '\0'; len = j; if (!buf) chgroman(str, len, NULL); else { #ifdef DEP_FILECONV buf = kanjiconv2(tmp, buf, strsize(tmp), defaultkcode, DEFCODE, L_FNAME); #endif memset((char *)kbuf, 0, sizeof(kbuf)); if (!str2jis(kbuf, arraysize(kbuf), buf)) return(-1); chgroman(str, len, kbuf); } qsort(romanlist, maxromanlist, sizeof(romantable), cmproman); return(0); } VOID freeroman(n) int n; { romantable *tmp; maxromanlist = 0; if (n) { tmp = (romantable *)realloc(romanlist, n * sizeof(romantable)); if (tmp) romanlist = tmp; } else if (romanlist) { tmp = romanlist; romanlist = NULL; free(tmp); } } FD-3.01j/info.c100644 2105 1751 41706 13516612560 12010 0ustar shiraiuser/* * info.c * * information module */ #include "fd.h" #include "dirent.h" #include "sysemu.h" #include "pathname.h" #include "term.h" #include "types.h" #include "funcno.h" #include "kanji.h" #include "unixdisk.h" #include "mntinfo.h" #include "fsinfo.h" #define KEYWID 7 #ifdef LINUX #define SFN_MSDOSFS #endif #if defined (FREEBSD) && (__FreeBSD__ < 3) # include # if defined (__FreeBSD_version) && (__FreeBSD_version < 227000) # define SFN_MSDOSFS # endif #endif /* FREEBSD && (__FreeBSD__ < 3) */ #ifdef NETBSD # if defined (NetBSD1_0) || defined (NetBSD1_1) # define SFN_MSDOSFS # endif #endif /* NETBSD */ #ifndef MNTTYPE_43 #define MNTTYPE_43 "4.3" /* NEWS-OS 3-4, HP-UX, HI-UX */ #endif #ifndef MNTTYPE_42 #define MNTTYPE_42 "4.2" /* SunOS 4 */ #endif #ifndef MNTTYPE_UFS #define MNTTYPE_UFS "ufs" /* SVR4, OSF/1, Free/NetBSD */ #endif #ifndef MNTTYPE_FFS #define MNTTYPE_FFS "ffs" /* NetBSD, OpenBSD */ #endif #ifndef MNTTYPE_ADVFS #define MNTTYPE_ADVFS "advfs" /* OSF/1 */ #endif #ifndef MNTTYPE_VXFS #define MNTTYPE_VXFS "vxfs" /* HP-UX */ #endif #ifndef MNTTYPE_HFS #define MNTTYPE_HFS "hfs" /* Darwin, HP-UX */ #endif #ifndef MNTTYPE_EXT2 #define MNTTYPE_EXT2 "ext2" /* Linux */ #endif #ifndef MNTTYPE_EXT3 #define MNTTYPE_EXT3 "ext3" /* Linux */ #endif #ifndef MNTTYPE_EXT4 #define MNTTYPE_EXT4 "ext4" /* Linux */ #endif #ifndef MNTTYPE_JFS #define MNTTYPE_JFS "jfs" /* AIX */ #endif #ifndef MNTTYPE_EFS #define MNTTYPE_EFS "efs" /* IRIX */ #endif #ifndef MNTTYPE_SYSV #define MNTTYPE_SYSV "sysv" /* SystemV Rel.3 */ #endif #ifndef MNTTYPE_DGUX #define MNTTYPE_DGUX "dg/ux" /* DG/UX */ #endif #ifndef MNTTYPE_UMSDOS #define MNTTYPE_UMSDOS "umsdos" /* umsdosfs on Linux */ #endif #ifndef MNTTYPE_MSDOS #define MNTTYPE_MSDOS "msdos" /* msdosfs */ #endif #ifndef MNTTYPE_MSDOSFS #define MNTTYPE_MSDOSFS "msdosfs" /* msdosfs on FreeBSD */ #endif #ifndef MNTTYPE_VFAT #define MNTTYPE_VFAT "vfat" /* vfatfs on Linux */ #endif #ifndef MNTTYPE_PC #define MNTTYPE_PC "pc" /* MS-DOS */ #endif #ifndef MNTTYPE_DOS7 #define MNTTYPE_DOS7 "dos7" /* MS-DOS on Win95 */ #endif #ifndef MNTTYPE_FAT12 #define MNTTYPE_FAT12 "fat12" /* MS-DOS */ #endif #ifndef MNTTYPE_FAT16 #define MNTTYPE_FAT16 "fat16(16bit sector)" /* MS-DOS */ #endif #ifndef MNTTYPE_FAT16X #define MNTTYPE_FAT16X "fat16(32bit sector)" /* MS-DOS */ #endif #ifndef MNTTYPE_FAT32 #define MNTTYPE_FAT32 "fat32" /* Win98 */ #endif #ifndef MNTTYPE_SHARED #define MNTTYPE_SHARED "shared" /* Win98 */ #endif #define MNTTYPE_XNFS "nfs" /* NFS */ extern VOID error __P_((CONST char *)); extern int _chdir2 __P_((CONST char *)); extern VOID warning __P_((int, CONST char *)); #ifdef DEP_DOSLFN extern int supportLFN __P_((CONST char *)); # ifdef DEP_DOSDRIVE extern int checkdrive __P_((int)); # endif #endif /* DEP_DOSLFN */ #ifdef DEP_DOSDRIVE extern int dosstatfs __P_((int, char *)); #endif extern int filetop __P_((int)); extern VOID cputspace __P_((int)); extern VOID cputstr __P_((int, CONST char *)); #ifdef DEP_PTY extern VOID Xlocate __P_((int, int)); extern VOID Xputterm __P_((int)); extern int XXputch __P_((int)); extern VOID XXcputs __P_((CONST char *)); extern int XXcprintf __P_((CONST char *, ...)); extern int Xattrprintf __P_((CONST char *, int, ...)); #else #define Xlocate locate #define Xputterm putterm #define XXputch Xputch #define XXcputs Xcputs #define XXcprintf Xcprintf #define Xattrprintf attrprintf #endif extern bindlist_t bindlist; extern int maxbind; extern CONST functable funclist[]; extern char fullpath[]; extern char *distributor; #ifdef DEP_DOSDRIVE extern int needbavail; #endif static int NEAR code2str __P_((char *, int)); static int NEAR checkline __P_((int)); VOID help __P_((int)); static int NEAR getfsinfo __P_((CONST char *, statfs_t *, mnt_t *)); #ifndef NOFLOCK int isnfs __P_((CONST char *)); #endif int writablefs __P_((CONST char *)); off_t getblocksize __P_((CONST char *)); static int NEAR info1line __P_((int, int, CONST char *, off_t, CONST char *, CONST char *)); off_t calcKB __P_((off_t, off_t)); int getinfofs __P_((CONST char *, off_t *, off_t *, off_t *)); int infofs __P_((CONST char *)); static CONST int keycodelist[] = { K_HOME, K_END, K_DL, K_IL, K_DC, K_IC, K_BEG, K_EOL, K_NPAGE, K_PPAGE, K_CLR, K_ENTER, K_HELP, K_BS, '\t', K_CR, K_ESC }; #define KEYCODESIZ arraysize(keycodelist) static CONST char *keystrlist[] = { "Home", "End", "DelLin", "InsLin", "Del", "Ins", "Beg", "Eol", "PageDn", "PageUp", "Clr", "Enter", "Help", "Bs", "Tab", "Ret", "Esc" }; static CONST strtable mntlist[] = { {FSID_FAT, MNTTYPE_PC}, {FSID_LFN, MNTTYPE_DOS7}, {FSID_LFN, MNTTYPE_FAT32}, {FSID_LFN, MNTTYPE_SHARED}, #if MSDOS # ifdef DEP_DOSDRIVE {FSID_FAT, MNTTYPE_FAT12}, {FSID_FAT, MNTTYPE_FAT16}, {FSID_FAT, MNTTYPE_FAT16X}, # endif #else /* !MSDOS */ {FSID_UFS, MNTTYPE_43}, {FSID_UFS, MNTTYPE_42}, {FSID_UFS, MNTTYPE_UFS}, {FSID_UFS, MNTTYPE_FFS}, {FSID_UFS, MNTTYPE_JFS}, {FSID_EFS, MNTTYPE_EFS}, {FSID_SYSV, MNTTYPE_SYSV}, {FSID_SYSV, MNTTYPE_DGUX}, {FSID_LINUX, MNTTYPE_EXT2}, {FSID_LINUX, MNTTYPE_EXT3}, {FSID_LINUX, MNTTYPE_EXT4}, {FSID_FAT, MNTTYPE_UMSDOS}, # ifdef SFN_MSDOSFS {FSID_FAT, MNTTYPE_MSDOS}, # else {FSID_LFN, MNTTYPE_MSDOS}, # endif {FSID_LFN, MNTTYPE_MSDOSFS}, {FSID_LFN, MNTTYPE_VFAT}, {0, MNTTYPE_ADVFS}, {0, MNTTYPE_VXFS}, # ifdef DARWIN /* Macintosh HFS+ is pseudo file system covered with skin */ {0, MNTTYPE_HFS}, # endif #endif /* !MSDOS */ }; #define MNTLISTSIZ arraysize(mntlist) static int NEAR code2str(buf, code) char *buf; int code; { int i; buf = buf + strlen(buf); if (code >= K_F(1) && code <= K_F(20)) VOID_C Xsnprintf(buf, KEYWID + 1, "F%-6d", code - K_F0); else if ((code & ~0x7f) == 0x80 && Xisalpha(code & 0x7f)) VOID_C Xsnprintf(buf, KEYWID + 1, "Alt-%c ", code & 0x7f); else if (code == K_UP) VOID_C Xsnprintf(buf, KEYWID + 1, "%-*.*s", KEYWID, KEYWID, UPAR_K); else if (code == K_DOWN) VOID_C Xsnprintf(buf, KEYWID + 1, "%-*.*s", KEYWID, KEYWID, DWNAR_K); else if (code == K_RIGHT) VOID_C Xsnprintf(buf, KEYWID + 1, "%-*.*s", KEYWID, KEYWID, RIGAR_K); else if (code == K_LEFT) VOID_C Xsnprintf(buf, KEYWID + 1, "%-*.*s", KEYWID, KEYWID, LEFAR_K); else { for (i = 0; i < KEYCODESIZ; i++) if (code == keycodelist[i]) break; if (i < KEYCODESIZ) VOID_C Xsnprintf(buf, KEYWID + 1, "%-*.*s", KEYWID, KEYWID, keystrlist[i]); #ifdef CODEEUC else if (isekana2(code)) VOID_C Xsnprintf(buf, KEYWID + 1 + 1, "'%c%c' ", C_EKANA, code & 0xff); #endif else if (code > MAXUTYPE(u_char)) return(0); #ifndef CODEEUC else if (Xiskana(code)) VOID_C Xsnprintf(buf, KEYWID + 1, "'%c' ", code); #endif else if (Xiscntrl(code)) VOID_C Xsnprintf(buf, KEYWID + 1, "Ctrl-%c ", (code + '@') & 0x7f); else if (!ismsb(code)) VOID_C Xsnprintf(buf, KEYWID + 1, "'%c' ", code); else return(0); } return(1); } static int NEAR checkline(y) int y; { if (y >= FILEPERROW) { warning(0, HITKY_K); y = 1; } return(y); } VOID help(arch) int arch; { CONST char *cp; char buf[(KEYWID + 1 + 1) * 2 + 1]; int i, j, c, x, y, yy; if (distributor && *distributor) { i = n_column - (int)strlen(distributor) - 24; Xlocate(i, L_HELP); VOID_C XXputch('['); VOID_C Xattrprintf(" Distributed by: %s ", 1, distributor); VOID_C XXputch(']'); } yy = filetop(win); x = y = 0; Xlocate(0, yy + y++); Xputterm(L_CLEAR); for (i = 0; i < FUNCLISTSIZ ; i++) { if (i == NO_OPERATION || i == WARNING_BELL) continue; Xlocate(x * (n_column / 2), yy + y); if (x ^= 1) Xputterm(L_CLEAR); else y++; if (arch && !(funclist[i].status & FN_ARCHIVE)) continue; c = 0; buf[0] = '\0'; for (j = 0; j < maxbind; j++) { if (i != ffunc(j)) continue; c += code2str(buf, (int)(bindlist[j].key)); if (c >= 2) break; } if (c < 2) for (j = 0; j < maxbind; j++) { if (i != dfunc(j)) continue; c += code2str(buf, (int)(bindlist[j].key)); if (c >= 2) break; } if (!c) continue; XXcputs(" "); if (c < 2) cputspace(KEYWID); cp = mesconv2(funclist[i].hmes_no, funclist[i].hmes, funclist[i].hmes_eng); VOID_C XXcprintf("%k: %k", buf, cp); y = checkline(y); } if (y > 1) { if (x) y++; for (; y < FILEPERROW; y++) { Xlocate(0, yy + y); Xputterm(L_CLEAR); } warning(0, HITKY_K); } } static int NEAR getfsinfo(path, fsbuf, mntbuf) CONST char *path; statfs_t *fsbuf; mnt_t *mntbuf; { #if MSDOS # ifdef DEP_DOSDRIVE int i; # endif char buf[MAXPATHLEN]; int drive; #else /* !MSDOS */ # ifdef DEP_DOSDRIVE static char dosmntdir[4]; char buf[3 * sizeof(long) + 1]; int drv; # endif mnt_t *mntp; FILE *fp; char fsname[MAXPATHLEN], dir[MAXPATHLEN]; ALLOC_T match; #endif /* !MSDOS */ #if !MSDOS || defined (DOUBLESLASH) CONST char *cp; ALLOC_T len; #endif statfs_t fs; mnt_t mnt; #if MSDOS if (!fsbuf) fsbuf = &fs; if (!mntbuf) mntbuf = &mnt; mntbuf -> Xmnt_fsname = "MSDOS"; drive = dospath(path, buf); # ifdef DOUBLESLASH if (drive == '_') { if (*buf) path = buf; len = isdslash(path); if ((cp = strdelim(&(path[len]), 0))) { len = cp - path; if (!(cp = strdelim(&(path[len + 1]), 0))) cp += strlen(cp); len = cp - path; } Xstrncpy(mntbuf -> Xmnt_dir, path, len); } else # endif VOID_C gendospath(mntbuf -> Xmnt_dir, drive, _SC_); # ifdef DEP_DOSLFN switch (supportLFN(mntbuf -> Xmnt_dir)) { case 3: mntbuf -> Xmnt_type = MNTTYPE_SHARED; break; case 2: mntbuf -> Xmnt_type = MNTTYPE_FAT32; break; case 1: mntbuf -> Xmnt_type = MNTTYPE_DOS7; break; # ifdef DEP_DOSDRIVE case -1: mntbuf -> Xmnt_fsname = "LFN emurate"; mntbuf -> Xmnt_type = MNTTYPE_DOS7; break; case -2: mntbuf -> Xmnt_fsname = "BIOS raw"; i = checkdrive(Xtoupper(mntbuf -> Xmnt_dir[0]) - 'A'); if (i == PT_FAT12) mntbuf -> Xmnt_type = MNTTYPE_FAT12; else if (i == PT_FAT16) mntbuf -> Xmnt_type = MNTTYPE_FAT16; else if (i == PT_FAT16X) mntbuf -> Xmnt_type = MNTTYPE_FAT16X; else mntbuf -> Xmnt_type = MNTTYPE_FAT32; break; # endif case -4: return(seterrno(ENOENT)); /*NOTREACHED*/ break; default: mntbuf -> Xmnt_type = MNTTYPE_PC; break; } # else /* !DEP_DOSLFN */ mntbuf -> Xmnt_type = MNTTYPE_PC; # endif /* !DEP_DOSLFN */ mntbuf -> Xmnt_opts = nullstr; if (Xstatfs(mntbuf -> Xmnt_dir, fsbuf) < 0) return(-1); #else /* !MSDOS */ if (!fsbuf) fsbuf = &fs; if (!mntbuf) mntbuf = &mnt; cp = NULL; if (!strncmp(path, "/dev/", strsize("/dev/"))) { cp = getrealpath(path, dir, NULL); if (cp != dir && cp != path) return(-1); } # ifdef DEP_DOSDRIVE else if ((drv = dospath(path, NULL))) { mntbuf -> Xmnt_fsname = vnullstr; mntbuf -> Xmnt_dir = dosmntdir; dosmntdir[0] = drv; Xstrcpy(&(dosmntdir[1]), ":\\"); mntbuf -> Xmnt_type = (Xislower(drv)) ? MNTTYPE_DOS7 : MNTTYPE_PC; mntbuf -> Xmnt_opts = vnullstr; if (dosstatfs(drv, buf) < 0) return(-1); if (buf[3 * sizeof(long)] & 001) mntbuf -> Xmnt_type = MNTTYPE_FAT32; fsbuf -> Xf_bsize = *((long *)&(buf[0 * sizeof(long)])); # ifdef USEFSDATA fsbuf -> fd_req.btot = calcKB((off_t)(fsbuf -> Xf_bsize), (off_t)(*((long *)&(buf[1 * sizeof(long)])))); fsbuf -> fd_req.bfree = fsbuf -> fd_req.bfreen = calcKB((off_t)(fsbuf -> Xf_bsize), (off_t)(*((long *)&(buf[2 * sizeof(long)])))); # else /* !USEFSDATA */ # ifdef USESTATVFSH fsbuf -> f_frsize = 0L; # endif # ifndef NOFBLOCKS fsbuf -> Xf_blocks = *((long *)&(buf[1 * sizeof(long)])); # endif # ifndef NOFBFREE fsbuf -> Xf_bfree = fsbuf -> Xf_bavail = *((long *)&(buf[2 * sizeof(long)])); # endif # endif /* !USEFSDATA */ # ifndef NOFFILES fsbuf -> Xf_files = -1L; # endif return(0); } # endif /* DEP_DOSDRIVE */ else if ((cp = getrealpath(path, dir, NULL)) != dir) return(-1); if (cp == dir) { match = (ALLOC_T)0; if (!(fp = Xsetmntent(getmounted(), "rb"))) return(-1); for (;;) { # ifdef DEBUG _mtrace_file = "getmntent(start)"; mntp = Xgetmntent(fp, &mnt); if (_mtrace_file) _mtrace_file = NULL; else { _mtrace_file = "getmntent(end)"; malloc(0); /* dummy malloc */ } if (!mntp) break; # else if (!(mntp = Xgetmntent(fp, &mnt))) break; # endif len = strlen(mntp -> Xmnt_dir); if (len < match || strncmp(mntp -> Xmnt_dir, dir, len) || (mntp -> Xmnt_dir[len - 1] != _SC_ && dir[len] && dir[len] != _SC_)) continue; # if defined (USEPROCMNT) || defined (HAVEPROCMNT) # ifdef HAVEPROCMNT if (hasmounted()) /*EMPTY*/; else # endif if (match && !strpathcmp(ROOTFS, mntp -> Xmnt_fsname)) continue; # endif /* USEPROCMNT || HAVEPROCMNT */ match = len; Xstrcpy(fsname, mntp -> Xmnt_fsname); } Xendmntent(fp); if (!match) return(seterrno(ENOENT)); cp = fsname; } if (!(fp = Xsetmntent(getmounted(), "rb"))) return(-1); while ((mntp = Xgetmntent(fp, &mnt))) if (!strpathcmp(cp, mntp -> Xmnt_fsname)) break; Xendmntent(fp); if (!mntp) return(seterrno(ENOENT)); memcpy((char *)mntbuf, (char *)mntp, sizeof(mnt_t)); if (Xstatfs(mntbuf -> Xmnt_dir, fsbuf) >= 0) /*EMPTY*/; else if (path == cp || Xstatfs(path, fsbuf) < 0) return(-1); #endif /* !MSDOS */ return(0); } #ifndef NOFLOCK int isnfs(path) CONST char *path; { mnt_t mntbuf; struct stat st; char *cp, buf[MAXPATHLEN]; int n; if (Xstat(path, &st) < 0) return(-1); if (!s_isdir(&st)) { if (!(cp = strrdelim(path, 1))) return(-1); Xstrncpy(buf, path, cp - path); path = buf; } if (getfsinfo(path, NULL, &mntbuf) < 0) return(-1); n = Xstrncasecmp(mntbuf.Xmnt_type, MNTTYPE_XNFS, strsize(MNTTYPE_XNFS)); return((n == 0) ? -1 : 0); } #endif /* NOFLOCK */ int writablefs(path) CONST char *path; { #ifdef DEP_DOSEMU int drv; #endif mnt_t mntbuf; int i; if (Xaccess(path, R_OK | W_OK | X_OK) < 0) return(-1); #ifdef DEP_DOSEMU if ((drv = dospath(path, NULL))) return((Xisupper(drv)) ? FSID_FAT : FSID_DOSDRIVE); #endif if (getfsinfo(path, NULL, &mntbuf) < 0) return(0); if (Xhasmntopt(&mntbuf, "ro")) return(0); for (i = 0; i < MNTLISTSIZ; i++) if (!strcmp(mntbuf.Xmnt_type, mntlist[i].str)) return(mntlist[i].no); return(0); } /*ARGSUSED*/ off_t getblocksize(dir) CONST char *dir; { #if MSDOS statfs_t fsbuf; if (Xstatfs(dir, &fsbuf) < 0) return((off_t)1024); return((off_t)blocksize(fsbuf)); #else /* !MSDOS */ statfs_t fsbuf; struct stat st; if (isdotdir(dir) != 2) { /* In case of the newborn directory */ if (Xstat(dir, &st) >= 0) return((off_t)(st.st_size)); } else { # ifdef CYGWIN if (Xstatfs(dir, &fsbuf) >= 0) # else if (getfsinfo(dir, &fsbuf, NULL) >= 0) # endif return((off_t)blocksize(fsbuf)); # ifndef NOSTBLKSIZE if (Xstat(dir, &st) >= 0) return((off_t)(st.st_blksize)); # endif } return(DEV_BSIZE); #endif /* !MSDOS */ } static int NEAR info1line(yy, y, ind, n, s, unit) int yy, y; CONST char *ind; off_t n; CONST char *s, *unit; { int width; Xlocate(0, yy + y); Xputterm(L_CLEAR); Xlocate(n_column / 2 - 20, yy + y); VOID_C XXcprintf("%-20.20k", ind); Xlocate(n_column / 2 + 2, yy + y); if (s) { width = n_column - (n_column / 2 + 2); cputstr(width, s); } else VOID_C XXcprintf("%<'*qd %k", MAXCOLSCOMMA(3), n, unit); return(checkline(++y)); } off_t calcKB(block, byte) off_t block, byte; { if (block < (off_t)0 || byte <= (off_t)0) return((off_t)-1); if (byte == (off_t)1024) return(block); else if (byte > 1024) { byte = (byte + (off_t)512) / (off_t)1024; return(block * byte); } else { byte = ((off_t)1024 + (byte / (off_t)2)) / byte; return(block / byte); } } int getinfofs(path, totalp, freep, bsizep) CONST char *path; off_t *totalp, *freep, *bsizep; { statfs_t fsbuf; int n; #ifdef DEP_DOSDRIVE needbavail++; #endif n = getfsinfo(path, &fsbuf, NULL); #ifdef DEP_DOSDRIVE needbavail--; #endif if (n < 0) { *bsizep = getblocksize(path); return(-1); } #ifdef NOFBLOCKS *totalp = (off_t)0; #else *totalp = fsbuf.Xf_blocks; #endif #ifdef NOFBFREE *freep = (off_t)0; #else *freep = fsbuf.Xf_bavail; #endif *bsizep = blocksize(fsbuf); return(0); } int infofs(path) CONST char *path; { statfs_t fsbuf; mnt_t mntbuf; int y, yy; #ifdef DEP_DOSDRIVE needbavail++; #endif if (getfsinfo(path, &fsbuf, &mntbuf) < 0) { warning(ENOTDIR, path); #ifdef DEP_DOSDRIVE needbavail--; #endif return(0); } yy = filetop(win); y = 0; Xlocate(0, yy + y++); Xputterm(L_CLEAR); y = info1line(yy, y, FSNAM_K, (off_t)0, mntbuf.Xmnt_fsname, NULL); y = info1line(yy, y, FSMNT_K, (off_t)0, mntbuf.Xmnt_dir, NULL); y = info1line(yy, y, FSTYP_K, (off_t)0, mntbuf.Xmnt_type, NULL); #ifndef NOFBLOCKS y = info1line(yy, y, FSTTL_K, calcKB((off_t)(fsbuf.Xf_blocks), (off_t)blocksize(fsbuf)), NULL, "Kbytes"); #endif #ifndef NOFBFREE y = info1line(yy, y, FSUSE_K, calcKB((off_t)(fsbuf.Xf_blocks - fsbuf.Xf_bfree), (off_t)blocksize(fsbuf)), NULL, "Kbytes"); y = info1line(yy, y, FSAVL_K, calcKB((off_t)(fsbuf.Xf_bavail), (off_t)blocksize(fsbuf)), NULL, "Kbytes"); #endif y = info1line(yy, y, FSBSZ_K, (off_t)(fsbuf.Xf_bsize), NULL, "bytes"); #ifndef NOFFILES y = info1line(yy, y, FSINO_K, (off_t)(fsbuf.Xf_files), NULL, UNIT_K); #endif if (y > 1) { for (; y < FILEPERROW; y++) { Xlocate(0, yy + y); Xputterm(L_CLEAR); } warning(0, HITKY_K); } #ifdef DEP_DOSDRIVE needbavail--; #endif return(1); } FD-3.01j/rockridg.c100644 2105 1751 21715 13516612560 12657 0ustar shiraiuser/* * rockridg.c * * ISO-9660 RockRidge format filter */ #include "fd.h" #include "device.h" #include "parse.h" #include "func.h" #define TRANSTBLFILE "TRANS.TBL" #define TRANSTBLVAR 1 #define RR_TRANS 001 #define RR_LOWER 002 #define RR_VERNO 004 #define RR_HYPHN 010 typedef struct _transtable { char *org; char *alias; char *slink; r_dev_t rdev; char type; struct _transtable *next; } transtable; #ifndef _NOROCKRIDGE static char *NEAR getorgname __P_((char *, int)); static XFILE *NEAR opentranstbl __P_((CONST char *, int, int *)); static transtable *NEAR readtranstbl __P_((CONST char *, int)); static VOID NEAR freetranstbl __P_((transtable *)); static transtable *NEAR inittrans __P_((CONST char *, int)); static VOID NEAR cachetrans __P_((CONST char *, CONST char *)); static char *NEAR transfile __P_((CONST char *, int, char *, int)); static char *NEAR detransfile __P_((CONST char *, int, char *, int)); static char *NEAR detransdir __P_((CONST char *, char *, int)); char *rockridgepath = NULL; int norockridge = 0; static transtable *rr_curtbl = NULL; static char *rr_cwd = NULL; static char *rr_transcwd = NULL; static char *NEAR getorgname(name, flags) char *name; int flags; { char *cp; int len; cp = Xstrchr(name, ';'); len = (cp) ? cp - name : strlen(name); if (flags & RR_LOWER) Xstrntolower(name, len); if ((flags & RR_VERNO) && cp) { if (flags & RR_HYPHN) *cp = '-'; cp += 2; } *cp = '\0'; return(name); } static XFILE *NEAR opentranstbl(path, len, flagsp) CONST char *path; int len, *flagsp; { XFILE *fp; char *cp, *file, buf[MAXPATHLEN]; if (len + 1 >= MAXPATHLEN - 1) return(NULL); Xstrncpy(buf, path, len); file = strcatdelim(buf); cp = Xstrncpy(file, TRANSTBLFILE, MAXPATHLEN - 1 - (file - buf)); *flagsp = RR_TRANS; if ((fp = Xfopen(buf, "r"))) return(fp); len = cp - buf; if (len + 1 >= MAXPATHLEN - 1) return(NULL); VOID_C Xsnprintf(&(buf[len]), (int)sizeof(buf) - len, ";%d", TRANSTBLVAR); *flagsp |= RR_VERNO; if ((fp = Xfopen(buf, "r"))) return(fp); buf[len] = '-'; *flagsp |= RR_HYPHN; if ((fp = Xfopen(buf, "r"))) return(fp); buf[len] = '\0'; Xstrtolower(file); *flagsp = RR_TRANS | RR_LOWER; if ((fp = Xfopen(buf, "r"))) return(fp); buf[len] = ';'; *flagsp |= RR_VERNO; if ((fp = Xfopen(buf, "r"))) return(fp); buf[len] = '-'; *flagsp |= RR_HYPHN; if ((fp = Xfopen(buf, "r"))) return(fp); return(NULL); } static transtable *NEAR readtranstbl(path, len) CONST char *path; int len; { transtable *top, **bottom, *new; XFILE *fp; r_dev_t maj, min; char *cp, *eol, *org, *line; int l1, l2, flags; norockridge++; #ifdef FAKEUNINIT flags = 0; #endif fp = opentranstbl(path, len, &flags); norockridge--; if (!fp) return(NULL); top = NULL; bottom = ⊤ while ((line = Xfgets(fp))) { cp = line; switch (*cp) { case 'F': case 'D': case 'B': case 'C': case 'L': case 'S': case 'P': cp++; break; default: *cp = '\0'; break; } if (!*(cp = skipspace(cp))) { Xfree(line); continue; } for (eol = cp; *eol; eol++) if (Xisblank(*eol)) break; if (*eol) *(eol++) = '\0'; if (!*(eol = skipspace(eol))) { Xfree(line); continue; } org = getorgname(cp, flags); cp = eol; while (*eol && !Xisblank(*eol)) eol++; l1 = eol - cp; if (*eol) *(eol++) = '\0'; l2 = 0; maj = min = (r_dev_t)-1; if (*line == 'L') { eol = skipspace(eol); while (eol[l2] && !Xisblank(eol[l2])) l2++; eol[l2++] = '\0'; } else if (*line == 'B' || *line == 'C') { eol = skipspace(eol); eol = Xsscanf(eol, "%+*d", sizeof(r_dev_t), &maj); if (eol) { eol = skipspace(eol); eol = Xsscanf(eol, "%+*d", sizeof(r_dev_t), &min); if (!eol) maj = (r_dev_t)-1; } } new = (transtable *)Xmalloc(sizeof(transtable)); new -> org = Xstrdup(org); new -> alias = Xstrndup(cp, l1); new -> slink = (l2 > 0) ? Xstrndup(eol, l2 - 1) : NULL; new -> type = *line; new -> rdev = (maj != (r_dev_t)-1) ? makedev(maj, min) : (r_dev_t)-1; *bottom = new; new -> next = NULL; bottom = &(new -> next); Xfree(line); } if (top) *bottom = top; VOID_C Xfclose(fp); return(top); } static VOID NEAR freetranstbl(tbl) transtable *tbl; { transtable *tp; if (tbl) { tp = tbl -> next; tbl -> next = NULL; while (tp) { tbl = tp; tp = tbl -> next; Xfree(tbl -> org); Xfree(tbl -> alias); Xfree(tbl -> slink); Xfree(tbl); } } } static transtable *NEAR inittrans(path, len) CONST char *path; int len; { transtable *tp; if (len < 0) len = strlen(path); if (rr_cwd && !strnpathcmp(path, rr_cwd, len) && !rr_cwd[len]) return(rr_curtbl); if (!(tp = readtranstbl(path, len))) return(NULL); freetranstbl(rr_curtbl); rr_curtbl = tp; Xfree(rr_cwd); rr_cwd = Xstrndup(path, len); Xfree(rr_transcwd); rr_transcwd = NULL; return(rr_curtbl); } static VOID NEAR cachetrans(path, trans) CONST char *path, *trans; { CONST char *cp1, *cp2; int len; if (!rr_cwd) return; cp1 = path; cp2 = trans; len = strlen(rr_cwd); for (;;) { if (!(cp1 = strdelim(cp1, 0)) || cp1 - path > len) return; if (!(cp2 = strdelim(cp2, 0))) return; if (cp1 - path == len) break; cp1++; cp2++; } if (strnpathcmp(path, rr_cwd, len)) return; Xfree(rr_transcwd); rr_transcwd = Xstrndup(trans, cp2 - trans); } static char *NEAR transfile(file, len, buf, ptr) CONST char *file; int len; char *buf; int ptr; { transtable *tp; if (len < 0) len = strlen(file); tp = rr_curtbl; for (;;) { if (!strnpathcmp(file, tp -> org, len) && !(tp -> org[len])) { rr_curtbl = tp; buf = Xstrncpy(&(buf[ptr]), tp -> alias, MAXPATHLEN - 1 - ptr); return(buf); } if ((tp = tp -> next) == rr_curtbl) break; } return(NULL); } char *transpath(path, buf) CONST char *path; char *buf; { CONST char *cp; char *tmp, *next; int ptr, len, dlen; if (!(cp = includepath(path, rockridgepath)) || !*cp) return((char *)path); if (!rr_cwd || !rr_transcwd || strnpathcmp(path, rr_cwd, len = strlen(rr_cwd))) { ptr = cp - path; Xstrncpy(buf, path, ptr); } else { Xstrcpy(buf, rr_transcwd); if (!path[len]) return(buf); ptr = strlen(buf); cp = &(path[len]); } while (cp) { dlen = cp++ - path; buf[ptr++] = _SC_; if ((next = strdelim(cp, 0))) len = next - cp; else len = strlen(cp); if (!inittrans(path, dlen)) tmp = NULL; else tmp = transfile(cp, len, buf, ptr); if (!tmp) tmp = Xstrncpy(&(buf[ptr]), cp, len); ptr = tmp - buf; cp = next; } cachetrans(path, buf); return(buf); } static char *NEAR detransfile(file, len, buf, ptr) CONST char *file; int len; char *buf; int ptr; { transtable *tp; if (len < 0) len = strlen(file); tp = rr_curtbl; for (;;) { if (!strnpathcmp(file, tp -> alias, len) && !(tp -> alias[len])) { rr_curtbl = tp; buf = Xstrncpy(&(buf[ptr]), tp -> org, MAXPATHLEN - 1 - ptr); return(buf); } if ((tp = tp -> next) == rr_curtbl) break; } return(NULL); } static char *NEAR detransdir(dir, buf, ptr) CONST char *dir; char *buf; int ptr; { char *cp, *next; int dlen, flen; while (dir) { dlen = ptr; buf[ptr++] = _SC_; if ((next = strdelim(dir, 0))) flen = next++ - dir; else flen = strlen(dir); if (!inittrans(buf, dlen)) cp = NULL; else cp = detransfile(dir, flen, buf, ptr); if (!cp) cp = Xstrncpy(&(buf[ptr]), dir, flen); ptr = cp - buf; dir = next; } return(&(buf[ptr])); } char *detranspath(path, buf) CONST char *path; char *buf; { CONST char *cp; int ptr, len; if (!path) { freetranstbl(rr_curtbl); rr_curtbl = NULL; Xfree(rr_cwd); rr_cwd = NULL; Xfree(rr_transcwd); rr_transcwd = NULL; return(NULL); } if (!(cp = includepath(path, rockridgepath)) || !*cp) return((char *)path); if (!rr_transcwd || !rr_cwd || strnpathcmp(path, rr_transcwd, len = strlen(rr_transcwd))) { ptr = cp++ - path; Xstrncpy(buf, path, ptr); } else { Xstrcpy(buf, rr_cwd); if (!path[len]) return(buf); ptr = strlen(buf); cp = &(path[len + 1]); } detransdir(cp, buf, ptr); cachetrans(buf, path); return(buf); } int rrlstat(path, stp) CONST char *path; struct stat *stp; { transtable *tp; char *cp; u_int mode; if (!(cp = strrdelim(path, 0)) || !inittrans(path, cp++ - path)) return(-1); tp = rr_curtbl; for (;;) { if (!strpathcmp(cp, tp -> org)) break; if ((tp = tp -> next) == rr_curtbl) return(-1); } rr_curtbl = tp; if ((mode = getfmode(tp -> type)) == (u_int)-1) mode = S_IFREG; stp -> st_mode &= ~S_IFMT; stp -> st_mode |= mode; if ((mode == S_IFBLK || mode == S_IFCHR) && tp -> rdev != (r_dev_t)-1) stp -> st_rdev = tp -> rdev; return(0); } int rrreadlink(path, buf, bufsiz) CONST char *path; char *buf; int bufsiz; { transtable *tp; char *cp; int len; if (!(cp = strrdelim(path, 0)) || !inittrans(path, cp++ - path)) return(-1); tp = rr_curtbl; for (;;) { if (!strpathcmp(cp, tp -> org)) break; if ((tp = tp -> next) == rr_curtbl) return(-1); } rr_curtbl = tp; if (tp -> type != 'L' || !(tp -> slink)) return(-1); len = strlen(tp -> slink); if (len > bufsiz) len = bufsiz; memcpy(buf, tp -> slink, len); return(len); } #endif /* !_NOROCKRIDGE */ FD-3.01j/tree.c100644 2105 1751 43212 13516612560 12006 0ustar shiraiuser/* * tree.c * * tree mode module */ #include "fd.h" #include "func.h" #include "kanji.h" #define DIRFIELD 3 #define TREEFIELD (((dircountlimit > 0) \ ? (n_column * 3) / 5 : n_column) - 2) #define FILEFIELD ((dircountlimit > 0) \ ? n_column - ((n_column * 3) / 5) - 3 : 0) #define bufpos(y) (((y) - 1) * (TREEFIELD + 1) * KANAWID) #define bufptr(y) (&(tr_scr[bufpos(y)])) #ifndef _NOTREE extern char fullpath[]; extern int autoupdate; extern int win_x; extern int win_y; static int NEAR evaldir __P_((CONST char *, int)); static treelist *NEAR maketree __P_((CONST char *, treelist *, treelist *, int, int *)); static int NEAR _showtree __P_((treelist *, int, int, int)); static VOID NEAR showtree __P_((VOID_A)); static VOID NEAR treebar __P_((VOID_A)); static treelist *NEAR _searchtree __P_((treelist *, int, int)); static VOID NEAR searchtree __P_((VOID_A)); static int NEAR expandtree __P_((treelist *)); static int NEAR expandall __P_((treelist *)); static int NEAR treeup __P_((VOID_A)); static int NEAR treedown __P_((VOID_A)); static int NEAR freetree __P_((treelist *, int)); static int NEAR bottomtree __P_((VOID_A)); static VOID NEAR _tree_search __P_((VOID_A)); static int NEAR _tree_input __P_((VOID_A)); static char *NEAR _tree __P_((VOID_A)); int sorttree = 0; int dircountlimit = 0; static int redraw = 0; static int tr_no = 0; static int tr_line = 0; static int tr_top = 0; static int tr_bottom = 0; static char *tr_scr = NULL; static treelist *tr_root = NULL; static treelist *tr_cur = NULL; static int NEAR evaldir(dir, disp) CONST char *dir; int disp; { DIR *dirp; struct dirent *dp; struct stat st; char *cp, path[MAXPATHLEN]; int i, x, y, w, min, limit; if ((limit = dircountlimit) <= 0) return(1); min = filetop(win); if (disp) for (i = 1; i < FILEPERROW; i++) { Xlocate(TREEFIELD + 2, min + i); VOID_C XXputch('|'); Xputterm(L_CLEAR); } if (!(dirp = Xopendir(dir))) return(0); Xstrcpy(path, dir); cp = strcatdelim(path); i = x = 0; y = 1; w = FILEFIELD; if (limit > FILEPERROW - 1) w /= 2; while ((dp = Xreaddir(dirp))) { if (isdotdir(dp -> d_name)) continue; if (strcatpath(path, cp, dp -> d_name) < 0) continue; if (limit-- <= 0 || (stat2(path, &st) >= 0 && s_isdir(&st))) { if (!disp) { i++; break; } } else if (disp) { Xlocate(x + TREEFIELD + 4, min + y); VOID_C XXcprintf("%^.*k", w, dp -> d_name); i++; if (++y >= FILEPERROW) { y = 1; x += w + 1; if (x >= w * 2 + 2) break; } } } VOID_C Xclosedir(dirp); if (disp && !i) { Xlocate(x + TREEFIELD + 4, min + 1); cputstr(w, "[No Files]"); } return(i); } /*ARGSUSED*/ static treelist *NEAR maketree(path, list, parent, level, maxp) CONST char *path; treelist *list, *parent; int level, *maxp; { #ifdef DEP_DOSEMU char tmp[MAXPATHLEN]; #endif #ifndef NODIRLOOP treelist *lp; #endif DIR *dirp; struct dirent *dp; struct stat st; CONST char *cp, *subdir; char *dir, cwd[MAXPATHLEN]; int i, len; if ((level + 1) * DIRFIELD + 2 > TREEFIELD) { *maxp = -2; return(NULL); } if (intrkey(K_ESC)) { *maxp = -1; return(NULL); } if (!Xgetwd(cwd)) { *maxp = 0; return(NULL); } len = getpathtop(path, NULL, NULL); cp = &(path[len]); if (*cp == _SC_) cp++; else cp = strdelim(path, 0); len = (cp) ? cp - path : strlen(path); dir = Xstrndup(path, len); subdir = &(path[len]); if (*subdir == _SC_) subdir++; else if (!*subdir) subdir = NULL; if (!subdir) len = 0; else if ((cp = strdelim(subdir, 0))) len = cp - subdir; else len = strlen(subdir); *maxp = 0; i = _chdir2(dir); Xfree(dir); if (i < 0 || !(dirp = Xopendir(curpath))) return(NULL); i = 0; while ((dp = Xreaddir(dirp))) { if (isdotdir(dp -> d_name)) continue; else if (Xstat(nodospath(tmp, dp -> d_name), &st) < 0 || !s_isdir(&st)) continue; list = b_realloc(list, *maxp, treelist); if (!subdir) { list[*maxp].name = Xstrdup(dp -> d_name); list[*maxp].sub = NULL; list[*maxp].max = 0; #ifndef NODIRLOOP list[*maxp].dev = st.st_dev; list[*maxp].ino = st.st_ino; list[*maxp].parent = parent; #endif (*maxp)++; } else if (!strnpathcmp(dp -> d_name, subdir, len) && !(dp -> d_name[len])) { list[0].name = Xstrdup(dp -> d_name); list[0].sub = &(list[0]); list[0].max = 0; #ifndef NODIRLOOP list[0].dev = st.st_dev; list[0].ino = st.st_ino; list[0].parent = parent; #endif if (++(*maxp) >= 2) break; } else { if (!*maxp) { list[0].name = NULL; list[0].sub = NULL; list[0].max = -1; #ifndef NODIRLOOP list[0].dev = 0; list[0].ino = 0; list[0].parent = NULL; #endif } if (!i) { i++; list[1].name = NULL; list[1].sub = NULL; list[1].max = -1; #ifndef NODIRLOOP list[1].dev = 0; list[1].ino = 0; list[1].parent = NULL; #endif if (++(*maxp) >= 2) break; } } } VOID_C Xclosedir(dirp); if (list) for (i = 0; i < *maxp; i++) { #ifndef NODIRLOOP if (!(list[i].name)) lp = NULL; # ifdef DEP_URLPATH else if (list[i].dev == (dev_t)-1 || list[i].ino == (ino_t)-1) lp = NULL; # endif else for (lp = parent; lp; lp = lp -> parent) if (lp -> dev == list[i].dev && lp -> ino == list[i].ino) break; if (lp) { list[i].sub = NULL; list[i].max = 0; } else #endif /* !NODIRLOOP */ if (list[i].sub) list[i].sub = maketree(subdir, NULL, &(list[i]), level + 1, &(list[i].max)); else { if (list[i].max >= 0 && list[i].name && evaldir(nodospath(tmp, list[i].name), 0)) list[i].max = -1; } } if (sorttree && sorton) qsort(list, *maxp, sizeof(treelist), cmptree); #if MSDOS if (_dospath(path)) path += 2; #endif #ifdef DEP_DOSEMU if (*path == _SC_ || _dospath(path)) #else if (*path == _SC_) #endif { if (_chdir2(fullpath) < 0) error(fullpath); } else if (isdotdir(path) != 2 && _chdir2(cwd) < 0) error(parentpath); return(list); } static int NEAR _showtree(list, max, nest, y) treelist *list; int max, nest, y; { char *cp; int i, j, w, tmp; w = TREEFIELD - (nest * DIRFIELD) - 1; tmp = y; for (i = 0; i < max; i++) { if (nest > 0) { for (j = tmp; j < y; j++) { if (j <= 0 || j >= FILEPERROW) continue; cp = bufptr(j); cp[(nest - 1) * DIRFIELD] = '|'; } } if (y > 0 && y < FILEPERROW) { cp = bufptr(y); if (nest > 0) memcpy(&(cp[(nest - 1) * DIRFIELD]), "+--", 3); if (!(list[i].name)) { tmp = (w > 3) ? 3 : w; memcpy(&(cp[nest * DIRFIELD]), "...", tmp); } else { tmp = Xsnprintf(&(cp[nest * DIRFIELD]), w * KANAWID + 1, "%^.*s", w, list[i].name); #ifdef CODEEUC tmp = strlen(&(cp[nest * DIRFIELD])); #endif cp[nest * DIRFIELD + tmp] = (list[i].max < 0) ? '>' : ' '; } } y++; tmp = y; if (w >= DIRFIELD && list[i].sub) y = _showtree(list[i].sub, list[i].max, nest + 1, y); } return(y); } static VOID NEAR showtree(VOID_A) { int i, min; min = filetop(win); for (i = 0; i < FILEPERROW; i++) { Xlocate(0, min + i); Xputterm(L_CLEAR); } for (i = 1; i < FILEPERROW; i++) { memset(bufptr(i), ' ', TREEFIELD); bufptr(i)[TREEFIELD] = '\0'; } _showtree(tr_root -> sub, 1, 0, tr_top - min); for (i = 1; i < FILEPERROW; i++) { Xlocate(1, min + i); attrputstr(TREEFIELD, bufptr(i), min + i == tr_line); } VOID_C evaldir(treepath, 1); keyflush(); } static VOID NEAR treebar(VOID_A) { Xlocate(1, filetop(win)); VOID_C XXcprintf("Tree=%^-*.*k", n_column - 6, n_column - 6, treepath); Xlocate(0, L_MESLINE); Xputterm(L_CLEAR); } VOID rewritetree(VOID_A) { tr_scr = Xrealloc(tr_scr, bufpos(FILEPERROW)); searchtree(); showtree(); treebar(); Xtflush(); } static treelist *NEAR _searchtree(list, max, nest) treelist *list; int max, nest; { treelist *lp, *tmplp; int i, w, len; lp = NULL; w = TREEFIELD - (nest * DIRFIELD) - 1; for (i = 0; i < max; i++) { if (tr_bottom == tr_line) { lp = tr_root; tr_no = i; if (list[i].name) Xstrcpy(treepath, list[i].name); else *treepath = '\0'; } tr_bottom++; if (w < DIRFIELD || !(list[i].sub)) continue; tmplp = _searchtree(list[i].sub, list[i].max, nest + 1); if (!tmplp) continue; lp = (tmplp == tr_root) ? &(list[i]) : tmplp; len = strlen(list[i].name); if (len > 0 && list[i].name[len - 1] == _SC_) len--; memmove(&(treepath[len + 1]), treepath, strlen(treepath) + 1); memcpy(treepath, list[i].name, len); treepath[len] = _SC_; } return(lp); } static VOID NEAR searchtree(VOID_A) { tr_bottom = tr_top; tr_cur = _searchtree(tr_root -> sub, 1, 0); } static int NEAR expandtree(list) treelist *list; { treelist *lp, *lptmp; char *cp; int i; lp = NULL; if (list -> sub) { lp = (treelist *)Xmalloc(sizeof(treelist)); memcpy((char *)lp, (char *)&(list -> sub[0]), sizeof(treelist)); for (i = 1; i < list -> max; i++) { Xfree(list -> sub[i].name); list -> sub[i].name = NULL; } } if (_chdir2(treepath) < 0) { if (list -> sub) error(treepath); list -> max = 0; return(1); } for (cp = treepath, i = 0; (cp = strdelim(cp, 0)); cp++, i++) /*EMPTY*/; lptmp = maketree(curpath, list -> sub, list, i, &(list -> max)); if (_chdir2(fullpath) < 0) lostcwd(fullpath); if (list -> max < 0) { i = (list -> max < -1) ? 1 : 0; if (!(list -> sub)) list -> max = -1; else { list -> max = 2; list -> sub[1].name = NULL; Xfree(lp); } return(i); } if (list -> sub) { if (!(lp -> name)) i = list -> max; else for (i = 0; i < list -> max; i++) if (lptmp[i].name && !strpathcmp(lp -> name, lptmp[i].name)) break; if (i < list -> max) { Xfree(lptmp[i].name); for (; i > 0; i--) memcpy((char *)&(lptmp[i]), (char *)&(lptmp[i - 1]), sizeof(treelist)); memcpy((char *)&(lptmp[0]), (char *)lp, sizeof(treelist)); } Xfree(lp); } list -> sub = lptmp; return(1); } static int NEAR expandall(list) treelist *list; { char *cp; int i; if (!list || list -> max >= 0) return(1); if (!expandtree(list)) return(0); if (!(list -> sub)) return(1); cp = &(treepath[strlen(treepath)]); if (cp > &(treepath[1])) { strcatdelim(treepath); cp++; } for (i = 0; i < list -> max; i++) { Xstrcpy(cp, list -> sub[i].name); if (!expandall(&(list -> sub[i]))) return(0); } return(1); } static int NEAR treeup(VOID_A) { int min; min = filetop(win); if (tr_line > min + 1) tr_line--; else if (tr_top <= min) tr_top++; else return(-1); searchtree(); return(0); } static int NEAR treedown(VOID_A) { char *cp, *dir; int min, oy, otop; min = filetop(win); oy = tr_line; otop = tr_top; if (tr_line < tr_bottom - 1 && tr_line < min + FILEPERROW - 2) tr_line++; else if (tr_bottom >= min + FILEPERROW) tr_top--; else return(-1); searchtree(); if (!tr_cur || !(tr_cur -> sub)) return(0); if (tr_cur -> sub[tr_no].max >= 0 || tr_cur -> sub[tr_no].name) return(0); waitmes(); dir = treepath; #ifdef DEP_DOSPATH if (_dospath(treepath)) dir += 2; #endif cp = strrdelim(dir, 0); if (cp == dir) cp++; #ifdef DOUBLESLASH else if (cp - treepath < isdslash(treepath)) cp++; #endif #ifdef DEP_URLPATH else if (cp - treepath < _urlpath(treepath, NULL, NULL)) cp++; #endif *cp = '\0'; if (!expandtree(tr_cur)) { tr_line = oy; tr_top = otop; searchtree(); return(-1); } searchtree(); redraw = 1; return(0); } static int NEAR freetree(list, max) treelist *list; int max; { int i, n; for (i = n = 0; i < max; i++) { n++; Xfree(list[i].name); if (list[i].sub) n += freetree(list[i].sub, list[i].max); } Xfree(list); return(n); } static int NEAR bottomtree(VOID_A) { int min, oy, otop; min = filetop(win); oy = tr_line; otop = tr_top; while (tr_line < min + FILEPERROW - 2) if (treedown() < 0) break; if (tr_line >= tr_bottom - 1 && tr_top >= min + 1) { tr_line = oy; tr_top = otop; searchtree(); return(-1); } return(0); } static VOID NEAR _tree_search(VOID_A) { int oy, otop; oy = tr_line; otop = tr_top; while (strpathcmp(fullpath, treepath)) if (treeup() < 0) { tr_top = otop; tr_line = oy; searchtree(); do { if (treedown() < 0) break; } while (strpathcmp(fullpath, treepath)); break; } } static int NEAR _tree_input(VOID_A) { treelist *old; char *cwd; int ch, min, tmp, half; keyflush(); Xgetkey(-1, 0, 0); ch = Xgetkey(1, 0, autoupdate); Xgetkey(-1, 0, 0); old = tr_cur; min = filetop(win); switch (ch) { case K_UP: treeup(); break; case K_DOWN: treedown(); break; case K_PPAGE: if (bottomtree() < 0) break; half = (FILEPERROW - 1) / 2; tmp = min + half + 1; if (tr_top + half > min + 1) half = min - tr_top + 1; if (half > 0) tr_top += half; tr_line = tmp; searchtree(); break; case K_NPAGE: if (bottomtree() < 0) break; half = (FILEPERROW - 1) / 2; tmp = min + half + 1; while (half-- > 0) if (treedown() < 0) break; tr_line = tmp; searchtree(); break; case K_BEG: case K_HOME: case '<': tr_line = tr_top = min + 1; searchtree(); break; case K_EOL: case K_END: case '>': while (treedown() >= 0); break; case '?': _tree_search(); break; case '(': tmp = tr_no - 1; do { if (treeup() < 0) break; } while (tmp >= 0 && (tr_cur != old || tr_no != tmp)); break; case ')': tmp = tr_no + 1; do { if (treedown() < 0) break; } while (tmp < old -> max && (tr_cur != old || tr_no != tmp)); break; case '\t': if (!tr_cur || !(tr_cur -> sub) || tr_cur -> sub[tr_no].max >= 0) break; waitmes(); expandall(&(tr_cur -> sub[tr_no])); searchtree(); redraw = 1; break; case K_RIGHT: if (!tr_cur || !(tr_cur -> sub)) break; if (tr_cur -> sub[tr_no].max >= 0) { if (!(tr_cur -> sub[tr_no].sub)) break; if (treedown() < 0) break; } waitmes(); expandtree(&(tr_cur -> sub[tr_no])); searchtree(); redraw = 1; break; case K_LEFT: if (tr_cur && tr_cur -> sub && tr_cur -> sub[tr_no].sub) { tmp = freetree(tr_cur -> sub[tr_no].sub, tr_cur -> sub[tr_no].max); tr_bottom -= tmp; tr_cur -> sub[tr_no].max = -1; tr_cur -> sub[tr_no].sub = NULL; redraw = 1; break; } /*FALLTHRU*/ case K_BS: do { if (treeup() < 0) break; if (!tr_cur || !(tr_cur -> sub)) break; } while (&(tr_cur -> sub[tr_no]) != old); break; case 'l': if (!(cwd = inputstr(LOGD_K, 0, -1, NULL, HST_PATH))) break; if (!*(cwd = evalpath(cwd, 0))) break; if (chdir2(cwd) >= 0) { Xfree(cwd); break; } warning(-1, cwd); ch = '\0'; Xfree(cwd); break; case K_CTRL('L'): #if FD >= 3 case K_TIMEOUT: #endif rewritefile(1); break; case K_ESC: break; default: if (ch >= K_MIN) break; if (!Xisupper(ch)) break; if (tr_line == tr_bottom - 1) { tr_line = tr_top = min + 1; searchtree(); } else do { if (treedown() < 0) break; if (!tr_cur || !(tr_cur -> sub)) break; tmp = Xtoupper(*(tr_cur -> sub[tr_no].name)); } while (ch != tmp); break; } return(ch); } static char *NEAR _tree(VOID_A) { #ifndef NODIRLOOP # ifdef DEP_DOSDRIVE char tmp[MAXPATHLEN]; # endif struct stat st; #endif /* !NODIRLOOP */ char *cp, *cwd, path[MAXPATHLEN]; int ch, min, len, oy, otop; keyflush(); waitmes(); tr_root = (treelist *)Xmalloc(sizeof(treelist)); tr_root -> name = NULL; tr_root -> max = 1; tr_root -> sub = tr_cur = (treelist *)Xmalloc(sizeof(treelist)); #ifndef NODIRLOOP tr_root -> ino = 0; tr_root -> parent = NULL; #endif treepath = path; #ifdef DEP_DOSEMU if (dospath(nullstr, path)) len = 3; else #endif { #ifdef DOUBLESLASH if ((len = isdslash(fullpath))) /*EMPTY*/; else #endif #ifdef DEP_URLPATH if ((len = _urlpath(fullpath, NULL, NULL))) /*EMPTY*/; else #endif #if MSDOS len = 3; #else len = 1; #endif Xstrcpy(path, fullpath); } tr_cur[0].name = Xstrndup(path, len); #ifndef NODIRLOOP if (Xstat(nodospath(tmp, tr_cur[0].name), &st) < 0) tr_cur[0].dev = tr_cur[0].ino = 0; else { tr_cur[0].dev = st.st_dev; tr_cur[0].ino = st.st_ino; } tr_cur[0].parent = NULL; #endif tr_cur[0].sub = maketree(path, NULL, &(tr_cur[0]), 0, &(tr_cur[0].max)); tr_line = 0; if (path[len - 1] == _SC_) len--; cwd = &(path[len]); if (isrootpath(cwd)) /*EMPTY*/; else for (cp = cwd; (cp = strdelim(cp, 0)); cp++, tr_line++) if ((tr_line + 1) * DIRFIELD + 2 > TREEFIELD || !(tr_cur = &(tr_cur -> sub[0]))) break; min = filetop(win); tr_line += (tr_top = min + 1); if (tr_line >= min + FILEPERROW - 2) { tr_top -= tr_line - (min + FILEPERROW - 2); tr_line = min + FILEPERROW - 2; } tr_scr = Xmalloc(bufpos(FILEPERROW)); searchtree(); showtree(); win_x = 0; do { treebar(); oy = tr_line; otop = tr_top; redraw = 0; win_y = tr_line; Xlocate(win_x, win_y); Xtflush(); if ((ch = _tree_input()) == 'l') { Xfree(tr_scr); freetree(tr_root, 1); return(fullpath); } if (redraw || tr_top != otop) showtree(); else if (oy != tr_line) { Xlocate(1, tr_line); attrputstr(TREEFIELD, bufptr(tr_line - min), 1); Xlocate(1, oy); if (stable_standout) Xputterm(END_STANDOUT); else cputstr(TREEFIELD, bufptr(oy - min)); VOID_C evaldir(path, 1); } } while (ch != K_ESC && ch != K_CR); Xfree(tr_scr); freetree(tr_root, 1); treepath = NULL; if (ch == K_ESC) return(NULL); return(Xstrdup(path)); } /*ARGSUSED*/ char *tree(cleanup, drvp) int cleanup, *drvp; { #ifdef DEP_PSEUDOPATH int drv; #endif char *path, *dupfullpath; if (FILEPERROW < WFILEMINTREE) { warning(0, NOROW_K); return(NULL); } #ifdef DEP_PSEUDOPATH if ((drv = preparedrv(fullpath, NULL, NULL)) < 0) { warning(-1, fullpath); return(NULL); } #endif dupfullpath = Xstrdup(fullpath); do { path = _tree(); } while (path == fullpath); #ifdef DEP_PSEUDOPATH if (path && drvp && (*drvp = preparedrv(path, NULL, NULL)) < 0) { warning(-1, path); Xfree(path); path = NULL; } #endif if (chdir2(dupfullpath) < 0) lostcwd(NULL); Xfree(dupfullpath); #ifdef DEP_PSEUDOPATH shutdrv(drv); #endif if (cleanup) rewritefile(1); return(path); } #endif /* !_NOTREE */ FD-3.01j/lsparse.c100644 2105 1751 113014 13516612560 12536 0ustar shiraiuser/* * lsparse.c * * parser for file list */ #ifdef FD #include "fd.h" #else #include "headers.h" #include "depend.h" #include "kctype.h" #include "string.h" #include "malloc.h" #endif #include "time.h" #include "dirent.h" #include "pathname.h" #include "unixemu.h" #include "device.h" #include "parse.h" #include "lsparse.h" #ifdef FD #include "kconv.h" #endif #define MAXSCORE 256 #define IGNORETYPESYM "-VMNLhC" #define SYMLINKSTR "->" #define GNULINKSTR "link to" #ifdef OLDPARSE #define LINESEP '\t' #else #define LINESEP '\n' #endif typedef struct _name_t { CONST char *name; short len; } name_t; #define DEFNAME(s) {s, strsize(s)} #ifdef DEP_LSPARSE static int NEAR readattr __P_((namelist *, CONST char *)); static int NEAR readdatestr __P_((CONST char *, CONST char *[], int)); static int NEAR readampm __P_((CONST char *)); #ifdef OLDPARSE static int NEAR countfield __P_((CONST char *, CONST u_char [], int, int *)); static char *NEAR getfield __P_((char *, CONST char *, int, CONST lsparse_t *, int)); static int NEAR readfileent __P_((namelist *, CONST char *, CONST lsparse_t *, int)); #else /* !OLDPARSE */ static char *NEAR checkspace __P_((CONST char *, int *)); # ifdef DEP_FILECONV static char *NEAR readfname __P_((CONST char *, int)); # else # define readfname Xstrndup # endif # ifdef DEP_FTPPATH static char *NEAR readbasename __P_((CONST char *, int)); # endif # ifndef NOSYMLINK static char *NEAR readlinkname __P_((CONST char *, int)); # endif static int NEAR readfileent __P_((namelist *, CONST char *, CONST char *, int, int)); #endif /* !OLDPARSE */ static int NEAR dircmp __P_((CONST char *, CONST char *)); static char *NEAR pseudodir __P_((namelist *, namelist *, int)); #ifndef OLDPARSE static char **NEAR decodevar __P_((char *CONST *)); static int NEAR matchlist __P_((CONST char *, char *CONST *)); #endif int (*lsintrfunc)__P_((VOID_A)) = NULL; #ifndef NOSYMLINK static CONST name_t linklist[] = { DEFNAME(SYMLINKSTR), DEFNAME(GNULINKSTR), }; #define LINKLISTSIZ arraysize(linklist) #endif /* !NOSYMLINK */ #ifndef OLDPARSE static CONST char sympairlist[] = "{}//!!"; static CONST char *autoformat[] = { # if MSDOS "%*f\n%s %x %x %y-%m-%d %t %a", /* LHa (v) */ " %*f\n%s %x %x %d-%m-%y %t %a", /* RAR (v) */ "%a %u/%g %s %m %d %t %y %*f", /* tar (traditional) */ "%a %u/%g %s %y-%m-%d %t %*f", /* tar (GNU >=1.12) */ "%a %l %u %g %s %m %d %{yt} %*f", /* ls or pax */ "%a %u/%g %s %m %d %y %t %*f", /* tar (kmtar) */ " %s %y-%m-%d %t %*f", /* zip */ " %s %x %x %x %y-%m-%d %t %*f", /* pkunzip */ " %s %x %x %d %m %y %t %*f", /* zoo */ "%1x %12f %s %x %x %y-%m-%d %t %a", /* LHa (l) */ " %f %s %x %x %d-%m-%y %t %a", /* RAR (l) */ # else /* !MSDOS */ " %*f\n%s %x %x %d-%m-%y %t %a", /* RAR (v) */ "%a %u/%g %s %m %d %t %y %*f", /* tar (SVR4) */ "%a %u/%g %s %y-%m-%d %t %*f", /* tar (GNU >=1.12) */ "%a %l %u %g %s %m %d %{yt} %*f", /* ls or pax */ "%a %u/%g %s %x %m %d %{yt} %*f", /* LHa (1.14<=) */ " %s %m-%d-%y %t %*f", /* zip */ " %s %x %x %d %m %y %t %*f", /* zoo */ "%10a %u/%g %s %m %d %t %y %*f", /* tar (UXP/DS) */ "%9a %u/%g %s %m %d %t %y %*f", /* tar (traditional) */ "%9a %u/%g %s %x %m %d %{yt} %*f", /* LHa */ "%a %u/%g %m %d %t %y %*f", /* tar (IRIX) */ " %f %s %x %x %d-%m-%y %t %a", /* RAR (l) */ # endif /* !MSDOS */ }; #define AUTOFORMATSIZ arraysize(autoformat) #endif /* !OLDPARSE */ #endif /* DEP_LSPARSE */ static CONST char typesymlist[] = "dbclsp"; static CONST u_short typelist[] = { S_IFDIR, S_IFBLK, S_IFCHR, S_IFLNK, S_IFSOCK, S_IFIFO }; #ifdef DEP_LSPARSE static CONST char *monthlist[] = { "Jan", "Feb", "Mar", "Apr", "May", "Jun", "Jul", "Aug", "Sep", "Oct", "Nov", "Dec", }; #define MONTHLISTSIZ arraysize(monthlist) static CONST char *weeklist[] = { "Sun", "Mon", "Tue", "Wed", "Thu", "Fri", "Sat", }; #define WEEKLISTSIZ arraysize(weeklist) static CONST char *amlist[] = { "AM", "a.m.", }; #define AMLISTSIZ arraysize(amlist) static CONST char *pmlist[] = { "PM", "p.m.", }; #define PMLISTSIZ arraysize(pmlist) static CONST name_t tzlist[] = { {"AHST", -10 * 60}, {"HAST", -10 * 60}, {"AKST", -9 * 60}, {"YST", -9 * 60}, {"YDT", -8 * 60}, {"PST", -8 * 60}, {"PDT", -7 * 60}, {"MST", -7 * 60}, {"MDT", -6 * 60}, {"CST", -6 * 60}, {"CDT", -5 * 60}, {"EST", -5 * 60}, {"EDT", -4 * 60}, {"AST", -4 * 60}, {"WST", -4 * 60}, {"ADT", -3 * 60}, {"WDT", -3 * 60}, {"NST", -3 * 60 - 30}, {"NDT", -2 * 60 - 30}, {"FST", -2 * 60}, {"FDT", -1 * 60}, {"UT", 0}, {"UCT", 0}, {"UTC", 0}, {"WET", 0}, {"BST", 1 * 60}, {"CET", 1 * 60}, {"MET", 1 * 60}, {"EET", 2 * 60}, {"IST", 3 * 60 + 30}, {"IDT", 4 * 60 + 30}, {"SST", 8 * 60}, {"HKT", 8 * 60}, {"KST", 9 * 60}, {"JST", 9 * 60}, {"KDT", 10 * 60}, {"NZST", 12 * 60}, }; #define TZLISTSIZ arraysize(tzlist) #endif /* DEP_LSPARSE */ u_int getfmode(c) int c; { int i; c = Xtolower(c); for (i = 0; typesymlist[i]; i++) if (c == typesymlist[i]) return(typelist[i]); return((u_int)-1); } int getfsymbol(mode) u_int mode; { int i; for (i = 0; i < arraysize(typelist); i++) if ((mode & S_IFMT) == typelist[i]) return(typesymlist[i]); return('\0'); } #ifdef NOUID int logical_access(mode) u_int mode; #else int logical_access(mode, uid, gid) u_int mode; u_id_t uid; g_id_t gid; #endif { int dir; dir = ((mode & S_IFMT) == S_IFDIR); #ifdef NOUID mode >>= 6; #else if ((uid_t)uid == geteuid()) mode >>= 6; else if ((gid_t)gid == getegid() || isgroupmember(gid)) mode >>= 3; #endif if (dir && !(mode & F_ISEXE)) mode &= ~(F_ISRED | F_ISWRI); return(mode & 007); } #ifdef DEP_LSPARSE static int NEAR readattr(tmp, buf) namelist *tmp; CONST char *buf; { int i, len; u_int n, mode; len = strlen(buf); if (len < 9) { mode = (tmp -> st_mode & S_IFMT) | S_IREAD_ALL | S_IWRITE_ALL; while (--len >= 0) { if ((n = getfmode(buf[len])) != (u_int)-1) { mode &= ~S_IFMT; mode |= n; } else switch (Xtolower(buf[len])) { case 'a': mode |= S_ISVTX; break; case 'h': mode &= ~S_IREAD_ALL; break; case 'r': case 'o': mode &= ~S_IWRITE_ALL; break; case 'w': case '-': case '.': case ' ': break; case 'v': mode &= ~S_IFMT; mode |= S_IFIFO; break; default: return(0); /*NOTREACHED*/ break; } } if ((mode & S_IFMT) == S_IFDIR) mode |= S_IEXEC_ALL; } else { mode = tmp -> st_mode & S_IFMT; i = len - 9; if (buf[i] == 'r' || buf[i] == 'R') mode |= S_IRUSR; else if (buf[i] != '-') return(0); i++; if (buf[i] == 'w' || buf[i] == 'W') mode |= S_IWUSR; else if (buf[i] != '-') return(0); i++; if (buf[i] == 'x' || buf[i] == 'X') mode |= S_IXUSR; else if (buf[i] == 's') mode |= (S_IXUSR | S_ISUID); else if (buf[i] == 'S') mode |= S_ISUID; else if (buf[i] != '-') return(0); i++; if (buf[i] == 'r' || buf[i] == 'R') mode |= S_IRGRP; else if (buf[i] != '-') return(0); i++; if (buf[i] == 'w' || buf[i] == 'W') mode |= S_IWGRP; else if (buf[i] != '-') return(0); i++; if (buf[i] == 'x' || buf[i] == 'X') mode |= S_IXGRP; else if (buf[i] == 's') mode |= (S_IXGRP | S_ISGID); else if (buf[i] == 'S') mode |= S_ISGID; else if (buf[i] != '-') return(0); i++; if (buf[i] == 'r' || buf[i] == 'R') mode |= S_IROTH; else if (buf[i] != '-') return(0); i++; if (buf[i] == 'w' || buf[i] == 'W') mode |= S_IWOTH; else if (buf[i] != '-') return(0); i++; if (buf[i] == 'x' || buf[i] == 'X') mode |= S_IXOTH; else if (buf[i] == 't') mode |= (S_IXOTH | S_ISVTX); else if (buf[i] == 'T') mode |= S_ISVTX; else if (buf[i] != '-') return(0); if (len >= 10 && !Xstrchr(IGNORETYPESYM, buf[len - 10])) { n = getfmode(buf[len - 10]); if (n == (u_int)-1) return(0); mode &= ~S_IFMT; mode |= n; } } tmp -> st_mode = mode; return(len); } static int NEAR readdatestr(s, list, max) CONST char *s, *list[]; int max; { int i; for (i = 0; i < max; i++) if (!Xstrncasecmp(s, list[i], 3)) return(i); return(-1); } static int NEAR readampm(s) CONST char *s; { int i; for (i = 0; i < AMLISTSIZ; i++) if (!Xstrcasecmp(s, amlist[i])) return(0); for (i = 0; i < PMLISTSIZ; i++) if (!Xstrcasecmp(s, pmlist[i])) return(1); return(-1); } VOID initlist(namep, name) namelist *namep; CONST char *name; { namep -> name = Xstrdup(name); namep -> ent = 0; namep -> st_mode = (S_IREAD_ALL | S_IWUSR | S_IFREG); namep -> st_nlink = 1; #ifndef NOUID namep -> st_uid = (u_id_t)-1; namep -> st_gid = (g_id_t)-1; #endif #ifndef NOSYMLINK namep -> linkname = NULL; #endif #ifdef HAVEFLAGS namep -> st_flags = 0; #endif namep -> st_size = (off_t)0; namep -> st_mtim = (time_t)0; namep -> flags = (F_ISRED | F_ISWRI); namep -> tmpflags = F_STAT; } VOID todirlist(namep, mode) namelist *namep; u_int mode; { if (mode == (u_int)-1) mode = S_IEXEC_ALL; else { namep -> st_mode &= S_IFMT; mode &= ~S_IFMT; } namep -> st_mode &= ~S_IFMT; namep -> st_mode |= (S_IFDIR | mode); if (!(namep -> st_size)) namep -> st_size = DEV_BSIZE; namep -> flags |= (F_ISEXE | F_ISDIR); } #ifdef OLDPARSE static int NEAR countfield(line, sep, field, eolp) CONST char *line; CONST u_char sep[]; int field, *eolp; { int i, j, f, s, sp; f = -1; s = 1; sp = (int)sep[0]; for (i = j = 0; line[i]; i++) { if (sp != SEP_NONE && i >= sp) { j++; sp = (j < MAXLSPARSESEP) ? (int)sep[j] : SEP_NONE; for (; sp == SEP_NONE || i < sp; i++) if (!Xisblank(line[i])) break; if (f < 0) f = 1; else f++; s = 0; } else if (Xisblank(line[i])) s = 1; else if (s) { f++; s = 0; } if (field < 0) continue; else if (f > field) return(-1); else if (f == field) { if (eolp) { for (j = i; line[j]; j++) { if ((sp != SEP_NONE && j >= sp) || Xisblank(line[j])) break; } *eolp = j; } return(i); } } return((field < 0) ? f : -1); } static char *NEAR getfield(buf, line, skip, list, n) char *buf; CONST char *line; int skip; CONST lsparse_t *list; int n; { CONST char *cp; char *tmp; int i, f, eol; *buf = '\0'; f = (list -> field[n] != FLD_NONE) ? (int)(list -> field[n]) - skip : -1; if (f < 0 || (i = countfield(line, list -> sep, f, &eol)) < 0) return(buf); cp = &(line[i]); i = (int)(list -> delim[n]); if (i >= 128) { i -= 128; if (&(cp[i]) < &(line[eol])) cp += i; else return(buf); } else if (i && (!(cp = Xstrchr(cp, i)) || ++cp >= &(line[eol]))) return(buf); i = (int)(list -> width[n]); if (i >= 128) i -= 128; else if (i) { if ((tmp = Xstrchr(cp, i))) i = tmp - cp; else i = &(line[eol]) - cp; } if (!i || &(cp[i]) > &(line[eol])) i = &(line[eol]) - cp; Xstrncpy(buf, cp, i); return(buf); } static int NEAR readfileent(tmp, line, list, max) namelist *tmp; CONST char *line; CONST lsparse_t *list; int max; { # ifndef NOUID uidtable *up; gidtable *gp; u_id_t uid; g_id_t gid; # endif struct tm tm, *tp; time_t t; off_t n; int i, skip; char *cp, *buf; i = countfield(line, list -> sep, -1, NULL); skip = (max > i) ? max - i : 0; buf = Xmalloc(strlen(line) + 1); initlist(tmp, NULL); tmp -> st_mode = 0; tmp -> flags = 0; getfield(buf, line, skip, list, F_NAME); if (!*buf) { Xfree(buf); return(-1); } # if MSDOS # ifdef BSPATHDELIM for (i = 0; buf[i]; i++) if (buf[i] == '/') buf[i] = _SC_; # else for (i = 0; buf[i]; i++) { if (buf[i] == '\\') buf[i] = _SC_; else if (iskanji1(buf, i)) i++; } # endif # endif /* MSDOS */ if (isdelim(buf, i = (int)strlen(buf) - 1)) { if (i > 0) buf[i] = '\0'; tmp -> st_mode |= S_IFDIR; } tmp -> name = Xstrdup(buf); getfield(buf, line, skip, list, F_MODE); readattr(tmp, buf); if (!(tmp -> st_mode & S_IFMT)) tmp -> st_mode |= S_IFREG; if (s_isdir(tmp)) tmp -> flags |= F_ISDIR; else if (s_islnk(tmp)) tmp -> flags |= F_ISLNK; else if (s_ischr(tmp) || s_isblk(tmp)) tmp -> flags |= F_ISDEV; # ifndef NOUID getfield(buf, line, skip, list, F_UID); if (Xsscanf(buf, "%-<*d%$", sizeof(uid), &uid)) tmp -> st_uid = uid; else tmp -> st_uid = ((up = finduid(0, buf))) ? up -> uid : (u_id_t)-1; getfield(buf, line, skip, list, F_GID); if (Xsscanf(buf, "%-<*d%$", sizeof(gid), &gid)) tmp -> st_gid = gid; else tmp -> st_gid = ((gp = findgid(0, buf))) ? gp -> gid : (g_id_t)-1; # endif getfield(buf, line, skip, list, F_SIZE); tmp -> st_size = (Xsscanf(buf, "%qd%$", &n)) ? n : (off_t)0; getfield(buf, line, skip, list, F_MON); if ((i = readdatestr(buf, monthlist, MONTHLISTSIZ)) >= 0) tm.tm_mon = i; else if ((i = Xatoi(buf)) >= 1 && i < 12) tm.tm_mon = i - 1; else tm.tm_mon = 0; getfield(buf, line, skip, list, F_DAY); tm.tm_mday = ((i = Xatoi(buf)) >= 1 && i < 31) ? i : 1; getfield(buf, line, skip, list, F_YEAR); if (!*buf) tm.tm_year = 1970; else if ((i = Xatoi(buf)) >= 0) tm.tm_year = i; else if (list -> field[F_YEAR] == list -> field[F_TIME] && Xstrchr(buf, ':')) { t = Xtime(NULL); # ifdef DEBUG _mtrace_file = "localtime(start)"; tp = localtime(&t); if (_mtrace_file) _mtrace_file = NULL; else { _mtrace_file = "localtime(end)"; malloc(0); /* dummy malloc */ } # else tp = localtime(&t); # endif tm.tm_year = tp -> tm_year; if (tm.tm_mon > tp -> tm_mon || (tm.tm_mon == tp -> tm_mon && tm.tm_mday > tp -> tm_mday)) tm.tm_year--; } else tm.tm_year = 1970; if (tm.tm_year < 1900 && (tm.tm_year += 1900) < 1970) tm.tm_year += 100; tm.tm_year -= 1900; getfield(buf, line, skip, list, F_TIME); if (!(cp = Xsscanf(buf, "%d", &i)) || i > 23) tm.tm_hour = tm.tm_min = tm.tm_sec = 0; else { tm.tm_hour = i; if (!(cp = Xsscanf(cp, ":%d", &i)) || i > 59) tm.tm_min = tm.tm_sec = 0; else { tm.tm_min = i; if (!Xsscanf(cp, ":%d%$", &i) || i > 60) tm.tm_sec = 0; else tm.tm_sec = i; } } tmp -> st_mtim = Xtimelocal(&tm); tmp -> flags |= logical_access2(tmp); Xfree(buf); return(0); } #else /* !OLDPARSE */ static char *NEAR checkspace(s, scorep) CONST char *s; int *scorep; { int i; if (Xisblank(*s)) { (*scorep)++; s = skipspace(&(s[1])); } for (i = 0; s[i]; i++) { if (Xisblank(s[i])) { (*scorep)++; for (i++; Xisblank(s[i]); i++) /*EMPTY*/; if (!s[i]) break; *scorep += 4; } } return(Xstrndup(s, i)); } # ifdef DEP_FILECONV static char *NEAR readfname(s, len) CONST char *s; int len; { char *cp; cp = Xstrndup(s, len); renewkanjiconv(&cp, fnamekcode, DEFCODE, L_FNAME); return(cp); } # endif /* DEP_FILECONV */ # ifdef DEP_FTPPATH static char *NEAR readbasename(s, len) CONST char *s; int len; { CONST char *cp; int i; if (!s) return(NULL); cp = NULL; for (i = 0; i < len; i++) { if (s[i] == _SC_) cp = &(s[i]); else if (iswchar(s, i)) i++; if (!(s[i])) break; } if (cp) { len -= ++cp - s; s = cp; } return(readfname(s, len)); } # endif /* DEP_FTPPATH */ # ifndef NOSYMLINK static char *NEAR readlinkname(s, len) CONST char *s; int len; { int i; for (i = 0; i < LINKLISTSIZ; i++) { if (linklist[i].len > len) continue; if (!strncmp(s, linklist[i].name, linklist[i].len)) { s += linklist[i].len; return(skipspace(s)); } } return(NULL); } # endif /* !NOSYMLINK */ static int NEAR readfileent(tmp, line, form, skip, flags) namelist *tmp; CONST char *line, *form; int skip, flags; { # ifndef NOUID uidtable *up; gidtable *gp; u_id_t uid; g_id_t gid; # endif # ifndef NOSYMLINK CONST char *line2, *lname; # endif struct tm tm, *tp; time_t t; off_t size, frac, unit; CONST char *s, *lastform; char *cp, *buf, *eol, *rawbuf; u_int mode; int i, n, ch, l, len, pm, maj, min, hit, err, err2, retr, score; if (skip && skip > strlen(form)) return(-1); initlist(tmp, NULL); tmp -> st_mode &= ~S_IFREG; tmp -> flags = 0; tm.tm_year = tm.tm_mon = tm.tm_mday = -1; tm.tm_hour = tm.tm_min = tm.tm_sec = -1; pm = maj = min = -1; mode = (u_int)-1; score = 0; while (*(lastform = form)) if (Xisblank(*form)) { line = skipspace(line); form++; } else if (*form == '\n') { if (*line != *(form++)) score += 20; else line++; line = skipspace(line); } else if (*form != '%' || *(++form) == '%') { ch = *(form++); if (skip) { skip--; continue; } if (*line != ch) score += 10; else line++; } else { ch = '\0'; if (*form == '*') { form++; for (i = 0; line[i]; i++) if (line[i] == '\n') break; len = i; } else if (!(cp = Xsscanf(form, "%+d", &len))) len = -1; else { form = cp; for (i = 0; i < len; i++) if (!line[i]) break; len = i; ch = -1; } for (n = 0; n < strsize(sympairlist); n++) if (*form == sympairlist[n++]) break; s = form++; if (n >= strsize(sympairlist)) l = 1; else { form = Xstrchr(form, sympairlist[n]); if (!form || form <= &(s[1])) { Xfree(tmp -> name); # ifndef NOSYMLINK Xfree(tmp -> linkname); # endif return(-1); } l = ++form - s; if (*s == '{') { s++; l -= 2; } } if (skip) { skip--; continue; } if (len < 0) { if (!Xisblank(*form) && (*form != '%' || form[1] == '%')) ch = *form; for (len = 0; line[len]; len++) { if (ch) { if (ch == line[len]) break; } else if (Xisblank(line[len])) break; } } rawbuf = Xstrndup(line, len); hit = err = err2 = retr = 0; buf = checkspace(rawbuf, &err); for (i = 0; i < l; i++) switch (s[i]) { case 'a': if (readattr(tmp, buf)) { hit++; mode = tmp -> st_mode; } break; case 'l': if ((n = Xatoi(buf)) < 0) break; tmp -> st_nlink = n; hit++; break; case 'u': # ifndef NOUID cp = Xsscanf(buf, "%-<*d%$", sizeof(uid), &uid); if (cp) tmp -> st_uid = uid; else if ((up = finduid(0, buf))) tmp -> st_uid = up -> uid; # endif hit++; break; case 'g': # ifndef NOUID cp = Xsscanf(buf, "%-<*d%$", sizeof(gid), &gid); if (cp) tmp -> st_gid = gid; else if ((gp = findgid(0, buf))) tmp -> st_gid = gp -> gid; # endif hit++; break; case 's': if (buf[0] == '-' && !buf[1]) { hit++; break; } if (!(cp = Xsscanf(buf, "%qd", &size))) break; unit = (off_t)1024 * (off_t)1024 * (off_t)1024; frac = (off_t)0; if (*cp == '.') { for (cp++; Xisdigit(*cp); cp++) { unit /= (off_t)10; frac += unit * (*cp - '0'); } } n = Xtoupper(*cp); if (n == 'K') { size *= (off_t)1024; size += frac / ((off_t)1024 * (off_t)1024); } else if (n == 'M') { size *= (off_t)1024 * (off_t)1024; size += frac / (off_t)1024; } else if (n == 'G') { size *= (off_t)1024 * (off_t)1024 * (off_t)1024; size += frac; } else n = '\0'; if (n && Xtoupper(*(++cp)) == 'B') cp++; if (*cp) err2++; tmp -> st_size = size; hit++; break; case 'y': if ((n = Xatoi(buf)) < 0) break; tm.tm_year = n; hit++; break; case 'm': n = readdatestr(buf, monthlist, MONTHLISTSIZ); if (n >= 0) tm.tm_mon = n; else if ((n = Xatoi(buf)) >= 1 && n <= 12) tm.tm_mon = n - 1; else break; hit++; break; case 'd': if ((n = Xatoi(buf)) < 1 || n > 31) break; tm.tm_mday = n; hit++; break; case 'w': n = readdatestr(buf, weeklist, WEEKLISTSIZ); if (n < 0) break; hit++; break; case 't': if (!(cp = Xsscanf(buf, "%d", &n)) || n > 23) break; tm.tm_hour = n; hit++; if (!(cp = Xsscanf(cp, ":%d", &n)) || n > 59) { tm.tm_min = tm.tm_sec = 0; err2++; break; } tm.tm_min = n; if (*cp != ':') n = 0; else if (!(cp = Xsscanf(&(cp[1]), "%d", &n)) || n > 60) { tm.tm_sec = 0; break; } tm.tm_sec = n; if (!*cp) /*EMPTY*/; else if ((n = readampm(cp)) >= 0) pm = n; else err2++; break; case 'p': if ((n = readampm(buf)) < 0) break; pm = n; hit++; break; case 'B': if ((n = Xatoi(buf)) < 0) break; maj = n; hit++; break; case 'b': if ((n = Xatoi(buf)) < 0) break; min = n; hit++; break; case 'L': if (hit) break; eol = &(rawbuf[len]); for (n = 0; n < len; n++) { cp = &(rawbuf[n]); # ifdef BSPATHDELIM if (*cp == '/') *cp = _SC_; # else /* !BSPATHDELIM */ # if MSDOS if (*cp == '\\') *cp = _SC_; else if (iskanji1(rawbuf, n)) { n++; continue; } # endif # endif /* !BSPATHDELIM */ if (!Xisblank(*cp)) continue; cp = skipspace(&(cp[1])); if (cp >= eol) { if (!ch) n = len; break; } } while (isdelim(rawbuf, n - 1)) n--; if (n <= 0) break; # ifndef NOSYMLINK Xfree(tmp -> linkname); tmp -> linkname = readfname(rawbuf, n); # endif tmp -> st_mode &= ~S_IFMT; tmp -> st_mode |= S_IFLNK; hit++; err = 0; break; case '/': n = l - ++i; if ((cp = Xmemchr(&(s[i]), '/', n))) n = cp - &(s[i]); if (Xstrncasecmp(buf, &(s[i]), n) || buf[n]) /*EMPTY*/; else { todirlist(tmp, mode); hit++; } i += n; break; case '!': n = l - ++i; if ((cp = Xmemchr(&(s[i]), '!', n))) n = cp - &(s[i]); if (Xstrncasecmp(buf, &(s[i]), n) || buf[n]) retr++; else form = lastform; hit++; i += n; break; case 'f': eol = &(rawbuf[len]); # ifndef NOSYMLINK lname = NULL; # endif for (n = 0; n < len; n++) { cp = &(rawbuf[n]); # ifdef BSPATHDELIM if (*cp == '/') *cp = _SC_; # else /* !BSPATHDELIM */ # if MSDOS if (*cp == '\\') *cp = _SC_; else if (iskanji1(rawbuf, n)) { n++; continue; } # endif # endif /* !BSPATHDELIM */ if (!Xisblank(*cp)) continue; cp = skipspace(&(cp[1])); if (cp >= eol) { if (!ch) n = len; break; } # ifndef NOSYMLINK lname = readlinkname(cp, eol - cp); if (lname) break; # endif } # ifndef NOSYMLINK line2 = &(line[n]); # endif if (isdelim(rawbuf, n - 1)) { todirlist(tmp, mode); while (isdelim(rawbuf, --n - 1)) /*EMPTY*/; } if (n <= 0) break; Xfree(tmp -> name); # ifdef DEP_FTPPATH if (flags & LF_BASENAME) tmp -> name = readbasename(rawbuf, n); else # endif tmp -> name = readfname(rawbuf, n); if (!(flags & LF_NOTRAVERSE)) /*EMPTY*/; else if (strdelim(tmp -> name, 0)) { hit = -1; break; } hit++; err = 0; # ifndef NOSYMLINK if (!lname) break; line2 = skipspace(line2); if (ch && line2 >= &(line[len])) break; lname = &(line[lname - rawbuf]); for (n = 0; lname[n]; n++) if (Xisblank(lname[n])) break; if (n) { Xfree(tmp -> linkname); tmp -> linkname = readfname(lname, n); tmp -> st_mode &= ~S_IFMT; tmp -> st_mode |= S_IFLNK; n = &(lname[n]) - line; if (n > len) len = n; } # endif break; case 'x': hit++; err = 0; break; default: hit = -1; break; } Xfree(buf); Xfree(rawbuf); if (hit < 0) { Xfree(tmp -> name); # ifndef NOSYMLINK Xfree(tmp -> linkname); # endif return(hit); } if (!hit) score += 5; else if (hit <= err2) score += err2; score += err; if (!retr) { line += len; if (!ch) line = skipspace(line); } } if (score >= MAXSCORE || !(tmp -> name) || !*(tmp -> name)) { Xfree(tmp -> name); # ifndef NOSYMLINK Xfree(tmp -> linkname); # endif return(MAXSCORE); } if (!(tmp -> st_mode & S_IFMT)) tmp -> st_mode |= S_IFREG; if (s_isdir(tmp)) tmp -> flags |= F_ISDIR; else if (s_islnk(tmp)) tmp -> flags |= F_ISLNK; else if (s_ischr(tmp) || s_isblk(tmp)) { tmp -> flags |= F_ISDEV; if (maj >= 0 || min >= 0) { if (maj < 0) maj = 0; if (min < 0) min = 0; tmp -> st_size = makedev(maj, min); } } if (tm.tm_year < 0) { t = Xtime(NULL); # ifdef DEBUG _mtrace_file = "localtime(start)"; tp = localtime(&t); if (_mtrace_file) _mtrace_file = NULL; else { _mtrace_file = "localtime(end)"; malloc(0); /* dummy malloc */ } # else tp = localtime(&t); # endif tm.tm_year = tp -> tm_year; if (tm.tm_mon < 0 || tm.tm_mday < 0) tm.tm_year = 1970 - 1900; else if (tm.tm_mon > tp -> tm_mon || (tm.tm_mon == tp -> tm_mon && tm.tm_mday > tp -> tm_mday)) tm.tm_year--; } else { if (tm.tm_year < 1900 && (tm.tm_year += 1900) < 1970) tm.tm_year += 100; tm.tm_year -= 1900; } if (tm.tm_mon < 0) tm.tm_mon = 0; if (tm.tm_mday < 0) tm.tm_mday = 1; if (tm.tm_hour < 0) tm.tm_hour = 0; else if (pm > 0) tm.tm_hour = (tm.tm_hour % 12) + 12; else if (!pm) tm.tm_hour %= 12; if (tm.tm_min < 0) tm.tm_min = 0; if (tm.tm_sec < 0) tm.tm_sec = 0; tmp -> st_mtim = Xtimelocal(&tm); tmp -> flags |= logical_access2(tmp); return(score); } #endif /* !OLDPARSE */ static int NEAR dircmp(s1, s2) CONST char *s1, *s2; { int i, j; for (i = j = 0; s2[j]; i++, j++) { if (s1[i] == s2[j]) { #ifdef BSPATHDELIM if (iskanji1(s1, i) && (s1[++i] != s2[++j] || !s2[j])) return(s1[i] - s2[j]); #endif continue; } if (s1[i] != _SC_ || s2[j] != _SC_) return(s1[i] - s2[j]); while (s1[i + 1] == _SC_) i++; while (s2[j + 1] == _SC_) j++; } return(s1[i]); } int dirmatchlen(s1, s2) CONST char *s1, *s2; { int i, j; for (i = j = 0; s1[i]; i++, j++) { if (s1[i] == s2[j]) { #ifdef BSPATHDELIM if (iskanji1(s1, i)) { if (s1[++i] != s2[++j]) return(0); if (!(s1[i])) break; } #endif continue; } if (s1[i] != _SC_ || s2[j] != _SC_) return(0); while (s1[i + 1] == _SC_) i++; while (s2[j + 1] == _SC_) j++; } if (s2[j] && s2[j] != _SC_) { for (j = 0; s1[j] == _SC_; j++) /*EMPTY*/; return((i == j) ? 1 : 0); } if (i && s2[j]) while (s2[j + 1] == _SC_) j++; return(j); } static char *NEAR pseudodir(namep, list, max) namelist *namep, *list; int max; { char *cp, *next; int i, len; u_short ent; for (cp = namep -> name; (next = strdelim(cp, 0)); cp = ++next) { while (next[1] == _SC_) next++; if (!next[1]) break; len = next - namep -> name; if (!len) len++; for (i = 0; i < max; i++) { if (isdir(&(list[i])) && len == dirmatchlen(list[i].name, namep -> name)) break; } if (i >= max) return(Xstrndup(namep -> name, len)); if (strncmp(list[i].name, namep -> name, len)) { list[i].name = Xrealloc(list[i].name, len + 1); Xstrncpy(list[i].name, namep -> name, len); } } if (isdir(namep) && !isdotdir(namep -> name)) for (i = 0; i < max; i++) { if (isdir(&(list[i])) && !dircmp(list[i].name, namep -> name)) { cp = list[i].name; ent = list[i].ent; memcpy((char *)&(list[i]), (char *)namep, sizeof(*list)); list[i].name = cp; list[i].ent = ent; return(NULL); } } return(vnullstr); } #ifndef OLDPARSE static char **NEAR decodevar(argv) char *CONST *argv; { char **new; int n, max; max = countvar(argv); new = (char **)Xmalloc((max + 1) * sizeof(char *)); for (n = 0; n < max; n++) new[n] = decodestr(argv[n], NULL, 0); new[n] = NULL; return(new); } static int NEAR matchlist(s, argv) CONST char *s; char *CONST *argv; { # ifndef PATHNOCASE int duppathignorecase; # endif reg_ex_t *re; CONST char *s1, *s2; char *new; int i, len, ret; if (!argv) return(0); # ifndef PATHNOCASE duppathignorecase = pathignorecase; pathignorecase = 0; # endif ret = 0; for (i = 0; !ret && argv[i]; i++) { s1 = argv[i]; s2 = s; if (!Xisblank(s1[0])) s2 = skipspace(s2); len = strlen(s1); if (!len || Xisblank(s1[len - 1])) new = Xstrdup(s2); else { len = strlen(s2); for (len--; len >= 0; len--) if (!Xisblank(s2[len])) break; new = Xstrndup(s2, ++len); } re = regexp_init(s1, -1); ret = regexp_exec(re, new, 0); Xfree(new); regexp_free(re); } # ifndef PATHNOCASE pathignorecase = duppathignorecase; # endif return(ret); } #endif /* !OLDPARSE */ int parsefilelist(vp, list, namep, nlinep, func) VOID_P vp; CONST lsparse_t *list; namelist *namep; int *nlinep; char *(*func)__P_((VOID_P)); { #ifdef OLDPARSE int max; #else static char **formlist = NULL; static char **lign = NULL; static char **lerr = NULL; namelist tmp; CONST char *form; char *form0, *form2; short *scorelist; int nf, na, ret, skip; #endif static char **lvar = NULL; char *cp; int i, score, len, nline, needline; if (!vp) { freevar(lvar); lvar = NULL; #ifndef OLDPARSE freevar(formlist); freevar(lign); freevar(lerr); if (!list || !(list -> format)) formlist = lign = lerr = NULL; else { formlist = decodevar(list -> format); lign = decodevar(list -> lignore); lerr = decodevar(list -> lerror); } #endif return(0); } #ifndef OLDPARSE if (!formlist || !*formlist) return(-3); #endif if (!(nline = countvar(lvar))) { lvar = (char **)Xrealloc(lvar, (nline + 2) * sizeof(char *)); if (!(lvar[nline] = (*func)(vp))) return(-1); lvar[++nline] = NULL; } if (lsintrfunc && (*lsintrfunc)()) return(-2); #ifndef OLDPARSE if (matchlist(lvar[0], lign)) { Xfree(lvar[0]); memmove((char *)(&(lvar[0])), (char *)(&(lvar[1])), nline * sizeof(*lvar)); (*nlinep)++; return(0); } if (matchlist(lvar[0], lerr)) return(-3); #endif #ifdef OLDPARSE max = 0; for (i = 0; i < MAXLSPARSEFIELD; i++) { if (list -> field[i] == FLD_NONE) continue; if ((int)(list -> field[i]) > max) max = (int)(list -> field[i]); } #else nf = countvar(formlist); scorelist = (short *)Xmalloc(nf * sizeof(short)); for (i = 0; i < nf; i++) scorelist[i] = MAXSCORE; nf = na = skip = 0; form0 = NULL; ret = 1; #endif namep -> name = NULL; #ifndef NOSYMLINK namep -> linkname = NULL; #endif needline = 0; for (;;) { #ifdef OLDPARSE needline = list -> lines; #else /* !OLDPARSE */ # ifdef FAKEUNINIT form2 = NULL; /* fake for -Wuninitialized */ # endif if (formlist[nf]) form = form2 = formlist[nf]; else if (scorelist[0] < MAXSCORE) { ret = scorelist[0] + 1; score = 0; break; } else if (na < AUTOFORMATSIZ) form = autoformat[na++]; else { if (!form0) form0 = decodestr(list -> format[0], NULL, 0); form = form0; skip++; } needline = 1; for (i = 0; form[i]; i++) if (form[i] == '\n') needline++; #endif /* !OLDPARSE */ if (nline < needline) { lvar = (char **)Xrealloc(lvar, (needline + 1) * sizeof(char *)); for (; nline < needline; nline++) if (!(lvar[nline] = (*func)(vp))) break; lvar[nline] = NULL; if (nline < needline) { #ifndef OLDPARSE if (needline > 1 && na < AUTOFORMATSIZ) { if (!formlist[nf]) continue; Xfree(formlist[nf]); for (i = nf; formlist[i]; i++) formlist[i] = formlist[i + 1]; continue; } Xfree(namep -> name); namep -> name = NULL; # ifndef NOSYMLINK Xfree(namep -> linkname); namep -> linkname = NULL; # endif Xfree(form0); Xfree(scorelist); #endif /* !OLDPARSE */ *nlinep += nline; return(-1); } } for (i = len = 0; i < needline; i++) len += strlen(lvar[i]) + 1; cp = Xmalloc(len + 1); for (i = len = 0; i < needline; i++) { Xstrcpy(&(cp[len]), lvar[i]); len += strlen(lvar[i]); cp[len++] = LINESEP; } if (len > 0) len--; cp[len] = '\0'; #ifdef OLDPARSE score = readfileent(namep, cp, list, max); Xfree(cp); break; /*NOTREACHED*/ #else /* !OLDPARSE */ score = readfileent(&tmp, cp, form, skip, list -> flags); Xfree(cp); if (score < 0) { if (formlist[nf]) { Xfree(formlist[nf]); for (i = nf; formlist[i]; i++) formlist[i] = formlist[i + 1]; } else if (na >= AUTOFORMATSIZ) break; continue; } if (!formlist[nf]) { if (score < scorelist[0]) i = 0; } else { for (i = 0; i < nf; i++) if (score < scorelist[i]) { memmove((char *)(&(formlist[i + 1])), (char *)(&(formlist[i])), (nf - i) * sizeof(*formlist)); memmove((char *)(&(scorelist[i + 1])), (char *)(&(scorelist[i])), (nf - i) * sizeof(*scorelist)); break; } scorelist[i] = score; formlist[i] = form2; nf++; } if (score >= MAXSCORE); else if (!i) { Xfree(namep -> name); # ifndef NOSYMLINK Xfree(namep -> linkname); # endif memcpy((char *)namep, (char *)&tmp, sizeof(*namep)); } else { Xfree(tmp.name); # ifndef NOSYMLINK Xfree(tmp.linkname); # endif } if (!score) break; #endif /* !OLDPARSE */ } #ifndef OLDPARSE if (score < 0) { Xfree(namep -> name); namep -> name = NULL; # ifndef NOSYMLINK Xfree(namep -> linkname); namep -> linkname = NULL; # endif } #endif /* !OLDPARSE */ if (lvar) { for (i = 0; i < needline; i++) Xfree(lvar[i]); if (nline + 1 > needline) memmove((char *)(&(lvar[0])), (char *)(&(lvar[needline])), (nline - needline + 1) * sizeof(*lvar)); } *nlinep += needline; #ifdef OLDPARSE return((score) ? 0 : 1); #else Xfree(form0); Xfree(scorelist); return((score) ? 0 : ret); #endif } namelist *addlist(list, max, entp) namelist *list; int max, *entp; { int ent; if (!entp) ent = max + 1; else { if (max < *entp) return(list); ent = *entp = ((max + 1) / BUFUNIT + 1) * BUFUNIT; } list = (namelist *)Xrealloc(list, ent * sizeof(namelist)); return(list); } VOID freelist(list, max) namelist *list; int max; { int i; if (list) { for (i = 0; i < max; i++) { Xfree(list[i].name); #ifndef NOSYMLINK Xfree(list[i].linkname); #endif } Xfree(list); } } int lsparse(vp, list, listp, func) VOID_P vp; CONST lsparse_t *list; namelist **listp; char *(*func) __P_((VOID_P)); { namelist tmp; char *cp, *dir; int n, nline, max, ent, score; for (n = 0; n < (int)(list -> topskip); n++) { if (!(cp = (*func)(vp))) break; Xfree(cp); } max = ent = 0; *listp = addlist(*listp, max, &ent); initlist(&((*listp)[0]), parentpath); todirlist(&((*listp)[0]), (u_int)-1); max++; nline = 0; #ifdef HAVEFLAGS tmp.st_flags = (u_long)0; #endif score = -1; parsefilelist(NULL, list, NULL, NULL, NULL); for (;;) { n = parsefilelist(vp, list, &tmp, &nline, func); if (n < 0) { if (n == -1) break; parsefilelist(NULL, NULL, NULL, NULL, NULL); freelist(*listp, max); *listp = NULL; return(n); } if (!n) continue; else if (score < 0) score = n; else if (n > score) continue; if (list -> flags & LF_NOTRAVERSE) dir = vnullstr; else for (;;) { dir = pseudodir(&tmp, *listp, max); if (!dir || dir == vnullstr) break; *listp = addlist(*listp, max, &ent); memcpy((char *)&((*listp)[max]), (char *)&tmp, sizeof(**listp)); todirlist(&((*listp)[max]), (u_int)-1); (*listp)[max].name = dir; #ifndef NOSYMLINK (*listp)[max].linkname = NULL; #endif (*listp)[max].ent = nline; max++; } if (!dir) { Xfree(tmp.name); #ifndef NOSYMLINK Xfree(tmp.linkname); #endif continue; } if (isdotdir(tmp.name) != 1 || max <= 0 || isdotdir((*listp)[0].name) != 1) *listp = addlist(*listp, max, &ent); else { Xfree((*listp)[0].name); #ifndef NOSYMLINK Xfree((*listp)[0].linkname); #endif memmove((char *)&((*listp)[0]), (char *)&((*listp)[1]), --max * sizeof(**listp)); } memcpy((char *)&((*listp)[max]), (char *)&tmp, sizeof(**listp)); (*listp)[max].ent = nline; max++; } parsefilelist(NULL, NULL, NULL, NULL, NULL); nline -= (int)(list -> bottomskip); for (n = max - 1; n > 0; n--) { if ((*listp)[n].ent <= nline) break; Xfree((*listp)[n].name); #ifndef NOSYMLINK Xfree((*listp)[n].linkname); #endif } max = n + 1; for (n = 0; n < max; n++) (*listp)[n].ent = n; return(max); } int Xstrptime(s, fmt, tm, tzp) CONST char *s, *fmt; struct tm *tm; int *tzp; { char *cp; int n, c, len, cent, hour, pm, tz; cent = hour = tz = 0; pm = -1; tm -> tm_year = tm -> tm_mon = tm -> tm_mday = tm -> tm_hour = tm -> tm_min = tm -> tm_sec = 0; for (; *fmt; fmt++) { if (*fmt == ' ') { if (*s == ' ') for (s++; *s == ' '; s++) /*EMPTY*/; continue; } if (*fmt != '%' || *(++fmt) == '%') { if (*(s++) != *fmt) return(-1); continue; } c = (fmt[1] != '%' || fmt[2] == '%') ? fmt[1] : ' '; for (len = 0; s[len]; len++) if (s[len] == c) break; cp = Xstrndup(s, len); s += len; n = 0; switch (*fmt) { case 'a': case 'A': n = readdatestr(cp, weeklist, WEEKLISTSIZ); #if 0 if (n >= 0) tm -> tm_wday = n; #endif break; case 'b': case 'B': case 'h': n = readdatestr(cp, monthlist, MONTHLISTSIZ); if (n >= 0) tm -> tm_mon = n; break; case 'C': if ((n = Xatoi(cp)) < 19 || n > 99) n = -1; else cent = n; break; case 'd': case 'e': if ((n = Xatoi(cp)) < 0 || n > 31) n = -1; else tm -> tm_mday = n; break; case 'H': if ((n = Xatoi(cp)) < 0 || n > 23) n = -1; else tm -> tm_hour = n; break; case 'I': if ((n = Xatoi(cp)) < 1 || n > 12) n = -1; else hour = n; break; case 'm': if ((n = Xatoi(cp)) < 1 || n > 12) n = -1; else tm -> tm_mon = n - 1; break; case 'M': if ((n = Xatoi(cp)) < 0 || n > 59) n = -1; else tm -> tm_min = n; break; case 'p': n = readampm(cp); if (n >= 0) pm = n; break; case 'S': if ((n = Xatoi(cp)) < 0 || n > 60) n = -1; else tm -> tm_sec = n; break; case 'u': if ((n = Xatoi(cp)) < 1 || n > 7) n = -1; #if 0 else tm -> tm_wday = n % 7; #endif break; case 'w': if ((n = Xatoi(cp)) < 0 || n > 6) n = -1; #if 0 else tm -> tm_wday = n; #endif break; case 'y': if ((n = Xatoi(cp)) < 0 || n > 99) n = -1; else { if (n < 69) n += 100; tm -> tm_year = n; } break; case 'Y': if ((n = Xatoi(cp)) < 0 || n > 9999) n = -1; else tm -> tm_year = n - 1900; break; case 'Z': tz = 0; if (*cp == '-') tz = -1; else if (*cp == '+') tz = 1; if (tz) { if ((n = Xatoi(&(cp[1]))) < 0) break; n = (n / 100) * 60 + (n % 100); tz *= n; break; } else if (!strncmp(cp, "GMT", strsize("GMT"))) { n = strsize("GMT"); if (!cp[n]) break; else if (cp[n] == '-') tz = -1; else if (cp[n] == '+') tz = 1; else { n = -1; break; } n++; if ((n = Xatoi(&(cp[n]))) < 0) break; tz *= n * 60; break; } for (n = 0; n < TZLISTSIZ; n++) if (!strcmp(cp, tzlist[n].name)) break; if (n >= TZLISTSIZ) { n = -1; break; } tz = tzlist[n].len; break; default: n = -1; break; } Xfree(cp); if (n < 0) return(-1); } if (cent) tm -> tm_year = cent * 100 - 1900 + (tm -> tm_year % 100); if (hour) { if (pm > 0) hour = (hour % 12) + 12; else if (!pm) hour %= 12; tm -> tm_hour = hour; } if (tzp) *tzp = tz; return(0); } #endif /* DEP_LSPARSE */ FD-3.01j/archive.c100644 2105 1751 110434 13516612560 12511 0ustar shiraiuser/* * archive.c * * archive file accessing module */ #include "fd.h" #include "realpath.h" #include "kconv.h" #include "func.h" #include "kanji.h" #include "system.h" #include "termemu.h" #ifndef _NOARCHIVE #if MSDOS extern char *unixgetcurdir __P_((char *, int)); #endif #if FD >= 3 extern int widedigit; #endif extern int mark; #if FD >= 2 extern int sorttype; #endif extern int stackdepth; #ifndef _NOTRADLAYOUT extern int tradlayout; #endif extern int sizeinfo; extern off_t marksize; extern namelist filestack[]; extern char fullpath[]; #ifndef _NOCOLOR extern int ansicolor; #endif extern int win_x; extern int win_y; extern char *deftmpdir; extern int hideclock; extern int n_args; #ifdef OLDPARSE # if MSDOS #define PM_LHA 5, 2, \ {FLD_NONE, FLD_NONE, FLD_NONE, 1, 4, 4, 4, 5, 0}, \ {0, 0, 0, 0, 0, '-', 128 + 6, 0, 0}, \ {0, 0, 0, 0, '-', '-', 0, 0, 0}, \ {SEP_NONE, SEP_NONE, SEP_NONE}, 2 #define PM_TAR 0, 0, \ {0, 1, 1, 2, 5, 3, 4, 6, 7}, \ {0, 0, '/', 0, 0, 0, 0, 0, 0}, \ {0, '/', 0, 0, 0, 0, 0, 0, 0}, \ {SEP_NONE, SEP_NONE, SEP_NONE}, 1 # else /* !MSDOS */ #define PM_LHA 2, 2, \ {0, 1, 1, 2, 6, 4, 5, 6, 7}, \ {0, 0, '/', 0, 0, 0, 0, 0, 0}, \ {128 + 9, '/', 0, 0, 0, 0, 0, 0, 0}, \ {9, SEP_NONE, SEP_NONE}, 1 # ifdef UXPDS #define PM_TAR 0, 0, \ {0, 1, 1, 2, 6, 3, 4, 5, 7}, \ {0, 0, '/', 0, 0, 0, 0, 0, 0}, \ {128 + 10, '/', 0, 0, 0, 0, 0, 0, 0}, \ {10, SEP_NONE, SEP_NONE}, 1 # else /* !UXPDS */ # ifdef TARFROMPAX #define PM_TAR 0, 0, \ {0, 2, 3, 4, 7, 5, 6, 7, 8}, \ {0, 0, 0, 0, 0, 0, 0, 0, 0}, \ {0, 0, 0, 0, 0, 0, 0, 0, 0}, \ {SEP_NONE, SEP_NONE, SEP_NONE}, 1 # else /* !TARFROMPAX */ # ifdef TARUSESPACE #define PM_TAR 0, 0, \ {0, 1, 1, 2, 6, 3, 4, 5, 7}, \ {0, 0, '/', 0, 0, 0, 0, 0, 0}, \ {0, '/', 0, 0, 0, 0, 0, 0, 0}, \ {SEP_NONE, SEP_NONE, SEP_NONE}, 1 # else /* !TARUSESPACE */ #define PM_TAR 0, 0, \ {0, 1, 1, 2, 6, 3, 4, 5, 7}, \ {0, 0, '/', 0, 0, 0, 0, 0, 0}, \ {128 + 9, '/', 0, 0, 0, 0, 0, 0, 0}, \ {9, SEP_NONE, SEP_NONE}, 1 # endif /* !TARUSESPACE */ # endif /* !TARFROMPAX */ # endif /* !UXPDS */ # endif /* !MSDOS */ #define PM_NULL SKP_NONE, 0, \ {0, 0, 0, 0, 0, 0, 0, 0, 0}, \ {0, 0, 0, 0, 0, 0, 0, 0, 0}, \ {0, 0, 0, 0, 0, 0, 0, 0, 0}, \ {SEP_NONE, SEP_NONE, SEP_NONE}, 1 #define isarchbr(l) (((l) -> topskip) != SKP_NONE) #else /* !OLDPARSE */ #define PM_LHA form_lha, ign_lha, NULL, 0, 0 #define PM_TAR form_tar, NULL, NULL, 0, 0 #define PM_NULL NULL, NULL, NULL, 0, 0 #define isarchbr(l) ((l) -> format) #endif /* !OLDPARSE */ #ifndef _NOBROWSE static VOID NEAR copyargvar __P_((int, char *CONST *)); static VOID NEAR pushbrowsevar __P_((CONST char *)); static VOID NEAR popbrowsevar __P_((VOID_A)); #endif static VOID NEAR pusharchdupl __P_((VOID_A)); static VOID NEAR poparchdupl __P_((VOID_A)); static VOID NEAR Xwaitmes __P_((VOID_A)); static VOID NEAR unpackerror __P_((VOID_A)); static char *archfgets __P_((VOID_P)); static int NEAR readarchive __P_((CONST char *, lsparse_t *, int)); static CONST char *NEAR skiparchdir __P_((CONST char *)); static int NEAR getarchdirlen __P_((CONST char *)); static char *NEAR searcharchdir __P_((CONST char *, int)); static char *NEAR archoutdir __P_((VOID_A)); static int NEAR undertmp __P_((CONST char *)); #ifdef DEP_PSEUDOPATH static char *NEAR genfullpath __P_((char *, CONST char *, CONST char *, CONST char *)); static int NEAR archdostmpdir __P_((char *, char **, CONST char *)); #else static char *NEAR genfullpath __P_((char *, CONST char *, CONST char *)); #endif #ifndef NOSYMLINK static int NEAR archrealpath __P_((char *, char *)); static int NEAR unpacklink __P_((namelist *, CONST char *)); #endif #ifndef OLDPARSE static char *form_lha[] = { # if MSDOS "%*f\\n%s %x %x %y-%m-%d %t %a", /* MS-DOS (-v) */ "%1x %12f %s %x %x %y-%m-%d %t %a", /* MS-DOS (-l) */ # else "%a %u/%g %s %x %m %d %{yt} %*f", /* >=1.14 */ "%9a %u/%g %s %x %m %d %{yt} %*f", /* traditional */ # endif NULL }; static char *ign_lha[] = { # if MSDOS "Listing of archive : *", " Name Original *", "--------------*", # if defined (FAKEESCAPE) || !defined (BSPATHDELIM) "* files * ???.?% ?\077-?\077-?? ??:??:??", /* avoid trigraph */ # else "* files * ???.?%% ?\077-?\077-?? ??:??:??", /* avoid trigraph */ # endif "", # else /* !MSDOS */ " PERMSSN * UID*GID *", "----------*", " Total * file* ???.*%*", # endif /* !MSDOS */ NULL }; static char *form_tar[] = { # if MSDOS "%a %u/%g %s %m %d %t %y %*f", /* traditional */ "%a %u/%g %s %y-%m-%d %t %*f", /* GNU >=1.12 */ "%a %u/%g %s %m %d %y %t %*f", /* kmtar */ # else /* !MSDOS */ "%a %u/%g %s %m %d %t %y %*f", /* SVR4 */ "%a %u/%g %s %y-%m-%d %t %*f", /* GNU >=1.12 */ "%a %l %u %g %s %m %d %{yt} %*f", /* pax */ "%10a %u/%g %s %m %d %t %y %*f", /* tar (UXP/DS) */ "%9a %u/%g %s %m %d %t %y %*f", /* traditional */ "%a %u %g %s %m %d %t %y %*f", /* AIX */ "%a %u/%g %m %d %t %y %*f", /* IRIX */ # endif /* !MSDOS */ NULL }; #endif /* !OLDPARSE */ int maxlaunch = 0; int maxarchive = 0; #if defined (DEP_DYNAMICLIST) || !defined (_NOCUSTOMIZE) int origmaxlaunch = 0; int origmaxarchive = 0; #endif #ifdef DEP_DYNAMICLIST launchlist_t launchlist = NULL; origlaunchlist_t origlaunchlist #else /* !DEP_DYNAMICLIST */ # ifndef _NOCUSTOMIZE origlaunchlist_t origlaunchlist = NULL; # endif launchlist_t launchlist #endif /* !DEP_DYNAMICLIST */ = { #if MSDOS {"*.lzh", "lha v %S", PM_LHA, 0}, {"*.tar", "tar tvf %S", PM_TAR, 0}, {"*.tar.Z", "gzip -cd %S|tar tvf -", PM_TAR, 0}, {"*.tar.gz", "gzip -cd %S|tar tvf -", PM_TAR, 0}, {"*.tar.bz2", "bzip2 -cd %S|tar tvf -", PM_TAR, 0}, {"*.taz", "gzip -cd %S|tar tvf -", PM_TAR, 0}, {"*.tgz", "gzip -cd %S|tar tvf -", PM_TAR, 0}, #else /* !MSDOS */ {"*.lzh", "lha l", PM_LHA, 0}, {"*.tar", "tar tvf", PM_TAR, 0}, {"*.tar.Z", "zcat %C|tar tvf -", PM_TAR, 0}, {"*.tar.gz", "gzip -cd %C|tar tvf -", PM_TAR, 0}, {"*.tar.bz2", "bzip2 -cd %C|tar tvf -", PM_TAR, 0}, {"*.tar.xz", "xz -cd %C|tar tvf -", PM_TAR, 0}, # ifndef CYGWIN {"*.taZ", "zcat %C|tar tvf -", PM_TAR, 0}, # endif {"*.taz", "gzip -cd %C|tar tvf -", PM_TAR, 0}, {"*.tgz", "gzip -cd %C|tar tvf -", PM_TAR, 0}, {"*.txz", "xz -cd %C|tar tvf -", PM_TAR, 0}, #endif /* !MSDOS */ {NULL, NULL, PM_NULL, 0} }; #ifdef DEP_DYNAMICLIST archivelist_t archivelist = NULL; origarchivelist_t origarchivelist #else /* !DEP_DYNAMICLIST */ # ifndef _NOCUSTOMIZE origarchivelist_t origarchivelist = NULL; # endif archivelist_t archivelist #endif /* !DEP_DYNAMICLIST */ = { #if MSDOS {"*.lzh", "lha a %S %TA", "lha x %S %TA", 0}, {"*.tar", "tar cf %C %T", "tar xf %C %TA", 0}, {"*.tar.Z", "tar cf - %T|compress -c > %C", "gzip -cd %S|tar xf - %TA", 0}, {"*.tar.gz", "tar cf - %T|gzip -c > %C", "gzip -cd %S|tar xf - %TA", 0}, {"*.tar.bz2", "tar cf - %T|bzip2 -c > %C", "bzip2 -cd %S|tar xf - %TA", 0}, {"*.taz", "tar cf - %T|compress -c > %C", "gzip -cd %S|tar xf - %TA", 0}, {"*.tgz", "tar cf - %T|gzip -c > %C", "gzip -cd %S|tar xf - %TA", 0}, #else /* !MSDOS */ {"*.lzh", "lha aq %C %TA", "lha xq %C %TA", 0}, {"*.tar", "tar cf %C %T", "tar xf %C %TA", 0}, {"*.tar.Z", "tar cf - %T|compress -c > %C", "zcat %C|tar xf - %TA", 0}, {"*.tar.gz", "tar cf - %T|gzip -c > %C", "gzip -cd %C|tar xf - %TA", 0}, {"*.tar.bz2", "tar cf - %T|bzip2 -c > %C", "bzip2 -cd %C|tar xf - %TA", 0}, {"*.tar.xz", "tar cf - %T|xz -c > %C", "xz -cd %C|tar xf - %TA", 0}, # ifndef CYGWIN {"*.taZ", "tar cf - %T|compress -c > %C", "zcat %C|tar xf - %TA", 0}, # endif {"*.taz", "tar cf - %T|gzip -c > %C", "gzip -cd %C|tar xf - %TA", 0}, {"*.tgz", "tar cf - %T|gzip -c > %C", "gzip -cd %C|tar xf - %TA", 0}, {"*.txz", "tar cf - %T|xz -c > %C", "xz -cd %C|tar xf - %TA", 0}, #endif /* !MSDOS */ {NULL, NULL, NULL, 0} }; char archivedir[MAXPATHLEN]; #ifndef _NOBROWSE char **browsevar = NULL; #endif #ifndef _NOBROWSE static VOID NEAR copyargvar(argc, argv) int argc; char *CONST *argv; { int i; if (argvar && argvar[0]) for (i = 1; argvar[i]; i++) Xfree(argvar[i]); argvar = (char **)Xrealloc(argvar, (argc + 2) * sizeof(char *)); for (i = 0; i < argc; i++) argvar[i + 1] = Xstrdup(argv[i]); argvar[i + 1] = NULL; } static VOID NEAR pushbrowsevar(s) CONST char *s; { int i; i = countvar(browsevar); browsevar = (char **)Xrealloc(browsevar, (i + 2) * sizeof(char *)); if (!i) browsevar[1] = NULL; else memmove((char *)&(browsevar[1]), (char *)&(browsevar[0]), (i + 1) * sizeof(char *)); browsevar[0] = Xstrdup(s); copyargvar(i + 1, browsevar); } static VOID NEAR popbrowsevar(VOID_A) { int i; i = countvar(browsevar); if (i <= 0) return; Xfree(browsevar[0]); memmove((char *)&(browsevar[0]), (char *)&(browsevar[1]), i * sizeof(char *)); copyargvar(i - 1, browsevar); } #endif /* !_NOBROWSE */ static VOID NEAR pusharchdupl(VOID_A) { winvartable *new; new = (winvartable *)Xmalloc(sizeof(winvartable)); new -> v_archduplp = archduplp; new -> v_archivedir = NULL; new -> v_archivefile = archivefile; new -> v_archtmpdir = archtmpdir; new -> v_launchp = launchp; new -> v_arcflist = arcflist; new -> v_maxarcf = maxarcf; #ifdef DEP_PSEUDOPATH new -> v_archdrive = archdrive; #endif #ifndef _NOBROWSE new -> v_browselist = browselist; new -> v_browselevel = browselevel; #endif #ifndef _NOTREE new -> v_treepath = treepath; #endif new -> v_fullpath = new -> v_lastfile = NULL; new -> v_findpattern = findpattern; new -> v_filepos = filepos; new -> v_sorton = sorton; archduplp = new; } /*ARGSUSED*/ VOID escapearch(all) int all; { for (;;) { #ifndef _NOBROWSE if (!archduplp) { freebrowse(browselist); Xfree(archivefile); browselist = NULL; archivefile = NULL; break; } if (browselist) popbrowsevar(); #endif poparchdupl(); #ifndef _NOBROWSE if (all && browselist) continue; #endif break; } } static VOID NEAR poparchdupl(VOID_A) { #ifdef DEP_PSEUDOPATH int drive; #endif winvartable *old; char *cp, *dir; if (!(old = archduplp)) return; cp = archivefile; dir = archtmpdir; #ifdef DEP_PSEUDOPATH drive = archdrive; #endif freelist(arcflist, maxarcf); archduplp = old -> v_archduplp; if (!(old -> v_archivedir)) *archivedir = '\0'; else { Xstrcpy(archivedir, old -> v_archivedir); Xfree(old -> v_archivedir); } archivefile = old -> v_archivefile; archtmpdir = old -> v_archtmpdir; launchp = old -> v_launchp; arcflist = old -> v_arcflist; maxarcf = old -> v_maxarcf; #ifdef DEP_PSEUDOPATH archdrive = old -> v_archdrive; #endif #ifndef _NOBROWSE browselevel = old -> v_browselevel; #endif #ifndef _NOTREE treepath = old -> v_treepath; #endif Xfree(findpattern); findpattern = old -> v_findpattern; filepos = old -> v_filepos; sorton = old -> v_sorton; maxfile = 0; #ifndef _NOBROWSE if (browselist) { if (!(old -> v_browselist)) { freebrowse(browselist); browselist = NULL; } } else #endif #ifdef DEP_PSEUDOPATH if (drive > 0) { Xstrcpy(fullpath, old -> v_fullpath); Xfree(old -> v_fullpath); removetmp(dir, cp); } else #endif if (archivefile) { Xstrcpy(fullpath, old -> v_fullpath); Xfree(old -> v_fullpath); removetmp(dir, NULL); } Xfree(cp); Xfree(old); } VOID archbar(file, dir) CONST char *file, *dir; { #ifndef _NOBROWSE int i; #endif CONST char *cp; char *arch; int len; #ifndef _NOBROWSE if (browselist) { if (!browsevar) arch = Xstrdup(nullstr); else { len = 0; for (i = 0; browsevar[i]; i++) len += strlen(browsevar[i]) + 1; arch = Xmalloc(len + 1); len = 0; for (i--; i >= 0; i--) { Xstrcpy(&(arch[len]), browsevar[i]); len += strlen(browsevar[i]); if (i > 0) arch[len++] = '>'; } arch[len] = '\0'; } } else #endif /* !_NOBROWSE */ { arch = Xmalloc(strlen(fullpath) + strlen(file) + strlen(dir) + 3); Xstrcpy(Xstrcpy(strcatdelim2(arch, fullpath, file), ":"), dir); } #ifndef _NOTRADLAYOUT if (istradlayout()) { Xlocate(0, TL_PATH); Xputterm(L_CLEAR); Xlocate(TC_PATH, TL_PATH); # ifndef _NOBROWSE if (browselist) { cp = TS_BROWSE; len = TD_BROWSE; } else # endif { cp = TS_ARCH; len = TD_ARCH; } Xattrputs(cp, 1); cputstr(len, arch); Xfree(arch); Xlocate(TC_MARK, TL_PATH); VOID_C XXcprintf("%<*d", TD_MARK, mark); Xattrputs(TS_MARK, 1); VOID_C XXcprintf("%<'*qd", TD_SIZE, marksize); Xtflush(); return; } #endif /* !_NOTRADLAYOUT */ Xlocate(0, L_PATH); Xputterm(L_CLEAR); Xlocate(C_PATH, L_PATH); #ifndef _NOBROWSE if (browselist) { cp = S_BROWSE; len = D_BROWSE; } else #endif { cp = S_ARCH; len = D_ARCH; } Xattrputs(cp, 1); cputstr(len, arch); Xfree(arch); Xtflush(); } static VOID NEAR Xwaitmes(VOID_A) { int x, y; x = win_x; y = win_y; win_x = win_y = -1; waitmes(); win_x = x; win_y = y; } static VOID NEAR unpackerror(VOID_A) { if (!isttyiomode) { kanjifputs(UNPNG_K, Xstderr); VOID_C fputnl(Xstderr); } else { Xlocate(0, n_line - 1); Xcputnl(); hideclock = 1; warning(0, UNPNG_K); } } static char *archfgets(vp) VOID_P vp; { return(Xfgets((XFILE *)vp)); } static int NEAR readarchive(file, list, flags) CONST char *file; lsparse_t *list; int flags; { XFILE *fp; int n, wastty; wastty = isttyiomode; if (!(fp = popenmacro(list -> comm, file, flags))) return(-1); if (wastty) Xwaitmes(); maxarcf = lsparse(fp, list, &arcflist, archfgets); n = pclose2(fp); if (maxarcf < 0 || n) { if (maxarcf == -3 || n > 0) unpackerror(); freelist(arcflist, maxarcf); maxarcf = 0; return(-1); } if (maxarcf <= 1) { maxarcf = 0; Xfree(arcflist[0].name); arcflist[0].name = (char *)NOFIL_K; #ifndef NOSYMLINK Xfree(arcflist[0].linkname); arcflist[0].linkname = NULL; #endif arcflist[0].st_nlink = -1; arcflist[0].flags = 0; arcflist[0].tmpflags = F_STAT; } return(0); } static CONST char *NEAR skiparchdir(file) CONST char *file; { int len; if (!*archivedir) len = 0; else if ((len = dirmatchlen(archivedir, file))) file += len; else return(NULL); if (*file && len > 0 && (len > 1 || *archivedir != _SC_)) file++; return(file); } static int NEAR getarchdirlen(file) CONST char *file; { CONST char *tmp; int len; if (!(tmp = strdelim(file, 0))) len = strlen(file); else { len = (tmp == file) ? 1 : tmp - file; while (*(++tmp) == _SC_) /*EMPTY*/; } if (len == 2 && file[0] == '.' && file[1] == '.') len = 0; if (tmp && *tmp) return(-1 - len); return(len); } VOID copyarcf(re, archre) CONST reg_ex_t *re; CONST char *archre; { CONST char *cp; int i, j, n, len, parent; parent = (*archivedir) ? 0 : -1; /* omit arcflist[0] as pseudo ".." */ for (i = 1; i < maxarcf; i++) { if (!(cp = skiparchdir(arcflist[i].name))) continue; if (!*cp) { parent = i; continue; } len = getarchdirlen(cp); if (len >= -1 && len <= 0) { if (parent <= 0) parent = i; } if (len < 0) continue; if (re && !regexp_exec(re, cp, 1)) continue; if (archre) { if (!(n = searcharcf(archre, arcflist, maxarcf, i))) continue; if (n < 0) break; } for (j = 0; j < stackdepth; j++) if (!strcmp(cp, filestack[j].name)) break; if (j < stackdepth) continue; filelist = addlist(filelist, maxfile, &maxent); memcpy((char *)&(filelist[maxfile]), (char *)&(arcflist[i]), sizeof(namelist)); filelist[maxfile].name = (char *)cp; #ifndef NOSYMLINK filelist[maxfile].linkname = arcflist[i].linkname; #endif maxfile++; } if (parent < 0) return; for (i = 0; i < maxfile; i++) if (isdotdir(filelist[i].name) == 1) return; filelist = addlist(filelist, maxfile, &maxent); memmove((char *)&(filelist[1]), (char *)&(filelist[0]), maxfile++ * sizeof(namelist)); memcpy((char *)&(filelist[0]), (char *)&(arcflist[parent]), sizeof(namelist)); filelist[0].name = arcflist[0].name; #ifndef NOSYMLINK filelist[0].linkname = NULL; #endif } static char *NEAR searcharchdir(file, flen) CONST char *file; int flen; { CONST char *cp; int i, len; errno = ENOENT; /* omit arcflist[0] as pseudo ".." */ for (i = 1; i < maxarcf; i++) { if (!(cp = skiparchdir(arcflist[i].name))) continue; if (!file) return(arcflist[(*cp) ? 0 : i].name); if (!*cp) continue; len = getarchdirlen(cp); if (len >= -1 && len <= 0) { if (*file) continue; return(arcflist[0].name); } if (len < 0) continue; if (len != flen || strnpathcmp(file, cp, flen)) continue; if (!isdir(&(arcflist[i]))) { errno = ENOTDIR; continue; } return(arcflist[i].name); } return(NULL); } static char *NEAR archoutdir(VOID_A) { char *cp, *file; if (!*archivedir) return((char *)-1); if (!(file = searcharchdir(NULL, 0))) return(NULL); cp = &(file[(int)strlen(file) - 1]); while (cp > file && *cp == _SC_) cp--; #ifdef BSPATHDELIM if (onkanji1(file, cp - file)) cp++; #endif cp = strrdelim2(file, 0, cp); if (!cp) *archivedir = '\0'; else { if (cp == file) copyrootpath(archivedir); else Xstrncpy(archivedir, file, cp - file); file = ++cp; } return(file); } CONST char *archchdir(path) CONST char *path; { #ifndef _NOBROWSE int i, n, flags, dupfilepos; #endif CONST char *cp, *file; char *tmp, duparchdir[MAXPATHLEN]; int len; Xfree(findpattern); findpattern = NULL; #ifndef _NOBROWSE if (browselist) { if (!path || !*path) path = parentpath; if ((cp = strdelim(path, 0))) { for (i = 1; cp[i]; i++) if (cp[i] != _SC_) break; if (cp[i]) { errno = ENOENT; return(NULL); } Xstrncpy(duparchdir, path, (cp - path)); path = duparchdir; } n = browselevel; cp = browselist[n].ext; flags = (F_NOCONFIRM | F_ARGSET | F_NOADDOPT | F_IGNORELIST); dupfilepos = filepos; if (path == filelist[filepos].name) i = filepos; else for (i = 0; i < maxfile; i++) if (!strcmp(path, filelist[i].name)) break; if (i < maxfile && isdir(&(filelist[i]))) filepos = i; else if (!isdotdir(path)) { errno = ENOENT; return(NULL); } pushbrowsevar(path); if (cp && !(browselist[n].flags & LF_DIRNOPREP)) execusercomm(cp, path, flags); if (isdotdir(path)) { filepos = dupfilepos; popbrowsevar(); return((path[1]) ? (char *)-1 : path); } if (browselist[n + 1].comm && !(browselist[n].flags & LF_DIRLOOP)) n++; if (dolaunch(&(browselist[n]), flags) < 0 || !isarchbr(&(browselist[n]))) { popbrowsevar(); return(path); } browselevel = n; return(parentpath); } #endif /* !_NOBROWSE */ if (!path) return(archoutdir()); Xstrcpy(duparchdir, archivedir); file = nullstr; do { if (*path == _SC_) len = 1; else if ((cp = strdelim(path, 0))) len = cp - path; else len = strlen(path); cp = path; if (*cp != '.') /*EMPTY*/; else if (len == 1) cp = curpath; else if (len == 2 && cp[1] == '.') cp = nullstr; if (searcharchdir(cp, len)) { if (*(tmp = archivedir)) tmp = strcatdelim(archivedir); Xstrncpy(tmp, path, len); file = parentpath; } else if (cp == curpath) /*EMPTY*/; else if (*cp || !(file = archoutdir())) { Xstrcpy(archivedir, duparchdir); errno = ENOENT; return(NULL); } else if (file == (char *)-1) break; path += len; while (*path == _SC_) path++; } while (*path); return(file); } #ifndef _NOCOMPLETE int completearch(path, flen, argc, argvp) CONST char *path; int flen, argc; char ***argvp; { CONST char *cp, *file; char *new, dir[MAXPATHLEN], duparchdir[MAXPATHLEN]; int i, len, parent; # ifdef DEP_DOSPATH if (_dospath(path)) return(argc); # endif Xstrcpy(duparchdir, archivedir); if (!(file = strrdelim(path, 0))) file = path; # ifndef _NOBROWSE else if (browselist) return(argc); # endif else { Xstrncpy(dir, path, (file == path) ? 1 : file - path); if (!(cp = archchdir(dir)) || cp == (char *)-1) { Xstrcpy(archivedir, duparchdir); return(argc); } flen -= ++file - path; } /* omit arcflist[0] as pseudo ".." */ for (i = 1; i < maxarcf; i++) { if (!(cp = skiparchdir(arcflist[i].name))) continue; if (!*cp) continue; parent = 0; len = getarchdirlen(cp); if (len >= -1 && len <= 0) { len = 2; parent++; } if (len < 0) continue; if (len != flen || strnpathcmp(file, cp, flen)) continue; new = Xmalloc(len + 1 + 1); Xstrncpy(new, cp, len); if (parent || isdir(&(arcflist[i]))) new[len++] = _SC_; new[len] = '\0'; argc = addcompletion(NULL, new, argc, argvp); } Xstrcpy(archivedir, duparchdir); return(argc); } #endif /* !_NOCOMPLETE */ int dolaunch(list, flags) lsparse_t *list; int flags; { #ifdef DEP_PSEUDOPATH int drive; #endif CONST char *cp; char *tmpdir; tmpdir = NULL; #ifdef DEP_PSEUDOPATH drive = 0; #endif if (flags & F_ARGSET) /*EMPTY*/; else if (archivefile) { if (!(tmpdir = tmpunpack(1))) { Xputterm(T_BELL); return(-1); } } #ifdef DEP_PSEUDOPATH else if ((drive = tmpdosdupl(nullstr, &tmpdir, 1)) < 0) { Xputterm(T_BELL); return(-1); } #endif if (!isarchbr(list)) { ptyusercomm(list -> comm, filelist[filepos].name, flags); if (flags & F_ARGSET) /*EMPTY*/; #ifdef DEP_PSEUDOPATH else if (drive) removetmp(tmpdir, filelist[filepos].name); #endif else if (archivefile) removetmp(tmpdir, NULL); return(1); } pusharchdupl(); if (flags & F_ARGSET) /*EMPTY*/; #ifdef DEP_PSEUDOPATH else if (drive) { archduplp -> v_fullpath = Xstrdup(fullpath); Xstrcpy(fullpath, tmpdir); } #endif else if (archivefile) { archduplp -> v_fullpath = Xstrdup(fullpath); Xstrcpy(fullpath, tmpdir); if (*archivedir) { Xstrcpy(strcatdelim(fullpath), archivedir); archduplp -> v_archivedir = Xstrdup(archivedir); } } cp = (filelist && filepos < maxfile) ? filelist[filepos].name : NULL; if (!cp) cp = nullstr; if (archivefile) maxfile = 0; *archivedir = '\0'; archivefile = Xstrdup(cp); archtmpdir = tmpdir; launchp = list; arcflist = NULL; maxarcf = 0; #ifdef DEP_PSEUDOPATH archdrive = drive; #endif #ifndef _NOTREE treepath = NULL; #endif findpattern = NULL; while (maxfile > 0) Xfree(filelist[--maxfile].name); #if FD >= 2 if (sorttype < 200) sorton = 0; #else sorton = 0; #endif if (readarchive(archivefile, launchp, flags) < 0) { arcflist = NULL; poparchdupl(); return(-1); } maxfile = filepos = 0; return(1); } int launcher(VOID_A) { #ifndef _NOBROWSE CONST char *cp; int flags; #endif reg_ex_t *re; int i, n; #ifndef _NOBROWSE if (browselist) { n = browselevel; cp = browselist[n].ext; flags = (F_NOCONFIRM | F_ARGSET | F_NOADDOPT | F_IGNORELIST); pushbrowsevar(filelist[filepos].name); if (cp && !(browselist[n].flags & LF_FILENOPREP)) execusercomm(cp, filelist[filepos].name, flags); if (browselist[n + 1].comm && !(browselist[n].flags & LF_FILELOOP)) n++; if (dolaunch(&(browselist[n]), flags) < 0 || !isarchbr(&(browselist[n]))) { popbrowsevar(); return(-1); } browselevel = n; return(1); } #endif /* !_NOBROWSE */ for (i = 0; i < maxlaunch; i++) { #ifndef PATHNOCASE if (launchlist[i].flags & LF_IGNORECASE) pathignorecase++; #endif re = regexp_init(launchlist[i].ext, -1); n = regexp_exec(re, filelist[filepos].name, 0); regexp_free(re); #ifndef PATHNOCASE if (launchlist[i].flags & LF_IGNORECASE) pathignorecase--; #endif if (n) break; } if (i >= maxlaunch) return(0); return(dolaunch(&(launchlist[i]), F_NOCONFIRM | F_IGNORELIST)); } static int NEAR undertmp(path) CONST char *path; { winvartable *wvp; char *full, rpath[MAXPATHLEN], dir[MAXPATHLEN]; full = fullpath; VOID_C Xrealpath(path, rpath, RLP_READLINK); for (wvp = archduplp; wvp; wvp = wvp -> v_archduplp) { if (!(wvp -> v_fullpath)) continue; VOID_C Xrealpath(full, dir, RLP_READLINK); if (underpath(rpath, dir, -1)) return(1); full = wvp -> v_fullpath; } return(0); } #ifdef DEP_PSEUDOPATH static char *NEAR genfullpath(path, file, full, tmpdir) char *path; CONST char *file, *full, *tmpdir; #else static char *NEAR genfullpath(path, file, full) char *path; CONST char *file, *full; #endif { #if MSDOS char *tmp; int drive; #endif CONST char *cp; cp = file; #if MSDOS if ((drive = _dospath(cp))) cp += 2; #endif #ifdef DEP_DOSEMU if (_dospath(cp)) cp += 2; #endif #ifdef DEP_PSEUDOPATH if (tmpdir) Xstrcpy(path, tmpdir); else #endif if (*cp == _SC_) { Xstrcpy(path, file); return(path); } else if (!full || !*full) { errno = ENOENT; return(NULL); } #if MSDOS else if (drive) { tmp = gendospath(path, drive, _SC_); drive = Xtoupper(drive); if (drive == Xtoupper(*full)) Xstrcpy(tmp, &(full[3])); else if (!unixgetcurdir(tmp, drive - 'A' + 1)) return(NULL); } #endif else Xstrcpy(path, full); Xstrcpy(strcatdelim(path), cp); return(path); } #ifdef DEP_PSEUDOPATH static int NEAR archdostmpdir(path, dirp, full) char *path, **dirp; CONST char *full; { char *cp, dupfullpath[MAXPATHLEN]; int drive; Xstrcpy(dupfullpath, fullpath); if (full != fullpath) { Xstrcpy(fullpath, full); if (_chdir2(fullpath) < 0) full = NULL; } # ifdef DEP_DOSDRIVE if ((drive = dospath2(path))) /*EMPTY*/; else # endif # ifdef DEP_URLPATH if (urlpath(path, NULL, NULL, &drive)) drive += '0'; else # endif drive = 0; Xstrcpy(fullpath, dupfullpath); if (full != fullpath && _chdir2(fullpath) < 0) { lostcwd(fullpath); return(-1); } if (!drive) return(0); cp = path; # ifdef DEP_DOSPATH if (_dospath(cp)) cp += 2; # endif if (full) Xstrcpy(fullpath, full); else if (*cp != _SC_) return(-1); VOID_C Xrealpath(path, path, RLP_READLINK); Xstrcpy(fullpath, dupfullpath); if (!(cp = dostmpdir(drive))) return(-1); *dirp = cp; return(1); } #endif /* DEP_PSEUDOPATH */ int pack(arch) CONST char *arch; { #ifdef DEP_PSEUDOPATH char *dest, *tmpdest; int drive; #endif winvartable *wvp; reg_ex_t *re; char *tmpdir, *full, *duparchivefile, path[MAXPATHLEN]; int i, n, ret; for (i = 0; i < maxarchive; i++) { if (!archivelist[i].p_comm) continue; #ifndef PATHNOCASE if (archivelist[i].flags & AF_IGNORECASE) pathignorecase++; #endif re = regexp_init(archivelist[i].ext, -1); n = regexp_exec(re, arch, 0); regexp_free(re); #ifndef PATHNOCASE if (archivelist[i].flags & AF_IGNORECASE) pathignorecase--; #endif if (n) break; } if (i >= maxarchive) return(-1); full = fullpath; for (wvp = archduplp; wvp; wvp = wvp -> v_archduplp) if (wvp -> v_fullpath) full = wvp -> v_fullpath; ret = 1; tmpdir = NULL; #ifdef DEP_PSEUDOPATH tmpdest = NULL; drive = 0; Xstrcpy(path, arch); if ((dest = strrdelim(path, 1))) *(++dest) = '\0'; else copycurpath(path); if ((n = archdostmpdir(path, &tmpdest, full)) < 0) { warning(ENOENT, arch); return(0); } if (n) dest = Xstrdup(path); #endif /* DEP_PSEUDOPATH */ if (archivefile) { if (!(tmpdir = tmpunpack(0))) { #ifdef DEP_PSEUDOPATH Xfree(dest); #endif return(0); } } #ifdef DEP_PSEUDOPATH else if ((drive = tmpdosdupl(nullstr, &tmpdir, 0)) < 0) { Xfree(dest); return(0); } #endif #ifdef DEP_PSEUDOPATH if (!genfullpath(path, arch, full, tmpdest)) warning(-1, arch); #else if (!genfullpath(path, arch, full)) warning(-1, arch); #endif else { duparchivefile = archivefile; archivefile = NULL; Xwaitmes(); ret = execusercomm(archivelist[i].p_comm, path, F_ARGSET | F_ISARCH | F_NOADDOPT); if (ret > 0) { if (ret < 127) { hideclock = 1; warning(0, HITKY_K); } rewritefile(1); } archivefile = duparchivefile; } #ifdef DEP_PSEUDOPATH if (tmpdest) { if (!ret) { if (_chdir2(tmpdest) < 0) ret = 1; else VOID_C forcemovefile(dest); } Xfree(dest); removetmp(tmpdest, NULL); } if (drive) removetmp(tmpdir, NULL); else #endif /* DEP_PSEUDOPATH */ if (archivefile) removetmp(tmpdir, NULL); return((ret) ? 0 : 1); } /*ARGSUSED*/ int unpack(arch, dir, arg, tr, flags) CONST char *arch, *dir, *arg; int tr, flags; { #ifdef DEP_PSEUDOPATH winvartable *wvp; namelist alist[1], *dupfilelist; char *full, *dest, *tmpdest; int drive, dupmaxfile, dupfilepos; #endif reg_ex_t *re; char *cp, *new, *tmpdir, path[MAXPATHLEN]; int i, n, ret; #ifndef _NOBROWSE if (browselist) { warning(0, UNPNG_K); return(0); } #endif for (i = 0; i < maxarchive; i++) { if (!archivelist[i].u_comm) continue; #ifndef PATHNOCASE if (archivelist[i].flags & AF_IGNORECASE) pathignorecase++; #endif re = regexp_init(archivelist[i].ext, -1); n = regexp_exec(re, arch, 0); regexp_free(re); #ifndef PATHNOCASE if (archivelist[i].flags & AF_IGNORECASE) pathignorecase--; #endif if (n) break; } if (i >= maxarchive) return(-1); if (dir) Xstrcpy(path, dir); else for (;;) { #ifndef _NOTREE if (tr) dir = new = tree(0, NULL); else #endif /* !_NOTREE */ { if (arg && *arg) new = Xstrdup(arg); else new = inputstr(UNPAC_K, 1, -1, NULL, HST_PATH); dir = new = evalpath(new, 0); } if (!dir) return(0); if (!*dir) copycurpath(path); else { cp = Xstrcpy(path, dir); #ifdef DEP_DOSPATH if (_dospath(dir) && !dir[2]) copycurpath(cp); #endif } Xfree(new); dir = NULL; if (!undertmp(path)) break; Xlocate(0, L_CMDLINE); Xputterm(L_CLEAR); VOID_C XXcprintf("[%.*s]", n_column - 2, path); if (yesno(UNPTM_K)) break; } ret = 1; cp = path; tmpdir = NULL; #ifdef DEP_PSEUDOPATH tmpdest = NULL; full = fullpath; for (wvp = archduplp; wvp; wvp = wvp -> v_archduplp) if (wvp -> v_fullpath) full = wvp -> v_fullpath; if ((n = archdostmpdir(path, &tmpdest, full)) < 0) { warning(ENOENT, path); return(0); } if (n) { dest = Xstrdup(path); cp = tmpdest; } # ifdef FAKEUNINIT else dest = NULL; /* fake for -Wuninitialized */ # endif dupfilelist = filelist; dupmaxfile = maxfile; dupfilepos = filepos; alist[0].name = (char *)arch; # ifndef NOSYMLINK alist[0].linkname = NULL; # endif alist[0].st_mode = 0700; filelist = alist; maxfile = 1; filepos = 0; drive = tmpdosdupl(arch, &tmpdir, 0); filelist = dupfilelist; maxfile = dupmaxfile; filepos = dupfilepos; if (drive < 0) warning(-1, arch); else #endif /* DEP_PSEUDOPATH */ if ((!dir && preparedir(path) < 0) || _chdir2(cp) < 0) warning(-1, path); #ifdef DEP_PSEUDOPATH else if (!genfullpath(path, arch, fullpath, tmpdir)) warning(-1, arch); #else else if (!genfullpath(path, arch, fullpath)) warning(-1, arch); #endif else { Xwaitmes(); ret = execusercomm(archivelist[i].u_comm, path, flags); if (ret > 0) { if (ret < 127) { hideclock = 1; warning(0, HITKY_K); } rewritefile(1); } } #ifdef DEP_PSEUDOPATH if (tmpdest) { if (!ret) VOID_C forcemovefile(dest); Xfree(dest); removetmp(tmpdest, NULL); } if (tmpdir) removetmp(tmpdir, arch); else #endif /* DEP_PSEUDOPATH */ if (_chdir2(fullpath) < 0) lostcwd(fullpath); return((ret) ? 0 : 1); } #ifndef NOSYMLINK static int NEAR archrealpath(path, resolved) char *path, *resolved; { char *cp, tmp[MAXPATHLEN]; int n; if (!*path || (n = isdotdir(path)) == 2) /*EMPTY*/; else if (n == 1) { cp = strrdelim(resolved, 0); if (!cp) return(-1); *cp = '\0'; } else if ((cp = strdelim(path, 0))) { Xstrncpy(tmp, path, cp - path); if (archrealpath(tmp, resolved) < 0) return(-1); if (archrealpath(++cp, resolved) < 0) return(-1); } else { cp = strcatdelim(resolved); Xstrncpy(cp, path, MAXPATHLEN - 1 - (cp - resolved)); } return(0); } static int NEAR unpacklink(list, dir) namelist *list; CONST char *dir; { namelist duplist; char *cp, path[MAXPATHLEN], duparchdir[MAXPATHLEN]; int i, ret; if (!(list -> linkname)) return(0); if (!islink(list)) cp = list -> linkname; else { strcatdelim2(duparchdir, archivedir, list -> linkname); cp = duparchdir; } *path = '\0'; if (archrealpath(cp, path) < 0) return(-1); for (i = 0; i < maxarcf; i++) { *duparchdir = '\0'; if (archrealpath(arcflist[i].name, duparchdir) < 0) continue; if (!strcmp(path, duparchdir)) break; } if (i >= maxarcf) return(-1); if (unpacklink(&(arcflist[i]), dir) < 0) return(-1); Xstrcpy(duparchdir, archivedir); memcpy(&duplist, &(filelist[filepos]), sizeof(namelist)); memcpy(&(filelist[filepos]), &(arcflist[i]), sizeof(namelist)); if (!(cp = strrdelim(filelist[filepos].name, 0))) *archivedir = '\0'; else { Xstrncpy(archivedir, filelist[filepos].name, cp - filelist[filepos].name); filelist[filepos].name = ++cp; } ret = unpack(archivefile, dir, NULL, 0, F_ARGSET | F_ISARCH | F_NOADDOPT); memcpy(&(filelist[filepos]), &duplist, sizeof(namelist)); Xstrcpy(archivedir, duparchdir); return(ret); } #endif /* !NOSYMLINK */ char *tmpunpack(single) int single; { #ifdef DEP_DOSEMU char tmp[MAXPATHLEN]; #endif winvartable *wvp; char *subdir, *tmpdir, path[MAXPATHLEN]; int i, ret, dupmark; for (i = 0, wvp = archduplp; wvp; i++, wvp = wvp -> v_archduplp) /*EMPTY*/; Xstrcpy(path, ARCHTMPPREFIX); if (mktmpdir(path) < 0) { warning(-1, path); return(NULL); } tmpdir = Xstrdup(path); for (i = 0; i < maxfile; i++) if (ismark(&(filelist[i]))) filelist[i].tmpflags |= F_WSMRK; dupmark = mark; if (single) { mark = 0; #ifndef NOSYMLINK VOID_C unpacklink(&(filelist[filepos]), path); #endif } ret = unpack(archivefile, path, NULL, 0, F_ARGSET | F_ISARCH | F_NOADDOPT); mark = dupmark; for (i = 0; i < maxfile; i++) { if (wasmark(&(filelist[i]))) filelist[i].tmpflags |= F_ISMRK; filelist[i].tmpflags &= ~F_WSMRK; } subdir = archivedir; while (*subdir == _SC_) subdir++; if (ret < 0) Xputterm(T_BELL); else if (!ret) /*EMPTY*/; else if (_chdir2(path) < 0) { hideclock = 1; warning(-1, path); } else if (*subdir && _chdir2(subdir) < 0) { hideclock = 1; warning(-1, subdir); } else if (single || mark <= 0) { if (Xaccess(fnodospath(tmp, filepos), F_OK) >= 0) return(tmpdir); hideclock = 1; warning(-1, filelist[filepos].name); } else { for (i = 0; i < maxfile; i++) { if (!ismark(&(filelist[i]))) continue; if (Xaccess(fnodospath(tmp, i), F_OK) < 0) { hideclock = 1; warning(-1, filelist[i].name); break; } } if (i >= maxfile) return(tmpdir); } removetmp(tmpdir, NULL); return(NULL); } int backup(dev) CONST char *dev; { macrostat st; char *tmp; int i; waitmes(); if (!filelist) n_args = 0; else { for (i = 0; i < maxfile; i++) { if (ismark(&(filelist[i]))) filelist[i].tmpflags |= F_ISARG; else filelist[i].tmpflags &= ~F_ISARG; } n_args = mark; } st.flags = (F_NOCONFIRM | F_ISARCH); if (!(tmp = evalcommand("tar cf %C %TA", dev, &st))) return(0); #ifdef _NOEXTRAMACRO if (filelist) for (;;) { system2(tmp, st.flags); Xfree(tmp); if (!(st.flags & F_REMAIN) || !(tmp = evalcommand("tar rf %C %TA", dev, NULL))) break; } else #endif { system2(tmp, st.flags); Xfree(tmp); } if (filelist) { for (i = 0; i < maxfile; i++) filelist[i].tmpflags &= ~(F_ISARG | F_ISMRK); mark = 0; marksize = (off_t)0; } return(1); } int searcharcf(regstr, flist, maxf, n) CONST char *regstr; namelist *flist; int maxf, n; { namelist tmp; lsparse_t *list; namelist *dupfilelist; reg_ex_t *re; XFILE *fp; char *cp, *next, *tmpdir, *file; int i, c, nline, match, dupmaxfile, dupfilepos; if (n < 0) { file = flist -> name; if (isdir(flist)) return(0); } else { file = flist[n].name; if (isdir(&(flist[n]))) return(0); } for (i = 0; i < maxlaunch; i++) { if (!isarchbr(&(launchlist[i]))) continue; #ifndef PATHNOCASE if (launchlist[i].flags & LF_IGNORECASE) pathignorecase++; #endif re = regexp_init(launchlist[i].ext, -1); c = regexp_exec(re, file, 0); regexp_free(re); #ifndef PATHNOCASE if (launchlist[i].flags & LF_IGNORECASE) pathignorecase--; #endif if (c) break; } if (i >= maxlaunch) return(0); list = &(launchlist[i]); if (n >= 0) { dupfilelist = filelist; dupmaxfile = maxfile; dupfilepos = filepos; filelist = flist; maxfile = maxf; filepos = n; tmpdir = tmpunpack(1); filelist = dupfilelist; maxfile = dupmaxfile; filepos = dupfilepos; if (!tmpdir) return(0); } #ifdef FAKEUNINIT else tmpdir = NULL; /* fake for -Wuninitialized */ #endif Xlocate(0, n_line - 1); Xtflush(); if (!(fp = popenmacro(list -> comm, file, F_IGNORELIST))) { if (n >= 0) removetmp(tmpdir, file); return(0); } Xlocate(0, L_MESLINE); Xputterm(L_CLEAR); VOID_C Xattrkanjiputs(SEACH_K, 1); VOID_C Xkanjiputs(file); Xtflush(); for (i = 0; i < (int)(list -> topskip); i++) { if (!(cp = Xfgets(fp))) break; Xfree(cp); } nline = match = 0; re = regexp_init(regstr, -1); parsefilelist(NULL, list, NULL, NULL, NULL); for (;;) { if (match && match <= nline - (int)(list -> bottomskip)) break; i = parsefilelist(fp, list, &tmp, &nline, archfgets); if (i < 0) { if (i == -1) break; VOID_C pclose2(fp); parsefilelist(NULL, NULL, NULL, NULL, NULL); regexp_free(re); if (n >= 0) removetmp(tmpdir, file); return(-1); } if (!i) continue; cp = tmp.name; while (cp) { if ((next = strdelim(cp, 0))) *(next++) = '\0'; if (regexp_exec(re, cp, 1)) break; cp = next; } if (cp) match = nline; Xfree(tmp.name); #ifndef NOSYMLINK Xfree(tmp.linkname); #endif } parsefilelist(NULL, NULL, NULL, NULL, NULL); regexp_free(re); if (n >= 0) removetmp(tmpdir, file); if ((i = pclose2(fp))) return((i > 0) ? -1 : 0); if (match > nline - (int)(list -> bottomskip)) match = 0; return(match); } #endif /* !_NOARCHIVE */ FD-3.01j/custom.c100644 2105 1751 335704 13516612560 12413 0ustar shiraiuser/* * custom.c * * customizer of configurations */ #include "fd.h" #include "parse.h" #include "kconv.h" #include "func.h" #include "funcno.h" #include "kanji.h" #include "system.h" #include "termemu.h" #ifdef DEP_URLPATH #include "urldisk.h" #endif #define MAXCUSTOM 7 #define MAXCUSTNAM 14 #define MAXCUSTVAL (n_column - MAXCUSTNAM - 3) #define noselect(n, m, x, s, v) (selectstr(n, m, x, s, v) != K_CR) #define getmax(m, n) do { \ cs_max = ((!(n) && basiccustom) \ ? nbasic : (m)[n]); \ } while (0) #define setmax(m, n) do { \ if ((n)) (m)[n] = cs_max; \ } while (0) #define MAXSAVEMENU 5 #define DEFPALETTE "89624351888" #define MAXPALETTE 11 #define MAXCOLOR 10 typedef struct _envtable { CONST char *env; VOID_P var; #ifdef FORCEDSTDC union { CONST char *str; int num; } def; #else CONST char *def; #endif #ifdef _NOCATALOG # ifndef _NOJPNMES CONST char *hmes; # endif # ifndef _NOENGMES CONST char *hmes_eng; # endif #else /* !_NOCATALOG */ int hmes_no; #endif /* !_NOCATALOG */ u_char type; } envtable; #define env_str(n) (&(envlist[n].env[FDESIZ])) #define fdenv_str(n) (envlist[n].env) #define env_type(n) (envlist[n].type & T_TYPE) #define _B_(t) (T_BASIC | (t)) #ifdef FORCEDSTDC #define def_str(n) (envlist[n].def.str) #define def_num(n) (envlist[n].def.num) #define DEFVAL(d) {(char *)(d)} #else #define def_str(n) (envlist[n].def) #define def_num(n) ((int)(envlist[n].def)) #define DEFVAL(d) (char *)(d) #endif #if !MSDOS && defined (FORCEDSTDC) #define ENV_CONST #else #define ENV_CONST CONST #endif #define T_TYPE 0037 #define T_PRIMAL 0040 #define T_BASIC 0100 #define T_BOOL 0 #define T_SHORT 1 #define T_INT 2 #define T_NATURAL 3 #define T_CHARP 4 #define T_PATH 5 #define T_PATHS 6 #define T_SORT 7 #define T_DISP 8 #define T_WRFS 9 #define T_COLUMN 10 #if MSDOS #define T_DDRV 11 #else #define T_DDRV T_BOOL #endif #define T_COLOR 12 #define T_COLORPAL 13 #define T_EDIT 14 #define T_KIN 15 #define T_KOUT 16 #define T_KNAM 17 #define T_KTERM 18 #define T_MESLANG 19 #define T_KPATHS 20 #define T_OCTAL 21 #define T_KEYCODE 22 #define T_HELP 23 #define T_URLOPT 24 #define T_IMEBUF 25 #define T_NOVAR 26 #ifdef DEP_FILECONV typedef struct _pathtable { VOID_P path; char *last; u_char lang; u_char flags; } pathtable; #define P_ISARRAY 0001 #define P_STABLE 0002 #endif /* DEP_FILECONV */ extern int sorttype; extern int displaymode; #ifndef _NOTREE extern int sorttree; #endif #ifndef _NOWRITEFS extern int writefs; #endif #if !defined (_USEDOSCOPY) && !defined (_NOEXTRACOPY) extern int inheritcopy; #endif #ifndef _NOEXTRACOPY extern int progressbar; extern int precopymenu; #endif #if !MSDOS extern int adjtty; #endif extern int hideclock; extern int defcolumns; extern int minfilename; #if FD >= 3 extern int widedigit; extern int sizeunit; #endif extern char *histfile[]; extern short histsize[]; extern short savehist[]; #if FD >= 3 extern short histumask[]; #endif #ifndef _NOTREE extern int dircountlimit; #endif extern int showsecond; #if FD >= 3 extern int autoupdate; #endif #ifndef _NOTRADLAYOUT extern int tradlayout; #endif extern int sizeinfo; #if FD >= 2 extern int helplayout; #endif #ifdef DEP_IME extern int imekey; extern int imebuffer; # if FD >= 3 extern short imelearning; extern short frequmask; extern char *freqfile; # endif #endif /* DEP_IME */ #ifdef DEP_URLPATH extern int hidepasswd; #endif #ifndef _NOCOLOR extern int ansicolor; # if FD >= 2 extern char *ansipalette; # endif #endif /* !_NOCOLOR */ #ifndef _NOEDITMODE extern char *editmode; #endif #if FD >= 2 extern int loopcursor; #endif extern char *deftmpdir; #ifndef _NOROCKRIDGE extern char *rockridgepath; #endif #ifndef _NOPRECEDE extern char *precedepath; #endif extern CONST char *promptstr; #ifdef DEP_ORIGSHELL extern CONST char *promptstr2; #endif #if FD >= 2 extern short tmpumask; #endif #ifdef DEP_ORIGSHELL extern int dumbshell; #endif #ifdef DEP_LOGGING extern char *logfile; extern int logsize; # ifndef NOSYSLOG extern int usesyslog; # endif extern int loglevel; # ifndef NOUID extern int rootloglevel; # endif #endif /* DEP_LOGGING */ #if FD >= 2 extern int thruargs; #endif extern int wheader; extern char fullpath[]; extern char *origpath; extern char *progpath; #ifdef DEP_IME extern char *dicttblpath; #endif #ifndef _NOCUSTOMIZE extern int curcolumns; extern int subwindow; extern int win_x; extern int win_y; # if FD >= 2 extern int lcmdline; # endif extern int calc_x; extern int calc_y; extern CONST functable funclist[]; extern macrolist_t macrolist; extern int maxmacro; extern helpindex_t helpindex; extern orighelpindex_t orighelpindex; extern bindlist_t bindlist; extern origbindlist_t origbindlist; extern int maxbind; extern int origmaxbind; extern CONST strtable keyidentlist[]; # ifndef _NOKEYMAP extern keyseq_t *origkeymaplist; # endif # ifndef _NOARCHIVE extern launchlist_t launchlist; extern origlaunchlist_t origlaunchlist; extern int maxlaunch; extern int origmaxlaunch; extern archivelist_t archivelist; extern origarchivelist_t origarchivelist; extern int maxarchive; extern int origmaxarchive; # endif extern int inruncom; #endif /* !_NOCUSTOMIZE */ #if FD >= 2 static int NEAR atooctal __P_((CONST char *)); #endif static int NEAR getenvid __P_((CONST char *, int, int *)); static VOID NEAR _evalenv __P_((int)); static VOID NEAR evalenvone __P_((int)); #ifdef DEP_FILECONV static char *NEAR pathlang __P_((pathtable *, int)); static VOID NEAR pathconv __P_((pathtable *)); static VOID NEAR savepathlang __P_((VOID_A)); static VOID NEAR evalpathlang __P_((VOID_A)); #endif static VOID NEAR evalheader __P_((VOID_A)); #ifndef _NOCUSTOMIZE static int NEAR custputs __P_((CONST char *)); static char *NEAR strcatalloc __P_((char *, CONST char *)); static VOID NEAR putsep __P_((VOID_A)); static VOID NEAR fillline __P_((int, int)); static char *NEAR inputcuststr __P_((CONST char *, int, CONST char *, int)); static char *NEAR inputcustenvstr __P_((CONST char *, int, CONST char *, int)); static VOID NEAR setnamelist __P_((int, namelist *, CONST char *)); static int NEAR browsenamelist __P_((namelist *, int, int, CONST char *, CONST char *, CONST char **)); static VOID NEAR custtitle __P_((VOID_A)); static VOID NEAR calcmax __P_((int [], int)); static VOID NEAR envcaption __P_((CONST char *)); static char **NEAR copyenv __P_((char **)); static VOID NEAR cleanupenv __P_((VOID_A)); # if FD >= 2 static char *NEAR ascoctal __P_((int, char *)); # endif # ifdef DEP_ORIGSHELL static VOID NEAR putargs __P_((CONST char *, int, CONST char *[], XFILE *)); # endif static char *NEAR int2str __P_((char *, int)); static int NEAR inputkeycode __P_((CONST char *)); static int NEAR dispenv __P_((int)); static int NEAR editenv __P_((int)); static int NEAR dumpenv __P_((CONST char *, XFILE *)); # ifdef DEP_ORIGSHELL static int NEAR checkenv __P_((char *, char *CONST *, int *, XFILE *)); static int NEAR checkunset __P_((char *, int, char *CONST *, XFILE *)); # endif static VOID NEAR cleanupbind __P_((VOID_A)); static int NEAR dispbind __P_((int)); static int NEAR selectbind __P_((int, int, CONST char *)); static int NEAR editbind __P_((int)); static int NEAR issamebind __P_((CONST bindtable *, CONST bindtable *)); static int NEAR dumpbind __P_((CONST char *, char *, XFILE *)); # ifdef DEP_ORIGSHELL static int NEAR checkbind __P_((char *, char *, int, char *CONST *, XFILE *)); # endif # ifndef _NOKEYMAP static VOID NEAR cleanupkeymap __P_((VOID_A)); static int NEAR dispkeymap __P_((int)); static int NEAR editkeymap __P_((int)); static int NEAR searchkeymap __P_((CONST keyseq_t *, CONST keyseq_t *)); static int NEAR issamekeymap __P_((CONST keyseq_t *, CONST keyseq_t *)); static int NEAR dumpkeymap __P_((CONST char *, char *, XFILE *)); # ifdef DEP_ORIGSHELL static int NEAR checkkeymap __P_((char *, char *, int, char *CONST *, XFILE *)); # endif # endif # ifndef _NOARCHIVE static VOID NEAR cleanuplaunch __P_((VOID_A)); static int NEAR displaunch __P_((int)); static VOID NEAR verboselaunch __P_((lsparse_t *)); static char **NEAR editvar __P_((CONST char *, char **)); static int NEAR editarchbrowser __P_((lsparse_t *)); static int NEAR editlaunch __P_((int)); static int NEAR issamelaunch __P_((CONST lsparse_t *, CONST lsparse_t *)); static int NEAR dumplaunch __P_((CONST char *, char *, XFILE *)); # ifdef DEP_ORIGSHELL static int NEAR checklaunch __P_((char *, char *, int, char *CONST *, XFILE *)); # endif static VOID NEAR cleanuparch __P_((VOID_A)); static int NEAR disparch __P_((int)); static int NEAR editarch __P_((int)); static int NEAR issamearch __P_((CONST archive_t *, CONST archive_t *)); static int NEAR dumparch __P_((CONST char *, char *, XFILE *)); # ifdef DEP_ORIGSHELL static int NEAR checkarch __P_((char *, char *, int, char *CONST *, XFILE *)); # endif # endif # ifdef DEP_DOSEMU static VOID NEAR cleanupdosdrive __P_((VOID_A)); static int NEAR dispdosdrive __P_((int)); static int NEAR editdosdrive __P_((int)); static int NEAR dumpdosdrive __P_((CONST char *, char *, XFILE *)); # ifdef DEP_ORIGSHELL static int NEAR checkdosdrive __P_((char *, char *, int, char *CONST *, XFILE *)); # endif # endif static int NEAR dispsave __P_((int)); # ifdef DEP_ORIGSHELL static int NEAR overwriteconfig __P_((int *, CONST char *)); # endif static int NEAR selectmulti __P_((int, CONST char *CONST [], int[])); static int NEAR editsave __P_((int)); static VOID NEAR dispname __P_((int, int, int)); static VOID NEAR dispcust __P_((VOID_A)); static VOID NEAR movecust __P_((int, int)); static int NEAR editcust __P_((VOID_A)); #endif /* !_NOCUSTOMIZE */ #ifndef _NOCUSTOMIZE int custno = -1; int basiccustom = 0; #endif static ENV_CONST envtable envlist[] = { #ifndef _NOCUSTOMIZE {"FD_BASICCUSTOM", &basiccustom, DEFVAL(BASICCUSTOM), BSCS_E, _B_(T_BOOL)}, #endif {"FD_SORTTYPE", &sorttype, DEFVAL(SORTTYPE), STTP_E, _B_(T_SORT)}, {"FD_DISPLAYMODE", &displaymode, DEFVAL(DISPLAYMODE), DPMD_E, _B_(T_DISP)}, #ifndef _NOTREE {"FD_SORTTREE", &sorttree, DEFVAL(SORTTREE), STTR_E, T_BOOL}, #endif #ifndef _NOWRITEFS {"FD_WRITEFS", &writefs, DEFVAL(WRITEFS), WRFS_E, T_WRFS}, #endif #if !defined (PATHNOCASE) && (FD >= 2) {"FD_IGNORECASE", &pathignorecase, DEFVAL(IGNORECASE), IGNC_E, T_BOOL}, #endif #ifndef _NOVERSCMP {"FD_VERSIONCOMP", &versioncomp, DEFVAL(VERSIONCOMP), VCMP_E, T_BOOL}, #endif #if !defined (_USEDOSCOPY) && !defined (_NOEXTRACOPY) {"FD_INHERITCOPY", &inheritcopy, DEFVAL(INHERITCOPY), IHTM_E, T_BOOL}, #endif #ifndef _NOEXTRACOPY {"FD_PROGRESSBAR", &progressbar, DEFVAL(PROGRESSBAR), PRGB_E, T_BOOL}, {"FD_PRECOPYMENU", &precopymenu, DEFVAL(PRECOPYMENU), PCMN_E, T_BOOL}, #endif #if !MSDOS {"FD_ADJTTY", &adjtty, DEFVAL(ADJTTY), AJTY_E, T_BOOL}, # if FD >= 2 {"FD_USEGETCURSOR", &usegetcursor, DEFVAL(USEGETCURSOR), UGCS_E, T_BOOL}, # endif #endif /* !MSDOS */ {"FD_DEFCOLUMNS", &defcolumns, DEFVAL(DEFCOLUMNS), CLMN_E, _B_(T_COLUMN)}, {"FD_MINFILENAME", &minfilename, DEFVAL(MINFILENAME), MINF_E, T_NATURAL}, #if FD >= 3 {"FD_WIDEDIGIT", &widedigit, DEFVAL(WIDEDIGIT), WDDGT_E, T_BOOL}, {"FD_SIZEUNIT", &sizeunit, DEFVAL(SIZEUNIT), SZUNT_E, T_BOOL}, #endif {"FD_HISTFILE", &(histfile[0]), DEFVAL(HISTFILE), HSFL_E, T_PATH}, #if FD >= 2 {"FD_DIRHISTFILE", &(histfile[1]), DEFVAL(DIRHISTFILE), DHFL_E, T_PATH}, #endif {"FD_HISTSIZE", &(histsize[0]), DEFVAL(HISTSIZE), HSSZ_E, _B_(T_SHORT)}, {"FD_DIRHIST", &(histsize[1]), DEFVAL(DIRHIST), DRHS_E, _B_(T_SHORT)}, {"FD_SAVEHIST", &(savehist[0]), DEFVAL(SAVEHIST), SVHS_E, _B_(T_SHORT)}, #if FD >= 2 {"FD_SAVEDIRHIST", &(savehist[1]), DEFVAL(SAVEDIRHIST), SVDH_E, T_SHORT}, #endif #if FD >= 3 {"FD_HISTUMASK", &(histumask[0]), DEFVAL(HISTUMASK), HUMSK_E, T_OCTAL}, {"FD_DIRHISTUMASK", &(histumask[1]), DEFVAL(DIRHISTUMASK), DUMSK_E, T_OCTAL}, #endif #ifndef _NOTREE {"FD_DIRCOUNTLIMIT", &dircountlimit, DEFVAL(DIRCOUNTLIMIT), DCLM_E, T_INT}, #endif #ifdef DEP_DOSDRIVE {"FD_DOSDRIVE", &dosdrive, DEFVAL(DOSDRIVE), DOSD_E, T_DDRV}, #endif {"FD_SECOND", &showsecond, DEFVAL(SECOND), SCND_E, _B_(T_BOOL)}, #if FD >= 3 {"FD_AUTOUPDATE", &autoupdate, DEFVAL(AUTOUPDATE), ATUP_E, _B_(T_INT)}, #endif #ifndef _NOTRADLAYOUT {"FD_TRADLAYOUT", &tradlayout, DEFVAL(TRADLAYOUT), TRLO_E, T_BOOL}, #endif {"FD_SIZEINFO", &sizeinfo, DEFVAL(SIZEINFO), SZIF_E, _B_(T_BOOL)}, #if FD >= 2 {"FD_FUNCLAYOUT", &helplayout, DEFVAL(FUNCLAYOUT), FNLO_E, T_HELP}, #endif #ifdef DEP_IME {"FD_IMEKEY", &imekey, DEFVAL(IMEKEY), IMKY_E, T_KEYCODE}, # if FD >= 3 {"FD_IMEBUFFER", &imebuffer, DEFVAL(IMEBUFFER), IMBF_E, T_IMEBUF}, {"FD_IMELEARNING", &imelearning, DEFVAL(IMELEARNING), IMLRN_E, T_SHORT}, {"FD_FREQFILE", &freqfile, DEFVAL(FREQFILE), FRFL_E, T_PATH}, {"FD_FREQUMASK", &frequmask, DEFVAL(FREQUMASK), FUMSK_E, T_OCTAL}, # else {"FD_IMEBUFFER", &imebuffer, DEFVAL(IMEBUFFER), IMBF_E, T_BOOL}, # endif #endif /* DEP_IME */ #ifndef _NOCOLOR {"FD_ANSICOLOR", &ansicolor, DEFVAL(ANSICOLOR), ACOL_E, _B_(T_COLOR)}, # if FD >= 2 {"FD_ANSIPALETTE", &ansipalette, DEFVAL(ANSIPALETTE), APAL_E, T_COLORPAL}, # endif #endif /* !_NOCOLOR */ #ifndef _NOEDITMODE {"FD_EDITMODE", &editmode, DEFVAL(EDITMODE), EDMD_E, T_EDIT}, #endif #if FD >= 2 {"FD_LOOPCURSOR", &loopcursor, DEFVAL(LOOPCURSOR), LPCS_E, T_BOOL}, #endif {"FD_TMPDIR", &deftmpdir, DEFVAL(TMPDIR), TMPD_E, T_PATH}, #if FD >= 2 {"FD_TMPUMASK", &tmpumask, DEFVAL(TMPUMASK), TUMSK_E, T_OCTAL}, #endif #ifndef _NOROCKRIDGE {"FD_RRPATH", &rockridgepath, DEFVAL(RRPATH), RRPT_E, T_PATHS}, #endif #ifndef _NOPRECEDE {"FD_PRECEDEPATH", &precedepath, DEFVAL(PRECEDEPATH), PCPT_E, T_PATHS}, #endif #if FD >= 2 {"FD_PS1", &promptstr, DEFVAL(PROMPT), PRMP_E, T_CHARP | T_PRIMAL}, #else {"FD_PROMPT", &promptstr, DEFVAL(PROMPT), PRMP_E, T_CHARP}, #endif #ifdef DEP_ORIGSHELL {"FD_PS2", &promptstr2, DEFVAL(PROMPT2), PRM2_E, T_CHARP | T_PRIMAL}, {"FD_DUMBSHELL", &dumbshell, DEFVAL(DUMBSHELL), DMSHL_E, T_BOOL}, #endif #ifdef DEP_PTY {"FD_PTYMODE", &ptymode, DEFVAL(PTYMODE), PTYMD_E, T_BOOL}, {"FD_PTYTERM", &ptyterm, DEFVAL(PTYTERM), PTYTM_E, T_CHARP}, {"FD_PTYMENUKEY", &ptymenukey, DEFVAL(PTYMENUKEY), PTYKY_E, T_KEYCODE}, #endif #ifdef DEP_LOGGING {"FD_LOGFILE", &logfile, DEFVAL(LOGFILE), LGFIL_E, T_PATH}, {"FD_LOGSIZE", &logsize, DEFVAL(LOGSIZE), LGSIZ_E, T_INT}, # ifndef NOSYSLOG {"FD_USESYSLOG", &usesyslog, DEFVAL(USESYSLOG), USYLG_E, T_BOOL}, # endif {"FD_LOGLEVEL", &loglevel, DEFVAL(LOGLEVEL), LGLVL_E, T_INT}, # ifndef NOUID {"FD_ROOTLOGLEVEL", &rootloglevel, DEFVAL(ROOTLOGLEVEL), RLGLV_E, T_INT}, # endif #endif /* DEP_LOGGING */ #if FD >= 2 {"FD_THRUARGS", &thruargs, DEFVAL(THRUARGS), THARG_E, T_BOOL}, #endif #ifdef DEP_URLPATH {"FD_URLDRIVE", &urldrive, DEFVAL(URLDRIVE), URLD_E, T_BOOL}, {"FD_URLTIMEOUT", &urltimeout, DEFVAL(URLTIMEOUT), URLTO_E, T_INT}, {"FD_URLOPTIONS", &urloptions, DEFVAL(URLOPTIONS), URLOP_E, T_URLOPT}, {"FD_HIDEPASSWD", &hidepasswd, DEFVAL(HIDEPASSWD), HIDPW_E, T_BOOL}, #endif #ifdef DEP_FTPPATH {"FD_FTPADDRESS", &ftpaddress, DEFVAL(FTPADDRESS), FTPAD_E, T_CHARP}, {"FD_FTPPROXY", &ftpproxy, DEFVAL(FTPPROXY), FTPPR_E, T_CHARP}, {"FD_FTPLOGFILE", &ftplogfile, DEFVAL(FTPLOGFILE), FTPLG_E, T_PATH}, #endif #ifdef DEP_HTTPPATH {"FD_HTTPPROXY", &httpproxy, DEFVAL(HTTPPROXY), HTPPR_E, T_CHARP}, {"FD_HTTPLOGFILE", &httplogfile, DEFVAL(HTTPLOGFILE), HTPLG_E, T_PATH}, {"FD_HTMLLOGFILE", &htmllogfile, DEFVAL(HTMLLOGFILE), HTMLG_E, T_PATH}, #endif #ifdef DEP_UNICODE {"FD_UNICODEBUFFER", &unicodebuffer, DEFVAL(UNICODEBUFFER), UNBF_E, T_BOOL}, #endif #if defined (DEP_KCONV) || (!defined (_NOENGMES) && !defined (_NOJPNMES)) {"FD_LANGUAGE", &outputkcode, DEFVAL(NOCNV), LANG_E, _B_(T_KOUT)}, #endif #ifdef DEP_FILECONV {"FD_DEFKCODE", &defaultkcode, DEFVAL(NOCNV), DFKC_E, T_KNAM}, #endif #ifdef DEP_KCONV {"FD_INPUTKCODE", &inputkcode, DEFVAL(NOCNV), IPKC_E, _B_(T_KIN)}, #endif #if defined (DEP_KCONV) && defined (DEP_PTY) {"FD_PTYINKCODE", &ptyinkcode, DEFVAL(NOCNV), PIKC_E, T_KTERM}, {"FD_PTYOUTKCODE", &ptyoutkcode, DEFVAL(NOCNV), POKC_E, T_KTERM}, #endif #ifdef DEP_FILECONV {"FD_FNAMEKCODE", &fnamekcode, DEFVAL(NOCNV), FNKC_E, T_KNAM}, #endif #if defined (DEP_FILECONV) && defined (DEP_URLPATH) {"FD_URLKCODE", &urlkcode, DEFVAL(NOCNV), URLKC_E, T_KNAM}, #endif #if !defined (_NOENGMES) && !defined (_NOJPNMES) {"FD_MESSAGELANG", &messagelang, DEFVAL(NOCNV), MESL_E, T_MESLANG}, #endif #ifdef DEP_FILECONV {"FD_SJISPATH", &sjispath, DEFVAL(SJISPATH), SJSP_E, T_KPATHS}, {"FD_EUCPATH", &eucpath, DEFVAL(EUCPATH), EUCP_E, T_KPATHS}, {"FD_JISPATH", &jis7path, DEFVAL(JISPATH), JISP_E, T_KPATHS}, {"FD_JIS8PATH", &jis8path, DEFVAL(JIS8PATH), JS8P_E, T_KPATHS}, {"FD_JUNETPATH", &junetpath, DEFVAL(JUNETPATH), JNTP_E, T_KPATHS}, {"FD_OJISPATH", &ojis7path, DEFVAL(OJISPATH), OJSP_E, T_KPATHS}, {"FD_OJIS8PATH", &ojis8path, DEFVAL(OJIS8PATH), OJ8P_E, T_KPATHS}, {"FD_OJUNETPATH", &ojunetpath, DEFVAL(OJUNETPATH), OJNP_E, T_KPATHS}, {"FD_HEXPATH", &hexpath, DEFVAL(HEXPATH), HEXP_E, T_KPATHS}, {"FD_CAPPATH", &cappath, DEFVAL(CAPPATH), CAPP_E, T_KPATHS}, {"FD_UTF8PATH", &utf8path, DEFVAL(UTF8PATH), UTF8P_E, T_KPATHS}, {"FD_UTF8MACPATH", &utf8macpath, DEFVAL(UTF8MACPATH), UTF8M_E, T_KPATHS}, {"FD_UTF8ICONVPATH", &utf8iconvpath, DEFVAL(UTF8ICONVPATH), UTF8I_E, T_KPATHS}, {"FD_NOCONVPATH", &noconvpath, DEFVAL(NOCONVPATH), NCVP_E, T_KPATHS}, #endif /* DEP_FILECONV */ #ifndef _NOCUSTOMIZE {"FD_PAGER", NULL, DEFVAL(NULL), PAGR_E, T_NOVAR}, {"FD_EDITOR", NULL, DEFVAL(NULL), EDIT_E, T_NOVAR}, {"FD_SHELL", NULL, DEFVAL(NULL), SHEL_E, T_NOVAR}, # ifndef NOPOSIXUTIL {"FD_FCEDIT", NULL, DEFVAL(NULL), FCED_E, T_NOVAR}, # endif # if MSDOS {"FD_COMSPEC", NULL, DEFVAL(NULL), CMSP_E, T_NOVAR}, # endif #endif /* !_NOCUSTOMIZE */ }; #define ENVLISTSIZ arraysize(envlist) #ifdef DEP_FILECONV static pathtable pathlist[] = { {fullpath, NULL, NOCNV, P_ISARRAY}, {&origpath, NULL, NOCNV, P_STABLE}, {&progpath, NULL, NOCNV, P_STABLE}, # ifdef DEP_UNICODE {&unitblpath, NULL, NOCNV, P_STABLE}, # endif # ifdef DEP_IME {&dicttblpath, NULL, NOCNV, P_STABLE}, # endif # ifndef _NOCATALOG {&cattblpath, NULL, NOCNV, P_STABLE}, # endif }; #define PATHLISTSIZ arraysize(pathlist) # ifndef _NOSPLITWIN # ifndef _NOARCHIVE static pathtable archlist[MAXWINDOWS]; # endif static pathtable fulllist[MAXWINDOWS]; # endif /* !_NOSPLITWIN */ #endif /* DEP_FILECONV */ #ifndef _NOCUSTOMIZE # ifdef DEP_DOSEMU static CONST devinfo mediadescr[] = { {0xf0, "2HD(PC/AT)", 2, 18, 80}, {0xf9, "2HD(PC98)", 2, 15, 80}, {0xf9, "2DD(PC/AT)", 2, 9, 80}, {0xfb, "2DD(PC98)", 2, 8 + 100, 80}, # ifdef HDDMOUNT {0xf8, "HDD", 'n', 0, 0}, {0xf8, "HDD(PC98)", 'N', 98, 0}, # endif }; #define MEDIADESCRSIZ arraysize(mediadescr) # endif /* DEP_DOSEMU */ static char basicenv[ENVLISTSIZ]; static int nbasic = 0; static int cs_item = 0; static int cs_max = 0; static int cs_row = 0; static int *cs_len = NULL; static char **tmpenvlist = NULL; static char **tmpmacrolist = NULL; static int tmpmaxmacro = 0; static char **tmphelpindex = NULL; static bindtable *tmpbindlist = NULL; static int tmpmaxbind = 0; # ifndef _NOKEYMAP static keyseq_t *tmpkeymaplist = NULL; static short *keyseqlist = NULL; # endif # ifndef _NOARCHIVE static lsparse_t *tmplaunchlist = NULL; static int tmpmaxlaunch = 0; static archive_t *tmparchivelist = NULL; static int tmpmaxarchive = 0; # endif # ifdef DEP_DOSEMU static devinfo *tmpfdtype = NULL; static int tmpmaxfdtype = 0; # endif #endif /* !_NOCUSTOMIZE */ VOID initenv(VOID_A) { #if !MSDOS && defined (FORCEDSTDC) char *cp; int w; #endif int i; #if !MSDOS && defined (FORCEDSTDC) if ((w = sizeof(char *) - sizeof(int)) > 0) { i = 0x5a; cp = (char *)(&i); if (*cp == 0x5a) w = 0; } #endif for (i = 0; i < ENVLISTSIZ; i++) { switch (env_type(i)) { case T_CHARP: case T_PATH: case T_PATHS: case T_COLORPAL: case T_EDIT: case T_KPATHS: case T_NOVAR: if (envlist[i].var && (*(char **)(envlist[i].var))) *((char **)(envlist[i].var)) = NULL; break; #ifdef PRESETKCODE case T_KIN: case T_KOUT: case T_KNAM: case T_KTERM: setenv2(env_str(i), PRESETKCODE, 0); /*FALLTHRU*/ #endif default: #if !MSDOS && defined (FORCEDSTDC) if (w > 0) { cp = (char *)&def_num(i); memmove(cp, &(cp[w]), sizeof(int)); } #endif break; } _evalenv(i); } } #if FD >= 2 static int NEAR atooctal(s) CONST char *s; { int n; if (!Xsscanf(s, "%= 2 */ static int NEAR getenvid(s, len, envp) CONST char *s; int len, *envp; { int i; if (len < 0) len = strlen(s); for (i = 0; i < ENVLISTSIZ; i++) { if (!strnenvcmp(s, fdenv_str(i), len) && !fdenv_str(i)[len]) { if (envp) *envp = 0; return(i); } if (!strnenvcmp(s, env_str(i), len) && !env_str(i)[len]) { if (envp) *envp = 1; return(i); } } return(-1); } static VOID NEAR _evalenv(no) int no; { #if MSDOS && defined (DEP_DOSDRIVE) int i; #endif CONST char *cp; char *new; int n; cp = getenv2(fdenv_str(no)); switch (env_type(no)) { case T_BOOL: if (!cp) n = def_num(no); else n = (*cp && Xatoi(cp)) ? 1 : 0; *((int *)(envlist[no].var)) = n; break; case T_SHORT: if ((n = Xatoi(cp)) < 0) n = def_num(no); if (n > MAXTYPE(short)) n = MAXTYPE(short); *((short *)(envlist[no].var)) = n; break; #ifdef DEP_URLPATH case T_URLOPT: /*FALLTHRU*/ #endif case T_INT: if ((n = Xatoi(cp)) < 0) n = def_num(no); *((int *)(envlist[no].var)) = n; break; case T_NATURAL: if ((n = Xatoi(cp)) < 0) n = def_num(no); *((int *)(envlist[no].var)) = n; break; case T_PATH: if (!cp) cp = def_str(no); new = evalpath(Xstrdup(cp), 0); Xfree(*((char **)(envlist[no].var))); *((char **)(envlist[no].var)) = new; break; case T_PATHS: case T_KPATHS: if (!cp) cp = def_str(no); new = evalpaths(cp, ':'); Xfree(*((char **)(envlist[no].var))); *((char **)(envlist[no].var)) = new; break; case T_SORT: if ((n = Xatoi(cp)) < 0 || (n / 100) > MAXSORTINHERIT || ((n % 100) & ~(SRT_TYPE | SRT_DESC)) || ((n % 100) & SRT_TYPE) > MAXSORTTYPE) n = def_num(no); *((int *)(envlist[no].var)) = n; sorton = n % 100; break; case T_DISP: #ifdef HAVEFLAGS if ((n = Xatoi(cp)) < 0 || n > 15) #else if ((n = Xatoi(cp)) < 0 || n > 7) #endif n = def_num(no); *((int *)(envlist[no].var)) = n; break; #ifndef _NOWRITEFS case T_WRFS: if ((n = Xatoi(cp)) < 0 || n > 2) n = def_num(no); *((int *)(envlist[no].var)) = n; break; #endif case T_COLUMN: if ((n = Xatoi(cp)) <= 0 || n > 5 || n == 4) n = def_num(no); *((int *)(envlist[no].var)) = n; break; #if MSDOS && defined (DEP_DOSDRIVE) case T_DDRV: if (!cp) n = def_num(no); else { n = 0; if (!(new = Xstrchr(cp, ','))) { if (*cp && Xatoi(cp)) n |= 1; } else { if (!strcmp(&(new[1]), "BIOS")) n |= 2; if (new <= cp) /*EMPTY*/; else if (Xsscanf(cp, "% 3) n = def_num(no); *((int *)(envlist[no].var)) = n; break; #endif #ifndef _NOEDITMODE case T_EDIT: if (!cp) cp = def_str(no); else if (strcmp(cp, "emacs") && strcmp(cp, "vi") && strcmp(cp, "wordstar")) cp = NULL; *((char **)(envlist[no].var)) = (char *)cp; break; #endif /* !_NOEDITMODE */ #if defined (DEP_KCONV) || (!defined (_NOENGMES) && !defined (_NOJPNMES)) case T_MESLANG: # ifndef _NOCATALOG catname = cp; /*FALLTHRU*/ # endif case T_KIN: case T_KOUT: case T_KNAM: case T_KTERM: n = (1 << (env_type(no) - T_KIN)); *((int *)(envlist[no].var)) = getlang(cp, n); break; #endif /* DEP_KCONV || (!_NOENGMES && !NOJPNMES) */ #if FD >= 2 case T_OCTAL: if ((n = atooctal(cp)) < 0) n = def_num(no); *((short *)(envlist[no].var)) = n; break; #endif #if defined (DEP_PTY) || defined (DEP_IME) case T_KEYCODE: if ((n = getkeycode(cp, 0)) < 0) n = def_num(no); *((int *)(envlist[no].var)) = n; break; #endif #if FD >= 2 case T_HELP: if ((n = Xatoi(cp)) < 0 || (n / 100) > MAXHELPINDEX || (n % 100) > (n / 100)) n = def_num(no); *((int *)(envlist[no].var)) = n; break; #endif #ifndef _NOCUSTOMIZE case T_NOVAR: break; #endif #if defined (DEP_IME) && (FD >= 3) case T_IMEBUF: if ((n = Xatoi(cp)) < 0 || n > 3) n = def_num(no); *((int *)(envlist[no].var)) = n; break; #endif default: if (!cp) cp = def_str(no); *((char **)(envlist[no].var)) = (char *)cp; break; } } #ifdef DEP_FILECONV static char *NEAR pathlang(pp, stable) pathtable *pp; int stable; { char *path; if (pp -> flags & P_ISARRAY) path = (char *)(pp -> path); else path = *((char **)(pp -> path)); if (!path) return(NULL); if (!stable) /*EMPTY*/; else if (pp -> lang == NOCNV) { if (!(pp -> flags & P_STABLE)) { Xfree(pp -> last); pp -> last = NULL; } stable = 0; } else if (pp -> flags & P_STABLE) /*EMPTY*/; else if (!(pp -> last) || strcmp(path, pp -> last)) stable = 0; if (!stable && (pp -> lang = getkcode(path)) == NOCNV) pp -> lang = DEFCODE; return(path); } static VOID NEAR pathconv(pp) pathtable *pp; { char *path, buf[MAXPATHLEN]; int lang; lang = pp -> lang; if (!(path = pathlang(pp, 0))) return; if (lang != pp -> lang) { kanjiconv(buf, path, MAXPATHLEN - 1, DEFCODE, lang, L_FNAME); if (pp -> flags & P_ISARRAY) kanjiconv(path, buf, MAXPATHLEN - 1, pp -> lang, DEFCODE, L_FNAME); else { path = Xstrdup(buf); renewkanjiconv(&path, pp -> lang, DEFCODE, L_FNAME); Xfree(*((char **)(pp -> path))); *((char **)(pp -> path)) = path; } if (kanjierrno) pp -> lang = DEFCODE; } if (!(pp -> flags & P_STABLE)) { Xfree(pp -> last); pp -> last = Xstrdup(path); } } static VOID NEAR savepathlang(VOID_A) { int i; for (i = 0; i < PATHLISTSIZ; i++) VOID_C pathlang(&(pathlist[i]), 1); # ifndef _NOSPLITWIN for (i = 0; i < MAXWINDOWS; i++) { # ifndef _NOARCHIVE archlist[i].path = &(winvar[i].v_archivedir); archlist[i].flags = P_STABLE; VOID_C pathlang(&(archlist[i]), 1); # endif fulllist[i].path = &(winvar[i].v_fullpath); fulllist[i].flags = P_STABLE; VOID_C pathlang(&(fulllist[i]), 1); } # endif /* !_NOSPLITWIN */ } static VOID NEAR evalpathlang(VOID_A) { int i; for (i = 0; i < PATHLISTSIZ; i++) pathconv(&(pathlist[i])); # ifndef _NOSPLITWIN for (i = 0; i < MAXWINDOWS; i++) { # ifndef _NOARCHIVE pathconv(&(archlist[i])); # endif pathconv(&(fulllist[i])); } # endif /* !_NOSPLITWIN */ # ifdef DEP_PTY changekcode(); changeinkcode(); changeoutkcode(); # endif } #endif /* DEP_FILECONV */ static VOID NEAR evalheader(VOID_A) { #ifndef _NOEXTRAWIN int i; #endif int n; n = wheader; wheader = WHEADER; if (n == wheader) return; #ifdef _NOEXTRAWIN calcwin(); #else n -= wheader; for (i = 0; i < windows; i++) if (winvar[i].v_fileperrow + n >= WFILEMIN) break; if (i < windows) winvar[i].v_fileperrow += n; #endif #ifdef DEP_PTY changewsize(wheader, windows); #endif } static VOID NEAR evalenvone(n) int n; { #ifdef DEP_FILECONV int type; #endif #ifdef DEP_FILECONV type = env_type(n); if (type != T_KPATHS && (type < T_KIN || type > T_KTERM)) type = -1; if (type >= 0) savepathlang(); #endif _evalenv(n); #ifdef DEP_FILECONV if (type >= 0) evalpathlang(); #endif #ifndef _NOCATALOG if (env_type(n) == T_MESLANG || env_type(n) == T_KOUT) chkcatalog(); #endif } VOID evalenv(s, len) CONST char *s; int len; { int i, duperrno; duperrno = errno; if (s) { if ((i = getenvid(s, len, NULL)) < 0) return; evalenvone(i); } else { #ifdef DEP_FILECONV savepathlang(); #endif for (i = 0; i < ENVLISTSIZ; i++) _evalenv(i); #ifdef DEP_FILECONV evalpathlang(); #endif #ifndef _NOCATALOG chkcatalog(); #endif } evalheader(); errno = duperrno; } #ifdef DEBUG VOID freeenvpath(VOID_A) { int i; # ifdef DEP_FILECONV for (i = 0; i < PATHLISTSIZ; i++) { Xfree(pathlist[i].last); pathlist[i].last = NULL; } # endif for (i = 0; i < ENVLISTSIZ; i++) switch (env_type(i)) { case T_PATH: case T_PATHS: case T_KPATHS: Xfree(*((char **)(envlist[i].var))); *((char **)(envlist[i].var)) = NULL; break; default: break; } } #endif /* DEBUG */ VOID freestrarray(list, max) char **list; int max; { int i; if (list) for (i = 0; i < max; i++) Xfree(list[i]); } char **copystrarray(dest, src, ndestp, nsrc) char **dest, *CONST *src; int *ndestp, nsrc; { int i; if (dest != src) freestrarray(dest, (ndestp) ? *ndestp : nsrc); if (nsrc <= 0) /*EMPTY*/; # ifndef DEP_DYNAMICLIST else if (dest) /*EMPTY*/; # endif else dest = (char **)Xrealloc(dest, nsrc * sizeof(*dest)); for (i = 0; i < nsrc; i++) dest[i] = Xstrdup(src[i]); if (ndestp) *ndestp = nsrc; return(dest); } #if !defined (_NOCUSTOMIZE) || defined (DEP_DYNAMICLIST) bindtable *copybind(dest, src, ndestp, nsrc) bindtable *dest; CONST bindtable *src; int *ndestp, nsrc; { if (nsrc <= 0) /*EMPTY*/; # ifndef DEP_DYNAMICLIST else if (dest) /*EMPTY*/; # endif else dest = (bindtable *)Xrealloc(dest, nsrc * sizeof(*dest)); if (dest != src) memcpy((char *)dest, (char *)src, nsrc * sizeof(*dest)); *ndestp = nsrc; return(dest); } #endif /* !_NOCUSTOMIZE || DEP_DYNAMICLIST */ #ifndef _NOARCHIVE VOID freelaunchlist(list, max) lsparse_t *list; int max; { int i; if (list) for (i = 0; i < max; i++) freelaunch(&(list[i])); } lsparse_t *copylaunch(dest, src, ndestp, nsrc) lsparse_t *dest; CONST lsparse_t *src; int *ndestp, nsrc; { int i; if (dest != src) freelaunchlist(dest, *ndestp); if (nsrc <= 0) /*EMPTY*/; # ifndef DEP_DYNAMICLIST else if (dest) /*EMPTY*/; # endif else dest = (lsparse_t *)Xrealloc(dest, nsrc * sizeof(*dest)); if (dest != src) memcpy((char *)dest, (char *)src, nsrc * sizeof(*dest)); for (i = 0; i < nsrc; i++) { dest[i].ext = Xstrdup(src[i].ext); dest[i].comm = Xstrdup(src[i].comm); # ifndef OLDPARSE dest[i].format = duplvar(src[i].format, -1); dest[i].lignore = duplvar(src[i].lignore, -1); dest[i].lerror = duplvar(src[i].lerror, -1); # endif } *ndestp = nsrc; return(dest); } VOID freearchlist(list, max) archive_t *list; int max; { int i; if (list) for (i = 0; i < max; i++) freearch(&(list[i])); } archive_t *copyarch(dest, src, ndestp, nsrc) archive_t *dest; CONST archive_t *src; int *ndestp, nsrc; { int i; if (dest != src) freearchlist(dest, *ndestp); if (nsrc <= 0) /*EMPTY*/; # ifndef DEP_DYNAMICLIST else if (dest) /*EMPTY*/; # endif else dest = (archive_t *)Xrealloc(dest, nsrc * sizeof(*dest)); if (dest != src) memcpy((char *)dest, (char *)src, nsrc * sizeof(*dest)); for (i = 0; i < nsrc; i++) { dest[i].ext = Xstrdup(src[i].ext); dest[i].p_comm = Xstrdup(src[i].p_comm); dest[i].u_comm = Xstrdup(src[i].u_comm); } *ndestp = nsrc; return(dest); } #endif /* !_NOARCHIVE */ #ifdef DEP_DOSEMU VOID freedosdrive(list, max) devinfo *list; int max; { int i; if (list) for (i = 0; i < max; i++) Xfree(list[i].name); } devinfo *copydosdrive(dest, src, ndestp, nsrc) devinfo *dest; CONST devinfo *src; int *ndestp, nsrc; { int i; if (dest != src) freedosdrive(dest, *ndestp); if (nsrc <= 0) /*EMPTY*/; # ifndef DEP_DYNAMICLIST else if (dest) /*EMPTY*/; # endif else dest = (devinfo *)Xrealloc(dest, nsrc * sizeof(*dest)); if (dest != src) memcpy((char *)dest, (char *)src, nsrc * sizeof(*dest)); for (i = 0; i < nsrc; i++) dest[i].name = Xstrdup(src[i].name); *ndestp = nsrc; return(dest); } #endif /* DEP_DOSEMU */ #ifndef _NOCUSTOMIZE static int NEAR custputs(s) CONST char *s; { return(XXcprintf("%^.*k", n_lastcolumn, s)); } static char *NEAR strcatalloc(s1, s2) char *s1; CONST char *s2; { int l1, l2; l1 = (s1) ? strlen(s1) : 0; l2 = strlen(s2); s1 = Xrealloc(s1, l1 + l2 + 1); Xstrncpy(&(s1[l1]), s2, l2); return(s1); } static VOID NEAR putsep(VOID_A) { Xattrputs(" ", 1); } static VOID NEAR fillline(y, w) int y, w; { Xlocate(0, y); VOID_C attrputstr(w, NULL, 1); } static char *NEAR inputcuststr(prompt, delsp, s, h) CONST char *prompt; int delsp; CONST char *s; int h; { return(inputstr(prompt, delsp, (s) ? strlen(s) : 0, s, h)); } static char *NEAR inputcustenvstr(prompt, delsp, s, h) CONST char *prompt; int delsp; CONST char *s; int h; { char *cp; if (!(cp = inputcuststr(prompt, delsp, s, h))) return((char *)-1); if (!*cp && yesno(USENV_K, prompt)) { Xfree(cp); return(NULL); } return(cp); } static VOID NEAR setnamelist(n, list, s) int n; namelist *list; CONST char *s; { memset((char *)&(list[n]), 0, sizeof(*list)); list[n].name = (char *)s; list[n].ent = n; list[n].flags = (F_ISRED | F_ISWRI); list[n].tmpflags = F_STAT; } static int NEAR browsenamelist(list, max, col, def, prompt, mes) namelist *list; int max, col; CONST char *def, *prompt, **mes; { int ch, pos, old; int dupwin_x, dupwin_y, dupminfilename, dupcolumns, dupdispmode; dupminfilename = minfilename; dupcolumns = curcolumns; dupdispmode = dispmode; minfilename = n_column; curcolumns = col; dispmode = 0; dupwin_x = win_x; dupwin_y = win_y; subwindow = 1; pos = listupfile(list, max, def, 1); envcaption(prompt); do { Xlocate(0, L_INFO); Xputterm(L_CLEAR); VOID_C custputs(mes[pos] ? mes[pos] : list[pos].name); VOID_C XXputch('.'); Xlocate(win_x, win_y); Xtflush(); keyflush(); Xgetkey(-1, 0, 0); ch = Xgetkey(1, 0, 0); Xgetkey(-1, 0, 0); old = pos; switch (ch) { case K_UP: if (pos > 0) pos--; break; case K_DOWN: if (pos < max - 1) pos++; break; case K_RIGHT: if (pos <= max - 1 - FILEPERROW) pos += FILEPERROW; else if (pos / FILEPERPAGE != (max - 1) / FILEPERPAGE) pos = max - 1; break; case K_LEFT: if (pos >= FILEPERROW) pos -= FILEPERROW; break; case K_PPAGE: if (pos < FILEPERPAGE) Xputterm(T_BELL); else pos = ((pos / FILEPERPAGE) - 1) * FILEPERPAGE; break; case K_NPAGE: if (((pos / FILEPERPAGE) + 1) * FILEPERPAGE >= max - 1) Xputterm(T_BELL); else pos = ((pos / FILEPERPAGE) + 1) * FILEPERPAGE; break; case K_BEG: case K_HOME: case '<': pos = 0; break; case K_EOL: case K_END: case '>': pos = max - 1; break; case K_CTRL('L'): rewritefile(1); old = -FILEPERPAGE; break; default: break; } if (old / FILEPERPAGE != pos / FILEPERPAGE) pos = listupfile(list, max, list[pos].name, 1); else if (old != pos) { putname(list, old, -1); calc_x += putname(list, pos, 1) + 1; win_x = calc_x; win_y = calc_y; } } while (ch != K_ESC && ch != K_CR); win_x = dupwin_x; win_y = dupwin_y; subwindow = 0; minfilename = dupminfilename; curcolumns = dupcolumns; dispmode = dupdispmode; return((ch == K_CR) ? pos : -1); } static VOID NEAR custtitle(VOID_A) { CONST char *str[MAXCUSTOM]; int i, len, max, width; str[0] = TENV_K; str[1] = TBIND_K; str[2] = TKYMP_K; str[3] = TLNCH_K; str[4] = TARCH_K; str[5] = TSDRV_K; str[6] = TSAVE_K; for (i = width = max = 0; i < MAXCUSTOM; i++) { len = strlen2(str[i]); width += len + 2; if (max < len) max = len; } width--; len = 1; if (width <= n_column) width = max; else { len = 0; if (width - (MAXCUSTOM - 1) <= n_column) width = max; else width = n_column / MAXCUSTOM - 1; } Xlocate(0, filetop(win)); Xputterm(L_CLEAR); for (i = 0; i < MAXCUSTOM; i++) { VOID_C Xattrprintf("/%^.*k", i == custno, width, str[i]); if (len) VOID_C XXputch(' '); } fillline(filetop(win) + 1, n_column); } static VOID NEAR calcmax(max, new) int max[], new; { # ifndef _NOKEYMAP int i; # endif max[0] = ENVLISTSIZ; max[1] = maxbind + new; # ifdef _NOKEYMAP max[2] = new; # else for (i = 0; keyseqlist[i] >= 0; i++) /*EMPTY*/; max[2] = i; # endif # ifdef _NOARCHIVE max[3] = new; max[4] = new; # else max[3] = maxlaunch + new; max[4] = maxarchive + new; # endif # ifdef DEP_DOSEMU max[5] = maxfdtype + new; # else max[5] = new; # endif max[6] = (new) ? MAXSAVEMENU : 0; } static VOID NEAR envcaption(s) CONST char *s; { Xlocate(0, L_HELP); Xputterm(L_CLEAR); VOID_C Xattrprintf("%^.*k", 1, n_column, s); } static char **NEAR copyenv(list) char **list; { int i; if (list) { # ifdef DEP_FILECONV savepathlang(); # endif for (i = 0; i < ENVLISTSIZ; i++) { setenv2(fdenv_str(i), list[i * 2], 0); setenv2(env_str(i), list[i * 2 + 1], 0); _evalenv(i); } # ifdef DEP_FILECONV evalpathlang(); # endif # ifndef _NOCATALOG chkcatalog(); # endif evalheader(); } else { list = (char **)Xmalloc(ENVLISTSIZ * 2 * sizeof(*list)); for (i = 0; i < ENVLISTSIZ; i++) { list[i * 2] = Xstrdup(getshellvar(fdenv_str(i), -1)); list[i * 2 + 1] = Xstrdup(getshellvar(env_str(i), -1)); } } return(list); } static VOID NEAR cleanupenv(VOID_A) { CONST char *cp; int i; # ifdef DEP_FILECONV savepathlang(); # endif for (i = 0; i < ENVLISTSIZ; i++) { setenv2(fdenv_str(i), NULL, 0); cp = (env_type(i) == T_CHARP) ? def_str(i) : NULL; setenv2(env_str(i), cp, 0); _evalenv(i); } # ifdef DEP_FILECONV evalpathlang(); # endif # ifndef _NOCATALOG chkcatalog(); # endif evalheader(); } # if FD >= 2 static char *NEAR ascoctal(n, buf) int n; char *buf; { # ifdef BASHSTYLE VOID_C Xsnprintf(buf, MAXLONGWIDTH + 1, "%03o", n & 0777); # else VOID_C Xsnprintf(buf, MAXLONGWIDTH + 1, "%04o", n & 0777); # endif return(buf); } # endif /* FD >= 2 */ # ifdef DEP_ORIGSHELL static VOID NEAR putargs(s, argc, argv, fp) CONST char *s; int argc; CONST char *argv[]; XFILE *fp; { int i; if (!argc) return; VOID_C Xfputs(s, fp); for (i = 0; i < argc; i++) VOID_C Xfprintf(fp, " %s", argv[i]); VOID_C fputnl(fp); } # endif /* DEP_ORIGSHELL */ static char *NEAR int2str(buf, n) char *buf; int n; { VOID_C Xsnprintf(buf, MAXLONGWIDTH + 1, "%d", n); return(buf); } static int NEAR inputkeycode(s) CONST char *s; { int c, dupwin_x, dupwin_y; dupwin_x = win_x; dupwin_y = win_y; Xlocate(0, L_INFO); Xputterm(L_CLEAR); win_x = custputs(s); win_y = L_INFO; Xlocate(win_x, win_y); Xtflush(); keyflush(); Xgetkey(-1, 0, 0); c = Xgetkey(1, 0, 0); Xgetkey(-1, 0, 0); win_x = dupwin_x; win_y = dupwin_y; return(c); } static int NEAR dispenv(no) int no; { CONST char *cp, *str[MAXSELECTSTRS]; char *new, buf[MAXLONGWIDTH + 1]; int n, p; new = NULL; switch (env_type(no)) { case T_BOOL: str[0] = VBOL0_K; str[1] = VBOL1_K; cp = str[(*((int *)(envlist[no].var))) ? 1 : 0]; break; case T_SHORT: cp = int2str(buf, *((short *)(envlist[no].var))); break; case T_INT: case T_NATURAL: case T_COLUMN: cp = int2str(buf, *((int *)(envlist[no].var))); break; case T_SORT: n = *((int *)(envlist[no].var)); str[0] = ORAW_K; str[1] = ONAME_K; str[2] = OEXT_K; str[3] = OSIZE_K; str[4] = ODATE_K; str[5] = OLEN_K; p = n / 100; if (p > MAXSORTINHERIT) p = MAXSORTINHERIT; n %= 100; if ((n & 7) > MAXSORTTYPE) n = ((n & ~7) | MAXSORTTYPE); new = Xstrdup(&(str[n & 7][3])); if (n & 7) { str[0] = OINC_K; str[1] = ODEC_K; new = strcatalloc(new, "("); new = strcatalloc(new, &(str[n / 8][3])); new = strcatalloc(new, ")"); } if (p) { new = strcatalloc(new, ", "); # if FD >= 2 if (p > 1) cp = VSARC_K; else # endif cp = VSORT_K; new = strcatalloc(new, cp); } cp = new; break; case T_DISP: n = *((int *)(envlist[no].var)); new = Xstrdup(VDS1A_K); str[0] = VDS10_K; str[1] = VDS11_K; new = strcatalloc(new, str[n & 1]); new = strcatalloc(new, VDS2A_K); str[0] = VDS20_K; str[1] = VDS21_K; new = strcatalloc(new, str[(n >> 1) & 1]); new = strcatalloc(new, VDS3A_K); str[0] = VDS30_K; str[1] = VDS31_K; new = strcatalloc(new, str[(n >> 2) & 1]); # ifdef HAVEFLAGS new = strcatalloc(new, VDS4A_K); str[0] = VDS40_K; str[1] = VDS41_K; new = strcatalloc(new, str[(n >> 3) & 1]); # endif cp = new; break; # ifndef _NOWRITEFS case T_WRFS: str[0] = VWFS0_K; str[1] = VWFS1_K; str[2] = VWFS2_K; cp = str[*((int *)(envlist[no].var))]; break; # endif # if MSDOS && defined (DEP_DOSDRIVE) case T_DDRV: n = *((int *)(envlist[no].var)); str[0] = VBOL0_K; str[1] = VBOL1_K; cp = str[n & 1]; if (n & 2) { new = Xstrdup(cp); cp = new = strcatalloc(new, VBIOS_K); } break; # endif /* MSDOS && DEP_DOSDRIVE */ # ifndef _NOCOLOR case T_COLOR: str[0] = VBOL0_K; str[1] = VBOL1_K; str[2] = VCOL2_K; str[3] = VCOL3_K; cp = str[*((int *)(envlist[no].var))]; break; # if FD >= 2 case T_COLORPAL: str[0] = VBLK1_K; str[1] = VRED1_K; str[2] = VGRN1_K; str[3] = VYEL1_K; str[4] = VBLU1_K; str[5] = VMAG1_K; str[6] = VCYN1_K; str[7] = VWHI1_K; str[8] = VFOR1_K; str[9] = VBAK1_K; if (!(cp = getenv2(fdenv_str(no)))) cp = def_str(no); new = NULL; for (n = 0; n < MAXPALETTE; n++) { if (n) new = strcatalloc(new, "/"); p = (Xisdigit(cp[n])) ? cp[n] : DEFPALETTE[n]; p -= '0'; new = strcatalloc(new, str[p]); if (!cp[n]) cp--; } cp = new; break; # endif /* FD >= 2*/ # endif /* !_NOCOLOR */ # ifndef _NOEDITMODE case T_EDIT: if (!(cp = *((char **)(envlist[no].var)))) cp = VNONE_K; break; # endif /* !_NOEDITMODE */ # if defined (DEP_KCONV) || (!defined (_NOENGMES) && !defined (_NOJPNMES)) case T_MESLANG: # ifndef _NOCATALOG if (*((int *)(envlist[no].var)) == NOCNV && catname && *catname) { cp = catname; break; } /*FALLTHRU*/ # endif case T_KIN: case T_KOUT: case T_KNAM: case T_KTERM: str[NOCNV] = VNCNV_K; str[ENG] = VENG_K; # ifdef DEP_KCONV str[SJIS] = "ShiftJIS"; str[EUC] = "EUC-JP"; str[JIS7] = "7bit-JIS"; str[O_JIS7] = "old 7bit-JIS"; str[JIS8] = "8bit-JIS"; str[O_JIS8] = "old 8bit-JIS"; str[JUNET] = "ISO-2022-JP"; str[O_JUNET] = "old ISO-2022-JP"; str[HEX] = "HEX"; str[CAP] = "CAP"; str[UTF8] = "UTF-8"; str[M_UTF8] = "UTF-8 for Mac OS X"; str[I_UTF8] = "UTF-8 for iconv"; # endif /* DEP_KCONV */ cp = str[*((int *)(envlist[no].var))]; break; # endif /* DEP_KCONV || (!_NOENGMES && !NOJPNMES) */ # if FD >= 2 case T_OCTAL: cp = ascoctal(*((short *)(envlist[no].var)), buf); break; # endif # if defined (DEP_PTY) || defined (DEP_IME) case T_KEYCODE: cp = getenv2(fdenv_str(no)); break; # endif # if FD >= 2 case T_HELP: n = *((int *)(envlist[no].var)); p = n / 100; n %= 100; new = Xstrdup(VFNMX_K); new = strcatalloc(new, int2str(buf, p)); new = strcatalloc(new, ", "); new = strcatalloc(new, VFNBR_K); new = strcatalloc(new, int2str(buf, n)); cp = new; break; # endif /* FD >= 2 */ # ifdef DEP_URLPATH case T_URLOPT: n = *((int *)(envlist[no].var)); new = Xstrdup("PASV:"); str[0] = UOP00_K; str[1] = UOP01_K; new = strcatalloc(new, str[n & 1]); new = strcatalloc(new, ", PORT:"); new = strcatalloc(new, str[(n >> 1) & 1]); new = strcatalloc(new, ", MDTM:"); new = strcatalloc(new, str[(n >> 2) & 1]); new = strcatalloc(new, ", FEAT:"); new = strcatalloc(new, str[(n >> 3) & 1]); new = strcatalloc(new, ", HTTP:"); str[0] = UOP50_K; str[1] = UOP51_K; new = strcatalloc(new, str[(n >> 4) & 1]); cp = new; break; # endif /* DEP_URLPATH */ #if defined (DEP_IME) && (FD >= 3) case T_IMEBUF: str[0] = VBOL0_K; str[1] = IMEB1_K; str[2] = IMEB2_K; str[3] = IMEB3_K; cp = str[*((int *)(envlist[no].var))]; break; #endif default: if (!(cp = getenv2(fdenv_str(no)))) cp = def_str(no); break; } if (!getenv2(fdenv_str(no))) { if (!new) new = Xstrdup(cp); cp = new = strcatalloc(new, (cp && *cp) ? VDEF_K : VUDEF_K); } cputstr(MAXCUSTVAL, cp); n = strlen2(cp); if (n > MAXCUSTVAL - 1) n = MAXCUSTVAL - 1; Xfree(new); return(n); } static int NEAR editenv(no) int no; { # ifndef _NOCATALOG char **argv; int i, top; # endif CONST char *cp, *env, *str[MAXSELECTSTRS]; char *s, *new, buf[MAXLONGWIDTH + 1]; int n, p, tmp, val[MAXSELECTSTRS]; for (n = 0; n < MAXSELECTSTRS; n++) val[n] = n; # ifndef _NOCATALOG argv = NULL; # endif new = NULL; env = env_str(no); switch (env_type(no)) { case T_BOOL: n = (*((int *)(envlist[no].var))) ? 1 : 0; str[0] = VBOL0_K; str[1] = VBOL1_K; str[2] = VUSET_K; val[2] = -1; envcaption(env); if (noselect(&n, 3, 0, str, val)) return(0); cp = (n >= 0) ? int2str(buf, n) : NULL; break; case T_SHORT: int2str(buf, *((short *)(envlist[no].var))); cp = s = inputcustenvstr(env, 1, buf, -1); if (cp == (char *)-1) return(0); if (!cp) break; n = Xatoi(cp); Xfree(s); if (n < 0 || n > MAXTYPE(short)) { warning(0, VALNG_K); return(0); } cp = int2str(buf, n); break; case T_INT: case T_NATURAL: int2str(buf, *((int *)(envlist[no].var))); cp = s = inputcustenvstr(env, 1, buf, -1); if (cp == (char *)-1) return(0); if (!cp) break; n = Xatoi(cp); Xfree(s); if (n < 0) { warning(0, VALNG_K); return(0); } cp = int2str(buf, n); break; case T_PATH: case T_PATHS: case T_KPATHS: if (!(cp = getenv2(fdenv_str(no)))) cp = def_str(no); cp = new = inputcustenvstr(env, 1, cp, HST_PATH); if (cp == (char *)-1) return(0); break; case T_SORT: n = *((int *)(envlist[no].var)); str[0] = ONAME_K; str[1] = OEXT_K; str[2] = OSIZE_K; str[3] = ODATE_K; str[4] = OLEN_K; str[5] = ORAW_K; str[6] = OUST_K; val[0] = 1; val[1] = 2; val[2] = 3; val[3] = 4; val[4] = 5; val[5] = 0; val[6] = -1; p = n / 100; if (p > MAXSORTINHERIT) p = MAXSORTINHERIT; n %= 100; if ((n & 7) > MAXSORTTYPE) n = ((n & ~7) | MAXSORTTYPE); tmp = n & ~7; n &= 7; envcaption(env); if (noselect(&n, 7, 0, str, val)) return(0); if (n < 0) { cp = NULL; break; } if (n) { str[0] = OINC_K; str[1] = ODEC_K; val[0] = 0; val[1] = 8; if (noselect(&tmp, 2, 56, str, val)) return(0); n += tmp; } envcaption(VSORT_K); str[0] = VSRT0_K; str[1] = VSRT1_K; str[2] = VSRT2_K; val[0] = 0; val[1] = 1; val[2] = 2; if (noselect(&p, MAXSORTINHERIT + 1, 0, str, val)) return(0); n += p * 100; cp = int2str(buf, n); break; case T_DISP: n = *((int *)(envlist[no].var)); envcaption(VDS1B_K); str[0] = VDS10_K; str[1] = VDS11_K; str[2] = VUSET_K; val[2] = -1; tmp = n & 1; if (noselect(&tmp, 3, 0, str, val)) return(0); if (tmp < 0) { cp = NULL; break; } n = (n & ~1) | tmp; envcaption(VDS2B_K); str[0] = VDS20_K; str[1] = VDS21_K; tmp = (n & 2) >> 1; if (noselect(&tmp, 2, 0, str, val)) return(0); n = (n & ~2) | (tmp << 1); envcaption(VDS3B_K); str[0] = VDS30_K; str[1] = VDS31_K; tmp = (n & 4) >> 2; if (noselect(&tmp, 2, 0, str, val)) return(0); n = (n & ~4) | (tmp << 2); # ifdef HAVEFLAGS envcaption(VDS4B_K); str[0] = VDS40_K; str[1] = VDS41_K; tmp = (n & 8) >> 3; if (noselect(&tmp, 2, 0, str, val)) return(0); n = (n & ~8) | (tmp << 3); # endif cp = int2str(buf, n); break; # ifndef _NOWRITEFS case T_WRFS: n = *((int *)(envlist[no].var)); str[0] = VWFS0_K; str[1] = VWFS1_K; str[2] = VWFS2_K; str[3] = VUSET_K; val[3] = -1; envcaption(env); if (noselect(&n, 4, 0, str, val)) return(0); cp = (n >= 0) ? int2str(buf, n) : NULL; break; # endif /* !_NOWRITEFS */ # if MSDOS && defined (DEP_DOSDRIVE) case T_DDRV: n = (*((int *)(envlist[no].var)) & 1); str[0] = VBOL0_K; str[1] = VBOL1_K; str[2] = VUSET_K; val[2] = -1; envcaption(env); if (noselect(&n, 3, 0, str, val)) return(0); cp = (n >= 0) ? int2str(buf, n) : NULL; if (cp && *((int *)(envlist[no].var)) & 2) { new = Xstrdup(cp); cp = new = strcatalloc(new, ",BIOS"); } break; # endif /* MSDOS && DEP_DOSDRIVE */ case T_COLUMN: n = *((int *)(envlist[no].var)); str[0] = "1"; str[1] = "2"; str[2] = "3"; str[3] = "5"; str[4] = VUSET_K; val[0] = 1; val[1] = 2; val[2] = 3; val[3] = 5; val[4] = -1; envcaption(env); if (noselect(&n, 5, 0, str, val)) return(0); cp = (n >= 0) ? int2str(buf, n) : NULL; break; # ifndef _NOCOLOR case T_COLOR: n = *((int *)(envlist[no].var)); str[0] = VBOL0_K; str[1] = VBOL1_K; str[2] = VCOL2_K; str[3] = VCOL3_K; str[4] = VUSET_K; val[4] = -1; envcaption(env); if (noselect(&n, 5, 0, str, val)) return(0); cp = (n >= 0) ? int2str(buf, n) : NULL; break; # if FD >= 2 case T_COLORPAL: n = 0; str[0] = VCREG_K; str[1] = VCBAK_K; str[2] = VCDIR_K; str[3] = VCUWR_K; str[4] = VCURD_K; str[5] = VCLNK_K; str[6] = VCSCK_K; str[7] = VCFIF_K; str[8] = VCBLD_K; str[9] = VCCHD_K; str[10] = VCEXE_K; str[MAXPALETTE] = VUSET_K; val[MAXPALETTE] = -1; envcaption(env); if (noselect(&n, MAXPALETTE + 1, 0, str, val)) return(0); if (n < 0) { cp = NULL; break; } cp = *((char **)(envlist[no].var)); p = (cp) ? strlen(cp) : 0; if (p < MAXPALETTE) p = MAXPALETTE; new = Xmalloc(p + 1); p = 0; if (cp) for (; cp[p]; p++) new[p] = cp[p]; for (; p < MAXPALETTE; p++) new[p] = DEFPALETTE[p]; new[p] = '\0'; p = (Xisdigit(new[n])) ? new[n] : DEFPALETTE[n]; p -= '0'; envcaption(str[n]); str[0] = VBLK2_K; str[1] = VRED2_K; str[2] = VGRN2_K; str[3] = VYEL2_K; str[4] = VBLU2_K; str[5] = VMAG2_K; str[6] = VCYN2_K; str[7] = VWHI2_K; str[8] = VFOR2_K; str[9] = VBAK2_K; if (noselect(&p, MAXCOLOR, 0, str, val)) { Xfree(new); return(0); } new[n] = p + '0'; cp = new; break; # endif /* FD >= 2*/ # endif /* !_NOCOLOR */ # ifndef _NOEDITMODE case T_EDIT: cp = *((char **)(envlist[no].var)); str[0] = "emacs"; str[1] = "wordstar"; str[2] = "vi"; str[3] = VUSET_K; val[3] = -1; if (!cp) n = 0; else for (n = 2; n > 0; n--) if (!strcmp(cp, str[n])) break; envcaption(env); if (noselect(&n, 4, 0, str, val)) return(0); cp = (n >= 0) ? str[n] : NULL; break; # endif /* !_NOEDITMODE */ # if defined (DEP_KCONV) || (!defined (_NOENGMES) && !defined (_NOJPNMES)) case T_KIN: case T_KNAM: case T_KOUT: case T_KTERM: case T_MESLANG: tmp = 0; str[tmp] = VNCNV_K; val[tmp++] = NOCNV; # if !defined (_NOENGMES) && !defined (_NOJPNMES) str[tmp] = VENG_K; val[tmp++] = ENG; # endif # ifdef DEP_KCONV str[tmp] = "SJIS"; val[tmp++] = SJIS; str[tmp] = "EUC"; val[tmp++] = EUC; str[tmp] = "7bit-JIS"; val[tmp++] = JIS7; str[tmp] = "8bit-JIS"; val[tmp++] = JIS8; str[tmp] = "ISO-2022-JP"; val[tmp++] = JUNET; str[tmp] = "Hex"; val[tmp++] = HEX; str[tmp] = "UTF-8"; val[tmp++] = UTF8; # endif /* DEP_KCONV */ str[tmp] = VUSET_K; val[tmp++] = -1; p = (1 << (env_type(no) - T_KIN)); for (n = 0; n < tmp; n++) { if (val[n] < 0 || (kanjiiomode[val[n]] & p)) continue; tmp--; memmove((char *)&(str[n]), (char *)&(str[n + 1]), (tmp - n) * sizeof(*str)); memmove((char *)&(val[n]), (char *)&(val[n + 1]), (tmp - n) * sizeof(*val)); n--; } if (!tmp) return(0); n = *((int *)(envlist[no].var)); # ifdef DEP_KCONV switch (n) { case O_JIS7: case O_JIS8: case O_JUNET: case CAP: p = 1; n--; break; case M_UTF8: case I_UTF8: p = n - UTF8; n = UTF8; break; default: p = 0; break; } # endif /* DEP_KCONV */ # ifndef _NOCATALOG if (env_type(no) == T_MESLANG && (argv = listcatalog())) { for (top = 0; top < tmp; top++) if (val[top] < 0) break; for (i = 0; argv[i]; i++) { if (tmp >= MAXSELECTSTRS) break; memmove((char *)&(str[top + 1]), (char *)&(str[top]), (tmp - top) * sizeof(*str)); memmove((char *)&(val[top + 1]), (char *)&(val[top]), (tmp - top) * sizeof(*val)); str[top] = argv[i]; val[top] = -2 - i; tmp++; } } # endif /* !_NOCATALOG */ envcaption(env); if (noselect(&n, tmp, 0, str, val)) return(0); # ifndef _NOCATALOG if (argv && n < -1) { cp = argv[-2 - n]; break; } # endif if (n < 0) { cp = NULL; break; } # ifdef DEP_KCONV switch (n) { case JIS7: case JIS8: case JUNET: str[0] = VNJIS_K; str[1] = VOJIS_K; tmp = 2; break; case HEX: str[0] = "HEX"; str[1] = "CAP"; tmp = 2; break; case UTF8: str[0] = VUTF8_K; str[1] = VUTFM_K; str[2] = VUTFI_K; tmp = 3; break; default: tmp = -1; break; } if (tmp >= 0) { val[0] = 0; val[1] = 1; val[2] = 2; if (noselect(&p, tmp, 64, str, val)) return(0); n += p; } # endif /* DEP_KCONV */ str[NOCNV] = nullstr; # if !defined (_NOENGMES) && !defined (_NOJPNMES) str[ENG] = "C"; # endif # ifdef DEP_KCONV str[SJIS] = "sjis"; str[EUC] = "euc"; str[JIS7] = "jis7"; str[O_JIS7] = "ojis7"; str[JIS8] = "jis8"; str[O_JIS8] = "ojis8"; str[JUNET] = "junet"; str[O_JUNET] = "ojunet"; str[HEX] = "hex"; str[CAP] = "cap"; str[UTF8] = "utf8"; str[M_UTF8] = "utf8-mac"; str[I_UTF8] = "utf8-iconv"; # endif /* DEP_KCONV */ cp = str[n]; break; # endif /* DEP_KCONV || (!_NOENGMES && !NOJPNMES) */ # if FD >= 2 case T_OCTAL: ascoctal(*((short *)(envlist[no].var)), buf); cp = s = inputcustenvstr(env, 1, buf, -1); if (cp == (char *)-1) return(0); if (!cp) break; n = atooctal(cp); Xfree(s); if (n < 0) { warning(0, VALNG_K); return(0); } cp = ascoctal(n, buf); break; # endif /* FD >= 2 */ # if defined (DEP_PTY) || defined (DEP_IME) case T_KEYCODE: cp = s = asprintf2(VKYCD_K, env); n = inputkeycode(cp); Xfree(s); if (n == K_ESC) { if (!yesno(USENV_K, env)) return(0); cp = NULL; break; } cp = getkeysym(n, 0); if (!yesno(VKYOK_K, cp, env_str(no))) return(0); break; # endif /* DEP_PTY || DEP_IME */ # if FD >= 2 case T_HELP: n = *((int *)(envlist[no].var)); p = n / 100; n %= 100; envcaption(env); int2str(buf, p); lcmdline = -1; cp = s = inputcustenvstr(VFNMX_K, 1, buf, -1); if (cp == (char *)-1) return(0); if (!cp) break; p = Xatoi(cp); Xfree(s); if (p < 0 || p > MAXHELPINDEX) { warning(0, VALNG_K); return(0); } envcaption(env); int2str(buf, n); lcmdline = -1; cp = s = inputcustenvstr(VFNBR_K, 1, buf, -1); if (cp == (char *)-1) return(0); if (!cp) break; n = Xatoi(cp); Xfree(s); if (n < 0 || n > p) { warning(0, VALNG_K); return(0); } cp = int2str(buf, p * 100 + n); break; # endif /* FD >= 2 */ # ifdef DEP_URLPATH case T_URLOPT: tmp = *((int *)(envlist[no].var)); for (n = 0; n < 5; n++) { val[n] = (tmp & 1); tmp >>= 1; } str[0] = UOP1B_K; str[1] = UOP2B_K; str[2] = UOP3B_K; str[3] = UOP4B_K; str[4] = UOP5B_K; envcaption(UOP0B_K); if (noselect(NULL, 5, 0, str, val)) return(0); tmp = 0; for (n = 5 - 1; n >= 0; n--) { tmp <<= 1; if (val[n]) tmp |= 1; } cp = (tmp) ? int2str(buf, tmp) : NULL; break; # endif /* DEP_URLPATH */ #if defined (DEP_IME) && (FD >= 3) case T_IMEBUF: n = *((int *)(envlist[no].var)); str[0] = VBOL0_K; str[1] = IMEB1_K; str[2] = IMEB2_K; str[3] = IMEB3_K; str[4] = VUSET_K; val[4] = -1; envcaption(env); if (noselect(&n, 5, 0, str, val)) return(0); cp = (n >= 0) ? int2str(buf, n) : NULL; break; #endif /* DEP_IME && FD >= 3 */ default: if (!(cp = getenv2(fdenv_str(no)))) cp = def_str(no); cp = new = inputcustenvstr(env, 0, cp, -1); if (cp == (char *)-1) return(0); break; } if (getshellvar(fdenv_str(no), -1)) n = setenv2(fdenv_str(no), cp, 0); else n = setenv2(env, cp, 0); # ifndef _NOCATALOG freevar(argv); # endif Xfree(new); if (n < 0) warning(-1, env); evalenvone(no); evalheader(); return(1); } static int NEAR dumpenv(flaglist, fp) CONST char *flaglist; XFILE *fp; { char *cp; int i, n; for (i = n = 0; i < ENVLISTSIZ; i++) { if ((!flaglist || !(flaglist[i] & 2)) && (cp = getshellvar(env_str(i), -1)) && (env_type(i) != T_CHARP || strenvcmp(cp, def_str(i)))) n++; if ((!flaglist || !(flaglist[i] & 1)) && getshellvar(fdenv_str(i), -1)) n++; } if (!n || !fp) return(n); VOID_C fputnl(fp); VOID_C Xfputs("# shell variables definition\n", fp); for (i = 0; i < ENVLISTSIZ; i++) { if ((!flaglist || !(flaglist[i] & 2)) && (cp = getshellvar(env_str(i), -1)) && (env_type(i) != T_CHARP || strenvcmp(cp, def_str(i)))) { cp = killmeta(cp); VOID_C Xfprintf(fp, "%s=%s\n", env_str(i), cp); Xfree(cp); } if ((!flaglist || !(flaglist[i] & 1)) && (cp = getshellvar(fdenv_str(i), -1))) { cp = killmeta(cp); VOID_C Xfprintf(fp, "%s=%s\n", fdenv_str(i), cp); Xfree(cp); } } return(n); } # ifdef DEP_ORIGSHELL static int NEAR checkenv(flaglist, argv, len, fp) char *flaglist, *CONST *argv; int *len; XFILE *fp; { CONST char *ident, **unset, **trash; char *cp; int i, n, ns, nu, nt, f; for (n = 0; argv[n]; n++) if (getenvid(argv[n], len[n], NULL) >= 0) break; if (!argv[n]) return(0); unset = trash = NULL; ns = nu = nt = 0; for (n = 0; argv[n]; n++) { if ((i = getenvid(argv[n], len[n], &f)) < 0) { if (ns++) VOID_C Xfputc(' ', fp); VOID_C Xfputs(argv[n], fp); continue; } ident = fdenv_str(i); if (f) ident += FDESIZ; f = (1 << f); if (!flaglist || !(flaglist[i] & f)) { if (flaglist) flaglist[i] |= f; if ((cp = getshellvar(ident, -1)) && (env_type(i) != T_CHARP || strenvcmp(cp, def_str(i)))) { if (ns++) VOID_C Xfputc(' ', fp); cp = killmeta(cp); VOID_C Xfprintf(fp, "%s=%s", ident, cp); Xfree(cp); continue; } else if (!(envlist[i].type & T_PRIMAL)) { unset = (CONST char **)Xrealloc(unset, (nu + 1) * sizeof(*unset)); unset[nu++] = ident; continue; } } trash = (CONST char **)Xrealloc(trash, (nt + 1) * sizeof(*trash)); trash[nt++] = argv[n]; } if (ns) VOID_C fputnl(fp); if (unset) { putargs(BL_UNSET, nu, unset, fp); Xfree(unset); } if (trash) { putargs("#", nt, trash, fp); Xfree(trash); } return(1); } static int NEAR checkunset(flaglist, argc, argv, fp) char *flaglist; int argc; char *CONST *argv; XFILE *fp; { CONST char *ident, **unset, **trash; char *cp; int i, n, ns, nu, nt, f; if (strcommcmp(argv[0], BL_UNSET)) return(0); if (argc < 2) return(-1); for (n = 1; n < argc; n++) if (getenvid(argv[n], -1, NULL) >= 0) break; if (n >= argc) return(0); unset = trash = NULL; ns = nu = nt = 0; for (n = 1; n < argc; n++) { if ((i = getenvid(argv[n], -1, &f)) < 0) { unset = (CONST char **)Xrealloc(unset, (nu + 1) * sizeof(*unset)); unset[nu++] = argv[n]; continue; } ident = fdenv_str(i); if (f) ident += FDESIZ; f = (1 << f); if (!flaglist || !(flaglist[i] & f)) { if (flaglist) flaglist[i] |= f; if ((cp = getshellvar(ident, -1)) && (env_type(i) != T_CHARP || strenvcmp(cp, def_str(i)))) { if (ns++) VOID_C Xfputc(' ', fp); cp = killmeta(cp); VOID_C Xfprintf(fp, "%s=%s", ident, cp); Xfree(cp); continue; } else if (!(envlist[i].type & T_PRIMAL)) { unset = (CONST char **)Xrealloc(unset, (nu + 1) * sizeof(*unset)); unset[nu++] = ident; continue; } } trash = (CONST char **)Xrealloc(trash, (nt + 1) * sizeof(*trash)); trash[nt++] = ident; } if (ns) VOID_C fputnl(fp); if (unset) { putargs(BL_UNSET, nu, unset, fp); Xfree(unset); } if (trash) { VOID_C Xfputs("# ", fp); putargs(BL_UNSET, nt, trash, fp); Xfree(trash); } return(1); } # endif /* DEP_ORIGSHELL */ static VOID NEAR cleanupbind(VOID_A) { freestrarray(macrolist, maxmacro); maxmacro = 0; # ifdef DEP_DYNAMICLIST bindlist = # endif copybind(bindlist, origbindlist, &maxbind, origmaxbind); # ifdef DEP_DYNAMICLIST helpindex = # endif copystrarray(helpindex, orighelpindex, NULL, MAXHELPINDEX); } static int NEAR dispbind(no) int no; { CONST char *cp1, *cp2; int len, width; if (no >= maxbind) { cputspace(MAXCUSTVAL); return(0); } if (ffunc(no) < FUNCLISTSIZ) cp1 = funclist[ffunc(no)].ident; else cp1 = getmacro(ffunc(no)); if (dfunc(no) < FUNCLISTSIZ) cp2 = funclist[dfunc(no)].ident; else cp2 = (hasdfunc(no)) ? getmacro(dfunc(no)) : NULL; if (!cp2) { width = MAXCUSTVAL; cputstr(width, cp1); } else { width = (MAXCUSTVAL - 1) / 2; cputstr(width, cp1); putsep(); cputstr(MAXCUSTVAL - 1 - width, cp2); } len = strlen2(cp1); if (len > --width) len = width; return(len); } static int NEAR selectbind(n, max, prompt) int n, max; CONST char *prompt; { namelist *list; CONST char *cp, **mes; int i, dupsorton; max += FUNCLISTSIZ; list = (namelist *)Xmalloc((FUNCLISTSIZ + 2) * sizeof(namelist)); mes = (CONST char **)Xmalloc((FUNCLISTSIZ + 2) * sizeof(char *)); for (i = 0; i < FUNCLISTSIZ; i++) setnamelist(i, list, funclist[i].ident); setnamelist(i, list, USRDF_K); mes[i++] = NULL; setnamelist(i, list, DELKB_K); mes[i] = NULL; dupsorton = sorton; sorton = SRT_FILENAME; qsort(list, FUNCLISTSIZ, sizeof(namelist), cmplist); sorton = dupsorton; for (i = 0; i < FUNCLISTSIZ; i++) mes[i] = mesconv2(funclist[list[i].ent].hmes_no, funclist[list[i].ent].hmes, funclist[list[i].ent].hmes_eng); cp = (n < FUNCLISTSIZ) ? funclist[n].ident : list[FUNCLISTSIZ].name; n = browsenamelist(list, max, 5, cp, prompt, mes); if (n >= 0) n = list[n].ent; Xfree(list); Xfree(mes); return (n); } static int NEAR editbind(no) int no; { bindtable bind; CONST char *str; char *cp, *buf, *func1, *func2; int i, n1, n2, key; if (no < maxbind) key = bindlist[no].key; else { key = inputkeycode(BINDK_K); for (no = 0; no < maxbind; no++) if (key == (int)(bindlist[no].key)) break; # ifndef DEP_DYNAMICLIST if (no >= MAXBINDTABLE - 1) { warning(0, OVERF_K); return(0); } # endif } if (key == K_ESC) { warning(0, ESCNG_K); return(0); } str = getkeysym(key, 0); func1 = func2 = NULL; for (;;) { if (no >= maxbind) { n1 = FUNCLISTSIZ; i = 1; } else { n1 = ffunc(no); i = 2; } buf = asprintf2(BINDF_K, str); n1 = selectbind(n1, i, buf); Xfree(buf); if (n1 < 0) return(-1); else if (n1 < FUNCLISTSIZ) break; else if (n1 == FUNCLISTSIZ + 1) { if (!yesno(DLBOK_K, str)) return(-1); deletekeybind(no); return(1); } else if (maxmacro >= MAXMACROTABLE) warning(0, OVERF_K); else { i = (no < maxbind) ? ffunc(no) : -1; buf = asprintf2(BNDFC_K, str); cp = inputcuststr(buf, 0, getmacro(i), HST_COMM); Xfree(buf); if (!cp); else if (!*cp) { Xfree(cp); n1 = NO_OPERATION; break; } else { func1 = cp; n1 = FNO_SETMACRO; break; } } } if (yesno(KBDIR_K)) n2 = FNO_NONE; else for (;;) { if (no >= maxbind) n2 = FUNCLISTSIZ; else if ((n2 = dfunc(no)) == FNO_NONE) n2 = ffunc(no); buf = asprintf2(BINDD_K, str); n2 = selectbind(i = n2, 1, buf); Xfree(buf); if (n2 < 0) { freemacro(n1); return(-1); } else if (n2 < FUNCLISTSIZ) { if (n2 == n1) n2 = FNO_NONE; break; } else if (maxmacro >= MAXMACROTABLE) warning(0, OVERF_K); else { if (no >= maxbind) i = -1; buf = asprintf2(BNDDC_K, str); cp = inputcuststr(buf, 0, getmacro(i), HST_COMM); Xfree(buf); if (!cp) /*EMPTY*/; else if (!*cp) { Xfree(cp); n2 = FNO_NONE; break; } else { func2 = cp; n2 = FNO_SETMACRO; break; } } } if (key < K_F(1) || key > K_F(MAXHELPINDEX)) cp = NULL; else cp = inputcuststr(FCOMM_K, 0, helpindex[key - K_F(1)], -1); bind.key = (short)key; bind.f_func = (funcno_t)n1; bind.d_func = (funcno_t)n2; VOID_C addkeybind(no, &bind, func1, func2, cp); return(1); } static int NEAR issamebind(bindp1, bindp2) CONST bindtable *bindp1, *bindp2; { if (ismacro(bindp1 -> f_func) || bindp1 -> f_func != bindp2 -> f_func) return(0); if (ismacro(bindp1 -> d_func) || bindp1 -> d_func != bindp2 -> d_func) return(0); if (gethelp(bindp1)) return(0); return(1); } static int NEAR dumpbind(flaglist, origflaglist, fp) CONST char *flaglist; char *origflaglist; XFILE *fp; { char *new; int i, j, n; if (origflaglist || origmaxbind <= 0) new = NULL; else { origflaglist = new = Xmalloc(origmaxbind * sizeof(char)); memset(origflaglist, 0, origmaxbind * sizeof(char)); } for (i = n = 0; i < maxbind; i++) { if (flaglist && flaglist[i]) continue; j = searchkeybind(&(bindlist[i]), origbindlist, origmaxbind); if (j < origmaxbind) { origflaglist[j] = 1; if (issamebind(&(bindlist[i]), &(origbindlist[j]))) continue; } n++; } for (i = 0; i < origmaxbind; i++) { if (origflaglist[i]) continue; n++; } if (!n || !fp) { Xfree(new); return(n); } VOID_C fputnl(fp); VOID_C Xfputs("# key bind definition\n", fp); for (i = 0; i < maxbind; i++) { if (flaglist && flaglist[i]) continue; j = searchkeybind(&(bindlist[i]), origbindlist, origmaxbind); if (j < origmaxbind) { if (issamebind(&(bindlist[i]), &(origbindlist[j]))) continue; } printmacro(bindlist, i, 1, fp); } for (i = 0; i < origmaxbind; i++) { if (origflaglist[i]) continue; printmacro(origbindlist, i, 0, fp); } Xfree(new); return(n); } # ifdef DEP_ORIGSHELL static int NEAR checkbind(flaglist, origflaglist, argc, argv, fp) char *flaglist, *origflaglist; int argc; char *CONST *argv; XFILE *fp; { bindtable bind; int i, j, n; if (strcommcmp(argv[0], BL_BIND)) return(0); if (parsekeybind(argc, argv, &bind) < 0) return(-1); n = (bind.d_func == FNO_NONE) ? 3 : 4; i = searchkeybind(&bind, bindlist, maxbind); j = searchkeybind(&bind, origbindlist, origmaxbind); if (i < maxbind) { if (!flaglist || flaglist[i]) return(-1); if (j < origmaxbind) { if (!origflaglist || origflaglist[j]) return(-1); if (argc <= n && bind.f_func == origbindlist[j].f_func && bind.d_func == origbindlist[j].d_func) return(-1); origflaglist[j] = 1; } } else { if (j >= origmaxbind) return(-1); if (!origflaglist || origflaglist[j]) return(-1); origflaglist[j] = 1; printmacro(origbindlist, j, 0, fp); return(1); } flaglist[i] = 1; printmacro(bindlist, i, 1, fp); return(1); } # endif /* DEP_ORIGSHELL */ # ifndef _NOKEYMAP static VOID NEAR cleanupkeymap(VOID_A) { copykeyseq(origkeymaplist); } static int NEAR dispkeymap(no) int no; { keyseq_t key; char *cp; int len; key.code = keyseqlist[no]; if (getkeyseq(&key) < 0 || !(key.len)) { cputspace(MAXCUSTVAL); return(0); } cp = encodestr(key.str, key.len); cputstr(MAXCUSTVAL, cp); len = strlen2(cp); if (len > MAXCUSTVAL - 1) len = MAXCUSTVAL - 1; Xfree(cp); return(len); } static int NEAR editkeymap(no) int no; { CONST char *cp; char *str, *buf; ALLOC_T size; int i, len, key, dupwin_x, dupwin_y; key = keyseqlist[no]; cp = getkeysym(key, 1); dupwin_x = win_x; dupwin_y = win_y; Xlocate(0, L_INFO); Xputterm(L_CLEAR); buf = asprintf2(KYMPK_K, cp); win_x = Xkanjiputs(buf); win_y = L_INFO; Xlocate(win_x, win_y); Xtflush(); keyflush(); Xfree(buf); while (!kbhit2(1000000L / SENSEPERSEC)); buf = c_realloc(NULL, 0, &size); len = 0; for (;;) { buf = c_realloc(buf, len, &size); if ((i = Xgetch()) == EOF) break; buf[len++] = i; if (!kbhit2(WAITKEYPAD * 1000L)) break; } buf = Xrealloc(buf, len + 1); buf[len] = '\0'; win_x = dupwin_x; win_y = dupwin_y; if (len == 1 && buf[0] == K_ESC) { Xfree(buf); if (!yesno(DELKM_K, cp)) return(0); setkeyseq(key, NULL, 0); return(1); } str = encodestr(buf, len); i = yesno(SETKM_K, cp, str); Xfree(str); if (!i) { Xfree(buf); return(0); } setkeyseq(key, buf, len); return(1); } static int NEAR searchkeymap(kp, list) CONST keyseq_t *kp, *list; { int i; for (i = 0; i < K_MAX - K_MIN + 1; i++) if (kp -> code == list[i].code) break; return(i); } static int NEAR issamekeymap(kp1, kp2) CONST keyseq_t *kp1, *kp2; { if (!(kp1 -> len)) return((kp2 -> len) ? 0 : 1); else if (!(kp2 -> len) || kp1 -> len != kp2 -> len) return(0); else if (!(kp1 -> str) || !(kp2 -> str) || memcmp(kp1 -> str, kp2 -> str, kp1 -> len)) return(0); return(1); } static int NEAR dumpkeymap(flaglist, origflaglist, fp) CONST char *flaglist; char *origflaglist; XFILE *fp; { keyseq_t key; char *new; int i, j, n; if (origflaglist) new = NULL; else { origflaglist = new = Xmalloc((K_MAX - K_MIN + 1) * sizeof(char)); memset(origflaglist, 0, (K_MAX - K_MIN + 1) * sizeof(char)); } for (i = n = 0; keyseqlist[i] >= 0; i++) { if (flaglist && flaglist[i]) continue; key.code = keyseqlist[i]; if (getkeyseq(&key) < 0) continue; j = searchkeymap(&key, origkeymaplist); if (j < K_MAX - K_MIN + 1) { origflaglist[j] = 1; if (issamekeymap(&key, &(origkeymaplist[j]))) continue; } n++; } for (i = 0; i < K_MAX - K_MIN + 1; i++) { if (origflaglist[i]) continue; if (!(origkeymaplist[i].len)) { origflaglist[i] = 1; continue; } key.code = origkeymaplist[i].code; if (getkeyseq(&key) >= 0) { if (issamekeymap(&key, &(origkeymaplist[i]))) { origflaglist[i] = 1; continue; } } n++; } if (!n || !fp) { Xfree(new); return(n); } VOID_C fputnl(fp); VOID_C Xfputs("# keymap definition\n", fp); for (i = 0; keyseqlist[i] >= 0; i++) { if (flaglist && flaglist[i]) continue; key.code = keyseqlist[i]; if (getkeyseq(&key) < 0) continue; j = searchkeymap(&key, origkeymaplist); if (j < K_MAX - K_MIN + 1) { if (issamekeymap(&key, &(origkeymaplist[j]))) continue; } printkeymap(&key, 1, fp); } for (i = 0; i < K_MAX - K_MIN + 1; i++) { if (origflaglist[i]) continue; printkeymap(&(origkeymaplist[i]), 1, fp); } Xfree(new); return(n); } # ifdef DEP_ORIGSHELL static int NEAR checkkeymap(flaglist, origflaglist, argc, argv, fp) char *flaglist, *origflaglist; int argc; char *CONST *argv; XFILE *fp; { keyseq_t key; int i, j; if (strcommcmp(argv[0], BL_KEYMAP)) return(0); if (parsekeymap(argc, argv, &key) < 0) return(-1); if (key.code < 0 || !(key.len)) return(0); for (i = 0; keyseqlist[i] >= 0; i++) if (key.code == keyseqlist[i]) break; j = searchkeymap(&key, origkeymaplist); if (keyseqlist[i] >= 0) { if (!flaglist || flaglist[i]) { Xfree(key.str); return(-1); } if (j < K_MAX - K_MIN + 1) { if (!origflaglist || origflaglist[j] || issamekeymap(&key, &(origkeymaplist[j]))) { Xfree(key.str); return(-1); } origflaglist[j] = 1; } } else { Xfree(key.str); if (j >= K_MAX - K_MIN + 1) return(-1); if (!origflaglist || origflaglist[j]) return(-1); origflaglist[j] = 1; printkeymap(&(origkeymaplist[j]), 0, fp); return(1); } Xfree(key.str); if (getkeyseq(&key) < 0) return(-1); flaglist[i] = 1; printkeymap(&key, 1, fp); return(1); } # endif /* DEP_ORIGSHELL */ # endif /* !_NOKEYMAP */ # ifndef _NOARCHIVE static VOID NEAR cleanuplaunch(VOID_A) { # ifdef DEP_DYNAMICLIST launchlist = # endif copylaunch(launchlist, origlaunchlist, &maxlaunch, origmaxlaunch); } static int NEAR displaunch(no) int no; { int len, width; if (no >= maxlaunch) { cputspace(MAXCUSTVAL); return(0); } if (!launchlist[no].format) { width = MAXCUSTVAL; cputstr(width, launchlist[no].comm); } else { width = (MAXCUSTVAL - 1 - 6) / 2; cputstr(width, launchlist[no].comm); putsep(); width = MAXCUSTVAL - 1 - 6 - width; cputstr(width, launchlist[no].format[0]); putsep(); VOID_C XXcprintf("%-2d", (int)(launchlist[no].topskip)); putsep(); VOID_C XXcprintf("%-2d", (int)(launchlist[no].bottomskip)); } len = strlen2(launchlist[no].comm); if (len > --width) len = width; return(len); } static VOID NEAR verboselaunch(list) lsparse_t *list; { int y, yy, len, nf, ni, ne; custtitle(); yy = filetop(win); y = 1; fillline(yy + y++, n_column); len = strlen2(&(list -> ext[1])); if (list -> flags & LF_IGNORECASE) len++; if (len >= MAXCUSTNAM) len = MAXCUSTNAM; fillline(yy + y++, MAXCUSTNAM + 1 - len); Xputterm(L_CLEAR); if (list -> flags & LF_IGNORECASE) { VOID_C XXputch('/'); len--; } VOID_C XXcprintf("%^.*k", len, &(list -> ext[1])); putsep(); cputstr(MAXCUSTVAL, list -> comm); putsep(); fillline(yy + y++, n_column); nf = ni = ne = 0; if (list -> format) for (; y < FILEPERROW - 1; y++) { if (nf >= 0) { if (!(list -> format[nf])) { nf = -1; fillline(yy + y, n_column); continue; } else if (nf) fillline(yy + y, MAXCUSTNAM + 2); else { Xlocate(0, yy + y); putsep(); Xattrputs("-t", 1); VOID_C XXcprintf("%3d", (int)(list -> topskip)); putsep(); Xattrputs("-b", 1); VOID_C XXcprintf("%3d", (int)(list -> bottomskip)); putsep(); Xattrputs("-f", 1); putsep(); } cputstr(MAXCUSTVAL, list -> format[nf]); putsep(); nf++; } else if (ni >= 0 && list -> lignore) { if (!(list -> lignore[ni])) { ni = -1; fillline(yy + y, n_column); continue; } else if (ni) fillline(yy + y, MAXCUSTNAM + 2); else { fillline(yy + y, MAXCUSTNAM - 2 + 1); Xattrputs("-i", 1); putsep(); } cputstr(MAXCUSTVAL, list -> lignore[ni]); putsep(); ni++; } else if (ne >= 0 && list -> lerror) { if (!(list -> lerror[ne])) { ne = -1; fillline(yy + y, n_column); continue; } else if (ne) fillline(yy + y, MAXCUSTNAM + 2); else { fillline(yy + y, MAXCUSTNAM - 2 + 1); Xattrputs("-e", 1); putsep(); } cputstr(MAXCUSTVAL, list -> lerror[ne]); putsep(); ne++; } else break; } for (; y < FILEPERROW; y++) fillline(yy + y, n_column); } static char **NEAR editvar(prompt, var) CONST char *prompt; char **var; { namelist *list; CONST char *usg, **mes, *str[4]; char *cp, *tmp; int i, n, max, val[4]; max = countvar(var); for (i = 0; i < arraysize(val); i++) val[i] = i; list = (namelist *)Xmalloc((max + 1) * sizeof(namelist)); mes = (CONST char **)Xmalloc((max + 1) * sizeof(char *)); usg = ARUSG_K; for (i = 0; i < max; i++) { setnamelist(i, list, var[i]); mes[i] = usg; } setnamelist(i, list, ARADD_K); mes[i] = NULL; cp = NULL; for (;;) { n = browsenamelist(list, max + 1, 1, cp, prompt, mes); if (n < 0) break; cp = list[n].name; if (n >= max) { if (!(tmp = inputcuststr(prompt, 1, NULL, -1))) continue; if (!*tmp) { Xfree(tmp); continue; } list = (namelist *)Xrealloc(list, (max + 2) * sizeof(*list)); mes = (CONST char **)Xrealloc(mes, (max + 2) * sizeof(*mes)); setnamelist(max, list, tmp); mes[max++] = usg; setnamelist(max, list, cp); mes[max] = NULL; cp = tmp; continue; } str[0] = AREDT_K; str[1] = (n > 0) ? ARUPW_K : NULL; str[2] = (n < max - 1) ? ARDWN_K : NULL; str[3] = ARDEL_K; i = 0; if (noselect(&i, arraysize(val), 0, str, val)) continue; if (i == 0) { if (!(tmp = inputcuststr(prompt, 1, cp, -1))) continue; if (!*tmp) { Xfree(tmp); continue; } Xfree(cp); cp = list[n].name = tmp; } else if (i == 1) { list[n].name = list[n - 1].name; list[n - 1].name = cp; } else if (i == 2) { list[n].name = list[n + 1].name; list[n + 1].name = cp; } else if (i == 3) { if (!yesno(ADLOK_K)) continue; Xfree(cp); for (i = n; i < max; i++) list[i].name = list[i + 1].name; mes[--max] = NULL; cp = list[n].name; } } Xfree(var); if (!max) var = NULL; else { var = (char **)Xmalloc((max + 1) * sizeof(*var)); for (i = 0; i < max; i++) var[i] = list[i].name; var[i] = NULL; } Xfree(list); Xfree(mes); return(var); } static int NEAR editarchbrowser(list) lsparse_t *list; { CONST char *cp, *str[6]; char *tmp, buf[MAXLONGWIDTH + 1]; int i, n, val[6]; u_char *skipp; str[0] = "-f"; str[1] = "-t"; str[2] = "-b"; str[3] = "-i"; str[4] = "-e"; str[5] = ARDON_K; for (i = 0; i < arraysize(val); i++) val[i] = i; n = 0; for (;;) { verboselaunch(list); envcaption(ARSEL_K); if (noselect(&n, arraysize(val), 0, str, val)) { if (yesno(ARCAN_K)) return(0); continue; } if (n == arraysize(val) - 1) { if (!(list -> format)) { if (!yesno(ARNOT_K)) continue; freevar(list -> lignore); freevar(list -> lerror); list -> lignore = list -> lerror = NULL; list -> topskip = list -> bottomskip = (u_char)0; } break; } if (n == 0) list -> format = editvar(ARCHF_K, list -> format); else if (n == 3) list -> lignore = editvar(ARIGN_K, list -> lignore); else if (n == 4) list -> lerror = editvar(ARERR_K, list -> lerror); else { if (n == 1) { skipp = &(list -> topskip); cp = TOPSK_K; } else { skipp = &(list -> bottomskip); cp = BTMSK_K; } int2str(buf, *skipp); if (!(tmp = inputcuststr(cp, 1, buf, -1))) continue; i = Xatoi(tmp); Xfree(tmp); if (i < 0) { warning(0, VALNG_K); continue; } *skipp = i; } } return(1); } static int NEAR editlaunch(no) int no; { lsparse_t list; char *cp; int n; if (no < maxlaunch) { list.ext = Xstrdup(launchlist[no].ext); list.flags = launchlist[no].flags; verboselaunch(&(launchlist[no])); } else { if (!(cp = inputcuststr(EXTLN_K, 1, NULL, -1))) return(0); list.ext = getext(cp, &(list.flags)); Xfree(cp); if (!(list.ext[0]) || !(list.ext[1])) { Xfree(list.ext); return(0); } for (no = 0; no < maxlaunch; no++) { n = extcmp(list.ext, list.flags, launchlist[no].ext, launchlist[no].flags, 1); if (!n) break; } # ifndef DEP_DYNAMICLIST if (no >= MAXLAUNCHTABLE) { warning(0, OVERF_K); return(0); } # endif } for (;;) { if (no < maxlaunch) { list.comm = launchlist[no].comm; list.format = duplvar(launchlist[no].format, -1); list.lignore = duplvar(launchlist[no].lignore, -1); list.lerror = duplvar(launchlist[no].lerror, -1); list.topskip = launchlist[no].topskip; list.bottomskip = launchlist[no].bottomskip; } else { list.comm = NULL; list.format = list.lignore = list.lerror = NULL; list.topskip = list.bottomskip = (u_char)0; } list.comm = inputcuststr(LNCHC_K, 0, list.comm, HST_COMM); if (!(list.comm)) { freelaunch(&list); return(-1); } else if (!*(list.comm)) { freelaunch(&list); if (no >= maxlaunch) return(-1); if (!yesno(DLLOK_K, launchlist[no].ext)) return(-1); deletelaunch(no); return(1); } else if (!yesno(ISARC_K)) { freevar(list.format); freevar(list.lignore); freevar(list.lerror); list.format = list.lignore = list.lerror = NULL; list.topskip = list.bottomskip = (u_char)0; break; } if (editarchbrowser(&list)) break; Xfree(list.comm); freevar(list.format); freevar(list.lignore); freevar(list.lerror); } addlaunch(no, &list); return(1); } static int NEAR issamelaunch(lp1, lp2) CONST lsparse_t *lp1, *lp2; { int i; if (!(lp1 -> format)) { if (lp2 -> format) return(0); } else if (!(lp2 -> format)) return(0); else if (lp1 -> topskip != lp2 -> topskip || lp1 -> bottomskip != lp2 -> bottomskip) return(0); if (strcommcmp(lp1 -> comm, lp2 -> comm)) return(0); if (!(lp1 -> format)) return(1); for (i = 0; lp1 -> format[i]; i++) if (strcmp(lp1 -> format[i], lp2 -> format[i])) break; if (lp1 -> format[i]) return(0); if (!(lp1 -> lignore)) { if (lp2 -> lignore) return(0); } else if (!(lp2 -> lignore)) return(0); else { for (i = 0; lp1 -> lignore[i]; i++) if (strcmp(lp1 -> lignore[i], lp2 -> lignore[i])) break; if (lp1 -> lignore[i]) return(0); } if (!(lp1 -> lerror)) { if (lp2 -> lerror) return(0); } else if (!(lp2 -> lerror)) return(0); else { for (i = 0; lp1 -> lerror[i]; i++) if (strcmp(lp1 -> lerror[i], lp2 -> lerror[i])) break; if (lp1 -> lerror[i]) return(0); } return(1); } static int NEAR dumplaunch(flaglist, origflaglist, fp) CONST char *flaglist; char *origflaglist; XFILE *fp; { char *new; int i, j, n; if (origflaglist || origmaxlaunch <= 0) new = NULL; else { origflaglist = new = Xmalloc(origmaxlaunch * sizeof(char)); memset(origflaglist, 0, origmaxlaunch * sizeof(char)); } for (i = n = 0; i < maxlaunch; i++) { if (flaglist && flaglist[i]) continue; j = searchlaunch(&(launchlist[i]), origlaunchlist, origmaxlaunch); if (j < origmaxlaunch) { origflaglist[j] = 1; j = issamelaunch(&(launchlist[i]), &(origlaunchlist[j])); if (j) continue; } n++; } for (i = 0; i < origmaxlaunch; i++) { if (origflaglist[i]) continue; n++; } if (!n || !fp) { Xfree(new); return(n); } VOID_C fputnl(fp); VOID_C Xfputs("# launcher definition\n", fp); for (i = 0; i < maxlaunch; i++) { if (flaglist && flaglist[i]) continue; j = searchlaunch(&(launchlist[i]), origlaunchlist, origmaxlaunch); if (j < origmaxlaunch) { j = issamelaunch(&(launchlist[i]), &(origlaunchlist[j])); if (j) continue; } printlaunchcomm(launchlist, i, 1, 0, fp); } for (i = 0; i < origmaxlaunch; i++) { if (origflaglist[i]) continue; printlaunchcomm(origlaunchlist, i, 0, 0, fp); } Xfree(new); return(n); } # ifdef DEP_ORIGSHELL static int NEAR checklaunch(flaglist, origflaglist, argc, argv, fp) char *flaglist, *origflaglist; int argc; char *CONST *argv; XFILE *fp; { lsparse_t launch; int i, j; if (strcommcmp(argv[0], BL_LAUNCH)) return(0); if (parselaunch(argc, argv, &launch) < 0) return(-1); i = searchlaunch(&launch, launchlist, maxlaunch); j = searchlaunch(&launch, origlaunchlist, origmaxlaunch); if (i < maxlaunch) { if (!flaglist || flaglist[i]) { freelaunch(&launch); return(-1); } if (j < origmaxlaunch) { if (!origflaglist || origflaglist[j] || !issamelaunch(&launch, &(origlaunchlist[j]))) { freelaunch(&launch); return(-1); } origflaglist[j] = 1; } } else { freelaunch(&launch); if (j >= origmaxlaunch) return(-1); if (!origflaglist || origflaglist[j]) return(-1); origflaglist[j] = 1; printlaunchcomm(origlaunchlist, j, 0, 0, fp); return(1); } freelaunch(&launch); flaglist[i] = 1; printlaunchcomm(launchlist, i, 1, 0, fp); return(1); } # endif /* DEP_ORIGSHELL */ static VOID NEAR cleanuparch(VOID_A) { # ifdef DEP_DYNAMICLIST archivelist = # endif copyarch(archivelist, origarchivelist, &maxarchive, origmaxarchive); } static int NEAR disparch(no) int no; { int len, width; if (no >= maxarchive) { cputspace(MAXCUSTVAL); return(0); } width = (MAXCUSTVAL - 1) / 2; cputstr(width, archivelist[no].p_comm); putsep(); cputstr(MAXCUSTVAL - 1 - width, archivelist[no].u_comm); len = (archivelist[no].p_comm) ? strlen2(archivelist[no].p_comm) : 0; if (len > --width) len = width; return(len); } static int NEAR editarch(no) int no; { archive_t list; char *cp; int n; if (no < maxarchive) { list.ext = Xstrdup(archivelist[no].ext); list.flags = archivelist[no].flags; } else { if (!(cp = inputcuststr(EXTAR_K, 1, NULL, -1))) return(0); list.ext = getext(cp, &(list.flags)); Xfree(cp); if (!(list.ext[0]) || !(list.ext[1])) { Xfree(list.ext); return(0); } for (no = 0; no < maxarchive; no++) { n = extcmp(list.ext, list.flags, archivelist[no].ext, archivelist[no].flags, 1); if (!n) break; } # ifndef DEP_DYNAMICLIST if (no >= MAXARCHIVETABLE) { warning(0, OVERF_K); return(0); } # endif } for (;;) { if (no < maxarchive) { list.p_comm = archivelist[no].p_comm; list.u_comm = archivelist[no].u_comm; } else { list.p_comm = list.u_comm = NULL; } list.p_comm = inputcuststr(PACKC_K, 0, list.p_comm, HST_COMM); if (!(list.p_comm)) { Xfree(list.ext); return(0); } else if (!*(list.p_comm)) { Xfree(list.p_comm); list.p_comm = NULL; } list.u_comm = inputcuststr(UPCKC_K, 0, list.u_comm, HST_COMM); if (!(list.u_comm)) { Xfree(list.p_comm); continue; } else if (!*(list.u_comm)) { Xfree(list.u_comm); list.u_comm = NULL; } break; } if (!(list.p_comm) && !(list.u_comm)) { Xfree(list.ext); if (no >= maxarchive) return(0); if (!yesno(DLAOK_K, archivelist[no].ext)) return(0); deletearch(no); return(1); } addarch(no, &list); return(1); } static int NEAR issamearch(ap1, ap2) CONST archive_t *ap1, *ap2; { if (!(ap1 -> p_comm)) { if (ap2 -> p_comm) return(0); } else if (!(ap2 -> p_comm)) return(0); else if (strcommcmp(ap1 -> p_comm, ap2 -> p_comm)) return(0); if (strcommcmp(ap1 -> u_comm, ap2 -> u_comm)) return(0); return(1); } static int NEAR dumparch(flaglist, origflaglist, fp) CONST char *flaglist; char *origflaglist; XFILE *fp; { char *new; int i, j, n; if (origflaglist || origmaxarchive <= 0) new = NULL; else { origflaglist = new = Xmalloc(origmaxarchive * sizeof(char)); memset(origflaglist, 0, origmaxarchive * sizeof(char)); } for (i = n = 0; i < maxarchive; i++) { if (flaglist && flaglist[i]) continue; j = searcharch(&(archivelist[i]), origarchivelist, origmaxarchive); if (j < origmaxarchive) { origflaglist[j] = 1; j = issamearch(&(archivelist[i]), &(origarchivelist[j])); if (j) continue; } n++; } for (i = 0; i < origmaxarchive; i++) { if (origflaglist[i]) continue; n++; } if (!n || !fp) { Xfree(new); return(n); } VOID_C fputnl(fp); VOID_C Xfputs("# archiver definition\n", fp); for (i = 0; i < maxarchive; i++) { if (flaglist && flaglist[i]) continue; j = searcharch(&(archivelist[i]), origarchivelist, origmaxarchive); if (j < origmaxarchive) { j = issamearch(&(archivelist[i]), &(origarchivelist[j])); if (j) continue; } printarchcomm(archivelist, i, 1, fp); } for (i = 0; i < origmaxarchive; i++) { if (origflaglist[i]) continue; printarchcomm(origarchivelist, i, 0, fp); } Xfree(new); return(n); } # ifdef DEP_ORIGSHELL static int NEAR checkarch(flaglist, origflaglist, argc, argv, fp) char *flaglist, *origflaglist; int argc; char *CONST *argv; XFILE *fp; { archive_t arch; int i, j; if (strcommcmp(argv[0], BL_ARCH)) return(0); if (parsearch(argc, argv, &arch) < 0) return(-1); i = searcharch(&arch, archivelist, maxarchive); j = searcharch(&arch, origarchivelist, origmaxarchive); if (i < maxarchive) { if (!flaglist || flaglist[i]) { freearch(&arch); return(-1); } if (j < origmaxarchive) { if (!origflaglist || origflaglist[j] || !issamearch(&arch, &(origarchivelist[j]))) { freearch(&arch); return(-1); } origflaglist[j] = 1; } } else { freearch(&arch); if (j >= origmaxarchive) return(-1); if (!origflaglist || origflaglist[j]) return(-1); origflaglist[j] = 1; printarchcomm(origarchivelist, j, 0, fp); return(1); } freearch(&arch); flaglist[i] = 1; printarchcomm(archivelist, i, 1, fp); return(1); } # endif /* DEP_ORIGSHELL */ # endif /* !_NOARCHIVE */ # ifdef DEP_DOSEMU static VOID NEAR cleanupdosdrive(VOID_A) { # ifdef DEP_DYNAMICLIST fdtype = # endif copydosdrive(fdtype, origfdtype, &maxfdtype, origmaxfdtype); } static int NEAR dispdosdrive(no) int no; { # ifdef HDDMOUNT char buf[strsize("HDD98 #offset=") + MAXCOLSCOMMA(3) + 1]; # endif int i, len, w1, w2, width; if (no >= maxfdtype) { cputspace(MAXCUSTVAL); return(0); } width = (MAXCUSTVAL - 1) / 2; cputstr(width, fdtype[no].name); putsep(); w1 = MAXCUSTVAL - 1 - width; # ifdef HDDMOUNT if (!fdtype[no].cyl) { Xstrcpy(buf, "HDD"); if (Xisupper(fdtype[no].head)) VOID_C Xstrcat(buf, "98"); i = strlen(buf); VOID_C Xsnprintf(&(buf[i]), (int)sizeof(buf) - i, " #offset=%'Ld", fdtype[no].offset / fdtype[no].sect); cputstr(w1, buf); } else # endif /* HDDMOUNT */ { len = 0; for (i = 0; i < MEDIADESCRSIZ; i++) { w2 = strlen2(mediadescr[i].name); if (len < w2) len = w2; } w2 = (w1 - len) / 3 - 1; if (w2 <= 0) w2 = 1; VOID_C XXcprintf("%-*d", w2, (int)(fdtype[no].head)); putsep(); VOID_C XXcprintf("%-*d", w2, (int)(fdtype[no].sect)); putsep(); VOID_C XXcprintf("%-*d", w2, (int)(fdtype[no].cyl)); putsep(); for (i = 0; i < MEDIADESCRSIZ; i++) { if (fdtype[no].head == mediadescr[i].head && fdtype[no].sect == mediadescr[i].sect && fdtype[no].cyl == mediadescr[i].cyl) break; } w1 -= (w2 + 1) * 3; cputstr(w1, (i < MEDIADESCRSIZ) ? mediadescr[i].name : NULL); } len = strlen2(fdtype[no].name); if (len > --width) len = width; return(len); } static int NEAR editdosdrive(no) int no; { # ifdef HDDMOUNT int j; # endif devinfo dev; CONST char *str['Z' - 'A' + 1]; char *cp, buf[MAXLONGWIDTH + 1], sbuf['Z' - 'A' + 1][3]; int i, n, val['Z' - 'A' + 1]; if (no < maxfdtype) dev.drive = fdtype[no].drive; else { # ifndef DEP_DYNAMICLIST if (no >= MAXDRIVEENTRY - 1) { warning(0, OVERF_K); return(0); } # endif for (dev.drive = n = 0; dev.drive <= 'Z' - 'A'; dev.drive++) { # ifdef HDDMOUNT for (i = 0; i < maxfdtype; i++) if (dev.drive == fdtype[i].drive && !(fdtype[i].cyl)) break; if (i < maxfdtype) continue; # endif VOID_C gendospath(sbuf[n], dev.drive + 'A', '\0'); str[n] = sbuf[n]; val[n++] = dev.drive + 'A'; } envcaption(DRNAM_K); i = val[0]; if (noselect(&i, n, 0, str, val)) return(0); dev.drive = i; } dev.name = NULL; # ifdef FAKEUNINIT dev.head = dev.sect = dev.cyl = 0; /* fake for -Wuninitialized */ # endif for (;;) { if (!(dev.name)) { cp = asprintf2(DRDEV_K, dev.drive); if (no < maxfdtype) dev.name = fdtype[no].name; dev.name = inputcuststr(cp, 1, dev.name, HST_PATH); Xfree(cp); if (!(dev.name)) return(0); else if (!*(dev.name)) { Xfree(dev.name); if (no >= maxfdtype) return(0); if (!yesno(DLDOK_K, fdtype[no].drive)) return(0); VOID_C deletedrv(no); return(1); } } envcaption(DRMED_K); for (i = n = 0; i < MEDIADESCRSIZ; i++) { # ifdef HDDMOUNT if (!mediadescr[i].cyl) { if (no < maxfdtype) continue; for (j = 0; j < maxfdtype; j++) if (dev.drive == fdtype[j].drive) break; if (j < maxfdtype) continue; } # endif str[n] = mediadescr[i].name; val[n++] = i; } str[n] = USRDF_K; val[n++] = i; i = val[0]; if (noselect(&i, n, 0, str, val)) { Xfree(dev.name); dev.name = NULL; continue; } if (i < MEDIADESCRSIZ) { dev.head = mediadescr[i].head; dev.sect = mediadescr[i].sect; dev.cyl = mediadescr[i].cyl; break; } for (;;) { if (no >= maxfdtype) cp = NULL; else cp = int2str(buf, fdtype[no].head); if (!(cp = inputcuststr(DRHED_K, 1, cp, -1))) break; dev.head = n = Xatoi(cp); Xfree(cp); if (n > 0 && n <= MAXUTYPE(u_char)) break; warning(0, VALNG_K); } if (!cp) continue; for (;;) { if (no >= maxfdtype) cp = NULL; else cp = int2str(buf, fdtype[no].sect); if (!(cp = inputcuststr(DRSCT_K, 1, cp, -1))) break; dev.sect = n = Xatoi(cp); Xfree(cp); if (dev.sect > 0) break; if (n > 0 && n <= MAXUTYPE(u_short)) break; warning(0, VALNG_K); } if (!cp) continue; for (;;) { if (no >= maxfdtype) cp = NULL; else cp = int2str(buf, fdtype[no].cyl); if (!(cp = inputcuststr(DRCYL_K, 1, cp, -1))) break; dev.cyl = n = Xatoi(cp); Xfree(cp); if (n > 0 && n <= MAXUTYPE(u_short)) break; warning(0, VALNG_K); } if (cp) break; } n = searchdrv(&dev, fdtype, maxfdtype, 1); if (n < maxfdtype) { if (n != no) warning(0, DUPLD_K); return(0); } if (no < maxfdtype) no = deletedrv(no); if ((n = insertdrv(no, &dev)) < 0) { if (n < -1) warning(0, OVERF_K); else warning(ENODEV, dev.name); Xfree(dev.name); return(0); } return(1); } static int NEAR dumpdosdrive(flaglist, origflaglist, fp) CONST char *flaglist; char *origflaglist; XFILE *fp; { char *new; int i, j, n; if (origflaglist || origmaxfdtype <= 0) new = NULL; else { origflaglist = new = Xmalloc(origmaxfdtype * sizeof(char)); memset(origflaglist, 0, origmaxfdtype * sizeof(char)); } for (i = n = 0; i < maxfdtype; i++) { if (flaglist && flaglist[i]) continue; j = searchdrv(&(fdtype[i]), origfdtype, origmaxfdtype, 1); if (j < origmaxfdtype) { origflaglist[j] = 1; continue; } n++; # ifdef HDDMOUNT if (fdtype[i].cyl) continue; for (; i + 1 < maxfdtype; i++) { if (fdtype[i + 1].cyl || fdtype[i + 1].drive != fdtype[i].drive + 1 || strpathcmp(fdtype[i + 1].name, fdtype[i].name)) break; } # endif /* HDDMOUNT */ } for (i = 0; i < origmaxfdtype; i++) { if (origflaglist[i]) continue; n++; } if (!n || !fp) { Xfree(new); return(n); } VOID_C fputnl(fp); VOID_C Xfputs("# MS-DOS drive definition\n", fp); for (i = 0; i < maxfdtype; i++) { if (flaglist && flaglist[i]) continue; j = searchdrv(&(fdtype[i]), origfdtype, origmaxfdtype, 1); if (j < origmaxfdtype) continue; printsetdrv(fdtype, i, 1, 0, fp); # ifdef HDDMOUNT if (fdtype[i].cyl) continue; for (; i + 1 < maxfdtype; i++) { if (fdtype[i + 1].cyl || fdtype[i + 1].drive != fdtype[i].drive + 1 || strpathcmp(fdtype[i + 1].name, fdtype[i].name)) break; } # endif /* HDDMOUNT */ } for (i = 0; i < origmaxfdtype; i++) { if (origflaglist[i]) continue; printsetdrv(origfdtype, i, 0, 0, fp); } Xfree(new); return(n); } # ifdef DEP_ORIGSHELL static int NEAR checkdosdrive(flaglist, origflaglist, argc, argv, fp) char *flaglist, *origflaglist; int argc; char *CONST *argv; XFILE *fp; { devinfo dev; int i, j; if (strcommcmp(argv[0], BL_SDRIVE) && strcommcmp(argv[0], BL_UDRIVE)) return(0); if (parsesetdrv(argc, argv, &dev) < 0) return(-1); i = searchdrv(&dev, fdtype, maxfdtype, 1); j = searchdrv(&dev, origfdtype, origmaxfdtype, 1); if (i < maxfdtype) { if (!flaglist || flaglist[i]) return(-1); if (j < origmaxfdtype) return(-1); } else { if (j >= origmaxfdtype) return(-1); if (!origflaglist || origflaglist[j]) return(-1); origflaglist[j] = 1; printsetdrv(origfdtype, j, 0, 0, fp); return(1); } # ifdef HDDMOUNT if (!(dev.cyl)) { for (j = i + 1; j < maxfdtype; j++) { if (!flaglist || flaglist[j]) break; if (fdtype[j].cyl || fdtype[j].drive != fdtype[j - 1].drive + 1 || strpathcmp(fdtype[j].name, dev.name)) break; flaglist[j] = 1; } for (; i > 0; i--) { if (!flaglist || flaglist[i - 1]) break; if (fdtype[i - 1].cyl || fdtype[i - 1].drive + 1 != fdtype[i].drive || strpathcmp(fdtype[i - 1].name, dev.name)) break; flaglist[i] = 1; } } # endif flaglist[i] = 1; printsetdrv(fdtype, i, 1, 0, fp); return(1); } # endif /* DEP_ORIGSHELL */ # endif /* DEP_DOSEMU */ static int NEAR dispsave(no) int no; { CONST char *mes[MAXSAVEMENU]; int len; mes[0] = CCNCL_K; mes[1] = CCLEA_K; mes[2] = CLOAD_K; mes[3] = CSAVE_K; # ifdef DEP_ORIGSHELL mes[4] = COVWR_K; # else mes[4] = NIMPL_K; # endif cputstr(MAXCUSTVAL, mes[no]); len = strlen2(mes[no]); if (len > MAXCUSTVAL - 1) len = MAXCUSTVAL - 1; return(len); } # ifdef DEP_ORIGSHELL static int NEAR overwriteconfig(val, file) int *val; CONST char *file; { syntaxtree *trp, *stree; lockbuf_t *lck; XFILE *fpin, *fpout; char *cp, *buf, **argv, **subst, path[MAXPATHLEN]; char *flaglist[MAXCUSTOM - 1], *origflaglist[MAXCUSTOM - 1]; int i, n, len, *slen, fd, argc, max[MAXCUSTOM], origmax[MAXCUSTOM - 1]; if (!(lck = lockfopen(file, "r", O_BINARY | O_RDWR, 0))) { warning(-1, file); return(-1); } Xstrcpy(path, file); if ((fpin = lck -> fp)) fd = opentmpfile(path, 0666); else { lockclose(lck); lck = lockopen(path, O_BINARY | O_WRONLY | O_CREAT | O_EXCL, 0666); fd = (lck) ? lck -> fd : -1; } fpout = (fd >= 0) ? Xfdopen(fd, "w") : NULL; if (fpout) { if (!fpin) { lck -> fp = fpout; lck -> flags |= LCK_STREAM; } } else { warning(-1, path); # if !MSDOS && !defined (CYGWIN) if (fd >= 0) { VOID_C Xunlink(path); if (fpin) VOID_C Xclose(fd); } lockclose(lck); # else lockclose(lck); if (fd >= 0) { if (fpin) VOID_C Xclose(fd); VOID_C Xunlink(path); } # endif return(-1); } calcmax(max, 0); origmax[0] = 0; origmax[1] = origmaxbind; # ifdef _NOKEYMAP origmax[2] = 0; # else origmax[2] = K_MAX - K_MIN + 1; # endif # ifdef _NOARCHIVE origmax[3] = 0; origmax[4] = 0; # else origmax[3] = origmaxlaunch; origmax[4] = origmaxarchive; # endif # ifdef DEP_DOSEMU origmax[5] = origmaxfdtype; # else origmax[5] = 0; # endif for (i = 0; i < MAXCUSTOM - 1; i++) { if (!max[i]) flaglist[i] = NULL; else { flaglist[i] = Xmalloc(max[i] * sizeof(char)); memset(flaglist[i], 0, max[i] * sizeof(char)); } if (!origmax[i]) origflaglist[i] = NULL; else { origflaglist[i] = Xmalloc(origmax[i] * sizeof(char)); memset(origflaglist[i], 0, origmax[i] * sizeof(char)); } } buf = NULL; len = 0; trp = stree = newstree(NULL); if (fpin) while ((cp = Xfgets(fpin))) { n = strlen(cp); if (!buf) { buf = Xstrdup(cp); len = n; } else { buf = Xrealloc(buf, len + n + 1 + 1); buf[len++] = '\n'; Xstrcpy(&(buf[len]), cp); len += n; } trp = analyze(cp, trp, 1); Xfree(cp); n = 0; if (!trp); else if (trp -> cont) continue; else if ((argv = getsimpleargv(stree))) { argc = (stree -> comm) -> argc; argc = (stree -> comm) -> argc = getsubst(argc, argv, &subst, &slen); for (i = 0; i < argc; i++) stripquote(argv[i], EA_STRIPQ); if (subst[0]) { if (!argc && val[0]) n = checkenv(flaglist[0], subst, slen, fpout); } else { if (!n && val[0]) n = checkunset(flaglist[0], argc, argv, fpout); if (!n && val[1]) n = checkbind(flaglist[1], origflaglist[1], argc, argv, fpout); # ifndef _NOKEYMAP if (!n && val[2]) n = checkkeymap(flaglist[2], origflaglist[2], argc, argv, fpout); # endif # ifndef _NOARCHIVE if (!n && val[3]) n = checklaunch(flaglist[3], origflaglist[3], argc, argv, fpout); if (!n && val[4]) n = checkarch(flaglist[4], origflaglist[4], argc, argv, fpout); # endif # ifdef DEP_DOSEMU if (!n && val[5]) n = checkdosdrive(flaglist[5], origflaglist[5], argc, argv, fpout); # endif } freevar(subst); Xfree(slen); } freestree(stree); trp = stree; if (n <= 0) { if (n < 0) VOID_C Xfputs("# ", fpout); VOID_C Xfputs(buf, fpout); VOID_C fputnl(fpout); } Xfree(buf); buf = NULL; len = 0; } freestree(stree); Xfree(stree); if (!fpin) VOID_C Xfputs("# configurations by customizer\n", fpout); else { n = 0; if (val[0] && flaglist[0]) n = dumpenv(flaglist[0], NULL); if (!n && val[1] && flaglist[1]) n += dumpbind(flaglist[1], origflaglist[1], NULL); # ifndef _NOKEYMAP if (!n && val[2] && flaglist[2]) n += dumpkeymap(flaglist[2], origflaglist[2], NULL); # endif # ifndef _NOARCHIVE if (!n && val[3] && flaglist[3]) n += dumplaunch(flaglist[3], origflaglist[3], NULL); if (!n && val[4] && flaglist[4]) n += dumparch(flaglist[4], origflaglist[4], NULL); # endif # ifdef DEP_DOSEMU if (!n && val[5] && flaglist[5]) n += dumpdosdrive(flaglist[5], origflaglist[5], NULL); # endif if (n) { VOID_C fputnl(fpout); VOID_C Xfputs("# additional configurations by customizer\n", fpout); } } if (val[0] && flaglist[0]) dumpenv(flaglist[0], fpout); if (val[1] && flaglist[1]) dumpbind(flaglist[1], origflaglist[1], fpout); # ifndef _NOKEYMAP if (val[2] && flaglist[2]) dumpkeymap(flaglist[2], origflaglist[2], fpout); # endif # ifndef _NOARCHIVE if (val[3] && flaglist[3]) dumplaunch(flaglist[3], origflaglist[3], fpout); if (val[4] && flaglist[4]) dumparch(flaglist[4], origflaglist[4], fpout); # endif # ifdef DEP_DOSEMU if (val[5] && flaglist[5]) dumpdosdrive(flaglist[5], origflaglist[5], fpout); # endif for (i = 0; i < MAXCUSTOM - 1; i++) { Xfree(flaglist[i]); Xfree(origflaglist[i]); } if (!fpin) lockclose(lck); else { # if !MSDOS && !defined (CYGWIN) n = Xrename(path, file); lockclose(lck); VOID_C Xfclose(fpout); # else /* MSDOS || CYGWIN */ lockclose(lck); VOID_C Xfclose(fpout); # if MSDOS n = Xrename(path, file); # else while ((n = Xrename(path, file)) < 0) { if (errno != EACCES) break; usleep(100000L); } # endif # endif /* MSDOS || CYGWIN */ if (n < 0) { warning(-1, file); VOID_C Xunlink(path); return(-1); } } return(0); } # endif /* DEP_ORIGSHELL */ static int NEAR selectmulti(max, str, val) int max; CONST char *CONST str[]; int val[]; { int i, ch; ch = selectstr(NULL, max, 0, str, val); if (ch == K_CR) { for (i = 0; i < max; i++) if (val[i]) break; if (i >= max) ch = K_ESC; } return(ch != K_CR); } static int NEAR editsave(no) int no; { lockbuf_t *lck; CONST char *str[MAXCUSTOM - 1]; char *file; int i, n, done, val[MAXCUSTOM - 1]; for (i = 0; i < MAXCUSTOM - 1; i++) { str[i] = NULL; val[i] = 1; } str[0] = TENV_K; str[1] = TBIND_K; # ifndef _NOKEYMAP str[2] = TKYMP_K; # endif # ifndef _NOARCHIVE str[3] = TLNCH_K; str[4] = TARCH_K; # endif # ifdef DEP_DOSEMU str[5] = TSDRV_K; # endif done = 0; switch (no) { case 0: envcaption(SREST_K); if (selectmulti(MAXCUSTOM - 1, str, val)) break; done = 1; if (val[0]) copyenv(tmpenvlist); if (val[1]) { # ifdef DEP_DYNAMICLIST macrolist = # endif copystrarray(macrolist, tmpmacrolist, &maxmacro, tmpmaxmacro); # ifdef DEP_DYNAMICLIST helpindex = # endif copystrarray(helpindex, tmphelpindex, NULL, MAXHELPINDEX); # ifdef DEP_DYNAMICLIST bindlist = # endif copybind(bindlist, tmpbindlist, &maxbind, tmpmaxbind); } # ifndef _NOKEYMAP if (val[2]) copykeyseq(tmpkeymaplist); # endif # ifndef _NOARCHIVE if (val[3]) { # ifdef DEP_DYNAMICLIST launchlist = # endif copylaunch(launchlist, tmplaunchlist, &maxlaunch, tmpmaxlaunch); } if (val[4]) { # ifdef DEP_DYNAMICLIST archivelist = # endif copyarch(archivelist, tmparchivelist, &maxarchive, tmpmaxarchive); } # endif /* !_NOARCHIVE */ # ifdef DEP_DOSEMU if (val[5]) { # ifdef DEP_DYNAMICLIST fdtype = # endif copydosdrive(fdtype, tmpfdtype, &maxfdtype, tmpmaxfdtype); } # endif /* DEP_DOSEMU */ break; case 1: envcaption(SCLEA_K); if (selectmulti(MAXCUSTOM - 1, str, val)) break; done = 1; if (val[0]) cleanupenv(); if (val[1]) cleanupbind(); # ifndef _NOKEYMAP if (val[2]) cleanupkeymap(); # endif # ifndef _NOARCHIVE if (val[3]) cleanuplaunch(); if (val[4]) cleanuparch(); # endif # ifdef DEP_DOSEMU if (val[5]) cleanupdosdrive(); # endif break; case 2: file = inputcuststr(FLOAD_K, 1, FD_RCFILE, HST_PATH); if (!file) break; if (!*file) { Xfree(file); break; } done = 1; n = sigvecset(0); Xlocate(0, n_line - 1); inruncom = 1; i = loadruncom(file, 0); Xfree(file); inruncom = 0; sigvecset(n); if (i < 0) { hideclock = 1; warning(0, HITKY_K); } break; case 3: file = inputcuststr(FSAVE_K, 1, FD_RCFILE, HST_PATH); if (!file) break; done = 1; file = evalpath(file, 0); # ifdef FAKEUNINIT lck = NULL; /* fake for -Wuninitialized */ # endif if (!*file || (Xaccess(file, F_OK) >= 0 && yesno(FSVOK_K))) done = 0; else { envcaption(SSAVE_K); if (selectmulti(MAXCUSTOM - 1, str, val)) done = 0; else { lck = lockfopen(file, "w", O_BINARY | O_WRONLY | O_CREAT | O_TRUNC, 0); if (!lck || !(lck -> fp)) { warning(-1, file); lockclose(lck); done = 0; } } } Xfree(file); if (!done) break; VOID_C Xfputs("# configurations by customizer\n", lck -> fp); if (val[0]) dumpenv(NULL, lck -> fp); if (val[1]) dumpbind(NULL, NULL, lck -> fp); # ifndef _NOKEYMAP if (val[2]) dumpkeymap(NULL, NULL, lck -> fp); # endif # ifndef _NOARCHIVE if (val[3]) dumplaunch(NULL, NULL, lck -> fp); if (val[4]) dumparch(NULL, NULL, lck -> fp); # endif # ifdef DEP_DOSEMU if (val[5]) dumpdosdrive(NULL, NULL, lck -> fp); # endif lockclose(lck); break; case 4: # ifdef DEP_ORIGSHELL file = inputcuststr(FOVWR_K, 1, FD_RCFILE, HST_PATH); if (!file) break; done = 1; file = evalpath(file, 0); if (!*file || (Xaccess(file, F_OK) < 0 && errno == ENOENT && !yesno(FOVOK_K))) done = 0; else { envcaption(SOVWR_K); if (selectmulti(MAXCUSTOM - 1, str, val)) done = 0; else if (overwriteconfig(val, file) < 0) done = 0; } Xfree(file); break; # endif /* DEP_ORIGSHELL */ default: break; } return(done); } static VOID NEAR dispname(no, y, isstandout) int no, y, isstandout; { # if !defined (_NOARCHIVE) || defined (DEP_DOSEMU) char buf[MAXCUSTNAM * 2 + 1]; # endif CONST char *cp; char *name[MAXSAVEMENU]; int len; cp = NEWET_K; switch (custno) { case 0: if (basiccustom) no = basicenv[no]; cp = env_str(no); break; case 1: if (no < maxbind) cp = getkeysym(bindlist[no].key, 0); break; # ifndef _NOKEYMAP case 2: cp = getkeysym(keyseqlist[no], 1); break; # endif # ifndef _NOARCHIVE case 3: if (no < maxlaunch) { if (!(launchlist[no].flags & LF_IGNORECASE)) cp = &(launchlist[no].ext[1]); else { Xstrncpy(buf, launchlist[no].ext, MAXCUSTNAM * 2); buf[0] = '/'; cp = buf; } } break; case 4: if (no < maxarchive) { if (!(archivelist[no].flags & AF_IGNORECASE)) cp = &(archivelist[no].ext[1]); else { Xstrncpy(buf, archivelist[no].ext, MAXCUSTNAM * 2); buf[0] = '/'; cp = buf; } } break; # endif # ifdef DEP_DOSEMU case 5: if (no < maxfdtype) { VOID_C gendospath(buf, fdtype[no].drive, '\0'); cp = buf; } break; # endif case 6: name[0] = "Cancel"; name[1] = "Clear"; name[2] = "Load"; name[3] = "Save"; name[4] = "Overwrite"; cp = name[no]; break; default: cp = nullstr; break; } len = strlen2(cp); if (len >= MAXCUSTNAM) len = MAXCUSTNAM; fillline(y, MAXCUSTNAM + 1 - len); if (!isstandout && stable_standout) Xlocate(MAXCUSTNAM + 1, y); else VOID_C Xattrprintf("%^.*k", isstandout, MAXCUSTNAM, cp); putsep(); } static VOID NEAR dispcust(VOID_A) { int i, n, y, yy, start, end; yy = filetop(win); y = 2; start = (cs_item / cs_row) * cs_row; end = start + cs_row; if (end > cs_max) end = cs_max; for (i = start; i < end; i++) { dispname(i, yy + y++, 1); Xputterm(L_CLEAR); switch (custno) { case 0: n = (basiccustom) ? basicenv[i] : i; cs_len[i - start] = dispenv(n); break; case 1: cs_len[i - start] = dispbind(i); break; # ifndef _NOKEYMAP case 2: cs_len[i - start] = dispkeymap(i); break; # endif # ifndef _NOARCHIVE case 3: cs_len[i - start] = displaunch(i); break; case 4: cs_len[i - start] = disparch(i); break; # endif # ifdef DEP_DOSEMU case 5: cs_len[i - start] = dispdosdrive(i); break; # endif case 6: cs_len[i - start] = dispsave(i); break; default: cs_len[i - start] = XXcprintf("%^.*k", MAXCUSTVAL, NIMPL_K); if (cs_len[i - start] > MAXCUSTVAL - 1) cs_len[i - start] = MAXCUSTVAL - 1; else cputspace(MAXCUSTVAL - cs_len[i - start]); break; } putsep(); fillline(yy + y++, n_column); } for (; y < FILEPERROW; y++) fillline(yy + y, n_column); } VOID rewritecust(VOID_A) { cs_row = (FILEPERROW - 2) / 2; cs_len = (int *)Xrealloc(cs_len, cs_row * sizeof(*cs_len)); dispcust(); movecust(-1, 1); custtitle(); Xtflush(); } static VOID NEAR movecust(old, all) int old, all; { CONST char *hmes[MAXCUSTOM]; if (all > 0) { hmes[0] = NULL; hmes[1] = HBIND_K; hmes[2] = HKYMP_K; hmes[3] = HLNCH_K; hmes[4] = HARCH_K; hmes[5] = HSDRV_K; hmes[6] = HSAVE_K; Xlocate(0, L_INFO); Xputterm(L_CLEAR); if (hmes[custno]) VOID_C custputs(hmes[custno]); else VOID_C custputs(mesconv2(envlist[cs_item].hmes_no, envlist[cs_item].hmes, envlist[cs_item].hmes_eng)); } win_y = filetop(win) + 2 + (cs_item % cs_row) * 2; dispname(cs_item, win_y, 0); win_x = cs_len[cs_item % cs_row] + MAXCUSTNAM + 2; if (old >= 0 && old < cs_max) dispname(old, filetop(win) + 2 + (old % cs_row) * 2, 1); Xlocate(win_x, win_y); } static int NEAR editcust(VOID_A) { int n; switch (custno) { case 0: n = (basiccustom) ? basicenv[cs_item] : cs_item; n = editenv(n); cs_max = (basiccustom) ? nbasic : ENVLISTSIZ; break; case 1: if ((n = editbind(cs_item))) cs_max = maxbind + 1; break; # ifndef _NOKEYMAP case 2: n = editkeymap(cs_item); break; # endif # ifndef _NOARCHIVE case 3: if ((n = editlaunch(cs_item))) cs_max = maxlaunch + 1; break; case 4: if ((n = editarch(cs_item))) cs_max = maxarchive + 1; break; # endif # ifdef DEP_DOSEMU case 5: if ((n = editdosdrive(cs_item))) cs_max = maxfdtype + 1; break; # endif case 6: n = editsave(cs_item); break; default: n = 0; break; } if (n < 0) { rewritefile(1); n = 0; } return(n); } /*ARGSUSED*/ int customize(env) CONST char *env; { # ifndef _NOKEYMAP int n; # endif int i, yy, ch, old, changed, item[MAXCUSTOM], max[MAXCUSTOM]; # if FD >= 3 if (env) { if ((i = getenvid(env, -1, NULL)) < 0) { errno = EINVAL; warning(-1, env); return(-1); } return(editenv(i)); } # endif yy = filetop(win); for (i = 0; i < FILEPERROW; i++) { Xlocate(0, yy + i); Xputterm(L_CLEAR); } for (i = 0; i < MAXCUSTOM; i++) item[i] = 0; nbasic = 0; for (i = 0; i < ENVLISTSIZ; i++) if (envlist[i].type & T_BASIC) basicenv[nbasic++] = i; while (i < ENVLISTSIZ) basicenv[i++] = -1; tmpenvlist = copyenv(NULL); tmpmacrolist = copystrarray(NULL, macrolist, &tmpmaxmacro, maxmacro); tmphelpindex = copystrarray(NULL, helpindex, NULL, MAXHELPINDEX); tmpbindlist = copybind(NULL, bindlist, &tmpmaxbind, maxbind); # ifndef _NOKEYMAP tmpkeymaplist = copykeyseq(NULL); for (n = 0; keyidentlist[n].no > 0; n++) /*EMPTY*/; keyseqlist = (short *)Xmalloc((n + 20 + 1) * sizeof(*keyseqlist)); n = 0; for (i = 1; i <= 20; i++) { for (ch = 0; ch <= K_MAX - K_MIN; ch++) if (tmpkeymaplist[ch].code == K_F(i)) break; if (ch <= K_MAX - K_MIN) keyseqlist[n++] = K_F(i); } for (i = 0; keyidentlist[i].no > 0; i++) { for (ch = 0; ch <= K_MAX - K_MIN; ch++) if (tmpkeymaplist[ch].code == keyidentlist[i].no) break; if (ch <= K_MAX - K_MIN) keyseqlist[n++] = keyidentlist[i].no; } keyseqlist[n] = -1; # endif # ifndef _NOARCHIVE tmplaunchlist = copylaunch(NULL, launchlist, &tmpmaxlaunch, maxlaunch); tmparchivelist = copyarch(NULL, archivelist, &tmpmaxarchive, maxarchive); # endif # ifdef DEP_DOSEMU tmpfdtype = copydosdrive(NULL, fdtype, &tmpmaxfdtype, maxfdtype); # endif calcmax(max, 1); changed = 0; custno = 0; cs_item = item[custno]; getmax(max, custno); cs_row = (FILEPERROW - 2) / 2; cs_len = (int *)Xmalloc(cs_row * sizeof(*cs_len)); custtitle(); old = -1; do { if (old < 0) dispcust(); if (cs_item != old) movecust(old, 1); Xlocate(win_x, win_y); Xtflush(); keyflush(); Xgetkey(-1, 0, 0); ch = Xgetkey(1, 0, 0); Xgetkey(-1, 0, 0); old = cs_item; switch (ch) { case K_UP: if (cs_item > 0 && !((--cs_item + 1) % cs_row)) old = -1; break; case K_DOWN: if (cs_item < cs_max - 1 && !(++cs_item % cs_row)) old = -1; break; case K_RIGHT: if (custno < MAXCUSTOM - 1) { item[custno] = cs_item; setmax(max, custno); custno++; custtitle(); cs_item = item[custno]; getmax(max, custno); old = -1; } break; case K_LEFT: if (custno > 0) { item[custno] = cs_item; setmax(max, custno); custno--; custtitle(); cs_item = item[custno]; getmax(max, custno); old = -1; } break; case K_PPAGE: if (cs_item < cs_row) Xputterm(T_BELL); else { cs_item = (cs_item / cs_row - 1) * cs_row; old = -1; } break; case K_NPAGE: if ((cs_item / cs_row + 1) * cs_row >= cs_max) Xputterm(T_BELL); else { cs_item = (cs_item / cs_row + 1) * cs_row; old = -1; } break; case K_BEG: case K_HOME: case '<': if (cs_item / cs_row) old = -1; cs_item = 0; break; case K_EOL: case K_END: case '>': if (cs_item / cs_row != (cs_max - 1) / cs_row) old = -1; cs_item = cs_max - 1; break; case K_CTRL('L'): rewritefile(1); break; case K_CR: if (!editcust()) { helpbar(); old = cs_max; break; } if (custno < MAXCUSTOM - 1) { setmax(max, custno); changed = 1; } else { calcmax(max, 1); changed = 0; } rewritefile(1); break; case K_ESC: if (changed && !yesno(NOSAV_K)) ch = '\0'; break; default: break; } } while (ch != K_ESC); custno = -1; Xfree(cs_len); for (i = 0; i < ENVLISTSIZ * 2; i++) Xfree(tmpenvlist[i]); Xfree(tmpenvlist); freestrarray(tmpmacrolist, tmpmaxmacro); Xfree(tmpmacrolist); freestrarray(tmphelpindex, MAXHELPINDEX); Xfree(tmphelpindex); Xfree(tmpbindlist); # ifndef _NOKEYMAP freekeyseq(tmpkeymaplist); Xfree(keyseqlist); # endif # ifndef _NOARCHIVE freelaunchlist(tmplaunchlist, tmpmaxlaunch); Xfree(tmplaunchlist); freearchlist(tmparchivelist, tmpmaxarchive); Xfree(tmparchivelist); # endif # ifdef DEP_DOSEMU freedosdrive(tmpfdtype, tmpmaxfdtype); Xfree(tmpfdtype); # endif return(1); } #endif /* !_NOCUSTOMIZE */ FD-3.01j/command.c100644 2105 1751 124637 13516612560 12520 0ustar shiraiuser/* * command.c * * command executing module */ #include "fd.h" #include "parse.h" #include "func.h" #include "funcno.h" #include "kanji.h" #include "system.h" #include "termemu.h" #if defined (_NOEXTRAATTR) || defined (NOUID) #define MAXATTRSEL 2 #define ATTR_X 35 #define ATTR_Y L_INFO #else #define MAXATTRSEL 3 #define ATTR_X 0 #define ATTR_Y L_HELP #endif extern int curcolumns; #if FD >= 3 extern int widedigit; #endif extern int mark; extern off_t marksize; extern off_t blocksize; extern int isearch; extern int fnameofs; extern int chgorder; extern int stackdepth; extern namelist filestack[]; #ifndef _NOARCHIVE extern char archivedir[]; #endif extern int win_x; extern int win_y; extern char *destpath; #ifndef _NOTRADLAYOUT extern int tradlayout; #endif extern int sizeinfo; extern int wheader; extern char fullpath[]; extern int hideclock; #ifdef DEP_ORIGSHELL extern int fdmode; #endif static int NEAR dochdir4 __P_((CONST char *, int)); static int cur_up __P_((CONST char *)); static int cur_down __P_((CONST char *)); static int cur_right __P_((CONST char *)); static int cur_left __P_((CONST char *)); static int roll_up __P_((CONST char *)); static int roll_down __P_((CONST char *)); static int cur_top __P_((CONST char *)); static int cur_bottom __P_((CONST char *)); static int fname_right __P_((CONST char *)); static int fname_left __P_((CONST char *)); static int one_column __P_((CONST char *)); static int two_columns __P_((CONST char *)); static int three_columns __P_((CONST char *)); static int five_columns __P_((CONST char *)); static VOID NEAR markcount __P_((VOID_A)); static int mark_file __P_((CONST char *)); static int mark_file2 __P_((CONST char *)); static int mark_file3 __P_((CONST char *)); static int mark_all __P_((CONST char *)); static int mark_reverse __P_((CONST char *)); static reg_ex_t *NEAR prepareregexp __P_((CONST char *, CONST char *)); static int mark_find __P_((CONST char *)); static int in_dir __P_((CONST char *)); static int out_dir __P_((CONST char *)); static int push_file __P_((CONST char *)); static int pop_file __P_((CONST char *)); static int symlink_mode __P_((CONST char *)); static int filetype_mode __P_((CONST char *)); static int dotfile_mode __P_((CONST char *)); static int fileflg_mode __P_((CONST char *)); static int log_dir __P_((CONST char *)); static int log_top __P_((CONST char *)); static VOID NEAR clearscreen __P_((VOID_A)); #ifndef PAGER static VOID NEAR dump __P_((CONST char *)); #endif static int NEAR execenv __P_((CONST char *, CONST char *)); static int NEAR execshell __P_((VOID_A)); static int view_file __P_((CONST char *)); static int edit_file __P_((CONST char *)); static int sort_dir __P_((CONST char *)); #ifndef _NOWRITEFS static int write_dir __P_((CONST char *)); #endif static int reread_dir __P_((CONST char *)); static int help_message __P_((CONST char *)); #ifndef _NOCUSTOMIZE static int edit_config __P_((CONST char *)); #endif #ifdef DEP_PTY static int NEAR confirmpty __P_((VOID_A)); #endif static int quit_system __P_((CONST char *)); static int make_dir __P_((CONST char *)); static int copy_file __P_((CONST char *)); #ifndef _NOTREE static int copy_tree __P_((CONST char *)); #endif static int move_file __P_((CONST char *)); #ifndef _NOTREE static int move_tree __P_((CONST char *)); #endif static int rename_file __P_((CONST char *)); static int delete_file __P_((CONST char *)); static int delete_dir __P_((CONST char *)); static int find_file __P_((CONST char *)); static int find_dir __P_((CONST char *)); static int execute_sh __P_((CONST char *)); static int execute_file __P_((CONST char *)); #ifndef _NOARCHIVE static int launch_file __P_((CONST char *)); static int pack_file __P_((CONST char *)); static int unpack_file __P_((CONST char *)); # ifndef _NOTREE static int unpack_tree __P_((CONST char *)); # endif #endif /* !_NOARCHIVE */ static int info_filesys __P_((CONST char *)); static int NEAR selectattr __P_((CONST char *)); static int attr_file __P_((CONST char *)); #ifndef _NOEXTRAATTR static int attr_dir __P_((CONST char *)); #endif #ifndef _NOTREE static int tree_dir __P_((CONST char *)); #endif #ifndef _NOARCHIVE static int backup_tape __P_((CONST char *)); #endif static int search_forw __P_((CONST char *)); static int search_back __P_((CONST char *)); #ifndef _NOSPLITWIN static VOID NEAR duplwin __P_((int)); static VOID NEAR movewin __P_((int)); static int split_window __P_((CONST char *)); static int next_window __P_((CONST char *)); #endif #ifndef _NOEXTRAWIN static int widen_window __P_((CONST char *)); static int narrow_window __P_((CONST char *)); static int kill_window __P_((CONST char *)); #endif static int warning_bell __P_((CONST char *)); static int no_operation __P_((CONST char *)); #include "functabl.h" reg_ex_t *findregexp = NULL; #ifndef _NOWRITEFS int writefs = 0; #endif #if FD >= 2 int loopcursor = 0; #endif int internal_status = FNC_FAIL; int maxbind = 0; #if defined (DEP_DYNAMICLIST) || !defined (_NOCUSTOMIZE) int origmaxbind = 0; #endif #ifdef DEP_DYNAMICLIST bindlist_t bindlist = NULL; origbindlist_t origbindlist #else /* !DEP_DYNAMICLIST */ # ifndef _NOCUSTOMIZE origbindlist_t origbindlist = NULL; # endif bindlist_t bindlist #endif /* !DEP_DYNAMICLIST */ = { {K_UP, CUR_UP, FNO_NONE}, {K_DOWN, CUR_DOWN, FNO_NONE}, {K_RIGHT, CUR_RIGHT, FNO_NONE}, {K_LEFT, CUR_LEFT, FNO_NONE}, {K_NPAGE, ROLL_UP, FNO_NONE}, {K_PPAGE, ROLL_DOWN, FNO_NONE}, #ifdef _NOTREE {K_F(1), HELP_MESSAGE, FNO_NONE}, #else {K_F(1), LOG_DIR, FNO_NONE}, #endif {K_F(2), EXECUTE_FILE, FNO_NONE}, {K_F(3), COPY_FILE, FNO_NONE}, {K_F(4), DELETE_FILE, FNO_NONE}, {K_F(5), RENAME_FILE, FNO_NONE}, {K_F(6), SORT_DIR, FNO_NONE}, {K_F(7), FIND_FILE, FNO_NONE}, #ifdef _NOTREE {K_F(8), LOG_DIR, FNO_NONE}, #else {K_F(8), TREE_DIR, FNO_NONE}, #endif {K_F(9), EDIT_FILE, FNO_NONE}, #ifndef _NOARCHIVE {K_F(10), UNPACK_FILE, FNO_NONE}, #endif {K_F(11), ATTR_FILE, FNO_NONE}, {K_F(12), INFO_FILESYS, FNO_NONE}, {K_F(13), MOVE_FILE, FNO_NONE}, {K_F(14), DELETE_DIR, FNO_NONE}, {K_F(15), MAKE_DIR, FNO_NONE}, {K_F(16), EXECUTE_SH, FNO_NONE}, #ifndef _NOWRITEFS {K_F(17), WRITE_DIR, FNO_NONE}, #endif #ifndef _NOARCHIVE {K_F(18), BACKUP_TAPE, FNO_NONE}, #endif {K_F(19), VIEW_FILE, FNO_NONE}, #ifndef _NOARCHIVE {K_F(20), PACK_FILE, FNO_NONE}, {K_CR, LAUNCH_FILE, IN_DIR}, #else {K_CR, VIEW_FILE, IN_DIR}, #endif {K_BS, OUT_DIR, FNO_NONE}, {K_DC, PUSH_FILE, FNO_NONE}, {K_IC, POP_FILE, FNO_NONE}, {'\t', MARK_FILE, FNO_NONE}, {K_ESC, QUIT_SYSTEM, FNO_NONE}, {'<', CUR_TOP, FNO_NONE}, {'>', CUR_BOTTOM, FNO_NONE}, {'1', ONE_COLUMN, FNO_NONE}, {'2', TWO_COLUMNS, FNO_NONE}, {'3', THREE_COLUMNS, FNO_NONE}, {'5', FIVE_COLUMNS, FNO_NONE}, {'(', FNAME_RIGHT, FNO_NONE}, {')', FNAME_LEFT, FNO_NONE}, {' ', MARK_FILE2, FNO_NONE}, {'+', MARK_ALL, FNO_NONE}, {'-', MARK_REVERSE, FNO_NONE}, {'*', MARK_FIND, FNO_NONE}, {']', PUSH_FILE, FNO_NONE}, {'[', POP_FILE, FNO_NONE}, {'?', HELP_MESSAGE, FNO_NONE}, {'a', ATTR_FILE, FNO_NONE}, #ifndef _NOARCHIVE {'b', BACKUP_TAPE, FNO_NONE}, #endif {'c', COPY_FILE, FNO_NONE}, {'d', DELETE_FILE, FNO_NONE}, {'e', EDIT_FILE, FNO_NONE}, {'f', FIND_FILE, FNO_NONE}, {'h', EXECUTE_SH, FNO_NONE}, {'i', INFO_FILESYS, FNO_NONE}, {'k', MAKE_DIR, FNO_NONE}, {'l', LOG_DIR, FNO_NONE}, {'\\', LOG_TOP, FNO_NONE}, {'m', MOVE_FILE, FNO_NONE}, #ifndef _NOARCHIVE {'p', PACK_FILE, FNO_NONE}, #endif {'q', QUIT_SYSTEM, FNO_NONE}, {'r', RENAME_FILE, FNO_NONE}, {'s', SORT_DIR, FNO_NONE}, #ifndef _NOTREE {'t', TREE_DIR, FNO_NONE}, #endif #ifndef _NOARCHIVE {'u', UNPACK_FILE, FNO_NONE}, #endif {'v', VIEW_FILE, FNO_NONE}, #ifndef _NOWRITEFS {'w', WRITE_DIR, FNO_NONE}, #endif {'x', EXECUTE_FILE, FNO_NONE}, #ifndef _NOEXTRAATTR {'A', ATTR_DIR, FNO_NONE}, #endif #ifndef _NOTREE {'C', COPY_TREE, FNO_NONE}, #endif {'D', DELETE_DIR, FNO_NONE}, #ifndef _NOCUSTOMIZE {'E', EDIT_CONFIG, FNO_NONE}, #endif {'F', FIND_DIR, FNO_NONE}, {'H', DOTFILE_MODE, FNO_NONE}, #ifndef _NOTREE {'L', LOG_TREE, FNO_NONE}, {'M', MOVE_TREE, FNO_NONE}, #endif #ifdef HAVEFLAGS {'O', FILEFLG_MODE, FNO_NONE}, #endif {'Q', QUIT_SYSTEM, FNO_NONE}, {'S', SYMLINK_MODE, FNO_NONE}, {'T', FILETYPE_MODE, FNO_NONE}, #if !defined (_NOTREE) && !defined (_NOARCHIVE) {'U', UNPACK_TREE, FNO_NONE}, #endif #ifndef _NOSPLITWIN {'/', SPLIT_WINDOW, FNO_NONE}, {'^', NEXT_WINDOW, FNO_NONE}, #endif #ifndef _NOEXTRAWIN {'W', WIDEN_WINDOW, FNO_NONE}, {'N', NARROW_WINDOW, FNO_NONE}, {'K', KILL_WINDOW, FNO_NONE}, #endif {K_HOME, MARK_ALL, FNO_NONE}, {K_END, MARK_REVERSE, FNO_NONE}, {K_BEG, CUR_TOP, FNO_NONE}, {K_EOL, CUR_BOTTOM, FNO_NONE}, {K_HELP, HELP_MESSAGE, FNO_NONE}, {K_CTRL('@'), MARK_FILE3, FNO_NONE}, {K_CTRL('L'), REREAD_DIR, FNO_NONE}, {K_CTRL('R'), SEARCH_BACK, FNO_NONE}, {K_CTRL('S'), SEARCH_FORW, FNO_NONE}, {-1, NO_OPERATION, FNO_NONE} }; static int NEAR dochdir4(path, raw) CONST char *path; int raw; { if (chdir4(path, raw, archivefile) < 0) { warning(-1, path); return(FNC_CANCEL); } return(FNC_EFFECT); } static int cur_up(arg) CONST char *arg; { #if FD >= 2 int p; #endif int n, old; old = filepos; if (!arg || (n = Xatoi(arg)) <= 0) n = 1; filepos -= n; #if FD >= 2 if (loopcursor) { p = FILEPERPAGE; while (filepos < 0 || filepos / p < old / p) filepos += p; if (filepos >= maxfile) filepos = maxfile - 1; } else #endif if (filepos < 0) filepos = 0; return((filepos != old) ? FNC_UPDATE : FNC_NONE); } static int cur_down(arg) CONST char *arg; { #if FD >= 2 int p; #endif int n, old; old = filepos; if (!arg || (n = Xatoi(arg)) <= 0) n = 1; filepos += n; #if FD >= 2 if (loopcursor) { p = FILEPERPAGE; if (filepos >= maxfile) filepos = (filepos / p) * p; while (filepos / p > old / p) { filepos -= p; if (filepos < 0) break; } if (filepos < 0) filepos = 0; } else #endif if (filepos >= maxfile) filepos = maxfile - 1; return((filepos != old) ? FNC_UPDATE : FNC_NONE); } static int cur_right(arg) CONST char *arg; { int n, r, p, old; old = filepos; if (!arg || (n = Xatoi(arg)) <= 0) n = 1; r = FILEPERROW; p = FILEPERPAGE; filepos += r * n; #if FD >= 2 if (loopcursor) { if (filepos >= maxfile) filepos = (filepos / p) * p + (old % r); while (filepos / p > old / p) { filepos -= p; if (filepos < 0) break; } if (filepos < 0) filepos = 0; } else #endif if (filepos < maxfile) /*EMPTY*/; else if (old / p == (maxfile - 1) / p) filepos = old; else { filepos = ((maxfile - 1) / r) * r + (old % r); if (filepos >= maxfile) { filepos -= r; if (filepos / p < (maxfile - 1) / p) filepos = maxfile - 1; } } return((filepos != old) ? FNC_UPDATE : FNC_NONE); } static int cur_left(arg) CONST char *arg; { #if FD >= 2 int p; #endif int n, r, old; old = filepos; if (!arg || (n = Xatoi(arg)) <= 0) n = 1; r = FILEPERROW; filepos -= r * n; #if FD >= 2 if (loopcursor) { p = FILEPERPAGE; while (filepos < 0 || filepos / p < old / p) filepos += p; if (filepos >= maxfile) { filepos = (maxfile - 1) / r * r + (old % r); if (filepos >= maxfile) filepos -= r; } } else #endif if (filepos >= 0) /*EMPTY*/; else filepos = old % r; return((filepos != old) ? FNC_UPDATE : FNC_NONE); } static int roll_up(arg) CONST char *arg; { int n, p, old; old = filepos; if (!arg || (n = Xatoi(arg)) <= 0) n = 1; p = FILEPERPAGE; filepos = (filepos / p + n) * p; if (filepos >= maxfile) { filepos = old; return(warning_bell(arg)); } return(FNC_UPDATE); } static int roll_down(arg) CONST char *arg; { int n, p, old; old = filepos; if (!arg || (n = Xatoi(arg)) <= 0) n = 1; p = FILEPERPAGE; filepos = (filepos / p - n) * p; if (filepos < 0) { filepos = old; return(warning_bell(arg)); } return(FNC_UPDATE); } /*ARGSUSED*/ static int cur_top(arg) CONST char *arg; { if (filepos <= 0) return(FNC_NONE); filepos = 0; return(FNC_UPDATE); } /*ARGSUSED*/ static int cur_bottom(arg) CONST char *arg; { if (filepos >= maxfile - 1) return(FNC_NONE); filepos = maxfile - 1; return(FNC_UPDATE); } /*ARGSUSED*/ static int fname_right(arg) CONST char *arg; { if (fnameofs <= 0) return(FNC_NONE); fnameofs--; return(FNC_UPDATE); } /*ARGSUSED*/ static int fname_left(arg) CONST char *arg; { #ifndef NOSYMLINK # ifdef DEP_DOSEMU char path[MAXPATHLEN]; # endif char tmp[MAXPATHLEN]; #endif /* !NOSYMLINK */ int i, m; #ifndef NOSYMLINK if (islink(&(filelist[filepos]))) { # ifndef _NOARCHIVE if (archivefile) { if (!(filelist[filepos].linkname)) i = 0; else { i = strlen(filelist[filepos].linkname); if (i > strsize(tmp)) i = strsize(tmp); Xstrncpy(tmp, filelist[filepos].linkname, i); } } else # endif i = Xreadlink(fnodospath(path, filepos), tmp, strsize(tmp)); tmp[i] = '\0'; i = 1 - (strlen3(tmp) + 4); } else #endif /* !NOSYMLINK */ { i = calcwidth(); if (isdisptyp(dispmode)) { m = filelist[filepos].st_mode; if ((m & S_IFMT) == S_IFDIR || (m & S_IFMT) == S_IFLNK || (m & S_IFMT) == S_IFSOCK || (m & S_IFMT) == S_IFIFO || (m & S_IEXEC_ALL)) i--; } } if (i >= strlen3(filelist[filepos].name) - fnameofs) return(FNC_NONE); fnameofs++; return(FNC_UPDATE); } /*ARGSUSED*/ static int one_column(arg) CONST char *arg; { curcolumns = 1; return(FNC_UPDATE); } /*ARGSUSED*/ static int two_columns(arg) CONST char *arg; { curcolumns = 2; return(FNC_UPDATE); } /*ARGSUSED*/ static int three_columns(arg) CONST char *arg; { curcolumns = 3; return(FNC_UPDATE); } /*ARGSUSED*/ static int five_columns(arg) CONST char *arg; { curcolumns = 5; return(FNC_UPDATE); } static VOID NEAR markcount(VOID_A) { #ifndef _NOTRADLAYOUT if (istradlayout()) { Xlocate(TC_MARK, TL_PATH); VOID_C XXcprintf("%<*d", TD_MARK, mark); Xlocate(TC_MARK + TD_MARK + TW_MARK, TL_PATH); VOID_C XXcprintf("%<'*qd", TD_SIZE, marksize); return; } #endif Xlocate(C_MARK + W_MARK, L_STATUS); VOID_C XXcprintf("%<*d", D_MARK, mark); if (sizeinfo) { Xlocate(C_SIZE + W_SIZE, L_SIZE); VOID_C XXcprintf("%<'*qd", D_SIZE, marksize); } } /*ARGSUSED*/ static int mark_file(arg) CONST char *arg; { if (isdir(&(filelist[filepos]))) return(FNC_NONE); filelist[filepos].tmpflags ^= F_ISMRK; if (ismark(&(filelist[filepos]))) { mark++; if (isfile(&(filelist[filepos]))) marksize += getblock(filelist[filepos].st_size); } else { mark--; if (isfile(&(filelist[filepos]))) marksize -= getblock(filelist[filepos].st_size); } markcount(); return(FNC_UPDATE); } static int mark_file2(arg) CONST char *arg; { mark_file(arg); if (filepos < maxfile - 1) filepos++; return(FNC_UPDATE); } static int mark_file3(arg) CONST char *arg; { mark_file(arg); if (filepos < maxfile - 1 && filepos / FILEPERPAGE == (filepos + 1) / FILEPERPAGE) filepos++; else filepos = (filepos / FILEPERPAGE) * FILEPERPAGE; return(FNC_UPDATE); } static int mark_all(arg) CONST char *arg; { int i; if ((arg && Xatoi(arg) == 0) || (!arg && mark)) { for (i = 0; i < maxfile; i++) filelist[i].tmpflags &= ~F_ISMRK; mark = 0; marksize = (off_t)0; } else { mark = 0; marksize = (off_t)0; for (i = 0; i < maxfile; i++) if (!isdir(&(filelist[i]))) { filelist[i].tmpflags |= F_ISMRK; mark++; if (isfile(&(filelist[i]))) marksize += getblock(filelist[i].st_size); } } markcount(); return(FNC_UPDATE); } /*ARGSUSED*/ static int mark_reverse(arg) CONST char *arg; { int i; mark = 0; marksize = (off_t)0; for (i = 0; i < maxfile; i++) if (!isdir(&(filelist[i]))) if ((filelist[i].tmpflags ^= F_ISMRK) & F_ISMRK) { mark++; if (isfile(&(filelist[i]))) marksize += getblock(filelist[i].st_size); } markcount(); return(FNC_UPDATE); } static reg_ex_t *NEAR prepareregexp(mes, arg) CONST char *mes, *arg; { reg_ex_t *re; char *wild; if (arg && *arg) wild = Xstrdup(arg); else if (!(wild = inputstr(mes, 0, 0, "*", -1))) return(NULL); if (!*wild || strdelim(wild, 1)) { warning(ENOENT, wild); Xfree(wild); return(NULL); } re = regexp_init(wild, -1); Xfree(wild); return(re); } static int mark_find(arg) CONST char *arg; { reg_ex_t *re; int i; if (!(re = prepareregexp(FINDF_K, arg))) return(FNC_CANCEL); for (i = 0; i < maxfile; i++) if (!isdir(&(filelist[i])) && !ismark(&(filelist[i])) && regexp_exec(re, filelist[i].name, 1)) { filelist[i].tmpflags |= F_ISMRK; mark++; if (isfile(&(filelist[i]))) marksize += getblock(filelist[i].st_size); } regexp_free(re); markcount(); return(FNC_HELPSPOT); } static int in_dir(arg) CONST char *arg; { if (!isdir(&(filelist[filepos]))) return(warning_bell(arg)); #ifndef _NOARCHIVE else if (archivefile) /*EMPTY*/; #endif else if (isdotdir(filelist[filepos].name) == 2) return(warning_bell(arg)); return(dochdir4(filelist[filepos].name, 1)); } /*ARGSUSED*/ static int out_dir(arg) CONST char *arg; { CONST char *path; #ifndef _NOARCHIVE if (archivefile) path = NULL; else #endif path = parentpath; return(dochdir4(path, 1)); } /*ARGSUSED*/ static int push_file(arg) CONST char *arg; { int i; if (stackdepth >= MAXSTACK || isdotdir(filelist[filepos].name)) return(FNC_NONE); memcpy((char *)&(filestack[stackdepth++]), (char *)&(filelist[filepos]), sizeof(namelist)); maxfile--; for (i = filepos; i < maxfile; i++) memcpy((char *)&(filelist[i]), (char *)&(filelist[i + 1]), sizeof(namelist)); if (filepos >= maxfile) filepos = maxfile - 1; return(FNC_UPDATE); } /*ARGSUSED*/ static int pop_file(arg) CONST char *arg; { int i; if (stackdepth <= 0) return(FNC_NONE); for (i = maxfile; i > filepos + 1; i--) memcpy((char *)&(filelist[i]), (char *)&(filelist[i - 1]), sizeof(namelist)); maxfile++; memcpy((char *)&(filelist[filepos + 1]), (char *)&(filestack[--stackdepth]), sizeof(namelist)); chgorder = 1; return(FNC_UPDATE); } /*ARGSUSED*/ static int symlink_mode(arg) CONST char *arg; { dispmode ^= F_SYMLINK; return(FNC_EFFECT); } /*ARGSUSED*/ static int filetype_mode(arg) CONST char *arg; { dispmode ^= F_FILETYPE; return(FNC_UPDATE); } /*ARGSUSED*/ static int dotfile_mode(arg) CONST char *arg; { dispmode ^= F_DOTFILE; return(FNC_EFFECT); } /*ARGSUSED*/ static int fileflg_mode(arg) CONST char *arg; { dispmode ^= F_FILEFLAG; return(FNC_UPDATE); } static int log_dir(arg) CONST char *arg; { char *path; int no; if (arg && *arg) path = Xstrdup(arg); else if (!(path = inputstr(LOGD_K, 0, -1, NULL, HST_PATH))) return(FNC_CANCEL); else if (!*(path = evalpath(path, 0))) { Xfree(path); return(FNC_CANCEL); } no = dochdir4(path, 0); Xfree(path); return(no); } /*ARGSUSED*/ static int log_top(arg) CONST char *arg; { return(dochdir4(rootpath, 1)); } static VOID NEAR clearscreen(VOID_A) { #ifdef DEP_PTY int i, yy; if (isptymode()) { yy = filetop(win); for (i = 0; i < FILEPERROW; i++) { Xlocate(0, yy + i); Xputterm(L_CLEAR); } } else #endif /* DEP_PTY */ Xputterms(T_CLEAR); Xtflush(); } #ifndef PAGER static VOID NEAR dump(file) CONST char *file; { XFILE *fp; char *buf, *prompt; int i, len, siz, min, max; if (!(fp = Xfopen(file, "r"))) { warning(-1, file); return; } clearscreen(); min = 0; max = n_line - 1; # ifdef DEP_PTY if (isptymode()) { min = filetop(win); max = min + FILEPERROW; } # endif Xtflush(); buf = NEXT_K; i = strlen3(file); len = strlen2(buf); if (i + len > n_lastcolumn) i = n_lastcolumn - len; siz = i * KANAWID + strlen(buf); prompt = Xmalloc(siz + 1); VOID_C strncpy2(prompt, file, &i, 0); VOID_C Xstrlcat(prompt, buf, siz); i = min; while ((buf = Xfgets(fp))) { Xlocate(0, i); Xputterm(L_CLEAR); VOID_C XXcprintf("%^.*k", n_column, buf); Xfree(buf); if (++i >= max) { i = min; hideclock = 1; if (!yesno(prompt)) break; } } if (Xfeof(fp)) { while (i < max) { Xlocate(0, i++); Xputterm(L_CLEAR); } } VOID_C Xfclose(fp); Xfree(prompt); } #endif /* !PAGER */ static int NEAR execenv(env, arg) CONST char *env, *arg; { char *command; if (!(command = getenv2(env)) || !*command) return(0); clearscreen(); ptymacro(command, arg, F_NOCONFIRM | F_IGNORELIST); return(1); } static int NEAR execshell(VOID_A) { #if MSDOS char *sh2; #endif #ifdef DEP_PTY int x, y, min, max; #endif char *sh; int mode, ret, wastty; #if MSDOS if (!(sh = getenv2("FD_SHELL"))) sh = "COMMAND.COM"; #else if (!(sh = getenv2("FD_SHELL"))) sh = "/bin/sh"; #endif #ifdef DEP_ORIGSHELL else if (!strpathcmp(getshellname(sh, NULL, NULL), FDSHELL)) sh = NULL; #endif #if MSDOS # ifdef DEP_ORIGSHELL if (!sh) /*EMPTY*/; else # endif if ((sh2 = getenv2("FD_COMSPEC"))) sh = sh2; #endif /* MSDOS */ #ifdef DEP_ORIGSHELL if (!sh && !fdmode) { warning(0, RECUR_K); return(-1); } #endif sigvecset(0); mode = Xtermmode(0); wastty = isttyiomode; VOID_C Xkanjiputs(SHEXT_K); #ifdef DEP_PTY if (isptymode()) { min = filetop(win); max = min + FILEPERROW; y = max; if (!isttyiomode) Xttyiomode(0); if (getxy(&x, &y) < 0 || --y >= max) y = max - 1; regionscroll(C_SCROLLFORW, 1, 0, y, min, max - 1); } else #endif /* DEP_PTY */ Xcputnl(); Xtflush(); if (isttyiomode) Xstdiomode(); ret = ptysystem(sh); #ifndef DEP_ORIGSHELL checkscreen(-1, -1); #endif if (wastty) Xttyiomode(wastty - 1); VOID_C Xtermmode(mode); sigvecset(1); return(ret); } /*ARGSUSED*/ static int view_file(arg) CONST char *arg; { #if !defined (_NOARCHIVE) || defined (DEP_PSEUDOPATH) char *dir; #endif #ifdef DEP_PSEUDOPATH int drive; #endif #if !defined (_NOARCHIVE) || defined (DEP_PSEUDOPATH) dir = NULL; #endif #ifdef DEP_PSEUDOPATH drive = 0; #endif if (isdir(&(filelist[filepos]))) return(FNC_CANCEL); #ifndef _NOARCHIVE else if (archivefile) { if (!(dir = tmpunpack(1))) return(FNC_CANCEL); } #endif #ifdef DEP_PSEUDOPATH else if ((drive = tmpdosdupl(nullstr, &dir, 1)) < 0) return(FNC_CANCEL); #endif if (!execenv("FD_PAGER", filelist[filepos].name)) { #ifdef PAGER ptymacro(PAGER, filelist[filepos].name, F_NOCONFIRM | F_IGNORELIST); #else do { dump(filelist[filepos].name); hideclock = 1; } while (!yesno(PEND_K)); #endif } #ifdef DEP_PSEUDOPATH if (drive) removetmp(dir, filelist[filepos].name); else #endif #ifndef _NOARCHIVE if (archivefile) removetmp(dir, NULL); else #endif /*EMPTY*/; return(FNC_UPDATE); } static int edit_file(arg) CONST char *arg; { #ifdef DEP_PSEUDOPATH char *dir; int drive; dir = NULL; #endif if (isdir(&(filelist[filepos]))) return(warning_bell(arg)); #ifndef _NOARCHIVE if (archivefile) return(FNC_CANCEL); #endif #ifdef DEP_PSEUDOPATH if ((drive = tmpdosdupl(nullstr, &dir, 1)) < 0) return(FNC_CANCEL); #endif if (!execenv("FD_EDITOR", filelist[filepos].name)) { #ifdef EDITOR ptymacro(EDITOR, filelist[filepos].name, F_NOCONFIRM | F_IGNORELIST); #endif } #ifdef DEP_PSEUDOPATH if (drive) { if (tmpdosrestore(drive, filelist[filepos].name) < 0) warning(-1, filelist[filepos].name); removetmp(dir, filelist[filepos].name); } #endif return(FNC_EFFECT); } static int sort_dir(arg) CONST char *arg; { CONST char *str[MAXSORTTYPE + 1]; int i, n, tmp1, tmp2, val[MAXSORTTYPE + 1], *dupl; str[0] = ONAME_K; str[1] = OEXT_K; str[2] = OSIZE_K; str[3] = ODATE_K; str[4] = OLEN_K; str[5] = ORAW_K; val[0] = SRT_FILENAME; val[1] = SRT_EXTENSION; val[2] = SRT_SIZE; val[3] = SRT_DATE; val[4] = SRT_LENGTH; val[5] = 0; tmp1 = (sorton & SRT_TYPE); tmp2 = (sorton & SRT_DESC); if (arg && *arg) { n = Xatoi(arg); if ((n >= 0 && n <= (MAXSORTTYPE | SRT_DESC)) || (n & SRT_TYPE) <= MAXSORTTYPE) { tmp1 = (n & SRT_TYPE); tmp2 = (n & SRT_DESC); } } else { n = arraysize(str); if (!tmp1) { n--; tmp1 = val[0]; } if (selectstr(&tmp1, n, 0, str, val) != K_CR) return(FNC_CANCEL); } if (!tmp1) { sorton = 0; qsort(filelist, maxfile, sizeof(namelist), cmplist); } else { str[0] = OINC_K; str[1] = ODEC_K; val[0] = 0; val[1] = SRT_DESC; if (selectstr(&tmp2, 2, 56, str, val) != K_CR) return(FNC_CANCEL); sorton = (tmp1 | tmp2); dupl = (int *)Xmalloc(maxfile * sizeof(int)); for (i = 0; i < maxfile; i++) { dupl[i] = filelist[i].ent; filelist[i].ent = i; } waitmes(); qsort(filelist, maxfile, sizeof(namelist), cmplist); for (i = 0; i < maxfile; i++) { tmp1 = filelist[i].ent; filelist[i].ent = dupl[tmp1]; } Xfree(dupl); chgorder = 1; } return(FNC_UPDATE); } #ifndef _NOWRITEFS static int write_dir(arg) CONST char *arg; { int fs; if (writefs >= 2 || findpattern) return(warning_bell(arg)); if ((fs = writablefs(curpath)) <= 0) { warning(0, NOWRT_K); return(FNC_CANCEL); } if (!yesno(WRTOK_K)) return(FNC_CANCEL); if (underhome(NULL) <= 0 && !yesno(HOMOK_K)) return(FNC_CANCEL); arrangedir(fs); chgorder = 0; return(FNC_EFFECT); } #endif /* !_NOWRITEFS */ /*ARGSUSED*/ static int reread_dir(arg) CONST char *arg; { #ifdef DEP_DOSDRIVE int drive; #endif checkscreen(WCOLUMNMIN, WHEADERMAX + WFOOTER + WFILEMIN); #ifdef DEP_DOSDRIVE if ((drive = dospath3(nullstr))) flushdrv(drive, NULL); #endif return(FNC_EFFECT); } #ifndef _NOCUSTOMIZE static int edit_config(arg) CONST char *arg; { if (!arg && FILEPERROW < WFILEMINCUSTOM) { warning(0, NOROW_K); return(FNC_CANCEL); } if (customize(arg) <= 0) return(FNC_CANCEL); return(FNC_EFFECT); } #endif /*ARGSUSED*/ static int help_message(arg) CONST char *arg; { #ifdef _NOARCHIVE help(0); #else help((archivefile) ? 1 : 0); #endif return(FNC_UPDATE); } #ifdef DEP_PTY static int NEAR confirmpty(VOID_A) { int i; VOID_C checkallpty(); for (i = 0; i < MAXWINDOWS; i++) if (ptylist[i].pid) break; if (i < MAXWINDOWS && !yesno(KILL_K)) return(1); return(0); } #endif /* DEP_PTY */ /*ARGSUSED*/ static int quit_system(arg) CONST char *arg; { #ifdef DEP_ORIGSHELL CONST char *str[3]; int val[3]; #endif int n; #ifndef _NOARCHIVE if (archivefile) return(FNC_QUIT); #endif n = 0; #ifdef DEP_ORIGSHELL if (!fdmode) { Xlocate(0, L_MESLINE); Xputterm(L_CLEAR); VOID_C Xkanjiputs(QUIT_K); val[0] = 0; val[1] = 1; val[2] = 2; str[0] = QYES_K; str[1] = QNO_K; str[2] = QCHG_K; if (selectstr(&n, 3, 20, str, val) != K_CR || n == 1) return(FNC_CANCEL); } else #endif /* DEP_ORIGSHELL */ if (!yesno(QUIT_K)) return(FNC_CANCEL); #ifdef DEP_PTY if (confirmpty()) return(FNC_CANCEL); #endif return((n) ? FNC_FAIL : FNC_QUIT); } static int make_dir(arg) CONST char *arg; { char *path; if (arg && *arg) path = Xstrdup(arg); else if (!(path = inputstr(MAKED_K, 1, -1, NULL, HST_PATH))) return(FNC_CANCEL); else if (!*(path = evalpath(path, 0))) { Xfree(path); return(FNC_CANCEL); } if (mkdir2(path, 0777) < 0) warning(-1, path); Xfree(path); return(FNC_EFFECT); } static int copy_file(arg) CONST char *arg; { return(copyfile(arg, 0)); } #ifndef _NOTREE /*ARGSUSED*/ static int copy_tree(arg) CONST char *arg; { return(copyfile(NULL, 1)); } #endif /* !_NOTREE */ static int move_file(arg) CONST char *arg; { return(movefile(arg, 0)); } #ifndef _NOTREE /*ARGSUSED*/ static int move_tree(arg) CONST char *arg; { return(movefile(NULL, 1)); } #endif /* !_NOTREE */ static int rename_file(arg) CONST char *arg; { #ifdef DEP_DOSEMU char path[MAXPATHLEN]; #endif char *file; if (isdotdir(filelist[filepos].name)) return(warning_bell(arg)); if (arg && *arg) { file = Xstrdup(arg); errno = EEXIST; if (Xaccess(file, F_OK) >= 0 || errno != ENOENT) { warning(-1, file); Xfree(file); return(FNC_CANCEL); } } else for (;;) { file = inputstr(NEWNM_K, 1, 0, filelist[filepos].name, -1); if (!file || !*file) return(FNC_CANCEL); if (Xaccess(file, F_OK) < 0) { if (errno == ENOENT) break; warning(-1, file); } else warning(0, WRONG_K); Xfree(file); } if (Xrename(fnodospath(path, filepos), file) < 0) { warning(-1, file); Xfree(file); return(FNC_CANCEL); } if (strdelim(file, 0)) { Xfree(file); file = Xstrdup(parentpath); } setlastfile(file); return(FNC_EFFECT); } static int delete_file(arg) CONST char *arg; { CONST char *cp; int len; if (mark > 0) { if (!yesno(DELMK_K)) return(FNC_CANCEL); if (prepareremove(0, mark) < 0) return(FNC_CANCEL); filepos = applyfile(rmvfile, NULL); } else if (isdir(&(filelist[filepos]))) return(warning_bell(arg)); else { cp = DELFL_K; len = strlen2(cp) - strsize("%.*s"); if (!yesno(cp, n_lastcolumn - len, filelist[filepos].name)) return(FNC_CANCEL); if (prepareremove(0, 1) < 0) return(FNC_CANCEL); filepos = applyfile(rmvfile, NULL); } if (filepos >= maxfile && (filepos -= 2) < 0) filepos = 0; return(FNC_EFFECT); } static int delete_dir(arg) CONST char *arg; { #if !defined (NOSYMLINK) && defined (DEP_DOSEMU) char path[MAXPATHLEN]; #endif CONST char *cp; int ret, len; if (!isdir(&(filelist[filepos])) || isdotdir(filelist[filepos].name)) return(warning_bell(arg)); cp = DELDR_K; len = strlen2(cp) - strsize("%.*s"); if (!yesno(cp, n_lastcolumn - len, filelist[filepos].name)) return(FNC_CANCEL); cp = filelist[filepos].name; #ifndef NOSYMLINK if (islink(&(filelist[filepos]))) { if (prepareremove(0, 1) < 0) return(FNC_CANCEL); ret = rmvfile(fnodospath(path, filepos)); if (ret == APL_ERROR) warning(-1, cp); } else #endif { if (prepareremove(1, 1) < 0) return(FNC_CANCEL); ret = applydir(cp, rmvfile, NULL, rmvdir, ORD_NOPREDIR, NULL); } if (ret == APL_OK) filepos++; if (filepos >= maxfile && (filepos -= 2) < 0) filepos = 0; return(FNC_EFFECT); } static int find_file(arg) CONST char *arg; { char *wild; if (arg) wild = Xstrdup(arg); else if (!(wild = inputstr(FINDF_K, 0, 0, "*", -1))) return(FNC_CANCEL); #ifndef _NOARCHIVE if (*wild == '/') /*EMPTY*/; else #endif if (strdelim(wild, 1)) { warning(ENOENT, wild); Xfree(wild); return(FNC_CANCEL); } Xfree(findpattern); if (*wild) findpattern = wild; else { Xfree(wild); findpattern = NULL; } return(FNC_EFFECT); } static int find_dir(arg) CONST char *arg; { CONST char *cp; char *tmp; if (!(findregexp = prepareregexp(FINDD_K, arg))) return(FNC_CANCEL); destpath = NULL; if (isdir(&(filelist[filepos]))) cp = filelist[filepos].name; else cp = curpath; VOID_C applydir(cp, findfile, finddir, NULL, ORD_NORMAL, NOFND_K); regexp_free(findregexp); if (!destpath) return(FNC_CANCEL); if (!(tmp = strrdelim(destpath, 0))) tmp = destpath; else { *(tmp++) = '\0'; if (dochdir4(destpath, 1) == FNC_CANCEL) { Xfree(destpath); return(FNC_CANCEL); } } setlastfile(tmp); Xfree(destpath); return(FNC_EFFECT); } int evalstatus(n) int n; { if (n < 0) return(FNC_CANCEL); if (internal_status == FNC_QUIT || internal_status > FNC_CANCEL) return(internal_status); return(FNC_EFFECT); } static int execute_sh(arg) CONST char *arg; { char *com; int ret; if (arg) com = Xstrdup(arg); else { Xttyiomode(1); com = inputshellloop(-1, NULL); Xttyiomode(0); if (!com) return(FNC_CANCEL); } if (*com) { ret = ptyusercomm(com, (filepos < maxfile) ? filelist[filepos].name : NULL, F_ARGSET); ret = evalstatus(ret); } else { execshell(); ret = FNC_EFFECT; } Xfree(com); return(ret); } /*ARGSUSED*/ static int execute_file(arg) CONST char *arg; { #if !defined (_NOARCHIVE) || defined (DEP_PSEUDOPATH) char *dir; #endif #ifndef CWDINPATH char *tmp; #endif #ifdef DEP_PSEUDOPATH int drive; #endif char *com; int ret, len; #if !defined (_NOARCHIVE) && !defined (_NOBROWSE) if (browselist) return(warning_bell(arg)); #endif #if !defined (_NOARCHIVE) || defined (DEP_PSEUDOPATH) dir = NULL; #endif #ifdef DEP_PSEUDOPATH drive = 0; #endif #ifdef CWDINPATH len = (!isdir(&(filelist[filepos])) && isexec(&(filelist[filepos]))) ? strlen(filelist[filepos].name) + 1 : 0; Xttyiomode(1); com = inputshellloop(len, filelist[filepos].name); Xttyiomode(0); #else if (isdir(&(filelist[filepos])) || !isexec(&(filelist[filepos]))) { len = 0; tmp = filelist[filepos].name; } else { len = strlen(filelist[filepos].name) + 2 + 1; tmp = Xmalloc(len + 1); tmp[0] = '.'; tmp[1] = _SC_; Xstrcpy(&(tmp[2]), filelist[filepos].name); } Xttyiomode(1); com = inputshellloop(len, tmp); Xttyiomode(0); if (tmp != filelist[filepos].name) Xfree(tmp); #endif if (!com) return(FNC_CANCEL); if (!*com) { execshell(); Xfree(com); return(FNC_EFFECT); } #ifndef _NOARCHIVE if (archivefile) { if (!(dir = tmpunpack(1))) ret = -1; else { ret = ptyusercomm(com, filelist[filepos].name, F_ARGSET | F_IGNORELIST); removetmp(dir, NULL); } } else #endif #ifdef DEP_PSEUDOPATH if ((drive = tmpdosdupl(nullstr, &dir, 1)) < 0) ret = -1; else if (drive) { ret = ptyusercomm(com, filelist[filepos].name, F_ARGSET | F_IGNORELIST); removetmp(dir, filelist[filepos].name); } else #endif { ret = ptyusercomm(com, filelist[filepos].name, F_ARGSET); } ret = evalstatus(ret); Xfree(com); return(ret); } #ifndef _NOARCHIVE static int launch_file(arg) CONST char *arg; { if (!launcher()) return(view_file(arg)); return(FNC_EFFECT); } static int pack_file(arg) CONST char *arg; { char *file; int ret; if (arg && *arg) file = Xstrdup(arg); else if (!(file = inputstr(PACK_K, 1, -1, NULL, HST_PATH))) return(FNC_CANCEL); else if (!*(file = evalpath(file, 0))) { Xfree(file); return(FNC_CANCEL); } ret = pack(file); Xfree(file); if (ret < 0) { Xputterm(T_BELL); return(FNC_CANCEL); } if (!ret) return(FNC_CANCEL); return(FNC_EFFECT); } static int unpack_file(arg) CONST char *arg; { #ifdef DEP_DOSEMU char path[MAXPATHLEN]; #endif int ret; if (archivefile) ret = unpack(archivefile, NULL, arg, 0, F_ARGSET | F_ISARCH | F_NOADDOPT); else if (isdir(&(filelist[filepos]))) return(warning_bell(arg)); else ret = unpack(fnodospath(path, filepos), NULL, arg, 0, F_ARGSET | F_ISARCH | F_NOADDOPT | F_IGNORELIST); if (ret < 0) return(warning_bell(arg)); if (!ret) return(FNC_CANCEL); return(FNC_EFFECT); } #ifndef _NOTREE static int unpack_tree(arg) CONST char *arg; { #ifdef DEP_DOSEMU char path[MAXPATHLEN]; #endif int ret; if (archivefile) ret = unpack(archivefile, NULL, NULL, 1, F_ARGSET | F_ISARCH | F_NOADDOPT); else if (isdir(&(filelist[filepos]))) return(warning_bell(arg)); else ret = unpack(fnodospath(path, filepos), NULL, NULL, 1, F_ARGSET | F_ISARCH | F_NOADDOPT | F_IGNORELIST); if (ret <= 0) { if (ret < 0) warning_bell(arg); return(FNC_HELPSPOT); } return(FNC_EFFECT); } #endif /* !_NOTREE */ #endif /* !_NOARCHIVE */ static int info_filesys(arg) CONST char *arg; { char *path; int ret; if (arg && *arg) path = Xstrdup(arg); else if (!(path = inputstr(FSDIR_K, 0, -1, NULL, HST_PATH))) return(FNC_CANCEL); else if (!*(path = evalpath(path, 0))) { Xfree(path); path = Xstrdup(curpath); } ret = infofs(path); Xfree(path); if (!ret) return(FNC_CANCEL); return(FNC_HELPSPOT); } static int NEAR selectattr(s) CONST char *s; { CONST char *str[MAXATTRSEL]; int n, val[MAXATTRSEL]; str[0] = CMODE_K; str[1] = CDATE_K; val[0] = ATR_MODEONLY; val[1] = ATR_TIMEONLY; #if !defined (_NOEXTRAATTR) && !defined (NOUID) str[2] = COWNR_K; val[2] = ATR_OWNERONLY; #endif n = ATR_MODEONLY; Xlocate(0, ATTR_Y); Xputterm(L_CLEAR); #if defined (_NOEXTRAATTR) || defined (NOUID) VOID_C Xkanjiputs(s); #else VOID_C Xattrkanjiputs(s, 1); #endif if (selectstr(&n, MAXATTRSEL, ATTR_X, str, val) != K_CR) return(-1); return(n); } /*ARGSUSED*/ static int attr_file(arg) CONST char *arg; { int i, n, flag; if (mark > 0) { for (i = 0; i < maxfile; i++) if (ismark(&(filelist[i]))) break; if (i >= maxfile) i = filepos; if ((flag = selectattr(ATTRM_K)) < 0) return(FNC_CANCEL); flag |= ATR_MULTIPLE; } else { #ifndef NOSYMLINK if (islink(&(filelist[filepos]))) { warning(0, ILLNK_K); return(FNC_CANCEL); } #endif i = filepos; flag = 0; } while ((n = inputattr(&(filelist[i]), flag)) < 0) warning(0, ILTMS_K); if (!n) { if (FILEPERROW < WFILEMINATTR) return(FNC_EFFECT); return(FNC_UPDATE); } applyfile(setattr, NULL); return(FNC_EFFECT); } #ifndef _NOEXTRAATTR /*ARGSUSED*/ static int attr_dir(arg) CONST char *arg; { int n, flag; if (!isdir(&(filelist[filepos]))) return(warning_bell(arg)); if ((flag = selectattr(ATTRD_K)) < 0) return(FNC_CANCEL); flag |= (ATR_MULTIPLE | ATR_RECURSIVE); while ((n = inputattr(&(filelist[filepos]), flag)) < 0) warning(0, ILTMS_K); if (!n) { if (FILEPERROW < WFILEMINATTR) return(FNC_EFFECT); return(FNC_UPDATE); } VOID_C applydir(filelist[filepos].name, setattr, NULL, setattr, ORD_NOPREDIR, NULL); return(FNC_EFFECT); } #endif /* !_NOEXTRAATTR */ #ifndef _NOTREE /*ARGSUSED*/ static int tree_dir(arg) CONST char *arg; { char *path; int no; if (!(path = tree(0, NULL))) return(FNC_UPDATE); no = dochdir4(path, 1); if (no == FNC_CANCEL) no = FNC_UPDATE; Xfree(path); return(no); } #endif /* !_NOTREE */ #ifndef _NOARCHIVE static int backup_tape(arg) CONST char *arg; { char *dir, *dev; #ifdef DEP_PSEUDOPATH int drive; #endif int ret; #if !defined (_NOARCHIVE) && !defined (_NOBROWSE) if (browselist) return(warning_bell(arg)); #endif dir = NULL; #ifdef DEP_PSEUDOPATH drive = 0; #endif if (arg && *arg) dev = Xstrdup(arg); #if MSDOS else if (!(dev = inputstr(BKUP_K, 1, -1, NULL, HST_PATH))) return(FNC_CANCEL); #else else if (!(dev = inputstr(BKUP_K, 1, 5, "/dev/", HST_PATH))) return(FNC_CANCEL); #endif else if (!*(dev = evalpath(dev, 0))) { Xfree(dev); return(FNC_CANCEL); } else if (archivefile) { if (!(dir = tmpunpack(0))) { Xfree(dev); return(FNC_CANCEL); } } #ifdef DEP_PSEUDOPATH else if ((drive = tmpdosdupl(nullstr, &dir, 0)) < 0) { Xfree(dev); return(FNC_CANCEL); } #endif ret = backup(dev); #ifdef DEP_PSEUDOPATH if (drive) removetmp(dir, NULL); else #endif if (archivefile) removetmp(dir, NULL); Xfree(dev); if (ret <= 0) return(FNC_CANCEL); return(FNC_EFFECT); } #endif /* !_NOARCHIVE */ /*ARGSUSED*/ static int search_forw(arg) CONST char *arg; { isearch = 1; Xlocate(0, L_HELP); Xputterm(L_CLEAR); win_x = Xattrkanjiputs(SEAF_K, 1); win_y = L_HELP; return(FNC_NONE); } /*ARGSUSED*/ static int search_back(arg) CONST char *arg; { isearch = -1; Xlocate(0, L_HELP); Xputterm(L_CLEAR); win_x = Xattrkanjiputs(SEAB_K, 1); win_y = L_HELP; return(FNC_NONE); } #ifndef _NOSPLITWIN static VOID NEAR duplwin(oldwin) int oldwin; { int i; for (i = 0; i < winvar[oldwin].v_maxfile; i++) winvar[oldwin].v_filelist[i].tmpflags &= ~(F_ISMRK | F_WSMRK | F_ISARG); if (filelist) return; maxfile = winvar[oldwin].v_maxfile; i = ((maxfile) ? maxfile : 1) * sizeof(namelist); filelist = addlist(filelist, maxfile, &maxent); memcpy((char *)filelist, (char *)(winvar[oldwin].v_filelist), i); for (i = 0; i < winvar[oldwin].v_maxfile; i++) filelist[i].name = Xstrdup(winvar[oldwin].v_filelist[i].name); lastfile = Xstrdup(winvar[oldwin].v_lastfile); filepos = winvar[oldwin].v_filepos; sorton = winvar[oldwin].v_sorton; dispmode = winvar[oldwin].v_dispmode; } static VOID NEAR movewin(oldwin) int oldwin; { Xfree(winvar[oldwin].v_fullpath); winvar[oldwin].v_fullpath = Xstrdup(fullpath); if (winvar[win].v_fullpath) Xstrcpy(fullpath, winvar[win].v_fullpath); # ifndef _NOARCHIVE Xfree(winvar[oldwin].v_archivedir); winvar[oldwin].v_archivedir = Xstrdup(archivedir); if (winvar[win].v_archivedir) Xstrcpy(archivedir, winvar[win].v_archivedir); # endif } int nextwin(VOID_A) { int oldwin; if (windows <= 1) return(-1); if (lastfile || internal_status == FNC_EFFECT) getfilelist(); oldwin = win; if (++win >= windows) win = 0; duplwin(oldwin); movewin(oldwin); if (chdir3(fullpath, 1) < 0) lostcwd(fullpath); return(0); } /*ARGSUSED*/ static int split_window(arg) CONST char *arg; { winvartable tmp; int i, oldwin; oldwin = win; if (windows >= MAXWINDOWS) { # ifdef _NOEXTRAWIN # ifdef DEP_PTY if (confirmpty()) return(FNC_CANCEL); # endif if (win > 0) { shutwin(0); win = 0; duplwin(oldwin); } for (i = 1; i < windows; i++) shutwin(i); # ifdef DEP_PTY killallpty(); # endif windows = 1; calcwin(); # else /* !_NOEXTRAWIN */ warning(0, NOWIN_K); return(FNC_CANCEL); # endif /* !_NOEXTRAWIN */ } # ifdef _NOEXTRAWIN else if (fileperrow(windows + 1) < WFILEMIN) # else else if (FILEPERROW < WFILEMIN * 2 + 1) # endif { warning(0, NOROW_K); return(FNC_CANCEL); } else { win++; memcpy((char *)&tmp, (char *)&(winvar[windows]), sizeof(winvartable)); memmove((char *)&(winvar[win + 1]), (char *)&(winvar[win]), (windows++ - win) * sizeof(winvartable)); memcpy((char *)&(winvar[win]), (char *)&tmp, sizeof(winvartable)); # ifdef _NOEXTRAWIN calcwin(); # else i = (winvar[oldwin].v_fileperrow - 1) / 2; FILEPERROW = (winvar[oldwin].v_fileperrow - 1) - i; winvar[oldwin].v_fileperrow = i; # endif # ifdef DEP_PTY insertwin(win, windows); changewsize(wheader, windows); # endif duplwin(oldwin); movewin(oldwin); } return(FNC_EFFECT); } /*ARGSUSED*/ static int next_window(arg) CONST char *arg; { if (nextwin() < 0) return(FNC_NONE); # ifdef DEP_PTY if (!ptyinternal && ptylist[win].pid && ptylist[win].status < 0) { rewritefile(0); VOID_C frontend(); if (internal_status > FNC_FAIL) return(internal_status); } # endif return(FNC_EFFECT); } #endif /* !_NOSPLITWIN */ #ifndef _NOEXTRAWIN static int widen_window(arg) CONST char *arg; { int n, next; if (windows <= 1) return(FNC_NONE); if (!arg || (n = Xatoi(arg)) <= 0) n = 1; if ((next = win + 1) >= windows) next = 0; if (winvar[next].v_fileperrow - n < WFILEMIN) n = winvar[next].v_fileperrow - WFILEMIN; if (n <= 0) return(warning_bell(arg)); winvar[next].v_fileperrow -= n; winvar[win].v_fileperrow += n; # ifdef DEP_PTY changewsize(wheader, windows); # endif return(FNC_EFFECT); } static int narrow_window(arg) CONST char *arg; { int n, next; if (windows <= 1) return(FNC_NONE); if (!arg || (n = Xatoi(arg)) <= 0) n = 1; if ((next = win + 1) >= windows) next = 0; if (FILEPERROW - n < WFILEMIN) n = FILEPERROW - WFILEMIN; if (n <= 0) return(warning_bell(arg)); winvar[next].v_fileperrow += n; winvar[win].v_fileperrow -= n; # ifdef DEP_PTY changewsize(wheader, windows); # endif return(FNC_EFFECT); } /*ARGSUSED*/ static int kill_window(arg) CONST char *arg; { winvartable tmp; int prev; if (windows <= 1) return(FNC_NONE); memcpy((char *)&tmp, (char *)&(winvar[win]), sizeof(winvartable)); memmove((char *)&(winvar[win]), (char *)&(winvar[win + 1]), (--windows - win) * sizeof(winvartable)); memcpy((char *)&(winvar[windows]), (char *)&tmp, sizeof(winvartable)); if ((prev = win - 1) < 0) prev = windows - 1; winvar[prev].v_fileperrow += winvar[windows].v_fileperrow + 1; # ifdef DEP_PTY deletewin(win, windows); changewsize(wheader, windows); # endif win = prev; duplwin(windows); movewin(windows); shutwin(windows); if (chdir3(fullpath, 1) < 0) lostcwd(fullpath); # ifdef DEP_PTY if (!ptyinternal && ptylist[win].pid && ptylist[win].status < 0) { rewritefile(0); VOID_C frontend(); if (internal_status > FNC_FAIL) return(internal_status); } # endif return(FNC_EFFECT); } #endif /* !_NOEXTRAWIN */ /*ARGSUSED*/ static int warning_bell(arg) CONST char *arg; { Xputterm(T_BELL); return(FNC_NONE); } /*ARGSUSED*/ static int no_operation(arg) CONST char *arg; { return(FNC_NONE); } FD-3.01j/browse.c100644 2105 1751 121247 13516612560 12375 0ustar shiraiuser/* * browse.c * * directory browsing module */ #include "fd.h" #include "device.h" #include "parse.h" #include "kconv.h" #include "func.h" #include "funcno.h" #include "kanji.h" #include "termemu.h" #define CL_REG 0 #define CL_BACK 1 #define CL_DIR 2 #define CL_RONLY 3 #define CL_HIDDEN 4 #define CL_LINK 5 #define CL_SOCK 6 #define CL_FIFO 7 #define CL_BLOCK 8 #define CL_CHAR 9 #define CL_EXE 10 #define ANSI_FG 8 #define ANSI_BG 9 #if MSDOS extern int setcurdrv __P_((int, int)); #endif extern bindlist_t bindlist; extern int maxbind; extern CONST functable funclist[]; #ifndef _NOWRITEFS extern int writefs; #endif extern char *curfilename; extern int lostcount; extern char *origpath; #ifndef _NOARCHIVE extern char archivedir[]; #endif extern int win_x; extern int win_y; #ifndef _NOCUSTOMIZE extern int custno; #endif extern int internal_status; extern int hideclock; extern int fd_restricted; #ifndef _NOCOLOR static int NEAR getcolorid __P_((namelist *)); static int NEAR biascolor __P_((int)); static int NEAR getcolor __P_((int)); #endif static VOID NEAR pathbar __P_((VOID_A)); static CONST char *NEAR skipstr __P_((CONST char *, int)); static VOID NEAR putsorttype __P_((VOID_A)); static VOID NEAR statusbar __P_((VOID_A)); static VOID NEAR stackbar __P_((VOID_A)); static VOID NEAR cputbytes __P_((off_t, off_t, int)); static VOID NEAR sizebar __P_((VOID_A)); static int NEAR putsize __P_((char *, off_t, int, int, int)); static int NEAR putsize2 __P_((char *, namelist *, int)); static int NEAR putfilename __P_((char *, namelist *, int)); static VOID NEAR infobar __P_((VOID_A)); static int NEAR calclocate __P_((int)); static int NEAR calcfilepos __P_((namelist *, int, CONST char *)); static int NEAR listupmyself __P_((CONST char *)); #ifndef _NOSPLITWIN static int NEAR listupwin __P_((CONST char *)); #endif static int NEAR searchmove __P_((int, char *)); #ifndef _NOPRECEDE static int readstatus __P_((VOID_A)); #endif static int NEAR readfilelist __P_((CONST reg_ex_t *, CONST char *)); static int NEAR getfuncno __P_((int)); static int NEAR browsedir __P_((VOID_A)); static VOID NEAR initcwd __P_((CONST char *, int)); int curcolumns = 0; int defcolumns = 0; int minfilename = 0; int widedigit = 0; int sizeunit = 0; int mark = 0; int fnameofs = 0; int displaymode = 0; int sorttype = 0; int chgorder = 0; int stackdepth = 0; #ifndef _NOTRADLAYOUT int tradlayout = 0; #endif #if FD >= 2 int thruargs = 0; #endif int sizeinfo = 0; int wheader = WHEADERMIN; off_t marksize = (off_t)0; off_t totalsize = (off_t)0; off_t blocksize = (off_t)0; namelist filestack[MAXSTACK]; char fullpath[MAXPATHLEN] = ""; int maxmacro = 0; int isearch = 0; int autoupdate = 0; #if FD >= 2 int helplayout = 0; #endif #ifdef DEP_DYNAMICLIST macrolist_t macrolist = NULL; helpindex_t helpindex = NULL; orighelpindex_t orighelpindex #else /* !DEP_DYNAMICLIST */ macrolist_t macrolist = { NULL }; # ifndef _NOCUSTOMIZE orighelpindex_t orighelpindex = NULL; # endif helpindex_t helpindex #endif /* !DEP_DYNAMICLIST */ = { #ifdef _NOTREE "help", #else "Logdir", #endif "eXec", "Copy", "Delete", "Rename", "Sort", "Find", #ifdef _NOTREE "Logdir", #else "Tree", #endif "Editor", #ifdef _NOARCHIVE "", #else "Unpack", #endif #if FD >= 2 "Attr", "Info", "Move", "rmDir", "mKdir", "sHell", # ifdef _NOWRITEFS "", # else "Write", # endif # ifdef _NOARCHIVE "", # else "Backup", # endif "View", # ifdef _NOARCHIVE "", # else "Pack", # endif #endif /* FD >= 2 */ }; #ifdef HAVEFLAGS CONST char fflagsymlist[] = "ANacuacu"; CONST u_long fflaglist[] = { SF_ARCHIVED, UF_NODUMP, SF_APPEND, SF_IMMUTABLE, SF_NOUNLINK, UF_APPEND, UF_IMMUTABLE, UF_NOUNLINK }; #endif winvartable winvar[MAXWINDOWS]; #ifndef _NOCOLOR int ansicolor = 0; char *ansipalette = NULL; #endif #ifndef _NOPRECEDE char *precedepath = NULL; #endif #ifndef _NOSPLITWIN int windows = 1; #endif #if !defined (_NOSPLITWIN) || defined (DEP_PTY) int win = 0; #endif int calc_x = -1; int calc_y = -1; static CONST u_short modelist[] = { S_IFDIR, S_IFLNK, S_IFSOCK, S_IFIFO, S_IFBLK, S_IFCHR }; #define MODELISTSIZ arraysize(modelist) static CONST char suffixlist[] = { '/', '@', '=', '|' }; #define SUFFIXLISTSIZ arraysize(suffixlist) #ifndef _NOCOLOR static CONST u_char colorlist[] = { CL_DIR, CL_LINK, CL_SOCK, CL_FIFO, CL_BLOCK, CL_CHAR }; static CONST char defpalette[] = { ANSI_FG, /* CL_REG */ ANSI_BG, /* CL_BACK */ ANSI_CYAN, /* CL_DIR */ ANSI_GREEN, /* CL_RONLY */ ANSI_BLUE, /* CL_HIDDEN */ ANSI_YELLOW, /* CL_LINK */ ANSI_MAGENTA, /* CL_SOCK */ ANSI_RED, /* CL_FIFO */ ANSI_FG, /* CL_BLOCK */ ANSI_FG, /* CL_CHAR */ ANSI_FG, /* CL_EXE */ }; #endif /* !_NOCOLOR */ #ifndef _NOPRECEDE static int maxstat = 0; static int haste = 0; #endif static int search_x = -1; static int search_y = -1; #ifndef _NOCOLOR static int NEAR getcolorid(namep) namelist *namep; { int i; if (!isread(namep)) return(CL_HIDDEN); if (!iswrite(namep)) return(CL_RONLY); for (i = 0; i < MODELISTSIZ; i++) if ((namep -> st_mode & S_IFMT) == modelist[i]) return(colorlist[i]); if (isexec(namep)) return(CL_EXE); return(CL_REG); } static int NEAR biascolor(color) int color; { if (color == ANSI_FG) color = (ansicolor == 3) ? ANSI_BLACK : ANSI_WHITE; else if (color == ANSI_BG) color = (ansicolor == 2) ? ANSI_BLACK : -1; return(color); } static int NEAR getcolor(id) int id; { int color; if (!ansipalette || id >= strlen(ansipalette)) color = defpalette[id]; else { color = ansipalette[id]; if (Xisdigit(color)) color -= '0'; else color = defpalette[id]; } return(biascolor(color)); } #endif /* !_NOCOLOR */ static VOID NEAR pathbar(VOID_A) { #ifndef _NOTRADLAYOUT if (istradlayout()) { Xlocate(0, TL_PATH); Xputterm(L_CLEAR); Xlocate(TC_PATH, TL_PATH); Xattrputs(TS_PATH, 1); cputstr(TD_PATH, fullpath); Xlocate(TC_MARK, TL_PATH); VOID_C XXcprintf("%<*d", TD_MARK, mark); Xattrputs(TS_MARK, 1); # if FD >= 3 if (sizeunit) VOID_C XXcprintf("%>'*qd", TD_SIZE, marksize); else # endif VOID_C XXcprintf("%<'*qd", TD_SIZE, marksize); Xtflush(); return; } #endif /* !_NOTRADLAYOUT */ Xlocate(0, L_PATH); Xputterm(L_CLEAR); Xlocate(C_PATH, L_PATH); Xattrputs(S_PATH, 1); cputstr(D_PATH, fullpath); Xtflush(); } VOID helpbar(VOID_A) { int i, col, gap, width, len, ofs, max, blk, rest; #if FD >= 2 if (helplayout) { max = helplayout / 100; blk = helplayout % 100; if (max < 0) max = FUNCLAYOUT / 100; else if (max > MAXHELPINDEX) max = MAXHELPINDEX; if (blk <= 0 || blk > max) blk = max; } else #endif { max = FUNCLAYOUT / 100; blk = FUNCLAYOUT % 100; } if (ishardomit()) { col = n_column; gap = 0; } else if (iswellomit()) { col = n_column; gap = 1; } else if (isrightomit()) { col = n_column; gap = 2; } else if (isleftshift()) { col = n_column; gap = 3; } else { col = n_column - 1; gap = 3; } if (max > FUNCLAYOUT / 100) gap = 1; rest = max - 1 + gap * ((max - 1) / blk); width = (col - 4 - rest) / max; ofs = (n_column - width * max - rest) / 2; if (ofs < 4) ofs = 4; Xlocate(0, L_HELP); Xputterm(L_CLEAR); VOID_C XXputch(isdisplnk(dispmode) ? 'S' : ' '); VOID_C XXputch(isdisptyp(dispmode) ? 'T' : ' '); VOID_C XXputch(ishidedot(dispmode) ? 'H' : ' '); #ifdef HAVEFLAGS VOID_C XXputch(isfileflg(dispmode) ? 'F' : ' '); #endif for (i = 0; i < max; i++) { Xlocate(ofs + (width + 1) * i + (i / blk) * gap, L_HELP); len = (width - strlen2(helpindex[i]) + 1) / 2; if (len < 0) len = 0; attrputstr(len, NULL, 1); attrputstr(width - len, helpindex[i], 1); } Xtflush(); } static CONST char *NEAR skipstr(s, n) CONST char *s; int n; { while (n-- > 0 && *s) s++; return(s); } static VOID NEAR putsorttype(VOID_A) { CONST char *str[MAXSORTTYPE + 1]; #ifndef _NOPRECEDE if (haste) { VOID_C Xkanjiputs(OMIT_K); return; } #endif str[0] = ORAW_K; str[SRT_FILENAME] = ONAME_K; str[SRT_EXTENSION] = OEXT_K; str[SRT_SIZE] = OSIZE_K; str[SRT_DATE] = ODATE_K; str[SRT_LENGTH] = OLEN_K; VOID_C Xkanjiputs(skipstr(str[sorton & SRT_TYPE], 3)); if (!(sorton & SRT_TYPE)) return; str[0] = OINC_K; str[1] = ODEC_K; VOID_C XXcprintf("(%k)", skipstr(str[(sorton & SRT_DESC) ? 1 : 0], 3)); } static VOID NEAR statusbar(VOID_A) { #ifndef _NOTRADLAYOUT if (istradlayout()) { Xlocate(0, TL_STATUS); Xputterm(L_CLEAR); Xlocate(TC_INFO, TL_STATUS); Xattrputs(TS_INFO, 1); Xlocate(TC_SIZE, TL_STATUS); VOID_C XXcprintf("%<*d", TD_MARK, maxfile); Xattrputs(TS_SIZE, 1); # if FD >= 3 if (sizeunit) VOID_C XXcprintf("%>'*qd", TD_SIZE, totalsize); else # endif VOID_C XXcprintf("%<'*qd", TD_SIZE, totalsize); return; } #endif /* !_NOTRADLAYOUT */ Xlocate(0, L_STATUS); Xputterm(L_CLEAR); Xlocate(C_PAGE, L_STATUS); Xattrputs(S_PAGE, 1); VOID_C XXcprintf("%<*d/%<*d", D_PAGE, filepos / FILEPERPAGE + 1, D_PAGE, (maxfile - 1) / FILEPERPAGE + 1); Xlocate(C_MARK, L_STATUS); Xattrputs(S_MARK, 1); VOID_C XXcprintf("%<*d/%<*d", D_MARK, mark, D_MARK, maxfile); if (!ishardomit()) { Xlocate(C_SORT, L_STATUS); Xattrputs(S_SORT, 1); putsorttype(); } Xlocate(C_FIND, L_STATUS); Xattrputs(S_FIND, 1); if (findpattern) cputstr(D_FIND, findpattern); Xtflush(); } static VOID NEAR stackbar(VOID_A) { #ifndef _NOCOLOR int x, color, bgcolor; #endif int i, width; width = n_column / MAXSTACK; Xlocate(0, L_STACK); #ifndef _NOCOLOR if ((bgcolor = getcolor(CL_BACK)) >= 0) Xchgcolor(bgcolor, 1); x = 0; #endif Xputterm(L_CLEAR); for (i = 0; i < stackdepth; i++) { #ifndef _NOCOLOR if (ansicolor == 2) for (; x < width * i + 1; x++) VOID_C XXputch(' '); else #endif Xlocate(width * i + 1, L_STACK); #ifndef _NOCOLOR color = getcolor(getcolorid(&(filestack[i]))); if (ansicolor && color >= 0) Xchgcolor(color, 1); else #endif Xputterm(T_STANDOUT); cputstr(width - 2, filestack[i].name); #ifndef _NOCOLOR x += width - 2; if (bgcolor >= 0) Xchgcolor(bgcolor, 1); else if (ansicolor) Xputterm(T_NORMAL); else #endif Xputterm(END_STANDOUT); } #ifndef _NOCOLOR if (bgcolor >= 0) { for (; x < n_column; x++) VOID_C XXputch(' '); Xputterm(T_NORMAL); } #endif Xtflush(); } static VOID NEAR cputbytes(size, bsize, width) off_t size, bsize; int width; { off_t n; int len; if (size < (off_t)0) { VOID_C XXcprintf("%*s", width, "?"); return; } n = size * bsize; len = (size > MAXTYPE(off_t) / bsize) ? width : Xfprintf(NULL, "%'qd", n); if (len + W_BYTES <= width) VOID_C XXcprintf("%<'*qd%s", width - W_BYTES, n, S_BYTES); else { n = calcKB(size, bsize); VOID_C XXcprintf("%<>'*qd", width, n); } } static VOID NEAR sizebar(VOID_A) { off_t total, fre, bsize; if (!hassizeinfo() || !*fullpath) return; if (getinfofs(curpath, &total, &fre, &bsize) < 0) total = fre = (off_t)-1; #ifndef _NOTRADLAYOUT if (istradlayout()) { Xlocate(0, TL_SIZE); Xputterm(L_CLEAR); Xlocate(TC_PAGE, TL_SIZE); Xattrputs(TS_PAGE, 1); VOID_C XXcprintf("%<*d/%<*d", TD_PAGE, filepos / FILEPERPAGE + 1, TD_PAGE, (maxfile - 1) / FILEPERPAGE + 1); Xlocate(TC_TOTAL, TL_SIZE); Xattrputs(TS_TOTAL, 1); cputbytes(total, bsize, TD_TOTAL); Xlocate(TC_USED, TL_SIZE); Xattrputs(TS_USED, 1); cputbytes(total - fre, bsize, TD_USED); Xlocate(TC_FREE, TL_SIZE); Xattrputs(TS_FREE, 1); cputbytes(fre, bsize, TD_FREE); return; } #endif /* !_NOTRADLAYOUT */ Xlocate(0, L_SIZE); Xputterm(L_CLEAR); Xlocate(C_SIZE, L_SIZE); Xattrputs(S_SIZE, 1); #if FD >= 3 if (sizeunit) VOID_C XXcprintf("%>'*qd/%>'*qd", D_SIZE, marksize, D_SIZE, totalsize); else #endif VOID_C XXcprintf("%<'*qd/%<'*qd", D_SIZE, marksize, D_SIZE, totalsize); if (!ishardomit()) { Xlocate(C_TOTAL, L_SIZE); Xattrputs(S_TOTAL, 1); cputbytes(total, bsize, D_TOTAL); } if (!iswellomit()) { Xlocate(C_FREE, L_SIZE); Xattrputs(S_FREE, 1); cputbytes(fre, bsize, D_FREE); } Xtflush(); } int putmode(buf, mode, notype) char *buf; u_int mode; int notype; { int i, c; i = 0; if (!notype) { if (!(c = getfsymbol(mode))) c = '-'; buf[i++] = c; } buf[i++] = (mode & S_IRUSR) ? 'r' : '-'; buf[i++] = (mode & S_IWUSR) ? 'w' : '-'; #if MSDOS buf[i++] = (mode & S_IXUSR) ? 'x' : '-'; buf[i++] = (mode & S_ISVTX) ? 'a' : '-'; #else /* !MSDOS */ buf[i++] = (mode & S_ISUID) ? ((mode & S_IXUSR) ? 's' : 'S') : ((mode & S_IXUSR) ? 'x' : '-'); buf[i++] = (mode & S_IRGRP) ? 'r' : '-'; buf[i++] = (mode & S_IWGRP) ? 'w' : '-'; buf[i++] = (mode & S_ISGID) ? ((mode & S_IXGRP) ? 's' : 'S') : ((mode & S_IXGRP) ? 'x' : '-'); buf[i++] = (mode & S_IROTH) ? 'r' : '-'; buf[i++] = (mode & S_IWOTH) ? 'w' : '-'; buf[i++] = (mode & S_ISVTX) ? ((mode & S_IXOTH) ? 't' : 'T') : ((mode & S_IXOTH) ? 'x' : '-'); #endif /* !MSDOS */ buf[i] = '\0'; return(i); } #ifdef HAVEFLAGS int putflags(buf, flags) char *buf; u_long flags; { int i; for (i = 0; i < arraysize(fflaglist); i++) buf[i] = (flags & fflaglist[i]) ? fflagsymlist[i] : '-'; buf[i] = '\0'; return(i); } #endif #ifndef NOUID int putowner(buf, uid) char *buf; u_id_t uid; { uidtable *up; int i, len; i = len = (iswellomit()) ? WOWNERMIN : WOWNER; if (uid == (u_id_t)-1) while (--i >= 0) buf[i] = '?'; else if ((up = finduid(uid, NULL))) VOID_C strncpy2(buf, up -> name, &len, 0); else VOID_C Xsnprintf(buf, len + 1, "%-*d", len, (int)uid); return(len); } int putgroup(buf, gid) char *buf; g_id_t gid; { gidtable *gp; int i, len; i = len = (iswellomit()) ? WGROUPMIN : WGROUP; if (gid == (g_id_t)-1) while (--i >= 0) buf[i] = '?'; else if ((gp = findgid(gid, NULL))) VOID_C strncpy2(buf, gp -> name, &len, 0); else VOID_C Xsnprintf(buf, len + 1, "%-*d", len, (int)gid); return(len); } #endif /* !NOUID */ /*ARGSUSED*/ static int NEAR putsize(buf, n, width, max, sz) char *buf; off_t n; int width, max, sz; { char tmp[MAXLONGWIDTH + 1]; int i, len; if (max > MAXLONGWIDTH) max = MAXLONGWIDTH; #if FD >= 3 if (sz && sizeunit) VOID_C Xsnprintf(tmp, sizeof(tmp), "%>*qd", max, n); else #endif VOID_C Xsnprintf(tmp, sizeof(tmp), "%<*qd", max, n); for (i = max - width; i > 0; i--) if (tmp[i - 1] == ' ') break; len = max - i; Xstrncpy(buf, &(tmp[i]), len); return(len); } static int NEAR putsize2(buf, namep, width) char *buf; namelist *namep; int width; { if (isdir(namep)) VOID_C Xsnprintf(buf, width + 1, "%*.*s", width, width, ""); #if MSDOS else if (s_isfifo(namep)) VOID_C Xsnprintf(buf, width + 1, "%*.*s", width, width, ""); #else /* !MSDOS */ # ifdef DEP_DOSDRIVE else if (dospath2(nullstr) && s_isfifo(namep)) VOID_C Xsnprintf(buf, width + 1, "%*.*s", width, width, ""); # endif else if (isdev(namep)) VOID_C Xsnprintf(buf, width + 1, "%<*lu,%<*lu", width / 2, (u_long)major((u_long)(namep -> st_size)), width - (width / 2) - 1, (u_long)minor((u_long)(namep -> st_size))); #endif /* !MSDOS */ #if FD >= 3 else if (sizeunit) VOID_C Xsnprintf(buf, width + 1, "%>*qd", width, namep -> st_size); #endif else VOID_C Xsnprintf(buf, width + 1, "%<*qd", width, namep -> st_size); return(width); } static int NEAR putfilename(buf, namep, width) char *buf; namelist *namep; int width; { #ifdef NOSYMLINK VOID_C strncpy2(buf, namep -> name, &width, fnameofs); #else /* !NOSYMLINK */ # ifdef DEP_DOSDRIVE char path[MAXPATHLEN]; # endif char *tmp; int i, w, len; i = strncpy2(buf, namep -> name, &width, fnameofs); if (!islink(namep)) return(width); len = fnameofs - strlen3(namep -> name); if (--len < 0) i++; if (--len < 0 && i < width) buf[i++] = '-'; if (--len < 0 && i < width) buf[i++] = '>'; if (--len < 0) { i++; len = 0; } buf += i; if ((w = width - i) <= 0) /*EMPTY*/; # ifndef _NOARCHIVE else if (archivefile) { if (namep -> linkname) VOID_C strncpy2(buf, namep -> linkname, &w, len); } # endif else { tmp = Xmalloc(width * 2 + len + 1); i = Xreadlink(nodospath(path, namep -> name), tmp, width * 2 + len); if (i >= 0) { tmp[i] = '\0'; VOID_C strncpy2(buf, tmp, &w, len); } Xfree(tmp); } #endif /* !NOSYMLINK */ return(width); } static VOID NEAR infobar(VOID_A) { char *buf; struct tm *tm; int len; if (!filelist || maxfile < 0) return; #ifdef DEP_PTY if (parentfd >= 0) return; #endif #ifndef _NOTRADLAYOUT if (istradlayout()) { Xlocate(TC_INFO + TW_INFO, TL_STATUS); cputspace(TD_INFO); Xlocate(TC_INFO + TW_INFO, TL_STATUS); if (filepos >= maxfile) { if (filelist[0].st_nlink < 0 && filelist[0].name) VOID_C Xkanjiputs(filelist[0].name); Xtflush(); return; } len = TD_INFO - (1 + TWSIZE2 + 1 + WDATE + 1 + WTIME + 1 + TWMODE); # ifndef _NOPRECEDE if (!hasstat(&(filelist[filepos]))) { VOID_C kanjiputs2(filelist[filepos].name, len, fnameofs); Xtflush(); return; } # endif buf = Xmalloc(TD_INFO * KANAWID + 1); tm = localtime(&(filelist[filepos].st_mtim)); len = putfilename(buf, &(filelist[filepos]), len); buf[len++] = ' '; len += putsize2(&(buf[len]), &(filelist[filepos]), TWSIZE2); buf[len++] = ' '; VOID_C Xsnprintf(&(buf[len]), WDATE + 1 + WTIME + 1 + 1, "%02d-%02d-%02d %2d:%02d ", tm -> tm_year % 100, tm -> tm_mon + 1, tm -> tm_mday, tm -> tm_hour, tm -> tm_min); len += WDATE + 1 + WTIME + 1; # ifdef HAVEFLAGS if (isfileflg(dispmode)) { len += putflags(&(buf[len]), filelist[filepos].st_flags); while (len < TWMODE) buf[len++] = ' '; } else # endif len += putmode(&(buf[len]), (!isdisplnk(dispmode) && islink(&(filelist[filepos]))) ? (S_IFLNK | 0777) : filelist[filepos].st_mode, 1); VOID_C Xkanjiputs(buf); Xfree(buf); Xtflush(); return; } #endif /* !_NOTRADLAYOUT */ Xlocate(0, L_INFO); Xputterm(L_CLEAR); if (filepos >= maxfile) { if (filelist[0].st_nlink < 0 && filelist[0].name) VOID_C Xkanjiputs(filelist[0].name); Xtflush(); return; } #ifndef _NOPRECEDE if (!hasstat(&(filelist[filepos]))) { len = WMODE + WSIZE2 + 1 + WDATE + 1 + WTIME + 1; if (!ishardomit()) { len += 1 + WNLINK + 1; # ifndef NOUID len += (iswellomit()) ? WOWNERMIN + 1 + WGROUPMIN + 1 : WOWNER + 1 + WGROUP + 1; # endif } Xlocate(len, L_INFO); VOID_C kanjiputs2(filelist[filepos].name, n_lastcolumn - len, fnameofs); Xtflush(); return; } #endif buf = Xmalloc(n_lastcolumn * KANAWID + 1); tm = localtime(&(filelist[filepos].st_mtim)); if (isbestomit()) len = 0; #ifdef HAVEFLAGS else if (isfileflg(dispmode)) { len = putflags(buf, filelist[filepos].st_flags); while (len < WMODE) buf[len++] = ' '; } #endif else len = putmode(buf, (!isdisplnk(dispmode) && islink(&(filelist[filepos]))) ? (S_IFLNK | 0777) : filelist[filepos].st_mode, 0); if (!ishardomit()) { VOID_C Xsnprintf(&(buf[len]), 1 + WNLINK + 1 + 1, " %<*d ", WNLINK, (int)(filelist[filepos].st_nlink)); len += 1 + WNLINK + 1; #ifndef NOUID len += putowner(&(buf[len]), filelist[filepos].st_uid); buf[len++] = ' '; len += putgroup(&(buf[len]), filelist[filepos].st_gid); buf[len++] = ' '; #endif } #if !MSDOS if (isdev(&(filelist[filepos]))) { len += putsize(&(buf[len]), (off_t)major((u_long)(filelist[filepos].st_size)), 3, n_lastcolumn - len, 0); buf[len++] = ','; buf[len++] = ' '; len += putsize(&(buf[len]), (off_t)minor((u_long)(filelist[filepos].st_size)), 3, n_lastcolumn - len, 0); } else #endif len += putsize(&(buf[len]), filelist[filepos].st_size, WSIZE2, n_lastcolumn - len, 1); buf[len++] = ' '; VOID_C Xsnprintf(&(buf[len]), WDATE + 1 + WTIME + 1 + 1, "%02d-%02d-%02d %02d:%02d ", tm -> tm_year % 100, tm -> tm_mon + 1, tm -> tm_mday, tm -> tm_hour, tm -> tm_min); len += WDATE + 1 + WTIME + 1; putfilename(&(buf[len]), &(filelist[filepos]), n_lastcolumn - len); VOID_C Xkanjiputs(buf); Xfree(buf); Xtflush(); } VOID waitmes(VOID_A) { helpbar(); Xlocate(0, L_MESLINE); Xputterm(L_CLEAR); VOID_C Xkanjiputs(WAIT_K); if (win_x >= 0 && win_y >= 0) Xlocate(win_x, win_y); Xtflush(); } int filetop(w) int w; { int n; n = wheader; while (w) n += winvar[--w].v_fileperrow + 1; return(n); } static int NEAR calclocate(n) int n; { #ifndef _NOCOLOR int bgcolor; #endif int col, width; col = n_column; if (ispureshift()) col++; width = col / FILEPERLINE; n %= FILEPERPAGE; calc_x = (n / FILEPERROW) * width; calc_y = n % FILEPERROW + filetop(win); #ifndef _NOCOLOR if ((bgcolor = getcolor(CL_BACK)) >= 0) { Xchgcolor(bgcolor, 1); Xlocate(calc_x, calc_y); if (!isleftshift()) { VOID_C XXputch(' '); calc_x++; } } else #endif { if (!isleftshift()) calc_x++; Xlocate(calc_x, calc_y); } return(width); } #ifdef NOUID #define WIDTH1 (WMODE + 1 + WSECOND + 1) #else #define WIDTH1 (iswellomit() \ ? (WOWNERMIN + 1 + WGROUPMIN + 1 + WMODE + 1 + WSECOND + 1) \ : (WOWNER + 1 + WGROUP + 1 + WMODE + 1 + WSECOND + 1)) #endif #define WIDTH2 (WTIME + 1 + WDATE + 1) #define WIDTH3 (WSIZE + 1) int calcwidth(VOID_A) { int col, w1, width; col = n_column; if (ispureshift()) col++; width = (col / FILEPERLINE) - 2 - 1 + ((isshortwid()) ? 1 : 0); w1 = WIDTH1; if (curcolumns < 2 && width - (w1 + WIDTH2 + WIDTH3) >= minfilename) width -= w1 + WIDTH2 + WIDTH3; else if (curcolumns < 3 && width - (WIDTH2 + WIDTH3) >= minfilename) width -= WIDTH2 + WIDTH3; else if (curcolumns < 4 && width - WIDTH3 >= minfilename) width -= WIDTH3; return(width); } int putname(list, n, isstandout) namelist *list; int n, isstandout; { char *buf; struct tm *tm; int i, j, col, len, wid, width; #ifndef _NOCOLOR int color, bgcolor; #endif col = calclocate(n) - 2 - 1 + ((isshortwid()) ? 1 : 0); width = calcwidth(); VOID_C XXputch(ismark(&(list[n])) ? '*' : ' '); if (list != filelist) { len = strlen3(list[n].name); if (isdisptyp(dispmode) && s_isdir(&(list[n]))) len++; if (col > len) col = len; if (width > len) width = len; } if (isstandout < 0 && stable_standout) { Xputterm(END_STANDOUT); calclocate(n); #ifndef _NOPRECEDE if (!hasstat(&(list[n]))) return(width); #endif return(col); } buf = Xmalloc(col * KANAWID + 1); i = (isstandout && fnameofs > 0) ? fnameofs : 0; wid = width; i = strncpy2(buf, list[n].name, &width, i); #ifndef _NOPRECEDE if (!hasstat(&(list[n]))) { VOID_C Xattrkanjiputs(buf, isstandout > 0); Xfree(buf); return(wid); } #endif if (isdisptyp(dispmode) && i < width) { for (j = 0; j < MODELISTSIZ; j++) if ((list[n].st_mode & S_IFMT) == modelist[j]) break; if (j < SUFFIXLISTSIZ) buf[i] = suffixlist[j]; else if (s_isreg(&(list[n])) && (list[n].st_mode & S_IEXEC_ALL)) buf[i] = '*'; } #ifndef _NOCOLOR if (list == filelist) color = getcolor(getcolorid(&(list[n]))); else color = biascolor(ANSI_FG); #endif len = width; width += col - wid; tm = NULL; if (curcolumns < 5 && len + WIDTH3 <= width) { buf[len++] = ' '; len += putsize2(&(buf[len]), &(list[n]), WSIZE); } if (curcolumns < 3 && len + WIDTH2 <= width) { tm = localtime(&(list[n].st_mtim)); VOID_C Xsnprintf(&(buf[len]), WIDTH2 + 1, " %02d-%02d-%02d %2d:%02d", tm -> tm_year % 100, tm -> tm_mon + 1, tm -> tm_mday, tm -> tm_hour, tm -> tm_min); len += WIDTH2; } if (curcolumns < 2 && len + WIDTH1 <= width) { if (!tm) tm = localtime(&(list[n].st_mtim)); VOID_C Xsnprintf(&(buf[len]), 1 + WSECOND + 1, ":%02d", tm -> tm_sec); len += 1 + WSECOND; buf[len++] = ' '; #ifndef NOUID len += putowner(&(buf[len]), list[n].st_uid); buf[len++] = ' '; len += putgroup(&(buf[len]), list[n].st_gid); buf[len++] = ' '; #endif #ifdef HAVEFLAGS if (isfileflg(dispmode)) { i = putflags(&(buf[len]), list[n].st_flags); while (i < WMODE) buf[len + i++] = ' '; len += i; } else #endif len += putmode(&(buf[len]), (!isdisplnk(dispmode) && islink(&(list[n]))) ? (S_IFLNK | 0777) : list[n].st_mode, 0); } while (len < width) buf[len++] = ' '; buf[len] = '\0'; #ifndef _NOCOLOR if (ansicolor && color >= 0) Xchgcolor(color, isstandout > 0); else #endif if (isstandout > 0) Xputterm(T_STANDOUT); VOID_C Xkanjiputs(buf); Xfree(buf); #ifndef _NOCOLOR if ((bgcolor = getcolor(CL_BACK)) >= 0) { Xchgcolor(bgcolor, 1); VOID_C XXputch(' '); } if (ansicolor) Xputterm(T_NORMAL); else #endif if (isstandout > 0) Xputterm(END_STANDOUT); return(col); } VOID setlastfile(cp) CONST char *cp; { Xfree(lastfile); lastfile = Xstrdup(cp); } static int NEAR calcfilepos(list, max, def) namelist *list; int max; CONST char *def; { int i; if (def) for (i = 0; i < max; i++) if (!strpathcmp(def, list[i].name)) return(i); if (list == filelist && max > 1 && isdotdir(list[1].name) == 1) return(1); return(0); } int listupfile(list, max, def, isstandout) namelist *list; int max; CONST char *def; int isstandout; { CONST char *cp; int i, n, pos; for (i = 0; i < FILEPERROW; i++) { Xlocate(0, i + filetop(win)); Xputterm(L_CLEAR); } if (!list || max <= 0) { i = (n_column / FILEPERLINE) - 2 - 1; Xlocate(1, filetop(win)); VOID_C XXputch(' '); cp = NOFIL_K; if (i <= strlen2(cp)) cp = "NoFiles"; attrputstr(i, cp, isstandout); win_x = calc_x = i + 2; win_y = calc_y = filetop(win); return(0); } pos = calcfilepos(list, max, def); if (list == filelist) { #ifndef _NOTRADLAYOUT if (istradlayout()) { Xlocate(TC_PAGE + TW_PAGE, TL_SIZE); VOID_C XXcprintf("%<*d", TD_PAGE, pos / FILEPERPAGE + 1); } else #endif { Xlocate(C_PAGE + W_PAGE, L_STATUS); VOID_C XXcprintf("%<*d", D_PAGE, pos / FILEPERPAGE + 1); } } n = (pos / FILEPERPAGE) * FILEPERPAGE; for (i = 0; i < FILEPERPAGE; i++, n++) { if (n >= max) break; if (!isstandout || n != pos) putname(list, n, 0); else { calc_x += putname(list, n, 1) + 1; win_x = calc_x; win_y = calc_y; } } calc_x = win_x; calc_y = win_y; return(pos); } static int NEAR listupmyself(def) CONST char *def; { #ifndef _NOTREE if (treepath) rewritetree(); else #endif #ifndef _NOCUSTOMIZE if (custno >= 0) rewritecust(); else #endif #ifdef DEP_PTY if (ptylist[win].pid && ptylist[win].status < 0) /*EMPTY*/; else #endif if (filelist && (filepos < maxfile || (!filepos && !maxfile))) return(listupfile(filelist, maxfile, def, 1)); return(-1); } #ifndef _NOSPLITWIN static int NEAR listupwin(def) CONST char *def; { CONST char *file; int i, x, y, n, dupwin; dupwin = win; y = wheader + winvar[0].v_fileperrow; for (n = 1; n < windows; n++) { Xlocate(0, y); Xputterm(L_CLEAR); VOID_C XXputch(' '); for (i = 2; i < n_column; i++) VOID_C XXputch('-'); y += winvar[n].v_fileperrow + 1; } for (; y < L_STACK; y++) { Xlocate(0, y); Xputterm(L_CLEAR); } # ifdef FAKEUNINIT x = y = -1; /* fake for -Wuninitialized */ # endif n = -1; for (win = 0; win < windows; win++) { if (win == dupwin) { n = listupmyself(def); x = win_x; y = win_y; continue; } # ifdef DEP_PTY if (ptylist[win].pid && ptylist[win].status < 0) continue; # endif if (!filelist) continue; if ((file = lastfile)) /*EMPTY*/; else if (filepos < maxfile || (!filepos && !maxfile)) file = filelist[filepos].name; VOID_C listupfile(filelist, maxfile, file, 0); } win = dupwin; win_x = x; win_y = y; return(n); } int shutwin(n) int n; { int i, dupwin; dupwin = win; win = n; # ifndef _NOARCHIVE while (archivefile) escapearch(1); Xfree(winvar[win].v_archivedir); winvar[win].v_archivedir = NULL; # endif /* !_NOARCHIVE */ Xfree(winvar[win].v_fullpath); winvar[win].v_fullpath = NULL; setlastfile(NULL); if (filelist) { for (i = 0; i < maxfile; i++) Xfree(filelist[i].name); Xfree(filelist); filelist = NULL; } maxfile = maxent = filepos = sorton = dispmode = 0; Xfree(findpattern); findpattern = NULL; # ifdef DEP_PTY killpty(win, NULL); # endif win = dupwin; return(n); } #endif /* !_NOSPLITWIN */ VOID calcwin(VOID_A) { int i, row; row = fileperrow(windows); winvar[windows - 1].v_fileperrow = fileperrow(1); for (i = 0; i < windows - 1; i++) { winvar[i].v_fileperrow = row; winvar[windows - 1].v_fileperrow -= row + 1; } for (i = windows; i < MAXWINDOWS; i++) winvar[i].v_fileperrow = 0; } VOID movepos(old, funcstat) int old, funcstat; { #ifndef _NOSPLITWIN if (rewritemode(funcstat) >= FN_REWIN) { filepos = listupwin(filelist[filepos].name); keyflush(); } else #endif if (rewritemode(funcstat) >= FN_RELIST || old / FILEPERPAGE != filepos / FILEPERPAGE) { filepos = listupfile(filelist, maxfile, filelist[filepos].name, 1); keyflush(); } else if (rewritemode(funcstat) >= FN_REWRITE || old != filepos) { if (old != filepos) putname(filelist, old, -1); calc_x += putname(filelist, filepos, 1) + 1; win_x = calc_x; win_y = calc_y; } infobar(); } VOID rewritefile(all) int all; { int x, y; if (!filelist || maxfile < 0) return; #ifdef DEP_PTY if (parentfd >= 0) return; #endif x = win_x; y = win_y; if (all > 0) { title(); helpbar(); infobar(); } sizebar(); statusbar(); stackbar(); #ifndef _NOARCHIVE if (archivefile) archbar(archivefile, archivedir); else #endif pathbar(); if (all >= 0) { #ifdef _NOSPLITWIN VOID_C listupmyself(filelist[filepos].name); #else VOID_C listupwin(filelist[filepos].name); #endif } if (!all) { win_x = x; win_y = y; } Xlocate(win_x, win_y); Xtflush(); } static int NEAR searchmove(ch, buf) int ch; char *buf; { CONST char *str[4]; int i, n, s, pos, len, func; if (isearch > 0) { n = isearch; s = 1; } else { n = -isearch; s = -1; } len = strlen(buf); pos = filepos; for (i = 0; i < maxbind; i++) if (ch == (int)(bindlist[i].key)) break; func = (i < maxbind) ? ffunc(i) : -1; if (ch == K_BS) { if (!len) isearch = 0; else buf[--len] = '\0'; } else if (len && func == SEARCH_FORW) { if (n > 2) pos++; else if (n > 1) pos = 0; s = 1; } else if (len && func == SEARCH_BACK) { if (n > 2) pos--; else if (n > 1) pos = maxfile - 1; s = -1; } else { if (n == 1) buf[len = 0] = '\0'; if (Xiscntrl(ch) || ch >= K_MIN) isearch = 0; else if (len < MAXNAMLEN - 1) { buf[len++] = ch; buf[len] = '\0'; } } if (!isearch) { helpbar(); search_x = search_y = -1; win_x = calc_x; win_y = calc_y; if (ch == K_CR) return(-1); else if (ch != K_ESC) Xputterm(T_BELL); return(0); } Xlocate(0, L_HELP); str[0] = SEAF_K; str[1] = SEAFF_K; str[2] = SEAB_K; str[3] = SEABF_K; i = 0; if (pos >= 0 && pos < maxfile) for (;;) { if (!strnpathcmp2(filelist[pos].name, buf, len)) { i = 1; break; } pos += s; if (pos < 0 || pos >= maxfile) break; } search_x = len; len = Xattrkanjiputs(str[2 - s - i], 1); cputstr(n_column - len - 1, buf); if ((search_x += len) >= n_column) search_x = n_column - 1; search_y = L_HELP; if (i) filepos = pos; else if (n != 2 && ch != K_BS) Xputterm(T_BELL); isearch = s * (i + 2); return(i); } #ifndef _NOPRECEDE static int readstatus(VOID_A) { int i; for (i = maxstat; i < maxfile; i++) if (!hasstat(&(filelist[i]))) break; if (i >= maxfile) return(0); maxstat = i + 1; if (getstatus(&(filelist[i])) < 0) return(0); if (keywaitfunc != readstatus) return(0); if (isfile(&(filelist[i])) && filelist[i].st_size) sizebar(); if (i == filepos) { calc_x += putname(filelist, i, 1) + 1; win_x = calc_x; win_y = calc_y; infobar(); } else if (i / FILEPERPAGE == filepos / FILEPERPAGE) putname(filelist, i, 0); Xlocate(win_x, win_y); Xtflush(); return(0); } #endif /* !_NOPRECEDE */ static int NEAR readfilelist(re, arcre) CONST reg_ex_t *re; CONST char *arcre; { #ifndef _NOPRECEDE char cwd[MAXPATHLEN]; #endif DIR *dirp; struct dirent *dp; char buf[MAXNAMLEN + 1]; int i, n; n = 0; #ifndef _NOPRECEDE if (Xgetwd(cwd) && includepath(cwd, precedepath)) { n = 1; sorton = 0; } #endif if (!(dirp = Xopendir(curpath))) { lostcwd(NULL); if (!(dirp = Xopendir(curpath))) error(curpath); } while ((dp = searchdir(dirp, re, arcre))) { if (ishidedot(dispmode) && *(dp -> d_name) == '.' && !isdotdir(dp -> d_name)) continue; Xstrcpy(buf, dp -> d_name); for (i = 0; i < stackdepth; i++) if (!strcmp(buf, filestack[i].name)) break; if (i < stackdepth) continue; filelist = addlist(filelist, maxfile, &maxent); filelist[maxfile].name = Xstrdup(buf); #ifndef NOSYMLINK filelist[maxfile].linkname = NULL; #endif filelist[maxfile].ent = maxfile; filelist[maxfile].tmpflags = 0; #ifndef _NOPRECEDE if (n) { if (isdotdir(dp -> d_name)) { filelist[maxfile].flags = F_ISDIR; filelist[maxfile].st_mode = S_IFDIR; } } else #endif if (getstatus(&(filelist[maxfile])) < 0) { Xfree(filelist[maxfile].name); continue; } maxfile++; } VOID_C Xclosedir(dirp); return(n); } VOID getfilelist(VOID_A) { reg_ex_t *re; char *arcre; re = NULL; arcre = NULL; if (findpattern) { #ifndef _NOARCHIVE if (*findpattern == '/') arcre = &(findpattern[1]); else #endif re = regexp_init(findpattern, -1); } maxfile = 0; #ifndef _NOARCHIVE if (archivefile) { blocksize = (off_t)1; if (sorttype < 100) sorton = 0; copyarcf(re, arcre); } else #endif { blocksize = getblocksize(curpath); if (sorttype < 100) sorton = sorttype; if (readfilelist(re, arcre)) { #ifndef _NOPRECEDE haste = 1; sorton = 0; #endif } } regexp_free(re); if (!maxfile) { filelist = addlist(filelist, maxfile, &maxent); filelist[0].name = (char *)NOFIL_K; #ifndef NOSYMLINK filelist[0].linkname = NULL; #endif filelist[0].tmpflags = 0; filelist[0].st_nlink = -1; } #ifndef _NOPRECEDE maxstat = (haste) ? 0 : maxfile; #endif if (sorton) qsort(filelist, maxfile, sizeof(namelist), cmplist); } static int NEAR getfuncno(ch) int ch; { int n; #if FD >= 3 if (ch == K_TIMEOUT) return(REREAD_DIR); #endif for (n = 0; n < maxbind; n++) if (ch == (int)(bindlist[n].key)) break; if (n >= maxbind) return(NO_OPERATION); #ifndef _NOPRECEDE if (haste && !hasstat(&(filelist[filepos])) && (hasdfunc(n) || (funclist[ffunc(n)].status & FN_NEEDSTATUS)) && getstatus(&(filelist[filepos])) < 0) return(WARNING_BELL); #endif if (hasdfunc(n) && isdir(&(filelist[filepos]))) return(dfunc(n)); return(ffunc(n)); } int dointernal(no, arg, mode, statp) int no; CONST char *arg; int mode, *statp; { int n, stat; stat = (FN_KILLSTACK | FN_RESCREEN | FN_REWIN); if (no < FUNCLISTSIZ) stat = funclist[no].status; if (statp) *statp = stat; if (maxfile <= 0 && !(stat & FN_NOFILE)) return(FNC_NONE); #ifndef _NOARCHIVE if (!archivefile) /*EMPTY*/; else if (no >= FUNCLISTSIZ || !(stat & FN_ARCHIVE)) return(FNC_NONE); #endif if (fd_restricted && (stat & FN_RESTRICT)) { warning(0, RESTR_K); return(FNC_NONE); } if (!(stat & FN_KILLSTACK)) /*EMPTY*/; else if (stackdepth > 0) { chgorder = 0; if (!yesno(KILOK_K)) return(FNC_NONE); for (n = maxfile - 1; n > filepos; n--) memcpy((char *)&(filelist[n + stackdepth]), (char *)&(filelist[n]), sizeof(namelist)); for (n = 0; n < stackdepth; n++) memcpy((char *)&(filelist[n + filepos + 1]), (char *)&(filestack[n]), sizeof(namelist)); maxfile += stackdepth; stackdepth = 0; filepos = listupfile(filelist, maxfile, filelist[filepos].name, 1); stackbar(); } #ifndef _NOWRITEFS # ifndef _NOARCHIVE else if (archivefile) /*EMPTY*/; # endif else if (!chgorder || writefs >= 1 || no == WRITE_DIR) /*EMPTY*/; else if (fd_restricted) /*EMPTY*/; else if ((n = writablefs(curpath)) > 0 && underhome(NULL) > 0) { chgorder = 0; if (yesno(WRTOK_K)) arrangedir(n); } #endif /* !_NOWRITEFS */ if (no < FUNCLISTSIZ) { if (mode == ICM_BINDKEY) arg = NULL; no = (*funclist[no].func)(arg); if (mode != ICM_CMDLINE) /*EMPTY*/; else if (no < FNC_NONE || no >= FNC_EFFECT) internal_status = no; } else { no = evalstatus(ptyusercomm(getmacro(no), arg, 0)); #ifdef DEP_PTY if (ptymode && isearch) no = FNC_NONE; #endif } return(no); } static int NEAR browsedir(VOID_A) { #ifndef _NOPRECEDE int dupsorton; #endif char buf[MAXNAMLEN + 1]; int ch, i, no, old, funcstat; #ifndef _NOPRECEDE haste = 0; dupsorton = sorton; #endif #ifndef _NOCOLOR if (ansicolor) Xputterm(T_NORMAL); #endif mark = 0; totalsize = marksize = (off_t)0; chgorder = 0; fnameofs = 0; win_x = win_y = 0; waitmes(); getfilelist(); for (i = 0; i < maxfile; i++) { if (!isfile(&(filelist[i])) || !filelist[i].st_size) continue; totalsize += getblock(filelist[i].st_size); if (ismark(&(filelist[i]))) marksize += getblock(filelist[i].st_size); } Xlocate(0, L_INFO); Xputterm(L_CLEAR); title(); helpbar(); rewritefile(-1); #ifdef _NOSPLITWIN old = filepos = listupfile(filelist, maxfile, lastfile, 1); #else old = filepos = listupwin(lastfile); #endif funcstat = 0; no = FNC_CANCEL; keyflush(); buf[0] = '\0'; for (;;) { if (no) movepos(old, funcstat); if (search_x >= 0 && search_y >= 0) { win_x = search_x; win_y = search_y; } Xlocate(win_x, win_y); Xtflush(); #ifndef _NOPRECEDE if (haste) keywaitfunc = readstatus; #endif Xgetkey(-1, 0, 0); ch = Xgetkey(1, 0, autoupdate); Xgetkey(-1, 0, 0); #ifndef _NOPRECEDE keywaitfunc = NULL; #endif old = filepos; if (isearch) { #if FD >= 3 if (ch == K_TIMEOUT) { no = FNC_NONE; continue; } #endif no = searchmove(ch, buf); if (no >= 0) { fnameofs = 0; continue; } } curfilename = filelist[filepos].name; setlastfile(NULL); lostcount = 0; no = dointernal(getfuncno(ch), filelist[filepos].name, ICM_BINDKEY, &funcstat); #ifdef DEP_PTY while (ptylist[win].pid && ptylist[win].status < 0) { VOID_C frontend(); no = FNC_UPDATE; funcstat &= ~FN_REWRITEMODE; funcstat |= FN_REWIN; } #endif /* DEP_PTY */ #ifndef _NOPRECEDE if (sorton) haste = 0; #endif if (no < FNC_NONE || no >= FNC_EFFECT) break; if (no == FNC_CANCEL && lostcount > 0) break; if (no == FNC_CANCEL || no == FNC_HELPSPOT) helpbar(); if (no < FNC_UPDATE) { funcstat = 0; continue; } if (rewritemode(funcstat) != FN_REWRITE || old != filepos) fnameofs = 0; if (funcstat & FN_RESCREEN) { title(); helpbar(); rewritefile(-1); } } if (no >= FNC_EFFECT) { if (lastfile) /*EMPTY*/; else if (filepos >= maxfile) setlastfile(curpath); else setlastfile(filelist[filepos].name); } #ifndef _NOARCHIVE else if (archivefile && no < FNC_NONE) { setlastfile(archivefile); escapearch(1); if (no > FNC_FAIL) no = FNC_NONE; } #endif #ifndef _NOARCHIVE if (archivefile) /*EMPTY*/; else #endif for (i = 0; i < maxfile; i++) { Xfree(filelist[i].name); filelist[i].name = NULL; } maxfile = filepos = 0; #ifndef _NOPRECEDE if (haste && !sorton) sorton = dupsorton; #endif return(no); } static VOID NEAR initcwd(path, internal) CONST char *path; int internal; { #if MSDOS int i; #endif char *cp, *file, buf[MAXPATHLEN]; if (!path) return; cp = Xstrdup(path); #ifdef DEP_FILECONV if (!internal) renewkanjiconv(&cp, getkcode(cp), DEFCODE, L_FNAME); #endif #if FD >= 2 if (thruargs) /*EMPTY*/; else #endif if (!internal) cp = evalpath(cp, 0); #if MSDOS if (_dospath(cp)) { if (setcurdrv(*cp, 0) >= 0 && !Xgetwd(fullpath)) error("getwd()"); for (i = 0; cp[i + 2]; i++) cp[i] = cp[i + 2]; cp[i] = '\0'; } #endif /* !MSDOS */ if (chdir2(cp) >= 0) { Xfree(cp); return; } file = strrdelim(cp, 0); #ifdef DEP_DOSEMU if (!file && dospath2(cp)) file = &(cp[2]); #endif if (!file) { setlastfile(cp); Xfree(cp); return; } if (file == cp) copyrootpath(buf); else VOID_C Xstrncpy(buf, cp, file - cp); if (*file == _SC_) file++; if (chdir2(buf) < 0) { hideclock = 2; warning(-1, buf); #if MSDOS Xstrcpy(fullpath, origpath); #endif Xfree(cp); return; } setlastfile(file); Xfree(cp); } VOID main_fd(pathlist, internal) char *CONST *pathlist; int internal; { char *cwd; int n, argc; if (!pathlist) argc = 0; else for (argc = 0; argc < MAXINVOKEARGS; argc++) if (!pathlist[argc]) break; cwd = getwd2(); for (n = MAXWINDOWS - 1; n >= 0; n--) { #ifndef _NOSPLITWIN win = n; winvar[n].v_fullpath = NULL; # ifndef _NOARCHIVE winvar[n].v_archivedir = NULL; # endif #endif /* !_NOSPLITWIN */ #ifdef DEP_PTY ptylist[n].pid = (p_id_t)0; ptylist[n].path = NULL; ptylist[n].fd = ptylist[n].pipe = -1; ptylist[n].status = 0; #endif #ifndef _NOARCHIVE archduplp = NULL; archivefile = NULL; archtmpdir = NULL; launchp = NULL; arcflist = NULL; maxarcf = 0; # ifdef DEP_DOSDRIVE archdrive = 0; # endif # ifndef _NOBROWSE browselist = NULL; browselevel = 0; # endif #endif /* !_NOARCHIVE */ #ifndef _NOTREE treepath = NULL; #endif lastfile = NULL; findpattern = NULL; filelist = NULL; maxfile = maxent = filepos = 0; sorton = sorttype % 100; dispmode = displaymode; curcolumns = defcolumns; FILEPERROW = 0; if (n >= argc) continue; chdir2(cwd); initcwd(pathlist[n], internal); #ifndef _NOSPLITWIN winvar[n].v_fullpath = Xstrdup(fullpath); if (n) { getfilelist(); sorton = sorttype % 100; filepos = calcfilepos(filelist, maxfile, lastfile); } #endif } #ifndef _NOSPLITWIN windows = 1; win = 0; while (windows < argc) { if (fileperrow(windows + 1) < WFILEMIN) { hideclock = 2; warning(0, NOROW_K); for (n = windows; n < argc; n++) shutwin(n); break; } windows++; } #endif /* !_NOSPLITWIN */ calcwin(); _chdir2(fullpath); for (;;) { if ((n = browsedir()) >= FNC_NONE) continue; if (n > FNC_FAIL) chdir2(cwd); break; } Xfree(cwd); #ifdef _NOSPLITWIN Xfree(filelist); Xfree(findpattern); #else for (n = 0; n < MAXWINDOWS; n++) shutwin(n); windows = 1; win = 0; calcwin(); #endif #ifdef DEP_PTY killallpty(); #endif Xlocate(0, n_line - 1); Xtflush(); } FD-3.01j/evalopt.c100644 2105 1751 3314 13516612560 12500 0ustar shiraiuser/* * evalopt.c * * option arguments parser */ #include "headers.h" #include "evalopt.h" static CONST opt_t *NEAR getoption __P_((int, CONST opt_t *)); static CONST opt_t *NEAR getoption(c, optlist) int c; CONST opt_t *optlist; { int n; if (!optlist) return(NULL); for (n = 0; optlist[n].opt; n++) if (c == optlist[n].opt) return(&(optlist[n])); return(NULL); } VOID initopt(optlist) CONST opt_t *optlist; { int n; if (!optlist) return; for (n = 0; optlist[n].opt; n++) if (optlist[n].var) *(optlist[n].var) = 0; } VOID optusage(arg0, args, optlist) CONST char *arg0, *args; CONST opt_t *optlist; { int n; VOID_C fprintf(stderr, "Usage: %s", arg0); n = 0; if (optlist) while (optlist[n].opt) n++; if (n > 0) { VOID_C fputs(" [-", stderr); for (n = 0; optlist[n].opt; n++) { VOID_C fputc(optlist[n].opt, stderr); if (!(optlist[n].argval)) continue; VOID_C fprintf(stderr, " <%s>", optlist[n].argval); if (optlist[n + 1].opt) VOID_C fputs(" [-", stderr); } VOID_C fputc(']', stderr); } VOID_C fprintf(stderr, " %s\n", args); } int evalopt(argc, argv, optlist) int argc; char *CONST *argv; CONST opt_t *optlist; { CONST char *cp; CONST opt_t *optp; int i, n, val; for (n = 1; n < argc; n++) { if (argv[n][0] != '-' || !argv[n][1]) break; if (argv[n][1] == '=' && !argv[n][2]) { n++; break; } for (i = 1; argv[n][i]; i++) { if (!(optp = getoption(argv[n][i], optlist))) return(-1); if (!(optp -> argval)) { if (optp -> var) *(optp -> var) = optp -> val; } else { cp = &(argv[n][++i]); if (!*cp) cp = argv[++n]; if (!cp || (val = atoi(cp)) <= 0) return(-1); if (optp -> var) *(optp -> var) = val; break; } } } return(n); } FD-3.01j/gentbl.c100644 2105 1751 4737 13516612560 12313 0ustar shiraiuser/* * gentbl.c * * table generator module */ #include "headers.h" #include "gentbl.h" #define MAXBYTES 8 int textmode = 0; static int textlen = 0; static int textnext = 0; FILE *opentbl(path) CONST char *path; { FILE *fp; if (!(fp = fopen(path, (textmode) ? "w" : "wb"))) { VOID_C fprintf(stderr, "%s: Cannot open.\n", path); return(NULL); } return(fp); } int fputheader(name, fp) CONST char *name; FILE *fp; { if (!textmode) return(0); if (fprintf(fp, "#include \"%s.h\"\n", name) < 0 && ferror(fp)) return(-1); return(0); } int fputbegin(name, fp) CONST char *name; FILE *fp; { if (!textmode) return(0); textnext = textlen = 0; if (fprintf(fp, "CONST u_char %s[] = {", name) < 0 && ferror(fp)) return(-1); return(0); } int fputend(fp) FILE *fp; { if (!textmode) return(0); if (!textnext) { fputbyte('\0', fp); VOID_C fputs("\t/* dummy entry */", fp); } return((fputs("\n};\n", fp) == EOF && ferror(fp)) ? -1 : 0); } int fputbyte(c, fp) int c; FILE *fp; { CONST char *sep1, *sep2; if (!textmode) return((fputc(c, fp) == EOF && ferror(fp)) ? -1 : 0); sep1 = (textnext) ? "," : ""; sep2 = (textlen) ? " " : "\n\t"; textnext = 1; if (++textlen >= MAXBYTES) textlen = 0; if (fprintf(fp, "%s%s0x%02x", sep1, sep2, c & 0xff) < 0 && ferror(fp)) return(-1); return(0); } int fputword(w, fp) u_int w; FILE *fp; { if (fputbyte((int)(w & 0xff), fp) < 0 || fputbyte((int)((w >> 8) & 0xff), fp) < 0) return(-1); return(0); } int fputdword(dw, fp) long dw; FILE *fp; { if (fputword((u_int)(dw & 0xffff), fp) < 0 || fputword((u_int)((dw >> 16) & 0xffff), fp) < 0) return(-1); return(0); } int fputbuf(buf, size, fp) CONST u_char *buf; ALLOC_T size; FILE *fp; { ALLOC_T n; if (!textmode) { if (fwrite(buf, size, (ALLOC_T)1, fp) != (ALLOC_T)1) return(-1); } else for (n = (ALLOC_T)0; n < size; n++) if (fputbyte((int)(buf[n]), fp) < 0) return(-1); return(0); } int fputlength(name, len, fp, width) CONST char *name; long len; FILE *fp; int width; { CONST char *cp; if (!textmode) { switch (width) { case 2: if (fputword(len, fp) < 0) return(-1); break; case 4: if (fputdword(len, fp) < 0) return(-1); break; default: if (fputbyte(len, fp) < 0) return(-1); break; } return(0); } switch (width) { case 2: cp = "u_int"; break; case 4: cp = "long"; break; default: cp = "int"; break; } if (fprintf(fp, "%s %s = %ld;\n", cp, name, len) < 0 && ferror(fp)) return(-1); return(0); } FD-3.01j/mkunitbl.c100644 2105 1751 636233 13516612560 12727 0ustar shiraiuser/* * mkunitbl.c * * Unicode table generator */ #include "headers.h" #include "typesize.h" #include "evalopt.h" #include "gentbl.h" #define USERDEFINE #define MAXNFLEN 4 #define NFTABLES 2 typedef struct _convtable { u_short unicode; u_short org; } convtable; typedef struct _nftable { u_short unicode; u_short normalization[MAXNFLEN + 1]; } nftable; static int cmpuni __P_((CONST VOID_P, CONST VOID_P)); static int cmpnf __P_((CONST VOID_P, CONST VOID_P)); static int NEAR fputunilist __P_((convtable [], u_int, FILE *)); static int NEAR fputnflist __P_((CONST char *, nftable [], u_int, FILE *)); static int NEAR fputarray __P_((CONST char *, VOID_P, FILE *, int)); static int NEAR mkunitbl __P_((FILE *)); int main __P_((int, char *CONST [])); static CONST char *tblname[NFTABLES]; static u_int tblent[NFTABLES]; static int nfent = 0; static int nocontent = 0; static CONST opt_t optlist[] = { {'t', &textmode, 1, NULL}, {'n', &nocontent, 1, NULL}, {'\0', NULL, 0, NULL}, }; static convtable unilist[] = { {0x00a7, 0x8198}, {0x00a8, 0x814e}, {0x00b0, 0x818b}, {0x00b1, 0x817d}, {0x00b4, 0x814c}, {0x00b6, 0x81f7}, {0x00d7, 0x817e}, {0x00f7, 0x8180}, {0x0391, 0x839f}, {0x0392, 0x83a0}, {0x0393, 0x83a1}, {0x0394, 0x83a2}, {0x0395, 0x83a3}, {0x0396, 0x83a4}, {0x0397, 0x83a5}, {0x0398, 0x83a6}, {0x0399, 0x83a7}, {0x039a, 0x83a8}, {0x039b, 0x83a9}, {0x039c, 0x83aa}, {0x039d, 0x83ab}, {0x039e, 0x83ac}, {0x039f, 0x83ad}, {0x03a0, 0x83ae}, {0x03a1, 0x83af}, {0x03a3, 0x83b0}, {0x03a4, 0x83b1}, {0x03a5, 0x83b2}, {0x03a6, 0x83b3}, {0x03a7, 0x83b4}, {0x03a8, 0x83b5}, {0x03a9, 0x83b6}, {0x03b1, 0x83bf}, {0x03b2, 0x83c0}, {0x03b3, 0x83c1}, {0x03b4, 0x83c2}, {0x03b5, 0x83c3}, {0x03b6, 0x83c4}, {0x03b7, 0x83c5}, {0x03b8, 0x83c6}, {0x03b9, 0x83c7}, {0x03ba, 0x83c8}, {0x03bb, 0x83c9}, {0x03bc, 0x83ca}, {0x03bd, 0x83cb}, {0x03be, 0x83cc}, {0x03bf, 0x83cd}, {0x03c0, 0x83ce}, {0x03c1, 0x83cf}, {0x03c3, 0x83d0}, {0x03c4, 0x83d1}, {0x03c5, 0x83d2}, {0x03c6, 0x83d3}, {0x03c7, 0x83d4}, {0x03c8, 0x83d5}, {0x03c9, 0x83d6}, {0x0401, 0x8446}, {0x0410, 0x8440}, {0x0411, 0x8441}, {0x0412, 0x8442}, {0x0413, 0x8443}, {0x0414, 0x8444}, {0x0415, 0x8445}, {0x0416, 0x8447}, {0x0417, 0x8448}, {0x0418, 0x8449}, {0x0419, 0x844a}, {0x041a, 0x844b}, {0x041b, 0x844c}, {0x041c, 0x844d}, {0x041d, 0x844e}, {0x041e, 0x844f}, {0x041f, 0x8450}, {0x0420, 0x8451}, {0x0421, 0x8452}, {0x0422, 0x8453}, {0x0423, 0x8454}, {0x0424, 0x8455}, {0x0425, 0x8456}, {0x0426, 0x8457}, {0x0427, 0x8458}, {0x0428, 0x8459}, {0x0429, 0x845a}, {0x042a, 0x845b}, {0x042b, 0x845c}, {0x042c, 0x845d}, {0x042d, 0x845e}, {0x042e, 0x845f}, {0x042f, 0x8460}, /* Russian small letter, unused in LFN */ {0x0430, 0x8470}, {0x0431, 0x8471}, {0x0432, 0x8472}, {0x0433, 0x8473}, {0x0434, 0x8474}, {0x0435, 0x8475}, {0x0436, 0x8477}, {0x0437, 0x8478}, {0x0438, 0x8479}, {0x0439, 0x847a}, {0x043a, 0x847b}, {0x043b, 0x847c}, {0x043c, 0x847d}, {0x043d, 0x847e}, {0x043e, 0x8480}, {0x043f, 0x8481}, {0x0440, 0x8482}, {0x0441, 0x8483}, {0x0442, 0x8484}, {0x0443, 0x8485}, {0x0444, 0x8486}, {0x0445, 0x8487}, {0x0446, 0x8488}, {0x0447, 0x8489}, {0x0448, 0x848a}, {0x0449, 0x848b}, {0x044a, 0x848c}, {0x044b, 0x848d}, {0x044c, 0x848e}, {0x044d, 0x848f}, {0x044e, 0x8490}, {0x044f, 0x8491}, {0x0451, 0x8476}, {0x2010, 0x815d}, {0x2015, 0x815c}, {0x2018, 0x8165}, {0x2019, 0x8166}, {0x201c, 0x8167}, {0x201d, 0x8168}, {0x2020, 0x81f5}, {0x2021, 0x81f6}, {0x2025, 0x8164}, {0x2026, 0x8163}, {0x2030, 0x81f1}, {0x2032, 0x818c}, {0x2033, 0x818d}, {0x203b, 0x81a6}, {0x2103, 0x818e}, {0x2116, 0xfa59}, {0x2121, 0xfa5a}, {0x212b, 0x81f0}, {0x2160, 0xfa4a}, {0x2161, 0xfa4b}, {0x2162, 0xfa4c}, {0x2163, 0xfa4d}, {0x2164, 0xfa4e}, {0x2165, 0xfa4f}, {0x2166, 0xfa50}, {0x2167, 0xfa51}, {0x2168, 0xfa52}, {0x2169, 0xfa53}, {0x2170, 0xfa40}, {0x2171, 0xfa41}, {0x2172, 0xfa42}, {0x2173, 0xfa43}, {0x2174, 0xfa44}, {0x2175, 0xfa45}, {0x2176, 0xfa46}, {0x2177, 0xfa47}, {0x2178, 0xfa48}, {0x2179, 0xfa49}, {0x2190, 0x81a9}, {0x2191, 0x81aa}, {0x2192, 0x81a8}, {0x2193, 0x81ab}, {0x21d2, 0x81cb}, {0x21d4, 0x81cc}, {0x2200, 0x81cd}, {0x2202, 0x81dd}, {0x2203, 0x81ce}, {0x2207, 0x81de}, {0x2208, 0x81b8}, {0x220b, 0x81b9}, {0x2211, 0x8794}, {0x221a, 0x81e3}, {0x221d, 0x81e5}, {0x221e, 0x8187}, {0x221f, 0x8798}, {0x2220, 0x81da}, {0x2225, 0x8161}, {0x2227, 0x81c8}, {0x2228, 0x81c9}, {0x2229, 0x81bf}, {0x222a, 0x81be}, {0x222b, 0x81e7}, {0x222c, 0x81e8}, {0x222e, 0x8793}, {0x2234, 0x8188}, {0x2235, 0x81e6}, {0x223d, 0x81e4}, {0x2252, 0x81e0}, {0x2260, 0x8182}, {0x2261, 0x81df}, {0x2266, 0x8185}, {0x2267, 0x8186}, {0x226a, 0x81e1}, {0x226b, 0x81e2}, {0x2282, 0x81bc}, {0x2283, 0x81bd}, {0x2286, 0x81ba}, {0x2287, 0x81bb}, {0x22a5, 0x81db}, {0x22bf, 0x8799}, {0x2312, 0x81dc}, {0x2460, 0x8740}, {0x2461, 0x8741}, {0x2462, 0x8742}, {0x2463, 0x8743}, {0x2464, 0x8744}, {0x2465, 0x8745}, {0x2466, 0x8746}, {0x2467, 0x8747}, {0x2468, 0x8748}, {0x2469, 0x8749}, {0x246a, 0x874a}, {0x246b, 0x874b}, {0x246c, 0x874c}, {0x246d, 0x874d}, {0x246e, 0x874e}, {0x246f, 0x874f}, {0x2470, 0x8750}, {0x2471, 0x8751}, {0x2472, 0x8752}, {0x2473, 0x8753}, {0x2500, 0x849f}, {0x2501, 0x84aa}, {0x2502, 0x84a0}, {0x2503, 0x84ab}, {0x250c, 0x84a1}, {0x250f, 0x84ac}, {0x2510, 0x84a2}, {0x2513, 0x84ad}, {0x2514, 0x84a4}, {0x2517, 0x84af}, {0x2518, 0x84a3}, {0x251b, 0x84ae}, {0x251c, 0x84a5}, {0x251d, 0x84ba}, {0x2520, 0x84b5}, {0x2523, 0x84b0}, {0x2524, 0x84a7}, {0x2525, 0x84bc}, {0x2528, 0x84b7}, {0x252b, 0x84b2}, {0x252c, 0x84a6}, {0x252f, 0x84b6}, {0x2530, 0x84bb}, {0x2533, 0x84b1}, {0x2534, 0x84a8}, {0x2537, 0x84b8}, {0x2538, 0x84bd}, {0x253b, 0x84b3}, {0x253c, 0x84a9}, {0x253f, 0x84b9}, {0x2542, 0x84be}, {0x254b, 0x84b4}, {0x25a0, 0x81a1}, {0x25a1, 0x81a0}, {0x25b2, 0x81a3}, {0x25b3, 0x81a2}, {0x25bc, 0x81a5}, {0x25bd, 0x81a4}, {0x25c6, 0x819f}, {0x25c7, 0x819e}, {0x25cb, 0x819b}, {0x25ce, 0x819d}, {0x25cf, 0x819c}, {0x25ef, 0x81fc}, {0x2605, 0x819a}, {0x2606, 0x8199}, {0x2640, 0x818a}, {0x2642, 0x8189}, {0x266a, 0x81f4}, {0x266d, 0x81f3}, {0x266f, 0x81f2}, {0x3000, 0x8140}, {0x3001, 0x8141}, {0x3002, 0x8142}, {0x3003, 0x8156}, {0x3005, 0x8158}, {0x3006, 0x8159}, {0x3007, 0x815a}, {0x3008, 0x8171}, {0x3009, 0x8172}, {0x300a, 0x8173}, {0x300b, 0x8174}, {0x300c, 0x8175}, {0x300d, 0x8176}, {0x300e, 0x8177}, {0x300f, 0x8178}, {0x3010, 0x8179}, {0x3011, 0x817a}, {0x3012, 0x81a7}, {0x3013, 0x81ac}, {0x3014, 0x816b}, {0x3015, 0x816c}, {0x301d, 0x8780}, {0x301f, 0x8781}, {0x3041, 0x829f}, {0x3042, 0x82a0}, {0x3043, 0x82a1}, {0x3044, 0x82a2}, {0x3045, 0x82a3}, {0x3046, 0x82a4}, {0x3047, 0x82a5}, {0x3048, 0x82a6}, {0x3049, 0x82a7}, {0x304a, 0x82a8}, {0x304b, 0x82a9}, {0x304c, 0x82aa}, {0x304d, 0x82ab}, {0x304e, 0x82ac}, {0x304f, 0x82ad}, {0x3050, 0x82ae}, {0x3051, 0x82af}, {0x3052, 0x82b0}, {0x3053, 0x82b1}, {0x3054, 0x82b2}, {0x3055, 0x82b3}, {0x3056, 0x82b4}, {0x3057, 0x82b5}, {0x3058, 0x82b6}, {0x3059, 0x82b7}, {0x305a, 0x82b8}, {0x305b, 0x82b9}, {0x305c, 0x82ba}, {0x305d, 0x82bb}, {0x305e, 0x82bc}, {0x305f, 0x82bd}, {0x3060, 0x82be}, {0x3061, 0x82bf}, {0x3062, 0x82c0}, {0x3063, 0x82c1}, {0x3064, 0x82c2}, {0x3065, 0x82c3}, {0x3066, 0x82c4}, {0x3067, 0x82c5}, {0x3068, 0x82c6}, {0x3069, 0x82c7}, {0x306a, 0x82c8}, {0x306b, 0x82c9}, {0x306c, 0x82ca}, {0x306d, 0x82cb}, {0x306e, 0x82cc}, {0x306f, 0x82cd}, {0x3070, 0x82ce}, {0x3071, 0x82cf}, {0x3072, 0x82d0}, {0x3073, 0x82d1}, {0x3074, 0x82d2}, {0x3075, 0x82d3}, {0x3076, 0x82d4}, {0x3077, 0x82d5}, {0x3078, 0x82d6}, {0x3079, 0x82d7}, {0x307a, 0x82d8}, {0x307b, 0x82d9}, {0x307c, 0x82da}, {0x307d, 0x82db}, {0x307e, 0x82dc}, {0x307f, 0x82dd}, {0x3080, 0x82de}, {0x3081, 0x82df}, {0x3082, 0x82e0}, {0x3083, 0x82e1}, {0x3084, 0x82e2}, {0x3085, 0x82e3}, {0x3086, 0x82e4}, {0x3087, 0x82e5}, {0x3088, 0x82e6}, {0x3089, 0x82e7}, {0x308a, 0x82e8}, {0x308b, 0x82e9}, {0x308c, 0x82ea}, {0x308d, 0x82eb}, {0x308e, 0x82ec}, {0x308f, 0x82ed}, {0x3090, 0x82ee}, {0x3091, 0x82ef}, {0x3092, 0x82f0}, {0x3093, 0x82f1}, {0x309b, 0x814a}, {0x309c, 0x814b}, {0x309d, 0x8154}, {0x309e, 0x8155}, {0x30a1, 0x8340}, {0x30a2, 0x8341}, {0x30a3, 0x8342}, {0x30a4, 0x8343}, {0x30a5, 0x8344}, {0x30a6, 0x8345}, {0x30a7, 0x8346}, {0x30a8, 0x8347}, {0x30a9, 0x8348}, {0x30aa, 0x8349}, {0x30ab, 0x834a}, {0x30ac, 0x834b}, {0x30ad, 0x834c}, {0x30ae, 0x834d}, {0x30af, 0x834e}, {0x30b0, 0x834f}, {0x30b1, 0x8350}, {0x30b2, 0x8351}, {0x30b3, 0x8352}, {0x30b4, 0x8353}, {0x30b5, 0x8354}, {0x30b6, 0x8355}, {0x30b7, 0x8356}, {0x30b8, 0x8357}, {0x30b9, 0x8358}, {0x30ba, 0x8359}, {0x30bb, 0x835a}, {0x30bc, 0x835b}, {0x30bd, 0x835c}, {0x30be, 0x835d}, {0x30bf, 0x835e}, {0x30c0, 0x835f}, {0x30c1, 0x8360}, {0x30c2, 0x8361}, {0x30c3, 0x8362}, {0x30c4, 0x8363}, {0x30c5, 0x8364}, {0x30c6, 0x8365}, {0x30c7, 0x8366}, {0x30c8, 0x8367}, {0x30c9, 0x8368}, {0x30ca, 0x8369}, {0x30cb, 0x836a}, {0x30cc, 0x836b}, {0x30cd, 0x836c}, {0x30ce, 0x836d}, {0x30cf, 0x836e}, {0x30d0, 0x836f}, {0x30d1, 0x8370}, {0x30d2, 0x8371}, {0x30d3, 0x8372}, {0x30d4, 0x8373}, {0x30d5, 0x8374}, {0x30d6, 0x8375}, {0x30d7, 0x8376}, {0x30d8, 0x8377}, {0x30d9, 0x8378}, {0x30da, 0x8379}, {0x30db, 0x837a}, {0x30dc, 0x837b}, {0x30dd, 0x837c}, {0x30de, 0x837d}, {0x30df, 0x837e}, {0x30e0, 0x8380}, {0x30e1, 0x8381}, {0x30e2, 0x8382}, {0x30e3, 0x8383}, {0x30e4, 0x8384}, {0x30e5, 0x8385}, {0x30e6, 0x8386}, {0x30e7, 0x8387}, {0x30e8, 0x8388}, {0x30e9, 0x8389}, {0x30ea, 0x838a}, {0x30eb, 0x838b}, {0x30ec, 0x838c}, {0x30ed, 0x838d}, {0x30ee, 0x838e}, {0x30ef, 0x838f}, {0x30f0, 0x8390}, {0x30f1, 0x8391}, {0x30f2, 0x8392}, {0x30f3, 0x8393}, {0x30f4, 0x8394}, {0x30f5, 0x8395}, {0x30f6, 0x8396}, {0x30fb, 0x8145}, {0x30fc, 0x815b}, {0x30fd, 0x8152}, {0x30fe, 0x8153}, {0x3231, 0xfa58}, {0x3232, 0x878b}, {0x3239, 0x878c}, {0x32a4, 0x8785}, {0x32a5, 0x8786}, {0x32a6, 0x8787}, {0x32a7, 0x8788}, {0x32a8, 0x8789}, {0x3303, 0x8765}, {0x330d, 0x8769}, {0x3314, 0x8760}, {0x3318, 0x8763}, {0x3322, 0x8761}, {0x3323, 0x876b}, {0x3326, 0x876a}, {0x3327, 0x8764}, {0x332b, 0x876c}, {0x3336, 0x8766}, {0x333b, 0x876e}, {0x3349, 0x875f}, {0x334a, 0x876d}, {0x334d, 0x8762}, {0x3351, 0x8767}, {0x3357, 0x8768}, {0x337b, 0x877e}, {0x337c, 0x878f}, {0x337d, 0x878e}, {0x337e, 0x878d}, {0x338e, 0x8772}, {0x338f, 0x8773}, {0x339c, 0x876f}, {0x339d, 0x8770}, {0x339e, 0x8771}, {0x33a1, 0x8775}, {0x33c4, 0x8774}, {0x33cd, 0x8783}, {0x4e00, 0x88ea}, {0x4e01, 0x929a}, {0x4e03, 0x8eb5}, {0x4e07, 0x969c}, {0x4e08, 0x8fe4}, {0x4e09, 0x8e4f}, {0x4e0a, 0x8fe3}, {0x4e0b, 0x89ba}, {0x4e0d, 0x9573}, {0x4e0e, 0x975e}, {0x4e10, 0x98a0}, {0x4e11, 0x894e}, {0x4e14, 0x8a8e}, {0x4e15, 0x98a1}, {0x4e16, 0x90a2}, {0x4e17, 0x99c0}, {0x4e18, 0x8b75}, {0x4e19, 0x95b8}, {0x4e1e, 0x8fe5}, {0x4e21, 0x97bc}, {0x4e26, 0x95c0}, {0x4e28, 0xfa68}, {0x4e2a, 0x98a2}, {0x4e2d, 0x9286}, {0x4e31, 0x98a3}, {0x4e32, 0x8bf8}, {0x4e36, 0x98a4}, {0x4e38, 0x8adb}, {0x4e39, 0x924f}, {0x4e3b, 0x8ee5}, {0x4e3c, 0x98a5}, {0x4e3f, 0x98a6}, {0x4e42, 0x98a7}, {0x4e43, 0x9454}, {0x4e45, 0x8b76}, {0x4e4b, 0x9456}, {0x4e4d, 0x93e1}, {0x4e4e, 0x8cc1}, {0x4e4f, 0x9652}, {0x4e55, 0xe568}, {0x4e56, 0x98a8}, {0x4e57, 0x8fe6}, {0x4e58, 0x98a9}, {0x4e59, 0x89b3}, {0x4e5d, 0x8be3}, {0x4e5e, 0x8cee}, {0x4e5f, 0x96e7}, {0x4e62, 0x9ba4}, {0x4e71, 0x9790}, {0x4e73, 0x93fb}, {0x4e7e, 0x8aa3}, {0x4e80, 0x8b54}, {0x4e82, 0x98aa}, {0x4e85, 0x98ab}, {0x4e86, 0x97b9}, {0x4e88, 0x975c}, {0x4e89, 0x9188}, {0x4e8a, 0x98ad}, {0x4e8b, 0x8e96}, {0x4e8c, 0x93f1}, {0x4e8e, 0x98b0}, {0x4e91, 0x895d}, {0x4e92, 0x8cdd}, {0x4e94, 0x8cdc}, {0x4e95, 0x88e4}, {0x4e98, 0x986a}, {0x4e99, 0x9869}, {0x4e9b, 0x8db1}, {0x4e9c, 0x889f}, {0x4e9e, 0x98b1}, {0x4e9f, 0x98b2}, {0x4ea0, 0x98b3}, {0x4ea1, 0x9653}, {0x4ea2, 0x98b4}, {0x4ea4, 0x8cf0}, {0x4ea5, 0x88e5}, {0x4ea6, 0x9692}, {0x4ea8, 0x8b9c}, {0x4eab, 0x8b9d}, {0x4eac, 0x8b9e}, {0x4ead, 0x92e0}, {0x4eae, 0x97ba}, {0x4eb0, 0x98b5}, {0x4eb3, 0x98b6}, {0x4eb6, 0x98b7}, {0x4eba, 0x906c}, {0x4ec0, 0x8f59}, {0x4ec1, 0x906d}, {0x4ec2, 0x98bc}, {0x4ec4, 0x98ba}, {0x4ec6, 0x98bb}, {0x4ec7, 0x8b77}, {0x4eca, 0x8da1}, {0x4ecb, 0x89ee}, {0x4ecd, 0x98b9}, {0x4ece, 0x98b8}, {0x4ecf, 0x95a7}, {0x4ed4, 0x8e65}, {0x4ed5, 0x8e64}, {0x4ed6, 0x91bc}, {0x4ed7, 0x98bd}, {0x4ed8, 0x9574}, {0x4ed9, 0x90e5}, {0x4edd, 0x8157}, {0x4ede, 0x98be}, {0x4edf, 0x98c0}, {0x4ee1, 0xfa69}, {0x4ee3, 0x91e3}, {0x4ee4, 0x97df}, {0x4ee5, 0x88c8}, {0x4eed, 0x98bf}, {0x4eee, 0x89bc}, {0x4ef0, 0x8bc2}, {0x4ef2, 0x9287}, {0x4ef6, 0x8c8f}, {0x4ef7, 0x98c1}, {0x4efb, 0x9443}, {0x4efc, 0xfa6a}, {0x4f00, 0xfa6b}, {0x4f01, 0x8ae9}, {0x4f03, 0xfa6c}, {0x4f09, 0x98c2}, {0x4f0a, 0x88c9}, {0x4f0d, 0x8cde}, {0x4f0e, 0x8aea}, {0x4f0f, 0x959a}, {0x4f10, 0x94b0}, {0x4f11, 0x8b78}, {0x4f1a, 0x89ef}, {0x4f1c, 0x98e5}, {0x4f1d, 0x9360}, {0x4f2f, 0x948c}, {0x4f30, 0x98c4}, {0x4f34, 0x94ba}, {0x4f36, 0x97e0}, {0x4f38, 0x904c}, {0x4f39, 0xfa6d}, {0x4f3a, 0x8e66}, {0x4f3c, 0x8e97}, {0x4f3d, 0x89be}, {0x4f43, 0x92cf}, {0x4f46, 0x9241}, {0x4f47, 0x98c8}, {0x4f4d, 0x88ca}, {0x4f4e, 0x92e1}, {0x4f4f, 0x8f5a}, {0x4f50, 0x8db2}, {0x4f51, 0x9743}, {0x4f53, 0x91cc}, {0x4f55, 0x89bd}, {0x4f56, 0xfa6e}, {0x4f57, 0x98c7}, {0x4f59, 0x975d}, {0x4f5a, 0x98c3}, {0x4f5b, 0x98c5}, {0x4f5c, 0x8dec}, {0x4f5d, 0x98c6}, {0x4f5e, 0x9b43}, {0x4f69, 0x98ce}, {0x4f6f, 0x98d1}, {0x4f70, 0x98cf}, {0x4f73, 0x89c0}, {0x4f75, 0x95b9}, {0x4f76, 0x98c9}, {0x4f7b, 0x98cd}, {0x4f7c, 0x8cf1}, {0x4f7f, 0x8e67}, {0x4f83, 0x8aa4}, {0x4f86, 0x98d2}, {0x4f88, 0x98ca}, {0x4f8a, 0xfa70}, {0x4f8b, 0x97e1}, {0x4f8d, 0x8e98}, {0x4f8f, 0x98cb}, {0x4f91, 0x98d0}, {0x4f92, 0xfa6f}, {0x4f94, 0xfa72}, {0x4f96, 0x98d3}, {0x4f98, 0x98cc}, {0x4f9a, 0xfa71}, {0x4f9b, 0x8b9f}, {0x4f9d, 0x88cb}, {0x4fa0, 0x8ba0}, {0x4fa1, 0x89bf}, {0x4fab, 0x9b44}, {0x4fad, 0x9699}, {0x4fae, 0x958e}, {0x4faf, 0x8cf2}, {0x4fb5, 0x904e}, {0x4fb6, 0x97b5}, {0x4fbf, 0x95d6}, {0x4fc2, 0x8c57}, {0x4fc3, 0x91a3}, {0x4fc4, 0x89e2}, {0x4fc9, 0xfa61}, {0x4fca, 0x8f72}, {0x4fcd, 0xfa73}, {0x4fce, 0x98d7}, {0x4fd0, 0x98dc}, {0x4fd1, 0x98da}, {0x4fd4, 0x98d5}, {0x4fd7, 0x91ad}, {0x4fd8, 0x98d8}, {0x4fda, 0x98db}, {0x4fdb, 0x98d9}, {0x4fdd, 0x95db}, {0x4fdf, 0x98d6}, {0x4fe1, 0x904d}, {0x4fe3, 0x9693}, {0x4fe4, 0x98dd}, {0x4fe5, 0x98de}, {0x4fee, 0x8f43}, {0x4fef, 0x98eb}, {0x4ff3, 0x946f}, {0x4ff5, 0x9555}, {0x4ff6, 0x98e6}, {0x4ff8, 0x95ee}, {0x4ffa, 0x89b4}, {0x4ffe, 0x98ea}, {0x4fff, 0xfa76}, {0x5005, 0x98e4}, {0x5006, 0x98ed}, {0x5009, 0x9171}, {0x500b, 0x8cc2}, {0x500d, 0x947b}, {0x500f, 0xe0c5}, {0x5011, 0x98ec}, {0x5012, 0x937c}, {0x5014, 0x98e1}, {0x5016, 0x8cf4}, {0x5019, 0x8cf3}, {0x501a, 0x98df}, {0x501e, 0xfa77}, {0x501f, 0x8ed8}, {0x5021, 0x98e7}, {0x5022, 0xfa75}, {0x5023, 0x95ed}, {0x5024, 0x926c}, {0x5025, 0x98e3}, {0x5026, 0x8c91}, {0x5028, 0x98e0}, {0x5029, 0x98e8}, {0x502a, 0x98e2}, {0x502b, 0x97cf}, {0x502c, 0x98e9}, {0x502d, 0x9860}, {0x5036, 0x8be4}, {0x5039, 0x8c90}, {0x5040, 0xfa74}, {0x5042, 0xfa7a}, {0x5043, 0x98ee}, {0x5046, 0xfa78}, {0x5047, 0x98ef}, {0x5048, 0x98f3}, {0x5049, 0x88cc}, {0x504f, 0x95ce}, {0x5050, 0x98f2}, {0x5055, 0x98f1}, {0x5056, 0x98f5}, {0x505a, 0x98f4}, {0x505c, 0x92e2}, {0x5065, 0x8c92}, {0x506c, 0x98f6}, {0x5070, 0xfa79}, {0x5072, 0x8ec3}, {0x5074, 0x91a4}, {0x5075, 0x92e3}, {0x5076, 0x8bf4}, {0x5078, 0x98f7}, {0x507d, 0x8b55}, {0x5080, 0x98f8}, {0x5085, 0x98fa}, {0x508d, 0x9654}, {0x5091, 0x8c86}, {0x5094, 0xfa7b}, {0x5098, 0x8e50}, {0x5099, 0x94f5}, {0x509a, 0x98f9}, {0x50ac, 0x8dc3}, {0x50ad, 0x9762}, {0x50b2, 0x98fc}, {0x50b3, 0x9942}, {0x50b4, 0x98fb}, {0x50b5, 0x8dc2}, {0x50b7, 0x8f9d}, {0x50be, 0x8c58}, {0x50c2, 0x9943}, {0x50c5, 0x8bcd}, {0x50c9, 0x9940}, {0x50ca, 0x9941}, {0x50cd, 0x93ad}, {0x50cf, 0x919c}, {0x50d1, 0x8ba1}, {0x50d5, 0x966c}, {0x50d6, 0x9944}, {0x50d8, 0xfa7d}, {0x50da, 0x97bb}, {0x50de, 0x9945}, {0x50e3, 0x9948}, {0x50e5, 0x9946}, {0x50e7, 0x916d}, {0x50ed, 0x9947}, {0x50ee, 0x9949}, {0x50f4, 0xfa7c}, {0x50f5, 0x994b}, {0x50f9, 0x994a}, {0x50fb, 0x95c6}, {0x5100, 0x8b56}, {0x5101, 0x994d}, {0x5102, 0x994e}, {0x5104, 0x89ad}, {0x5109, 0x994c}, {0x5112, 0x8ef2}, {0x5114, 0x9951}, {0x5115, 0x9950}, {0x5116, 0x994f}, {0x5118, 0x98d4}, {0x511a, 0x9952}, {0x511f, 0x8f9e}, {0x5121, 0x9953}, {0x512a, 0x9744}, {0x5132, 0x96d7}, {0x5137, 0x9955}, {0x513a, 0x9954}, {0x513b, 0x9957}, {0x513c, 0x9956}, {0x513f, 0x9958}, {0x5140, 0x9959}, {0x5141, 0x88f2}, {0x5143, 0x8cb3}, {0x5144, 0x8c5a}, {0x5145, 0x8f5b}, {0x5146, 0x929b}, {0x5147, 0x8ba2}, {0x5148, 0x90e6}, {0x5149, 0x8cf5}, {0x514a, 0xfa7e}, {0x514b, 0x8d8e}, {0x514c, 0x995b}, {0x514d, 0x96c6}, {0x514e, 0x9365}, {0x5150, 0x8e99}, {0x5152, 0x995a}, {0x5154, 0x995c}, {0x515a, 0x937d}, {0x515c, 0x8a95}, {0x5162, 0x995d}, {0x5164, 0xfa80}, {0x5165, 0x93fc}, {0x5168, 0x9153}, {0x5169, 0x995f}, {0x516a, 0x9960}, {0x516b, 0x94aa}, {0x516c, 0x8cf6}, {0x516d, 0x985a}, {0x516e, 0x9961}, {0x5171, 0x8ba4}, {0x5175, 0x95ba}, {0x5176, 0x91b4}, {0x5177, 0x8bef}, {0x5178, 0x9354}, {0x517c, 0x8c93}, {0x5180, 0x9962}, {0x5182, 0x9963}, {0x5185, 0x93e0}, {0x5186, 0x897e}, {0x5189, 0x9966}, {0x518a, 0x8dfb}, {0x518c, 0x9965}, {0x518d, 0x8dc4}, {0x518f, 0x9967}, {0x5190, 0xe3ec}, {0x5191, 0x9968}, {0x5192, 0x9660}, {0x5193, 0x9969}, {0x5195, 0x996a}, {0x5196, 0x996b}, {0x5197, 0x8fe7}, {0x5199, 0x8eca}, {0x519d, 0xfa81}, {0x51a0, 0x8aa5}, {0x51a2, 0x996e}, {0x51a4, 0x996c}, {0x51a5, 0x96bb}, {0x51a6, 0x996d}, {0x51a8, 0x9579}, {0x51a9, 0x996f}, {0x51aa, 0x9970}, {0x51ab, 0x9971}, {0x51ac, 0x937e}, {0x51b0, 0x9975}, {0x51b1, 0x9973}, {0x51b2, 0x9974}, {0x51b3, 0x9972}, {0x51b4, 0x8de1}, {0x51b5, 0x9976}, {0x51b6, 0x96e8}, {0x51b7, 0x97e2}, {0x51bd, 0x9977}, {0x51be, 0xfa82}, {0x51c4, 0x90a6}, {0x51c5, 0x9978}, {0x51c6, 0x8f79}, {0x51c9, 0x9979}, {0x51cb, 0x929c}, {0x51cc, 0x97bd}, {0x51cd, 0x9380}, {0x51d6, 0x99c3}, {0x51db, 0x997a}, {0x51dc, 0xeaa3}, {0x51dd, 0x8bc3}, {0x51e0, 0x997b}, {0x51e1, 0x967d}, {0x51e6, 0x8f88}, {0x51e7, 0x91fa}, {0x51e9, 0x997d}, {0x51ea, 0x93e2}, {0x51ec, 0xfa83}, {0x51ed, 0x997e}, {0x51f0, 0x9980}, {0x51f1, 0x8a4d}, {0x51f5, 0x9981}, {0x51f6, 0x8ba5}, {0x51f8, 0x93ca}, {0x51f9, 0x899a}, {0x51fa, 0x8f6f}, {0x51fd, 0x949f}, {0x51fe, 0x9982}, {0x5200, 0x9381}, {0x5203, 0x906e}, {0x5204, 0x9983}, {0x5206, 0x95aa}, {0x5207, 0x90d8}, {0x5208, 0x8aa0}, {0x520a, 0x8aa7}, {0x520b, 0x9984}, {0x520e, 0x9986}, {0x5211, 0x8c59}, {0x5214, 0x9985}, {0x5215, 0xfa84}, {0x5217, 0x97f1}, {0x521d, 0x8f89}, {0x5224, 0x94bb}, {0x5225, 0x95ca}, {0x5227, 0x9987}, {0x5229, 0x9798}, {0x522a, 0x9988}, {0x522e, 0x9989}, {0x5230, 0x939e}, {0x5233, 0x998a}, {0x5236, 0x90a7}, {0x5237, 0x8dfc}, {0x5238, 0x8c94}, {0x5239, 0x998b}, {0x523a, 0x8e68}, {0x523b, 0x8d8f}, {0x5243, 0x92e4}, {0x5244, 0x998d}, {0x5247, 0x91a5}, {0x524a, 0x8ded}, {0x524b, 0x998e}, {0x524c, 0x998f}, {0x524d, 0x914f}, {0x524f, 0x998c}, {0x5254, 0x9991}, {0x5256, 0x9655}, {0x525b, 0x8d84}, {0x525e, 0x9990}, {0x5263, 0x8c95}, {0x5264, 0x8ddc}, {0x5265, 0x948d}, {0x5269, 0x9994}, {0x526a, 0x9992}, {0x526f, 0x959b}, {0x5270, 0x8fe8}, {0x5271, 0x999b}, {0x5272, 0x8a84}, {0x5273, 0x9995}, {0x5274, 0x9993}, {0x5275, 0x916e}, {0x527d, 0x9997}, {0x527f, 0x9996}, {0x5283, 0x8a63}, {0x5287, 0x8c80}, {0x5288, 0x999c}, {0x5289, 0x97ab}, {0x528d, 0x9998}, {0x5291, 0x999d}, {0x5292, 0x999a}, {0x5294, 0x9999}, {0x529b, 0x97cd}, {0x529c, 0xfa85}, {0x529f, 0x8cf7}, {0x52a0, 0x89c1}, {0x52a3, 0x97f2}, {0x52a6, 0xfa86}, {0x52a9, 0x8f95}, {0x52aa, 0x9377}, {0x52ab, 0x8d85}, {0x52ac, 0x99a0}, {0x52ad, 0x99a1}, {0x52af, 0xfb77}, {0x52b1, 0x97e3}, {0x52b4, 0x984a}, {0x52b5, 0x99a3}, {0x52b9, 0x8cf8}, {0x52bc, 0x99a2}, {0x52be, 0x8a4e}, {0x52c0, 0xfa87}, {0x52c1, 0x99a4}, {0x52c3, 0x9675}, {0x52c5, 0x92ba}, {0x52c7, 0x9745}, {0x52c9, 0x95d7}, {0x52cd, 0x99a5}, {0x52d2, 0xe8d3}, {0x52d5, 0x93ae}, {0x52d7, 0x99a6}, {0x52d8, 0x8aa8}, {0x52d9, 0x96b1}, {0x52db, 0xfa88}, {0x52dd, 0x8f9f}, {0x52de, 0x99a7}, {0x52df, 0x95e5}, {0x52e0, 0x99ab}, {0x52e2, 0x90a8}, {0x52e3, 0x99a8}, {0x52e4, 0x8bce}, {0x52e6, 0x99a9}, {0x52e7, 0x8aa9}, {0x52f2, 0x8c4d}, {0x52f3, 0x99ac}, {0x52f5, 0x99ad}, {0x52f8, 0x99ae}, {0x52f9, 0x99af}, {0x52fa, 0x8ed9}, {0x52fe, 0x8cf9}, {0x52ff, 0x96dc}, {0x5300, 0xfa89}, {0x5301, 0x96e6}, {0x5302, 0x93f5}, {0x5305, 0x95ef}, {0x5306, 0x99b0}, {0x5307, 0xfa8a}, {0x5308, 0x99b1}, {0x530d, 0x99b3}, {0x530f, 0x99b5}, {0x5310, 0x99b4}, {0x5315, 0x99b6}, {0x5316, 0x89bb}, {0x5317, 0x966b}, {0x5319, 0x8dfa}, {0x531a, 0x99b7}, {0x531d, 0x9178}, {0x5320, 0x8fa0}, {0x5321, 0x8ba7}, {0x5323, 0x99b8}, {0x5324, 0xfa8b}, {0x532a, 0x94d9}, {0x532f, 0x99b9}, {0x5331, 0x99ba}, {0x5333, 0x99bb}, {0x5338, 0x99bc}, {0x5339, 0x9543}, {0x533a, 0x8be6}, {0x533b, 0x88e3}, {0x533f, 0x93bd}, {0x5340, 0x99bd}, {0x5341, 0x8f5c}, {0x5343, 0x90e7}, {0x5345, 0x99bf}, {0x5346, 0x99be}, {0x5347, 0x8fa1}, {0x5348, 0x8cdf}, {0x5349, 0x99c1}, {0x534a, 0x94bc}, {0x534d, 0x99c2}, {0x5351, 0x94da}, {0x5352, 0x91b2}, {0x5353, 0x91ec}, {0x5354, 0x8ba6}, {0x5357, 0x93ec}, {0x5358, 0x9250}, {0x535a, 0x948e}, {0x535c, 0x966d}, {0x535e, 0x99c4}, {0x5360, 0x90e8}, {0x5366, 0x8c54}, {0x5369, 0x99c5}, {0x536e, 0x99c6}, {0x536f, 0x894b}, {0x5370, 0x88f3}, {0x5371, 0x8aeb}, {0x5372, 0xfa8c}, {0x5373, 0x91a6}, {0x5374, 0x8b70}, {0x5375, 0x9791}, {0x5377, 0x99c9}, {0x5378, 0x89b5}, {0x537b, 0x99c8}, {0x537f, 0x8ba8}, {0x5382, 0x99ca}, {0x5384, 0x96ef}, {0x5393, 0xfa8d}, {0x5396, 0x99cb}, {0x5398, 0x97d0}, {0x539a, 0x8cfa}, {0x539f, 0x8cb4}, {0x53a0, 0x99cc}, {0x53a5, 0x99ce}, {0x53a6, 0x99cd}, {0x53a8, 0x907e}, {0x53a9, 0x8958}, {0x53ad, 0x897d}, {0x53ae, 0x99cf}, {0x53b0, 0x99d0}, {0x53b2, 0xfa8e}, {0x53b3, 0x8cb5}, {0x53b6, 0x99d1}, {0x53bb, 0x8b8e}, {0x53c2, 0x8e51}, {0x53c3, 0x99d2}, {0x53c8, 0x9694}, {0x53c9, 0x8db3}, {0x53ca, 0x8b79}, {0x53cb, 0x9746}, {0x53cc, 0x916f}, {0x53cd, 0x94bd}, {0x53ce, 0x8efb}, {0x53d4, 0x8f66}, {0x53d6, 0x8ee6}, {0x53d7, 0x8ef3}, {0x53d9, 0x8f96}, {0x53db, 0x94be}, {0x53dd, 0xfa8f}, {0x53df, 0x99d5}, {0x53e1, 0x8962}, {0x53e2, 0x9170}, {0x53e3, 0x8cfb}, {0x53e4, 0x8cc3}, {0x53e5, 0x8be5}, {0x53e8, 0x99d9}, {0x53e9, 0x9240}, {0x53ea, 0x91fc}, {0x53eb, 0x8ba9}, {0x53ec, 0x8fa2}, {0x53ed, 0x99da}, {0x53ee, 0x99d8}, {0x53ef, 0x89c2}, {0x53f0, 0x91e4}, {0x53f1, 0x8eb6}, {0x53f2, 0x8e6a}, {0x53f3, 0x8945}, {0x53f6, 0x8a90}, {0x53f7, 0x8d86}, {0x53f8, 0x8e69}, {0x53fa, 0x99db}, {0x5401, 0x99dc}, {0x5403, 0x8b68}, {0x5404, 0x8a65}, {0x5408, 0x8d87}, {0x5409, 0x8b67}, {0x540a, 0x92dd}, {0x540b, 0x8944}, {0x540c, 0x93af}, {0x540d, 0x96bc}, {0x540e, 0x8d40}, {0x540f, 0x9799}, {0x5410, 0x9366}, {0x5411, 0x8cfc}, {0x541b, 0x8c4e}, {0x541d, 0x99e5}, {0x541f, 0x8be1}, {0x5420, 0x9669}, {0x5426, 0x94db}, {0x5429, 0x99e4}, {0x542b, 0x8adc}, {0x542c, 0x99df}, {0x542d, 0x99e0}, {0x542e, 0x99e2}, {0x5436, 0x99e3}, {0x5438, 0x8b7a}, {0x5439, 0x9081}, {0x543b, 0x95ab}, {0x543c, 0x99e1}, {0x543d, 0x99dd}, {0x543e, 0x8ce1}, {0x5440, 0x99de}, {0x5442, 0x9843}, {0x5446, 0x95f0}, {0x5448, 0x92e6}, {0x5449, 0x8ce0}, {0x544a, 0x8d90}, {0x544e, 0x99e6}, {0x5451, 0x93db}, {0x545f, 0x99ea}, {0x5468, 0x8efc}, {0x546a, 0x8ef4}, {0x5470, 0x99ed}, {0x5471, 0x99eb}, {0x5473, 0x96a1}, {0x5475, 0x99e8}, {0x5476, 0x99f1}, {0x5477, 0x99ec}, {0x547b, 0x99ef}, {0x547c, 0x8cc4}, {0x547d, 0x96bd}, {0x5480, 0x99f0}, {0x5484, 0x99f2}, {0x5486, 0x99f4}, {0x548a, 0xfa92}, {0x548b, 0x8dee}, {0x548c, 0x9861}, {0x548e, 0x99e9}, {0x548f, 0x99e7}, {0x5490, 0x99f3}, {0x5492, 0x99ee}, {0x549c, 0xfa91}, {0x54a2, 0x99f6}, {0x54a4, 0x9a42}, {0x54a5, 0x99f8}, {0x54a8, 0x99fc}, {0x54a9, 0xfa93}, {0x54ab, 0x9a40}, {0x54ac, 0x99f9}, {0x54af, 0x9a5d}, {0x54b2, 0x8de7}, {0x54b3, 0x8a50}, {0x54b8, 0x99f7}, {0x54bc, 0x9a44}, {0x54bd, 0x88f4}, {0x54be, 0x9a43}, {0x54c0, 0x88a3}, {0x54c1, 0x9569}, {0x54c2, 0x9a41}, {0x54c4, 0x99fa}, {0x54c7, 0x99f5}, {0x54c8, 0x99fb}, {0x54c9, 0x8dc6}, {0x54d8, 0x9a45}, {0x54e1, 0x88f5}, {0x54e2, 0x9a4e}, {0x54e5, 0x9a46}, {0x54e6, 0x9a47}, {0x54e8, 0x8fa3}, {0x54e9, 0x9689}, {0x54ed, 0x9a4c}, {0x54ee, 0x9a4b}, {0x54f2, 0x934e}, {0x54fa, 0x9a4d}, {0x54fd, 0x9a4a}, {0x54ff, 0xfa94}, {0x5504, 0x8953}, {0x5506, 0x8db4}, {0x5507, 0x904f}, {0x550f, 0x9a48}, {0x5510, 0x9382}, {0x5514, 0x9a49}, {0x5516, 0x88a0}, {0x552e, 0x9a53}, {0x552f, 0x9742}, {0x5531, 0x8fa5}, {0x5533, 0x9a59}, {0x5538, 0x9a58}, {0x5539, 0x9a4f}, {0x553e, 0x91c1}, {0x5540, 0x9a50}, {0x5544, 0x91ed}, {0x5545, 0x9a55}, {0x5546, 0x8fa4}, {0x554c, 0x9a52}, {0x554f, 0x96e2}, {0x5553, 0x8c5b}, {0x5556, 0x9a56}, {0x5557, 0x9a57}, {0x555c, 0x9a54}, {0x555d, 0x9a5a}, {0x5563, 0x9a51}, {0x557b, 0x9a60}, {0x557c, 0x9a65}, {0x557e, 0x9a61}, {0x5580, 0x9a5c}, {0x5583, 0x9a66}, {0x5584, 0x9150}, {0x5586, 0xfa95}, {0x5587, 0x9a68}, {0x5589, 0x8d41}, {0x558a, 0x9a5e}, {0x558b, 0x929d}, {0x5598, 0x9a62}, {0x5599, 0x9a5b}, {0x559a, 0x8aab}, {0x559c, 0x8aec}, {0x559d, 0x8a85}, {0x559e, 0x9a63}, {0x559f, 0x9a5f}, {0x55a7, 0x8c96}, {0x55a8, 0x9a69}, {0x55a9, 0x9a67}, {0x55aa, 0x9172}, {0x55ab, 0x8b69}, {0x55ac, 0x8baa}, {0x55ae, 0x9a64}, {0x55b0, 0x8bf2}, {0x55b6, 0x8963}, {0x55c4, 0x9a6d}, {0x55c5, 0x9a6b}, {0x55c7, 0x9aa5}, {0x55d4, 0x9a70}, {0x55da, 0x9a6a}, {0x55dc, 0x9a6e}, {0x55df, 0x9a6c}, {0x55e3, 0x8e6b}, {0x55e4, 0x9a6f}, {0x55f7, 0x9a72}, {0x55f9, 0x9a77}, {0x55fd, 0x9a75}, {0x55fe, 0x9a74}, {0x5606, 0x9251}, {0x5609, 0x89c3}, {0x5614, 0x9a71}, {0x5616, 0x9a73}, {0x5617, 0x8fa6}, {0x5618, 0x8952}, {0x561b, 0x9a76}, {0x5629, 0x89dc}, {0x562f, 0x9a82}, {0x5631, 0x8ffa}, {0x5632, 0x9a7d}, {0x5634, 0x9a7b}, {0x5636, 0x9a7c}, {0x5638, 0x9a7e}, {0x5642, 0x895c}, {0x564c, 0x9158}, {0x564e, 0x9a78}, {0x5650, 0x9a79}, {0x565b, 0x8a9a}, {0x5664, 0x9a81}, {0x5668, 0x8aed}, {0x566a, 0x9a84}, {0x566b, 0x9a80}, {0x566c, 0x9a83}, {0x5674, 0x95ac}, {0x5678, 0x93d3}, {0x567a, 0x94b6}, {0x5680, 0x9a86}, {0x5686, 0x9a85}, {0x5687, 0x8a64}, {0x568a, 0x9a87}, {0x568f, 0x9a8a}, {0x5694, 0x9a89}, {0x56a0, 0x9a88}, {0x56a2, 0x9458}, {0x56a5, 0x9a8b}, {0x56ae, 0x9a8c}, {0x56b4, 0x9a8e}, {0x56b6, 0x9a8d}, {0x56bc, 0x9a90}, {0x56c0, 0x9a93}, {0x56c1, 0x9a91}, {0x56c2, 0x9a8f}, {0x56c3, 0x9a92}, {0x56c8, 0x9a94}, {0x56ce, 0x9a95}, {0x56d1, 0x9a96}, {0x56d3, 0x9a97}, {0x56d7, 0x9a98}, {0x56d8, 0x9964}, {0x56da, 0x8efa}, {0x56db, 0x8e6c}, {0x56de, 0x89f1}, {0x56e0, 0x88f6}, {0x56e3, 0x9263}, {0x56ee, 0x9a99}, {0x56f0, 0x8da2}, {0x56f2, 0x88cd}, {0x56f3, 0x907d}, {0x56f9, 0x9a9a}, {0x56fa, 0x8cc5}, {0x56fd, 0x8d91}, {0x56ff, 0x9a9c}, {0x5700, 0x9a9b}, {0x5703, 0x95de}, {0x5704, 0x9a9d}, {0x5708, 0x9a9f}, {0x5709, 0x9a9e}, {0x570b, 0x9aa0}, {0x570d, 0x9aa1}, {0x570f, 0x8c97}, {0x5712, 0x8980}, {0x5713, 0x9aa2}, {0x5716, 0x9aa4}, {0x5718, 0x9aa3}, {0x571c, 0x9aa6}, {0x571f, 0x9379}, {0x5726, 0x9aa7}, {0x5727, 0x88b3}, {0x5728, 0x8ddd}, {0x572d, 0x8c5c}, {0x5730, 0x926e}, {0x5737, 0x9aa8}, {0x5738, 0x9aa9}, {0x573b, 0x9aab}, {0x5740, 0x9aac}, {0x5742, 0x8de2}, {0x5747, 0x8bcf}, {0x574a, 0x9656}, {0x574e, 0x9aaa}, {0x574f, 0x9aad}, {0x5750, 0x8dbf}, {0x5751, 0x8d42}, {0x5759, 0xfa96}, {0x5761, 0x9ab1}, {0x5764, 0x8da3}, {0x5765, 0xfa97}, {0x5766, 0x9252}, {0x5769, 0x9aae}, {0x576a, 0x92d8}, {0x577f, 0x9ab2}, {0x5782, 0x9082}, {0x5788, 0x9ab0}, {0x5789, 0x9ab3}, {0x578b, 0x8c5e}, {0x5793, 0x9ab4}, {0x57a0, 0x9ab5}, {0x57a2, 0x8d43}, {0x57a3, 0x8a5f}, {0x57a4, 0x9ab7}, {0x57aa, 0x9ab8}, {0x57ac, 0xfa98}, {0x57b0, 0x9ab9}, {0x57b3, 0x9ab6}, {0x57c0, 0x9aaf}, {0x57c3, 0x9aba}, {0x57c6, 0x9abb}, {0x57c7, 0xfa9a}, {0x57c8, 0xfa99}, {0x57cb, 0x9684}, {0x57ce, 0x8fe9}, {0x57d2, 0x9abd}, {0x57d3, 0x9abe}, {0x57d4, 0x9abc}, {0x57d6, 0x9ac0}, {0x57dc, 0x9457}, {0x57df, 0x88e6}, {0x57e0, 0x9575}, {0x57e3, 0x9ac1}, {0x57f4, 0x8ffb}, {0x57f7, 0x8eb7}, {0x57f9, 0x947c}, {0x57fa, 0x8aee}, {0x57fc, 0x8de9}, {0x5800, 0x9678}, {0x5802, 0x93b0}, {0x5805, 0x8c98}, {0x5806, 0x91cd}, {0x580a, 0x9abf}, {0x580b, 0x9ac2}, {0x5815, 0x91c2}, {0x5819, 0x9ac3}, {0x581d, 0x9ac4}, {0x5821, 0x9ac6}, {0x5824, 0x92e7}, {0x582a, 0x8aac}, {0x582f, 0xea9f}, {0x5830, 0x8981}, {0x5831, 0x95f1}, {0x5834, 0x8fea}, {0x5835, 0x9367}, {0x583a, 0x8de4}, {0x583d, 0x9acc}, {0x5840, 0x95bb}, {0x5841, 0x97db}, {0x584a, 0x89f2}, {0x584b, 0x9ac8}, {0x5851, 0x9159}, {0x5852, 0x9acb}, {0x5854, 0x9383}, {0x5857, 0x9368}, {0x5858, 0x9384}, {0x5859, 0x94b7}, {0x585a, 0x92cb}, {0x585e, 0x8dc7}, {0x5862, 0x9ac7}, {0x5869, 0x8996}, {0x586b, 0x9355}, {0x5870, 0x9ac9}, {0x5872, 0x9ac5}, {0x5875, 0x906f}, {0x5879, 0x9acd}, {0x587e, 0x8f6d}, {0x5883, 0x8bab}, {0x5885, 0x9ace}, {0x5893, 0x95e6}, {0x5897, 0x919d}, {0x589c, 0x92c4}, {0x589e, 0xfa9d}, {0x589f, 0x9ad0}, {0x58a8, 0x966e}, {0x58ab, 0x9ad1}, {0x58ae, 0x9ad6}, {0x58b2, 0xfa9e}, {0x58b3, 0x95ad}, {0x58b8, 0x9ad5}, {0x58b9, 0x9acf}, {0x58ba, 0x9ad2}, {0x58bb, 0x9ad4}, {0x58be, 0x8da4}, {0x58c1, 0x95c7}, {0x58c5, 0x9ad7}, {0x58c7, 0x9264}, {0x58ca, 0x89f3}, {0x58cc, 0x8feb}, {0x58d1, 0x9ad9}, {0x58d3, 0x9ad8}, {0x58d5, 0x8d88}, {0x58d7, 0x9ada}, {0x58d8, 0x9adc}, {0x58d9, 0x9adb}, {0x58dc, 0x9ade}, {0x58de, 0x9ad3}, {0x58df, 0x9ae0}, {0x58e4, 0x9adf}, {0x58e5, 0x9add}, {0x58eb, 0x8e6d}, {0x58ec, 0x9070}, {0x58ee, 0x9173}, {0x58ef, 0x9ae1}, {0x58f0, 0x90ba}, {0x58f1, 0x88eb}, {0x58f2, 0x9484}, {0x58f7, 0x92d9}, {0x58f9, 0x9ae3}, {0x58fa, 0x9ae2}, {0x58fb, 0x9ae4}, {0x58fc, 0x9ae5}, {0x58fd, 0x9ae6}, {0x5902, 0x9ae7}, {0x5909, 0x95cf}, {0x590a, 0x9ae8}, {0x590b, 0xfa9f}, {0x590f, 0x89c4}, {0x5910, 0x9ae9}, {0x5915, 0x975b}, {0x5916, 0x8a4f}, {0x5918, 0x99c7}, {0x5919, 0x8f67}, {0x591a, 0x91bd}, {0x591b, 0x9aea}, {0x591c, 0x96e9}, {0x5922, 0x96b2}, {0x5925, 0x9aec}, {0x5927, 0x91e5}, {0x5929, 0x9356}, {0x592a, 0x91be}, {0x592b, 0x9576}, {0x592c, 0x9aed}, {0x592d, 0x9aee}, {0x592e, 0x899b}, {0x5931, 0x8eb8}, {0x5932, 0x9aef}, {0x5937, 0x88ce}, {0x5938, 0x9af0}, {0x593e, 0x9af1}, {0x5944, 0x8982}, {0x5947, 0x8aef}, {0x5948, 0x93de}, {0x5949, 0x95f2}, {0x594e, 0x9af5}, {0x594f, 0x9174}, {0x5950, 0x9af4}, {0x5951, 0x8c5f}, {0x5953, 0xfaa0}, {0x5954, 0x967a}, {0x5955, 0x9af3}, {0x5957, 0x9385}, {0x5958, 0x9af7}, {0x595a, 0x9af6}, {0x595b, 0xfaa1}, {0x595d, 0xfaa2}, {0x5960, 0x9af9}, {0x5962, 0x9af8}, {0x5963, 0xfaa3}, {0x5965, 0x899c}, {0x5967, 0x9afa}, {0x5968, 0x8fa7}, {0x5969, 0x9afc}, {0x596a, 0x9244}, {0x596c, 0x9afb}, {0x596e, 0x95b1}, {0x5973, 0x8f97}, {0x5974, 0x937a}, {0x5978, 0x9b40}, {0x597d, 0x8d44}, {0x5981, 0x9b41}, {0x5982, 0x9440}, {0x5983, 0x94dc}, {0x5984, 0x96cf}, {0x598a, 0x9444}, {0x598d, 0x9b4a}, {0x5993, 0x8b57}, {0x5996, 0x9764}, {0x5999, 0x96ad}, {0x599b, 0x9baa}, {0x599d, 0x9b42}, {0x59a3, 0x9b45}, {0x59a4, 0xfaa4}, {0x59a5, 0x91c3}, {0x59a8, 0x9657}, {0x59ac, 0x9369}, {0x59b2, 0x9b46}, {0x59b9, 0x9685}, {0x59ba, 0xfaa5}, {0x59bb, 0x8dc8}, {0x59be, 0x8fa8}, {0x59c6, 0x9b47}, {0x59c9, 0x8e6f}, {0x59cb, 0x8e6e}, {0x59d0, 0x88b7}, {0x59d1, 0x8cc6}, {0x59d3, 0x90a9}, {0x59d4, 0x88cf}, {0x59d9, 0x9b4b}, {0x59da, 0x9b4c}, {0x59dc, 0x9b49}, {0x59e5, 0x8957}, {0x59e6, 0x8aad}, {0x59e8, 0x9b48}, {0x59ea, 0x96c3}, {0x59eb, 0x9550}, {0x59f6, 0x88a6}, {0x59fb, 0x88f7}, {0x59ff, 0x8e70}, {0x5a01, 0x88d0}, {0x5a03, 0x88a1}, {0x5a09, 0x9b51}, {0x5a11, 0x9b4f}, {0x5a18, 0x96ba}, {0x5a1a, 0x9b52}, {0x5a1c, 0x9b50}, {0x5a1f, 0x9b4e}, {0x5a20, 0x9050}, {0x5a25, 0x9b4d}, {0x5a29, 0x95d8}, {0x5a2f, 0x8ce2}, {0x5a35, 0x9b56}, {0x5a36, 0x9b57}, {0x5a3c, 0x8fa9}, {0x5a40, 0x9b53}, {0x5a41, 0x984b}, {0x5a46, 0x946b}, {0x5a49, 0x9b55}, {0x5a5a, 0x8da5}, {0x5a62, 0x9b58}, {0x5a66, 0x9577}, {0x5a6a, 0x9b59}, {0x5a6c, 0x9b54}, {0x5a7f, 0x96b9}, {0x5a92, 0x947d}, {0x5a9a, 0x9b5a}, {0x5a9b, 0x9551}, {0x5abc, 0x9b5b}, {0x5abd, 0x9b5f}, {0x5abe, 0x9b5c}, {0x5ac1, 0x89c5}, {0x5ac2, 0x9b5e}, {0x5ac9, 0x8eb9}, {0x5acb, 0x9b5d}, {0x5acc, 0x8c99}, {0x5ad0, 0x9b6b}, {0x5ad6, 0x9b64}, {0x5ad7, 0x9b61}, {0x5ae1, 0x9284}, {0x5ae3, 0x9b60}, {0x5ae6, 0x9b62}, {0x5ae9, 0x9b63}, {0x5afa, 0x9b65}, {0x5afb, 0x9b66}, {0x5b09, 0x8af0}, {0x5b0b, 0x9b68}, {0x5b0c, 0x9b67}, {0x5b16, 0x9b69}, {0x5b22, 0x8fec}, {0x5b2a, 0x9b6c}, {0x5b2c, 0x92da}, {0x5b30, 0x8964}, {0x5b32, 0x9b6a}, {0x5b36, 0x9b6d}, {0x5b3e, 0x9b6e}, {0x5b40, 0x9b71}, {0x5b43, 0x9b6f}, {0x5b45, 0x9b70}, {0x5b50, 0x8e71}, {0x5b51, 0x9b72}, {0x5b54, 0x8d45}, {0x5b55, 0x9b73}, {0x5b56, 0xfaa6}, {0x5b57, 0x8e9a}, {0x5b58, 0x91b6}, {0x5b5a, 0x9b74}, {0x5b5b, 0x9b75}, {0x5b5c, 0x8e79}, {0x5b5d, 0x8d46}, {0x5b5f, 0x96d0}, {0x5b63, 0x8b47}, {0x5b64, 0x8cc7}, {0x5b65, 0x9b76}, {0x5b66, 0x8a77}, {0x5b69, 0x9b77}, {0x5b6b, 0x91b7}, {0x5b70, 0x9b78}, {0x5b71, 0x9ba1}, {0x5b73, 0x9b79}, {0x5b75, 0x9b7a}, {0x5b78, 0x9b7b}, {0x5b7a, 0x9b7d}, {0x5b80, 0x9b7e}, {0x5b83, 0x9b80}, {0x5b85, 0x91ee}, {0x5b87, 0x8946}, {0x5b88, 0x8ee7}, {0x5b89, 0x88c0}, {0x5b8b, 0x9176}, {0x5b8c, 0x8aae}, {0x5b8d, 0x8eb3}, {0x5b8f, 0x8d47}, {0x5b95, 0x9386}, {0x5b97, 0x8f40}, {0x5b98, 0x8aaf}, {0x5b99, 0x9288}, {0x5b9a, 0x92e8}, {0x5b9b, 0x88b6}, {0x5b9c, 0x8b58}, {0x5b9d, 0x95f3}, {0x5b9f, 0x8ec0}, {0x5ba2, 0x8b71}, {0x5ba3, 0x90e9}, {0x5ba4, 0x8eba}, {0x5ba5, 0x9747}, {0x5ba6, 0x9b81}, {0x5bae, 0x8b7b}, {0x5bb0, 0x8dc9}, {0x5bb3, 0x8a51}, {0x5bb4, 0x8983}, {0x5bb5, 0x8faa}, {0x5bb6, 0x89c6}, {0x5bb8, 0x9b82}, {0x5bb9, 0x9765}, {0x5bbf, 0x8f68}, {0x5bc0, 0xfaa7}, {0x5bc2, 0x8ee2}, {0x5bc3, 0x9b83}, {0x5bc4, 0x8af1}, {0x5bc5, 0x93d0}, {0x5bc6, 0x96a7}, {0x5bc7, 0x9b84}, {0x5bc9, 0x9b85}, {0x5bcc, 0x9578}, {0x5bd0, 0x9b87}, {0x5bd2, 0x8aa6}, {0x5bd3, 0x8bf5}, {0x5bd4, 0x9b86}, {0x5bd8, 0xfaa9}, {0x5bdb, 0x8ab0}, {0x5bdd, 0x9051}, {0x5bde, 0x9b8b}, {0x5bdf, 0x8e40}, {0x5be1, 0x89c7}, {0x5be2, 0x9b8a}, {0x5be4, 0x9b88}, {0x5be5, 0x9b8c}, {0x5be6, 0x9b89}, {0x5be7, 0x944a}, {0x5be8, 0x9ecb}, {0x5be9, 0x9052}, {0x5beb, 0x9b8d}, {0x5bec, 0xfaaa}, {0x5bee, 0x97be}, {0x5bf0, 0x9b8e}, {0x5bf3, 0x9b90}, {0x5bf5, 0x929e}, {0x5bf6, 0x9b8f}, {0x5bf8, 0x90a1}, {0x5bfa, 0x8e9b}, {0x5bfe, 0x91ce}, {0x5bff, 0x8ef5}, {0x5c01, 0x9595}, {0x5c02, 0x90ea}, {0x5c04, 0x8ecb}, {0x5c05, 0x9b91}, {0x5c06, 0x8fab}, {0x5c07, 0x9b92}, {0x5c08, 0x9b93}, {0x5c09, 0x88d1}, {0x5c0a, 0x91b8}, {0x5c0b, 0x9071}, {0x5c0d, 0x9b94}, {0x5c0e, 0x93b1}, {0x5c0f, 0x8fac}, {0x5c11, 0x8fad}, {0x5c13, 0x9b95}, {0x5c16, 0x90eb}, {0x5c1a, 0x8fae}, {0x5c1e, 0xfaab}, {0x5c20, 0x9b96}, {0x5c22, 0x9b97}, {0x5c24, 0x96de}, {0x5c28, 0x9b98}, {0x5c2d, 0x8bc4}, {0x5c31, 0x8f41}, {0x5c38, 0x9b99}, {0x5c39, 0x9b9a}, {0x5c3a, 0x8eda}, {0x5c3b, 0x904b}, {0x5c3c, 0x93f2}, {0x5c3d, 0x9073}, {0x5c3e, 0x94f6}, {0x5c3f, 0x9441}, {0x5c40, 0x8bc7}, {0x5c41, 0x9b9b}, {0x5c45, 0x8b8f}, {0x5c46, 0x9b9c}, {0x5c48, 0x8bfc}, {0x5c4a, 0x93cd}, {0x5c4b, 0x89ae}, {0x5c4d, 0x8e72}, {0x5c4e, 0x9b9d}, {0x5c4f, 0x9ba0}, {0x5c50, 0x9b9f}, {0x5c51, 0x8bfb}, {0x5c53, 0x9b9e}, {0x5c55, 0x9357}, {0x5c5e, 0x91ae}, {0x5c60, 0x936a}, {0x5c61, 0x8ec6}, {0x5c64, 0x9177}, {0x5c65, 0x979a}, {0x5c6c, 0x9ba2}, {0x5c6e, 0x9ba3}, {0x5c6f, 0x93d4}, {0x5c71, 0x8e52}, {0x5c76, 0x9ba5}, {0x5c79, 0x9ba6}, {0x5c8c, 0x9ba7}, {0x5c90, 0x8af2}, {0x5c91, 0x9ba8}, {0x5c94, 0x9ba9}, {0x5ca1, 0x89aa}, {0x5ca6, 0xfaac}, {0x5ca8, 0x915a}, {0x5ca9, 0x8ae2}, {0x5cab, 0x9bab}, {0x5cac, 0x96a6}, {0x5cb1, 0x91d0}, {0x5cb3, 0x8a78}, {0x5cb6, 0x9bad}, {0x5cb7, 0x9baf}, {0x5cb8, 0x8add}, {0x5cba, 0xfaad}, {0x5cbb, 0x9bac}, {0x5cbc, 0x9bae}, {0x5cbe, 0x9bb1}, {0x5cc5, 0x9bb0}, {0x5cc7, 0x9bb2}, {0x5cd9, 0x9bb3}, {0x5ce0, 0x93bb}, {0x5ce1, 0x8bac}, {0x5ce8, 0x89e3}, {0x5ce9, 0x9bb4}, {0x5cea, 0x9bb9}, {0x5ced, 0x9bb7}, {0x5cef, 0x95f5}, {0x5cf0, 0x95f4}, {0x5cf5, 0xfaae}, {0x5cf6, 0x9387}, {0x5cfa, 0x9bb6}, {0x5cfb, 0x8f73}, {0x5cfd, 0x9bb5}, {0x5d07, 0x9092}, {0x5d0b, 0x9bba}, {0x5d0e, 0x8de8}, {0x5d11, 0x9bc0}, {0x5d14, 0x9bc1}, {0x5d15, 0x9bbb}, {0x5d16, 0x8a52}, {0x5d17, 0x9bbc}, {0x5d18, 0x9bc5}, {0x5d19, 0x9bc4}, {0x5d1a, 0x9bc3}, {0x5d1b, 0x9bbf}, {0x5d1f, 0x9bbe}, {0x5d22, 0x9bc2}, {0x5d27, 0xfaaf}, {0x5d29, 0x95f6}, {0x5d42, 0xfab2}, {0x5d4b, 0x9bc9}, {0x5d4c, 0x9bc6}, {0x5d4e, 0x9bc8}, {0x5d50, 0x9792}, {0x5d52, 0x9bc7}, {0x5d53, 0xfab0}, {0x5d5c, 0x9bbd}, {0x5d69, 0x9093}, {0x5d6c, 0x9bca}, {0x5d6d, 0xfab3}, {0x5d6f, 0x8db5}, {0x5d73, 0x9bcb}, {0x5d76, 0x9bcc}, {0x5d82, 0x9bcf}, {0x5d84, 0x9bce}, {0x5d87, 0x9bcd}, {0x5d8b, 0x9388}, {0x5d8c, 0x9bb8}, {0x5d90, 0x9bd5}, {0x5d9d, 0x9bd1}, {0x5da2, 0x9bd0}, {0x5dac, 0x9bd2}, {0x5dae, 0x9bd3}, {0x5db7, 0x9bd6}, {0x5db8, 0xfab4}, {0x5db9, 0xfab5}, {0x5dba, 0x97e4}, {0x5dbc, 0x9bd7}, {0x5dbd, 0x9bd4}, {0x5dc9, 0x9bd8}, {0x5dcc, 0x8ade}, {0x5dcd, 0x9bd9}, {0x5dd0, 0xfab6}, {0x5dd2, 0x9bdb}, {0x5dd3, 0x9bda}, {0x5dd6, 0x9bdc}, {0x5ddb, 0x9bdd}, {0x5ddd, 0x90ec}, {0x5dde, 0x8f42}, {0x5de1, 0x8f84}, {0x5de3, 0x9183}, {0x5de5, 0x8d48}, {0x5de6, 0x8db6}, {0x5de7, 0x8d49}, {0x5de8, 0x8b90}, {0x5deb, 0x9bde}, {0x5dee, 0x8db7}, {0x5df1, 0x8cc8}, {0x5df2, 0x9bdf}, {0x5df3, 0x96a4}, {0x5df4, 0x9462}, {0x5df5, 0x9be0}, {0x5df7, 0x8d4a}, {0x5dfb, 0x8aaa}, {0x5dfd, 0x9246}, {0x5dfe, 0x8bd0}, {0x5e02, 0x8e73}, {0x5e03, 0x957a}, {0x5e06, 0x94bf}, {0x5e0b, 0x9be1}, {0x5e0c, 0x8af3}, {0x5e11, 0x9be4}, {0x5e16, 0x929f}, {0x5e19, 0x9be3}, {0x5e1a, 0x9be2}, {0x5e1b, 0x9be5}, {0x5e1d, 0x92e9}, {0x5e25, 0x9083}, {0x5e2b, 0x8e74}, {0x5e2d, 0x90c8}, {0x5e2f, 0x91d1}, {0x5e30, 0x8b41}, {0x5e33, 0x92a0}, {0x5e36, 0x9be6}, {0x5e37, 0x9be7}, {0x5e38, 0x8fed}, {0x5e3d, 0x9658}, {0x5e40, 0x9bea}, {0x5e43, 0x9be9}, {0x5e44, 0x9be8}, {0x5e45, 0x959d}, {0x5e47, 0x9bf1}, {0x5e4c, 0x9679}, {0x5e4e, 0x9beb}, {0x5e54, 0x9bed}, {0x5e55, 0x968b}, {0x5e57, 0x9bec}, {0x5e5f, 0x9bee}, {0x5e61, 0x94a6}, {0x5e62, 0x9bef}, {0x5e63, 0x95bc}, {0x5e64, 0x9bf0}, {0x5e72, 0x8ab1}, {0x5e73, 0x95bd}, {0x5e74, 0x944e}, {0x5e75, 0x9bf2}, {0x5e76, 0x9bf3}, {0x5e78, 0x8d4b}, {0x5e79, 0x8ab2}, {0x5e7a, 0x9bf4}, {0x5e7b, 0x8cb6}, {0x5e7c, 0x9763}, {0x5e7d, 0x9748}, {0x5e7e, 0x8af4}, {0x5e7f, 0x9bf6}, {0x5e81, 0x92a1}, {0x5e83, 0x8d4c}, {0x5e84, 0x8faf}, {0x5e87, 0x94dd}, {0x5e8a, 0x8fb0}, {0x5e8f, 0x8f98}, {0x5e95, 0x92ea}, {0x5e96, 0x95f7}, {0x5e97, 0x9358}, {0x5e9a, 0x8d4d}, {0x5e9c, 0x957b}, {0x5ea0, 0x9bf7}, {0x5ea6, 0x9378}, {0x5ea7, 0x8dc0}, {0x5eab, 0x8cc9}, {0x5ead, 0x92eb}, {0x5eb5, 0x88c1}, {0x5eb6, 0x8f8e}, {0x5eb7, 0x8d4e}, {0x5eb8, 0x9766}, {0x5ec1, 0x9bf8}, {0x5ec2, 0x9bf9}, {0x5ec3, 0x9470}, {0x5ec8, 0x9bfa}, {0x5ec9, 0x97f5}, {0x5eca, 0x984c}, {0x5ecf, 0x9bfc}, {0x5ed0, 0x9bfb}, {0x5ed3, 0x8a66}, {0x5ed6, 0x9c40}, {0x5eda, 0x9c43}, {0x5edb, 0x9c44}, {0x5edd, 0x9c42}, {0x5edf, 0x955f}, {0x5ee0, 0x8fb1}, {0x5ee1, 0x9c46}, {0x5ee2, 0x9c45}, {0x5ee3, 0x9c41}, {0x5ee8, 0x9c47}, {0x5ee9, 0x9c48}, {0x5eec, 0x9c49}, {0x5ef0, 0x9c4c}, {0x5ef1, 0x9c4a}, {0x5ef3, 0x9c4b}, {0x5ef4, 0x9c4d}, {0x5ef6, 0x8984}, {0x5ef7, 0x92ec}, {0x5ef8, 0x9c4e}, {0x5efa, 0x8c9a}, {0x5efb, 0x89f4}, {0x5efc, 0x9455}, {0x5efe, 0x9c4f}, {0x5eff, 0x93f9}, {0x5f01, 0x95d9}, {0x5f03, 0x9c50}, {0x5f04, 0x984d}, {0x5f09, 0x9c51}, {0x5f0a, 0x95be}, {0x5f0b, 0x9c54}, {0x5f0c, 0x989f}, {0x5f0d, 0x98af}, {0x5f0f, 0x8eae}, {0x5f10, 0x93f3}, {0x5f11, 0x9c55}, {0x5f13, 0x8b7c}, {0x5f14, 0x92a2}, {0x5f15, 0x88f8}, {0x5f16, 0x9c56}, {0x5f17, 0x95a4}, {0x5f18, 0x8d4f}, {0x5f1b, 0x926f}, {0x5f1f, 0x92ed}, {0x5f21, 0xfab7}, {0x5f25, 0x96ed}, {0x5f26, 0x8cb7}, {0x5f27, 0x8cca}, {0x5f29, 0x9c57}, {0x5f2d, 0x9c58}, {0x5f2f, 0x9c5e}, {0x5f31, 0x8ee3}, {0x5f34, 0xfab8}, {0x5f35, 0x92a3}, {0x5f37, 0x8bad}, {0x5f38, 0x9c59}, {0x5f3c, 0x954a}, {0x5f3e, 0x9265}, {0x5f41, 0x9c5a}, {0x5f45, 0xfa67}, {0x5f48, 0x9c5b}, {0x5f4a, 0x8bae}, {0x5f4c, 0x9c5c}, {0x5f4e, 0x9c5d}, {0x5f51, 0x9c5f}, {0x5f53, 0x9396}, {0x5f56, 0x9c60}, {0x5f57, 0x9c61}, {0x5f59, 0x9c62}, {0x5f5c, 0x9c53}, {0x5f5d, 0x9c52}, {0x5f61, 0x9c63}, {0x5f62, 0x8c60}, {0x5f66, 0x9546}, {0x5f67, 0xfab9}, {0x5f69, 0x8dca}, {0x5f6a, 0x9556}, {0x5f6b, 0x92a4}, {0x5f6c, 0x956a}, {0x5f6d, 0x9c64}, {0x5f70, 0x8fb2}, {0x5f71, 0x8965}, {0x5f73, 0x9c65}, {0x5f77, 0x9c66}, {0x5f79, 0x96f0}, {0x5f7c, 0x94de}, {0x5f7f, 0x9c69}, {0x5f80, 0x899d}, {0x5f81, 0x90aa}, {0x5f82, 0x9c68}, {0x5f83, 0x9c67}, {0x5f84, 0x8c61}, {0x5f85, 0x91d2}, {0x5f87, 0x9c6d}, {0x5f88, 0x9c6b}, {0x5f8a, 0x9c6a}, {0x5f8b, 0x97a5}, {0x5f8c, 0x8ce3}, {0x5f90, 0x8f99}, {0x5f91, 0x9c6c}, {0x5f92, 0x936b}, {0x5f93, 0x8f5d}, {0x5f97, 0x93be}, {0x5f98, 0x9c70}, {0x5f99, 0x9c6f}, {0x5f9e, 0x9c6e}, {0x5fa0, 0x9c71}, {0x5fa1, 0x8ce4}, {0x5fa8, 0x9c72}, {0x5fa9, 0x959c}, {0x5faa, 0x8f7a}, {0x5fad, 0x9c73}, {0x5fae, 0x94f7}, {0x5fb3, 0x93bf}, {0x5fb4, 0x92a5}, {0x5fb7, 0xfaba}, {0x5fb9, 0x934f}, {0x5fbc, 0x9c74}, {0x5fbd, 0x8b4a}, {0x5fc3, 0x9053}, {0x5fc5, 0x954b}, {0x5fcc, 0x8af5}, {0x5fcd, 0x9445}, {0x5fd6, 0x9c75}, {0x5fd7, 0x8e75}, {0x5fd8, 0x9659}, {0x5fd9, 0x965a}, {0x5fdc, 0x899e}, {0x5fdd, 0x9c7a}, {0x5fde, 0xfabb}, {0x5fe0, 0x9289}, {0x5fe4, 0x9c77}, {0x5feb, 0x89f5}, {0x5ff0, 0x9cab}, {0x5ff1, 0x9c79}, {0x5ff5, 0x944f}, {0x5ff8, 0x9c78}, {0x5ffb, 0x9c76}, {0x5ffd, 0x8d9a}, {0x5fff, 0x9c7c}, {0x600e, 0x9c83}, {0x600f, 0x9c89}, {0x6010, 0x9c81}, {0x6012, 0x937b}, {0x6015, 0x9c86}, {0x6016, 0x957c}, {0x6019, 0x9c80}, {0x601b, 0x9c85}, {0x601c, 0x97e5}, {0x601d, 0x8e76}, {0x6020, 0x91d3}, {0x6021, 0x9c7d}, {0x6025, 0x8b7d}, {0x6026, 0x9c88}, {0x6027, 0x90ab}, {0x6028, 0x8985}, {0x6029, 0x9c82}, {0x602a, 0x89f6}, {0x602b, 0x9c87}, {0x602f, 0x8baf}, {0x6031, 0x9c84}, {0x603a, 0x9c8a}, {0x6041, 0x9c8c}, {0x6042, 0x9c96}, {0x6043, 0x9c94}, {0x6046, 0x9c91}, {0x604a, 0x9c90}, {0x604b, 0x97f6}, {0x604d, 0x9c92}, {0x6050, 0x8bb0}, {0x6052, 0x8d50}, {0x6055, 0x8f9a}, {0x6059, 0x9c99}, {0x605a, 0x9c8b}, {0x605d, 0xfabc}, {0x605f, 0x9c8f}, {0x6060, 0x9c7e}, {0x6062, 0x89f8}, {0x6063, 0x9c93}, {0x6064, 0x9c95}, {0x6065, 0x9270}, {0x6068, 0x8da6}, {0x6069, 0x89b6}, {0x606a, 0x9c8d}, {0x606b, 0x9c98}, {0x606c, 0x9c97}, {0x606d, 0x8bb1}, {0x606f, 0x91a7}, {0x6070, 0x8a86}, {0x6075, 0x8c62}, {0x6077, 0x9c8e}, {0x6081, 0x9c9a}, {0x6083, 0x9c9d}, {0x6084, 0x9c9f}, {0x6085, 0xfabd}, {0x6089, 0x8ebb}, {0x608a, 0xfabe}, {0x608b, 0x9ca5}, {0x608c, 0x92ee}, {0x608d, 0x9c9b}, {0x6092, 0x9ca3}, {0x6094, 0x89f7}, {0x6096, 0x9ca1}, {0x6097, 0x9ca2}, {0x609a, 0x9c9e}, {0x609b, 0x9ca0}, {0x609f, 0x8ce5}, {0x60a0, 0x9749}, {0x60a3, 0x8ab3}, {0x60a6, 0x8978}, {0x60a7, 0x9ca4}, {0x60a9, 0x9459}, {0x60aa, 0x88ab}, {0x60b2, 0x94df}, {0x60b3, 0x9c7b}, {0x60b4, 0x9caa}, {0x60b5, 0x9cae}, {0x60b6, 0x96e3}, {0x60b8, 0x9ca7}, {0x60bc, 0x9389}, {0x60bd, 0x9cac}, {0x60c5, 0x8fee}, {0x60c6, 0x9cad}, {0x60c7, 0x93d5}, {0x60d1, 0x9866}, {0x60d3, 0x9ca9}, {0x60d5, 0xfac0}, {0x60d8, 0x9caf}, {0x60da, 0x8d9b}, {0x60dc, 0x90c9}, {0x60de, 0xfabf}, {0x60df, 0x88d2}, {0x60e0, 0x9ca8}, {0x60e1, 0x9ca6}, {0x60e3, 0x9179}, {0x60e7, 0x9c9c}, {0x60e8, 0x8e53}, {0x60f0, 0x91c4}, {0x60f1, 0x9cbb}, {0x60f2, 0xfac2}, {0x60f3, 0x917a}, {0x60f4, 0x9cb6}, {0x60f6, 0x9cb3}, {0x60f7, 0x9cb4}, {0x60f9, 0x8ee4}, {0x60fa, 0x9cb7}, {0x60fb, 0x9cba}, {0x6100, 0x9cb5}, {0x6101, 0x8f44}, {0x6103, 0x9cb8}, {0x6106, 0x9cb2}, {0x6108, 0x96fa}, {0x6109, 0x96f9}, {0x610d, 0x9cbc}, {0x610e, 0x9cbd}, {0x610f, 0x88d3}, {0x6111, 0xfac3}, {0x6115, 0x9cb1}, {0x611a, 0x8bf0}, {0x611b, 0x88a4}, {0x611f, 0x8ab4}, {0x6120, 0xfac1}, {0x6121, 0x9cb9}, {0x6127, 0x9cc1}, {0x6128, 0x9cc0}, {0x612c, 0x9cc5}, {0x6130, 0xfac5}, {0x6134, 0x9cc6}, {0x6137, 0xfac4}, {0x613c, 0x9cc4}, {0x613d, 0x9cc7}, {0x613e, 0x9cbf}, {0x613f, 0x9cc3}, {0x6142, 0x9cc8}, {0x6144, 0x9cc9}, {0x6147, 0x9cbe}, {0x6148, 0x8e9c}, {0x614a, 0x9cc2}, {0x614b, 0x91d4}, {0x614c, 0x8d51}, {0x614d, 0x9cb0}, {0x614e, 0x9054}, {0x6153, 0x9cd6}, {0x6155, 0x95e7}, {0x6158, 0x9ccc}, {0x6159, 0x9ccd}, {0x615a, 0x9cce}, {0x615d, 0x9cd5}, {0x615f, 0x9cd4}, {0x6162, 0x969d}, {0x6163, 0x8ab5}, {0x6165, 0x9cd2}, {0x6167, 0x8c64}, {0x6168, 0x8a53}, {0x616b, 0x9ccf}, {0x616e, 0x97b6}, {0x616f, 0x9cd1}, {0x6170, 0x88d4}, {0x6171, 0x9cd3}, {0x6173, 0x9cca}, {0x6174, 0x9cd0}, {0x6175, 0x9cd7}, {0x6176, 0x8c63}, {0x6177, 0x9ccb}, {0x617e, 0x977c}, {0x6182, 0x974a}, {0x6187, 0x9cda}, {0x618a, 0x9cde}, {0x618e, 0x919e}, {0x6190, 0x97f7}, {0x6191, 0x9cdf}, {0x6194, 0x9cdc}, {0x6196, 0x9cd9}, {0x6198, 0xfac6}, {0x6199, 0x9cd8}, {0x619a, 0x9cdd}, {0x61a4, 0x95ae}, {0x61a7, 0x93b2}, {0x61a9, 0x8c65}, {0x61ab, 0x9ce0}, {0x61ac, 0x9cdb}, {0x61ae, 0x9ce1}, {0x61b2, 0x8c9b}, {0x61b6, 0x89af}, {0x61ba, 0x9ce9}, {0x61be, 0x8ab6}, {0x61c3, 0x9ce7}, {0x61c6, 0x9ce8}, {0x61c7, 0x8da7}, {0x61c8, 0x9ce6}, {0x61c9, 0x9ce4}, {0x61ca, 0x9ce3}, {0x61cb, 0x9cea}, {0x61cc, 0x9ce2}, {0x61cd, 0x9cec}, {0x61d0, 0x89f9}, {0x61e3, 0x9cee}, {0x61e6, 0x9ced}, {0x61f2, 0x92a6}, {0x61f4, 0x9cf1}, {0x61f6, 0x9cef}, {0x61f7, 0x9ce5}, {0x61f8, 0x8c9c}, {0x61fa, 0x9cf0}, {0x61fc, 0x9cf4}, {0x61fd, 0x9cf3}, {0x61fe, 0x9cf5}, {0x61ff, 0x9cf2}, {0x6200, 0x9cf6}, {0x6208, 0x9cf7}, {0x6209, 0x9cf8}, {0x620a, 0x95e8}, {0x620c, 0x9cfa}, {0x620d, 0x9cf9}, {0x620e, 0x8f5e}, {0x6210, 0x90ac}, {0x6211, 0x89e4}, {0x6212, 0x89fa}, {0x6213, 0xfac7}, {0x6214, 0x9cfb}, {0x6216, 0x88bd}, {0x621a, 0x90ca}, {0x621b, 0x9cfc}, {0x621d, 0xe6c1}, {0x621e, 0x9d40}, {0x621f, 0x8c81}, {0x6221, 0x9d41}, {0x6226, 0x90ed}, {0x622a, 0x9d42}, {0x622e, 0x9d43}, {0x622f, 0x8b59}, {0x6230, 0x9d44}, {0x6232, 0x9d45}, {0x6233, 0x9d46}, {0x6234, 0x91d5}, {0x6238, 0x8ccb}, {0x623b, 0x96df}, {0x623f, 0x965b}, {0x6240, 0x8f8a}, {0x6241, 0x9d47}, {0x6247, 0x90ee}, {0x6248, 0xe7bb}, {0x6249, 0x94e0}, {0x624b, 0x8ee8}, {0x624d, 0x8dcb}, {0x624e, 0x9d48}, {0x6253, 0x91c5}, {0x6255, 0x95a5}, {0x6258, 0x91ef}, {0x625b, 0x9d4b}, {0x625e, 0x9d49}, {0x6260, 0x9d4c}, {0x6263, 0x9d4a}, {0x6268, 0x9d4d}, {0x626e, 0x95af}, {0x6271, 0x88b5}, {0x6276, 0x957d}, {0x6279, 0x94e1}, {0x627c, 0x9d4e}, {0x627e, 0x9d51}, {0x627f, 0x8fb3}, {0x6280, 0x8b5a}, {0x6282, 0x9d4f}, {0x6283, 0x9d56}, {0x6284, 0x8fb4}, {0x6289, 0x9d50}, {0x628a, 0x9463}, {0x6291, 0x977d}, {0x6292, 0x9d52}, {0x6293, 0x9d53}, {0x6294, 0x9d57}, {0x6295, 0x938a}, {0x6296, 0x9d54}, {0x6297, 0x8d52}, {0x6298, 0x90dc}, {0x629b, 0x9d65}, {0x629c, 0x94b2}, {0x629e, 0x91f0}, {0x62a6, 0xfac8}, {0x62ab, 0x94e2}, {0x62ac, 0x9dab}, {0x62b1, 0x95f8}, {0x62b5, 0x92ef}, {0x62b9, 0x9695}, {0x62bb, 0x9d5a}, {0x62bc, 0x899f}, {0x62bd, 0x928a}, {0x62c2, 0x9d63}, {0x62c5, 0x9253}, {0x62c6, 0x9d5d}, {0x62c7, 0x9d64}, {0x62c8, 0x9d5f}, {0x62c9, 0x9d66}, {0x62ca, 0x9d62}, {0x62cc, 0x9d61}, {0x62cd, 0x948f}, {0x62cf, 0x9d5b}, {0x62d0, 0x89fb}, {0x62d1, 0x9d59}, {0x62d2, 0x8b91}, {0x62d3, 0x91f1}, {0x62d4, 0x9d55}, {0x62d7, 0x9d58}, {0x62d8, 0x8d53}, {0x62d9, 0x90d9}, {0x62db, 0x8fb5}, {0x62dc, 0x9d60}, {0x62dd, 0x9471}, {0x62e0, 0x8b92}, {0x62e1, 0x8a67}, {0x62ec, 0x8a87}, {0x62ed, 0x9040}, {0x62ee, 0x9d68}, {0x62ef, 0x9d6d}, {0x62f1, 0x9d69}, {0x62f3, 0x8c9d}, {0x62f5, 0x9d6e}, {0x62f6, 0x8e41}, {0x62f7, 0x8d89}, {0x62fe, 0x8f45}, {0x62ff, 0x9d5c}, {0x6301, 0x8e9d}, {0x6302, 0x9d6b}, {0x6307, 0x8e77}, {0x6308, 0x9d6c}, {0x6309, 0x88c2}, {0x630c, 0x9d67}, {0x6311, 0x92a7}, {0x6319, 0x8b93}, {0x631f, 0x8bb2}, {0x6327, 0x9d6a}, {0x6328, 0x88a5}, {0x632b, 0x8dc1}, {0x632f, 0x9055}, {0x633a, 0x92f0}, {0x633d, 0x94d2}, {0x633e, 0x9d70}, {0x633f, 0x917d}, {0x6349, 0x91a8}, {0x634c, 0x8e4a}, {0x634d, 0x9d71}, {0x634f, 0x9d73}, {0x6350, 0x9d6f}, {0x6355, 0x95df}, {0x6357, 0x92bb}, {0x635c, 0x917b}, {0x6367, 0x95f9}, {0x6368, 0x8ecc}, {0x6369, 0x9d80}, {0x636b, 0x9d7e}, {0x636e, 0x9098}, {0x6372, 0x8c9e}, {0x6376, 0x9d78}, {0x6377, 0x8fb7}, {0x637a, 0x93e6}, {0x637b, 0x9450}, {0x6380, 0x9d76}, {0x6383, 0x917c}, {0x6388, 0x8ef6}, {0x6389, 0x9d7b}, {0x638c, 0x8fb6}, {0x638e, 0x9d75}, {0x638f, 0x9d7a}, {0x6392, 0x9472}, {0x6396, 0x9d74}, {0x6398, 0x8c40}, {0x639b, 0x8a7c}, {0x639f, 0x9d7c}, {0x63a0, 0x97a9}, {0x63a1, 0x8dcc}, {0x63a2, 0x9254}, {0x63a3, 0x9d79}, {0x63a5, 0x90da}, {0x63a7, 0x8d54}, {0x63a8, 0x9084}, {0x63a9, 0x8986}, {0x63aa, 0x915b}, {0x63ab, 0x9d77}, {0x63ac, 0x8b64}, {0x63b2, 0x8c66}, {0x63b4, 0x92cd}, {0x63b5, 0x9d7d}, {0x63bb, 0x917e}, {0x63be, 0x9d81}, {0x63c0, 0x9d83}, {0x63c3, 0x91b5}, {0x63c4, 0x9d89}, {0x63c6, 0x9d84}, {0x63c9, 0x9d86}, {0x63cf, 0x9560}, {0x63d0, 0x92f1}, {0x63d2, 0x9d87}, {0x63d6, 0x974b}, {0x63da, 0x9767}, {0x63db, 0x8ab7}, {0x63e1, 0x88ac}, {0x63e3, 0x9d85}, {0x63e9, 0x9d82}, {0x63ee, 0x8af6}, {0x63f4, 0x8987}, {0x63f5, 0xfac9}, {0x63f6, 0x9d88}, {0x63fa, 0x9768}, {0x6406, 0x9d8c}, {0x640d, 0x91b9}, {0x640f, 0x9d93}, {0x6413, 0x9d8d}, {0x6416, 0x9d8a}, {0x6417, 0x9d91}, {0x641c, 0x9d72}, {0x6426, 0x9d8e}, {0x6428, 0x9d92}, {0x642c, 0x94c0}, {0x642d, 0x938b}, {0x6434, 0x9d8b}, {0x6436, 0x9d8f}, {0x643a, 0x8c67}, {0x643e, 0x8def}, {0x6442, 0x90db}, {0x644e, 0x9d97}, {0x6458, 0x9345}, {0x6460, 0xfaca}, {0x6467, 0x9d94}, {0x6469, 0x9680}, {0x646f, 0x9d95}, {0x6476, 0x9d96}, {0x6478, 0x96cc}, {0x647a, 0x90a0}, {0x6483, 0x8c82}, {0x6488, 0x9d9d}, {0x6492, 0x8e54}, {0x6493, 0x9d9a}, {0x6495, 0x9d99}, {0x649a, 0x9451}, {0x649d, 0xfacb}, {0x649e, 0x93b3}, {0x64a4, 0x9350}, {0x64a5, 0x9d9b}, {0x64a9, 0x9d9c}, {0x64ab, 0x958f}, {0x64ad, 0x9464}, {0x64ae, 0x8e42}, {0x64b0, 0x90ef}, {0x64b2, 0x966f}, {0x64b9, 0x8a68}, {0x64bb, 0x9da3}, {0x64bc, 0x9d9e}, {0x64c1, 0x9769}, {0x64c2, 0x9da5}, {0x64c5, 0x9da1}, {0x64c7, 0x9da2}, {0x64cd, 0x9180}, {0x64ce, 0xfacc}, {0x64d2, 0x9da0}, {0x64d4, 0x9d5e}, {0x64d8, 0x9da4}, {0x64da, 0x9d9f}, {0x64e0, 0x9da9}, {0x64e1, 0x9daa}, {0x64e2, 0x9346}, {0x64e3, 0x9dac}, {0x64e6, 0x8e43}, {0x64e7, 0x9da7}, {0x64ec, 0x8b5b}, {0x64ef, 0x9dad}, {0x64f1, 0x9da6}, {0x64f2, 0x9db1}, {0x64f4, 0x9db0}, {0x64f6, 0x9daf}, {0x64fa, 0x9db2}, {0x64fd, 0x9db4}, {0x64fe, 0x8fef}, {0x6500, 0x9db3}, {0x6505, 0x9db7}, {0x6518, 0x9db5}, {0x651c, 0x9db6}, {0x651d, 0x9d90}, {0x6523, 0x9db9}, {0x6524, 0x9db8}, {0x652a, 0x9d98}, {0x652b, 0x9dba}, {0x652c, 0x9dae}, {0x652f, 0x8e78}, {0x6534, 0x9dbb}, {0x6535, 0x9dbc}, {0x6536, 0x9dbe}, {0x6537, 0x9dbd}, {0x6538, 0x9dbf}, {0x6539, 0x89fc}, {0x653b, 0x8d55}, {0x653e, 0x95fa}, {0x653f, 0x90ad}, {0x6545, 0x8ccc}, {0x6548, 0x9dc1}, {0x654d, 0x9dc4}, {0x654e, 0xfacd}, {0x654f, 0x9571}, {0x6551, 0x8b7e}, {0x6555, 0x9dc3}, {0x6556, 0x9dc2}, {0x6557, 0x9473}, {0x6558, 0x9dc5}, {0x6559, 0x8bb3}, {0x655d, 0x9dc7}, {0x655e, 0x9dc6}, {0x6562, 0x8ab8}, {0x6563, 0x8e55}, {0x6566, 0x93d6}, {0x656c, 0x8c68}, {0x6570, 0x9094}, {0x6572, 0x9dc8}, {0x6574, 0x90ae}, {0x6575, 0x9347}, {0x6577, 0x957e}, {0x6578, 0x9dc9}, {0x6582, 0x9dca}, {0x6583, 0x9dcb}, {0x6587, 0x95b6}, {0x6588, 0x9b7c}, {0x6589, 0x90c4}, {0x658c, 0x956b}, {0x658e, 0x8dd6}, {0x6590, 0x94e3}, {0x6591, 0x94c1}, {0x6597, 0x936c}, {0x6599, 0x97bf}, {0x659b, 0x9dcd}, {0x659c, 0x8ece}, {0x659f, 0x9dce}, {0x65a1, 0x88b4}, {0x65a4, 0x8bd2}, {0x65a5, 0x90cb}, {0x65a7, 0x9580}, {0x65ab, 0x9dcf}, {0x65ac, 0x8e61}, {0x65ad, 0x9266}, {0x65af, 0x8e7a}, {0x65b0, 0x9056}, {0x65b7, 0x9dd0}, {0x65b9, 0x95fb}, {0x65bc, 0x8997}, {0x65bd, 0x8e7b}, {0x65c1, 0x9dd3}, {0x65c3, 0x9dd1}, {0x65c4, 0x9dd4}, {0x65c5, 0x97b7}, {0x65c6, 0x9dd2}, {0x65cb, 0x90f9}, {0x65cc, 0x9dd5}, {0x65cf, 0x91b0}, {0x65d2, 0x9dd6}, {0x65d7, 0x8af8}, {0x65d9, 0x9dd8}, {0x65db, 0x9dd7}, {0x65e0, 0x9dd9}, {0x65e1, 0x9dda}, {0x65e2, 0x8af9}, {0x65e5, 0x93fa}, {0x65e6, 0x9255}, {0x65e7, 0x8b8c}, {0x65e8, 0x8e7c}, {0x65e9, 0x9181}, {0x65ec, 0x8f7b}, {0x65ed, 0x88ae}, {0x65f1, 0x9ddb}, {0x65fa, 0x89a0}, {0x65fb, 0x9ddf}, {0x6600, 0xface}, {0x6602, 0x8d56}, {0x6603, 0x9dde}, {0x6606, 0x8da9}, {0x6607, 0x8fb8}, {0x6609, 0xfad1}, {0x660a, 0x9ddd}, {0x660c, 0x8fb9}, {0x660e, 0x96be}, {0x660f, 0x8da8}, {0x6613, 0x88d5}, {0x6614, 0x90cc}, {0x6615, 0xfacf}, {0x661c, 0x9de4}, {0x661e, 0xfad3}, {0x661f, 0x90af}, {0x6620, 0x8966}, {0x6624, 0xfad4}, {0x6625, 0x8f74}, {0x6627, 0x9686}, {0x6628, 0x8df0}, {0x662d, 0x8fba}, {0x662e, 0xfad2}, {0x662f, 0x90a5}, {0x6631, 0xfa63}, {0x6634, 0x9de3}, {0x6635, 0x9de1}, {0x6636, 0x9de2}, {0x663b, 0xfad0}, {0x663c, 0x928b}, {0x663f, 0x9e45}, {0x6641, 0x9de8}, {0x6642, 0x8e9e}, {0x6643, 0x8d57}, {0x6644, 0x9de6}, {0x6649, 0x9de7}, {0x664b, 0x9057}, {0x664f, 0x9de5}, {0x6652, 0x8e4e}, {0x6657, 0xfad6}, {0x6659, 0xfad7}, {0x665d, 0x9dea}, {0x665e, 0x9de9}, {0x665f, 0x9dee}, {0x6662, 0x9def}, {0x6664, 0x9deb}, {0x6665, 0xfad5}, {0x6666, 0x8a41}, {0x6667, 0x9dec}, {0x6668, 0x9ded}, {0x6669, 0x94d3}, {0x666e, 0x9581}, {0x666f, 0x8c69}, {0x6670, 0x9df0}, {0x6673, 0xfad9}, {0x6674, 0x90b0}, {0x6676, 0x8fbb}, {0x667a, 0x9271}, {0x6681, 0x8bc5}, {0x6683, 0x9df1}, {0x6684, 0x9df5}, {0x6687, 0x89c9}, {0x6688, 0x9df2}, {0x6689, 0x9df4}, {0x668e, 0x9df3}, {0x6691, 0x8f8b}, {0x6696, 0x9267}, {0x6697, 0x88c3}, {0x6698, 0x9df6}, {0x6699, 0xfada}, {0x669d, 0x9df7}, {0x66a0, 0xfadb}, {0x66a2, 0x92a8}, {0x66a6, 0x97ef}, {0x66ab, 0x8e62}, {0x66ae, 0x95e9}, {0x66b2, 0xfadc}, {0x66b4, 0x965c}, {0x66b8, 0x9e41}, {0x66b9, 0x9df9}, {0x66bc, 0x9dfc}, {0x66be, 0x9dfb}, {0x66bf, 0xfadd}, {0x66c1, 0x9df8}, {0x66c4, 0x9e40}, {0x66c7, 0x93dc}, {0x66c9, 0x9dfa}, {0x66d6, 0x9e42}, {0x66d9, 0x8f8c}, {0x66da, 0x9e43}, {0x66dc, 0x976a}, {0x66dd, 0x9498}, {0x66e0, 0x9e44}, {0x66e6, 0x9e46}, {0x66e9, 0x9e47}, {0x66f0, 0x9e48}, {0x66f2, 0x8bc8}, {0x66f3, 0x8967}, {0x66f4, 0x8d58}, {0x66f5, 0x9e49}, {0x66f7, 0x9e4a}, {0x66f8, 0x8f91}, {0x66f9, 0x9182}, {0x66fa, 0xfade}, {0x66fb, 0xfa66}, {0x66fc, 0x99d6}, {0x66fd, 0x915d}, {0x66fe, 0x915c}, {0x66ff, 0x91d6}, {0x6700, 0x8dc5}, {0x6703, 0x98f0}, {0x6708, 0x8c8e}, {0x6709, 0x974c}, {0x670b, 0x95fc}, {0x670d, 0x959e}, {0x670e, 0xfadf}, {0x670f, 0x9e4b}, {0x6714, 0x8df1}, {0x6715, 0x92bd}, {0x6716, 0x9e4c}, {0x6717, 0x984e}, {0x671b, 0x965d}, {0x671d, 0x92a9}, {0x671e, 0x9e4d}, {0x671f, 0x8afa}, {0x6726, 0x9e4e}, {0x6727, 0x9e4f}, {0x6728, 0x96d8}, {0x672a, 0x96a2}, {0x672b, 0x9696}, {0x672c, 0x967b}, {0x672d, 0x8e44}, {0x672e, 0x9e51}, {0x6731, 0x8ee9}, {0x6734, 0x9670}, {0x6736, 0x9e53}, {0x6737, 0x9e56}, {0x6738, 0x9e55}, {0x673a, 0x8af7}, {0x673d, 0x8b80}, {0x673f, 0x9e52}, {0x6741, 0x9e54}, {0x6746, 0x9e57}, {0x6749, 0x9099}, {0x674e, 0x979b}, {0x674f, 0x88c7}, {0x6750, 0x8dde}, {0x6751, 0x91ba}, {0x6753, 0x8edb}, {0x6756, 0x8ff1}, {0x6759, 0x9e5a}, {0x675c, 0x936d}, {0x675e, 0x9e58}, {0x675f, 0x91a9}, {0x6760, 0x9e59}, {0x6761, 0x8ff0}, {0x6762, 0x96db}, {0x6763, 0x9e5b}, {0x6764, 0x9e5c}, {0x6765, 0x9788}, {0x6766, 0xfae1}, {0x676a, 0x9e61}, {0x676d, 0x8d59}, {0x676f, 0x9474}, {0x6770, 0x9e5e}, {0x6771, 0x938c}, {0x6772, 0x9ddc}, {0x6773, 0x9de0}, {0x6775, 0x8b6e}, {0x6777, 0x9466}, {0x677c, 0x9e60}, {0x677e, 0x8fbc}, {0x677f, 0x94c2}, {0x6785, 0x9e66}, {0x6787, 0x94f8}, {0x6789, 0x9e5d}, {0x678b, 0x9e63}, {0x678c, 0x9e62}, {0x6790, 0x90cd}, {0x6795, 0x968d}, {0x6797, 0x97d1}, {0x679a, 0x9687}, {0x679c, 0x89ca}, {0x679d, 0x8e7d}, {0x67a0, 0x9867}, {0x67a1, 0x9e65}, {0x67a2, 0x9095}, {0x67a6, 0x9e64}, {0x67a9, 0x9e5f}, {0x67af, 0x8ccd}, {0x67b3, 0x9e6b}, {0x67b4, 0x9e69}, {0x67b6, 0x89cb}, {0x67b7, 0x9e67}, {0x67b8, 0x9e6d}, {0x67b9, 0x9e73}, {0x67bb, 0xfae2}, {0x67c0, 0xfae4}, {0x67c1, 0x91c6}, {0x67c4, 0x95bf}, {0x67c6, 0x9e75}, {0x67ca, 0x9541}, {0x67ce, 0x9e74}, {0x67cf, 0x9490}, {0x67d0, 0x965e}, {0x67d1, 0x8ab9}, {0x67d3, 0x90f5}, {0x67d4, 0x8f5f}, {0x67d8, 0x92d1}, {0x67da, 0x974d}, {0x67dd, 0x9e70}, {0x67de, 0x9e6f}, {0x67e2, 0x9e71}, {0x67e4, 0x9e6e}, {0x67e7, 0x9e76}, {0x67e9, 0x9e6c}, {0x67ec, 0x9e6a}, {0x67ee, 0x9e72}, {0x67ef, 0x9e68}, {0x67f1, 0x928c}, {0x67f3, 0x96f6}, {0x67f4, 0x8ec4}, {0x67f5, 0x8df2}, {0x67fb, 0x8db8}, {0x67fe, 0x968f}, {0x67ff, 0x8a60}, {0x6801, 0xfae5}, {0x6802, 0x92cc}, {0x6803, 0x93c8}, {0x6804, 0x8968}, {0x6813, 0x90f0}, {0x6816, 0x90b2}, {0x6817, 0x8c49}, {0x681e, 0x9e78}, {0x6821, 0x8d5a}, {0x6822, 0x8a9c}, {0x6829, 0x9e7a}, {0x682a, 0x8a94}, {0x682b, 0x9e81}, {0x6832, 0x9e7d}, {0x6834, 0x90f1}, {0x6838, 0x8a6a}, {0x6839, 0x8daa}, {0x683c, 0x8a69}, {0x683d, 0x8dcd}, {0x6840, 0x9e7b}, {0x6841, 0x8c85}, {0x6842, 0x8c6a}, {0x6843, 0x938d}, {0x6844, 0xfae6}, {0x6846, 0x9e79}, {0x6848, 0x88c4}, {0x684d, 0x9e7c}, {0x684e, 0x9e7e}, {0x6850, 0x8bcb}, {0x6851, 0x8c4b}, {0x6852, 0xfae3}, {0x6853, 0x8aba}, {0x6854, 0x8b6a}, {0x6859, 0x9e82}, {0x685c, 0x8df7}, {0x685d, 0x9691}, {0x685f, 0x8e56}, {0x6863, 0x9e83}, {0x6867, 0x954f}, {0x6874, 0x9e8f}, {0x6876, 0x89b1}, {0x6877, 0x9e84}, {0x687e, 0x9e95}, {0x687f, 0x9e85}, {0x6881, 0x97c0}, {0x6883, 0x9e8c}, {0x6885, 0x947e}, {0x688d, 0x9e94}, {0x688f, 0x9e87}, {0x6893, 0x88b2}, {0x6894, 0x9e89}, {0x6897, 0x8d5b}, {0x689b, 0x9e8b}, {0x689d, 0x9e8a}, {0x689f, 0x9e86}, {0x68a0, 0x9e91}, {0x68a2, 0x8fbd}, {0x68a6, 0x9aeb}, {0x68a7, 0x8ce6}, {0x68a8, 0x979c}, {0x68ad, 0x9e88}, {0x68af, 0x92f2}, {0x68b0, 0x8a42}, {0x68b1, 0x8dab}, {0x68b3, 0x9e80}, {0x68b5, 0x9e90}, {0x68b6, 0x8a81}, {0x68b9, 0x9e8e}, {0x68ba, 0x9e92}, {0x68bc, 0x938e}, {0x68c4, 0x8afc}, {0x68c6, 0x9eb0}, {0x68c8, 0xfa64}, {0x68c9, 0x96c7}, {0x68ca, 0x9e97}, {0x68cb, 0x8afb}, {0x68cd, 0x9e9e}, {0x68cf, 0xfae7}, {0x68d2, 0x965f}, {0x68d4, 0x9e9f}, {0x68d5, 0x9ea1}, {0x68d7, 0x9ea5}, {0x68d8, 0x9e99}, {0x68da, 0x9249}, {0x68df, 0x938f}, {0x68e0, 0x9ea9}, {0x68e1, 0x9e9c}, {0x68e3, 0x9ea6}, {0x68e7, 0x9ea0}, {0x68ee, 0x9058}, {0x68ef, 0x9eaa}, {0x68f2, 0x90b1}, {0x68f9, 0x9ea8}, {0x68fa, 0x8abb}, {0x6900, 0x986f}, {0x6901, 0x9e96}, {0x6904, 0x9ea4}, {0x6905, 0x88d6}, {0x6908, 0x9e98}, {0x690b, 0x96b8}, {0x690c, 0x9e9d}, {0x690d, 0x9041}, {0x690e, 0x92c5}, {0x690f, 0x9e93}, {0x6912, 0x9ea3}, {0x6919, 0x909a}, {0x691a, 0x9ead}, {0x691b, 0x8a91}, {0x691c, 0x8c9f}, {0x6921, 0x9eaf}, {0x6922, 0x9e9a}, {0x6923, 0x9eae}, {0x6925, 0x9ea7}, {0x6926, 0x9e9b}, {0x6928, 0x9eab}, {0x692a, 0x9eac}, {0x6930, 0x9ebd}, {0x6934, 0x93cc}, {0x6936, 0x9ea2}, {0x6939, 0x9eb9}, {0x693d, 0x9ebb}, {0x693f, 0x92d6}, {0x694a, 0x976b}, {0x6953, 0x9596}, {0x6954, 0x9eb6}, {0x6955, 0x91c8}, {0x6959, 0x9ebc}, {0x695a, 0x915e}, {0x695c, 0x9eb3}, {0x695d, 0x9ec0}, {0x695e, 0x9ebf}, {0x6960, 0x93ed}, {0x6961, 0x9ebe}, {0x6962, 0x93e8}, {0x6968, 0xfae9}, {0x696a, 0x9ec2}, {0x696b, 0x9eb5}, {0x696d, 0x8bc6}, {0x696e, 0x9eb8}, {0x696f, 0x8f7c}, {0x6973, 0x9480}, {0x6974, 0x9eba}, {0x6975, 0x8bc9}, {0x6977, 0x9eb2}, {0x6978, 0x9eb4}, {0x6979, 0x9eb1}, {0x697c, 0x984f}, {0x697d, 0x8a79}, {0x697e, 0x9eb7}, {0x6981, 0x9ec1}, {0x6982, 0x8a54}, {0x698a, 0x8de5}, {0x698e, 0x897c}, {0x6991, 0x9ed2}, {0x6994, 0x9850}, {0x6995, 0x9ed5}, {0x6998, 0xfaeb}, {0x699b, 0x9059}, {0x699c, 0x9ed4}, {0x69a0, 0x9ed3}, {0x69a7, 0x9ed0}, {0x69ae, 0x9ec4}, {0x69b1, 0x9ee1}, {0x69b2, 0x9ec3}, {0x69b4, 0x9ed6}, {0x69bb, 0x9ece}, {0x69be, 0x9ec9}, {0x69bf, 0x9ec6}, {0x69c1, 0x9ec7}, {0x69c3, 0x9ecf}, {0x69c7, 0xeaa0}, {0x69ca, 0x9ecc}, {0x69cb, 0x8d5c}, {0x69cc, 0x92c6}, {0x69cd, 0x9184}, {0x69ce, 0x9eca}, {0x69d0, 0x9ec5}, {0x69d3, 0x9ec8}, {0x69d8, 0x976c}, {0x69d9, 0x968a}, {0x69dd, 0x9ecd}, {0x69de, 0x9ed7}, {0x69e2, 0xfaec}, {0x69e7, 0x9edf}, {0x69e8, 0x9ed8}, {0x69eb, 0x9ee5}, {0x69ed, 0x9ee3}, {0x69f2, 0x9ede}, {0x69f9, 0x9edd}, {0x69fb, 0x92ce}, {0x69fd, 0x9185}, {0x69ff, 0x9edb}, {0x6a02, 0x9ed9}, {0x6a05, 0x9ee0}, {0x6a0a, 0x9ee6}, {0x6a0b, 0x94f3}, {0x6a0c, 0x9eec}, {0x6a12, 0x9ee7}, {0x6a13, 0x9eea}, {0x6a14, 0x9ee4}, {0x6a17, 0x9294}, {0x6a19, 0x9557}, {0x6a1b, 0x9eda}, {0x6a1e, 0x9ee2}, {0x6a1f, 0x8fbe}, {0x6a21, 0x96cd}, {0x6a22, 0x9ef6}, {0x6a23, 0x9ee9}, {0x6a29, 0x8ca0}, {0x6a2a, 0x89a1}, {0x6a2b, 0x8a7e}, {0x6a2e, 0x9ed1}, {0x6a30, 0xfaed}, {0x6a35, 0x8fbf}, {0x6a36, 0x9eee}, {0x6a38, 0x9ef5}, {0x6a39, 0x8ef7}, {0x6a3a, 0x8a92}, {0x6a3d, 0x924d}, {0x6a44, 0x9eeb}, {0x6a46, 0xfaef}, {0x6a47, 0x9ef0}, {0x6a48, 0x9ef4}, {0x6a4b, 0x8bb4}, {0x6a58, 0x8b6b}, {0x6a59, 0x9ef2}, {0x6a5f, 0x8b40}, {0x6a61, 0x93c9}, {0x6a62, 0x9ef1}, {0x6a66, 0x9ef3}, {0x6a6b, 0xfaee}, {0x6a72, 0x9eed}, {0x6a73, 0xfaf0}, {0x6a78, 0x9eef}, {0x6a7e, 0xfaf1}, {0x6a7f, 0x8a80}, {0x6a80, 0x9268}, {0x6a84, 0x9efa}, {0x6a8d, 0x9ef8}, {0x6a8e, 0x8ce7}, {0x6a90, 0x9ef7}, {0x6a97, 0x9f40}, {0x6a9c, 0x9e77}, {0x6aa0, 0x9ef9}, {0x6aa2, 0x9efb}, {0x6aa3, 0x9efc}, {0x6aaa, 0x9f4b}, {0x6aac, 0x9f47}, {0x6aae, 0x9e8d}, {0x6ab3, 0x9f46}, {0x6ab8, 0x9f45}, {0x6abb, 0x9f42}, {0x6ac1, 0x9ee8}, {0x6ac2, 0x9f44}, {0x6ac3, 0x9f43}, {0x6ad1, 0x9f49}, {0x6ad3, 0x9845}, {0x6ada, 0x9f4c}, {0x6adb, 0x8bf9}, {0x6ade, 0x9f48}, {0x6adf, 0x9f4a}, {0x6ae2, 0xfaf2}, {0x6ae4, 0xfaf3}, {0x6ae8, 0x94a5}, {0x6aea, 0x9f4d}, {0x6afa, 0x9f51}, {0x6afb, 0x9f4e}, {0x6b04, 0x9793}, {0x6b05, 0x9f4f}, {0x6b0a, 0x9edc}, {0x6b12, 0x9f52}, {0x6b16, 0x9f53}, {0x6b1d, 0x8954}, {0x6b1f, 0x9f55}, {0x6b20, 0x8c87}, {0x6b21, 0x8e9f}, {0x6b23, 0x8bd3}, {0x6b27, 0x89a2}, {0x6b32, 0x977e}, {0x6b37, 0x9f57}, {0x6b38, 0x9f56}, {0x6b39, 0x9f59}, {0x6b3a, 0x8b5c}, {0x6b3d, 0x8bd4}, {0x6b3e, 0x8abc}, {0x6b43, 0x9f5c}, {0x6b47, 0x9f5b}, {0x6b49, 0x9f5d}, {0x6b4c, 0x89cc}, {0x6b4e, 0x9256}, {0x6b50, 0x9f5e}, {0x6b53, 0x8abd}, {0x6b54, 0x9f60}, {0x6b59, 0x9f5f}, {0x6b5b, 0x9f61}, {0x6b5f, 0x9f62}, {0x6b61, 0x9f63}, {0x6b62, 0x8e7e}, {0x6b63, 0x90b3}, {0x6b64, 0x8d9f}, {0x6b66, 0x9590}, {0x6b69, 0x95e0}, {0x6b6a, 0x9863}, {0x6b6f, 0x8e95}, {0x6b73, 0x8dce}, {0x6b74, 0x97f0}, {0x6b78, 0x9f64}, {0x6b79, 0x9f65}, {0x6b7b, 0x8e80}, {0x6b7f, 0x9f66}, {0x6b80, 0x9f67}, {0x6b83, 0x9f69}, {0x6b84, 0x9f68}, {0x6b86, 0x9677}, {0x6b89, 0x8f7d}, {0x6b8a, 0x8eea}, {0x6b8b, 0x8e63}, {0x6b8d, 0x9f6a}, {0x6b95, 0x9f6c}, {0x6b96, 0x9042}, {0x6b98, 0x9f6b}, {0x6b9e, 0x9f6d}, {0x6ba4, 0x9f6e}, {0x6baa, 0x9f6f}, {0x6bab, 0x9f70}, {0x6baf, 0x9f71}, {0x6bb1, 0x9f73}, {0x6bb2, 0x9f72}, {0x6bb3, 0x9f74}, {0x6bb4, 0x89a3}, {0x6bb5, 0x9269}, {0x6bb7, 0x9f75}, {0x6bba, 0x8e45}, {0x6bbb, 0x8a6b}, {0x6bbc, 0x9f76}, {0x6bbf, 0x9361}, {0x6bc0, 0x9aca}, {0x6bc5, 0x8b42}, {0x6bc6, 0x9f77}, {0x6bcb, 0x9f78}, {0x6bcd, 0x95ea}, {0x6bce, 0x9688}, {0x6bd2, 0x93c5}, {0x6bd3, 0x9f79}, {0x6bd4, 0x94e4}, {0x6bd6, 0xfaf4}, {0x6bd8, 0x94f9}, {0x6bdb, 0x96d1}, {0x6bdf, 0x9f7a}, {0x6beb, 0x9f7c}, {0x6bec, 0x9f7b}, {0x6bef, 0x9f7e}, {0x6bf3, 0x9f7d}, {0x6c08, 0x9f81}, {0x6c0f, 0x8e81}, {0x6c11, 0x96af}, {0x6c13, 0x9f82}, {0x6c14, 0x9f83}, {0x6c17, 0x8b43}, {0x6c1b, 0x9f84}, {0x6c23, 0x9f86}, {0x6c24, 0x9f85}, {0x6c34, 0x9085}, {0x6c37, 0x9558}, {0x6c38, 0x8969}, {0x6c3e, 0x94c3}, {0x6c3f, 0xfaf5}, {0x6c40, 0x92f3}, {0x6c41, 0x8f60}, {0x6c42, 0x8b81}, {0x6c4e, 0x94c4}, {0x6c50, 0x8eac}, {0x6c55, 0x9f88}, {0x6c57, 0x8abe}, {0x6c5a, 0x8998}, {0x6c5c, 0xfaf6}, {0x6c5d, 0x93f0}, {0x6c5e, 0x9f87}, {0x6c5f, 0x8d5d}, {0x6c60, 0x9272}, {0x6c62, 0x9f89}, {0x6c68, 0x9f91}, {0x6c6a, 0x9f8a}, {0x6c6f, 0xfaf8}, {0x6c70, 0x91bf}, {0x6c72, 0x8b82}, {0x6c73, 0x9f92}, {0x6c7a, 0x8c88}, {0x6c7d, 0x8b44}, {0x6c7e, 0x9f90}, {0x6c81, 0x9f8e}, {0x6c82, 0x9f8b}, {0x6c83, 0x9780}, {0x6c86, 0xfaf7}, {0x6c88, 0x92be}, {0x6c8c, 0x93d7}, {0x6c8d, 0x9f8c}, {0x6c90, 0x9f94}, {0x6c92, 0x9f93}, {0x6c93, 0x8c42}, {0x6c96, 0x89ab}, {0x6c99, 0x8db9}, {0x6c9a, 0x9f8d}, {0x6c9b, 0x9f8f}, {0x6ca1, 0x9676}, {0x6ca2, 0x91f2}, {0x6cab, 0x9697}, {0x6cae, 0x9f9c}, {0x6cb1, 0x9f9d}, {0x6cb3, 0x89cd}, {0x6cb8, 0x95a6}, {0x6cb9, 0x96fb}, {0x6cba, 0x9f9f}, {0x6cbb, 0x8ea1}, {0x6cbc, 0x8fc0}, {0x6cbd, 0x9f98}, {0x6cbe, 0x9f9e}, {0x6cbf, 0x8988}, {0x6cc1, 0x8bb5}, {0x6cc4, 0x9f95}, {0x6cc5, 0x9f9a}, {0x6cc9, 0x90f2}, {0x6cca, 0x9491}, {0x6ccc, 0x94e5}, {0x6cd3, 0x9f97}, {0x6cd5, 0x9640}, {0x6cd7, 0x9f99}, {0x6cd9, 0x9fa2}, {0x6cda, 0xfaf9}, {0x6cdb, 0x9fa0}, {0x6cdd, 0x9f9b}, {0x6ce1, 0x9641}, {0x6ce2, 0x9467}, {0x6ce3, 0x8b83}, {0x6ce5, 0x9344}, {0x6ce8, 0x928d}, {0x6cea, 0x9fa3}, {0x6cef, 0x9fa1}, {0x6cf0, 0x91d7}, {0x6cf1, 0x9f96}, {0x6cf3, 0x896a}, {0x6d04, 0xfafa}, {0x6d0b, 0x976d}, {0x6d0c, 0x9fae}, {0x6d12, 0x9fad}, {0x6d17, 0x90f4}, {0x6d19, 0x9faa}, {0x6d1b, 0x978c}, {0x6d1e, 0x93b4}, {0x6d1f, 0x9fa4}, {0x6d25, 0x92c3}, {0x6d29, 0x896b}, {0x6d2a, 0x8d5e}, {0x6d2b, 0x9fa7}, {0x6d32, 0x8f46}, {0x6d33, 0x9fac}, {0x6d35, 0x9fab}, {0x6d36, 0x9fa6}, {0x6d38, 0x9fa9}, {0x6d3b, 0x8a88}, {0x6d3d, 0x9fa8}, {0x6d3e, 0x9468}, {0x6d41, 0x97ac}, {0x6d44, 0x8ff2}, {0x6d45, 0x90f3}, {0x6d59, 0x9fb4}, {0x6d5a, 0x9fb2}, {0x6d5c, 0x956c}, {0x6d63, 0x9faf}, {0x6d64, 0x9fb1}, {0x6d66, 0x8959}, {0x6d69, 0x8d5f}, {0x6d6a, 0x9851}, {0x6d6c, 0x8a5c}, {0x6d6e, 0x9582}, {0x6d6f, 0xfafc}, {0x6d74, 0x9781}, {0x6d77, 0x8a43}, {0x6d78, 0x905a}, {0x6d79, 0x9fb3}, {0x6d85, 0x9fb8}, {0x6d87, 0xfafb}, {0x6d88, 0x8fc1}, {0x6d8c, 0x974f}, {0x6d8e, 0x9fb5}, {0x6d93, 0x9fb0}, {0x6d95, 0x9fb6}, {0x6d96, 0xfb40}, {0x6d99, 0x97dc}, {0x6d9b, 0x9393}, {0x6d9c, 0x93c0}, {0x6dac, 0xfb41}, {0x6daf, 0x8a55}, {0x6db2, 0x8974}, {0x6db5, 0x9fbc}, {0x6db8, 0x9fbf}, {0x6dbc, 0x97c1}, {0x6dc0, 0x9784}, {0x6dc5, 0x9fc6}, {0x6dc6, 0x9fc0}, {0x6dc7, 0x9fbd}, {0x6dcb, 0x97d2}, {0x6dcc, 0x9fc3}, {0x6dcf, 0xfb42}, {0x6dd1, 0x8f69}, {0x6dd2, 0x9fc5}, {0x6dd5, 0x9fca}, {0x6dd8, 0x9391}, {0x6dd9, 0x9fc8}, {0x6dde, 0x9fc2}, {0x6de1, 0x9257}, {0x6de4, 0x9fc9}, {0x6de6, 0x9fbe}, {0x6de8, 0x9fc4}, {0x6dea, 0x9fcb}, {0x6deb, 0x88fa}, {0x6dec, 0x9fc1}, {0x6dee, 0x9fcc}, {0x6df1, 0x905b}, {0x6df2, 0xfb44}, {0x6df3, 0x8f7e}, {0x6df5, 0x95a3}, {0x6df7, 0x8dac}, {0x6df8, 0xfb43}, {0x6df9, 0x9fb9}, {0x6dfa, 0x9fc7}, {0x6dfb, 0x9359}, {0x6dfc, 0xfb45}, {0x6e05, 0x90b4}, {0x6e07, 0x8a89}, {0x6e08, 0x8dcf}, {0x6e09, 0x8fc2}, {0x6e0a, 0x9fbb}, {0x6e0b, 0x8f61}, {0x6e13, 0x8c6b}, {0x6e15, 0x9fba}, {0x6e19, 0x9fd0}, {0x6e1a, 0x8f8d}, {0x6e1b, 0x8cb8}, {0x6e1d, 0x9fdf}, {0x6e1f, 0x9fd9}, {0x6e20, 0x8b94}, {0x6e21, 0x936e}, {0x6e23, 0x9fd4}, {0x6e24, 0x9fdd}, {0x6e25, 0x88ad}, {0x6e26, 0x8951}, {0x6e27, 0xfb48}, {0x6e29, 0x89b7}, {0x6e2b, 0x9fd6}, {0x6e2c, 0x91aa}, {0x6e2d, 0x9fcd}, {0x6e2e, 0x9fcf}, {0x6e2f, 0x8d60}, {0x6e38, 0x9fe0}, {0x6e39, 0xfb46}, {0x6e3a, 0x9fdb}, {0x6e3c, 0xfb49}, {0x6e3e, 0x9fd3}, {0x6e43, 0x9fda}, {0x6e4a, 0x96a9}, {0x6e4d, 0x9fd8}, {0x6e4e, 0x9fdc}, {0x6e56, 0x8cce}, {0x6e58, 0x8fc3}, {0x6e5b, 0x9258}, {0x6e5c, 0xfb47}, {0x6e5f, 0x9fd2}, {0x6e67, 0x974e}, {0x6e6b, 0x9fd5}, {0x6e6e, 0x9fce}, {0x6e6f, 0x9392}, {0x6e72, 0x9fd1}, {0x6e76, 0x9fd7}, {0x6e7e, 0x9870}, {0x6e7f, 0x8ebc}, {0x6e80, 0x969e}, {0x6e82, 0x9fe1}, {0x6e8c, 0x94ac}, {0x6e8f, 0x9fed}, {0x6e90, 0x8cb9}, {0x6e96, 0x8f80}, {0x6e98, 0x9fe3}, {0x6e9c, 0x97ad}, {0x6e9d, 0x8d61}, {0x6e9f, 0x9ff0}, {0x6ea2, 0x88ec}, {0x6ea5, 0x9fee}, {0x6eaa, 0x9fe2}, {0x6eaf, 0x9fe8}, {0x6eb2, 0x9fea}, {0x6eb6, 0x976e}, {0x6eb7, 0x9fe5}, {0x6eba, 0x934d}, {0x6ebd, 0x9fe7}, {0x6ebf, 0xfb4a}, {0x6ec2, 0x9fef}, {0x6ec4, 0x9fe9}, {0x6ec5, 0x96c5}, {0x6ec9, 0x9fe4}, {0x6ecb, 0x8ea0}, {0x6ecc, 0x9ffc}, {0x6ed1, 0x8a8a}, {0x6ed3, 0x9fe6}, {0x6ed4, 0x9feb}, {0x6ed5, 0x9fec}, {0x6edd, 0x91ea}, {0x6ede, 0x91d8}, {0x6eec, 0x9ff4}, {0x6eef, 0x9ffa}, {0x6ef2, 0x9ff8}, {0x6ef4, 0x9348}, {0x6ef7, 0xe042}, {0x6ef8, 0x9ff5}, {0x6efe, 0x9ff6}, {0x6eff, 0x9fde}, {0x6f01, 0x8b99}, {0x6f02, 0x9559}, {0x6f06, 0x8ebd}, {0x6f09, 0x8d97}, {0x6f0f, 0x9852}, {0x6f11, 0x9ff2}, {0x6f13, 0xe041}, {0x6f14, 0x8989}, {0x6f15, 0x9186}, {0x6f20, 0x9499}, {0x6f22, 0x8abf}, {0x6f23, 0x97f8}, {0x6f2b, 0x969f}, {0x6f2c, 0x92d0}, {0x6f31, 0x9ff9}, {0x6f32, 0x9ffb}, {0x6f38, 0x9151}, {0x6f3e, 0xe040}, {0x6f3f, 0x9ff7}, {0x6f41, 0x9ff1}, {0x6f45, 0x8ac1}, {0x6f54, 0x8c89}, {0x6f58, 0xe04e}, {0x6f5b, 0xe049}, {0x6f5c, 0x90f6}, {0x6f5f, 0x8a83}, {0x6f64, 0x8f81}, {0x6f66, 0xe052}, {0x6f6d, 0xe04b}, {0x6f6e, 0x92aa}, {0x6f6f, 0xe048}, {0x6f70, 0x92d7}, {0x6f74, 0xe06b}, {0x6f78, 0xe045}, {0x6f7a, 0xe044}, {0x6f7c, 0xe04d}, {0x6f80, 0xe047}, {0x6f81, 0xe046}, {0x6f82, 0xe04c}, {0x6f84, 0x909f}, {0x6f86, 0xe043}, {0x6f88, 0xfb4b}, {0x6f8e, 0xe04f}, {0x6f91, 0xe050}, {0x6f97, 0x8ac0}, {0x6fa1, 0xe055}, {0x6fa3, 0xe054}, {0x6fa4, 0xe056}, {0x6faa, 0xe059}, {0x6fb1, 0x9362}, {0x6fb3, 0xe053}, {0x6fb5, 0xfb4c}, {0x6fb9, 0xe057}, {0x6fc0, 0x8c83}, {0x6fc1, 0x91f7}, {0x6fc2, 0xe051}, {0x6fc3, 0x945a}, {0x6fc6, 0xe058}, {0x6fd4, 0xe05d}, {0x6fd5, 0xe05b}, {0x6fd8, 0xe05e}, {0x6fdb, 0xe061}, {0x6fdf, 0xe05a}, {0x6fe0, 0x8d8a}, {0x6fe1, 0x9447}, {0x6fe4, 0x9fb7}, {0x6feb, 0x9794}, {0x6fec, 0xe05c}, {0x6fee, 0xe060}, {0x6fef, 0x91f3}, {0x6ff1, 0xe05f}, {0x6ff3, 0xe04a}, {0x6ff5, 0xfb4d}, {0x6ff6, 0xe889}, {0x6ffa, 0xe064}, {0x6ffe, 0xe068}, {0x7001, 0xe066}, {0x7005, 0xfb4e}, {0x7007, 0xfb4f}, {0x7009, 0xe062}, {0x700b, 0xe063}, {0x700f, 0xe067}, {0x7011, 0xe065}, {0x7015, 0x956d}, {0x7018, 0xe06d}, {0x701a, 0xe06a}, {0x701b, 0xe069}, {0x701d, 0xe06c}, {0x701e, 0x93d2}, {0x701f, 0xe06e}, {0x7026, 0x9295}, {0x7027, 0x91eb}, {0x7028, 0xfb50}, {0x702c, 0x90a3}, {0x7030, 0xe06f}, {0x7032, 0xe071}, {0x703e, 0xe070}, {0x704c, 0x9ff3}, {0x7051, 0xe072}, {0x7058, 0x93e5}, {0x7063, 0xe073}, {0x706b, 0x89ce}, {0x706f, 0x9394}, {0x7070, 0x8a44}, {0x7078, 0x8b84}, {0x707c, 0x8edc}, {0x707d, 0x8dd0}, {0x7085, 0xfb51}, {0x7089, 0x9846}, {0x708a, 0x9086}, {0x708e, 0x898a}, {0x7092, 0xe075}, {0x7099, 0xe074}, {0x70ab, 0xfb52}, {0x70ac, 0xe078}, {0x70ad, 0x9259}, {0x70ae, 0xe07b}, {0x70af, 0xe076}, {0x70b3, 0xe07a}, {0x70b8, 0xe079}, {0x70b9, 0x935f}, {0x70ba, 0x88d7}, {0x70bb, 0xfa62}, {0x70c8, 0x97f3}, {0x70cb, 0xe07d}, {0x70cf, 0x8947}, {0x70d9, 0xe080}, {0x70dd, 0xe07e}, {0x70df, 0xe07c}, {0x70f1, 0xe077}, {0x70f9, 0x9642}, {0x70fd, 0xe082}, {0x7104, 0xfb54}, {0x7109, 0xe081}, {0x710f, 0xfb53}, {0x7114, 0x898b}, {0x7119, 0xe084}, {0x711a, 0x95b0}, {0x711c, 0xe083}, {0x7121, 0x96b3}, {0x7126, 0x8fc5}, {0x7136, 0x9152}, {0x713c, 0x8fc4}, {0x7146, 0xfb56}, {0x7147, 0xfb57}, {0x7149, 0x97f9}, {0x714c, 0xe08a}, {0x714e, 0x90f7}, {0x7155, 0xe086}, {0x7156, 0xe08b}, {0x7159, 0x898c}, {0x715c, 0xfb55}, {0x7162, 0xe089}, {0x7164, 0x9481}, {0x7165, 0xe085}, {0x7166, 0xe088}, {0x7167, 0x8fc6}, {0x7169, 0x94cf}, {0x716c, 0xe08c}, {0x716e, 0x8ecf}, {0x717d, 0x90f8}, {0x7184, 0xe08f}, {0x7188, 0xe087}, {0x718a, 0x8c46}, {0x718f, 0xe08d}, {0x7194, 0x976f}, {0x7195, 0xe090}, {0x7199, 0xeaa4}, {0x719f, 0x8f6e}, {0x71a8, 0xe091}, {0x71ac, 0xe092}, {0x71b1, 0x944d}, {0x71b9, 0xe094}, {0x71be, 0xe095}, {0x71c1, 0xfb59}, {0x71c3, 0x9452}, {0x71c8, 0x9395}, {0x71c9, 0xe097}, {0x71ce, 0xe099}, {0x71d0, 0x97d3}, {0x71d2, 0xe096}, {0x71d4, 0xe098}, {0x71d5, 0x898d}, {0x71d7, 0xe093}, {0x71df, 0x9a7a}, {0x71e0, 0xe09a}, {0x71e5, 0x9187}, {0x71e6, 0x8e57}, {0x71e7, 0xe09c}, {0x71ec, 0xe09b}, {0x71ed, 0x9043}, {0x71ee, 0x99d7}, {0x71f5, 0xe09d}, {0x71f9, 0xe09f}, {0x71fb, 0xe08e}, {0x71fc, 0xe09e}, {0x71fe, 0xfb5a}, {0x71ff, 0xe0a0}, {0x7206, 0x949a}, {0x720d, 0xe0a1}, {0x7210, 0xe0a2}, {0x721b, 0xe0a3}, {0x7228, 0xe0a4}, {0x722a, 0x92dc}, {0x722c, 0xe0a6}, {0x722d, 0xe0a5}, {0x7230, 0xe0a7}, {0x7232, 0xe0a8}, {0x7235, 0x8edd}, {0x7236, 0x9583}, {0x723a, 0x96ea}, {0x723b, 0xe0a9}, {0x723c, 0xe0aa}, {0x723d, 0x9175}, {0x723e, 0x8ea2}, {0x723f, 0xe0ab}, {0x7240, 0xe0ac}, {0x7246, 0xe0ad}, {0x7247, 0x95d0}, {0x7248, 0x94c5}, {0x724b, 0xe0ae}, {0x724c, 0x9476}, {0x7252, 0x92ab}, {0x7258, 0xe0af}, {0x7259, 0x89e5}, {0x725b, 0x8b8d}, {0x725d, 0x96c4}, {0x725f, 0x96b4}, {0x7261, 0x89b2}, {0x7262, 0x9853}, {0x7267, 0x9671}, {0x7269, 0x95a8}, {0x7272, 0x90b5}, {0x7274, 0xe0b0}, {0x7279, 0x93c1}, {0x727d, 0x8ca1}, {0x727e, 0xe0b1}, {0x7280, 0x8dd2}, {0x7281, 0xe0b3}, {0x7282, 0xe0b2}, {0x7287, 0xe0b4}, {0x7292, 0xe0b5}, {0x7296, 0xe0b6}, {0x72a0, 0x8b5d}, {0x72a2, 0xe0b7}, {0x72a7, 0xe0b8}, {0x72ac, 0x8ca2}, {0x72af, 0x94c6}, {0x72b1, 0xfb5b}, {0x72b2, 0xe0ba}, {0x72b6, 0x8ff3}, {0x72b9, 0xe0b9}, {0x72be, 0xfb5c}, {0x72c2, 0x8bb6}, {0x72c3, 0xe0bb}, {0x72c4, 0xe0bd}, {0x72c6, 0xe0bc}, {0x72ce, 0xe0be}, {0x72d0, 0x8ccf}, {0x72d2, 0xe0bf}, {0x72d7, 0x8be7}, {0x72d9, 0x915f}, {0x72db, 0x8d9d}, {0x72e0, 0xe0c1}, {0x72e1, 0xe0c2}, {0x72e2, 0xe0c0}, {0x72e9, 0x8eeb}, {0x72ec, 0x93c6}, {0x72ed, 0x8bb7}, {0x72f7, 0xe0c4}, {0x72f8, 0x924b}, {0x72f9, 0xe0c3}, {0x72fc, 0x9854}, {0x72fd, 0x9482}, {0x730a, 0xe0c7}, {0x7316, 0xe0c9}, {0x7317, 0xe0c6}, {0x731b, 0x96d2}, {0x731c, 0xe0c8}, {0x731d, 0xe0ca}, {0x731f, 0x97c2}, {0x7324, 0xfb5d}, {0x7325, 0xe0ce}, {0x7329, 0xe0cd}, {0x732a, 0x9296}, {0x732b, 0x944c}, {0x732e, 0x8ca3}, {0x732f, 0xe0cc}, {0x7334, 0xe0cb}, {0x7336, 0x9750}, {0x7337, 0x9751}, {0x733e, 0xe0cf}, {0x733f, 0x898e}, {0x7344, 0x8d96}, {0x7345, 0x8e82}, {0x734e, 0xe0d0}, {0x734f, 0xe0d1}, {0x7357, 0xe0d3}, {0x7363, 0x8f62}, {0x7368, 0xe0d5}, {0x736a, 0xe0d4}, {0x7370, 0xe0d6}, {0x7372, 0x8a6c}, {0x7375, 0xe0d8}, {0x7377, 0xfb5f}, {0x7378, 0xe0d7}, {0x737a, 0xe0da}, {0x737b, 0xe0d9}, {0x7384, 0x8cba}, {0x7387, 0x97a6}, {0x7389, 0x8bca}, {0x738b, 0x89a4}, {0x7396, 0x8be8}, {0x73a9, 0x8adf}, {0x73b2, 0x97e6}, {0x73b3, 0xe0dc}, {0x73bb, 0xe0de}, {0x73bd, 0xfb60}, {0x73c0, 0xe0df}, {0x73c2, 0x89cf}, {0x73c8, 0xe0db}, {0x73c9, 0xfb61}, {0x73ca, 0x8e58}, {0x73cd, 0x92bf}, {0x73ce, 0xe0dd}, {0x73d2, 0xfb64}, {0x73d6, 0xfb62}, {0x73de, 0xe0e2}, {0x73e0, 0x8eec}, {0x73e3, 0xfb63}, {0x73e5, 0xe0e0}, {0x73ea, 0x8c5d}, {0x73ed, 0x94c7}, {0x73ee, 0xe0e1}, {0x73f1, 0xe0fc}, {0x73f5, 0xfb66}, {0x73f8, 0xe0e7}, {0x73fe, 0x8cbb}, {0x7403, 0x8b85}, {0x7405, 0xe0e4}, {0x7406, 0x979d}, {0x7407, 0xfb65}, {0x7409, 0x97ae}, {0x7422, 0x91f4}, {0x7425, 0xe0e6}, {0x7426, 0xfb67}, {0x7429, 0xfb69}, {0x742a, 0xfb68}, {0x742e, 0xfb6a}, {0x7432, 0xe0e8}, {0x7433, 0x97d4}, {0x7434, 0x8bd5}, {0x7435, 0x94fa}, {0x7436, 0x9469}, {0x743a, 0xe0e9}, {0x743f, 0xe0eb}, {0x7441, 0xe0ee}, {0x7455, 0xe0ea}, {0x7459, 0xe0ed}, {0x745a, 0x8ce8}, {0x745b, 0x896c}, {0x745c, 0xe0ef}, {0x745e, 0x9090}, {0x745f, 0xe0ec}, {0x7460, 0x97da}, {0x7462, 0xfb6b}, {0x7463, 0xe0f2}, {0x7464, 0xeaa2}, {0x7469, 0xe0f0}, {0x746a, 0xe0f3}, {0x746f, 0xe0e5}, {0x7470, 0xe0f1}, {0x7473, 0x8dba}, {0x7476, 0xe0f4}, {0x747e, 0xe0f5}, {0x7483, 0x979e}, {0x7489, 0xfb6c}, {0x748b, 0xe0f6}, {0x749e, 0xe0f7}, {0x749f, 0xfb6d}, {0x74a2, 0xe0e3}, {0x74a7, 0xe0f8}, {0x74b0, 0x8ac2}, {0x74bd, 0x8ea3}, {0x74ca, 0xe0f9}, {0x74cf, 0xe0fa}, {0x74d4, 0xe0fb}, {0x74dc, 0x895a}, {0x74e0, 0xe140}, {0x74e2, 0x955a}, {0x74e3, 0xe141}, {0x74e6, 0x8aa2}, {0x74e7, 0xe142}, {0x74e9, 0xe143}, {0x74ee, 0xe144}, {0x74f0, 0xe146}, {0x74f1, 0xe147}, {0x74f2, 0xe145}, {0x74f6, 0x9572}, {0x74f7, 0xe149}, {0x74f8, 0xe148}, {0x7501, 0xfb6e}, {0x7503, 0xe14b}, {0x7504, 0xe14a}, {0x7505, 0xe14c}, {0x750c, 0xe14d}, {0x750d, 0xe14f}, {0x750e, 0xe14e}, {0x7511, 0x8d99}, {0x7513, 0xe151}, {0x7515, 0xe150}, {0x7518, 0x8ac3}, {0x751a, 0x9072}, {0x751c, 0x935b}, {0x751e, 0xe152}, {0x751f, 0x90b6}, {0x7523, 0x8e59}, {0x7525, 0x8999}, {0x7526, 0xe153}, {0x7528, 0x9770}, {0x752b, 0x95e1}, {0x752c, 0xe154}, {0x752f, 0xfaa8}, {0x7530, 0x9363}, {0x7531, 0x9752}, {0x7532, 0x8d62}, {0x7533, 0x905c}, {0x7537, 0x926a}, {0x7538, 0x99b2}, {0x753a, 0x92ac}, {0x753b, 0x89e6}, {0x753c, 0xe155}, {0x7544, 0xe156}, {0x7546, 0xe15b}, {0x7549, 0xe159}, {0x754a, 0xe158}, {0x754b, 0x9dc0}, {0x754c, 0x8a45}, {0x754d, 0xe157}, {0x754f, 0x88d8}, {0x7551, 0x94a8}, {0x7554, 0x94c8}, {0x7559, 0x97af}, {0x755a, 0xe15c}, {0x755b, 0xe15a}, {0x755c, 0x927b}, {0x755d, 0x90a4}, {0x7560, 0x94a9}, {0x7562, 0x954c}, {0x7564, 0xe15e}, {0x7565, 0x97aa}, {0x7566, 0x8c6c}, {0x7567, 0xe15f}, {0x7569, 0xe15d}, {0x756a, 0x94d4}, {0x756b, 0xe160}, {0x756d, 0xe161}, {0x756f, 0xfb6f}, {0x7570, 0x88d9}, {0x7573, 0x8ff4}, {0x7574, 0xe166}, {0x7576, 0xe163}, {0x7577, 0x93eb}, {0x7578, 0xe162}, {0x757f, 0x8b45}, {0x7582, 0xe169}, {0x7586, 0xe164}, {0x7587, 0xe165}, {0x7589, 0xe168}, {0x758a, 0xe167}, {0x758b, 0x9544}, {0x758e, 0x9161}, {0x758f, 0x9160}, {0x7591, 0x8b5e}, {0x7594, 0xe16a}, {0x759a, 0xe16b}, {0x759d, 0xe16c}, {0x75a3, 0xe16e}, {0x75a5, 0xe16d}, {0x75ab, 0x8975}, {0x75b1, 0xe176}, {0x75b2, 0x94e6}, {0x75b3, 0xe170}, {0x75b5, 0xe172}, {0x75b8, 0xe174}, {0x75b9, 0x905d}, {0x75bc, 0xe175}, {0x75bd, 0xe173}, {0x75be, 0x8ebe}, {0x75c2, 0xe16f}, {0x75c3, 0xe171}, {0x75c5, 0x9561}, {0x75c7, 0x8fc7}, {0x75ca, 0xe178}, {0x75cd, 0xe177}, {0x75d2, 0xe179}, {0x75d4, 0x8ea4}, {0x75d5, 0x8dad}, {0x75d8, 0x9397}, {0x75d9, 0xe17a}, {0x75db, 0x92c9}, {0x75de, 0xe17c}, {0x75e2, 0x979f}, {0x75e3, 0xe17b}, {0x75e9, 0x9189}, {0x75f0, 0xe182}, {0x75f2, 0xe184}, {0x75f3, 0xe185}, {0x75f4, 0x9273}, {0x75fa, 0xe183}, {0x75fc, 0xe180}, {0x75fe, 0xe17d}, {0x75ff, 0xe17e}, {0x7601, 0xe181}, {0x7609, 0xe188}, {0x760b, 0xe186}, {0x760d, 0xe187}, {0x761f, 0xe189}, {0x7620, 0xe18b}, {0x7621, 0xe18c}, {0x7622, 0xe18d}, {0x7624, 0xe18e}, {0x7627, 0xe18a}, {0x7630, 0xe190}, {0x7634, 0xe18f}, {0x763b, 0xe191}, {0x7642, 0x97c3}, {0x7646, 0xe194}, {0x7647, 0xe192}, {0x7648, 0xe193}, {0x764c, 0x8ae0}, {0x7652, 0x96fc}, {0x7656, 0x95c8}, {0x7658, 0xe196}, {0x765c, 0xe195}, {0x7661, 0xe197}, {0x7662, 0xe198}, {0x7667, 0xe19c}, {0x7668, 0xe199}, {0x7669, 0xe19a}, {0x766a, 0xe19b}, {0x766c, 0xe19d}, {0x7670, 0xe19e}, {0x7672, 0xe19f}, {0x7676, 0xe1a0}, {0x7678, 0xe1a1}, {0x767a, 0x94ad}, {0x767b, 0x936f}, {0x767c, 0xe1a2}, {0x767d, 0x9492}, {0x767e, 0x9553}, {0x7680, 0xe1a3}, {0x7682, 0xfb70}, {0x7683, 0xe1a4}, {0x7684, 0x9349}, {0x7686, 0x8a46}, {0x7687, 0x8d63}, {0x7688, 0xe1a5}, {0x768b, 0xe1a6}, {0x768e, 0xe1a7}, {0x7690, 0x8e48}, {0x7693, 0xe1a9}, {0x7696, 0xe1a8}, {0x7699, 0xe1aa}, {0x769a, 0xe1ab}, {0x769b, 0xfb73}, {0x769c, 0xfb71}, {0x769e, 0xfb72}, {0x76a6, 0xfb74}, {0x76ae, 0x94e7}, {0x76b0, 0xe1ac}, {0x76b4, 0xe1ad}, {0x76b7, 0xea89}, {0x76b8, 0xe1ae}, {0x76b9, 0xe1af}, {0x76ba, 0xe1b0}, {0x76bf, 0x8e4d}, {0x76c2, 0xe1b1}, {0x76c3, 0x9475}, {0x76c6, 0x967e}, {0x76c8, 0x896d}, {0x76ca, 0x8976}, {0x76cd, 0xe1b2}, {0x76d2, 0xe1b4}, {0x76d6, 0xe1b3}, {0x76d7, 0x9390}, {0x76db, 0x90b7}, {0x76dc, 0x9f58}, {0x76de, 0xe1b5}, {0x76df, 0x96bf}, {0x76e1, 0xe1b6}, {0x76e3, 0x8ac4}, {0x76e4, 0x94d5}, {0x76e5, 0xe1b7}, {0x76e7, 0xe1b8}, {0x76ea, 0xe1b9}, {0x76ee, 0x96da}, {0x76f2, 0x96d3}, {0x76f4, 0x92bc}, {0x76f8, 0x918a}, {0x76fb, 0xe1bb}, {0x76fe, 0x8f82}, {0x7701, 0x8fc8}, {0x7704, 0xe1be}, {0x7707, 0xe1bd}, {0x7708, 0xe1bc}, {0x7709, 0x94fb}, {0x770b, 0x8ac5}, {0x770c, 0x8ca7}, {0x771b, 0xe1c4}, {0x771e, 0xe1c1}, {0x771f, 0x905e}, {0x7720, 0x96b0}, {0x7724, 0xe1c0}, {0x7725, 0xe1c2}, {0x7726, 0xe1c3}, {0x7729, 0xe1bf}, {0x7737, 0xe1c5}, {0x7738, 0xe1c6}, {0x773a, 0x92ad}, {0x773c, 0x8ae1}, {0x7740, 0x9285}, {0x7746, 0xfb76}, {0x7747, 0xe1c7}, {0x775a, 0xe1c8}, {0x775b, 0xe1cb}, {0x7761, 0x9087}, {0x7763, 0x93c2}, {0x7765, 0xe1cc}, {0x7766, 0x9672}, {0x7768, 0xe1c9}, {0x776b, 0xe1ca}, {0x7779, 0xe1cf}, {0x777e, 0xe1ce}, {0x777f, 0xe1cd}, {0x778b, 0xe1d1}, {0x778e, 0xe1d0}, {0x7791, 0xe1d2}, {0x779e, 0xe1d4}, {0x77a0, 0xe1d3}, {0x77a5, 0x95cb}, {0x77ac, 0x8f75}, {0x77ad, 0x97c4}, {0x77b0, 0xe1d5}, {0x77b3, 0x93b5}, {0x77b6, 0xe1d6}, {0x77b9, 0xe1d7}, {0x77bb, 0xe1db}, {0x77bc, 0xe1d9}, {0x77bd, 0xe1da}, {0x77bf, 0xe1d8}, {0x77c7, 0xe1dc}, {0x77cd, 0xe1dd}, {0x77d7, 0xe1de}, {0x77da, 0xe1df}, {0x77db, 0x96b5}, {0x77dc, 0xe1e0}, {0x77e2, 0x96ee}, {0x77e3, 0xe1e1}, {0x77e5, 0x926d}, {0x77e7, 0x948a}, {0x77e9, 0x8be9}, {0x77ed, 0x925a}, {0x77ee, 0xe1e2}, {0x77ef, 0x8bb8}, {0x77f3, 0x90ce}, {0x77fc, 0xe1e3}, {0x7802, 0x8dbb}, {0x780c, 0xe1e4}, {0x7812, 0xe1e5}, {0x7814, 0x8ca4}, {0x7815, 0x8dd3}, {0x7820, 0xe1e7}, {0x7821, 0xfb78}, {0x7825, 0x9375}, {0x7826, 0x8dd4}, {0x7827, 0x8b6d}, {0x7832, 0x9643}, {0x7834, 0x946a}, {0x783a, 0x9376}, {0x783f, 0x8d7b}, {0x7845, 0xe1e9}, {0x784e, 0xfb79}, {0x785d, 0x8fc9}, {0x7864, 0xfb7a}, {0x786b, 0x97b0}, {0x786c, 0x8d64}, {0x786f, 0x8ca5}, {0x7872, 0x94a1}, {0x7874, 0xe1eb}, {0x787a, 0xfb7b}, {0x787c, 0xe1ed}, {0x7881, 0x8ce9}, {0x7886, 0xe1ec}, {0x7887, 0x92f4}, {0x788c, 0xe1ef}, {0x788d, 0x8a56}, {0x788e, 0xe1ea}, {0x7891, 0x94e8}, {0x7893, 0x894f}, {0x7895, 0x8dea}, {0x7897, 0x9871}, {0x789a, 0xe1ee}, {0x78a3, 0xe1f0}, {0x78a7, 0x95c9}, {0x78a9, 0x90d7}, {0x78aa, 0xe1f2}, {0x78af, 0xe1f3}, {0x78b5, 0xe1f1}, {0x78ba, 0x8a6d}, {0x78bc, 0xe1f9}, {0x78be, 0xe1f8}, {0x78c1, 0x8ea5}, {0x78c5, 0xe1fa}, {0x78c6, 0xe1f5}, {0x78ca, 0xe1fb}, {0x78cb, 0xe1f6}, {0x78d0, 0x94d6}, {0x78d1, 0xe1f4}, {0x78d4, 0xe1f7}, {0x78da, 0xe241}, {0x78e7, 0xe240}, {0x78e8, 0x9681}, {0x78ec, 0xe1fc}, {0x78ef, 0x88e9}, {0x78f4, 0xe243}, {0x78fd, 0xe242}, {0x7901, 0x8fca}, {0x7907, 0xe244}, {0x790e, 0x9162}, {0x7911, 0xe246}, {0x7912, 0xe245}, {0x7919, 0xe247}, {0x7926, 0xe1e6}, {0x792a, 0xe1e8}, {0x792b, 0xe249}, {0x792c, 0xe248}, {0x7930, 0xfb7c}, {0x793a, 0x8ea6}, {0x793c, 0x97e7}, {0x793e, 0x8ed0}, {0x7940, 0xe24a}, {0x7941, 0x8c56}, {0x7947, 0x8b5f}, {0x7948, 0x8b46}, {0x7949, 0x8e83}, {0x7950, 0x9753}, {0x7953, 0xe250}, {0x7955, 0xe24f}, {0x7956, 0x9163}, {0x7957, 0xe24c}, {0x795a, 0xe24e}, {0x795d, 0x8f6a}, {0x795e, 0x905f}, {0x795f, 0xe24d}, {0x7960, 0xe24b}, {0x7962, 0x9449}, {0x7965, 0x8fcb}, {0x7968, 0x955b}, {0x796d, 0x8dd5}, {0x7977, 0x9398}, {0x797a, 0xe251}, {0x797f, 0xe252}, {0x7980, 0xe268}, {0x7981, 0x8bd6}, {0x7984, 0x985c}, {0x7985, 0x9154}, {0x798a, 0xe253}, {0x798d, 0x89d0}, {0x798e, 0x92f5}, {0x798f, 0x959f}, {0x7994, 0xfb81}, {0x799b, 0xfb83}, {0x799d, 0xe254}, {0x79a6, 0x8b9a}, {0x79a7, 0xe255}, {0x79aa, 0xe257}, {0x79ae, 0xe258}, {0x79b0, 0x9448}, {0x79b3, 0xe259}, {0x79b9, 0xe25a}, {0x79ba, 0xe25b}, {0x79bd, 0x8bd7}, {0x79be, 0x89d1}, {0x79bf, 0x93c3}, {0x79c0, 0x8f47}, {0x79c1, 0x8e84}, {0x79c9, 0xe25c}, {0x79cb, 0x8f48}, {0x79d1, 0x89c8}, {0x79d2, 0x9562}, {0x79d5, 0xe25d}, {0x79d8, 0x94e9}, {0x79df, 0x9164}, {0x79e1, 0xe260}, {0x79e3, 0xe261}, {0x79e4, 0x9489}, {0x79e6, 0x9060}, {0x79e7, 0xe25e}, {0x79e9, 0x9281}, {0x79ec, 0xe25f}, {0x79f0, 0x8fcc}, {0x79fb, 0x88da}, {0x7a00, 0x8b48}, {0x7a08, 0xe262}, {0x7a0b, 0x92f6}, {0x7a0d, 0xe263}, {0x7a0e, 0x90c5}, {0x7a14, 0x96ab}, {0x7a17, 0x9542}, {0x7a18, 0xe264}, {0x7a19, 0xe265}, {0x7a1a, 0x9274}, {0x7a1c, 0x97c5}, {0x7a1f, 0xe267}, {0x7a20, 0xe266}, {0x7a2e, 0x8eed}, {0x7a31, 0xe269}, {0x7a32, 0x88ee}, {0x7a37, 0xe26c}, {0x7a3b, 0xe26a}, {0x7a3c, 0x89d2}, {0x7a3d, 0x8c6d}, {0x7a3e, 0xe26b}, {0x7a3f, 0x8d65}, {0x7a40, 0x8d92}, {0x7a42, 0x95e4}, {0x7a43, 0xe26d}, {0x7a46, 0x9673}, {0x7a49, 0xe26f}, {0x7a4d, 0x90cf}, {0x7a4e, 0x896e}, {0x7a4f, 0x89b8}, {0x7a50, 0x88aa}, {0x7a57, 0xe26e}, {0x7a61, 0xe270}, {0x7a62, 0xe271}, {0x7a63, 0x8ff5}, {0x7a69, 0xe272}, {0x7a6b, 0x8a6e}, {0x7a70, 0xe274}, {0x7a74, 0x8c8a}, {0x7a76, 0x8b86}, {0x7a79, 0xe275}, {0x7a7a, 0x8bf3}, {0x7a7d, 0xe276}, {0x7a7f, 0x90fa}, {0x7a81, 0x93cb}, {0x7a83, 0x90de}, {0x7a84, 0x8df3}, {0x7a88, 0xe277}, {0x7a92, 0x9282}, {0x7a93, 0x918b}, {0x7a95, 0xe279}, {0x7a96, 0xe27b}, {0x7a97, 0xe278}, {0x7a98, 0xe27a}, {0x7a9f, 0x8c41}, {0x7aa9, 0xe27c}, {0x7aaa, 0x8c45}, {0x7aae, 0x8b87}, {0x7aaf, 0x9771}, {0x7ab0, 0xe27e}, {0x7ab6, 0xe280}, {0x7aba, 0x894d}, {0x7abf, 0xe283}, {0x7ac3, 0x8a96}, {0x7ac4, 0xe282}, {0x7ac5, 0xe281}, {0x7ac7, 0xe285}, {0x7ac8, 0xe27d}, {0x7aca, 0xe286}, {0x7acb, 0x97a7}, {0x7acd, 0xe287}, {0x7acf, 0xe288}, {0x7ad1, 0xfb84}, {0x7ad2, 0x9af2}, {0x7ad3, 0xe28a}, {0x7ad5, 0xe289}, {0x7ad9, 0xe28b}, {0x7ada, 0xe28c}, {0x7adc, 0x97b3}, {0x7add, 0xe28d}, {0x7adf, 0xe8ed}, {0x7ae0, 0x8fcd}, {0x7ae1, 0xe28e}, {0x7ae2, 0xe28f}, {0x7ae3, 0x8f76}, {0x7ae5, 0x93b6}, {0x7ae6, 0xe290}, {0x7ae7, 0xfb85}, {0x7aea, 0x9247}, {0x7aeb, 0xfb87}, {0x7aed, 0xe291}, {0x7aef, 0x925b}, {0x7af0, 0xe292}, {0x7af6, 0x8ba3}, {0x7af8, 0x995e}, {0x7af9, 0x927c}, {0x7afa, 0x8eb1}, {0x7aff, 0x8ac6}, {0x7b02, 0xe293}, {0x7b04, 0xe2a0}, {0x7b06, 0xe296}, {0x7b08, 0x8b88}, {0x7b0a, 0xe295}, {0x7b0b, 0xe2a2}, {0x7b0f, 0xe294}, {0x7b11, 0x8fce}, {0x7b18, 0xe298}, {0x7b19, 0xe299}, {0x7b1b, 0x934a}, {0x7b1e, 0xe29a}, {0x7b20, 0x8a7d}, {0x7b25, 0x9079}, {0x7b26, 0x9584}, {0x7b28, 0xe29c}, {0x7b2c, 0x91e6}, {0x7b33, 0xe297}, {0x7b35, 0xe29b}, {0x7b36, 0xe29d}, {0x7b39, 0x8df9}, {0x7b45, 0xe2a4}, {0x7b46, 0x954d}, {0x7b48, 0x94a4}, {0x7b49, 0x9399}, {0x7b4b, 0x8bd8}, {0x7b4c, 0xe2a3}, {0x7b4d, 0xe2a1}, {0x7b4f, 0x94b3}, {0x7b50, 0xe29e}, {0x7b51, 0x927d}, {0x7b52, 0x939b}, {0x7b54, 0x939a}, {0x7b56, 0x8df4}, {0x7b5d, 0xe2b6}, {0x7b65, 0xe2a6}, {0x7b67, 0xe2a8}, {0x7b6c, 0xe2ab}, {0x7b6e, 0xe2ac}, {0x7b70, 0xe2a9}, {0x7b71, 0xe2aa}, {0x7b74, 0xe2a7}, {0x7b75, 0xe2a5}, {0x7b7a, 0xe29f}, {0x7b86, 0x95cd}, {0x7b87, 0x89d3}, {0x7b8b, 0xe2b3}, {0x7b8d, 0xe2b0}, {0x7b8f, 0xe2b5}, {0x7b92, 0xe2b4}, {0x7b94, 0x9493}, {0x7b95, 0x96a5}, {0x7b97, 0x8e5a}, {0x7b98, 0xe2ae}, {0x7b99, 0xe2b7}, {0x7b9a, 0xe2b2}, {0x7b9c, 0xe2b1}, {0x7b9d, 0xe2ad}, {0x7b9e, 0xfb88}, {0x7b9f, 0xe2af}, {0x7ba1, 0x8ac7}, {0x7baa, 0x925c}, {0x7bad, 0x90fb}, {0x7bb1, 0x94a0}, {0x7bb4, 0xe2bc}, {0x7bb8, 0x94a2}, {0x7bc0, 0x90df}, {0x7bc1, 0xe2b9}, {0x7bc4, 0x94cd}, {0x7bc6, 0xe2bd}, {0x7bc7, 0x95d1}, {0x7bc9, 0x927a}, {0x7bcb, 0xe2b8}, {0x7bcc, 0xe2ba}, {0x7bcf, 0xe2bb}, {0x7bdd, 0xe2be}, {0x7be0, 0x8ec2}, {0x7be4, 0x93c4}, {0x7be5, 0xe2c3}, {0x7be6, 0xe2c2}, {0x7be9, 0xe2bf}, {0x7bed, 0x9855}, {0x7bf3, 0xe2c8}, {0x7bf6, 0xe2cc}, {0x7bf7, 0xe2c9}, {0x7c00, 0xe2c5}, {0x7c07, 0xe2c6}, {0x7c0d, 0xe2cb}, {0x7c11, 0xe2c0}, {0x7c12, 0x99d3}, {0x7c13, 0xe2c7}, {0x7c14, 0xe2c1}, {0x7c17, 0xe2ca}, {0x7c1f, 0xe2d0}, {0x7c21, 0x8ac8}, {0x7c23, 0xe2cd}, {0x7c27, 0xe2ce}, {0x7c2a, 0xe2cf}, {0x7c2b, 0xe2d2}, {0x7c37, 0xe2d1}, {0x7c38, 0x94f4}, {0x7c3d, 0xe2d3}, {0x7c3e, 0x97fa}, {0x7c3f, 0x95eb}, {0x7c40, 0xe2d8}, {0x7c43, 0xe2d5}, {0x7c4c, 0xe2d4}, {0x7c4d, 0x90d0}, {0x7c4f, 0xe2d7}, {0x7c50, 0xe2d9}, {0x7c54, 0xe2d6}, {0x7c56, 0xe2dd}, {0x7c58, 0xe2da}, {0x7c5f, 0xe2db}, {0x7c60, 0xe2c4}, {0x7c64, 0xe2dc}, {0x7c65, 0xe2de}, {0x7c6c, 0xe2df}, {0x7c73, 0x95c4}, {0x7c75, 0xe2e0}, {0x7c7e, 0x96e0}, {0x7c81, 0x8bcc}, {0x7c82, 0x8c48}, {0x7c83, 0xe2e1}, {0x7c89, 0x95b2}, {0x7c8b, 0x9088}, {0x7c8d, 0x96ae}, {0x7c90, 0xe2e2}, {0x7c92, 0x97b1}, {0x7c95, 0x9494}, {0x7c97, 0x9165}, {0x7c98, 0x9453}, {0x7c9b, 0x8f6c}, {0x7c9f, 0x88be}, {0x7ca1, 0xe2e7}, {0x7ca2, 0xe2e5}, {0x7ca4, 0xe2e3}, {0x7ca5, 0x8a9f}, {0x7ca7, 0x8fcf}, {0x7ca8, 0xe2e8}, {0x7cab, 0xe2e6}, {0x7cad, 0xe2e4}, {0x7cae, 0xe2ec}, {0x7cb1, 0xe2eb}, {0x7cb2, 0xe2ea}, {0x7cb3, 0xe2e9}, {0x7cb9, 0xe2ed}, {0x7cbd, 0xe2ee}, {0x7cbe, 0x90b8}, {0x7cc0, 0xe2ef}, {0x7cc2, 0xe2f1}, {0x7cc5, 0xe2f0}, {0x7cca, 0x8cd0}, {0x7cce, 0x9157}, {0x7cd2, 0xe2f3}, {0x7cd6, 0x939c}, {0x7cd8, 0xe2f2}, {0x7cdc, 0xe2f4}, {0x7cde, 0x95b3}, {0x7cdf, 0x918c}, {0x7ce0, 0x8d66}, {0x7ce2, 0xe2f5}, {0x7ce7, 0x97c6}, {0x7cef, 0xe2f7}, {0x7cf2, 0xe2f8}, {0x7cf4, 0xe2f9}, {0x7cf6, 0xe2fa}, {0x7cf8, 0x8e85}, {0x7cfa, 0xe2fb}, {0x7cfb, 0x8c6e}, {0x7cfe, 0x8b8a}, {0x7d00, 0x8b49}, {0x7d02, 0xe340}, {0x7d04, 0x96f1}, {0x7d05, 0x8d67}, {0x7d06, 0xe2fc}, {0x7d0a, 0xe343}, {0x7d0b, 0x96e4}, {0x7d0d, 0x945b}, {0x7d10, 0x9552}, {0x7d14, 0x8f83}, {0x7d15, 0xe342}, {0x7d17, 0x8ed1}, {0x7d18, 0x8d68}, {0x7d19, 0x8e86}, {0x7d1a, 0x8b89}, {0x7d1b, 0x95b4}, {0x7d1c, 0xe341}, {0x7d20, 0x9166}, {0x7d21, 0x9661}, {0x7d22, 0x8df5}, {0x7d2b, 0x8e87}, {0x7d2c, 0x92db}, {0x7d2e, 0xe346}, {0x7d2f, 0x97dd}, {0x7d30, 0x8dd7}, {0x7d32, 0xe347}, {0x7d33, 0x9061}, {0x7d35, 0xe349}, {0x7d39, 0x8fd0}, {0x7d3a, 0x8dae}, {0x7d3f, 0xe348}, {0x7d42, 0x8f49}, {0x7d43, 0x8cbc}, {0x7d44, 0x9167}, {0x7d45, 0xe344}, {0x7d46, 0xe34a}, {0x7d48, 0xfb8a}, {0x7d4b, 0xe345}, {0x7d4c, 0x8c6f}, {0x7d4e, 0xe34d}, {0x7d4f, 0xe351}, {0x7d50, 0x8c8b}, {0x7d56, 0xe34c}, {0x7d5b, 0xe355}, {0x7d5c, 0xfb8b}, {0x7d5e, 0x8d69}, {0x7d61, 0x978d}, {0x7d62, 0x88ba}, {0x7d63, 0xe352}, {0x7d66, 0x8b8b}, {0x7d68, 0xe34f}, {0x7d6e, 0xe350}, {0x7d71, 0x939d}, {0x7d72, 0xe34e}, {0x7d73, 0xe34b}, {0x7d75, 0x8a47}, {0x7d76, 0x90e2}, {0x7d79, 0x8ca6}, {0x7d7d, 0xe357}, {0x7d89, 0xe354}, {0x7d8f, 0xe356}, {0x7d93, 0xe353}, {0x7d99, 0x8c70}, {0x7d9a, 0x91b1}, {0x7d9b, 0xe358}, {0x7d9c, 0x918e}, {0x7d9f, 0xe365}, {0x7da0, 0xfb8d}, {0x7da2, 0xe361}, {0x7da3, 0xe35b}, {0x7dab, 0xe35f}, {0x7dac, 0x8ef8}, {0x7dad, 0x88db}, {0x7dae, 0xe35a}, {0x7daf, 0xe362}, {0x7db0, 0xe366}, {0x7db1, 0x8d6a}, {0x7db2, 0x96d4}, {0x7db4, 0x92d4}, {0x7db5, 0xe35c}, {0x7db7, 0xfb8c}, {0x7db8, 0xe364}, {0x7dba, 0xe359}, {0x7dbb, 0x925d}, {0x7dbd, 0xe35e}, {0x7dbe, 0x88bb}, {0x7dbf, 0x96c8}, {0x7dc7, 0xe35d}, {0x7dca, 0x8bd9}, {0x7dcb, 0x94ea}, {0x7dcf, 0x918d}, {0x7dd1, 0x97ce}, {0x7dd2, 0x8f8f}, {0x7dd5, 0xe38e}, {0x7dd6, 0xfb8e}, {0x7dd8, 0xe367}, {0x7dda, 0x90fc}, {0x7ddc, 0xe363}, {0x7ddd, 0xe368}, {0x7dde, 0xe36a}, {0x7de0, 0x92f7}, {0x7de1, 0xe36d}, {0x7de4, 0xe369}, {0x7de8, 0x95d2}, {0x7de9, 0x8ac9}, {0x7dec, 0x96c9}, {0x7def, 0x88dc}, {0x7df2, 0xe36c}, {0x7df4, 0x97fb}, {0x7dfb, 0xe36b}, {0x7e01, 0x898f}, {0x7e04, 0x93ea}, {0x7e05, 0xe36e}, {0x7e09, 0xe375}, {0x7e0a, 0xe36f}, {0x7e0b, 0xe376}, {0x7e12, 0xe372}, {0x7e1b, 0x949b}, {0x7e1e, 0x8ec8}, {0x7e1f, 0xe374}, {0x7e21, 0xe371}, {0x7e22, 0xe377}, {0x7e23, 0xe370}, {0x7e26, 0x8f63}, {0x7e2b, 0x9644}, {0x7e2e, 0x8f6b}, {0x7e31, 0xe373}, {0x7e32, 0xe380}, {0x7e35, 0xe37b}, {0x7e37, 0xe37e}, {0x7e39, 0xe37c}, {0x7e3a, 0xe381}, {0x7e3b, 0xe37a}, {0x7e3d, 0xe360}, {0x7e3e, 0x90d1}, {0x7e41, 0x94c9}, {0x7e43, 0xe37d}, {0x7e46, 0xe378}, {0x7e4a, 0x9140}, {0x7e4b, 0x8c71}, {0x7e4d, 0x8f4a}, {0x7e52, 0xfb8f}, {0x7e54, 0x9044}, {0x7e55, 0x9155}, {0x7e56, 0xe384}, {0x7e59, 0xe386}, {0x7e5a, 0xe387}, {0x7e5d, 0xe383}, {0x7e5e, 0xe385}, {0x7e66, 0xe379}, {0x7e67, 0xe382}, {0x7e69, 0xe38a}, {0x7e6a, 0xe389}, {0x7e6d, 0x969a}, {0x7e70, 0x8c4a}, {0x7e79, 0xe388}, {0x7e7b, 0xe38c}, {0x7e7c, 0xe38b}, {0x7e7d, 0xe38f}, {0x7e7f, 0xe391}, {0x7e82, 0x8e5b}, {0x7e83, 0xe38d}, {0x7e88, 0xe392}, {0x7e89, 0xe393}, {0x7e8a, 0xfa5c}, {0x7e8c, 0xe394}, {0x7e8e, 0xe39a}, {0x7e8f, 0x935a}, {0x7e90, 0xe396}, {0x7e92, 0xe395}, {0x7e93, 0xe397}, {0x7e94, 0xe398}, {0x7e96, 0xe399}, {0x7e9b, 0xe39b}, {0x7e9c, 0xe39c}, {0x7f36, 0x8aca}, {0x7f38, 0xe39d}, {0x7f3a, 0xe39e}, {0x7f45, 0xe39f}, {0x7f47, 0xfb90}, {0x7f4c, 0xe3a0}, {0x7f4d, 0xe3a1}, {0x7f4e, 0xe3a2}, {0x7f50, 0xe3a3}, {0x7f51, 0xe3a4}, {0x7f54, 0xe3a6}, {0x7f55, 0xe3a5}, {0x7f58, 0xe3a7}, {0x7f5f, 0xe3a8}, {0x7f60, 0xe3a9}, {0x7f67, 0xe3ac}, {0x7f68, 0xe3aa}, {0x7f69, 0xe3ab}, {0x7f6a, 0x8ddf}, {0x7f6b, 0x8c72}, {0x7f6e, 0x9275}, {0x7f70, 0x94b1}, {0x7f72, 0x8f90}, {0x7f75, 0x946c}, {0x7f77, 0x94eb}, {0x7f78, 0xe3ad}, {0x7f79, 0x9ceb}, {0x7f82, 0xe3ae}, {0x7f83, 0xe3b0}, {0x7f85, 0x9785}, {0x7f86, 0xe3af}, {0x7f87, 0xe3b2}, {0x7f88, 0xe3b1}, {0x7f8a, 0x9772}, {0x7f8c, 0xe3b3}, {0x7f8e, 0x94fc}, {0x7f94, 0xe3b4}, {0x7f9a, 0xe3b7}, {0x7f9d, 0xe3b6}, {0x7f9e, 0xe3b5}, {0x7fa1, 0xfb91}, {0x7fa3, 0xe3b8}, {0x7fa4, 0x8c51}, {0x7fa8, 0x9141}, {0x7fa9, 0x8b60}, {0x7fae, 0xe3bc}, {0x7faf, 0xe3b9}, {0x7fb2, 0xe3ba}, {0x7fb6, 0xe3bd}, {0x7fb8, 0xe3be}, {0x7fb9, 0xe3bb}, {0x7fbd, 0x8948}, {0x7fc1, 0x89a5}, {0x7fc5, 0xe3c0}, {0x7fc6, 0xe3c1}, {0x7fca, 0xe3c2}, {0x7fcc, 0x9782}, {0x7fd2, 0x8f4b}, {0x7fd4, 0xe3c4}, {0x7fd5, 0xe3c3}, {0x7fe0, 0x9089}, {0x7fe1, 0xe3c5}, {0x7fe6, 0xe3c6}, {0x7fe9, 0xe3c7}, {0x7feb, 0x8ae3}, {0x7ff0, 0x8acb}, {0x7ff3, 0xe3c8}, {0x7ff9, 0xe3c9}, {0x7ffb, 0x967c}, {0x7ffc, 0x9783}, {0x8000, 0x9773}, {0x8001, 0x9856}, {0x8003, 0x8d6c}, {0x8004, 0xe3cc}, {0x8005, 0x8ed2}, {0x8006, 0xe3cb}, {0x800b, 0xe3cd}, {0x800c, 0x8ea7}, {0x8010, 0x91cf}, {0x8012, 0xe3ce}, {0x8015, 0x8d6b}, {0x8017, 0x96d5}, {0x8018, 0xe3cf}, {0x8019, 0xe3d0}, {0x801c, 0xe3d1}, {0x8021, 0xe3d2}, {0x8028, 0xe3d3}, {0x8033, 0x8ea8}, {0x8036, 0x96eb}, {0x803b, 0xe3d5}, {0x803d, 0x925e}, {0x803f, 0xe3d4}, {0x8046, 0xe3d7}, {0x804a, 0xe3d6}, {0x8052, 0xe3d8}, {0x8056, 0x90b9}, {0x8058, 0xe3d9}, {0x805a, 0xe3da}, {0x805e, 0x95b7}, {0x805f, 0xe3db}, {0x8061, 0x918f}, {0x8062, 0xe3dc}, {0x8068, 0xe3dd}, {0x806f, 0x97fc}, {0x8070, 0xe3e0}, {0x8072, 0xe3df}, {0x8073, 0xe3de}, {0x8074, 0x92ae}, {0x8076, 0xe3e1}, {0x8077, 0x9045}, {0x8079, 0xe3e2}, {0x807d, 0xe3e3}, {0x807e, 0x9857}, {0x807f, 0xe3e4}, {0x8084, 0xe3e5}, {0x8085, 0xe3e7}, {0x8086, 0xe3e6}, {0x8087, 0x94a3}, {0x8089, 0x93f7}, {0x808b, 0x985d}, {0x808c, 0x94a7}, {0x8093, 0xe3e9}, {0x8096, 0x8fd1}, {0x8098, 0x9549}, {0x809a, 0xe3ea}, {0x809b, 0xe3e8}, {0x809d, 0x8acc}, {0x80a1, 0x8cd2}, {0x80a2, 0x8e88}, {0x80a5, 0x94ec}, {0x80a9, 0x8ca8}, {0x80aa, 0x9662}, {0x80ac, 0xe3ed}, {0x80ad, 0xe3eb}, {0x80af, 0x8d6d}, {0x80b1, 0x8d6e}, {0x80b2, 0x88e7}, {0x80b4, 0x8de6}, {0x80ba, 0x9478}, {0x80c3, 0x88dd}, {0x80c4, 0xe3f2}, {0x80c6, 0x925f}, {0x80cc, 0x9477}, {0x80ce, 0x91d9}, {0x80d6, 0xe3f4}, {0x80d9, 0xe3f0}, {0x80da, 0xe3f3}, {0x80db, 0xe3ee}, {0x80dd, 0xe3f1}, {0x80de, 0x9645}, {0x80e1, 0x8cd3}, {0x80e4, 0x88fb}, {0x80e5, 0xe3ef}, {0x80ef, 0xe3f6}, {0x80f1, 0xe3f7}, {0x80f4, 0x93b7}, {0x80f8, 0x8bb9}, {0x80fc, 0xe445}, {0x80fd, 0x945c}, {0x8102, 0x8e89}, {0x8105, 0x8bba}, {0x8106, 0x90c6}, {0x8107, 0x9865}, {0x8108, 0x96ac}, {0x8109, 0xe3f5}, {0x810a, 0x90d2}, {0x811a, 0x8b72}, {0x811b, 0xe3f8}, {0x8123, 0xe3fa}, {0x8129, 0xe3f9}, {0x812f, 0xe3fb}, {0x8131, 0x9245}, {0x8133, 0x945d}, {0x8139, 0x92af}, {0x813e, 0xe442}, {0x8146, 0xe441}, {0x814b, 0xe3fc}, {0x814e, 0x9074}, {0x8150, 0x9585}, {0x8151, 0xe444}, {0x8153, 0xe443}, {0x8154, 0x8d6f}, {0x8155, 0x9872}, {0x815f, 0xe454}, {0x8165, 0xe448}, {0x8166, 0xe449}, {0x816b, 0x8eee}, {0x816e, 0xe447}, {0x8170, 0x8d98}, {0x8171, 0xe446}, {0x8174, 0xe44a}, {0x8178, 0x92b0}, {0x8179, 0x95a0}, {0x817a, 0x9142}, {0x817f, 0x91da}, {0x8180, 0xe44e}, {0x8182, 0xe44f}, {0x8183, 0xe44b}, {0x8188, 0xe44c}, {0x818a, 0xe44d}, {0x818f, 0x8d70}, {0x8193, 0xe455}, {0x8195, 0xe451}, {0x819a, 0x9586}, {0x819c, 0x968c}, {0x819d, 0x9547}, {0x81a0, 0xe450}, {0x81a3, 0xe453}, {0x81a4, 0xe452}, {0x81a8, 0x9663}, {0x81a9, 0xe456}, {0x81b0, 0xe457}, {0x81b3, 0x9156}, {0x81b5, 0xe458}, {0x81b8, 0xe45a}, {0x81ba, 0xe45e}, {0x81bd, 0xe45b}, {0x81be, 0xe459}, {0x81bf, 0x945e}, {0x81c0, 0xe45c}, {0x81c2, 0xe45d}, {0x81c6, 0x89b0}, {0x81c8, 0xe464}, {0x81c9, 0xe45f}, {0x81cd, 0xe460}, {0x81d1, 0xe461}, {0x81d3, 0x919f}, {0x81d8, 0xe463}, {0x81d9, 0xe462}, {0x81da, 0xe465}, {0x81df, 0xe466}, {0x81e0, 0xe467}, {0x81e3, 0x9062}, {0x81e5, 0x89e7}, {0x81e7, 0xe468}, {0x81e8, 0x97d5}, {0x81ea, 0x8ea9}, {0x81ed, 0x8f4c}, {0x81f3, 0x8e8a}, {0x81f4, 0x9276}, {0x81fa, 0xe469}, {0x81fb, 0xe46a}, {0x81fc, 0x8950}, {0x81fe, 0xe46b}, {0x8201, 0xe46c}, {0x8202, 0xe46d}, {0x8205, 0xe46e}, {0x8207, 0xe46f}, {0x8208, 0x8bbb}, {0x8209, 0x9da8}, {0x820a, 0xe470}, {0x820c, 0x90e3}, {0x820d, 0xe471}, {0x820e, 0x8ec9}, {0x8210, 0xe472}, {0x8212, 0x98ae}, {0x8216, 0xe473}, {0x8217, 0x95dc}, {0x8218, 0x8ada}, {0x821b, 0x9143}, {0x821c, 0x8f77}, {0x821e, 0x9591}, {0x821f, 0x8f4d}, {0x8229, 0xe474}, {0x822a, 0x8d71}, {0x822b, 0xe475}, {0x822c, 0x94ca}, {0x822e, 0xe484}, {0x8233, 0xe477}, {0x8235, 0x91c7}, {0x8236, 0x9495}, {0x8237, 0x8cbd}, {0x8238, 0xe476}, {0x8239, 0x9144}, {0x8240, 0xe478}, {0x8247, 0x92f8}, {0x8258, 0xe47a}, {0x8259, 0xe479}, {0x825a, 0xe47c}, {0x825d, 0xe47b}, {0x825f, 0xe47d}, {0x8262, 0xe480}, {0x8264, 0xe47e}, {0x8266, 0x8acd}, {0x8268, 0xe481}, {0x826a, 0xe482}, {0x826b, 0xe483}, {0x826e, 0x8daf}, {0x826f, 0x97c7}, {0x8271, 0xe485}, {0x8272, 0x9046}, {0x8276, 0x8990}, {0x8277, 0xe486}, {0x8278, 0xe487}, {0x827e, 0xe488}, {0x828b, 0x88f0}, {0x828d, 0xe489}, {0x8292, 0xe48a}, {0x8299, 0x9587}, {0x829d, 0x8ec5}, {0x829f, 0xe48c}, {0x82a5, 0x8a48}, {0x82a6, 0x88b0}, {0x82ab, 0xe48b}, {0x82ac, 0xe48e}, {0x82ad, 0x946d}, {0x82af, 0x9063}, {0x82b1, 0x89d4}, {0x82b3, 0x9646}, {0x82b8, 0x8c7c}, {0x82b9, 0x8bda}, {0x82bb, 0xe48d}, {0x82bd, 0x89e8}, {0x82c5, 0x8aa1}, {0x82d1, 0x8991}, {0x82d2, 0xe492}, {0x82d3, 0x97e8}, {0x82d4, 0x91db}, {0x82d7, 0x9563}, {0x82d9, 0xe49e}, {0x82db, 0x89d5}, {0x82dc, 0xe49c}, {0x82de, 0xe49a}, {0x82df, 0xe491}, {0x82e1, 0xe48f}, {0x82e3, 0xe490}, {0x82e5, 0x8ee1}, {0x82e6, 0x8bea}, {0x82e7, 0x9297}, {0x82eb, 0x93cf}, {0x82f1, 0x8970}, {0x82f3, 0xe494}, {0x82f4, 0xe493}, {0x82f9, 0xe499}, {0x82fa, 0xe495}, {0x82fb, 0xe498}, {0x8301, 0xfb93}, {0x8302, 0x96ce}, {0x8303, 0xe497}, {0x8304, 0x89d6}, {0x8305, 0x8a9d}, {0x8306, 0xe49b}, {0x8309, 0xe49d}, {0x830e, 0x8c73}, {0x8316, 0xe4a1}, {0x8317, 0xe4aa}, {0x8318, 0xe4ab}, {0x831c, 0x88a9}, {0x8323, 0xe4b2}, {0x8328, 0x88ef}, {0x832b, 0xe4a9}, {0x832f, 0xe4a8}, {0x8331, 0xe4a3}, {0x8332, 0xe4a2}, {0x8334, 0xe4a0}, {0x8335, 0xe49f}, {0x8336, 0x9283}, {0x8338, 0x91f9}, {0x8339, 0xe4a5}, {0x8340, 0xe4a4}, {0x8345, 0xe4a7}, {0x8349, 0x9190}, {0x834a, 0x8c74}, {0x834f, 0x8960}, {0x8350, 0xe4a6}, {0x8352, 0x8d72}, {0x8358, 0x9191}, {0x8362, 0xfb94}, {0x8373, 0xe4b8}, {0x8375, 0xe4b9}, {0x8377, 0x89d7}, {0x837b, 0x89ac}, {0x837c, 0xe4b6}, {0x837f, 0xfb95}, {0x8385, 0xe4ac}, {0x8387, 0xe4b4}, {0x8389, 0xe4bb}, {0x838a, 0xe4b5}, {0x838e, 0xe4b3}, {0x8393, 0xe496}, {0x8396, 0xe4b1}, {0x839a, 0xe4ad}, {0x839e, 0x8ace}, {0x839f, 0xe4af}, {0x83a0, 0xe4ba}, {0x83a2, 0xe4b0}, {0x83a8, 0xe4bc}, {0x83aa, 0xe4ae}, {0x83ab, 0x949c}, {0x83b1, 0x9789}, {0x83b5, 0xe4b7}, {0x83bd, 0xe4cd}, {0x83c1, 0xe4c5}, {0x83c5, 0x909b}, {0x83c7, 0xfb96}, {0x83ca, 0x8b65}, {0x83cc, 0x8bdb}, {0x83ce, 0xe4c0}, {0x83d3, 0x89d9}, {0x83d6, 0x8fd2}, {0x83d8, 0xe4c3}, {0x83dc, 0x8dd8}, {0x83df, 0x9370}, {0x83e0, 0xe4c8}, {0x83e9, 0x95ec}, {0x83eb, 0xe4bf}, {0x83ef, 0x89d8}, {0x83f0, 0x8cd4}, {0x83f1, 0x9548}, {0x83f2, 0xe4c9}, {0x83f4, 0xe4bd}, {0x83f6, 0xfb97}, {0x83f7, 0xe4c6}, {0x83fb, 0xe4d0}, {0x83fd, 0xe4c1}, {0x8403, 0xe4c2}, {0x8404, 0x93b8}, {0x8407, 0xe4c7}, {0x840b, 0xe4c4}, {0x840c, 0x9647}, {0x840d, 0xe4ca}, {0x840e, 0x88de}, {0x8413, 0xe4be}, {0x8420, 0xe4cc}, {0x8422, 0xe4cb}, {0x8429, 0x948b}, {0x842a, 0xe4d2}, {0x842c, 0xe4dd}, {0x8431, 0x8a9e}, {0x8435, 0xe4e0}, {0x8438, 0xe4ce}, {0x843c, 0xe4d3}, {0x843d, 0x978e}, {0x8446, 0xe4dc}, {0x8448, 0xfb98}, {0x8449, 0x9774}, {0x844e, 0x97a8}, {0x8457, 0x9298}, {0x845b, 0x8a8b}, {0x8461, 0x9592}, {0x8462, 0xe4e2}, {0x8463, 0x939f}, {0x8466, 0x88af}, {0x8469, 0xe4db}, {0x846b, 0xe4d7}, {0x846c, 0x9192}, {0x846d, 0xe4d1}, {0x846e, 0xe4d9}, {0x846f, 0xe4de}, {0x8471, 0x944b}, {0x8475, 0x88a8}, {0x8477, 0xe4d6}, {0x8479, 0xe4df}, {0x847a, 0x9598}, {0x8482, 0xe4da}, {0x8484, 0xe4d5}, {0x848b, 0x8fd3}, {0x8490, 0x8f4e}, {0x8494, 0x8eaa}, {0x8499, 0x96d6}, {0x849c, 0x9566}, {0x849f, 0xe4e5}, {0x84a1, 0xe4ee}, {0x84ad, 0xe4d8}, {0x84b2, 0x8a97}, {0x84b4, 0xfb99}, {0x84b8, 0x8ff6}, {0x84b9, 0xe4e3}, {0x84bb, 0xe4e8}, {0x84bc, 0x9193}, {0x84bf, 0xe4e4}, {0x84c1, 0xe4eb}, {0x84c4, 0x927e}, {0x84c6, 0xe4ec}, {0x84c9, 0x9775}, {0x84ca, 0xe4e1}, {0x84cb, 0x8a57}, {0x84cd, 0xe4e7}, {0x84d0, 0xe4ea}, {0x84d1, 0x96aa}, {0x84d6, 0xe4ed}, {0x84d9, 0xe4e6}, {0x84da, 0xe4e9}, {0x84dc, 0xfa60}, {0x84ec, 0x9648}, {0x84ee, 0x9840}, {0x84f4, 0xe4f1}, {0x84fc, 0xe4f8}, {0x84ff, 0xe4f0}, {0x8500, 0x8ec1}, {0x8506, 0xe4cf}, {0x8511, 0x95cc}, {0x8513, 0x96a0}, {0x8514, 0xe4f7}, {0x8515, 0xe4f6}, {0x8517, 0xe4f2}, {0x8518, 0xe4f3}, {0x851a, 0x8955}, {0x851f, 0xe4f5}, {0x8521, 0xe4ef}, {0x8526, 0x92d3}, {0x852c, 0xe4f4}, {0x852d, 0x88fc}, {0x8535, 0x91a0}, {0x853d, 0x95c1}, {0x8540, 0xe4f9}, {0x8541, 0xe540}, {0x8543, 0x94d7}, {0x8548, 0xe4fc}, {0x8549, 0x8fd4}, {0x854a, 0x8ec7}, {0x854b, 0xe542}, {0x854e, 0x8bbc}, {0x8553, 0xfb9a}, {0x8555, 0xe543}, {0x8557, 0x9599}, {0x8558, 0xe4fb}, {0x8559, 0xfb9b}, {0x855a, 0xe4d4}, {0x8563, 0xe4fa}, {0x8568, 0x986e}, {0x8569, 0x93a0}, {0x856a, 0x9593}, {0x856b, 0xfb9c}, {0x856d, 0xe54a}, {0x8577, 0xe550}, {0x857e, 0xe551}, {0x8580, 0xe544}, {0x8584, 0x9496}, {0x8587, 0xe54e}, {0x8588, 0xe546}, {0x858a, 0xe548}, {0x8590, 0xe552}, {0x8591, 0xe547}, {0x8594, 0xe54b}, {0x8597, 0x8992}, {0x8599, 0x93e3}, {0x859b, 0xe54c}, {0x859c, 0xe54f}, {0x85a4, 0xe545}, {0x85a6, 0x9145}, {0x85a8, 0xe549}, {0x85a9, 0x8e46}, {0x85aa, 0x9064}, {0x85ab, 0x8c4f}, {0x85ac, 0x96f2}, {0x85ae, 0x96f7}, {0x85af, 0x8f92}, {0x85b0, 0xfb9e}, {0x85b9, 0xe556}, {0x85ba, 0xe554}, {0x85c1, 0x986d}, {0x85c9, 0xe553}, {0x85cd, 0x9795}, {0x85cf, 0xe555}, {0x85d0, 0xe557}, {0x85d5, 0xe558}, {0x85dc, 0xe55b}, {0x85dd, 0xe559}, {0x85e4, 0x93a1}, {0x85e5, 0xe55a}, {0x85e9, 0x94cb}, {0x85ea, 0xe54d}, {0x85f7, 0x8f93}, {0x85f9, 0xe55c}, {0x85fa, 0xe561}, {0x85fb, 0x9194}, {0x85fe, 0xe560}, {0x8602, 0xe541}, {0x8606, 0xe562}, {0x8607, 0x9168}, {0x860a, 0xe55d}, {0x860b, 0xe55f}, {0x8613, 0xe55e}, {0x8616, 0x9f50}, {0x8617, 0x9f41}, {0x861a, 0xe564}, {0x8622, 0xe563}, {0x862d, 0x9796}, {0x862f, 0xe1ba}, {0x8630, 0xe565}, {0x863f, 0xe566}, {0x864d, 0xe567}, {0x864e, 0x8cd5}, {0x8650, 0x8b73}, {0x8654, 0xe569}, {0x8655, 0x997c}, {0x865a, 0x8b95}, {0x865c, 0x97b8}, {0x865e, 0x8bf1}, {0x865f, 0xe56a}, {0x8667, 0xe56b}, {0x866b, 0x928e}, {0x8671, 0xe56c}, {0x8679, 0x93f8}, {0x867b, 0x88b8}, {0x868a, 0x89e1}, {0x868b, 0xe571}, {0x868c, 0xe572}, {0x8693, 0xe56d}, {0x8695, 0x8e5c}, {0x86a3, 0xe56e}, {0x86a4, 0x9461}, {0x86a9, 0xe56f}, {0x86aa, 0xe570}, {0x86ab, 0xe57a}, {0x86af, 0xe574}, {0x86b0, 0xe577}, {0x86b6, 0xe573}, {0x86c4, 0xe575}, {0x86c6, 0xe576}, {0x86c7, 0x8ed6}, {0x86c9, 0xe578}, {0x86cb, 0x9260}, {0x86cd, 0x8c75}, {0x86ce, 0x8a61}, {0x86d4, 0xe57b}, {0x86d9, 0x8a5e}, {0x86db, 0xe581}, {0x86de, 0xe57c}, {0x86df, 0xe580}, {0x86e4, 0x94b8}, {0x86e9, 0xe57d}, {0x86ec, 0xe57e}, {0x86ed, 0x9567}, {0x86ee, 0x94d8}, {0x86ef, 0xe582}, {0x86f8, 0x91fb}, {0x86f9, 0xe58c}, {0x86fb, 0xe588}, {0x86fe, 0x89e9}, {0x8700, 0xe586}, {0x8702, 0x9649}, {0x8703, 0xe587}, {0x8706, 0xe584}, {0x8708, 0xe585}, {0x8709, 0xe58a}, {0x870a, 0xe58d}, {0x870d, 0xe58b}, {0x8711, 0xe589}, {0x8712, 0xe583}, {0x8718, 0x9277}, {0x871a, 0xe594}, {0x871c, 0x96a8}, {0x8725, 0xe592}, {0x8729, 0xe593}, {0x8734, 0xe58e}, {0x8737, 0xe590}, {0x873b, 0xe591}, {0x873f, 0xe58f}, {0x8749, 0x90e4}, {0x874b, 0x9858}, {0x874c, 0xe598}, {0x874e, 0xe599}, {0x8753, 0xe59f}, {0x8755, 0x9049}, {0x8757, 0xe59b}, {0x8759, 0xe59e}, {0x875f, 0xe596}, {0x8760, 0xe595}, {0x8763, 0xe5a0}, {0x8766, 0x89da}, {0x8768, 0xe59c}, {0x876a, 0xe5a1}, {0x876e, 0xe59d}, {0x8774, 0xe59a}, {0x8776, 0x92b1}, {0x8778, 0xe597}, {0x877f, 0x9488}, {0x8782, 0xe5a5}, {0x878d, 0x975a}, {0x879f, 0xe5a4}, {0x87a2, 0xe5a3}, {0x87ab, 0xe5ac}, {0x87af, 0xe5a6}, {0x87b3, 0xe5ae}, {0x87ba, 0x9786}, {0x87bb, 0xe5b1}, {0x87bd, 0xe5a8}, {0x87c0, 0xe5a9}, {0x87c4, 0xe5ad}, {0x87c6, 0xe5b0}, {0x87c7, 0xe5af}, {0x87cb, 0xe5a7}, {0x87d0, 0xe5aa}, {0x87d2, 0xe5bb}, {0x87e0, 0xe5b4}, {0x87ef, 0xe5b2}, {0x87f2, 0xe5b3}, {0x87f6, 0xe5b8}, {0x87f7, 0xe5b9}, {0x87f9, 0x8a49}, {0x87fb, 0x8b61}, {0x87fe, 0xe5b7}, {0x8805, 0xe5a2}, {0x8807, 0xfba1}, {0x880d, 0xe5b6}, {0x880e, 0xe5ba}, {0x880f, 0xe5b5}, {0x8811, 0xe5bc}, {0x8815, 0xe5be}, {0x8816, 0xe5bd}, {0x8821, 0xe5c0}, {0x8822, 0xe5bf}, {0x8823, 0xe579}, {0x8827, 0xe5c4}, {0x8831, 0xe5c1}, {0x8836, 0xe5c2}, {0x8839, 0xe5c3}, {0x883b, 0xe5c5}, {0x8840, 0x8c8c}, {0x8842, 0xe5c7}, {0x8844, 0xe5c6}, {0x8846, 0x8f4f}, {0x884c, 0x8d73}, {0x884d, 0x9fa5}, {0x8852, 0xe5c8}, {0x8853, 0x8f70}, {0x8857, 0x8a58}, {0x8859, 0xe5c9}, {0x885b, 0x8971}, {0x885d, 0x8fd5}, {0x885e, 0xe5ca}, {0x8861, 0x8d74}, {0x8862, 0xe5cb}, {0x8863, 0x88df}, {0x8868, 0x955c}, {0x886b, 0xe5cc}, {0x8870, 0x908a}, {0x8872, 0xe5d3}, {0x8875, 0xe5d0}, {0x8877, 0x928f}, {0x887d, 0xe5d1}, {0x887e, 0xe5ce}, {0x887f, 0x8bdc}, {0x8881, 0xe5cd}, {0x8882, 0xe5d4}, {0x8888, 0x8c55}, {0x888b, 0x91dc}, {0x888d, 0xe5da}, {0x8892, 0xe5d6}, {0x8896, 0x91b3}, {0x8897, 0xe5d5}, {0x8899, 0xe5d8}, {0x889e, 0xe5cf}, {0x88a2, 0xe5d9}, {0x88a4, 0xe5db}, {0x88ab, 0x94ed}, {0x88ae, 0xe5d7}, {0x88b0, 0xe5dc}, {0x88b1, 0xe5de}, {0x88b4, 0x8cd1}, {0x88b5, 0xe5d2}, {0x88b7, 0x88bf}, {0x88bf, 0xe5dd}, {0x88c1, 0x8dd9}, {0x88c2, 0x97f4}, {0x88c3, 0xe5df}, {0x88c4, 0xe5e0}, {0x88c5, 0x9195}, {0x88cf, 0x97a0}, {0x88d4, 0xe5e1}, {0x88d5, 0x9754}, {0x88d8, 0xe5e2}, {0x88d9, 0xe5e3}, {0x88dc, 0x95e2}, {0x88dd, 0xe5e4}, {0x88df, 0x8dbe}, {0x88e1, 0x97a1}, {0x88e8, 0xe5e9}, {0x88f2, 0xe5ea}, {0x88f3, 0x8fd6}, {0x88f4, 0xe5e8}, {0x88f5, 0xfba2}, {0x88f8, 0x9787}, {0x88f9, 0xe5e5}, {0x88fc, 0xe5e7}, {0x88fd, 0x90bb}, {0x88fe, 0x909e}, {0x8902, 0xe5e6}, {0x8904, 0xe5eb}, {0x8907, 0x95a1}, {0x890a, 0xe5ed}, {0x890c, 0xe5ec}, {0x8910, 0x8a8c}, {0x8912, 0x964a}, {0x8913, 0xe5ee}, {0x891c, 0xfa5d}, {0x891d, 0xe5fa}, {0x891e, 0xe5f0}, {0x8925, 0xe5f1}, {0x892a, 0xe5f2}, {0x892b, 0xe5f3}, {0x8936, 0xe5f7}, {0x8938, 0xe5f8}, {0x893b, 0xe5f6}, {0x8941, 0xe5f4}, {0x8943, 0xe5ef}, {0x8944, 0xe5f5}, {0x894c, 0xe5f9}, {0x894d, 0xe8b5}, {0x8956, 0x89a6}, {0x895e, 0xe5fc}, {0x895f, 0x8bdd}, {0x8960, 0xe5fb}, {0x8964, 0xe641}, {0x8966, 0xe640}, {0x896a, 0xe643}, {0x896d, 0xe642}, {0x896f, 0xe644}, {0x8972, 0x8f50}, {0x8974, 0xe645}, {0x8977, 0xe646}, {0x897e, 0xe647}, {0x897f, 0x90bc}, {0x8981, 0x9776}, {0x8983, 0xe648}, {0x8986, 0x95a2}, {0x8987, 0x9465}, {0x8988, 0xe649}, {0x898a, 0xe64a}, {0x898b, 0x8ca9}, {0x898f, 0x8b4b}, {0x8993, 0xe64b}, {0x8996, 0x8e8b}, {0x8997, 0x9460}, {0x8998, 0xe64c}, {0x899a, 0x8a6f}, {0x89a1, 0xe64d}, {0x89a6, 0xe64f}, {0x89a7, 0x9797}, {0x89a9, 0xe64e}, {0x89aa, 0x9065}, {0x89ac, 0xe650}, {0x89af, 0xe651}, {0x89b2, 0xe652}, {0x89b3, 0x8acf}, {0x89ba, 0xe653}, {0x89bd, 0xe654}, {0x89bf, 0xe655}, {0x89c0, 0xe656}, {0x89d2, 0x8a70}, {0x89da, 0xe657}, {0x89dc, 0xe658}, {0x89dd, 0xe659}, {0x89e3, 0x89f0}, {0x89e6, 0x9047}, {0x89e7, 0xe65a}, {0x89f4, 0xe65b}, {0x89f8, 0xe65c}, {0x8a00, 0x8cbe}, {0x8a02, 0x92f9}, {0x8a03, 0xe65d}, {0x8a08, 0x8c76}, {0x8a0a, 0x9075}, {0x8a0c, 0xe660}, {0x8a0e, 0x93a2}, {0x8a10, 0xe65f}, {0x8a12, 0xfba3}, {0x8a13, 0x8c50}, {0x8a16, 0xe65e}, {0x8a17, 0x91f5}, {0x8a18, 0x8b4c}, {0x8a1b, 0xe661}, {0x8a1d, 0xe662}, {0x8a1f, 0x8fd7}, {0x8a23, 0x8c8d}, {0x8a25, 0xe663}, {0x8a2a, 0x964b}, {0x8a2d, 0x90dd}, {0x8a31, 0x8b96}, {0x8a33, 0x96f3}, {0x8a34, 0x9169}, {0x8a36, 0xe664}, {0x8a37, 0xfba4}, {0x8a3a, 0x9066}, {0x8a3b, 0x9290}, {0x8a3c, 0x8fd8}, {0x8a41, 0xe665}, {0x8a46, 0xe668}, {0x8a48, 0xe669}, {0x8a50, 0x8dbc}, {0x8a51, 0x91c0}, {0x8a52, 0xe667}, {0x8a54, 0x8fd9}, {0x8a55, 0x955d}, {0x8a5b, 0xe666}, {0x8a5e, 0x8e8c}, {0x8a60, 0x8972}, {0x8a62, 0xe66d}, {0x8a63, 0x8c77}, {0x8a66, 0x8e8e}, {0x8a69, 0x8e8d}, {0x8a6b, 0x986c}, {0x8a6c, 0xe66c}, {0x8a6d, 0xe66b}, {0x8a6e, 0x9146}, {0x8a70, 0x8b6c}, {0x8a71, 0x9862}, {0x8a72, 0x8a59}, {0x8a73, 0x8fda}, {0x8a79, 0xfba5}, {0x8a7c, 0xe66a}, {0x8a82, 0xe66f}, {0x8a84, 0xe670}, {0x8a85, 0xe66e}, {0x8a87, 0x8cd6}, {0x8a89, 0x975f}, {0x8a8c, 0x8e8f}, {0x8a8d, 0x9446}, {0x8a91, 0xe673}, {0x8a93, 0x90be}, {0x8a95, 0x9261}, {0x8a98, 0x9755}, {0x8a9a, 0xe676}, {0x8a9e, 0x8cea}, {0x8aa0, 0x90bd}, {0x8aa1, 0xe672}, {0x8aa3, 0xe677}, {0x8aa4, 0x8ceb}, {0x8aa5, 0xe674}, {0x8aa6, 0xe675}, {0x8aa7, 0xfba6}, {0x8aa8, 0xe671}, {0x8aac, 0x90e0}, {0x8aad, 0x93c7}, {0x8ab0, 0x924e}, {0x8ab2, 0x89db}, {0x8ab9, 0x94ee}, {0x8abc, 0x8b62}, {0x8abe, 0xfba7}, {0x8abf, 0x92b2}, {0x8ac2, 0xe67a}, {0x8ac4, 0xe678}, {0x8ac7, 0x926b}, {0x8acb, 0x90bf}, {0x8acc, 0x8ad0}, {0x8acd, 0xe679}, {0x8acf, 0x907a}, {0x8ad2, 0x97c8}, {0x8ad6, 0x985f}, {0x8ada, 0xe67b}, {0x8adb, 0xe687}, {0x8adc, 0x92b3}, {0x8ade, 0xe686}, {0x8adf, 0xfba8}, {0x8ae0, 0xe683}, {0x8ae1, 0xe68b}, {0x8ae2, 0xe684}, {0x8ae4, 0xe680}, {0x8ae6, 0x92fa}, {0x8ae7, 0xe67e}, {0x8aeb, 0xe67c}, {0x8aed, 0x9740}, {0x8aee, 0x8e90}, {0x8af1, 0xe681}, {0x8af3, 0xe67d}, {0x8af6, 0xfbaa}, {0x8af7, 0xe685}, {0x8af8, 0x8f94}, {0x8afa, 0x8cbf}, {0x8afe, 0x91f8}, {0x8b00, 0x9664}, {0x8b01, 0x8979}, {0x8b02, 0x88e0}, {0x8b04, 0x93a3}, {0x8b07, 0xe689}, {0x8b0c, 0xe688}, {0x8b0e, 0x93e4}, {0x8b10, 0xe68d}, {0x8b14, 0xe682}, {0x8b16, 0xe68c}, {0x8b17, 0xe68e}, {0x8b19, 0x8caa}, {0x8b1a, 0xe68a}, {0x8b1b, 0x8d75}, {0x8b1d, 0x8ed3}, {0x8b20, 0xe68f}, {0x8b21, 0x9777}, {0x8b26, 0xe692}, {0x8b28, 0xe695}, {0x8b2b, 0xe693}, {0x8b2c, 0x9554}, {0x8b33, 0xe690}, {0x8b39, 0x8bde}, {0x8b3e, 0xe694}, {0x8b41, 0xe696}, {0x8b49, 0xe69a}, {0x8b4c, 0xe697}, {0x8b4e, 0xe699}, {0x8b4f, 0xe698}, {0x8b53, 0xfbab}, {0x8b56, 0xe69b}, {0x8b58, 0x8eaf}, {0x8b5a, 0xe69d}, {0x8b5b, 0xe69c}, {0x8b5c, 0x9588}, {0x8b5f, 0xe69f}, {0x8b66, 0x8c78}, {0x8b6b, 0xe69e}, {0x8b6c, 0xe6a0}, {0x8b6f, 0xe6a1}, {0x8b70, 0x8b63}, {0x8b71, 0xe3bf}, {0x8b72, 0x8ff7}, {0x8b74, 0xe6a2}, {0x8b77, 0x8cec}, {0x8b7d, 0xe6a3}, {0x8b7f, 0xfbac}, {0x8b80, 0xe6a4}, {0x8b83, 0x8e5d}, {0x8b8a, 0x9dcc}, {0x8b8c, 0xe6a5}, {0x8b8e, 0xe6a6}, {0x8b90, 0x8f51}, {0x8b92, 0xe6a7}, {0x8b93, 0xe6a8}, {0x8b96, 0xe6a9}, {0x8b99, 0xe6aa}, {0x8b9a, 0xe6ab}, {0x8c37, 0x924a}, {0x8c3a, 0xe6ac}, {0x8c3f, 0xe6ae}, {0x8c41, 0xe6ad}, {0x8c46, 0x93a4}, {0x8c48, 0xe6af}, {0x8c4a, 0x964c}, {0x8c4c, 0xe6b0}, {0x8c4e, 0xe6b1}, {0x8c50, 0xe6b2}, {0x8c55, 0xe6b3}, {0x8c5a, 0x93d8}, {0x8c61, 0x8fdb}, {0x8c62, 0xe6b4}, {0x8c6a, 0x8d8b}, {0x8c6b, 0x98ac}, {0x8c6c, 0xe6b5}, {0x8c78, 0xe6b6}, {0x8c79, 0x955e}, {0x8c7a, 0xe6b7}, {0x8c7c, 0xe6bf}, {0x8c82, 0xe6b8}, {0x8c85, 0xe6ba}, {0x8c89, 0xe6b9}, {0x8c8a, 0xe6bb}, {0x8c8c, 0x9665}, {0x8c8d, 0xe6bc}, {0x8c8e, 0xe6bd}, {0x8c94, 0xe6be}, {0x8c98, 0xe6c0}, {0x8c9d, 0x8a4c}, {0x8c9e, 0x92e5}, {0x8ca0, 0x9589}, {0x8ca1, 0x8de0}, {0x8ca2, 0x8d76}, {0x8ca7, 0x956e}, {0x8ca8, 0x89dd}, {0x8ca9, 0x94cc}, {0x8caa, 0xe6c3}, {0x8cab, 0x8ad1}, {0x8cac, 0x90d3}, {0x8cad, 0xe6c2}, {0x8cae, 0xe6c7}, {0x8caf, 0x9299}, {0x8cb0, 0x96e1}, {0x8cb2, 0xe6c5}, {0x8cb3, 0xe6c6}, {0x8cb4, 0x8b4d}, {0x8cb6, 0xe6c8}, {0x8cb7, 0x9483}, {0x8cb8, 0x91dd}, {0x8cbb, 0x94ef}, {0x8cbc, 0x935c}, {0x8cbd, 0xe6c4}, {0x8cbf, 0x9666}, {0x8cc0, 0x89ea}, {0x8cc1, 0xe6ca}, {0x8cc2, 0x9847}, {0x8cc3, 0x92c0}, {0x8cc4, 0x9864}, {0x8cc7, 0x8e91}, {0x8cc8, 0xe6c9}, {0x8cca, 0x91af}, {0x8ccd, 0xe6da}, {0x8cce, 0x9147}, {0x8cd1, 0x93f6}, {0x8cd3, 0x956f}, {0x8cda, 0xe6cd}, {0x8cdb, 0x8e5e}, {0x8cdc, 0x8e92}, {0x8cde, 0x8fdc}, {0x8ce0, 0x9485}, {0x8ce2, 0x8cab}, {0x8ce3, 0xe6cc}, {0x8ce4, 0xe6cb}, {0x8ce6, 0x958a}, {0x8cea, 0x8ebf}, {0x8ced, 0x9371}, {0x8cf0, 0xfbad}, {0x8cf4, 0xfbae}, {0x8cfa, 0xe6cf}, {0x8cfb, 0xe6d0}, {0x8cfc, 0x8d77}, {0x8cfd, 0xe6ce}, {0x8d04, 0xe6d1}, {0x8d05, 0xe6d2}, {0x8d07, 0xe6d4}, {0x8d08, 0x91a1}, {0x8d0a, 0xe6d3}, {0x8d0b, 0x8ae4}, {0x8d0d, 0xe6d6}, {0x8d0f, 0xe6d5}, {0x8d10, 0xe6d7}, {0x8d12, 0xfbaf}, {0x8d13, 0xe6d9}, {0x8d14, 0xe6db}, {0x8d16, 0xe6dc}, {0x8d64, 0x90d4}, {0x8d66, 0x8ecd}, {0x8d67, 0xe6dd}, {0x8d6b, 0x8a71}, {0x8d6d, 0xe6de}, {0x8d70, 0x9196}, {0x8d71, 0xe6df}, {0x8d73, 0xe6e0}, {0x8d74, 0x958b}, {0x8d76, 0xfbb0}, {0x8d77, 0x8b4e}, {0x8d81, 0xe6e1}, {0x8d85, 0x92b4}, {0x8d8a, 0x897a}, {0x8d99, 0xe6e2}, {0x8da3, 0x8eef}, {0x8da8, 0x9096}, {0x8db3, 0x91ab}, {0x8dba, 0xe6e5}, {0x8dbe, 0xe6e4}, {0x8dc2, 0xe6e3}, {0x8dcb, 0xe6eb}, {0x8dcc, 0xe6e9}, {0x8dcf, 0xe6e6}, {0x8dd6, 0xe6e8}, {0x8dda, 0xe6e7}, {0x8ddb, 0xe6ea}, {0x8ddd, 0x8b97}, {0x8ddf, 0xe6ee}, {0x8de1, 0x90d5}, {0x8de3, 0xe6ef}, {0x8de8, 0x8cd7}, {0x8dea, 0xe6ec}, {0x8deb, 0xe6ed}, {0x8def, 0x9848}, {0x8df3, 0x92b5}, {0x8df5, 0x9148}, {0x8dfc, 0xe6f0}, {0x8dff, 0xe6f3}, {0x8e08, 0xe6f1}, {0x8e09, 0xe6f2}, {0x8e0a, 0x9778}, {0x8e0f, 0x93a5}, {0x8e10, 0xe6f6}, {0x8e1d, 0xe6f4}, {0x8e1e, 0xe6f5}, {0x8e1f, 0xe6f7}, {0x8e2a, 0xe748}, {0x8e30, 0xe6fa}, {0x8e34, 0xe6fb}, {0x8e35, 0xe6f9}, {0x8e42, 0xe6f8}, {0x8e44, 0x92fb}, {0x8e47, 0xe740}, {0x8e48, 0xe744}, {0x8e49, 0xe741}, {0x8e4a, 0xe6fc}, {0x8e4c, 0xe742}, {0x8e50, 0xe743}, {0x8e55, 0xe74a}, {0x8e59, 0xe745}, {0x8e5f, 0x90d6}, {0x8e60, 0xe747}, {0x8e63, 0xe749}, {0x8e64, 0xe746}, {0x8e72, 0xe74c}, {0x8e74, 0x8f52}, {0x8e76, 0xe74b}, {0x8e7c, 0xe74d}, {0x8e81, 0xe74e}, {0x8e84, 0xe751}, {0x8e85, 0xe750}, {0x8e87, 0xe74f}, {0x8e8a, 0xe753}, {0x8e8b, 0xe752}, {0x8e8d, 0x96f4}, {0x8e91, 0xe755}, {0x8e93, 0xe754}, {0x8e94, 0xe756}, {0x8e99, 0xe757}, {0x8ea1, 0xe759}, {0x8eaa, 0xe758}, {0x8eab, 0x9067}, {0x8eac, 0xe75a}, {0x8eaf, 0x8beb}, {0x8eb0, 0xe75b}, {0x8eb1, 0xe75d}, {0x8ebe, 0xe75e}, {0x8ec5, 0xe75f}, {0x8ec6, 0xe75c}, {0x8ec8, 0xe760}, {0x8eca, 0x8ed4}, {0x8ecb, 0xe761}, {0x8ecc, 0x8b4f}, {0x8ecd, 0x8c52}, {0x8ecf, 0xfbb2}, {0x8ed2, 0x8cac}, {0x8edb, 0xe762}, {0x8edf, 0x93ee}, {0x8ee2, 0x935d}, {0x8ee3, 0xe763}, {0x8eeb, 0xe766}, {0x8ef8, 0x8eb2}, {0x8efb, 0xe765}, {0x8efc, 0xe764}, {0x8efd, 0x8c79}, {0x8efe, 0xe767}, {0x8f03, 0x8a72}, {0x8f05, 0xe769}, {0x8f09, 0x8dda}, {0x8f0a, 0xe768}, {0x8f0c, 0xe771}, {0x8f12, 0xe76b}, {0x8f13, 0xe76d}, {0x8f14, 0x95e3}, {0x8f15, 0xe76a}, {0x8f19, 0xe76c}, {0x8f1b, 0xe770}, {0x8f1c, 0xe76e}, {0x8f1d, 0x8b50}, {0x8f1f, 0xe76f}, {0x8f26, 0xe772}, {0x8f29, 0x9479}, {0x8f2a, 0x97d6}, {0x8f2f, 0x8f53}, {0x8f33, 0xe773}, {0x8f38, 0x9741}, {0x8f39, 0xe775}, {0x8f3b, 0xe774}, {0x8f3e, 0xe778}, {0x8f3f, 0x9760}, {0x8f42, 0xe777}, {0x8f44, 0x8a8d}, {0x8f45, 0xe776}, {0x8f46, 0xe77b}, {0x8f49, 0xe77a}, {0x8f4c, 0xe779}, {0x8f4d, 0x9351}, {0x8f4e, 0xe77c}, {0x8f57, 0xe77d}, {0x8f5c, 0xe77e}, {0x8f5f, 0x8d8c}, {0x8f61, 0x8c44}, {0x8f62, 0xe780}, {0x8f63, 0xe781}, {0x8f64, 0xe782}, {0x8f9b, 0x9068}, {0x8f9c, 0xe783}, {0x8f9e, 0x8eab}, {0x8f9f, 0xe784}, {0x8fa3, 0xe785}, {0x8fa7, 0x999f}, {0x8fa8, 0x999e}, {0x8fad, 0xe786}, {0x8fae, 0xe390}, {0x8faf, 0xe787}, {0x8fb0, 0x9243}, {0x8fb1, 0x904a}, {0x8fb2, 0x945f}, {0x8fb7, 0xe788}, {0x8fba, 0x95d3}, {0x8fbb, 0x92d2}, {0x8fbc, 0x8d9e}, {0x8fbf, 0x9248}, {0x8fc2, 0x8949}, {0x8fc4, 0x9698}, {0x8fc5, 0x9076}, {0x8fce, 0x8c7d}, {0x8fd1, 0x8bdf}, {0x8fd4, 0x95d4}, {0x8fda, 0xe789}, {0x8fe2, 0xe78b}, {0x8fe5, 0xe78a}, {0x8fe6, 0x89de}, {0x8fe9, 0x93f4}, {0x8fea, 0xe78c}, {0x8feb, 0x9497}, {0x8fed, 0x9352}, {0x8fef, 0xe78d}, {0x8ff0, 0x8f71}, {0x8ff4, 0xe78f}, {0x8ff7, 0x96c0}, {0x8ff8, 0xe79e}, {0x8ff9, 0xe791}, {0x8ffa, 0xe792}, {0x8ffd, 0x92c7}, {0x9000, 0x91de}, {0x9001, 0x9197}, {0x9003, 0x93a6}, {0x9005, 0xe790}, {0x9006, 0x8b74}, {0x900b, 0xe799}, {0x900d, 0xe796}, {0x900e, 0xe7a3}, {0x900f, 0x93a7}, {0x9010, 0x9280}, {0x9011, 0xe793}, {0x9013, 0x92fc}, {0x9014, 0x9372}, {0x9015, 0xe794}, {0x9016, 0xe798}, {0x9017, 0x9080}, {0x9019, 0x9487}, {0x901a, 0x92ca}, {0x901d, 0x90c0}, {0x901e, 0xe797}, {0x901f, 0x91ac}, {0x9020, 0x91a2}, {0x9021, 0xe795}, {0x9022, 0x88a7}, {0x9023, 0x9841}, {0x9027, 0xe79a}, {0x902e, 0x91df}, {0x9031, 0x8f54}, {0x9032, 0x9069}, {0x9035, 0xe79c}, {0x9036, 0xe79b}, {0x9038, 0x88ed}, {0x9039, 0xe79d}, {0x903c, 0x954e}, {0x903e, 0xe7a5}, {0x9041, 0x93d9}, {0x9042, 0x908b}, {0x9045, 0x9278}, {0x9047, 0x8bf6}, {0x9049, 0xe7a4}, {0x904a, 0x9756}, {0x904b, 0x895e}, {0x904d, 0x95d5}, {0x904e, 0x89df}, {0x904f, 0xe79f}, {0x9050, 0xe7a0}, {0x9051, 0xe7a1}, {0x9052, 0xe7a2}, {0x9053, 0x93b9}, {0x9054, 0x9242}, {0x9055, 0x88e1}, {0x9056, 0xe7a6}, {0x9058, 0xe7a7}, {0x9059, 0xeaa1}, {0x905c, 0x91bb}, {0x905e, 0xe7a8}, {0x9060, 0x8993}, {0x9061, 0x916b}, {0x9063, 0x8cad}, {0x9065, 0x9779}, {0x9067, 0xfbb5}, {0x9068, 0xe7a9}, {0x9069, 0x934b}, {0x906d, 0x9198}, {0x906e, 0x8ed5}, {0x906f, 0xe7aa}, {0x9072, 0xe7ad}, {0x9075, 0x8f85}, {0x9076, 0xe7ab}, {0x9077, 0x914a}, {0x9078, 0x9149}, {0x907a, 0x88e2}, {0x907c, 0x97c9}, {0x907d, 0xe7af}, {0x907f, 0x94f0}, {0x9080, 0xe7b1}, {0x9081, 0xe7b0}, {0x9082, 0xe7ae}, {0x9083, 0xe284}, {0x9084, 0x8ad2}, {0x9087, 0xe78e}, {0x9089, 0xe7b3}, {0x908a, 0xe7b2}, {0x908f, 0xe7b4}, {0x9091, 0x9757}, {0x90a3, 0x93df}, {0x90a6, 0x964d}, {0x90a8, 0xe7b5}, {0x90aa, 0x8ed7}, {0x90af, 0xe7b6}, {0x90b1, 0xe7b7}, {0x90b5, 0xe7b8}, {0x90b8, 0x9340}, {0x90c1, 0x88e8}, {0x90ca, 0x8d78}, {0x90ce, 0x9859}, {0x90db, 0xe7bc}, {0x90de, 0xfbb6}, {0x90e1, 0x8c53}, {0x90e2, 0xe7b9}, {0x90e4, 0xe7ba}, {0x90e8, 0x9594}, {0x90ed, 0x8a73}, {0x90f5, 0x9758}, {0x90f7, 0x8bbd}, {0x90fd, 0x9373}, {0x9102, 0xe7bd}, {0x9112, 0xe7be}, {0x9115, 0xfbb8}, {0x9119, 0xe7bf}, {0x9127, 0xfbb9}, {0x912d, 0x9341}, {0x9130, 0xe7c1}, {0x9132, 0xe7c0}, {0x9149, 0x93d1}, {0x914a, 0xe7c2}, {0x914b, 0x8f55}, {0x914c, 0x8ede}, {0x914d, 0x947a}, {0x914e, 0x9291}, {0x9152, 0x8ef0}, {0x9154, 0x908c}, {0x9156, 0xe7c3}, {0x9158, 0xe7c4}, {0x9162, 0x907c}, {0x9163, 0xe7c5}, {0x9165, 0xe7c6}, {0x9169, 0xe7c7}, {0x916a, 0x978f}, {0x916c, 0x8f56}, {0x9172, 0xe7c9}, {0x9173, 0xe7c8}, {0x9175, 0x8d79}, {0x9177, 0x8d93}, {0x9178, 0x8e5f}, {0x9182, 0xe7cc}, {0x9187, 0x8f86}, {0x9189, 0xe7cb}, {0x918b, 0xe7ca}, {0x918d, 0x91e7}, {0x9190, 0x8ced}, {0x9192, 0x90c1}, {0x9197, 0x94ae}, {0x919c, 0x8f58}, {0x91a2, 0xe7cd}, {0x91a4, 0x8fdd}, {0x91aa, 0xe7d0}, {0x91ab, 0xe7ce}, {0x91af, 0xe7cf}, {0x91b4, 0xe7d2}, {0x91b5, 0xe7d1}, {0x91b8, 0x8ff8}, {0x91ba, 0xe7d3}, {0x91c0, 0xe7d4}, {0x91c1, 0xe7d5}, {0x91c6, 0x94ce}, {0x91c7, 0x8dd1}, {0x91c8, 0x8edf}, {0x91c9, 0xe7d6}, {0x91cb, 0xe7d7}, {0x91cc, 0x97a2}, {0x91cd, 0x8f64}, {0x91ce, 0x96ec}, {0x91cf, 0x97ca}, {0x91d0, 0xe7d8}, {0x91d1, 0x8be0}, {0x91d6, 0xe7d9}, {0x91d7, 0xfbbb}, {0x91d8, 0x9342}, {0x91da, 0xfbba}, {0x91db, 0xe7dc}, {0x91dc, 0x8a98}, {0x91dd, 0x906a}, {0x91de, 0xfbbc}, {0x91df, 0xe7da}, {0x91e1, 0xe7db}, {0x91e3, 0x92de}, {0x91e4, 0xfbbf}, {0x91e5, 0xfbc0}, {0x91e6, 0x9674}, {0x91e7, 0x8bfa}, {0x91ed, 0xfbbd}, {0x91ee, 0xfbbe}, {0x91f5, 0xe7de}, {0x91f6, 0xe7df}, {0x91fc, 0xe7dd}, {0x91ff, 0xe7e1}, {0x9206, 0xfbc1}, {0x920a, 0xfbc3}, {0x920d, 0x93dd}, {0x920e, 0x8a62}, {0x9210, 0xfbc2}, {0x9211, 0xe7e5}, {0x9214, 0xe7e2}, {0x9215, 0xe7e4}, {0x921e, 0xe7e0}, {0x9229, 0xe86e}, {0x922c, 0xe7e3}, {0x9234, 0x97e9}, {0x9237, 0x8cd8}, {0x9239, 0xfbca}, {0x923a, 0xfbc4}, {0x923c, 0xfbc6}, {0x923f, 0xe7ed}, {0x9240, 0xfbc5}, {0x9244, 0x9353}, {0x9245, 0xe7e8}, {0x9248, 0xe7eb}, {0x9249, 0xe7e9}, {0x924b, 0xe7ee}, {0x924e, 0xfbc7}, {0x9250, 0xe7ef}, {0x9251, 0xfbc9}, {0x9257, 0xe7e7}, {0x9259, 0xfbc8}, {0x925a, 0xe7f4}, {0x925b, 0x8994}, {0x925e, 0xe7e6}, {0x9262, 0x94ab}, {0x9264, 0xe7ea}, {0x9266, 0x8fde}, {0x9267, 0xfbcb}, {0x9271, 0x8d7a}, {0x9277, 0xfbcd}, {0x9278, 0xfbce}, {0x927e, 0x9667}, {0x9280, 0x8be2}, {0x9283, 0x8f65}, {0x9285, 0x93ba}, {0x9288, 0xfa5f}, {0x9291, 0x914c}, {0x9293, 0xe7f2}, {0x9295, 0xe7ec}, {0x9296, 0xe7f1}, {0x9298, 0x96c1}, {0x929a, 0x92b6}, {0x929b, 0xe7f3}, {0x929c, 0xe7f0}, {0x92a7, 0xfbcc}, {0x92ad, 0x914b}, {0x92b7, 0xe7f7}, {0x92b9, 0xe7f6}, {0x92cf, 0xe7f5}, {0x92d0, 0xfbd2}, {0x92d2, 0x964e}, {0x92d3, 0xfbd6}, {0x92d5, 0xfbd4}, {0x92d7, 0xfbd0}, {0x92d9, 0xfbd1}, {0x92e0, 0xfbd5}, {0x92e4, 0x8f9b}, {0x92e7, 0xfbcf}, {0x92e9, 0xe7f8}, {0x92ea, 0x95dd}, {0x92ed, 0x8973}, {0x92f2, 0x9565}, {0x92f3, 0x9292}, {0x92f8, 0x8b98}, {0x92f9, 0xfa65}, {0x92fa, 0xe7fa}, {0x92fb, 0xfbd9}, {0x92fc, 0x8d7c}, {0x92ff, 0xfbdc}, {0x9302, 0xfbde}, {0x9306, 0x8e4b}, {0x930f, 0xe7f9}, {0x9310, 0x908d}, {0x9318, 0x908e}, {0x9319, 0xe840}, {0x931a, 0xe842}, {0x931d, 0xfbdd}, {0x931e, 0xfbdb}, {0x9320, 0x8ff9}, {0x9321, 0xfbd8}, {0x9322, 0xe841}, {0x9323, 0xe843}, {0x9325, 0xfbd7}, {0x9326, 0x8bd1}, {0x9328, 0x9564}, {0x932b, 0x8ee0}, {0x932c, 0x9842}, {0x932e, 0xe7fc}, {0x932f, 0x8df6}, {0x9332, 0x985e}, {0x9335, 0xe845}, {0x933a, 0xe844}, {0x933b, 0xe846}, {0x9344, 0xe7fb}, {0x9348, 0xfa5e}, {0x934b, 0x93e7}, {0x934d, 0x9374}, {0x9354, 0x92d5}, {0x9356, 0xe84b}, {0x9357, 0xfbe0}, {0x935b, 0x9262}, {0x935c, 0xe847}, {0x9360, 0xe848}, {0x936c, 0x8c4c}, {0x936e, 0xe84a}, {0x9370, 0xfbdf}, {0x9375, 0x8cae}, {0x937c, 0xe849}, {0x937e, 0x8fdf}, {0x938c, 0x8a99}, {0x9394, 0xe84f}, {0x9396, 0x8dbd}, {0x9397, 0x9199}, {0x939a, 0x92c8}, {0x93a4, 0xfbe1}, {0x93a7, 0x8a5a}, {0x93ac, 0xe84d}, {0x93ad, 0xe84e}, {0x93ae, 0x92c1}, {0x93b0, 0xe84c}, {0x93b9, 0xe850}, {0x93c3, 0xe856}, {0x93c6, 0xfbe2}, {0x93c8, 0xe859}, {0x93d0, 0xe858}, {0x93d1, 0x934c}, {0x93d6, 0xe851}, {0x93d7, 0xe852}, {0x93d8, 0xe855}, {0x93dd, 0xe857}, {0x93de, 0xfbe3}, {0x93e1, 0x8bbe}, {0x93e4, 0xe85a}, {0x93e5, 0xe854}, {0x93e8, 0xe853}, {0x93f8, 0xfbe4}, {0x9403, 0xe85e}, {0x9407, 0xe85f}, {0x9410, 0xe860}, {0x9413, 0xe85d}, {0x9414, 0xe85c}, {0x9418, 0x8fe0}, {0x9419, 0x93a8}, {0x941a, 0xe85b}, {0x9421, 0xe864}, {0x942b, 0xe862}, {0x9431, 0xfbe5}, {0x9435, 0xe863}, {0x9436, 0xe861}, {0x9438, 0x91f6}, {0x943a, 0xe865}, {0x9441, 0xe866}, {0x9444, 0xe868}, {0x9445, 0xfbe6}, {0x9448, 0xfbe7}, {0x9451, 0x8ad3}, {0x9452, 0xe867}, {0x9453, 0x96f8}, {0x945a, 0xe873}, {0x945b, 0xe869}, {0x945e, 0xe86c}, {0x9460, 0xe86a}, {0x9462, 0xe86b}, {0x946a, 0xe86d}, {0x9470, 0xe86f}, {0x9475, 0xe870}, {0x9477, 0xe871}, {0x947c, 0xe874}, {0x947d, 0xe872}, {0x947e, 0xe875}, {0x947f, 0xe877}, {0x9481, 0xe876}, {0x9577, 0x92b7}, {0x9580, 0x96e5}, {0x9582, 0xe878}, {0x9583, 0x914d}, {0x9587, 0xe879}, {0x9589, 0x95c2}, {0x958a, 0xe87a}, {0x958b, 0x8a4a}, {0x958f, 0x895b}, {0x9591, 0x8ad5}, {0x9592, 0xfbe8}, {0x9593, 0x8ad4}, {0x9594, 0xe87b}, {0x9596, 0xe87c}, {0x9598, 0xe87d}, {0x9599, 0xe87e}, {0x95a0, 0xe880}, {0x95a2, 0x8ad6}, {0x95a3, 0x8a74}, {0x95a4, 0x8d7d}, {0x95a5, 0x94b4}, {0x95a7, 0xe882}, {0x95a8, 0xe881}, {0x95ad, 0xe883}, {0x95b2, 0x897b}, {0x95b9, 0xe886}, {0x95bb, 0xe885}, {0x95bc, 0xe884}, {0x95be, 0xe887}, {0x95c3, 0xe88a}, {0x95c7, 0x88c5}, {0x95ca, 0xe888}, {0x95cc, 0xe88c}, {0x95cd, 0xe88b}, {0x95d4, 0xe88e}, {0x95d5, 0xe88d}, {0x95d6, 0xe88f}, {0x95d8, 0x93ac}, {0x95dc, 0xe890}, {0x95e1, 0xe891}, {0x95e2, 0xe893}, {0x95e5, 0xe892}, {0x961c, 0x958c}, {0x9621, 0xe894}, {0x9628, 0xe895}, {0x962a, 0x8de3}, {0x962e, 0xe896}, {0x962f, 0xe897}, {0x9632, 0x9668}, {0x963b, 0x916a}, {0x963f, 0x88a2}, {0x9640, 0x91c9}, {0x9642, 0xe898}, {0x9644, 0x958d}, {0x964b, 0xe89b}, {0x964c, 0xe899}, {0x964d, 0x8d7e}, {0x964f, 0xe89a}, {0x9650, 0x8cc0}, {0x965b, 0x95c3}, {0x965c, 0xe89d}, {0x965d, 0xe89f}, {0x965e, 0xe89e}, {0x965f, 0xe8a0}, {0x9662, 0x8940}, {0x9663, 0x9077}, {0x9664, 0x8f9c}, {0x9665, 0x8ad7}, {0x9666, 0xe8a1}, {0x966a, 0x9486}, {0x966c, 0xe8a3}, {0x9670, 0x8941}, {0x9672, 0xe8a2}, {0x9673, 0x92c2}, {0x9675, 0x97cb}, {0x9676, 0x93a9}, {0x9677, 0xe89c}, {0x9678, 0x97a4}, {0x967a, 0x8caf}, {0x967d, 0x977a}, {0x9685, 0x8bf7}, {0x9686, 0x97b2}, {0x9688, 0x8c47}, {0x968a, 0x91e0}, {0x968b, 0xe440}, {0x968d, 0xe8a4}, {0x968e, 0x8a4b}, {0x968f, 0x908f}, {0x9694, 0x8a75}, {0x9695, 0xe8a6}, {0x9697, 0xe8a7}, {0x9698, 0xe8a5}, {0x9699, 0x8c84}, {0x969b, 0x8ddb}, {0x969c, 0x8fe1}, {0x969d, 0xfbeb}, {0x96a0, 0x8942}, {0x96a3, 0x97d7}, {0x96a7, 0xe8a9}, {0x96a8, 0xe7ac}, {0x96aa, 0xe8a8}, {0x96af, 0xfbec}, {0x96b0, 0xe8ac}, {0x96b1, 0xe8aa}, {0x96b2, 0xe8ab}, {0x96b4, 0xe8ad}, {0x96b6, 0xe8ae}, {0x96b7, 0x97ea}, {0x96b8, 0xe8af}, {0x96b9, 0xe8b0}, {0x96bb, 0x90c7}, {0x96bc, 0x94b9}, {0x96c0, 0x909d}, {0x96c1, 0x8ae5}, {0x96c4, 0x9759}, {0x96c5, 0x89eb}, {0x96c6, 0x8f57}, {0x96c7, 0x8cd9}, {0x96c9, 0xe8b3}, {0x96cb, 0xe8b2}, {0x96cc, 0x8e93}, {0x96cd, 0xe8b4}, {0x96ce, 0xe8b1}, {0x96d1, 0x8e47}, {0x96d5, 0xe8b8}, {0x96d6, 0xe5ab}, {0x96d9, 0x99d4}, {0x96db, 0x9097}, {0x96dc, 0xe8b6}, {0x96e2, 0x97a3}, {0x96e3, 0x93ef}, {0x96e8, 0x894a}, {0x96ea, 0x90e1}, {0x96eb, 0x8eb4}, {0x96f0, 0x95b5}, {0x96f2, 0x895f}, {0x96f6, 0x97eb}, {0x96f7, 0x978b}, {0x96f9, 0xe8b9}, {0x96fb, 0x9364}, {0x9700, 0x8ef9}, {0x9704, 0xe8ba}, {0x9706, 0xe8bb}, {0x9707, 0x906b}, {0x9708, 0xe8bc}, {0x970a, 0x97ec}, {0x970d, 0xe8b7}, {0x970e, 0xe8be}, {0x970f, 0xe8c0}, {0x9711, 0xe8bf}, {0x9713, 0xe8bd}, {0x9716, 0xe8c1}, {0x9719, 0xe8c2}, {0x971c, 0x919a}, {0x971e, 0x89e0}, {0x9724, 0xe8c3}, {0x9727, 0x96b6}, {0x972a, 0xe8c4}, {0x9730, 0xe8c5}, {0x9732, 0x9849}, {0x9733, 0xfbed}, {0x9738, 0x9e50}, {0x9739, 0xe8c6}, {0x973b, 0xfbee}, {0x973d, 0xe8c7}, {0x973e, 0xe8c8}, {0x9742, 0xe8cc}, {0x9743, 0xfbef}, {0x9744, 0xe8c9}, {0x9746, 0xe8ca}, {0x9748, 0xe8cb}, {0x9749, 0xe8cd}, {0x974d, 0xfbf0}, {0x974f, 0xfbf1}, {0x9751, 0xfbf2}, {0x9752, 0x90c2}, {0x9755, 0xfbf3}, {0x9756, 0x96f5}, {0x9759, 0x90c3}, {0x975c, 0xe8ce}, {0x975e, 0x94f1}, {0x9760, 0xe8cf}, {0x9761, 0xea72}, {0x9762, 0x96ca}, {0x9764, 0xe8d0}, {0x9766, 0xe8d1}, {0x9768, 0xe8d2}, {0x9769, 0x8a76}, {0x976b, 0xe8d4}, {0x976d, 0x9078}, {0x9771, 0xe8d5}, {0x9774, 0x8c43}, {0x9779, 0xe8d6}, {0x977a, 0xe8da}, {0x977c, 0xe8d8}, {0x9781, 0xe8d9}, {0x9784, 0x8a93}, {0x9785, 0xe8d7}, {0x9786, 0xe8db}, {0x978b, 0xe8dc}, {0x978d, 0x88c6}, {0x978f, 0xe8dd}, {0x9790, 0xe8de}, {0x9798, 0x8fe2}, {0x979c, 0xe8df}, {0x97a0, 0x8b66}, {0x97a3, 0xe8e2}, {0x97a6, 0xe8e1}, {0x97a8, 0xe8e0}, {0x97ab, 0xe691}, {0x97ad, 0x95da}, {0x97b3, 0xe8e3}, {0x97b4, 0xe8e4}, {0x97c3, 0xe8e5}, {0x97c6, 0xe8e6}, {0x97c8, 0xe8e7}, {0x97cb, 0xe8e8}, {0x97d3, 0x8ad8}, {0x97dc, 0xe8e9}, {0x97ed, 0xe8ea}, {0x97ee, 0x9442}, {0x97f2, 0xe8ec}, {0x97f3, 0x89b9}, {0x97f5, 0xe8ef}, {0x97f6, 0xe8ee}, {0x97fb, 0x8943}, {0x97ff, 0x8bbf}, {0x9801, 0x95c5}, {0x9802, 0x92b8}, {0x9803, 0x8da0}, {0x9805, 0x8d80}, {0x9806, 0x8f87}, {0x9808, 0x907b}, {0x980c, 0xe8f1}, {0x980f, 0xe8f0}, {0x9810, 0x9761}, {0x9811, 0x8ae6}, {0x9812, 0x94d0}, {0x9813, 0x93da}, {0x9817, 0x909c}, {0x9818, 0x97cc}, {0x981a, 0x8c7a}, {0x9821, 0xe8f4}, {0x9824, 0xe8f3}, {0x982c, 0x966a}, {0x982d, 0x93aa}, {0x9834, 0x896f}, {0x9837, 0xe8f5}, {0x9838, 0xe8f2}, {0x983b, 0x9570}, {0x983c, 0x978a}, {0x983d, 0xe8f6}, {0x9846, 0xe8f7}, {0x984b, 0xe8f9}, {0x984c, 0x91e8}, {0x984d, 0x8a7a}, {0x984e, 0x8a7b}, {0x984f, 0xe8f8}, {0x9854, 0x8ae7}, {0x9855, 0x8cb0}, {0x9857, 0xfbf4}, {0x9858, 0x8ae8}, {0x985b, 0x935e}, {0x985e, 0x97de}, {0x9865, 0xfbf5}, {0x9867, 0x8cda}, {0x986b, 0xe8fa}, {0x986f, 0xe8fb}, {0x9870, 0xe8fc}, {0x9871, 0xe940}, {0x9873, 0xe942}, {0x9874, 0xe941}, {0x98a8, 0x9597}, {0x98aa, 0xe943}, {0x98af, 0xe944}, {0x98b1, 0xe945}, {0x98b6, 0xe946}, {0x98c3, 0xe948}, {0x98c4, 0xe947}, {0x98c6, 0xe949}, {0x98db, 0x94f2}, {0x98dc, 0xe3ca}, {0x98df, 0x9048}, {0x98e2, 0x8b51}, {0x98e9, 0xe94a}, {0x98eb, 0xe94b}, {0x98ed, 0x99aa}, {0x98ee, 0x9f5a}, {0x98ef, 0x94d1}, {0x98f2, 0x88f9}, {0x98f4, 0x88b9}, {0x98fc, 0x8e94}, {0x98fd, 0x964f}, {0x98fe, 0x8ffc}, {0x9903, 0xe94c}, {0x9905, 0x96dd}, {0x9909, 0xe94d}, {0x990a, 0x977b}, {0x990c, 0x8961}, {0x9910, 0x8e60}, {0x9912, 0xe94e}, {0x9913, 0x89ec}, {0x9914, 0xe94f}, {0x9918, 0xe950}, {0x991d, 0xe952}, {0x991e, 0xe953}, {0x9920, 0xe955}, {0x9921, 0xe951}, {0x9924, 0xe954}, {0x9927, 0xfbf8}, {0x9928, 0x8ad9}, {0x992c, 0xe956}, {0x992e, 0xe957}, {0x993d, 0xe958}, {0x993e, 0xe959}, {0x9942, 0xe95a}, {0x9945, 0xe95c}, {0x9949, 0xe95b}, {0x994b, 0xe95e}, {0x994c, 0xe961}, {0x9950, 0xe95d}, {0x9951, 0xe95f}, {0x9952, 0xe960}, {0x9955, 0xe962}, {0x9957, 0x8bc0}, {0x9996, 0x8ef1}, {0x9997, 0xe963}, {0x9998, 0xe964}, {0x9999, 0x8d81}, {0x999e, 0xfbfa}, {0x99a5, 0xe965}, {0x99a8, 0x8a5d}, {0x99ac, 0x946e}, {0x99ad, 0xe966}, {0x99ae, 0xe967}, {0x99b3, 0x9279}, {0x99b4, 0x93e9}, {0x99bc, 0xe968}, {0x99c1, 0x949d}, {0x99c4, 0x91ca}, {0x99c5, 0x8977}, {0x99c6, 0x8bec}, {0x99c8, 0x8bed}, {0x99d0, 0x9293}, {0x99d1, 0xe96d}, {0x99d2, 0x8bee}, {0x99d5, 0x89ed}, {0x99d8, 0xe96c}, {0x99db, 0xe96a}, {0x99dd, 0xe96b}, {0x99df, 0xe969}, {0x99e2, 0xe977}, {0x99ed, 0xe96e}, {0x99ee, 0xe96f}, {0x99f1, 0xe970}, {0x99f2, 0xe971}, {0x99f8, 0xe973}, {0x99fb, 0xe972}, {0x99ff, 0x8f78}, {0x9a01, 0xe974}, {0x9a05, 0xe976}, {0x9a0e, 0x8b52}, {0x9a0f, 0xe975}, {0x9a12, 0x919b}, {0x9a13, 0x8cb1}, {0x9a19, 0xe978}, {0x9a28, 0x91cb}, {0x9a2b, 0xe979}, {0x9a30, 0x93ab}, {0x9a37, 0xe97a}, {0x9a3e, 0xe980}, {0x9a40, 0xe97d}, {0x9a42, 0xe97c}, {0x9a43, 0xe97e}, {0x9a45, 0xe97b}, {0x9a4d, 0xe982}, {0x9a4e, 0xfbfb}, {0x9a55, 0xe981}, {0x9a57, 0xe984}, {0x9a5a, 0x8bc1}, {0x9a5b, 0xe983}, {0x9a5f, 0xe985}, {0x9a62, 0xe986}, {0x9a64, 0xe988}, {0x9a65, 0xe987}, {0x9a69, 0xe989}, {0x9a6a, 0xe98b}, {0x9a6b, 0xe98a}, {0x9aa8, 0x8d9c}, {0x9aad, 0xe98c}, {0x9ab0, 0xe98d}, {0x9ab8, 0x8a5b}, {0x9abc, 0xe98e}, {0x9ac0, 0xe98f}, {0x9ac4, 0x9091}, {0x9acf, 0xe990}, {0x9ad1, 0xe991}, {0x9ad3, 0xe992}, {0x9ad4, 0xe993}, {0x9ad8, 0x8d82}, {0x9ad9, 0xfbfc}, {0x9adc, 0xfc40}, {0x9ade, 0xe994}, {0x9adf, 0xe995}, {0x9ae2, 0xe996}, {0x9ae3, 0xe997}, {0x9ae6, 0xe998}, {0x9aea, 0x94af}, {0x9aeb, 0xe99a}, {0x9aed, 0x9545}, {0x9aee, 0xe99b}, {0x9aef, 0xe999}, {0x9af1, 0xe99d}, {0x9af4, 0xe99c}, {0x9af7, 0xe99e}, {0x9afb, 0xe99f}, {0x9b06, 0xe9a0}, {0x9b18, 0xe9a1}, {0x9b1a, 0xe9a2}, {0x9b1f, 0xe9a3}, {0x9b22, 0xe9a4}, {0x9b23, 0xe9a5}, {0x9b25, 0xe9a6}, {0x9b27, 0xe9a7}, {0x9b28, 0xe9a8}, {0x9b29, 0xe9a9}, {0x9b2a, 0xe9aa}, {0x9b2e, 0xe9ab}, {0x9b2f, 0xe9ac}, {0x9b31, 0x9f54}, {0x9b32, 0xe9ad}, {0x9b3b, 0xe2f6}, {0x9b3c, 0x8b53}, {0x9b41, 0x8a40}, {0x9b42, 0x8db0}, {0x9b43, 0xe9af}, {0x9b44, 0xe9ae}, {0x9b45, 0x96a3}, {0x9b4d, 0xe9b1}, {0x9b4e, 0xe9b2}, {0x9b4f, 0xe9b0}, {0x9b51, 0xe9b3}, {0x9b54, 0x9682}, {0x9b58, 0xe9b4}, {0x9b5a, 0x8b9b}, {0x9b6f, 0x9844}, {0x9b72, 0xfc42}, {0x9b74, 0xe9b5}, {0x9b75, 0xfc41}, {0x9b83, 0xe9b7}, {0x9b8e, 0x88bc}, {0x9b8f, 0xfc43}, {0x9b91, 0xe9b8}, {0x9b92, 0x95a9}, {0x9b93, 0xe9b6}, {0x9b96, 0xe9b9}, {0x9b97, 0xe9ba}, {0x9b9f, 0xe9bb}, {0x9ba0, 0xe9bc}, {0x9ba8, 0xe9bd}, {0x9baa, 0x968e}, {0x9bab, 0x8e4c}, {0x9bad, 0x8df8}, {0x9bae, 0x914e}, {0x9bb1, 0xfc44}, {0x9bb4, 0xe9be}, {0x9bb9, 0xe9c1}, {0x9bbb, 0xfc45}, {0x9bc0, 0xe9bf}, {0x9bc6, 0xe9c2}, {0x9bc9, 0x8cef}, {0x9bca, 0xe9c0}, {0x9bcf, 0xe9c3}, {0x9bd1, 0xe9c4}, {0x9bd2, 0xe9c5}, {0x9bd4, 0xe9c9}, {0x9bd6, 0x8e49}, {0x9bdb, 0x91e2}, {0x9be1, 0xe9ca}, {0x9be2, 0xe9c7}, {0x9be3, 0xe9c6}, {0x9be4, 0xe9c8}, {0x9be8, 0x8c7e}, {0x9bf0, 0xe9ce}, {0x9bf1, 0xe9cd}, {0x9bf2, 0xe9cc}, {0x9bf5, 0x88b1}, {0x9c00, 0xfc46}, {0x9c04, 0xe9d8}, {0x9c06, 0xe9d4}, {0x9c08, 0xe9d5}, {0x9c09, 0xe9d1}, {0x9c0a, 0xe9d7}, {0x9c0c, 0xe9d3}, {0x9c0d, 0x8a82}, {0x9c10, 0x986b}, {0x9c12, 0xe9d6}, {0x9c13, 0xe9d2}, {0x9c14, 0xe9d0}, {0x9c15, 0xe9cf}, {0x9c1b, 0xe9da}, {0x9c21, 0xe9dd}, {0x9c24, 0xe9dc}, {0x9c25, 0xe9db}, {0x9c2d, 0x9568}, {0x9c2e, 0xe9d9}, {0x9c2f, 0x88f1}, {0x9c30, 0xe9de}, {0x9c32, 0xe9e0}, {0x9c39, 0x8a8f}, {0x9c3a, 0xe9cb}, {0x9c3b, 0x8956}, {0x9c3e, 0xe9e2}, {0x9c46, 0xe9e1}, {0x9c47, 0xe9df}, {0x9c48, 0x924c}, {0x9c52, 0x9690}, {0x9c57, 0x97d8}, {0x9c5a, 0xe9e3}, {0x9c60, 0xe9e4}, {0x9c67, 0xe9e5}, {0x9c76, 0xe9e6}, {0x9c78, 0xe9e7}, {0x9ce5, 0x92b9}, {0x9ce7, 0xe9e8}, {0x9ce9, 0x94b5}, {0x9ceb, 0xe9ed}, {0x9cec, 0xe9e9}, {0x9cf0, 0xe9ea}, {0x9cf3, 0x9650}, {0x9cf4, 0x96c2}, {0x9cf6, 0x93ce}, {0x9d03, 0xe9ee}, {0x9d06, 0xe9ef}, {0x9d07, 0x93bc}, {0x9d08, 0xe9ec}, {0x9d09, 0xe9eb}, {0x9d0e, 0x89a8}, {0x9d12, 0xe9f7}, {0x9d15, 0xe9f6}, {0x9d1b, 0x8995}, {0x9d1f, 0xe9f4}, {0x9d23, 0xe9f3}, {0x9d26, 0xe9f1}, {0x9d28, 0x8a9b}, {0x9d2a, 0xe9f0}, {0x9d2b, 0x8eb0}, {0x9d2c, 0x89a7}, {0x9d3b, 0x8d83}, {0x9d3e, 0xe9fa}, {0x9d3f, 0xe9f9}, {0x9d41, 0xe9f8}, {0x9d44, 0xe9f5}, {0x9d46, 0xe9fb}, {0x9d48, 0xe9fc}, {0x9d50, 0xea44}, {0x9d51, 0xea43}, {0x9d59, 0xea45}, {0x9d5c, 0x894c}, {0x9d5d, 0xea40}, {0x9d5e, 0xea41}, {0x9d60, 0x8d94}, {0x9d61, 0x96b7}, {0x9d64, 0xea42}, {0x9d6b, 0xfc48}, {0x9d6c, 0x9651}, {0x9d6f, 0xea4a}, {0x9d70, 0xfc47}, {0x9d72, 0xea46}, {0x9d7a, 0xea4b}, {0x9d87, 0xea48}, {0x9d89, 0xea47}, {0x9d8f, 0x8c7b}, {0x9d9a, 0xea4c}, {0x9da4, 0xea4d}, {0x9da9, 0xea4e}, {0x9dab, 0xea49}, {0x9daf, 0xe9f2}, {0x9db2, 0xea4f}, {0x9db4, 0x92df}, {0x9db8, 0xea53}, {0x9dba, 0xea54}, {0x9dbb, 0xea52}, {0x9dc1, 0xea51}, {0x9dc2, 0xea57}, {0x9dc4, 0xea50}, {0x9dc6, 0xea55}, {0x9dcf, 0xea56}, {0x9dd3, 0xea59}, {0x9dd9, 0xea58}, {0x9de6, 0xea5b}, {0x9ded, 0xea5c}, {0x9def, 0xea5d}, {0x9df2, 0x9868}, {0x9df8, 0xea5a}, {0x9df9, 0x91e9}, {0x9dfa, 0x8deb}, {0x9dfd, 0xea5e}, {0x9e19, 0xfc4a}, {0x9e1a, 0xea5f}, {0x9e1b, 0xea60}, {0x9e1e, 0xea61}, {0x9e75, 0xea62}, {0x9e78, 0x8cb2}, {0x9e79, 0xea63}, {0x9e7d, 0xea64}, {0x9e7f, 0x8ead}, {0x9e81, 0xea65}, {0x9e88, 0xea66}, {0x9e8b, 0xea67}, {0x9e8c, 0xea68}, {0x9e91, 0xea6b}, {0x9e92, 0xea69}, {0x9e93, 0x985b}, {0x9e95, 0xea6a}, {0x9e97, 0x97ed}, {0x9e9d, 0xea6c}, {0x9e9f, 0x97d9}, {0x9ea5, 0xea6d}, {0x9ea6, 0x949e}, {0x9ea9, 0xea6e}, {0x9eaa, 0xea70}, {0x9ead, 0xea71}, {0x9eb8, 0xea6f}, {0x9eb9, 0x8d8d}, {0x9eba, 0x96cb}, {0x9ebb, 0x9683}, {0x9ebc, 0x9bf5}, {0x9ebe, 0x9f80}, {0x9ebf, 0x969b}, {0x9ec4, 0x89a9}, {0x9ecc, 0xea73}, {0x9ecd, 0x8b6f}, {0x9ece, 0xea74}, {0x9ecf, 0xea75}, {0x9ed0, 0xea76}, {0x9ed1, 0xfc4b}, {0x9ed2, 0x8d95}, {0x9ed4, 0xea77}, {0x9ed8, 0xe0d2}, {0x9ed9, 0x96d9}, {0x9edb, 0x91e1}, {0x9edc, 0xea78}, {0x9edd, 0xea7a}, {0x9ede, 0xea79}, {0x9ee0, 0xea7b}, {0x9ee5, 0xea7c}, {0x9ee8, 0xea7d}, {0x9eef, 0xea7e}, {0x9ef4, 0xea80}, {0x9ef6, 0xea81}, {0x9ef7, 0xea82}, {0x9ef9, 0xea83}, {0x9efb, 0xea84}, {0x9efc, 0xea85}, {0x9efd, 0xea86}, {0x9f07, 0xea87}, {0x9f08, 0xea88}, {0x9f0e, 0x9343}, {0x9f13, 0x8cdb}, {0x9f15, 0xea8a}, {0x9f20, 0x916c}, {0x9f21, 0xea8b}, {0x9f2c, 0xea8c}, {0x9f3b, 0x9540}, {0x9f3e, 0xea8d}, {0x9f4a, 0xea8e}, {0x9f4b, 0xe256}, {0x9f4e, 0xe6d8}, {0x9f4f, 0xe8eb}, {0x9f52, 0xea8f}, {0x9f54, 0xea90}, {0x9f5f, 0xea92}, {0x9f60, 0xea93}, {0x9f61, 0xea94}, {0x9f62, 0x97ee}, {0x9f63, 0xea91}, {0x9f66, 0xea95}, {0x9f67, 0xea96}, {0x9f6a, 0xea98}, {0x9f6c, 0xea97}, {0x9f72, 0xea9a}, {0x9f76, 0xea9b}, {0x9f77, 0xea99}, {0x9f8d, 0x97b4}, {0x9f95, 0xea9c}, {0x9f9c, 0xea9d}, {0x9f9d, 0xe273}, {0x9fa0, 0xea9e}, #ifdef USERDEFINE {0xe000, 0xf040}, {0xe001, 0xf041}, {0xe002, 0xf042}, {0xe003, 0xf043}, {0xe004, 0xf044}, {0xe005, 0xf045}, {0xe006, 0xf046}, {0xe007, 0xf047}, {0xe008, 0xf048}, {0xe009, 0xf049}, {0xe00a, 0xf04a}, {0xe00b, 0xf04b}, {0xe00c, 0xf04c}, {0xe00d, 0xf04d}, {0xe00e, 0xf04e}, {0xe00f, 0xf04f}, {0xe010, 0xf050}, {0xe011, 0xf051}, {0xe012, 0xf052}, {0xe013, 0xf053}, {0xe014, 0xf054}, {0xe015, 0xf055}, {0xe016, 0xf056}, {0xe017, 0xf057}, {0xe018, 0xf058}, {0xe019, 0xf059}, {0xe01a, 0xf05a}, {0xe01b, 0xf05b}, {0xe01c, 0xf05c}, {0xe01d, 0xf05d}, {0xe01e, 0xf05e}, {0xe01f, 0xf05f}, {0xe020, 0xf060}, {0xe021, 0xf061}, {0xe022, 0xf062}, {0xe023, 0xf063}, {0xe024, 0xf064}, {0xe025, 0xf065}, {0xe026, 0xf066}, {0xe027, 0xf067}, {0xe028, 0xf068}, {0xe029, 0xf069}, {0xe02a, 0xf06a}, {0xe02b, 0xf06b}, {0xe02c, 0xf06c}, {0xe02d, 0xf06d}, {0xe02e, 0xf06e}, {0xe02f, 0xf06f}, {0xe030, 0xf070}, {0xe031, 0xf071}, {0xe032, 0xf072}, {0xe033, 0xf073}, {0xe034, 0xf074}, {0xe035, 0xf075}, {0xe036, 0xf076}, {0xe037, 0xf077}, {0xe038, 0xf078}, {0xe039, 0xf079}, {0xe03a, 0xf07a}, {0xe03b, 0xf07b}, {0xe03c, 0xf07c}, {0xe03d, 0xf07d}, {0xe03e, 0xf07e}, {0xe03f, 0xf080}, {0xe040, 0xf081}, {0xe041, 0xf082}, {0xe042, 0xf083}, {0xe043, 0xf084}, {0xe044, 0xf085}, {0xe045, 0xf086}, {0xe046, 0xf087}, {0xe047, 0xf088}, {0xe048, 0xf089}, {0xe049, 0xf08a}, {0xe04a, 0xf08b}, {0xe04b, 0xf08c}, {0xe04c, 0xf08d}, {0xe04d, 0xf08e}, {0xe04e, 0xf08f}, {0xe04f, 0xf090}, {0xe050, 0xf091}, {0xe051, 0xf092}, {0xe052, 0xf093}, {0xe053, 0xf094}, {0xe054, 0xf095}, {0xe055, 0xf096}, {0xe056, 0xf097}, {0xe057, 0xf098}, {0xe058, 0xf099}, {0xe059, 0xf09a}, {0xe05a, 0xf09b}, {0xe05b, 0xf09c}, {0xe05c, 0xf09d}, {0xe05d, 0xf09e}, {0xe05e, 0xf09f}, {0xe05f, 0xf0a0}, {0xe060, 0xf0a1}, {0xe061, 0xf0a2}, {0xe062, 0xf0a3}, {0xe063, 0xf0a4}, {0xe064, 0xf0a5}, {0xe065, 0xf0a6}, {0xe066, 0xf0a7}, {0xe067, 0xf0a8}, {0xe068, 0xf0a9}, {0xe069, 0xf0aa}, {0xe06a, 0xf0ab}, {0xe06b, 0xf0ac}, {0xe06c, 0xf0ad}, {0xe06d, 0xf0ae}, {0xe06e, 0xf0af}, {0xe06f, 0xf0b0}, {0xe070, 0xf0b1}, {0xe071, 0xf0b2}, {0xe072, 0xf0b3}, {0xe073, 0xf0b4}, {0xe074, 0xf0b5}, {0xe075, 0xf0b6}, {0xe076, 0xf0b7}, {0xe077, 0xf0b8}, {0xe078, 0xf0b9}, {0xe079, 0xf0ba}, {0xe07a, 0xf0bb}, {0xe07b, 0xf0bc}, {0xe07c, 0xf0bd}, {0xe07d, 0xf0be}, {0xe07e, 0xf0bf}, {0xe07f, 0xf0c0}, {0xe080, 0xf0c1}, {0xe081, 0xf0c2}, {0xe082, 0xf0c3}, {0xe083, 0xf0c4}, {0xe084, 0xf0c5}, {0xe085, 0xf0c6}, {0xe086, 0xf0c7}, {0xe087, 0xf0c8}, {0xe088, 0xf0c9}, {0xe089, 0xf0ca}, {0xe08a, 0xf0cb}, {0xe08b, 0xf0cc}, {0xe08c, 0xf0cd}, {0xe08d, 0xf0ce}, {0xe08e, 0xf0cf}, {0xe08f, 0xf0d0}, {0xe090, 0xf0d1}, {0xe091, 0xf0d2}, {0xe092, 0xf0d3}, {0xe093, 0xf0d4}, {0xe094, 0xf0d5}, {0xe095, 0xf0d6}, {0xe096, 0xf0d7}, {0xe097, 0xf0d8}, {0xe098, 0xf0d9}, {0xe099, 0xf0da}, {0xe09a, 0xf0db}, {0xe09b, 0xf0dc}, {0xe09c, 0xf0dd}, {0xe09d, 0xf0de}, {0xe09e, 0xf0df}, {0xe09f, 0xf0e0}, {0xe0a0, 0xf0e1}, {0xe0a1, 0xf0e2}, {0xe0a2, 0xf0e3}, {0xe0a3, 0xf0e4}, {0xe0a4, 0xf0e5}, {0xe0a5, 0xf0e6}, {0xe0a6, 0xf0e7}, {0xe0a7, 0xf0e8}, {0xe0a8, 0xf0e9}, {0xe0a9, 0xf0ea}, {0xe0aa, 0xf0eb}, {0xe0ab, 0xf0ec}, {0xe0ac, 0xf0ed}, {0xe0ad, 0xf0ee}, {0xe0ae, 0xf0ef}, {0xe0af, 0xf0f0}, {0xe0b0, 0xf0f1}, {0xe0b1, 0xf0f2}, {0xe0b2, 0xf0f3}, {0xe0b3, 0xf0f4}, {0xe0b4, 0xf0f5}, {0xe0b5, 0xf0f6}, {0xe0b6, 0xf0f7}, {0xe0b7, 0xf0f8}, {0xe0b8, 0xf0f9}, {0xe0b9, 0xf0fa}, {0xe0ba, 0xf0fb}, {0xe0bb, 0xf0fc}, {0xe0bc, 0xf140}, {0xe0bd, 0xf141}, {0xe0be, 0xf142}, {0xe0bf, 0xf143}, {0xe0c0, 0xf144}, {0xe0c1, 0xf145}, {0xe0c2, 0xf146}, {0xe0c3, 0xf147}, {0xe0c4, 0xf148}, {0xe0c5, 0xf149}, {0xe0c6, 0xf14a}, {0xe0c7, 0xf14b}, {0xe0c8, 0xf14c}, {0xe0c9, 0xf14d}, {0xe0ca, 0xf14e}, {0xe0cb, 0xf14f}, {0xe0cc, 0xf150}, {0xe0cd, 0xf151}, {0xe0ce, 0xf152}, {0xe0cf, 0xf153}, {0xe0d0, 0xf154}, {0xe0d1, 0xf155}, {0xe0d2, 0xf156}, {0xe0d3, 0xf157}, {0xe0d4, 0xf158}, {0xe0d5, 0xf159}, {0xe0d6, 0xf15a}, {0xe0d7, 0xf15b}, {0xe0d8, 0xf15c}, {0xe0d9, 0xf15d}, {0xe0da, 0xf15e}, {0xe0db, 0xf15f}, {0xe0dc, 0xf160}, {0xe0dd, 0xf161}, {0xe0de, 0xf162}, {0xe0df, 0xf163}, {0xe0e0, 0xf164}, {0xe0e1, 0xf165}, {0xe0e2, 0xf166}, {0xe0e3, 0xf167}, {0xe0e4, 0xf168}, {0xe0e5, 0xf169}, {0xe0e6, 0xf16a}, {0xe0e7, 0xf16b}, {0xe0e8, 0xf16c}, {0xe0e9, 0xf16d}, {0xe0ea, 0xf16e}, {0xe0eb, 0xf16f}, {0xe0ec, 0xf170}, {0xe0ed, 0xf171}, {0xe0ee, 0xf172}, {0xe0ef, 0xf173}, {0xe0f0, 0xf174}, {0xe0f1, 0xf175}, {0xe0f2, 0xf176}, {0xe0f3, 0xf177}, {0xe0f4, 0xf178}, {0xe0f5, 0xf179}, {0xe0f6, 0xf17a}, {0xe0f7, 0xf17b}, {0xe0f8, 0xf17c}, {0xe0f9, 0xf17d}, {0xe0fa, 0xf17e}, {0xe0fb, 0xf180}, {0xe0fc, 0xf181}, {0xe0fd, 0xf182}, {0xe0fe, 0xf183}, {0xe0ff, 0xf184}, {0xe100, 0xf185}, {0xe101, 0xf186}, {0xe102, 0xf187}, {0xe103, 0xf188}, {0xe104, 0xf189}, {0xe105, 0xf18a}, {0xe106, 0xf18b}, {0xe107, 0xf18c}, {0xe108, 0xf18d}, {0xe109, 0xf18e}, {0xe10a, 0xf18f}, {0xe10b, 0xf190}, {0xe10c, 0xf191}, {0xe10d, 0xf192}, {0xe10e, 0xf193}, {0xe10f, 0xf194}, {0xe110, 0xf195}, {0xe111, 0xf196}, {0xe112, 0xf197}, {0xe113, 0xf198}, {0xe114, 0xf199}, {0xe115, 0xf19a}, {0xe116, 0xf19b}, {0xe117, 0xf19c}, {0xe118, 0xf19d}, {0xe119, 0xf19e}, {0xe11a, 0xf19f}, {0xe11b, 0xf1a0}, {0xe11c, 0xf1a1}, {0xe11d, 0xf1a2}, {0xe11e, 0xf1a3}, {0xe11f, 0xf1a4}, {0xe120, 0xf1a5}, {0xe121, 0xf1a6}, {0xe122, 0xf1a7}, {0xe123, 0xf1a8}, {0xe124, 0xf1a9}, {0xe125, 0xf1aa}, {0xe126, 0xf1ab}, {0xe127, 0xf1ac}, {0xe128, 0xf1ad}, {0xe129, 0xf1ae}, {0xe12a, 0xf1af}, {0xe12b, 0xf1b0}, {0xe12c, 0xf1b1}, {0xe12d, 0xf1b2}, {0xe12e, 0xf1b3}, {0xe12f, 0xf1b4}, {0xe130, 0xf1b5}, {0xe131, 0xf1b6}, {0xe132, 0xf1b7}, {0xe133, 0xf1b8}, {0xe134, 0xf1b9}, {0xe135, 0xf1ba}, {0xe136, 0xf1bb}, {0xe137, 0xf1bc}, {0xe138, 0xf1bd}, {0xe139, 0xf1be}, {0xe13a, 0xf1bf}, {0xe13b, 0xf1c0}, {0xe13c, 0xf1c1}, {0xe13d, 0xf1c2}, {0xe13e, 0xf1c3}, {0xe13f, 0xf1c4}, {0xe140, 0xf1c5}, {0xe141, 0xf1c6}, {0xe142, 0xf1c7}, {0xe143, 0xf1c8}, {0xe144, 0xf1c9}, {0xe145, 0xf1ca}, {0xe146, 0xf1cb}, {0xe147, 0xf1cc}, {0xe148, 0xf1cd}, {0xe149, 0xf1ce}, {0xe14a, 0xf1cf}, {0xe14b, 0xf1d0}, {0xe14c, 0xf1d1}, {0xe14d, 0xf1d2}, {0xe14e, 0xf1d3}, {0xe14f, 0xf1d4}, {0xe150, 0xf1d5}, {0xe151, 0xf1d6}, {0xe152, 0xf1d7}, {0xe153, 0xf1d8}, {0xe154, 0xf1d9}, {0xe155, 0xf1da}, {0xe156, 0xf1db}, {0xe157, 0xf1dc}, {0xe158, 0xf1dd}, {0xe159, 0xf1de}, {0xe15a, 0xf1df}, {0xe15b, 0xf1e0}, {0xe15c, 0xf1e1}, {0xe15d, 0xf1e2}, {0xe15e, 0xf1e3}, {0xe15f, 0xf1e4}, {0xe160, 0xf1e5}, {0xe161, 0xf1e6}, {0xe162, 0xf1e7}, {0xe163, 0xf1e8}, {0xe164, 0xf1e9}, {0xe165, 0xf1ea}, {0xe166, 0xf1eb}, {0xe167, 0xf1ec}, {0xe168, 0xf1ed}, {0xe169, 0xf1ee}, {0xe16a, 0xf1ef}, {0xe16b, 0xf1f0}, {0xe16c, 0xf1f1}, {0xe16d, 0xf1f2}, {0xe16e, 0xf1f3}, {0xe16f, 0xf1f4}, {0xe170, 0xf1f5}, {0xe171, 0xf1f6}, {0xe172, 0xf1f7}, {0xe173, 0xf1f8}, {0xe174, 0xf1f9}, {0xe175, 0xf1fa}, {0xe176, 0xf1fb}, {0xe177, 0xf1fc}, {0xe178, 0xf240}, {0xe179, 0xf241}, {0xe17a, 0xf242}, {0xe17b, 0xf243}, {0xe17c, 0xf244}, {0xe17d, 0xf245}, {0xe17e, 0xf246}, {0xe17f, 0xf247}, {0xe180, 0xf248}, {0xe181, 0xf249}, {0xe182, 0xf24a}, {0xe183, 0xf24b}, {0xe184, 0xf24c}, {0xe185, 0xf24d}, {0xe186, 0xf24e}, {0xe187, 0xf24f}, {0xe188, 0xf250}, {0xe189, 0xf251}, {0xe18a, 0xf252}, {0xe18b, 0xf253}, {0xe18c, 0xf254}, {0xe18d, 0xf255}, {0xe18e, 0xf256}, {0xe18f, 0xf257}, {0xe190, 0xf258}, {0xe191, 0xf259}, {0xe192, 0xf25a}, {0xe193, 0xf25b}, {0xe194, 0xf25c}, {0xe195, 0xf25d}, {0xe196, 0xf25e}, {0xe197, 0xf25f}, {0xe198, 0xf260}, {0xe199, 0xf261}, {0xe19a, 0xf262}, {0xe19b, 0xf263}, {0xe19c, 0xf264}, {0xe19d, 0xf265}, {0xe19e, 0xf266}, {0xe19f, 0xf267}, {0xe1a0, 0xf268}, {0xe1a1, 0xf269}, {0xe1a2, 0xf26a}, {0xe1a3, 0xf26b}, {0xe1a4, 0xf26c}, {0xe1a5, 0xf26d}, {0xe1a6, 0xf26e}, {0xe1a7, 0xf26f}, {0xe1a8, 0xf270}, {0xe1a9, 0xf271}, {0xe1aa, 0xf272}, {0xe1ab, 0xf273}, {0xe1ac, 0xf274}, {0xe1ad, 0xf275}, {0xe1ae, 0xf276}, {0xe1af, 0xf277}, {0xe1b0, 0xf278}, {0xe1b1, 0xf279}, {0xe1b2, 0xf27a}, {0xe1b3, 0xf27b}, {0xe1b4, 0xf27c}, {0xe1b5, 0xf27d}, {0xe1b6, 0xf27e}, {0xe1b7, 0xf280}, {0xe1b8, 0xf281}, {0xe1b9, 0xf282}, {0xe1ba, 0xf283}, {0xe1bb, 0xf284}, {0xe1bc, 0xf285}, {0xe1bd, 0xf286}, {0xe1be, 0xf287}, {0xe1bf, 0xf288}, {0xe1c0, 0xf289}, {0xe1c1, 0xf28a}, {0xe1c2, 0xf28b}, {0xe1c3, 0xf28c}, {0xe1c4, 0xf28d}, {0xe1c5, 0xf28e}, {0xe1c6, 0xf28f}, {0xe1c7, 0xf290}, {0xe1c8, 0xf291}, {0xe1c9, 0xf292}, {0xe1ca, 0xf293}, {0xe1cb, 0xf294}, {0xe1cc, 0xf295}, {0xe1cd, 0xf296}, {0xe1ce, 0xf297}, {0xe1cf, 0xf298}, {0xe1d0, 0xf299}, {0xe1d1, 0xf29a}, {0x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2d9}, {0xe211, 0xf2da}, {0xe212, 0xf2db}, {0xe213, 0xf2dc}, {0xe214, 0xf2dd}, {0xe215, 0xf2de}, {0xe216, 0xf2df}, {0xe217, 0xf2e0}, {0xe218, 0xf2e1}, {0xe219, 0xf2e2}, {0xe21a, 0xf2e3}, {0xe21b, 0xf2e4}, {0xe21c, 0xf2e5}, {0xe21d, 0xf2e6}, {0xe21e, 0xf2e7}, {0xe21f, 0xf2e8}, {0xe220, 0xf2e9}, {0xe221, 0xf2ea}, {0xe222, 0xf2eb}, {0xe223, 0xf2ec}, {0xe224, 0xf2ed}, {0xe225, 0xf2ee}, {0xe226, 0xf2ef}, {0xe227, 0xf2f0}, {0xe228, 0xf2f1}, {0xe229, 0xf2f2}, {0xe22a, 0xf2f3}, {0xe22b, 0xf2f4}, {0xe22c, 0xf2f5}, {0xe22d, 0xf2f6}, {0xe22e, 0xf2f7}, {0xe22f, 0xf2f8}, {0xe230, 0xf2f9}, {0xe231, 0xf2fa}, {0xe232, 0xf2fb}, {0xe233, 0xf2fc}, {0xe234, 0xf340}, {0xe235, 0xf341}, {0xe236, 0xf342}, {0xe237, 0xf343}, {0xe238, 0xf344}, {0xe239, 0xf345}, {0xe23a, 0xf346}, {0xe23b, 0xf347}, {0xe23c, 0xf348}, {0xe23d, 0xf349}, {0xe23e, 0xf34a}, {0xe23f, 0xf34b}, {0xe240, 0xf34c}, {0xe241, 0xf34d}, {0xe242, 0xf34e}, {0xe243, 0xf34f}, {0xe244, 0xf350}, {0xe245, 0xf351}, {0xe246, 0xf352}, {0xe247, 0xf353}, {0xe248, 0xf354}, {0xe249, 0xf355}, {0xe24a, 0xf356}, {0xe24b, 0xf357}, {0xe24c, 0xf358}, {0xe24d, 0xf359}, {0xe24e, 0xf35a}, {0xe24f, 0xf35b}, {0xe250, 0xf35c}, {0xe251, 0xf35d}, {0xe252, 0xf35e}, {0xe253, 0xf35f}, {0xe254, 0xf360}, {0xe255, 0xf361}, {0xe256, 0xf362}, {0xe257, 0xf363}, {0xe258, 0xf364}, {0xe259, 0xf365}, {0xe25a, 0xf366}, {0xe25b, 0xf367}, {0xe25c, 0xf368}, {0xe25d, 0xf369}, {0xe25e, 0xf36a}, {0xe25f, 0xf36b}, {0xe260, 0xf36c}, {0xe261, 0xf36d}, {0xe262, 0xf36e}, {0xe263, 0xf36f}, {0xe264, 0xf370}, {0xe265, 0xf371}, {0xe266, 0xf372}, {0xe267, 0xf373}, {0xe268, 0xf374}, {0xe269, 0xf375}, {0xe26a, 0xf376}, {0xe26b, 0xf377}, {0xe26c, 0xf378}, {0xe26d, 0xf379}, {0xe26e, 0xf37a}, {0xe26f, 0xf37b}, {0xe270, 0xf37c}, {0xe271, 0xf37d}, {0xe272, 0xf37e}, {0xe273, 0xf380}, {0xe274, 0xf381}, {0xe275, 0xf382}, {0xe276, 0xf383}, {0xe277, 0xf384}, {0xe278, 0xf385}, {0xe279, 0xf386}, {0xe27a, 0xf387}, {0xe27b, 0xf388}, {0xe27c, 0xf389}, {0xe27d, 0xf38a}, {0xe27e, 0xf38b}, {0xe27f, 0xf38c}, {0xe280, 0xf38d}, {0xe281, 0xf38e}, {0xe282, 0xf38f}, {0xe283, 0xf390}, {0xe284, 0xf391}, {0xe285, 0xf392}, {0xe286, 0xf393}, {0xe287, 0xf394}, {0xe288, 0xf395}, {0xe289, 0xf396}, {0xe28a, 0xf397}, {0xe28b, 0xf398}, {0xe28c, 0xf399}, {0xe28d, 0xf39a}, {0xe28e, 0xf39b}, {0xe28f, 0xf39c}, {0xe290, 0xf39d}, {0xe291, 0xf39e}, {0xe292, 0xf39f}, {0xe293, 0xf3a0}, {0xe294, 0xf3a1}, {0xe295, 0xf3a2}, {0xe296, 0xf3a3}, {0xe297, 0xf3a4}, {0xe298, 0xf3a5}, {0xe299, 0xf3a6}, {0xe29a, 0xf3a7}, {0xe29b, 0xf3a8}, {0xe29c, 0xf3a9}, {0xe29d, 0xf3aa}, {0xe29e, 0xf3ab}, {0xe29f, 0xf3ac}, {0x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{0xe2dd, 0xf3ea}, {0xe2de, 0xf3eb}, {0xe2df, 0xf3ec}, {0xe2e0, 0xf3ed}, {0xe2e1, 0xf3ee}, {0xe2e2, 0xf3ef}, {0xe2e3, 0xf3f0}, {0xe2e4, 0xf3f1}, {0xe2e5, 0xf3f2}, {0xe2e6, 0xf3f3}, {0xe2e7, 0xf3f4}, {0xe2e8, 0xf3f5}, {0xe2e9, 0xf3f6}, {0xe2ea, 0xf3f7}, {0xe2eb, 0xf3f8}, {0xe2ec, 0xf3f9}, {0xe2ed, 0xf3fa}, {0xe2ee, 0xf3fb}, {0xe2ef, 0xf3fc}, {0xe2f0, 0xf440}, {0xe2f1, 0xf441}, {0xe2f2, 0xf442}, {0xe2f3, 0xf443}, {0xe2f4, 0xf444}, {0xe2f5, 0xf445}, {0xe2f6, 0xf446}, {0xe2f7, 0xf447}, {0xe2f8, 0xf448}, {0xe2f9, 0xf449}, {0xe2fa, 0xf44a}, {0xe2fb, 0xf44b}, {0xe2fc, 0xf44c}, {0xe2fd, 0xf44d}, {0xe2fe, 0xf44e}, {0xe2ff, 0xf44f}, {0xe300, 0xf450}, {0xe301, 0xf451}, {0xe302, 0xf452}, {0xe303, 0xf453}, {0xe304, 0xf454}, {0xe305, 0xf455}, {0xe306, 0xf456}, {0xe307, 0xf457}, {0xe308, 0xf458}, {0xe309, 0xf459}, {0xe30a, 0xf45a}, {0xe30b, 0xf45b}, {0xe30c, 0xf45c}, {0xe30d, 0xf45d}, {0xe30e, 0xf45e}, {0xe30f, 0xf45f}, {0xe310, 0xf460}, {0xe311, 0xf461}, {0xe312, 0xf462}, {0xe313, 0xf463}, {0xe314, 0xf464}, {0xe315, 0xf465}, {0xe316, 0xf466}, {0xe317, 0xf467}, {0xe318, 0xf468}, {0xe319, 0xf469}, {0xe31a, 0xf46a}, {0xe31b, 0xf46b}, {0xe31c, 0xf46c}, {0xe31d, 0xf46d}, {0xe31e, 0xf46e}, {0xe31f, 0xf46f}, {0xe320, 0xf470}, {0xe321, 0xf471}, {0xe322, 0xf472}, {0xe323, 0xf473}, {0xe324, 0xf474}, {0xe325, 0xf475}, {0xe326, 0xf476}, {0xe327, 0xf477}, {0xe328, 0xf478}, {0xe329, 0xf479}, {0xe32a, 0xf47a}, {0xe32b, 0xf47b}, {0xe32c, 0xf47c}, {0xe32d, 0xf47d}, {0xe32e, 0xf47e}, {0xe32f, 0xf480}, {0xe330, 0xf481}, {0xe331, 0xf482}, {0xe332, 0xf483}, {0xe333, 0xf484}, {0xe334, 0xf485}, {0xe335, 0xf486}, {0xe336, 0xf487}, {0xe337, 0xf488}, {0xe338, 0xf489}, {0xe339, 0xf48a}, {0xe33a, 0xf48b}, {0xe33b, 0xf48c}, {0xe33c, 0xf48d}, {0xe33d, 0xf48e}, {0xe33e, 0xf48f}, {0xe33f, 0xf490}, {0xe340, 0xf491}, {0xe341, 0xf492}, {0xe342, 0xf493}, {0xe343, 0xf494}, {0xe344, 0xf495}, {0xe345, 0xf496}, {0xe346, 0xf497}, {0xe347, 0xf498}, {0xe348, 0xf499}, {0xe349, 0xf49a}, {0xe34a, 0xf49b}, {0xe34b, 0xf49c}, {0xe34c, 0xf49d}, {0xe34d, 0xf49e}, {0xe34e, 0xf49f}, {0xe34f, 0xf4a0}, {0xe350, 0xf4a1}, {0xe351, 0xf4a2}, {0xe352, 0xf4a3}, {0xe353, 0xf4a4}, {0xe354, 0xf4a5}, {0xe355, 0xf4a6}, {0xe356, 0xf4a7}, {0xe357, 0xf4a8}, {0xe358, 0xf4a9}, {0xe359, 0xf4aa}, {0xe35a, 0xf4ab}, {0xe35b, 0xf4ac}, {0xe35c, 0xf4ad}, {0xe35d, 0xf4ae}, {0xe35e, 0xf4af}, {0xe35f, 0xf4b0}, {0xe360, 0xf4b1}, {0xe361, 0xf4b2}, {0xe362, 0xf4b3}, {0xe363, 0xf4b4}, {0xe364, 0xf4b5}, {0xe365, 0xf4b6}, {0xe366, 0xf4b7}, {0xe367, 0xf4b8}, {0xe368, 0xf4b9}, {0xe369, 0xf4ba}, {0xe36a, 0xf4bb}, {0xe36b, 0xf4bc}, {0xe36c, 0xf4bd}, {0xe36d, 0xf4be}, {0xe36e, 0xf4bf}, {0xe36f, 0xf4c0}, {0xe370, 0xf4c1}, {0xe371, 0xf4c2}, {0xe372, 0xf4c3}, {0xe373, 0xf4c4}, {0xe374, 0xf4c5}, {0xe375, 0xf4c6}, {0xe376, 0xf4c7}, {0xe377, 0xf4c8}, {0xe378, 0xf4c9}, {0xe379, 0xf4ca}, {0xe37a, 0xf4cb}, {0xe37b, 0xf4cc}, {0xe37c, 0xf4cd}, {0xe37d, 0xf4ce}, {0xe37e, 0xf4cf}, {0xe37f, 0xf4d0}, {0xe380, 0xf4d1}, {0xe381, 0xf4d2}, {0xe382, 0xf4d3}, {0xe383, 0xf4d4}, {0xe384, 0xf4d5}, {0xe385, 0xf4d6}, {0xe386, 0xf4d7}, {0xe387, 0xf4d8}, {0xe388, 0xf4d9}, {0xe389, 0xf4da}, {0xe38a, 0xf4db}, {0xe38b, 0xf4dc}, {0xe38c, 0xf4dd}, {0xe38d, 0xf4de}, {0xe38e, 0xf4df}, {0xe38f, 0xf4e0}, {0xe390, 0xf4e1}, {0xe391, 0xf4e2}, {0xe392, 0xf4e3}, {0xe393, 0xf4e4}, {0xe394, 0xf4e5}, {0xe395, 0xf4e6}, {0xe396, 0xf4e7}, {0xe397, 0xf4e8}, {0xe398, 0xf4e9}, {0xe399, 0xf4ea}, {0xe39a, 0xf4eb}, {0xe39b, 0xf4ec}, {0xe39c, 0xf4ed}, {0xe39d, 0xf4ee}, {0xe39e, 0xf4ef}, {0xe39f, 0xf4f0}, {0xe3a0, 0xf4f1}, {0xe3a1, 0xf4f2}, {0xe3a2, 0xf4f3}, {0xe3a3, 0xf4f4}, {0xe3a4, 0xf4f5}, {0xe3a5, 0xf4f6}, {0xe3a6, 0xf4f7}, {0xe3a7, 0xf4f8}, {0xe3a8, 0xf4f9}, {0xe3a9, 0xf4fa}, {0xe3aa, 0xf4fb}, {0xe3ab, 0xf4fc}, {0xe3ac, 0xf540}, {0xe3ad, 0xf541}, {0xe3ae, 0xf542}, {0xe3af, 0xf543}, {0xe3b0, 0xf544}, {0xe3b1, 0xf545}, {0xe3b2, 0xf546}, {0xe3b3, 0xf547}, {0xe3b4, 0xf548}, {0xe3b5, 0xf549}, {0xe3b6, 0xf54a}, {0xe3b7, 0xf54b}, {0xe3b8, 0xf54c}, {0xe3b9, 0xf54d}, {0xe3ba, 0xf54e}, {0xe3bb, 0xf54f}, {0xe3bc, 0xf550}, {0xe3bd, 0xf551}, {0xe3be, 0xf552}, {0xe3bf, 0xf553}, {0xe3c0, 0xf554}, {0xe3c1, 0xf555}, {0xe3c2, 0xf556}, {0xe3c3, 0xf557}, {0xe3c4, 0xf558}, {0xe3c5, 0xf559}, {0xe3c6, 0xf55a}, {0xe3c7, 0xf55b}, {0xe3c8, 0xf55c}, {0xe3c9, 0xf55d}, {0xe3ca, 0xf55e}, {0xe3cb, 0xf55f}, {0xe3cc, 0xf560}, {0xe3cd, 0xf561}, {0xe3ce, 0xf562}, {0xe3cf, 0xf563}, {0xe3d0, 0xf564}, {0xe3d1, 0xf565}, {0xe3d2, 0xf566}, {0xe3d3, 0xf567}, {0xe3d4, 0xf568}, {0xe3d5, 0xf569}, {0xe3d6, 0xf56a}, {0xe3d7, 0xf56b}, {0xe3d8, 0xf56c}, {0xe3d9, 0xf56d}, {0xe3da, 0xf56e}, {0xe3db, 0xf56f}, {0xe3dc, 0xf570}, {0xe3dd, 0xf571}, {0xe3de, 0xf572}, {0xe3df, 0xf573}, {0xe3e0, 0xf574}, {0xe3e1, 0xf575}, {0xe3e2, 0xf576}, {0xe3e3, 0xf577}, {0xe3e4, 0xf578}, {0xe3e5, 0xf579}, {0xe3e6, 0xf57a}, {0xe3e7, 0xf57b}, {0xe3e8, 0xf57c}, {0xe3e9, 0xf57d}, {0xe3ea, 0xf57e}, {0xe3eb, 0xf580}, {0xe3ec, 0xf581}, {0xe3ed, 0xf582}, {0xe3ee, 0xf583}, {0xe3ef, 0xf584}, {0xe3f0, 0xf585}, {0xe3f1, 0xf586}, {0xe3f2, 0xf587}, {0xe3f3, 0xf588}, {0xe3f4, 0xf589}, {0xe3f5, 0xf58a}, {0xe3f6, 0xf58b}, {0xe3f7, 0xf58c}, {0xe3f8, 0xf58d}, {0xe3f9, 0xf58e}, {0xe3fa, 0xf58f}, {0xe3fb, 0xf590}, {0xe3fc, 0xf591}, {0xe3fd, 0xf592}, {0xe3fe, 0xf593}, {0xe3ff, 0xf594}, {0xe400, 0xf595}, {0xe401, 0xf596}, {0xe402, 0xf597}, {0xe403, 0xf598}, {0xe404, 0xf599}, {0xe405, 0xf59a}, {0xe406, 0xf59b}, {0xe407, 0xf59c}, {0xe408, 0xf59d}, {0xe409, 0xf59e}, {0xe40a, 0xf59f}, {0xe40b, 0xf5a0}, {0xe40c, 0xf5a1}, {0xe40d, 0xf5a2}, {0xe40e, 0xf5a3}, {0xe40f, 0xf5a4}, {0xe410, 0xf5a5}, {0xe411, 0xf5a6}, {0xe412, 0xf5a7}, {0xe413, 0xf5a8}, {0xe414, 0xf5a9}, {0xe415, 0xf5aa}, {0xe416, 0xf5ab}, {0xe417, 0xf5ac}, {0xe418, 0xf5ad}, {0xe419, 0xf5ae}, {0xe41a, 0xf5af}, {0xe41b, 0xf5b0}, {0xe41c, 0xf5b1}, {0xe41d, 0xf5b2}, {0xe41e, 0xf5b3}, {0xe41f, 0xf5b4}, {0xe420, 0xf5b5}, {0xe421, 0xf5b6}, {0xe422, 0xf5b7}, {0xe423, 0xf5b8}, {0xe424, 0xf5b9}, {0xe425, 0xf5ba}, {0xe426, 0xf5bb}, {0xe427, 0xf5bc}, {0xe428, 0xf5bd}, {0xe429, 0xf5be}, {0xe42a, 0xf5bf}, {0xe42b, 0xf5c0}, {0xe42c, 0xf5c1}, {0xe42d, 0xf5c2}, {0xe42e, 0xf5c3}, {0xe42f, 0xf5c4}, {0xe430, 0xf5c5}, {0xe431, 0xf5c6}, {0xe432, 0xf5c7}, {0xe433, 0xf5c8}, {0xe434, 0xf5c9}, {0xe435, 0xf5ca}, {0xe436, 0xf5cb}, {0xe437, 0xf5cc}, {0xe438, 0xf5cd}, {0xe439, 0xf5ce}, {0xe43a, 0xf5cf}, {0xe43b, 0xf5d0}, {0xe43c, 0xf5d1}, {0xe43d, 0xf5d2}, {0xe43e, 0xf5d3}, {0xe43f, 0xf5d4}, {0xe440, 0xf5d5}, {0xe441, 0xf5d6}, {0xe442, 0xf5d7}, {0xe443, 0xf5d8}, {0xe444, 0xf5d9}, {0xe445, 0xf5da}, {0xe446, 0xf5db}, {0xe447, 0xf5dc}, {0xe448, 0xf5dd}, {0xe449, 0xf5de}, {0xe44a, 0xf5df}, {0xe44b, 0xf5e0}, {0xe44c, 0xf5e1}, {0xe44d, 0xf5e2}, {0xe44e, 0xf5e3}, {0xe44f, 0xf5e4}, {0xe450, 0xf5e5}, {0xe451, 0xf5e6}, {0xe452, 0xf5e7}, {0xe453, 0xf5e8}, {0xe454, 0xf5e9}, {0xe455, 0xf5ea}, {0xe456, 0xf5eb}, {0xe457, 0xf5ec}, {0xe458, 0xf5ed}, {0xe459, 0xf5ee}, {0xe45a, 0xf5ef}, {0xe45b, 0xf5f0}, {0xe45c, 0xf5f1}, {0xe45d, 0xf5f2}, {0xe45e, 0xf5f3}, {0xe45f, 0xf5f4}, {0xe460, 0xf5f5}, {0xe461, 0xf5f6}, {0xe462, 0xf5f7}, {0xe463, 0xf5f8}, {0xe464, 0xf5f9}, {0xe465, 0xf5fa}, {0xe466, 0xf5fb}, {0xe467, 0xf5fc}, {0xe468, 0xf640}, {0xe469, 0xf641}, {0xe46a, 0xf642}, {0xe46b, 0xf643}, {0xe46c, 0xf644}, {0xe46d, 0xf645}, {0xe46e, 0xf646}, {0xe46f, 0xf647}, {0xe470, 0xf648}, {0xe471, 0xf649}, {0xe472, 0xf64a}, {0xe473, 0xf64b}, {0xe474, 0xf64c}, {0xe475, 0xf64d}, {0xe476, 0xf64e}, {0xe477, 0xf64f}, {0xe478, 0xf650}, {0xe479, 0xf651}, {0xe47a, 0xf652}, {0xe47b, 0xf653}, {0xe47c, 0xf654}, {0xe47d, 0xf655}, {0xe47e, 0xf656}, {0xe47f, 0xf657}, {0xe480, 0xf658}, {0xe481, 0xf659}, {0xe482, 0xf65a}, {0xe483, 0xf65b}, {0xe484, 0xf65c}, {0xe485, 0xf65d}, {0xe486, 0xf65e}, {0xe487, 0xf65f}, {0xe488, 0xf660}, {0xe489, 0xf661}, {0xe48a, 0xf662}, {0xe48b, 0xf663}, {0xe48c, 0xf664}, {0xe48d, 0xf665}, {0xe48e, 0xf666}, {0xe48f, 0xf667}, {0xe490, 0xf668}, {0xe491, 0xf669}, {0xe492, 0xf66a}, {0xe493, 0xf66b}, {0xe494, 0xf66c}, {0xe495, 0xf66d}, {0xe496, 0xf66e}, {0xe497, 0xf66f}, {0xe498, 0xf670}, {0xe499, 0xf671}, {0xe49a, 0xf672}, {0xe49b, 0xf673}, {0xe49c, 0xf674}, {0xe49d, 0xf675}, {0xe49e, 0xf676}, {0xe49f, 0xf677}, {0xe4a0, 0xf678}, {0xe4a1, 0xf679}, {0xe4a2, 0xf67a}, {0xe4a3, 0xf67b}, {0xe4a4, 0xf67c}, {0xe4a5, 0xf67d}, {0xe4a6, 0xf67e}, {0xe4a7, 0xf680}, {0xe4a8, 0xf681}, {0xe4a9, 0xf682}, {0xe4aa, 0xf683}, {0xe4ab, 0xf684}, {0xe4ac, 0xf685}, {0xe4ad, 0xf686}, {0xe4ae, 0xf687}, {0xe4af, 0xf688}, {0xe4b0, 0xf689}, {0xe4b1, 0xf68a}, {0xe4b2, 0xf68b}, {0xe4b3, 0xf68c}, {0xe4b4, 0xf68d}, {0xe4b5, 0xf68e}, {0xe4b6, 0xf68f}, {0xe4b7, 0xf690}, {0xe4b8, 0xf691}, {0xe4b9, 0xf692}, {0xe4ba, 0xf693}, {0xe4bb, 0xf694}, {0xe4bc, 0xf695},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 0xf6d3}, {0xe4fb, 0xf6d4}, {0xe4fc, 0xf6d5}, {0xe4fd, 0xf6d6}, {0xe4fe, 0xf6d7}, {0xe4ff, 0xf6d8}, {0xe500, 0xf6d9}, {0xe501, 0xf6da}, {0xe502, 0xf6db}, {0xe503, 0xf6dc}, {0xe504, 0xf6dd}, {0xe505, 0xf6de}, {0xe506, 0xf6df}, {0xe507, 0xf6e0}, {0xe508, 0xf6e1}, {0xe509, 0xf6e2}, {0xe50a, 0xf6e3}, {0xe50b, 0xf6e4}, {0xe50c, 0xf6e5}, {0xe50d, 0xf6e6}, {0xe50e, 0xf6e7}, {0xe50f, 0xf6e8}, {0xe510, 0xf6e9}, {0xe511, 0xf6ea}, {0xe512, 0xf6eb}, {0xe513, 0xf6ec}, {0xe514, 0xf6ed}, {0xe515, 0xf6ee}, {0xe516, 0xf6ef}, {0xe517, 0xf6f0}, {0xe518, 0xf6f1}, {0xe519, 0xf6f2}, {0xe51a, 0xf6f3}, {0xe51b, 0xf6f4}, {0xe51c, 0xf6f5}, {0xe51d, 0xf6f6}, {0xe51e, 0xf6f7}, {0xe51f, 0xf6f8}, {0xe520, 0xf6f9}, {0xe521, 0xf6fa}, {0xe522, 0xf6fb}, {0xe523, 0xf6fc}, {0xe524, 0xf740}, {0xe525, 0xf741}, {0xe526, 0xf742}, {0xe527, 0xf743}, {0xe528, 0xf744}, {0xe529, 0xf745}, {0xe52a, 0xf746}, {0xe52b, 0xf747}, {0xe52c, 0xf748}, {0xe52d, 0xf749}, {0xe52e, 0xf74a}, {0xe52f, 0xf74b}, {0xe530, 0xf74c}, {0xe531, 0xf74d}, {0xe532, 0xf74e}, {0xe533, 0xf74f}, {0xe534, 0xf750}, {0xe535, 0xf751}, {0xe536, 0xf752}, {0xe537, 0xf753}, {0xe538, 0xf754}, {0xe539, 0xf755}, {0xe53a, 0xf756}, {0xe53b, 0xf757}, {0xe53c, 0xf758}, {0xe53d, 0xf759}, {0xe53e, 0xf75a}, {0xe53f, 0xf75b}, {0xe540, 0xf75c}, {0xe541, 0xf75d}, {0xe542, 0xf75e}, {0xe543, 0xf75f}, {0xe544, 0xf760}, {0xe545, 0xf761}, {0xe546, 0xf762}, {0xe547, 0xf763}, {0xe548, 0xf764}, {0xe549, 0xf765}, {0xe54a, 0xf766}, {0xe54b, 0xf767}, {0xe54c, 0xf768}, {0xe54d, 0xf769}, {0xe54e, 0xf76a}, {0xe54f, 0xf76b}, {0xe550, 0xf76c}, {0xe551, 0xf76d}, {0xe552, 0xf76e}, {0xe553, 0xf76f}, {0xe554, 0xf770}, {0xe555, 0xf771}, {0xe556, 0xf772}, {0xe557, 0xf773}, {0xe558, 0xf774}, {0xe559, 0xf775}, {0xe55a, 0xf776}, {0xe55b, 0xf777}, {0xe55c, 0xf778}, {0xe55d, 0xf779}, {0xe55e, 0xf77a}, {0xe55f, 0xf77b}, {0xe560, 0xf77c}, {0xe561, 0xf77d}, {0xe562, 0xf77e}, {0xe563, 0xf780}, {0xe564, 0xf781}, {0xe565, 0xf782}, {0xe566, 0xf783}, {0xe567, 0xf784}, {0xe568, 0xf785}, {0xe569, 0xf786}, {0xe56a, 0xf787}, {0xe56b, 0xf788}, {0xe56c, 0xf789}, {0xe56d, 0xf78a}, {0xe56e, 0xf78b}, {0xe56f, 0xf78c}, {0xe570, 0xf78d}, {0xe571, 0xf78e}, {0xe572, 0xf78f}, {0xe573, 0xf790}, {0xe574, 0xf791}, {0xe575, 0xf792}, {0xe576, 0xf793}, {0xe577, 0xf794}, {0xe578, 0xf795}, {0xe579, 0xf796}, {0xe57a, 0xf797}, {0xe57b, 0xf798}, {0xe57c, 0xf799}, {0xe57d, 0xf79a}, {0xe57e, 0xf79b}, {0xe57f, 0xf79c}, {0xe580, 0xf79d}, {0xe581, 0xf79e}, {0xe582, 0xf79f}, {0xe583, 0xf7a0}, {0xe584, 0xf7a1}, {0xe585, 0xf7a2}, {0xe586, 0xf7a3}, {0xe587, 0xf7a4}, {0xe588, 0xf7a5}, {0xe589, 0xf7a6}, {0xe58a, 0xf7a7}, {0xe58b, 0xf7a8}, {0xe58c, 0xf7a9}, {0xe58d, 0xf7aa}, {0xe58e, 0xf7ab}, {0xe58f, 0xf7ac}, {0xe590, 0xf7ad}, {0xe591, 0xf7ae}, {0xe592, 0xf7af}, {0xe593, 0xf7b0}, {0xe594, 0xf7b1}, {0xe595, 0xf7b2}, {0xe596, 0xf7b3}, {0xe597, 0xf7b4}, {0xe598, 0xf7b5}, {0xe599, 0xf7b6}, {0xe59a, 0xf7b7}, {0xe59b, 0xf7b8}, {0xe59c, 0xf7b9}, {0xe59d, 0xf7ba}, {0xe59e, 0xf7bb}, {0xe59f, 0xf7bc}, {0xe5a0, 0xf7bd}, {0xe5a1, 0xf7be}, {0xe5a2, 0xf7bf}, {0xe5a3, 0xf7c0}, {0xe5a4, 0xf7c1}, {0xe5a5, 0xf7c2}, {0xe5a6, 0xf7c3}, {0xe5a7, 0xf7c4}, {0xe5a8, 0xf7c5}, {0xe5a9, 0xf7c6}, {0xe5aa, 0xf7c7}, {0xe5ab, 0xf7c8}, {0xe5ac, 0xf7c9}, {0xe5ad, 0xf7ca}, {0xe5ae, 0xf7cb}, {0xe5af, 0xf7cc}, {0xe5b0, 0xf7cd}, {0xe5b1, 0xf7ce}, {0xe5b2, 0xf7cf}, {0xe5b3, 0xf7d0}, {0xe5b4, 0xf7d1}, {0xe5b5, 0xf7d2}, {0xe5b6, 0xf7d3}, {0xe5b7, 0xf7d4}, {0xe5b8, 0xf7d5}, {0xe5b9, 0xf7d6}, {0xe5ba, 0xf7d7}, {0xe5bb, 0xf7d8}, {0xe5bc, 0xf7d9}, {0xe5bd, 0xf7da}, {0xe5be, 0xf7db}, {0xe5bf, 0xf7dc}, {0xe5c0, 0xf7dd}, {0xe5c1, 0xf7de}, {0xe5c2, 0xf7df}, {0xe5c3, 0xf7e0}, {0xe5c4, 0xf7e1}, {0xe5c5, 0xf7e2}, {0xe5c6, 0xf7e3}, {0xe5c7, 0xf7e4}, {0xe5c8, 0xf7e5}, {0xe5c9, 0xf7e6}, {0xe5ca, 0xf7e7}, {0xe5cb, 0xf7e8}, {0xe5cc, 0xf7e9}, {0xe5cd, 0xf7ea}, {0xe5ce, 0xf7eb}, {0xe5cf, 0xf7ec}, {0xe5d0, 0xf7ed}, {0xe5d1, 0xf7ee}, {0xe5d2, 0xf7ef}, {0xe5d3, 0xf7f0}, {0xe5d4, 0xf7f1}, {0xe5d5, 0xf7f2}, {0xe5d6, 0xf7f3}, {0xe5d7, 0xf7f4}, {0xe5d8, 0xf7f5}, {0xe5d9, 0xf7f6}, {0xe5da, 0xf7f7}, {0xe5db, 0xf7f8}, {0xe5dc, 0xf7f9}, {0xe5dd, 0xf7fa}, {0xe5de, 0xf7fb}, {0xe5df, 0xf7fc}, {0xe5e0, 0xf840}, {0xe5e1, 0xf841}, {0xe5e2, 0xf842}, {0xe5e3, 0xf843}, {0xe5e4, 0xf844}, {0xe5e5, 0xf845}, {0xe5e6, 0xf846}, {0xe5e7, 0xf847}, {0xe5e8, 0xf848}, {0xe5e9, 0xf849}, {0xe5ea, 0xf84a}, {0xe5eb, 0xf84b}, {0xe5ec, 0xf84c}, {0xe5ed, 0xf84d}, {0xe5ee, 0xf84e}, {0xe5ef, 0xf84f}, {0xe5f0, 0xf850}, {0xe5f1, 0xf851}, {0xe5f2, 0xf852}, {0xe5f3, 0xf853}, {0xe5f4, 0xf854}, {0xe5f5, 0xf855}, {0xe5f6, 0xf856}, {0xe5f7, 0xf857}, {0xe5f8, 0xf858}, {0xe5f9, 0xf859}, {0xe5fa, 0xf85a}, {0xe5fb, 0xf85b}, {0xe5fc, 0xf85c}, {0xe5fd, 0xf85d}, {0xe5fe, 0xf85e}, {0xe5ff, 0xf85f}, {0xe600, 0xf860}, {0xe601, 0xf861}, {0xe602, 0xf862}, {0xe603, 0xf863}, {0xe604, 0xf864}, {0xe605, 0xf865}, {0xe606, 0xf866}, {0xe607, 0xf867}, {0xe608, 0xf868}, {0xe609, 0xf869}, {0xe60a, 0xf86a}, {0xe60b, 0xf86b}, {0xe60c, 0xf86c}, {0xe60d, 0xf86d}, {0xe60e, 0xf86e}, {0xe60f, 0xf86f}, {0xe610, 0xf870}, {0xe611, 0xf871}, {0xe612, 0xf872}, {0xe613, 0xf873}, {0xe614, 0xf874}, {0xe615, 0xf875}, {0xe616, 0xf876}, {0xe617, 0xf877}, {0xe618, 0xf878}, {0xe619, 0xf879}, {0xe61a, 0xf87a}, {0xe61b, 0xf87b}, {0xe61c, 0xf87c}, {0xe61d, 0xf87d}, {0xe61e, 0xf87e}, {0xe61f, 0xf880}, {0xe620, 0xf881}, {0xe621, 0xf882}, {0xe622, 0xf883}, {0xe623, 0xf884}, {0xe624, 0xf885}, {0xe625, 0xf886}, {0xe626, 0xf887}, {0xe627, 0xf888}, {0xe628, 0xf889}, {0xe629, 0xf88a}, {0xe62a, 0xf88b}, {0xe62b, 0xf88c}, {0xe62c, 0xf88d}, {0xe62d, 0xf88e}, {0xe62e, 0xf88f}, {0xe62f, 0xf890}, {0xe630, 0xf891}, {0xe631, 0xf892}, {0xe632, 0xf893}, {0xe633, 0xf894}, {0xe634, 0xf895}, {0xe635, 0xf896}, {0xe636, 0xf897}, {0xe637, 0xf898}, {0xe638, 0xf899}, {0xe639, 0xf89a}, {0xe63a, 0xf89b}, {0xe63b, 0xf89c}, {0xe63c, 0xf89d}, {0xe63d, 0xf89e}, {0xe63e, 0xf89f}, {0xe63f, 0xf8a0}, {0xe640, 0xf8a1}, {0xe641, 0xf8a2}, {0xe642, 0xf8a3}, {0xe643, 0xf8a4}, {0xe644, 0xf8a5}, {0xe645, 0xf8a6}, {0xe646, 0xf8a7}, {0xe647, 0xf8a8}, {0xe648, 0xf8a9}, {0xe649, 0xf8aa}, {0xe64a, 0xf8ab}, {0xe64b, 0xf8ac}, {0xe64c, 0xf8ad}, {0xe64d, 0xf8ae}, {0xe64e, 0xf8af}, {0xe64f, 0xf8b0}, {0xe650, 0xf8b1}, {0xe651, 0xf8b2}, {0xe652, 0xf8b3}, {0xe653, 0xf8b4}, {0xe654, 0xf8b5}, {0xe655, 0xf8b6}, {0xe656, 0xf8b7}, {0xe657, 0xf8b8}, {0xe658, 0xf8b9}, {0xe659, 0xf8ba}, {0xe65a, 0xf8bb}, {0xe65b, 0xf8bc}, {0xe65c, 0xf8bd}, {0xe65d, 0xf8be}, {0xe65e, 0xf8bf}, {0xe65f, 0xf8c0}, {0xe660, 0xf8c1}, {0xe661, 0xf8c2}, {0xe662, 0xf8c3}, {0xe663, 0xf8c4}, {0xe664, 0xf8c5}, {0xe665, 0xf8c6}, {0xe666, 0xf8c7}, {0xe667, 0xf8c8}, {0xe668, 0xf8c9}, {0xe669, 0xf8ca}, {0xe66a, 0xf8cb}, {0xe66b, 0xf8cc}, {0xe66c, 0xf8cd}, {0xe66d, 0xf8ce}, {0xe66e, 0xf8cf}, {0xe66f, 0xf8d0}, {0xe670, 0xf8d1}, {0xe671, 0xf8d2}, {0xe672, 0xf8d3}, {0xe673, 0xf8d4}, {0xe674, 0xf8d5}, {0xe675, 0xf8d6}, {0xe676, 0xf8d7}, {0xe677, 0xf8d8}, {0xe678, 0xf8d9}, {0xe679, 0xf8da}, {0xe67a, 0xf8db}, {0xe67b, 0xf8dc}, {0xe67c, 0xf8dd}, {0xe67d, 0xf8de}, {0xe67e, 0xf8df}, {0xe67f, 0xf8e0}, {0xe680, 0xf8e1}, {0xe681, 0xf8e2}, {0xe682, 0xf8e3}, {0xe683, 0xf8e4}, {0xe684, 0xf8e5}, {0xe685, 0xf8e6}, {0xe686, 0xf8e7}, {0xe687, 0xf8e8}, {0xe688, 0xf8e9}, {0xe689, 0xf8ea}, {0xe68a, 0xf8eb}, {0xe68b, 0xf8ec}, {0xe68c, 0xf8ed}, {0xe68d, 0xf8ee}, {0xe68e, 0xf8ef}, {0xe68f, 0xf8f0}, {0xe690, 0xf8f1}, {0xe691, 0xf8f2}, {0xe692, 0xf8f3}, {0xe693, 0xf8f4}, {0xe694, 0xf8f5}, {0xe695, 0xf8f6}, {0xe696, 0xf8f7}, {0xe697, 0xf8f8}, {0xe698, 0xf8f9}, {0xe699, 0xf8fa}, {0xe69a, 0xf8fb}, {0xe69b, 0xf8fc}, {0xe69c, 0xf940}, {0xe69d, 0xf941}, {0xe69e, 0xf942}, {0xe69f, 0xf943}, {0xe6a0, 0xf944}, {0xe6a1, 0xf945}, {0xe6a2, 0xf946}, {0xe6a3, 0xf947}, {0xe6a4, 0xf948}, {0xe6a5, 0xf949}, {0xe6a6, 0xf94a}, {0xe6a7, 0xf94b}, {0xe6a8, 0xf94c}, {0xe6a9, 0xf94d}, {0xe6aa, 0xf94e}, {0xe6ab, 0xf94f}, {0xe6ac, 0xf950}, {0xe6ad, 0xf951}, {0xe6ae, 0xf952}, {0xe6af, 0xf953}, {0xe6b0, 0xf954}, {0xe6b1, 0xf955}, {0xe6b2, 0xf956}, {0xe6b3, 0xf957}, {0xe6b4, 0xf958}, {0xe6b5, 0xf959}, {0xe6b6, 0xf95a}, {0xe6b7, 0xf95b}, {0xe6b8, 0xf95c}, {0xe6b9, 0xf95d}, {0xe6ba, 0xf95e}, {0xe6bb, 0xf95f}, {0xe6bc, 0xf960}, {0xe6bd, 0xf961}, {0xe6be, 0xf962}, {0xe6bf, 0xf963}, {0xe6c0, 0xf964}, {0xe6c1, 0xf965}, {0xe6c2, 0xf966}, {0xe6c3, 0xf967}, {0xe6c4, 0xf968}, {0xe6c5, 0xf969}, {0xe6c6, 0xf96a}, {0xe6c7, 0xf96b}, {0xe6c8, 0xf96c}, {0xe6c9, 0xf96d}, {0xe6ca, 0xf96e}, {0xe6cb, 0xf96f}, {0xe6cc, 0xf970}, {0xe6cd, 0xf971}, {0xe6ce, 0xf972}, {0xe6cf, 0xf973}, {0xe6d0, 0xf974}, {0xe6d1, 0xf975}, {0xe6d2, 0xf976}, {0xe6d3, 0xf977}, {0xe6d4, 0xf978}, {0xe6d5, 0xf979}, {0xe6d6, 0xf97a}, {0xe6d7, 0xf97b}, {0xe6d8, 0xf97c}, {0xe6d9, 0xf97d}, {0xe6da, 0xf97e}, {0xe6db, 0xf980}, {0xe6dc, 0xf981}, {0xe6dd, 0xf982}, {0xe6de, 0xf983}, {0xe6df, 0xf984}, {0xe6e0, 0xf985}, {0xe6e1, 0xf986}, {0xe6e2, 0xf987}, {0xe6e3, 0xf988}, {0xe6e4, 0xf989}, {0xe6e5, 0xf98a}, {0xe6e6, 0xf98b}, {0xe6e7, 0xf98c}, {0xe6e8, 0xf98d}, {0xe6e9, 0xf98e}, {0xe6ea, 0xf98f}, {0xe6eb, 0xf990}, {0xe6ec, 0xf991}, {0xe6ed, 0xf992}, {0xe6ee, 0xf993}, {0xe6ef, 0xf994}, {0xe6f0, 0xf995}, {0xe6f1, 0xf996}, {0xe6f2, 0xf997}, {0xe6f3, 0xf998}, {0xe6f4, 0xf999}, {0xe6f5, 0xf99a}, {0xe6f6, 0xf99b}, {0xe6f7, 0xf99c}, {0xe6f8, 0xf99d}, {0xe6f9, 0xf99e}, {0xe6fa, 0xf99f}, {0xe6fb, 0xf9a0}, {0xe6fc, 0xf9a1}, {0xe6fd, 0xf9a2}, {0xe6fe, 0xf9a3}, {0xe6ff, 0xf9a4}, {0xe700, 0xf9a5}, {0xe701, 0xf9a6}, {0xe702, 0xf9a7}, {0xe703, 0xf9a8}, {0xe704, 0xf9a9}, {0xe705, 0xf9aa}, {0xe706, 0xf9ab}, {0xe707, 0xf9ac}, {0xe708, 0xf9ad}, {0xe709, 0xf9ae}, {0xe70a, 0xf9af}, {0xe70b, 0xf9b0}, {0xe70c, 0xf9b1}, {0xe70d, 0xf9b2}, {0xe70e, 0xf9b3}, {0xe70f, 0xf9b4}, {0xe710, 0xf9b5}, {0xe711, 0xf9b6}, {0xe712, 0xf9b7}, {0xe713, 0xf9b8}, {0xe714, 0xf9b9}, {0xe715, 0xf9ba}, {0xe716, 0xf9bb}, {0xe717, 0xf9bc}, {0xe718, 0xf9bd}, {0xe719, 0xf9be}, {0xe71a, 0xf9bf}, {0xe71b, 0xf9c0}, {0xe71c, 0xf9c1}, {0xe71d, 0xf9c2}, {0xe71e, 0xf9c3}, {0xe71f, 0xf9c4}, {0xe720, 0xf9c5}, {0xe721, 0xf9c6}, {0xe722, 0xf9c7}, {0xe723, 0xf9c8}, {0xe724, 0xf9c9}, {0xe725, 0xf9ca}, {0xe726, 0xf9cb}, {0xe727, 0xf9cc}, {0xe728, 0xf9cd}, {0xe729, 0xf9ce}, {0xe72a, 0xf9cf}, {0xe72b, 0xf9d0}, {0xe72c, 0xf9d1}, {0xe72d, 0xf9d2}, {0xe72e, 0xf9d3}, {0xe72f, 0xf9d4}, {0xe730, 0xf9d5}, {0xe731, 0xf9d6}, {0xe732, 0xf9d7}, {0xe733, 0xf9d8}, {0xe734, 0xf9d9}, {0xe735, 0xf9da}, {0xe736, 0xf9db}, {0xe737, 0xf9dc}, {0xe738, 0xf9dd}, {0xe739, 0xf9de}, {0xe73a, 0xf9df}, {0xe73b, 0xf9e0}, {0xe73c, 0xf9e1}, {0xe73d, 0xf9e2}, {0xe73e, 0xf9e3}, {0xe73f, 0xf9e4}, {0xe740, 0xf9e5}, {0xe741, 0xf9e6}, {0xe742, 0xf9e7}, {0xe743, 0xf9e8}, {0xe744, 0xf9e9}, {0xe745, 0xf9ea}, {0xe746, 0xf9eb}, {0xe747, 0xf9ec}, {0xe748, 0xf9ed}, {0xe749, 0xf9ee}, {0xe74a, 0xf9ef}, {0xe74b, 0xf9f0}, {0xe74c, 0xf9f1}, {0xe74d, 0xf9f2}, {0xe74e, 0xf9f3}, {0xe74f, 0xf9f4}, {0xe750, 0xf9f5}, {0xe751, 0xf9f6}, {0xe752, 0xf9f7}, {0xe753, 0xf9f8}, {0xe754, 0xf9f9}, {0xe755, 0xf9fa}, {0xe756, 0xf9fb}, {0xe757, 0xf9fc}, #endif /* USERDEFINE */ {0xf929, 0xfae0}, {0xf9dc, 0xfbe9}, {0xfa0e, 0xfa90}, {0xfa0f, 0xfa9b}, {0xfa10, 0xfa9c}, {0xfa11, 0xfab1}, {0xfa12, 0xfad8}, {0xfa13, 0xfae8}, {0xfa14, 0xfaea}, {0xfa15, 0xfb58}, {0xfa16, 0xfb5e}, {0xfa17, 0xfb75}, {0xfa18, 0xfb7d}, {0xfa19, 0xfb7e}, {0xfa1a, 0xfb80}, {0xfa1b, 0xfb82}, {0xfa1c, 0xfb86}, {0xfa1d, 0xfb89}, {0xfa1e, 0xfb92}, {0xfa1f, 0xfb9d}, {0xfa20, 0xfb9f}, {0xfa21, 0xfba0}, {0xfa22, 0xfba9}, {0xfa23, 0xfbb1}, {0xfa24, 0xfbb3}, {0xfa25, 0xfbb4}, {0xfa26, 0xfbb7}, {0xfa27, 0xfbd3}, {0xfa28, 0xfbda}, {0xfa29, 0xfbea}, {0xfa2a, 0xfbf6}, {0xfa2b, 0xfbf7}, {0xfa2c, 0xfbf9}, {0xfa2d, 0xfc49}, {0xff01, 0x8149}, {0xff02, 0xfa57}, {0xff03, 0x8194}, {0xff04, 0x8190}, {0xff05, 0x8193}, {0xff06, 0x8195}, {0xff07, 0xfa56}, {0xff08, 0x8169}, {0xff09, 0x816a}, {0xff0a, 0x8196}, {0xff0b, 0x817b}, {0xff0c, 0x8143}, {0xff0d, 0x817c}, {0xff0e, 0x8144}, {0xff0f, 0x815e}, {0xff10, 0x824f}, {0xff11, 0x8250}, {0xff12, 0x8251}, {0xff13, 0x8252}, {0xff14, 0x8253}, {0xff15, 0x8254}, {0xff16, 0x8255}, {0xff17, 0x8256}, {0xff18, 0x8257}, {0xff19, 0x8258}, {0xff1a, 0x8146}, {0xff1b, 0x8147}, {0xff1c, 0x8183}, {0xff1d, 0x8181}, {0xff1e, 0x8184}, {0xff1f, 0x8148}, {0xff20, 0x8197}, {0xff21, 0x8260}, {0xff22, 0x8261}, {0xff23, 0x8262}, {0xff24, 0x8263}, {0xff25, 0x8264}, {0xff26, 0x8265}, {0xff27, 0x8266}, {0xff28, 0x8267}, {0xff29, 0x8268}, {0xff2a, 0x8269}, {0xff2b, 0x826a}, {0xff2c, 0x826b}, {0xff2d, 0x826c}, {0xff2e, 0x826d}, {0xff2f, 0x826e}, {0xff30, 0x826f}, {0xff31, 0x8270}, {0xff32, 0x8271}, {0xff33, 0x8272}, {0xff34, 0x8273}, {0xff35, 0x8274}, {0xff36, 0x8275}, {0xff37, 0x8276}, {0xff38, 0x8277}, {0xff39, 0x8278}, {0xff3a, 0x8279}, {0xff3b, 0x816d}, {0xff3c, 0x815f}, {0xff3d, 0x816e}, {0xff3e, 0x814f}, {0xff3f, 0x8151}, {0xff40, 0x814d}, {0xff41, 0x8281}, {0xff42, 0x8282}, {0xff43, 0x8283}, {0xff44, 0x8284}, {0xff45, 0x8285}, {0xff46, 0x8286}, {0xff47, 0x8287}, {0xff48, 0x8288}, {0xff49, 0x8289}, {0xff4a, 0x828a}, {0xff4b, 0x828b}, {0xff4c, 0x828c}, {0xff4d, 0x828d}, {0xff4e, 0x828e}, {0xff4f, 0x828f}, {0xff50, 0x8290}, {0xff51, 0x8291}, {0xff52, 0x8292}, {0xff53, 0x8293}, {0xff54, 0x8294}, {0xff55, 0x8295}, {0xff56, 0x8296}, {0xff57, 0x8297}, {0xff58, 0x8298}, {0xff59, 0x8299}, {0xff5a, 0x829a}, {0xff5b, 0x816f}, {0xff5c, 0x8162}, {0xff5d, 0x8170}, {0xff5e, 0x8160}, {0xffe0, 0x8191}, {0xffe1, 0x8192}, {0xffe2, 0x81ca}, {0xffe3, 0x8150}, {0xffe4, 0xfa55}, {0xffe5, 0x818f}, }; #define UNILISTSIZ arraysize(unilist) static nftable macunilist[] = { {0x00c0, {0x0041, 0x0300, 0}}, {0x00c1, {0x0041, 0x0301, 0}}, {0x00c2, {0x0041, 0x0302, 0}}, {0x00c3, {0x0041, 0x0303, 0}}, {0x00c4, {0x0041, 0x0308, 0}}, {0x00c5, {0x0041, 0x030a, 0}}, {0x00c7, {0x0043, 0x0327, 0}}, {0x00c8, {0x0045, 0x0300, 0}}, {0x00c9, {0x0045, 0x0301, 0}}, {0x00ca, {0x0045, 0x0302, 0}}, {0x00cb, {0x0045, 0x0308, 0}}, {0x00cc, {0x0049, 0x0300, 0}}, {0x00cd, {0x0049, 0x0301, 0}}, {0x00ce, {0x0049, 0x0302, 0}}, {0x00cf, {0x0049, 0x0308, 0}}, {0x00d1, {0x004e, 0x0303, 0}}, {0x00d2, {0x004f, 0x0300, 0}}, {0x00d3, {0x004f, 0x0301, 0}}, {0x00d4, {0x004f, 0x0302, 0}}, {0x00d5, {0x004f, 0x0303, 0}}, {0x00d6, {0x004f, 0x0308, 0}}, {0x00d9, {0x0055, 0x0300, 0}}, {0x00da, {0x0055, 0x0301, 0}}, {0x00db, {0x0055, 0x0302, 0}}, {0x00dc, {0x0055, 0x0308, 0}}, {0x00dd, {0x0059, 0x0301, 0}}, {0x00e0, {0x0061, 0x0300, 0}}, {0x00e1, {0x0061, 0x0301, 0}}, {0x00e2, {0x0061, 0x0302, 0}}, {0x00e3, {0x0061, 0x0303, 0}}, {0x00e4, {0x0061, 0x0308, 0}}, {0x00e5, {0x0061, 0x030a, 0}}, {0x00e7, {0x0063, 0x0327, 0}}, {0x00e8, {0x0065, 0x0300, 0}}, {0x00e9, {0x0065, 0x0301, 0}}, {0x00ea, {0x0065, 0x0302, 0}}, {0x00eb, {0x0065, 0x0308, 0}}, {0x00ec, {0x0069, 0x0300, 0}}, {0x00ed, {0x0069, 0x0301, 0}}, {0x00ee, {0x0069, 0x0302, 0}}, {0x00ef, {0x0069, 0x0308, 0}}, {0x00f1, {0x006e, 0x0303, 0}}, {0x00f2, {0x006f, 0x0300, 0}}, {0x00f3, {0x006f, 0x0301, 0}}, {0x00f4, {0x006f, 0x0302, 0}}, {0x00f5, {0x006f, 0x0303, 0}}, {0x00f6, {0x006f, 0x0308, 0}}, {0x00f9, {0x0075, 0x0300, 0}}, {0x00fa, {0x0075, 0x0301, 0}}, {0x00fb, {0x0075, 0x0302, 0}}, {0x00fc, {0x0075, 0x0308, 0}}, {0x00fd, {0x0079, 0x0301, 0}}, {0x00ff, {0x0079, 0x0308, 0}}, {0x0100, {0x0041, 0x0304, 0}}, {0x0101, {0x0061, 0x0304, 0}}, {0x0102, {0x0041, 0x0306, 0}}, {0x0103, {0x0061, 0x0306, 0}}, {0x0104, {0x0041, 0x0328, 0}}, {0x0105, {0x0061, 0x0328, 0}}, {0x0106, {0x0043, 0x0301, 0}}, {0x0107, {0x0063, 0x0301, 0}}, {0x0108, {0x0043, 0x0302, 0}}, {0x0109, {0x0063, 0x0302, 0}}, {0x010a, {0x0043, 0x0307, 0}}, {0x010b, {0x0063, 0x0307, 0}}, {0x010c, {0x0043, 0x030c, 0}}, {0x010d, {0x0063, 0x030c, 0}}, {0x010e, {0x0044, 0x030c, 0}}, {0x010f, {0x0064, 0x030c, 0}}, {0x0112, {0x0045, 0x0304, 0}}, {0x0113, {0x0065, 0x0304, 0}}, {0x0114, {0x0045, 0x0306, 0}}, {0x0115, {0x0065, 0x0306, 0}}, {0x0116, {0x0045, 0x0307, 0}}, {0x0117, {0x0065, 0x0307, 0}}, {0x0118, {0x0045, 0x0328, 0}}, {0x0119, {0x0065, 0x0328, 0}}, {0x011a, {0x0045, 0x030c, 0}}, {0x011b, {0x0065, 0x030c, 0}}, {0x011c, {0x0047, 0x0302, 0}}, {0x011d, {0x0067, 0x0302, 0}}, {0x011e, {0x0047, 0x0306, 0}}, {0x011f, {0x0067, 0x0306, 0}}, {0x0120, {0x0047, 0x0307, 0}}, {0x0121, {0x0067, 0x0307, 0}}, {0x0122, {0x0047, 0x0327, 0}}, {0x0123, {0x0067, 0x0327, 0}}, {0x0124, {0x0048, 0x0302, 0}}, {0x0125, {0x0068, 0x0302, 0}}, {0x0128, {0x0049, 0x0303, 0}}, {0x0129, {0x0069, 0x0303, 0}}, {0x012a, {0x0049, 0x0304, 0}}, {0x012b, {0x0069, 0x0304, 0}}, {0x012c, {0x0049, 0x0306, 0}}, {0x012d, {0x0069, 0x0306, 0}}, {0x012e, {0x0049, 0x0328, 0}}, {0x012f, {0x0069, 0x0328, 0}}, {0x0130, {0x0049, 0x0307, 0}}, {0x0134, {0x004a, 0x0302, 0}}, {0x0135, {0x006a, 0x0302, 0}}, {0x0136, {0x004b, 0x0327, 0}}, {0x0137, {0x006b, 0x0327, 0}}, {0x0139, {0x004c, 0x0301, 0}}, {0x013a, {0x006c, 0x0301, 0}}, {0x013b, {0x004c, 0x0327, 0}}, {0x013c, {0x006c, 0x0327, 0}}, {0x013d, {0x004c, 0x030c, 0}}, {0x013e, {0x006c, 0x030c, 0}}, {0x0143, {0x004e, 0x0301, 0}}, {0x0144, {0x006e, 0x0301, 0}}, {0x0145, {0x004e, 0x0327, 0}}, {0x0146, {0x006e, 0x0327, 0}}, {0x0147, {0x004e, 0x030c, 0}}, {0x0148, {0x006e, 0x030c, 0}}, {0x014c, {0x004f, 0x0304, 0}}, {0x014d, {0x006f, 0x0304, 0}}, {0x014e, {0x004f, 0x0306, 0}}, {0x014f, {0x006f, 0x0306, 0}}, {0x0150, {0x004f, 0x030b, 0}}, {0x0151, {0x006f, 0x030b, 0}}, {0x0154, {0x0052, 0x0301, 0}}, {0x0155, {0x0072, 0x0301, 0}}, {0x0156, {0x0052, 0x0327, 0}}, {0x0157, {0x0072, 0x0327, 0}}, {0x0158, {0x0052, 0x030c, 0}}, {0x0159, {0x0072, 0x030c, 0}}, {0x015a, {0x0053, 0x0301, 0}}, {0x015b, {0x0073, 0x0301, 0}}, {0x015c, {0x0053, 0x0302, 0}}, {0x015d, {0x0073, 0x0302, 0}}, {0x015e, {0x0053, 0x0327, 0}}, {0x015f, {0x0073, 0x0327, 0}}, {0x0160, {0x0053, 0x030c, 0}}, {0x0161, {0x0073, 0x030c, 0}}, {0x0162, {0x0054, 0x0327, 0}}, {0x0163, {0x0074, 0x0327, 0}}, {0x0164, {0x0054, 0x030c, 0}}, {0x0165, {0x0074, 0x030c, 0}}, {0x0168, {0x0055, 0x0303, 0}}, {0x0169, {0x0075, 0x0303, 0}}, {0x016a, {0x0055, 0x0304, 0}}, {0x016b, {0x0075, 0x0304, 0}}, {0x016c, {0x0055, 0x0306, 0}}, {0x016d, {0x0075, 0x0306, 0}}, {0x016e, {0x0055, 0x030a, 0}}, {0x016f, {0x0075, 0x030a, 0}}, {0x0170, {0x0055, 0x030b, 0}}, {0x0171, {0x0075, 0x030b, 0}}, {0x0172, {0x0055, 0x0328, 0}}, {0x0173, {0x0075, 0x0328, 0}}, {0x0174, {0x0057, 0x0302, 0}}, {0x0175, {0x0077, 0x0302, 0}}, {0x0176, {0x0059, 0x0302, 0}}, {0x0177, {0x0079, 0x0302, 0}}, {0x0178, {0x0059, 0x0308, 0}}, {0x0179, {0x005a, 0x0301, 0}}, {0x017a, {0x007a, 0x0301, 0}}, {0x017b, {0x005a, 0x0307, 0}}, {0x017c, {0x007a, 0x0307, 0}}, {0x017d, {0x005a, 0x030c, 0}}, {0x017e, {0x007a, 0x030c, 0}}, {0x01a0, {0x004f, 0x031b, 0}}, {0x01a1, {0x006f, 0x031b, 0}}, {0x01af, {0x0055, 0x031b, 0}}, {0x01b0, {0x0075, 0x031b, 0}}, {0x01cd, {0x0041, 0x030c, 0}}, {0x01ce, {0x0061, 0x030c, 0}}, {0x01cf, {0x0049, 0x030c, 0}}, {0x01d0, {0x0069, 0x030c, 0}}, {0x01d1, {0x004f, 0x030c, 0}}, {0x01d2, {0x006f, 0x030c, 0}}, {0x01d3, {0x0055, 0x030c, 0}}, {0x01d4, {0x0075, 0x030c, 0}}, {0x01d5, {0x0055, 0x0308, 0x0304, 0}}, {0x01d6, {0x0075, 0x0308, 0x0304, 0}}, {0x01d7, {0x0055, 0x0308, 0x0301, 0}}, {0x01d8, {0x0075, 0x0308, 0x0301, 0}}, {0x01d9, {0x0055, 0x0308, 0x030c, 0}}, {0x01da, {0x0075, 0x0308, 0x030c, 0}}, {0x01db, {0x0055, 0x0308, 0x0300, 0}}, {0x01dc, {0x0075, 0x0308, 0x0300, 0}}, {0x01de, {0x0041, 0x0308, 0x0304, 0}}, {0x01df, {0x0061, 0x0308, 0x0304, 0}}, {0x01e0, {0x0041, 0x0307, 0x0304, 0}}, {0x01e1, {0x0061, 0x0307, 0x0304, 0}}, {0x01e2, {0x00c6, 0x0304, 0}}, {0x01e3, {0x00e6, 0x0304, 0}}, {0x01e6, {0x0047, 0x030c, 0}}, {0x01e7, {0x0067, 0x030c, 0}}, {0x01e8, {0x004b, 0x030c, 0}}, {0x01e9, {0x006b, 0x030c, 0}}, {0x01ea, {0x004f, 0x0328, 0}}, {0x01eb, {0x006f, 0x0328, 0}}, {0x01ec, {0x004f, 0x0328, 0x0304, 0}}, {0x01ed, {0x006f, 0x0328, 0x0304, 0}}, {0x01ee, {0x01b7, 0x030c, 0}}, {0x01ef, {0x0292, 0x030c, 0}}, {0x01f0, {0x006a, 0x030c, 0}}, {0x01f4, {0x0047, 0x0301, 0}}, {0x01f5, {0x0067, 0x0301, 0}}, {0x01fa, {0x0041, 0x030a, 0x0301, 0}}, {0x01fb, {0x0061, 0x030a, 0x0301, 0}}, {0x01fc, {0x00c6, 0x0301, 0}}, {0x01fd, {0x00e6, 0x0301, 0}}, {0x01fe, {0x00d8, 0x0301, 0}}, {0x01ff, {0x00f8, 0x0301, 0}}, {0x0200, {0x0041, 0x030f, 0}}, {0x0201, {0x0061, 0x030f, 0}}, {0x0202, {0x0041, 0x0311, 0}}, {0x0203, {0x0061, 0x0311, 0}}, {0x0204, {0x0045, 0x030f, 0}}, {0x0205, {0x0065, 0x030f, 0}}, {0x0206, {0x0045, 0x0311, 0}}, {0x0207, {0x0065, 0x0311, 0}}, {0x0208, {0x0049, 0x030f, 0}}, {0x0209, {0x0069, 0x030f, 0}}, {0x020a, {0x0049, 0x0311, 0}}, {0x020b, {0x0069, 0x0311, 0}}, {0x020c, {0x004f, 0x030f, 0}}, {0x020d, {0x006f, 0x030f, 0}}, {0x020e, {0x004f, 0x0311, 0}}, {0x020f, {0x006f, 0x0311, 0}}, {0x0210, {0x0052, 0x030f, 0}}, {0x0211, {0x0072, 0x030f, 0}}, {0x0212, {0x0052, 0x0311, 0}}, {0x0213, {0x0072, 0x0311, 0}}, {0x0214, {0x0055, 0x030f, 0}}, {0x0215, {0x0075, 0x030f, 0}}, {0x0216, {0x0055, 0x0311, 0}}, {0x0217, {0x0075, 0x0311, 0}}, {0x0310, {0x0306, 0x0307, 0}}, {0x0340, {0x0300, 0}}, {0x0341, {0x0301, 0}}, {0x0343, {0x0313, 0}}, {0x0344, {0x0308, 0x030d, 0}}, {0x0374, {0x02b9, 0}}, {0x037e, {0x003b, 0}}, {0x0385, {0x00a8, 0x030d, 0}}, {0x0386, {0x0391, 0x030d, 0}}, {0x0387, {0x00b7, 0}}, {0x0388, {0x0395, 0x030d, 0}}, {0x0389, {0x0397, 0x030d, 0}}, {0x038a, {0x0399, 0x030d, 0}}, {0x038c, {0x039f, 0x030d, 0}}, {0x038e, {0x03a5, 0x030d, 0}}, {0x038f, {0x03a9, 0x030d, 0}}, {0x0390, {0x03b9, 0x0308, 0x030d, 0}}, {0x03aa, {0x0399, 0x0308, 0}}, {0x03ab, {0x03a5, 0x0308, 0}}, {0x03ac, {0x03b1, 0x030d, 0}}, {0x03ad, {0x03b5, 0x030d, 0}}, {0x03ae, {0x03b7, 0x030d, 0}}, {0x03af, {0x03b9, 0x030d, 0}}, {0x03b0, {0x03c5, 0x0308, 0x030d, 0}}, {0x03ca, {0x03b9, 0x0308, 0}}, {0x03cb, {0x03c5, 0x0308, 0}}, {0x03cc, {0x03bf, 0x030d, 0}}, {0x03cd, {0x03c5, 0x030d, 0}}, {0x03ce, {0x03c9, 0x030d, 0}}, {0x03d3, {0x03d2, 0x030d, 0}}, {0x03d4, {0x03d2, 0x0308, 0}}, {0x0401, {0x0415, 0x0308, 0}}, {0x0403, {0x0413, 0x0301, 0}}, {0x0407, {0x0406, 0x0308, 0}}, {0x040c, {0x041a, 0x0301, 0}}, {0x040e, {0x0423, 0x0306, 0}}, {0x0419, {0x0418, 0x0306, 0}}, {0x0439, {0x0438, 0x0306, 0}}, {0x0451, {0x0435, 0x0308, 0}}, {0x0453, {0x0433, 0x0301, 0}}, {0x0457, {0x0456, 0x0308, 0}}, {0x045c, {0x043a, 0x0301, 0}}, {0x045e, {0x0443, 0x0306, 0}}, {0x0476, {0x0474, 0x030f, 0}}, {0x0477, {0x0475, 0x030f, 0}}, {0x04c1, {0x0416, 0x0306, 0}}, {0x04c2, {0x0436, 0x0306, 0}}, {0x04d0, {0x0410, 0x0306, 0}}, {0x04d1, {0x0430, 0x0306, 0}}, {0x04d2, {0x0410, 0x0308, 0}}, {0x04d3, {0x0430, 0x0308, 0}}, {0x04d4, {0x00c6, 0}}, {0x04d5, {0x00e6, 0}}, {0x04d6, {0x0415, 0x0306, 0}}, {0x04d7, {0x0435, 0x0306, 0}}, {0x04d8, {0x018f, 0}}, {0x04d9, {0x0259, 0}}, {0x04da, {0x018f, 0x0308, 0}}, {0x04db, {0x0259, 0x0308, 0}}, {0x04dc, {0x0416, 0x0308, 0}}, {0x04dd, {0x0436, 0x0308, 0}}, {0x04de, {0x0417, 0x0308, 0}}, {0x04df, {0x0437, 0x0308, 0}}, {0x04e0, {0x01b7, 0}}, {0x04e1, {0x0292, 0}}, {0x04e2, {0x0418, 0x0304, 0}}, {0x04e3, {0x0438, 0x0304, 0}}, {0x04e4, {0x0418, 0x0308, 0}}, {0x04e5, {0x0438, 0x0308, 0}}, {0x04e6, {0x041e, 0x0308, 0}}, {0x04e7, {0x043e, 0x0308, 0}}, {0x04e8, {0x019f, 0}}, {0x04e9, {0x0275, 0}}, {0x04ea, {0x019f, 0x0308, 0}}, {0x04eb, {0x0275, 0x0308, 0}}, {0x04ee, {0x0423, 0x0304, 0}}, {0x04ef, {0x0443, 0x0304, 0}}, {0x04f0, {0x0423, 0x0308, 0}}, {0x04f1, {0x0443, 0x0308, 0}}, {0x04f2, {0x0423, 0x030b, 0}}, {0x04f3, {0x0443, 0x030b, 0}}, {0x04f4, {0x0427, 0x0308, 0}}, {0x04f5, {0x0447, 0x0308, 0}}, {0x04f8, {0x042b, 0x0308, 0}}, {0x04f9, {0x044b, 0x0308, 0}}, {0x0929, {0x0928, 0x093c, 0}}, {0x0931, {0x0930, 0x093c, 0}}, {0x0934, {0x0933, 0x093c, 0}}, {0x0958, {0x0915, 0x093c, 0}}, {0x0959, {0x0916, 0x093c, 0}}, {0x095a, {0x0917, 0x093c, 0}}, {0x095b, {0x091c, 0x093c, 0}}, {0x095c, {0x0921, 0x093c, 0}}, {0x095d, {0x0922, 0x093c, 0}}, {0x095e, {0x092b, 0x093c, 0}}, {0x095f, {0x092f, 0x093c, 0}}, {0x09b0, {0x09ac, 0x09bc, 0}}, {0x09cb, {0x09c7, 0x09be, 0}}, {0x09cc, {0x09c7, 0x09d7, 0}}, {0x09dc, {0x09a1, 0x09bc, 0}}, {0x09dd, {0x09a2, 0x09bc, 0}}, {0x09df, {0x09af, 0x09bc, 0}}, {0x0a59, {0x0a16, 0x0a3c, 0}}, {0x0a5a, {0x0a17, 0x0a3c, 0}}, {0x0a5b, {0x0a1c, 0x0a3c, 0}}, {0x0a5c, {0x0a21, 0x0a3c, 0}}, {0x0a5e, {0x0a2b, 0x0a3c, 0}}, {0x0b48, {0x0b47, 0x0b56, 0}}, {0x0b4b, {0x0b47, 0x0b3e, 0}}, {0x0b4c, {0x0b47, 0x0b57, 0}}, {0x0b5c, {0x0b21, 0x0b3c, 0}}, {0x0b5d, {0x0b22, 0x0b3c, 0}}, {0x0b5f, {0x0b2f, 0x0b3c, 0}}, {0x0b94, {0x0b92, 0x0bd7, 0}}, {0x0bca, {0x0bc6, 0x0bbe, 0}}, {0x0bcb, {0x0bc7, 0x0bbe, 0}}, {0x0bcc, {0x0bc6, 0x0bd7, 0}}, {0x0c48, {0x0c46, 0x0c56, 0}}, {0x0cc0, {0x0cbf, 0x0cd5, 0}}, {0x0cc7, {0x0cc6, 0x0cd5, 0}}, {0x0cc8, {0x0cc6, 0x0cd6, 0}}, {0x0cca, {0x0cc6, 0x0cc2, 0}}, {0x0ccb, {0x0cc6, 0x0cc2, 0x0cd5, 0}}, {0x0d4a, {0x0d46, 0x0d3e, 0}}, {0x0d4b, {0x0d47, 0x0d3e, 0}}, {0x0d4c, {0x0d46, 0x0d57, 0}}, {0x0e33, {0x0e4d, 0x0e32, 0}}, {0x0eb3, {0x0ecd, 0x0eb2, 0}}, {0x0f43, {0x0f42, 0x0fb7, 0}}, {0x0f4d, {0x0f4c, 0x0fb7, 0}}, {0x0f52, {0x0f51, 0x0fb7, 0}}, {0x0f57, {0x0f56, 0x0fb7, 0}}, {0x0f5c, {0x0f5b, 0x0fb7, 0}}, {0x0f69, {0x0f40, 0x0fb5, 0}}, {0x0f73, {0x0f72, 0x0f71, 0}}, {0x0f75, {0x0f74, 0x0f71, 0}}, {0x0f76, {0x0fb2, 0x0f80, 0}}, {0x0f77, {0x0fb2, 0x0f80, 0x0f71, 0}}, {0x0f78, {0x0fb3, 0x0f80, 0}}, {0x0f79, {0x0fb3, 0x0f80, 0x0f71, 0}}, {0x0f81, {0x0f80, 0x0f71, 0}}, {0x0f93, {0x0f92, 0x0fb7, 0}}, {0x0f9d, {0x0f9c, 0x0fb7, 0}}, {0x0fa2, {0x0fa1, 0x0fb7, 0}}, {0x0fa7, {0x0fa6, 0x0fb7, 0}}, {0x0fac, {0x0fab, 0x0fb7, 0}}, {0x0fb9, {0x0f90, 0x0fb5, 0}}, {0x1e00, {0x0041, 0x0325, 0}}, {0x1e01, {0x0061, 0x0325, 0}}, {0x1e02, {0x0042, 0x0307, 0}}, {0x1e03, {0x0062, 0x0307, 0}}, {0x1e04, {0x0042, 0x0323, 0}}, {0x1e05, {0x0062, 0x0323, 0}}, {0x1e06, {0x0042, 0x0331, 0}}, {0x1e07, {0x0062, 0x0331, 0}}, {0x1e08, {0x0043, 0x0327, 0x0301, 0}}, {0x1e09, {0x0063, 0x0327, 0x0301, 0}}, {0x1e0a, {0x0044, 0x0307, 0}}, {0x1e0b, {0x0064, 0x0307, 0}}, {0x1e0c, {0x0044, 0x0323, 0}}, {0x1e0d, {0x0064, 0x0323, 0}}, {0x1e0e, {0x0044, 0x0331, 0}}, {0x1e0f, {0x0064, 0x0331, 0}}, {0x1e10, {0x0044, 0x0327, 0}}, {0x1e11, {0x0064, 0x0327, 0}}, {0x1e12, {0x0044, 0x032d, 0}}, {0x1e13, {0x0064, 0x032d, 0}}, {0x1e14, {0x0045, 0x0304, 0x0300, 0}}, {0x1e15, {0x0065, 0x0304, 0x0300, 0}}, {0x1e16, {0x0045, 0x0304, 0x0301, 0}}, {0x1e17, {0x0065, 0x0304, 0x0301, 0}}, {0x1e18, {0x0045, 0x032d, 0}}, {0x1e19, {0x0065, 0x032d, 0}}, {0x1e1a, {0x0045, 0x0330, 0}}, {0x1e1b, {0x0065, 0x0330, 0}}, {0x1e1c, {0x0045, 0x0327, 0x0306, 0}}, {0x1e1d, {0x0065, 0x0327, 0x0306, 0}}, {0x1e1e, {0x0046, 0x0307, 0}}, {0x1e1f, {0x0066, 0x0307, 0}}, {0x1e20, {0x0047, 0x0304, 0}}, {0x1e21, {0x0067, 0x0304, 0}}, {0x1e22, {0x0048, 0x0307, 0}}, {0x1e23, {0x0068, 0x0307, 0}}, {0x1e24, {0x0048, 0x0323, 0}}, {0x1e25, {0x0068, 0x0323, 0}}, {0x1e26, {0x0048, 0x0308, 0}}, {0x1e27, {0x0068, 0x0308, 0}}, {0x1e28, {0x0048, 0x0327, 0}}, {0x1e29, {0x0068, 0x0327, 0}}, {0x1e2a, {0x0048, 0x032e, 0}}, {0x1e2b, {0x0068, 0x032e, 0}}, {0x1e2c, {0x0049, 0x0330, 0}}, {0x1e2d, {0x0069, 0x0330, 0}}, {0x1e2e, {0x0049, 0x0308, 0x0301, 0}}, {0x1e2f, {0x0069, 0x0308, 0x0301, 0}}, {0x1e30, {0x004b, 0x0301, 0}}, {0x1e31, {0x006b, 0x0301, 0}}, {0x1e32, {0x004b, 0x0323, 0}}, {0x1e33, {0x006b, 0x0323, 0}}, {0x1e34, {0x004b, 0x0331, 0}}, {0x1e35, {0x006b, 0x0331, 0}}, {0x1e36, {0x004c, 0x0323, 0}}, {0x1e37, {0x006c, 0x0323, 0}}, {0x1e38, {0x004c, 0x0323, 0x0304, 0}}, {0x1e39, {0x006c, 0x0323, 0x0304, 0}}, {0x1e3a, {0x004c, 0x0331, 0}}, {0x1e3b, {0x006c, 0x0331, 0}}, {0x1e3c, {0x004c, 0x032d, 0}}, {0x1e3d, {0x006c, 0x032d, 0}}, {0x1e3e, {0x004d, 0x0301, 0}}, {0x1e3f, {0x006d, 0x0301, 0}}, {0x1e40, {0x004d, 0x0307, 0}}, {0x1e41, {0x006d, 0x0307, 0}}, {0x1e42, {0x004d, 0x0323, 0}}, {0x1e43, {0x006d, 0x0323, 0}}, {0x1e44, {0x004e, 0x0307, 0}}, {0x1e45, {0x006e, 0x0307, 0}}, {0x1e46, {0x004e, 0x0323, 0}}, {0x1e47, {0x006e, 0x0323, 0}}, {0x1e48, {0x004e, 0x0331, 0}}, {0x1e49, {0x006e, 0x0331, 0}}, {0x1e4a, {0x004e, 0x032d, 0}}, {0x1e4b, {0x006e, 0x032d, 0}}, {0x1e4c, {0x004f, 0x0303, 0x0301, 0}}, {0x1e4d, {0x006f, 0x0303, 0x0301, 0}}, {0x1e4e, {0x004f, 0x0303, 0x0308, 0}}, {0x1e4f, {0x006f, 0x0303, 0x0308, 0}}, {0x1e50, {0x004f, 0x0304, 0x0300, 0}}, {0x1e51, {0x006f, 0x0304, 0x0300, 0}}, {0x1e52, {0x004f, 0x0304, 0x0301, 0}}, {0x1e53, {0x006f, 0x0304, 0x0301, 0}}, {0x1e54, {0x0050, 0x0301, 0}}, {0x1e55, {0x0070, 0x0301, 0}}, {0x1e56, {0x0050, 0x0307, 0}}, {0x1e57, {0x0070, 0x0307, 0}}, {0x1e58, {0x0052, 0x0307, 0}}, {0x1e59, {0x0072, 0x0307, 0}}, {0x1e5a, {0x0052, 0x0323, 0}}, {0x1e5b, {0x0072, 0x0323, 0}}, {0x1e5c, {0x0052, 0x0323, 0x0304, 0}}, {0x1e5d, {0x0072, 0x0323, 0x0304, 0}}, {0x1e5e, {0x0052, 0x0331, 0}}, {0x1e5f, {0x0072, 0x0331, 0}}, {0x1e60, {0x0053, 0x0307, 0}}, {0x1e61, {0x0073, 0x0307, 0}}, {0x1e62, {0x0053, 0x0323, 0}}, {0x1e63, {0x0073, 0x0323, 0}}, {0x1e64, {0x0053, 0x0301, 0x0307, 0}}, {0x1e65, {0x0073, 0x0301, 0x0307, 0}}, {0x1e66, {0x0053, 0x030c, 0x0307, 0}}, {0x1e67, {0x0073, 0x030c, 0x0307, 0}}, {0x1e68, {0x0053, 0x0323, 0x0307, 0}}, {0x1e69, {0x0073, 0x0323, 0x0307, 0}}, {0x1e6a, {0x0054, 0x0307, 0}}, {0x1e6b, {0x0074, 0x0307, 0}}, {0x1e6c, {0x0054, 0x0323, 0}}, {0x1e6d, {0x0074, 0x0323, 0}}, {0x1e6e, {0x0054, 0x0331, 0}}, {0x1e6f, {0x0074, 0x0331, 0}}, {0x1e70, {0x0054, 0x032d, 0}}, {0x1e71, {0x0074, 0x032d, 0}}, {0x1e72, {0x0055, 0x0324, 0}}, {0x1e73, {0x0075, 0x0324, 0}}, {0x1e74, {0x0055, 0x0330, 0}}, {0x1e75, {0x0075, 0x0330, 0}}, {0x1e76, {0x0055, 0x032d, 0}}, {0x1e77, {0x0075, 0x032d, 0}}, {0x1e78, {0x0055, 0x0303, 0x0301, 0}}, {0x1e79, {0x0075, 0x0303, 0x0301, 0}}, {0x1e7a, {0x0055, 0x0304, 0x0308, 0}}, {0x1e7b, {0x0075, 0x0304, 0x0308, 0}}, {0x1e7c, {0x0056, 0x0303, 0}}, {0x1e7d, {0x0076, 0x0303, 0}}, {0x1e7e, {0x0056, 0x0323, 0}}, {0x1e7f, {0x0076, 0x0323, 0}}, {0x1e80, {0x0057, 0x0300, 0}}, {0x1e81, {0x0077, 0x0300, 0}}, {0x1e82, {0x0057, 0x0301, 0}}, {0x1e83, {0x0077, 0x0301, 0}}, {0x1e84, {0x0057, 0x0308, 0}}, {0x1e85, {0x0077, 0x0308, 0}}, {0x1e86, {0x0057, 0x0307, 0}}, {0x1e87, {0x0077, 0x0307, 0}}, {0x1e88, {0x0057, 0x0323, 0}}, {0x1e89, {0x0077, 0x0323, 0}}, {0x1e8a, {0x0058, 0x0307, 0}}, {0x1e8b, {0x0078, 0x0307, 0}}, {0x1e8c, {0x0058, 0x0308, 0}}, {0x1e8d, {0x0078, 0x0308, 0}}, {0x1e8e, {0x0059, 0x0307, 0}}, {0x1e8f, {0x0079, 0x0307, 0}}, {0x1e90, {0x005a, 0x0302, 0}}, {0x1e91, {0x007a, 0x0302, 0}}, {0x1e92, {0x005a, 0x0323, 0}}, {0x1e93, {0x007a, 0x0323, 0}}, {0x1e94, {0x005a, 0x0331, 0}}, {0x1e95, {0x007a, 0x0331, 0}}, {0x1e96, {0x0068, 0x0331, 0}}, {0x1e97, {0x0074, 0x0308, 0}}, {0x1e98, {0x0077, 0x030a, 0}}, {0x1e99, {0x0079, 0x030a, 0}}, {0x1e9b, {0x017f, 0x0307, 0}}, {0x1ea0, {0x0041, 0x0323, 0}}, {0x1ea1, {0x0061, 0x0323, 0}}, {0x1ea2, {0x0041, 0x0309, 0}}, {0x1ea3, {0x0061, 0x0309, 0}}, {0x1ea4, {0x0041, 0x0302, 0x0301, 0}}, {0x1ea5, {0x0061, 0x0302, 0x0301, 0}}, {0x1ea6, {0x0041, 0x0302, 0x0300, 0}}, {0x1ea7, {0x0061, 0x0302, 0x0300, 0}}, {0x1ea8, {0x0041, 0x0302, 0x0309, 0}}, {0x1ea9, {0x0061, 0x0302, 0x0309, 0}}, {0x1eaa, {0x0041, 0x0302, 0x0303, 0}}, {0x1eab, {0x0061, 0x0302, 0x0303, 0}}, {0x1eac, {0x0041, 0x0323, 0x0302, 0}}, {0x1ead, {0x0061, 0x0323, 0x0302, 0}}, {0x1eae, {0x0041, 0x0306, 0x0301, 0}}, {0x1eaf, {0x0061, 0x0306, 0x0301, 0}}, {0x1eb0, {0x0041, 0x0306, 0x0300, 0}}, {0x1eb1, {0x0061, 0x0306, 0x0300, 0}}, {0x1eb2, {0x0041, 0x0306, 0x0309, 0}}, {0x1eb3, {0x0061, 0x0306, 0x0309, 0}}, {0x1eb4, {0x0041, 0x0306, 0x0303, 0}}, {0x1eb5, {0x0061, 0x0306, 0x0303, 0}}, {0x1eb6, {0x0041, 0x0323, 0x0306, 0}}, {0x1eb7, {0x0061, 0x0323, 0x0306, 0}}, {0x1eb8, {0x0045, 0x0323, 0}}, {0x1eb9, {0x0065, 0x0323, 0}}, {0x1eba, {0x0045, 0x0309, 0}}, {0x1ebb, {0x0065, 0x0309, 0}}, {0x1ebc, {0x0045, 0x0303, 0}}, {0x1ebd, {0x0065, 0x0303, 0}}, {0x1ebe, {0x0045, 0x0302, 0x0301, 0}}, {0x1ebf, {0x0065, 0x0302, 0x0301, 0}}, {0x1ec0, {0x0045, 0x0302, 0x0300, 0}}, {0x1ec1, {0x0065, 0x0302, 0x0300, 0}}, {0x1ec2, {0x0045, 0x0302, 0x0309, 0}}, {0x1ec3, {0x0065, 0x0302, 0x0309, 0}}, {0x1ec4, {0x0045, 0x0302, 0x0303, 0}}, {0x1ec5, {0x0065, 0x0302, 0x0303, 0}}, {0x1ec6, {0x0045, 0x0323, 0x0302, 0}}, {0x1ec7, {0x0065, 0x0323, 0x0302, 0}}, {0x1ec8, {0x0049, 0x0309, 0}}, {0x1ec9, {0x0069, 0x0309, 0}}, {0x1eca, {0x0049, 0x0323, 0}}, {0x1ecb, {0x0069, 0x0323, 0}}, {0x1ecc, {0x004f, 0x0323, 0}}, {0x1ecd, {0x006f, 0x0323, 0}}, {0x1ece, {0x004f, 0x0309, 0}}, {0x1ecf, {0x006f, 0x0309, 0}}, {0x1ed0, {0x004f, 0x0302, 0x0301, 0}}, {0x1ed1, {0x006f, 0x0302, 0x0301, 0}}, {0x1ed2, {0x004f, 0x0302, 0x0300, 0}}, {0x1ed3, {0x006f, 0x0302, 0x0300, 0}}, {0x1ed4, {0x004f, 0x0302, 0x0309, 0}}, {0x1ed5, {0x006f, 0x0302, 0x0309, 0}}, {0x1ed6, {0x004f, 0x0302, 0x0303, 0}}, {0x1ed7, {0x006f, 0x0302, 0x0303, 0}}, {0x1ed8, {0x004f, 0x0323, 0x0302, 0}}, {0x1ed9, {0x006f, 0x0323, 0x0302, 0}}, {0x1eda, {0x004f, 0x031b, 0x0301, 0}}, {0x1edb, {0x006f, 0x031b, 0x0301, 0}}, {0x1edc, {0x004f, 0x031b, 0x0300, 0}}, {0x1edd, {0x006f, 0x031b, 0x0300, 0}}, {0x1ede, {0x004f, 0x031b, 0x0309, 0}}, {0x1edf, {0x006f, 0x031b, 0x0309, 0}}, {0x1ee0, {0x004f, 0x031b, 0x0303, 0}}, {0x1ee1, {0x006f, 0x031b, 0x0303, 0}}, {0x1ee2, {0x004f, 0x031b, 0x0323, 0}}, {0x1ee3, {0x006f, 0x031b, 0x0323, 0}}, {0x1ee4, {0x0055, 0x0323, 0}}, {0x1ee5, {0x0075, 0x0323, 0}}, {0x1ee6, {0x0055, 0x0309, 0}}, {0x1ee7, {0x0075, 0x0309, 0}}, {0x1ee8, {0x0055, 0x031b, 0x0301, 0}}, {0x1ee9, {0x0075, 0x031b, 0x0301, 0}}, {0x1eea, {0x0055, 0x031b, 0x0300, 0}}, {0x1eeb, {0x0075, 0x031b, 0x0300, 0}}, {0x1eec, {0x0055, 0x031b, 0x0309, 0}}, {0x1eed, {0x0075, 0x031b, 0x0309, 0}}, {0x1eee, {0x0055, 0x031b, 0x0303, 0}}, {0x1eef, {0x0075, 0x031b, 0x0303, 0}}, {0x1ef0, {0x0055, 0x031b, 0x0323, 0}}, {0x1ef1, {0x0075, 0x031b, 0x0323, 0}}, {0x1ef2, {0x0059, 0x0300, 0}}, {0x1ef3, {0x0079, 0x0300, 0}}, {0x1ef4, {0x0059, 0x0323, 0}}, {0x1ef5, {0x0079, 0x0323, 0}}, {0x1ef6, {0x0059, 0x0309, 0}}, {0x1ef7, {0x0079, 0x0309, 0}}, {0x1ef8, {0x0059, 0x0303, 0}}, {0x1ef9, {0x0079, 0x0303, 0}}, {0x1f00, {0x03b1, 0x0313, 0}}, {0x1f01, {0x03b1, 0x0314, 0}}, {0x1f02, {0x03b1, 0x0313, 0x0300, 0}}, {0x1f03, {0x03b1, 0x0314, 0x0300, 0}}, {0x1f04, {0x03b1, 0x0313, 0x0301, 0}}, {0x1f05, {0x03b1, 0x0314, 0x0301, 0}}, {0x1f06, {0x03b1, 0x0313, 0x0342, 0}}, {0x1f07, {0x03b1, 0x0314, 0x0342, 0}}, {0x1f08, {0x0391, 0x0313, 0}}, {0x1f09, {0x0391, 0x0314, 0}}, {0x1f0a, {0x0391, 0x0313, 0x0300, 0}}, {0x1f0b, {0x0391, 0x0314, 0x0300, 0}}, {0x1f0c, {0x0391, 0x0313, 0x0301, 0}}, {0x1f0d, {0x0391, 0x0314, 0x0301, 0}}, {0x1f0e, {0x0391, 0x0313, 0x0342, 0}}, {0x1f0f, {0x0391, 0x0314, 0x0342, 0}}, {0x1f10, {0x03b5, 0x0313, 0}}, {0x1f11, {0x03b5, 0x0314, 0}}, {0x1f12, {0x03b5, 0x0313, 0x0300, 0}}, {0x1f13, {0x03b5, 0x0314, 0x0300, 0}}, {0x1f14, {0x03b5, 0x0313, 0x0301, 0}}, {0x1f15, {0x03b5, 0x0314, 0x0301, 0}}, {0x1f18, {0x0395, 0x0313, 0}}, {0x1f19, {0x0395, 0x0314, 0}}, {0x1f1a, {0x0395, 0x0313, 0x0300, 0}}, {0x1f1b, {0x0395, 0x0314, 0x0300, 0}}, {0x1f1c, {0x0395, 0x0313, 0x0301, 0}}, {0x1f1d, {0x0395, 0x0314, 0x0301, 0}}, {0x1f20, {0x03b7, 0x0313, 0}}, {0x1f21, {0x03b7, 0x0314, 0}}, {0x1f22, {0x03b7, 0x0313, 0x0300, 0}}, {0x1f23, {0x03b7, 0x0314, 0x0300, 0}}, {0x1f24, {0x03b7, 0x0313, 0x0301, 0}}, {0x1f25, {0x03b7, 0x0314, 0x0301, 0}}, {0x1f26, {0x03b7, 0x0313, 0x0342, 0}}, {0x1f27, {0x03b7, 0x0314, 0x0342, 0}}, {0x1f28, {0x0397, 0x0313, 0}}, {0x1f29, {0x0397, 0x0314, 0}}, {0x1f2a, {0x0397, 0x0313, 0x0300, 0}}, {0x1f2b, {0x0397, 0x0314, 0x0300, 0}}, {0x1f2c, {0x0397, 0x0313, 0x0301, 0}}, {0x1f2d, {0x0397, 0x0314, 0x0301, 0}}, {0x1f2e, {0x0397, 0x0313, 0x0342, 0}}, {0x1f2f, {0x0397, 0x0314, 0x0342, 0}}, {0x1f30, {0x03b9, 0x0313, 0}}, {0x1f31, {0x03b9, 0x0314, 0}}, {0x1f32, {0x03b9, 0x0313, 0x0300, 0}}, {0x1f33, {0x03b9, 0x0314, 0x0300, 0}}, {0x1f34, {0x03b9, 0x0313, 0x0301, 0}}, {0x1f35, {0x03b9, 0x0314, 0x0301, 0}}, {0x1f36, {0x03b9, 0x0313, 0x0342, 0}}, {0x1f37, {0x03b9, 0x0314, 0x0342, 0}}, {0x1f38, {0x0399, 0x0313, 0}}, {0x1f39, {0x0399, 0x0314, 0}}, {0x1f3a, {0x0399, 0x0313, 0x0300, 0}}, {0x1f3b, {0x0399, 0x0314, 0x0300, 0}}, {0x1f3c, {0x0399, 0x0313, 0x0301, 0}}, {0x1f3d, {0x0399, 0x0314, 0x0301, 0}}, {0x1f3e, {0x0399, 0x0313, 0x0342, 0}}, {0x1f3f, {0x0399, 0x0314, 0x0342, 0}}, {0x1f40, {0x03bf, 0x0313, 0}}, {0x1f41, {0x03bf, 0x0314, 0}}, {0x1f42, {0x03bf, 0x0313, 0x0300, 0}}, {0x1f43, {0x03bf, 0x0314, 0x0300, 0}}, {0x1f44, {0x03bf, 0x0313, 0x0301, 0}}, {0x1f45, {0x03bf, 0x0314, 0x0301, 0}}, {0x1f48, {0x039f, 0x0313, 0}}, {0x1f49, {0x039f, 0x0314, 0}}, {0x1f4a, {0x039f, 0x0313, 0x0300, 0}}, {0x1f4b, {0x039f, 0x0314, 0x0300, 0}}, {0x1f4c, {0x039f, 0x0313, 0x0301, 0}}, {0x1f4d, {0x039f, 0x0314, 0x0301, 0}}, {0x1f50, {0x03c5, 0x0313, 0}}, {0x1f51, {0x03c5, 0x0314, 0}}, {0x1f52, {0x03c5, 0x0313, 0x0300, 0}}, {0x1f53, {0x03c5, 0x0314, 0x0300, 0}}, {0x1f54, {0x03c5, 0x0313, 0x0301, 0}}, {0x1f55, {0x03c5, 0x0314, 0x0301, 0}}, {0x1f56, {0x03c5, 0x0313, 0x0342, 0}}, {0x1f57, {0x03c5, 0x0314, 0x0342, 0}}, {0x1f59, {0x03a5, 0x0314, 0}}, {0x1f5b, {0x03a5, 0x0314, 0x0300, 0}}, {0x1f5d, {0x03a5, 0x0314, 0x0301, 0}}, {0x1f5f, {0x03a5, 0x0314, 0x0342, 0}}, {0x1f60, {0x03c9, 0x0313, 0}}, {0x1f61, {0x03c9, 0x0314, 0}}, {0x1f62, {0x03c9, 0x0313, 0x0300, 0}}, {0x1f63, {0x03c9, 0x0314, 0x0300, 0}}, {0x1f64, {0x03c9, 0x0313, 0x0301, 0}}, {0x1f65, {0x03c9, 0x0314, 0x0301, 0}}, {0x1f66, {0x03c9, 0x0313, 0x0342, 0}}, {0x1f67, {0x03c9, 0x0314, 0x0342, 0}}, {0x1f68, {0x03a9, 0x0313, 0}}, {0x1f69, {0x03a9, 0x0314, 0}}, {0x1f6a, {0x03a9, 0x0313, 0x0300, 0}}, {0x1f6b, {0x03a9, 0x0314, 0x0300, 0}}, {0x1f6c, {0x03a9, 0x0313, 0x0301, 0}}, {0x1f6d, {0x03a9, 0x0314, 0x0301, 0}}, {0x1f6e, {0x03a9, 0x0313, 0x0342, 0}}, {0x1f6f, {0x03a9, 0x0314, 0x0342, 0}}, {0x1f70, {0x03b1, 0x0300, 0}}, {0x1f71, {0x03b1, 0x0301, 0}}, {0x1f72, {0x03b5, 0x0300, 0}}, {0x1f73, {0x03b5, 0x0301, 0}}, {0x1f74, {0x03b7, 0x0300, 0}}, {0x1f75, {0x03b7, 0x0301, 0}}, {0x1f76, {0x03b9, 0x0300, 0}}, {0x1f77, {0x03b9, 0x0301, 0}}, {0x1f78, {0x03bf, 0x0300, 0}}, {0x1f79, {0x03bf, 0x0301, 0}}, {0x1f7a, {0x03c5, 0x0300, 0}}, {0x1f7b, {0x03c5, 0x0301, 0}}, {0x1f7c, {0x03c9, 0x0300, 0}}, {0x1f7d, {0x03c9, 0x0301, 0}}, {0x1f80, {0x03b1, 0x0345, 0x0313, 0}}, {0x1f81, {0x03b1, 0x0345, 0x0314, 0}}, {0x1f82, {0x03b1, 0x0345, 0x0313, 0x0300, 0}}, {0x1f83, {0x03b1, 0x0345, 0x0314, 0x0300, 0}}, {0x1f84, {0x03b1, 0x0345, 0x0313, 0x0301, 0}}, {0x1f85, {0x03b1, 0x0345, 0x0314, 0x0301, 0}}, {0x1f86, {0x03b1, 0x0345, 0x0313, 0x0342, 0}}, {0x1f87, {0x03b1, 0x0345, 0x0314, 0x0342, 0}}, {0x1f88, {0x0391, 0x0345, 0x0313, 0}}, {0x1f89, {0x0391, 0x0345, 0x0314, 0}}, {0x1f8a, {0x0391, 0x0345, 0x0313, 0x0300, 0}}, {0x1f8b, {0x0391, 0x0345, 0x0314, 0x0300, 0}}, {0x1f8c, {0x0391, 0x0345, 0x0313, 0x0301, 0}}, {0x1f8d, {0x0391, 0x0345, 0x0314, 0x0301, 0}}, {0x1f8e, {0x0391, 0x0345, 0x0313, 0x0342, 0}}, {0x1f8f, {0x0391, 0x0345, 0x0314, 0x0342, 0}}, {0x1f90, {0x03b7, 0x0345, 0x0313, 0}}, {0x1f91, {0x03b7, 0x0345, 0x0314, 0}}, {0x1f92, {0x03b7, 0x0345, 0x0313, 0x0300, 0}}, {0x1f93, {0x03b7, 0x0345, 0x0314, 0x0300, 0}}, {0x1f94, {0x03b7, 0x0345, 0x0313, 0x0301, 0}}, {0x1f95, {0x03b7, 0x0345, 0x0314, 0x0301, 0}}, {0x1f96, {0x03b7, 0x0345, 0x0313, 0x0342, 0}}, {0x1f97, {0x03b7, 0x0345, 0x0314, 0x0342, 0}}, {0x1f98, {0x0397, 0x0345, 0x0313, 0}}, {0x1f99, {0x0397, 0x0345, 0x0314, 0}}, {0x1f9a, {0x0397, 0x0345, 0x0313, 0x0300, 0}}, {0x1f9b, {0x0397, 0x0345, 0x0314, 0x0300, 0}}, {0x1f9c, {0x0397, 0x0345, 0x0313, 0x0301, 0}}, {0x1f9d, {0x0397, 0x0345, 0x0314, 0x0301, 0}}, {0x1f9e, {0x0397, 0x0345, 0x0313, 0x0342, 0}}, {0x1f9f, {0x0397, 0x0345, 0x0314, 0x0342, 0}}, {0x1fa0, {0x03c9, 0x0345, 0x0313, 0}}, {0x1fa1, {0x03c9, 0x0345, 0x0314, 0}}, {0x1fa2, {0x03c9, 0x0345, 0x0313, 0x0300, 0}}, {0x1fa3, {0x03c9, 0x0345, 0x0314, 0x0300, 0}}, {0x1fa4, {0x03c9, 0x0345, 0x0313, 0x0301, 0}}, {0x1fa5, {0x03c9, 0x0345, 0x0314, 0x0301, 0}}, {0x1fa6, {0x03c9, 0x0345, 0x0313, 0x0342, 0}}, {0x1fa7, {0x03c9, 0x0345, 0x0314, 0x0342, 0}}, {0x1fa8, {0x03a9, 0x0345, 0x0313, 0}}, {0x1fa9, {0x03a9, 0x0345, 0x0314, 0}}, {0x1faa, {0x03a9, 0x0345, 0x0313, 0x0300, 0}}, {0x1fab, {0x03a9, 0x0345, 0x0314, 0x0300, 0}}, {0x1fac, {0x03a9, 0x0345, 0x0313, 0x0301, 0}}, {0x1fad, {0x03a9, 0x0345, 0x0314, 0x0301, 0}}, {0x1fae, {0x03a9, 0x0345, 0x0313, 0x0342, 0}}, {0x1faf, {0x03a9, 0x0345, 0x0314, 0x0342, 0}}, {0x1fb0, {0x03b1, 0x0306, 0}}, {0x1fb1, {0x03b1, 0x0304, 0}}, {0x1fb2, {0x03b1, 0x0345, 0x0300, 0}}, {0x1fb3, {0x03b1, 0x0345, 0}}, {0x1fb4, {0x03b1, 0x0345, 0x0301, 0}}, {0x1fb6, {0x03b1, 0x0342, 0}}, {0x1fb7, {0x03b1, 0x0345, 0x0342, 0}}, {0x1fb8, {0x0391, 0x0306, 0}}, {0x1fb9, {0x0391, 0x0304, 0}}, {0x1fba, {0x0391, 0x0300, 0}}, {0x1fbb, {0x0391, 0x0301, 0}}, {0x1fbc, {0x0391, 0x0345, 0}}, {0x1fbe, {0x03b9, 0}}, {0x1fc1, {0x00a8, 0x0342, 0}}, {0x1fc2, {0x03b7, 0x0345, 0x0300, 0}}, {0x1fc3, {0x03b7, 0x0345, 0}}, {0x1fc4, {0x03b7, 0x0345, 0x0301, 0}}, {0x1fc6, {0x03b7, 0x0342, 0}}, {0x1fc7, {0x03b7, 0x0345, 0x0342, 0}}, {0x1fc8, {0x0395, 0x0300, 0}}, {0x1fc9, {0x0395, 0x0301, 0}}, {0x1fca, {0x0397, 0x0300, 0}}, {0x1fcb, {0x0397, 0x0301, 0}}, {0x1fcc, {0x0397, 0x0345, 0}}, {0x1fcd, {0x1fbf, 0x0300, 0}}, {0x1fce, {0x1fbf, 0x0301, 0}}, {0x1fcf, {0x1fbf, 0x0342, 0}}, {0x1fd0, {0x03b9, 0x0306, 0}}, {0x1fd1, {0x03b9, 0x0304, 0}}, {0x1fd2, {0x03b9, 0x0308, 0x0300, 0}}, {0x1fd3, {0x03b9, 0x0308, 0x0301, 0}}, {0x1fd6, {0x03b9, 0x0342, 0}}, {0x1fd7, {0x03b9, 0x0308, 0x0342, 0}}, {0x1fd8, {0x0399, 0x0306, 0}}, {0x1fd9, {0x0399, 0x0304, 0}}, {0x1fda, {0x0399, 0x0300, 0}}, {0x1fdb, {0x0399, 0x0301, 0}}, {0x1fdd, {0x1ffe, 0x0300, 0}}, {0x1fde, {0x1ffe, 0x0301, 0}}, {0x1fdf, {0x1ffe, 0x0342, 0}}, {0x1fe0, {0x03c5, 0x0306, 0}}, {0x1fe1, {0x03c5, 0x0304, 0}}, {0x1fe2, {0x03c5, 0x0308, 0x0300, 0}}, {0x1fe3, {0x03c5, 0x0308, 0x0301, 0}}, {0x1fe4, {0x03c1, 0x0313, 0}}, {0x1fe5, {0x03c1, 0x0314, 0}}, {0x1fe6, {0x03c5, 0x0342, 0}}, {0x1fe7, {0x03c5, 0x0308, 0x0342, 0}}, {0x1fe8, {0x03a5, 0x0306, 0}}, {0x1fe9, {0x03a5, 0x0304, 0}}, {0x1fea, {0x03a5, 0x0300, 0}}, {0x1feb, {0x03a5, 0x0301, 0}}, {0x1fec, {0x03a1, 0x0314, 0}}, {0x1fed, {0x00a8, 0x0300, 0}}, {0x1fee, {0x00a8, 0x0301, 0}}, {0x1fef, {0x0060, 0}}, {0x1ff2, {0x03c9, 0x0345, 0x0300, 0}}, {0x1ff3, {0x03c9, 0x0345, 0}}, {0x1ff4, {0x03bf, 0x0345, 0x0301, 0}}, {0x1ff6, {0x03c9, 0x0342, 0}}, {0x1ff7, {0x03c9, 0x0345, 0x0342, 0}}, {0x1ff8, {0x039f, 0x0300, 0}}, {0x1ff9, {0x039f, 0x0301, 0}}, {0x1ffa, {0x03a9, 0x0300, 0}}, {0x1ffb, {0x03a9, 0x0301, 0}}, {0x1ffc, {0x03a9, 0x0345, 0}}, {0x1ffd, {0x00b4, 0}}, {0x2015, {0x2014, 0}}, {0x2225, {0x2016, 0}}, {0x304c, {0x304b, 0x3099, 0}}, {0x304e, {0x304d, 0x3099, 0}}, {0x3050, {0x304f, 0x3099, 0}}, {0x3052, {0x3051, 0x3099, 0}}, {0x3054, {0x3053, 0x3099, 0}}, {0x3056, {0x3055, 0x3099, 0}}, {0x3058, {0x3057, 0x3099, 0}}, {0x305a, {0x3059, 0x3099, 0}}, {0x305c, {0x305b, 0x3099, 0}}, {0x305e, {0x305d, 0x3099, 0}}, {0x3060, {0x305f, 0x3099, 0}}, {0x3062, {0x3061, 0x3099, 0}}, {0x3065, {0x3064, 0x3099, 0}}, {0x3067, {0x3066, 0x3099, 0}}, {0x3069, {0x3068, 0x3099, 0}}, {0x3070, {0x306f, 0x3099, 0}}, {0x3071, {0x306f, 0x309a, 0}}, {0x3073, {0x3072, 0x3099, 0}}, {0x3074, {0x3072, 0x309a, 0}}, {0x3076, {0x3075, 0x3099, 0}}, {0x3077, {0x3075, 0x309a, 0}}, {0x3079, {0x3078, 0x3099, 0}}, {0x307a, {0x3078, 0x309a, 0}}, {0x307c, {0x307b, 0x3099, 0}}, {0x307d, {0x307b, 0x309a, 0}}, {0x3094, {0x3046, 0x3099, 0}}, {0x309e, {0x309d, 0x3099, 0}}, {0x30ac, {0x30ab, 0x3099, 0}}, {0x30ae, {0x30ad, 0x3099, 0}}, {0x30b0, {0x30af, 0x3099, 0}}, {0x30b2, {0x30b1, 0x3099, 0}}, {0x30b4, {0x30b3, 0x3099, 0}}, {0x30b6, {0x30b5, 0x3099, 0}}, {0x30b8, {0x30b7, 0x3099, 0}}, {0x30ba, {0x30b9, 0x3099, 0}}, {0x30bc, {0x30bb, 0x3099, 0}}, {0x30be, {0x30bd, 0x3099, 0}}, {0x30c0, {0x30bf, 0x3099, 0}}, {0x30c2, {0x30c1, 0x3099, 0}}, {0x30c5, {0x30c4, 0x3099, 0}}, {0x30c7, {0x30c6, 0x3099, 0}}, {0x30c9, {0x30c8, 0x3099, 0}}, {0x30d0, {0x30cf, 0x3099, 0}}, {0x30d1, {0x30cf, 0x309a, 0}}, {0x30d3, {0x30d2, 0x3099, 0}}, {0x30d4, {0x30d2, 0x309a, 0}}, {0x30d6, {0x30d5, 0x3099, 0}}, {0x30d7, {0x30d5, 0x309a, 0}}, {0x30d9, {0x30d8, 0x3099, 0}}, {0x30da, {0x30d8, 0x309a, 0}}, {0x30dc, {0x30db, 0x3099, 0}}, {0x30dd, {0x30db, 0x309a, 0}}, {0x30f4, {0x30a6, 0x3099, 0}}, {0x30f7, {0x30ef, 0x3099, 0}}, {0x30f8, {0x30f0, 0x3099, 0}}, {0x30f9, {0x30f1, 0x3099, 0}}, {0x30fa, {0x30f2, 0x3099, 0}}, {0x30fe, {0x30fd, 0x3099, 0}}, {0xfb1f, {0x05f2, 0x05b7, 0}}, {0xfb2a, {0x05e9, 0x05c1, 0}}, {0xfb2b, {0x05e9, 0x05c2, 0}}, {0xfb2c, {0x05e9, 0x05bc, 0x05c1, 0}}, {0xfb2d, {0x05e9, 0x05bc, 0x05c2, 0}}, {0xfb2e, {0x05d0, 0x05b7, 0}}, {0xfb2f, {0x05d0, 0x05b8, 0}}, {0xfb30, {0x05d0, 0x05bc, 0}}, {0xfb31, {0x05d1, 0x05bc, 0}}, {0xfb32, {0x05d2, 0x05bc, 0}}, {0xfb33, {0x05d3, 0x05bc, 0}}, {0xfb34, {0x05d4, 0x05bc, 0}}, {0xfb35, {0x05d5, 0x05bc, 0}}, {0xfb36, {0x05d6, 0x05bc, 0}}, {0xfb38, {0x05d8, 0x05bc, 0}}, {0xfb39, {0x05d9, 0x05bc, 0}}, {0xfb3a, {0x05da, 0x05bc, 0}}, {0xfb3b, {0x05db, 0x05bc, 0}}, {0xfb3c, {0x05dc, 0x05bc, 0}}, {0xfb3e, {0x05de, 0x05bc, 0}}, {0xfb40, {0x05e0, 0x05bc, 0}}, {0xfb41, {0x05e1, 0x05bc, 0}}, {0xfb43, {0x05e3, 0x05bc, 0}}, {0xfb44, {0x05e4, 0x05bc, 0}}, {0xfb46, {0x05e6, 0x05bc, 0}}, {0xfb47, {0x05e7, 0x05bc, 0}}, {0xfb48, {0x05e8, 0x05bc, 0}}, {0xfb49, {0x05e9, 0x05bc, 0}}, {0xfb4a, {0x05ea, 0x05bc, 0}}, {0xfb4b, {0x05d5, 0x05b9, 0}}, {0xfb4c, {0x05d1, 0x05bf, 0}}, {0xfb4d, {0x05db, 0x05bf, 0}}, {0xfb4e, {0x05e4, 0x05bf, 0}}, {0xff0d, {0x2212, 0}}, {0xff5e, {0x301c, 0}}, {0xffe0, {0x00a2, 0}}, {0xffe1, {0x00a3, 0}}, {0xffe2, {0x00ac, 0}}, }; #define MACUNILISTSIZ arraysize(macunilist) static nftable iconvunilist[] = { {0x2225, {0x2016, 0}}, {0xff0d, {0x2212, 0}}, {0xff5e, {0x301c, 0}}, {0xffe0, {0x00a2, 0}}, {0xffe1, {0x00a3, 0}}, {0xffe2, {0x00ac, 0}}, }; #define ICONVUNILISTSIZ arraysize(iconvunilist) static int cmpuni(vp1, vp2) CONST VOID_P vp1; CONST VOID_P vp2; { convtable *tp1, *tp2; tp1 = (convtable *)vp1; tp2 = (convtable *)vp2; if (tp1 -> unicode > tp2 -> unicode) return(1); if (tp1 -> unicode < tp2 -> unicode) return(-1); return(0); } static int cmpnf(vp1, vp2) CONST VOID_P vp1; CONST VOID_P vp2; { nftable *tp1, *tp2; int i; tp1 = (nftable *)vp1; tp2 = (nftable *)vp2; for (i = 0; i < MAXNFLEN; i++) { if (tp1 -> normalization[i] > tp2 -> normalization[i]) return(1); if (tp1 -> normalization[i] < tp2 -> normalization[i]) return(-1); } return(0); } static int NEAR fputunilist(list, max, fp) convtable list[]; u_int max; FILE *fp; { u_int n; qsort(list, max, sizeof(convtable), cmpuni); if (fputlength("unitblent", (long)max, fp, 2) < 0) return(-1); if (fputbegin("unitblbuf", fp) < 0) return(-1); for (n = 0; n < max; n++) { if (fputword(list[n].unicode, fp) < 0 || fputword(list[n].org, fp) < 0) return(-1); } if (fputend(fp) < 0) return(-1); return(0); } static int NEAR fputnflist(name, list, max, fp) CONST char *name; nftable list[]; u_int max; FILE *fp; { u_int n; int i; tblname[nfent] = name; tblent[nfent] = max; nfent++; qsort(list, max, sizeof(nftable), cmpnf); if (!textmode && fputword(max, fp) < 0) return(-1); if (fputbegin(name, fp) < 0) return(-1); for (n = 0; n < max; n++) { if (fputword(list[n].unicode, fp) < 0) return(-1); for (i = 0; i < MAXNFLEN; i++) { if (fputword(list[n].normalization[i], fp) < 0) return(-1); } } if (fputend(fp) < 0) return(-1); return(0); } static int NEAR fputarray(name, vp, fp, str) CONST char *name; VOID_P vp; FILE *fp; int str; { CONST char *s; u_int ent; int n; if (!textmode) return(0); s = (str) ? "CONST u_char *" : "u_int "; if (fprintf(fp, "%s%s[] = {", s, name) < 0 && ferror(fp)) return(-1); for (n = 0; n < nfent; n++) { if (n && fputs(", ", fp) == EOF && ferror(fp)) return(-1); if (str) { s = ((CONST char **)vp)[n]; if (fprintf(fp, "%s", s) < 0 && ferror(fp)) return(-1); } else { ent = ((u_int *)vp)[n]; if (fprintf(fp, "%d", ent) < 0 && ferror(fp)) return(-1); } } if (fputs("};\n", fp) == EOF && ferror(fp)) return(-1); return(0); } static int NEAR mkunitbl(fp) FILE *fp; { if (fputheader("headers", fp) < 0) return(-1); if (nocontent) return(0); if (fputunilist(unilist, UNILISTSIZ, fp) < 0) return(-1); if (fputlength("nftblnum", NFTABLES, fp, 1) < 0) return(-1); if (fputlength("nflen", MAXNFLEN, fp, 1) < 0) return(-1); if (fputnflist("macunilist", macunilist, MACUNILISTSIZ, fp) < 0) return(-1); if (fputnflist("iconvunilist", iconvunilist, ICONVUNILISTSIZ, fp) < 0) return(-1); if (fputarray("nftblbuf", tblname, fp, 1) < 0) return(-1); if (fputarray("nftblent", tblent, fp, 0) < 0) return(-1); return(0); } int main(argc, argv) int argc; char *CONST argv[]; { FILE *fp; CONST char *path; int n; initopt(optlist); n = evalopt(argc, argv, optlist); if (n < 0 || n >= argc) { optusage(argv[0], "", optlist); return(1); } path = argv[n]; if (!(fp = opentbl(path))) return(1); n = mkunitbl(fp); VOID_C fclose(fp); if (n < 0) { VOID_C fprintf(stderr, "%s: Cannot write file.\n", path); return(1); } return(0); } FD-3.01j/mkdict.c100644 2105 1751 437576 13516612560 12366 0ustar shiraiuser/* * mkdict.c * * Kanji translation table converter */ #include "headers.h" #include "kctype.h" #include "typesize.h" #include "string.h" #include "kconv.h" #include "roman.h" #include "hinsi.h" #include "evalopt.h" #include "gentbl.h" #define MAXLINESTR 1023 #define DICTBUFUNIT 32 #define MAXHINSI 16 #define MAXBIAS 4 #define MAXHINSILEN 16 #define MAXFUZOKULEN 4 #define MAXRANGE 50 #define VERBOSECHAR '.' #define J_DAKUTEN 0x212b #define J_U 0x2426 #define J_VU 0x2574 #define DIC_WNN 1 #define DIC_CANNA 2 #define DIC_SJ3 4 #define DIC_WNNSJ3 (DIC_WNN | DIC_SJ3) #define getword(s, n) (((u_short)((s)[(n) + 1]) << 8) | (s)[n]) typedef struct _dicttable { ALLOC_T ptr; ALLOC_T klen; ALLOC_T size; int max; } dicttable; typedef struct _biastable { u_short id; u_short klen; CONST u_short kbuf[MAXBIAS]; } biastable; typedef struct _hinsitable { u_short id; u_char dict; u_char klen; u_short kbuf[MAXHINSILEN]; } hinsitable; typedef struct _hinsisettable { u_short id; u_short klen; CONST u_short set[MAXHINSI]; } hinsisettable; typedef struct _contable { u_short id; u_short klen; CONST u_short kbuf[MAXFUZOKULEN]; u_short nlen; CONST u_short next[SH_MAX]; } contable; static u_char *NEAR Xrealloc __P_((VOID_P, ALLOC_T)); static int NEAR addstrbuf __P_((ALLOC_T)); static int NEAR adddictlist __P_((ALLOC_T, ALLOC_T, ALLOC_T)); static int NEAR setkbuf __P_((int, CONST u_short *)); static int NEAR setjisbuf __P_((CONST char *, int, int)); static int NEAR setword __P_((u_int)); static int NEAR sethinsi __P_((int, CONST u_short *)); static int cmphinsi __P_((CONST VOID_P, CONST VOID_P)); static int NEAR addhinsi __P_((int, u_short *, int, CONST char *)); static int NEAR _gethinsi __P_((int, u_short *, CONST char *, int *)); static int NEAR gethinsi __P_((int, u_short *, char *, int *)); static int cmpidlist __P_((CONST VOID_P, CONST VOID_P)); static int NEAR adddict __P_((CONST char *, CONST char *, char *, u_int)); static u_int NEAR getfreq __P_((char *)); static int NEAR addcannadict __P_((CONST char *, char *)); static int NEAR convdict __P_((off_t, FILE *)); static int NEAR addhinsidict __P_((VOID_A)); static int NEAR addconlist __P_((int, int, CONST contable *)); static int NEAR genconlist __P_((VOID_A)); static int NEAR cmpjisbuf __P_((CONST u_char *, int, CONST u_char *, int)); static int cmpdict __P_((CONST VOID_P, CONST VOID_P)); static int NEAR writeindex __P_((FILE *)); static int NEAR writehinsiindex __P_((FILE *)); static int NEAR writehinsidict __P_((FILE *)); static int NEAR writedict __P_((FILE *)); static VOID NEAR readdict __P_((int, int, char *CONST [])); static int NEAR mkdict __P_((FILE *)); int main __P_((int, char *CONST [])); static dicttable *dictlist = NULL; static long maxdict = 0L; static long dictlistsize = 0L; static u_char *strbuf = NULL; static ALLOC_T maxstr = (ALLOC_T)0; static ALLOC_T strbufsize = (ALLOC_T)0; static int needhinsi = 0; static int nocontent = 0; static int verbose = 0; static CONST opt_t optlist[] = { {'h', &needhinsi, 1, NULL}, {'t', &textmode, 1, NULL}, {'n', &nocontent, 1, NULL}, {'v', &verbose, 1, NULL}, {'\0', NULL, 0, NULL}, }; static CONST biastable biaslist[] = { {HN_KA_IKU, 1, {0x2443}}, /* tsu */ {HN_KO_KO, 1, {0x2424}}, /* i */ {HN_KU_KU, 2, {0x246b, 0x246c}}, /* ru, re */ {HN_SU_SU, 1, {0x246b}}, /* ru */ }; #define BIASLISTSIZ arraysize(biaslist) static CONST hinsisettable hinsisetlist[] = { {HN_JINCHI, 2, {HN_JINMEI, HN_CHIMEI}}, {HN_KA5DAN, 2, {HN_KA5DOU, HN_KA5YOU}}, {HN_GA5DAN, 2, {HN_GA5DOU, HN_GA5YOU}}, {HN_SA5DAN, 2, {HN_SA5DOU, HN_SA5YOU}}, {HN_TA5DAN, 2, {HN_TA5DOU, HN_TA5YOU}}, {HN_NA5DAN, 2, {HN_NA5DOU, HN_NA5YOU}}, {HN_BA5DAN, 2, {HN_BA5DOU, HN_BA5YOU}}, {HN_MA5DAN, 2, {HN_MA5DOU, HN_MA5YOU}}, {HN_RA5DAN, 2, {HN_RA5DOU, HN_RA5YOU}}, {HN_WA5DAN, 2, {HN_WA5DOU, HN_WA5YOU}}, {HN_1DAN, 2, {HN_1DOU, HN_1YOU}}, {HN_1_MEI, 3, {HN_1DOU, HN_1YOU, HN_MEISHI}}, {HN_SAHEN, 2, {HN_SAHDOU, HN_SAHYOU}}, {HN_ZAHEN, 2, {HN_ZAHDOU, HN_ZAHDOU}}, {HN_KD_MEI, 2, {HN_KEIDOU, HN_MEISHI}}, }; #define HINSISETLISTSIZ arraysize(hinsisetlist) static hinsitable hinsilist[] = { {HN_SENTOU, DIC_WNN, /* Sentou */ 2, {0x4068, 0x462c}}, {HN_SUUJI, DIC_WNN, /* Suuji */ 2, {0x3f74, 0x3b7a}}, {HN_KANA, DIC_WNN, /* Kana */ 2, {0x252b, 0x254a}}, {HN_EISUU, DIC_WNN, /* EiSuu */ 2, {0x3151, 0x3f74}}, {HN_KIGOU, DIC_WNN, /* Kigou */ 2, {0x352d, 0x3966}}, {HN_HEIKAKKO, DIC_WNN, /* HeiKakko */ 3, {0x4a44, 0x3367, 0x384c}}, {HN_FUZOKUGO, DIC_WNN, /* Fuzokugo */ 3, {0x4955, 0x4230, 0x386c}}, {HN_KAIKAKKO, DIC_WNN, /* KaiKakko */ 3, {0x332b, 0x3367, 0x384c}}, {HN_GIJI, DIC_WNN, /* Giji */ 2, {0x353f, 0x3b77}}, {HN_MEISHI, DIC_WNN, /* Meishi */ 2, {0x4c3e, 0x3b6c}}, {HN_MEISHI, DIC_CANNA, /* #KN */ 3, {'#', 'K', 'N'}}, {HN_MEISHI, DIC_CANNA, /* #T25 */ 4, {'#', 'T', '2', '5'}}, {HN_MEISHI, DIC_CANNA, /* #T33 */ 4, {'#', 'T', '3', '3'}}, {HN_MEISHI, DIC_CANNA, /* #T35 */ 4, {'#', 'T', '3', '5'}}, {HN_MEISHI, DIC_CANNA, /* #OKX */ 4, {'#', 'O', 'K', 'X'}}, {HN_MEISHI, DIC_SJ3, /* Ikkatsu */ 2, {0x306c, 0x3367}}, {HN_MEISHI, DIC_SJ3, /* Dai1 */ 2, {0x4265, 0x2331}}, {HN_MEISHI, DIC_SJ3, /* Dai2 */ 2, {0x4265, 0x2332}}, {HN_MEISHI, DIC_SJ3, /* Dai3 */ 2, {0x4265, 0x2333}}, {HN_MEISHI, DIC_SJ3, /* Dai4 */ 2, {0x4265, 0x2334}}, {HN_MEISHI, DIC_SJ3, /* Dai5 */ 2, {0x4265, 0x2335}}, {HN_MEISHI, DIC_SJ3, /* Dai6 */ 2, {0x4265, 0x2336}}, {HN_MEISHI, DIC_SJ3, /* Mei1 */ 2, {0x4c3e, 0x2331}}, {HN_MEISHI, DIC_SJ3, /* Mei2 */ 2, {0x4c3e, 0x2332}}, {HN_MEISHI, DIC_SJ3, /* Mei3 */ 2, {0x4c3e, 0x2333}}, {HN_MEISHI, DIC_SJ3, /* Mei4 */ 2, {0x4c3e, 0x2334}}, {HN_MEISHI, DIC_SJ3, /* Mei5 */ 2, {0x4c3e, 0x2335}}, {HN_MEISHI, DIC_SJ3, /* Mei6 */ 2, {0x4c3e, 0x2336}}, {HN_MEISHI, DIC_SJ3, /* Mei7 */ 2, {0x4c3e, 0x2337}}, {HN_MEISHI, DIC_SJ3, /* Mei9 */ 2, {0x4c3e, 0x2339}}, {HN_MEISHI, DIC_SJ3, /* Mei10 */ 3, {0x4c3e, 0x2331, 0x2330}}, {HN_MEISHI, DIC_SJ3, /* Mei11 */ 3, {0x4c3e, 0x2331, 0x2331}}, {HN_MEISHI, DIC_SJ3, /* Mei20 */ 3, {0x4c3e, 0x2332, 0x2330}}, {HN_JINMEI, DIC_WNN, /* Jinmei */ 2, {0x3f4d, 0x4c3e}}, {HN_JINMEI, DIC_CANNA, /* #JN */ 3, {'#', 'J', 'N'}}, {HN_JINMEI, DIC_CANNA, /* #JNM */ 4, {'#', 'J', 'N', 'M'}}, {HN_JINMEI, DIC_SJ3, /* Myouji */ 2, {0x4944, 0x3b7a}}, {HN_JINMEI, DIC_SJ3, /* Namae */ 2, {0x4c3e, 0x4130}}, {HN_CHIMEI, DIC_WNNSJ3, /* Chimei */ 2, {0x434f, 0x4c3e}}, {HN_CHIMEI, DIC_CANNA, /* #CN */ 3, {'#', 'C', 'N'}}, {HN_CHIMEI, DIC_CANNA, /* #CNS */ 4, {'#', 'C', 'N', 'S'}}, {HN_CHIMEI, DIC_CANNA, /* #JNS */ 4, {'#', 'J', 'N', 'S'}}, {HN_CHIMEI, DIC_SJ3, /* Kenku */ 2, {0x3829, 0x3668}}, {HN_JINCHI, DIC_WNN, /* Jinmei&Chimei */ 5, {0x3f4d, 0x4c3e, '&', 0x434f, 0x4c3e}}, {HN_JINCHI, DIC_CANNA, /* #JCN */ 4, {'#', 'J', 'C', 'N'}}, {HN_KOYUU, DIC_WNN, /* KoyuuMeishi */ 4, {0x3847, 0x4d2d, 0x4c3e, 0x3b6c}}, {HN_KOYUU, DIC_CANNA, /* #KK */ 3, {'#', 'K', 'K'}}, {HN_KOYUU, DIC_SJ3, /* Kigyou */ 2, {0x346b, 0x3648}}, {HN_SUUSHI, DIC_WNNSJ3, /* Suushi */ 2, {0x3f74, 0x3b6c}}, {HN_SUUSHI, DIC_CANNA, /* #NN */ 3, {'#', 'N', 'N'}}, {HN_SUUSHI, DIC_CANNA, /* #N00 */ 4, {'#', 'N', '0', '0'}}, {HN_SUUSHI, DIC_CANNA, /* #N01 */ 4, {'#', 'N', '0', '1'}}, {HN_SUUSHI, DIC_CANNA, /* #N02 */ 4, {'#', 'N', '0', '2'}}, {HN_SUUSHI, DIC_CANNA, /* #N03 */ 4, {'#', 'N', '0', '3'}}, {HN_SUUSHI, DIC_SJ3, /* Suushi2 */ 3, {0x3f74, 0x3b6c, 0x2332}}, {HN_KA5DOU, DIC_WNN, /* KaDouKan */ 3, {0x252b, 0x4630, 0x3434}}, {HN_GA5DOU, DIC_WNN, /* GaDouKan */ 3, {0x252c, 0x4630, 0x3434}}, {HN_SA5DOU, DIC_WNN, /* SaDouKan */ 3, {0x2535, 0x4630, 0x3434}}, {HN_TA5DOU, DIC_WNN, /* TaDouKan */ 3, {0x253f, 0x4630, 0x3434}}, {HN_NA5DOU, DIC_WNN, /* NaDouKan */ 3, {0x254a, 0x4630, 0x3434}}, {HN_BA5DOU, DIC_WNN, /* BaDouKan */ 3, {0x2550, 0x4630, 0x3434}}, {HN_MA5DOU, DIC_WNN, /* MaDouKan */ 3, {0x255e, 0x4630, 0x3434}}, {HN_RA5DOU, DIC_WNN, /* RaDouKan */ 3, {0x2569, 0x4630, 0x3434}}, {HN_WA5DOU, DIC_WNN, /* WaDouKan */ 3, {0x256f, 0x4630, 0x3434}}, {HN_1DOU, DIC_WNN, /* 1DouKan */ 3, {0x306c, 0x4630, 0x3434}}, {HN_SAHDOU, DIC_WNN, /* SaHenDouKan */ 4, {0x2535, 0x4a51, 0x4630, 0x3434}}, {HN_ZAHDOU, DIC_WNN, /* ZaHenDouKan */ 4, {0x2536, 0x4a51, 0x4630, 0x3434}}, {HN_KA5YOU, DIC_WNN, /* KaDouRenyouKan */ 5, {0x252b, 0x4630, 0x4f22, 0x4d51, 0x3434}}, {HN_GA5YOU, DIC_WNN, /* GaDouRenyouKan */ 5, {0x252c, 0x4630, 0x4f22, 0x4d51, 0x3434}}, {HN_SA5YOU, DIC_WNN, /* SaDouRenyouKan */ 5, {0x2535, 0x4630, 0x4f22, 0x4d51, 0x3434}}, {HN_TA5YOU, DIC_WNN, /* TaDouRenyouKan */ 5, {0x253f, 0x4630, 0x4f22, 0x4d51, 0x3434}}, {HN_NA5YOU, DIC_WNN, /* NaDouRenyouKan */ 5, {0x254a, 0x4630, 0x4f22, 0x4d51, 0x3434}}, {HN_BA5YOU, DIC_WNN, /* BaDouRenyouKan */ 5, {0x2550, 0x4630, 0x4f22, 0x4d51, 0x3434}}, {HN_MA5YOU, DIC_WNN, /* MaDouRenyouKan */ 5, {0x255e, 0x4630, 0x4f22, 0x4d51, 0x3434}}, {HN_RA5YOU, DIC_WNN, /* RaDouRenyouKan */ 5, {0x2569, 0x4630, 0x4f22, 0x4d51, 0x3434}}, {HN_WA5YOU, DIC_WNN, /* WaDouRenyouKan */ 5, {0x256f, 0x4630, 0x4f22, 0x4d51, 0x3434}}, {HN_1YOU, DIC_WNN, /* 1DouRenyouKan */ 5, {0x306c, 0x4630, 0x4f22, 0x4d51, 0x3434}}, {HN_SAHYOU, DIC_WNN, /* SaHenDouRenyouKan */ 6, {0x2535, 0x4a51, 0x4630, 0x4f22, 0x4d51, 0x3434}}, {HN_ZAHYOU, DIC_WNN, /* ZaHenDouRenyouKan */ 6, {0x2536, 0x4a51, 0x4630, 0x4f22, 0x4d51, 0x3434}}, {HN_KA5DAN, DIC_WNN, /* KaGyou5Dan */ 4, {0x252b, 0x3954, 0x385e, 0x434a}}, {HN_KA5DAN, DIC_CANNA, /* #K5 */ 3, {'#', 'K', '5'}}, {HN_KA5DAN, DIC_CANNA, /* #K5r */ 4, {'#', 'K', '5', 'r'}}, {HN_KA5DAN, DIC_SJ3, /* Ka5-1 */ 3, {0x252b, 0x385e, 0x2331}}, {HN_KA5DAN, DIC_SJ3, /* Ka5-2 */ 3, {0x252b, 0x385e, 0x2332}}, {HN_KA5DAN, DIC_SJ3, /* Ka5-3 */ 3, {0x252b, 0x385e, 0x2333}}, {HN_KA5DAN, DIC_SJ3, /* Ka5-4 */ 3, {0x252b, 0x385e, 0x2334}}, {HN_KA5DAN, DIC_SJ3, /* Ka5-5 */ 3, {0x252b, 0x385e, 0x2335}}, {HN_KA5DAN, DIC_SJ3, /* Ka5-6 */ 3, {0x252b, 0x385e, 0x2336}}, {HN_KA5DAN, DIC_SJ3, /* Ka5-7 */ 3, {0x252b, 0x385e, 0x2337}}, {HN_KA5DAN, DIC_SJ3, /* Ka5-8 */ 3, {0x252b, 0x385e, 0x2338}}, {HN_GA5DAN, DIC_WNN, /* GaGyou5Dan */ 4, {0x252c, 0x3954, 0x385e, 0x434a}}, {HN_GA5DAN, DIC_CANNA, /* #G5 */ 3, {'#', 'G', '5'}}, {HN_GA5DAN, DIC_CANNA, /* #G5r */ 4, {'#', 'G', '5', 'r'}}, {HN_GA5DAN, DIC_SJ3, /* Ga5-1 */ 3, {0x252c, 0x385e, 0x2331}}, {HN_GA5DAN, DIC_SJ3, /* Ga5-2 */ 3, {0x252c, 0x385e, 0x2332}}, {HN_GA5DAN, DIC_SJ3, /* Ga5-3 */ 3, {0x252c, 0x385e, 0x2333}}, {HN_GA5DAN, DIC_SJ3, /* Ga5-4 */ 3, {0x252c, 0x385e, 0x2334}}, {HN_GA5DAN, DIC_SJ3, /* Ga5-5 */ 3, {0x252c, 0x385e, 0x2335}}, {HN_GA5DAN, DIC_SJ3, /* Ga5-6 */ 3, {0x252c, 0x385e, 0x2336}}, {HN_GA5DAN, DIC_SJ3, /* Ga5-7 */ 3, {0x252c, 0x385e, 0x2337}}, {HN_GA5DAN, DIC_SJ3, /* Ga5-8 */ 3, {0x252c, 0x385e, 0x2338}}, {HN_SA5DAN, DIC_WNN, /* SaGyou5Dan */ 4, {0x2535, 0x3954, 0x385e, 0x434a}}, {HN_SA5DAN, DIC_CANNA, /* #S5 */ 3, {'#', 'S', '5'}}, {HN_SA5DAN, DIC_CANNA, /* #S5r */ 4, {'#', 'S', '5', 'r'}}, {HN_SA5DAN, DIC_SJ3, /* Sa5-1 */ 3, {0x2535, 0x385e, 0x2331}}, {HN_SA5DAN, DIC_SJ3, /* Sa5-2 */ 3, {0x2535, 0x385e, 0x2332}}, {HN_SA5DAN, DIC_SJ3, /* Sa5-3 */ 3, {0x2535, 0x385e, 0x2333}}, {HN_SA5DAN, DIC_SJ3, /* Sa5-4 */ 3, {0x2535, 0x385e, 0x2334}}, {HN_SA5DAN, DIC_SJ3, /* Sa5-5 */ 3, {0x2535, 0x385e, 0x2335}}, {HN_SA5DAN, DIC_SJ3, /* Sa5-6 */ 3, {0x2535, 0x385e, 0x2336}}, {HN_SA5DAN, DIC_SJ3, /* Sa5-7 */ 3, {0x2535, 0x385e, 0x2337}}, {HN_SA5DAN, DIC_SJ3, /* Sa5-8 */ 3, {0x2535, 0x385e, 0x2338}}, {HN_TA5DAN, DIC_WNN, /* TaGyou5Dan */ 4, {0x253f, 0x3954, 0x385e, 0x434a}}, {HN_TA5DAN, DIC_CANNA, /* #T5 */ 3, {'#', 'T', '5'}}, {HN_TA5DAN, DIC_CANNA, /* #T5r */ 4, {'#', 'T', '5', 'r'}}, {HN_TA5DAN, DIC_SJ3, /* Ta5-1 */ 3, {0x253f, 0x385e, 0x2331}}, {HN_TA5DAN, DIC_SJ3, /* Ta5-2 */ 3, {0x253f, 0x385e, 0x2332}}, {HN_TA5DAN, DIC_SJ3, /* Ta5-3 */ 3, {0x253f, 0x385e, 0x2333}}, {HN_TA5DAN, DIC_SJ3, /* Ta5-4 */ 3, {0x253f, 0x385e, 0x2334}}, {HN_TA5DAN, DIC_SJ3, /* Ta5-5 */ 3, {0x253f, 0x385e, 0x2335}}, {HN_TA5DAN, DIC_SJ3, /* Ta5-6 */ 3, {0x253f, 0x385e, 0x2336}}, {HN_TA5DAN, DIC_SJ3, /* Ta5-7 */ 3, {0x253f, 0x385e, 0x2337}}, {HN_TA5DAN, DIC_SJ3, /* Ta5-8 */ 3, {0x253f, 0x385e, 0x2338}}, {HN_NA5DAN, DIC_WNN, /* NaGyou5Dan */ 4, {0x254a, 0x3954, 0x385e, 0x434a}}, {HN_NA5DAN, DIC_CANNA, /* #N5 */ 3, {'#', 'N', '5'}}, {HN_NA5DAN, DIC_SJ3, /* Na5 */ 2, {0x254a, 0x385e}}, {HN_BA5DAN, DIC_WNN, /* BaGyou5Dan */ 4, {0x2550, 0x3954, 0x385e, 0x434a}}, {HN_BA5DAN, DIC_CANNA, /* #B5 */ 3, {'#', 'B', '5'}}, {HN_BA5DAN, DIC_CANNA, /* #B5r */ 4, {'#', 'B', '5', 'r'}}, {HN_BA5DAN, DIC_SJ3, /* Ba5-1 */ 3, {0x2550, 0x385e, 0x2331}}, {HN_BA5DAN, DIC_SJ3, /* Ba5-2 */ 3, {0x2550, 0x385e, 0x2332}}, {HN_BA5DAN, DIC_SJ3, /* Ba5-3 */ 3, {0x2550, 0x385e, 0x2333}}, {HN_BA5DAN, DIC_SJ3, /* Ba5-4 */ 3, {0x2550, 0x385e, 0x2334}}, {HN_BA5DAN, DIC_SJ3, /* Ba5-5 */ 3, {0x2550, 0x385e, 0x2335}}, {HN_BA5DAN, DIC_SJ3, /* Ba5-6 */ 3, {0x2550, 0x385e, 0x2336}}, {HN_BA5DAN, DIC_SJ3, /* Ba5-7 */ 3, {0x2550, 0x385e, 0x2337}}, {HN_BA5DAN, DIC_SJ3, /* Ba5-8 */ 3, {0x2550, 0x385e, 0x2338}}, {HN_MA5DAN, DIC_WNN, /* MaGyou5Dan */ 4, {0x255e, 0x3954, 0x385e, 0x434a}}, {HN_MA5DAN, DIC_CANNA, /* #M5 */ 3, {'#', 'M', '5'}}, {HN_MA5DAN, DIC_CANNA, /* #M5r */ 4, {'#', 'M', '5', 'r'}}, {HN_MA5DAN, DIC_SJ3, /* Ma5-1 */ 3, {0x255e, 0x385e, 0x2331}}, {HN_MA5DAN, DIC_SJ3, /* Ma5-2 */ 3, {0x255e, 0x385e, 0x2332}}, {HN_MA5DAN, DIC_SJ3, /* Ma5-3 */ 3, {0x255e, 0x385e, 0x2333}}, {HN_MA5DAN, DIC_SJ3, /* Ma5-4 */ 3, {0x255e, 0x385e, 0x2334}}, {HN_MA5DAN, DIC_SJ3, /* Ma5-5 */ 3, {0x255e, 0x385e, 0x2335}}, {HN_MA5DAN, DIC_SJ3, /* Ma5-6 */ 3, {0x255e, 0x385e, 0x2336}}, {HN_MA5DAN, DIC_SJ3, /* Ma5-7 */ 3, {0x255e, 0x385e, 0x2337}}, {HN_MA5DAN, DIC_SJ3, /* Ma5-8 */ 3, {0x255e, 0x385e, 0x2338}}, {HN_RA5DAN, DIC_WNN, /* RaGyou5Dan */ 4, {0x2569, 0x3954, 0x385e, 0x434a}}, {HN_RA5DAN, DIC_CANNA, /* #R5 */ 3, {'#', 'R', '5'}}, {HN_RA5DAN, DIC_CANNA, /* #R5r */ 4, {'#', 'R', '5', 'r'}}, {HN_RA5DAN, DIC_SJ3, /* Ra5-1 */ 3, {0x2569, 0x385e, 0x2331}}, {HN_RA5DAN, DIC_SJ3, /* Ra5-2 */ 3, {0x2569, 0x385e, 0x2332}}, {HN_RA5DAN, DIC_SJ3, /* Ra5-3 */ 3, {0x2569, 0x385e, 0x2333}}, {HN_RA5DAN, DIC_SJ3, /* Ra5-4 */ 3, {0x2569, 0x385e, 0x2334}}, {HN_RA5DAN, DIC_SJ3, /* Ra5-5 */ 3, {0x2569, 0x385e, 0x2335}}, {HN_RA5DAN, DIC_SJ3, /* Ra5-6 */ 3, {0x2569, 0x385e, 0x2336}}, {HN_RA5DAN, DIC_SJ3, /* Ra5-7 */ 3, {0x2569, 0x385e, 0x2337}}, {HN_RA5DAN, DIC_SJ3, /* Ra5-8 */ 3, {0x2569, 0x385e, 0x2338}}, {HN_WA5DAN, DIC_WNN, /* WaGyou5Dan */ 4, {0x256f, 0x3954, 0x385e, 0x434a}}, {HN_WA5DAN, DIC_CANNA, /* #W5 */ 3, {'#', 'W', '5'}}, {HN_WA5DAN, DIC_CANNA, /* #W5r */ 4, {'#', 'W', '5', 'r'}}, {HN_WA5DAN, DIC_SJ3, /* Wa5-1 */ 3, {0x256f, 0x385e, 0x2331}}, {HN_WA5DAN, DIC_SJ3, /* Wa5-2 */ 3, {0x256f, 0x385e, 0x2332}}, {HN_WA5DAN, DIC_SJ3, /* Wa5-3 */ 3, {0x256f, 0x385e, 0x2333}}, {HN_WA5DAN, DIC_SJ3, /* Wa5-4 */ 3, {0x256f, 0x385e, 0x2334}}, {HN_WA5DAN, DIC_SJ3, /* Wa5-5 */ 3, {0x256f, 0x385e, 0x2335}}, {HN_WA5DAN, DIC_SJ3, /* Wa5-6 */ 3, {0x256f, 0x385e, 0x2336}}, {HN_WA5DAN, DIC_SJ3, /* Wa5-7 */ 3, {0x256f, 0x385e, 0x2337}}, {HN_WA5DAN, DIC_SJ3, /* Wa5-8 */ 3, {0x256f, 0x385e, 0x2338}}, {HN_1DAN, DIC_WNN, /* 1Dan */ 2, {0x306c, 0x434a}}, {HN_1DAN, DIC_CANNA, /* #KS */ 3, {'#', 'K', 'S'}}, {HN_1DAN, DIC_SJ3, /* 1Dan1 */ 3, {0x306c, 0x434a, 0x2331}}, {HN_1DAN, DIC_SJ3, /* 1Dan2 */ 3, {0x306c, 0x434a, 0x2332}}, {HN_1DAN, DIC_SJ3, /* 1Dan3 */ 3, {0x306c, 0x434a, 0x2333}}, {HN_1DAN, DIC_SJ3, /* 1Dan4 */ 3, {0x306c, 0x434a, 0x2334}}, {HN_1_MEI, DIC_WNN, /* 1Dan&Meishi */ 5, {0x306c, 0x434a, '&', 0x4c3e, 0x3b6c}}, {HN_1_MEI, DIC_CANNA, /* #KSr */ 4, {'#', 'K', 'S', 'r'}}, {HN_KA_IKU, DIC_WNN, /* KaGyou(Iku) */ 6, {0x252b, 0x3954, '(', 0x3954, 0x242f, ')'}}, {HN_KA_IKU, DIC_CANNA, /* #C5r */ 4, {'#', 'C', '5', 'r'}}, {HN_KA_IKU, DIC_SJ3, /* Ka5Onbin */ 4, {0x252b, 0x385e, 0x323b, 0x4a58}}, {HN_KO_KO, DIC_WNN, /* Ko(Ko) */ 4, {0x4d68, '(', 0x2433, ')'}}, {HN_KO_KO, DIC_CANNA, /* #kxo */ 4, {'#', 'k', 'x', 'o'}}, {HN_KO_KO, DIC_CANNA, /* #kxoi */ 5, {'#', 'k', 'x', 'o', 'i'}}, {HN_KO_KO, DIC_SJ3, /* KaHenMi */ 3, {0x252b, 0x4a51, 0x4c24}}, {HN_KO_KO, DIC_SJ3, /* KaHenMei */ 3, {0x252b, 0x4a51, 0x4c3f}}, {HN_KI_KI, DIC_WNN, /* Ki(Ki) */ 4, {0x4d68, '(', 0x242d, ')'}}, {HN_KI_KI, DIC_CANNA, /* #kxi */ 4, {'#', 'k', 'x', 'i'}}, {HN_KI_KI, DIC_SJ3, /* KaHenYou */ 3, {0x252b, 0x4a51, 0x4d51}}, {HN_KU_KU, DIC_WNN, /* Ku(Ku) */ 4, {0x4d68, '(', 0x242f, ')'}}, {HN_KU_KU, DIC_CANNA, /* #kxuru */ 6, {'#', 'k', 'x', 'u', 'r', 'u'}}, {HN_KU_KU, DIC_CANNA, /* #kxure */ 6, {'#', 'k', 'x', 'u', 'r', 'e'}}, {HN_KU_KU, DIC_SJ3, /* KaHenKa */ 3, {0x252b, 0x4a51, 0x323e}}, {HN_KU_KU, DIC_SJ3, /* KaHenShuuTai */ 4, {0x252b, 0x4a51, 0x3d2a, 0x424e}}, {HN_SAHEN, DIC_WNN, /* SaGyou(Suru) */ 6, {0x2535, 0x3954, '(', 0x2439, 0x246b, ')'}}, {HN_SAHEN, DIC_CANNA, /* #T10 */ 4, {'#', 'T', '1', '0'}}, {HN_SAHEN, DIC_CANNA, /* #T11 */ 4, {'#', 'T', '1', '1'}}, {HN_SAHEN, DIC_CANNA, /* #T12 */ 4, {'#', 'T', '1', '2'}}, {HN_SAHEN, DIC_CANNA, /* #SX */ 3, {'#', 'S', 'X'}}, {HN_SAHEN, DIC_SJ3, /* SaHen */ 2, {0x2535, 0x4a51}}, {HN_ZAHEN, DIC_WNN, /* ZaGyou(Zuru) */ 6, {0x2536, 0x3954, '(', 0x243a, 0x246b, ')'}}, {HN_ZAHEN, DIC_CANNA, /* #ZX */ 3, {'#', 'Z', 'X'}}, {HN_ZAHEN, DIC_SJ3, /* ZaHen */ 2, {0x2536, 0x4a51}}, {HN_SA_MEI, DIC_WNN, /* SaGyou(Suru)&Meishi */ 9, {0x2535, 0x3954, '(', 0x2439, 0x246b, ')', '&', 0x4c3e, 0x3b6c}}, {HN_SA_MEI, DIC_CANNA, /* #T00 */ 4, {'#', 'T', '0', '0'}}, {HN_SA_MEI, DIC_CANNA, /* #T30 */ 4, {'#', 'T', '3', '0'}}, {HN_SA_MEI, DIC_SJ3, /* Mei8 */ 2, {0x4c3e, 0x2338}}, {HN_SI_SI, DIC_WNN, /* Shi(Shi) */ 4, {0x3059, '(', 0x2437, ')'}}, {HN_SI_SI, DIC_CANNA, /* #sxi */ 4, {'#', 's', 'x', 'i'}}, {HN_SI_SI, DIC_SJ3, /* SaHenMiYou */ 4, {0x2535, 0x4a51, 0x4c24, 0x4d51}}, {HN_SU_SU, DIC_WNN, /* Su(Su) */ 4, {0x3059, '(', 0x2439, ')'}}, {HN_SU_SU, DIC_CANNA, /* #sxuru */ 6, {'#', 's', 'x', 'u', 'r', 'u'}}, {HN_SU_SU, DIC_CANNA, /* #sxu1 */ 5, {'#', 's', 'x', 'u', '1'}}, {HN_SU_SU, DIC_SJ3, /* SaHenKa */ 3, {0x2535, 0x4a51, 0x323e}}, {HN_SU_SU, DIC_SJ3, /* SaHenShuuTai */ 4, {0x2535, 0x4a51, 0x3d2a, 0x424e}}, {HN_SE_SE, DIC_WNN, /* Se(Se) */ 4, {0x3059, '(', 0x243b, ')'}}, {HN_SE_SE, DIC_CANNA, /* #sxe */ 4, {'#', 's', 'x', 'e'}}, {HN_SE_SE, DIC_SJ3, /* SaHenMi2 */ 4, {0x2535, 0x4a51, 0x4c24, 0x2332}}, {HN_SE_SE, DIC_SJ3, /* SaHenMei2 */ 4, {0x2535, 0x4a51, 0x4c3f, 0x2332}}, {HN_RA_KUD, DIC_WNN, /* RaGyou(Kudasai) */ 7, {0x2569, 0x3954, '(', 0x323c, 0x2435, 0x2424, ')'}}, {HN_RA_KUD, DIC_CANNA, /* #L5 */ 3, {'#', 'L', '5'}}, {HN_KEIYOU, DIC_WNN, /* Keiyoushi */ 3, {0x3741, 0x4d46, 0x3b6c}}, {HN_KEIYOU, DIC_CANNA, /* #KY */ 3, {'#', 'K', 'Y'}}, {HN_KEIYOU, DIC_CANNA, /* #KYmi */ 5, {'#', 'K', 'Y', 'm', 'i'}}, {HN_KEIYOU, DIC_CANNA, /* #KYU */ 4, {'#', 'K', 'Y', 'U'}}, {HN_KEIYOU, DIC_SJ3, /* Kei1 */ 2, {0x3741, 0x2331}}, {HN_KEIYOU, DIC_SJ3, /* Kei2 */ 2, {0x3741, 0x2332}}, {HN_KEIYOU, DIC_SJ3, /* Kei3 */ 2, {0x3741, 0x2333}}, {HN_KEIYOU, DIC_SJ3, /* Kei4 */ 2, {0x3741, 0x2334}}, {HN_KEIYOU, DIC_SJ3, /* Kei5 */ 2, {0x3741, 0x2335}}, {HN_KEIYOU, DIC_SJ3, /* Kei6 */ 2, {0x3741, 0x2336}}, {HN_KEIYOU, DIC_SJ3, /* Kei7 */ 2, {0x3741, 0x2337}}, {HN_KEIYOU, DIC_SJ3, /* Kei8 */ 2, {0x3741, 0x2338}}, {HN_KEIYOU, DIC_SJ3, /* Kei9 */ 2, {0x3741, 0x2339}}, {HN_KEIYOU, DIC_SJ3, /* Kei10 */ 3, {0x3741, 0x2331, 0x2330}}, {HN_KEIYOU, DIC_SJ3, /* Kei11 */ 3, {0x3741, 0x2331, 0x2331}}, {HN_KEIDOU, DIC_WNN, /* KeiyouDoushi */ 4, {0x3741, 0x4d46, 0x4630, 0x3b6c}}, {HN_KEIDOU, DIC_CANNA, /* #T02 */ 4, {'#', 'T', '0', '2'}}, {HN_KEIDOU, DIC_CANNA, /* #T03 */ 4, {'#', 'T', '0', '3'}}, {HN_KEIDOU, DIC_CANNA, /* #T07 */ 4, {'#', 'T', '0', '7'}}, {HN_KEIDOU, DIC_CANNA, /* #T08 */ 4, {'#', 'T', '0', '8'}}, {HN_KEIDOU, DIC_CANNA, /* #T16 */ 4, {'#', 'T', '1', '6'}}, {HN_KEIDOU, DIC_CANNA, /* #T17 */ 4, {'#', 'T', '1', '7'}}, {HN_KEIDOU, DIC_CANNA, /* #T18 */ 4, {'#', 'T', '1', '8'}}, {HN_KEIDOU, DIC_CANNA, /* #T19 */ 4, {'#', 'T', '1', '9'}}, {HN_KEIDOU, DIC_SJ3, /* KeiDou1 */ 3, {0x3741, 0x4630, 0x2331}}, {HN_KEIDOU, DIC_SJ3, /* KeiDou3 */ 3, {0x3741, 0x4630, 0x2333}}, {HN_KEIDOU, DIC_SJ3, /* KeiDou4 */ 3, {0x3741, 0x4630, 0x2334}}, {HN_KEIDOU, DIC_SJ3, /* KeiDou5 */ 3, {0x3741, 0x4630, 0x2335}}, {HN_KEIDOU, DIC_SJ3, /* KeiDou6 */ 3, {0x3741, 0x4630, 0x2336}}, {HN_KEIDOU, DIC_SJ3, /* KeiDou7 */ 3, {0x3741, 0x4630, 0x2337}}, {HN_KEIDOU, DIC_SJ3, /* KeiDou8 */ 3, {0x3741, 0x4630, 0x2338}}, {HN_KEIDOU, DIC_SJ3, /* KeiDou9 */ 3, {0x3741, 0x4630, 0x2339}}, {HN_KD_MEI, DIC_WNN, /* KeiyouDoushi&Meishi */ 7, {0x3741, 0x4d46, 0x4630, 0x3b6c, '&', 0x4c3e, 0x3b6c}}, {HN_KD_MEI, DIC_CANNA, /* #T05 */ 4, {'#', 'T', '0', '5'}}, {HN_KD_MEI, DIC_CANNA, /* #T15 */ 4, {'#', 'T', '1', '5'}}, {HN_KD_TAR, DIC_WNN, /* KeiyouDoushi(Taru) */ 8, {0x3741, 0x4d46, 0x4630, 0x3b6c, '(', 0x243f, 0x246b, ')'}}, {HN_KD_TAR, DIC_CANNA, /* #F00 */ 4, {'#', 'F', '0', '0'}}, {HN_KD_TAR, DIC_CANNA, /* #F01 */ 4, {'#', 'F', '0', '1'}}, {HN_KD_TAR, DIC_CANNA, /* #F02 */ 4, {'#', 'F', '0', '2'}}, {HN_KD_TAR, DIC_CANNA, /* #F03 */ 4, {'#', 'F', '0', '3'}}, {HN_KD_TAR, DIC_CANNA, /* #F05 */ 4, {'#', 'F', '0', '5'}}, {HN_KD_TAR, DIC_CANNA, /* #F06 */ 4, {'#', 'F', '0', '6'}}, {HN_KD_TAR, DIC_CANNA, /* #F09 */ 4, {'#', 'F', '0', '9'}}, {HN_KD_TAR, DIC_CANNA, /* #F10 */ 4, {'#', 'F', '1', '0'}}, {HN_KD_TAR, DIC_CANNA, /* #F11 */ 4, {'#', 'F', '1', '1'}}, {HN_KD_TAR, DIC_SJ3, /* KeiDou2 */ 3, {0x3741, 0x4630, 0x2332}}, {HN_FUKUSI, DIC_WNN, /* Fukushi */ 2, {0x497b, 0x3b6c}}, {HN_FUKUSI, DIC_CANNA, /* #T06 */ 4, {'#', 'T', '0', '6'}}, {HN_FUKUSI, DIC_CANNA, /* #T26 */ 4, {'#', 'T', '2', '6'}}, {HN_FUKUSI, DIC_CANNA, /* #T31 */ 4, {'#', 'T', '3', '1'}}, {HN_FUKUSI, DIC_CANNA, /* #T32 */ 4, {'#', 'T', '3', '2'}}, {HN_FUKUSI, DIC_CANNA, /* #T36 */ 4, {'#', 'T', '3', '6'}}, {HN_FUKUSI, DIC_CANNA, /* #F04 */ 4, {'#', 'F', '0', '4'}}, {HN_FUKUSI, DIC_CANNA, /* #F12 */ 4, {'#', 'F', '1', '2'}}, {HN_FUKUSI, DIC_CANNA, /* #F14 */ 4, {'#', 'F', '1', '4'}}, {HN_FUKUSI, DIC_CANNA, /* #F15 */ 4, {'#', 'F', '1', '5'}}, {HN_FUKUSI, DIC_SJ3, /* TokushuFuku */ 3, {0x4643, 0x3c6c, 0x497b}}, {HN_FUKUSI, DIC_SJ3, /* Fuku1 */ 2, {0x497b, 0x2331}}, {HN_FUKUSI, DIC_SJ3, /* Fuku2 */ 2, {0x497b, 0x2332}}, {HN_FUKUSI, DIC_SJ3, /* Fuku3 */ 2, {0x497b, 0x2333}}, {HN_FUKUSI, DIC_SJ3, /* Fuku4 */ 2, {0x497b, 0x2334}}, {HN_FUKUSI, DIC_SJ3, /* Fuku5 */ 2, {0x497b, 0x2335}}, {HN_FUKUSI, DIC_SJ3, /* Fuku6 */ 2, {0x497b, 0x2336}}, {HN_FUKUSI, DIC_SJ3, /* Fuku7 */ 2, {0x497b, 0x2337}}, {HN_FUKUSI, DIC_SJ3, /* Fuku8 */ 2, {0x497b, 0x2338}}, {HN_FUKUSI, DIC_SJ3, /* Fuku9 */ 2, {0x497b, 0x2339}}, {HN_RENTAI, DIC_WNN, /* Rentaishi */ 3, {0x4f22, 0x424e, 0x3b6c}}, {HN_RENTAI, DIC_CANNA, /* #RT */ 3, {'#', 'R', 'T'}}, {HN_RENTAI, DIC_SJ3, /* Rentai */ 2, {0x4f22, 0x424e}}, {HN_SETKAN, DIC_WNN, /* Setsuzokushi,Kandoushi */ 7, {0x405c, 0x4233, 0x3b6c, ',', 0x3436, 0x4630, 0x3b6c}}, {HN_SETKAN, DIC_CANNA, /* #CJ */ 3, {'#', 'C', 'J'}}, {HN_SETKAN, DIC_SJ3, /* Aisatsu */ 2, {0x3027, 0x3b22}}, {HN_SETKAN, DIC_SJ3, /* Kandou */ 2, {0x3436, 0x4630}}, {HN_SETKAN, DIC_SJ3, /* Setsuzoku */ 2, {0x405c, 0x4233}}, {HN_TANKAN, DIC_WNN, /* TanKanji */ 3, {0x4331, 0x3441, 0x3b7a}}, {HN_TANKAN, DIC_CANNA, /* #KJ */ 3, {'#', 'K', 'J'}}, {HN_TANKAN, DIC_CANNA, /* #TK */ 3, {'#', 'T', 'K'}}, {HN_TANKAN, DIC_SJ3, /* TanKan */ 2, {0x4331, 0x3441}}, {HN_SETTOU, DIC_WNN, /* Settougo */ 3, {0x405c, 0x462c, 0x386c}}, {HN_SETTOU, DIC_CANNA, /* #PRE */ 4, {'#', 'P', 'R', 'E'}}, {HN_SETTOU, DIC_SJ3, /* Settou1 */ 3, {0x405c, 0x462c, 0x2331}}, {HN_SETTOU, DIC_SJ3, /* Settou3 */ 3, {0x405c, 0x462c, 0x2333}}, {HN_SETTOU, DIC_SJ3, /* Settou5 */ 3, {0x405c, 0x462c, 0x2335}}, {HN_SETUBI, DIC_WNN, /* Setsubigo */ 3, {0x405c, 0x4878, 0x386c}}, {HN_SETUBI, DIC_CANNA, /* #N2T10 */ 6, {'#', 'N', '2', 'T', '1', '0'}}, {HN_SETUBI, DIC_CANNA, /* #N2KS */ 5, {'#', 'N', '2', 'K', 'S'}}, {HN_SETUBI, DIC_CANNA, /* #SUC */ 4, {'#', 'S', 'U', 'C'}}, {HN_SETUBI, DIC_SJ3, /* Setsubi1 */ 3, {0x405c, 0x4878, 0x2331}}, {HN_SETUBI, DIC_SJ3, /* Setsubi2 */ 3, {0x405c, 0x4878, 0x2332}}, {HN_SETUBI, DIC_SJ3, /* Setsubi3 */ 3, {0x405c, 0x4878, 0x2333}}, {HN_SETUBI, DIC_SJ3, /* Setsubi8 */ 3, {0x405c, 0x4878, 0x2338}}, {HN_SETUBI, DIC_SJ3, /* Setsubi9 */ 3, {0x405c, 0x4878, 0x2339}}, {HN_SETOSU, DIC_WNN, /* SettouSuushi */ 4, {0x405c, 0x462c, 0x3f74, 0x3b6c}}, {HN_SETOSU, DIC_CANNA, /* #NNPRE */ 6, {'#', 'N', 'N', 'P', 'R', 'E'}}, {HN_SETOSU, DIC_SJ3, /* Settou4 */ 3, {0x405c, 0x462c, 0x2334}}, {HN_JOSUU, DIC_WNN, /* JoSuushi */ 3, {0x3d75, 0x3f74, 0x3b6c}}, {HN_JOSUU, DIC_CANNA, /* #JS */ 3, {'#', 'J', 'S'}}, {HN_JOSUU, DIC_SJ3, /* Josuu */ 2, {0x3d75, 0x3f74}}, {HN_JOSUU, DIC_SJ3, /* Josuu2 */ 3, {0x3d75, 0x3f74, 0x2332}}, {HN_SETOJO, DIC_WNN, /* SettouJoSuushi */ 5, {0x405c, 0x462c, 0x3d75, 0x3f74, 0x3b6c}}, {HN_SETUJO, DIC_WNN, /* SetsubiJoSuushi */ 5, {0x405c, 0x4878, 0x3d75, 0x3f74, 0x3b6c}}, {HN_SETUJO, DIC_CANNA, /* #JSSUC */ 6, {'#', 'J', 'S', 'S', 'U', 'C'}}, {HN_SETUJN, DIC_WNN, /* SetsubiJinmei */ 4, {0x405c, 0x4878, 0x3f4d, 0x4c3e}}, {HN_SETUJN, DIC_CANNA, /* #JNSUC */ 6, {'#', 'J', 'N', 'S', 'U', 'C'}}, {HN_SETOCH, DIC_WNN, /* SettouChimei */ 4, {0x405c, 0x462c, 0x434f, 0x4c3e}}, {HN_SETOCH, DIC_CANNA, /* #CNPRE */ 6, {'#', 'C', 'N', 'P', 'R', 'E'}}, {HN_SETOCH, DIC_SJ3, /* Settou2 */ 3, {0x405c, 0x462c, 0x2332}}, {HN_SETUCH, DIC_WNN, /* SetsubiChimei */ 4, {0x405c, 0x4878, 0x434f, 0x4c3e}}, {HN_SETUCH, DIC_CANNA, /* #CNSUC1 */ 7, {'#', 'C', 'N', 'S', 'U', 'C', '1'}}, {HN_SETUCH, DIC_SJ3, /* Setsubi4 */ 3, {0x405c, 0x4878, 0x2334}}, {HN_SETO_O, DIC_WNN, /* Settougo(O) */ 6, {0x405c, 0x462c, 0x386c, '(', 0x242a, ')'}}, {HN_SETO_K, DIC_WNN, /* Settougo(Kaku) */ 6, {0x405c, 0x462c, 0x386c, '(', 0x3346, ')'}}, {HN_KD_STB, DIC_WNN, /* KeiyouDoushiKaSetsubigo */ 8, {0x3741, 0x4d46, 0x4630, 0x3b6c, 0x323d, 0x405c, 0x4878, 0x386c}}, {HN_KD_STB, DIC_CANNA, /* #N2T15 */ 6, {'#', 'N', '2', 'T', '1', '5'}}, {HN_KD_STB, DIC_CANNA, /* #N2T16 */ 6, {'#', 'N', '2', 'T', '1', '6'}}, {HN_KD_STB, DIC_CANNA, /* #N2T17 */ 6, {'#', 'N', '2', 'T', '1', '7'}}, {HN_KD_STB, DIC_CANNA, /* #N2KYT */ 6, {'#', 'N', '2', 'K', 'Y', 'T'}}, {HN_KD_STB, DIC_SJ3, /* Setsubi6 */ 3, {0x405c, 0x4878, 0x2336}}, {HN_SA_M_S, DIC_WNN, /* SaGyou(Suru)&MeishiKaSetsubigo */ 13, {0x2535, 0x3954, '(', 0x2439, 0x246b, ')', '&', 0x4c3e, 0x3b6c, 0x323d, 0x405c, 0x4878, 0x386c}}, {HN_SA_M_S, DIC_CANNA, /* #N2T30 */ 6, {'#', 'N', '2', 'T', '3', '0'}}, {HN_SA_M_S, DIC_SJ3, /* Setsubi7 */ 3, {0x405c, 0x4878, 0x2337}}, {HN_SETUDO, DIC_WNN, /* SetsubiDoushi */ 4, {0x405c, 0x4878, 0x4630, 0x3b6c}}, {HN_SETUDO, DIC_CANNA, /* #D2T35 */ 6, {'#', 'D', '2', 'T', '3', '5'}}, {HN_KE_SED, DIC_WNN, /* KeiyoushiKaSetsubiDoushi */ 8, {0x3741, 0x4d46, 0x3b6c, 0x323d, 0x405c, 0x4878, 0x4630, 0x3b6c}}, {HN_KE_SED, DIC_CANNA, /* #D2KY */ 5, {'#', 'D', '2', 'K', 'Y'}}, {HN_KE_SED, DIC_SJ3, /* Setsubi5 */ 3, {0x405c, 0x4878, 0x2335}}, {HN_MAX, DIC_CANNA, /* #sxa */ 4, {'#', 's', 'x', 'a'}}, {HN_MAX, DIC_CANNA, /* #sxiro */ 6, {'#', 's', 'x', 'i', 'r', 'o'}}, {HN_MAX, DIC_SJ3, /* SaHenMi1 */ 4, {0x2535, 0x4a51, 0x4c24, 0x2331}}, {HN_MAX, DIC_SJ3, /* SaHenMei1 */ 4, {0x2535, 0x4a51, 0x4c3f, 0x2331}}, }; #define HINSILISTSIZ arraysize(hinsilist) static CONST contable jirconlist[] = { /* Sentou */ {HN_SENTOU, 0, {0}, 1, {HN_SENTOU}}, /* Suuji */ {HN_SUUJI, 0, {0}, 4, {HN_SENTOU, HN_SUUJI, HN_SUUSHI, HN_SETOSU}}, /* Kana */ {HN_KANA, 0, {0}, 1, {HN_SENTOU}}, /* EiSuu */ {HN_EISUU, 0, {0}, 2, {HN_SENTOU, HN_KIGOU}}, /* Kigou */ {HN_KIGOU, 0, {0}, 3, {HN_SENTOU, HN_EISUU, HN_KIGOU}}, /* HeiKakko */ {HN_HEIKAKKO, 0, {0}, 1, {HN_SENTOU}}, /* Fuzokugo */ {HN_FUZOKUGO, 0, {0}, 1, {HN_SENTOU}}, /* KaiKakko */ {HN_KAIKAKKO, 0, {0}, 1, {HN_SENTOU}}, /* Giji */ {HN_GIJI, 0, {0}, 1, {HN_SENTOU}}, /* Meishi */ {HN_MEISHI, 0, {0}, 3, {HN_SENTOU, HN_SETTOU, HN_SETO_K}}, /* Jinmei */ {HN_JINMEI, 0, {0}, 1, {HN_SENTOU}}, /* Chimei */ {HN_CHIMEI, 0, {0}, 2, {HN_SENTOU, HN_SETOCH}}, /* KoyuuMeishi */ {HN_KOYUU, 0, {0}, 2, {HN_SENTOU, HN_SETTOU}}, /* Suushi */ {HN_SUUSHI, 0, {0}, 4, {HN_SENTOU, HN_SUUJI, HN_SUUSHI, HN_SETOSU}}, /* KaDouKan */ {HN_KA5DOU, 0, {0}, 1, {HN_SENTOU}}, /* GaDouKan */ {HN_GA5DOU, 0, {0}, 1, {HN_SENTOU}}, /* SaDouKan */ {HN_SA5DOU, 0, {0}, 1, {HN_SENTOU}}, /* TaDouKan */ {HN_TA5DOU, 0, {0}, 1, {HN_SENTOU}}, /* NaDouKan */ {HN_NA5DOU, 0, {0}, 1, {HN_SENTOU}}, /* BaDouKan */ {HN_BA5DOU, 0, {0}, 1, {HN_SENTOU}}, /* MaDouKan */ {HN_MA5DOU, 0, {0}, 1, {HN_SENTOU}}, /* RaDouKan */ {HN_RA5DOU, 0, {0}, 1, {HN_SENTOU}}, /* WaDouKan */ {HN_WA5DOU, 0, {0}, 1, {HN_SENTOU}}, /* 1DouKan */ {HN_1DOU, 0, {0}, 1, {HN_SENTOU}}, /* SaHenDouKan */ {HN_SAHDOU, 0, {0}, 1, {HN_SENTOU}}, /* ZaHenDouKan */ {HN_ZAHDOU, 0, {0}, 1, {HN_SENTOU}}, /* KaDouRenyouKan */ {HN_KA5YOU, 0, {0}, 1, {HN_SETO_O}}, /* GaDouRenyouKan */ {HN_GA5YOU, 0, {0}, 1, {HN_SETO_O}}, /* SaDouRenyouKan */ {HN_SA5YOU, 0, {0}, 1, {HN_SETO_O}}, /* TaDouRenyouKan */ {HN_TA5YOU, 0, {0}, 1, {HN_SETO_O}}, /* NaDouRenyouKan */ {HN_NA5YOU, 0, {0}, 1, {HN_SETO_O}}, /* BaDouRenyouKan */ {HN_BA5YOU, 0, {0}, 1, {HN_SETO_O}}, /* MaDouRenyouKan */ {HN_MA5YOU, 0, {0}, 1, {HN_SETO_O}}, /* RaDouRenyouKan */ {HN_RA5YOU, 0, {0}, 1, {HN_SETO_O}}, /* WaDouRenyouKan */ {HN_WA5YOU, 0, {0}, 1, {HN_SETO_O}}, /* 1DouRenyouKan */ {HN_1YOU, 0, {0}, 1, {HN_SETO_O}}, /* SaHenDouRenyouKan */ {HN_SAHYOU, 0, {0}, 1, {HN_SETO_O}}, /* ZaHenDouRenyouKan */ {HN_ZAHYOU, 0, {0}, 1, {HN_SETO_O}}, /* KaGyou(Iku) */ {HN_KA_IKU, 0, {0}, 1, {HN_SENTOU}}, /* Ko(Ko) */ {HN_KO_KO, 0, {0}, 1, {HN_SENTOU}}, /* Ki(Ki) */ {HN_KI_KI, 0, {0}, 1, {HN_SENTOU}}, /* Ku(Ku) */ {HN_KU_KU, 0, {0}, 1, {HN_SENTOU}}, /* SaGyou(Suru)&Meishi */ {HN_SA_MEI, 0, {0}, 3, {HN_SENTOU, HN_SETTOU, HN_SETO_K}}, /* Shi(Shi) */ {HN_SI_SI, 0, {0}, 1, {HN_SENTOU}}, /* Su(Su) */ {HN_SU_SU, 0, {0}, 1, {HN_SENTOU}}, /* Se(Se) */ {HN_SE_SE, 0, {0}, 1, {HN_SENTOU}}, /* RaGyou(Kudasai) */ {HN_RA_KUD, 0, {0}, 1, {HN_SENTOU}}, /* Keiyoushi */ {HN_KEIYOU, 0, {0}, 2, {HN_SENTOU, HN_SETO_O}}, /* KeiyouDoushi */ {HN_KEIDOU, 0, {0}, 2, {HN_SENTOU, HN_SETO_O}}, /* KeiyouDoushi(Taru) */ {HN_KD_TAR, 0, {0}, 1, {HN_SENTOU}}, /* Fukushi */ {HN_FUKUSI, 0, {0}, 1, {HN_SENTOU}}, /* Rentaishi */ {HN_RENTAI, 0, {0}, 1, {HN_SENTOU}}, /* Setsuzokushi,Kandoushi */ {HN_SETKAN, 0, {0}, 1, {HN_SENTOU}}, /* Settougo */ {HN_SETTOU, 0, {0}, 2, {HN_SENTOU, HN_SETO_K}}, /* Setsubigo */ {HN_SETUBI, 0, {0}, 5, {HN_KANA, HN_EISUU, HN_MEISHI, HN_KOYUU, HN_SA_MEI}}, /* SettouSuushi */ {HN_SETOSU, 0, {0}, 1, {HN_SENTOU}}, /* JoSuushi */ {HN_JOSUU, 0, {0}, 3, {HN_SUUJI, HN_SUUSHI, HN_SETOJO}}, /* SettouJoSuushi */ {HN_SETOJO, 0, {0}, 2, {HN_SUUJI, HN_SUUSHI}}, /* SetsubiJoSuushi */ {HN_SETUJO, 0, {0}, 3, {HN_SUUJI, HN_SUUSHI, HN_JOSUU}}, /* SetsubiJinmei */ {HN_SETUJN, 0, {0}, 1, {HN_JINMEI}}, /* SettouChimei */ {HN_SETOCH, 0, {0}, 1, {HN_SENTOU}}, /* SetsubiChimei */ {HN_SETUCH, 0, {0}, 2, {HN_CHIMEI, HN_SETUCH}}, /* Settougo(O) */ {HN_SETO_O, 0, {0}, 1, {HN_SENTOU}}, /* Settougo(Kaku) */ {HN_SETO_K, 0, {0}, 1, {HN_SENTOU}}, /* KeiyouDoushiKaSetsubigo */ {HN_KD_STB, 0, {0}, 5, {HN_KANA, HN_EISUU, HN_MEISHI, HN_KOYUU, HN_SA_MEI}}, /* SaGyou(Suru)&MeishiKaSetsubigo */ {HN_SA_M_S, 0, {0}, 5, {HN_KANA, HN_EISUU, HN_MEISHI, HN_KOYUU, HN_SA_MEI}}, /* SetsubiDoushi */ {HN_SETUDO, 0, {0}, 27, {HN_1DOU, HN_KI_KI, HN_SI_SI, FZ_I4, FZ_I8, FZ_KANE, FZ_GARI, FZ_KI4, FZ_KI6, FZ_GI, FZ_KURE3, FZ_SASE, FZ_SARE, FZ_SHI4, FZ_SHI7, FZ_SHIME, FZ_JI2, FZ_SE4, FZ_CHI, FZ_DEKI, FZ_NI3, FZ_BI, FZ_MI, FZ_MI3, FZ_RARE, FZ_RI2, FZ_RE5}}, /* KeiyoushiKaSetsubiDoushi */ {HN_KE_SED, 0, {0}, 27, {HN_1DOU, HN_KI_KI, HN_SI_SI, FZ_I4, FZ_I8, FZ_KANE, FZ_GARI, FZ_KI4, FZ_KI6, FZ_GI, FZ_KURE3, FZ_SASE, FZ_SARE, FZ_SHI4, FZ_SHI7, FZ_SHIME, FZ_JI2, FZ_SE4, FZ_CHI, FZ_DEKI, FZ_NI3, FZ_BI, FZ_MI, FZ_MI3, FZ_RARE, FZ_RI2, FZ_RE5}}, }; #define JIRCONLISTSIZ arraysize(jirconlist) static CONST contable conlist[] = { /* KeiDouTai-Na */ {FZ_NA, 1, {0x244a}, 7, {HN_KANA, HN_EISUU, HN_KEIDOU, HN_KD_STB, FZ_SOU2, FZ_MITAI, FZ_YOU2}}, /* JoDou-Da-Tai-Na */ {FZ_NA2, 1, {0x244a}, 51, {HN_SUUJI, HN_KANA, HN_EISUU, HN_KIGOU, HN_HEIKAKKO, HN_GIJI, HN_MEISHI, HN_JINMEI, HN_CHIMEI, HN_KOYUU, HN_SUUSHI, HN_SA_MEI, HN_FUKUSI, HN_SETUBI, HN_JOSUU, HN_SETOJO, HN_SETUJO, HN_SETUJN, HN_SETUCH, HN_SA_M_S, HN_SETUDO, FZ_I4, FZ_KA3, FZ_KARA2, FZ_GARI, FZ_KI, FZ_KI4, FZ_KIRI, FZ_GI, FZ_KURAI, FZ_GURAI, FZ_GE2, FZ_KOSO, FZ_SA3, FZ_SHI4, FZ_ZUTSU, FZ_DAKE, FZ_CHI, FZ_NAZO, FZ_NADO, FZ_NI3, FZ_NOMI, FZ_BAKARI, FZ_BI, FZ_HODO, FZ_MADE, FZ_MI, FZ_MI4, FZ_ME2, FZ_YUE, FZ_RI2}}, /* KeiDou,JoDou-Da-Shi */ {FZ_DA, 1, {0x2440}, 71, {HN_SUUJI, HN_KANA, HN_EISUU, HN_KIGOU, HN_HEIKAKKO, HN_GIJI, HN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FZ_KURAI, FZ_GURAI, FZ_GE2, FZ_KOSO, FZ_SA3, FZ_SHI4, FZ_SHI5, FZ_SHI6, FZ_JI, FZ_ZUTSU, FZ_SOU2, FZ_DAKE, FZ_CHI, FZ_CHI2, FZ_NAZO, FZ_NADO, FZ_NI3, FZ_NI4, FZ_NI6, FZ_NO2, FZ_NOMI, FZ_BAKARI, FZ_BI, FZ_BI2, FZ_HODO, FZ_MADE, FZ_MI, FZ_MI2, FZ_MI4, FZ_MITAI, FZ_ME2, FZ_YUE, FZ_YOU2, FZ_RI2, FZ_RI3}}, /* JoDou-Desu-ShiTai */ {FZ_SU, 1, {0x2439}, 1, {FZ_DE3}}, /* Tari-KeiDou,JoDou-Taru,Aru-Mi */ {FZ_RA2, 1, {0x2469}, 1, {FZ_A}}, {FZ_TARA, 2, {0x243f, 0x2469}, 35, {HN_SUUJI, HN_KANA, HN_EISUU, HN_KIGOU, HN_HEIKAKKO, HN_GIJI, HN_MEISHI, HN_JINMEI, HN_CHIMEI, HN_KOYUU, HN_SUUSHI, HN_SA_MEI, HN_KD_TAR, HN_SETUBI, HN_JOSUU, HN_SETOJO, HN_SETUJO, HN_SETUJN, HN_SETUCH, HN_SA_M_S, HN_SETUDO, FZ_I4, FZ_GARI, FZ_KI4, FZ_GI, FZ_GE2, FZ_SA3, FZ_SHI4, FZ_CHI, FZ_NI3, FZ_BI, FZ_MI, FZ_MI4, FZ_ME2, FZ_RI2}}, /* Tari-KeiDouYouShi */ {FZ_TARI, 2, {0x243f, 0x246a}, 1, {HN_KD_TAR}}, /* Tari-KeiDou,JoDou-Narutaru-IMei */ {FZ_NARE, 2, {0x244a, 0x246c}, 35, {HN_SUUJI, HN_KANA, HN_EISUU, HN_KIGOU, HN_HEIKAKKO, HN_GIJI, HN_MEISHI, HN_JINMEI, HN_CHIMEI, HN_KOYUU, HN_SUUSHI, HN_SA_MEI, HN_KEIDOU, HN_SETUBI, HN_JOSUU, HN_SETOJO, HN_SETUJO, HN_SETUJN, HN_SETUCH, HN_SA_M_S, HN_SETUDO, FZ_I4, FZ_GARI, FZ_KI4, FZ_GI, FZ_GE2, FZ_SA3, FZ_SHI4, FZ_CHI, FZ_NI3, FZ_BI, FZ_MI, FZ_MI4, FZ_ME2, FZ_RI2}}, {FZ_TARE, 2, {0x243f, 0x246c}, 35, {HN_SUUJI, HN_KANA, HN_EISUU, HN_KIGOU, HN_HEIKAKKO, HN_GIJI, HN_MEISHI, HN_JINMEI, HN_CHIMEI, HN_KOYUU, HN_SUUSHI, HN_SA_MEI, HN_KD_TAR, HN_SETUBI, HN_JOSUU, HN_SETOJO, HN_SETUJO, HN_SETUJN, HN_SETUCH, HN_SA_M_S, HN_SETUDO, FZ_I4, FZ_GARI, FZ_KI4, FZ_GI, FZ_GE2, FZ_SA3, FZ_SHI4, FZ_CHI, FZ_NI3, FZ_BI, FZ_MI, FZ_MI4, FZ_ME2, FZ_RI2}}, /* JoDou-Naru-Tai */ {FZ_NARU, 2, {0x244a, 0x246b}, 35, {HN_SUUJI, HN_KANA, HN_EISUU, HN_KIGOU, HN_HEIKAKKO, HN_GIJI, HN_MEISHI, HN_JINMEI, HN_CHIMEI, HN_KOYUU, HN_SUUSHI, HN_SA_MEI, HN_KEIDOU, HN_SETUBI, HN_JOSUU, HN_SETOJO, HN_SETUJO, HN_SETUJN, HN_SETUCH, HN_SA_M_S, HN_SETUDO, FZ_I4, FZ_GARI, FZ_KI4, FZ_GI, FZ_GE2, FZ_SA3, FZ_SHI4, FZ_CHI, FZ_NI3, FZ_BI, FZ_MI, FZ_MI4, FZ_ME2, FZ_RI2}}, /* Tari-KeiDou,JoDou-Taru-Tai */ {FZ_TARU, 2, {0x243f, 0x246b}, 35, {HN_SUUJI, HN_KANA, HN_EISUU, HN_KIGOU, HN_HEIKAKKO, HN_GIJI, HN_MEISHI, HN_JINMEI, HN_CHIMEI, HN_KOYUU, HN_SUUSHI, HN_SA_MEI, HN_KD_TAR, HN_SETUBI, HN_JOSUU, HN_SETOJO, HN_S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Z_RE5, FZ_WA}}, /* JoDou-Gotoshi-Tai-Gotoku */ {FZ_KU2, 1, {0x242f}, 1, {FZ_GOTO}}, /* JoDou-Gotoshi-You-Gotoku */ {FZ_KI2, 1, {0x242d}, 1, {FZ_GOTO}}, /* JoDou-You,U-ShiTai */ {FZ_YOU, 2, {0x2468, 0x2426}, 35, {HN_1DOU, HN_KO_KO, HN_SI_SI, FZ_I8, FZ_IKE, FZ_E, FZ_OKE, FZ_ORE, FZ_KANE, FZ_GARE, FZ_KURE3, FZ_KE, FZ_GE, FZ_KO2, FZ_SASE, FZ_SARE, FZ_SHI7, FZ_SHIMAE, FZ_SHIME, FZ_JI2, FZ_SE2, FZ_SE4, FZ_TE, FZ_TE2, FZ_DE4, FZ_DEKI, FZ_NARE2, FZ_NE, FZ_BE, FZ_MI3, FZ_ME, FZ_YARE, FZ_RARE, FZ_RE2, FZ_RE5}}, {FZ_U, 1, {0x2426}, 17, {FZ_IKO, FZ_O, FZ_OKO, FZ_ORO, FZ_GARO, FZ_KO, FZ_GO, FZ_SHIMAO, FZ_SO, FZ_TO2, FZ_NARO, FZ_NO, FZ_BO, FZ_MO, FZ_YARO, FZ_YORO, FZ_RO}}, /* SuiryouJoDou-U-ShiTai */ {FZ_U2, 1, {0x2426}, 6, {FZ_KARO, FZ_SHO, FZ_DARO, FZ_DESHO, FZ_RO2, FZ_RO3}}, /* JoDou-Dearu,Aru-KaMei */ {FZ_RE, 1, {0x246c}, 1, {FZ_A}}, /* JoDou-Dearu,Aru-ShiTai */ {FZ_RU, 1, {0x246b}, 1, {FZ_A}}, /* JoDou-Dearu,Aru-You */ {FZ_RI, 1, {0x246a}, 1, {FZ_A}}, /* JoDou-Ki-Shi */ {FZ_KI3, 1, {0x242d}, 12, {FZ_I4, FZ_KARI, FZ_GARI, FZ_KI4, FZ_GI, FZ_SHI4, FZ_TARI, FZ_CHI, FZ_NI3, FZ_BI, FZ_MI, FZ_RI2}}, /* JoDou-Ki-Tai-Shi */ {FZ_SHI2, 1, {0x2437}, 19, {HN_KO_KO, HN_KI_KI, HN_SE_SE, FZ_I4, FZ_KARI, FZ_GARI, FZ_KI4, FZ_KI6, FZ_GI, FZ_KO2, FZ_SHI4, FZ_SE3, FZ_ZE, FZ_TARI, FZ_CHI, FZ_NI3, FZ_BI, FZ_MI, FZ_RI2}}, /* 5Dan-Sa-HenTouShiTai */ {FZ_U3, 1, {0x2426}, 1, {HN_WA5DOU}}, {FZ_RU2, 1, {0x246b}, 4, {HN_RA5DOU, HN_KU_KU, HN_SU_SU, HN_RA_KUD}}, {FZ_MU, 1, {0x2460}, 1, {HN_MA5DOU}}, {FZ_BU, 1, {0x2456}, 1, {HN_BA5DOU}}, {FZ_NU2, 1, {0x244c}, 1, {HN_NA5DOU}}, {FZ_TSU, 1, {0x2444}, 1, {HN_TA5DOU}}, {FZ_SU3, 1, {0x2439}, 1, {HN_SA5DOU}}, {FZ_GU, 1, {0x2430}, 1, {HN_GA5DOU}}, {FZ_KU3, 1, {0x242f}, 2, {HN_KA5DOU, HN_KA_IKU}}, {FZ_ZURU, 2, {0x243a, 0x246b}, 1, {HN_ZAHDOU}}, {FZ_JIRU, 2, {0x2438, 0x246b}, 1, {HN_ZAHDOU}}, {FZ_IKU, 2, {0x2424, 0x242f}, 2, {FZ_TE2, FZ_DE4}}, {FZ_OKU, 2, {0x242a, 0x242f}, 2, {FZ_TE2, FZ_DE4}}, {FZ_ORU, 2, {0x242a, 0x246b}, 2, {FZ_TE2, FZ_DE4}}, {FZ_YORU, 2, {0x2468, 0x246b}, 1, {FZ_NI6}}, {FZ_YARU, 2, {0x2464, 0x246b}, 2, {FZ_TE2, FZ_DE4}}, {FZ_NARU2, 2, {0x244a, 0x246b}, 10, {FZ_KU4, FZ_KU5, FZ_DEMO, FZ_TO, FZ_TO4, FZ_NI, FZ_NI6, FZ_HA, FZ_BA3, FZ_MO2}}, {FZ_KURU, 2, {0x242f, 0x246b}, 2, {FZ_TE2, FZ_DE4}}, {FZ_SURU, 2, {0x2439, 0x246b}, 24, {HN_KANA, HN_SAHDOU, HN_1YOU, HN_SA_MEI, HN_SA_M_S, FZ_I5, FZ_GARI2, FZ_KI5, FZ_GI2, FZ_KU4, FZ_KU5, FZ_SHI5, FZ_SHI6, FZ_JI, FZ_CHI2, FZ_TO, FZ_TO3, FZ_TO4, FZ_NI, FZ_NI4, FZ_NI6, FZ_BI2, FZ_MI2, FZ_RI3}}, {FZ_SHIMAU, 3, {0x2437, 0x245e, 0x2426}, 2, {FZ_TE2, FZ_DE4}}, {FZ_GARU, 2, {0x242c, 0x246b}, 2, {HN_KEIYOU, FZ_TA4}}, /* Sa-HenMi3-Se */ {FZ_SE3, 1, {0x243b}, 11, {HN_KANA, HN_SAHDOU, HN_SA_MEI, HN_SA_M_S, FZ_KU4, FZ_KU5, FZ_TO, FZ_TO3, FZ_TO4, FZ_NI, FZ_NI6}}, {FZ_ZE, 1, {0x243c}, 1, {HN_ZAHDOU}}, /* 5KaMei */ {FZ_E, 1, {0x2428}, 1, {HN_WA5DOU}}, {FZ_RE2, 1, {0x246c}, 2, {HN_RA5DOU, HN_RA_KUD}}, {FZ_ME, 1, {0x2461}, 1, {HN_MA5DOU}}, {FZ_BE, 1, {0x2459}, 1, {HN_BA5DOU}}, {FZ_NE, 1, {0x244d}, 1, {HN_NA5DOU}}, {FZ_TE, 1, {0x2446}, 1, {HN_TA5DOU}}, {FZ_SE2, 1, {0x243b}, 1, {HN_SA5DOU}}, {FZ_GE, 1, {0x2432}, 1, {HN_GA5DOU}}, {FZ_KE, 1, {0x2431}, 2, {HN_KA5DOU, HN_KA_IKU}}, {FZ_IKE, 2, {0x2424, 0x2431}, 2, {FZ_TE2, FZ_DE4}}, {FZ_OKE, 2, {0x242a, 0x2431}, 2, {FZ_TE2, FZ_DE4}}, {FZ_ORE, 2, {0x242a, 0x246c}, 2, {FZ_TE2, FZ_DE4}}, {FZ_NARE2, 2, {0x244a, 0x246c}, 10, {FZ_KU4, FZ_KU5, FZ_DEMO, FZ_TO, FZ_TO4, FZ_NI, FZ_NI6, FZ_HA, FZ_BA3, FZ_MO2}}, {FZ_YARE, 2, {0x2464, 0x246c}, 2, {FZ_TE2, FZ_DE4}}, {FZ_SHIMAE, 3, {0x2437, 0x245e, 0x2428}, 2, {FZ_TE2, FZ_DE4}}, {FZ_GARE, 2, {0x242c, 0x246c}, 2, {HN_KEIYOU, FZ_TA4}}, /* 5-I-Bin2 */ {FZ_N2, 1, {0x2473}, 3, {HN_NA5DOU, HN_BA5DOU, HN_MA5DOU}}, {FZ_I2, 1, {0x2424}, 1, {HN_GA5DOU}}, /* 5DanTouMi1 */ {FZ_WA, 1, {0x246f}, 1, {HN_WA5DOU}}, {FZ_RA3, 1, {0x2469}, 2, {HN_RA5DOU, HN_RA_KUD}}, {FZ_MA, 1, {0x245e}, 1, {HN_MA5DOU}}, {FZ_BA, 1, {0x2450}, 1, {HN_BA5DOU}}, {FZ_NA3, 1, {0x244a}, 1, {HN_NA5DOU}}, {FZ_TA2, 1, {0x243f}, 1, {HN_TA5DOU}}, {FZ_SA, 1, {0x2435}, 1, {HN_SA5DOU}}, {FZ_GA, 1, {0x242c}, 1, {HN_GA5DOU}}, {FZ_KA, 1, {0x242b}, 2, {HN_KA5DOU, HN_KA_IKU}}, {FZ_IKA, 2, {0x2424, 0x242b}, 2, {FZ_TE2, FZ_DE4}}, {FZ_OKA, 2, {0x242a, 0x242b}, 2, {FZ_TE2, FZ_DE4}}, {FZ_ORA, 2, {0x242a, 0x2469}, 2, {FZ_TE2, FZ_DE4}}, {FZ_YORA, 2, {0x2468, 0x2469}, 1, {FZ_NI6}}, {FZ_NARA2, 2, {0x244a, 0x2469}, 10, {FZ_KU4, FZ_KU5, FZ_DEMO, FZ_TO, FZ_TO4, FZ_NI, FZ_NI6, FZ_HA, FZ_BA3, FZ_MO2}}, {FZ_YARA, 2, {0x2464, 0x2469}, 2, {FZ_TE2, FZ_DE4}}, {FZ_SHIMAWA, 3, {0x2437, 0x245e, 0x246f}, 2, {FZ_TE2, FZ_DE4}}, {FZ_GARA, 2, {0x242c, 0x2469}, 2, {HN_KEIYOU, FZ_TA4}}, /* 5DanTouMi */ {FZ_O, 1, {0x242a}, 1, {HN_WA5DOU}}, {FZ_RO, 1, {0x246d}, 1, {HN_RA5DOU}}, {FZ_MO, 1, {0x2462}, 1, {HN_MA5DOU}}, {FZ_BO, 1, {0x245c}, 1, {HN_BA5DOU}}, {FZ_NO, 1, {0x244e}, 1, {HN_NA5DOU}}, {FZ_TO2, 1, {0x2448}, 1, {HN_TA5DOU}}, {FZ_SO, 1, {0x243d}, 1, {HN_SA5DOU}}, {FZ_GO, 1, {0x2434}, 1, {HN_GA5DOU}}, {FZ_KO, 1, {0x2433}, 2, {HN_KA5DOU, HN_KA_IKU}}, {FZ_IKO, 2, {0x2424, 0x2433}, 2, {FZ_TE2, FZ_DE4}}, {FZ_OKO, 2, {0x242a, 0x2433}, 2, {FZ_TE2, FZ_DE4}}, {FZ_ORO, 2, {0x242a, 0x246d}, 2, {FZ_TE2, FZ_DE4}}, {FZ_YORO, 2, {0x2468, 0x246d}, 1, {FZ_NI6}}, {FZ_NARO, 2, {0x244a, 0x246d}, 10, {FZ_KU4, FZ_KU5, FZ_DEMO, FZ_TO, FZ_TO4, FZ_NI, FZ_NI6, FZ_HA, FZ_BA3, FZ_MO2}}, {FZ_YARO, 2, {0x2464, 0x246d}, 2, {FZ_TE2, FZ_DE4}}, {FZ_SHIMAO, 3, {0x2437, 0x245e, 0x242a}, 2, {FZ_TE2, FZ_DE4}}, {FZ_GARO, 2, {0x242c, 0x246d}, 2, {HN_KEIYOU, FZ_TA4}}, /* KeiDou,JoDou-Da-TouMi */ {FZ_DARO, 2, {0x2440, 0x246d}, 88, {HN_SUUJI, HN_KANA, HN_EISUU, HN_KIGOU, HN_HEIKAKKO, HN_GIJI, HN_MEISHI, HN_JINMEI, HN_CHIMEI, HN_KOYUU, HN_SUUSHI, HN_SA_MEI, HN_KEIDOU, HN_FUKUSI, HN_SET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_BI, 1, {0x2453}, 1, {HN_BA5DOU}}, {FZ_SHI4, 1, {0x2437}, 1, {HN_SA5DOU}}, {FZ_NI3, 1, {0x244b}, 1, {HN_NA5DOU}}, {FZ_CHI, 1, {0x2441}, 1, {HN_TA5DOU}}, {FZ_GI, 1, {0x242e}, 1, {HN_GA5DOU}}, {FZ_KI4, 1, {0x242d}, 2, {HN_KA5DOU, HN_KA_IKU}}, {FZ_GARI, 2, {0x242c, 0x246a}, 2, {HN_KEIYOU, FZ_TA4}}, /* 5DanTouYouHiTai */ {FZ_IKI, 2, {0x2424, 0x242d}, 2, {FZ_TE2, FZ_DE4}}, {FZ_OKI, 2, {0x242a, 0x242d}, 2, {FZ_TE2, FZ_DE4}}, {FZ_ORI, 2, {0x242a, 0x246a}, 2, {FZ_TE2, FZ_DE4}}, {FZ_YORI, 2, {0x2468, 0x246a}, 1, {FZ_NI6}}, {FZ_NARI, 2, {0x244a, 0x246a}, 10, {FZ_KU4, FZ_KU5, FZ_DEMO, FZ_TO, FZ_TO4, FZ_NI, FZ_NI6, FZ_HA, FZ_BA3, FZ_MO2}}, {FZ_YARI, 2, {0x2464, 0x246a}, 2, {FZ_TE2, FZ_DE4}}, {FZ_SHIMAI, 3, {0x2437, 0x245e, 0x2424}, 2, {FZ_TE2, FZ_DE4}}, /* O-5DanTouYou */ {FZ_I5, 1, {0x2424}, 1, {HN_WA5YOU}}, {FZ_RI3, 1, {0x246a}, 1, {HN_RA5YOU}}, {FZ_MI2, 1, {0x245f}, 1, {HN_MA5YOU}}, {FZ_BI2, 1, {0x2453}, 1, {HN_BA5YOU}}, {FZ_SHI5, 1, {0x2437}, 1, {HN_SA5YOU}}, {FZ_NI4, 1, {0x244b}, 1, {HN_NA5YOU}}, {FZ_CHI2, 1, {0x2441}, 1, {HN_TA5YOU}}, {FZ_GI2, 1, {0x242e}, 1, {HN_GA5YOU}}, {FZ_KI5, 1, {0x242d}, 1, {HN_KA5YOU}}, {FZ_GARI2, 2, {0x242c, 0x246a}, 2, {HN_KEIYOU, FZ_TA4}}, {FZ_SHI6, 1, {0x2437}, 1, {HN_SAHYOU}}, {FZ_JI, 1, {0x2438}, 1, {HN_ZAHYOU}}, /* O-5DanTouMi1 */ {FZ_WA2, 1, {0x246f}, 1, {HN_WA5YOU}}, {FZ_RA4, 1, {0x2469}, 1, {HN_RA5YOU}}, {FZ_MA2, 1, {0x245e}, 1, {HN_MA5YOU}}, {FZ_BA2, 1, {0x2450}, 1, {HN_BA5YOU}}, {FZ_NA4, 1, {0x244a}, 1, {HN_NA5YOU}}, {FZ_TA3, 1, {0x243f}, 1, {HN_TA5YOU}}, {FZ_SA2, 1, {0x2435}, 1, {HN_SA5YOU}}, {FZ_GA2, 1, {0x242c}, 1, {HN_GA5YOU}}, {FZ_KA2, 1, {0x242b}, 1, {HN_KA5YOU}}, {FZ_GARA2, 2, {0x242c, 0x2469}, 2, {HN_KEIYOU, FZ_TA4}}, /* Yoru-KaMei */ {FZ_YORE, 2, {0x2468, 0x246c}, 1, {FZ_NI6}}, /* Kuru-Mi */ {FZ_KO2, 1, {0x2433}, 2, {FZ_TE2, FZ_DE4}}, /* Kuru-You */ {FZ_KI6, 1, {0x242d}, 2, {FZ_TE2, FZ_DE4}}, /* Sa-HenMi1You-Shi */ {FZ_SHI7, 1, {0x2437}, 24, {HN_KANA, HN_SAHDOU, HN_1YOU, HN_SA_MEI, HN_SA_M_S, FZ_I5, FZ_GARI2, FZ_KI5, FZ_GI2, FZ_KU4, FZ_KU5, FZ_SHI5, FZ_SHI6, FZ_JI, FZ_CHI2, FZ_TO, FZ_TO3, FZ_TO4, FZ_NI, FZ_NI4, FZ_NI6, FZ_BI2, FZ_MI2, FZ_RI3}}, {FZ_JI2, 1, {0x2438}, 1, {HN_ZAHDOU}}, /* 1DanTouShiTai */ {FZ_RU3, 1, {0x246b}, 30, {HN_1DOU, FZ_I8, FZ_IKE, FZ_E, FZ_OKE, FZ_ORE, FZ_KANE, FZ_GARE, FZ_KURE3, FZ_K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Z_OKA, FZ_OKE, FZ_ORA, FZ_ORE, FZ_KA, FZ_KANE, FZ_KARA, FZ_GA, FZ_GARA, FZ_GARE, FZ_KURE3, FZ_KE, FZ_GE, FZ_KO2, FZ_SA, FZ_SASE, FZ_SARE, FZ_SHIMAE, FZ_SHIMAWA, FZ_SHIME, FZ_SE2, FZ_SE3, FZ_SE4, FZ_ZE, FZ_TA2, FZ_TARA, FZ_TE, FZ_DEKI, FZ_NA3, FZ_NARA2, FZ_NARE2, FZ_NE, FZ_BA, FZ_BE, FZ_MA, FZ_MI3, FZ_ME, FZ_YARA, FZ_YARE, FZ_YORA, FZ_RA2, FZ_RA3, FZ_RARE, FZ_RE2, FZ_RE5, FZ_WA}}, /* KeiYou1-Ku */ {FZ_KU4, 1, {0x242f}, 4, {HN_KEIYOU, HN_KE_SED, FZ_TA4, FZ_RASHI}}, {FZ_KU5, 1, {0x242f}, 2, {FZ_NA5, FZ_YASHINA}}, /* KeiYou3-Xyuu */ {FZ_XYUU, 2, {0x2465, 0x2426}, 1, {FZ_RASHI}}, /* KeiTaiShi */ {FZ_I7, 1, {0x2424}, 4, {HN_KEIYOU, HN_KE_SED, FZ_TA4, FZ_RASHI}}, /* KeiBunShi */ {FZ_SHI8, 1, {0x2437}, 2, {HN_KEIYOU, HN_KE_SED}}, /* KeiBun,JoDou-Beshi-Mi-Kara */ {FZ_KARA, 2, {0x242b, 0x2469}, 7, {HN_KEIYOU, HN_KE_SED, FZ_SUBE, FZ_ZUBE, FZ_TA4, FZ_BE2, FZ_RASHI}}, /* KeiBunYou */ {FZ_KARI, 2, {0x242b, 0x246a}, 4, {HN_KEIYOU, HN_KE_SED, FZ_TA4, FZ_RASHI}}, /* KeiBunTai1-Ki */ {FZ_KI7, 1, {0x242d}, 4, {HN_KEIYOU, HN_KE_SED, FZ_TA4, FZ_RASHI}}, /* KeiBunTai2-Karu */ {FZ_KARU, 2, {0x242b, 0x246b}, 4, {HN_KEIYOU, HN_KE_SED, FZ_TA4, FZ_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ARI2, FZ_NARI3, FZ_NARU, FZ_NARU2, FZ_NARE, FZ_NARE2, FZ_NI, FZ_NI2, FZ_NI3, FZ_NI4, FZ_NI5, FZ_NI6, FZ_NU, FZ_NU2, FZ_NE, FZ_NO2, FZ_NO3, FZ_NOMI, FZ_HA, FZ_BA3, FZ_BAKARI, FZ_BI, FZ_BI2, FZ_BU, FZ_HE, FZ_BE, FZ_HODO, FZ_MAI, FZ_MADE, FZ_MI, FZ_MI2, FZ_MI4, FZ_MITAI, FZ_MU, FZ_ME, FZ_ME2, FZ_MO2, FZ_YA, FZ_YA2, FZ_YARA2, FZ_YARI, FZ_YARU, FZ_YARE, FZ_XYUU, FZ_YUE, FZ_YO, FZ_YOU, FZ_YOU2, FZ_YORI, FZ_YORI2, FZ_YORU, FZ_YORE, FZ_RA, FZ_RARE, FZ_RI, FZ_RI2, FZ_RI3, FZ_RU, FZ_RU2, FZ_RU3, FZ_RE, FZ_RE2, FZ_RE5, FZ_RO4, FZ_WA3, FZ_WO, FZ_N}}, }; #define CONLISTSIZ arraysize(conlist) static CONST contable shuutanlist[] = { /* svkanren */ {SH_svkanren, 0, {0}, 238, {HN_SUUJI, HN_KANA, HN_EISUU, HN_KIGOU, HN_HEIKAKKO, HN_KAIKAKKO, HN_GIJI, HN_MEISHI, HN_JINMEI, HN_CHIMEI, HN_KOYUU, HN_SUUSHI, HN_1DOU, HN_1YOU, HN_SA_MEI, HN_SI_SI, HN_KEIDOU, HN_KD_TAR, HN_FUKUSI, HN_RENTAI, HN_SETKAN, HN_SETUBI, HN_JOSUU, HN_SETOJO, HN_SETUJO, HN_SETUJN, HN_SETUCH, HN_KD_STB, HN_SA_M_S, HN_SETUDO, FZ_BAN, FZ_COMMA, FZ_PERIOD, FZ_QUEST, FZ_TOUTEN, FZ_KUTEN, FZ_ZENPERIOD, FZ_ZENQUEST, FZ_ZENBAN, FZ_I, FZ_I4, FZ_I5, FZ_I6, FZ_I7, FZ_I9, FZ_IKI, FZ_IKU, FZ_IK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, FZ_NARI, FZ_NARI2, FZ_NARI3, FZ_NARU, FZ_NARU2, FZ_NI, FZ_NI2, FZ_NI3, FZ_NI4, FZ_NI5, FZ_NI6, FZ_NU, FZ_NU2, FZ_NO2, FZ_NO3, FZ_NOMI, FZ_HA, FZ_BA3, FZ_BAKARI, FZ_BI, FZ_BI2, FZ_BU, FZ_HE, FZ_HODO, FZ_MAI, FZ_MADE, FZ_MI, FZ_MI2, FZ_MI4, FZ_MITAI, FZ_MU, FZ_ME2, FZ_MO2, FZ_YA, FZ_YA2, FZ_YARA2, FZ_YARI, FZ_YARU, FZ_XYUU, FZ_YUE, FZ_YOU, FZ_YOU2, FZ_YORI, FZ_YORI2, FZ_YORU, FZ_RA, FZ_RARE, FZ_RI, FZ_RI2, FZ_RI3, FZ_RU, FZ_RU2, FZ_RU3, FZ_RE5, FZ_WA3, FZ_WO, FZ_N}}, }; #define SHUUTANLISTSIZ arraysize(shuutanlist) static u_char *NEAR Xrealloc(buf, size) VOID_P buf; ALLOC_T size; { return((buf) ? (u_char *)realloc(buf, size) : (u_char *)malloc(size)); } static int NEAR addstrbuf(len) ALLOC_T len; { u_char *cp; ALLOC_T size; len += maxstr; size = (strbufsize) ? strbufsize : DICTBUFUNIT; while (size < len) size *= 2; if (size <= strbufsize) return(0); if (!(cp = Xrealloc(strbuf, size))) return(-1); strbuf = cp; strbufsize = size; return(0); } static int NEAR adddictlist(ptr, klen, size) ALLOC_T ptr, klen, size; { dicttable *new; if (maxdict >= dictlistsize) { new = (dicttable *)Xrealloc(dictlist, (dictlistsize + DICTBUFUNIT) * sizeof(dicttable)); if (!new) return(-1); dictlist = new; dictlistsize += DICTBUFUNIT; } dictlist[maxdict].ptr = ptr; dictlist[maxdict].klen = klen; dictlist[maxdict].size = size; dictlist[maxdict].max = 0; maxdict++; return(0); } static int NEAR setkbuf(klen, kbuf) int klen; CONST u_short *kbuf; { int i; if (addstrbuf(1 + klen * 2) < 0) return(-1); strbuf[maxstr++] = klen; for (i = 0; i < klen; i++) { strbuf[maxstr++] = (kbuf[i] & 0xff); strbuf[maxstr++] = ((kbuf[i] >> 8) & 0xff); } return(0); } static int NEAR setjisbuf(s, roman, bias) CONST char *s; int roman, bias; { u_short kbuf[MAXUTYPE(u_char) - 1]; int i, n; n = str2jis(kbuf, arraysize(kbuf), s); if (roman) { for (i = 0; i < n - 1; i++) { if (kbuf[i] != J_U || kbuf[i + 1] != J_DAKUTEN) continue; kbuf[i] = J_VU; memmove((char *)&(kbuf[i + 1]), (char *)&(kbuf[i + 2]), (--n - i - 1) * sizeof(u_short)); } } if (bias < BIASLISTSIZ) { for (i = 0; i < biaslist[bias].klen; i++) if (kbuf[n - 1] == biaslist[bias].kbuf[i]) break; if (i < biaslist[bias].klen) n--; } return(setkbuf(n, kbuf)); } static int NEAR setword(w) u_int w; { if (addstrbuf(2) < 0) return(-1); strbuf[maxstr++] = (w & 0xff); strbuf[maxstr++] = ((w >> 8) & 0xff); return(0); } static int NEAR sethinsi(len, idlist) int len; CONST u_short *idlist; { int i; if (addstrbuf(2 + len * 2) < 0) return(-1); strbuf[maxstr++] = (len & 0xff); strbuf[maxstr++] = ((len >> 8) & 0xff); for (i = 0; i < len; i++) { strbuf[maxstr++] = (idlist[i] & 0xff); strbuf[maxstr++] = ((idlist[i] >> 8) & 0xff); } return(0); } static int cmphinsi(vp1, vp2) CONST VOID_P vp1; CONST VOID_P vp2; { hinsitable *hp1, *hp2; CONST u_short *buf1, *buf2; int i, klen1, klen2; hp1 = (hinsitable *)vp1; hp2 = (hinsitable *)vp2; buf1 = hp1 -> kbuf; buf2 = hp2 -> kbuf; klen1 = hp1 -> klen; klen2 = hp2 -> klen; for (i = 0; i < klen1; i++) { if (i >= klen2) return(1); if (buf1[i] > buf2[i]) return(1); else if (buf1[i] < buf2[i]) return(-1); } return(klen1 - klen2); } static int NEAR addhinsi(hmax, idlist, id, hstr) int hmax; u_short *idlist; int id; CONST char *hstr; { int n; for (n = 0; n < hmax; n++) if (idlist[n] == id) return(hmax); if (hmax >= MAXHINSI) { if (verbose) VOID_C fprintf(stderr, "%s: Too many Hinsi fields.\n", hstr); return(hmax); } idlist[hmax++] = id; return(hmax); } static int NEAR _gethinsi(hmax, idlist, hstr, dictp) int hmax; u_short *idlist; CONST char *hstr; int *dictp; { hinsitable tmp; int i, n, min, max; if (!hstr || !*hstr) return(hmax); tmp.klen = str2jis(tmp.kbuf, MAXHINSILEN, hstr); min = -1; max = HINSILISTSIZ; for (;;) { i = (min + max) / 2; if (i <= min || i >= max) { if (verbose) VOID_C fprintf(stderr, "%s: Unknown Hinsi srting (ignored).\n", hstr); return(hmax); } n = cmphinsi(&(hinsilist[i]), &tmp); if (n < 0) min = i; else if (n > 0) max = i; else break; } *dictp = hinsilist[i].dict; hmax = addhinsi(hmax, idlist, hinsilist[i].id, hstr); for (n = 0; n < HINSISETLISTSIZ; n++) if (hinsisetlist[n].id == hinsilist[i].id) break; if (n < HINSISETLISTSIZ) for (i = 0; i < hinsisetlist[n].klen; i++) hmax = addhinsi(hmax, idlist, hinsisetlist[n].set[i], hstr); return(hmax); } static int NEAR gethinsi(hmax, idlist, hstr, dictp) int hmax; u_short *idlist; char *hstr; int *dictp; { CONST char *cp; char *next; int dict, mask; next = hstr; while ((cp = next)) { mask = ~DIC_SJ3; if ((next = strchr(cp, ':'))) { mask = !mask; *(next++) = '\0'; } #ifdef FAKEUNINIT dict = -1; #endif hmax = _gethinsi(hmax, idlist, cp, &dict); *dictp |= (dict & mask); } return(hmax); } static int cmpidlist(vp1, vp2) CONST VOID_P vp1; CONST VOID_P vp2; { u_short *sp1, *sp2; sp1 = (u_short *)vp1; sp2 = (u_short *)vp2; return(*sp1 - *sp2); } static int NEAR adddict(str, kstr, hstr, freq) CONST char *str, *kstr; char *hstr; u_int freq; { ALLOC_T ptr, klen; u_short idlist[MAXHINSI]; char *cp, *next; int i, n, dict, hmax; dict = hmax = 0; next = hstr; while ((cp = next)) { if ((next = strchr(cp, '/'))) *(next++) = '\0'; hmax = gethinsi(hmax, idlist, cp, &dict); } qsort(idlist, hmax, sizeof(u_short), cmpidlist); n = BIASLISTSIZ; if (!(dict & DIC_WNN)) for (i = 0; i < hmax; i++) { for (n = 0; n < BIASLISTSIZ; n++) if (idlist[i] == biaslist[n].id) break; if (n < BIASLISTSIZ) break; } ptr = maxstr; if (setjisbuf(str, 1, n) < 0) return(-1); klen = maxstr - ptr; if (setjisbuf(kstr, 0, n) < 0) return(-1); if (setword(freq) < 0) return(-1); if (needhinsi && setkbuf(hmax, idlist) < 0) return(-1); return(adddictlist(ptr, klen, maxstr - ptr - klen)); } static u_int NEAR getfreq(cp) char *cp; { long freq; if (!cp || !*cp) freq = 0L; else { *(cp++) = '\0'; if ((freq = strtol(cp, NULL, 10)) < 0L) freq = 0L; else if (freq > MAXUTYPE(u_short)) freq = MAXUTYPE(u_short); } return((u_int)freq); } static int NEAR addcannadict(str, buf) CONST char *str; char *buf; { CONST char *kstr; char *cp; u_int freq; int n, ptr; cp = NULL; for (ptr = 1; buf[ptr]; ptr++) { if (buf[ptr] == '*') cp = &(buf[ptr]); else if (Xisspace(buf[ptr])) break; else if (!Xisalnum(buf[ptr])) return(0); } if (ptr <= 1) return(0); buf[ptr++] = '\0'; freq = getfreq(cp); while (buf[ptr] && Xisspace(buf[ptr])) ptr++; for (n = 0; buf[ptr]; n++) { if (buf[ptr] == '#') { if (addcannadict(str, &(buf[ptr])) < 0) return(-1); return(1); } kstr = &(buf[ptr]); while (buf[ptr] && !Xisspace(buf[ptr])) ptr++; buf[ptr++] = '\0'; if (*kstr == '@') kstr = str; if (adddict(str, kstr, buf, freq) < 0) return(-1); } return(1); } static int NEAR convdict(size, fp) off_t size; FILE *fp; { char *cp, *str, *kstr, *hstr, buf[MAXLINESTR + 1]; long ofs; int n, ptr, tmp; n = 0; while (fgets(buf, sizeof(buf), fp)) { if (verbose && size) { if ((ofs = ftell(fp)) < 0L) ofs = 0L; tmp = (int)((ofs * MAXRANGE) / size); for (; n < tmp; n++) VOID_C fputc(VERBOSECHAR, stdout); VOID_C fflush(stdout); } ptr = 0; while (buf[ptr] && Xisspace(buf[ptr])) ptr++; if (!buf[ptr]) continue; cp = newkanjiconv(buf, EUC, DEFCODE, L_INPUT); if (cp != buf) { Xstrncpy(buf, cp, sizeof(buf) - 1); free(cp); } str = &(buf[ptr]); for (; buf[ptr]; ptr++) { if (iskanji1(buf, ptr)) ptr++; else if (!iskana1(buf, &ptr)) break; } if (!buf[ptr] || !Xisspace(buf[ptr])) continue; buf[ptr++] = '\0'; while (buf[ptr] && Xisspace(buf[ptr])) ptr++; if (!buf[ptr]) continue; if (buf[ptr] == '#' && (tmp = addcannadict(str, &(buf[ptr])))) { if (tmp < 0) return(-1); continue; } kstr = &(buf[ptr++]); while (buf[ptr] && !Xisspace(buf[ptr])) ptr++; if (!(buf[ptr])) hstr = NULL; else { buf[ptr++] = '\0'; while (buf[ptr] && Xisspace(buf[ptr])) ptr++; if (!buf[ptr]) hstr = NULL; else { hstr = &(buf[ptr++]); while (buf[ptr] && !Xisspace(buf[ptr])) ptr++; } } if (adddict(str, kstr, hstr, getfreq(&(buf[ptr]))) < 0) return(-1); } if (verbose) { for (; n < MAXRANGE; n++) VOID_C fputc(VERBOSECHAR, stdout); VOID_C fputs(" done.\n", stdout); } return(0); } static int NEAR addhinsidict(VOID_A) { ALLOC_T ptr, klen; int i; for (i = 0; i < CONLISTSIZ; i++) { ptr = maxstr; if (setkbuf(conlist[i].klen, conlist[i].kbuf) < 0) return(-1); klen = maxstr - ptr; if (setkbuf(conlist[i].klen, conlist[i].kbuf) < 0) return(-1); if (setword(0) < 0) return(-1); if (setkbuf(1, &(conlist[i].id)) < 0) return(-1); if (adddictlist(ptr, klen, maxstr - ptr - klen)) return(-1); } return(0); } static int NEAR addconlist(n, max, list) int n, max; CONST contable *list; { ALLOC_T ptr; CONST u_short *idlist; int i, len; idlist = NULL; len = 0; for (i = 0; i < max; i++) if (list[i].id == n) { idlist = list[i].next; len = list[i].nlen; break; } ptr = maxstr; if (sethinsi(len, idlist) < 0) return(-1); if (adddictlist(ptr, (ALLOC_T)0, maxstr - ptr)) return(-1); return(0); } static int NEAR genconlist(VOID_A) { int i; free(dictlist); dictlist = NULL; maxdict = dictlistsize = 0L; free(strbuf); strbuf = NULL; maxstr = strbufsize = (ALLOC_T)0; if (!needhinsi) return(0); for (i = HN_MIN; i < HN_MAX; i++) if (addconlist(i, JIRCONLISTSIZ, jirconlist) < 0) return(-1); for (i = FZ_MIN; i < FZ_MAX; i++) if (addconlist(i, CONLISTSIZ, conlist) < 0) return(-1); for (i = SH_MIN; i < SH_MAX; i++) if (addconlist(i, SHUUTANLISTSIZ, shuutanlist) < 0) return(-1); return(0); } static int NEAR cmpjisbuf(buf1, len1, buf2, len2) CONST u_char *buf1; int len1; CONST u_char *buf2; int len2; { int i, c1, c2; for (i = 0; i < len1; i += 2) { if (i >= len2) return(1); c1 = getword(buf1, i); c2 = getword(buf2, i); if (c1 > c2) return(1); else if (c1 < c2) return(-1); } if (i < len2) return(-1); return(0); } static int cmpdict(vp1, vp2) CONST VOID_P vp1; CONST VOID_P vp2; { dicttable *dp1, *dp2; u_char *buf1, *buf2; int n, lvl, len1, len2; dp1 = (dicttable *)vp1; dp2 = (dicttable *)vp2; lvl = 3; buf1 = &(strbuf[dp1 -> ptr]); buf2 = &(strbuf[dp2 -> ptr]); len1 = *(buf1++) * 2; len2 = *(buf2++) * 2; if ((n = cmpjisbuf(buf1, len1, buf2, len2))) return(n * lvl); lvl--; buf1 += len1; buf2 += len2; len1 = *(buf1++) * 2; len2 = *(buf2++) * 2; if ((n = cmpjisbuf(buf1, len1, buf2, len2))) return(n * lvl); if (!needhinsi) return(0); lvl--; buf1 += len1 + 2; buf2 += len2 + 2; len1 = *(buf1++) * 2; len2 = *(buf2++) * 2; if ((n = cmpjisbuf(buf1, len1, buf2, len2))) return(n * lvl); return(0); } static int NEAR writeindex(fp) FILE *fp; { u_char *buf; char tmp[4 + 1]; ALLOC_T ptr; long i, j, n, max, ent; int len; for (i = ent = 0L; i < maxdict; i++) { if (!(dictlist[i].size)) continue; ent++; dictlist[i].max = 1; for (j = 1L; i + j < maxdict; j++) { if (!(dictlist[i + j].size)) continue; n = cmpdict(&(dictlist[i + j - 1]), &(dictlist[i + j])); if (n < -2 || n > 2) break; dictlist[i].max++; dictlist[i + j].max = 0; if (!n) dictlist[i + j].size = (ALLOC_T)0; } i += j - 1; } if (fputlength("dicttblent", ent, fp, 4) < 0) return(-1); if (fputbegin("dictindexbuf", fp) < 0) return(-1); ptr = (ALLOC_T)0; for (i = 0L; i < maxdict; i++) { if (!(dictlist[i].size)) continue; if (fputdword(ptr, fp) < 0) return(-1); ptr += dictlist[i].klen; ptr++; for (j = max = 0L; j < dictlist[i].max; j++) { if (!(dictlist[i + j].size)) continue; if (++max > MAXUTYPE(u_char)) { if (verbose) { buf = &(strbuf[dictlist[i + j].ptr]); len = *(buf++) * 2; buf += len; len = *(buf++) * 2; while (len > 0) { VOID_C jis2str(tmp, getword(buf, 0)); VOID_C fprintf(stderr, "%s", tmp); buf += 2; len -= 2; } VOID_C fprintf(stderr, ": Too many entries for the same reading (ignored).\n"); } continue; } ptr += dictlist[i + j].size; } i += dictlist[i].max - 1; } if (!textmode && fputdword(ptr, fp) < 0) return(-1); if (fputend(fp) < 0) return(-1); return(0); } static int NEAR writedict(fp) FILE *fp; { u_char *buf; long i, j, max; if (fputbegin("dicttblbuf", fp) < 0) return(-1); for (i = 0L; i < maxdict; i++) { if (!(dictlist[i].size)) continue; buf = &(strbuf[dictlist[i].ptr]); if (fputbuf(buf, dictlist[i].klen, fp) < 0) return(-1); for (j = max = 0L; j < dictlist[i].max; j++) if (dictlist[i + j].size) max++; if (max > MAXUTYPE(u_char)) max = MAXUTYPE(u_char); if (fputbyte(max, fp) < 0) return(-1); for (j = max = 0L; j < dictlist[i].max; j++) { if (!(dictlist[i + j].size)) continue; if (++max > MAXUTYPE(u_char)) break; buf = &(strbuf[dictlist[i + j].ptr]); buf += dictlist[i + j].klen; if (fputbuf(buf, dictlist[i + j].size, fp) < 0) return(-1); } i += dictlist[i].max - 1; } if (fputend(fp) < 0) return(-1); return(0); } static int NEAR writehinsiindex(fp) FILE *fp; { ALLOC_T ptr; long i; if (fputlength("hinsitblent", maxdict, fp, 2) < 0) return(-1); if (fputbegin("hinsiindexbuf", fp) < 0) return(-1); ptr = (ALLOC_T)0; for (i = 0L; i < maxdict; i++) { if (fputword(ptr, fp) < 0) return(-1); ptr += dictlist[i].size; } if (!textmode && fputword(ptr, fp) < 0) return(-1); if (fputend(fp) < 0) return(-1); return(0); } static int NEAR writehinsidict(fp) FILE *fp; { u_char *buf; long i; if (fputbegin("hinsitblbuf", fp) < 0) return(-1); for (i = 0L; i < maxdict; i++) { buf = &(strbuf[dictlist[i].ptr]); if (fputbuf(buf, dictlist[i].size, fp) < 0) return(-1); } if (fputend(fp) < 0) return(-1); return(0); } static VOID NEAR readdict(n, argc, argv) int n, argc; char *CONST argv[]; { FILE *fp; struct stat st; off_t size; int c, max; if (nocontent) return; qsort(hinsilist, HINSILISTSIZ, sizeof(hinsitable), cmphinsi); for (; n < argc; n++) { size = (off_t)0; if (verbose) { VOID_C fprintf(stdout, "%s:\n", argv[n]); if (stat(argv[n], &st) >= 0) size = st.st_size; } if (!(fp = fopen(argv[n], "r"))) { VOID_C fprintf(stderr, "%s: Cannot open file.\n", argv[n]); continue; } c = convdict(size, fp); VOID_C fclose(fp); if (c < 0) break; } max = maxdict; if (needhinsi && addhinsidict() < 0) { needhinsi = 0; maxdict = max; } if (verbose) { VOID_C fprintf(stdout, "sorting..."); VOID_C fflush(stdout); } qsort(dictlist, maxdict, sizeof(dicttable), cmpdict); if (verbose) VOID_C fputs(" done.\n", stdout); } static int NEAR mkdict(fp) FILE *fp; { if (fputheader("headers", fp) < 0) return(-1); if (nocontent) return(0); if (verbose) { VOID_C fprintf(stdout, "writing..."); VOID_C fflush(stdout); } if (writeindex(fp) < 0) return(-1); if (writedict(fp) < 0) return(-1); if (genconlist() < 0) return(-1); if (writehinsiindex(fp) < 0) return(-1); if (writehinsidict(fp) < 0) return(-1); if (verbose) VOID_C fputs(" done.\n", stdout); return(0); } int main(argc, argv) int argc; char *CONST argv[]; { FILE *fp; CONST char *path; int n; initopt(optlist); n = evalopt(argc, argv, optlist); if (n < 0 || n >= argc) { optusage(argv[0], " [ ...]", optlist); return(1); } path = argv[n]; if (!(fp = opentbl(path))) return(1); readdict(n + 1, argc, argv); n = mkdict(fp); VOID_C fclose(fp); if (n < 0) { VOID_C fprintf(stderr, "%s: Cannot write file.\n", path); return(1); } return(0); } FD-3.01j/mktankan.c100644 2105 1751 40151 13516612560 12652 0ustar shiraiuser/* * mktankan.c * * Tan-Kanji translation table generator */ #include "headers.h" #include "kctype.h" #include "typesize.h" #include "kconv.h" #include "roman.h" #define MAXKANASTR 255 #define DEFFREQ 0 #define DEFTK(s, c) {s, strsize(s), c} typedef struct _tankantable { CONST char *str; ALLOC_T len; u_short code; } tankantable; extern romantable *romanlist; static int NEAR Xjis2str __P_((char *, u_int)); static VOID NEAR roman2str __P_((char *, CONST char *, ALLOC_T)); int main __P_((int, char *CONST [])); static CONST u_short tankanstr[] = { 0x4331, 0x3441, 0x3b7a }; static CONST tankantable tankanlist[] = { DEFTK("a", 0x3021), DEFTK("ai", 0x3025), DEFTK("hou", 0x3029), /* a + u */ DEFTK("aoi", 0x302a), DEFTK("akane", 0x302b), DEFTK("aki", 0x302c), DEFTK("aku", 0x302d), DEFTK("asahi", 0x3030), DEFTK("asi", 0x3031), DEFTK("aji", 0x3033), DEFTK("azusa", 0x3034), DEFTK("atu", 0x3035), DEFTK("kyuu", 0x3037), /* atsuka + u */ DEFTK("ate", 0x3038), DEFTK("ane", 0x3039), DEFTK("abu", 0x303a), DEFTK("ame", 0x303b), DEFTK("aya", 0x303c), DEFTK("ayu", 0x303e), DEFTK("aru", 0x303f), DEFTK("awa", 0x3040), DEFTK("awase", 0x3041), DEFTK("an", 0x3042), DEFTK("i", 0x304a), DEFTK("iki", 0x3068), DEFTK("iku", 0x3069), DEFTK("iso", 0x306b), DEFTK("iti", 0x306c), DEFTK("itu", 0x306e), DEFTK("ine", 0x3070), DEFTK("ibara", 0x3071), DEFTK("imo", 0x3072), DEFTK("iwasi", 0x3073), DEFTK("in", 0x3074), DEFTK("u", 0x3126), DEFTK("ki", 0x312e), /* ukaga + u */ DEFTK("usi", 0x312f), DEFTK("usu", 0x3130), DEFTK("uzu", 0x3132), DEFTK("uso", 0x3133), DEFTK("uta", 0x3134), DEFTK("utu", 0x3135), DEFTK("unagi", 0x3137), DEFTK("uba", 0x3138), DEFTK("umaya", 0x3139), DEFTK("ura", 0x313a), DEFTK("uri", 0x313b), DEFTK("uruu", 0x313c), DEFTK("uwasa", 0x313d), DEFTK("un", 0x313e), DEFTK("e", 0x3141), DEFTK("ei", 0x3143), DEFTK("eki", 0x3155), DEFTK("etu", 0x3159), DEFTK("enoki", 0x315d), DEFTK("en", 0x315e), DEFTK("o", 0x3177), DEFTK("oi", 0x3179), DEFTK("ou", 0x317a), DEFTK("oka", 0x322c), DEFTK("oki", 0x322d), DEFTK("ogi", 0x322e), DEFTK("oku", 0x322f), DEFTK("oke", 0x3233), DEFTK("osu", 0x3234), DEFTK("otu", 0x3235), DEFTK("ore", 0x3236), DEFTK("on", 0x3237), DEFTK("ka", 0x323c), DEFTK("ga", 0x3264), DEFTK("kai", 0x3270), DEFTK("gai", 0x332e), DEFTK("kairi", 0x333d), DEFTK("kaori", 0x333e), DEFTK("kaeru", 0x333f), DEFTK("kaki", 0x3340), DEFTK("kagi", 0x3343), DEFTK("kaku", 0x3344), DEFTK("gaku", 0x3358), DEFTK("kake", 0x335d), DEFTK("kasa", 0x335e), DEFTK("kasi", 0x335f), DEFTK("kaji", 0x3361), DEFTK("kajika", 0x3362), DEFTK("kata", 0x3363), DEFTK("katu", 0x3364), DEFTK("katuo", 0x336f), DEFTK("kanou", 0x3370), DEFTK("kaba", 0x3371), DEFTK("kaban", 0x3373), DEFTK("kabu", 0x3374), DEFTK("kabuto", 0x3375), DEFTK("kago", 0x3376), DEFTK("kama", 0x3377), DEFTK("kamu", 0x337a), DEFTK("kamo", 0x337b), DEFTK("kasiwa", 0x337c), DEFTK("kaya", 0x337d), DEFTK("kayu", 0x3421), DEFTK("kari", 0x3422), DEFTK("kawara", 0x3424), DEFTK("kan", 0x3425), DEFTK("gan", 0x345d), DEFTK("ki", 0x346b), DEFTK("gi", 0x3536), DEFTK("kiku", 0x3545), DEFTK("kiti", 0x3548), DEFTK("kitu", 0x3549), DEFTK("kinuta", 0x354e), DEFTK("kine", 0x354f), DEFTK("kibi", 0x3550), DEFTK("kyaku", 0x3551), DEFTK("gyaku", 0x3554), DEFTK("kyuu", 0x3556), DEFTK("gyuu", 0x356d), DEFTK("kyo", 0x356e), DEFTK("gyo", 0x3579), DEFTK("kyou", 0x357c), DEFTK("gyou", 0x3644), DEFTK("kyoku", 0x3649), DEFTK("gyoku", 0x364c), DEFTK("kiri", 0x364d), DEFTK("kiro", 0x364e), DEFTK("kin", 0x364f), DEFTK("gin", 0x3663), DEFTK("ku", 0x3665), DEFTK("gu", 0x3671), DEFTK("kuu", 0x3674), DEFTK("guu", 0x3676), DEFTK("kusi", 0x367a), DEFTK("kusiro", 0x367c), DEFTK("kuzu", 0x367d), DEFTK("kutu", 0x367e), DEFTK("kutuwa", 0x3725), DEFTK("kubo", 0x3726), DEFTK("kuma", 0x3727), DEFTK("kume", 0x3729), DEFTK("kuri", 0x372a), DEFTK("kuwa", 0x372c), DEFTK("kun", 0x372e), DEFTK("gun", 0x3732), DEFTK("ke", 0x3735), DEFTK("kei", 0x3738), DEFTK("gei", 0x375d), DEFTK("geki", 0x3760), DEFTK("keta", 0x3765), DEFTK("ketu", 0x3766), DEFTK("getu", 0x376e), DEFTK("ken", 0x376f), DEFTK("gen", 0x3835), DEFTK("ko", 0x3843), DEFTK("go", 0x385e), DEFTK("kotu", 0x3870), /* ko + i */ DEFTK("koi", 0x3871), DEFTK("kou", 0x3872), DEFTK("gou", 0x3964), DEFTK("kouji", 0x396d), DEFTK("koku", 0x396e), DEFTK("goku", 0x3976), DEFTK("roku", 0x3977), /* ko + si */ DEFTK("kosi", 0x3978), DEFTK("kosiki", 0x3979), DEFTK("kotu", 0x397a), DEFTK("koma", 0x397d), DEFTK("komi", 0x397e), DEFTK("kono", 0x3a21), DEFTK("koro", 0x3a22), DEFTK("kon", 0x3a23), DEFTK("sa", 0x3a33), DEFTK("za", 0x3a41), DEFTK("sai", 0x3a44), DEFTK("zai", 0x3a5e), DEFTK("go", 0x3a63), /* sa + eru */ DEFTK("saka", 0x3a64), DEFTK("sakai", 0x3a66), DEFTK("sakaki", 0x3a67), DEFTK("sakana", 0x3a68), DEFTK("saki", 0x3a69), DEFTK("sagi", 0x3a6d), DEFTK("saku", 0x3a6e), DEFTK("sakura", 0x3a79), DEFTK("sake", 0x3a7a), DEFTK("sasa", 0x3a7b), DEFTK("saji", 0x3a7c), DEFTK("satu", 0x3a7d), DEFTK("zatu", 0x3b28), DEFTK("satuki", 0x3b29), DEFTK("saba", 0x3b2a), DEFTK("betu", 0x3b2b), /* saba + ku */ DEFTK("sabi", 0x3b2c), DEFTK("same", 0x3b2d), DEFTK("sara", 0x3b2e), DEFTK("sarasi", 0x3b2f), DEFTK("san", 0x3b30), DEFTK("zan", 0x3b42), DEFTK("si", 0x3b45), DEFTK("ji", 0x3b76), DEFTK("sio", 0x3c2e), DEFTK("sika", 0x3c2f), DEFTK("siki", 0x3c30), DEFTK("sigi", 0x3c32), DEFTK("jiku", 0x3c33), DEFTK("sisi", 0x3c35), DEFTK("sizuku", 0x3c36), DEFTK("siti", 0x3c37), DEFTK("situ", 0x3c38), DEFTK("jitu", 0x3c42), DEFTK("sitomi", 0x3c43), DEFTK("sino", 0x3c44), DEFTK("si", 0x3c45), /* sino + bu */ DEFTK("siba", 0x3c46), DEFTK("sibe", 0x3c49), DEFTK("sima", 0x3c4a), DEFTK("sha", 0x3c4b), DEFTK("ja", 0x3c58), DEFTK("shaku", 0x3c5a), DEFTK("jaku", 0x3c63), DEFTK("shu", 0x3c67), DEFTK("ju", 0x3c74), DEFTK("shuu", 0x3c7c), DEFTK("juu", 0x3d3a), DEFTK("shuku", 0x3d47), DEFTK("juku", 0x3d4e), DEFTK("shutu", 0x3d50), DEFTK("jutu", 0x3d51), DEFTK("shun", 0x3d53), DEFTK("jun", 0x3d5a), DEFTK("sho", 0x3d68), DEFTK("jo", 0x3d75), DEFTK("shou", 0x3d7d), DEFTK("jou", 0x3e65), DEFTK("shoku", 0x3e7c), DEFTK("joku", 0x3f2b), DEFTK("siri", 0x3f2c), DEFTK("sin", 0x3f2d), DEFTK("jin", 0x3f4d), DEFTK("su", 0x3f5a), DEFTK("zu", 0x3f5e), DEFTK("sui", 0x3f61), DEFTK("zui", 0x3f6f), DEFTK("suu", 0x3f72), DEFTK("sue", 0x3f78), DEFTK("sugi", 0x3f79), DEFTK("suge", 0x3f7b), DEFTK("ha", 0x3f7c), /* sukobu + ru */ DEFTK("suzume", 0x3f7d), DEFTK("suso", 0x3f7e), DEFTK("chou", 0x4021), /* su + mu */ DEFTK("suri", 0x4022), DEFTK("sun", 0x4023), DEFTK("se", 0x4024), DEFTK("ze", 0x4027), DEFTK("sei", 0x4028), DEFTK("zei", 0x4047), DEFTK("seki", 0x4049), DEFTK("setu", 0x405a), DEFTK("zetu", 0x4064), DEFTK("semi", 0x4066), DEFTK("sen", 0x4067), DEFTK("zen", 0x4130), DEFTK("senti", 0x4138), DEFTK("so", 0x4139), DEFTK("sou", 0x414e), DEFTK("zou", 0x417c), DEFTK("soku", 0x4225), DEFTK("zoku", 0x422f), DEFTK("sotu", 0x4234), DEFTK("sode", 0x4235), DEFTK("sono", 0x4236), DEFTK("sen", 0x4237), /* soro + u */ DEFTK("son", 0x4238), DEFTK("ta", 0x423e), DEFTK("da", 0x4242), DEFTK("tai", 0x424e), DEFTK("dai", 0x4265), DEFTK("taka", 0x426b), DEFTK("taki", 0x426c), DEFTK("taku", 0x426e), DEFTK("daku", 0x4279), DEFTK("take", 0x427b), DEFTK("tako", 0x427c), DEFTK("tada", 0x427e), DEFTK("kou", 0x4321), /* tata + ku */ DEFTK("tan", 0x4322), /* tada + si */ DEFTK("tatu", 0x4323), DEFTK("datu", 0x4325), DEFTK("tatumi", 0x4327), DEFTK("tate", 0x4328), DEFTK("ten", 0x4329), /* tado + ru */ DEFTK("tana", 0x432a), DEFTK("tani", 0x432b), DEFTK("tanuki", 0x432c), DEFTK("tara", 0x432d), DEFTK("taru", 0x432e), DEFTK("dare", 0x432f), DEFTK("tan", 0x4330), DEFTK("dan", 0x4344), DEFTK("ti", 0x434d), DEFTK("tiku", 0x435b), DEFTK("titu", 0x4361), DEFTK("cha", 0x4363), DEFTK("chaku", 0x4364), DEFTK("chuu", 0x4366), DEFTK("cho", 0x4374), DEFTK("chou", 0x437a), DEFTK("choku", 0x443c), DEFTK("tin", 0x443f), DEFTK("tu", 0x4445), DEFTK("tui", 0x4446), DEFTK("tuu", 0x444b), DEFTK("tuka", 0x444d), DEFTK("tuga", 0x444e), DEFTK("kaku", 0x444f), /* tuka + mu */ DEFTK("tuki", 0x4450), DEFTK("tukuda", 0x4451), DEFTK("tuke", 0x4452), DEFTK("tuge", 0x4453), DEFTK("tuji", 0x4454), DEFTK("tuta", 0x4455), DEFTK("tuduri", 0x4456), DEFTK("tuba", 0x4457), DEFTK("tubaki", 0x4458), DEFTK("kai", 0x4459), /* tubu + su */ DEFTK("tubo", 0x445a), DEFTK("tuma", 0x445c), DEFTK("tumugi", 0x445d), DEFTK("tume", 0x445e), DEFTK("turi", 0x445f), DEFTK("turu", 0x4461), DEFTK("tei", 0x4462), DEFTK("dei", 0x4525), DEFTK("teki", 0x4526), DEFTK("deki", 0x452e), DEFTK("tetu", 0x452f), DEFTK("ten", 0x4535), DEFTK("den", 0x4541), DEFTK("to", 0x4546), DEFTK("do", 0x4558), DEFTK("tou", 0x455d), DEFTK("dou", 0x462f), DEFTK("touge", 0x463d), DEFTK("toki", 0x463e), DEFTK("toku", 0x463f), DEFTK("doku", 0x4647), DEFTK("toti", 0x464a), DEFTK("totu", 0x464c), DEFTK("todo", 0x464e), DEFTK("todoke", 0x464f), DEFTK("tobi", 0x4650), DEFTK("toma", 0x4651), DEFTK("tora", 0x4652), DEFTK("tori", 0x4653), DEFTK("toro", 0x4654), DEFTK("ton", 0x4655), DEFTK("don", 0x465d), DEFTK("na", 0x4660), DEFTK("nai", 0x4662), DEFTK("nagara", 0x4663), DEFTK("nagi", 0x4664), DEFTK("nazo", 0x4666), DEFTK("nada", 0x4667), DEFTK("natu", 0x4668), DEFTK("nabe", 0x4669), DEFTK("nara", 0x466a), DEFTK("nare", 0x466b), DEFTK("nawa", 0x466c), DEFTK("nawate", 0x466d), DEFTK("nan", 0x466e), DEFTK("nanji", 0x4672), DEFTK("ni", 0x4673), DEFTK("nioi", 0x4677), DEFTK("sin", 0x4678), /* nigi + wau */ DEFTK("niku", 0x4679), DEFTK("niji", 0x467a), DEFTK("nijuu", 0x467b), DEFTK("niti", 0x467c), DEFTK("nyuu", 0x467d), DEFTK("nyo", 0x4721), DEFTK("nyou", 0x4722), DEFTK("nira", 0x4723), DEFTK("nin", 0x4724), DEFTK("nure", 0x4728), DEFTK("ne", 0x4729), DEFTK("nei", 0x472b), DEFTK("negi", 0x472c), DEFTK("neko", 0x472d), DEFTK("netu", 0x472e), DEFTK("nen", 0x472f), DEFTK("no", 0x4735), DEFTK("nou", 0x4739), DEFTK("si", 0x4741), /* nozo + ku */ DEFTK("nomi", 0x4742), DEFTK("ha", 0x4743), DEFTK("ba", 0x474c), DEFTK("hai", 0x4750), DEFTK("bai", 0x475c), DEFTK("sha", 0x4767), /* ha + u */ DEFTK("hae", 0x4768), DEFTK("hakari", 0x4769), DEFTK("sin", 0x476a), /* ha + gu */ DEFTK("hagi", 0x476b), DEFTK("haku", 0x476c), DEFTK("baku", 0x4778), DEFTK("hako", 0x4821), DEFTK("hazama", 0x4823), DEFTK("hasi", 0x4824), DEFTK("hajime", 0x4825), DEFTK("hazu", 0x4826), DEFTK("haze", 0x4827), DEFTK("hata", 0x4828), DEFTK("hada", 0x4829), DEFTK("hatake", 0x482a), DEFTK("hati", 0x482c), DEFTK("hatu", 0x482e), DEFTK("batu", 0x4832), DEFTK("hato", 0x4837), DEFTK("hanasi", 0x4838), DEFTK("haniwa", 0x4839), DEFTK("hamaguri", 0x483a), DEFTK("hayabusa", 0x483b), DEFTK("han", 0x483c), DEFTK("ban", 0x4854), DEFTK("hi", 0x485b), DEFTK("bi", 0x4877), DEFTK("hiiragi", 0x4922), DEFTK("hie", 0x4923), DEFTK("hiki", 0x4924), DEFTK("hige", 0x4926), DEFTK("hiko", 0x4927), DEFTK("hiza", 0x4928), DEFTK("hisi", 0x4929), DEFTK("hiji", 0x492a), DEFTK("hitu", 0x492b), DEFTK("hinoki", 0x4930), DEFTK("hime", 0x4931), DEFTK("himo", 0x4933), DEFTK("hyaku", 0x4934), DEFTK("byuu", 0x4935), DEFTK("hyou", 0x4936), DEFTK("byou", 0x4940), DEFTK("hiru", 0x4947), DEFTK("hire", 0x4949), DEFTK("hin", 0x494a), DEFTK("bin", 0x4952), DEFTK("fu", 0x4954), DEFTK("bu", 0x496e), DEFTK("fuu", 0x4975), DEFTK("fuki", 0x4978), DEFTK("fuku", 0x497a), DEFTK("futi", 0x4a25), DEFTK("futu", 0x4a26), DEFTK("butu", 0x4a29), DEFTK("funa", 0x4a2b), DEFTK("fun", 0x4a2c), DEFTK("bun", 0x4a38), DEFTK("hei", 0x4a3a), DEFTK("bei", 0x4a46), DEFTK("pe-ji", 0x4a47), DEFTK("heki", 0x4a48), DEFTK("betu", 0x4a4c), DEFTK("hera", 0x4a4f), DEFTK("hen", 0x4a50), DEFTK("ben", 0x4a58), DEFTK("ho", 0x4a5d), DEFTK("bo", 0x4a67), DEFTK("hou", 0x4a6f), DEFTK("bou", 0x4b33), DEFTK("bai", 0x4b4a), /* ho + eru */ DEFTK("hoo", 0x4b4b), DEFTK("hoku", 0x4b4c), DEFTK("boku", 0x4b4d), DEFTK("botan", 0x4b55), DEFTK("botu", 0x4b56), DEFTK("hotondo", 0x4b58), DEFTK("hori", 0x4b59), DEFTK("horo", 0x4b5a), DEFTK("hon", 0x4b5b), DEFTK("bon", 0x4b5e), DEFTK("ma", 0x4b60), DEFTK("mai", 0x4b64), DEFTK("mairu", 0x4b69), DEFTK("maki", 0x4b6a), DEFTK("maku", 0x4b6b), DEFTK("makura", 0x4b6d), DEFTK("maguro", 0x4b6e), DEFTK("masa", 0x4b6f), DEFTK("masu", 0x4b70), DEFTK("mata", 0x4b72), DEFTK("matu", 0x4b75), DEFTK("made", 0x4b78), DEFTK("mama", 0x4b79), DEFTK("mayu", 0x4b7a), DEFTK("maro", 0x4b7b), DEFTK("man", 0x4b7c), DEFTK("mi", 0x4c23), DEFTK("misaki", 0x4c28), DEFTK("mitu", 0x4c29), DEFTK("minato", 0x4c2b), DEFTK("mino", 0x4c2c), DEFTK("nen", 0x4c2d), /* mino + ru */ DEFTK("myaku", 0x4c2e), DEFTK("myou", 0x4c2f), DEFTK("miri", 0x4c30), DEFTK("min", 0x4c31), DEFTK("mu", 0x4c33), DEFTK("muku", 0x4c3a), DEFTK("muko", 0x4c3b), DEFTK("musume", 0x4c3c), DEFTK("mei", 0x4c3d), DEFTK("mesu", 0x4c46), DEFTK("metu", 0x4c47), DEFTK("men", 0x4c48), DEFTK("mo", 0x4c4e), DEFTK("mou", 0x4c51), DEFTK("cho", 0x4c59), /* mou + keru */ DEFTK("moku", 0x4c5a), DEFTK("moti", 0x4c5e), DEFTK("mottomo", 0x4c60), DEFTK("rei", 0x4c61), /* modo + ru */ DEFTK("momi", 0x4c62), DEFTK("morai", 0x4c63), DEFTK("mon", 0x4c64), DEFTK("monme", 0x4c68), DEFTK("ya", 0x4c69), DEFTK("yaku", 0x4c71), DEFTK("yasu", 0x4c77), DEFTK("yanagi", 0x4c78), DEFTK("yabu", 0x4c79), DEFTK("yari", 0x4c7a), DEFTK("yu", 0x4c7b), DEFTK("yui", 0x4d23), DEFTK("yuu", 0x4d24), DEFTK("yo", 0x4d3d), DEFTK("you", 0x4d43), DEFTK("yoku", 0x4d5d), DEFTK("yodo", 0x4d64), DEFTK("ra", 0x4d65), DEFTK("rai", 0x4d68), DEFTK("raku", 0x4d6c), DEFTK("ran", 0x4d70), DEFTK("ri", 0x4d78), DEFTK("riku", 0x4e26), DEFTK("ritu", 0x4e27), DEFTK("ryaku", 0x4e2b), DEFTK("ryuu", 0x4e2d), DEFTK("ryo", 0x4e37), DEFTK("ryou", 0x4e3b), DEFTK("ryoku", 0x4e4f), DEFTK("rin", 0x4e51), DEFTK("ru", 0x4e5c), DEFTK("rui", 0x4e5d), DEFTK("rei", 0x4e61), DEFTK("reki", 0x4e71), DEFTK("retu", 0x4e73), DEFTK("ren", 0x4e77), DEFTK("ro", 0x4f24), DEFTK("rou", 0x4f2b), DEFTK("roku", 0x4f3b), DEFTK("ron", 0x4f40), DEFTK("wa", 0x4f41), DEFTK("wai", 0x4f44), DEFTK("waki", 0x4f46), DEFTK("waku", 0x4f47), DEFTK("wasi", 0x4f49), DEFTK("wataru", 0x4f4a), DEFTK("sen", 0x4f4b), /* wata + ru */ DEFTK("wani", 0x4f4c), DEFTK("wabi", 0x4f4d), DEFTK("wara", 0x4f4e), DEFTK("warabi", 0x4f4f), DEFTK("wan", 0x4f50), DEFTK(NULL, 0x4f54), }; #define TANKANLISTSIZ arraysize(tankanlist) static int NEAR Xjis2str(buf, c) char *buf; u_int c; { #ifndef CODEEUC char tmp[MAXKLEN + 1]; #endif int n; #ifdef CODEEUC n = jis2str(buf, c); #else n = jis2str(tmp, c); VOID_C kanjiconv2(buf, tmp, MAXKLEN, DEFCODE, EUC, L_INPUT); #endif return n; } static VOID NEAR roman2str(buf, s, size) char *buf; CONST char *s; ALLOC_T size; { ALLOC_T ptr, len; int i, n; ptr = (ALLOC_T)0; while (size) { #ifdef FAKEUNINIT n = 0; /* fake for -Wuninitialized */ #endif for (len = size; len > (ALLOC_T)0; len--) if ((n = searchroman(s, len)) >= 0) break; if (len <= (ALLOC_T)0) { if (*s == 'n') ptr += Xjis2str(&(buf[ptr]), J_NN); else if (*s == '-') ptr += Xjis2str(&(buf[ptr]), J_CHO); else if (*s == *(s + 1)) ptr += Xjis2str(&(buf[ptr]), J_TSU); s++; size--; continue; } for (i = 0; i < R_MAXKANA; i++) { if (!romanlist[n].code[i]) break; ptr += Xjis2str(&(buf[ptr]), romanlist[n].code[i]); } s += len; size -= len; } buf[ptr] = '\0'; } int main(argc, argv) int argc; char *CONST argv[]; { FILE *fp; char buf[MAXKANASTR + 1]; char kbuf[MAXKLEN * R_MAXKANA + 1], tbuf[sizeof(tankanstr) + 1]; u_short code; int n, len; if (argc < 2 || !(fp = fopen(argv[1], "wb"))) { VOID_C fprintf(stderr, "Cannot open file.\n"); return(1); } initroman(); for (n = len = 0; n < arraysize(tankanstr); n++) len += Xjis2str(&(tbuf[len]), tankanstr[n]); for (n = 0; n < TANKANLISTSIZ - 1; n++) { if (!tankanlist[n].str) continue; roman2str(buf, tankanlist[n].str, tankanlist[n].len); code = tankanlist[n].code; while (code < tankanlist[n + 1].code) { VOID_C Xjis2str(kbuf, code++); VOID_C fprintf(fp, "%s %s %s %d\n", buf, kbuf, tbuf, DEFFREQ); while (!VALIDJIS(code)) if (++code >= J_MAX) break; } } VOID_C fclose(fp); return(0); } FD-3.01j/mkkanji.c100644 2105 1751 4051 13516612560 12451 0ustar shiraiuser/* * mkkanji.c * * preprocesser for "kanji.h" */ #include "headers.h" #include "typesize.h" #define MAXLINEBUF 255 #define MESCONVSTR "mesconv" #define MESLISTSTR "meslist" #define MESCONVSTR2 "mesconv2" #define MESLISTSTR2 "meslist" int main __P_((int, char *CONST [])); int main(argc, argv) int argc; char *CONST argv[]; { FILE *fpin, *fpout; char *cp, *s, buf[MAXLINEBUF + 1]; long n; u_short sum; int i, len, quote; if (argc <= 1 || argc > 3) { VOID_C fprintf(stderr, "Usage: mkkanji []\n"); return(1); } if (!strcmp(argv[1], "-")) fpin = stdin; else if (!(fpin = fopen(argv[1], "r"))) { VOID_C fprintf(stderr, "%s: cannot open.\n", argv[1]); return(1); } if (argc <= 2) fpout = stdout; else if (!(fpout = fopen(argv[2], "w"))) { VOID_C fprintf(stderr, "%s: cannot open.\n", argv[2]); VOID_C fclose(fpin); return(1); } n = 0L; sum = (u_short)0; while (fgets(buf, sizeof(buf), fpin)) { s = NULL; len = 0; for (cp = buf; cp; cp = strpbrk(cp, " \t")) { while (*cp == ' ' || *cp == '\t') cp++; if (!*cp) break; if (!strncmp(cp, MESCONVSTR, strsize(MESCONVSTR))) { s = MESCONVSTR2; len = strsize(MESCONVSTR); break; } if (!strncmp(cp, MESLISTSTR, strsize(MESLISTSTR))) { s = MESLISTSTR2; len = strsize(MESLISTSTR); break; } } if (s) { for (i = len; cp[i]; i++) if (cp[i] != ' ' && cp[i] != '\t') break; if (cp[i] != '(') s = NULL; else { len = cp - buf; cp += ++i; while (*cp == ' ' || *cp == '\t') cp++; } } if (!s) VOID_C fputs(buf, fpout); else if (++n >= MAXUTYPE(u_short)) { VOID_C fprintf(stderr, "too many entries.\n"); VOID_C fclose(fpin); VOID_C fclose(fpout); return(1); } else { quote = '\0'; for (i = 0; cp[i]; i++) { if (cp[i] == quote) quote = '\0'; else if (quote) sum += cp[i]; else if (cp[i] == '"') quote = cp[i]; } VOID_C fprintf(fpout, "%-.*s%s(%3ld, %s", len, buf, s, n, cp); } } VOID_C fprintf(fpout, "\n#define\tCAT_SUM\t%u\n", (u_int)sum & 0xffff); return(0); } FD-3.01j/mkcat.c100644 2105 1751 21767 13516612560 12161 0ustar shiraiuser/* * mkcat.c * * message catalog generator */ #define K_EXTERN #include "headers.h" #include "kctype.h" #include "typesize.h" #include "version.h" #include "evalopt.h" #include "gentbl.h" #define MAXLINEBUF 255 #define MAXVERBUF 8 #define MAXCATALOG 2 #define CF_KANJI 0001 #define CF_NOSUM 0100 #define DEFINESTR "define" #define MESCONVSTR "mesconv2" #define MESLISTSTR "meslist" #define CATSUMSTR "CAT_SUM" #define VERSIONSTR "#version\t" #define SUMSTR "#sum\t" #define BEGINSTR "#begin\t" #define ENDSTR "#end" static VOID_P NEAR Xrealloc __P_((VOID_P, ALLOC_T)); static char *NEAR fgets2 __P_((FILE *)); static char *NEAR getversion __P_((VOID_A)); static CONST char *NEAR getnum __P_((CONST char *, u_int *)); static int NEAR geteol __P_((CONST char *)); static VOID NEAR putstr __P_((CONST char *, int, FILE *)); static int NEAR mkcat __P_((FILE *, FILE *)); static int NEAR addbuf __P_((u_int, CONST char *)); static VOID NEAR cleanbuf __P_((VOID_A)); static int NEAR cnvcat __P_((FILE *, FILE *)); int main __P_((int, char *CONST [])); static char **meslist = NULL; static u_int maxmes = (u_int)0; static int n_column = 0; static CONST char escapechar[] = "abefnrtv"; static CONST char escapevalue[] = { 0x07, 0x08, 0x1b, 0x0c, 0x0a, 0x0d, 0x09, 0x0b, }; static CONST opt_t optlist[] = { {'c', &n_column, 0, "column"}, {'\0', NULL, 0, NULL}, }; static VOID_P NEAR Xrealloc(ptr, size) VOID_P ptr; ALLOC_T size; { if (!size) return(NULL); return((ptr) ? realloc(ptr, size) : malloc(size)); } static char *NEAR fgets2(fp) FILE *fp; { char *cp, *tmp, buf[MAXLINEBUF + 1]; ALLOC_T i, len, size; int cont; cp = NULL; size = (ALLOC_T)0; for (;;) { if (!fgets(buf, sizeof(buf), fp)) return(cp); len = strlen(buf); if (!len || buf[len - 1] != '\n') cont = 1; else { cont = 0; len--; } if (!(tmp = (char *)Xrealloc(cp, size + len + 1))) { free(cp); return(NULL); } cp = tmp; memcpy(&(cp[size]), buf, len); cp[size += len] = '\0'; if (cont) continue; if (!len) break; for (i = 0; i < len - 1; i++) if (iskanji1(buf, i)) i++; if (i >= len || buf[i] != '\\') break; size--; } return(cp); } static char *NEAR getversion(VOID_A) { static char buf[MAXVERBUF]; char *cp; int n; if (!(cp = strchr(version, ' '))) cp = version; else while (*cp == ' ') cp++; memset(buf, '\0', sizeof(buf)); for (n = 0; cp[n]; n++) { if (n >= sizeof(buf) - 1 || cp[n] == ' ') break; buf[n] = cp[n]; } return(buf); } static CONST char *NEAR getnum(cp, wp) CONST char *cp; u_int *wp; { long n; char *tmp; if (!Xisdigit(*cp)) return(NULL); n = strtol(cp, &tmp, 10); if (n < 0L || n >= MAXUTYPE(u_int) || !tmp || tmp <= cp) return(NULL); if (wp) *wp = (u_int)n; return(tmp); } static int NEAR geteol(s) CONST char *s; { int i; for (i = 0; s[i]; i++) { if (s[i] == '\\') { if (!s[++i]) return(-1); } else if (iskanji1(s, i)) i++; else if (s[i] == '"') break; } if (!s[i]) return(-1); return(i); } static VOID NEAR putstr(s, len, fp) CONST char *s; int len; FILE *fp; { int i, c, n; for (i = 0; i < len; i++) { if (iskanji1(s, i)) { VOID_C fputc(s[i], fp); VOID_C fputc(s[++i], fp); } else if (s[i] != '\\') VOID_C fputc(s[i], fp); else { i++; c = 0; for (n = 0; n < 3; n++) { if (s[i + n] < '0' || s[i + n] > '7') break; c = c * 8 + s[i + n] - '0'; } if (n > 0) i += n - 1; else { c = s[i]; for (n = 0; escapechar[n]; n++) if (c == escapechar[n]) break; if (escapechar[n]) c = escapevalue[n]; } VOID_C fputc(c, fp); } } VOID_C fputc('\n', fp); } static int NEAR mkcat(fpin, fpout) FILE *fpin, *fpout; { CONST char *cp, *tmp, *ptr[MAXCATALOG]; char *buf; u_int w; int i, c, len[MAXCATALOG]; VOID_C fprintf(fpout, "%s%s\n", VERSIONSTR, getversion()); for (; (buf = fgets2(fpin)); free(buf)) { cp = buf; if (*(cp++) != '#') continue; while (Xisblank(*cp)) cp++; if (strncmp(cp, DEFINESTR, strsize(DEFINESTR))) continue; cp += strsize(DEFINESTR); if (!Xisblank(*cp)) continue; for (cp++; Xisblank(*cp); cp++) /*EMPTY*/; tmp = cp; if (!Xisalpha(*(cp++))) continue; while (Xisalnum(*cp) || *cp == '_') cp++; if (!Xisblank(*cp)) continue; i = cp - tmp; for (cp++; Xisblank(*cp); cp++) /*EMPTY*/; if (i == strsize(CATSUMSTR) && !strncmp(tmp, CATSUMSTR, i)) { if (!(cp = getnum(cp, &w)) || *cp) continue; VOID_C fprintf(fpout, "%s%u\n", SUMSTR, w); continue; } if (!strncmp(cp, MESCONVSTR, strsize(MESCONVSTR))) cp += strsize(MESCONVSTR); else if (!strncmp(cp, MESLISTSTR, strsize(MESLISTSTR))) cp += strsize(MESLISTSTR); else continue; while (Xisblank(*cp)) cp++; if (*(cp++) != '(') continue; while (Xisblank(*cp)) cp++; if (!(cp = getnum(cp, &w)) || *(cp++) != ',') continue; for (i = 0; i < MAXCATALOG; i++) { while (Xisblank(*cp)) cp++; if (*(cp++) != '"') break; if ((len[i] = geteol(cp)) < 0) break; ptr[i] = cp; cp += len[i] + 1; while (Xisblank(*cp)) cp++; c = (i < MAXCATALOG - 1) ? ',' : ')'; if (*(cp++) != c) break; } if (i < MAXCATALOG) continue; VOID_C fprintf(fpout, "%s%u\n", BEGINSTR, w); putstr(ptr[n_column - 1], len[n_column - 1], fpout); VOID_C fprintf(fpout, "%s\n", ENDSTR); } return(0); } static int NEAR addbuf(n, s) u_int n; CONST char *s; { char *cp, **tmp; ALLOC_T len, size; if (n >= maxmes) { tmp = (char **)Xrealloc(meslist, (n + 1) * sizeof(char *)); if (!tmp) return(-1); meslist = tmp; while (maxmes <= n) meslist[maxmes++] = NULL; } len = strlen(s); if (!meslist[n]) { size = (ALLOC_T)0; cp = (char *)malloc(len + 1); if (!cp) return(-1); } else { size = strlen(meslist[n]); cp = (char *)Xrealloc(meslist[n], size + 1 + len + 1); if (!cp) return(-1); cp[size++] = '\n'; } memcpy(&(cp[size]), s, len + 1); meslist[n] = cp; return(0); } static VOID NEAR cleanbuf(VOID_A) { u_int n; if (meslist) { for (n = 0; n < maxmes; n++) if (meslist[n]) free(meslist[n]); free(meslist); } maxmes = (u_int)0; meslist = NULL; } static int NEAR cnvcat(fpin, fpout) FILE *fpin, *fpout; { CONST char *cp; char *buf, *ver; long n; u_int i, w, sum, flags; ver = NULL; w = sum = (u_int)0; flags = CF_NOSUM; for (; (buf = fgets2(fpin)); free(buf)) { cp = buf; if (w) { if (!strcmp(buf, ENDSTR)) w = (u_int)0; else if (addbuf(w, buf) < 0) { VOID_C fprintf(stderr, "Cannot allocate memory.\n"); cleanbuf(); return(-1); } else if (!(flags & CF_KANJI)) { for (i = 0; buf[i]; i++) if (ismsb(buf[i])) break; if (buf[i]) flags |= CF_KANJI; } } else if (!strncmp(buf, VERSIONSTR, strsize(VERSIONSTR))) { cp += strsize(VERSIONSTR); ver = getversion(); if (strcmp(cp, ver)) { VOID_C fprintf(stderr, "%s: Illegal version.\n", cp); cleanbuf(); return(-1); } } else if (!strncmp(buf, SUMSTR, strsize(SUMSTR))) { cp += strsize(SUMSTR); if (!(cp = getnum(cp, &sum)) || *cp || !sum) { VOID_C fprintf(stderr, "%s: Illegal check sum.\n", cp); cleanbuf(); return(-1); } flags &= ~CF_NOSUM; } else if (!strncmp(buf, BEGINSTR, strsize(BEGINSTR))) { cp += strsize(BEGINSTR); if (!(cp = getnum(cp, &w)) || *cp || !w) { VOID_C fprintf(stderr, "%s: Illegal ID.\n", cp); cleanbuf(); return(-1); } } } if (!ver) { VOID_C fprintf(stderr, "No version exists.\n"); cleanbuf(); return(-1); } if (flags & CF_NOSUM) { VOID_C fprintf(stderr, "No check sum exists.\n"); cleanbuf(); return(-1); } if (!buf) { if (fwrite(ver, MAXVERBUF, 1, fpout) != 1 || fputword(flags, fpout) < 0 || fputword(sum, fpout) < 0 || fputword(maxmes, fpout) < 0) { VOID_C fprintf(stderr, "Cannot write.\n"); cleanbuf(); return(-1); } n = 0L; for (i = 0; i < maxmes; i++) { n += (meslist[i]) ? strlen(meslist[i]) : 0; n++; if (n >= MAXUTYPE(u_short)) { VOID_C fprintf(stderr, "Too mary messages.\n"); cleanbuf(); return(-1); } if (fputword(n, fpout) < 0) { VOID_C fprintf(stderr, "Cannot write.\n"); cleanbuf(); return(-1); } } for (i = 0; i < maxmes; i++) { cp = (meslist[i]) ? meslist[i] : ""; n = strlen(cp); if (fwrite(cp, n + 1, 1, fpout) != 1) { VOID_C fprintf(stderr, "Cannot write.\n"); cleanbuf(); return(-1); } } } cleanbuf(); if (buf) return(-1); return(0); } int main(argc, argv) int argc; char *CONST argv[]; { FILE *fpin, *fpout; int n; initopt(optlist); n = evalopt(argc, argv, optlist); if (n >= argc || n + 2 < argc) { optusage(argv[0], " []", optlist); return(1); } if (n_column > MAXCATALOG) { VOID_C fprintf(stderr, "%d: Column too large.\n", n_column); return(1); } if (!strcmp(argv[n], "-")) fpin = stdin; else if (!(fpin = fopen(argv[n], "r"))) { VOID_C fprintf(stderr, "%s: Cannot open.\n", argv[n]); return(1); } if (n + 1 >= argc) fpout = stdout; else if (!(fpout = opentbl(argv[n + 1]))) { VOID_C fclose(fpin); return(1); } if (n_column) n = mkcat(fpin, fpout); else n = cnvcat(fpin, fpout); VOID_C fclose(fpin); VOID_C fclose(fpout); if (n < 0) return(1); return(0); } FD-3.01j/mkdir_p.c100644 2105 1751 4006 13516612560 12452 0ustar shiraiuser/* * mkdir_p.c * * make directory with parent directories */ #define K_EXTERN #include "headers.h" #include "kctype.h" #include "typesize.h" #if MSDOS && !defined (DJGPP) #undef MAXPATHLEN #define MAXPATHLEN 260 #define unixmkdir(p, m) ((mkdir(p)) ? -1 : 0) #else #define unixmkdir(p, m) ((mkdir(p, m)) ? -1 : 0) #endif static int a2octal __P_((CONST char *)); static char *strrdelim __P_((CONST char *)); static int mkdir_p __P_((CONST char *, int)); int main __P_((int, char *CONST [])); static int a2octal(s) CONST char *s; { CONST char *cp; int n; if (!s) return(-1); n = 0; for (cp = s; *cp; cp++) { if (*cp < '0' || *cp > '7') break; n *= 8; n += *cp - '0'; } if (cp <= s) return(-1); return(n); } static char *strrdelim(s) CONST char *s; { CONST char *cp; cp = NULL; for (; *s; s++) { if (*s == _SC_) cp = s; #ifdef BSPATHDELIM if (iskanji1(s, 0)) s++; #endif } return((char *)cp); } static int mkdir_p(path, mode) CONST char *path; int mode; { char *cp, buf[MAXPATHLEN]; ALLOC_T len; if (unixmkdir(path, mode) >= 0) return(0); if (errno != ENOENT) return(-1); cp = strrdelim(path); if (!cp || cp < path) { errno = ENOENT; return(-1); } if ((len = cp - path) >= strsize(buf)) { errno = ENAMETOOLONG; return(-1); } memcpy(buf, path, len); buf[len] = '\0'; if (mkdir_p(buf, mode) < 0) return(-1); return(unixmkdir(path, mode)); } int main(argc, argv) int argc; char *CONST argv[]; { CONST char *cp; int n, mode; mode = 0777; for (n = 1; n < argc; n++) { if (argv[n][0] != '-' || !argv[n][1]) break; if (argv[n][1] == '-' && !argv[n][2]) { n++; break; } if (argv[n][1] == 'm') { cp = &(argv[n][2]); if (!*cp) cp = argv[++n]; if ((mode = a2octal(cp)) < 0) { n = argc; break; } } } if (n >= argc || n + 1 < argc) { VOID_C fprintf(stderr, "Usage: mkdir_p [-m ] \n"); return(1); } if (mkdir_p(argv[n], mode) < 0) { VOID_C fprintf(stderr, "%s: cannot make directory.\n", argv[n]); return(1); } return(0); } FD-3.01j/kanjicnv.c100644 2105 1751 15636 13516612560 12663 0ustar shiraiuser/* * kanjicnv.c * * tiny Kanji code converter */ #include "headers.h" #include "evalopt.h" #ifdef WITHUTF8 #define K_EXTERN #include "kctype.h" #endif #define ASCII 000 #define KANA 001 #define KANJI 002 #define JKANA 004 #define K_SJIS 010 #define K_EUC 020 #define K_UTF8 040 #define U2_UDEF 0x3013 /* GETA */ #define MINUNICODE 0x00a7 #define MAXUNICODE 0xffe5 #define MINKANJI 0x8140 #define MAXKANJI 0xfc4b #define getword(s, n) (((u_short)((s)[(n) + 1]) << 8) | (s)[n]) #ifdef WITHUTF8 extern CONST u_char unitblbuf[]; extern u_int unitblent; extern int nftblnum; extern int nflen; extern CONST u_char *nftblbuf[]; extern u_int nftblent[]; #endif static VOID NEAR Xfputc __P_((int, FILE *)); #ifdef WITHUTF8 static u_int NEAR cnvunicode __P_((u_int)); static VOID NEAR fputucs2 __P_((u_int, FILE *)); static VOID NEAR ucs2normalization __P_((u_int, int, FILE *)); static VOID NEAR convertutf8 __P_((u_int, FILE *)); #endif static VOID NEAR convert __P_((int, int, FILE *)); static VOID NEAR output __P_((FILE *, int, int)); int main __P_((int, char *CONST [])); static int msboff = 0; static int prefix = 0; static int removebs = 0; static int kanjicode = K_SJIS; static CONST opt_t optlist[] = { {'7', &msboff, 1, NULL}, {'b', &removebs, 1, NULL}, {'c', &prefix, 1, NULL}, {'e', &kanjicode, K_EUC, NULL}, {'s', &kanjicode, K_SJIS, NULL}, #ifdef WITHUTF8 {'u', &kanjicode, K_UTF8, NULL}, #endif {'\0', NULL, 0, NULL}, }; static VOID NEAR Xfputc(c, fp) int c; FILE *fp; { if (msboff && (c & 0x80)) VOID_C fprintf(fp, "\\%03o", c); else VOID_C fputc(c, fp); } #ifdef WITHUTF8 static u_int NEAR cnvunicode(wc) u_int wc; { CONST u_char *cp; u_int w, ofs, min, max; if (wc < 0x0080) return(wc); if (wc >= 0x00a1 && wc <= 0x00df) return(0xff00 | (wc - 0x00a1 + 0x61)); if (wc >= 0x8260 && wc <= 0x8279) return(0xff00 | (wc - 0x8260 + 0x21)); if (wc >= 0x8281 && wc <= 0x829a) return(0xff00 | (wc - 0x8281 + 0x41)); if (wc < MINKANJI || wc > MAXKANJI) return(U2_UDEF); # if 0 wc = unifysjis(wc, 0); # endif ofs = min = max = 0; cp = unitblbuf; for (ofs = 0; ofs < unitblent; ofs++) { w = getword(cp, 2); if (wc == w) return(getword(cp, 0)); cp += 4; } return(U2_UDEF); } static VOID NEAR fputucs2(wc, fp) u_int wc; FILE *fp; { if (wc < 0x80) Xfputc(wc, fp); else if (wc < 0x800) { Xfputc(0xc0 | (wc >> 6), fp); Xfputc(0x80 | (wc & 0x3f), fp); } else { Xfputc(0xe0 | (wc >> 12), fp); Xfputc(0x80 | ((wc >> 6) & 0x3f), fp); Xfputc(0x80 | (wc & 0x3f), fp); } } static VOID NEAR ucs2normalization(wc, nf, fp) u_int wc; int nf; FILE *fp; { CONST u_char *cp; u_int w, ofs, ent; int n; if (nf <= 0 || nf > nftblnum || wc < MINUNICODE || wc > MAXUNICODE) { cp = NULL; ofs = ent = (u_int)0; } else { n = 2 + nflen * 2; cp = nftblbuf[nf - 1]; ent = nftblent[nf - 1]; for (ofs = 0; ofs < ent; ofs++) { w = getword(cp, 0); if (wc == w) break; cp += n; } } if (ofs >= ent) fputucs2(wc, fp); else for (n = 0; n < nflen; n++) { cp += 2; w = getword(cp, 0); if (!w) break; fputucs2(w, fp);; } } static VOID NEAR convertutf8(wc, fp) u_int wc; FILE *fp; { ucs2normalization(cnvunicode(wc), WITHUTF8, fp); } #endif /* WITHUTF8 */ static VOID NEAR convert(j1, j2, fp) int j1, j2; FILE *fp; { int c1, c2; c1 = c2 = '\0'; if (kanjicode == K_EUC) { if (j1) { c1 = (j1 | 0x80); c2 = (j2 | 0x80); } else if (j2 <= 0x20 || j2 >= 0x60) c2 = j2; else { c1 = 0x8e; c2 = (j2 | 0x80); } } else { if (j1) { c1 = ((j1 - 1) >> 1) + ((j1 < 0x5f) ? 0x71 : 0xb1); c2 = j2 + ((j1 & 1) ? ((j2 < 0x60) ? 0x1f : 0x20) : 0x7e); } else if (j2 <= 0x20 || j2 >= 0x60) c2 = j2; else c2 = (j2 | 0x80); #ifdef WITHUTF8 if (kanjicode == K_UTF8) { convertutf8(((u_int)c1 << 8) | c2, fp); c1 = c2 = '\0'; } #endif } if (c1) Xfputc(c1, fp); if (c2) Xfputc(c2, fp); if (c2 == '\\' && (prefix || msboff)) Xfputc('\\', fp); } static VOID NEAR output(fp, c, mode) FILE *fp; int c, mode; { static u_char buf[2]; static int kanji1 = 0; static int bufp = 0; if (!fp) { bufp = kanji1 = 0; return; } if (!bufp) /*EMPTY*/; else if (bufp > 1) { convert(buf[0], buf[1], fp); bufp = 0; } else if (kanji1 & (KANA | JKANA)) { convert(0, buf[0], fp); bufp = 0; } else if (!(kanji1 & KANJI)) { Xfputc(buf[0], fp); bufp = 0; } kanji1 = mode; if (c != EOF) buf[bufp++] = c; } int main(argc, argv) int argc; char *CONST argv[]; { FILE *fpin, *fpout; int n, c, mode, esc, kanji; initopt(optlist); n = evalopt(argc, argv, optlist); if (n >= argc || n + 2 < argc) { optusage(argv[0], " []", optlist); return(1); } if (!strcmp(argv[n], "-")) fpin = stdin; else if (!(fpin = fopen(argv[n], "r"))) { VOID_C fprintf(stderr, "%s: cannot open.\n", argv[n]); return(1); } if (n + 1 >= argc) fpout = stdout; else if (!(fpout = fopen(argv[n + 1], "w"))) { VOID_C fprintf(stderr, "%s: cannot open.\n", argv[n + 1]); VOID_C fclose(fpin); return(1); } mode = ASCII; esc = kanji = 0; while ((c = fgetc(fpin)) != EOF) { switch (c) { case '\033': /* ESC */ if (esc) output(fpout, '\033', mode); else if (kanji > 0) { output(fpout, '\033', mode); output(fpout, '$', mode); } else if (kanji < 0) { output(fpout, '\033', mode); output(fpout, '(', mode); } esc = 1; kanji = 0; break; case '$': if (!esc) { if (!kanji) output(fpout, c, mode); } else { mode &= ~JKANA; esc = 0; kanji = 1; } break; case '(': if (!esc) { if (!kanji) output(fpout, c, mode); } else { mode &= ~JKANA; esc = 0; kanji = -1; } break; case '\016': /* SO */ if (esc) output(fpout, '\033', mode); else if (kanji > 0) { output(fpout, '\033', mode); output(fpout, '$', mode); } else if (kanji < 0) { output(fpout, '\033', mode); output(fpout, '(', mode); } mode |= KANA; esc = kanji = 0; break; case '\017': /* SI */ if (esc) output(fpout, '\033', mode); else if (kanji > 0) { output(fpout, '\033', mode); output(fpout, '$', mode); } else if (kanji < 0) { output(fpout, '\033', mode); output(fpout, '(', mode); } mode &= ~KANA; esc = kanji = 0; break; case '\b': if (removebs) { if (esc) output(fpout, '\033', mode); else if (kanji > 0) { output(fpout, '\033', mode); output(fpout, '$', mode); } else if (kanji < 0) { output(fpout, '\033', mode); output(fpout, '(', mode); } output(NULL, EOF, mode); esc = kanji = 0; break; } /*FALLTHRU*/ default: if (esc) output(fpout, '\033', mode); else if (kanji > 0) mode |= KANJI; else if (kanji < 0) { if (c == 'I') mode |= JKANA; else mode &= ~KANJI; } else output(fpout, c, mode); esc = kanji = 0; break; } } output(fpout, EOF, mode); VOID_C fclose(fpout); VOID_C fclose(fpin); return(0); } FD-3.01j/expfunc.c100644 2105 1751 17537 13516612560 12532 0ustar shiraiuser/* * expfunc.c * * function expander for the obsolete /bin/sh */ #include "headers.h" #include #define MAXLINEBUF 255 #define MAXFUNCNO 32 #define MAXARGS 10 extern VOID exit __P_((int)); static char *NEAR skipspace __P_((char *)); static char *NEAR Xstrlcat __P_((char *, CONST char *, int)); static char *NEAR Xstrndup __P_((CONST char *, int)); static char *NEAR isfunction __P_((char *)); static int NEAR entryfunc __P_((char *)); static char *NEAR checkhere __P_((char *)); static int NEAR getargs __P_((char **, char *[])); static char *NEAR expargs __P_((CONST char *, char *[])); static int NEAR searchfunc __P_((CONST char *)); static int NEAR evalline __P_((char *, char *[])); static char *NEAR getline __P_((FILE *)); int main __P_((int, char *CONST [])); static int funcno = 0; static char *func[MAXFUNCNO]; static int funclen[MAXFUNCNO]; static char *funcbody[MAXFUNCNO]; static char *NEAR skipspace(s) char *s; { while (*s == ' ' || *s == '\t') s++; return(s); } static char *NEAR Xstrlcat(s1, s2, n) char *s1; CONST char *s2; int n; { char *s; int i; i = strlen(s1); n -= i; s = &(s1[i]); for (i = 0; i < n && s2[i]; i++) s[i] = s2[i]; s[i] = '\0'; return(s1); } static char *NEAR Xstrndup(s, n) CONST char *s; int n; { char *tmp; if (!s) return(NULL); if (!(tmp = (char *)malloc(n + 1))) exit(1); memcpy(tmp, s, n); tmp[n] = '\0'; return(tmp); } static char *NEAR isfunction(line) char *line; { char *cp; int len; if (funcno >= MAXFUNCNO) return(NULL); line = skipspace(line); for (len = 0; line[len]; len++) if (line[len] != '_' && !isalpha((int)(line[len]))) break; if (!len) return(NULL); cp = skipspace(&(line[len])); if (*cp != '(') return(NULL); cp = skipspace(&(cp[1])); if (*cp != ')') return(NULL); cp = skipspace(&(cp[1])); if (*cp != '{') return(NULL); func[funcno] = Xstrndup(line, len); funclen[funcno] = len; funcbody[funcno] = NULL; return(&(cp[1])); } static int NEAR entryfunc(line) char *line; { char *cp; int i, len, quote; i = 1; quote = '\0'; if (*line == '}') { i = 0; line = ""; } else for (cp = line; *cp; cp++) { if (*cp == quote) quote = '\0'; else if (quote == '\'') continue; else if (*cp == '\\' && cp[1]) cp++; else if (quote) continue; else if (*cp == '\'' || *cp == '"') quote = *cp; else if (*cp == '}') { *cp = '\0'; i = 0; } } len = strlen(line); if (!i) len += 3; if (!funcbody[funcno]) { len += 2; funcbody[funcno] = (char *)malloc(len + 1); if (!funcbody[funcno]) exit(1); strcpy(funcbody[funcno], "{ "); } else { len += strlen(funcbody[funcno]); if (*line) len++; funcbody[funcno] = (char *)realloc(funcbody[funcno], len + 1); if (!funcbody[funcno]) exit(1); if (*line) VOID_C Xstrlcat(funcbody[funcno], "\n", len); } VOID_C Xstrlcat(funcbody[funcno], line, len); if (!i) VOID_C Xstrlcat(funcbody[funcno++], "; }", len); return(i); } static char *NEAR checkhere(line) char *line; { char *cp; int len, quote; quote = '\0'; for (cp = line; *cp; cp++) { if (*cp == quote) quote = '\0'; else if (quote == '\'') continue; else if (*cp == '\\' && cp[1]) cp++; else if (quote) continue; else if (*cp == '\'' || *cp == '"') quote = *cp; else if (*cp == '<' && cp[1] == '<') break; } if (*cp != '<') return(NULL); cp = skipspace(&(cp[2])); for (len = 0; cp[len]; len++) if (cp[len] == ' ' || cp[len] == '\t') break; return(Xstrndup(cp, len)); } static int NEAR getargs(linep, args) char **linep, *args[]; { char *cp, *new, *line, *buf; int i, n, len, quote, size; for (i = 0; i < MAXARGS; i++) args[i] = NULL; line = *linep; for (i = 0; i < MAXARGS; i++) { new = buf = NULL; n = size = 0; cp = line = skipspace(line); quote = '\0'; for (;;) { if (!*cp) { if (!quote) break; len = strlen(line); if (!buf) buf = (char *)malloc(len + 1); else buf = (char *)realloc(buf, size + 1 + len + 1); if (!buf) exit(1); if (size) { buf[size++] = '\n'; n++; } memcpy(&(buf[size]), line, len + 1); size += len; cp = line = getline(stdin); if (!cp) break; continue; } if (*cp == quote) quote = '\0'; else if (quote == '\'') /*EMPTY*/; else if (*cp == '\\') { if (cp[1] == '\n') break; else if (cp[1]) { cp++; n++; } else { new = getline(stdin); if (!new || line > cp) break; cp = line = new; new = NULL; continue; } } else if (quote) /*EMPTY*/; else if (*cp == '\'' || *cp == '"') quote = *cp; else if (strchr(" \t\n!&);<>`|}", *cp)) break; cp++; n++; } if (n) { if (buf) { len = strlen(line); buf = (char *)realloc(buf, size + 1 + len + 1); if (!buf) exit(1); buf[size++] = '\n'; memcpy(&(buf[size]), line, len + 1); size += len; line = buf; } if (*line == '\'' || *line == '"') { n--; if (*(cp - 1) == *line) n--; line++; } args[i] = Xstrndup(line, n); } if (buf) free(buf); if (new) line = new; else if (*cp == '\\' && cp[1] == '\n') line = &(cp[2]); else if (*cp == ' ' || *cp == '\t') line = cp; else { i++; break; } } *linep = cp; return(i); } static char *NEAR expargs(line, args) CONST char *line; char *args[]; { char *cp, *buf, *tmp, *top; int i, len, alen, vlen, rlen, quote; len = strlen(line); buf = Xstrndup(line, len); quote = '\0'; cp = buf; while (*cp) { if (*cp == quote) quote = '\0'; else if (quote == '\'') /*EMPTY*/; else if (*cp == '\\' && cp[1]) cp++; else if (*cp == '$') { top = cp; if (*(++cp) == '{') cp++; if (*cp >= '1' && *cp <= '9') { i = *cp - '1'; if (*(++cp) == '}') cp++; alen = cp - top; rlen = len - (cp - buf); vlen = (args[i]) ? strlen(args[i]) : 0; len = len - alen + vlen; if (vlen > alen) { tmp = (char *)realloc(buf, len + 1); if (!tmp) exit(1); cp = &(tmp[cp - buf]); top = &(tmp[top - buf]); buf = tmp; } memmove(&(top[vlen]), cp, rlen + 1); if (vlen) memcpy(top, args[i], vlen); continue; } } else if (quote) /*EMPTY*/; else if (*cp == '\'' || *cp == '"') quote = *cp; cp++; } return(buf); } static int NEAR searchfunc(s) CONST char *s; { int i, len; for (i = 0; i < funcno; i++) { len = funclen[i]; if (!strncmp(s, func[i], len)) if (s[len] == ' ' || s[len] == '\t') return(i); } return(-1); } static int NEAR evalline(line, args) char *line, *args[]; { char *cp, *newargs[MAXARGS]; int i, quote; if (args) line = expargs(line, args); quote = '\0'; for (cp = line; *cp; cp++) { if (*cp == quote) quote = '\0'; else if (quote) /*EMPTY*/; else if (*cp == '\'' || *cp == '"') quote = *cp; else if ((i = searchfunc(cp)) >= 0) { cp += funclen[i]; getargs(&cp, newargs); evalline(funcbody[i], newargs); for (i = 0; i < MAXARGS; i++) if (newargs[i]) free(newargs[i]); cp--; continue; } VOID_C fputc(*cp, stdout); } i = strlen(line); if (args) free(line); else VOID_C fputc('\n', stdout); return(i); } static char *NEAR getline(fp) FILE *fp; { static char buf[MAXLINEBUF + 1]; int len; for (;;) { *buf = '\0'; if (!fgets(buf, MAXLINEBUF, fp)) return(NULL); len = strlen(buf); if (len > 0 && buf[--len] == '\n') buf[len] = '\0'; if (*(skipspace(buf)) != '#') break; VOID_C fprintf(stdout, "%s\n", buf); } return(buf); } /*ARGSUSED*/ int main(argc, argv) int argc; char *CONST argv[]; { char *cp, *heredoc, *line; int infunc; infunc = 0; heredoc = NULL; func[0] = "return"; funclen[0] = strlen(func[0]); funcbody[0] = "(exit $1)"; funcno = 1; while ((line = getline(stdin))) { if (heredoc) { VOID_C fprintf(stdout, "%s\n", line); if (!strcmp(line, heredoc)) { free(heredoc); heredoc = NULL; } } else { heredoc = checkhere(line); if (infunc) infunc = entryfunc(line); else if ((cp = isfunction(line))) infunc = (*cp) ? entryfunc(cp) : 1; else evalline(line, NULL); } } return(0); } FD-3.01j/mkfuncno.c100644 2105 1751 2172 13516612560 12647 0ustar shiraiuser/* * mkfuncno.c * * preprocesser for "funcno.h" */ #define __FD_PRIMAL__ #include "fd.h" #include "types.h" #ifdef _NOCATALOG #define _TBL_(fn, id, hl, fl) {NULL, id, NULL, 0} #else #define _TBL_(fn, id, hl, fl) {NULL, id, 0, 0} #endif #include "functabl.h" int main __P_((int, char *CONST [])); /*ARGSUSED*/ int main(argc, argv) int argc; char *CONST argv[]; { FILE *fp; int i, len; if (!strcmp(argv[1], "-")) fp = stdout; else if (!(fp = fopen(argv[1], "w"))) { VOID_C fprintf(stderr, "%s: Cannot open.\n", argv[1]); return(1); } VOID_C fprintf(fp, "/*\n"); VOID_C fprintf(fp, " *\t%s\n", (fp != stdout) ? argv[1] : "STDOUT"); VOID_C fprintf(fp, " *\n"); VOID_C fprintf(fp, " *\tfunction No. table\n"); VOID_C fprintf(fp, " */\n"); VOID_C fprintf(fp, "\n"); for (i = 0; i < (int)sizeof(funclist) / sizeof(functable); i++) { VOID_C fprintf(fp, "#define\t%s\t", funclist[i].ident); len = strlen(funclist[i].ident); while ((len += 8) < 16) VOID_C fputc('\t', fp); VOID_C fprintf(fp, "\t%d\n", i); } VOID_C fprintf(fp, "\n#define\tFUNCLISTSIZ\t\t%d\n", i); if (fp != stdout) VOID_C fclose(fp); return(0); } FD-3.01j/fd.h100644 2105 1751 24574 13516612560 11457 0ustar shiraiuser/* * fd.h * * definitions for FD */ #include "headers.h" #ifndef FD #define FD 3 #endif #ifndef DEFRC #define DEFRC "/etc/fd2rc" #endif #if FD < 2 #define _NOORIGSHELL #define _NOSPLITWIN #define _NOPRECEDE #define _NOCUSTOMIZE #define _NOEXTRACOPY #define _NOUSEHASH #define _NOORIGGLOB #define _NOKANJIFCONV #define _NOBROWSE #define _NOEXTRAMACRO #define _NOTRADLAYOUT #define _NOEXTRAWIN #define _NOPTY #define _NOEXTRAATTR #define _NOLOGGING #define _NOIME #endif /* FD < 2 */ #if FD < 3 #define _NOCATALOG #define _NODYNAMICLIST #define _NOSOCKET #define _NOSOCKREDIR #define _NOFTP #define _NOHTTP #define _NOVERSCMP #endif /* FD < 3 */ #ifdef DEBUG extern VOID mtrace __P_ ((VOID_A)); extern VOID muntrace __P_ ((VOID_A)); extern char *_mtrace_file; #endif #if MSDOS # ifdef BSPATHDELIM # if FD >= 2 # define FD_RCFILE "~\\fd2.rc" # else # define FD_RCFILE "~\\fd.rc" # endif # else /* !BSPATHDELIM */ # if FD >= 2 # define FD_RCFILE "~/fd2.rc" # else # define FD_RCFILE "~/fd.rc" # endif # endif /* !BSPATHDELIM */ #define TMPPREFIX "FD" #define ARCHTMPPREFIX "AR" #define DOSTMPPREFIX 'D' #else /* !MSDOS */ # if FD >= 2 # define FD_RCFILE "~/.fd2rc" # else # define FD_RCFILE "~/.fdrc" # endif #define TMPPREFIX "fd" #define ARCHTMPPREFIX "ar" #define DOSTMPPREFIX 'd' #endif /* !MSDOS */ #if MSDOS && defined (_NOORIGSHELL) /* Using COMMAND.COM */ #define SHELL_OPERAND "|" #define CMDLINE_DELIM "\t\n <>|" #else #define SHELL_OPERAND "&;(`|" #define CMDLINE_DELIM "\t\n &;()<>|" #endif #define FDPROG "fd" #define FDSHELL "fdsh" #define FDENV "FD_" #define FDESIZ strsize(FDENV) #define FDVERSION "FD_VERSION" /**************************************************************** * If you don't like the following tools as each uses, * * you should rewrite another suitable command name. * ****************************************************************/ #define PAGER "more%K" /* to view file */ #define EDITOR "vi" /* to edit file */ /**************************************************************** * Default value in case if not defined by neither environ * * variables nor run_com file nor command line option * ****************************************************************/ #define BASICCUSTOM 0 #define SORTTYPE 0 #define DISPLAYMODE 0 #define SORTTREE 0 #define WRITEFS 0 #define IGNORECASE 0 #define VERSIONCOMP 0 #define INHERITCOPY 0 #define PROGRESSBAR 0 #define PRECOPYMENU 0 #define ADJTTY 0 #define USEGETCURSOR 0 #define DEFCOLUMNS 2 #define MINFILENAME 12 #define WIDEDIGIT 0 #define SIZEUNIT 0 #if MSDOS # ifdef BSPATHDELIM # define HISTFILE "~\\fd.hst" # else # define HISTFILE "~/fd.hst" # endif #else /* !MSDOS */ #define HISTFILE "~/.fd_history" #endif /* !MSDOS */ #define DIRHISTFILE "" #define HISTSIZE 50 #define DIRHIST 50 #define SAVEHIST 50 #define SAVEDIRHIST 50 #define HISTUMASK 022 #define DIRHISTUMASK 022 #define DIRCOUNTLIMIT 50 #define DOSDRIVE 0 #define SECOND 0 #define AUTOUPDATE 0 #define TRADLAYOUT 0 #define SIZEINFO 0 #define FUNCLAYOUT 1005 #define IMEKEY -1 #define IMEBUFFER 0 #define IMELEARNING 16 #if MSDOS # ifdef BSPATHDELIM # define FREQFILE "~\\fd.frq" # else # define FREQFILE "~/fd.frq" # endif #else /* !MSDOS */ #define FREQFILE "~/.fd_freq" #endif /* !MSDOS */ #define FREQUMASK 022 #define ANSICOLOR 0 #define ANSIPALETTE "" #define EDITMODE "emacs" #define LOOPCURSOR 0 #if MSDOS #define TMPDIR "." #else #define TMPDIR "/tmp" #endif #define TMPUMASK 022 #define RRPATH "" #define PRECEDEPATH "" #if FD >= 2 #define PROMPT "$ " #else #define PROMPT "sh#" #endif #define PROMPT2 "> " #define DUMBSHELL 0 #define PTYMODE 0 #define PTYTERM "vt100" #define PTYMENUKEY -1 #define LOGFILE "" #define LOGSIZE 1024 #define USESYSLOG 0 #define LOGLEVEL 0 #define ROOTLOGLEVEL 1 #define THRUARGS 0 #define URLDRIVE 0 #define URLTIMEOUT 0 #define URLOPTIONS 0 #define HIDEPASSWD 0 #define FTPADDRESS "FDclone@" #define FTPPROXY "" #define FTPLOGFILE "" #define HTTPPROXY "" #define HTTPLOGFILE "" #define HTMLLOGFILE "" #define UNICODEBUFFER 0 #define SJISPATH "" #define EUCPATH "" #define JISPATH "" #define JIS8PATH "" #define JUNETPATH "" #define OJISPATH "" #define OJIS8PATH "" #define OJUNETPATH "" #define HEXPATH "" #define CAPPATH "" #define UTF8PATH "" #define UTF8MACPATH "" #define UTF8ICONVPATH "" #define NOCONVPATH "" /**************************************************************** * Maximum value of some arrays (to change in compile) * ****************************************************************/ #define MAXBINDTABLE 256 #define MAXMACROTABLE 64 #define MAXLAUNCHTABLE 32 #define MAXARCHIVETABLE 16 #define MAXALIASTABLE 256 #define MAXFUNCTABLE 32 #define MAXFUNCLINES 16 #if MSDOS #define MAXCOMMSTR (128 - 2) #endif #define MAXSELECTSTRS 16 #define MAXSTACK 5 #ifdef _NOEXTRAWIN #define MAXWINDOWS 2 #else #define MAXWINDOWS 5 #endif #define MAXHISTNO MAXTYPE(short) #define MAXINVOKEARGS MAXWINDOWS #define MAXLOGLEN 255 #include "depend.h" #ifndef __FD_PRIMAL__ #include "printf.h" #include "kctype.h" #include "string.h" #include "malloc.h" #endif /**************************************************************** * Screen layout parameter * ****************************************************************/ #define FILEPERLINE (curcolumns) #ifdef _NOSPLITWIN #define fileperrow(w) (n_line - wheader - WFOOTER) #else #define fileperrow(w) ((n_line - wheader - WFOOTER + 1) / (w) - 1) #endif #define FILEPERPAGE (FILEPERLINE * FILEPERROW) #ifdef _NOTRADLAYOUT #define istradlayout() (0) #define hassizeinfo() (sizeinfo) #else #define istradlayout() (tradlayout && n_column >= WCOLUMNSTD) #define hassizeinfo() (sizeinfo || istradlayout()) #endif #define WHEADERMIN 3 #define WHEADERMAX 4 #define WHEADER (WHEADERMIN + ((hassizeinfo()) ? 1 : 0)) #define WFOOTER 3 #define L_TITLE 0 #define L_SIZE 1 #define L_STATUS (sizeinfo + 1) #define L_PATH (sizeinfo + 2) #define TL_SIZE 1 #define TL_STATUS 3 #define TL_PATH 2 #ifdef HAVEFLAGS #define WMODELINE 2 #else #define WMODELINE 1 #endif #define WFILEMINTREE 3 #define WFILEMINCUSTOM 4 #define WFILEMINATTR (WMODELINE + 5) #define WFILEMIN 1 #if FD >= 2 #define MAXHELPINDEX 20 #define MAXSORTINHERIT 2 #else #define MAXHELPINDEX 10 #define MAXSORTINHERIT 1 #endif #define MAXSORTTYPE 5 #define L_STACK (n_line - 3) #define L_HELP (n_line - 2) #define L_INFO (n_line - 1) #define L_CMDLINE (n_line - 2) #define WCMDLINE 2 #define L_MESLINE (n_line - 1) #define WCOLUMNSTD 80 #define WCOLUMNOMIT 58 #define WCOLUMNHARD 42 #define WCOLUMNMIN 34 #define S_BYTES " bytes" #define W_BYTES strsize(S_BYTES) #define S_PAGE "Page:" #define S_MARK "Mark:" #define S_INFO "" #define S_SORT "Sort:" #define S_FIND "Find:" #define S_PATH "Path:" #define S_BROWSE "Browse:" #define S_ARCH "Arch:" #define S_SIZE "Size:" #define S_TOTAL "Total:" #define S_USED "" #define S_FREE "Free:" #define TS_PAGE "Page:" #define TS_MARK "Marked" #define TS_INFO "Info:" #define TS_SORT "" #define TS_FIND "" #define TS_PATH "Path=" #define TS_BROWSE "Browse=" #define TS_ARCH "Arch=" #define TS_SIZE "Files " #define TS_TOTAL "Total:" #define TS_USED "Used:" #define TS_FREE "Free:" #define W_PAGE strsize(S_PAGE) #define W_MARK strsize(S_MARK) #define W_INFO strsize(S_INFO) #define W_SORT strsize(S_SORT) #define W_FIND strsize(S_FIND) #define W_PATH strsize(S_PATH) #define W_BROWSE strsize(S_BROWSE) #define W_ARCH strsize(S_ARCH) #define W_SIZE strsize(S_SIZE) #define W_TOTAL strsize(S_TOTAL) #define W_USED strsize(S_USED) #define W_FREE strsize(S_FREE) #define TW_PAGE strsize(TS_PAGE) #define TW_MARK strsize(TS_MARK) #define TW_INFO strsize(TS_INFO) #define TW_SORT strsize(TS_SORT) #define TW_FIND strsize(TS_FIND) #define TW_PATH strsize(TS_PATH) #define TW_BROWSE strsize(TS_BROWSE) #define TW_ARCH strsize(TS_ARCH) #define TW_SIZE strsize(TS_SIZE) #define TW_TOTAL strsize(TS_TOTAL) #define TW_USED strsize(TS_USED) #define TW_FREE strsize(TS_FREE) #if FD >= 3 #define D_PAGE (widedigit ? 4 : 2) #define D_MARK (widedigit ? 5 : 4) #else #define D_PAGE 2 #define D_MARK 4 #endif #define D_INFO 0 #define D_SORT 14 #define D_FIND (n_column - C_FIND - W_FIND) #define D_PATH (n_column - C_PATH - W_PATH) #define D_BROWSE (n_column - C_PATH - W_BROWSE) #define D_ARCH (n_column - C_PATH - W_ARCH) #define D_SIZE 14 #define D_TOTAL 15 #define D_USED 0 #define D_FREE 15 #if FD >= 3 #define TW_GAP (widedigit ? 1 : 3) #define TD_PAGE (widedigit ? 4 : 2) #define TD_MARK (widedigit ? 5 : 4) #else #define TW_GAP 3 #define TD_PAGE 2 #define TD_MARK 4 #endif #define TD_INFO (TC_SIZE - TC_INFO - TW_INFO) #define TD_SORT 0 #define TD_FIND 0 #define TD_PATH (TC_MARK - TC_PATH - TW_PATH) #define TD_BROWSE (TC_MARK - TC_PATH - TW_BROWSE) #define TD_ARCH (TC_MARK - TC_PATH - TW_ARCH) #define TD_SIZE 13 #define TD_TOTAL 14 #define TD_USED 13 #define TD_FREE 14 #define C_PAGE ((isleftshift()) ? 0 : 1) #define C_MARK (C_PAGE + W_PAGE + D_PAGE + 1 + D_PAGE + 1) #define C_INFO -1 #define C_SORT (C_MARK + W_MARK + D_MARK + 1 + D_MARK + 1) #define C_FIND (C_SORT + \ ((ishardomit()) ? 0 : W_SORT + D_SORT + 1)) #define C_PATH ((isleftshift()) ? 0 : 1) #define C_SIZE ((isleftshift()) ? 0 : 1) #define C_TOTAL (C_SIZE + W_SIZE + D_SIZE + 1 + D_SIZE + 2) #define C_USED -1 #define C_FREE (C_TOTAL + W_TOTAL + D_TOTAL + 1) #define TC_PAGE 2 #define TC_MARK (n_column - TD_MARK - TW_MARK - TD_SIZE - 2) #define TC_INFO 2 #define TC_SORT -1 #define TC_FIND -1 #define TC_PATH 2 #define TC_SIZE (n_column - TD_MARK - TW_SIZE - TD_SIZE - 2) #define TC_TOTAL (TC_PAGE + TW_PAGE + TD_PAGE + 1 + TD_PAGE \ + TW_GAP) #define TC_USED (TC_TOTAL + TW_TOTAL + TD_TOTAL + TW_GAP) #define TC_FREE (TC_USED + TW_USED + TD_USED + TW_GAP) #define WSIZE 9 #define WSIZE2 8 #define TWSIZE2 10 #define WDATE 8 #define WTIME 5 #define WSECOND 2 #if MSDOS #define WMODE 5 #else #define WMODE 10 #endif #define TWMODE 9 #define WNLINK 2 #ifndef NOUID #define WOWNER 8 #define WGROUP 8 #define WOWNERMIN 5 #define WGROUPMIN 5 #endif /**************************************************************** * Restrictions for causation * ****************************************************************/ #ifdef UNKNOWNFS #undef WRITEFS #define WRITEFS 2 #endif FD-3.01j/headers.h100644 2105 1751 11200 13516612560 12457 0ustar shiraiuser/* * headers.h * * include headers */ #ifdef __HOST_CC__ #include "hmachine.h" #else #include "machine.h" #endif #include #include #include #include #include #include #include #ifndef NOUNISTDH #include #endif #ifndef NOSTDLIBH #include #endif #ifdef USETIMEH #include #endif #ifdef USESTDARGH #include #else #include #endif /* for glibc */ #if defined (LINUX) && defined (_SYS_SYSMACROS_H) #include #endif #if MSDOS #undef MAXPATHLEN #define MAXPATHLEN 260 #undef MAXNAMLEN #define MAXNAMLEN 255 #else /* !MSDOS */ #include #include #include # ifdef USEUTIME # include # endif # ifdef MINIX # include # endif # if !defined (MAXPATHLEN) && defined (PATH_MAX) # define MAXPATHLEN PATH_MAX # endif #endif /* !MSDOS */ #ifndef O_BINARY #define O_BINARY 0 #endif #ifndef O_TEXT #define O_TEXT 0 #endif #ifndef O_NOCTTY #define O_NOCTTY 0 #endif #ifndef O_ACCMODE #define O_ACCMODE (O_RDONLY | O_WRONLY | O_RDWR) #endif #ifndef L_SET # ifdef SEEK_SET # define L_SET SEEK_SET # else # define L_SET 0 # endif #endif /* !L_SET */ #ifndef L_INCR # ifdef SEEK_CUR # define L_INCR SEEK_CUR # else # define L_INCR 1 # endif #endif /* !L_INCR */ #ifndef L_XTND # ifdef SEEK_END # define L_XTND SEEK_END # else # define L_XTND 2 # endif #endif /* !L_XTND */ #ifdef __TURBOC__ #undef EFAULT #undef ENFILE #undef ENOSPC #undef EROFS #undef EPERM #undef EINTR #undef EIO #undef ENXIO #undef ENOTDIR #undef EISDIR #endif /* __TURBOC__ */ #ifndef ENOSPC #define ENOSPC EACCES #endif #ifndef ENODEV #define ENODEV EACCES #endif #ifndef EIO #define EIO ENODEV #endif #ifndef EISDIR #define EISDIR EACCES #endif #ifndef ENOTEMPTY # ifdef ENFSNOTEMPTY # define ENOTEMPTY ENFSNOTEMPTY # else # define ENOTEMPTY EACCES # endif #endif /* !ENOTEMPTY */ #ifndef EPERM #define EPERM EACCES #endif #ifndef EFAULT #define EFAULT ENODEV #endif #ifndef EROFS #define EROFS EACCES #endif #ifndef ENAMETOOLONG #define ENAMETOOLONG ERANGE #endif #ifndef ENOTDIR #define ENOTDIR ENOENT #endif #ifndef EINTR #define EINTR 0 #endif #ifndef ETIMEDOUT #define ETIMEDOUT EIO #endif #ifdef NOERRNO extern int errno; #endif #ifdef USESTRERROR #define Xstrerror strerror #else /* !USESTRERROR */ # ifndef DECLERRLIST extern CONST char *CONST sys_errlist[]; # endif #define Xstrerror(n) (char *)sys_errlist[n] #endif /* !USESTRERROR */ #ifdef USESTDARGH #define VA_START(a, f) va_start(a, f) #else #define VA_START(a, f) va_start(a) #endif #ifndef R_OK #define R_OK 4 #endif #ifndef W_OK #define W_OK 2 #endif #ifndef X_OK #define X_OK 1 #endif #ifndef F_OK #define F_OK 0 #endif #ifndef LOCK_SH #define LOCK_SH 1 #endif #ifndef LOCK_EX #define LOCK_EX 2 #endif #ifndef LOCK_NB #define LOCK_NB 4 #endif #ifndef LOCK_UN #define LOCK_UN 8 #endif #if !defined (NOFLAGS) && defined (UF_SETTABLE) && defined (SF_SETTABLE) #define HAVEFLAGS #endif #undef S_IRUSR #undef S_IWUSR #undef S_IXUSR #undef S_IRGRP #undef S_IWGRP #undef S_IXGRP #undef S_IROTH #undef S_IWOTH #undef S_IXOTH #define S_IRUSR 00400 #define S_IWUSR 00200 #define S_IXUSR 00100 #define S_IRGRP 00040 #define S_IWGRP 00020 #define S_IXGRP 00010 #define S_IROTH 00004 #define S_IWOTH 00002 #define S_IXOTH 00001 #define S_IREAD_ALL (S_IRUSR | S_IRGRP | S_IROTH) #define S_IWRITE_ALL (S_IWUSR | S_IWGRP | S_IWOTH) #define S_IEXEC_ALL (S_IXUSR | S_IXGRP | S_IXOTH) #undef S_IFLNK #undef S_IFSOCK #undef S_IFIFO #undef S_ISUID #undef S_ISGID #undef S_ISVTX #define S_IFLNK 0120000 #define S_IFSOCK 0140000 #define S_IFIFO 0010000 #define S_ISUID 0004000 #define S_ISGID 0002000 #define S_ISVTX 0001000 #ifdef HAVEFLAGS # ifndef UF_NODUMP # define UF_NODUMP 0x00000001 # endif # ifndef UF_IMMUTABLE # define UF_IMMUTABLE 0x00000002 # endif # ifndef UF_APPEND # define UF_APPEND 0x00000004 # endif # ifndef UF_NOUNLINK # define UF_NOUNLINK 0x00000010 # endif # ifndef SF_ARCHIVED # define SF_ARCHIVED 0x00010000 # endif # ifndef SF_IMMUTABLE # define SF_IMMUTABLE 0x00020000 # endif # ifndef SF_APPEND # define SF_APPEND 0x00040000 # endif # ifndef SF_NOUNLINK # define SF_NOUNLINK 0x00080000 # endif #endif /* HAVEFLAGS */ #ifdef NOUID_T typedef u_short uid_t; typedef u_short gid_t; #endif #ifdef OLDARGINT typedef int u_id_t; typedef int g_id_t; #define convuid(u) (((u) == (uid_t)-1) ? (u_id_t)-1 : (u_id_t)(u)) #define convgid(g) (((g) == (gid_t)-1) ? (g_id_t)-1 : (g_id_t)(g)) #else typedef uid_t u_id_t; typedef gid_t g_id_t; #define convuid(u) (u) #define convgid(g) (g) #endif FD-3.01j/machine.h100644 2105 1751 113151 13516612560 12500 0ustar shiraiuser/* * machine.h * * definitions of machine depended identifier */ #ifndef __MACHINE_H_ #define __MACHINE_H_ #undef MSDOS #if (DOSV || PC98 || J3100) #define MSDOS 1 #else #define MSDOS 0 #endif #if MSDOS #define NOMULTIKANJI #define PATHNOCASE #define COMMNOCASE #define ENVNOCASE #define NOUID #define NODIRLOOP #define NOSYMLINK #define BSPATHDELIM #define USECRNL #define CWDINPATH #define DOUBLESLASH #define NOTZFILEH #define USETIMEH #define NOFLAGS #define NOFTPH #define USEUTIME #define NOFLOCK #define NOSYSLOG #define USEMKTIME #define NOSETPGRP #define USESTRERROR #define SENSEPERSEC 20 # if defined (__TURBOC__) && defined (__WIN32__) # define BCC32 # endif # if defined (__GNUC__) # define USERESOURCEH # define SIGFNCINT # ifndef DJGPP # define DJGPP 1 # else # define USEREGCOMP # endif # else /* !__GNUC__ */ # ifndef BCC32 # define NOUID_T # endif # define NOFILEMODE # define NOUNISTDH # endif /* !__GNUC__ */ # if !defined (__GNUC__) || (defined (DJGPP) && DJGPP >= 2) # define NOUINT # endif # ifdef __TURBOC__ # ifndef BCC32 # define NEAR near # define DOS16 # endif # define FORCEDSTDC # define SIGFNCINT typedef long off_t; # endif # ifdef LSI_C # define NEAR near # define DOS16 # define FORCEDSTDC # endif # if defined (DJGPP) || defined (BCC32) # define PROTECTED_MODE # endif # if !defined (DJGPP) || (DJGPP < 2) # define NOSELECT # endif #endif /* !MSDOS */ #ifndef NEAR #define NEAR #endif #if defined (sun) #define CODEEUC #define CPP7BIT #define USELEAPCNT #define SOCKETLIB "-lsocket -lnsl" #include # if !defined (MAXHOSTNAMELEN) \ || defined (USGr4) || defined (__svr4__) || defined (__SVR4) # define SVR4 # define OSTYPE "SOLARIS" # define EXTENDCCOPT "-O -D_FILE_OFFSET_BITS=64" # include # ifdef __SUNPRO_C # pragma error_messages (off, E_STATEMENT_NOT_REACHED) # pragma error_messages (off, E_END_OF_LOOP_CODE_NOT_REACHED) # endif # if defined (__SUNPRO_C) && defined (BSD) # define USEDIRECT # define USERE_COMP # endif # define USEMANLANG # define REGEXPLIB "-lgen" # define USEMKDEVH # define NODNAMLEN # define DNAMESIZE 1 # define NOTMGMTOFF # define USEINSYSTMH # define USESTATVFSH # define USESTATVFS_T # define USEMNTTABH # define USEMKTIME # define SIGFNCINT # define USEINETPTON # else /* MAXHOSTNAMELEN && !USGr4 && !__svr4__ && !__SVR4 */ # define BSD43 # define OSTYPE "SUN_OS" # define BSDINSTALL # define USERE_COMP # define USETIMELOCAL # define USESYSCONF # define USEWAITPID # define USERESOURCEH # define USESETVBUF # endif /* MAXHOSTNAMELEN && !USGr4 && !__svr4__ && !__SVR4 */ #endif #if defined (sony) #define USELEAPCNT #define USEMANLANG #define SUPPORTSJIS # if defined (USGr4) || defined (SYSTYPE_SYSV) # define SVR4 # define OSTYPE "NEWS_OS6" # define REGEXPLIB "-lgen" # define USEMKDEVH # define NODNAMLEN # define DNAMESIZE 1 # define NOTMGMTOFF # define USESTATVFSH # define USEMNTTABH # define USEMKTIME # define USEUTIME # define USETIMES # define SIGFNCINT # define GETTODARGS 1 # else /* !USGr4 && !SYSTYPE_SYSV */ # define BSD43 # define BSDINSTALL # define USERE_COMP # define SIGARGINT # if defined (__sony) || !defined (bsd43) # define OSTYPE "NEWS_OS4" # define USESETENV # define USERESOURCEH # else /* !__sony && bsd43 */ # define OSTYPE "NEWS_OS3" # define NOERRNO # define NOFILEMODE # define NOUNISTDH # define NOSTDLIBH # define USEDIRECT # define NOTMGMTOFF # define NOVSPRINTF # define USEGETWD # define USETIMES # endif /* !__sony && bsd43 */ # endif /* !USGr4 && !SYSTYPE_SYSV */ #endif #if defined (sgi) #define SYSV #define OSTYPE "IRIX" #define CODEEUC # if defined (_COMPILER_VERSION) && ((_COMPILER_VERSION) >= 600) # define EXTENDCCOPT "-32 -O" # endif # if !defined (SYSTYPE_SVR4) && !defined (_SYSTYPE_SVR4) # define TERMCAPLIB "-lcurses" # define EXTENDLIB "-lsun" # endif #define USEPID_T #define DECLERRLIST #define USEMKDEVH #define NODNAMLEN #define DNAMESIZE 1 #define NOTMGMTOFF #define USESTATFSH #define STATFSARGS 4 #define USERE_COMP #define USEMKTIME #define USESYSCONF #define USEWAITPID #define USESIGPMASK #define USERESOURCEH #define GETPGRPVOID #define USESETPGID #define USESETVBUF #define USESTRERROR #endif #if defined (hpux) || defined (__hpux) \ || defined (__H3050) || defined (__H3050R) || defined (__H3050RX) #define SYSV #define OSTYPE "HPUX" # if defined (__CLASSIC_C__) # define NOSTDC # endif # if defined (__STDC_EXT__) # define EXTENDCCOPT "-D_FILE_OFFSET_BITS=64" # endif /* * This is a fake '#if' for some buggy HP-UX terminfo library. * Will you please define 'BUGGY_HPUX' manually on such environment. * * Some HP-UX has buggy libcurses/terminfo, to use libtermcap/termcap. * Another HP-UX has buggy libtermlib/termcap, to use libcurses/terminfo. * Or another HP-UX does not support termcap at all. * If you use HP-UX and the terminal trouble occured, * you should try to define 'BUGGY_HPUX' here and to re-compile. * #define BUGGY_HPUX * */ # if !defined (__HP_cc) # define BUGGY_HPUX /* Maybe HP-UX 10.20 */ # endif # if !defined (BUGGY_HPUX) # define USETERMINFO # define TERMCAPLIB "-lcurses" # endif #define BUGGYMAKE #define USEPID_T #define NOSIGLIST #define NOTZFILEH #define USETIMEH #define NOTMGMTOFF #define USEINSYSTMH #define USEREGCOMP #define NOTERMVAR #define USEUTIME #define USEMKTIME #define USESYSCONF #define USEWAITPID #define USESIGPMASK #define USERESOURCEH #define GETPGRPVOID #define USESETPGID #define USESETVBUF #define SIGFNCINT #define USESTRERROR #define USESETSID #define USESETRESUID #define USESETRESGID #endif #if defined (nec_ews) || defined (_nec_ews) #define CODEEUC # if defined (nec_ews_svr4) || defined (_nec_ews_svr4) # define SVR4 # define OSTYPE "EWSUXV" # undef CCCOMMAND # if defined (nec_ews) # define CCCOMMAND "/usr/necccs/bin/cc" # else # define CCCOMMAND "/usr/abiccs/bin/cc" # define STRICTSTDC # endif # define TERMCAPLIB "-lcurses" # define REGEXPLIB "-lgen" # define USEMKDEVH # define NODNAMLEN # define DNAMESIZE 1 # define NOTMGMTOFF # define USESTATVFSH # define USEMNTTABH # define USEUTIME # define USEMKTIME # define SIGFNCINT # else /* !nec_ews_svr4 && !_nec_ews_svr4 */ # define SYSV # endif /* !nec_ews_svr4 && !_nec_ews_svr4 */ #endif #if defined (uniosu) #define BSD43 #define OSTYPE "UNIOSU" #define CODEEUC #define EXTENDCCOPT "-O -Zs" #define TERMCAPLIB "-lcurses" #define REGEXPLIB "-lc -lPW" #define UNKNOWNFS #define NOVOID #define NOUID_T #define NOFILEMODE #define NOSTDLIBH #define USETIMEH #define USETERMIO #define SYSVDIRENT #define HAVETIMEZONE #define USEREGCMP #define USERESOURCEH #define WAITKEYPAD 720 #define WAITKANJI 720 #endif #if defined (uniosb) #define BSD43 #define OSTYPE "UNIOSB" #define NOERRNO #define NOFILEMODE #define NOUNISTDH #define NOSTDLIBH #define USEDIRECT #define USERE_COMP #define USESETENV #define NOVSPRINTF #define USEGETWD #define USERESOURCEH #define SIGARGINT #endif #if defined (luna88k) #define BSD43 #define OSTYPE "LUNA88K" #define CODEEUC #define NOERRNO #define NOFILEMODE #define USEDIRECT #define USERE_COMP #define USESETENV #define USEGETWD #define USERESOURCEH #define SIGARGINT #endif #if (defined (alpha) || defined (__alpha) || defined (__alpha__)) \ && !defined (linux) \ && !defined (__FreeBSD__) && !defined (__NetBSD__) && !defined (__OpenBSD__) #define CODEEUC #define TARUSESPACE #define NOFUNCMACRO #define EXTENDLIB "-lc_r" #define USEMNTINFOR # if defined (SYSTYPE_BSD) # define BSD43 # define OSTYPE "DECOSF1V2" # define BSDINSTALL # define BSDINSTCMD "installbsd" # define USEMOUNTH # define STATFSARGS 3 # define USERE_COMP # define USERESOURCEH # else /* !SYSTYPE_BSD */ # define SVR4 # define OSTYPE "DECOSF1V3" # define DECLERRLIST # define USELEAPCNT # define USETERMIO # define USESTATVFSH # define USEREGCOMP # define USEMKTIME # define SIGFNCINT # endif /* !SYSTYPE_BSD */ #endif #if defined (_IBMR2) #define SVR4 #define OSTYPE "AIX" #define EXTENDCCOPT "-O -D_LARGE_FILES -U_LARGE_FILE_API" #define TERMCAPLIB "-lcurses" #define NOTZFILEH #define USESELECTH #define USESYSDIRH #define USETIMEH #define USETERMIO #define NOTMGMTOFF #define USEMNTCTL #define USERE_COMP # if defined (_AIX41) # define HAVELONGLONG # define USESTATVFSH # define USEMKTIME # define SIGFNCINT # else # define USESTATFSH # define STATFSARGS 4 # define SIGARGINT # endif # if defined (_AIX43) # define NOTERMVAR # endif #endif #if defined (ultrix) #define BSD43 #define OSTYPE "ULTRIX" #define CODEEUC #define BSDINSTALL #define TARUSESPACE #define CPP7BIT #define USEFSDATA #define USEGETMNT #define USERE_COMP #define USESETENV #define USEMKTIME #define USESYSCONF #define USESIGPMASK #define USERESOURCEH #endif #if defined (_AUX_SOURCE) #define SYSV #define OSTYPE "AUX" #define CPP7BIT #define TERMCAPLIB "-ltermcap" #define UNKNOWNFS /* Because of the buggy (?) 'rename(2)' */ #define PWNEEDERROR #define USELEAPCNT #define USETIMEH #endif #if defined (DGUX) || defined (__DGUX__) #define SYSV #define OSTYPE "DGUX" #define CODEEUC #define TERMCAPLIB "-ltermcap" #define USESTATFSH #define STATFSARGS 4 #define USESYSDIRH #define NODNAMLEN #define DNAMESIZE 1 #define USERE_COMP #endif #if defined (__uxpm__) #define SVR4 #define OSTYPE "UXPM" #define CODEEUC #define CCOUTOPT "-o $*" #define REGEXPLIB "-lgen" #define USEMKDEVH #define NODNAMLEN #define DNAMESIZE 1 #define NOTMGMTOFF #define USESTATVFSH #define USEMNTTABH #define USEUTIME #define USEMKTIME #endif #if defined (__uxps__) #define SVR4 #define OSTYPE "UXPDS" #define CODEEUC #define REGEXPLIB "-lgen" #define USEMKDEVH #define NODNAMLEN #define DNAMESIZE 1 #define NOTMGMTOFF #define USESTATVFSH #define USEMNTTABH #define USEUTIME #define USEMKTIME #endif #if defined (NeXT) #define BSD43 #define OSTYPE "NEXTSTEP" #define CODEEUC #define NOFILEMODE #define NOUNISTDH #define USEDIRECT #define USERE_COMP #define USEGETWD #define USERESOURCEH #endif #if defined (__CYGWIN__) #define POSIX #define OSTYPE "CYGWIN" #define DEFKCODE "utf8" #define UTF8DOC #define EXTENDCCOPT "-O -D_FILE_OFFSET_BITS=64" #define PATHNOCASE #define COMMNOCASE #define USECRNL #define DOUBLESLASH #define USEMANLANG #define LANGWIDTH 2 #define BSDINSTALL #define TARUSESPACE /* * This is a fake '#if' for obsolete version of Cygwin. * Will you please define 'OldCygwin' manually on Cygwin. * * Some old Cygwin has no libncurses, to use libtermcap. * Latest distribution has no libtermcap, to use libncurses. * If you use older Cygwin without libncurses, * you should try to define 'OldCygwin' here and to re-compile. * #define OldCygwin * */ # if defined (OldCygwin) # define TERMCAPLIB "-ltermcap" # else # define TERMCAPLIB "-lncurses" # endif #define NOSIGLIST #define DECLERRLIST #define HAVECLINE #define SYSVDIRENT #define NODNAMLEN #define NODRECLEN #define HAVETIMEZONE #define NOTMGMTOFF #define USEREGCOMP #define USESETENV #define USEMKTIME #define DEFFDSETSIZE #define USETCGETPGRP /* for Cygwin buggy ioctl */ #define SIGFNCINT #define USESOCKLEN #define USEINETATON #define WAITKEYPAD 720 #define WAITTERMINAL 36 #endif #if defined (linux) #define POSIX #define OSTYPE "LINUX" #define UTF8LANG "utf8-iconv" #define CODEEUC # if defined (alpha) || defined (__alpha) || defined (__alpha__) /* Linux/Alpha need not support LFS and cannot use statfs(2) with LFS */ # define EXTENDCCOPT "-O" # else # define EXTENDCCOPT "-O -D_FILE_OFFSET_BITS=64" # endif #define USEMANLANG #define LANGWIDTH 2 #define BSDINSTALL #define TARUSESPACE /* * This is a fake '#if' for some buggy Slackware distribution. * Will you please define 'Slackware' manually on Slackware. * * Some old SlackWare has buggy libncurses, to use libtermcap. * Another distribution has no libtermcap, to use libncurses. * If you use older Slackware and the terminal trouble occured, * you should try to define 'Slackware' here and to re-compile. * #define Slackware * */ # if defined (Slackware) # define TERMCAPLIB "-ltermcap" # else # define TERMCAPLIB "-lncurses" # endif #define DECLSIGLIST #define DECLERRLIST #define NOTZFILEH #define USETIMEH #define HAVECLINE #define SYSVDIRENT #define NODNAMLEN #define HAVETIMEZONE #define NOTMGMTOFF #define HAVEPROCMNT #define USEREGCOMP #define USESETENV #define USEMKTIME # if !defined (alpha) && !defined (__alpha) && !defined (__alpha__) \ && !defined (ia64) && !defined (__ia64) && !defined (__ia64__) \ && !defined (x86_64) && !defined (__x86_64) && !defined (__x86_64__) \ && !defined (amd64) && !defined (__amd64) && !defined (__amd64__) \ && !defined (LP64) && !defined (__LP64) && !defined (__LP64__) \ && !defined (arm64) && !defined (__arm64) && !defined (__arm64__) \ && !defined (aarch64) && !defined (__aarch64) && !defined (__aarch64__) \ && !defined (s390x) && !defined (__s390x) && !defined (__s390x__) \ && !defined (CONFIG_ARCH_S390X) \ && (!defined (PPC) || !defined (__GNUC__) || (__GNUC__) >= 3) /* for bug */ # define USELLSEEK # endif #define SIGFNCINT #define USESOCKLEN #define USEINETATON #endif #if defined (__FreeBSD__) && defined (__powerpc__) #define BSD44 #define OSTYPE "JCCBSD" #define CODEEUC #define TARUSESPACE #define REGEXPLIB "-lcompat" #define DECLSIGLIST #define DECLERRLIST #define USELEAPCNT #define USEMOUNTH #define USEMNTINFO #define USERE_COMP #define USESETENV #define ULONGIOCTL #define USEMKTIME #define SIGFNCINT #define USEINETATON #endif #if defined (__FreeBSD__) && !defined (OSTYPE) && !defined (__BOW__) #define BSD44 #define OSTYPE "FREEBSD" #define CODEEUC #define USEMANLANG #define BSDINSTALL #define TARUSESPACE #define REGEXPLIB "-lcompat" #define DECLSIGLIST #define DECLERRLIST #define NOTZFILEH #define USEMOUNTH #define USEMNTINFO # if (__FreeBSD__) >= 5 # define LANGWIDTH 2 # endif # if (__FreeBSD__) >= 4 # define USESOCKLEN # endif # if (__FreeBSD__) < 3 # define USEVFCNAME # else # define USEFFSTYPE # endif #define USERE_COMP #define USESETENV #define ULONGIOCTL #define USEMKTIME #define SIGFNCINT #define USEINETATON #endif #if defined (__NetBSD__) #define BSD44 #define OSTYPE "NETBSD" #define CODEEUC #define BSDINSTALL #define TARUSESPACE #define REGEXPLIB "-lcompat" #define DECLSIGLIST #define DECLERRLIST #define USELEAPCNT #define USEFFSTYPE #define USERE_COMP #define USESETENV #define ULONGIOCTL #define USEMKTIME #define SIGFNCINT #define USEINETATON #include # if defined (NetBSD1_0) && ((NetBSD1_0) < 1) # define USEFFSIZE # endif # if defined (__NetBSD_Version__) && ((__NetBSD_Version__) >= 104000000) # define USESOCKLEN # endif # if defined (__NetBSD_Version__) && ((__NetBSD_Version__) >= 300000000) # define USESTATVFSH # define USEGETVFSTAT # else # define USEMOUNTH # define USEMNTINFO # endif #endif #if defined (__bsdi__) #define BSD44 #define OSTYPE "BSDOS" #define CODEEUC #define TARUSESPACE #define REGEXPLIB "-lcompat" #define STRICTSTDC #define DECLSIGLIST #define DECLERRLIST #define USEMOUNTH #define USEMNTINFO #define USERE_COMP #define USESETENV #define ULONGIOCTL #define USEMKTIME #define USEINETATON #include # if !defined (BSD) || ((BSD) < 199306) # define USEFFSIZE # endif #endif #if defined (__BOW__) \ || (defined (__386BSD__) && defined (__BSD_NET2) && !defined (OSTYPE)) #define BSD44 #define OSTYPE "BOW" #define TARUSESPACE #define TERMCAPLIB "-ltermcap" #define DECLSIGLIST #define DECLERRLIST #define USEMOUNTH #define USEMNTINFO # if defined (__FreeBSD__) # if (__FreeBSD__) < 3 # define USEVFCNAME # else # define USEFFSTYPE # endif # endif /* __FreeBSD__ */ #define USEREGCOMP #define USESETENV #define ULONGIOCTL #define USEMKTIME #define SIGFNCINT #define USEINETATON #endif #if defined (__OpenBSD__) #define BSD44 #define OSTYPE "OPENBSD" #define CODEEUC #define BSDINSTALL #define TARFROMPAX #define REGEXPLIB "-lcompat" #define DECLSIGLIST #define DECLERRLIST #define USELEAPCNT #define USEMOUNTH #define USEMNTINFO #define USEFFSTYPE #define USERE_COMP #define USESETENV #define ULONGIOCTL #define USEMKTIME #define SIGFNCINT #define USEINETATON #include # if defined (OpenBSD) && ((OpenBSD) > 201505) /* >5.7 */ # define NOTZFILEH # endif #endif #if defined (__APPLE__) && defined (__MACH__) && !defined (OSTYPE) #define BSD44 #define OSTYPE "DARWIN" /* aka Mac OS X */ #define DEFKCODE "utf8-mac" #define UTF8DOC #define USEMANLANG #define LANGWIDTH 2 #define BSDINSTALL #define TARFROMPAX #define TERMCAPLIB "-lcurses" #define DECLSIGLIST #define DECLERRLIST #define USELEAPCNT #define USEMOUNTH #define USEMNTINFO #define USEFFSTYPE #define USEREGCOMP #define USESETENV #define SELECTRWONLY #define ULONGIOCTL #define USEMKTIME #define SIGFNCINT #define USESOCKLEN #define USEINETATON #endif #if defined (__minix) #define OSTYPE "MINIX" #ifndef _MINIX #define _MINIX 1 #endif #include # if defined (_VCS_REVISION) # define MINIX32 # ifndef _XOPEN_SOURCE # define _XOPEN_SOURCE 520 # endif # else # define MINIX3 # endif #define CODEEUC #define EXTENDCCOPT "-O -D_MINIX=1" #define USEPID_T #define NOSIGLIST #define USESELECTH #define USETERMIOS #define USEDEVPTY #define SYSVDIRENT #define NODNAMLEN #define DNAMESIZE 1 #define USESETENV #define USEUTIME #define USEFCNTLOCK #define USEMKTIME #define USESYSCONF #define USEWAITPID #define USESIGACTION #define USESIGPMASK #define USETIMES #define GETPGRPVOID #define NOSETPGRP #define USESETVBUF #define SIGFNCINT #define USESTRERROR #define GETTODNULL #define USESETSID #define USESOCKLEN #define NOSENDFLAGS #define USEGETGROUPS # ifdef MINIX32 # define NOUINT # define USELEAPCNT # define USESTDARGH # define NOFLAGS # define USESTATVFSH # define USEGETFSENT # define USEULIMITH # define USEINETPTON # else # define CPP7BIT # define TERMCAPLIB "-lcurses" # define OLDARGINT # define NOFUNCMACRO # define NOLONGLONG # define NOTZFILEH # define USETIMEH # define NOTMGMTOFF # define NOSTBLKSIZE # define NOFTPH # define USESTATFSH # define NOFBLOCKS # define NOFBFREE # define NOFFILES # define USEFSTATFS # define USEREADMTAB # define NOTERMVAR # define NOFTRUNCATE # define NOSYSLOG # define NOKILLPG # define USEINETATON # endif #endif #if defined (__ANDROID__) || defined (__BIONIC__) #define OSTYPE2 "ANDROID" #define DEFKCODE "utf8-iconv" #define UTF8DOC #define USETERMIO #define NOFTPH #define USEREADMTAB #define USEPROCMNT #define NOVSPRINTF #define NOSYSLOG #define NOKILLPG #define NOGETPASS #define NOGETPWENT #define NOGETGRENT # ifndef __HOST_CC__ # include # endif # if defined (__ANDROID_API__) && ((__ANDROID_API__) >= 21) # define NODTABLESIZE # endif #endif #if defined (__386BSD__) && !defined (OSTYPE) #define BSD43 #define OSTYPE "ORG_386BSD" #define TARUSESPACE #define USEPID_T #define DECLSIGLIST #define DECLERRLIST #define USELEAPCNT #define USEMOUNTH #define USEMNTINFO #define USESETENV #define ULONGIOCTL #define USEMKTIME #define USEWAITPID #define USESIGPMASK #define USERESOURCEH #endif #if defined (mips) && !defined (OSTYPE) #define BSD43 #define OSTYPE "MIPS" #define CODEEUC # if defined (SYSTYPE_SYSV) # undef CCCOMMAND # define CCCOMMAND "/bsd43/bin/cc" # endif #define TERMCAPLIB "-lcurses -ltermcap" #define NOERRNO #define NOFILEMODE #define NOUNISTDH #define NOSTDLIBH #define USEDIRECT #define USERE_COMP #define USESETENV #define USEGETWD #define USERESOURCEH #define SIGARGINT #endif #if !defined(OSTYPE2) && defined (__GNUC__) && defined (__clang__) #define OSTYPE2 "LLVM" #endif /**************************************************************** * If your machine is not described above, you should * * comment out below manually to apply your environment. * ****************************************************************/ /* #define SYSV ;OS type is System V Rel.3 */ /* #define SVR4 ;OS type is System V Rel.4 */ /* #define BSD4 ;OS type is BSD 4.2 */ /* #define BSD43 ;OS type is BSD 4.3 */ /* #define BSD44 ;OS type is BSD 4.4 */ /* #define POSIX ;OS type is based on POSIX */ /* #define OSTYPE ;OS type is one of the followings */ /* SOLARIS ;newer Solalis 2.0 (Sun) */ /* SUN_OS ;older SunOS 4.1 (Sun) */ /* NEWS_OS6 ;newer NEWS-OS R6.0 (SONY) */ /* NEWS_OS4 ;newer NEWS-OS R4.2 (SONY) */ /* NEWS_OS3 ;older NEWS-OS R3.3 (SONY) */ /* IRIX ;IRIX (SGI) */ /* HPUX ;HP-UX (HP) */ /* EWSUXV ;EWS-UX/V (NEC) */ /* UNIOSU ;UniOS-U (OMRON) */ /* UNIOSB ;UniOS-B (OMRON) */ /* LUNA88K ;Luna/Mach (OMRON) */ /* DECOSF1V2 ;older OSF/1 V2 (DEC) */ /* DECOSF1V3 ;newer OSF/1 V3 (DEC) */ /* AIX ;AIX (IBM) */ /* ULTRIX ;Ultrix (DEC) */ /* AUX ;A/UX (Apple) */ /* DGUX ;DG/UX AViiON (DG) */ /* UXPM ;UXP/M (Fujitsu) */ /* UXPDS ;UXP/DS (Fujitsu) */ /* NEXTSTEP ;NEXTSTEP (NeXT) */ /* CYGWIN ;Cygwin */ /* LINUX ;Linux */ /* JCCBSD ;4.4BSD-Lite (JCC) */ /* FREEBSD ;FreeBSD */ /* NETBSD ;NetBSD */ /* BSDOS ;BSD/OS (BSDI) */ /* BOW ;BSD on Windows (ASCII) */ /* OPENBSD ;OpenBSD */ /* DARWIN ;Darwin (Apple) */ /* MINIX ;MINIX */ /* ANDROID ;Android (aka Linux) */ /* ORG_386BSD ;386BSD */ /* MIPS ;RISC/os (MIPS) */ /* LLVM ;Low Level Virtual Machine */ /* #define CODEEUC ;kanji code type is EUC */ /* #define DEFKCODE ;default string for kanji code type */ /* #define UTF8DOC ;kanji code type for documents is UTF-8 */ /* #define UTF8LANG ;kanji code type if LANG environment value is UTF-8 */ /* #define NOMULTIKANJI ;no need to support multiple kanji codes */ /* #define PATHNOCASE ;pathname is case insensitive */ /* #define COMMNOCASE ;shell command name is case insensitive */ /* #define ENVNOCASE ;environment variable is case insensitive */ /* #define NOUID ;have not uid, gid */ /* #define NODIRLOOP ;any directory structure cannot loop */ /* #define NOSYMLINK ;have not symbolic link */ /* #define BSPATHDELIM ;path delimtor is backspace */ /* #define USECRNL ;use CR-NL as end of line */ /* #define CWDINPATH ;CWD is implicitly included in command path */ /* #define DOUBLESLASH ;pathname starting with // has some special mean */ /* #define USEMANLANG ;man(1) directory includes LANG environment value */ /* #define LANGWIDTH ;column width of LANG used man(1) directory */ /* #define SUPPORTSJIS ;cc(1) or man(1) supports Shift JIS perfectly */ /* #define BSDINSTALL ;install(1) with option -c is valid like BSD */ /* #define BSDINSTCMD ;command name except "install" to install like BSD */ /* #define TARUSESPACE ;tar(1) uses space to divide file mode from UID */ /* #define TARFROMPAX ;tar(1) comes from pax(1) */ /* #define BUGGYMAKE ;make(1) assumes the same timestamp as earlier */ /* #define CPP7BIT ;cpp(1) cannot through 8bit */ /* #define OLDARGINT ;cc(1) treats any old-fashioned argument as integer */ /* #define CCCOMMAND ;fullpath of suitable cc(1) */ /* #define EXTENDCCOPT ;additional option on cc(1) */ /* #define CCOUTOPT ;option for output file name on cc(1) with -c */ /* #define CCLNKOPT ;option for output file name on cc(1) without -c */ /* #define USETERMINFO ;use terminfo library instead of termcap */ /* #define TERMCAPLIB ;library needed for termcap */ /* #define REGEXPLIB ;library needed for regular expression */ /* #define SOCKETLIB ;library needed for socket */ /* #define EXTENDLIB ;library needed for the other extended */ /* #define UNKNOWNFS ;use unsupported type FileSystem */ /* #define NOFILEMACRO ;cc(1) cannot evaluate __FILE__ macro */ /* #define NOFUNCMACRO ;cc(1) cannot evaluate __FUNCTION__ macro */ /* #define NOLINEMACRO ;cc(1) cannot evaluate __LINE__ macro */ /* #define FORCEDSTDC ;not defined __STDC__, but expect standard C */ /* #define STRICTSTDC ;cannot allow K&R type function declaration */ /* #define NOSTDC ;defined __STDC__, but expect traditional C */ /* #define NOCONST ;defined __STDC__, but cannot use 'const' qualifier */ /* #define NOVOID ;cannot use type 'void' */ /* #define NOUINT ;cannot use type 'u_int' */ /* #define NOLONGLONG ;cannot use type 'long long' */ /* #define HAVELONGLONG ;have type 'long long' */ /* #define NOUID_T ;uid_t, gid_t is not defined in */ /* #define USEPID_T ;pid_t is defined in as process ID */ /* #define DECLSIGLIST ;'sys_siglist[]' declared in */ /* #define NOSIGLIST ;have not 'sys_siglist[]' in library */ /* #define DECLERRLIST ;'sys_errlist[]' declared in or */ /* #define PWNEEDERROR ;/lib/libPW.a needs the extern variable 'Error[]' */ /* #define NOERRNO ;'errno' not declared in */ /* #define NOFILEMODE ;'S_I?{USR|GRP|OTH}' not defined in */ /* #define NOUNISTDH ;have not */ /* #define NOSTDLIBH ;have not */ /* #define NOTZFILEH ;have not */ /* #define USELEAPCNT ;'struct tzhead' has 'tzh_leapcnt' as leap second */ /* #define USESELECTH ;use for select() */ /* #define USESYSDIRH ;use for DEV_BSIZE */ /* #define USETIMEH ;use for 'struct tm' */ /* #define USESTDARGH ;use for va_list */ /* #define USEMKDEVH ;use for major()/minor() */ /* #define USEMKNODH ;use for major()/minor() */ /* #define USELOCKFH ;use for lockf() */ /* #define USESGTTY ;use sgtty interface */ /* #define USETERMIO ;use termio interface */ /* #define USETERMIOS ;use termios interface */ /* #define HAVECLINE ;'struct termios' has 'c_line' */ /* #define USEDEVPTMX ;use /dev/ptmx and /dev/pts/? for pseudo terminal */ /* #define USEDEVPTY ;use /dev/pty for pseudo terminal */ /* #define USEDIRECT ;use 'struct direct' instead of dirent */ /* #define SYSVDIRENT ;dirent interface behaves as System V */ /* #define NODNAMLEN ;'struct dirent' hasn't 'd_namlen' */ /* #define NODRECLEN ;'struct dirent' hasn't 'd_reclen' but 'd_fd' */ /* #define DNAMESIZE ;size of 'd_name' in 'struct dirent' */ /* #define HAVETIMEZONE ;have extern variable 'timezone' */ /* #define NOTMGMTOFF ;'struct tm' hasn't 'tm_gmtoff' */ /* #define NOSTBLKSIZE ;'struct stat' hasn't 'st_blksize' */ /* #define NOFLAGS ;'struct stat' has 'st_flags' but unsupported */ /* #define NOFTPH ;have not */ /* #define USEINSYSTMH ;use for */ /* #define NOHADDRLIST ;'struct hostent' hasn't 'h_addr_list' */ /* following 5 items are exclusive */ /* #define USESTATVFSH ;use as header of the FS status */ /* #define USESTATFSH ;use as header of the FS status */ /* #define USEVFSH ;use as header of the FS status */ /* #define USEMOUNTH ;use as header of the FS status */ /* #define USEFSDATA ;use 'struct fs_data' as structure of hte FS status */ /* #define USEFFSIZE ;'struct statfs' has 'f_fsize' as block size */ /* #define NOFBLOCKS ;'struct statfs' hasn't 'f_blocks' */ /* #define NOFBFREE ;'struct statfs' hasn't 'f_bfree' */ /* #define NOFFILES ;'struct statfs' hasn't 'f_files' */ /* #define USESTATVFS_T ;use 'statvfs_t' instead of 'struct statvfs' */ /* #define STATFSARGS ;the number of arguments in statfs() */ /* #define USEFSTATFS ;the fstatfs() instead of statfs() */ /* following 10 items are exclusive */ /* #define USEMNTENTH ;use as header of the mount entry */ /* #define USEMNTTABH ;use as header of the mount entry */ /* #define USEGETFSSTAT ;use getfsstat() to get the mount entry */ /* #define USEGETVFSTAT ;use getvfsstat() to get the mount entry */ /* #define USEMNTCTL ;use mntctl() to get the mount entry */ /* #define USEMNTINFOR ;use getmntinfo_r() to get the mount entry */ /* #define USEMNTINFO ;use getmntinfo() to get the mount entry */ /* #define USEGETMNT ;use getmnt() to get the mount entry */ /* #define USEGETFSENT ;use getfsent() to get the mount entry */ /* #define USEREADMTAB ;read directly /etc/mtab to get the mount entry */ /* #define USEPROCMNT ;use /proc/mounts as MOUNTED */ /* #define HAVEPROCMNT ;can use /proc/mounts as MOUNTED */ /* following 2 items are exclusive */ /* #define USEVFCNAME ;'struct vfsconf' has 'vfc_name' as the mount type */ /* #define USEFFSTYPE ;'struct statfs' has 'f_fstypename' as mount type */ /* following 3 items are exclusive */ /* #define USERE_COMP ;use re_comp() family as search */ /* #define USEREGCOMP ;use regcomp() family as search */ /* #define USEREGCMP ;use regcmp() family as search */ /* #define USERAND48 ;use rand48() family instead of random() */ /* #define USESETENV ;use setenv() instead of putenv() */ /* #define NOSELECT ;have not select() */ /* #define DEFFDSETSIZE ;pre-define FD_SETSIZE as OPEN_MAX for select() */ /* #define SELECTRWONLY ;select() cannot respond with the file opened as r/w */ /* #define NOVSPRINTF ;have not vsprintf() */ /* #define NOTERMVAR ;have not termcap variables such as PC, ospeed, etc. */ /* #define USEUTIME ;use utime() instead of utimes() */ /* #define USEGETWD ;use getwd() instead of getcwd() */ /* #define ULONGIOCTL ;the 2nd argument of ioctl() is unsigned long */ /* #define NOFTRUNCATE ;have not ftruncate() */ /* #define USEFCNTLOCK ;use fcntl() lock instead of flock() */ /* #define USELOCKF ;use lockf() instead of flock() */ /* #define NOFLOCK ;have neither flock() nor lockf() */ /* #define NOSYSLOG ;have not syslog() */ /* #define USETIMELOCAL ;have timelocal() as inverse of localtime() */ /* #define USEMKTIME ;use mktime() instead of timelocal() */ /* #define USESYSCONF ;use sysconf() for getting system configuration */ /* #define USELLSEEK ;use _llseek() for 64bits width instead of lseek() */ /* #define USEUNAME ;use uname() instead of gethostname() */ /* #define NOKILLPG ;have not killpg() */ /* #define USEWAITPID ;use waitpid() instead of wait3() */ /* #define USESIGACTION ;use sigaction() instead of signal() */ /* #define USESIGPMASK ;use sigprocmask() instead of sigsetmask() */ /* #define NODTABLESIZE ;have not getdtablesize() */ /* #define USERESOURCEH ;use for resource info. */ /* #define USEULIMITH ;use for resource info. */ /* #define USEGETRUSAGE ;use getrusage() for getting process time */ /* #define USETIMES ;use times() for getting process time */ /* #define GETPGRPVOID ;getpgrp() needs void argument */ /* #define USESETPGID ;use setpgid() instead of setpgrp() */ /* #define NOSETPGRP ;have not setpgrp() */ /* #define USETCGETPGRP ;use tcgetpgrp()/tcsetpgrp() instead of ioctl() */ /* #define USESETVBUF ;use setvbuf() instead of setbuf() or setlinebuf() */ /* #define SIGARGINT ;the 2nd argument function of signal() returns int */ /* #define SIGFNCINT ;the 2nd argument function of signal() needs int */ /* #define USESTRERROR ;use strerror() instead of sys_errlist[] */ /* #define GETTODARGS ;the number of arguments in gettimeofday() */ /* #define GETTODNULL ;the 2nd argument of gettimeofday() must be NULL */ /* #define USESETSID ;use setsid() to set session ID */ /* #define USEMMAP ;use mmap() to map files into memory */ /* #define NOGETPASS ;have not getpass() */ /* #define USESOCKLEN ;use socklen_t for bind()/connect()/accept() */ /* #define NOSENDFLAGS ;send() cannot support flags */ /* #define USEINETATON ;use inet_aton() instead of inet_addr() */ /* #define USEINETPTON ;use inet_pton() instead of inet_addr() */ /* #define NOGETPWENT ;have not getpwent() */ /* #define NOGETGRENT ;have not getgrent() */ /* #define USESETREUID ;use setreuid() to set effective user ID */ /* #define USESETRESUID ;use setresuid() to set effective user ID */ /* #define USESETREGID ;use setregid() to set effective group ID */ /* #define USESETRESGID ;use setresgid() to set effective group ID */ /* #define USEGETGROUPS ;use getgroups() to get group access list */ /* #define SENSEPERSEC ;ratio of key sense per 1 second */ /* #define WAITKEYPAD ;interval to wait after getting input of ESC [ms] */ /* #define WAITTERMINAL ;interval to wait for terminal response [ms] */ /* #define WAITKANJI ;interval to wait after getting input of Kanji [ms] */ /* */ /* DO NOT DELETE or EDIT BELOW */ /* */ #ifdef BSPATHDELIM #define _SC_ '\\' #define _SS_ "\\" #else #define _SC_ '/' #define _SS_ "/" #endif #if defined (BSD43) || defined (BSD44) #define BSD4 #endif #if defined (BSD44) || defined (SVR4) #define POSIX #define DEFFDSETSIZE #endif #ifdef POSIX # if !defined (USESGTTY) && !defined (USETERMIO) && !defined (USETERMIOS) # define USETERMIOS # endif #define USEPID_T #define USESYSCONF #define USEWAITPID #define USESIGACTION #define USESIGPMASK #define USERESOURCEH #define GETPGRPVOID #define USESETPGID #define USESETVBUF #define USESTRERROR #define USESETSID #define USEMMAP #endif #ifdef SVR4 #define SYSV #define USESOCKLEN #endif #ifdef SYSV #define TARUSESPACE # if !defined (USESGTTY) && !defined (USETERMIO) && !defined (USETERMIOS) # define USETERMIO # endif #define SYSVDIRENT #define HAVETIMEZONE #define USERAND48 #define USEUNAME #define NOKILLPG #define NODTABLESIZE # if !defined (USERE_COMP) && !defined (USEREGCOMP) # define USEREGCMP # endif #endif #if defined (BSD4) && !defined (USEDEVPTY) #define USEDEVPTY #endif #ifndef USEDEVPTY #define USEDEVPTMX #endif #if defined (POSIX) || defined (SYSV) #define USEFCNTLOCK #endif #if defined (BSD4) #define USEINSYSTMH #endif #if defined (BSD4) && !defined (BSD43) && !defined (BSD44) #define NOHADDRLIST #endif #if defined (POSIX) || defined (BSD4) #define USEGETGROUPS #endif #if defined (__GNUC__) || defined (__attribute__) #define X_attr_packed __attribute__ ((packed)) #else #define X_attr_packed #endif #ifdef __HOST_LANG__ #undef CODEEUC # if !MSDOS \ && !defined (NEWS_OS6) && !defined (NEWS_OS4) && !defined (NEWS_OS3) \ && !defined (HPUX) && !defined (UNIOSB) \ && !defined (AIX) && !defined (AUX) \ && !defined (CYGWIN) && !defined (BOW) && !defined (DARWIN) \ && !defined (ANDROID) && !defined (ORG_386BSD) # define CODEEUC # endif #endif /* */ /* Eval configurations by Configur */ /* */ #include "config.h" #ifdef USETERMIOS #undef USETERMIO #endif #if defined (USETERMIOS) || defined (USETERMIO) #undef USESGTTY #endif #if !defined (USETERMIOS) && !defined (USETERMIO) && !defined (USESGTTY) #define USESGTTY #endif #if defined (__STDC__) && !defined (NOSTDC) && !defined (FORCEDSTDC) #define FORCEDSTDC #endif #if defined (__STRICT_ANSI__) && !defined (STRICTSTDC) #define STRICTSTDC #endif #if defined (FORCEDSTDC) && !defined (USESTDARGH) #define USESTDARGH #endif #if defined (__STDC__) && !defined (NOSTDC) \ && !defined (NOLONGLONG) && !defined (HAVELONGLONG) #define HAVELONGLONG #endif #if defined (FORCEDSTDC) && !defined (STRICTSTDC) #define __P_(args) args #else #define __P_(args) () #endif #if defined (FORCEDSTDC) && !defined (NOCONST) #define CONST const #else #define CONST #endif #ifdef FORCEDSTDC #define ALLOC_T size_t #define VOID_A void #else #define ALLOC_T u_int #define VOID_A #endif #ifdef NOVOID #define VOID #define VOID_T int #define VOID_P char * #define VOID_C #else #define VOID void #define VOID_T void #define VOID_P void * #define VOID_C (void) #endif #ifdef NOUINT typedef unsigned int u_int; typedef unsigned char u_char; typedef unsigned short u_short; typedef unsigned long u_long; #endif #if defined (USEREGCMP) && !defined (REGEXPLIB) #define REGEXPLIB "-lPW" #endif #if defined (BSDINSTALL) && !defined (BSDINSTCMD) #define BSDINSTCMD "install" #endif #ifndef OSTYPE #define OSTYPE "UNKNOWN" #endif #ifndef CCCOMMAND #define CCCOMMAND "cc" #endif #ifndef EXTENDCCOPT #define EXTENDCCOPT "-O" #endif #ifndef TERMCAPLIB # ifdef USETERMINFO # define TERMCAPLIB "-lcurses" # else # define TERMCAPLIB "-ltermlib" # endif #endif #ifndef REGEXPLIB #define REGEXPLIB "" #endif #ifndef SOCKETLIB #define SOCKETLIB "" #endif #ifndef EXTENDLIB #define EXTENDLIB "" #endif #ifndef DNAMESIZE #define DNAMESIZE (MAXNAMLEN + 1) #endif #if defined (USESTATVFSH) #undef USESTATFSH #endif #if defined (USESTATVFSH) || defined (USESTATFSH) #undef USEMOUNTH #endif #if defined (USESTATVFSH) || defined (USESTATFSH) || defined (USEMOUNTH) #undef USEFSDATA #endif #if defined (USESTATVFSH) || defined (USESTATFSH) \ || defined (USEMOUNTH) || defined (USEFSDATA) #undef USEVFSH #endif #if !defined (USESTATVFSH) && !defined (USESTATFSH) \ && !defined (USEMOUNTH) && !defined (USEFSDATA) && !defined (USEVFSH) #define USEVFSH #endif #if defined (USESTATFSH) || defined (USEVFSH) || defined (USEMOUNTH) # ifndef STATFSARGS # define STATFSARGS 2 # endif #endif #if defined (USEMNTTABH) #undef USEGETFSSTAT #endif #if defined (USEMNTTABH) || defined (USEGETFSSTAT) #undef USEGETVFSTAT #endif #if defined (USEMNTTABH) || defined (USEGETFSSTAT) \ || defined (USEGETVFSTAT) #undef USEMNTCTL #endif #if defined (USEMNTTABH) || defined (USEGETFSSTAT) \ || defined (USEGETVFSTAT) || defined (USEMNTCTL) #undef USEMNTINFOR #endif #if defined (USEMNTTABH) || defined (USEGETFSSTAT) \ || defined (USEGETVFSTAT) || defined (USEMNTCTL) || defined (USEMNTINFOR) #undef USEMNTINFO #endif #if defined (USEMNTTABH) || defined (USEGETFSSTAT) \ || defined (USEGETVFSTAT) || defined (USEMNTCTL) || defined (USEMNTINFOR) \ || defined (USEMNTINFO) #undef USEGETMNT #endif #if defined (USEMNTTABH) || defined (USEGETFSSTAT) \ || defined (USEGETVFSTAT) || defined (USEMNTCTL) || defined (USEMNTINFOR) \ || defined (USEMNTINFO) || defined (USEGETMNT) #undef USEGETFSENT #endif #if defined (USEMNTTABH) || defined (USEGETFSSTAT) \ || defined (USEGETVFSTAT) || defined (USEMNTCTL) || defined (USEMNTINFOR) \ || defined (USEMNTINFO) || defined (USEGETMNT) || defined (USEGETFSENT) #undef USEREADMTAB #endif #if defined (USEMNTTABH) || defined (USEGETFSSTAT) \ || defined (USEGETVFSTAT) || defined (USEMNTCTL) || defined (USEMNTINFOR) \ || defined (USEMNTINFO) || defined (USEGETMNT) || defined (USEGETFSENT) \ || defined (USEREADMTAB) #undef USEMNTENTH #endif #if !defined (USEMNTTABH) && !defined (USEGETFSSTAT) \ && !defined (USEGETVFSTAT) && !defined (USEMNTCTL) && !defined (USEMNTINFOR) \ && !defined (USEMNTINFO) && !defined (USEGETMNT) && !defined (USEGETFSENT) \ && !defined (USEREADMTAB) && !defined (USEMNTENTH) #define USEMNTENTH #endif #if MSDOS #undef USEVFSH #undef USEMNTENTH #endif #if defined (USEVFCNAME) #undef USEFFSTYPE #endif #if defined (USERE_COMP) #undef USEREGCOMP #endif #if defined (USERE_COMP) || defined (USEREGCOMP) #undef USEREGCMP #endif #if !defined (USEGETRUSAGE) && !defined (USETIMES) \ && defined (USERESOURCEH) #define USEGETRUSAGE #endif #ifndef GETTODARGS #define GETTODARGS 2 #endif #endif /* !__MACHINE_H_ */ FD-3.01j/depend.h100644 2105 1751 12164 13516612560 12315 0ustar shiraiuser/* * depend.h * * definitions for dependency */ #if MSDOS && defined (_NOUSELFN) && !defined (_NODOSDRIVE) #define _NODOSDRIVE #endif #if defined (NOMULTIKANJI) && !defined (_NOKANJICONV) #define _NOKANJICONV #endif #if (defined (_NOKANJICONV) || (defined (FD) && FD < 2)) \ && !defined (_NOKANJIFCONV) #define _NOKANJIFCONV #endif #if (defined (_NOKANJICONV) || (defined (FD) && FD < 2)) \ && !defined (_NOIME) #define _NOIME #endif #if defined (_NOENGMES) && defined (_NOJPNMES) #undef _NOENGMES #endif #if (defined (_NOENGMES) || defined (_NOJPNMES) \ || (defined (FD) && FD < 3)) \ && !defined (_NOCATALOG) #define _NOCATALOG #endif #if (MSDOS || (defined (FD) && FD < 3)) && !defined (_NOSOCKET) #define _NOSOCKET #endif #if defined (_NOSOCKET) && !defined (_NOSOCKREDIR) #define _NOSOCKREDIR #endif #if defined (_NOSOCKET) && !defined (_NOFTP) #define _NOFTP #endif #if defined (_NOSOCKET) && !defined (_NOHTTP) #define _NOHTTP #endif #ifdef WITHNETWORK #undef OLDPARSE #endif #if defined (OLDPARSE) && !defined (_NOCUSTOMIZE) #define _NOCUSTOMIZE #endif #if defined (OLDPARSE) && !defined (_NOBROWSE) #define _NOBROWSE #endif #if defined (OLDPARSE) && !defined (_NOFTP) #define _NOFTP #endif #if defined (OLDPARSE) && !defined (_NOHTTP) #define _NOHTTP #endif #if MSDOS && !defined (_NOKEYMAP) #define _NOKEYMAP #endif #if MSDOS && !defined (_USEDOSCOPY) #define _USEDOSCOPY #endif #if (defined (_NOORIGSHELL) || (defined (FD) && FD < 2)) \ && !defined (_NOEXTRAMACRO) #define _NOEXTRAMACRO #endif #ifdef _NOSPLITWIN #undef MAXWINDOWS #define MAXWINDOWS 1 #else /* !_NOSPLITWIN */ # if (MAXWINDOWS <= 1) # define _NOSPLITWIN # endif #endif /* !_NOSPLITWIN */ #if (defined (_NOSPLITWIN) || (defined (FD) && FD < 2)) \ && !defined (_NOEXTRAWIN) #define _NOEXTRAWIN #endif #if (MSDOS || defined (NOSELECT) || (defined(FD) && FD < 2)) \ && !defined (_NOPTY) #define _NOPTY #endif #if (!defined (FD) || FD < 3) && !defined (_NOVERSCMP) #define _NOVERSCMP #else #undef _NOVERSCMP #define _NOVERSCMP "unsupported" #endif #undef DEP_DOSDRIVE #undef DEP_DOSEMU #undef DEP_DOSPATH #undef DEP_DOSLFN #undef DEP_ROCKRIDGE #undef DEP_KCONV #undef DEP_FILECONV #undef DEP_KANJIPATH #undef DEP_UNICODE #undef DEP_EMBEDUNITBL #undef DEP_ORIGSTREAM #undef DEP_ORIGSHELL #undef DEP_PTY #undef DEP_IME #undef DEP_EMBEDDICTTBL #undef DEP_LOGGING #undef DEP_DYNAMICLIST #undef DEP_SOCKET #undef DEP_SOCKREDIR #undef DEP_FTPPATH #undef DEP_HTTPPATH #undef DEP_URLPATH #undef DEP_STREAMTIMEOUT #undef DEP_STREAMLOCK #undef DEP_STREAMSOCKET #undef DEP_STREAMLOG #undef DEP_LSPARSE #undef DEP_PSEUDOPATH #undef DEP_BIASPATH #undef DEP_DIRENT #undef DEP_PATHTOP #if defined (FD) && !defined (_NODOSDRIVE) #define DEP_DOSDRIVE #endif #if !MSDOS && defined (DEP_DOSDRIVE) #define DEP_DOSEMU #endif #if MSDOS || defined (DEP_DOSDRIVE) #define DEP_DOSPATH #endif #if MSDOS && defined (FD) && !defined (_NOUSELFN) #define DEP_DOSLFN #endif #if defined (FD) && !defined (_NOROCKRIDGE) #define DEP_ROCKRIDGE #endif #if defined (FD) && !defined (_NOKANJICONV) #define DEP_KCONV #endif #if defined (FD) && !defined (_NOKANJIFCONV) #define DEP_FILECONV #endif #if !defined (NOMULTIKANJI) && defined (DEP_FILECONV) #define DEP_KANJIPATH #endif #if (defined (DEP_KCONV) && !defined (_NOUNICODE)) \ || defined (DEP_DOSDRIVE) #define DEP_UNICODE #endif #if defined (DEP_UNICODE) && defined (_NOUNICDTBL) #define DEP_EMBEDUNITBL #endif #ifndef MINIMUMSHELL #define DEP_ORIGSTREAM #endif #if defined (FDSH) || (defined (FD) && FD >= 2 && !defined (_NOORIGSHELL)) #define DEP_ORIGSHELL #endif #if defined (FD) && FD >= 2 && !defined (_NOPTY) #define DEP_PTY #endif #if defined (FD) && FD >= 2 && !defined (_NOIME) #define DEP_IME #endif #if defined (DEP_IME) && defined (_NODICTTBL) #define DEP_EMBEDDICTTBL #endif #if defined (FD) && FD >= 2 && !defined (_NOLOGGING) #define DEP_LOGGING #endif #if defined (FD) && FD >= 3 && !defined (_NODYNAMICLIST) #define DEP_DYNAMICLIST #endif #if !MSDOS \ && (defined (WITHNETWORK) || (defined (FD) && !defined (_NOSOCKET))) #define DEP_SOCKET #endif #if !MSDOS \ && (defined (WITHNETWORK) || (defined (FD) && !defined (_NOSOCKREDIR))) #define DEP_SOCKREDIR #endif #if !MSDOS \ && (defined (WITHNETWORK) || (defined (FD) && !defined (_NOFTP))) #define DEP_FTPPATH #endif #if !MSDOS \ && (defined (WITHNETWORK) || (defined (FD) && !defined (_NOHTTP))) #define DEP_HTTPPATH #endif #if defined (DEP_FTPPATH) || defined (DEP_HTTPPATH) #define DEP_URLPATH #endif #if defined (MH) || (defined (DEP_URLPATH) && !defined (NOSELECT)) #define DEP_STREAMTIMEOUT #endif #if defined (MH) && !defined (NOFLOCK) #define DEP_STREAMLOCK #endif #if defined (MH) || defined (DEP_SOCKET) #define DEP_STREAMSOCKET #endif #ifdef MH #define DEP_STREAMLOG #endif #if !defined (FD) || !defined (_NOARCHIVE) || defined (DEP_FTPPATH) #define DEP_LSPARSE #endif #if defined (DEP_DOSDRIVE) || defined (DEP_URLPATH) #define DEP_PSEUDOPATH #endif #if defined (DEP_PSEUDOPATH) || defined (DEP_DOSLFN) \ || defined (DEP_KANJIPATH) || defined (DEP_ROCKRIDGE) #define DEP_BIASPATH #endif #if MSDOS || defined (DEP_BIASPATH) #define DEP_DIRENT #endif #if defined (DEP_DOSEMU) || defined (DOUBLESLASH) || defined (DEP_URLPATH) #define DEP_PATHTOP #endif FD-3.01j/printf.h100644 2105 1751 3231 13516612560 12333 0ustar shiraiuser/* * printf.h * * definitions & function prototype declarations for "printf.c" */ #ifndef __PRINTF_H_ #define __PRINTF_H_ #include "stream.h" #define MAXCHARWID 4 typedef struct _printbuf_t { char *buf; int ptr; int size; u_short flags; } printbuf_t; #define VF_NEW 000001 #define VF_FILE 000002 #define VF_KANJI 000010 #define VF_UNSIGNED 000020 #define VF_ARGUMENT 000040 #define VF_PLUS 000100 #define VF_MINUS 000200 #define VF_SPACE 000400 #define VF_ZERO 001000 #define VF_THOUSAND 002000 #define VF_STRICTWIDTH 004000 #define VF_PRINTABLE 010000 #define VF_SIZEUNIT 020000 #define VF_ASPOSSIBLE 040000 #ifdef MINIMUMSHELL #define strlen3 strlen2 #else extern VOID getcharwidth __P_((CONST char *, ALLOC_T, int *, int *)); extern int strlen3 __P_((CONST char *)); #endif extern int getnum __P_((CONST char *, int *)); extern int setchar __P_((int, printbuf_t *)); #ifndef MINIMUMSHELL extern int Xvasprintf __P_((char **, CONST char *, va_list)); extern int Xasprintf __P_((char **, CONST char *, ...)); #endif extern int Xvsnprintf __P_((char *, int, CONST char *, va_list)); extern int Xsnprintf __P_((char *, int, CONST char *, ...)); extern int Xvfprintf __P_((XFILE *, CONST char *, va_list)); extern int Xfprintf __P_((XFILE *, CONST char *, ...)); extern int Xprintf __P_((CONST char *, ...)); #ifdef FD extern VOID kanjifputs __P_((CONST char *, XFILE *)); #else #define kanjifputs Xfputs #endif extern CONST char printfflagchar[]; extern CONST int printfflag[]; extern CONST char printfsizechar[]; extern CONST int printfsize[]; extern int printf_urgent; #ifdef DEP_FILECONV extern int printf_defkanji; #endif #endif /* !__PRINTF_H_ */ FD-3.01j/time.h100644 2105 1751 536 13516612560 11754 0ustar shiraiuser/* * time.h * * definitions & function prototype declarations for "time.c" */ #if (GETTODARGS == 1) #define Xgettimeofday(tv, tz) gettimeofday(tv) #else #define Xgettimeofday(tv, tz) gettimeofday(tv, tz) #endif extern time_t Xtime __P_((time_t *)); extern time_t Xtimegm __P_((CONST struct tm *)); extern time_t Xtimelocal __P_((struct tm *)); FD-3.01j/kctype.h100644 2105 1751 32670 13516612560 12361 0ustar shiraiuser/* * kctype.h * * Kanji code type macros */ #ifndef __KCTYPE_H_ #define __KCTYPE_H_ #include "depend.h" #include #ifdef K_EXTERN #define K_INTERN #define K_INIT(x) =x #else #define K_EXTERN extern #define K_INIT(x) #endif #define C_BS '\010' #define C_DEL '\177' #define C_EKANA 0x8e #ifdef LSI_C #include #define Xtoupper(c) toupper((u_char)(c)) #define Xtolower(c) tolower((u_char)(c)) #define Xisalnum(c) isalnum((u_char)(c)) #define Xisalpha(c) isalpha((u_char)(c)) #define Xiscntrl(c) iscntrl((u_char)(c)) #define Xisdigit(c) isdigit((u_char)(c)) #define Xisupper(c) isupper((u_char)(c)) #define Xislower(c) islower((u_char)(c)) #define Xisxdigit(c) isxdigit((u_char)(c)) #define Xisspace(c) isspace((u_char)(c)) #define Xisprint(c) isprint((u_char)(c)) #define Xisblank(c) ((c) == ' ' || (c) == '\t') #define Xiskana(c) iskana((u_char)(c)) #define issjis1(c) iskanji((u_char)(c)) #define issjis2(c) iskanji2((u_char)(c)) #define isutf2(c1, c2) ((((u_char)(c1) & 0xe0) == 0xc0) \ && ((u_char)(c2) & 0xc0) == 0x80) #define isutf3(c1, c2, c3) (((u_char)(c1) & 0xf0) == 0xe0 \ && ((u_char)(c2) & 0xc0) == 0x80 \ && ((u_char)(c3) & 0xc0) == 0x80) #else /* !LSI_C */ K_EXTERN CONST u_char uppercase[256] #ifdef K_INTERN = { 0x00, 0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07, /* 0x00 */ 0x08, 0x09, 0x0a, 0x0b, 0x0c, 0x0d, 0x0e, 0x0f, 0x10, 0x11, 0x12, 0x13, 0x14, 0x15, 0x16, 0x17, /* 0x10 */ 0x18, 0x19, 0x1a, 0x1b, 0x1c, 0x1d, 0x1e, 0x1f, 0x20, 0x21, 0x22, 0x23, 0x24, 0x25, 0x26, 0x27, /* 0x20 */ 0x28, 0x29, 0x2a, 0x2b, 0x2c, 0x2d, 0x2e, 0x2f, 0x30, 0x31, 0x32, 0x33, 0x34, 0x35, 0x36, 0x37, /* 0x30 */ 0x38, 0x39, 0x3a, 0x3b, 0x3c, 0x3d, 0x3e, 0x3f, 0x40, 0x41, 0x42, 0x43, 0x44, 0x45, 0x46, 0x47, /* 0x40 */ 0x48, 0x49, 0x4a, 0x4b, 0x4c, 0x4d, 0x4e, 0x4f, 0x50, 0x51, 0x52, 0x53, 0x54, 0x55, 0x56, 0x57, /* 0x50 */ 0x58, 0x59, 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, 0xfe, 0xff } #endif /* K_INTERN */ ; K_EXTERN CONST u_char lowercase[256] #ifdef K_INTERN = { 0x00, 0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07, /* 0x00 */ 0x08, 0x09, 0x0a, 0x0b, 0x0c, 0x0d, 0x0e, 0x0f, 0x10, 0x11, 0x12, 0x13, 0x14, 0x15, 0x16, 0x17, /* 0x10 */ 0x18, 0x19, 0x1a, 0x1b, 0x1c, 0x1d, 0x1e, 0x1f, 0x20, 0x21, 0x22, 0x23, 0x24, 0x25, 0x26, 0x27, /* 0x20 */ 0x28, 0x29, 0x2a, 0x2b, 0x2c, 0x2d, 0x2e, 0x2f, 0x30, 0x31, 0x32, 0x33, 0x34, 0x35, 0x36, 0x37, /* 0x30 */ 0x38, 0x39, 0x3a, 0x3b, 0x3c, 0x3d, 0x3e, 0x3f, 0x40, 0x61, 0x62, 0x63, 0x64, 0x65, 0x66, 0x67, /* 0x40 */ 0x68, 0x69, 0x6a, 0x6b, 0x6c, 0x6d, 0x6e, 0x6f, 0x70, 0x71, 0x72, 0x73, 0x74, 0x75, 0x76, 0x77, /* 0x50 */ 0x78, 0x79, 0x7a, 0x5b, 0x5c, 0x5d, 0x5e, 0x5f, 0x60, 0x61, 0x62, 0x63, 0x64, 0x65, 0x66, 0x67, /* 0x60 */ 0x68, 0x69, 0x6a, 0x6b, 0x6c, 0x6d, 0x6e, 0x6f, 0x70, 0x71, 0x72, 0x73, 0x74, 0x75, 0x76, 0x77, /* 0x70 */ 0x78, 0x79, 0x7a, 0x7b, 0x7c, 0x7d, 0x7e, 0x7f, 0x80, 0x81, 0x82, 0x83, 0x84, 0x85, 0x86, 0x87, /* 0x80 */ 0x88, 0x89, 0x8a, 0x8b, 0x8c, 0x8d, 0x8e, 0x8f, 0x90, 0x91, 0x92, 0x93, 0x94, 0x95, 0x96, 0x97, /* 0x90 */ 0x98, 0x99, 0x9a, 0x9b, 0x9c, 0x9d, 0x9e, 0x9f, 0xa0, 0xa1, 0xa2, 0xa3, 0xa4, 0xa5, 0xa6, 0xa7, /* 0xa0 */ 0xa8, 0xa9, 0xaa, 0xab, 0xac, 0xad, 0xae, 0xaf, 0xb0, 0xb1, 0xb2, 0xb3, 0xb4, 0xb5, 0xb6, 0xb7, /* 0xb0 */ 0xb8, 0xb9, 0xba, 0xbb, 0xbc, 0xbd, 0xbe, 0xbf, 0xc0, 0xc1, 0xc2, 0xc3, 0xc4, 0xc5, 0xc6, 0xc7, /* 0xc0 */ 0xc8, 0xc9, 0xca, 0xcb, 0xcc, 0xcd, 0xce, 0xcf, 0xd0, 0xd1, 0xd2, 0xd3, 0xd4, 0xd5, 0xd6, 0xd7, /* 0xd0 */ 0xd8, 0xd9, 0xda, 0xdb, 0xdc, 0xdd, 0xde, 0xdf, 0xe0, 0xe1, 0xe2, 0xe3, 0xe4, 0xe5, 0xe6, 0xe7, /* 0xe0 */ 0xe8, 0xe9, 0xea, 0xeb, 0xec, 0xed, 0xee, 0xef, 0xf0, 0xf1, 0xf2, 0xf3, 0xf4, 0xf5, 0xf6, 0xf7, /* 0xf0 */ 0xf8, 0xf9, 0xfa, 0xfb, 0xfc, 0xfd, 0xfe, 0xff } #endif /* K_INTERN */ ; K_EXTERN CONST u_char ctypetable[256] #ifdef K_INTERN = { 0020, 0020, 0020, 0020, 0020, 0020, 0020, 0020, /* 0x00 */ 0020, 0260, 0060, 0060, 0060, 0060, 0020, 0020, 0020, 0020, 0020, 0020, 0020, 0020, 0020, 0020, /* 0x10 */ 0020, 0020, 0020, 0020, 0020, 0020, 0020, 0020, 0340, 0100, 0100, 0100, 0100, 0100, 0100, 0100, /* 0x20 */ 0100, 0100, 0100, 0100, 0100, 0100, 0100, 0100, 0101, 0101, 0101, 0101, 0101, 0101, 0101, 0101, /* 0x30 */ 0111, 0101, 0100, 0100, 0100, 0100, 0100, 0100, 0100, 0112, 0112, 0112, 0112, 0112, 0112, 0102, /* 0x40 */ 0102, 0102, 0102, 0102, 0102, 0102, 0102, 0102, 0102, 0102, 0102, 0102, 0102, 0102, 0102, 0102, /* 0x50 */ 0102, 0102, 0102, 0100, 0100, 0100, 0100, 0100, 0100, 0114, 0114, 0114, 0114, 0114, 0114, 0104, /* 0x60 */ 0104, 0104, 0104, 0104, 0104, 0104, 0104, 0104, 0104, 0104, 0104, 0104, 0104, 0104, 0104, 0104, /* 0x70 */ 0104, 0104, 0104, 0100, 0100, 0100, 0100, 0020, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, /* 0x80 */ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, /* 0x90 */ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, /* 0xa0 */ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, /* 0xb0 */ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, /* 0xc0 */ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, /* 0xd0 */ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, /* 0xe0 */ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, /* 0xf0 */ } #endif /* K_INTERN */ ; K_EXTERN CONST u_char kctypetable[256] #ifdef K_INTERN = { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, /* 0x00 */ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, /* 0x10 */ 0, 0020, 0020, 0020, 0020, 0020, 0020, 0020, /* 0x20 */ 0020, 0020, 0020, 0020, 0020, 0020, 0020, 0020, 0020, 0020, 0020, 0020, 0020, 0020, 0020, 0020, /* 0x30 */ 0020, 0020, 0020, 0020, 0020, 0020, 0020, 0020, 0022, 0022, 0022, 0022, 0022, 0022, 0022, 0022, /* 0x40 */ 0022, 0022, 0022, 0022, 0022, 0022, 0022, 0022, 0022, 0022, 0022, 0022, 0022, 0022, 0022, 0022, /* 0x50 */ 0022, 0022, 0022, 0022, 0022, 0022, 0022, 0022, 0022, 0022, 0022, 0022, 0022, 0022, 0022, 0022, /* 0x60 */ 0022, 0022, 0022, 0022, 0022, 0022, 0022, 0022, 0022, 0022, 0022, 0022, 0022, 0022, 0022, 0022, /* 0x70 */ 0022, 0022, 0022, 0022, 0022, 0022, 0022, 0, 0042, 0043, 0043, 0043, 0043, 0043, 0043, 0043, /* 0x80 */ 0043, 0043, 0043, 0043, 0043, 0043, 0043, 0043, 0043, 0043, 0043, 0043, 0043, 0043, 0043, 0043, /* 0x90 */ 0043, 0043, 0043, 0043, 0043, 0043, 0043, 0043, 0042, 0056, 0056, 0056, 0056, 0056, 0056, 0056, /* 0xa0 */ 0056, 0056, 0056, 0056, 0056, 0056, 0056, 0056, 0056, 0056, 0056, 0056, 0056, 0056, 0056, 0056, /* 0xb0 */ 0056, 0056, 0056, 0056, 0056, 0056, 0056, 0056, 0116, 0116, 0116, 0116, 0116, 0116, 0116, 0116, /* 0xc0 */ 0116, 0116, 0116, 0116, 0116, 0116, 0116, 0116, 0116, 0116, 0116, 0116, 0116, 0116, 0116, 0116, /* 0xd0 */ 0116, 0116, 0116, 0116, 0116, 0116, 0116, 0116, 0213, 0213, 0213, 0213, 0213, 0213, 0213, 0213, /* 0xe0 */ 0213, 0213, 0213, 0213, 0213, 0213, 0213, 0213, 0013, 0013, 0013, 0013, 0013, 0013, 0013, 0013, /* 0xf0 */ 0013, 0013, 0013, 0013, 0013, 0010, 0010, 0 } #endif /* K_INTERN */ ; #define Xtoupper(c) (uppercase[(u_char)(c)]) #define Xtolower(c) (lowercase[(u_char)(c)]) #define C_DIGIT 0001 #define C_UPPER 0002 #define C_LOWER 0004 #define C_HEX 0010 #define C_CNTRL 0020 #define C_SPACE 0040 #define C_PRINT 0100 #define C_BLANK 0200 #define Xisalnum(c) (ctypetable[(u_char)(c)] \ & (C_DIGIT | C_UPPER | C_LOWER)) #define Xisalpha(c) (ctypetable[(u_char)(c)] & (C_UPPER | C_LOWER)) #define Xiscntrl(c) (ctypetable[(u_char)(c)] & C_CNTRL) #define Xisdigit(c) (ctypetable[(u_char)(c)] & C_DIGIT) #define Xisupper(c) (ctypetable[(u_char)(c)] & C_UPPER) #define Xislower(c) (ctypetable[(u_char)(c)] & C_LOWER) #define Xisxdigit(c) (ctypetable[(u_char)(c)] & (C_DIGIT | C_HEX)) #define Xisspace(c) (ctypetable[(u_char)(c)] & C_SPACE) #define Xisprint(c) (ctypetable[(u_char)(c)] & C_PRINT) #define Xisblank(c) (ctypetable[(u_char)(c)] & C_BLANK) #define KC_SJIS1 0001 #define KC_SJIS2 0002 #define KC_KANA 0004 #define KC_EUCJP 0010 #define KC_JIS 0020 #define KC_UTFN 0040 #define KC_UTF2 0100 #define KC_UTF3 0200 #define Xiskana(c) (kctypetable[(u_char)(c)] & KC_KANA) #ifndef issjis1 #define issjis1(c) (kctypetable[(u_char)(c)] & KC_SJIS1) #endif #ifndef issjis2 #define issjis2(c) (kctypetable[(u_char)(c)] & KC_SJIS2) #endif #ifndef iseuc #define iseuc(c) (kctypetable[(u_char)(c)] & KC_EUCJP) #endif #ifndef isjis #define isjis(c) (kctypetable[(u_char)(c)] & KC_JIS) #endif #define isutf2(c1, c2) ((kctypetable[(u_char)(c1)] & KC_UTF2) \ && (kctypetable[(u_char)(c2)] & KC_UTFN)) #define isutf3(c1, c2, c3) ((kctypetable[(u_char)(c1)] & KC_UTF3) \ && (kctypetable[(u_char)(c2)] & KC_UTFN) \ && (kctypetable[(u_char)(c3)] & KC_UTFN)) #endif /* !LSI_C */ #define ismsb(c) (((u_char)(c)) & 0x80) #define isekana(s, i) ((u_char)((s)[i]) == C_EKANA \ && Xiskana((s)[(i) + 1])) #define isskana(s, i) Xiskana((s)[i]) #define isjkana(s, i) Xiskana(((s)[i]) ^ 0x80) #define iswucs2(u) (((u) & 0xff00) \ && ((u) < 0xff61 || (u) > 0xff9f)) #ifndef MINIMUMSHELL K_EXTERN CONST u_char b2htable[16] #ifdef K_INTERN = { '0', '1', '2', '3', '4', '5', '6', '7', '8', '9', 'a', 'b', 'c', 'd', 'e', 'f', } #endif ; #define tohexa(c) b2htable[(u_char)(c)] #endif /* !MINIMUMSHELL */ #define NOCNV 0 #define ENG 1 #define SJIS 2 #define EUC 3 #define JIS7 4 #define O_JIS7 5 #define JIS8 6 #define O_JIS8 7 #define JUNET 8 #define O_JUNET 9 #define HEX 10 #define CAP 11 #define UTF8 12 #define M_UTF8 13 #define I_UTF8 14 #ifdef CODEEUC #define DEFCODE EUC #define SECCODE SJIS #define KANAWID 2 #define iskanji1(s, i) isweuc(s, i) #define iswchar(s, i) (isweuc(s, i) || isekana(s, i)) #else #define DEFCODE SJIS #define SECCODE EUC #define KANAWID 1 #define iskanji1(s, i) iswsjis(s, i) #define iswchar(s, i) iswsjis(s, i) #endif #define MAXKANJIBUF (3 + 2 + 3) #define MAXKLEN 2 #define MAXUTF8LEN 3 #define MAXNFLEN 4 #if !defined (_NOKANJICONV) || (defined (FD) && !defined (_NODOSDRIVE)) K_EXTERN int kanjierrno K_INIT(0); #endif #ifndef _NOKANJIFCONV K_EXTERN int defaultkcode K_INIT(NOCNV); #endif #ifdef _NOKANJICONV #define inputkcode NOCNV #else K_EXTERN int inputkcode K_INIT(NOCNV); #endif #if !defined (_NOKANJICONV) \ || (!defined (_NOENGMES) && !defined (_NOJPNMES)) K_EXTERN int outputkcode K_INIT(NOCNV); #endif #if !defined (_NOKANJICONV) && defined (DEP_PTY) K_EXTERN int ptyinkcode K_INIT(NOCNV); K_EXTERN int ptyoutkcode K_INIT(NOCNV); #endif #ifndef _NOKANJIFCONV K_EXTERN int fnamekcode K_INIT(NOCNV); #endif #if !defined (_NOENGMES) && !defined (_NOJPNMES) K_EXTERN int messagelang K_INIT(NOCNV); #endif #define L_INPUT 0001 #define L_OUTPUT 0002 #define L_FNAME 0004 #define L_TERMINAL 0010 #define L_MESSAGE 0020 K_EXTERN CONST char kanjiiomode[] # ifdef K_INTERN = { L_OUTPUT | L_FNAME | L_TERMINAL | L_MESSAGE, /* NOCNV */ L_OUTPUT | L_MESSAGE, /* ENG */ L_INPUT | L_OUTPUT | L_FNAME | L_TERMINAL, /* SJIS */ L_INPUT | L_OUTPUT | L_FNAME | L_TERMINAL, /* EUC */ L_OUTPUT | L_FNAME, /* JIS7 */ L_OUTPUT | L_FNAME, /* O_JIS7 */ L_OUTPUT | L_FNAME, /* JIS8 */ L_OUTPUT | L_FNAME, /* O_JIS8 */ L_OUTPUT | L_FNAME, /* JUNET */ L_OUTPUT | L_FNAME, /* O_JUNET */ L_FNAME, /* HEX */ L_FNAME, /* CAP */ L_INPUT | L_OUTPUT | L_FNAME | L_TERMINAL, /* UTF8 */ L_INPUT | L_OUTPUT | L_FNAME | L_TERMINAL, /* M_UTF8 */ L_INPUT | L_OUTPUT | L_FNAME | L_TERMINAL, /* I_UTF8 */ } # endif /* K_INTERN */ ; K_EXTERN int iswsjis __P_((CONST char *, int)); #ifndef LSI_C K_EXTERN int isweuc __P_((CONST char *, int)); #endif K_EXTERN int iskana1 __P_((CONST char *, int *)); #ifdef K_INTERN int iswsjis(s, i) CONST char *s; int i; { return(issjis1(s[i]) && issjis2(s[++i])); } # ifndef LSI_C int isweuc(s, i) CONST char *s; int i; { return(iseuc(s[i]) && iseuc(s[++i])); } # endif int iskana1(s, ip) CONST char *s; int *ip; { # ifdef CODEEUC int n; if ((n = isekana(s, *ip))) (*ip)++; return(n); # else return(isskana(s, *ip)); # endif } #endif /* K_INTERN */ #ifdef _NOKANJICONV # ifdef CODEEUC # define isinkanji1(c, k) \ iseuc(c) # define isinkanji2(c, k) \ iseuc(c) # else # define isinkanji1(c, k) \ issjis1(c) # define isinkanji2(c, k) \ issjis2(c) # endif #else /* !_NOKANJICONV */ #define isinkanji1(c, k) (((k) == EUC) ? iseuc(c) : \ (((k) == SJIS) ? issjis1(c) : 0)) #define isinkanji2(c, k) (((k) == EUC) ? iseuc(c) : \ (((k) == SJIS) ? issjis2(c) : 0)) #endif /* !_NOKANJICONV */ #endif /* !__KCTYPE_H_ */ FD-3.01j/typesize.h100644 2105 1751 2376 13516612560 12716 0ustar shiraiuser/* * typesize.h * * definitions for size of types */ #ifndef __TYPESIZE_H_ #define __TYPESIZE_H_ #define strsize(s) ((int)sizeof(s) - 1) #define arraysize(a) ((int)((u_int)sizeof(a) / (u_int)sizeof(*(a)))) #define MAXLONGWIDTH 20 /* log10(2^64) = 19.266 */ #define MAXCOLSCOMMA(d) (MAXLONGWIDTH + (MAXLONGWIDTH / (d))) #ifndef BITSPERBYTE # ifdef CHAR_BIT # define BITSPERBYTE CHAR_BIT # else /* !CHAR_BIT */ # ifdef NBBY # define BITSPERBYTE NBBY # else # define BITSPERBYTE 8 # endif # endif /* !CHAR_BIT */ #endif /* !BITSPERBYTE */ #ifdef HAVELONGLONG typedef long long long_t; typedef unsigned long long u_long_t; #else typedef long long_t; typedef unsigned long u_long_t; #endif #define _MAXUTYPE(t) ((t)(~(t)0)) #define MINTYPE(t) ((t)(_MAXUTYPE(t) << \ (BITSPERBYTE * sizeof(t) - 1))) #define MAXTYPE(t) ((t)~MINTYPE(t)) #ifdef LSI_C #define MAXUTYPE(t) ((u_long_t)~0 >> \ (BITSPERBYTE * (sizeof(u_long_t) - sizeof(t)))) #else #define MAXUTYPE(t) _MAXUTYPE(t) #endif #ifdef USELLSEEK typedef long_t l_off_t; #else typedef off_t l_off_t; #endif #ifdef USEPID_T typedef pid_t p_id_t; #else /* !USEPID_T */ # if MSDOS typedef int p_id_t; # else typedef long p_id_t; # endif #endif /* !USEPID_T */ #endif /* !__TYPESIZE_H_ */ FD-3.01j/string.h100644 2105 1751 3356 13516612560 12347 0ustar shiraiuser/* * string.h * * function prototype declarations for "string.c" */ #ifdef MINIMUMSHELL # ifndef _NOXMEMCHR # define _NOXMEMCHR # endif # ifndef _NOXSTRCAT # define _NOXSTRCAT # endif #endif /* MINIMUMSHELL */ #if (!defined (FD) || defined (_NOVERSCMP)) && !defined (_NOXSTRVERSCMP) #define _NOXSTRVERSCMP #endif #if (!MSDOS \ && ((!defined (FD) && !defined (WITHNETWORK)) || defined (_NODOSCOMMAND))) \ && !defined (_NOXSTRTOLOWER) #define _NOXSTRTOLOWER #endif #ifdef _NOXSTRCHR #define Xstrchr strchr #define Xstrrchr strrchr #else extern char *Xstrchr __P_((CONST char *, int)); extern char *Xstrrchr __P_((CONST char *, int)); #endif #ifdef _NOXMEMCHR #define Xmemchr memchr #else extern char *Xmemchr __P_((CONST char *, int, int)); #endif #ifndef _NOXSTRCPY extern char *Xstrcpy __P_((char *, CONST char *)); extern char *Xstrncpy __P_((char *, CONST char *, int)); #endif #ifdef _NOXSTRCAT #define Xstrcat strcat #define Xstrlcat(s1, s2, n) strcat(s1, s2) #else #define Xstrcat(s1, s2) Xstrlcat(s1, s2, sizeof(s1) - 1) extern char *Xstrlcat __P_((char *, CONST char *, int)); #endif #ifdef _NOXSTRCASECMP #define Xstrcasecmp strcasecmp #define Xstrncasecmp strncasecmp #else extern int Xstrcasecmp __P_((CONST char *, CONST char *)); extern int Xstrncasecmp __P_((CONST char *, CONST char *, int)); #endif #ifndef _NOXSTRVERSCMP extern int Xstrverscmp __P_((CONST char *, CONST char *, int)); #endif #if defined (_NOSTRLEN2) || !defined (CODEEUC) #define strlen2 strlen #else extern int strlen2 __P_((CONST char *)); #endif #ifndef _NOXSTRTOLOWER extern VOID Xstrtolower __P_((char *)); extern VOID Xstrtoupper __P_((char *)); extern VOID Xstrntolower __P_((char *, int)); extern VOID Xstrntoupper __P_((char *, int)); #endif /* !_NOXSTRTOLOWER */ FD-3.01j/malloc.h100644 2105 1751 1312 13516612560 12276 0ustar shiraiuser/* * malloc.h * * definitions & function prototype declarations for "malloc.c" */ #define BUFUNIT 32 #define b_size(n, type) ((((n) / BUFUNIT) + 1) \ * BUFUNIT * sizeof(type)) #define b_realloc(ptr, n, type) (((n) % BUFUNIT) ? ((type *)(ptr)) \ : (type *)Xrealloc(ptr, b_size(n, type))) extern char *Xmalloc __P_((ALLOC_T)); extern char *Xrealloc __P_((VOID_P, ALLOC_T)); extern VOID Xfree __P_((VOID_P)); extern char *Xstrdup __P_((CONST char *)); extern char *Xstrndup __P_((CONST char *, int)); extern char *c_realloc __P_((char *, ALLOC_T, ALLOC_T *)); #ifndef MINIMUMSHELL extern int vasprintf2 __P_((char **, CONST char *, va_list)); extern char *asprintf2 __P_((CONST char *, ...)); #endif FD-3.01j/dirent.h100644 2105 1751 1464 13516612560 12324 0ustar shiraiuser/* * dirent.h * * definitions for directory entry */ #ifndef __DIRENT_H_ #define __DIRENT_H_ #include "unixemu.h" #if defined (USESYSDIRH) || defined (USEDIRECT) #include #endif #if MSDOS # if defined (__TURBOC__) || (defined (DJGPP) && DJGPP < 2) # include # endif #else /* !MSDOS */ # ifndef USEDIRECT # include # endif #endif /* !MSDOS */ #ifdef USEDIRECT #define dirent direct #undef DIRSIZ #endif #ifndef DEV_BSIZE #define DEV_BSIZE 512 #endif #if !defined (MAXNAMLEN) && defined (FILENAME_MAX) #define MAXNAMLEN FILENAME_MAX #endif #if defined (DNAMESIZE) && DNAMESIZE < (MAXNAMLEN + 1) typedef struct _st_dirent { char buf[(int)sizeof(struct dirent) - DNAMESIZE + MAXNAMLEN + 1]; } st_dirent; #else typedef struct dirent st_dirent; #endif #endif /* !__DIRENT_H_ */ FD-3.01j/sysemu.h100644 2105 1751 11441 13516612560 12400 0ustar shiraiuser/* * sysemu.h * * definitions & function prototype declarations for "sysemu.c" */ #include "depend.h" #include "dirent.h" #include "stream.h" #define DEV_NORMAL 0 #define DEV_DOS 1 #define DEV_URL 2 #define DEV_HTTP 3 struct utimes_t { time_t actime; time_t modtime; }; extern int seterrno __P_((int)); #if MSDOS && defined (DJGPP) extern int dos_putpath __P_((CONST char *, int)); #endif #if MSDOS && !defined (FD) extern int getcurdrv __P_((VOID_A)); extern int setcurdrv __P_((int, int)); extern char *unixrealpath __P_((CONST char *, char *)); #endif #ifdef DEP_DOSPATH extern int _dospath __P_((CONST char *)); extern int dospath __P_((CONST char *, char *)); #endif #ifdef DEP_URLPATH extern int _urlpath __P_((CONST char *, char **, int *)); extern int urlpath __P_((CONST char *, char **, char *, int *)); #endif #ifdef DEP_DOSDRIVE # if MSDOS extern int dospath2 __P_((CONST char *)); extern int dospath3 __P_((CONST char *)); # else #define dospath2(path) dospath(path, NULL) #define dospath3(path) dospath(path, NULL) # endif #endif /* DEP_DOSDRIVE */ #ifdef CYGWIN char *getcygdrive_user __P_((VOID_A)); char *getcygdrive_system __P_((VOID_A)); # ifdef DEBUG VOID freecygdrive __P_((VOID_A)); # endif #endif /* CYGWIN */ #if (defined (DEP_KANJIPATH) || defined (DEP_ROCKRIDGE) \ || defined (DEP_PSEUDOPATH)) \ && defined (DEBUG) extern VOID freeopenlist(VOID_A); #endif #ifdef DEP_PSEUDOPATH extern int checkdrv __P_((int, int *)); extern int preparedrv __P_((CONST char *, int *, char *)); extern VOID shutdrv __P_((int)); #endif #ifdef DEP_DOSPATH extern u_int getunixmode __P_((u_int)); extern time_t getunixtime __P_((u_int, u_int)); extern u_short getdosmode __P_((u_int)); extern int getdostime __P_((u_short *, u_short *, time_t)); #endif #ifdef DEP_DIRENT extern DIR *Xopendir __P_((CONST char *)); extern int Xclosedir __P_((DIR *)); extern struct dirent *Xreaddir __P_((DIR *)); extern VOID Xrewinddir __P_((DIR *)); #else #define Xopendir opendir #define Xclosedir closedir #define Xreaddir readdir #define Xrewinddir rewinddir #endif #if MSDOS extern int rawchdir __P_((CONST char *)); #else #define rawchdir(p) ((chdir(p)) ? -1 : 0) #endif extern int Xchdir __P_((CONST char *)); extern char *Xgetwd __P_((char *)); #ifdef DEP_DIRENT extern int Xstat __P_((CONST char *, struct stat *)); extern int Xlstat __P_((CONST char *, struct stat *)); #else #define Xstat(p, s) ((stat(p, s)) ? -1 : 0) #define Xlstat(p, s) ((lstat(p, s)) ? -1 : 0) #endif #ifdef DEP_BIASPATH extern int Xaccess __P_((CONST char *, int)); extern int Xsymlink __P_((CONST char *, CONST char *)); extern int Xreadlink __P_((CONST char *, char *, int)); extern int Xchmod __P_((CONST char *, int)); #else #define Xaccess(p, m) ((access(p, m)) ? -1 : 0) #define Xsymlink(o, n) ((symlink(o, n)) ? -1 : 0) #define Xreadlink readlink #define Xchmod(p, m) ((chmod(p, m)) ? -1 : 0) #endif extern int rawutimes __P_((CONST char *, CONST struct utimes_t *)); extern int Xutimes __P_((CONST char *, CONST struct utimes_t *)); #ifdef DEP_BIASPATH # ifdef HAVEFLAGS extern int Xchflags __P_((CONST char *, u_long)); # endif # ifndef NOUID extern int Xchown __P_((CONST char *, u_id_t, g_id_t)); # endif extern int Xunlink __P_((CONST char *)); extern int Xrename __P_((CONST char *, CONST char *)); extern int Xopen __P_((CONST char *, int, int)); #else /* !DEP_BIASPATH */ #define Xchflags(p, f) ((chflags(p, f)) ? -1 : 0) #define Xchown(p, u, g) ((chown(p, u, g)) ? -1 : 0) #define Xunlink(p) ((unlink(p)) ? -1 : 0) #define Xrename(f, t) ((rename(f, t)) ? -1 : 0) #define Xopen open #endif /* !DEP_BIASPATH */ #ifdef DEP_PSEUDOPATH extern VOID putopenfd __P_((int, int)); extern int chkopenfd __P_((int)); extern int delopenfd __P_((int)); extern int Xclose __P_((int)); extern int Xread __P_((int, char *, int)); extern int Xwrite __P_((int, CONST char *, int)); extern off_t Xlseek __P_((int, off_t, int)); #ifndef NOFTRUNCATE extern int Xftruncate __P_((int, off_t)); #endif extern int Xdup __P_((int)); extern int Xdup2 __P_((int, int)); #else #define Xclose(f) ((close(f)) ? -1 : 0) #define Xread read #define Xwrite write #define Xlseek lseek #define Xftruncate ftruncate #define Xdup safe_dup #define Xdup2 safe_dup2 #endif extern int Xmkdir __P_((CONST char *, int)); #ifdef DEP_BIASPATH extern int Xrmdir __P_((CONST char *)); #else #define Xrmdir(p) ((rmdir(p)) ? -1 : 0) #endif #ifdef NOFLOCK #define Xflock(f, o) (0) #else extern int Xflock __P_((int, int)); #endif #ifdef NOSELECT #define checkread(f, b, n, t) sureread(f, b, n) #else extern int checkread __P_((int, VOID_P, int, int)); #endif #ifdef DEP_PSEUDOPATH extern int lastdrv; #endif #ifdef DEP_DOSDRIVE extern int dosdrive; #endif #ifdef DEP_URLPATH extern int urldrive; extern int urlkcode; #endif #if defined (FD) && !defined (NOSELECT) extern int (*readintrfunc)__P_((VOID_A)); #endif FD-3.01j/log.h100644 2105 1751 1362 13516612560 11615 0ustar shiraiuser/* * log.h * * definitions & function prototype declarations for "log.c" */ #include "depend.h" #define _LOG_WARNING_ 0 #define _LOG_NOTICE_ 1 #define _LOG_INFO_ 2 #define _LOG_DEBUG_ 3 #ifdef DEP_LOGGING #define LOG0(l, n, f) logsyscall(l, n, f) #define LOG1(l, n, f, a1) logsyscall(l, n, f, a1) #define LOG2(l, n, f, a1, a2) logsyscall(l, n, f, a1, a2) #define LOG3(l, n, f, a1, a2, a3) \ logsyscall(l, n, f, a1, a2, a3) extern VOID logclose __P_((VOID_A)); extern VOID logsyscall __P_((int, int, CONST char *, ...)); extern VOID logmessage __P_((int, CONST char *, ...)); #else /* !DEP_LOGGING */ #define LOG0(l, n, f) #define LOG1(l, n, f, a1) #define LOG2(l, n, f, a1, a2) #define LOG3(l, n, f, a1, a2, a3) #endif /* !DEP_LOGGING */ FD-3.01j/pathname.h100644 2105 1751 21152 13516612560 12650 0ustar shiraiuser/* * pathname.h * * definitions & function prototype declarations for "pathname.c" */ #ifndef __PATHNAME_H_ #define __PATHNAME_H_ #include "depend.h" #include "typesize.h" /* #define BASHSTYLE ; rather near to bash style */ /* #define MINIMUMSHELL ; omit verbose extension from Bourne shell */ /* #define NESTINGQUOTE ; allow `...` included in "..." */ #ifndef MINIMUMSHELL #define NESTINGQUOTE #endif #if defined (MINIMUMSHELL) && defined (DOUBLESLASH) #undef DOUBLESLASH #endif #define IFS_SET " \t\n" #define ESCAPE '\\' #if MSDOS && !defined (DEP_ORIGSHELL) #define PATHDELIM ';' #else #define PATHDELIM ':' #endif #define ENVPATH "PATH" #define ENVHOME "HOME" #define ENVPWD "PWD" #define ENVIFS "IFS" #define EXTCOM "COM" #define EXTEXE "EXE" #define EXTBAT "BAT" #ifndef BSPATHDELIM #define PESCAPE ESCAPE #define RMSUFFIX '%' # ifdef BASHSTYLE /* bash treats '\r' as just a character */ # define METACHAR "\t\n !\"#$&'()*;<=>?[\\]`|" # else # define METACHAR "\t\r\n !\"#$&'()*;<=>?[\\]`|" # endif #define DQ_METACHAR "\"$\\`" #else /* BSPATHDELIM */ # ifdef DEP_ORIGSHELL # define PESCAPE '%' # define RMSUFFIX '\\' # define METACHAR "\t\r\n !\"#$%&'()*;<=>?[]`|" # define DQ_METACHAR "\"$%`" # else # define FAKEESCAPE # define PESCAPE '$' # define RMSUFFIX '%' # define METACHAR "\t\r\n !\"$'*<>?|" # define DQ_METACHAR "\"$" # endif #endif /* BSPATHDELIM */ #define PC_NORMAL 0 #define PC_OPQUOTE 1 #define PC_CLQUOTE 2 #define PC_SQUOTE 3 #define PC_DQUOTE 4 #define PC_BQUOTE 5 #define PC_WCHAR 6 #define PC_ESCAPE 7 #define PC_META 8 #define PC_EXMETA 9 #define PC_DELIM 10 #if defined (_NOORIGGLOB) \ && !defined (USEREGCMP) && !defined (USEREGCOMP) && !defined (USERE_COMP) #undef _NOORIGGLOB #endif #ifdef _NOORIGGLOB # ifdef USEREGCOMP # include typedef regex_t reg_ex_t; # else typedef char reg_ex_t; # endif #else /* !_NOORIGGLOB */ typedef char * reg_ex_t; # undef USEREGCMP # undef USEREGCOMP # undef USERE_COMP #endif /* !_NOORIGGLOB */ #ifdef _NOUSEHASH typedef char hashlist; #else typedef struct _hashlist { char *command; char *path; int hits; int cost; struct _hashlist *next; u_char type; } hashlist; #define MAXHASH 64 #endif #define CM_NOTFOUND 0001 #define CM_FULLPATH 0002 #define CM_HASH 0004 #define CM_BATCH 0010 #define CM_EXE 0020 #define CM_ADDEXT 0040 #define CM_RECALC 0100 #define CM_REHASH 0200 typedef struct _strbuf_t { char *s; ALLOC_T size; ALLOC_T len; } strbuf_t; #ifndef NODIRLOOP typedef struct _devino_t { dev_t dev; ino_t ino; } devino_t; #endif typedef struct _wild_t { CONST char *s; strbuf_t fixed; strbuf_t path; int quote; #ifndef NODIRLOOP int nino; devino_t *ino; #endif #if defined (DOUBLESLASH) || defined (DEP_URLPATH) u_char type; #endif u_char flags; } wild_t; #define WT_NORMAL 0 #define WT_DOUBLESLASH 1 #define WT_URLPATH 2 #define EA_STRIPQ 000001 #define EA_STRIPESCAPE 000002 #define EA_KEEPESCAPE 000004 #define EA_NOEVALQ 000010 #define EA_NOEVALDQ 000020 #define EA_BACKQ 000040 #define EA_STRIPQLATER 000100 #define EA_NOUNIQDELIM 000200 #define EA_EOLESCAPE 000400 #define EA_FINDMETA 001000 #define EA_FINDDELIM 002000 #define EA_EVALIFS 004000 #define EA_INQUOTE 010000 #define PT_NONE 0 #define PT_DOS 1 #define PT_DSLASH 2 #define PT_URL 3 #ifdef SIGARGINT typedef int sigarg_t; #else # ifdef NOVOID # define sigarg_t # else typedef void sigarg_t; # endif #endif #ifdef SIGFNCINT typedef int sigfnc_t; #else # ifdef NOVOID # define sigfnc_t # else typedef void sigfnc_t; # endif #endif typedef sigarg_t (*sigcst_t)__P_((sigfnc_t)); typedef struct _uidtable { u_id_t uid; char *name; char *home; } uidtable; typedef struct _gidtable { g_id_t gid; char *name; #ifndef USEGETGROUPS char **gr_mem; #endif char ismem; } gidtable; extern int getpathtop __P_((CONST char *, int *, int *)); #ifdef DEP_DOSPATH extern char *gendospath __P_((char *, int, int)); #endif #if defined (DEP_PATHTOP) || defined (BSPATHDELIM) extern char *strdelim __P_((CONST char *, int)); extern char *strrdelim __P_((CONST char *, int)); #else #define strdelim(s, d) Xstrchr(s, _SC_) #define strrdelim(s, d) Xstrrchr(s, _SC_) #endif #ifdef FD extern char *strrdelim2 __P_((CONST char *, int, CONST char *)); #endif #ifndef MINIMUMSHELL extern int isdelim __P_((CONST char *, int)); #endif extern char *strcatdelim __P_((char *)); extern char *strcatdelim2 __P_((char *, CONST char *, CONST char *)); extern int strcatpath __P_((char *, char *, CONST char *)); #ifdef PATHNOCASE #define strpathcmp Xstrcasecmp #define strnpathcmp Xstrncasecmp #define strpathcmp2 Xstrcasecmp #define strnpathcmp2 Xstrncasecmp #else #define strpathcmp strcmp #define strnpathcmp strncmp extern int strpathcmp2 __P_((CONST char *, CONST char *)); extern int strnpathcmp2 __P_((CONST char *, CONST char *, int)); #endif #ifdef _NOVERSCMP #define strverscmp2 strpathcmp2 #else extern int strverscmp2 __P_((CONST char *, CONST char *)); #endif #ifdef COMMNOCASE #define strcommcmp Xstrcasecmp #define strncommcmp Xstrncasecmp #else #define strcommcmp strcmp #define strncommcmp strncmp #endif #ifdef ENVNOCASE #define strenvcmp Xstrcasecmp #define strnenvcmp Xstrncasecmp #else #define strenvcmp strcmp #define strnenvcmp strncmp #endif #ifdef FD extern char *underpath __P_((CONST char *, CONST char *, int)); #endif extern int isidentchar __P_((int)); extern int isidentchar2 __P_((int)); extern int isdotdir __P_((CONST char *)); extern char *isrootdir __P_((CONST char *)); #ifndef MINIMUMSHELL extern int isrootpath __P_((CONST char *)); extern VOID copyrootpath __P_((char *)); #endif extern VOID copycurpath __P_((char *)); #ifdef DOUBLESLASH extern int isdslash __P_((CONST char *)); #endif extern char *getbasename __P_((CONST char *)); extern char *getshellname __P_((CONST char *, int *, int *)); extern reg_ex_t *regexp_init __P_((CONST char *, int)); extern int regexp_exec __P_((CONST reg_ex_t *, CONST char *, int)); extern VOID regexp_free __P_((reg_ex_t *)); extern int cmppath __P_((CONST VOID_P, CONST VOID_P)); extern char **evalwild __P_((CONST char *, int)); #ifndef _NOUSEHASH extern hashlist **duplhash __P_((hashlist **)); #endif extern int searchhash __P_((hashlist **, CONST char *, CONST char *)); #ifdef FD extern char *searchexecpath __P_((CONST char *, CONST char *)); #endif #if !defined (FDSH) && !defined (_NOCOMPLETE) extern int addcompletion __P_((CONST char *, char *, int, char ***)); # ifndef NOUID # ifndef NOGETPWENT extern int completeuser __P_((CONST char *, int, int, char ***, int)); # endif # ifndef NOGETGRENT extern int completegroup __P_((CONST char *, int, int, char ***)); # endif # endif /* !NOUID */ extern int completepath __P_((CONST char *, int, int, char ***, int)); extern char *findcommon __P_((int, char *CONST *)); #endif /* !FDSH && !_NOCOMPLETE */ extern char *catvar __P_((char *CONST *, int)); extern int countvar __P_((char *CONST *)); extern VOID freevar __P_((char **)); extern char **duplvar __P_((char *CONST *, int)); extern int parsechar __P_((CONST char *, int, int, int, int *, int *)); #ifndef NOUID extern VOID getlogininfo __P_((CONST char **, CONST char **)); extern uidtable *finduid __P_((u_id_t, CONST char *)); extern gidtable *findgid __P_((g_id_t, CONST char *)); extern int isgroupmember __P_((g_id_t)); # ifdef DEBUG extern VOID freeidlist __P_((VOID_A)); # endif #endif /* !NOUID */ #ifndef MINIMUMSHELL extern CONST char *gethomedir __P_((VOID_A)); #endif extern CONST char *getrealpath __P_((CONST char *, char *, char *)); extern char *evalarg __P_((char *, int)); extern int evalifs __P_((int, char ***, CONST char *)); extern int evalglob __P_((int, char ***, int)); extern int stripquote __P_((char *, int)); extern char *_evalpath __P_((CONST char *, CONST char *, int)); extern char *evalpath __P_((char *, int)); extern CONST char nullstr[]; #define vnullstr ((char *)nullstr) extern CONST char rootpath[]; extern CONST char curpath[]; extern CONST char parentpath[]; extern char **argvar; #ifndef _NOUSEHASH extern hashlist **hashtable; #endif extern char *(*getvarfunc)__P_((CONST char *, int)); extern int (*putvarfunc)__P_((char *, int)); extern int (*getretvalfunc)__P_((VOID_A)); extern p_id_t (*getpidfunc)__P_((VOID_A)); extern p_id_t (*getlastpidfunc)__P_((VOID_A)); extern char *(*getflagfunc)__P_((VOID_A)); extern int (*checkundeffunc)__P_((CONST char *, CONST char *, int)); extern VOID_T (*exitfunc)__P_((VOID_A)); extern char *(*backquotefunc)__P_((CONST char *)); #ifndef MINIMUMSHELL extern char *(*posixsubstfunc)__P_((CONST char *, int *)); #endif #ifndef PATHNOCASE extern int pathignorecase; #endif #ifndef _NOVERSCMP extern int versioncomp; #endif #endif /* !__PATHNAME_H_ */ FD-3.01j/system.h100644 2105 1751 33052 13516612560 12401 0ustar shiraiuser/* * system.h * * definitions & function prototype declarations for "system.c" */ #ifdef HPUX /* for TIOCGPGRP & TIOCSPGRP */ #include #endif #include "depend.h" #include "stream.h" /* #define BASHSTYLE ; keep bash-like specifications */ /* #define BASHBUG ; keep bash's bug strictly */ /* #define PSIGNALSTYLE ; based upon psignal(3) messages */ /* #define NOJOB ; not use job control */ /* #define CHILDSTATEMENT ; make any statement child for suspend */ /* #define NOALIAS ; not use alias */ /* #define DOSCOMMAND ; emulate builtin commands of COMMAND.COM */ /* #define USEFAKEPIPE ; use DOS-like pipe instead of pipe(2) */ /* #define SHOWSTREE ; show syntax tree with -n option */ /* #define NOPOSIXUTIL ; not use POSIX utilities */ /* #define STRICTPOSIX ; keep POSIX strictly */ /* #define WITHNETWORK ; support network extensions */ /* #define WITHSOCKET ; support network extensions with socket */ /* #define WITHSOCKREDIR ; support network redirections with socket */ #if defined (BASHSTYLE) && !defined (BASHBUG) #define BASHBUG #endif #if (defined (NOSETPGRP) || defined (MINIMUMSHELL)) && !defined (NOJOB) #define NOJOB #endif #if defined (MINIMUMSHELL) && !defined (NOALIAS) #define NOALIAS #endif #if (MSDOS \ || ((defined (FD) || defined (WITHNETWORK)) && !defined (_NODOSCOMMAND))) \ && !defined (DOSCOMMAND) #define DOSCOMMAND #endif #if MSDOS && !defined (USEFAKEPIPE) #define USEFAKEPIPE #endif #if defined (MINIMUMSHELL) && !defined (NOPOSIXUTIL) #define NOPOSIXUTIL #endif #if defined (DEP_SOCKET) && !defined (WITHSOCKET) #define WITHSOCKET #endif #if defined (DEP_SOCKREDIR) && !defined (WITHSOCKREDIR) #define WITHSOCKREDIR #endif #include "pathname.h" #include "termio.h" #include "wait.h" #ifdef DEP_ORIGSHELL #ifdef BASHSTYLE #define ERRBREAK continue #else #define ERRBREAK break #endif #define RET_SUCCESS 0 #define RET_FAIL 1 #define RET_SYNTAXERR 2 #define RET_FATALERR 2 #ifdef SIGINT #define RET_INTR (SIGINT + 128) #else #define RET_INTR (2 + 128) #endif #define RET_NOTEXEC 126 #define RET_NOTFOUND 127 #define RET_NOTICE 255 #define RET_NULSYSTEM 256 #define READ_EOF 0x100 #define ENVPS1 "PS1" #define ENVPS2 "PS2" #define ENVPS4 "PS4" #define ENVMAIL "MAIL" #define ENVMAILPATH "MAILPATH" #define ENVMAILCHECK "MAILCHECK" #define ENVLINENO "LINENO" #define ENVENV "ENV" #define ENVCDPATH "CDPATH" #define ENVPPID "PPID" #define ENVOPTARG "OPTARG" #define ENVOPTIND "OPTIND" #define ENVSHELL "SHELL" #define ENVCOMSPEC "COMSPEC" #define ENVREPLY "REPLY" #if defined (TIOCGPGRP) && !defined (USETCGETPGRP) #define gettcpgrp(f, gp) ((ioctl(f, TIOCGPGRP, gp) < 0) \ ? (*(gp) = (p_id_t)-1) : *(gp)) #else #define gettcpgrp(f, gp) (*(gp) = tcgetpgrp(f)) #endif #if defined (TIOCSPGRP) && !defined (USETCGETPGRP) #define settcpgrp(f, g) ioctl(f, TIOCSPGRP, &(g)) #else #define settcpgrp tcsetpgrp #endif #if MSDOS #define Xexit exit #define DEFPATH ":" # ifndef _PATH_DEVNULL # define _PATH_DEVNULL "NULL" # endif #else /* !MSDOS */ #define Xexit _exit #define DEFPATH ":/bin:/usr/bin" #define DEFTERM "dumb" # ifndef _PATH_DEVNULL # define _PATH_DEVNULL "/dev/null" # endif #endif /* !MSDOS */ typedef struct _heredoc_t { char *eof; char *filename; char *buf; int fd; #ifndef USEFAKEPIPE p_id_t pipein; #endif u_char flags; } heredoc_t; #define HD_IGNORETAB 0001 #define HD_QUOTED 0002 typedef struct _redirectlist { int fd; char *filename; u_short type; int new; int old; #ifdef DEP_DOSDRIVE char *fakepipe; int dosfd; #endif struct _redirectlist *next; } redirectlist; #define MD_NORMAL 0000 #define MD_READ 0001 #define MD_WRITE 0002 #define MD_RDWR 0003 #define MD_APPEND 0004 #define MD_FILEDESC 0010 #define MD_WITHERR 0020 #define MD_HEREDOC 0040 #define MD_FORCED 0100 #define MD_REST 0200 #define MD_DUPL 0400 typedef struct _command_t { hashlist *hash; int argc; char **argv; redirectlist *redp; u_char type; u_char id; } command_t; #define CT_STATEMENT 0001 #define CT_NONE 0002 #define CT_BUILTIN 0003 #define CT_COMMAND 0004 #define CT_FUNCTION 0005 #define CT_ALIAS 0006 #define CT_LOGDRIVE 0007 #ifdef FD #define CT_FDORIGINAL 0100 #define CT_FDINTERNAL 0200 #endif #define SM_IF 0001 #define SM_THEN 0002 #define SM_ELIF 0003 #define SM_ELSE 0004 #define SM_FI 0005 #define SM_WHILE 0006 #define SM_UNTIL 0007 #define SM_DO 0010 #define SM_DONE 0011 #define SM_FOR 0012 #define SM_IN 0013 #define SM_CASE 0014 #define SM_INCASE 0015 #define SM_RPAREN 0016 #define SM_CASEEND 0017 #define SM_ESAC 0020 #define SM_LPAREN 0021 #define SM_FUNC 0022 #define SM_LIST 0023 #define SM_LISTEND 0024 #define SM_ANOTHER 0075 #define SM_CHILD 0076 #define SM_STATEMENT 0077 #define isstatement(comm) ((comm) && (comm) -> type == CT_STATEMENT) #define notstatement(comm) ((comm) && (comm) -> type != CT_STATEMENT) #define isbuiltin(comm) ((comm) && (comm) -> type == CT_BUILTIN) #define iscommand(comm) ((comm) && (comm) -> type == CT_COMMAND) #define ischild(comm) ((comm) && (comm) -> type == CT_STATEMENT \ && (comm) -> id == SM_CHILD) typedef struct _syntaxtree { command_t *comm; struct _syntaxtree *parent; struct _syntaxtree *next; #ifndef MINIMUMSHELL long lineno; #endif u_char type; u_char cont; u_char flags; } syntaxtree; #define OP_NONE 0 #define OP_FG 1 #define OP_BG 2 #define OP_AND 3 #define OP_OR 4 #define OP_PIPE 5 #define OP_NOT 6 #define OP_NOWN 7 #define CN_ESCAPE 0001 #define CN_QUOT 0002 #define CN_STAT 0004 #define CN_INHR 0170 #define CN_SBST 0070 #define CN_VAR 0010 #define CN_COMM 0020 #define CN_EXPR 0030 #define CN_CASE 0040 #define CN_HDOC 0100 #define ST_NODE 0001 #define ST_NEXT 0002 #define ST_TOP 0004 #define ST_NOWN 0010 #define ST_BUSY 0020 #define ST_HDOC 0040 #define ST_DEFKANJI 0100 #ifdef MINIMUMSHELL #define hasparent(trp) ((trp) -> parent) #define getparent(trp) ((trp) -> parent) #else #define hasparent(trp) (!((trp) -> flags & ST_TOP) && (trp) -> parent) #define getparent(trp) (((trp) -> flags & ST_TOP) \ ? NULL : (trp) -> parent) #endif #define statementbody(trp) ((syntaxtree *)(((trp) -> comm) -> argv)) #define hascomm(trp) ((trp) -> comm && ((trp) -> comm) -> argc >= 0) #define isopfg(trp) ((trp) -> type == OP_FG) #define isopbg(trp) ((trp) -> type == OP_BG) #define isopand(trp) ((trp) -> type == OP_AND) #define isopor(trp) ((trp) -> type == OP_OR) #define isoppipe(trp) ((trp) -> type == OP_PIPE) #ifdef MINIMUMSHELL #define isopnot(trp) (0) #define isopnown(trp) (0) #else #define isopnot(trp) ((trp) -> type == OP_NOT) #define isopnown(trp) ((trp) -> type == OP_NOWN) #endif typedef struct _shbuiltintable { int (NEAR *func)__P_((syntaxtree *)); CONST char *ident; u_char flags; } shbuiltintable; #define BT_NOGLOB 0001 #define BT_RESTRICT 0002 #ifdef STRICTPOSIX #define BT_POSIXSPECIAL 0004 #else #define BT_POSIXSPECIAL 0 #endif #define BT_NOKANJIFGET 0010 #define BT_DISABLE 0020 #define BT_FILENAME 0040 #define SMPREV 4 typedef struct _statementtable { int (NEAR *func)__P_((syntaxtree *)); CONST char *ident; u_char type; u_char prev[SMPREV]; } statementtable; #define STT_TYPE 0017 #define STT_FOR 0001 #define STT_CASE 0002 #define STT_IN 0003 #define STT_INCASE 0004 #define STT_CASEEND 0005 #define STT_LIST 0006 #define STT_LPAREN 0007 #define STT_FUNC 0010 #define STT_NEEDLIST 0020 #define STT_NEEDIDENT 0040 #define STT_NEEDNONE 0100 #define STT_NEEDCOMM 0200 typedef struct _opetable { u_char op; u_char level; CONST char *symbol; } opetable; typedef struct _pipelist { char *file; XFILE *fp; #ifndef USEFAKEPIPE syntaxtree *trp; #endif int fd; int new; int old; int ret; p_id_t pid; struct _pipelist *next; } pipelist; #ifndef NOJOB typedef struct _jobtable { p_id_t *pids; int *stats; int *fds; int npipe; syntaxtree *trp; char *tty; int order; # ifdef BASHSTYLE int id; # endif } jobtable; # ifdef BASHSTYLE # define jobid(n) (joblist[n].id) # else # define jobid(n) ((n) + 1) # endif #endif /* !NOJOB */ typedef struct _shfunctable { char *ident; syntaxtree *func; } shfunctable; typedef struct _shaliastable { char *ident; char *comm; u_char flags; } shaliastable; #define AL_USED 0001 typedef struct _signaltable { int sig; int (*func)__P_((VOID_A)); CONST char *ident; CONST char *mes; u_char flags; } signaltable; #define TR_STAT 0007 #define TR_IGN 0001 #define TR_TERM 0002 #define TR_STOP 0003 #define TR_TRAP 0004 #define TR_BLOCK 0010 #define TR_NOTRAP 0020 #define TR_CATCH 0040 #define TR_READBL 0100 typedef struct _ulimittable { u_char opt; int res; int unit; CONST char *mes; } ulimittable; typedef struct _shflagtable { CONST char *ident; int *var; u_char letter; } shflagtable; extern int shellmode; extern p_id_t mypid; extern p_id_t orgpid; extern p_id_t shellpid; extern int ret_status; extern int interactive; extern int errorexit; #ifndef NOJOB extern int stopped; extern p_id_t orgpgrp; extern p_id_t childpgrp; extern p_id_t ttypgrp; #endif extern int interrupted; extern int nottyout; extern int syntaxerrno; #if !MSDOS extern int sigconted; #endif extern int verboseexec; extern int notexec; extern int verboseinput; extern int terminated; extern int forcedstdin; extern int interactive_io; extern int tmperrorexit; extern int restricted; extern int freeenviron; extern int undeferror; extern int hashahead; extern int noglob; extern int autoexport; #ifndef MINIMUMSHELL extern int noclobber; extern int ignoreeof; #endif #ifndef NOJOB extern int bgnotify; extern int jobok; #endif #ifdef FD # ifndef _NOEDITMODE extern int emacsmode; extern int vimode; # endif # ifdef DEP_PTY extern int shptymode; # endif # if !MSDOS extern int autosavetty; # endif #endif /* FD */ extern int loginshell; extern int noruncom; extern CONST statementtable statementlist[]; extern CONST signaltable signallist[]; #endif /* DEP_ORIGSHELL */ extern VOID suspendsignal __P_((int, sigcst_t, sigblk_t *)); extern VOID resumesignal __P_((int, sigblk_t *)); #ifdef DEP_ORIGSHELL #ifndef MINIMUMSHELL extern int catchsignal __P_((int)); #endif extern VOID prepareexit __P_((int)); extern VOID Xexit2 __P_((int)); extern VOID execerror __P_((char *CONST *, CONST char *, int, int)); extern VOID doperror __P_((CONST char *, CONST char *)); extern int isnumeric __P_((CONST char *)); #if !MSDOS extern VOID dispsignal __P_((int, int, XFILE *)); # ifdef NOJOB extern int _waitjob __P_((p_id_t, wait_pid_t *, int)); #define waitjob _waitjob #define waitjob2(p, w, o, f) _waitjob(p, w, o) # else extern int _waitjob __P_((p_id_t, wait_pid_t *, int, XFILE *)); #define waitjob(p, w, o) _waitjob(p, w, o, Xstderr) #define waitjob2 _waitjob # endif extern int waitchild __P_((p_id_t, syntaxtree *)); #endif /* !MSDOS */ extern VOID setshflag __P_((int, int)); extern char *evalvararg __P_((char *, int, int)); extern VOID freeheredoc __P_((heredoc_t *, int)); extern VOID freerlist __P_((redirectlist *, int)); extern VOID freecomm __P_((command_t *, int)); extern syntaxtree *newstree __P_((syntaxtree *)); extern VOID freestree __P_((syntaxtree *)); extern syntaxtree *parentstree __P_((syntaxtree *)); #if !MSDOS extern VOID cmpmail __P_((CONST char *, CONST char *, time_t *)); #endif extern int identcheck __P_((CONST char *, int)); extern char *getshellvar __P_((CONST char *, int)); extern int putexportvar __P_((char *, int)); extern int putshellvar __P_((char *, int)); extern int unset __P_((CONST char *, int)); #ifdef MINIMUMSHELL extern syntaxtree *duplstree __P_((syntaxtree *, syntaxtree *)); #define duplstree2(tr, p, t) duplstree(tr, p) #else extern syntaxtree *duplstree __P_((syntaxtree *, syntaxtree *, long)); #define duplstree2 duplstree #endif extern CONST statementtable *getstatement __P_((syntaxtree *)); #if defined (BASHSTYLE) || !defined (MINIMUMSHELL) extern syntaxtree *startvar __P_((syntaxtree *, redirectlist *, CONST char *, int *, int *, int)); #endif extern syntaxtree *analyze __P_((CONST char *, syntaxtree *, int)); #ifdef DJGPP extern int closepipe __P_((int, int)); #define closepipe2 closepipe #else extern int closepipe __P_((int)); #define closepipe2(f, d) closepipe(f) #endif extern char *evalbackquote __P_((CONST char *)); #ifdef NOALIAS extern int checktype __P_((CONST char *, CONST VOID_P *, int)); #define checktype2(s, v, a, f) checktype(s, v, f) #else extern int checktype __P_((CONST char *, CONST VOID_P *, int, int)); #define checktype2 checktype #endif #if defined (FD) && !defined (_NOCOMPLETE) extern int completeshellvar __P_((CONST char *, int, int, char ***)); extern int completeshellcomm __P_((CONST char *, int, int, char ***)); #endif extern int getsubst __P_((int, char **, char ***, int **)); extern VOID printstree __P_((syntaxtree *, int, XFILE *)); extern int tinygetopt __P_((syntaxtree *, CONST char *, int *)); extern int setexport __P_((CONST char *)); extern int setronly __P_((CONST char *)); extern int typeone __P_((CONST char *, XFILE *)); #ifndef FDSH extern char **getsimpleargv __P_((syntaxtree *)); #endif extern VOID setshfunc __P_((char *, syntaxtree *)); extern int unsetshfunc __P_((CONST char *, int)); #if MSDOS extern int exec_simplecom __P_((syntaxtree *, int, CONST VOID_P)); #define exec_simplecom2(tr, t, v, b) \ exec_simplecom(tr, t, v) #else extern int exec_simplecom __P_((syntaxtree *, int, CONST VOID_P, int)); #define exec_simplecom2 exec_simplecom #endif extern int execruncom __P_((CONST char *, int)); extern VOID setshellvar __P_((char *CONST *)); extern int prepareterm __P_((VOID_A)); extern int initshell __P_((int, char *CONST *)); extern int shell_loop __P_((int)); extern int main_shell __P_((int, char *CONST *, char *CONST *)); #endif /* DEP_ORIGSHELL */ FD-3.01j/posixsh.h100644 2105 1751 3250 13516612560 12527 0ustar shiraiuser/* * posixsh.h * * function prototype declarations for "posixsh.c" */ #include "stream.h" #ifndef NOJOB extern int gettermio __P_((p_id_t, int)); extern VOID setlastjob __P_((int)); extern VOID dispjob __P_((int, XFILE *)); extern int statjob __P_((int)); extern VOID freejob __P_((int)); extern int searchjob __P_((p_id_t, int *)); extern int getjob __P_((CONST char *)); extern int stackjob __P_((p_id_t, int, int, syntaxtree *)); extern int stoppedjob __P_((p_id_t)); extern VOID killjob __P_((VOID_A)); extern VOID checkjob __P_((XFILE *)); #endif /* !NOJOB */ extern char *evalposixsubst __P_((CONST char *, int *)); #if !MSDOS extern VOID replacemailpath __P_((CONST char *, int)); extern VOID checkmail __P_((int)); #endif #ifndef NOALIAS extern shaliastable *getshalias __P_((CONST char *, int)); extern int addalias __P_((char *, char *)); extern int deletealias __P_((CONST char *)); extern VOID freealias __P_((shaliastable *)); extern shaliastable *checkalias __P_((syntaxtree *, char *, int, int)); #endif #ifndef NOJOB extern int posixjobs __P_((syntaxtree *)); extern int posixfg __P_((syntaxtree *)); extern int posixbg __P_((syntaxtree *)); #endif #ifndef NOALIAS extern int posixalias __P_((syntaxtree *)); extern int posixunalias __P_((syntaxtree *)); #endif extern int posixkill __P_((syntaxtree *)); extern int posixtest __P_((syntaxtree *)); #ifndef NOPOSIXUTIL extern int posixcommand __P_((syntaxtree *)); extern int posixgetopts __P_((syntaxtree *)); #endif #ifndef NOJOB extern jobtable *joblist; extern int maxjobs; #endif #if !MSDOS extern int mailcheck; #endif #ifndef NOALIAS extern shaliastable *shellalias; #endif #ifndef NOPOSIXUTIL extern int posixoptind; #endif FD-3.01j/wait.h100644 2105 1751 6305 13516612560 12002 0ustar shiraiuser/* * wait.h * * definitions for waiting child */ #ifndef __WAIT_H_ #define __WAIT_H_ #include "unixemu.h" #if !MSDOS #include #endif #ifdef USESIGPMASK #define sigmask_t sigset_t #define Xsigemptyset(m) VOID_C sigemptyset(&m) #define Xsigfillset(m) VOID_C sigfillset(&m) #define Xsigaddset(m, s) VOID_C sigaddset(&m, s) #define Xsigdelset(m, s) VOID_C sigdelset(&m, s) #define Xsigsetmask(m) VOID_C sigprocmask(SIG_SETMASK, &m, NULL) #define Xsigblock(o, m) VOID_C sigprocmask(SIG_BLOCK, &m, &o) #else /* !USESIGPMASK */ typedef int sigmask_t; #define Xsigemptyset(m) ((m) = 0) #define Xsigfillset(m) ((m) = ~0) #define Xsigaddset(m, s) ((m) |= sigmask(s)) #define Xsigdelset(m, s) ((m) &= ~sigmask(s)) #define Xsigsetmask(m) VOID_C sigsetmask(m) #define Xsigblock(o, m) ((o) = sigblock(m)) #endif /* !USESIGPMASK */ #if MSDOS #define sigblk_t sigcst_t #else #define sigblk_t sigmask_t #endif #ifdef NOKILLPG #define Xkillpg(p, s) kill(-(p), s) #else #define Xkillpg(p, s) killpg(p, s) #endif #ifdef USEWAITPID typedef int wait_pid_t; #else #define wait_pid_t union wait #endif #ifndef WSTOPPED #define WSTOPPED 0177 #endif #ifndef WNOHANG #define WNOHANG 1 #endif #ifndef WUNTRACED #define WUNTRACED 2 #endif #ifdef USEWAITPID #define Xwait3(wp, opts, ru) waitpid(-1, wp, opts) #define Xwait4(p, wp, opts, ru) waitpid(p, wp, opts) # ifndef WIFSTOPPED # define WIFSTOPPED(x) (((x) & 0177) == WSTOPPED) # endif # ifndef WIFSIGNALED # define WIFSIGNALED(x) (((x) & 0177) != WSTOPPED \ && ((x) & 0177) != 0) # endif # ifndef WIFEXITED # define WIFEXITED(x) (((x) & 0177) == 0) # endif # ifndef WCOREDUMP # define WCOREDUMP(x) ((x) & 0200) # endif # ifndef WSTOPSIG # define WSTOPSIG(x) (((x) >> 8) & 0177) # endif # ifndef WTERMSIG # define WTERMSIG(x) ((x) & 0177) # endif # ifndef WEXITSTATUS # define WEXITSTATUS(x) (((x) >> 8) & 0377) # endif #else /* !USEWAITPID */ #define Xwait3 wait3 #define Xwait4 wait4 # ifndef WIFSTOPPED # define WIFSTOPPED(x) ((x).w_stopval == WSTOPPED) # endif # ifndef WIFSIGNALED # define WIFSIGNALED(x) ((x).w_stopval != WSTOPPED \ && (x).w_termsig != 0) # endif # ifndef WIFEXITED # define WIFEXITED(x) ((x).w_stopval != WSTOPPED \ && (x).w_termsig == 0) # endif # ifndef WCOREDUMP # define WCOREDUMP(x) ((x).w_coredump) # endif # ifndef WSTOPSIG # define WSTOPSIG(x) ((x).w_stopsig) # endif # ifndef WTERMSIG # define WTERMSIG(x) ((x).w_termsig) # endif # ifndef WEXITSTATUS # define WEXITSTATUS(x) ((x).w_retcode) # endif #endif /* !USEWAITPID */ #ifndef NSIG # ifdef _NSIG # define NSIG _NSIG # else # ifdef DJGPP # define NSIG 301 # else # define NSIG 64 # endif # endif #endif #ifndef SIG_ERR #define SIG_ERR ((sigcst_t)-1) #endif #ifndef SIG_DFL #define SIG_DFL ((sigcst_t)0) #endif #ifndef SIG_IGN #define SIG_IGN ((sigcst_t)1) #endif #if !defined (SIGIOT) && defined (SIGABRT) #define SIGIOT SIGABRT #endif #if !defined (SIGCHLD) && defined (SIGCLD) #define SIGCHLD SIGCLD #endif #if !defined (SIGWINCH) && defined (SIGWINDOW) #define SIGWINCH SIGWINDOW #endif #ifdef FD # ifdef SIGALRM extern int noalrm; # define sigalrm(sig) ((!noalrm && (sig)) ? SIGALRM : 0) # else # define sigalrm(sig) 0 # endif #endif /* FD */ #endif /* !__WAIT_H_ */ FD-3.01j/termio.h100644 2105 1751 16264 13516612560 12362 0ustar shiraiuser/* * termio.h * * definitions & function prototype declarations for "termio.c" */ #ifndef __TERMIO_H_ #define __TERMIO_H_ #include "stream.h" #ifdef CYGWIN #include "typesize.h" #endif #if !MSDOS #include #endif #if MSDOS #include #include # ifdef DJGPP # include # include # include # if (DJGPP >= 2) # include # endif # endif /* !DJGPP */ #else /* MSDOS */ # ifdef USETERMIOS #include # endif # ifdef USETERMIO #include # endif # ifdef USESGTTY #include # endif #endif /* MSDOS */ #if MSDOS #undef USETERMIOS #undef USETERMIO #undef USESGTTY #endif #ifndef STDIN_FILENO #define STDIN_FILENO 0 #endif #ifndef STDOUT_FILENO #define STDOUT_FILENO 1 #endif #ifndef STDERR_FILENO #define STDERR_FILENO 2 #endif #ifdef ULONGIOCTL typedef unsigned long ioctlreq_t; #else typedef int ioctlreq_t; #endif #ifdef USETERMIOS typedef struct termios termioctl_t; typedef struct termios ldiscioctl_t; #define tioctl(d, r, a) ((r) \ ? Xtcsetattr(d, (r) - 1, a) : Xtcgetattr(d, a)) #define ttyflush(f, a) Xtcflush(f, a) #define getspeed(t) cfgetospeed(&t) # ifdef HAVECLINE # define ldisc(a) ((a).c_line) # endif #define REQGETP 0 #define REQGETD 0 #define REQSETP (TCSAFLUSH + 1) #define REQSETD (TCSADRAIN + 1) #define REQSETN (TCSANOW + 1) #define FLSHIN TCIFLUSH #define FLSHOUT TCOFLUSH #define FLSHIO TCIOFLUSH #endif /* USETERMIOS */ #ifdef USETERMIO typedef struct termio termioctl_t; typedef struct termio ldiscioctl_t; #define tioctl Xioctl #define ttyflush(f, a) Xioctl(f, TCFLSH, a) #define getspeed(t) ((t).c_cflag & CBAUD) #define ldisc(a) ((a).c_line) #define REQGETP TCGETA #define REQGETD TCGETA #define REQSETP TCSETAF #define REQSETD TCSETAW #define REQSETN TCSETA #define FLSHIN 0 #define FLSHOUT 1 #define FLSHIO 2 #endif /* USETERMIO */ #ifdef USESGTTY typedef struct sgttyb termioctl_t; typedef int ldiscioctl_t; #define tioctl Xioctl #define ttyflush(f, a) Xioctl(f, TIOCFLUSH, &(a)) #define getspeed(t) ((t).sg_ospeed) #define ldisc(a) (a) #define REQGETP TIOCGETP #define REQGETD TIOCGETD #define REQSETP TIOCSETP #define REQSETD TIOCSETD #define REQSETN TIOCSETN #define FLSHIN FREAD #define FLSHOUT FWRITE #define FLSHIO (FREAD | FWRITE) #endif /* USESGTTY */ #if defined (CYGWIN) && (CYGWIN > 1007009) /* for Cygwin buggy ioctl */ #undef ttyflush #define ttyflush(f, a) Xioctl(f, TCFLSH, a) #endif #ifdef TIOCGWINSZ typedef struct winsize termwsize_t; #define REQGETWS TIOCGWINSZ #define REQSETWS TIOCSWINSZ #else /* !TIOCGWINSZ */ # ifdef WIOCGETD typedef struct uwdata termwsize_t; #define REQGETWS WIOCGETD #define REQSETWS WIOCSETD # else /* !WIOCGETD */ # ifdef TIOCGSIZE typedef struct ttysize termwsize_t; #define REQGETWS TIOCGSIZE #define REQSETWS TIOCSSIZE # else /* !TIOCGSIZE */ #define NOTERMWSIZE # endif /* !TIOCGSIZE */ # endif /* !WIOCGETD */ #endif /* !TIOCGWINSZ */ #ifndef PENDIN #define PENDIN 0 #endif #ifndef IEXTEN #define IEXTEN 0 #endif #ifndef ECHOCTL #define ECHOCTL 0 #endif #ifndef ECHOKE #define ECHOKE 0 #endif #ifndef OCRNL #define OCRNL 0 #endif #ifndef ONOCR #define ONOCR 0 #endif #ifndef ONLRET #define ONLRET 0 #endif #ifndef OXTABS #define OXTABS XTABS #endif #ifndef TAB3 #define TAB3 OXTABS #endif #define TIO_LCBREAK (ISIG | IEXTEN) #define TIO_LCOOKED (TIO_LCBREAK | ICANON) #define TIO_LECHO (ECHO | ECHOE | ECHOCTL | ECHOKE) #define TIO_LNOECHO ~(ECHO | ECHOE | ECHOK | ECHONL) #define TIO_ICOOKED (BRKINT | IXON) #define TIO_INOCOOKED ~(IGNBRK | ISTRIP) #define TIO_ONL (OPOST | ONLCR) #define TIO_ONONL ~(OCRNL | ONOCR | ONLRET) #if MSDOS # ifdef DJGPP # define TIO_BUFSIZ (ALLOC_T)0 # else # define TIO_BUFSIZ sizeof(u_char) # endif # define TIO_WINSIZ (ALLOC_T)0 #else /* !MSDOS */ # ifdef USESGTTY # define TIO_BUFSIZ (sizeof(termioctl_t) \ + sizeof(int) + sizeof(struct tchars)) # else # define TIO_BUFSIZ sizeof(termioctl_t) # endif # ifdef NOTERMWSIZE # define TIO_WINSIZ (ALLOC_T)0 # else # define TIO_WINSIZ sizeof(termwsize_t) # endif #endif /* !MSDOS */ #if defined (USETERMIOS) || defined (USETERMIO) #if (VEOF == VMIN) || (VEOL == VTIME) #define VAL_VMIN '\004' #define VAL_VTIME 255 #else #define VAL_VMIN 0 #define VAL_VTIME 0 #endif #endif /* USETERMIOS || USETERMIO */ #if MSDOS #define FR_CARRY 00001 #define FR_PARITY 00004 #define FR_ACARRY 00020 #define FR_ZERO 00100 #define FR_SIGN 00200 #define FR_TRAP 00400 #define FR_INTERRUPT 01000 #define FR_DIRECTION 02000 #define FR_OVERFLOW 04000 # ifdef DJGPP # if (DJGPP < 2) # define __dpmi_regs _go32_dpmi_registers # define __dpmi_int(v, r) \ ((r) -> x.ss = (r) -> x.sp = 0, \ _go32_dpmi_simulate_int(v, r)) # define _dos_ds _go32_info_block.selector_for_linear_memory # define __tb \ _go32_info_block.linear_address_of_transfer_buffer # define __tb_offset (__tb & 15) # define __tb_segment (__tb / 16) # endif # define tbsize _go32_info_block.size_of_transfer_buffer # define PTR_FAR(p) ((u_long)(__tb)) # define PTR_SEG(p) (__tb_segment) # define PTR_OFF(p, o) (__tb_offset + (o)) # else /* !DJGPP */ # ifdef __TURBOC__ /* Oops!! Borland C++ has not x.bp !! */ typedef union DPMI_REGS { struct XREGS { u_short ax, bx, cx, dx, si, di, bp, flags; } x; struct HREGS { u_char al, ah, bl, bh, cl, ch, dl, dh; } h; } __dpmi_regs; # else typedef union REGS __dpmi_regs; # endif # define PTR_FAR(p) (((u_long)FP_SEG(p) << 4) \ + FP_OFF(p)) # define PTR_SEG(p) FP_SEG(p) # define PTR_OFF(p, o) FP_OFF(p) # endif /* !DJGPP */ #endif /* MSDOS */ #define ENVTERM "TERM" #define ENVLINES "LINES" #define ENVCOLUMNS "COLUMNS" #define ENVEMACS "EMACS" #define SEL_WRITE 0001 #define SEL_NOINTR 0002 #define SEL_TTYIO 0004 #ifndef _PATH_TTY # if MSDOS # define _PATH_TTY "CON" # else # define _PATH_TTY "/dev/tty" # endif #endif /* !_PATH_TTY */ #ifdef LSI_C extern int safe_dup __P_((int)); extern int safe_dup2 __P_((int, int)); #else #define safe_dup dup #define safe_dup2 dup2 #endif #if MSDOS extern VOID dosseterrno __P_((u_int)); extern int intcall __P_((int, __dpmi_regs *, struct SREGS *)); #endif extern int Xgetdtablesize __P_((VOID_A)); extern int isvalidfd __P_((int)); extern int newdup __P_((int)); extern int sureread __P_((int, VOID_P, int)); extern int surewrite __P_((int, CONST VOID_P, int)); extern VOID safeclose __P_((int)); extern VOID safefclose __P_((XFILE *)); extern int opentty __P_((int *, XFILE **)); extern VOID closetty __P_((int *, XFILE **)); #if !MSDOS extern VOID closeonexec __P_((int)); extern int Xioctl __P_((int, ioctlreq_t, ...)); # ifdef USETERMIOS extern int Xtcgetattr __P_((int, termioctl_t *)); extern int Xtcsetattr __P_((int, int, CONST termioctl_t *)); extern int Xtcflush __P_((int, int)); # endif #endif /* !MSDOS */ #if defined (FD) || defined (CYGWIN) || !defined (NOJOB) extern VOID loadtermio __P_((int, CONST char *, CONST char *)); extern VOID savetermio __P_((int, char **, char **)); #endif #ifdef CYGWIN extern p_id_t Xfork __P_((VOID_A)); #else #define Xfork fork #endif #ifndef NOSELECT extern int sureselect __P_((int, int [], char [], VOID_P, int)); #define readselect(n, f, r, v) sureselect(n, f, r, v, 0) #endif #endif /* !__TERMIO_H_ */ FD-3.01j/term.h100644 2105 1751 14333 13516612560 12025 0ustar shiraiuser/* * term.h * * definitions & function prototype declarations for "term.c" */ #ifndef __TERM_H_ #define __TERM_H_ #include "stream.h" typedef struct _keyseq_t { char *str; short code; u_char len; u_char flags; } keyseq_t; #define KF_DEFINED 0001 #define KF_HASALTER 0002 #define GETSIZE "\033[6n" #define SIZEFMT "\033[%d;%dR" #define K_CR '\r' #define K_ESC '\033' #define K_MIN K_NOKEY #define K_NOKEY 0401 #define K_DOWN 0402 #define K_UP 0403 #define K_LEFT 0404 #define K_RIGHT 0405 #define K_HOME 0406 #define K_BS 0407 #define K_F0 0410 #define K_F(n) (K_F0 + (n)) #define K_DL 0510 #define K_IL 0511 #define K_DC 0512 #define K_IC 0513 #define K_EIC 0514 #define K_CLR 0515 #define K_EOS 0516 #define K_EOL 0517 #define K_ESF 0520 #define K_ESR 0521 #define K_NPAGE 0522 #define K_PPAGE 0523 #define K_STAB 0524 #define K_CTAB 0525 #define K_CATAB 0526 #define K_ENTER 0527 #define K_SRST 0530 #define K_RST 0531 #define K_PRINT 0532 #define K_LL 0533 #define K_A1 0534 #define K_A3 0535 #define K_B2 0536 #define K_C1 0537 #define K_C3 0540 #define K_BTAB 0541 #define K_BEG 0542 #define K_CANC 0543 #define K_CLOSE 0544 #define K_COMM 0545 #define K_COPY 0546 #define K_CREAT 0547 #define K_END 0550 #define K_EXIT 0551 #define K_FIND 0552 #define K_HELP 0553 #define K_MAX K_HELP #define K_TIMEOUT (K_MAX + 1) #define K_METAKEY 01000 #define K_ALTERNATE 02000 #if MSDOS #define mkmetakey(c) (K_METAKEY | (Xtolower(c) & 0x7f)) #define ismetakey(c) (((c) & K_METAKEY) && Xislower((c) & 0xff)) #else #define mkmetakey(c) (K_METAKEY | ((c) & 0x7f)) #define ismetakey(c) (((c) & K_METAKEY) && Xisalpha((c) & 0xff)) #endif #define mkekana(c) (K_METAKEY | ((c) & 0xff)) #define isekana2(c) (((c) & K_METAKEY) && Xiskana((c) & 0xff)) #define alternate(c) ((c) & ~K_ALTERNATE) #ifndef K_CTRL #define K_CTRL(c) ((c) & 037) #endif extern int n_column; extern int n_lastcolumn; extern int n_line; extern int stable_standout; #if MSDOS extern CONST char *termstr[]; #else extern char *termstr[]; #endif #define T_INIT 0 #define T_END 1 #define T_METAMODE 2 #define T_NOMETAMODE 3 #define T_SCROLL 4 #define T_KEYPAD 5 #define T_NOKEYPAD 6 #define T_NORMALCURSOR 7 #define T_HIGHCURSOR 8 #define T_NOCURSOR 9 #define T_SETCURSOR 10 #define T_RESETCURSOR 11 #define T_BELL 12 #define T_VBELL 13 #define T_CLEAR 14 #define T_NORMAL 15 #define T_BOLD 16 #define T_REVERSE 17 #define T_DIM 18 #define T_BLINK 19 #define T_STANDOUT 20 #define T_UNDERLINE 21 #define END_STANDOUT 22 #define END_UNDERLINE 23 #define L_CLEAR 24 #define L_CLEARBOL 25 #define L_INSERT 26 #define L_DELETE 27 #define C_INSERT 28 #define C_DELETE 29 #define C_LOCATE 30 #define C_HOME 31 #define C_RETURN 32 #define C_NEWLINE 33 #define C_SCROLLFORW 34 #define C_SCROLLREV 35 #define C_UP 36 #define C_DOWN 37 #define C_RIGHT 38 #define C_LEFT 39 #define C_NUP 40 #define C_NDOWN 41 #define C_NRIGHT 42 #define C_NLEFT 43 #define T_FGCOLOR 44 #define T_BGCOLOR 45 #define MAXTERMSTR 46 extern u_char cc_intr; extern u_char cc_quit; extern u_char cc_eof; extern u_char cc_eol; extern u_char cc_erase; extern int (*keywaitfunc)__P_((VOID_A)); #if !MSDOS extern int usegetcursor; extern int suspended; extern char *duptty[2]; #endif extern int ttyio; extern int isttyiomode; extern XFILE *ttyout; extern int dumbterm; extern VOID inittty __P_((int)); extern VOID Xcooked __P_((VOID_A)); extern VOID Xcbreak __P_((VOID_A)); extern VOID Xraw __P_((VOID_A)); extern VOID Xecho __P_((VOID_A)); extern VOID Xnoecho __P_((VOID_A)); extern VOID Xnl __P_((VOID_A)); extern VOID Xnonl __P_((VOID_A)); extern VOID tabs __P_((VOID_A)); extern VOID notabs __P_((VOID_A)); extern VOID keyflush __P_((VOID_A)); #if !MSDOS extern int savettyio __P_((int)); #endif extern VOID ttyiomode __P_((int)); extern VOID stdiomode __P_((VOID_A)); extern int termmode __P_((int)); extern VOID exit2 __P_((int)); extern int getxy __P_((int *, int *)); extern VOID getterment __P_((CONST char *)); #if !MSDOS extern VOID freeterment __P_((VOID_A)); extern VOID regetterment __P_((CONST char *, int)); extern VOID setdefterment __P_((VOID_A)); extern VOID setdefkeyseq __P_((VOID_A)); extern int getdefkeyseq __P_((keyseq_t *)); extern VOID setkeyseq __P_((int, char *, int)); extern int getkeyseq __P_((keyseq_t *)); extern keyseq_t *copykeyseq __P_((keyseq_t *)); extern VOID freekeyseq __P_((keyseq_t *)); #endif extern int tputparam __P_((int, int, int, int)); extern VOID initterm __P_((VOID_A)); extern VOID endterm __P_((VOID_A)); extern VOID putterm __P_((int)); extern int Xputch __P_((int)); extern VOID Xcputs __P_((CONST char *)); extern VOID tputs2 __P_((CONST char *, int)); #if MSDOS #define putterms putterm #else extern VOID putterms __P_((int)); extern VOID checksuspend __P_((VOID_A)); #endif extern int kbhit2 __P_((long)); extern int Xgetch __P_((VOID_A)); extern int getkey2 __P_((int, int, int)); #if MSDOS #define getkey3 getkey2 #else extern int getkey3 __P_((int, int, int)); #endif extern int ungetkey2 __P_((int, int)); extern int setscroll __P_((int, int)); extern VOID locate __P_((int, int)); extern VOID tflush __P_((VOID_A)); extern char *getwsize __P_((int, int)); extern VOID setwsize __P_((int, int, int)); extern int cvasprintf __P_((char **sp, CONST char *fmt, va_list)); extern int Xcprintf __P_((CONST char *, ...)); extern VOID tprintf __P_((CONST char *, int, ...)); extern VOID cputnl __P_((VOID_A)); extern int kanjiputs __P_((CONST char *)); extern VOID attrputs __P_((CONST char *, int)); extern int attrprintf __P_((CONST char *, int, ...)); extern int attrkanjiputs __P_((CONST char *, int)); extern VOID chgcolor __P_((int, int)); extern VOID movecursor __P_((int, int, int)); #ifndef SENSEPERSEC #define SENSEPERSEC 50 #endif #ifndef WAITKEYPAD #define WAITKEYPAD 360 /* msec */ #endif #ifndef WAITTERMINAL #define WAITTERMINAL WAITKEYPAD /* msec */ #endif #ifndef WAITKANJI #define WAITKANJI 120 /* msec */ #endif #define ANSI_BLACK 0 #define ANSI_RED 1 #define ANSI_GREEN 2 #define ANSI_YELLOW 3 #define ANSI_BLUE 4 #define ANSI_MAGENTA 5 #define ANSI_CYAN 6 #define ANSI_WHITE 7 #define ANSI_NORMAL 30 #define ANSI_REVERSE 40 #endif /* !__TERM_H_ */ FD-3.01j/stream.h100644 2105 1751 6605 13516612560 12334 0ustar shiraiuser/* * stream.h * * definitions & function prototype declarations for "stream.c" */ #ifndef __STREAM_H_ #define __STREAM_H_ #include "depend.h" #ifndef XF_BUFSIZ #define XF_BUFSIZ ((ALLOC_T)BUFSIZ) #endif #if MSDOS #define CH_EOF '\032' #else #define CH_EOF '\004' #endif #ifdef DEP_ORIGSTREAM typedef struct _XFILE { int fd; int status; int flags; ALLOC_T ptr; ALLOC_T count; char buf[XF_BUFSIZ]; # ifdef DEP_STREAMTIMEOUT int timeout; # endif # ifdef DEP_STREAMLOG VOID_T (*dumpfunc)__P_((CONST u_char *, ALLOC_T, CONST char *)); int debuglvl; CONST char *debugmes; char path[1]; # endif } XFILE; #else /* !DEP_ORIGSTREAM */ #define XFILE FILE #endif /* !DEP_ORIGSTREAM */ #define XS_EOF 000001 #define XS_ERROR 000002 #define XS_CLOSED 000004 #define XS_READ 000010 #define XS_WRITTEN 000020 #define XS_BINARY 000040 #define XS_RDONLY 000100 #define XS_WRONLY 000200 #define XS_LOCKED 000400 #define XS_NOAHEAD 001000 #define XS_CLEARBUF 002000 #define XF_NOBUF 000001 #define XF_LINEBUF 000002 #define XF_CRNL 000004 #define XF_NOCLOSE 000010 #define XF_NONBLOCK 000020 #define XF_CONNECTED 000040 #define XF_TELNET 000100 #define XF_NULLCONV 000200 #ifdef DEP_ORIGSTREAM extern XFILE *Xfopen __P_((CONST char *, CONST char *)); extern XFILE *Xfdopen __P_((int, CONST char *)); extern int Xfclose __P_((XFILE *)); extern VOID Xclearerr __P_((XFILE *)); extern int Xfeof __P_((XFILE *)); extern int Xferror __P_((XFILE *)); extern int Xfileno __P_((XFILE *)); extern VOID Xsetflags __P_((XFILE *, int)); # ifdef DEP_STREAMTIMEOUT extern VOID Xsettimeout __P_((XFILE *, int)); # endif extern int Xfflush __P_((XFILE *)); extern int Xfpurge __P_((XFILE *)); extern int Xfread __P_((char *, ALLOC_T, XFILE *)); extern int Xfwrite __P_((CONST char *, ALLOC_T, XFILE *)); extern int Xfgetc __P_((XFILE *)); extern int Xfputc __P_((int, XFILE *)); extern char *Xfgets __P_((XFILE *)); extern int Xfputs __P_((CONST char *, XFILE *)); extern VOID Xsetbuf __P_((XFILE *)); extern VOID Xsetlinebuf __P_((XFILE *)); #else /* !DEP_ORIGSTREAM */ #define Xfopen fopen #define Xfdopen fdopen #define Xfclose fclose #define Xclearerr clearerr #define Xfeof feof #define Xferror ferror #define Xfileno fileno #define Xfflush fflush #define Xfpurge(f) #define Xfread(p, s, f) fread(p, 1, s, f) #define Xfwrite(p, s, f) fwrite(p, 1, s, f) #define Xfgetc fgetc #define Xfputc fputc #define Xfputs fputs # if MSDOS # define Xsetbuf(f) setbuf(f, NULL) # define Xsetlinebuf(f) # else /* !MSDOS */ # ifdef USESETVBUF # define Xsetbuf(f) setvbuf(f, NULL, _IONBF, 0) # define Xsetlinebuf(f) setvbuf(f, NULL, _IOLBF, 0) # else # define Xsetbuf(f) setbuf(f, NULL) # define Xsetlinebuf(f) setlinebuf(f) # endif # endif /* !MSDOS */ #endif /* !DEP_ORIGSTREAM */ #if defined (FD) && !defined (DEP_ORIGSHELL) extern XFILE *Xpopen __P_((CONST char *, CONST char *)); extern int Xpclose __P_((XFILE *)); #endif extern int fputnl __P_((XFILE *)); extern VOID putc2 __P_((int)); #ifndef FD extern char *gets2 __P_((CONST char *)); #endif extern VOID puts2 __P_((CONST char *)); extern VOID putnl __P_((VOID_A)); extern VOID errputs __P_((CONST char *, int)); #ifdef DEP_ORIGSTREAM extern int (*stream_isnfsfunc)__P_((CONST char *)); extern XFILE *Xstdin; extern XFILE *Xstdout; extern XFILE *Xstderr; #else #define Xstdin stdin #define Xstdout stdout #define Xstderr stderr #endif #endif /* !__STREAM_H_ */ FD-3.01j/types.h100644 2105 1751 16153 13516612560 12224 0ustar shiraiuser/* * types.h * * type definitions */ #include "depend.h" #include "typesize.h" #include "stream.h" #include "lsparse.h" typedef struct _strtable { u_short no; CONST char *str; } strtable; typedef struct _lockbuf_t { int fd; XFILE *fp; char *name; u_char flags; } lockbuf_t; #define LCK_FLOCK 0001 #define LCK_INVALID 0002 #define LCK_STREAM 0004 #define LCK_MAXRETRY 32 #ifdef DEP_DYNAMICLIST typedef u_short funcno_t; #else typedef u_char funcno_t; #endif typedef struct _bindtable { short key; funcno_t f_func; funcno_t d_func; } bindtable; #define FNO_NONE MAXUTYPE(funcno_t) #define FNO_SETMACRO (MAXUTYPE(funcno_t) - 1) #define ffunc(n) (bindlist[n].f_func) #define dfunc(n) (bindlist[n].d_func) #define hasdfunc(n) (dfunc(n) != FNO_NONE) typedef struct _functable { int (*func)__P_((CONST char *)); CONST char *ident; #ifdef _NOCATALOG # ifndef _NOJPNMES CONST char *hmes; # endif # ifndef _NOENGMES CONST char *hmes_eng; # endif #else /* !_NOCATALOG */ int hmes_no; #endif /* !_NOCATALOG */ u_char status; } functable; #define FN_REWRITE 0001 #define FN_RELIST 0002 #define FN_REWIN 0003 #define FN_REWRITEMODE 0003 #define FN_RESCREEN 0004 #define FN_KILLSTACK 0010 #define FN_ARCHIVE 0020 #define FN_NOFILE 0040 #define FN_RESTRICT 0100 #define FN_NEEDSTATUS 0200 #define rewritemode(n) ((n) & FN_REWRITEMODE) #ifndef _NOARCHIVE typedef struct _archive_t { char *ext; char *p_comm; char *u_comm; u_char flags; } archive_t; #define AF_IGNORECASE 0001 /* must be the same as LF_IGNORECASE */ #endif #ifndef _NOTREE typedef struct _treelist { char *name; int max; # ifndef NODIRLOOP dev_t dev; ino_t ino; struct _treelist *parent; # endif struct _treelist *sub; } treelist; #endif /* !_NOTREE */ typedef struct _winvartable { #ifndef _NOARCHIVE struct _winvartable *v_archduplp; char *v_archivedir; char *v_archivefile; char *v_archtmpdir; lsparse_t *v_launchp; namelist *v_arcflist; int v_maxarcf; # ifdef DEP_PSEUDOPATH int v_archdrive; # endif # ifndef _NOBROWSE lsparse_t *v_browselist; int v_browselevel; # endif #endif /* !_NOARCHIVE */ #ifndef _NOTREE char *v_treepath; #endif char *v_fullpath; char *v_lastfile; char *v_findpattern; namelist *v_filelist; int v_maxfile; int v_maxent; int v_filepos; int v_sorton; int v_dispmode; int v_fileperrow; } winvartable; extern winvartable winvar[]; #ifdef _NOSPLITWIN #define windows 1 #else extern int windows; #endif #if defined (_NOSPLITWIN) && !defined (DEP_PTY) #define win 0 #else extern int win; #endif #ifndef _NOARCHIVE #define archduplp (winvar[win].v_archduplp) #define archivefile (winvar[win].v_archivefile) #define archtmpdir (winvar[win].v_archtmpdir) #define launchp (winvar[win].v_launchp) #define arcflist (winvar[win].v_arcflist) #define maxarcf (winvar[win].v_maxarcf) # ifdef DEP_PSEUDOPATH # define archdrive (winvar[win].v_archdrive) # endif # ifndef _NOBROWSE # define browselist (winvar[win].v_browselist) # define browselevel (winvar[win].v_browselevel) # endif #endif /* !_NOARCHIVE */ #ifndef _NOTREE #define treepath (winvar[win].v_treepath) #endif #define lastfile (winvar[win].v_lastfile) #define findpattern (winvar[win].v_findpattern) #define filelist (winvar[win].v_filelist) #define maxfile (winvar[win].v_maxfile) #define maxent (winvar[win].v_maxent) #define filepos (winvar[win].v_filepos) #define sorton (winvar[win].v_sorton) #define dispmode (winvar[win].v_dispmode) #define FILEPERROW (winvar[win].v_fileperrow) typedef struct _macrostat { short addopt; short needburst; short needmark; u_short flags; } macrostat; #define F_NOCONFIRM 0000001 #define F_ARGSET 0000002 #define F_REMAIN 0000004 #define F_NOEXT 0000010 #define F_TOSFN 0000020 #define F_ISARCH 0000040 #define F_BURST 0000100 #define F_MARK 0000200 #define F_NOADDOPT 0000400 #define F_IGNORELIST 0001000 #define F_NOCOMLINE 0002000 #define F_NOKANJICONV 0004000 #define F_TTYIOMODE 0010000 #define F_TTYNL 0020000 #define F_EVALMACRO 0040000 #define F_DOSYSTEM 0100000 #ifndef DEP_ORIGSHELL typedef struct _aliastable { char *alias; char *comm; } aliastable; typedef struct _userfunctable { char *func; char **comm; } userfunctable; #endif /* !DEP_ORIGSHELL */ typedef struct _builtintable { int (NEAR *func)__P_((int, char *CONST [])); char *ident; } builtintable; #ifdef DEP_DYNAMICLIST typedef bindtable * bindlist_t; typedef CONST bindtable origbindlist_t[]; typedef lsparse_t * launchlist_t; typedef CONST lsparse_t origlaunchlist_t[]; typedef archive_t * archivelist_t; typedef CONST archive_t origarchivelist_t[]; typedef char ** macrolist_t; typedef char ** helpindex_t; typedef char * orighelpindex_t[]; #else typedef bindtable bindlist_t[MAXBINDTABLE]; typedef bindtable * origbindlist_t; typedef lsparse_t launchlist_t[MAXLAUNCHTABLE]; typedef lsparse_t * origlaunchlist_t; typedef archive_t archivelist_t[MAXARCHIVETABLE]; typedef archive_t * origarchivelist_t; typedef char * macrolist_t[MAXMACROTABLE]; typedef char * helpindex_t[MAXHELPINDEX]; typedef char ** orighelpindex_t; #endif #define F_SYMLINK 001 #define F_FILETYPE 002 #define F_DOTFILE 004 #define F_FILEFLAG 010 #define isdisptyp(n) ((n) & F_FILETYPE) #define ishidedot(n) ((n) & F_DOTFILE) #ifdef _NOARCHIVE #define isdisplnk(n) ((n) & F_SYMLINK) #define isfileflg(n) ((n) & F_FILEFLAG) #else #define isdisplnk(n) (!archivefile && ((n) & F_SYMLINK)) #define isfileflg(n) (!archivefile && ((n) & F_FILEFLAG)) #endif #define FNC_NONE 0 #define FNC_CANCEL 1 #define FNC_UPDATE 2 #define FNC_HELPSPOT 3 #define FNC_EFFECT 4 #define FNC_QUIT (-1) #define FNC_FAIL (-2) #define ICM_BINDKEY 0 #define ICM_CMDLINE 1 #define FSID_UFS 1 #define FSID_EFS 2 #define FSID_SYSV 3 #define FSID_LINUX 4 #define FSID_FAT 5 #define FSID_LFN 6 #define FSID_DOSDRIVE 7 #define CHK_OK 0 #define CHK_EXIST 1 #define CHK_OVERWRITE 2 #define CHK_ERROR (-1) #define CHK_CANCEL (-2) #define APL_OK 0 #define APL_IGNORE 1 #define APL_ERROR (-1) #define APL_CANCEL (-2) #define CPP_UPDATE 1 #define CPP_RENAME 2 #define CPP_OVERWRITE 3 #define CPP_NOCOPY 4 #define CPP_FORWUPDATE 5 #define CPP_FORWOVERWRITE 6 #define RMP_BIAS 2 #define RMP_REMOVEALL (RMP_BIAS + CHK_OK) #define RMP_KEEPALL (RMP_BIAS + CHK_ERROR) #define TCH_MODE 00001 #define TCH_UID 00002 #define TCH_GID 00004 #define TCH_ATIME 00010 #define TCH_MTIME 00020 #define TCH_FLAGS 00040 #define TCH_CHANGE 00100 #define TCH_MASK 00200 #define TCH_MODEEXE 00400 #define TCH_IGNOREERR 01000 #define ATR_EXCLUSIVE 3 #define ATR_MODEONLY 1 #define ATR_TIMEONLY 2 #define ATR_OWNERONLY 3 #define ATR_MULTIPLE 4 #define ATR_RECURSIVE 8 #define ORD_NODIR 0 #define ORD_NORMAL 1 #define ORD_LOWER 2 #define ORD_NOPREDIR 3 #define SRT_TYPE 0007 #define SRT_FILENAME 0001 #define SRT_EXTENSION 0002 #define SRT_SIZE 0003 #define SRT_DATE 0004 #define SRT_LENGTH 0005 #define SRT_DESC 0010 #define HST_TYPE 0007 #define HST_COMM 0000 #define HST_PATH 0001 #define HST_USER 0002 #define HST_GROUP 0003 #define HST_UNIQ 0010 #define HST_INIT 0400 #define nohist(n) ((n) != HST_COMM && (n) != HST_PATH) #define completable(n) ((n) >= 0) FD-3.01j/namelist.h100644 2105 1751 3176 13516612560 12655 0ustar shiraiuser/* * namelist.h * * definitions for listing files */ #ifndef __NAMELIST_H_ #define __NAMELIST_H_ #include "depend.h" typedef struct _namelist { char *name; u_short ent; u_short st_mode; short st_nlink; #ifndef NOUID u_id_t st_uid; g_id_t st_gid; #endif #if !defined (NOSYMLINK) && defined (DEP_LSPARSE) char *linkname; #endif #ifdef HAVEFLAGS u_long st_flags; #endif off_t st_size; time_t st_mtim; u_char flags; u_char tmpflags; } namelist; #define F_ISEXE 0001 #define F_ISWRI 0002 #define F_ISRED 0004 #define F_ISDIR 0010 #define F_ISLNK 0020 #define F_ISDEV 0040 #define F_ISMRK 0001 #define F_WSMRK 0002 #define F_ISARG 0004 #define F_STAT 0010 #define isdir(file) ((file) -> flags & F_ISDIR) #define islink(file) ((file) -> flags & F_ISLNK) #define isdev(file) ((file) -> flags & F_ISDEV) #define isfile(file) (!((file) -> flags & (F_ISDIR | F_ISDEV))) #define isread(file) ((file) -> flags & F_ISRED) #define iswrite(file) ((file) -> flags & F_ISWRI) #define isexec(file) ((file) -> flags & F_ISEXE) #define ismark(file) ((file) -> tmpflags & F_ISMRK) #define wasmark(file) ((file) -> tmpflags & F_WSMRK) #define isarg(file) ((file) -> tmpflags & F_ISARG) #define hasstat(file) ((file) -> tmpflags & F_STAT) #define s_isdir(s) ((((s) -> st_mode) & S_IFMT) == S_IFDIR) #define s_isreg(s) ((((s) -> st_mode) & S_IFMT) == S_IFREG) #define s_islnk(s) ((((s) -> st_mode) & S_IFMT) == S_IFLNK) #define s_isfifo(s) ((((s) -> st_mode) & S_IFMT) == S_IFIFO) #define s_ischr(s) ((((s) -> st_mode) & S_IFMT) == S_IFCHR) #define s_isblk(s) ((((s) -> st_mode) & S_IFMT) == S_IFBLK) #endif /* !__NAMELIST_H_ */ FD-3.01j/dosdisk.h100644 2105 1751 21100 13516612560 12504 0ustar shiraiuser/* * dosdisk.h * * definitions & function prototype declarations for "dosdisk.c" */ #include "depend.h" #include "typesize.h" #include "dirent.h" #if !MSDOS #include #endif #define DOSDIRENT 32 #define SECTCACHESIZE 32 #define SECTSIZE {512, 1024, 256, 128, 2048, 4096} #define STDSECTSIZE 512 #define SECTCACHEMEM (SECTCACHESIZE * STDSECTSIZE) #define MINCLUST 2 #define MAX12BIT (0xff0 - MINCLUST) #define DOSMAXPATHLEN 260 #define MAXFATMEM (512 * 9) /* FAT size of 3.5inch 2HD */ #define NOTINLFN "\\/:*?\"<>|" #define NOTINALIAS "+,;=[]" #define PACKINALIAS " ." #define LFNENTSIZ 13 #define DOSMAXNAMLEN 255 #define INHIBITNAME {"CON ", "AUX ", "PRN ", \ "CLOCK$ ", "CONFIG$ ", "NUL "} #define INHIBITCOM "COM" #define INHIBITCOMMAX 9 /* Windows NT will avoid COM5-COM9 */ #define INHIBITLPT "LPT" #define INHIBITLPTMAX 9 /* Windows will avoid LPT4-LPT9 */ #define MAXDRIVEENTRY 32 #define DOSFDOFFSET (1 << (8 * sizeof(int) - 2)) #ifdef NOFILE #define DOSNOFILE NOFILE #else #define DOSNOFILE 64 #endif #ifdef SYSVDIRENT #define d_fileno d_ino #endif #if (defined (i386) || defined (__i386) || defined (__i386__)) \ && (defined (SOLARIS) || defined (LINUX) \ || defined (JCCBSD) || defined (FREEBSD) \ || defined (NETBSD) || defined (BSDOS) || defined (BOW) \ || defined (OPENBSD) || defined (MINIX) || defined (ORG_386BSD)) #define HDDMOUNT #endif typedef struct _bpb_t { u_char jmpcode[3]; u_char makername[8]; u_char sectsize[2]; u_char clustsize; u_char bootsect[2]; u_char nfat; u_char maxdir[2]; u_char total[2]; u_char media; u_char fatsize[2]; u_char secttrack[2]; u_char nhead[2]; u_char hidden[4]; u_char bigtotal[4]; u_char bigfatsize[4]; u_char exflags[2]; u_char filesys[2]; u_char rootdir[4]; u_char fsinfo[4]; u_char reserved[2]; char fsname[8]; } X_attr_packed bpb_t; #define FS_FAT "FAT " #define FS_FAT12 "FAT12 " #define FS_FAT16 "FAT16 " #define FS_FAT32 "FAT32 " typedef struct _dent_t { u_char name[8]; u_char ext[3]; u_char attr; u_char reserved; u_char checksum; u_char ctime[2]; u_char cdate[2]; u_char adate[2]; u_char clust_h[2]; u_char time[2]; u_char date[2]; u_char clust[2]; u_char size[4]; } X_attr_packed dent_t; #define DS_IRDONLY 001 #define DS_IHIDDEN 002 #define DS_IFSYSTEM 004 #define DS_IFLABEL 010 #define DS_IFLFN 017 #define DS_IFDIR 020 #define DS_IARCHIVE 040 typedef struct _cache_t { char path[MAXPATHLEN]; dent_t dent; long clust; long offset; } cache_t; #if !MSDOS typedef struct _devinfo { u_char drive; char *name; u_char head; u_short sect; u_short cyl; # ifdef HDDMOUNT l_off_t offset; # endif } devinfo; # ifdef DEP_DYNAMICLIST typedef devinfo * fdtype_t; typedef CONST devinfo origfdtype_t[]; # else typedef devinfo fdtype_t[MAXDRIVEENTRY]; typedef devinfo * origfdtype_t; # endif #endif /* !MSDOS */ typedef struct _devstat { u_char drive; char *fatbuf; /* ch_name */ u_char clustsize; /* ch_head */ u_short sectsize; /* ch_sect */ u_short fatofs; /* ch_cyl */ #ifdef HDDMOUNT l_off_t offset; #endif u_long fatsize; u_long dirofs; u_short dirsize; u_long totalsize; u_long availsize; long rootdir; #if !MSDOS int fd; #endif int nlink; u_char flags; cache_t *dircache; } devstat; #define F_RONLY 0001 #define F_16BIT 0002 #define F_8SECT 0004 #define F_DUPL 0010 #define F_CACHE 0020 #define F_WRFAT 0040 #define F_LFN 0100 #define F_FAT32 0200 #define ch_name fatbuf #define ch_head clustsize #define ch_sect sectsize #define ch_cyl fatofs typedef struct _dosiobuf { long _cnt; char *_ptr; char *_base; long _bufsize; short _flag; int _file; long _top; long _next; long _off; off_t _loc; off_t _size; dent_t _dent; long _clust; long _offset; } dosFILE; #define O_IOEOF 020000 #define O_IOERR 040000 #define byte2word(p) ((p)[0] + ((u_short)(p)[1] << 8)) #define byte2dword(p) ((p)[0] + ((u_long)(p)[1] << 8) \ + ((u_long)(p)[2] << 16) \ + ((u_long)(p)[3] << 24)) #define dd2dentp(dd) (&(devlist[dd].dircache -> dent)) #define dd2path(dd) (devlist[dd].dircache -> path) #define dd2clust(dd) (devlist[dd].dircache -> clust) #define dd2offset(dd) (devlist[dd].dircache -> offset) #define fd2devp(fd) (&(devlist[dosflist[fd]._file])) #define fd2dentp(fd) (dd2dentp(dosflist[fd]._file)) #define fd2path(fd) (dd2path(dosflist[fd]._file)) #define fd2clust(fd) (dd2clust(dosflist[fd]._file)) #define fd2offset(fd) (dd2offset(dosflist[fd]._file)) #define dosfflag(p) (((dosFILE *)((VOID_P)(p))) -> _flag) #define dosfeof(p) ((dosfflag(p) & O_IOEOF) != 0) #define dosferror(p) ((dosfflag(p) & O_IOERR) != 0) #define dosclearerr(p) (dosfflag(p) &= ~(O_IOERR | O_IOEOF)) typedef struct _dosdirdesc { int dd_id; int dd_fd; long dd_loc; long dd_size; long dd_top; long dd_off; char *dd_buf; } dosDIR; #define DID_IFDOSDRIVE (-1) #ifdef HDDMOUNT typedef struct _partition_t { u_char boot; u_char s_head; u_char s_sect; u_char s_cyl; u_char filesys; u_char e_head; u_char e_sect; u_char e_cyl; u_char f_sect[4]; u_char t_sect[4]; } X_attr_packed partition_t; #define PART_SIZE ((int)sizeof(partition_t)) #define PART_TABLE 0x01be #define PART_NUM 4 #define PTAT_FAT12 0x01 #define PTAT_FAT16 0x04 #define PTAT_EXTEND 0x05 #define PTAT_FAT16X 0x06 #define PTAT_NTFS 0x07 #define PTAT_FAT32 0x0b #define PTAT_FAT32LBA 0x0c #define PTAT_FAT16XLBA 0x0e #define PTAT_EXTENDLBA 0x0f #define PTAT_LINUX 0x83 #define PTAT_386BSD 0xa5 #define PTAT_OPENBSD 0xa6 #define PTAT_NETBSD 0xa9 typedef struct _partition98_t { u_char boot; u_char filesys; u_char reserved[2]; u_char ipl_sect; u_char ipl_head; u_char ipl_cyl[2]; u_char s_sect; u_char s_head; u_char s_cyl[2]; u_char e_sect; u_char e_head; u_char e_cyl[2]; u_char name[16]; } X_attr_packed partition98_t; #define PART98_SIZE ((int)sizeof(partition98_t)) #define PART98_TABLE 0x0200 #define PART98_NUM 16 #define PT98_FAT12 0x81 /* 0x80 | 0x01 */ #define PT98_FAT16 0x91 /* 0x80 | 0x11 */ #define PT98_FREEBSD 0x94 /* 0x80 | 0x14 */ #define PT98_FAT16X 0xa1 /* 0x80 | 0x21 */ #define PT98_NTFS 0xb1 /* 0x80 | 0x31 */ #define PT98_386BSD 0xc4 /* 0x80 | 0x44 */ #define PT98_FAT32 0xe1 /* 0x80 | 0x61 */ #define PT98_LINUX 0xe2 /* 0x80 | 0x62 */ #endif /* HDDMOUNT */ #ifdef NODRECLEN #define wrap_reclen(dp) (*(u_short *)(dp)) #else #define wrap_reclen(dp) ((dp) -> d_reclen) #endif #ifdef CYGWIN /* Some versions of Cygwin have neither d_fileno nor d_ino */ struct dosdirent { u_long d_fileno; u_short d_reclen; char d_name[MAXNAMLEN + 1]; }; typedef struct dosdirent st_dosdirent; #else #define dosdirent dirent #define st_dosdirent st_dirent #endif #ifndef _NODOSDRIVE #if MSDOS extern int dependdosfunc; #else /* !MSDOS */ extern fdtype_t fdtype; extern int maxfdtype; # if defined (DEP_DYNAMICLIST) || !defined (_NOCUSTOMIZE) extern origfdtype_t origfdtype; extern int origmaxfdtype; # endif #endif /* !MSDOS */ extern int lastdrive; extern int needbavail; extern VOID_T (*doswaitfunc)__P_((VOID_A)); extern int (*dosintrfunc)__P_((VOID_A)); #ifdef HDDMOUNT extern l_off_t *readpt __P_((CONST char *, int)); #endif extern int dosopendev __P_((int)); extern VOID dosclosedev __P_((int)); extern int flushdrv __P_((int, VOID_T (*)__P_((VOID_A)))); extern DIR *dosopendir __P_((CONST char *)); extern int dosclosedir __P_((DIR *)); extern struct dosdirent *dosreaddir __P_((DIR *)); extern int dosrewinddir __P_((DIR *)); extern int doschdir __P_((CONST char *)); extern char *dosgetcwd __P_((char *, int)); #if MSDOS extern char *dosshortname __P_((CONST char *, char *)); extern char *doslongname __P_((CONST char *, char *)); #endif extern int dosstatfs __P_((int, char *)); extern int dosstat __P_((CONST char *, struct stat *)); extern int doslstat __P_((CONST char *, struct stat *)); extern int dosaccess __P_((CONST char *, int)); #ifndef NOSYMLINK extern int dossymlink __P_((CONST char *, CONST char *)); extern int dosreadlink __P_((CONST char *, char *, int)); #endif extern int doschmod __P_((CONST char *, int)); extern int dosutimes __P_((CONST char *, CONST struct utimes_t *)); extern int dosunlink __P_((CONST char *)); extern int dosrename __P_((CONST char *, CONST char *)); extern int dosopen __P_((CONST char *, int, int)); extern int dosclose __P_((int)); extern int dosread __P_((int, char *, int)); extern int doswrite __P_((int, CONST char *, int)); extern off_t doslseek __P_((int, off_t, int)); extern int dosftruncate __P_((int, off_t)); extern int dosmkdir __P_((CONST char *, int)); extern int dosrmdir __P_((CONST char *)); extern int dosflushbuf __P_((int)); extern int dosallclose __P_((VOID_A)); #endif /* !_NODOSDRIVE */ FD-3.01j/unixdisk.h100644 2105 1751 15016 13516612560 12713 0ustar shiraiuser/* * unixdisk.h * * definitions & function prototype declarations for "unixdisk.c" */ #if MSDOS && !defined __UNIXDISK_H_ #define __UNIXDISK_H_ #include "depend.h" #include "termio.h" #include "unixemu.h" #include "fsinfo.h" #ifdef DJGPP #define NOP 0x00 #define RETF 0xc3 #else #define NOP 0x90 #define RETF 0xcb #endif #define DATETIMEFORMAT 1 #define DS_IRDONLY 001 #define DS_IHIDDEN 002 #define DS_IFSYSTEM 004 #define DS_IFLABEL 010 #define DS_IFDIR 020 #define DS_IARCHIVE 040 #define SEARCHATTRS (DS_IRDONLY | DS_IHIDDEN | DS_IFSYSTEM \ | DS_IFDIR | DS_IARCHIVE) #define PSEUDOINTNO 0x80 #define MAXINTNO 0xff #define BOOTSECTSIZE 512 #define MAXSECTSIZE 4096 #define BIOSRETRY 4 #define VOL_FAT32 "FAT32" #ifdef PC98 #define DISKBIOS 0x1b #define BIOS_READ 0x06 #define BIOS_WRITE 0x05 #define BIOS_VERIFY 0x01 #define BIOS_PARAM 0x84 #define BIOS_RESET 0x03 #define BIOS_HDD 0x80 #define BIOS_SCSI 0xa0 #define BIOS_DMAERR 0x20 #define MAX_HDD 4 #define MAX_SCSI 8 #define PT_FAT12 0x81 /* 0x80 | 0x01 */ #define PT_FAT16 0x91 /* 0x80 | 0x11 */ #define PT_FREEBSD 0x94 /* 0x80 | 0x14 */ #define PT_FAT16X 0xa1 /* 0x80 | 0x21 */ #define PT_NTFS 0xb1 /* 0x80 | 0x31 */ #define PT_386BSD 0xc4 /* 0x80 | 0x44 */ #define PT_FAT32 0xe1 /* 0x80 | 0x61 */ #define PT_LINUX 0xe2 /* 0x80 | 0x62 */ #define PART_TABLE 0x0000 #define PART_NUM 16 #else /* !PC98 */ #define DISKBIOS 0x13 #define BIOS_READ 0x02 #define BIOS_WRITE 0x03 #define BIOS_VERIFY 0x04 #define BIOS_PARAM 0x08 #define BIOS_RESET 0x00 #define BIOS_TYPE 0x15 #define BIOS_XCHECK 0x41 #define BIOS_XREAD 0x42 #define BIOS_XWRITE 0x43 #define BIOS_XVERIFY 0x44 #define BIOS_XPARAM 0x48 #define BIOS_HDD 0x80 #define BIOS_DMAERR 0x09 #define DT_NODRIVE 0x00 #define DT_FLOPPY 0x01 #define DT_FLOPPY_CL 0x02 #define DT_HARDDISK 0x03 #define PT_FAT12 0x01 #define PT_FAT16 0x04 #define PT_EXTEND 0x05 #define PT_FAT16X 0x06 #define PT_NTFS 0x07 #define PT_FAT32 0x0b #define PT_FAT32LBA 0x0c #define PT_FAT16XLBA 0x0e #define PT_EXTENDLBA 0x0f #define PT_LINUX 0x83 #define PT_386BSD 0xa5 #define PT_OPENBSD 0xa6 #define PT_NETBSD 0xa9 #define PART_TABLE 0x01be #define PART_NUM 4 #endif /* !PC98 */ typedef struct _partition_t { u_char boot; #ifdef PC98 u_char filesys; u_char reserved[2]; u_char ipl_sect; u_char ipl_head; u_char ipl_cyl[2]; u_char s_sect; u_char s_head; u_char s_cyl[2]; u_char e_sect; u_char e_head; u_char e_cyl[2]; u_char name[16]; #else u_char s_head; u_char s_sect; u_char s_cyl; u_char filesys; u_char e_head; u_char e_sect; u_char e_cyl; u_char f_sect[4]; u_char t_sect[4]; #endif } X_attr_packed partition_t; #define PART_SIZE ((int)sizeof(partition_t)) typedef struct _xparam_t { u_char size[2]; u_char flags[2]; u_char cyl[4]; u_char head[4]; u_char sect[4]; u_char total[8]; u_char sectsize[2]; u_char eddparam[4]; u_char signature[2]; u_char infolen; u_char reserved[3]; u_char busname[4]; u_char interfacename[8]; u_char interfacepath[8]; u_char devicepath[8]; u_char reserved2; u_char checksum; } X_attr_packed xparam_t; #define XPARAM_SIZE ((int)sizeof(xparam_t)) typedef struct _xpacket_t { u_char size; u_char reserved; u_char nsect[2]; u_char bufptr[4]; u_char sect[8]; } X_attr_packed xpacket_t; #define XPACKET_SIZE ((int)sizeof(xpacket_t)) typedef struct _drvinfo { u_long head; u_long sect; u_long cyl; u_long secthead; u_char s_head; u_char s_sect; u_short s_cyl; #ifndef PC98 u_long f_sect; #endif u_short sectsize; u_char drv; u_char flags; u_char filesys; } drvinfo; #define DI_TYPE 0003 #define DI_NOPLOVED 0000 #define DI_FIXED 0001 #define DI_REMOVABLE 0002 #define DI_MISC 0003 #define DI_PSEUDO 0004 #define DI_CHECKED 0010 #define DI_LBA 0020 #define DI_INVALIDCHS 0040 struct dosfind_t { u_char keyattr; u_char drive; char body[8], ext[3]; char reserve[8]; u_char attr; u_short wrtime, wrdate; u_long size_l; char name[13]; } X_attr_packed; struct lfnfind_t { u_long attr; u_short crtime, crdate, crtime_h1, crtime_h2; u_short actime, acdate, actime_h1, actime_h2; u_short wrtime, wrdate, wrtime_h1, wrtime_h2; u_long size_h, size_l; u_long reserve1, reserve2; char name[MAXPATHLEN]; char alias[14]; } X_attr_packed; struct iopacket_t { u_long sect; u_short size; u_short buf_off; u_short buf_seg; } X_attr_packed; struct fat32statfs_t { u_short f_type; u_short f_version; u_long f_clustsize; u_long f_sectsize; u_long f_bavail; u_long f_blocks; u_long f_real_bavail_sect; u_long f_real_blocks_sect; u_long f_real_bavail; u_long f_real_blocks; u_char reserved[8]; } X_attr_packed; extern int getcurdrv __P_((VOID_A)); extern int setcurdrv __P_((int, int)); #ifndef _NOUSELFN extern int getdosver __P_((VOID_A)); extern int supportLFN __P_((CONST char *)); #endif extern char *unixgetcurdir __P_((char *, int)); #ifndef _NOUSELFN extern char *shortname __P_((CONST char *, char *)); #endif extern char *unixrealpath __P_((CONST char *, char *)); #ifndef BSPATHDELIM extern char *adjustpname __P_((char *)); #endif #if defined (DJGPP) || !defined (BSPATHDELIM) extern char *adjustfname __P_((char *)); #endif #ifndef _NOUSELFN extern char *preparefile __P_((CONST char *, char *)); # ifndef _NODOSDRIVE extern int checkdrive __P_((int)); extern int rawdiskio __P_((int, u_long, u_char *, int, int, int)); # endif #endif /* !_NOUSELFN */ extern DIR *unixopendir __P_((CONST char *)); extern int unixclosedir __P_((DIR *)); extern struct dirent *unixreaddir __P_((DIR *)); extern int unixrewinddir __P_((DIR *)); #ifdef _NOUSELFN #define unixunlink(p) ((unlink(p)) ? -1 : 0) #define unixrename(f, t) ((rename(f, t)) ? -1 : 0) # ifdef DJGPP # define unixmkdir(p, m) ((mkdir(p, m)) ? -1 : 0) # else extern int unixmkdir __P_((CONST char *, int)); # endif #define unixrmdir(p) ((rmdir(p)) ? -1 : 0) #define unixchdir(p) ((chdir(p)) ? -1 : 0) #else extern int unixunlink __P_((CONST char *)); extern int unixrename __P_((CONST char *, CONST char *)); extern int unixmkdir __P_((CONST char *, int)); extern int unixrmdir __P_((CONST char *)); extern int unixchdir __P_((CONST char *)); #endif extern char *unixgetcwd __P_((char *, int)); extern int unixstatfs __P_((CONST char *, statfs_t *)); extern int unixstat __P_((CONST char *, struct stat *)); extern int unixchmod __P_((CONST char *, int)); #ifdef _NOUSELFN #define unixutimes rawutimes #else /* !_NOUSELFN */ extern int unixutimes __P_((CONST char *, CONST struct utimes_t *)); extern int unixopen __P_((CONST char *, int, int)); #endif /* !_NOUSELFN */ #endif /* MSDOS && !__UNIXDISK_H_ */ FD-3.01j/unixemu.h100644 2105 1751 1350 13516612560 12523 0ustar shiraiuser/* * unixemu.h * * UNIX function emulation */ #if MSDOS && !defined (__UNIXEMU_H_) #define __UNIXEMU_H_ #ifndef DJGPP # ifndef random # define random() rand() # endif #define kill(pid, sig) ((raise(sig)) ? -1 : 0) #define SIGALRM 11 /* SIGSEGV */ #undef SIGSEGV #undef SIGTERM #undef SIGILL #endif /* !DJGPP */ typedef struct _dirdesc { int dd_id; u_short dd_fd; #if 0 long dd_loc; long dd_size; long dd_bsize; #endif long dd_off; char *dd_buf; char *dd_path; } DIR; #define DID_IFNORMAL 000 #define DID_IFLABEL 001 #define DID_IFLFN 002 struct dirent { long d_off; #ifndef _NODOSDRIVE u_long d_fileno; u_short d_reclen; #endif char d_name[MAXNAMLEN + 1]; char d_alias[14]; }; #endif /* MSDOS && !__UNIXEMU_H_ */ FD-3.01j/realpath.h100644 2105 1751 511 13516612560 12607 0ustar shiraiuser/* * realpath.h * * definitions & function prototype declarations for "realpath.c" */ #define RLP_READLINK 0001 #define RLP_PSEUDOPATH 0002 extern char *Xrealpath __P_((CONST char *, char *, int)); #ifndef NOSYMLINK extern char *symrealpath __P_((CONST char *, CONST char *, char *, int)); #endif extern int norealpath; FD-3.01j/encode.h100644 2105 1751 1205 13516612560 12265 0ustar shiraiuser/* * encode.h * * definitions & function prototype declarations for "md5.c" & "base64.c" */ #include "stream.h" #define MD5_BUFSIZ (128 / 32) #define MD5_BLOCKS 16 #define MD5_FILBUFSIZ 512 #define BASE64_ORGSIZ 3 #define BASE64_ENCSIZ 4 typedef struct _md5_t { u_long cl, ch; u_long sum[MD5_BUFSIZ]; u_long x[MD5_BLOCKS]; int n, b; } md5_t; extern VOID md5encode __P_((u_char *, ALLOC_T *, CONST u_char *, ALLOC_T)); extern int md5fencode __P_((u_char *, ALLOC_T *, XFILE *)); extern int base64encode __P_((char *, ALLOC_T, CONST u_char *, ALLOC_T)); extern int base64decode __P_((u_char *, ALLOC_T *, CONST char *, ALLOC_T)); FD-3.01j/termemu.h100644 2105 1751 4747 13516612560 12524 0ustar shiraiuser/* * termemu.h * * definitions for "termemu.c" */ #include "depend.h" #include "pathname.h" #ifdef DEP_PTY typedef struct _ptyinfo_t { p_id_t pid; char *path; int fd; int pipe; int status; #ifdef DEP_KCONV u_char incode, outcode; #endif } ptyinfo_t; #define TE_XPUTCH (K_MAX + 1) #define TE_XCPUTS (K_MAX + 2) #define TE_PUTTERM (K_MAX + 3) #define TE_PUTTERMS (K_MAX + 4) #define TE_SETSCROLL (K_MAX + 5) #define TE_LOCATE (K_MAX + 6) #define TE_CPUTNL (K_MAX + 7) #define TE_CHGCOLOR (K_MAX + 8) #define TE_MOVECURSOR (K_MAX + 9) #define TE_CHANGEWIN (K_MAX + 10) #define TE_CHANGEWSIZE (K_MAX + 11) #define TE_INSERTWIN (K_MAX + 12) #define TE_DELETEWIN (K_MAX + 13) #define TE_LOCKBACK (K_MAX + 14) #define TE_UNLOCKBACK (K_MAX + 15) #define TE_CHANGEKCODE (K_MAX + 16) #define TE_CHANGEINKCODE (K_MAX + 17) #define TE_CHANGEOUTKCODE (K_MAX + 18) #define TE_AWAKECHILD (K_MAX + 99) #define TE_SETVAR 1 #define TE_PUSHVAR 2 #define TE_POPVAR 3 #define TE_CHDIR 4 #define TE_PUTEXPORTVAR 5 #define TE_PUTSHELLVAR 6 #define TE_UNSET 7 #define TE_SETEXPORT 8 #define TE_SETRONLY 9 #define TE_SETSHFLAG 10 #define TE_ADDFUNCTION 11 #define TE_DELETEFUNCTION 12 #define TE_ADDALIAS 13 #define TE_DELETEALIAS 14 #define TE_SETHISTORY 15 #define TE_ADDKEYBIND 16 #define TE_DELETEKEYBIND 17 #define TE_SETKEYSEQ 18 #define TE_ADDLAUNCH 19 #define TE_DELETELAUNCH 20 #define TE_ADDARCH 21 #define TE_DELETEARCH 22 #define TE_INSERTDRV 23 #define TE_DELETEDRV 24 #define TE_LOCKFRONT 25 #define TE_UNLOCKFRONT 26 #define TE_SAVETTYIO 27 #define TE_ADDROMAN 28 #define TE_FREEROMAN 29 #define TE_INTERNAL 30 #define TE_CHANGESTATUS 99 extern VOID regionscroll __P_((int, int, int, int, int, int)); extern int selectpty __P_((int, int [], char [], long)); extern VOID syncptyout __P_((int, int)); extern int recvbuf __P_((int, VOID_P, int)); extern VOID sendbuf __P_((int, CONST VOID_P, int)); extern int recvword __P_((int, int *)); extern VOID sendword __P_((int, int)); extern int recvstring __P_((int, char **)); extern VOID sendstring __P_((int, CONST char *)); extern VOID sendparent __P_((int, ...)); extern int ptymacro __P_((CONST char *, CONST char *, int)); extern VOID killpty __P_((int, int *)); extern VOID killallpty __P_((VOID_A)); extern int checkpty __P_((int)); extern int checkallpty __P_((VOID_A)); extern int ptymode; extern int ptyinternal; extern char *ptyterm; extern int ptymenukey; extern ptyinfo_t ptylist[]; extern int parentfd; #endif /* DEP_PTY */ FD-3.01j/mntinfo.h100644 2105 1751 5453 13516612560 12513 0ustar shiraiuser/* * mntinfo.h * * definitions & function prototype declarations for "mntinfo.c" */ #ifndef __MNTINFO_H_ #define __MNTINFO_H_ #ifdef USEMNTENTH #include #endif #ifdef USEMNTTABH #include #endif #ifdef USEMNTCTL #include #include #include #include #endif #define ETCMTAB "/etc/mtab" #define PROCMOUNTS "/proc/mounts" #define DEVROOT "/dev/root" #define ROOTFS "rootfs" #ifdef USEMNTENTH typedef struct mntent mnt_t; #define Xmnt_fsname mnt_fsname #define Xmnt_dir mnt_dir #define Xmnt_type mnt_type #define Xmnt_opts mnt_opts #define Xsetmntent setmntent #define Xgetmntent(f, m) getmntent(f) #define Xendmntent endmntent #endif #ifdef USEMNTTABH #define MOUNTED MNTTAB typedef struct mnttab mnt_t; #define Xmnt_fsname mnt_special #define Xmnt_dir mnt_mountp #define Xmnt_type mnt_fstype #define Xmnt_opts mnt_mntopts #define Xsetmntent fopen #define Xgetmntent(f, m) (getmntent(f, m) ? NULL : m) #define Xendmntent fclose #endif #if defined (USEGETFSSTAT) || defined (USEGETVFSTAT) \ || defined (USEMNTCTL) || defined (USEMNTINFOR) || defined (USEMNTINFO) \ || defined (USEGETMNT) || defined (USEREADMTAB) typedef struct _mnt_t { CONST char *Xmnt_fsname; CONST char *Xmnt_dir; CONST char *Xmnt_type; CONST char *Xmnt_opts; } mnt_t; # ifdef USEREADMTAB # define Xendmntent fclose # else /* !USEREADMTAB */ # if defined (USEMNTINFO) || defined (USEGETMNT) # define Xendmntent(f) # else # define Xendmntent Xfree # endif # endif /* !USEREADMTAB */ #endif /* USEGETFSSTAT || USEGETVFSTAT || USEMNTCTL \ || USEMNTINFOR || USEMNTINFO || USEGETMNT || USEREADMTAB */ #ifdef USEGETFSENT typedef struct fstab mnt_t; #define Xmnt_fsname fs_spec #define Xmnt_dir fs_file #define Xmnt_type fs_vfstype #define Xmnt_opts fs_mntops #define Xsetmntent(f, m) (FILE *)setfsent() #define Xgetmntent(f, m) getfsent() #define Xendmntent(fp) endfsent() #endif #if MSDOS # ifdef DOUBLESLASH # define MNTDIRSIZ MAXPATHLEN # else # define MNTDIRSIZ (3 + 1) # endif typedef struct _mnt_t { CONST char *Xmnt_fsname; char Xmnt_dir[MNTDIRSIZ]; CONST char *Xmnt_type; CONST char *Xmnt_opts; } mnt_t; #endif /* MSDOS */ #ifdef USEPROCMNT #undef MOUNTED #define MOUNTED PROCMOUNTS #endif #ifndef MOUNTED #define MOUNTED ETCMTAB #endif #ifdef HAVEPROCMNT extern int hasmounted __P_((VOID_A)); extern char *getmounted __P_((VOID_A)); #else #define getmounted() MOUNTED #endif #if defined (USEGETFSSTAT) || defined (USEGETVFSTAT) \ || defined (USEMNTCTL) || defined (USEMNTINFOR) || defined (USEMNTINFO) \ || defined (USEGETMNT) || defined (USEREADMTAB) extern FILE *Xsetmntent __P_((CONST char *, CONST char *)); extern mnt_t *Xgetmntent __P_((FILE *, mnt_t *)); #endif extern char *Xhasmntopt __P_((mnt_t *, CONST char *)); #endif /* !__MNTINFO_H_ */ FD-3.01j/fsinfo.h100644 2105 1751 4747 13516612560 12332 0ustar shiraiuser/* * fsinfo.h * * definitions for file system information */ #ifndef __FSINFO_H_ #define __FSINFO_H_ #if (!defined (USEMOUNTH) && !defined (USEFSDATA) \ && (defined (USEGETFSSTAT) || defined (USEGETVFSTAT) \ || defined (USEMNTINFOR) || defined (USEMNTINFO))) \ || defined (USEMOUNTH) || defined (USEFSDATA) #include #endif #if defined (USEGETFSSTAT) || defined (USEGETMNT) #include #endif #ifdef USEGETFSENT #include #endif #if defined (USESTATVFSH) || defined (USEGETVFSTAT) #include #endif #ifdef USESTATFSH #include #endif #ifdef USEVFSH #include #endif #ifdef USESTATVFSH # ifdef USESTATVFS_T typedef statvfs_t statfs_t; # else typedef struct statvfs statfs_t; # endif #define Xstatfs statvfs #define blocksize(fs) ((fs).f_frsize ? (fs).f_frsize : (fs).f_bsize) #endif /* USESTATVFSH */ #ifdef USESTATFSH #define Xf_bavail f_bfree typedef struct statfs statfs_t; #define blocksize(fs) (fs).f_bsize #endif #ifdef USEVFSH typedef struct statfs statfs_t; #define blocksize(fs) (fs).f_bsize #endif #ifdef USEMOUNTH typedef struct statfs statfs_t; #define blocksize(fs) (fs).f_bsize #endif #ifdef USEFSDATA typedef struct fs_data statfs_t; #define Xf_bsize fd_req.bsize #define Xf_files fd_req.gtot #define Xf_blocks fd_req.btot #define Xf_bfree fd_req.bfree #define Xf_bavail fd_req.bfreen #define Xstatfs(p, b) (statfs(p, b) - 1) #define blocksize(fs) 1024 #endif #ifdef USEFFSIZE #define Xf_bsize f_fsize #endif #ifndef Xf_bsize #define Xf_bsize f_bsize #endif #ifndef Xf_files #define Xf_files f_files #endif #ifndef Xf_blocks #define Xf_blocks f_blocks #endif #ifndef Xf_bfree #define Xf_bfree f_bfree #endif #ifndef Xf_bavail #define Xf_bavail f_bavail #endif #if defined (USESTATFSH) || defined (USEVFSH) || defined (USEMOUNTH) # if (STATFSARGS >= 4) # define Xstatfs(p, b) statfs(p, b, sizeof(statfs_t), 0) # else /* STATFSARGS < 4 */ # if (STATFSARGS == 3) # define Xstatfs(p, b) statfs(p, b, sizeof(statfs_t)) # else /* STATFSARGS != 3 */ # ifdef USEFSTATFS extern int Xstatfs __P_((CONST char *, statfs_t *)); # else # define Xstatfs statfs # endif # endif /* STATFSARGS != 3 */ # endif /* STATFSARGS < 4 */ #endif /* USESTATFSH || USEVFSH || USEMOUNTH */ #if MSDOS typedef struct _statfs_t { long Xf_bsize; long Xf_blocks; long Xf_bfree; long Xf_bavail; long Xf_files; } statfs_t; #define Xstatfs unixstatfs #define blocksize(fs) (fs).Xf_bsize #endif #endif /* !__FSINFO_H_ */ FD-3.01j/device.h100644 2105 1751 1527 13516612560 12276 0ustar shiraiuser/* * device.h * * definitions for device ID */ #ifdef USEMKDEVH #include #else /* !USEMKDEVH */ # ifdef USEMKNODH # include # else /* !USEMKNODH */ # ifdef SVR4 # include # endif # endif /* !USEMKNODH */ #endif /* !USEMKDEVH */ #ifdef SVR4 #define BIT_MAJOR 15 #define BIT_MINOR 18 #else #define BIT_MAJOR 8 #define BIT_MINOR 8 #endif #define MASK_MAJOR (((u_long)1 << BIT_MAJOR) - 1) #define MASK_MINOR (((u_long)1 << BIT_MINOR) - 1) #ifndef major #define major(n) ((((u_long)(n)) >> BIT_MINOR) & MASK_MAJOR) #endif #ifndef minor #define minor(n) (((u_long)(n)) & MASK_MINOR) #endif #ifndef makedev #define makedev(ma, mi) (((((u_long)(ma)) & MASK_MAJOR) << BIT_MAJOR) \ | (((u_long)(mi)) & MASK_MINOR)) #endif #if MSDOS typedef short r_dev_t; #else typedef dev_t r_dev_t; #endif FD-3.01j/parse.h100644 2105 1751 3261 13516612560 12146 0ustar shiraiuser/* * parse.h * * definitions & function prototype declarations for "parse.c" */ #include "depend.h" #if defined (FD) && (FD < 2) && !defined (OLDPARSE) #define OLDPARSE #endif extern char *skipspace __P_((CONST char *)); extern char *Xsscanf __P_((CONST char *, CONST char *, ...)); extern int Xatoi __P_((CONST char *)); #if defined (FD) && !defined (DEP_ORIGSHELL) extern char *strtkchr __P_((CONST char *, int, int)); extern int getargs __P_((CONST char *, char ***)); extern char *gettoken __P_((CONST char *)); extern char *getenvval __P_((int *, char *CONST [])); extern char *evalcomstr __P_((CONST char *, CONST char *)); #endif extern char *evalpaths __P_((CONST char *, int)); #if MSDOS && defined (FD) && !defined (DEP_ORIGSHELL) #define killmeta(s) Xstrdup(s) #else extern char *killmeta __P_((CONST char *)); #endif #if defined (FD) && !defined (DEP_ORIGSHELL) extern VOID adjustpath __P_((VOID_A)); #endif #ifdef FD extern char *includepath __P_((CONST char *, CONST char *)); #endif #if defined (OLDPARSE) && !defined (_NOARCHIVE) extern char *getrange __P_((CONST char *, int, u_char *, u_char *, u_char *)); #endif extern int getprintable __P_((char *, ALLOC_T, CONST char *, ALLOC_T, int *)); extern int evalprompt __P_((char **, CONST char *)); #if defined (FD) && !defined (_NOARCHIVE) extern char *getext __P_((CONST char *, u_char *)); extern int extcmp __P_((CONST char *, int, CONST char *, int, int)); #endif #ifdef FD extern int getkeycode __P_((CONST char *, int)); #endif extern CONST char *getkeysym __P_((int, int)); extern char *decodestr __P_((CONST char *, u_char *, int)); #if defined (FD) && !defined (_NOKEYMAP) extern char *encodestr __P_((CONST char *, int)); #endif FD-3.01j/FAQ100644 2105 1751 101772 13516612560 11263 0ustar shiraiuser[FDclone3 $B$K4X$9$k(B Q&A $B=8(B] <1.UNIX $B0MB8$NOC(B> Q1-01. $BD9$$%U%!%$%kL>$,:G8e$^$GI=<($5$l$J$$$N$G$9$,!)(B A1-01. $B%G%U%)%k%H$N%-!<3dEv$F$G$*;H$$$N>l9g!"(B[(],[)] $B$N%-!<(B $B$G%U%!%$%kL>$NI=<(ItJ,$r>/$7$:$D$:$i$7$F$$$/$3$H$,$G(B $B$-$^$9!#$*L\Ev$F$N%U%!%$%k$K%+!<%=%k$r9g$o$;!"(B[)] $B$r(B $B2?EY$+2!$7$F$$$1$P!":G8e$^$GI=<($5$l$k$G$7$g$&!#(B Q1-02. FDclone $B$r=*N;$7$?8e$K!"I,$:5/F0;~$N%G%#%l%/%H%j$KLa(B $B$5$l$F$7$^$&$N$G$9$,!"2?$H$+$J$i$J$$$G$7$g$&$+!)(B A1-02. UNIX $B$H$$$&(B OS $B$G$O!"%+%l%s%H%G%#%l%/%H%j$H$$$&35G0(B $B$O%W%m%;%9Kh$KJL8D$K;}$C$F$$$F!"FC$K;R%W%m%;%9$G$NJQ(B $B99$r?F%W%m%;%9$KH?1G$5$;$kINEK!$H$7$F$O!"%7%'%k$+$i$N5/F0;~$K!V(Bcd `fd`$B!W$N(B $B$h$&$J7A$G5/F0$9$k$3$H$K$h$j!"=*N;8e$N%+%l%s%H%G%#%l(B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3!<%I%U%#%k%?$b4v$D$+(B $BB8:_$7$^$9!#$3$l$i$rMQ$$$F!"FbItJQ?t(B ($B$^$?$O4D6-JQ?t(B) PAGER $B$K(B "nkf %C | less" $B$J$I$H@_Dj$7$F$*$/$N$b$^$?(B $B0l$D$Nl9g1&%7%U%H$N>e(B) $B$N%-(B $B!<%H%C%W$K(B Enter $B$H9o0u$N$"$k$b$N$b$"$j$^$9$,!"$3$3(B $B$G8@$&(B Enter $B%-!<$H$O$3$l$H$O0[$J$j!"0lIt$N%-!<%\!<(B $B%I$KMQ0U$5$l$F$$$kFCe$3$N:.F1$,@8$8$?$3$H$,!"$3$N;Y>c$N856'(B $B$@$H;W$o$l$^$9!#(B Q3-14. BSD on Windows 1.5 $B$G%3%s%Q%$%k$7$?$N$K!"(BFreeBSD $B$@(B $B$H8+$J$5$l$F$7$^$C$F!"4A;z%3!<%I$,(B Shift JIS $B$G$O$J(B $B$/(B EUC $B4A;z$K$J$C$F$7$^$$$^$7$?!#(B A3-14. BSD on Windows 1.5 $B$N%$%s%9%H!<%i$K;Y>c$,$"$j!"%W%j(B $B%G%U%!%$%s$5$l$k$Y$-<1JL;R$,Dj5A$5$l$F$$$J$$$N$,860x(B $B$G$9!#(B $B0J2<$N%U%!%$%k$r%3%T!<$7$F2<$5$$!#(B $B%3%T!<85(B:("X" $B$O(B BOW CD-ROM $B$N$"$k%I%i%$%VL>(B) /dfs/X/usr/local/lib/gcc-lib/i386--freebsd/2.6/specs $B%3%T!<@h(B: /usr/local/lib/gcc-lib/i386--freebsd/2.6.2/specs Q3-15. $B%P%$%J%jHRI[$N(B FDclone $B$rF~l9g!"%?%$%H%k9T$N%P!<%8%g%sI=(B $B<($N8e$m$K(B '#' $B$NJ8;z$,$D$$$F$$$k$O$:$G$9!#$3$NI=<((B $B$N$J$$%P%$%J%j$K$D$$$F$O:nZ$7$^$;$s!#(B $B$3$NI=<($N$"$k%P%$%J%j$G$O!"%X%k%W2hLL$N%U%!%s%/%7%g(B $B%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B2<$5$$!#(B #define NOTUSEBIOS Q3-20. MS-DOS $B$G(B Long File Name $B$r;H$$$?$/$"$j$^$;$s!#$I$&(B $B$7$?$iNI$$$G$7$g$&!)(B A3-20. $B;XDj%G%#%l%/%H%jL>$N%I%i%$%VL>$H$7$F!"(B"C:\" $B$N$h$&$K(B $BBgJ8;z$rMQ$$$l$P6/@)E*$K(B Short File Name $B$r;H$&$h$&(B $B$K$J$j$^$9!#(B $B$b$7$/$O!"(BOS $B$N%P!<%8%g%s$r56$C$F!"(BOS $B$,(B LFN $B$KBP1~(B $B$7$?(B MS-DOS 7.0 (Windows95 $B$KIUB0$N(B MS-DOS) $B$h$jA0$N(B $B$b$N$G$"$k$h$&$K8+$;$+$1$k$N$b0l$D$Ne$G!"(BOS $B$r0lC6:F5/F0$7$J$$$HM-8z$K$J$j$^$;(B $B$s$N$GCm0U$7$F2<$5$$!#(B DEVICE=[drive:][path]SETVER.EXE Q3-21. PC-UNIX $B$G(B MS-DOS $B%U%!%$%k%7%9%F%`$r(B mount $B$7$F;H$C(B $B$F$$$^$9$,!"%U%m%C%T!<%I%i%$%V$G8+$?FbMF$H0lCW$7$^$;(B $B$s!#(B A3-21. $B0lHL$K!"C10l$N%a%G%#%"$rJ#?t$Ne$GF1;~$KMxMQ$7$?$$$H$$$&>l9g$O!"$3$NJU(B $B$j$N>u67$N>\:Y$K$D$$$F(B TECHKNOW $B$N9`L\(B 9 $B$K=q$$$F$"(B $B$j$^$9$N$G;2>H$7$F2<$5$$!#(B Q3-22. Solaris $B$G%U%m%C%T!<%I%i%$%V$r;H$*$&$H$9$k$H!V(BDevice busy.$B!W$HI=<($5$l$F%"%/%;%9$G$-$^$;$s!#(B A3-22. vold (Volume Management daemon) $B$,F0$$$F$$$^$;$s$+!)(B $B$3$N%G!<%b%s$,<+F0E*$K%U%m%C%T!<%G%P%$%9$r;H$C$F$7$^(B $B$&$?$a!"(BFDclone $B$,;H$*$&$H;W$C$F$b4{$K;HMQCf$G%"%/%;(B $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O$:$G$9!#(B (Ver. 2.04 $B0J9_$O$3$N5-=R$,$J$/$H$b<+F0E*$K(B PWD $B$N;X(B $B$9O@M}%G%#%l%/%H%jL>$r;2>H$7$^$9!#(B) $B$J$*!"3F$5$l$?(B csh $B0J9_$OO@M}%G%#%l%/%H%j$r07$&$3$H$,2DG=$G!"$=$NCM(B $B$r4D6-JQ?t(B PWD $B$H$7$F(B export $B$7$F$$$^$9!#(B <5.$B$=$NB>(B> Q5-01. $B%=!<%9$r<:$C$F$7$^$$$^$7$?!#(B A5-01. $B8=:_2<5-$N(B URL $B$KCV$+$l$F$$$k$3$H$,3NG'$5$l$F$$$^$9!#(B $B$=$A$i$+$iF~e$,!"F1:-$N%I%-%e%a%s%H$K5-:\$5$l$F$$(B $B$k$3$H$G!"$7$+$b$=$N$&$A$N$[$H$s$I$,!"$3$N(B FAQ $B$K$"(B $B$k$H$*$j$N?M$KJ9$/$3$H$O0-$$$3$H$G$O$"$j$^$;$s(B $B$,!"$G$-$k8B$j$N$3$H$O<+J,$G$d$k$H$$$&$N$,(B Internet $B$r;Y$($k8_=u@:?@$G$9!#(B $Be$G!"$I$&$7$F$b$o$+$i$J$$$3$H$,(B $B$"$k>l9g$O!"1sN8$J$/Ld$$9g$o$;$N(B mail $B$rAw$C$F2<$5$$!#(B FD-3.01j/lsparse.h100644 2105 1751 4116 13516612560 12505 0ustar shiraiuser/* * lsparse.h * * definitions & function prototype declarations for "lsparse.c" */ #ifndef __LSPARSE_H_ #define __LSPARSE_H_ #include "typesize.h" #include "namelist.h" #if defined (FD) && (FD < 2) && !defined (OLDPARSE) #define OLDPARSE #endif #define MAXLSPARSEFIELD 9 #define MAXLSPARSESEP 3 typedef struct _lsparse_t { char *ext; char *comm; #ifndef OLDPARSE char **format; char **lignore; char **lerror; #endif u_char topskip; u_char bottomskip; #ifdef OLDPARSE u_char field[MAXLSPARSEFIELD]; u_char delim[MAXLSPARSEFIELD]; u_char width[MAXLSPARSEFIELD]; u_char sep[MAXLSPARSESEP]; u_char lines; #endif u_char flags; } lsparse_t; #define F_MODE 0 #define F_UID 1 #define F_GID 2 #define F_SIZE 3 #define F_YEAR 4 #define F_MON 5 #define F_DAY 6 #define F_TIME 7 #define F_NAME 8 #define LF_IGNORECASE 0001 #define LF_DIRLOOP 0002 #define LF_DIRNOPREP 0004 #define LF_FILELOOP 0010 #define LF_FILENOPREP 0020 #define LF_NOTRAVERSE 0040 #define LF_BASENAME 0100 #define SKP_NONE MAXUTYPE(u_char) #define FLD_NONE MAXUTYPE(u_char) #define SEP_NONE MAXUTYPE(u_char) extern u_int getfmode __P_((int)); extern int getfsymbol __P_((u_int)); #ifdef NOUID extern int logical_access __P_((u_int)); #define logical_access2(s) logical_access((u_int)((s) -> st_mode)) #else extern int logical_access __P_((u_int, u_id_t, g_id_t)); #define logical_access2(s) logical_access((u_int)((s) -> st_mode), \ (s) -> st_uid, (s) -> st_gid) #endif #ifdef DEP_LSPARSE extern VOID initlist __P_((namelist *, CONST char *)); extern VOID todirlist __P_((namelist *, u_int)); extern int dirmatchlen __P_((CONST char *, CONST char *)); extern int parsefilelist __P_((VOID_P, CONST lsparse_t *, namelist *, int *, char *(*)__P_((VOID_P)))); extern namelist *addlist __P_((namelist *, int, int *)); extern VOID freelist __P_((namelist *, int)); extern int lsparse __P_((VOID_P, CONST lsparse_t *, namelist **, char *(*)__P_((VOID_P)))); extern int Xstrptime __P_((CONST char *, CONST char *, struct tm *, int *)); #endif extern int (*lsintrfunc)__P_((VOID_A)); #endif /* !__LSPARSE_H_ */ FD-3.01j/socket.h100644 2105 1751 3006 13516612560 12321 0ustar shiraiuser/* * socket.h * * definitions & function prototype declarations for "socket.c" */ #ifndef __SOCKET_H_ #define __SOCKET_H_ #include "depend.h" #if !MSDOS #include #endif #ifdef USESOCKLEN #define sock_len_t socklen_t #else typedef int sock_len_t; #endif #ifndef SHUT_RD #define SHUT_RD 0 #endif #ifndef SHUT_WR #define SHUT_WR 1 #endif #ifndef SHUT_RDWR #define SHUT_RDWR 2 #endif #define SCK_BACKLOG 5 #define SCK_ADDRSIZE (3 * 4 + 3) #define TELNET_IAC 255 #define TELNET_DONT 254 #define TELNET_DO 253 #define TELNET_WONT 252 #define TELNET_WILL 251 #define TELNET_IP 244 #define TELNET_DM 242 typedef struct _sockdirdesc { int dd_id; int dd_fd; long dd_loc; long dd_size; } sockDIR; #define SID_IFURLDRIVE (-2) #define SCK_TOSTYPE 0007 #define SCK_LOWDELAY 0001 #define SCK_THROUGHPUT 0002 #define SCK_RELIABILITY 0003 #define SCK_MINCOST 0004 #define SCK_NORMAL 0005 #define SCK_KEEPALIVE 0010 #define SCK_REUSEADDR 0020 extern int cmpsockport __P_((CONST char *, CONST char *)); extern int cmpsockaddr __P_((CONST char *, CONST char *)); extern int issocket __P_((int)); extern int getsockinfo __P_((int, char *, ALLOC_T, int *, int)); extern int chgsockopt __P_((int, int)); extern int sockconnect __P_((CONST char *, int, int, int)); extern int sockbind __P_((CONST char *, int, int)); extern int sockreply __P_((int, int, u_char *, ALLOC_T, int)); extern int sockaccept __P_((int, int)); extern int socksendoob __P_((int, CONST VOID_P, ALLOC_T)); #endif /* !__SOCKET_H_ */ FD-3.01j/url.h100644 2105 1751 2613 13516612560 11636 0ustar shiraiuser/* * url.h * * definitions & function prototype declarations for "url.c" */ #ifndef __URL_H_ #define __URL_H_ #define URL_UNSAFE 0001 #define URL_UNSAFEUSER 0011 #define URL_UNSAFEHOST 0021 #define URL_UNSAFEPATH 0041 #define UPF_ALLOWNONURL 0001 #define UPF_ALLOWABSPATH 0002 #define UPF_ALLOWANYSCHEME 0004 typedef struct _scheme_t { CONST char *ident; int len; int port; int type; } scheme_t; #define SCHEME_FTP "ftp" #define SCHEME_HTTP "http" #define SCHEME_SYMBOLCHAR "+-." /* RFC1738 */ #define TYPE_UNKNOWN 0 #define TYPE_FTP 1 #define TYPE_HTTP 2 #define TYPE_NONURL (-1) typedef struct _urlhost_t { char *user; char *pass; char *host; int port; } urlhost_t; typedef struct _urlpath_t { char *path; char *params; char *query; char *fragment; } urlpath_t; typedef struct _url_t { char *host; char *path; int type; } url_t; #if defined (DEP_URLPATH) || defined (DEP_SOCKREDIR) extern char *urldecode __P_((CONST char *, int)); extern char *urlencode __P_((CONST char *, int, int)); extern int urlparse __P_((CONST char *, scheme_t *, char **, int *, int)); extern int urlgetport __P_((int)); extern CONST char *urlgetscheme __P_((int)); extern int isurl __P_((CONST char *, int)); extern VOID urlfreehost __P_((urlhost_t *)); extern int urlgethost __P_((CONST char *, urlhost_t *)); extern int urlgetpath __P_((CONST char *, urlpath_t *)); #endif #endif /* !__URL_H_ */ FD-3.01j/auth.h100644 2105 1751 1110 13516612560 11764 0ustar shiraiuser/* * auth.h * * definitions & function prototype declarations for "auth.c" */ #include "url.h" #ifndef __AUTH_H_ #define __AUTH_H_ #define AUTHNOFILE 16 #define AUTHBASIC "Basic" #define AUTHDIGEST "Digest" typedef struct _auth_t { urlhost_t host; int type; int nlink; } auth_t; char *authgetuser __P_((VOID_A)); char *authgetpass __P_((VOID_A)); int authfind __P_((urlhost_t *, int, int)); VOID authentry __P_((urlhost_t *, int)); VOID authfree __P_((VOID_A)); char *authencode __P_((urlhost_t *, CONST char *, CONST char *, CONST char *)); #endif /* !__AUTH_H_ */ FD-3.01j/html.h100644 2105 1751 1530 13516612560 11775 0ustar shiraiuser/* * html.h * * definitions & function prototype declarations for "html.c" */ #include "stream.h" typedef struct _htmlstat_t { XFILE *fp; char *buf; char *path; ALLOC_T ptr; ALLOC_T len; ALLOC_T max; int charset; int flags; } htmlstat_t; #define HTML_LVL 00007 #define HTML_NONE 00000 #define HTML_HTML 00001 #define HTML_HEAD 00002 #define HTML_BODY 00003 #define HTML_PRE 00004 #define HTML_TAG 00010 #define HTML_CLOSE 00020 #define HTML_COMMENT 00040 #define HTML_BREAK 00100 #define HTML_NEWLINE 00200 #define HTML_ANCHOR 00400 #define htmllvl(h) (((hp) -> flags) & HTML_LVL) extern VOID htmllog __P_((CONST char *, ...)); extern int getcharset __P_((char *CONST *)); extern VOID htmlinit __P_((htmlstat_t *, XFILE *, CONST char *)); extern VOID htmlfree __P_((htmlstat_t *)); extern char *htmlfgets __P_((htmlstat_t *)); FD-3.01j/urldisk.h100644 2105 1751 14716 13516612560 12540 0ustar shiraiuser/* * urldisk.h * * definitions & function prototype declarations for "urldisk.c" */ #include "dirent.h" #include "stream.h" #include "namelist.h" #include "url.h" #include "auth.h" #define URLNOFILE 16 #define URLMAXCMDLINE 255 #define URLENDTIMEOUT 2 #define FTPANONUSER "anonymous" #define FTPANONPASS "@" #define lazyproxy(uh) (urlhostlist[uh].prototype == TYPE_HTTP \ && urlhostlist[uh].type == TYPE_FTP \ && urlhostlist[uh].http \ && !((urlhostlist[uh].http) -> server) \ && (urlhostlist[uh].http) -> version < 101) typedef struct _httpstat_t { char cwd[MAXPATHLEN]; int version; off_t clength; time_t mtim; char *server; url_t location; char *digest; int charset; int chunk; int flags; } httpstat_t; #define HFL_CLENGTH 000001 #define HFL_MTIME 000002 #define HFL_LOCATION 000004 #define HFL_DISCONNECT 000010 #define HFL_AUTHED 000020 #define HFL_PROXYAUTHED 000040 #define HFL_CHUNKED 000100 #define HFL_OTHERHOST 000200 #define HFL_BODYLESS 000400 typedef struct _urldev_t { XFILE *fp; urlhost_t host; urlhost_t proxy; int type; int prototype; #ifdef DEP_HTTPPATH httpstat_t *http; char *redirect; #endif int nlink; int options; int flags; } urldev_t; #define UOP_NOPASV 000001 #define UOP_NOPORT 000002 #define UOP_NOMDTM 000004 #define UOP_NOFEAT 000010 #define UOP_FULLSTAT 000020 #define UOP_NOLISTOPT 000040 #define UOP_USENLST 000100 #define UOP_NOSIZE 000200 #define UFL_LOCKED 000001 #define UFL_INTRED 000002 #define UFL_CLOSED 000004 #define UFL_PROXIED 000010 #define UFL_RETRYPASV 000100 #define UFL_RETRYPORT 000200 #define UFL_FIXLISTOPT 000400 typedef struct _urlstat_t { namelist *list; int max; int uh; int nlink; char *path; int flags; } urlstat_t; #define UFL_FULLLIST 000001 #define UGP_SCHEME 000001 #define UGP_USER 000002 #define UGP_PASS 000004 #define UGP_HOST 000010 #define UGP_CWD 000020 #define UGP_ANON 000100 #define UGP_ENCODE 000200 extern VOID urlfreestatlist __P_((int)); extern int urlferror __P_((XFILE *)); extern int urlgetreply __P_((int, char **)); extern int urlcommand __P_((int, char **, int, ...)); extern int urlnewstatlist __P_((int, namelist *, int, CONST char *)); extern int urlrecvlist __P_((int *, CONST char *, int)); extern CONST char *urlsplitpath __P_((char *, ALLOC_T, CONST char *)); extern int urlrecvstatus __P_((int *, CONST char *, namelist *, int *, int)); extern int urltracelink __P_((int *, CONST char *, namelist *, int *)); extern int urlreconnect __P_((int)); extern int urlopendev __P_((CONST char *, int)); extern VOID urlclosedev __P_((int)); extern int urlgenpath __P_((int, char *, ALLOC_T, int)); extern int urlchdir __P_((int, CONST char *)); extern char *urlgetcwd __P_((int, char *, ALLOC_T)); extern DIR *urlopendir __P_((CONST char *, int, CONST char *)); extern int urlclosedir __P_((DIR *)); extern struct dirent *urlreaddir __P_((DIR *)); extern VOID urlrewinddir __P_((DIR *)); extern int urlstat __P_((CONST char *, int, CONST char *, struct stat *)); extern int urllstat __P_((CONST char *, int, CONST char *, struct stat *)); extern int urlaccess __P_((CONST char *, int, CONST char *, int)); extern int urlreadlink __P_((CONST char *, int, CONST char *, char *, int)); extern int urlchmod __P_((CONST char *, int, CONST char *, int)); extern int urlunlink __P_((CONST char *, int, CONST char *)); extern int urlrename __P_((CONST char *, int, CONST char *, CONST char *)); extern VOID urlputopenlist __P_((int, int, CONST char *, int)); extern int urldelopenlist __P_((int)); extern int urlopen __P_((CONST char *, int, CONST char *, int)); extern int urlclose __P_((int)); extern int urlfstat __P_((int, struct stat *)); extern int urlselect __P_((int)); extern int urlread __P_((int, char *, int)); extern int urlwrite __P_((int, CONST char *, int)); extern int urldup2 __P_((int, int)); extern int urlmkdir __P_((CONST char *, int, CONST char *)); extern int urlrmdir __P_((CONST char *, int, CONST char *)); extern int urlallclose __P_((VOID_A)); #ifdef DEP_FTPPATH extern int ftpgetreply __P_((XFILE *, char **)); extern int ftpseterrno __P_((int)); extern int vftpcommand __P_((int, char **, int, va_list)); extern int ftpquit __P_((int)); extern int ftpabort __P_((int)); extern int ftplogin __P_((int)); extern int ftprecvlist __P_((int, CONST char *, namelist **)); extern int ftprecvstatus __P_((int, CONST char *, namelist *, int, int)); extern int ftpchdir __P_((int, CONST char *)); extern char *ftpgetcwd __P_((int, char *, ALLOC_T)); extern int ftpchmod __P_((int, CONST char *, int)); extern int ftpunlink __P_((int, CONST char *)); extern int ftprename __P_((int, CONST char *, CONST char *)); extern int ftpopen __P_((int, CONST char *, int)); extern int ftpclose __P_((int, int)); extern int ftpfstat __P_((int, struct stat *)); extern int ftpread __P_((int, int, char *, int)); extern int ftpwrite __P_((int, int, CONST char *, int)); extern int ftpmkdir __P_((int, CONST char *)); extern int ftprmdir __P_((int, CONST char *)); #endif /* DEP_FTPPATH */ #ifdef DEP_HTTPPATH extern VOID httpreset __P_((int, int)); extern int httpgetreply __P_((int, char **)); extern int httpseterrno __P_((int)); extern int vhttpcommand __P_((int, char **, int, va_list)); extern int httprecvlist __P_((int, CONST char *, namelist **)); extern int httprecvstatus __P_((int, CONST char *, namelist *, int, int *)); extern int httpchdir __P_((int, CONST char *)); extern char *httpgetcwd __P_((int, char *, ALLOC_T)); extern int httpchmod __P_((int, CONST char *, int)); extern int httpunlink __P_((int, CONST char *)); extern int httprename __P_((int, CONST char *, CONST char *)); extern int httpopen __P_((int, CONST char *, int)); extern int httpclose __P_((int, int)); extern int httpfstat __P_((int, struct stat *)); extern int httpread __P_((int, int, char *, int)); extern int httpwrite __P_((int, int, CONST char *, int)); extern int httpmkdir __P_((int, CONST char *)); extern int httprmdir __P_((int, CONST char *)); extern int httpreopen __P_((int, int)); extern int httprerecvlist __P_((int *, namelist **)); extern int httprerecvstatus __P_((int *, namelist *, int *)); #endif /* DEP_HTTPPATH */ extern int urloptions; extern int urltimeout; extern int urlkcode; extern urldev_t urlhostlist[]; extern int maxurlhost; extern urlstat_t *urlstatlist; extern int maxurlstat; extern char *logheader; #ifdef DEP_FTPPATH extern char *ftpaddress; extern char *ftpproxy; extern char *ftplogfile; #endif #ifdef DEP_HTTPPATH extern char *httpproxy; extern char *httplogfile; extern char *htmllogfile; #endif FD-3.01j/catalog.h100644 2105 1751 1721 13516612560 12445 0ustar shiraiuser/* * catalog.h * * function prototype declarations for "catalog.c" */ #include "depend.h" #ifdef _NOCATALOG # ifdef _NOENGMES # define mesconv2(n, jpn, eng) (jpn) # define meslist(n, jpn, eng) jpn # else /* !_NOENGMES */ # ifdef _NOJPNMES # define mesconv2(n, jpn, eng) (eng) # define meslist(n, jpn, eng) eng # else # define mesconv2(n, jpn, eng) mesconv(jpn, eng) # define meslist(n, jpn, eng) jpn, eng # endif # endif /* !_NOENGMES */ #else /* !_NOCATALOG */ #define mesconv2(n, jpn, eng) mesconv(n) #define meslist(n, jpn, eng) (n) #endif /* !_NOCATALOG */ #ifdef _NOCATALOG # if !defined (_NOENGMES) && !defined (_NOJPNMES) extern CONST char *mesconv __P_((CONST char *, CONST char *)); # endif #else /* !_NOCATALOG */ extern VOID freecatalog __P_((VOID_A)); extern char **listcatalog __P_((VOID_A)); extern int chkcatalog __P_((VOID_A)); extern CONST char *mesconv __P_((int)); extern char *cattblpath; extern CONST char *catname; #endif /* !_NOCATALOG */ FD-3.01j/evalopt.h100644 2105 1751 645 13516612560 12471 0ustar shiraiuser/* * evalopt.h * * definitions & function prototype declarations for "evalopt.c" */ #ifndef __EVALOPT_H_ #define __EVALOPT_H_ typedef struct _opt_t { int opt; int *var; int val; CONST char *argval; } opt_t; extern VOID initopt __P_((CONST opt_t *)); extern VOID optusage __P_((CONST char *, CONST char*, CONST opt_t *)); extern int evalopt __P_((int, char *CONST *, CONST opt_t *)); #endif /* __EVALOPT_H_ */ FD-3.01j/gentbl.h100644 2105 1751 1137 13516612560 12307 0ustar shiraiuser/* * gentbl.h * * definitions & function prototype declarations for "gentbl.c" */ #ifndef __GENTBL_H_ #define __GENTBL_H_ extern FILE *opentbl __P_((CONST char *)); extern int fputheader __P_((CONST char *, FILE *)); extern int fputbegin __P_((CONST char *, FILE *)); extern int fputend __P_((FILE *)); extern int fputbyte __P_((int, FILE *)); extern int fputword __P_((u_int, FILE *)); extern int fputdword __P_((long, FILE *)); extern int fputbuf __P_((CONST u_char *, ALLOC_T, FILE *)); extern int fputlength __P_((CONST char *, long, FILE *, int)); extern int textmode; #endif /* __GENTBL_H_ */ FD-3.01j/kconv.h100644 2105 1751 4236 13516612560 12157 0ustar shiraiuser/* * kconv.h * * definitions & function prototype declarations for "kconv.c" */ #include "depend.h" #define CVP_NEEDFILE 0001 #define CVP_READLINK 0002 extern int onkanji1 __P_((CONST char *, int)); #if !defined (_NOKANJICONV) \ || (!defined (_NOENGMES) && !defined (_NOJPNMES)) extern int getlang __P_((CONST char *, int)); #endif #if !defined (_NOKANJICONV) || (defined (DEP_DOSEMU) && defined (CODEEUC)) extern int sjis2ujis __P_((char *, CONST u_char *, int)); extern int ujis2sjis __P_((char *, CONST u_char *, int)); #endif #ifdef DEP_UNICODE # ifndef DEP_EMBEDUNITBL extern VOID readunitable __P_((int)); extern VOID discardunitable __P_((VOID_A)); # endif extern u_int unifysjis __P_((u_int, int)); extern u_int cnvunicode __P_((u_int, int)); #endif /* DEP_UNICODE */ #ifndef _NOKANJICONV # ifdef DEP_UNICODE extern int ucs2normalization __P_((u_short *, int *, int, u_int, int)); extern u_int ucs2denormalization __P_((CONST u_short *, int *, int, int)); extern int ucs2toutf8 __P_((char *, int, u_int)); extern u_int ucs2fromutf8 __P_((CONST u_char *, int *)); # endif extern int kanjiconv __P_((char *, CONST char *, int, int, int, int)); extern CONST char *kanjiconv2 __P_((char *, CONST char *, int, int, int, int)); extern char *newkanjiconv __P_((CONST char *, int, int, int)); extern VOID renewkanjiconv __P_((char **, int, int, int)); #endif /* !_NOKANJICONV */ #if defined (FD) && !defined (_NOKANJIFCONV) extern int getkcode __P_((CONST char *)); #endif #ifndef _NOKANJICONV extern int getoutputkcode __P_((VOID_A)); #endif #ifdef FD extern char *convget __P_((char *, char *, int)); extern char *convput __P_((char *, CONST char *, char *, int)); #endif #ifdef FD extern int noconv; #endif #ifndef _NOKANJIFCONV extern int nokanjifconv; extern char *sjispath; extern char *eucpath; extern char *jis7path; extern char *jis8path; extern char *junetpath; extern char *ojis7path; extern char *ojis8path; extern char *ojunetpath; extern char *hexpath; extern char *cappath; extern char *utf8path; extern char *utf8macpath; extern char *utf8iconvpath; extern char *noconvpath; #endif /* !_NOKANJIFCONV */ #ifdef DEP_UNICODE extern char *unitblpath; extern int unicodebuffer; #endif FD-3.01j/roman.h100644 2105 1751 1472 13516612560 12152 0ustar shiraiuser/* * roman.h * * definitions & function prototype declarations for "roman.c" */ #define R_MAXROMAN 4 #define R_MAXKANA 2 #define J_MIN 0x2121 #define J_MAX 0x7e7e #define J_CHO 0x213c #define J_TSU 0x2443 #define J_NN 0x2473 #define VALIDJIS(c) (iseuc((((c) >> 8) & 0xff) ^ 0x80) \ && iseuc(((c) & 0xff) ^ 0x80)) typedef struct _romantable { char str[R_MAXROMAN + 1]; ALLOC_T len; u_short code[R_MAXKANA]; } romantable; extern int code2kanji __P_((char *, u_int)); extern int searchroman __P_((CONST char *, int)); extern VOID initroman __P_((VOID_A)); extern int jis2str __P_((char *, u_int)); extern int str2jis __P_((u_short *, int, CONST char *)); extern int addroman __P_((CONST char *, CONST char *)); extern VOID freeroman __P_((int)); extern romantable *romanlist; extern int maxromanlist; FD-3.01j/hinsi.h100644 2105 1751 27426 13516612560 12177 0ustar shiraiuser/* * hinsi.h * * definitions for Hinsi grammar */ #define HN_MIN 0 #define HN_SENTOU 0 #define HN_SUUJI 1 #define HN_KANA 2 #define HN_EISUU 3 #define HN_KIGOU 4 #define HN_HEIKAKKO 5 #define HN_FUZOKUGO 6 #define HN_KAIKAKKO 7 #define HN_GIJI 8 #define HN_MEISHI 9 #define HN_JINMEI 10 #define HN_CHIMEI 11 #define HN_JINCHI 12 #define HN_KOYUU 13 #define HN_SUUSHI 14 #define HN_KA5DOU 15 #define HN_GA5DOU 16 #define HN_SA5DOU 17 #define HN_TA5DOU 18 #define HN_NA5DOU 19 #define HN_BA5DOU 20 #define HN_MA5DOU 21 #define HN_RA5DOU 22 #define HN_WA5DOU 23 #define HN_1DOU 24 #define HN_SAHDOU 25 #define HN_ZAHDOU 26 #define HN_KA5YOU 27 #define HN_GA5YOU 28 #define HN_SA5YOU 29 #define HN_TA5YOU 30 #define HN_NA5YOU 31 #define HN_BA5YOU 32 #define HN_MA5YOU 33 #define HN_RA5YOU 34 #define HN_WA5YOU 35 #define HN_1YOU 36 #define HN_SAHYOU 37 #define HN_ZAHYOU 38 #define HN_KA5DAN 39 #define HN_GA5DAN 40 #define HN_SA5DAN 41 #define HN_TA5DAN 42 #define HN_NA5DAN 43 #define HN_BA5DAN 44 #define HN_MA5DAN 45 #define HN_RA5DAN 46 #define HN_WA5DAN 47 #define HN_1DAN 48 #define HN_1_MEI 49 #define HN_KA_IKU 50 #define HN_KO_KO 51 #define HN_KI_KI 52 #define HN_KU_KU 53 #define HN_SAHEN 54 #define HN_ZAHEN 55 #define HN_SA_MEI 56 #define HN_SI_SI 57 #define HN_SU_SU 58 #define HN_SE_SE 59 #define HN_RA_KUD 60 #define HN_KEIYOU 61 #define HN_KEIDOU 62 #define HN_KD_MEI 63 #define HN_KD_TAR 64 #define HN_FUKUSI 65 #define HN_RENTAI 66 #define HN_SETKAN 67 #define HN_TANKAN 68 #define HN_SETTOU 69 #define HN_SETUBI 70 #define HN_SETOSU 71 #define HN_JOSUU 72 #define HN_SETOJO 73 #define HN_SETUJO 74 #define HN_SETUJN 75 #define HN_SETOCH 76 #define HN_SETUCH 77 #define HN_SETO_O 78 #define HN_SETO_K 79 #define HN_KD_STB 80 #define HN_SA_M_S 81 #define HN_SETUDO 82 #define HN_KE_SED 83 #define HN_MAX 84 #define FZ_MIN (HN_MAX + 0) #define FZ_BAN (HN_MAX + 0) #define FZ_COMMA (HN_MAX + 1) #define FZ_PERIOD (HN_MAX + 2) #define FZ_QUEST (HN_MAX + 3) #define FZ_TOUTEN (HN_MAX + 4) #define FZ_KUTEN (HN_MAX + 5) #define FZ_ZENPERIOD (HN_MAX + 6) #define FZ_ZENQUEST (HN_MAX + 7) #define FZ_ZENBAN (HN_MAX + 8) #define FZ_A (HN_MAX + 9) #define FZ_I (HN_MAX + 10) #define FZ_I2 (HN_MAX + 11) #define FZ_I3 (HN_MAX + 12) #define FZ_I4 (HN_MAX + 13) #define FZ_I6 (HN_MAX + 14) #define FZ_I5 (HN_MAX + 15) #define FZ_I7 (HN_MAX + 16) #define FZ_I8 (HN_MAX + 17) #define FZ_I9 (HN_MAX + 18) #define FZ_IKA (HN_MAX + 19) #define FZ_IKI (HN_MAX + 20) #define FZ_IKU (HN_MAX + 21) #define FZ_IKE (HN_MAX + 22) #define FZ_IKO (HN_MAX + 23) #define FZ_IXTSU (HN_MAX + 24) #define FZ_U (HN_MAX + 25) #define FZ_U2 (HN_MAX + 26) #define FZ_U3 (HN_MAX + 27) #define FZ_E (HN_MAX + 28) #define FZ_O (HN_MAX + 29) #define FZ_OI (HN_MAX + 30) #define FZ_OKA (HN_MAX + 31) #define FZ_OKI (HN_MAX + 32) #define FZ_OKU (HN_MAX + 33) #define FZ_OKE (HN_MAX + 34) #define FZ_OKO (HN_MAX + 35) #define FZ_OXTSU (HN_MAX + 36) #define FZ_ORA (HN_MAX + 37) #define FZ_ORI (HN_MAX + 38) #define FZ_ORU (HN_MAX + 39) #define FZ_ORE (HN_MAX + 40) #define FZ_ORO (HN_MAX + 41) #define FZ_KA (HN_MAX + 42) #define FZ_KA2 (HN_MAX + 43) #define FZ_KA3 (HN_MAX + 44) #define FZ_KAXTSU (HN_MAX + 45) #define FZ_KAXTSU2 (HN_MAX + 46) #define FZ_KANE (HN_MAX + 47) #define FZ_KARA (HN_MAX + 48) #define FZ_KARA2 (HN_MAX + 49) #define FZ_KARA3 (HN_MAX + 50) #define FZ_KARI (HN_MAX + 51) #define FZ_KARU (HN_MAX + 52) #define FZ_KARE (HN_MAX + 53) #define FZ_KARO (HN_MAX + 54) #define FZ_GA (HN_MAX + 55) #define FZ_GA2 (HN_MAX + 56) #define FZ_GA3 (HN_MAX + 57) #define FZ_GA4 (HN_MAX + 58) #define FZ_GAXTSU (HN_MAX + 59) #define FZ_GARA (HN_MAX + 60) #define FZ_GARA2 (HN_MAX + 61) #define FZ_GARI (HN_MAX + 62) #define FZ_GARI2 (HN_MAX + 63) #define FZ_GARE (HN_MAX + 64) #define FZ_GARO (HN_MAX + 65) #define FZ_GARU (HN_MAX + 66) #define FZ_DE (HN_MAX + 67) #define FZ_KI (HN_MAX + 68) #define FZ_KI2 (HN_MAX + 69) #define FZ_KI3 (HN_MAX + 70) #define FZ_KI4 (HN_MAX + 71) #define FZ_KI5 (HN_MAX + 72) #define FZ_KI6 (HN_MAX + 73) #define FZ_KI7 (HN_MAX + 74) #define FZ_KIRI (HN_MAX + 75) #define FZ_GI (HN_MAX + 76) #define FZ_GI2 (HN_MAX + 77) #define FZ_KU (HN_MAX + 78) #define FZ_KU2 (HN_MAX + 79) #define FZ_KU3 (HN_MAX + 80) #define FZ_KU4 (HN_MAX + 81) #define FZ_KU5 (HN_MAX + 82) #define FZ_KUSENI (HN_MAX + 83) #define FZ_KURAI (HN_MAX + 84) #define FZ_KURU (HN_MAX + 85) #define FZ_KURE (HN_MAX + 86) #define FZ_KURE2 (HN_MAX + 87) #define FZ_KURE3 (HN_MAX + 88) #define FZ_GU (HN_MAX + 89) #define FZ_GURAI (HN_MAX + 90) #define FZ_KE (HN_MAX + 91) #define FZ_KEDO (HN_MAX + 92) #define FZ_KERE (HN_MAX + 93) #define FZ_KEREDO (HN_MAX + 94) #define FZ_GE (HN_MAX + 95) #define FZ_GE2 (HN_MAX + 96) #define FZ_KO (HN_MAX + 97) #define FZ_KO2 (HN_MAX + 98) #define FZ_KOI (HN_MAX + 99) #define FZ_KOSO (HN_MAX + 100) #define FZ_GO (HN_MAX + 101) #define FZ_GOTO (HN_MAX + 102) #define FZ_SA (HN_MAX + 103) #define FZ_SA2 (HN_MAX + 104) #define FZ_SA3 (HN_MAX + 105) #define FZ_SAE (HN_MAX + 106) #define FZ_SASE (HN_MAX + 107) #define FZ_SARE (HN_MAX + 108) #define FZ_ZARU (HN_MAX + 109) #define FZ_ZARE (HN_MAX + 110) #define FZ_SHI (HN_MAX + 111) #define FZ_SHI2 (HN_MAX + 112) #define FZ_SHI3 (HN_MAX + 113) #define FZ_SHI4 (HN_MAX + 114) #define FZ_SHI5 (HN_MAX + 115) #define FZ_SHI6 (HN_MAX + 116) #define FZ_SHI7 (HN_MAX + 117) #define FZ_SHI8 (HN_MAX + 118) #define FZ_SHI9 (HN_MAX + 119) #define FZ_SHIKA (HN_MAX + 120) #define FZ_SHIMAI (HN_MAX + 121) #define FZ_SHIMAE (HN_MAX + 122) #define FZ_SHIMAO (HN_MAX + 123) #define FZ_SHIMAXTSU (HN_MAX + 124) #define FZ_SHIMAWA (HN_MAX + 125) #define FZ_SHIMAU (HN_MAX + 126) #define FZ_SHIME (HN_MAX + 127) #define FZ_SHO (HN_MAX + 128) #define FZ_SHIRO (HN_MAX + 129) #define FZ_JI (HN_MAX + 130) #define FZ_JI2 (HN_MAX + 131) #define FZ_JIYO (HN_MAX + 132) #define FZ_JIRU (HN_MAX + 133) #define FZ_JIRE (HN_MAX + 134) #define FZ_JIRO (HN_MAX + 135) #define FZ_SU (HN_MAX + 136) #define FZ_SU2 (HN_MAX + 137) #define FZ_SU3 (HN_MAX + 138) #define FZ_SUBE (HN_MAX + 139) #define FZ_SURA (HN_MAX + 140) #define FZ_SURU (HN_MAX + 141) #define FZ_SURE (HN_MAX + 142) #define FZ_SURE2 (HN_MAX + 143) #define FZ_ZU (HN_MAX + 144) #define FZ_ZUTSU (HN_MAX + 145) #define FZ_ZUBE (HN_MAX + 146) #define FZ_ZURU (HN_MAX + 147) #define FZ_ZURE (HN_MAX + 148) #define FZ_ZUN (HN_MAX + 149) #define FZ_SE (HN_MAX + 150) #define FZ_SE2 (HN_MAX + 151) #define FZ_SE3 (HN_MAX + 152) #define FZ_SE4 (HN_MAX + 153) #define FZ_SEYO (HN_MAX + 154) #define FZ_ZE (HN_MAX + 155) #define FZ_ZEYO (HN_MAX + 156) #define FZ_SO (HN_MAX + 157) #define FZ_SOU (HN_MAX + 158) #define FZ_SOU2 (HN_MAX + 159) #define FZ_TA (HN_MAX + 160) #define FZ_TA2 (HN_MAX + 161) #define FZ_TA3 (HN_MAX + 162) #define FZ_TA4 (HN_MAX + 163) #define FZ_TARA (HN_MAX + 164) #define FZ_TARI (HN_MAX + 165) #define FZ_TARI2 (HN_MAX + 166) #define FZ_TARU (HN_MAX + 167) #define FZ_TARE (HN_MAX + 168) #define FZ_DA (HN_MAX + 169) #define FZ_DA2 (HN_MAX + 170) #define FZ_DA3 (HN_MAX + 171) #define FZ_DAKE (HN_MAX + 172) #define FZ_DAXTSU (HN_MAX + 173) #define FZ_DANO (HN_MAX + 174) #define FZ_DARI (HN_MAX + 175) #define FZ_DARO (HN_MAX + 176) #define FZ_CHI (HN_MAX + 177) #define FZ_CHI2 (HN_MAX + 178) #define FZ_XTSU (HN_MAX + 179) #define FZ_XTSU2 (HN_MAX + 180) #define FZ_TSU (HN_MAX + 181) #define FZ_TSUTSU (HN_MAX + 182) #define FZ_TE (HN_MAX + 183) #define FZ_TE2 (HN_MAX + 184) #define FZ_DE2 (HN_MAX + 185) #define FZ_DE3 (HN_MAX + 186) #define FZ_DE4 (HN_MAX + 187) #define FZ_DE5 (HN_MAX + 188) #define FZ_DEKI (HN_MAX + 189) #define FZ_DESHI (HN_MAX + 190) #define FZ_DESHO (HN_MAX + 191) #define FZ_DESU (HN_MAX + 192) #define FZ_DEMO (HN_MAX + 193) #define FZ_TO (HN_MAX + 194) #define FZ_TO2 (HN_MAX + 195) #define FZ_TO3 (HN_MAX + 196) #define FZ_TO4 (HN_MAX + 197) #define FZ_DO (HN_MAX + 198) #define FZ_NI2 (HN_MAX + 199) #define FZ_NI3 (HN_MAX + 200) #define FZ_NA (HN_MAX + 201) #define FZ_NA2 (HN_MAX + 202) #define FZ_NA3 (HN_MAX + 203) #define FZ_NA4 (HN_MAX + 204) #define FZ_NA5 (HN_MAX + 205) #define FZ_NA6 (HN_MAX + 206) #define FZ_NAGARA (HN_MAX + 207) #define FZ_NAZO (HN_MAX + 208) #define FZ_NAXTSU (HN_MAX + 209) #define FZ_NADO (HN_MAX + 210) #define FZ_NARA (HN_MAX + 211) #define FZ_NARA2 (HN_MAX + 212) #define FZ_NARI (HN_MAX + 213) #define FZ_NARI2 (HN_MAX + 214) #define FZ_NARI3 (HN_MAX + 215) #define FZ_NARU (HN_MAX + 216) #define FZ_NARU2 (HN_MAX + 217) #define FZ_NARE (HN_MAX + 218) #define FZ_NARE2 (HN_MAX + 219) #define FZ_NARO (HN_MAX + 220) #define FZ_NI (HN_MAX + 221) #define FZ_NI4 (HN_MAX + 222) #define FZ_NI5 (HN_MAX + 223) #define FZ_NI6 (HN_MAX + 224) #define FZ_NU (HN_MAX + 225) #define FZ_NU2 (HN_MAX + 226) #define FZ_NE (HN_MAX + 227) #define FZ_NE2 (HN_MAX + 228) #define FZ_NO (HN_MAX + 229) #define FZ_NO2 (HN_MAX + 230) #define FZ_NO3 (HN_MAX + 231) #define FZ_NOMI (HN_MAX + 232) #define FZ_HA (HN_MAX + 233) #define FZ_BA (HN_MAX + 234) #define FZ_BA2 (HN_MAX + 235) #define FZ_BA3 (HN_MAX + 236) #define FZ_BAKARI (HN_MAX + 237) #define FZ_BI (HN_MAX + 238) #define FZ_BI2 (HN_MAX + 239) #define FZ_BU (HN_MAX + 240) #define FZ_HE (HN_MAX + 241) #define FZ_BE (HN_MAX + 242) #define FZ_BE2 (HN_MAX + 243) #define FZ_HODO (HN_MAX + 244) #define FZ_BO (HN_MAX + 245) #define FZ_MA (HN_MAX + 246) #define FZ_MA2 (HN_MAX + 247) #define FZ_MA3 (HN_MAX + 248) #define FZ_MAI (HN_MAX + 249) #define FZ_MADE (HN_MAX + 250) #define FZ_MI (HN_MAX + 251) #define FZ_MI2 (HN_MAX + 252) #define FZ_MI3 (HN_MAX + 253) #define FZ_MI4 (HN_MAX + 254) #define FZ_MITAI (HN_MAX + 255) #define FZ_MU (HN_MAX + 256) #define FZ_ME (HN_MAX + 257) #define FZ_ME2 (HN_MAX + 258) #define FZ_MO (HN_MAX + 259) #define FZ_MO2 (HN_MAX + 260) #define FZ_YA (HN_MAX + 261) #define FZ_YA2 (HN_MAX + 262) #define FZ_YASHINA (HN_MAX + 263) #define FZ_YAXTSU (HN_MAX + 264) #define FZ_YARA (HN_MAX + 265) #define FZ_YARA2 (HN_MAX + 266) #define FZ_YARI (HN_MAX + 267) #define FZ_YARU (HN_MAX + 268) #define FZ_YARE (HN_MAX + 269) #define FZ_YARO (HN_MAX + 270) #define FZ_XYUU (HN_MAX + 271) #define FZ_YUE (HN_MAX + 272) #define FZ_YO (HN_MAX + 273) #define FZ_YOU (HN_MAX + 274) #define FZ_YOU2 (HN_MAX + 275) #define FZ_YOXTSU (HN_MAX + 276) #define FZ_YORA (HN_MAX + 277) #define FZ_YORI (HN_MAX + 278) #define FZ_YORI2 (HN_MAX + 279) #define FZ_YORU (HN_MAX + 280) #define FZ_YORE (HN_MAX + 281) #define FZ_YORO (HN_MAX + 282) #define FZ_RA (HN_MAX + 283) #define FZ_RA2 (HN_MAX + 284) #define FZ_RA3 (HN_MAX + 285) #define FZ_RA4 (HN_MAX + 286) #define FZ_RASHI (HN_MAX + 287) #define FZ_RARE (HN_MAX + 288) #define FZ_RI (HN_MAX + 289) #define FZ_RI2 (HN_MAX + 290) #define FZ_RI3 (HN_MAX + 291) #define FZ_RU (HN_MAX + 292) #define FZ_RU2 (HN_MAX + 293) #define FZ_RU3 (HN_MAX + 294) #define FZ_RE (HN_MAX + 295) #define FZ_RE2 (HN_MAX + 296) #define FZ_RE3 (HN_MAX + 297) #define FZ_RE4 (HN_MAX + 298) #define FZ_RE5 (HN_MAX + 299) #define FZ_RO (HN_MAX + 300) #define FZ_RO2 (HN_MAX + 301) #define FZ_RO3 (HN_MAX + 302) #define FZ_RO4 (HN_MAX + 303) #define FZ_WA (HN_MAX + 304) #define FZ_WA2 (HN_MAX + 305) #define FZ_WA3 (HN_MAX + 306) #define FZ_WO (HN_MAX + 307) #define FZ_N (HN_MAX + 308) #define FZ_N2 (HN_MAX + 309) #define FZ_MAX (HN_MAX + 310) #define SH_MIN (FZ_MAX + 0) #define SH_svkanren (FZ_MAX + 0) #define SH_svkantan (FZ_MAX + 1) #define SH_svbunsetsu (FZ_MAX + 2) #define SH_MAX (FZ_MAX + 3) FD-3.01j/func.h100644 2105 1751 41643 13516612560 12015 0ustar shiraiuser/* * func.h * * function prototype declarations */ #include "depend.h" #include "sysemu.h" #include "pathname.h" #include "term.h" #include "types.h" #include "dosdisk.h" #include "unixemu.h" #define getblock(c) ((((c) + blocksize - 1) / blocksize) \ * blocksize) #define isleftshift() (n_column < WCOLUMNSTD) #define isrightomit() (n_column < WCOLUMNSTD - 1) #define ispureshift() (n_column == WCOLUMNSTD - 1) #define isshortwid() (n_column < WCOLUMNSTD - 1) #define iswellomit() (n_column < WCOLUMNSTD - 2) #define ishardomit() (n_column < WCOLUMNOMIT) #define isbestomit() (n_column < WCOLUMNHARD) #ifdef DEP_ORIGSHELL #define getconstvar(s) (getshellvar(s, strsize(s))) #else #define getconstvar(s) (char *)getenv(s) #define getshellvar(s, l) (char *)getenv(s) #endif #ifdef DEP_PTY # ifdef DEP_ORIGSHELL # define isptymode() (ptymode && (fdmode || !shptymode)) # define isshptymode() (!fdmode && shptymode) # else # define isptymode() ptymode # define isshptymode() 0 # endif #else /* !DEP_PTY */ #define isptymode() 0 #define isshptymode() 0 #endif /* !DEP_PTY */ /* main.c */ extern VOID error __P_((CONST char *)); extern VOID setlinecol __P_((VOID_A)); extern VOID checkscreen __P_((int, int)); #ifdef SIGWINCH extern VOID pollscreen __P_((int)); #endif extern int sigvecset __P_((int)); extern char *getversion __P_((int *)); extern VOID title __P_((VOID_A)); #ifndef _NOCUSTOMIZE extern VOID saveorigenviron __P_((VOID_A)); #endif extern int loadruncom __P_((CONST char *, int)); extern VOID initfd __P_((char *CONST *)); extern VOID prepareexitfd __P_((int)); /* system.c */ #ifdef DEP_ORIGSHELL extern int dosystem __P_((CONST char *)); extern XFILE *dopopen __P_((CONST char *)); extern int dopclose __P_((XFILE *)); #else #define dosystem system #define dopopen(c) Xpopen(c, "r") #define dopclose Xpclose #endif /* libc.c */ extern int stat2 __P_((CONST char *, struct stat *)); extern int _chdir2 __P_((CONST char *)); extern int chdir2 __P_((CONST char *)); extern int chdir3 __P_((CONST char *, int)); extern int chdir4 __P_((CONST char *, int, CONST char *)); extern int mkdir2 __P_((char *, int)); extern int strncpy2 __P_((char *, CONST char *, int *, int)); extern VOID perror2 __P_((CONST char *)); extern int setenv2 __P_((CONST char *, CONST char *, int)); extern char *getenv2 __P_((CONST char *)); #ifdef USESIGACTION extern sigcst_t signal2 __P_((int, sigcst_t)); #else #define signal2 signal #endif extern int system2 __P_((CONST char *, int)); extern XFILE *popen2 __P_((CONST char *, int)); extern int pclose2 __P_((XFILE *)); extern char *getwd2 __P_((VOID_A)); /* file.c */ #ifdef DEP_DOSEMU extern CONST char *nodospath __P_((char *, CONST char *)); #else #define nodospath(p, f) (f) #endif #define fnodospath(p, i) nodospath(p, filelist[i].name) extern int getstatus __P_((namelist *)); extern int cmplist __P_((CONST VOID_P, CONST VOID_P)); #ifndef _NOTREE extern int cmptree __P_((CONST VOID_P, CONST VOID_P)); #endif extern struct dirent *searchdir __P_((DIR *, CONST reg_ex_t *, CONST char *)); extern int underhome __P_((char *)); extern int preparedir __P_((CONST char *)); extern lockbuf_t *lockopen __P_((CONST char *, int, int)); extern lockbuf_t *lockfopen __P_((CONST char *, CONST char *, int, int)); extern VOID lockclose __P_((lockbuf_t *)); extern int touchfile __P_((CONST char *, struct stat *)); #ifdef DEP_PSEUDOPATH extern int reallstat __P_((CONST char *, struct stat *)); #else #define reallstat Xlstat #endif extern VOID lostcwd __P_((char *)); #ifndef NODIRLOOP extern int issamebody __P_((CONST char *, CONST char *)); #endif #ifndef NOSYMLINK extern int cpsymlink __P_((CONST char *, CONST char *)); #endif extern int safecpfile __P_((CONST char *, CONST char *, struct stat *, struct stat *)); extern int safemvfile __P_((CONST char *, CONST char *, struct stat *, struct stat *)); extern char *genrandname __P_((char *, int)); extern int mktmpdir __P_((char *)); extern int rmtmpdir __P_((CONST char *)); extern int opentmpfile __P_((CONST char *, int)); extern int mktmpfile __P_((char *)); extern int rmtmpfile __P_((CONST char *)); extern VOID removetmp __P_((char *, CONST char *)); extern int forcecleandir __P_((CONST char *, CONST char *)); #ifdef DEP_PSEUDOPATH extern char *dostmpdir __P_((int)); extern int tmpdosdupl __P_((CONST char *, char **, int)); extern int tmpdosrestore __P_((int, CONST char *)); #endif #ifndef _NOWRITEFS extern VOID arrangedir __P_((int)); #endif /* apply.c */ #ifndef _NOEXTRACOPY extern VOID showprogress __P_((off_t *)); extern VOID fshowprogress __P_((CONST char *)); #endif extern int prepareremove __P_((int, int)); extern int rmvfile __P_((CONST char *)); extern int rmvdir __P_((CONST char *)); extern int findfile __P_((CONST char *)); extern int finddir __P_((CONST char *)); extern int inputattr __P_((namelist *, int)); extern int setattr __P_((CONST char *)); extern int applyfile __P_((int (*)__P_((CONST char *)), CONST char *)); extern int applydir __P_((CONST char *, int (*)__P_((CONST char *)), int (*)__P_((CONST char *)), int (*)__P_((CONST char *)), int, CONST char *)); extern int copyfile __P_((CONST char *, int)); extern int movefile __P_((CONST char *, int)); extern int forcemovefile __P_((char *)); /* pty.c */ #ifdef DEP_PTY extern int Xopenpty __P_((int *, int *, char *, ALLOC_T)); extern int Xlogin_tty __P_((CONST char *, CONST char *, CONST char *)); extern p_id_t Xforkpty __P_((int *, CONST char *, CONST char *)); #endif #ifdef DEP_PTY # ifdef DEP_ORIGSHELL # define ptyusercomm ptymacro # else # define ptyusercomm(c, a, f) \ ptymacro(c, a, f | F_EVALMACRO) # endif #define ptysystem(c) ptymacro(c, NULL, F_DOSYSTEM) #else /* !DEP_PTY */ #define ptymacro execmacro #define ptyusercomm execusercomm #define ptysystem dosystem #endif /* !DEP_PTY */ /* frontend.c */ #ifdef DEP_PTY extern int waitstatus __P_((p_id_t, int, int *)); extern VOID Xttyiomode __P_((int)); extern VOID Xstdiomode __P_((VOID_A)); extern int Xtermmode __P_((int)); extern int XXputch __P_((int)); extern VOID XXcputs __P_((CONST char *)); extern VOID Xputterm __P_((int)); extern VOID Xputterms __P_((int)); extern int Xsetscroll __P_((int, int)); extern VOID Xlocate __P_((int, int)); extern VOID Xtflush __P_((VOID_A)); extern int XXcprintf __P_((CONST char *, ...)); extern VOID Xcputnl __P_((VOID_A)); extern int Xkanjiputs __P_((CONST char *)); extern VOID Xattrputs __P_((CONST char *, int)); extern int Xattrprintf __P_((CONST char *, int, ...)); extern int Xattrkanjiputs __P_((CONST char *, int)); extern VOID Xchgcolor __P_((int, int)); extern VOID Xmovecursor __P_((int, int, int)); extern VOID changewin __P_((int, p_id_t)); extern VOID changewsize __P_((int, int)); extern VOID insertwin __P_((int, int)); extern VOID deletewin __P_((int, int)); # ifdef DEP_KCONV extern VOID changekcode __P_((VOID_A)); extern VOID changeinkcode __P_((VOID_A)); extern VOID changeoutkcode __P_((VOID_A)); # endif extern int frontend __P_((VOID_A)); #else /* !DEP_PTY */ #define Xttyiomode ttyiomode #define Xstdiomode stdiomode #define Xtermmode termmode #define XXputch Xputch #define XXcputs Xcputs #define Xputterm putterm #define Xputterms putterms #define Xsetscroll setscroll #define Xlocate locate #define Xtflush tflush #define XXcprintf Xcprintf #define Xcputnl cputnl #define Xkanjiputs kanjiputs #define Xattrputs attrputs #define Xattrprintf attrprintf #define Xattrkanjiputs attrkanjiputs #define Xchgcolor chgcolor #define Xmovecursor movecursor #endif /* !DEP_PTY */ /* backend.c */ #ifdef DEP_PTY extern VOID resetptyterm __P_((int, int)); extern int backend __P_((VOID_A)); #endif /* builtin.c */ #ifndef _NOARCHIVE extern VOID freelaunch __P_((lsparse_t *)); extern int searchlaunch __P_((CONST lsparse_t *, CONST lsparse_t *, int)); extern int parselaunch __P_((int, char *CONST [], lsparse_t *)); extern VOID addlaunch __P_((int, lsparse_t *)); extern VOID deletelaunch __P_((int)); extern VOID freearch __P_((archive_t *)); extern int searcharch __P_((CONST archive_t *, CONST archive_t *, int)); extern int parsearch __P_((int, char *CONST [], archive_t *)); extern VOID addarch __P_((int, archive_t *)); extern VOID deletearch __P_((int)); extern VOID printlaunchcomm __P_((CONST lsparse_t *, int, int, int, XFILE *)); extern VOID printarchcomm __P_((CONST archive_t *, int, int, XFILE *)); # ifndef _NOBROWSE extern VOID freebrowse __P_((lsparse_t *)); # endif #endif extern int ismacro __P_((int)); extern CONST char *getmacro __P_((int)); extern int freemacro __P_((int)); extern int searchkeybind __P_((CONST bindtable *, CONST bindtable *, int)); extern int parsekeybind __P_((int, char *CONST [], bindtable *)); extern int addkeybind __P_((int, CONST bindtable *, char *, char *, char *)); extern VOID deletekeybind __P_((int)); extern char *gethelp __P_((CONST bindtable *)); extern VOID printmacro __P_((CONST bindtable *, int, int, XFILE *)); #ifdef DEP_DOSEMU extern int searchdrv __P_((CONST devinfo *, CONST devinfo *, int, int)); extern int deletedrv __P_((int)); extern int insertdrv __P_((int, devinfo *)); extern VOID printsetdrv __P_((CONST devinfo *, int, int, int, XFILE *)); extern int parsesetdrv __P_((int, char *CONST [], devinfo *)); #endif #ifndef _NOKEYMAP extern int parsekeymap __P_((int, char *CONST [], keyseq_t *)); extern VOID printkeymap __P_((keyseq_t *, int, XFILE *)); #endif #if !MSDOS extern int savestdio __P_((int)); #endif #ifndef DEP_ORIGSHELL extern int searchalias __P_((CONST char *, int)); extern int addalias __P_((char *, char *)); extern int deletealias __P_((CONST char *)); extern VOID printalias __P_((int, XFILE *)); extern int searchfunction __P_((CONST char *)); extern int addfunction __P_((char *, char **)); extern int deletefunction __P_((CONST char *)); extern VOID printfunction __P_((int, int, XFILE *)); #endif /* !DEP_ORIGSHELL */ extern CONST builtintable *getbuiltin __P_((CONST char *)); extern CONST functable *getinternal __P_((CONST char *)); extern int execbuiltin __P_((CONST builtintable *, int, char *CONST [])); extern int execinternal __P_((CONST functable *, int, char *CONST [])); #ifndef DEP_ORIGSHELL extern int execpseudoshell __P_((CONST char *, int)); #endif #ifndef _NOCOMPLETE extern int completebuiltin __P_((CONST char *, int, int, char ***)); extern int completeinternal __P_((CONST char *, int, int, char ***)); #endif #ifdef DEBUG extern VOID freedefine __P_((VOID_A)); #endif #define BL_SET "set" #define BL_UNSET "unset" #define BL_PENV "printenv" #define BL_LAUNCH "launch" #define BL_ARCH "arch" #define BL_BROWSE "browse" #define BL_PLAUNCH "printlaunch" #define BL_PARCH "printarch" #define BL_BIND "bind" #define BL_PBIND "printbind" #define BL_SDRIVE "setdrv" #define BL_UDRIVE "unsetdrv" #define BL_PDRIVE "printdrv" #define BL_KEYMAP "keymap" #define BL_GETKEY "getkey" #define BL_HISTORY "history" #define BL_FC "fc" #define BL_CHECKID "checkid" #define BL_EVALMACRO "evalmacro" #define BL_KCONV "kconv" #define BL_GETFREQ "getfreq" #define BL_SETFREQ "setfreq" #define BL_READLINE "readline" #define BL_YESNO "yesno" #define BL_SAVETTY "savetty" #define BL_SETROMAN "setroman" #define BL_PRINTROMAN "printroman" #define BL_ALIAS "alias" #define BL_UALIAS "unalias" #define BL_FUNCTION "function" #define BL_EXPORT "export" #define BL_CHDIR "chdir" #define BL_CD "cd" #define BL_SOURCE "source" #define BL_DOT "." /* shell.c */ extern char *restorearg __P_((CONST char *)); extern char *evalcommand __P_((CONST char *, CONST char *, macrostat *)); extern int replaceargs __P_((int *, char ***, char *CONST *, int)); extern int replacearg __P_((char **)); extern VOID demacroarg __P_((char **)); extern char *inputshellstr __P_((CONST char *, int, CONST char *)); extern char *inputshellloop __P_((int, CONST char *)); extern int isinternalcomm __P_((CONST char *)); extern int execmacro __P_((CONST char *, CONST char *, int)); extern XFILE *popenmacro __P_((CONST char *, CONST char *, int)); #ifdef DEP_ORIGSHELL #define execusercomm execmacro #else extern int execusercomm __P_((CONST char *, CONST char *, int)); #endif extern int entryhist __P_((CONST char *, int)); extern char *removehist __P_((int)); extern int loadhistory __P_((int)); extern int savehistory __P_((int)); extern int parsehist __P_((CONST char *, int *, int)); extern char *evalhistory __P_((char *)); #ifdef DEBUG extern VOID freehistory __P_((int)); #endif #if !defined (_NOCOMPLETE) && !defined (DEP_ORIGSHELL) extern int completealias __P_((CONST char *, int, int, char ***)); extern int completeuserfunc __P_((CONST char *, int, int, char ***)); #endif /* input.c */ extern int intrkey __P_((int)); extern int Xgetkey __P_((int, int, int)); extern int kanjiputs2 __P_((CONST char *, int, int)); extern VOID cputspace __P_((int)); extern VOID cputstr __P_((int, CONST char *)); extern VOID attrputstr __P_((int, CONST char *, int)); extern char *inputstr __P_((CONST char *, int, int, CONST char *, int)); extern int yesno __P_((CONST char *, ...)); extern VOID warning __P_((int, CONST char *)); extern int selectstr __P_((int *, int, int, CONST char *CONST [], int [])); #ifdef DEP_URLPATH extern char *inputpass __P_((VOID_A)); #endif /* ime.c */ #ifdef DEP_IME # ifdef DEP_PTY extern u_int ime_getkeycode __P_((CONST char *)); extern int ime_inkanjiconv __P_((char *, u_int)); # endif extern int ime_inputkanji __P_((int, char *)); # ifdef DEBUG extern VOID ime_freebuf __P_((VOID_A)); # endif #endif /* DEP_IME */ /* dict.c */ #ifdef DEP_IME extern VOID discarddicttable __P_((VOID_A)); extern VOID saveuserfreq __P_((CONST u_short *, CONST u_short *)); extern VOID freekanjilist __P_((u_short **)); extern u_short **searchdict __P_((u_short *, int)); # if FD >= 3 extern int fgetuserfreq __P_((CONST char *, XFILE *)); extern int fputuserfreq __P_((CONST char *, XFILE *)); # endif #endif /* DEP_IME */ /* info.c */ extern VOID help __P_((int)); #ifndef NOFLOCK extern int isnfs __P_((CONST char *)); #endif extern int writablefs __P_((CONST char *)); extern off_t getblocksize __P_((CONST char *)); extern off_t calcKB __P_((off_t, off_t)); extern int getinfofs __P_((CONST char *, off_t *, off_t *, off_t *)); extern int infofs __P_((CONST char *)); /* rockridge.c */ #ifndef _NOROCKRIDGE extern char *transpath __P_((CONST char *, char *)); extern char *detranspath __P_((CONST char *, char *)); extern int rrlstat __P_((CONST char *, struct stat *)); extern int rrreadlink __P_((CONST char *, char *, int)); #endif /* tree.c */ #ifndef _NOTREE extern VOID rewritetree __P_((VOID_A)); extern char *tree __P_((int, int *)); #endif /* archive.c */ #ifndef _NOARCHIVE extern VOID escapearch __P_((int)); extern VOID archbar __P_((CONST char *, CONST char *)); extern VOID copyarcf __P_((CONST reg_ex_t *, CONST char *)); extern CONST char *archchdir __P_((CONST char *)); # ifndef _NOCOMPLETE extern int completearch __P_((CONST char *, int, int, char ***)); # endif extern int launcher __P_((VOID_A)); extern int dolaunch __P_((lsparse_t *, int)); extern int pack __P_((CONST char *)); extern int unpack __P_((CONST char *, CONST char *, CONST char *, int, int)); extern char *tmpunpack __P_((int)); extern int backup __P_((CONST char *)); extern int searcharcf __P_((CONST char *, namelist *, int, int)); #endif /* custom.c */ extern VOID initenv __P_((VOID_A)); extern VOID evalenv __P_((CONST char *, int)); #ifdef DEBUG extern VOID freeenvpath __P_((VOID_A)); #endif extern VOID freestrarray __P_((char **, int)); extern char **copystrarray __P_((char **, char *CONST *, int *, int)); #if !defined (_NOCUSTOMIZE) || defined (DEP_DYNAMICLIST) extern bindtable *copybind __P_((bindtable *, CONST bindtable *, int *, int)); #endif #ifndef _NOARCHIVE extern VOID freelaunchlist __P_((lsparse_t *, int)); extern lsparse_t *copylaunch __P_((lsparse_t *, CONST lsparse_t *, int *, int)); extern VOID freearchlist __P_((archive_t *, int)); extern archive_t *copyarch __P_((archive_t *, CONST archive_t *, int *, int)); #endif #ifdef DEP_DOSEMU extern VOID freedosdrive __P_((devinfo *, int)); extern devinfo *copydosdrive __P_((devinfo *, CONST devinfo *, int *, int)); #endif #ifndef _NOCUSTOMIZE extern VOID rewritecust __P_((VOID_A)); extern int customize __P_((CONST char *)); #endif /* command.c */ extern int evalstatus __P_((int)); #ifndef _NOSPLITWIN extern int nextwin __P_((VOID_A)); #endif /* browse.c */ extern VOID helpbar __P_((VOID_A)); extern int putmode __P_((char *, u_int, int)); #ifdef HAVEFLAGS extern int putflags __P_((char *, u_long)); #endif #ifndef NOUID extern int putowner __P_((char *, u_id_t)); extern int putgroup __P_((char *, g_id_t)); #endif extern VOID waitmes __P_((VOID_A)); extern int filetop __P_((int)); extern int calcwidth __P_((VOID_A)); extern int putname __P_((namelist *, int, int)); extern VOID setlastfile __P_((CONST char *)); extern int listupfile __P_((namelist *, int, CONST char *, int)); #ifndef _NOSPLITWIN extern int shutwin __P_((int)); #endif extern VOID calcwin __P_((VOID_A)); extern VOID movepos __P_((int, int)); extern VOID rewritefile __P_((int)); extern VOID getfilelist __P_((VOID_A)); extern int dointernal __P_((int, CONST char *, int, int *)); extern VOID main_fd __P_((char *CONST *, int)); FD-3.01j/functabl.h100644 2105 1751 11070 13516612560 12647 0ustar shiraiuser/* * functabl.h * * function status table */ #ifndef _TBL_ #define _TBL_(fn, id, hl, fl) {fn, id, hl, BIN(fl)} #endif #define BIN(oct) ( (((oct) ) & 0001) \ | (((oct) >> 2) & 0002) \ | (((oct) >> 4) & 0004) \ | (((oct) >> 6) & 0010) \ | (((oct) >> 8) & 0020) \ | (((oct) >> 10) & 0040) \ | (((oct) >> 12) & 0100) \ | (((oct) >> 14) & 0200)) CONST functable funclist[] = { /* +---------- NEEDSTATUS * |+--------- RESTRICT * ||+-------- NOFILE * |||+------- ARCHIVE * ||||+------ KILLSTACK * |||||+----- RESCREEN * ||||||++-- 01: REWRITE * |||||||| 10: RELIST * |||||||| 11: REWIN * |||||||| */ _TBL_(cur_up, "CUR_UP", CUP_H, 000010000), _TBL_(cur_down, "CUR_DOWN", CDWN_H, 000010000), _TBL_(cur_right, "CUR_RIGHT", CRIG_H, 000010000), _TBL_(cur_left, "CUR_LEFT", CLEF_H, 000010000), _TBL_(roll_up, "ROLL_UP", RUP_H, 000010010), _TBL_(roll_down, "ROLL_DOWN", RDWN_H, 000010010), _TBL_(cur_top, "CUR_TOP", CTOP_H, 000010000), _TBL_(cur_bottom, "CUR_BOTTOM", CBTM_H, 000010000), _TBL_(fname_right, "FNAME_RIGHT", FNRI_H, 000010001), _TBL_(fname_left, "FNAME_LEFT", FNLE_H, 000010001), _TBL_(one_column, "ONE_COLUMN", COL1_H, 000110111), _TBL_(two_columns, "TWO_COLUMNS", COL2_H, 000110111), _TBL_(three_columns, "THREE_COLUMNS",COL3_H, 000110111), _TBL_(five_columns, "FIVE_COLUMNS", COL5_H, 000110111), _TBL_(mark_file, "MARK_FILE", MRK_H, 010010001), _TBL_(mark_file2, "MARK_FILE2", MRK2_H, 010010001), _TBL_(mark_file3, "MARK_FILE3", MRK2_H, 010010001), _TBL_(mark_all, "MARK_ALL", MRKA_H, 010010010), _TBL_(mark_reverse, "MARK_REVERSE", MRKR_H, 010010010), _TBL_(mark_find, "MARK_FIND", MRKF_H, 010010010), _TBL_(in_dir, "IN_DIR", IND_H, 011011000), _TBL_(out_dir, "OUT_DIR", OUTD_H, 001111000), _TBL_(log_top, "LOG_TOP", LOGT_H, 001101000), _TBL_(reread_dir, "REREAD_DIR", READ_H, 000110000), _TBL_(push_file, "PUSH_FILE", PUSH_H, 000010110), _TBL_(pop_file, "POP_FILE", POP_H, 000010110), _TBL_(log_dir, "LOG_DIR", LOGD_H, 001111000), _TBL_(attr_file, "ATTR_FILE", ATTR_H, 011001110), _TBL_(execute_file, "EXECUTE_FILE", EXEF_H, 010011111), _TBL_(info_filesys, "INFO_FILESYS", INFO_H, 000110010), _TBL_(copy_file, "COPY_FILE", COPY_H, 011001000), _TBL_(move_file, "MOVE_FILE", MOVE_H, 011001000), _TBL_(delete_file, "DELETE_FILE", DELF_H, 011001000), _TBL_(delete_dir, "DELETE_DIR", DELD_H, 011001000), _TBL_(rename_file, "RENAME_FILE", RENM_H, 001001000), _TBL_(make_dir, "MAKE_DIR", MKDR_H, 001101000), _TBL_(sort_dir, "SORT_DIR", SORT_H, 000010110), _TBL_(execute_sh, "EXECUTE_SH", EXSH_H, 000111111), _TBL_(find_file, "FIND_FILE", FNDF_H, 000111000), #ifndef _NOWRITEFS _TBL_(write_dir, "WRITE_DIR", WRIT_H, 001001000), #endif #ifndef _NOTREE _TBL_(tree_dir, "TREE_DIR", TREE_H, 001101110), #endif #ifndef _NOARCHIVE _TBL_(backup_tape, "BACKUP_TAPE", BACK_H, 001011000), #endif _TBL_(edit_file, "EDIT_FILE", EDIT_H, 011001000), _TBL_(view_file, "VIEW_FILE", VIEW_H, 010010111), #ifndef _NOARCHIVE _TBL_(unpack_file, "UNPACK_FILE", UNPK_H, 011011000), _TBL_(pack_file, "PACK_FILE", PACK_H, 001011000), #endif #ifndef _NOTREE _TBL_(tree_dir, "LOG_TREE", LGTR_H, 001101110), _TBL_(copy_tree, "COPY_TREE", CPTR_H, 011001110), _TBL_(move_tree, "MOVE_TREE", MVTR_H, 011001110), # ifndef _NOARCHIVE _TBL_(unpack_tree, "UNPACK_TREE", UPTR_H, 011011110), # endif #endif /* !_NOTREE */ _TBL_(find_dir, "FIND_DIR", FNDD_H, 011001110), #ifndef _NOEXTRAATTR _TBL_(attr_dir, "ATTR_DIR", ATRD_H, 011001110), #endif _TBL_(symlink_mode, "SYMLINK_MODE", SYLN_H, 000100000), _TBL_(filetype_mode, "FILETYPE_MODE",FLTY_H, 000110110), _TBL_(dotfile_mode, "DOTFILE_MODE", DTFL_H, 000101000), _TBL_(fileflg_mode, "FILEFLG_MODE", FLFL_H, 000100110), #ifndef _NOARCHIVE _TBL_(launch_file, "LAUNCH_FILE", LAUN_H, 010011111), #endif _TBL_(search_forw, "SEARCH_FORW", SEAF_H, 000010000), _TBL_(search_back, "SEARCH_BACK", SEAB_H, 000010000), #ifndef _NOSPLITWIN _TBL_(split_window, "SPLIT_WINDOW", SPWN_H, 000101000), _TBL_(next_window, "NEXT_WINDOW", NXWN_H, 000111000), #endif #ifndef _NOEXTRAWIN _TBL_(widen_window, "WIDEN_WINDOW", WDWN_H, 000111000), _TBL_(narrow_window, "NARROW_WINDOW",NRWN_H, 000111000), _TBL_(kill_window, "KILL_WINDOW", KLWN_H, 000101000), #endif #ifndef _NOCUSTOMIZE _TBL_(edit_config, "EDIT_CONFIG", EDCF_H, 000111110), #endif _TBL_(help_message, "HELP_MESSAGE", HELP_H, 000110110), _TBL_(quit_system, "QUIT_SYSTEM", QUIT_H, 000111000), _TBL_(warning_bell, "WARNING_BELL", WARN_H, 000110000), _TBL_(no_operation, "NO_OPERATION", NOOP_H, 000110000) }; FD-3.01j/makefile.gpc100644 2105 1751 153616 13516612560 13205 0ustar shiraiuser# # Makefile for fd # TITLE = FD- VERMAJ = 3 VERSION = 3.01j PREFIX = CONFDIR = BUILD = MANSEC = 1 BINTOP = $(PREFIX)\bin BINDIR = $(BUILD)$(BINTOP) DATATOP = $(PREFIX)\share DATADIR = $(BUILD)$(DATATOP)\fd MANTOP = $(PREFIX)\man MANDIR = $(BUILD)$(MANTOP)\man$(MANSEC) CATDIR = $(BUILD)$(MANTOP)\cat$(MANSEC) JMANDIR = $(BUILD)$(MANTOP)\man$(MANSEC) JCATDIR = $(BUILD)$(MANTOP)\cat$(MANSEC) IPKWDIR = .\ipk.work IPKTDIR = .\ipk.tmp DEPDIR = .\depend.tmp DIST = none DEFRC = $(CONFDIR)\fd2rc BLDRC = $(BUILD)$(DEFRC) DOSRC = ~FD\\fd2rc UNITBL = fd-unicd.tbl DICTTBL = fd-dict.tbl DICTTXT = fd-dict.txt DICTSRC = CATTBL = fd-cat.ja ECATTBL = fd-cat.C TABLES = $(UNITBL) $(CATTBL) $(ECATTBL) SRC = main.c printf.c termio.c term.c stream.c \ string.c malloc.c time.c \ pathname.c system.c posixsh.c doscom.c \ log.c sysemu.c dosdisk.c unixdisk.c \ realpath.c encode.c \ libc.c file.c mntinfo.c statfs.c apply.c \ pty.c termemu.c frontend.c backend.c \ parse.c builtin.c shell.c \ socket.c url.c auth.c \ ftp.c html.c http.c urldisk.c \ catalog.c \ kconv.c input.c ime.c dict.c roman.c \ info.c rockridg.c tree.c \ lsparse.c archive.c \ custom.c command.c browse.c HSRC = evalopt.c gentbl.c \ mkunitbl.c mkdict.c mktankan.c \ mkkanji.c mkcat.c mkdir_p.c \ kanjicnv.c expfunc.c \ mkfuncno.c DSRC = $(DEPDIR)\unitbl.c $(DEPDIR)\dicttbl.c HEADER = fd.h \ headers.h machine.h \ depend.h \ printf.h kctype.h typesize.h \ string.h malloc.h time.h \ dirent.h sysemu.h log.h \ pathname.h system.h posixsh.h wait.h \ termio.h term.h stream.h \ types.h namelist.h \ dosdisk.h unixdisk.h unixemu.h \ realpath.h encode.h termemu.h \ mntinfo.h fsinfo.h device.h parse.h lsparse.h \ socket.h url.h auth.h html.h urldisk.h \ catalog.h \ evalopt.h gentbl.h \ kconv.h roman.h hinsi.h \ func.h functabl.h SSRC = printf.c termio.c stream.c \ string.c malloc.c time.c \ pathname.c system.c posixsh.c doscom.c \ sysemu.c BSRC = printf.c termio.c stream.c \ string.c malloc.c \ pathname.c system.c doscom.c \ sysemu.c NSRC = printf.c termio.c stream.c \ string.c malloc.c time.c \ pathname.c system.c posixsh.c doscom.c \ sysemu.c \ realpath.c encode.c \ parse.c \ socket.c url.c auth.c \ ftp.c html.c http.c urldisk.c \ lsparse.c TSRC = string.c roman.c kconv.c evalopt.c gentbl.c unitbl.c DOC = README.eng HISTORY.eng FAQ.eng TECHKNOW.eng \ Install.eng ToAdmin.eng LICENSES.eng JDOC = README HISTORY FAQ TECHKNOW \ Install ToAdmin LICENSES MANSRC = fd_e.man MANCAT = fd_e.cat JMANSRC = fd.man JMANCAT = fd.cat RUNCOM = fdrc ARGS = object.arg SARGS = sobject.arg NARGS = nobject.arg SRCS = $(DOC) $(MANSRC) $(MANCAT) \ Configur Makefile Makefile.in $(SRC) $(HSRC) $(HEADER) \ makefile.gpc makefile.g98 \ makefile.dpc makefile.d98 \ makefile.lpc makefile.l98 \ makefile.bpc makefile.b98 \ mkmfdosg.sed mkmfdosd.sed mkmfdosl.sed mkmfdosb.sed \ mkmfsed.c \ config.hin version.h \ _fdrc _fdrc.dif fd.spec JSRCS = $(JDOC) $(JMANSRC) $(JMANCAT) \ kanji.hin SOURCES = $(SRCS) $(JSRCS) SHSOURCES = $(NSRC) \ headers.h machine.h \ depend.h \ printf.h kctype.h typesize.h \ string.h malloc.h time.h \ dirent.h sysemu.h log.h \ pathname.h system.h posixsh.h wait.h \ termio.h stream.h \ namelist.h \ unixemu.h \ realpath.h encode.h \ device.h parse.h lsparse.h \ socket.h url.h auth.h html.h urldisk.h \ kanjicnv.c expfunc.c mkmfsed.c \ Configur Makefile Makefile.in \ makefile.gpc makefile.g98 \ makefile.dpc makefile.d98 \ makefile.lpc makefile.l98 \ makefile.bpc makefile.b98 \ mkmfdosg.sed mkmfdosd.sed mkmfdosl.sed mkmfdosb.sed \ config.hin version.h CC = gcc HOSTCC = $(CC) INSTALL = copy /y MAKE = make SHELL = \bin\sh SED = sed ECHO = command /c echo CP = copy /y RM = del LN = copy /y MV = mv CHMOD = chmod LINT = lint TAR = tar LHA = lha SHAR = shar EXE = .exe OBJ = .o PROGRAM = fd ALIAS = fdsh DOSOBJS = unixdisk$(OBJ) IMEOBJS = ime$(OBJ) dict$(OBJ) roman$(OBJ) SCKOBJS = socket$(OBJ) url$(OBJ) auth$(OBJ) \ ftp$(OBJ) html$(OBJ) http$(OBJ) urldisk$(OBJ) OBJ1 = main$(OBJ) printf$(OBJ) termio$(OBJ) term$(OBJ) stream$(OBJ) \ string$(OBJ) malloc$(OBJ) time$(OBJ) OBJ2 = pathname$(OBJ) system$(OBJ) posixsh$(OBJ) doscom$(OBJ) \ log$(OBJ) sysemu$(OBJ) dosdisk$(OBJ) $(DOSOBJS) OBJ3 = realpath$(OBJ) encode$(OBJ) \ libc$(OBJ) file$(OBJ) mntinfo$(OBJ) statfs$(OBJ) apply$(OBJ) \ pty$(OBJ) termemu$(OBJ) frontend$(OBJ) backend$(OBJ) OBJ4 = parse$(OBJ) builtin$(OBJ) shell$(OBJ) OBJ5 = catalog$(OBJ) \ kconv$(OBJ) input$(OBJ) OBJ6 = info$(OBJ) rockridg$(OBJ) tree$(OBJ) \ lsparse$(OBJ) archive$(OBJ) \ custom$(OBJ) command$(OBJ) browse$(OBJ) SOBJ1 = sprintf$(OBJ) stermio$(OBJ) sstream$(OBJ) \ sstring$(OBJ) smalloc$(OBJ) stime$(OBJ) SOBJ2 = spathnam$(OBJ) ssystem$(OBJ) sposixsh$(OBJ) sdoscom$(OBJ) \ ssysemu$(OBJ) BOBJ = bprintf$(OBJ) btermio$(OBJ) bstream$(OBJ) \ bstring$(OBJ) bmalloc$(OBJ) \ bpathnam$(OBJ) bsystem$(OBJ) bdoscom$(OBJ) \ bsysemu$(OBJ) NOBJ1 = nprintf$(OBJ) ntermio$(OBJ) nstream$(OBJ) \ nstring$(OBJ) nmalloc$(OBJ) ntime$(OBJ) NOBJ2 = npathnam$(OBJ) nsystem$(OBJ) nposixsh$(OBJ) ndoscom$(OBJ) \ nsysemu$(OBJ) \ nrealpat$(OBJ) nencode$(OBJ) NOBJ3 = nparse$(OBJ) \ nsocket$(OBJ) nurl$(OBJ) nauth$(OBJ) \ nftp$(OBJ) nhtml$(OBJ) nhttp$(OBJ) nurldisk$(OBJ) \ nlsparse$(OBJ) KOBJ = tevalopt$(OBJ) COBJ = tevalopt$(OBJ) tgentbl$(OBJ) UOBJ = tevalopt$(OBJ) tgentbl$(OBJ) TOBJ = tstring$(OBJ) troman$(OBJ) tkconv$(OBJ) tevalopt$(OBJ) tgentbl$(OBJ) ALLOC = DEBUG = CFLAGS = -O HOSTCFLAGS = $(CFLAGS) CPPFLAGS = HOSTCPPFLAGS = $(CPPFLAGS) LDFLAGS = HOSTLDFLAGS = $(LDFLAGS) OSOPTS = -DDOSV COPTS = $(OSOPTS) $(DEBUG) $(CFLAGS) HOSTCOPTS = $(COPTS) FLDFLAGS = $(ALLOC) $(LDFLAGS) SLDFLAGS = $(ALLOC) $(LDFLAGS) NLDFLAGS = $(ALLOC) $(LDFLAGS) BUILDFLAGS = $(COPTS) $(CPPFLAGS) FDCFLAGS = $(BUILDFLAGS) -DFD=$(VERMAJ) SHCFLAGS = $(BUILDFLAGS) -DFDSH=$(VERMAJ) BSHCFLAGS = $(BUILDFLAGS) -DFDSH=$(VERMAJ) -DMINIMUMSHELL NSHCFLAGS = $(BUILDFLAGS) -DFDSH=$(VERMAJ) -DWITHNETWORK DEFCFLAGS = -DDEFRC='"'$(DOSRC)'"' .SUFFIXES: .h .c .o .exe ############################################################ # Dependency Rules ############################################################ all: $(PROGRAM)$(EXE) $(PROGRAM).$(MANSEC) $(TABLES) $(PROGRAM)$(EXE): $(OBJ1) $(OBJ2) $(OBJ3) $(OBJ4) $(OBJ5) $(OBJ6) $(ARGS) # @sleep 1 $(CC) -o $@ @$(ARGS) $(FLDFLAGS) @ren $@ $(PROGRAM) @aout2exe $(PROGRAM) @del $(PROGRAM) $(ARGS): $(OBJ1) $(OBJ2) $(OBJ3) $(OBJ4) $(OBJ5) $(OBJ6) # @sleep 1 @$(ECHO) $(OBJ1) > $(ARGS) @$(ECHO) $(OBJ2) >> $(ARGS) @$(ECHO) $(OBJ3) >> $(ARGS) @$(ECHO) $(OBJ4) >> $(ARGS) @$(ECHO) $(OBJ5) >> $(ARGS) @$(ECHO) $(OBJ6) >> $(ARGS) # @sleep 1 main$(OBJ): main.c $(CC) $(FDCFLAGS) $(DEFCFLAGS) -c -o $@ $*.c termio$(OBJ): termio.c $(CC) $(FDCFLAGS) -c -o $@ $*.c system$(OBJ): system.c $(CC) $(FDCFLAGS) $(DEFCFLAGS) -c -o $@ $*.c custom$(OBJ): custom.c $(CC) $(FDCFLAGS) -c -o $@ $*.c .c.o: $(CC) $(FDCFLAGS) -c -o $@ $*.c ############################################################ # kanji using module $(PROGRAM).$(MANSEC): kanjicnv$(EXE) $(JMANSRC) .\kanjicnv$(EXE) -s $(JMANSRC) $@ $(PROGRAM).$(MANSEC)c: kanjicnv$(EXE) $(JMANCAT) .\kanjicnv$(EXE) -s $(JMANCAT) $@ $(PROGRAM).eng: kanjicnv$(EXE) $(MANCAT) .\kanjicnv$(EXE) -b $(MANCAT) $@ $(PROGRAM).doc: kanjicnv$(EXE) $(JMANCAT) .\kanjicnv$(EXE) -s -b $(JMANCAT) $@ README.doc: kanjicnv$(EXE) README .\kanjicnv$(EXE) -s README $@ HISTORY.doc: kanjicnv$(EXE) HISTORY .\kanjicnv$(EXE) -s HISTORY $@ FAQ.doc: kanjicnv$(EXE) FAQ .\kanjicnv$(EXE) -s FAQ $@ LICENSES.doc: kanjicnv$(EXE) LICENSES .\kanjicnv$(EXE) -s LICENSES $@ kanjicnv$(EXE): kanjicnv$(OBJ) $(KOBJ) # @sleep 1 $(HOSTCC) $(HOSTCOPTS) $(HOSTLDFLAGS) -o $@ kanjicnv$(OBJ) $(KOBJ) @ren $@ kanjicnv @aout2exe kanjicnv @del kanjicnv # @sleep 1 kanjicnv$(OBJ): kanjicnv.c $(HOSTCC) $(HOSTCOPTS) $(HOSTCPPFLAGS) -c -o $@ $*.c ############################################################ # message catalog module kanji.h: mkkanji$(EXE) kanjicnv$(EXE) kanji.hin .\mkkanji$(EXE) kanji.hin | \ .\kanjicnv$(EXE) -s - $@ # @sleep 1 mkkanji$(EXE): mkkanji$(OBJ) # @sleep 1 $(HOSTCC) $(HOSTCOPTS) $(HOSTLDFLAGS) -o $@ mkkanji$(OBJ) @ren $@ mkkanji @aout2exe mkkanji @del mkkanji # @sleep 1 mkkanji$(OBJ): mkkanji.c $(HOSTCC) $(HOSTCOPTS) $(HOSTCPPFLAGS) -c -o $@ $*.c _fd-cat.ja: mkcat$(EXE) kanji.h .\mkcat$(EXE) -c 1 kanji.h $@ # @sleep 1 _fd-cat.C: mkcat$(EXE) kanji.h .\mkcat$(EXE) -c 2 kanji.h $@ # @sleep 1 fd-cat.ja: mkcat$(EXE) _fd-cat.ja .\mkcat$(EXE) _fd-cat.ja $@ fd-cat.C: mkcat$(EXE) _fd-cat.C .\mkcat$(EXE) _fd-cat.C $@ mkcat$(EXE): mkcat$(OBJ) $(COBJ) # @sleep 1 $(HOSTCC) $(HOSTCOPTS) $(HOSTLDFLAGS) -o $@ mkcat$(OBJ) $(COBJ) @ren $@ mkcat @aout2exe mkcat @del mkcat # @sleep 1 mkcat$(OBJ): mkcat.c $(HOSTCC) $(HOSTCOPTS) $(HOSTCPPFLAGS) -c -o $@ $*.c ############################################################ # function list using module funcno.h: mkfuncno$(EXE) .\mkfuncno$(EXE) $@ # @sleep 1 mkfuncno$(EXE): mkfuncno$(OBJ) # @sleep 1 $(HOSTCC) $(HOSTCOPTS) $(HOSTLDFLAGS) -o $@ mkfuncno$(OBJ) @ren $@ mkfuncno @aout2exe mkfuncno @del mkfuncno # @sleep 1 mkfuncno$(OBJ): mkfuncno.c $(HOSTCC) $(HOSTCOPTS) $(HOSTCPPFLAGS) -DFD=$(VERMAJ) -c -o $@ $*.c ############################################################ # UNICODE table generating module $(UNITBL): mkunitbl$(EXE) .\mkunitbl$(EXE) $@ unitbl.c: mkunitbl$(EXE) .\mkunitbl$(EXE) -t $@ $(DEPDIR)\unitbl.c: mkunitbl$(EXE) [ -d $(DEPDIR) ] || mkdir $(DEPDIR) .\mkunitbl$(EXE) -t -n $@ mkunitbl$(EXE): mkunitbl$(OBJ) $(UOBJ) # @sleep 1 $(HOSTCC) $(HOSTCOPTS) $(HOSTLDFLAGS) -o $@ mkunitbl$(OBJ) $(UOBJ) @ren $@ mkunitbl @aout2exe mkunitbl @del mkunitbl # @sleep 1 mkunitbl$(OBJ): mkunitbl.c $(HOSTCC) $(HOSTCOPTS) $(HOSTCPPFLAGS) -c -o $@ $*.c tunitbl$(OBJ): unitbl.c $(HOSTCC) $(HOSTCOPTS) $(HOSTCPPFLAGS) -c -o $@ unitbl.c ############################################################ # Kanji transfer table generating module $(DICTTBL): mkdict$(EXE) $(DICTSRC) .\mkdict$(EXE) $@ $(DICTSRC) dicttbl.c: mkdict$(EXE) $(DICTSRC) .\mkdict$(EXE) -t $@ $(DICTSRC) $(DEPDIR)\dicttbl.c: mkdict$(EXE) $(DICTSRC) [ -d $(DEPDIR) ] || mkdir $(DEPDIR) .\mkdict$(EXE) -t -n $@ $(DICTSRC) mkdict$(EXE): mkdict$(OBJ) $(TOBJ) # @sleep 1 $(HOSTCC) $(HOSTCOPTS) $(HOSTLDFLAGS) -o $@ mkdict$(OBJ) $(TOBJ) @ren $@ mkdict @aout2exe mkdict @del mkdict # @sleep 1 mktankan$(EXE): mktankan$(OBJ) $(TOBJ) # @sleep 1 $(HOSTCC) $(HOSTCOPTS) $(HOSTLDFLAGS) -o $@ mktankan$(OBJ) $(TOBJ) @ren $@ mktankan @aout2exe mktankan @del mktankan # @sleep 1 mkdict$(OBJ): mkdict.c $(HOSTCC) $(HOSTCOPTS) $(HOSTCPPFLAGS) -c -o $@ $*.c mktankan$(OBJ): mktankan.c $(HOSTCC) $(HOSTCOPTS) $(HOSTCPPFLAGS) -c -o $@ $*.c tstring$(OBJ): string.c $(HOSTCC) $(HOSTCOPTS) $(HOSTCPPFLAGS) -c -o $@ string.c troman$(OBJ): roman.c $(HOSTCC) $(HOSTCOPTS) $(HOSTCPPFLAGS) -c -o $@ roman.c tkconv$(OBJ): kconv.c $(HOSTCC) $(HOSTCOPTS) $(HOSTCPPFLAGS) -c -o $@ kconv.c tevalopt$(OBJ): evalopt.c $(HOSTCC) $(HOSTCOPTS) $(HOSTCPPFLAGS) -c -o $@ evalopt.c tgentbl$(OBJ): gentbl.c $(HOSTCC) $(HOSTCOPTS) $(HOSTCPPFLAGS) -c -o $@ gentbl.c rmdict: -$(RM) $(DICTTBL) $(DICTTXT): mktankan$(EXE) .\mktankan$(EXE) $@ # @sleep 1 ############################################################ # Directory generating module mkdir_p$(EXE): mkdir_p$(OBJ) # @sleep 1 $(HOSTCC) $(HOSTCOPTS) $(HOSTLDFLAGS) -o $@ mkdir_p$(OBJ) @ren $@ mkdir_p @aout2exe mkdir_p @del mkdir_p # @sleep 1 mkdir_p$(OBJ): mkdir_p.c $(HOSTCC) $(HOSTCOPTS) $(HOSTCPPFLAGS) -c -o $@ $*.c ############################################################ # to install all install: install-bin install-runcom install-man install-jman install-bin: $(PROGRAM)$(EXE) mkdir_p$(EXE) install-table [ -d $(BINDIR) ] || .\mkdir_p$(EXE) $(BINDIR) $(INSTALL) $(PROGRAM)$(EXE) $(BINDIR) $(CHMOD) a+rx $(BINDIR)\$(PROGRAM)$(EXE) -$(RM) $(BINDIR)\$(ALIAS)$(EXE) $(LN) $(BINDIR)\$(PROGRAM)$(EXE) $(BINDIR)\$(ALIAS)$(EXE) $(CHMOD) a+rx $(BINDIR)\$(ALIAS)$(EXE) install-runcom: -if [ -f $(RUNCOM) ]; then \ $(INSTALL) $(RUNCOM) $(BLDRC); \ $(CHMOD) a+r-x $(BLDRC); \ fi install-table: $(TABLE) mkdir_p$(EXE) -if [ -f $(UNITBL) ]; then \ [ -d $(BINDIR) ] || .\mkdir_p$(EXE) $(BINDIR); \ $(INSTALL) $(UNITBL) $(BINDIR); \ $(CHMOD) a+r-x $(BINDIR)\$(UNITBL); \ fi -if [ -f $(DICTTBL) ]; then \ [ -d $(BINDIR) ] || .\mkdir_p$(EXE) $(BINDIR); \ $(INSTALL) $(DICTTBL) $(BINDIR); \ $(CHMOD) a+r-x $(BINDIR)\$(DICTTBL); \ fi -if [ -f $(CATTBL) ]; then \ [ -d $(BINDIR) ] || .\mkdir_p$(EXE) $(BINDIR); \ $(INSTALL) $(CATTBL) $(BINDIR); \ $(CHMOD) a+r-x $(BINDIR)\$(CATTBL); \ fi -if [ -f $(ECATTBL) ]; then \ [ -d $(BINDIR) ] || .\mkdir_p$(EXE) $(BINDIR); \ $(INSTALL) $(ECATTBL) $(BINDIR); \ $(CHMOD) a+r-x $(BINDIR)\$(ECATTBL); \ fi install-man: $(MANSRC) mkdir_p$(EXE) [ -d $(MANDIR) ] || .\mkdir_p$(EXE) $(MANDIR) $(INSTALL) $(MANSRC) $(MANDIR)\$(PROGRAM).$(MANSEC) $(CHMOD) a+r-x $(MANDIR)\$(PROGRAM).$(MANSEC) -$(RM) $(MANDIR)\$(ALIAS).$(MANSEC) $(LN) $(MANDIR)\$(PROGRAM).$(MANSEC) $(MANDIR)\$(ALIAS).$(MANSEC) $(CHMOD) a+r-x $(MANDIR)\$(ALIAS).$(MANSEC) install-jman: $(PROGRAM).$(MANSEC) mkdir_p$(EXE) [ -d $(JMANDIR) ] || .\mkdir_p$(EXE) $(JMANDIR) [ "$(JMANDIR)" = "$(MANDIR)" ] || \ $(INSTALL) $(PROGRAM).$(MANSEC) $(JMANDIR)\$(PROGRAM).$(MANSEC) $(CHMOD) a+r-x $(JMANDIR)\$(PROGRAM).$(MANSEC) -$(RM) $(JMANDIR)\$(ALIAS).$(MANSEC) $(LN) $(JMANDIR)\$(PROGRAM).$(MANSEC) $(JMANDIR)\$(ALIAS).$(MANSEC) $(CHMOD) a+r-x $(JMANDIR)\$(ALIAS).$(MANSEC) catman: $(MANCAT) mkdir_p$(EXE) [ -d $(CATDIR) ] || .\mkdir_p$(EXE) $(CATDIR) $(INSTALL) $(MANCAT) $(CATDIR)\$(PROGRAM).$(MANSEC) $(CHMOD) a+r-x $(CATDIR)\$(PROGRAM).$(MANSEC) -$(RM) $(CATDIR)\$(ALIAS).$(MANSEC) $(LN) $(CATDIR)\$(PROGRAM).$(MANSEC) $(CATDIR)\$(ALIAS).$(MANSEC) $(CHMOD) a+r-x $(CATDIR)\$(ALIAS).$(MANSEC) catman-b: $(PROGRAM).eng mkdir_p$(EXE) [ -d $(CATDIR) ] || .\mkdir_p$(EXE) $(CATDIR) $(INSTALL) $(PROGRAM).eng $(CATDIR)\$(PROGRAM).$(MANSEC) $(CHMOD) a+r-x $(CATDIR)\$(PROGRAM).$(MANSEC) -$(RM) $(CATDIR)\$(ALIAS).$(MANSEC) $(LN) $(CATDIR)\$(PROGRAM).$(MANSEC) $(CATDIR)\$(ALIAS).$(MANSEC) $(CHMOD) a+r-x $(CATDIR)\$(ALIAS).$(MANSEC) compman: catman -$(RM) $(CATDIR)\$(ALIAS).$(MANSEC) compress -f $(CATDIR)\$(PROGRAM).$(MANSEC) -$(RM) $(CATDIR)\$(ALIAS).$(MANSEC).Z $(LN) $(CATDIR)\$(PROGRAM).$(MANSEC).Z $(CATDIR)\$(ALIAS).$(MANSEC).Z compman-b: catman-b -$(RM) $(CATDIR)\$(ALIAS).$(MANSEC) compress -f $(CATDIR)\$(PROGRAM).$(MANSEC) -$(RM) $(CATDIR)\$(ALIAS).$(MANSEC).Z $(LN) $(CATDIR)\$(PROGRAM).$(MANSEC).Z $(CATDIR)\$(ALIAS).$(MANSEC).Z jcatman: catman $(PROGRAM).$(MANSEC)c mkdir_p$(EXE) [ -d $(JCATDIR) ] || .\mkdir_p$(EXE) $(JCATDIR) $(INSTALL) $(PROGRAM).$(MANSEC)c $(JCATDIR)\$(PROGRAM).$(MANSEC) $(CHMOD) a+r-x $(JCATDIR)\$(PROGRAM).$(MANSEC) -$(RM) $(JCATDIR)\$(ALIAS).$(MANSEC) $(LN) $(JCATDIR)\$(PROGRAM).$(MANSEC) $(JCATDIR)\$(ALIAS).$(MANSEC) $(CHMOD) a+r-x $(JCATDIR)\$(ALIAS).$(MANSEC) jcatman-b: catman-b $(PROGRAM).doc mkdir_p$(EXE) [ -d $(JCATDIR) ] || .\mkdir_p$(EXE) $(JCATDIR) $(INSTALL) $(PROGRAM).doc $(JCATDIR)\$(PROGRAM).$(MANSEC) $(CHMOD) a+r-x $(JCATDIR)\$(PROGRAM).$(MANSEC) -$(RM) $(JCATDIR)\$(ALIAS).$(MANSEC) $(LN) $(JCATDIR)\$(PROGRAM).$(MANSEC) $(JCATDIR)\$(ALIAS).$(MANSEC) $(CHMOD) a+r-x $(JCATDIR)\$(ALIAS).$(MANSEC) jcompman: compman jcatman -$(RM) $(JCATDIR)\$(ALIAS).$(MANSEC) compress -f $(JCATDIR)\$(PROGRAM).$(MANSEC) -$(RM) $(JCATDIR)\$(ALIAS).$(MANSEC).Z $(LN) $(JCATDIR)\$(PROGRAM).$(MANSEC).Z $(JCATDIR)\$(ALIAS).$(MANSEC).Z jcompman-b: compman-b jcatman-b -$(RM) $(JCATDIR)\$(ALIAS).$(MANSEC) compress -f $(JCATDIR)\$(PROGRAM).$(MANSEC) -$(RM) $(JCATDIR)\$(ALIAS).$(MANSEC).Z $(LN) $(JCATDIR)\$(PROGRAM).$(MANSEC).Z $(JCATDIR)\$(ALIAS).$(MANSEC).Z ############################################################ # to make dependency depend: $(SRC) $(HSRC) $(DSRC) config.h kanji.h funcno.h [ -d $(DEPDIR) ] || mkdir $(DEPDIR) for f in $(SRC) $(HSRC); do \ $(SED) -e 's:^\(# *\)include "\(.*\).h":\1include "_\2.h":' \ $${f} > $(DEPDIR)\$${f}; \ done for f in $(DSRC); do \ $(SED) -e 's:^\(# *\)include "\(.*\).h":\1include "_\2.h":' \ $${f} > $${f}o; \ $(MV) $${f}o $${f}; \ done for f in $(SSRC); do \ $(RM) $(DEPDIR)\s$${f}; \ $(LN) $(DEPDIR)\$${f} $(DEPDIR)\s$${f}; \ done for f in $(BSRC); do \ $(RM) $(DEPDIR)\b$${f} && \ $(LN) $(DEPDIR)\$${f} $(DEPDIR)\b$${f}; \ done for f in $(NSRC); do \ $(RM) $(DEPDIR)\n$${f} && \ $(LN) $(DEPDIR)\$${f} $(DEPDIR)\n$${f}; \ done for f in $(TSRC); do \ $(RM) $(DEPDIR)\t$${f} && \ $(LN) $(DEPDIR)\$${f} $(DEPDIR)\t$${f}; \ done for f in $(HEADER) config.h kanji.h funcno.h version.h; do \ $(SED) -e 's:^\(# *\)include "\(.*\).h":\1include "_\2.h":' \ $${f} > $(DEPDIR)\_$${f}; \ done $(CP) Makefile.in Makefile.tmp $(DEPDIR) $(CP) Makefile.tmp $(DEPDIR)\Makefile.sh $(CP) Makefile.tmp $(DEPDIR)\Makefile.bsh $(CP) Makefile.tmp $(DEPDIR)\Makefile.nsh $(CP) Makefile.tmp $(DEPDIR)\Makefile.tr cd $(DEPDIR); makedepend \ -s "# DO NOT DELETE THIS LINE -- make depend depends on it." \ -f Makefile.tmp -- $(FDCFLAGS) -- \ $(SRC) \ `for f in $(DSRC); do $(ECHO) $${f}|$(SED) -e 's:^.*\::'; done` cd $(DEPDIR); makedepend \ -s "# DO NOT DELETE THIS LINE -- make depend depends on it." \ -f Makefile.sh -- $(SHCFLAGS) -- \ `for f in $(SSRC); do $(ECHO) s$${f}; done` cd $(DEPDIR); makedepend \ -s "# DO NOT DELETE THIS LINE -- make depend depends on it." \ -f Makefile.bsh -- $(BSHCFLAGS) -- \ `for f in $(BSRC); do $(ECHO) b$${f}; done` cd $(DEPDIR); makedepend \ -s "# DO NOT DELETE THIS LINE -- make depend depends on it." \ -f Makefile.nsh -- $(NSHCFLAGS) -- \ `for f in $(NSRC); do $(ECHO) n$${f}; done` cd $(DEPDIR); makedepend \ -s "# DO NOT DELETE THIS LINE -- make depend depends on it." \ -f Makefile.tr -- $(HOSTCOPTS) -- \ $(HSRC) \ `for f in $(TSRC); do $(ECHO) t$${f}; done` $(SED) -e '\^# DO NOT DELETE THIS LINE\,$$d' $(DEPDIR)\Makefile.in \ > Makefile.in $(ECHO) "# DO NOT DELETE THIS LINE -- make depend depends on it." \ >> Makefile.in $(SED) -e '1,\^# DO NOT DELETE THIS LINE\d' \ -e 's:^\(........\).*\.o:\1.o:' \ -e 's:\\[^ ]* *::g' \ -e 's:\.o:\$$(OBJ):g' \ -e 's:_\([^ ]*.h\):\1:g' \ -e 's: *$$::' \ -e '\: *$$\d' $(DEPDIR)\Makefile.tmp >> Makefile.in $(SED) -e '1,\^# DO NOT DELETE THIS LINE\d' \ -e 's:^\(........\).*\.o:\1.o:' \ -e 's:\\[^ ]* *::g' \ -e 's:\.o:\$$(OBJ):g' \ -e 's:_\([^ ]*.h\):\1:g' \ -e 's: *$$::' \ -e '\: *$$\d' $(DEPDIR)\Makefile.sh >> Makefile.in $(SED) -e '1,\^# DO NOT DELETE THIS LINE\d' \ -e 's:^\(........\).*\.o:\1.o:' \ -e 's:\\[^ ]* *::g' \ -e 's:\.o:\$$(OBJ):g' \ -e 's:_\([^ ]*.h\):\1:g' \ -e 's: *$$::' \ -e '\: *$$\d' $(DEPDIR)\Makefile.bsh >> Makefile.in $(SED) -e '1,\^# DO NOT DELETE THIS LINE\d' \ -e 's:^\(........\).*\.o:\1.o:' \ -e 's:\\[^ ]* *::g' \ -e 's:\.o:\$$(OBJ):g' \ -e 's:_\([^ ]*.h\):\1:g' \ -e 's: *$$::' \ -e '\: *$$\d' $(DEPDIR)\Makefile.nsh >> Makefile.in $(SED) -e '1,\^# DO NOT DELETE THIS LINE\d' \ -e 's:^\(........\).*\.o:\1.o:' \ -e 's:\\[^ ]* *::g' \ -e 's:\.o:\$$(OBJ):g' \ -e 's:_\([^ ]*.h\):\1:g' \ -e 's: *$$::' \ -e '\: *$$\d' $(DEPDIR)\Makefile.tr >> Makefile.in -rm -rf $(DEPDIR) ############################################################ # to verify sources lint: $(SRC) $(HSRC) config.h kanji.h funcno.h $(LINT) $(OSOPTS) -DFD=$(VERMAJ) `$(SED) -e "s:\$(OBJ):\.c:g" $(ARGS)` SRCS=`$(ECHO) $(UOBJ)|$(SED) -e "s:t\([^ ]*\)\$(OBJ):\1\.c:g"`; \ $(LINT) $(OSOPTS) mkunitbl.c $${SRCS} SRCS=`$(ECHO) $(TOBJ)|$(SED) -e "s:t\([^ ]*\)\$(OBJ):\1\.c:g"`; \ $(LINT) $(OSOPTS) mkdict.c $${SRCS}; \ $(LINT) $(OSOPTS) mktankan.c $${SRCS} $(LINT) $(OSOPTS) mkkanji.c SRCS=`$(ECHO) $(COBJ)|$(SED) -e "s:t\([^ ]*\)\$(OBJ):\1\.c:g"`; \ $(LINT) $(OSOPTS) mkcat.c $${SRCS} $(LINT) $(OSOPTS) mkdir_p.c SRCS=`$(ECHO) $(KOBJ)|$(SED) -e "s:t\([^ ]*\)\$(OBJ):\1\.c:g"`; \ $(LINT) $(OSOPTS) kanjicnv.c $${SRCS} $(LINT) $(OSOPTS) expfunc.c $(LINT) $(OSOPTS) mkfuncno.c ############################################################ # to make configuration file manually config: Configur expfunc.c -if ($(ECHO) 't() { echo $1; }; t test' | $(SHELL) >\dev\null 2>&1); then \ $(SED) -e "2,3d" -e "s:__cc__:gcc:" Configur \ | $(SHELL) > config.h; \ elif $(MAKE) -f Makefile.tmp expfunc$(EXE); then \ $(SED) -e "2,3d" -e "s:__cc__:gcc:" Configur \ | .\expfunc$(EXE) | $(SHELL) > config.h; \ fi # @sleep 1 config.h: config.hin $(CP) config.hin $@ # @sleep 1 expfunc$(EXE): expfunc$(OBJ) # @sleep 1 $(HOSTCC) $(HOSTCOPTS) $(HOSTLDFLAGS) -o $@ expfunc$(OBJ) @ren $@ expfunc @aout2exe expfunc @del expfunc # @sleep 1 expfunc$(OBJ): expfunc.c $(HOSTCC) $(HOSTCOPTS) $(HOSTCPPFLAGS) -c -o $@ $*.c ############################################################ # sample program for pseudo system(3) sh: fdsh$(EXE) fdsh$(EXE): $(SOBJ1) $(SOBJ2) $(SARGS) # @sleep 1 $(CC) -o $@ @$(SARGS) $(SLDFLAGS) @ren $@ fdsh @aout2exe fdsh @del fdsh $(SARGS): $(SOBJ1) $(SOBJ2) # @sleep 1 @$(ECHO) $(SOBJ1) > $(SARGS) @$(ECHO) $(SOBJ2) >> $(SARGS) # @sleep 1 sprintf$(OBJ): printf.c $(CC) $(SHCFLAGS) -c -o $@ printf.c stermio$(OBJ): termio.c $(CC) $(SHCFLAGS) -c -o $@ termio.c sstream$(OBJ): stream.c $(CC) $(SHCFLAGS) -c -o $@ stream.c sstring$(OBJ): string.c $(CC) $(SHCFLAGS) -c -o $@ string.c smalloc$(OBJ): malloc.c $(CC) $(SHCFLAGS) -c -o $@ malloc.c stime$(OBJ): time.c $(CC) $(SHCFLAGS) -c -o $@ time.c spathnam$(OBJ): pathname.c $(CC) $(SHCFLAGS) -c -o $@ pathname.c ssystem$(OBJ): system.c $(CC) $(SHCFLAGS) -c -o $@ system.c sposixsh$(OBJ): posixsh.c $(CC) $(SHCFLAGS) -c -o $@ posixsh.c sdoscom$(OBJ): doscom.c $(CC) $(SHCFLAGS) -c -o $@ doscom.c ssysemu$(OBJ): sysemu.c $(CC) $(SHCFLAGS) -c -o $@ sysemu.c ############################################################ # Bourne shell bsh: fdbsh$(EXE) fdbsh$(EXE): $(BOBJ) # @sleep 1 $(CC) -o $@ $(BOBJ) $(SLDFLAGS) @ren $@ fdbsh @aout2exe fdbsh @del fdbsh bprintf$(OBJ): printf.c $(CC) $(BSHCFLAGS) -c -o $@ printf.c btermio$(OBJ): termio.c $(CC) $(BSHCFLAGS) -c -o $@ termio.c bstream$(OBJ): stream.c $(CC) $(BSHCFLAGS) -c -o $@ stream.c bstring$(OBJ): string.c $(CC) $(BSHCFLAGS) -c -o $@ string.c bmalloc$(OBJ): malloc.c $(CC) $(BSHCFLAGS) -c -o $@ malloc.c bpathnam$(OBJ): pathname.c $(CC) $(BSHCFLAGS) -c -o $@ pathname.c bsystem$(OBJ): system.c $(CC) $(BSHCFLAGS) -c -o $@ system.c bdoscom$(OBJ): doscom.c $(CC) $(BSHCFLAGS) -c -o $@ doscom.c bsysemu$(OBJ): sysemu.c $(CC) $(BSHCFLAGS) -c -o $@ sysemu.c ############################################################ # Network shell nsh: fdnsh$(EXE) fdnsh$(EXE): $(NOBJ1) $(NOBJ2) $(NOBJ3) $(NARGS) # @sleep 1 $(CC) -o $@ @$(NARGS) $(NLDFLAGS) @ren $@ fdnsh @aout2exe fdnsh @del fdnsh $(NARGS): $(NOBJ1) $(NOBJ2) $(NOBJ3) # @sleep 1 @$(ECHO) $(NOBJ1) > $(NARGS) @$(ECHO) $(NOBJ2) >> $(NARGS) @$(ECHO) $(NOBJ3) >> $(NARGS) # @sleep 1 nprintf$(OBJ): printf.c $(CC) $(NSHCFLAGS) -c -o $@ printf.c ntermio$(OBJ): termio.c $(CC) $(NSHCFLAGS) -c -o $@ termio.c nstream$(OBJ): stream.c $(CC) $(NSHCFLAGS) -c -o $@ stream.c nstring$(OBJ): string.c $(CC) $(NSHCFLAGS) -c -o $@ string.c nmalloc$(OBJ): malloc.c $(CC) $(NSHCFLAGS) -c -o $@ malloc.c ntime$(OBJ): time.c $(CC) $(NSHCFLAGS) -c -o $@ time.c npathnam$(OBJ): pathname.c $(CC) $(NSHCFLAGS) -c -o $@ pathname.c nsystem$(OBJ): system.c $(CC) $(NSHCFLAGS) -c -o $@ system.c nposixsh$(OBJ): posixsh.c $(CC) $(NSHCFLAGS) -c -o $@ posixsh.c ndoscom$(OBJ): doscom.c $(CC) $(NSHCFLAGS) -c -o $@ doscom.c nsysemu$(OBJ): sysemu.c $(CC) $(NSHCFLAGS) -c -o $@ sysemu.c nrealpat$(OBJ): realpath.c $(CC) $(NSHCFLAGS) -c -o $@ realpath.c nencode$(OBJ): encode.c $(CC) $(NSHCFLAGS) -c -o $@ encode.c nparse$(OBJ): parse.c $(CC) $(NSHCFLAGS) -c -o $@ parse.c nsocket$(OBJ): socket.c $(CC) $(NSHCFLAGS) -c -o $@ socket.c nurl$(OBJ): url.c $(CC) $(NSHCFLAGS) -c -o $@ url.c nauth$(OBJ): auth.c $(CC) $(NSHCFLAGS) -c -o $@ auth.c nftp$(OBJ): ftp.c $(CC) $(NSHCFLAGS) -c -o $@ ftp.c nhtml$(OBJ): html.c $(CC) $(NSHCFLAGS) -c -o $@ html.c nhttp$(OBJ): http.c $(CC) $(NSHCFLAGS) -c -o $@ http.c nurldisk$(OBJ): urldisk.c $(CC) $(NSHCFLAGS) -c -o $@ urldisk.c nlsparse$(OBJ): lsparse.c $(CC) $(NSHCFLAGS) -c -o $@ lsparse.c ############################################################ # for programer's maintenance tar: $(SOURCES) $(TAR) cvf $(TITLE)$(VERSION).tar $(SOURCES) compress -f $(TITLE)$(VERSION).tar gtar: $(SOURCES) $(TAR) cvf $(TITLE)$(VERSION).tar $(SOURCES) gzip -f $(TITLE)$(VERSION).tar shtar: $(SHSOURCES) (VER=`date '+%y%m%d'`; \ $(TAR) cvf $(TITLE)sh-$${VER}.tar $(SHSOURCES); \ gzip -f $(TITLE)sh-$${VER}.tar) lzh: $(SOURCES) -$(RM) $(TITLE)$(VERSION).lzh $(LHA) a $(TITLE)$(VERSION).lzh $(SOURCES) shar: $(SOURCES) -$(RM) $(TITLE)$(VERSION).shar.[0-9][0-9] $(SHAR) -L50 -apc -n $(TITLE)$(VERSION) -o $(TITLE)$(VERSION).shar \ -T $(SRCS) -C $(JSRCS) ipk: $(PROGRAM)$(EXE) $(TABLES) mkdir_p$(EXE) -[ -d $(IPKWDIR)\$(BINDIR) ] || .\mkdir_p$(EXE) $(IPKWDIR)\$(BINDIR) -[ -d $(IPKWDIR)\$(BINDIR) ] || .\mkdir_p$(EXE) $(IPKWDIR)\$(BINDIR) -[ -d $(IPKWDIR)\$(BINDIR) ] || .\mkdir_p$(EXE) $(IPKWDIR)\$(BINDIR) -[ -d $(IPKWDIR)\$(CONFDIR) ] || .\mkdir_p$(EXE) $(IPKWDIR)\$(CONFDIR) -[ -d $(IPKWDIR)\CONTROL ] || .\mkdir_p$(EXE) $(IPKWDIR)\CONTROL -[ -d $(IPKTDIR) ] || .\mkdir_p$(EXE) $(IPKTDIR) $(CP) -p $(PROGRAM)$(EXE) $(IPKWDIR)\$(BINDIR) -[ -z "$(STRIP)" ] || $(STRIP) $(IPKWDIR)\$(BINDIR)\$(PROGRAM)$(EXE) $(CHMOD) a+rx $(IPKWDIR)\$(BINDIR)\$(PROGRAM)$(EXE) -$(RM) $(IPKWDIR)\$(BINDIR)\$(ALIAS)$(EXE) $(LN) $(IPKWDIR)\$(BINDIR)\$(PROGRAM)$(EXE) \ $(IPKWDIR)\$(BINDIR)\$(ALIAS)$(EXE) $(CHMOD) a+rx $(IPKWDIR)\$(BINDIR)\$(ALIAS)$(EXE) $(SED) -e 's:#TMPDIR=.*:TMPDIR=\home\tmp:' \ -e 's:#LANGUAGE=.*:LANGUAGE=euc:' \ -e 's:#INPUTKCODE=.*:INPUTKCODE=euc:' \ -e 's:#FNAMEKCODE=.*:FNAMEKCODE=utf8:' \ -e '\# launcher definition\,\^$$\ {' \ -e '\^$$\ {' \ -e 'i \' \ -e 'launch ".tar.Z" "gzip -cd %C|tar tvf -" "%a %u\%g %s %y-%m-%d %t %*f"' \ -e 'i \' \ -e 'launch ".taZ" "gzip -cd %C|tar tvf -" "%a %u\%g %s %y-%m-%d %t %*f"' \ -e 'i \' \ -e 'launch ".ipk" "gzip -cd %C|tar xOf - .\data.tar.gz|gzip -cd|tar tvf -" \\' \ -e 'i \' \ -e ' "%a %u\%g %s %y-%m-%d %t %*f"' \ -e 'i \' \ -e 'launch ".deb" "ar -p %C data.tar.gz|gzip -cd|tar tvf -" \\' \ -e 'i \' \ -e ' "%a %u\%g %s %y-%m-%d %t %*f"' \ -e '}' \ -e '}' \ -e '\# archiver definition\,\^$$\ {' \ -e '\^$$\ {' \ -e 'i \' \ -e 'arch ".tar.Z" "echo ERROR; false" "gzip -cd %C|tar xf - %TA"' \ -e 'i \' \ -e 'arch ".taZ" "echo ERROR; false" "gzip -cd %C|tar xf - %TA"' \ -e 'i \' \ -e 'arch ".ipk" "echo ERROR; false" \\' \ -e 'i \' \ -e ' "gzip -cd %C|tar xOf - .\data.tar.gz|gzip -cd|tar xf - %TA"' \ -e 'i \' \ -e 'arch ".deb" "echo ERROR; false" \\' \ -e 'i \' \ -e ' "ar -p %C data.tar.gz|gzip -cd|tar xf - %TA"' \ -e '}' \ -e '}' \ -e '$$ {' \ -e 'a \' \ -e 'if [ " $$TERM" = " vt100" -a " $$CONSOLE" = " \dev\console" ]; then' \ -e 'a \' \ -e ' keymap BS "^?"' \ -e 'a \' \ -e ' keymap DEL "\\033[3~"' \ -e 'a \' \ -e ' keymap HOME "\\033[H"' \ -e 'a \' \ -e ' keymap END "\\033[F"' \ -e 'a \' \ -e 'fi' \ -e '}' \ _fdrc > $(IPKWDIR)\$(BLDRC) $(CHMOD) a+r-x $(IPKWDIR)\$(BLDRC) -if [ -f $(UNITBL) ]; then \ cp -p $(UNITBL) $(IPKWDIR)\$(BINDIR); \ $(CHMOD) a+r-x $(IPKWDIR)\$(BINDIR)\$(UNITBL); \ fi -if [ -f $(DICTTBL) ]; then \ cp -p $(DICTTBL) $(IPKWDIR)\$(BINDIR); \ $(CHMOD) a+r-x $(IPKWDIR)\$(BINDIR)\$(DICTTBL); \ fi -if [ -f $(CATTBL) ]; then \ cp -p $(CATTBL) $(IPKWDIR)\$(BINDIR); \ $(CHMOD) a+r-x $(IPKWDIR)\$(BINDIR)\$(CATTBL); \ fi -if [ -f $(ECATTBL) ]; then \ cp -p $(ECATTBL) $(IPKWDIR)\$(BINDIR); \ $(CHMOD) a+r-x $(IPKWDIR)\$(BINDIR)\$(ECATTBL); \ fi $(ECHO) "Package: fd" > $(IPKWDIR)\CONTROL\control $(ECHO) "Priority: optional" >> $(IPKWDIR)\CONTROL\control $(ECHO) "Section: extras" >> $(IPKWDIR)\CONTROL\control $(ECHO) "Maintainer: $(DIST)" >> $(IPKWDIR)\CONTROL\control $(ECHO) "Architecture: arm" >> $(IPKWDIR)\CONTROL\control $(ECHO) "Version: $(VERSION)-1" >> $(IPKWDIR)\CONTROL\control $(ECHO) "Depends: ncurses" >> $(IPKWDIR)\CONTROL\control $(ECHO) "Description: a file & directory maintenance tool." \ >> $(IPKWDIR)\CONTROL\control (cd $(IPKWDIR); tar cf ..\data.tar --exclude=CONTROL .) (cd $(IPKWDIR)\CONTROL; tar cf ..\..\control.tar .) gzip .\data.tar $(MV) .\data.tar.gz $(IPKTDIR) gzip .\control.tar $(MV) .\control.tar.gz $(IPKTDIR) $(ECHO) "2.0" > $(IPKTDIR)\debian-binary (cd $(IPKTDIR); \ tar cf ..\ipk.tar .\debian-binary .\data.tar.gz .\control.tar.gz) gzip .\ipk.tar $(MV) .\ipk.tar.gz .\fd_$(VERSION)-1_arm.ipk -$(RM) -r $(IPKWDIR) $(IPKTDIR) clean: -$(RM) core -$(RM) *$(OBJ) -$(RM) funcno.h -$(RM) kanji.h -$(RM) _fd-cat.ja -$(RM) _fd-cat.C -$(RM) fd-cat.* -$(RM) kanjicnv$(EXE) -$(RM) expfunc$(EXE) -$(RM) mkdir_p$(EXE) -$(RM) mkfuncno$(EXE) -$(RM) mkunitbl$(EXE) -$(RM) mkdict$(EXE) -$(RM) mktankan$(EXE) -$(RM) mkkanji$(EXE) -$(RM) mkcat$(EXE) -$(RM) fdsh$(EXE) -$(RM) fdbsh$(EXE) -$(RM) fdnsh$(EXE) -$(RM) $(PROGRAM)$(EXE) -$(RM) $(PROGRAM).$(MANSEC) -$(RM) $(PROGRAM).$(MANSEC)c -$(RM) $(PROGRAM).eng -$(RM) $(PROGRAM).doc -$(RM) $(ARGS) -$(RM) $(SARGS) -$(RM) $(NARGS) -$(RM) $(UNITBL) -$(RM) unitbl.c -$(RM) dicttbl.c -$(RM) $(DICTTXT) -$(RM) $(DICTTBL) # DO NOT DELETE THIS LINE -- make depend depends on it. main$(OBJ): fd.h headers.h machine.h config.h main$(OBJ): depend.h printf.h main$(OBJ): stream.h kctype.h main$(OBJ): string.h malloc.h time.h log.h termio.h main$(OBJ): realpath.h main$(OBJ): parse.h kconv.h func.h sysemu.h dirent.h unixemu.h main$(OBJ): pathname.h main$(OBJ): typesize.h term.h types.h lsparse.h namelist.h dosdisk.h main$(OBJ): kanji.h catalog.h version.h system.h wait.h main$(OBJ): termemu.h roman.h urldisk.h url.h auth.h printf$(OBJ): headers.h machine.h config.h printf$(OBJ): depend.h printf.h stream.h kctype.h printf$(OBJ): typesize.h string.h printf$(OBJ): kconv.h termio$(OBJ): headers.h machine.h config.h termio$(OBJ): depend.h typesize.h sysemu.h dirent.h termio$(OBJ): unixemu.h termio$(OBJ): stream.h termio.h term$(OBJ): headers.h machine.h config.h term$(OBJ): depend.h printf.h term$(OBJ): stream.h kctype.h term$(OBJ): typesize.h string.h termio.h term$(OBJ): term.h stream$(OBJ): headers.h machine.h config.h stream$(OBJ): depend.h typesize.h malloc.h sysemu.h stream$(OBJ): dirent.h unixemu.h stream$(OBJ): stream.h pathname.h termio.h stream$(OBJ): socket.h string$(OBJ): headers.h machine.h config.h string$(OBJ): kctype.h depend.h string$(OBJ): string.h malloc$(OBJ): headers.h machine.h config.h malloc$(OBJ): printf.h stream.h depend.h malloc.h malloc$(OBJ): sysemu.h dirent.h unixemu.h time$(OBJ): headers.h machine.h config.h time$(OBJ): typesize.h time$(OBJ): string.h time.h pathname$(OBJ): fd.h headers.h machine.h config.h pathname$(OBJ): depend.h printf.h stream.h kctype.h pathname$(OBJ): string.h malloc.h pathname$(OBJ): dirent.h unixemu.h pathname$(OBJ): sysemu.h pathname.h typesize.h pathname$(OBJ): url.h system$(OBJ): fd.h headers.h machine.h config.h system$(OBJ): depend.h printf.h stream.h kctype.h system$(OBJ): string.h malloc.h system$(OBJ): term.h types.h typesize.h lsparse.h namelist.h kconv.h system$(OBJ): dirent.h unixemu.h system$(OBJ): sysemu.h system.h pathname.h termio.h system$(OBJ): wait.h system$(OBJ): termemu.h posixsh.h socket.h url.h system$(OBJ): urldisk.h auth.h posixsh$(OBJ): fd.h headers.h machine.h config.h posixsh$(OBJ): depend.h printf.h stream.h kctype.h posixsh$(OBJ): string.h malloc.h posixsh$(OBJ): sysemu.h dirent.h unixemu.h posixsh$(OBJ): system.h pathname.h typesize.h posixsh$(OBJ): termio.h posixsh$(OBJ): wait.h posixsh$(OBJ): termemu.h time.h posixsh.h term.h doscom$(OBJ): fd.h headers.h machine.h config.h doscom$(OBJ): depend.h printf.h stream.h kctype.h doscom$(OBJ): string.h malloc.h doscom$(OBJ): term.h types.h typesize.h lsparse.h namelist.h dirent.h doscom$(OBJ): unixemu.h doscom$(OBJ): sysemu.h system.h pathname.h termio.h doscom$(OBJ): wait.h doscom$(OBJ): realpath.h urldisk.h url.h auth.h log$(OBJ): fd.h headers.h machine.h config.h log$(OBJ): depend.h printf.h log$(OBJ): stream.h kctype.h log$(OBJ): string.h malloc.h func.h sysemu.h dirent.h unixemu.h log$(OBJ): pathname.h log$(OBJ): typesize.h term.h types.h lsparse.h namelist.h dosdisk.h sysemu$(OBJ): fd.h headers.h machine.h config.h sysemu$(OBJ): depend.h printf.h stream.h kctype.h sysemu$(OBJ): string.h malloc.h sysemu$(OBJ): kconv.h sysemu.h dirent.h unixemu.h sysemu$(OBJ): log.h pathname.h typesize.h termio.h sysemu$(OBJ): realpath.h dosdisk.h socket.h sysemu$(OBJ): urldisk.h namelist.h url.h auth.h dosdisk$(OBJ): headers.h machine.h config.h dosdisk$(OBJ): depend.h kctype.h dosdisk$(OBJ): string.h time.h sysemu.h dirent.h dosdisk$(OBJ): unixemu.h dosdisk$(OBJ): stream.h pathname.h typesize.h dosdisk.h unixdisk.h kconv.h unixdisk$(OBJ): headers.h machine.h config.h unixdisk$(OBJ): depend.h kctype.h unixdisk$(OBJ): string.h sysemu.h dirent.h unixemu.h unixdisk$(OBJ): stream.h unixdisk$(OBJ): pathname.h typesize.h dosdisk.h unixdisk.h realpath$(OBJ): fd.h headers.h machine.h config.h realpath$(OBJ): depend.h printf.h stream.h kctype.h realpath$(OBJ): string.h malloc.h realpath$(OBJ): sysemu.h dirent.h unixemu.h realpath$(OBJ): pathname.h typesize.h realpath.h realpath$(OBJ): url.h encode$(OBJ): headers.h machine.h config.h encode$(OBJ): kctype.h depend.h encode$(OBJ): sysemu.h dirent.h unixemu.h encode$(OBJ): stream.h encode$(OBJ): pathname.h typesize.h encode.h libc$(OBJ): fd.h headers.h machine.h config.h libc$(OBJ): depend.h printf.h libc$(OBJ): stream.h kctype.h libc$(OBJ): string.h malloc.h log.h realpath.h parse.h kconv.h func.h libc$(OBJ): sysemu.h dirent.h unixemu.h libc$(OBJ): pathname.h typesize.h term.h types.h libc$(OBJ): lsparse.h namelist.h dosdisk.h kanji.h catalog.h system.h libc$(OBJ): termio.h libc$(OBJ): wait.h libc$(OBJ): termemu.h url.h file$(OBJ): fd.h headers.h machine.h config.h file$(OBJ): depend.h printf.h file$(OBJ): stream.h kctype.h file$(OBJ): string.h malloc.h time.h termio.h file$(OBJ): realpath.h file$(OBJ): kconv.h func.h sysemu.h dirent.h unixemu.h file$(OBJ): pathname.h typesize.h term.h types.h file$(OBJ): lsparse.h namelist.h dosdisk.h kanji.h catalog.h urldisk.h file$(OBJ): url.h auth.h mntinfo$(OBJ): headers.h machine.h config.h mntinfo$(OBJ): kctype.h depend.h mntinfo$(OBJ): string.h malloc.h pathname.h mntinfo$(OBJ): typesize.h mntinfo.h fsinfo.h statfs$(OBJ): headers.h machine.h config.h statfs$(OBJ): fsinfo.h apply$(OBJ): fd.h headers.h machine.h config.h apply$(OBJ): depend.h printf.h stream.h kctype.h apply$(OBJ): string.h malloc.h apply$(OBJ): time.h realpath.h parse.h func.h sysemu.h dirent.h unixemu.h apply$(OBJ): pathname.h apply$(OBJ): typesize.h term.h types.h lsparse.h namelist.h dosdisk.h apply$(OBJ): kanji.h catalog.h pty$(OBJ): fd.h headers.h machine.h config.h pty$(OBJ): depend.h printf.h pty$(OBJ): stream.h kctype.h pty$(OBJ): string.h malloc.h sysemu.h dirent.h unixemu.h pty$(OBJ): pathname.h pty$(OBJ): typesize.h termio.h termemu$(OBJ): fd.h headers.h machine.h config.h termemu$(OBJ): depend.h printf.h stream.h kctype.h termemu$(OBJ): string.h malloc.h termemu$(OBJ): wait.h unixemu.h termio.h termemu$(OBJ): func.h sysemu.h dirent.h termemu$(OBJ): pathname.h termemu$(OBJ): typesize.h term.h types.h lsparse.h namelist.h dosdisk.h termemu$(OBJ): kanji.h catalog.h system.h termemu.h frontend$(OBJ): fd.h headers.h machine.h config.h frontend$(OBJ): depend.h printf.h stream.h kctype.h frontend$(OBJ): string.h malloc.h frontend$(OBJ): wait.h unixemu.h parse.h func.h frontend$(OBJ): sysemu.h dirent.h frontend$(OBJ): pathname.h typesize.h term.h frontend$(OBJ): types.h lsparse.h namelist.h dosdisk.h funcno.h kanji.h frontend$(OBJ): catalog.h system.h termio.h frontend$(OBJ): termemu.h frontend$(OBJ): roman.h backend$(OBJ): fd.h headers.h machine.h config.h backend$(OBJ): depend.h printf.h stream.h kctype.h backend$(OBJ): string.h malloc.h backend$(OBJ): termio.h backend$(OBJ): kconv.h func.h sysemu.h backend$(OBJ): dirent.h unixemu.h backend$(OBJ): pathname.h typesize.h term.h types.h backend$(OBJ): lsparse.h namelist.h dosdisk.h system.h wait.h backend$(OBJ): termemu.h parse$(OBJ): fd.h headers.h machine.h config.h parse$(OBJ): depend.h printf.h stream.h kctype.h parse$(OBJ): string.h malloc.h parse$(OBJ): pathname.h typesize.h term.h types.h lsparse.h namelist.h parse$(OBJ): kconv.h sysemu.h dirent.h unixemu.h parse$(OBJ): realpath.h parse.h system.h termio.h parse$(OBJ): wait.h builtin$(OBJ): fd.h headers.h machine.h config.h builtin$(OBJ): depend.h printf.h stream.h kctype.h builtin$(OBJ): string.h malloc.h builtin$(OBJ): encode.h parse.h kconv.h func.h sysemu.h dirent.h unixemu.h builtin$(OBJ): pathname.h builtin$(OBJ): typesize.h term.h types.h lsparse.h namelist.h dosdisk.h builtin$(OBJ): funcno.h kanji.h catalog.h system.h termio.h builtin$(OBJ): wait.h builtin$(OBJ): termemu.h roman.h shell$(OBJ): fd.h headers.h machine.h config.h shell$(OBJ): depend.h printf.h stream.h kctype.h shell$(OBJ): string.h malloc.h shell$(OBJ): realpath.h parse.h kconv.h func.h sysemu.h dirent.h unixemu.h shell$(OBJ): pathname.h shell$(OBJ): typesize.h term.h types.h lsparse.h namelist.h dosdisk.h shell$(OBJ): kanji.h catalog.h system.h termio.h shell$(OBJ): wait.h shell$(OBJ): termemu.h socket$(OBJ): headers.h machine.h config.h socket$(OBJ): depend.h printf.h stream.h kctype.h socket$(OBJ): typesize.h malloc.h socket$(OBJ): sysemu.h dirent.h unixemu.h socket$(OBJ): termio.h socket$(OBJ): socket.h url$(OBJ): headers.h machine.h config.h url$(OBJ): depend.h printf.h url$(OBJ): stream.h kctype.h url$(OBJ): typesize.h string.h malloc.h sysemu.h dirent.h unixemu.h url$(OBJ): pathname.h url.h auth$(OBJ): headers.h machine.h config.h auth$(OBJ): depend.h printf.h auth$(OBJ): stream.h string.h malloc.h time.h pathname.h typesize.h auth$(OBJ): encode.h parse.h socket.h auth.h url.h auth$(OBJ): system.h termio.h auth$(OBJ): wait.h auth$(OBJ): unixemu.h kanji.h catalog.h ftp$(OBJ): headers.h machine.h config.h ftp$(OBJ): depend.h printf.h ftp$(OBJ): stream.h kctype.h ftp$(OBJ): string.h malloc.h time.h sysemu.h dirent.h unixemu.h ftp$(OBJ): pathname.h ftp$(OBJ): typesize.h termio.h ftp$(OBJ): parse.h ftp$(OBJ): lsparse.h namelist.h socket.h auth.h ftp$(OBJ): url.h urldisk.h html$(OBJ): headers.h machine.h config.h html$(OBJ): depend.h printf.h html$(OBJ): stream.h kctype.h html$(OBJ): typesize.h string.h malloc.h sysemu.h dirent.h unixemu.h html$(OBJ): pathname.h termio.h html$(OBJ): parse.h html.h urldisk.h html$(OBJ): namelist.h url.h auth.h http$(OBJ): headers.h machine.h config.h http$(OBJ): depend.h printf.h http$(OBJ): stream.h kctype.h http$(OBJ): string.h malloc.h time.h sysemu.h dirent.h unixemu.h http$(OBJ): pathname.h http$(OBJ): typesize.h termio.h http$(OBJ): parse.h http$(OBJ): lsparse.h namelist.h socket.h auth.h http$(OBJ): url.h html.h urldisk.h urldisk$(OBJ): headers.h machine.h config.h urldisk$(OBJ): depend.h printf.h stream.h string.h urldisk$(OBJ): malloc.h time.h sysemu.h dirent.h unixemu.h urldisk$(OBJ): pathname.h urldisk$(OBJ): typesize.h termio.h urldisk$(OBJ): realpath.h urldisk$(OBJ): lsparse.h namelist.h socket.h urldisk$(OBJ): urldisk.h url.h auth.h catalog$(OBJ): fd.h headers.h machine.h config.h catalog$(OBJ): depend.h printf.h stream.h kctype.h catalog$(OBJ): string.h malloc.h catalog$(OBJ): termio.h catalog$(OBJ): func.h sysemu.h dirent.h catalog$(OBJ): unixemu.h catalog$(OBJ): pathname.h typesize.h term.h types.h lsparse.h namelist.h catalog$(OBJ): dosdisk.h kanji.h catalog.h kconv$(OBJ): fd.h headers.h machine.h config.h kconv$(OBJ): depend.h printf.h stream.h kctype.h kconv$(OBJ): string.h malloc.h kconv$(OBJ): termio.h kconv$(OBJ): realpath.h parse.h func.h kconv$(OBJ): sysemu.h dirent.h unixemu.h kconv$(OBJ): pathname.h typesize.h term.h types.h kconv$(OBJ): lsparse.h namelist.h dosdisk.h kconv.h termemu.h input$(OBJ): fd.h headers.h machine.h config.h input$(OBJ): depend.h printf.h stream.h kctype.h input$(OBJ): string.h malloc.h input$(OBJ): wait.h unixemu.h parse.h kconv.h func.h input$(OBJ): sysemu.h dirent.h input$(OBJ): pathname.h typesize.h term.h types.h lsparse.h namelist.h input$(OBJ): dosdisk.h kanji.h catalog.h system.h termio.h input$(OBJ): termemu.h ime$(OBJ): fd.h headers.h machine.h config.h ime$(OBJ): depend.h printf.h ime$(OBJ): stream.h kctype.h ime$(OBJ): string.h malloc.h wait.h unixemu.h ime$(OBJ): parse.h kconv.h roman.h func.h sysemu.h dirent.h ime$(OBJ): pathname.h ime$(OBJ): typesize.h term.h types.h lsparse.h namelist.h dosdisk.h ime$(OBJ): kanji.h catalog.h termemu.h dict$(OBJ): fd.h headers.h machine.h config.h dict$(OBJ): depend.h printf.h dict$(OBJ): stream.h kctype.h dict$(OBJ): string.h malloc.h termio.h dict$(OBJ): roman.h dict$(OBJ): hinsi.h func.h sysemu.h dirent.h unixemu.h dict$(OBJ): pathname.h typesize.h term.h types.h dict$(OBJ): lsparse.h namelist.h dosdisk.h parse.h kconv.h roman$(OBJ): headers.h machine.h config.h roman$(OBJ): depend.h kctype.h roman$(OBJ): typesize.h string.h kconv.h roman.h info$(OBJ): fd.h headers.h machine.h config.h info$(OBJ): depend.h printf.h info$(OBJ): stream.h kctype.h info$(OBJ): string.h malloc.h dirent.h unixemu.h info$(OBJ): sysemu.h pathname.h typesize.h term.h info$(OBJ): types.h lsparse.h namelist.h funcno.h kanji.h catalog.h info$(OBJ): unixdisk.h mntinfo.h fsinfo.h rockridg$(OBJ): fd.h headers.h machine.h config.h rockridg$(OBJ): depend.h printf.h stream.h kctype.h rockridg$(OBJ): string.h malloc.h rockridg$(OBJ): device.h parse.h func.h sysemu.h dirent.h unixemu.h rockridg$(OBJ): pathname.h rockridg$(OBJ): typesize.h term.h types.h lsparse.h namelist.h dosdisk.h tree$(OBJ): fd.h headers.h machine.h config.h tree$(OBJ): depend.h printf.h tree$(OBJ): stream.h kctype.h tree$(OBJ): string.h malloc.h func.h sysemu.h dirent.h unixemu.h tree$(OBJ): pathname.h tree$(OBJ): typesize.h term.h types.h lsparse.h namelist.h dosdisk.h tree$(OBJ): kanji.h catalog.h lsparse$(OBJ): fd.h headers.h machine.h config.h lsparse$(OBJ): depend.h printf.h stream.h kctype.h lsparse$(OBJ): string.h malloc.h lsparse$(OBJ): time.h dirent.h unixemu.h lsparse$(OBJ): pathname.h typesize.h device.h lsparse$(OBJ): parse.h lsparse.h namelist.h kconv.h archive$(OBJ): fd.h headers.h machine.h config.h archive$(OBJ): depend.h printf.h stream.h kctype.h archive$(OBJ): string.h malloc.h archive$(OBJ): realpath.h kconv.h func.h sysemu.h dirent.h unixemu.h archive$(OBJ): pathname.h archive$(OBJ): typesize.h term.h types.h lsparse.h namelist.h dosdisk.h archive$(OBJ): kanji.h catalog.h system.h termio.h archive$(OBJ): wait.h archive$(OBJ): termemu.h custom$(OBJ): fd.h headers.h machine.h config.h custom$(OBJ): depend.h printf.h stream.h kctype.h custom$(OBJ): string.h malloc.h custom$(OBJ): parse.h kconv.h func.h sysemu.h dirent.h unixemu.h custom$(OBJ): pathname.h custom$(OBJ): typesize.h term.h types.h lsparse.h namelist.h dosdisk.h custom$(OBJ): funcno.h kanji.h catalog.h system.h termio.h custom$(OBJ): wait.h custom$(OBJ): termemu.h urldisk.h url.h auth.h command$(OBJ): fd.h headers.h machine.h config.h command$(OBJ): depend.h printf.h stream.h kctype.h command$(OBJ): string.h malloc.h command$(OBJ): parse.h func.h sysemu.h dirent.h unixemu.h command$(OBJ): pathname.h command$(OBJ): typesize.h term.h types.h lsparse.h namelist.h dosdisk.h command$(OBJ): funcno.h kanji.h catalog.h system.h termio.h command$(OBJ): wait.h command$(OBJ): termemu.h functabl.h browse$(OBJ): fd.h headers.h machine.h config.h browse$(OBJ): depend.h printf.h stream.h kctype.h browse$(OBJ): string.h malloc.h browse$(OBJ): device.h parse.h kconv.h func.h sysemu.h dirent.h unixemu.h browse$(OBJ): pathname.h browse$(OBJ): typesize.h term.h types.h lsparse.h namelist.h dosdisk.h browse$(OBJ): funcno.h kanji.h catalog.h termemu.h unitbl$(OBJ): headers.h machine.h config.h dicttbl$(OBJ): headers.h machine.h config.h sprintf$(OBJ): headers.h machine.h config.h sprintf$(OBJ): depend.h printf.h stream.h kctype.h sprintf$(OBJ): typesize.h string.h stermio$(OBJ): headers.h machine.h config.h stermio$(OBJ): depend.h typesize.h sysemu.h dirent.h stermio$(OBJ): unixemu.h stermio$(OBJ): stream.h termio.h sstream$(OBJ): headers.h machine.h config.h sstream$(OBJ): depend.h typesize.h malloc.h sysemu.h sstream$(OBJ): dirent.h unixemu.h sstream$(OBJ): stream.h pathname.h termio.h sstring$(OBJ): headers.h machine.h config.h sstring$(OBJ): kctype.h depend.h sstring$(OBJ): string.h smalloc$(OBJ): headers.h machine.h config.h smalloc$(OBJ): printf.h stream.h depend.h malloc.h smalloc$(OBJ): sysemu.h dirent.h unixemu.h stime$(OBJ): headers.h machine.h config.h stime$(OBJ): typesize.h string.h time.h spathnam$(OBJ): headers.h machine.h config.h spathnam$(OBJ): depend.h spathnam$(OBJ): printf.h stream.h kctype.h spathnam$(OBJ): string.h malloc.h dirent.h unixemu.h spathnam$(OBJ): sysemu.h spathnam$(OBJ): pathname.h typesize.h ssystem$(OBJ): headers.h machine.h config.h ssystem$(OBJ): depend.h printf.h stream.h kctype.h ssystem$(OBJ): string.h malloc.h ssystem$(OBJ): dirent.h unixemu.h ssystem$(OBJ): sysemu.h system.h pathname.h ssystem$(OBJ): typesize.h termio.h ssystem$(OBJ): wait.h ssystem$(OBJ): termemu.h time.h posixsh.h sposixsh$(OBJ): headers.h machine.h config.h sposixsh$(OBJ): depend.h printf.h stream.h kctype.h sposixsh$(OBJ): string.h malloc.h sposixsh$(OBJ): sysemu.h dirent.h unixemu.h sposixsh$(OBJ): system.h pathname.h typesize.h sposixsh$(OBJ): termio.h sposixsh$(OBJ): wait.h sposixsh$(OBJ): termemu.h time.h posixsh.h sdoscom$(OBJ): headers.h machine.h config.h sdoscom$(OBJ): depend.h printf.h stream.h kctype.h sdoscom$(OBJ): string.h malloc.h sdoscom$(OBJ): dirent.h unixemu.h sdoscom$(OBJ): sysemu.h system.h pathname.h sdoscom$(OBJ): typesize.h termio.h sdoscom$(OBJ): wait.h ssysemu$(OBJ): headers.h machine.h config.h ssysemu$(OBJ): depend.h printf.h stream.h kctype.h ssysemu$(OBJ): string.h malloc.h ssysemu$(OBJ): sysemu.h dirent.h unixemu.h ssysemu$(OBJ): log.h pathname.h typesize.h termio.h ssysemu$(OBJ): realpath.h bprintf$(OBJ): headers.h machine.h config.h bprintf$(OBJ): depend.h printf.h stream.h kctype.h bprintf$(OBJ): typesize.h string.h btermio$(OBJ): headers.h machine.h config.h btermio$(OBJ): depend.h typesize.h sysemu.h dirent.h btermio$(OBJ): unixemu.h btermio$(OBJ): stream.h termio.h bstream$(OBJ): headers.h machine.h config.h bstream$(OBJ): depend.h typesize.h malloc.h sysemu.h bstream$(OBJ): dirent.h unixemu.h bstream$(OBJ): stream.h pathname.h termio.h bstring$(OBJ): headers.h machine.h config.h bstring$(OBJ): kctype.h depend.h bstring$(OBJ): string.h bmalloc$(OBJ): headers.h machine.h config.h bmalloc$(OBJ): printf.h stream.h depend.h malloc.h bmalloc$(OBJ): sysemu.h dirent.h unixemu.h bpathnam$(OBJ): headers.h machine.h config.h bpathnam$(OBJ): depend.h bpathnam$(OBJ): printf.h stream.h kctype.h bpathnam$(OBJ): string.h malloc.h dirent.h unixemu.h bpathnam$(OBJ): sysemu.h bpathnam$(OBJ): pathname.h typesize.h bsystem$(OBJ): headers.h machine.h config.h bsystem$(OBJ): depend.h printf.h stream.h kctype.h bsystem$(OBJ): string.h malloc.h bsystem$(OBJ): dirent.h unixemu.h bsystem$(OBJ): sysemu.h system.h pathname.h bsystem$(OBJ): typesize.h termio.h bsystem$(OBJ): wait.h bsystem$(OBJ): termemu.h bdoscom$(OBJ): headers.h machine.h config.h bdoscom$(OBJ): depend.h printf.h stream.h kctype.h bdoscom$(OBJ): string.h malloc.h bdoscom$(OBJ): dirent.h unixemu.h bdoscom$(OBJ): sysemu.h system.h pathname.h bdoscom$(OBJ): typesize.h termio.h bdoscom$(OBJ): wait.h bsysemu$(OBJ): headers.h machine.h config.h bsysemu$(OBJ): depend.h printf.h stream.h kctype.h bsysemu$(OBJ): string.h malloc.h bsysemu$(OBJ): sysemu.h dirent.h unixemu.h bsysemu$(OBJ): log.h pathname.h typesize.h termio.h bsysemu$(OBJ): realpath.h nprintf$(OBJ): headers.h machine.h config.h nprintf$(OBJ): depend.h printf.h stream.h kctype.h nprintf$(OBJ): typesize.h string.h ntermio$(OBJ): headers.h machine.h config.h ntermio$(OBJ): depend.h typesize.h sysemu.h dirent.h ntermio$(OBJ): unixemu.h ntermio$(OBJ): stream.h termio.h nstream$(OBJ): headers.h machine.h config.h nstream$(OBJ): depend.h typesize.h malloc.h sysemu.h nstream$(OBJ): dirent.h unixemu.h nstream$(OBJ): stream.h pathname.h termio.h nstream$(OBJ): socket.h nstring$(OBJ): headers.h machine.h config.h nstring$(OBJ): kctype.h depend.h nstring$(OBJ): string.h nmalloc$(OBJ): headers.h machine.h config.h nmalloc$(OBJ): printf.h stream.h depend.h malloc.h nmalloc$(OBJ): sysemu.h dirent.h unixemu.h ntime$(OBJ): headers.h machine.h config.h ntime$(OBJ): typesize.h string.h time.h npathnam$(OBJ): headers.h machine.h config.h npathnam$(OBJ): depend.h npathnam$(OBJ): printf.h stream.h kctype.h npathnam$(OBJ): string.h malloc.h dirent.h unixemu.h npathnam$(OBJ): sysemu.h npathnam$(OBJ): pathname.h typesize.h url.h nsystem$(OBJ): headers.h machine.h config.h nsystem$(OBJ): depend.h printf.h stream.h kctype.h nsystem$(OBJ): string.h malloc.h nsystem$(OBJ): dirent.h unixemu.h nsystem$(OBJ): sysemu.h system.h pathname.h nsystem$(OBJ): typesize.h termio.h nsystem$(OBJ): wait.h nsystem$(OBJ): termemu.h time.h posixsh.h socket.h nsystem$(OBJ): url.h urldisk.h namelist.h auth.h nposixsh$(OBJ): headers.h machine.h config.h nposixsh$(OBJ): depend.h printf.h stream.h kctype.h nposixsh$(OBJ): string.h malloc.h nposixsh$(OBJ): sysemu.h dirent.h unixemu.h nposixsh$(OBJ): system.h pathname.h typesize.h nposixsh$(OBJ): termio.h nposixsh$(OBJ): wait.h nposixsh$(OBJ): termemu.h time.h posixsh.h ndoscom$(OBJ): headers.h machine.h config.h ndoscom$(OBJ): depend.h printf.h stream.h kctype.h ndoscom$(OBJ): string.h malloc.h ndoscom$(OBJ): dirent.h unixemu.h ndoscom$(OBJ): sysemu.h system.h pathname.h ndoscom$(OBJ): typesize.h termio.h ndoscom$(OBJ): wait.h ndoscom$(OBJ): realpath.h urldisk.h namelist.h url.h ndoscom$(OBJ): auth.h nsysemu$(OBJ): headers.h machine.h config.h nsysemu$(OBJ): depend.h printf.h stream.h kctype.h nsysemu$(OBJ): string.h malloc.h nsysemu$(OBJ): sysemu.h dirent.h unixemu.h nsysemu$(OBJ): log.h pathname.h typesize.h termio.h nsysemu$(OBJ): realpath.h socket.h nsysemu$(OBJ): urldisk.h namelist.h url.h auth.h nrealpat$(OBJ): headers.h machine.h config.h nrealpat$(OBJ): depend.h nrealpat$(OBJ): printf.h stream.h kctype.h nrealpat$(OBJ): string.h sysemu.h dirent.h unixemu.h nrealpat$(OBJ): pathname.h nrealpat$(OBJ): typesize.h realpath.h url.h nencode$(OBJ): headers.h machine.h config.h nencode$(OBJ): kctype.h depend.h nencode$(OBJ): sysemu.h dirent.h unixemu.h nencode$(OBJ): stream.h nencode$(OBJ): pathname.h typesize.h encode.h nparse$(OBJ): headers.h machine.h config.h nparse$(OBJ): depend.h printf.h stream.h kctype.h nparse$(OBJ): string.h malloc.h nparse$(OBJ): sysemu.h dirent.h unixemu.h nparse$(OBJ): realpath.h parse.h system.h nparse$(OBJ): pathname.h typesize.h termio.h nparse$(OBJ): wait.h nsocket$(OBJ): headers.h machine.h config.h nsocket$(OBJ): depend.h printf.h stream.h kctype.h nsocket$(OBJ): typesize.h malloc.h nsocket$(OBJ): sysemu.h dirent.h unixemu.h nsocket$(OBJ): termio.h nsocket$(OBJ): socket.h nurl$(OBJ): headers.h machine.h config.h nurl$(OBJ): depend.h printf.h nurl$(OBJ): stream.h kctype.h nurl$(OBJ): typesize.h string.h malloc.h sysemu.h dirent.h unixemu.h nurl$(OBJ): pathname.h url.h nauth$(OBJ): headers.h machine.h config.h nauth$(OBJ): depend.h printf.h stream.h string.h nauth$(OBJ): malloc.h time.h pathname.h typesize.h encode.h parse.h nauth$(OBJ): socket.h auth.h url.h system.h nauth$(OBJ): termio.h nauth$(OBJ): wait.h unixemu.h nauth$(OBJ): sysemu.h dirent.h nftp$(OBJ): headers.h machine.h config.h nftp$(OBJ): depend.h printf.h nftp$(OBJ): stream.h kctype.h nftp$(OBJ): string.h malloc.h time.h sysemu.h dirent.h unixemu.h nftp$(OBJ): pathname.h nftp$(OBJ): typesize.h termio.h nftp$(OBJ): parse.h nftp$(OBJ): lsparse.h namelist.h socket.h auth.h nftp$(OBJ): url.h urldisk.h nhtml$(OBJ): headers.h machine.h config.h nhtml$(OBJ): depend.h printf.h stream.h kctype.h nhtml$(OBJ): typesize.h string.h nhtml$(OBJ): malloc.h sysemu.h dirent.h unixemu.h nhtml$(OBJ): pathname.h termio.h nhtml$(OBJ): parse.h html.h urldisk.h nhtml$(OBJ): namelist.h url.h auth.h nhttp$(OBJ): headers.h machine.h config.h nhttp$(OBJ): depend.h printf.h stream.h kctype.h nhttp$(OBJ): string.h malloc.h nhttp$(OBJ): time.h sysemu.h dirent.h unixemu.h nhttp$(OBJ): pathname.h typesize.h termio.h nhttp$(OBJ): parse.h lsparse.h namelist.h nhttp$(OBJ): socket.h auth.h url.h html.h nhttp$(OBJ): urldisk.h nurldisk$(OBJ): headers.h machine.h config.h nurldisk$(OBJ): depend.h printf.h stream.h string.h nurldisk$(OBJ): malloc.h time.h sysemu.h dirent.h unixemu.h nurldisk$(OBJ): pathname.h nurldisk$(OBJ): typesize.h termio.h nurldisk$(OBJ): realpath.h nurldisk$(OBJ): lsparse.h namelist.h socket.h nurldisk$(OBJ): urldisk.h url.h auth.h nlsparse$(OBJ): headers.h machine.h config.h nlsparse$(OBJ): depend.h kctype.h nlsparse$(OBJ): string.h malloc.h time.h dirent.h nlsparse$(OBJ): unixemu.h nlsparse$(OBJ): pathname.h typesize.h device.h parse.h lsparse.h namelist.h evalopt$(OBJ): headers.h machine.h config.h evalopt$(OBJ): evalopt.h gentbl$(OBJ): headers.h machine.h config.h gentbl$(OBJ): gentbl.h mkunitbl$(OBJ): headers.h machine.h config.h mkunitbl$(OBJ): typesize.h evalopt.h gentbl.h mkdict$(OBJ): headers.h machine.h config.h mkdict$(OBJ): kctype.h depend.h mkdict$(OBJ): typesize.h string.h kconv.h roman.h mkdict$(OBJ): hinsi.h evalopt.h gentbl.h mktankan$(OBJ): headers.h machine.h config.h mktankan$(OBJ): kctype.h depend.h mktankan$(OBJ): typesize.h kconv.h roman.h mkkanji$(OBJ): headers.h machine.h config.h mkkanji$(OBJ): typesize.h mkcat$(OBJ): headers.h machine.h config.h mkcat$(OBJ): kctype.h depend.h mkcat$(OBJ): typesize.h version.h evalopt.h gentbl.h mkdir_p$(OBJ): headers.h machine.h config.h mkdir_p$(OBJ): kctype.h depend.h mkdir_p$(OBJ): typesize.h kanjicnv$(OBJ): headers.h machine.h config.h kanjicnv$(OBJ): evalopt.h expfunc$(OBJ): headers.h machine.h config.h mkfuncno$(OBJ): fd.h headers.h machine.h config.h mkfuncno$(OBJ): depend.h types.h typesize.h stream.h mkfuncno$(OBJ): lsparse.h namelist.h functabl.h tstring$(OBJ): headers.h machine.h config.h tstring$(OBJ): kctype.h depend.h tstring$(OBJ): string.h troman$(OBJ): headers.h machine.h config.h troman$(OBJ): depend.h kctype.h troman$(OBJ): typesize.h string.h kconv.h roman.h tkconv$(OBJ): headers.h machine.h config.h tkconv$(OBJ): depend.h kctype.h tkconv$(OBJ): typesize.h string.h unixemu.h kconv.h tkconv$(OBJ): termemu.h pathname.h tevalopt$(OBJ): headers.h machine.h config.h tevalopt$(OBJ): evalopt.h tgentbl$(OBJ): headers.h machine.h config.h tgentbl$(OBJ): gentbl.h tunitbl$(OBJ): headers.h machine.h config.h FD-3.01j/makefile.g98100644 2105 1751 153616 13516612560 13043 0ustar shiraiuser# # Makefile for fd # TITLE = FD- VERMAJ = 3 VERSION = 3.01j PREFIX = CONFDIR = BUILD = MANSEC = 1 BINTOP = $(PREFIX)\bin BINDIR = $(BUILD)$(BINTOP) DATATOP = $(PREFIX)\share DATADIR = $(BUILD)$(DATATOP)\fd MANTOP = $(PREFIX)\man MANDIR = $(BUILD)$(MANTOP)\man$(MANSEC) CATDIR = $(BUILD)$(MANTOP)\cat$(MANSEC) JMANDIR = $(BUILD)$(MANTOP)\man$(MANSEC) JCATDIR = $(BUILD)$(MANTOP)\cat$(MANSEC) IPKWDIR = .\ipk.work IPKTDIR = .\ipk.tmp DEPDIR = .\depend.tmp DIST = none DEFRC = $(CONFDIR)\fd2rc BLDRC = $(BUILD)$(DEFRC) DOSRC = ~FD\\fd2rc UNITBL = fd-unicd.tbl DICTTBL = fd-dict.tbl DICTTXT = fd-dict.txt DICTSRC = CATTBL = fd-cat.ja ECATTBL = fd-cat.C TABLES = $(UNITBL) $(CATTBL) $(ECATTBL) SRC = main.c printf.c termio.c term.c stream.c \ string.c malloc.c time.c \ pathname.c system.c posixsh.c doscom.c \ log.c sysemu.c dosdisk.c unixdisk.c \ realpath.c encode.c \ libc.c file.c mntinfo.c statfs.c apply.c \ pty.c termemu.c frontend.c backend.c \ parse.c builtin.c shell.c \ socket.c url.c auth.c \ ftp.c html.c http.c urldisk.c \ catalog.c \ kconv.c input.c ime.c dict.c roman.c \ info.c rockridg.c tree.c \ lsparse.c archive.c \ custom.c command.c browse.c HSRC = evalopt.c gentbl.c \ mkunitbl.c mkdict.c mktankan.c \ mkkanji.c mkcat.c mkdir_p.c \ kanjicnv.c expfunc.c \ mkfuncno.c DSRC = $(DEPDIR)\unitbl.c $(DEPDIR)\dicttbl.c HEADER = fd.h \ headers.h machine.h \ depend.h \ printf.h kctype.h typesize.h \ string.h malloc.h time.h \ dirent.h sysemu.h log.h \ pathname.h system.h posixsh.h wait.h \ termio.h term.h stream.h \ types.h namelist.h \ dosdisk.h unixdisk.h unixemu.h \ realpath.h encode.h termemu.h \ mntinfo.h fsinfo.h device.h parse.h lsparse.h \ socket.h url.h auth.h html.h urldisk.h \ catalog.h \ evalopt.h gentbl.h \ kconv.h roman.h hinsi.h \ func.h functabl.h SSRC = printf.c termio.c stream.c \ string.c malloc.c time.c \ pathname.c system.c posixsh.c doscom.c \ sysemu.c BSRC = printf.c termio.c stream.c \ string.c malloc.c \ pathname.c system.c doscom.c \ sysemu.c NSRC = printf.c termio.c stream.c \ string.c malloc.c time.c \ pathname.c system.c posixsh.c doscom.c \ sysemu.c \ realpath.c encode.c \ parse.c \ socket.c url.c auth.c \ ftp.c html.c http.c urldisk.c \ lsparse.c TSRC = string.c roman.c kconv.c evalopt.c gentbl.c unitbl.c DOC = README.eng HISTORY.eng FAQ.eng TECHKNOW.eng \ Install.eng ToAdmin.eng LICENSES.eng JDOC = README HISTORY FAQ TECHKNOW \ Install ToAdmin LICENSES MANSRC = fd_e.man MANCAT = fd_e.cat JMANSRC = fd.man JMANCAT = fd.cat RUNCOM = fdrc ARGS = object.arg SARGS = sobject.arg NARGS = nobject.arg SRCS = $(DOC) $(MANSRC) $(MANCAT) \ Configur Makefile Makefile.in $(SRC) $(HSRC) $(HEADER) \ makefile.gpc makefile.g98 \ makefile.dpc makefile.d98 \ makefile.lpc makefile.l98 \ makefile.bpc makefile.b98 \ mkmfdosg.sed mkmfdosd.sed mkmfdosl.sed mkmfdosb.sed \ mkmfsed.c \ config.hin version.h \ _fdrc _fdrc.dif fd.spec JSRCS = $(JDOC) $(JMANSRC) $(JMANCAT) \ kanji.hin SOURCES = $(SRCS) $(JSRCS) SHSOURCES = $(NSRC) \ headers.h machine.h \ depend.h \ printf.h kctype.h typesize.h \ string.h malloc.h time.h \ dirent.h sysemu.h log.h \ pathname.h system.h posixsh.h wait.h \ termio.h stream.h \ namelist.h \ unixemu.h \ realpath.h encode.h \ device.h parse.h lsparse.h \ socket.h url.h auth.h html.h urldisk.h \ kanjicnv.c expfunc.c mkmfsed.c \ Configur Makefile Makefile.in \ makefile.gpc makefile.g98 \ makefile.dpc makefile.d98 \ makefile.lpc makefile.l98 \ makefile.bpc makefile.b98 \ mkmfdosg.sed mkmfdosd.sed mkmfdosl.sed mkmfdosb.sed \ config.hin version.h CC = gcc HOSTCC = $(CC) INSTALL = copy /y MAKE = make SHELL = \bin\sh SED = sed ECHO = command /c echo CP = copy /y RM = del LN = copy /y MV = mv CHMOD = chmod LINT = lint TAR = tar LHA = lha SHAR = shar EXE = .exe OBJ = .o PROGRAM = fd ALIAS = fdsh DOSOBJS = unixdisk$(OBJ) IMEOBJS = ime$(OBJ) dict$(OBJ) roman$(OBJ) SCKOBJS = socket$(OBJ) url$(OBJ) auth$(OBJ) \ ftp$(OBJ) html$(OBJ) http$(OBJ) urldisk$(OBJ) OBJ1 = main$(OBJ) printf$(OBJ) termio$(OBJ) term$(OBJ) stream$(OBJ) \ string$(OBJ) malloc$(OBJ) time$(OBJ) OBJ2 = pathname$(OBJ) system$(OBJ) posixsh$(OBJ) doscom$(OBJ) \ log$(OBJ) sysemu$(OBJ) dosdisk$(OBJ) $(DOSOBJS) OBJ3 = realpath$(OBJ) encode$(OBJ) \ libc$(OBJ) file$(OBJ) mntinfo$(OBJ) statfs$(OBJ) apply$(OBJ) \ pty$(OBJ) termemu$(OBJ) frontend$(OBJ) backend$(OBJ) OBJ4 = parse$(OBJ) builtin$(OBJ) shell$(OBJ) OBJ5 = catalog$(OBJ) \ kconv$(OBJ) input$(OBJ) OBJ6 = info$(OBJ) rockridg$(OBJ) tree$(OBJ) \ lsparse$(OBJ) archive$(OBJ) \ custom$(OBJ) command$(OBJ) browse$(OBJ) SOBJ1 = sprintf$(OBJ) stermio$(OBJ) sstream$(OBJ) \ sstring$(OBJ) smalloc$(OBJ) stime$(OBJ) SOBJ2 = spathnam$(OBJ) ssystem$(OBJ) sposixsh$(OBJ) sdoscom$(OBJ) \ ssysemu$(OBJ) BOBJ = bprintf$(OBJ) btermio$(OBJ) bstream$(OBJ) \ bstring$(OBJ) bmalloc$(OBJ) \ bpathnam$(OBJ) bsystem$(OBJ) bdoscom$(OBJ) \ bsysemu$(OBJ) NOBJ1 = nprintf$(OBJ) ntermio$(OBJ) nstream$(OBJ) \ nstring$(OBJ) nmalloc$(OBJ) ntime$(OBJ) NOBJ2 = npathnam$(OBJ) nsystem$(OBJ) nposixsh$(OBJ) ndoscom$(OBJ) \ nsysemu$(OBJ) \ nrealpat$(OBJ) nencode$(OBJ) NOBJ3 = nparse$(OBJ) \ nsocket$(OBJ) nurl$(OBJ) nauth$(OBJ) \ nftp$(OBJ) nhtml$(OBJ) nhttp$(OBJ) nurldisk$(OBJ) \ nlsparse$(OBJ) KOBJ = tevalopt$(OBJ) COBJ = tevalopt$(OBJ) tgentbl$(OBJ) UOBJ = tevalopt$(OBJ) tgentbl$(OBJ) TOBJ = tstring$(OBJ) troman$(OBJ) tkconv$(OBJ) tevalopt$(OBJ) tgentbl$(OBJ) ALLOC = DEBUG = CFLAGS = -O HOSTCFLAGS = $(CFLAGS) CPPFLAGS = HOSTCPPFLAGS = $(CPPFLAGS) LDFLAGS = HOSTLDFLAGS = $(LDFLAGS) OSOPTS = -DPC98 COPTS = $(OSOPTS) $(DEBUG) $(CFLAGS) HOSTCOPTS = $(COPTS) FLDFLAGS = $(ALLOC) $(LDFLAGS) SLDFLAGS = $(ALLOC) $(LDFLAGS) NLDFLAGS = $(ALLOC) $(LDFLAGS) BUILDFLAGS = $(COPTS) $(CPPFLAGS) FDCFLAGS = $(BUILDFLAGS) -DFD=$(VERMAJ) SHCFLAGS = $(BUILDFLAGS) -DFDSH=$(VERMAJ) BSHCFLAGS = $(BUILDFLAGS) -DFDSH=$(VERMAJ) -DMINIMUMSHELL NSHCFLAGS = $(BUILDFLAGS) -DFDSH=$(VERMAJ) -DWITHNETWORK DEFCFLAGS = -DDEFRC='"'$(DOSRC)'"' .SUFFIXES: .h .c .o .exe ############################################################ # Dependency Rules ############################################################ all: $(PROGRAM)$(EXE) $(PROGRAM).$(MANSEC) $(TABLES) $(PROGRAM)$(EXE): $(OBJ1) $(OBJ2) $(OBJ3) $(OBJ4) $(OBJ5) $(OBJ6) $(ARGS) # @sleep 1 $(CC) -o $@ @$(ARGS) $(FLDFLAGS) @ren $@ $(PROGRAM) @aout2exe $(PROGRAM) @del $(PROGRAM) $(ARGS): $(OBJ1) $(OBJ2) $(OBJ3) $(OBJ4) $(OBJ5) $(OBJ6) # @sleep 1 @$(ECHO) $(OBJ1) > $(ARGS) @$(ECHO) $(OBJ2) >> $(ARGS) @$(ECHO) $(OBJ3) >> $(ARGS) @$(ECHO) $(OBJ4) >> $(ARGS) @$(ECHO) $(OBJ5) >> $(ARGS) @$(ECHO) $(OBJ6) >> $(ARGS) # @sleep 1 main$(OBJ): main.c $(CC) $(FDCFLAGS) $(DEFCFLAGS) -c -o $@ $*.c termio$(OBJ): termio.c $(CC) $(FDCFLAGS) -c -o $@ $*.c system$(OBJ): system.c $(CC) $(FDCFLAGS) $(DEFCFLAGS) -c -o $@ $*.c custom$(OBJ): custom.c $(CC) $(FDCFLAGS) -c -o $@ $*.c .c.o: $(CC) $(FDCFLAGS) -c -o $@ $*.c ############################################################ # kanji using module $(PROGRAM).$(MANSEC): kanjicnv$(EXE) $(JMANSRC) .\kanjicnv$(EXE) -s $(JMANSRC) $@ $(PROGRAM).$(MANSEC)c: kanjicnv$(EXE) $(JMANCAT) .\kanjicnv$(EXE) -s $(JMANCAT) $@ $(PROGRAM).eng: kanjicnv$(EXE) $(MANCAT) .\kanjicnv$(EXE) -b $(MANCAT) $@ $(PROGRAM).doc: kanjicnv$(EXE) $(JMANCAT) .\kanjicnv$(EXE) -s -b $(JMANCAT) $@ README.doc: kanjicnv$(EXE) README .\kanjicnv$(EXE) -s README $@ HISTORY.doc: kanjicnv$(EXE) HISTORY .\kanjicnv$(EXE) -s HISTORY $@ FAQ.doc: kanjicnv$(EXE) FAQ .\kanjicnv$(EXE) -s FAQ $@ LICENSES.doc: kanjicnv$(EXE) LICENSES .\kanjicnv$(EXE) -s LICENSES $@ kanjicnv$(EXE): kanjicnv$(OBJ) $(KOBJ) # @sleep 1 $(HOSTCC) $(HOSTCOPTS) $(HOSTLDFLAGS) -o $@ kanjicnv$(OBJ) $(KOBJ) @ren $@ kanjicnv @aout2exe kanjicnv @del kanjicnv # @sleep 1 kanjicnv$(OBJ): kanjicnv.c $(HOSTCC) $(HOSTCOPTS) $(HOSTCPPFLAGS) -c -o $@ $*.c ############################################################ # message catalog module kanji.h: mkkanji$(EXE) kanjicnv$(EXE) kanji.hin .\mkkanji$(EXE) kanji.hin | \ .\kanjicnv$(EXE) -s - $@ # @sleep 1 mkkanji$(EXE): mkkanji$(OBJ) # @sleep 1 $(HOSTCC) $(HOSTCOPTS) $(HOSTLDFLAGS) -o $@ mkkanji$(OBJ) @ren $@ mkkanji @aout2exe mkkanji @del mkkanji # @sleep 1 mkkanji$(OBJ): mkkanji.c $(HOSTCC) $(HOSTCOPTS) $(HOSTCPPFLAGS) -c -o $@ $*.c _fd-cat.ja: mkcat$(EXE) kanji.h .\mkcat$(EXE) -c 1 kanji.h $@ # @sleep 1 _fd-cat.C: mkcat$(EXE) kanji.h .\mkcat$(EXE) -c 2 kanji.h $@ # @sleep 1 fd-cat.ja: mkcat$(EXE) _fd-cat.ja .\mkcat$(EXE) _fd-cat.ja $@ fd-cat.C: mkcat$(EXE) _fd-cat.C .\mkcat$(EXE) _fd-cat.C $@ mkcat$(EXE): mkcat$(OBJ) $(COBJ) # @sleep 1 $(HOSTCC) $(HOSTCOPTS) $(HOSTLDFLAGS) -o $@ mkcat$(OBJ) $(COBJ) @ren $@ mkcat @aout2exe mkcat @del mkcat # @sleep 1 mkcat$(OBJ): mkcat.c $(HOSTCC) $(HOSTCOPTS) $(HOSTCPPFLAGS) -c -o $@ $*.c ############################################################ # function list using module funcno.h: mkfuncno$(EXE) .\mkfuncno$(EXE) $@ # @sleep 1 mkfuncno$(EXE): mkfuncno$(OBJ) # @sleep 1 $(HOSTCC) $(HOSTCOPTS) $(HOSTLDFLAGS) -o $@ mkfuncno$(OBJ) @ren $@ mkfuncno @aout2exe mkfuncno @del mkfuncno # @sleep 1 mkfuncno$(OBJ): mkfuncno.c $(HOSTCC) $(HOSTCOPTS) $(HOSTCPPFLAGS) -DFD=$(VERMAJ) -c -o $@ $*.c ############################################################ # UNICODE table generating module $(UNITBL): mkunitbl$(EXE) .\mkunitbl$(EXE) $@ unitbl.c: mkunitbl$(EXE) .\mkunitbl$(EXE) -t $@ $(DEPDIR)\unitbl.c: mkunitbl$(EXE) [ -d $(DEPDIR) ] || mkdir $(DEPDIR) .\mkunitbl$(EXE) -t -n $@ mkunitbl$(EXE): mkunitbl$(OBJ) $(UOBJ) # @sleep 1 $(HOSTCC) $(HOSTCOPTS) $(HOSTLDFLAGS) -o $@ mkunitbl$(OBJ) $(UOBJ) @ren $@ mkunitbl @aout2exe mkunitbl @del mkunitbl # @sleep 1 mkunitbl$(OBJ): mkunitbl.c $(HOSTCC) $(HOSTCOPTS) $(HOSTCPPFLAGS) -c -o $@ $*.c tunitbl$(OBJ): unitbl.c $(HOSTCC) $(HOSTCOPTS) $(HOSTCPPFLAGS) -c -o $@ unitbl.c ############################################################ # Kanji transfer table generating module $(DICTTBL): mkdict$(EXE) $(DICTSRC) .\mkdict$(EXE) $@ $(DICTSRC) dicttbl.c: mkdict$(EXE) $(DICTSRC) .\mkdict$(EXE) -t $@ $(DICTSRC) $(DEPDIR)\dicttbl.c: mkdict$(EXE) $(DICTSRC) [ -d $(DEPDIR) ] || mkdir $(DEPDIR) .\mkdict$(EXE) -t -n $@ $(DICTSRC) mkdict$(EXE): mkdict$(OBJ) $(TOBJ) # @sleep 1 $(HOSTCC) $(HOSTCOPTS) $(HOSTLDFLAGS) -o $@ mkdict$(OBJ) $(TOBJ) @ren $@ mkdict @aout2exe mkdict @del mkdict # @sleep 1 mktankan$(EXE): mktankan$(OBJ) $(TOBJ) # @sleep 1 $(HOSTCC) $(HOSTCOPTS) $(HOSTLDFLAGS) -o $@ mktankan$(OBJ) $(TOBJ) @ren $@ mktankan @aout2exe mktankan @del mktankan # @sleep 1 mkdict$(OBJ): mkdict.c $(HOSTCC) $(HOSTCOPTS) $(HOSTCPPFLAGS) -c -o $@ $*.c mktankan$(OBJ): mktankan.c $(HOSTCC) $(HOSTCOPTS) $(HOSTCPPFLAGS) -c -o $@ $*.c tstring$(OBJ): string.c $(HOSTCC) $(HOSTCOPTS) $(HOSTCPPFLAGS) -c -o $@ string.c troman$(OBJ): roman.c $(HOSTCC) $(HOSTCOPTS) $(HOSTCPPFLAGS) -c -o $@ roman.c tkconv$(OBJ): kconv.c $(HOSTCC) $(HOSTCOPTS) $(HOSTCPPFLAGS) -c -o $@ kconv.c tevalopt$(OBJ): evalopt.c $(HOSTCC) $(HOSTCOPTS) $(HOSTCPPFLAGS) -c -o $@ evalopt.c tgentbl$(OBJ): gentbl.c $(HOSTCC) $(HOSTCOPTS) $(HOSTCPPFLAGS) -c -o $@ gentbl.c rmdict: -$(RM) $(DICTTBL) $(DICTTXT): mktankan$(EXE) .\mktankan$(EXE) $@ # @sleep 1 ############################################################ # Directory generating module mkdir_p$(EXE): mkdir_p$(OBJ) # @sleep 1 $(HOSTCC) $(HOSTCOPTS) $(HOSTLDFLAGS) -o $@ mkdir_p$(OBJ) @ren $@ mkdir_p @aout2exe mkdir_p @del mkdir_p # @sleep 1 mkdir_p$(OBJ): mkdir_p.c $(HOSTCC) $(HOSTCOPTS) $(HOSTCPPFLAGS) -c -o $@ $*.c ############################################################ # to install all install: install-bin install-runcom install-man install-jman install-bin: $(PROGRAM)$(EXE) mkdir_p$(EXE) install-table [ -d $(BINDIR) ] || .\mkdir_p$(EXE) $(BINDIR) $(INSTALL) $(PROGRAM)$(EXE) $(BINDIR) $(CHMOD) a+rx $(BINDIR)\$(PROGRAM)$(EXE) -$(RM) $(BINDIR)\$(ALIAS)$(EXE) $(LN) $(BINDIR)\$(PROGRAM)$(EXE) $(BINDIR)\$(ALIAS)$(EXE) $(CHMOD) a+rx $(BINDIR)\$(ALIAS)$(EXE) install-runcom: -if [ -f $(RUNCOM) ]; then \ $(INSTALL) $(RUNCOM) $(BLDRC); \ $(CHMOD) a+r-x $(BLDRC); \ fi install-table: $(TABLE) mkdir_p$(EXE) -if [ -f $(UNITBL) ]; then \ [ -d $(BINDIR) ] || .\mkdir_p$(EXE) $(BINDIR); \ $(INSTALL) $(UNITBL) $(BINDIR); \ $(CHMOD) a+r-x $(BINDIR)\$(UNITBL); \ fi -if [ -f $(DICTTBL) ]; then \ [ -d $(BINDIR) ] || .\mkdir_p$(EXE) $(BINDIR); \ $(INSTALL) $(DICTTBL) $(BINDIR); \ $(CHMOD) a+r-x $(BINDIR)\$(DICTTBL); \ fi -if [ -f $(CATTBL) ]; then \ [ -d $(BINDIR) ] || .\mkdir_p$(EXE) $(BINDIR); \ $(INSTALL) $(CATTBL) $(BINDIR); \ $(CHMOD) a+r-x $(BINDIR)\$(CATTBL); \ fi -if [ -f $(ECATTBL) ]; then \ [ -d $(BINDIR) ] || .\mkdir_p$(EXE) $(BINDIR); \ $(INSTALL) $(ECATTBL) $(BINDIR); \ $(CHMOD) a+r-x $(BINDIR)\$(ECATTBL); \ fi install-man: $(MANSRC) mkdir_p$(EXE) [ -d $(MANDIR) ] || .\mkdir_p$(EXE) $(MANDIR) $(INSTALL) $(MANSRC) $(MANDIR)\$(PROGRAM).$(MANSEC) $(CHMOD) a+r-x $(MANDIR)\$(PROGRAM).$(MANSEC) -$(RM) $(MANDIR)\$(ALIAS).$(MANSEC) $(LN) $(MANDIR)\$(PROGRAM).$(MANSEC) $(MANDIR)\$(ALIAS).$(MANSEC) $(CHMOD) a+r-x $(MANDIR)\$(ALIAS).$(MANSEC) install-jman: $(PROGRAM).$(MANSEC) mkdir_p$(EXE) [ -d $(JMANDIR) ] || .\mkdir_p$(EXE) $(JMANDIR) [ "$(JMANDIR)" = "$(MANDIR)" ] || \ $(INSTALL) $(PROGRAM).$(MANSEC) $(JMANDIR)\$(PROGRAM).$(MANSEC) $(CHMOD) a+r-x $(JMANDIR)\$(PROGRAM).$(MANSEC) -$(RM) $(JMANDIR)\$(ALIAS).$(MANSEC) $(LN) $(JMANDIR)\$(PROGRAM).$(MANSEC) $(JMANDIR)\$(ALIAS).$(MANSEC) $(CHMOD) a+r-x $(JMANDIR)\$(ALIAS).$(MANSEC) catman: $(MANCAT) mkdir_p$(EXE) [ -d $(CATDIR) ] || .\mkdir_p$(EXE) $(CATDIR) $(INSTALL) $(MANCAT) $(CATDIR)\$(PROGRAM).$(MANSEC) $(CHMOD) a+r-x $(CATDIR)\$(PROGRAM).$(MANSEC) -$(RM) $(CATDIR)\$(ALIAS).$(MANSEC) $(LN) $(CATDIR)\$(PROGRAM).$(MANSEC) $(CATDIR)\$(ALIAS).$(MANSEC) $(CHMOD) a+r-x $(CATDIR)\$(ALIAS).$(MANSEC) catman-b: $(PROGRAM).eng mkdir_p$(EXE) [ -d $(CATDIR) ] || .\mkdir_p$(EXE) $(CATDIR) $(INSTALL) $(PROGRAM).eng $(CATDIR)\$(PROGRAM).$(MANSEC) $(CHMOD) a+r-x $(CATDIR)\$(PROGRAM).$(MANSEC) -$(RM) $(CATDIR)\$(ALIAS).$(MANSEC) $(LN) $(CATDIR)\$(PROGRAM).$(MANSEC) $(CATDIR)\$(ALIAS).$(MANSEC) $(CHMOD) a+r-x $(CATDIR)\$(ALIAS).$(MANSEC) compman: catman -$(RM) $(CATDIR)\$(ALIAS).$(MANSEC) compress -f $(CATDIR)\$(PROGRAM).$(MANSEC) -$(RM) $(CATDIR)\$(ALIAS).$(MANSEC).Z $(LN) $(CATDIR)\$(PROGRAM).$(MANSEC).Z $(CATDIR)\$(ALIAS).$(MANSEC).Z compman-b: catman-b -$(RM) $(CATDIR)\$(ALIAS).$(MANSEC) compress -f $(CATDIR)\$(PROGRAM).$(MANSEC) -$(RM) $(CATDIR)\$(ALIAS).$(MANSEC).Z $(LN) $(CATDIR)\$(PROGRAM).$(MANSEC).Z $(CATDIR)\$(ALIAS).$(MANSEC).Z jcatman: catman $(PROGRAM).$(MANSEC)c mkdir_p$(EXE) [ -d $(JCATDIR) ] || .\mkdir_p$(EXE) $(JCATDIR) $(INSTALL) $(PROGRAM).$(MANSEC)c $(JCATDIR)\$(PROGRAM).$(MANSEC) $(CHMOD) a+r-x $(JCATDIR)\$(PROGRAM).$(MANSEC) -$(RM) $(JCATDIR)\$(ALIAS).$(MANSEC) $(LN) $(JCATDIR)\$(PROGRAM).$(MANSEC) $(JCATDIR)\$(ALIAS).$(MANSEC) $(CHMOD) a+r-x $(JCATDIR)\$(ALIAS).$(MANSEC) jcatman-b: catman-b $(PROGRAM).doc mkdir_p$(EXE) [ -d $(JCATDIR) ] || .\mkdir_p$(EXE) $(JCATDIR) $(INSTALL) $(PROGRAM).doc $(JCATDIR)\$(PROGRAM).$(MANSEC) $(CHMOD) a+r-x $(JCATDIR)\$(PROGRAM).$(MANSEC) -$(RM) $(JCATDIR)\$(ALIAS).$(MANSEC) $(LN) $(JCATDIR)\$(PROGRAM).$(MANSEC) $(JCATDIR)\$(ALIAS).$(MANSEC) $(CHMOD) a+r-x $(JCATDIR)\$(ALIAS).$(MANSEC) jcompman: compman jcatman -$(RM) $(JCATDIR)\$(ALIAS).$(MANSEC) compress -f $(JCATDIR)\$(PROGRAM).$(MANSEC) -$(RM) $(JCATDIR)\$(ALIAS).$(MANSEC).Z $(LN) $(JCATDIR)\$(PROGRAM).$(MANSEC).Z $(JCATDIR)\$(ALIAS).$(MANSEC).Z jcompman-b: compman-b jcatman-b -$(RM) $(JCATDIR)\$(ALIAS).$(MANSEC) compress -f $(JCATDIR)\$(PROGRAM).$(MANSEC) -$(RM) $(JCATDIR)\$(ALIAS).$(MANSEC).Z $(LN) $(JCATDIR)\$(PROGRAM).$(MANSEC).Z $(JCATDIR)\$(ALIAS).$(MANSEC).Z ############################################################ # to make dependency depend: $(SRC) $(HSRC) $(DSRC) config.h kanji.h funcno.h [ -d $(DEPDIR) ] || mkdir $(DEPDIR) for f in $(SRC) $(HSRC); do \ $(SED) -e 's:^\(# *\)include "\(.*\).h":\1include "_\2.h":' \ $${f} > $(DEPDIR)\$${f}; \ done for f in $(DSRC); do \ $(SED) -e 's:^\(# *\)include "\(.*\).h":\1include "_\2.h":' \ $${f} > $${f}o; \ $(MV) $${f}o $${f}; \ done for f in $(SSRC); do \ $(RM) $(DEPDIR)\s$${f}; \ $(LN) $(DEPDIR)\$${f} $(DEPDIR)\s$${f}; \ done for f in $(BSRC); do \ $(RM) $(DEPDIR)\b$${f} && \ $(LN) $(DEPDIR)\$${f} $(DEPDIR)\b$${f}; \ done for f in $(NSRC); do \ $(RM) $(DEPDIR)\n$${f} && \ $(LN) $(DEPDIR)\$${f} $(DEPDIR)\n$${f}; \ done for f in $(TSRC); do \ $(RM) $(DEPDIR)\t$${f} && \ $(LN) $(DEPDIR)\$${f} $(DEPDIR)\t$${f}; \ done for f in $(HEADER) config.h kanji.h funcno.h version.h; do \ $(SED) -e 's:^\(# *\)include "\(.*\).h":\1include "_\2.h":' \ $${f} > $(DEPDIR)\_$${f}; \ done $(CP) Makefile.in Makefile.tmp $(DEPDIR) $(CP) Makefile.tmp $(DEPDIR)\Makefile.sh $(CP) Makefile.tmp $(DEPDIR)\Makefile.bsh $(CP) Makefile.tmp $(DEPDIR)\Makefile.nsh $(CP) Makefile.tmp $(DEPDIR)\Makefile.tr cd $(DEPDIR); makedepend \ -s "# DO NOT DELETE THIS LINE -- make depend depends on it." \ -f Makefile.tmp -- $(FDCFLAGS) -- \ $(SRC) \ `for f in $(DSRC); do $(ECHO) $${f}|$(SED) -e 's:^.*\::'; done` cd $(DEPDIR); makedepend \ -s "# DO NOT DELETE THIS LINE -- make depend depends on it." \ -f Makefile.sh -- $(SHCFLAGS) -- \ `for f in $(SSRC); do $(ECHO) s$${f}; done` cd $(DEPDIR); makedepend \ -s "# DO NOT DELETE THIS LINE -- make depend depends on it." \ -f Makefile.bsh -- $(BSHCFLAGS) -- \ `for f in $(BSRC); do $(ECHO) b$${f}; done` cd $(DEPDIR); makedepend \ -s "# DO NOT DELETE THIS LINE -- make depend depends on it." \ -f Makefile.nsh -- $(NSHCFLAGS) -- \ `for f in $(NSRC); do $(ECHO) n$${f}; done` cd $(DEPDIR); makedepend \ -s "# DO NOT DELETE THIS LINE -- make depend depends on it." \ -f Makefile.tr -- $(HOSTCOPTS) -- \ $(HSRC) \ `for f in $(TSRC); do $(ECHO) t$${f}; done` $(SED) -e '\^# DO NOT DELETE THIS LINE\,$$d' $(DEPDIR)\Makefile.in \ > Makefile.in $(ECHO) "# DO NOT DELETE THIS LINE -- make depend depends on it." \ >> Makefile.in $(SED) -e '1,\^# DO NOT DELETE THIS LINE\d' \ -e 's:^\(........\).*\.o:\1.o:' \ -e 's:\\[^ ]* *::g' \ -e 's:\.o:\$$(OBJ):g' \ -e 's:_\([^ ]*.h\):\1:g' \ -e 's: *$$::' \ -e '\: *$$\d' $(DEPDIR)\Makefile.tmp >> Makefile.in $(SED) -e '1,\^# DO NOT DELETE THIS LINE\d' \ -e 's:^\(........\).*\.o:\1.o:' \ -e 's:\\[^ ]* *::g' \ -e 's:\.o:\$$(OBJ):g' \ -e 's:_\([^ ]*.h\):\1:g' \ -e 's: *$$::' \ -e '\: *$$\d' $(DEPDIR)\Makefile.sh >> Makefile.in $(SED) -e '1,\^# DO NOT DELETE THIS LINE\d' \ -e 's:^\(........\).*\.o:\1.o:' \ -e 's:\\[^ ]* *::g' \ -e 's:\.o:\$$(OBJ):g' \ -e 's:_\([^ ]*.h\):\1:g' \ -e 's: *$$::' \ -e '\: *$$\d' $(DEPDIR)\Makefile.bsh >> Makefile.in $(SED) -e '1,\^# DO NOT DELETE THIS LINE\d' \ -e 's:^\(........\).*\.o:\1.o:' \ -e 's:\\[^ ]* *::g' \ -e 's:\.o:\$$(OBJ):g' \ -e 's:_\([^ ]*.h\):\1:g' \ -e 's: *$$::' \ -e '\: *$$\d' $(DEPDIR)\Makefile.nsh >> Makefile.in $(SED) -e '1,\^# DO NOT DELETE THIS LINE\d' \ -e 's:^\(........\).*\.o:\1.o:' \ -e 's:\\[^ ]* *::g' \ -e 's:\.o:\$$(OBJ):g' \ -e 's:_\([^ ]*.h\):\1:g' \ -e 's: *$$::' \ -e '\: *$$\d' $(DEPDIR)\Makefile.tr >> Makefile.in -rm -rf $(DEPDIR) ############################################################ # to verify sources lint: $(SRC) $(HSRC) config.h kanji.h funcno.h $(LINT) $(OSOPTS) -DFD=$(VERMAJ) `$(SED) -e "s:\$(OBJ):\.c:g" $(ARGS)` SRCS=`$(ECHO) $(UOBJ)|$(SED) -e "s:t\([^ ]*\)\$(OBJ):\1\.c:g"`; \ $(LINT) $(OSOPTS) mkunitbl.c $${SRCS} SRCS=`$(ECHO) $(TOBJ)|$(SED) -e "s:t\([^ ]*\)\$(OBJ):\1\.c:g"`; \ $(LINT) $(OSOPTS) mkdict.c $${SRCS}; \ $(LINT) $(OSOPTS) mktankan.c $${SRCS} $(LINT) $(OSOPTS) mkkanji.c SRCS=`$(ECHO) $(COBJ)|$(SED) -e "s:t\([^ ]*\)\$(OBJ):\1\.c:g"`; \ $(LINT) $(OSOPTS) mkcat.c $${SRCS} $(LINT) $(OSOPTS) mkdir_p.c SRCS=`$(ECHO) $(KOBJ)|$(SED) -e "s:t\([^ ]*\)\$(OBJ):\1\.c:g"`; \ $(LINT) $(OSOPTS) kanjicnv.c $${SRCS} $(LINT) $(OSOPTS) expfunc.c $(LINT) $(OSOPTS) mkfuncno.c ############################################################ # to make configuration file manually config: Configur expfunc.c -if ($(ECHO) 't() { echo $1; }; t test' | $(SHELL) >\dev\null 2>&1); then \ $(SED) -e "2,3d" -e "s:__cc__:gcc:" Configur \ | $(SHELL) > config.h; \ elif $(MAKE) -f Makefile.tmp expfunc$(EXE); then \ $(SED) -e "2,3d" -e "s:__cc__:gcc:" Configur \ | .\expfunc$(EXE) | $(SHELL) > config.h; \ fi # @sleep 1 config.h: config.hin $(CP) config.hin $@ # @sleep 1 expfunc$(EXE): expfunc$(OBJ) # @sleep 1 $(HOSTCC) $(HOSTCOPTS) $(HOSTLDFLAGS) -o $@ expfunc$(OBJ) @ren $@ expfunc @aout2exe expfunc @del expfunc # @sleep 1 expfunc$(OBJ): expfunc.c $(HOSTCC) $(HOSTCOPTS) $(HOSTCPPFLAGS) -c -o $@ $*.c ############################################################ # sample program for pseudo system(3) sh: fdsh$(EXE) fdsh$(EXE): $(SOBJ1) $(SOBJ2) $(SARGS) # @sleep 1 $(CC) -o $@ @$(SARGS) $(SLDFLAGS) @ren $@ fdsh @aout2exe fdsh @del fdsh $(SARGS): $(SOBJ1) $(SOBJ2) # @sleep 1 @$(ECHO) $(SOBJ1) > $(SARGS) @$(ECHO) $(SOBJ2) >> $(SARGS) # @sleep 1 sprintf$(OBJ): printf.c $(CC) $(SHCFLAGS) -c -o $@ printf.c stermio$(OBJ): termio.c $(CC) $(SHCFLAGS) -c -o $@ termio.c sstream$(OBJ): stream.c $(CC) $(SHCFLAGS) -c -o $@ stream.c sstring$(OBJ): string.c $(CC) $(SHCFLAGS) -c -o $@ string.c smalloc$(OBJ): malloc.c $(CC) $(SHCFLAGS) -c -o $@ malloc.c stime$(OBJ): time.c $(CC) $(SHCFLAGS) -c -o $@ time.c spathnam$(OBJ): pathname.c $(CC) $(SHCFLAGS) -c -o $@ pathname.c ssystem$(OBJ): system.c $(CC) $(SHCFLAGS) -c -o $@ system.c sposixsh$(OBJ): posixsh.c $(CC) $(SHCFLAGS) -c -o $@ posixsh.c sdoscom$(OBJ): doscom.c $(CC) $(SHCFLAGS) -c -o $@ doscom.c ssysemu$(OBJ): sysemu.c $(CC) $(SHCFLAGS) -c -o $@ sysemu.c ############################################################ # Bourne shell bsh: fdbsh$(EXE) fdbsh$(EXE): $(BOBJ) # @sleep 1 $(CC) -o $@ $(BOBJ) $(SLDFLAGS) @ren $@ fdbsh @aout2exe fdbsh @del fdbsh bprintf$(OBJ): printf.c $(CC) $(BSHCFLAGS) -c -o $@ printf.c btermio$(OBJ): termio.c $(CC) $(BSHCFLAGS) -c -o $@ termio.c bstream$(OBJ): stream.c $(CC) $(BSHCFLAGS) -c -o $@ stream.c bstring$(OBJ): string.c $(CC) $(BSHCFLAGS) -c -o $@ string.c bmalloc$(OBJ): malloc.c $(CC) $(BSHCFLAGS) -c -o $@ malloc.c bpathnam$(OBJ): pathname.c $(CC) $(BSHCFLAGS) -c -o $@ pathname.c bsystem$(OBJ): system.c $(CC) $(BSHCFLAGS) -c -o $@ system.c bdoscom$(OBJ): doscom.c $(CC) $(BSHCFLAGS) -c -o $@ doscom.c bsysemu$(OBJ): sysemu.c $(CC) $(BSHCFLAGS) -c -o $@ sysemu.c ############################################################ # Network shell nsh: fdnsh$(EXE) fdnsh$(EXE): $(NOBJ1) $(NOBJ2) $(NOBJ3) $(NARGS) # @sleep 1 $(CC) -o $@ @$(NARGS) $(NLDFLAGS) @ren $@ fdnsh @aout2exe fdnsh @del fdnsh $(NARGS): $(NOBJ1) $(NOBJ2) $(NOBJ3) # @sleep 1 @$(ECHO) $(NOBJ1) > $(NARGS) @$(ECHO) $(NOBJ2) >> $(NARGS) @$(ECHO) $(NOBJ3) >> $(NARGS) # @sleep 1 nprintf$(OBJ): printf.c $(CC) $(NSHCFLAGS) -c -o $@ printf.c ntermio$(OBJ): termio.c $(CC) $(NSHCFLAGS) -c -o $@ termio.c nstream$(OBJ): stream.c $(CC) $(NSHCFLAGS) -c -o $@ stream.c nstring$(OBJ): string.c $(CC) $(NSHCFLAGS) -c -o $@ string.c nmalloc$(OBJ): malloc.c $(CC) $(NSHCFLAGS) -c -o $@ malloc.c ntime$(OBJ): time.c $(CC) $(NSHCFLAGS) -c -o $@ time.c npathnam$(OBJ): pathname.c $(CC) $(NSHCFLAGS) -c -o $@ pathname.c nsystem$(OBJ): system.c $(CC) $(NSHCFLAGS) -c -o $@ system.c nposixsh$(OBJ): posixsh.c $(CC) $(NSHCFLAGS) -c -o $@ posixsh.c ndoscom$(OBJ): doscom.c $(CC) $(NSHCFLAGS) -c -o $@ doscom.c nsysemu$(OBJ): sysemu.c $(CC) $(NSHCFLAGS) -c -o $@ sysemu.c nrealpat$(OBJ): realpath.c $(CC) $(NSHCFLAGS) -c -o $@ realpath.c nencode$(OBJ): encode.c $(CC) $(NSHCFLAGS) -c -o $@ encode.c nparse$(OBJ): parse.c $(CC) $(NSHCFLAGS) -c -o $@ parse.c nsocket$(OBJ): socket.c $(CC) $(NSHCFLAGS) -c -o $@ socket.c nurl$(OBJ): url.c $(CC) $(NSHCFLAGS) -c -o $@ url.c nauth$(OBJ): auth.c $(CC) $(NSHCFLAGS) -c -o $@ auth.c nftp$(OBJ): ftp.c $(CC) $(NSHCFLAGS) -c -o $@ ftp.c nhtml$(OBJ): html.c $(CC) $(NSHCFLAGS) -c -o $@ html.c nhttp$(OBJ): http.c $(CC) $(NSHCFLAGS) -c -o $@ http.c nurldisk$(OBJ): urldisk.c $(CC) $(NSHCFLAGS) -c -o $@ urldisk.c nlsparse$(OBJ): lsparse.c $(CC) $(NSHCFLAGS) -c -o $@ lsparse.c ############################################################ # for programer's maintenance tar: $(SOURCES) $(TAR) cvf $(TITLE)$(VERSION).tar $(SOURCES) compress -f $(TITLE)$(VERSION).tar gtar: $(SOURCES) $(TAR) cvf $(TITLE)$(VERSION).tar $(SOURCES) gzip -f $(TITLE)$(VERSION).tar shtar: $(SHSOURCES) (VER=`date '+%y%m%d'`; \ $(TAR) cvf $(TITLE)sh-$${VER}.tar $(SHSOURCES); \ gzip -f $(TITLE)sh-$${VER}.tar) lzh: $(SOURCES) -$(RM) $(TITLE)$(VERSION).lzh $(LHA) a $(TITLE)$(VERSION).lzh $(SOURCES) shar: $(SOURCES) -$(RM) $(TITLE)$(VERSION).shar.[0-9][0-9] $(SHAR) -L50 -apc -n $(TITLE)$(VERSION) -o $(TITLE)$(VERSION).shar \ -T $(SRCS) -C $(JSRCS) ipk: $(PROGRAM)$(EXE) $(TABLES) mkdir_p$(EXE) -[ -d $(IPKWDIR)\$(BINDIR) ] || .\mkdir_p$(EXE) $(IPKWDIR)\$(BINDIR) -[ -d $(IPKWDIR)\$(BINDIR) ] || .\mkdir_p$(EXE) $(IPKWDIR)\$(BINDIR) -[ -d $(IPKWDIR)\$(BINDIR) ] || .\mkdir_p$(EXE) $(IPKWDIR)\$(BINDIR) -[ -d $(IPKWDIR)\$(CONFDIR) ] || .\mkdir_p$(EXE) $(IPKWDIR)\$(CONFDIR) -[ -d $(IPKWDIR)\CONTROL ] || .\mkdir_p$(EXE) $(IPKWDIR)\CONTROL -[ -d $(IPKTDIR) ] || .\mkdir_p$(EXE) $(IPKTDIR) $(CP) -p $(PROGRAM)$(EXE) $(IPKWDIR)\$(BINDIR) -[ -z "$(STRIP)" ] || $(STRIP) $(IPKWDIR)\$(BINDIR)\$(PROGRAM)$(EXE) $(CHMOD) a+rx $(IPKWDIR)\$(BINDIR)\$(PROGRAM)$(EXE) -$(RM) $(IPKWDIR)\$(BINDIR)\$(ALIAS)$(EXE) $(LN) $(IPKWDIR)\$(BINDIR)\$(PROGRAM)$(EXE) \ $(IPKWDIR)\$(BINDIR)\$(ALIAS)$(EXE) $(CHMOD) a+rx $(IPKWDIR)\$(BINDIR)\$(ALIAS)$(EXE) $(SED) -e 's:#TMPDIR=.*:TMPDIR=\home\tmp:' \ -e 's:#LANGUAGE=.*:LANGUAGE=euc:' \ -e 's:#INPUTKCODE=.*:INPUTKCODE=euc:' \ -e 's:#FNAMEKCODE=.*:FNAMEKCODE=utf8:' \ -e '\# launcher definition\,\^$$\ {' \ -e '\^$$\ {' \ -e 'i \' \ -e 'launch ".tar.Z" "gzip -cd %C|tar tvf -" "%a %u\%g %s %y-%m-%d %t %*f"' \ -e 'i \' \ -e 'launch ".taZ" "gzip -cd %C|tar tvf -" "%a %u\%g %s %y-%m-%d %t %*f"' \ -e 'i \' \ -e 'launch ".ipk" "gzip -cd %C|tar xOf - .\data.tar.gz|gzip -cd|tar tvf -" \\' \ -e 'i \' \ -e ' "%a %u\%g %s %y-%m-%d %t %*f"' \ -e 'i \' \ -e 'launch ".deb" "ar -p %C data.tar.gz|gzip -cd|tar tvf -" \\' \ -e 'i \' \ -e ' "%a %u\%g %s %y-%m-%d %t %*f"' \ -e '}' \ -e '}' \ -e '\# archiver definition\,\^$$\ {' \ -e '\^$$\ {' \ -e 'i \' \ -e 'arch ".tar.Z" "echo ERROR; false" "gzip -cd %C|tar xf - %TA"' \ -e 'i \' \ -e 'arch ".taZ" "echo ERROR; false" "gzip -cd %C|tar xf - %TA"' \ -e 'i \' \ -e 'arch ".ipk" "echo ERROR; false" \\' \ -e 'i \' \ -e ' "gzip -cd %C|tar xOf - .\data.tar.gz|gzip -cd|tar xf - %TA"' \ -e 'i \' \ -e 'arch ".deb" "echo ERROR; false" \\' \ -e 'i \' \ -e ' "ar -p %C data.tar.gz|gzip -cd|tar xf - %TA"' \ -e '}' \ -e '}' \ -e '$$ {' \ -e 'a \' \ -e 'if [ " $$TERM" = " vt100" -a " $$CONSOLE" = " \dev\console" ]; then' \ -e 'a \' \ -e ' keymap BS "^?"' \ -e 'a \' \ -e ' keymap DEL "\\033[3~"' \ -e 'a \' \ -e ' keymap HOME "\\033[H"' \ -e 'a \' \ -e ' keymap END "\\033[F"' \ -e 'a \' \ -e 'fi' \ -e '}' \ _fdrc > $(IPKWDIR)\$(BLDRC) $(CHMOD) a+r-x $(IPKWDIR)\$(BLDRC) -if [ -f $(UNITBL) ]; then \ cp -p $(UNITBL) $(IPKWDIR)\$(BINDIR); \ $(CHMOD) a+r-x $(IPKWDIR)\$(BINDIR)\$(UNITBL); \ fi -if [ -f $(DICTTBL) ]; then \ cp -p $(DICTTBL) $(IPKWDIR)\$(BINDIR); \ $(CHMOD) a+r-x $(IPKWDIR)\$(BINDIR)\$(DICTTBL); \ fi -if [ -f $(CATTBL) ]; then \ cp -p $(CATTBL) $(IPKWDIR)\$(BINDIR); \ $(CHMOD) a+r-x $(IPKWDIR)\$(BINDIR)\$(CATTBL); \ fi -if [ -f $(ECATTBL) ]; then \ cp -p $(ECATTBL) $(IPKWDIR)\$(BINDIR); \ $(CHMOD) a+r-x $(IPKWDIR)\$(BINDIR)\$(ECATTBL); \ fi $(ECHO) "Package: fd" > $(IPKWDIR)\CONTROL\control $(ECHO) "Priority: optional" >> $(IPKWDIR)\CONTROL\control $(ECHO) "Section: extras" >> $(IPKWDIR)\CONTROL\control $(ECHO) "Maintainer: $(DIST)" >> $(IPKWDIR)\CONTROL\control $(ECHO) "Architecture: arm" >> $(IPKWDIR)\CONTROL\control $(ECHO) "Version: $(VERSION)-1" >> $(IPKWDIR)\CONTROL\control $(ECHO) "Depends: ncurses" >> $(IPKWDIR)\CONTROL\control $(ECHO) "Description: a file & directory maintenance tool." \ >> $(IPKWDIR)\CONTROL\control (cd $(IPKWDIR); tar cf ..\data.tar --exclude=CONTROL .) (cd $(IPKWDIR)\CONTROL; tar cf ..\..\control.tar .) gzip .\data.tar $(MV) .\data.tar.gz $(IPKTDIR) gzip .\control.tar $(MV) .\control.tar.gz $(IPKTDIR) $(ECHO) "2.0" > $(IPKTDIR)\debian-binary (cd $(IPKTDIR); \ tar cf ..\ipk.tar .\debian-binary .\data.tar.gz .\control.tar.gz) gzip .\ipk.tar $(MV) .\ipk.tar.gz .\fd_$(VERSION)-1_arm.ipk -$(RM) -r $(IPKWDIR) $(IPKTDIR) clean: -$(RM) core -$(RM) *$(OBJ) -$(RM) funcno.h -$(RM) kanji.h -$(RM) _fd-cat.ja -$(RM) _fd-cat.C -$(RM) fd-cat.* -$(RM) kanjicnv$(EXE) -$(RM) expfunc$(EXE) -$(RM) mkdir_p$(EXE) -$(RM) mkfuncno$(EXE) -$(RM) mkunitbl$(EXE) -$(RM) mkdict$(EXE) -$(RM) mktankan$(EXE) -$(RM) mkkanji$(EXE) -$(RM) mkcat$(EXE) -$(RM) fdsh$(EXE) -$(RM) fdbsh$(EXE) -$(RM) fdnsh$(EXE) -$(RM) $(PROGRAM)$(EXE) -$(RM) $(PROGRAM).$(MANSEC) -$(RM) $(PROGRAM).$(MANSEC)c -$(RM) $(PROGRAM).eng -$(RM) $(PROGRAM).doc -$(RM) $(ARGS) -$(RM) $(SARGS) -$(RM) $(NARGS) -$(RM) $(UNITBL) -$(RM) unitbl.c -$(RM) dicttbl.c -$(RM) $(DICTTXT) -$(RM) $(DICTTBL) # DO NOT DELETE THIS LINE -- make depend depends on it. main$(OBJ): fd.h headers.h machine.h config.h main$(OBJ): depend.h printf.h main$(OBJ): stream.h kctype.h main$(OBJ): string.h malloc.h time.h log.h termio.h main$(OBJ): realpath.h main$(OBJ): parse.h kconv.h func.h sysemu.h dirent.h unixemu.h main$(OBJ): pathname.h main$(OBJ): typesize.h term.h types.h lsparse.h namelist.h dosdisk.h main$(OBJ): kanji.h catalog.h version.h system.h wait.h main$(OBJ): termemu.h roman.h urldisk.h url.h auth.h printf$(OBJ): headers.h machine.h config.h printf$(OBJ): depend.h printf.h stream.h kctype.h printf$(OBJ): typesize.h string.h printf$(OBJ): kconv.h termio$(OBJ): headers.h machine.h config.h termio$(OBJ): depend.h typesize.h sysemu.h dirent.h termio$(OBJ): unixemu.h termio$(OBJ): stream.h termio.h term$(OBJ): headers.h machine.h config.h term$(OBJ): depend.h printf.h term$(OBJ): stream.h kctype.h term$(OBJ): typesize.h string.h termio.h term$(OBJ): term.h stream$(OBJ): headers.h machine.h config.h stream$(OBJ): depend.h typesize.h malloc.h sysemu.h stream$(OBJ): dirent.h unixemu.h stream$(OBJ): stream.h pathname.h termio.h stream$(OBJ): socket.h string$(OBJ): headers.h machine.h config.h string$(OBJ): kctype.h depend.h string$(OBJ): string.h malloc$(OBJ): headers.h machine.h config.h malloc$(OBJ): printf.h stream.h depend.h malloc.h malloc$(OBJ): sysemu.h dirent.h unixemu.h time$(OBJ): headers.h machine.h config.h time$(OBJ): typesize.h time$(OBJ): string.h time.h pathname$(OBJ): fd.h headers.h machine.h config.h pathname$(OBJ): depend.h printf.h stream.h kctype.h pathname$(OBJ): string.h malloc.h pathname$(OBJ): dirent.h unixemu.h pathname$(OBJ): sysemu.h pathname.h typesize.h pathname$(OBJ): url.h system$(OBJ): fd.h headers.h machine.h config.h system$(OBJ): depend.h printf.h stream.h kctype.h system$(OBJ): string.h malloc.h system$(OBJ): term.h types.h typesize.h lsparse.h namelist.h kconv.h system$(OBJ): dirent.h unixemu.h system$(OBJ): sysemu.h system.h pathname.h termio.h system$(OBJ): wait.h system$(OBJ): termemu.h posixsh.h socket.h url.h system$(OBJ): urldisk.h auth.h posixsh$(OBJ): fd.h headers.h machine.h config.h posixsh$(OBJ): depend.h printf.h stream.h kctype.h posixsh$(OBJ): string.h malloc.h posixsh$(OBJ): sysemu.h dirent.h unixemu.h posixsh$(OBJ): system.h pathname.h typesize.h posixsh$(OBJ): termio.h posixsh$(OBJ): wait.h posixsh$(OBJ): termemu.h time.h posixsh.h term.h doscom$(OBJ): fd.h headers.h machine.h config.h doscom$(OBJ): depend.h printf.h stream.h kctype.h doscom$(OBJ): string.h malloc.h doscom$(OBJ): term.h types.h typesize.h lsparse.h namelist.h dirent.h doscom$(OBJ): unixemu.h doscom$(OBJ): sysemu.h system.h pathname.h termio.h doscom$(OBJ): wait.h doscom$(OBJ): realpath.h urldisk.h url.h auth.h log$(OBJ): fd.h headers.h machine.h config.h log$(OBJ): depend.h printf.h log$(OBJ): stream.h kctype.h log$(OBJ): string.h malloc.h func.h sysemu.h dirent.h unixemu.h log$(OBJ): pathname.h log$(OBJ): typesize.h term.h types.h lsparse.h namelist.h dosdisk.h sysemu$(OBJ): fd.h headers.h machine.h config.h sysemu$(OBJ): depend.h printf.h stream.h kctype.h sysemu$(OBJ): string.h malloc.h sysemu$(OBJ): kconv.h sysemu.h dirent.h unixemu.h sysemu$(OBJ): log.h pathname.h typesize.h termio.h sysemu$(OBJ): realpath.h dosdisk.h socket.h sysemu$(OBJ): urldisk.h namelist.h url.h auth.h dosdisk$(OBJ): headers.h machine.h config.h dosdisk$(OBJ): depend.h kctype.h dosdisk$(OBJ): string.h time.h sysemu.h dirent.h dosdisk$(OBJ): unixemu.h dosdisk$(OBJ): stream.h pathname.h typesize.h dosdisk.h unixdisk.h kconv.h unixdisk$(OBJ): headers.h machine.h config.h unixdisk$(OBJ): depend.h kctype.h unixdisk$(OBJ): string.h sysemu.h dirent.h unixemu.h unixdisk$(OBJ): stream.h unixdisk$(OBJ): pathname.h typesize.h dosdisk.h unixdisk.h realpath$(OBJ): fd.h headers.h machine.h config.h realpath$(OBJ): depend.h printf.h stream.h kctype.h realpath$(OBJ): string.h malloc.h realpath$(OBJ): sysemu.h dirent.h unixemu.h realpath$(OBJ): pathname.h typesize.h realpath.h realpath$(OBJ): url.h encode$(OBJ): headers.h machine.h config.h encode$(OBJ): kctype.h depend.h encode$(OBJ): sysemu.h dirent.h unixemu.h encode$(OBJ): stream.h encode$(OBJ): pathname.h typesize.h encode.h libc$(OBJ): fd.h headers.h machine.h config.h libc$(OBJ): depend.h printf.h libc$(OBJ): stream.h kctype.h libc$(OBJ): string.h malloc.h log.h realpath.h parse.h kconv.h func.h libc$(OBJ): sysemu.h dirent.h unixemu.h libc$(OBJ): pathname.h typesize.h term.h types.h libc$(OBJ): lsparse.h namelist.h dosdisk.h kanji.h catalog.h system.h libc$(OBJ): termio.h libc$(OBJ): wait.h libc$(OBJ): termemu.h url.h file$(OBJ): fd.h headers.h machine.h config.h file$(OBJ): depend.h printf.h file$(OBJ): stream.h kctype.h file$(OBJ): string.h malloc.h time.h termio.h file$(OBJ): realpath.h file$(OBJ): kconv.h func.h sysemu.h dirent.h unixemu.h file$(OBJ): pathname.h typesize.h term.h types.h file$(OBJ): lsparse.h namelist.h dosdisk.h kanji.h catalog.h urldisk.h file$(OBJ): url.h auth.h mntinfo$(OBJ): headers.h machine.h config.h mntinfo$(OBJ): kctype.h depend.h mntinfo$(OBJ): string.h malloc.h pathname.h mntinfo$(OBJ): typesize.h mntinfo.h fsinfo.h statfs$(OBJ): headers.h machine.h config.h statfs$(OBJ): fsinfo.h apply$(OBJ): fd.h headers.h machine.h config.h apply$(OBJ): depend.h printf.h stream.h kctype.h apply$(OBJ): string.h malloc.h apply$(OBJ): time.h realpath.h parse.h func.h sysemu.h dirent.h unixemu.h apply$(OBJ): pathname.h apply$(OBJ): typesize.h term.h types.h lsparse.h namelist.h dosdisk.h apply$(OBJ): kanji.h catalog.h pty$(OBJ): fd.h headers.h machine.h config.h pty$(OBJ): depend.h printf.h pty$(OBJ): stream.h kctype.h pty$(OBJ): string.h malloc.h sysemu.h dirent.h unixemu.h pty$(OBJ): pathname.h pty$(OBJ): typesize.h termio.h termemu$(OBJ): fd.h headers.h machine.h config.h termemu$(OBJ): depend.h printf.h stream.h kctype.h termemu$(OBJ): string.h malloc.h termemu$(OBJ): wait.h unixemu.h termio.h termemu$(OBJ): func.h sysemu.h dirent.h termemu$(OBJ): pathname.h termemu$(OBJ): typesize.h term.h types.h lsparse.h namelist.h dosdisk.h termemu$(OBJ): kanji.h catalog.h system.h termemu.h frontend$(OBJ): fd.h headers.h machine.h config.h frontend$(OBJ): depend.h printf.h stream.h kctype.h frontend$(OBJ): string.h malloc.h frontend$(OBJ): wait.h unixemu.h parse.h func.h frontend$(OBJ): sysemu.h dirent.h frontend$(OBJ): pathname.h typesize.h term.h frontend$(OBJ): types.h lsparse.h namelist.h dosdisk.h funcno.h kanji.h frontend$(OBJ): catalog.h system.h termio.h frontend$(OBJ): termemu.h frontend$(OBJ): roman.h backend$(OBJ): fd.h headers.h machine.h config.h backend$(OBJ): depend.h printf.h stream.h kctype.h backend$(OBJ): string.h malloc.h backend$(OBJ): termio.h backend$(OBJ): kconv.h func.h sysemu.h backend$(OBJ): dirent.h unixemu.h backend$(OBJ): pathname.h typesize.h term.h types.h backend$(OBJ): lsparse.h namelist.h dosdisk.h system.h wait.h backend$(OBJ): termemu.h parse$(OBJ): fd.h headers.h machine.h config.h parse$(OBJ): depend.h printf.h stream.h kctype.h parse$(OBJ): string.h malloc.h parse$(OBJ): pathname.h typesize.h term.h types.h lsparse.h namelist.h parse$(OBJ): kconv.h sysemu.h dirent.h unixemu.h parse$(OBJ): realpath.h parse.h system.h termio.h parse$(OBJ): wait.h builtin$(OBJ): fd.h headers.h machine.h config.h builtin$(OBJ): depend.h printf.h stream.h kctype.h builtin$(OBJ): string.h malloc.h builtin$(OBJ): encode.h parse.h kconv.h func.h sysemu.h dirent.h unixemu.h builtin$(OBJ): pathname.h builtin$(OBJ): typesize.h term.h types.h lsparse.h namelist.h dosdisk.h builtin$(OBJ): funcno.h kanji.h catalog.h system.h termio.h builtin$(OBJ): wait.h builtin$(OBJ): termemu.h roman.h shell$(OBJ): fd.h headers.h machine.h config.h shell$(OBJ): depend.h printf.h stream.h kctype.h shell$(OBJ): string.h malloc.h shell$(OBJ): realpath.h parse.h kconv.h func.h sysemu.h dirent.h unixemu.h shell$(OBJ): pathname.h shell$(OBJ): typesize.h term.h types.h lsparse.h namelist.h dosdisk.h shell$(OBJ): kanji.h catalog.h system.h termio.h shell$(OBJ): wait.h shell$(OBJ): termemu.h socket$(OBJ): headers.h machine.h config.h socket$(OBJ): depend.h printf.h stream.h kctype.h socket$(OBJ): typesize.h malloc.h socket$(OBJ): sysemu.h dirent.h unixemu.h socket$(OBJ): termio.h socket$(OBJ): socket.h url$(OBJ): headers.h machine.h config.h url$(OBJ): depend.h printf.h url$(OBJ): stream.h kctype.h url$(OBJ): typesize.h string.h malloc.h sysemu.h dirent.h unixemu.h url$(OBJ): pathname.h url.h auth$(OBJ): headers.h machine.h config.h auth$(OBJ): depend.h printf.h auth$(OBJ): stream.h string.h malloc.h time.h pathname.h typesize.h auth$(OBJ): encode.h parse.h socket.h auth.h url.h auth$(OBJ): system.h termio.h auth$(OBJ): wait.h auth$(OBJ): unixemu.h kanji.h catalog.h ftp$(OBJ): headers.h machine.h config.h ftp$(OBJ): depend.h printf.h ftp$(OBJ): stream.h kctype.h ftp$(OBJ): string.h malloc.h time.h sysemu.h dirent.h unixemu.h ftp$(OBJ): pathname.h ftp$(OBJ): typesize.h termio.h ftp$(OBJ): parse.h ftp$(OBJ): lsparse.h namelist.h socket.h auth.h ftp$(OBJ): url.h urldisk.h html$(OBJ): headers.h machine.h config.h html$(OBJ): depend.h printf.h html$(OBJ): stream.h kctype.h html$(OBJ): typesize.h string.h malloc.h sysemu.h dirent.h unixemu.h html$(OBJ): pathname.h termio.h html$(OBJ): parse.h html.h urldisk.h html$(OBJ): namelist.h url.h auth.h http$(OBJ): headers.h machine.h config.h http$(OBJ): depend.h printf.h http$(OBJ): stream.h kctype.h http$(OBJ): string.h malloc.h time.h sysemu.h dirent.h unixemu.h http$(OBJ): pathname.h http$(OBJ): typesize.h termio.h http$(OBJ): parse.h http$(OBJ): lsparse.h namelist.h socket.h auth.h http$(OBJ): url.h html.h urldisk.h urldisk$(OBJ): headers.h machine.h config.h urldisk$(OBJ): depend.h printf.h stream.h string.h urldisk$(OBJ): malloc.h time.h sysemu.h dirent.h unixemu.h urldisk$(OBJ): pathname.h urldisk$(OBJ): typesize.h termio.h urldisk$(OBJ): realpath.h urldisk$(OBJ): lsparse.h namelist.h socket.h urldisk$(OBJ): urldisk.h url.h auth.h catalog$(OBJ): fd.h headers.h machine.h config.h catalog$(OBJ): depend.h printf.h stream.h kctype.h catalog$(OBJ): string.h malloc.h catalog$(OBJ): termio.h catalog$(OBJ): func.h sysemu.h dirent.h catalog$(OBJ): unixemu.h catalog$(OBJ): pathname.h typesize.h term.h types.h lsparse.h namelist.h catalog$(OBJ): dosdisk.h kanji.h catalog.h kconv$(OBJ): fd.h headers.h machine.h config.h kconv$(OBJ): depend.h printf.h stream.h kctype.h kconv$(OBJ): string.h malloc.h kconv$(OBJ): termio.h kconv$(OBJ): realpath.h parse.h func.h kconv$(OBJ): sysemu.h dirent.h unixemu.h kconv$(OBJ): pathname.h typesize.h term.h types.h kconv$(OBJ): lsparse.h namelist.h dosdisk.h kconv.h termemu.h input$(OBJ): fd.h headers.h machine.h config.h input$(OBJ): depend.h printf.h stream.h kctype.h input$(OBJ): string.h malloc.h input$(OBJ): wait.h unixemu.h parse.h kconv.h func.h input$(OBJ): sysemu.h dirent.h input$(OBJ): pathname.h typesize.h term.h types.h lsparse.h namelist.h input$(OBJ): dosdisk.h kanji.h catalog.h system.h termio.h input$(OBJ): termemu.h ime$(OBJ): fd.h headers.h machine.h config.h ime$(OBJ): depend.h printf.h ime$(OBJ): stream.h kctype.h ime$(OBJ): string.h malloc.h wait.h unixemu.h ime$(OBJ): parse.h kconv.h roman.h func.h sysemu.h dirent.h ime$(OBJ): pathname.h ime$(OBJ): typesize.h term.h types.h lsparse.h namelist.h dosdisk.h ime$(OBJ): kanji.h catalog.h termemu.h dict$(OBJ): fd.h headers.h machine.h config.h dict$(OBJ): depend.h printf.h dict$(OBJ): stream.h kctype.h dict$(OBJ): string.h malloc.h termio.h dict$(OBJ): roman.h dict$(OBJ): hinsi.h func.h sysemu.h dirent.h unixemu.h dict$(OBJ): pathname.h typesize.h term.h types.h dict$(OBJ): lsparse.h namelist.h dosdisk.h parse.h kconv.h roman$(OBJ): headers.h machine.h config.h roman$(OBJ): depend.h kctype.h roman$(OBJ): typesize.h string.h kconv.h roman.h info$(OBJ): fd.h headers.h machine.h config.h info$(OBJ): depend.h printf.h info$(OBJ): stream.h kctype.h info$(OBJ): string.h malloc.h dirent.h unixemu.h info$(OBJ): sysemu.h pathname.h typesize.h term.h info$(OBJ): types.h lsparse.h namelist.h funcno.h kanji.h catalog.h info$(OBJ): unixdisk.h mntinfo.h fsinfo.h rockridg$(OBJ): fd.h headers.h machine.h config.h rockridg$(OBJ): depend.h printf.h stream.h kctype.h rockridg$(OBJ): string.h malloc.h rockridg$(OBJ): device.h parse.h func.h sysemu.h dirent.h unixemu.h rockridg$(OBJ): pathname.h rockridg$(OBJ): typesize.h term.h types.h lsparse.h namelist.h dosdisk.h tree$(OBJ): fd.h headers.h machine.h config.h tree$(OBJ): depend.h printf.h tree$(OBJ): stream.h kctype.h tree$(OBJ): string.h malloc.h func.h sysemu.h dirent.h unixemu.h tree$(OBJ): pathname.h tree$(OBJ): typesize.h term.h types.h lsparse.h namelist.h dosdisk.h tree$(OBJ): kanji.h catalog.h lsparse$(OBJ): fd.h headers.h machine.h config.h lsparse$(OBJ): depend.h printf.h stream.h kctype.h lsparse$(OBJ): string.h malloc.h lsparse$(OBJ): time.h dirent.h unixemu.h lsparse$(OBJ): pathname.h typesize.h device.h lsparse$(OBJ): parse.h lsparse.h namelist.h kconv.h archive$(OBJ): fd.h headers.h machine.h config.h archive$(OBJ): depend.h printf.h stream.h kctype.h archive$(OBJ): string.h malloc.h archive$(OBJ): realpath.h kconv.h func.h sysemu.h dirent.h unixemu.h archive$(OBJ): pathname.h archive$(OBJ): typesize.h term.h types.h lsparse.h namelist.h dosdisk.h archive$(OBJ): kanji.h catalog.h system.h termio.h archive$(OBJ): wait.h archive$(OBJ): termemu.h custom$(OBJ): fd.h headers.h machine.h config.h custom$(OBJ): depend.h printf.h stream.h kctype.h custom$(OBJ): string.h malloc.h custom$(OBJ): parse.h kconv.h func.h sysemu.h dirent.h unixemu.h custom$(OBJ): pathname.h custom$(OBJ): typesize.h term.h types.h lsparse.h namelist.h dosdisk.h custom$(OBJ): funcno.h kanji.h catalog.h system.h termio.h custom$(OBJ): wait.h custom$(OBJ): termemu.h urldisk.h url.h auth.h command$(OBJ): fd.h headers.h machine.h config.h command$(OBJ): depend.h printf.h stream.h kctype.h command$(OBJ): string.h malloc.h command$(OBJ): parse.h func.h sysemu.h dirent.h unixemu.h command$(OBJ): pathname.h command$(OBJ): typesize.h term.h types.h lsparse.h namelist.h dosdisk.h command$(OBJ): funcno.h kanji.h catalog.h system.h termio.h command$(OBJ): wait.h command$(OBJ): termemu.h functabl.h browse$(OBJ): fd.h headers.h machine.h config.h browse$(OBJ): depend.h printf.h stream.h kctype.h browse$(OBJ): string.h malloc.h browse$(OBJ): device.h parse.h kconv.h func.h sysemu.h dirent.h unixemu.h browse$(OBJ): pathname.h browse$(OBJ): typesize.h term.h types.h lsparse.h namelist.h dosdisk.h browse$(OBJ): funcno.h kanji.h catalog.h termemu.h unitbl$(OBJ): headers.h machine.h config.h dicttbl$(OBJ): headers.h machine.h config.h sprintf$(OBJ): headers.h machine.h config.h sprintf$(OBJ): depend.h printf.h stream.h kctype.h sprintf$(OBJ): typesize.h string.h stermio$(OBJ): headers.h machine.h config.h stermio$(OBJ): depend.h typesize.h sysemu.h dirent.h stermio$(OBJ): unixemu.h stermio$(OBJ): stream.h termio.h sstream$(OBJ): headers.h machine.h config.h sstream$(OBJ): depend.h typesize.h malloc.h sysemu.h sstream$(OBJ): dirent.h unixemu.h sstream$(OBJ): stream.h pathname.h termio.h sstring$(OBJ): headers.h machine.h config.h sstring$(OBJ): kctype.h depend.h sstring$(OBJ): string.h smalloc$(OBJ): headers.h machine.h config.h smalloc$(OBJ): printf.h stream.h depend.h malloc.h smalloc$(OBJ): sysemu.h dirent.h unixemu.h stime$(OBJ): headers.h machine.h config.h stime$(OBJ): typesize.h string.h time.h spathnam$(OBJ): headers.h machine.h config.h spathnam$(OBJ): depend.h spathnam$(OBJ): printf.h stream.h kctype.h spathnam$(OBJ): string.h malloc.h dirent.h unixemu.h spathnam$(OBJ): sysemu.h spathnam$(OBJ): pathname.h typesize.h ssystem$(OBJ): headers.h machine.h config.h ssystem$(OBJ): depend.h printf.h stream.h kctype.h ssystem$(OBJ): string.h malloc.h ssystem$(OBJ): dirent.h unixemu.h ssystem$(OBJ): sysemu.h system.h pathname.h ssystem$(OBJ): typesize.h termio.h ssystem$(OBJ): wait.h ssystem$(OBJ): termemu.h time.h posixsh.h sposixsh$(OBJ): headers.h machine.h config.h sposixsh$(OBJ): depend.h printf.h stream.h kctype.h sposixsh$(OBJ): string.h malloc.h sposixsh$(OBJ): sysemu.h dirent.h unixemu.h sposixsh$(OBJ): system.h pathname.h typesize.h sposixsh$(OBJ): termio.h sposixsh$(OBJ): wait.h sposixsh$(OBJ): termemu.h time.h posixsh.h sdoscom$(OBJ): headers.h machine.h config.h sdoscom$(OBJ): depend.h printf.h stream.h kctype.h sdoscom$(OBJ): string.h malloc.h sdoscom$(OBJ): dirent.h unixemu.h sdoscom$(OBJ): sysemu.h system.h pathname.h sdoscom$(OBJ): typesize.h termio.h sdoscom$(OBJ): wait.h ssysemu$(OBJ): headers.h machine.h config.h ssysemu$(OBJ): depend.h printf.h stream.h kctype.h ssysemu$(OBJ): string.h malloc.h ssysemu$(OBJ): sysemu.h dirent.h unixemu.h ssysemu$(OBJ): log.h pathname.h typesize.h termio.h ssysemu$(OBJ): realpath.h bprintf$(OBJ): headers.h machine.h config.h bprintf$(OBJ): depend.h printf.h stream.h kctype.h bprintf$(OBJ): typesize.h string.h btermio$(OBJ): headers.h machine.h config.h btermio$(OBJ): depend.h typesize.h sysemu.h dirent.h btermio$(OBJ): unixemu.h btermio$(OBJ): stream.h termio.h bstream$(OBJ): headers.h machine.h config.h bstream$(OBJ): depend.h typesize.h malloc.h sysemu.h bstream$(OBJ): dirent.h unixemu.h bstream$(OBJ): stream.h pathname.h termio.h bstring$(OBJ): headers.h machine.h config.h bstring$(OBJ): kctype.h depend.h bstring$(OBJ): string.h bmalloc$(OBJ): headers.h machine.h config.h bmalloc$(OBJ): printf.h stream.h depend.h malloc.h bmalloc$(OBJ): sysemu.h dirent.h unixemu.h bpathnam$(OBJ): headers.h machine.h config.h bpathnam$(OBJ): depend.h bpathnam$(OBJ): printf.h stream.h kctype.h bpathnam$(OBJ): string.h malloc.h dirent.h unixemu.h bpathnam$(OBJ): sysemu.h bpathnam$(OBJ): pathname.h typesize.h bsystem$(OBJ): headers.h machine.h config.h bsystem$(OBJ): depend.h printf.h stream.h kctype.h bsystem$(OBJ): string.h malloc.h bsystem$(OBJ): dirent.h unixemu.h bsystem$(OBJ): sysemu.h system.h pathname.h bsystem$(OBJ): typesize.h termio.h bsystem$(OBJ): wait.h bsystem$(OBJ): termemu.h bdoscom$(OBJ): headers.h machine.h config.h bdoscom$(OBJ): depend.h printf.h stream.h kctype.h bdoscom$(OBJ): string.h malloc.h bdoscom$(OBJ): dirent.h unixemu.h bdoscom$(OBJ): sysemu.h system.h pathname.h bdoscom$(OBJ): typesize.h termio.h bdoscom$(OBJ): wait.h bsysemu$(OBJ): headers.h machine.h config.h bsysemu$(OBJ): depend.h printf.h stream.h kctype.h bsysemu$(OBJ): string.h malloc.h bsysemu$(OBJ): sysemu.h dirent.h unixemu.h bsysemu$(OBJ): log.h pathname.h typesize.h termio.h bsysemu$(OBJ): realpath.h nprintf$(OBJ): headers.h machine.h config.h nprintf$(OBJ): depend.h printf.h stream.h kctype.h nprintf$(OBJ): typesize.h string.h ntermio$(OBJ): headers.h machine.h config.h ntermio$(OBJ): depend.h typesize.h sysemu.h dirent.h ntermio$(OBJ): unixemu.h ntermio$(OBJ): stream.h termio.h nstream$(OBJ): headers.h machine.h config.h nstream$(OBJ): depend.h typesize.h malloc.h sysemu.h nstream$(OBJ): dirent.h unixemu.h nstream$(OBJ): stream.h pathname.h termio.h nstream$(OBJ): socket.h nstring$(OBJ): headers.h machine.h config.h nstring$(OBJ): kctype.h depend.h nstring$(OBJ): string.h nmalloc$(OBJ): headers.h machine.h config.h nmalloc$(OBJ): printf.h stream.h depend.h malloc.h nmalloc$(OBJ): sysemu.h dirent.h unixemu.h ntime$(OBJ): headers.h machine.h config.h ntime$(OBJ): typesize.h string.h time.h npathnam$(OBJ): headers.h machine.h config.h npathnam$(OBJ): depend.h npathnam$(OBJ): printf.h stream.h kctype.h npathnam$(OBJ): string.h malloc.h dirent.h unixemu.h npathnam$(OBJ): sysemu.h npathnam$(OBJ): pathname.h typesize.h url.h nsystem$(OBJ): headers.h machine.h config.h nsystem$(OBJ): depend.h printf.h stream.h kctype.h nsystem$(OBJ): string.h malloc.h nsystem$(OBJ): dirent.h unixemu.h nsystem$(OBJ): sysemu.h system.h pathname.h nsystem$(OBJ): typesize.h termio.h nsystem$(OBJ): wait.h nsystem$(OBJ): termemu.h time.h posixsh.h socket.h nsystem$(OBJ): url.h urldisk.h namelist.h auth.h nposixsh$(OBJ): headers.h machine.h config.h nposixsh$(OBJ): depend.h printf.h stream.h kctype.h nposixsh$(OBJ): string.h malloc.h nposixsh$(OBJ): sysemu.h dirent.h unixemu.h nposixsh$(OBJ): system.h pathname.h typesize.h nposixsh$(OBJ): termio.h nposixsh$(OBJ): wait.h nposixsh$(OBJ): termemu.h time.h posixsh.h ndoscom$(OBJ): headers.h machine.h config.h ndoscom$(OBJ): depend.h printf.h stream.h kctype.h ndoscom$(OBJ): string.h malloc.h ndoscom$(OBJ): dirent.h unixemu.h ndoscom$(OBJ): sysemu.h system.h pathname.h ndoscom$(OBJ): typesize.h termio.h ndoscom$(OBJ): wait.h ndoscom$(OBJ): realpath.h urldisk.h namelist.h url.h ndoscom$(OBJ): auth.h nsysemu$(OBJ): headers.h machine.h config.h nsysemu$(OBJ): depend.h printf.h stream.h kctype.h nsysemu$(OBJ): string.h malloc.h nsysemu$(OBJ): sysemu.h dirent.h unixemu.h nsysemu$(OBJ): log.h pathname.h typesize.h termio.h nsysemu$(OBJ): realpath.h socket.h nsysemu$(OBJ): urldisk.h namelist.h url.h auth.h nrealpat$(OBJ): headers.h machine.h config.h nrealpat$(OBJ): depend.h nrealpat$(OBJ): printf.h stream.h kctype.h nrealpat$(OBJ): string.h sysemu.h dirent.h unixemu.h nrealpat$(OBJ): pathname.h nrealpat$(OBJ): typesize.h realpath.h url.h nencode$(OBJ): headers.h machine.h config.h nencode$(OBJ): kctype.h depend.h nencode$(OBJ): sysemu.h dirent.h unixemu.h nencode$(OBJ): stream.h nencode$(OBJ): pathname.h typesize.h encode.h nparse$(OBJ): headers.h machine.h config.h nparse$(OBJ): depend.h printf.h stream.h kctype.h nparse$(OBJ): string.h malloc.h nparse$(OBJ): sysemu.h dirent.h unixemu.h nparse$(OBJ): realpath.h parse.h system.h nparse$(OBJ): pathname.h typesize.h termio.h nparse$(OBJ): wait.h nsocket$(OBJ): headers.h machine.h config.h nsocket$(OBJ): depend.h printf.h stream.h kctype.h nsocket$(OBJ): typesize.h malloc.h nsocket$(OBJ): sysemu.h dirent.h unixemu.h nsocket$(OBJ): termio.h nsocket$(OBJ): socket.h nurl$(OBJ): headers.h machine.h config.h nurl$(OBJ): depend.h printf.h nurl$(OBJ): stream.h kctype.h nurl$(OBJ): typesize.h string.h malloc.h sysemu.h dirent.h unixemu.h nurl$(OBJ): pathname.h url.h nauth$(OBJ): headers.h machine.h config.h nauth$(OBJ): depend.h printf.h stream.h string.h nauth$(OBJ): malloc.h time.h pathname.h typesize.h encode.h parse.h nauth$(OBJ): socket.h auth.h url.h system.h nauth$(OBJ): termio.h nauth$(OBJ): wait.h unixemu.h nauth$(OBJ): sysemu.h dirent.h nftp$(OBJ): headers.h machine.h config.h nftp$(OBJ): depend.h printf.h nftp$(OBJ): stream.h kctype.h nftp$(OBJ): string.h malloc.h time.h sysemu.h dirent.h unixemu.h nftp$(OBJ): pathname.h nftp$(OBJ): typesize.h termio.h nftp$(OBJ): parse.h nftp$(OBJ): lsparse.h namelist.h socket.h auth.h nftp$(OBJ): url.h urldisk.h nhtml$(OBJ): headers.h machine.h config.h nhtml$(OBJ): depend.h printf.h stream.h kctype.h nhtml$(OBJ): typesize.h string.h nhtml$(OBJ): malloc.h sysemu.h dirent.h unixemu.h nhtml$(OBJ): pathname.h termio.h nhtml$(OBJ): parse.h html.h urldisk.h nhtml$(OBJ): namelist.h url.h auth.h nhttp$(OBJ): headers.h machine.h config.h nhttp$(OBJ): depend.h printf.h stream.h kctype.h nhttp$(OBJ): string.h malloc.h nhttp$(OBJ): time.h sysemu.h dirent.h unixemu.h nhttp$(OBJ): pathname.h typesize.h termio.h nhttp$(OBJ): parse.h lsparse.h namelist.h nhttp$(OBJ): socket.h auth.h url.h html.h nhttp$(OBJ): urldisk.h nurldisk$(OBJ): headers.h machine.h config.h nurldisk$(OBJ): depend.h printf.h stream.h string.h nurldisk$(OBJ): malloc.h time.h sysemu.h dirent.h unixemu.h nurldisk$(OBJ): pathname.h nurldisk$(OBJ): typesize.h termio.h nurldisk$(OBJ): realpath.h nurldisk$(OBJ): lsparse.h namelist.h socket.h nurldisk$(OBJ): urldisk.h url.h auth.h nlsparse$(OBJ): headers.h machine.h config.h nlsparse$(OBJ): depend.h kctype.h nlsparse$(OBJ): string.h malloc.h time.h dirent.h nlsparse$(OBJ): unixemu.h nlsparse$(OBJ): pathname.h typesize.h device.h parse.h lsparse.h namelist.h evalopt$(OBJ): headers.h machine.h config.h evalopt$(OBJ): evalopt.h gentbl$(OBJ): headers.h machine.h config.h gentbl$(OBJ): gentbl.h mkunitbl$(OBJ): headers.h machine.h config.h mkunitbl$(OBJ): typesize.h evalopt.h gentbl.h mkdict$(OBJ): headers.h machine.h config.h mkdict$(OBJ): kctype.h depend.h mkdict$(OBJ): typesize.h string.h kconv.h roman.h mkdict$(OBJ): hinsi.h evalopt.h gentbl.h mktankan$(OBJ): headers.h machine.h config.h mktankan$(OBJ): kctype.h depend.h mktankan$(OBJ): typesize.h kconv.h roman.h mkkanji$(OBJ): headers.h machine.h config.h mkkanji$(OBJ): typesize.h mkcat$(OBJ): headers.h machine.h config.h mkcat$(OBJ): kctype.h depend.h mkcat$(OBJ): typesize.h version.h evalopt.h gentbl.h mkdir_p$(OBJ): headers.h machine.h config.h mkdir_p$(OBJ): kctype.h depend.h mkdir_p$(OBJ): typesize.h kanjicnv$(OBJ): headers.h machine.h config.h kanjicnv$(OBJ): evalopt.h expfunc$(OBJ): headers.h machine.h config.h mkfuncno$(OBJ): fd.h headers.h machine.h config.h mkfuncno$(OBJ): depend.h types.h typesize.h stream.h mkfuncno$(OBJ): lsparse.h namelist.h functabl.h tstring$(OBJ): headers.h machine.h config.h tstring$(OBJ): kctype.h depend.h tstring$(OBJ): string.h troman$(OBJ): headers.h machine.h config.h troman$(OBJ): depend.h kctype.h troman$(OBJ): typesize.h string.h kconv.h roman.h tkconv$(OBJ): headers.h machine.h config.h tkconv$(OBJ): depend.h kctype.h tkconv$(OBJ): typesize.h string.h unixemu.h kconv.h tkconv$(OBJ): termemu.h pathname.h tevalopt$(OBJ): headers.h machine.h config.h tevalopt$(OBJ): evalopt.h tgentbl$(OBJ): headers.h machine.h config.h tgentbl$(OBJ): gentbl.h tunitbl$(OBJ): headers.h machine.h config.h FD-3.01j/makefile.dpc100644 2105 1751 153656 13516612560 13206 0ustar shiraiuser# # Makefile for fd # TITLE = FD- VERMAJ = 3 VERSION = 3.01j PREFIX = CONFDIR = BUILD = MANSEC = 1 BINTOP = $(PREFIX)\bin BINDIR = $(BUILD)$(BINTOP) DATATOP = $(PREFIX)\share DATADIR = $(BUILD)$(DATATOP)\fd MANTOP = $(PREFIX)\man MANDIR = $(BUILD)$(MANTOP)\man$(MANSEC) CATDIR = $(BUILD)$(MANTOP)\cat$(MANSEC) JMANDIR = $(BUILD)$(MANTOP)\man$(MANSEC) JCATDIR = $(BUILD)$(MANTOP)\cat$(MANSEC) IPKWDIR = .\ipk.work IPKTDIR = .\ipk.tmp DEPDIR = .\depend.tmp DIST = none DEFRC = $(CONFDIR)\fd2rc BLDRC = $(BUILD)$(DEFRC) DOSRC = ~FD\\fd2rc UNITBL = fd-unicd.tbl DICTTBL = fd-dict.tbl DICTTXT = fd-dict.txt DICTSRC = CATTBL = fd-cat.ja ECATTBL = fd-cat.C TABLES = $(UNITBL) $(CATTBL) $(ECATTBL) SRC = main.c printf.c termio.c term.c stream.c \ string.c malloc.c time.c \ pathname.c system.c posixsh.c doscom.c \ log.c sysemu.c dosdisk.c unixdisk.c \ realpath.c encode.c \ libc.c file.c mntinfo.c statfs.c apply.c \ pty.c termemu.c frontend.c backend.c \ parse.c builtin.c shell.c \ socket.c url.c auth.c \ ftp.c html.c http.c urldisk.c \ catalog.c \ kconv.c input.c ime.c dict.c roman.c \ info.c rockridg.c tree.c \ lsparse.c archive.c \ custom.c command.c browse.c HSRC = evalopt.c gentbl.c \ mkunitbl.c mkdict.c mktankan.c \ mkkanji.c mkcat.c mkdir_p.c \ kanjicnv.c expfunc.c \ mkfuncno.c DSRC = $(DEPDIR)\unitbl.c $(DEPDIR)\dicttbl.c HEADER = fd.h \ headers.h machine.h \ depend.h \ printf.h kctype.h typesize.h \ string.h malloc.h time.h \ dirent.h sysemu.h log.h \ pathname.h system.h posixsh.h wait.h \ termio.h term.h stream.h \ types.h namelist.h \ dosdisk.h unixdisk.h unixemu.h \ realpath.h encode.h termemu.h \ mntinfo.h fsinfo.h device.h parse.h lsparse.h \ socket.h url.h auth.h html.h urldisk.h \ catalog.h \ evalopt.h gentbl.h \ kconv.h roman.h hinsi.h \ func.h functabl.h SSRC = printf.c termio.c stream.c \ string.c malloc.c time.c \ pathname.c system.c posixsh.c doscom.c \ sysemu.c BSRC = printf.c termio.c stream.c \ string.c malloc.c \ pathname.c system.c doscom.c \ sysemu.c NSRC = printf.c termio.c stream.c \ string.c malloc.c time.c \ pathname.c system.c posixsh.c doscom.c \ sysemu.c \ realpath.c encode.c \ parse.c \ socket.c url.c auth.c \ ftp.c html.c http.c urldisk.c \ lsparse.c TSRC = string.c roman.c kconv.c evalopt.c gentbl.c unitbl.c DOC = README.eng HISTORY.eng FAQ.eng TECHKNOW.eng \ Install.eng ToAdmin.eng LICENSES.eng JDOC = README HISTORY FAQ TECHKNOW \ Install ToAdmin LICENSES MANSRC = fd_e.man MANCAT = fd_e.cat JMANSRC = fd.man JMANCAT = fd.cat RUNCOM = fdrc ARGS = object.arg SARGS = sobject.arg NARGS = nobject.arg SRCS = $(DOC) $(MANSRC) $(MANCAT) \ Configur Makefile Makefile.in $(SRC) $(HSRC) $(HEADER) \ makefile.gpc makefile.g98 \ makefile.dpc makefile.d98 \ makefile.lpc makefile.l98 \ makefile.bpc makefile.b98 \ mkmfdosg.sed mkmfdosd.sed mkmfdosl.sed mkmfdosb.sed \ mkmfsed.c \ config.hin version.h \ _fdrc _fdrc.dif fd.spec JSRCS = $(JDOC) $(JMANSRC) $(JMANCAT) \ kanji.hin SOURCES = $(SRCS) $(JSRCS) SHSOURCES = $(NSRC) \ headers.h machine.h \ depend.h \ printf.h kctype.h typesize.h \ string.h malloc.h time.h \ dirent.h sysemu.h log.h \ pathname.h system.h posixsh.h wait.h \ termio.h stream.h \ namelist.h \ unixemu.h \ realpath.h encode.h \ device.h parse.h lsparse.h \ socket.h url.h auth.h html.h urldisk.h \ kanjicnv.c expfunc.c mkmfsed.c \ Configur Makefile Makefile.in \ makefile.gpc makefile.g98 \ makefile.dpc makefile.d98 \ makefile.lpc makefile.l98 \ makefile.bpc makefile.b98 \ mkmfdosg.sed mkmfdosd.sed mkmfdosl.sed mkmfdosb.sed \ config.hin version.h CC = gcc HOSTCC = $(CC) INSTALL = copy /y MAKE = make SHELL = \bin\sh SED = sed ECHO = echo CP = copy /y RM = del LN = copy /y MV = mv CHMOD = chmod LINT = lint TAR = tar LHA = lha SHAR = shar EXE = .exe OBJ = .o PROGRAM = fd ALIAS = fdsh DOSOBJS = unixdisk$(OBJ) IMEOBJS = ime$(OBJ) dict$(OBJ) roman$(OBJ) SCKOBJS = socket$(OBJ) url$(OBJ) auth$(OBJ) \ ftp$(OBJ) html$(OBJ) http$(OBJ) urldisk$(OBJ) OBJ1 = main$(OBJ) printf$(OBJ) termio$(OBJ) term$(OBJ) stream$(OBJ) \ string$(OBJ) malloc$(OBJ) time$(OBJ) OBJ2 = pathname$(OBJ) system$(OBJ) posixsh$(OBJ) doscom$(OBJ) \ log$(OBJ) sysemu$(OBJ) dosdisk$(OBJ) $(DOSOBJS) OBJ3 = realpath$(OBJ) encode$(OBJ) \ libc$(OBJ) file$(OBJ) mntinfo$(OBJ) statfs$(OBJ) apply$(OBJ) \ pty$(OBJ) termemu$(OBJ) frontend$(OBJ) backend$(OBJ) OBJ4 = parse$(OBJ) builtin$(OBJ) shell$(OBJ) OBJ5 = catalog$(OBJ) \ kconv$(OBJ) input$(OBJ) OBJ6 = info$(OBJ) rockridg$(OBJ) tree$(OBJ) \ lsparse$(OBJ) archive$(OBJ) \ custom$(OBJ) command$(OBJ) browse$(OBJ) SOBJ1 = sprintf$(OBJ) stermio$(OBJ) sstream$(OBJ) \ sstring$(OBJ) smalloc$(OBJ) stime$(OBJ) SOBJ2 = spathnam$(OBJ) ssystem$(OBJ) sposixsh$(OBJ) sdoscom$(OBJ) \ ssysemu$(OBJ) BOBJ = bprintf$(OBJ) btermio$(OBJ) bstream$(OBJ) \ bstring$(OBJ) bmalloc$(OBJ) \ bpathnam$(OBJ) bsystem$(OBJ) bdoscom$(OBJ) \ bsysemu$(OBJ) NOBJ1 = nprintf$(OBJ) ntermio$(OBJ) nstream$(OBJ) \ nstring$(OBJ) nmalloc$(OBJ) ntime$(OBJ) NOBJ2 = npathnam$(OBJ) nsystem$(OBJ) nposixsh$(OBJ) ndoscom$(OBJ) \ nsysemu$(OBJ) \ nrealpat$(OBJ) nencode$(OBJ) NOBJ3 = nparse$(OBJ) \ nsocket$(OBJ) nurl$(OBJ) nauth$(OBJ) \ nftp$(OBJ) nhtml$(OBJ) nhttp$(OBJ) nurldisk$(OBJ) \ nlsparse$(OBJ) KOBJ = tevalopt$(OBJ) COBJ = tevalopt$(OBJ) tgentbl$(OBJ) UOBJ = tevalopt$(OBJ) tgentbl$(OBJ) TOBJ = tstring$(OBJ) troman$(OBJ) tkconv$(OBJ) tevalopt$(OBJ) tgentbl$(OBJ) ALLOC = DEBUG = CFLAGS = -O HOSTCFLAGS = $(CFLAGS) CPPFLAGS = HOSTCPPFLAGS = $(CPPFLAGS) LDFLAGS = HOSTLDFLAGS = $(LDFLAGS) OSOPTS = -DDOSV COPTS = $(OSOPTS) $(DEBUG) $(CFLAGS) HOSTCOPTS = $(COPTS) FLDFLAGS = $(ALLOC) $(LDFLAGS) SLDFLAGS = $(ALLOC) $(LDFLAGS) NLDFLAGS = $(ALLOC) $(LDFLAGS) BUILDFLAGS = $(COPTS) $(CPPFLAGS) FDCFLAGS = $(BUILDFLAGS) -DFD=$(VERMAJ) SHCFLAGS = $(BUILDFLAGS) -DFDSH=$(VERMAJ) BSHCFLAGS = $(BUILDFLAGS) -DFDSH=$(VERMAJ) -DMINIMUMSHELL NSHCFLAGS = $(BUILDFLAGS) -DFDSH=$(VERMAJ) -DWITHNETWORK DEFCFLAGS = -DDEFRC='"'$(DOSRC)'"' .SUFFIXES: .h .c .o .exe ############################################################ # Dependency Rules ############################################################ all: $(PROGRAM)$(EXE) $(PROGRAM).$(MANSEC) $(TABLES) $(PROGRAM)$(EXE): $(OBJ1) $(OBJ2) $(OBJ3) $(OBJ4) $(OBJ5) $(OBJ6) $(ARGS) # @sleep 1 $(CC) -o $@ @$(ARGS) $(FLDFLAGS) # @ren $@ $(PROGRAM) # @aout2exe $(PROGRAM) # @del $(PROGRAM) $(ARGS): $(OBJ1) $(OBJ2) $(OBJ3) $(OBJ4) $(OBJ5) $(OBJ6) # @sleep 1 @$(ECHO) $(OBJ1) > $(ARGS) @$(ECHO) $(OBJ2) >> $(ARGS) @$(ECHO) $(OBJ3) >> $(ARGS) @$(ECHO) $(OBJ4) >> $(ARGS) @$(ECHO) $(OBJ5) >> $(ARGS) @$(ECHO) $(OBJ6) >> $(ARGS) # @sleep 1 main$(OBJ): main.c $(CC) $(FDCFLAGS) $(DEFCFLAGS) -c -o $@ $*.c termio$(OBJ): termio.c $(CC) $(FDCFLAGS) -c -o $@ $*.c system$(OBJ): system.c $(CC) $(FDCFLAGS) $(DEFCFLAGS) -c -o $@ $*.c custom$(OBJ): custom.c $(CC) $(FDCFLAGS) -c -o $@ $*.c .c.o: $(CC) $(FDCFLAGS) -c -o $@ $*.c ############################################################ # kanji using module $(PROGRAM).$(MANSEC): kanjicnv$(EXE) $(JMANSRC) .\kanjicnv$(EXE) -s -c $(JMANSRC) $@ $(PROGRAM).$(MANSEC)c: kanjicnv$(EXE) $(JMANCAT) .\kanjicnv$(EXE) -s $(JMANCAT) $@ $(PROGRAM).eng: kanjicnv$(EXE) $(MANCAT) .\kanjicnv$(EXE) -b $(MANCAT) $@ $(PROGRAM).doc: kanjicnv$(EXE) $(JMANCAT) .\kanjicnv$(EXE) -s -b $(JMANCAT) $@ README.doc: kanjicnv$(EXE) README .\kanjicnv$(EXE) -s README $@ HISTORY.doc: kanjicnv$(EXE) HISTORY .\kanjicnv$(EXE) -s HISTORY $@ FAQ.doc: kanjicnv$(EXE) FAQ .\kanjicnv$(EXE) -s FAQ $@ LICENSES.doc: kanjicnv$(EXE) LICENSES .\kanjicnv$(EXE) -s LICENSES $@ kanjicnv$(EXE): kanjicnv$(OBJ) $(KOBJ) # @sleep 1 $(HOSTCC) $(HOSTCOPTS) $(HOSTLDFLAGS) -o $@ kanjicnv$(OBJ) $(KOBJ) # @ren $@ kanjicnv # @aout2exe kanjicnv # @del kanjicnv # @sleep 1 kanjicnv$(OBJ): kanjicnv.c $(HOSTCC) $(HOSTCOPTS) $(HOSTCPPFLAGS) -c -o $@ $*.c ############################################################ # message catalog module kanji.h: mkkanji$(EXE) kanjicnv$(EXE) kanji.hin .\mkkanji$(EXE) kanji.hin | \ .\kanjicnv$(EXE) -s -c - $@ # @sleep 1 mkkanji$(EXE): mkkanji$(OBJ) # @sleep 1 $(HOSTCC) $(HOSTCOPTS) $(HOSTLDFLAGS) -o $@ mkkanji$(OBJ) # @ren $@ mkkanji # @aout2exe mkkanji # @del mkkanji # @sleep 1 mkkanji$(OBJ): mkkanji.c $(HOSTCC) $(HOSTCOPTS) $(HOSTCPPFLAGS) -c -o $@ $*.c _fd-cat.ja: mkcat$(EXE) kanji.h .\mkcat$(EXE) -c 1 kanji.h $@ # @sleep 1 _fd-cat.C: mkcat$(EXE) kanji.h .\mkcat$(EXE) -c 2 kanji.h $@ # @sleep 1 fd-cat.ja: mkcat$(EXE) _fd-cat.ja .\mkcat$(EXE) _fd-cat.ja $@ fd-cat.C: mkcat$(EXE) _fd-cat.C .\mkcat$(EXE) _fd-cat.C $@ mkcat$(EXE): mkcat$(OBJ) $(COBJ) # @sleep 1 $(HOSTCC) $(HOSTCOPTS) $(HOSTLDFLAGS) -o $@ mkcat$(OBJ) $(COBJ) # @ren $@ mkcat # @aout2exe mkcat # @del mkcat # @sleep 1 mkcat$(OBJ): mkcat.c $(HOSTCC) $(HOSTCOPTS) $(HOSTCPPFLAGS) -c -o $@ $*.c ############################################################ # function list using module funcno.h: mkfuncno$(EXE) .\mkfuncno$(EXE) $@ # @sleep 1 mkfuncno$(EXE): mkfuncno$(OBJ) # @sleep 1 $(HOSTCC) $(HOSTCOPTS) $(HOSTLDFLAGS) -o $@ mkfuncno$(OBJ) # @ren $@ mkfuncno # @aout2exe mkfuncno # @del mkfuncno # @sleep 1 mkfuncno$(OBJ): mkfuncno.c $(HOSTCC) $(HOSTCOPTS) $(HOSTCPPFLAGS) -DFD=$(VERMAJ) -c -o $@ $*.c ############################################################ # UNICODE table generating module $(UNITBL): mkunitbl$(EXE) .\mkunitbl$(EXE) $@ unitbl.c: mkunitbl$(EXE) .\mkunitbl$(EXE) -t $@ $(DEPDIR)\unitbl.c: mkunitbl$(EXE) [ -d $(DEPDIR) ] || mkdir $(DEPDIR) .\mkunitbl$(EXE) -t -n $@ mkunitbl$(EXE): mkunitbl$(OBJ) $(UOBJ) # @sleep 1 $(HOSTCC) $(HOSTCOPTS) $(HOSTLDFLAGS) -o $@ mkunitbl$(OBJ) $(UOBJ) # @ren $@ mkunitbl # @aout2exe mkunitbl # @del mkunitbl # @sleep 1 mkunitbl$(OBJ): mkunitbl.c $(HOSTCC) $(HOSTCOPTS) $(HOSTCPPFLAGS) -c -o $@ $*.c tunitbl$(OBJ): unitbl.c $(HOSTCC) $(HOSTCOPTS) $(HOSTCPPFLAGS) -c -o $@ unitbl.c ############################################################ # Kanji transfer table generating module $(DICTTBL): mkdict$(EXE) $(DICTSRC) .\mkdict$(EXE) $@ $(DICTSRC) dicttbl.c: mkdict$(EXE) $(DICTSRC) .\mkdict$(EXE) -t $@ $(DICTSRC) $(DEPDIR)\dicttbl.c: mkdict$(EXE) $(DICTSRC) [ -d $(DEPDIR) ] || mkdir $(DEPDIR) .\mkdict$(EXE) -t -n $@ $(DICTSRC) mkdict$(EXE): mkdict$(OBJ) $(TOBJ) # @sleep 1 $(HOSTCC) $(HOSTCOPTS) $(HOSTLDFLAGS) -o $@ mkdict$(OBJ) $(TOBJ) # @ren $@ mkdict # @aout2exe mkdict # @del mkdict # @sleep 1 mktankan$(EXE): mktankan$(OBJ) $(TOBJ) # @sleep 1 $(HOSTCC) $(HOSTCOPTS) $(HOSTLDFLAGS) -o $@ mktankan$(OBJ) $(TOBJ) # @ren $@ mktankan # @aout2exe mktankan # @del mktankan # @sleep 1 mkdict$(OBJ): mkdict.c $(HOSTCC) $(HOSTCOPTS) $(HOSTCPPFLAGS) -c -o $@ $*.c mktankan$(OBJ): mktankan.c $(HOSTCC) $(HOSTCOPTS) $(HOSTCPPFLAGS) -c -o $@ $*.c tstring$(OBJ): string.c $(HOSTCC) $(HOSTCOPTS) $(HOSTCPPFLAGS) -c -o $@ string.c troman$(OBJ): roman.c $(HOSTCC) $(HOSTCOPTS) $(HOSTCPPFLAGS) -c -o $@ roman.c tkconv$(OBJ): kconv.c $(HOSTCC) $(HOSTCOPTS) $(HOSTCPPFLAGS) -c -o $@ kconv.c tevalopt$(OBJ): evalopt.c $(HOSTCC) $(HOSTCOPTS) $(HOSTCPPFLAGS) -c -o $@ evalopt.c tgentbl$(OBJ): gentbl.c $(HOSTCC) $(HOSTCOPTS) $(HOSTCPPFLAGS) -c -o $@ gentbl.c rmdict: -$(RM) $(DICTTBL) $(DICTTXT): mktankan$(EXE) .\mktankan$(EXE) $@ # @sleep 1 ############################################################ # Directory generating module mkdir_p$(EXE): mkdir_p$(OBJ) # @sleep 1 $(HOSTCC) $(HOSTCOPTS) $(HOSTLDFLAGS) -o $@ mkdir_p$(OBJ) # @ren $@ mkdir_p # @aout2exe mkdir_p # @del mkdir_p # @sleep 1 mkdir_p$(OBJ): mkdir_p.c $(HOSTCC) $(HOSTCOPTS) $(HOSTCPPFLAGS) -c -o $@ $*.c ############################################################ # to install all install: install-bin install-runcom install-man install-jman install-bin: $(PROGRAM)$(EXE) mkdir_p$(EXE) install-table [ -d $(BINDIR) ] || .\mkdir_p$(EXE) $(BINDIR) $(INSTALL) $(PROGRAM)$(EXE) $(BINDIR) $(CHMOD) a+rx $(BINDIR)\$(PROGRAM)$(EXE) -$(RM) $(BINDIR)\$(ALIAS)$(EXE) $(LN) $(BINDIR)\$(PROGRAM)$(EXE) $(BINDIR)\$(ALIAS)$(EXE) $(CHMOD) a+rx $(BINDIR)\$(ALIAS)$(EXE) install-runcom: -if [ -f $(RUNCOM) ]; then \ $(INSTALL) $(RUNCOM) $(BLDRC); \ $(CHMOD) a+r-x $(BLDRC); \ fi install-table: $(TABLE) mkdir_p$(EXE) -if [ -f $(UNITBL) ]; then \ [ -d $(BINDIR) ] || .\mkdir_p$(EXE) $(BINDIR); \ $(INSTALL) $(UNITBL) $(BINDIR); \ $(CHMOD) a+r-x $(BINDIR)\$(UNITBL); \ fi -if [ -f $(DICTTBL) ]; then \ [ -d $(BINDIR) ] || .\mkdir_p$(EXE) $(BINDIR); \ $(INSTALL) $(DICTTBL) $(BINDIR); \ $(CHMOD) a+r-x $(BINDIR)\$(DICTTBL); \ fi -if [ -f $(CATTBL) ]; then \ [ -d $(BINDIR) ] || .\mkdir_p$(EXE) $(BINDIR); \ $(INSTALL) $(CATTBL) $(BINDIR); \ $(CHMOD) a+r-x $(BINDIR)\$(CATTBL); \ fi -if [ -f $(ECATTBL) ]; then \ [ -d $(BINDIR) ] || .\mkdir_p$(EXE) $(BINDIR); \ $(INSTALL) $(ECATTBL) $(BINDIR); \ $(CHMOD) a+r-x $(BINDIR)\$(ECATTBL); \ fi install-man: $(MANSRC) mkdir_p$(EXE) [ -d $(MANDIR) ] || .\mkdir_p$(EXE) $(MANDIR) $(INSTALL) $(MANSRC) $(MANDIR)\$(PROGRAM).$(MANSEC) $(CHMOD) a+r-x $(MANDIR)\$(PROGRAM).$(MANSEC) -$(RM) $(MANDIR)\$(ALIAS).$(MANSEC) $(LN) $(MANDIR)\$(PROGRAM).$(MANSEC) $(MANDIR)\$(ALIAS).$(MANSEC) $(CHMOD) a+r-x $(MANDIR)\$(ALIAS).$(MANSEC) install-jman: $(PROGRAM).$(MANSEC) mkdir_p$(EXE) [ -d $(JMANDIR) ] || .\mkdir_p$(EXE) $(JMANDIR) [ "$(JMANDIR)" = "$(MANDIR)" ] || \ $(INSTALL) $(PROGRAM).$(MANSEC) $(JMANDIR)\$(PROGRAM).$(MANSEC) $(CHMOD) a+r-x $(JMANDIR)\$(PROGRAM).$(MANSEC) -$(RM) $(JMANDIR)\$(ALIAS).$(MANSEC) $(LN) $(JMANDIR)\$(PROGRAM).$(MANSEC) $(JMANDIR)\$(ALIAS).$(MANSEC) $(CHMOD) a+r-x $(JMANDIR)\$(ALIAS).$(MANSEC) catman: $(MANCAT) mkdir_p$(EXE) [ -d $(CATDIR) ] || .\mkdir_p$(EXE) $(CATDIR) $(INSTALL) $(MANCAT) $(CATDIR)\$(PROGRAM).$(MANSEC) $(CHMOD) a+r-x $(CATDIR)\$(PROGRAM).$(MANSEC) -$(RM) $(CATDIR)\$(ALIAS).$(MANSEC) $(LN) $(CATDIR)\$(PROGRAM).$(MANSEC) $(CATDIR)\$(ALIAS).$(MANSEC) $(CHMOD) a+r-x $(CATDIR)\$(ALIAS).$(MANSEC) catman-b: $(PROGRAM).eng mkdir_p$(EXE) [ -d $(CATDIR) ] || .\mkdir_p$(EXE) $(CATDIR) $(INSTALL) $(PROGRAM).eng $(CATDIR)\$(PROGRAM).$(MANSEC) $(CHMOD) a+r-x $(CATDIR)\$(PROGRAM).$(MANSEC) -$(RM) $(CATDIR)\$(ALIAS).$(MANSEC) $(LN) $(CATDIR)\$(PROGRAM).$(MANSEC) $(CATDIR)\$(ALIAS).$(MANSEC) $(CHMOD) a+r-x $(CATDIR)\$(ALIAS).$(MANSEC) compman: catman -$(RM) $(CATDIR)\$(ALIAS).$(MANSEC) compress -f $(CATDIR)\$(PROGRAM).$(MANSEC) -$(RM) $(CATDIR)\$(ALIAS).$(MANSEC).Z $(LN) $(CATDIR)\$(PROGRAM).$(MANSEC).Z $(CATDIR)\$(ALIAS).$(MANSEC).Z compman-b: catman-b -$(RM) $(CATDIR)\$(ALIAS).$(MANSEC) compress -f $(CATDIR)\$(PROGRAM).$(MANSEC) -$(RM) $(CATDIR)\$(ALIAS).$(MANSEC).Z $(LN) $(CATDIR)\$(PROGRAM).$(MANSEC).Z $(CATDIR)\$(ALIAS).$(MANSEC).Z jcatman: catman $(PROGRAM).$(MANSEC)c mkdir_p$(EXE) [ -d $(JCATDIR) ] || .\mkdir_p$(EXE) $(JCATDIR) $(INSTALL) $(PROGRAM).$(MANSEC)c $(JCATDIR)\$(PROGRAM).$(MANSEC) $(CHMOD) a+r-x $(JCATDIR)\$(PROGRAM).$(MANSEC) -$(RM) $(JCATDIR)\$(ALIAS).$(MANSEC) $(LN) $(JCATDIR)\$(PROGRAM).$(MANSEC) $(JCATDIR)\$(ALIAS).$(MANSEC) $(CHMOD) a+r-x $(JCATDIR)\$(ALIAS).$(MANSEC) jcatman-b: catman-b $(PROGRAM).doc mkdir_p$(EXE) [ -d $(JCATDIR) ] || .\mkdir_p$(EXE) $(JCATDIR) $(INSTALL) $(PROGRAM).doc $(JCATDIR)\$(PROGRAM).$(MANSEC) $(CHMOD) a+r-x $(JCATDIR)\$(PROGRAM).$(MANSEC) -$(RM) $(JCATDIR)\$(ALIAS).$(MANSEC) $(LN) $(JCATDIR)\$(PROGRAM).$(MANSEC) $(JCATDIR)\$(ALIAS).$(MANSEC) $(CHMOD) a+r-x $(JCATDIR)\$(ALIAS).$(MANSEC) jcompman: compman jcatman -$(RM) $(JCATDIR)\$(ALIAS).$(MANSEC) compress -f $(JCATDIR)\$(PROGRAM).$(MANSEC) -$(RM) $(JCATDIR)\$(ALIAS).$(MANSEC).Z $(LN) $(JCATDIR)\$(PROGRAM).$(MANSEC).Z $(JCATDIR)\$(ALIAS).$(MANSEC).Z jcompman-b: compman-b jcatman-b -$(RM) $(JCATDIR)\$(ALIAS).$(MANSEC) compress -f $(JCATDIR)\$(PROGRAM).$(MANSEC) -$(RM) $(JCATDIR)\$(ALIAS).$(MANSEC).Z $(LN) $(JCATDIR)\$(PROGRAM).$(MANSEC).Z $(JCATDIR)\$(ALIAS).$(MANSEC).Z ############################################################ # to make dependency depend: $(SRC) $(HSRC) $(DSRC) config.h kanji.h funcno.h [ -d $(DEPDIR) ] || mkdir $(DEPDIR) for f in $(SRC) $(HSRC); do \ $(SED) -e 's:^\(# *\)include "\(.*\).h":\1include "_\2.h":' \ $${f} > $(DEPDIR)\$${f}; \ done for f in $(DSRC); do \ $(SED) -e 's:^\(# *\)include "\(.*\).h":\1include "_\2.h":' \ $${f} > $${f}o; \ $(MV) $${f}o $${f}; \ done for f in $(SSRC); do \ $(RM) $(DEPDIR)\s$${f}; \ $(LN) $(DEPDIR)\$${f} $(DEPDIR)\s$${f}; \ done for f in $(BSRC); do \ $(RM) $(DEPDIR)\b$${f} && \ $(LN) $(DEPDIR)\$${f} $(DEPDIR)\b$${f}; \ done for f in $(NSRC); do \ $(RM) $(DEPDIR)\n$${f} && \ $(LN) $(DEPDIR)\$${f} $(DEPDIR)\n$${f}; \ done for f in $(TSRC); do \ $(RM) $(DEPDIR)\t$${f} && \ $(LN) $(DEPDIR)\$${f} $(DEPDIR)\t$${f}; \ done for f in $(HEADER) config.h kanji.h funcno.h version.h; do \ $(SED) -e 's:^\(# *\)include "\(.*\).h":\1include "_\2.h":' \ $${f} > $(DEPDIR)\_$${f}; \ done $(CP) Makefile.in Makefile.tmp $(DEPDIR) $(CP) Makefile.tmp $(DEPDIR)\Makefile.sh $(CP) Makefile.tmp $(DEPDIR)\Makefile.bsh $(CP) Makefile.tmp $(DEPDIR)\Makefile.nsh $(CP) Makefile.tmp $(DEPDIR)\Makefile.tr cd $(DEPDIR); makedepend \ -s "# DO NOT DELETE THIS LINE -- make depend depends on it." \ -f Makefile.tmp -- $(FDCFLAGS) -- \ $(SRC) \ `for f in $(DSRC); do $(ECHO) $${f}|$(SED) -e 's:^.*\::'; done` cd $(DEPDIR); makedepend \ -s "# DO NOT DELETE THIS LINE -- make depend depends on it." \ -f Makefile.sh -- $(SHCFLAGS) -- \ `for f in $(SSRC); do $(ECHO) s$${f}; done` cd $(DEPDIR); makedepend \ -s "# DO NOT DELETE THIS LINE -- make depend depends on it." \ -f Makefile.bsh -- $(BSHCFLAGS) -- \ `for f in $(BSRC); do $(ECHO) b$${f}; done` cd $(DEPDIR); makedepend \ -s "# DO NOT DELETE THIS LINE -- make depend depends on it." \ -f Makefile.nsh -- $(NSHCFLAGS) -- \ `for f in $(NSRC); do $(ECHO) n$${f}; done` cd $(DEPDIR); makedepend \ -s "# DO NOT DELETE THIS LINE -- make depend depends on it." \ -f Makefile.tr -- $(HOSTCOPTS) -- \ $(HSRC) \ `for f in $(TSRC); do $(ECHO) t$${f}; done` $(SED) -e '\^# DO NOT DELETE THIS LINE\,$$d' $(DEPDIR)\Makefile.in \ > Makefile.in $(ECHO) "# DO NOT DELETE THIS LINE -- make depend depends on it." \ >> Makefile.in $(SED) -e '1,\^# DO NOT DELETE THIS LINE\d' \ -e 's:^\(........\).*\.o:\1.o:' \ -e 's:\\[^ ]* *::g' \ -e 's:\.o:\$$(OBJ):g' \ -e 's:_\([^ ]*.h\):\1:g' \ -e 's: *$$::' \ -e '\: *$$\d' $(DEPDIR)\Makefile.tmp >> Makefile.in $(SED) -e '1,\^# DO NOT DELETE THIS LINE\d' \ -e 's:^\(........\).*\.o:\1.o:' \ -e 's:\\[^ ]* *::g' \ -e 's:\.o:\$$(OBJ):g' \ -e 's:_\([^ ]*.h\):\1:g' \ -e 's: *$$::' \ -e '\: *$$\d' $(DEPDIR)\Makefile.sh >> Makefile.in $(SED) -e '1,\^# DO NOT DELETE THIS LINE\d' \ -e 's:^\(........\).*\.o:\1.o:' \ -e 's:\\[^ ]* *::g' \ -e 's:\.o:\$$(OBJ):g' \ -e 's:_\([^ ]*.h\):\1:g' \ -e 's: *$$::' \ -e '\: *$$\d' $(DEPDIR)\Makefile.bsh >> Makefile.in $(SED) -e '1,\^# DO NOT DELETE THIS LINE\d' \ -e 's:^\(........\).*\.o:\1.o:' \ -e 's:\\[^ ]* *::g' \ -e 's:\.o:\$$(OBJ):g' \ -e 's:_\([^ ]*.h\):\1:g' \ -e 's: *$$::' \ -e '\: *$$\d' $(DEPDIR)\Makefile.nsh >> Makefile.in $(SED) -e '1,\^# DO NOT DELETE THIS LINE\d' \ -e 's:^\(........\).*\.o:\1.o:' \ -e 's:\\[^ ]* *::g' \ -e 's:\.o:\$$(OBJ):g' \ -e 's:_\([^ ]*.h\):\1:g' \ -e 's: *$$::' \ -e '\: *$$\d' $(DEPDIR)\Makefile.tr >> Makefile.in -rm -rf $(DEPDIR) ############################################################ # to verify sources lint: $(SRC) $(HSRC) config.h kanji.h funcno.h $(LINT) $(OSOPTS) -DFD=$(VERMAJ) `$(SED) -e "s:\$(OBJ):\.c:g" $(ARGS)` SRCS=`$(ECHO) $(UOBJ)|$(SED) -e "s:t\([^ ]*\)\$(OBJ):\1\.c:g"`; \ $(LINT) $(OSOPTS) mkunitbl.c $${SRCS} SRCS=`$(ECHO) $(TOBJ)|$(SED) -e "s:t\([^ ]*\)\$(OBJ):\1\.c:g"`; \ $(LINT) $(OSOPTS) mkdict.c $${SRCS}; \ $(LINT) $(OSOPTS) mktankan.c $${SRCS} $(LINT) $(OSOPTS) mkkanji.c SRCS=`$(ECHO) $(COBJ)|$(SED) -e "s:t\([^ ]*\)\$(OBJ):\1\.c:g"`; \ $(LINT) $(OSOPTS) mkcat.c $${SRCS} $(LINT) $(OSOPTS) mkdir_p.c SRCS=`$(ECHO) $(KOBJ)|$(SED) -e "s:t\([^ ]*\)\$(OBJ):\1\.c:g"`; \ $(LINT) $(OSOPTS) kanjicnv.c $${SRCS} $(LINT) $(OSOPTS) expfunc.c $(LINT) $(OSOPTS) mkfuncno.c ############################################################ # to make configuration file manually config: Configur expfunc.c -if ($(ECHO) 't() { echo $1; }; t test' | $(SHELL) >\dev\null 2>&1); then \ $(SED) -e "2,3d" -e "s:__cc__:gcc:" Configur \ | $(SHELL) > config.h; \ elif $(MAKE) -f Makefile.tmp expfunc$(EXE); then \ $(SED) -e "2,3d" -e "s:__cc__:gcc:" Configur \ | .\expfunc$(EXE) | $(SHELL) > config.h; \ fi # @sleep 1 config.h: config.hin $(CP) config.hin $@ # @sleep 1 expfunc$(EXE): expfunc$(OBJ) # @sleep 1 $(HOSTCC) $(HOSTCOPTS) $(HOSTLDFLAGS) -o $@ expfunc$(OBJ) # @ren $@ expfunc # @aout2exe expfunc # @del expfunc # @sleep 1 expfunc$(OBJ): expfunc.c $(HOSTCC) $(HOSTCOPTS) $(HOSTCPPFLAGS) -c -o $@ $*.c ############################################################ # sample program for pseudo system(3) sh: fdsh$(EXE) fdsh$(EXE): $(SOBJ1) $(SOBJ2) $(SARGS) # @sleep 1 $(CC) -o $@ @$(SARGS) $(SLDFLAGS) # @ren $@ fdsh # @aout2exe fdsh # @del fdsh $(SARGS): $(SOBJ1) $(SOBJ2) # @sleep 1 @$(ECHO) $(SOBJ1) > $(SARGS) @$(ECHO) $(SOBJ2) >> $(SARGS) # @sleep 1 sprintf$(OBJ): printf.c $(CC) $(SHCFLAGS) -c -o $@ printf.c stermio$(OBJ): termio.c $(CC) $(SHCFLAGS) -c -o $@ termio.c sstream$(OBJ): stream.c $(CC) $(SHCFLAGS) -c -o $@ stream.c sstring$(OBJ): string.c $(CC) $(SHCFLAGS) -c -o $@ string.c smalloc$(OBJ): malloc.c $(CC) $(SHCFLAGS) -c -o $@ malloc.c stime$(OBJ): time.c $(CC) $(SHCFLAGS) -c -o $@ time.c spathnam$(OBJ): pathname.c $(CC) $(SHCFLAGS) -c -o $@ pathname.c ssystem$(OBJ): system.c $(CC) $(SHCFLAGS) -c -o $@ system.c sposixsh$(OBJ): posixsh.c $(CC) $(SHCFLAGS) -c -o $@ posixsh.c sdoscom$(OBJ): doscom.c $(CC) $(SHCFLAGS) -c -o $@ doscom.c ssysemu$(OBJ): sysemu.c $(CC) $(SHCFLAGS) -c -o $@ sysemu.c ############################################################ # Bourne shell bsh: fdbsh$(EXE) fdbsh$(EXE): $(BOBJ) # @sleep 1 $(CC) -o $@ $(BOBJ) $(SLDFLAGS) # @ren $@ fdbsh # @aout2exe fdbsh # @del fdbsh bprintf$(OBJ): printf.c $(CC) $(BSHCFLAGS) -c -o $@ printf.c btermio$(OBJ): termio.c $(CC) $(BSHCFLAGS) -c -o $@ termio.c bstream$(OBJ): stream.c $(CC) $(BSHCFLAGS) -c -o $@ stream.c bstring$(OBJ): string.c $(CC) $(BSHCFLAGS) -c -o $@ string.c bmalloc$(OBJ): malloc.c $(CC) $(BSHCFLAGS) -c -o $@ malloc.c bpathnam$(OBJ): pathname.c $(CC) $(BSHCFLAGS) -c -o $@ pathname.c bsystem$(OBJ): system.c $(CC) $(BSHCFLAGS) -c -o $@ system.c bdoscom$(OBJ): doscom.c $(CC) $(BSHCFLAGS) -c -o $@ doscom.c bsysemu$(OBJ): sysemu.c $(CC) $(BSHCFLAGS) -c -o $@ sysemu.c ############################################################ # Network shell nsh: fdnsh$(EXE) fdnsh$(EXE): $(NOBJ1) $(NOBJ2) $(NOBJ3) $(NARGS) # @sleep 1 $(CC) -o $@ @$(NARGS) $(NLDFLAGS) # @ren $@ fdnsh # @aout2exe fdnsh # @del fdnsh $(NARGS): $(NOBJ1) $(NOBJ2) $(NOBJ3) # @sleep 1 @$(ECHO) $(NOBJ1) > $(NARGS) @$(ECHO) $(NOBJ2) >> $(NARGS) @$(ECHO) $(NOBJ3) >> $(NARGS) # @sleep 1 nprintf$(OBJ): printf.c $(CC) $(NSHCFLAGS) -c -o $@ printf.c ntermio$(OBJ): termio.c $(CC) $(NSHCFLAGS) -c -o $@ termio.c nstream$(OBJ): stream.c $(CC) $(NSHCFLAGS) -c -o $@ stream.c nstring$(OBJ): string.c $(CC) $(NSHCFLAGS) -c -o $@ string.c nmalloc$(OBJ): malloc.c $(CC) $(NSHCFLAGS) -c -o $@ malloc.c ntime$(OBJ): time.c $(CC) $(NSHCFLAGS) -c -o $@ time.c npathnam$(OBJ): pathname.c $(CC) $(NSHCFLAGS) -c -o $@ pathname.c nsystem$(OBJ): system.c $(CC) $(NSHCFLAGS) -c -o $@ system.c nposixsh$(OBJ): posixsh.c $(CC) $(NSHCFLAGS) -c -o $@ posixsh.c ndoscom$(OBJ): doscom.c $(CC) $(NSHCFLAGS) -c -o $@ doscom.c nsysemu$(OBJ): sysemu.c $(CC) $(NSHCFLAGS) -c -o $@ sysemu.c nrealpat$(OBJ): realpath.c $(CC) $(NSHCFLAGS) -c -o $@ realpath.c nencode$(OBJ): encode.c $(CC) $(NSHCFLAGS) -c -o $@ encode.c nparse$(OBJ): parse.c $(CC) $(NSHCFLAGS) -c -o $@ parse.c nsocket$(OBJ): socket.c $(CC) $(NSHCFLAGS) -c -o $@ socket.c nurl$(OBJ): url.c $(CC) $(NSHCFLAGS) -c -o $@ url.c nauth$(OBJ): auth.c $(CC) $(NSHCFLAGS) -c -o $@ auth.c nftp$(OBJ): ftp.c $(CC) $(NSHCFLAGS) -c -o $@ ftp.c nhtml$(OBJ): html.c $(CC) $(NSHCFLAGS) -c -o $@ html.c nhttp$(OBJ): http.c $(CC) $(NSHCFLAGS) -c -o $@ http.c nurldisk$(OBJ): urldisk.c $(CC) $(NSHCFLAGS) -c -o $@ urldisk.c nlsparse$(OBJ): lsparse.c $(CC) $(NSHCFLAGS) -c -o $@ lsparse.c ############################################################ # for programer's maintenance tar: $(SOURCES) $(TAR) cvf $(TITLE)$(VERSION).tar $(SOURCES) compress -f $(TITLE)$(VERSION).tar gtar: $(SOURCES) $(TAR) cvf $(TITLE)$(VERSION).tar $(SOURCES) gzip -f $(TITLE)$(VERSION).tar shtar: $(SHSOURCES) (VER=`date '+%y%m%d'`; \ $(TAR) cvf $(TITLE)sh-$${VER}.tar $(SHSOURCES); \ gzip -f $(TITLE)sh-$${VER}.tar) lzh: $(SOURCES) -$(RM) $(TITLE)$(VERSION).lzh $(LHA) a $(TITLE)$(VERSION).lzh $(SOURCES) shar: $(SOURCES) -$(RM) $(TITLE)$(VERSION).shar.[0-9][0-9] $(SHAR) -L50 -apc -n $(TITLE)$(VERSION) -o $(TITLE)$(VERSION).shar \ -T $(SRCS) -C $(JSRCS) ipk: $(PROGRAM)$(EXE) $(TABLES) mkdir_p$(EXE) -[ -d $(IPKWDIR)\$(BINDIR) ] || .\mkdir_p$(EXE) $(IPKWDIR)\$(BINDIR) -[ -d $(IPKWDIR)\$(BINDIR) ] || .\mkdir_p$(EXE) $(IPKWDIR)\$(BINDIR) -[ -d $(IPKWDIR)\$(BINDIR) ] || .\mkdir_p$(EXE) $(IPKWDIR)\$(BINDIR) -[ -d $(IPKWDIR)\$(CONFDIR) ] || .\mkdir_p$(EXE) $(IPKWDIR)\$(CONFDIR) -[ -d $(IPKWDIR)\CONTROL ] || .\mkdir_p$(EXE) $(IPKWDIR)\CONTROL -[ -d $(IPKTDIR) ] || .\mkdir_p$(EXE) $(IPKTDIR) $(CP) -p $(PROGRAM)$(EXE) $(IPKWDIR)\$(BINDIR) -[ -z "$(STRIP)" ] || $(STRIP) $(IPKWDIR)\$(BINDIR)\$(PROGRAM)$(EXE) $(CHMOD) a+rx $(IPKWDIR)\$(BINDIR)\$(PROGRAM)$(EXE) -$(RM) $(IPKWDIR)\$(BINDIR)\$(ALIAS)$(EXE) $(LN) $(IPKWDIR)\$(BINDIR)\$(PROGRAM)$(EXE) \ $(IPKWDIR)\$(BINDIR)\$(ALIAS)$(EXE) $(CHMOD) a+rx $(IPKWDIR)\$(BINDIR)\$(ALIAS)$(EXE) $(SED) -e 's:#TMPDIR=.*:TMPDIR=\home\tmp:' \ -e 's:#LANGUAGE=.*:LANGUAGE=euc:' \ -e 's:#INPUTKCODE=.*:INPUTKCODE=euc:' \ -e 's:#FNAMEKCODE=.*:FNAMEKCODE=utf8:' \ -e '\# launcher definition\,\^$$\ {' \ -e '\^$$\ {' \ -e 'i \' \ -e 'launch ".tar.Z" "gzip -cd %C|tar tvf -" "%a %u\%g %s %y-%m-%d %t %*f"' \ -e 'i \' \ -e 'launch ".taZ" "gzip -cd %C|tar tvf -" "%a %u\%g %s %y-%m-%d %t %*f"' \ -e 'i \' \ -e 'launch ".ipk" "gzip -cd %C|tar xOf - .\data.tar.gz|gzip -cd|tar tvf -" \\' \ -e 'i \' \ -e ' "%a %u\%g %s %y-%m-%d %t %*f"' \ -e 'i \' \ -e 'launch ".deb" "ar -p %C data.tar.gz|gzip -cd|tar tvf -" \\' \ -e 'i \' \ -e ' "%a %u\%g %s %y-%m-%d %t %*f"' \ -e '}' \ -e '}' \ -e '\# archiver definition\,\^$$\ {' \ -e '\^$$\ {' \ -e 'i \' \ -e 'arch ".tar.Z" "echo ERROR; false" "gzip -cd %C|tar xf - %TA"' \ -e 'i \' \ -e 'arch ".taZ" "echo ERROR; false" "gzip -cd %C|tar xf - %TA"' \ -e 'i \' \ -e 'arch ".ipk" "echo ERROR; false" \\' \ -e 'i \' \ -e ' "gzip -cd %C|tar xOf - .\data.tar.gz|gzip -cd|tar xf - %TA"' \ -e 'i \' \ -e 'arch ".deb" "echo ERROR; false" \\' \ -e 'i \' \ -e ' "ar -p %C data.tar.gz|gzip -cd|tar xf - %TA"' \ -e '}' \ -e '}' \ -e '$$ {' \ -e 'a \' \ -e 'if [ " $$TERM" = " vt100" -a " $$CONSOLE" = " \dev\console" ]; then' \ -e 'a \' \ -e ' keymap BS "^?"' \ -e 'a \' \ -e ' keymap DEL "\\033[3~"' \ -e 'a \' \ -e ' keymap HOME "\\033[H"' \ -e 'a \' \ -e ' keymap END "\\033[F"' \ -e 'a \' \ -e 'fi' \ -e '}' \ _fdrc > $(IPKWDIR)\$(BLDRC) $(CHMOD) a+r-x $(IPKWDIR)\$(BLDRC) -if [ -f $(UNITBL) ]; then \ cp -p $(UNITBL) $(IPKWDIR)\$(BINDIR); \ $(CHMOD) a+r-x $(IPKWDIR)\$(BINDIR)\$(UNITBL); \ fi -if [ -f $(DICTTBL) ]; then \ cp -p $(DICTTBL) $(IPKWDIR)\$(BINDIR); \ $(CHMOD) a+r-x $(IPKWDIR)\$(BINDIR)\$(DICTTBL); \ fi -if [ -f $(CATTBL) ]; then \ cp -p $(CATTBL) $(IPKWDIR)\$(BINDIR); \ $(CHMOD) a+r-x $(IPKWDIR)\$(BINDIR)\$(CATTBL); \ fi -if [ -f $(ECATTBL) ]; then \ cp -p $(ECATTBL) $(IPKWDIR)\$(BINDIR); \ $(CHMOD) a+r-x $(IPKWDIR)\$(BINDIR)\$(ECATTBL); \ fi $(ECHO) "Package: fd" > $(IPKWDIR)\CONTROL\control $(ECHO) "Priority: optional" >> $(IPKWDIR)\CONTROL\control $(ECHO) "Section: extras" >> $(IPKWDIR)\CONTROL\control $(ECHO) "Maintainer: $(DIST)" >> $(IPKWDIR)\CONTROL\control $(ECHO) "Architecture: arm" >> $(IPKWDIR)\CONTROL\control $(ECHO) "Version: $(VERSION)-1" >> $(IPKWDIR)\CONTROL\control $(ECHO) "Depends: ncurses" >> $(IPKWDIR)\CONTROL\control $(ECHO) "Description: a file & directory maintenance tool." \ >> $(IPKWDIR)\CONTROL\control (cd $(IPKWDIR); tar cf ..\data.tar --exclude=CONTROL .) (cd $(IPKWDIR)\CONTROL; tar cf ..\..\control.tar .) gzip .\data.tar $(MV) .\data.tar.gz $(IPKTDIR) gzip .\control.tar $(MV) .\control.tar.gz $(IPKTDIR) $(ECHO) "2.0" > $(IPKTDIR)\debian-binary (cd $(IPKTDIR); \ tar cf ..\ipk.tar .\debian-binary .\data.tar.gz .\control.tar.gz) gzip .\ipk.tar $(MV) .\ipk.tar.gz .\fd_$(VERSION)-1_arm.ipk -$(RM) -r $(IPKWDIR) $(IPKTDIR) clean: -$(RM) core -$(RM) *$(OBJ) -$(RM) funcno.h -$(RM) kanji.h -$(RM) _fd-cat.ja -$(RM) _fd-cat.C -$(RM) fd-cat.* -$(RM) kanjicnv$(EXE) -$(RM) expfunc$(EXE) -$(RM) mkdir_p$(EXE) -$(RM) mkfuncno$(EXE) -$(RM) mkunitbl$(EXE) -$(RM) mkdict$(EXE) -$(RM) mktankan$(EXE) -$(RM) mkkanji$(EXE) -$(RM) mkcat$(EXE) -$(RM) fdsh$(EXE) -$(RM) fdbsh$(EXE) -$(RM) fdnsh$(EXE) -$(RM) $(PROGRAM)$(EXE) -$(RM) $(PROGRAM).$(MANSEC) -$(RM) $(PROGRAM).$(MANSEC)c -$(RM) $(PROGRAM).eng -$(RM) $(PROGRAM).doc -$(RM) $(ARGS) -$(RM) $(SARGS) -$(RM) $(NARGS) -$(RM) $(UNITBL) -$(RM) unitbl.c -$(RM) dicttbl.c -$(RM) $(DICTTXT) -$(RM) $(DICTTBL) # DO NOT DELETE THIS LINE -- make depend depends on it. main$(OBJ): fd.h headers.h machine.h config.h main$(OBJ): depend.h printf.h main$(OBJ): stream.h kctype.h main$(OBJ): string.h malloc.h time.h log.h termio.h main$(OBJ): realpath.h main$(OBJ): parse.h kconv.h func.h sysemu.h dirent.h unixemu.h main$(OBJ): pathname.h main$(OBJ): typesize.h term.h types.h lsparse.h namelist.h dosdisk.h main$(OBJ): kanji.h catalog.h version.h system.h wait.h main$(OBJ): termemu.h roman.h urldisk.h url.h auth.h printf$(OBJ): headers.h machine.h config.h printf$(OBJ): depend.h printf.h stream.h kctype.h printf$(OBJ): typesize.h string.h printf$(OBJ): kconv.h termio$(OBJ): headers.h machine.h config.h termio$(OBJ): depend.h typesize.h sysemu.h dirent.h termio$(OBJ): unixemu.h termio$(OBJ): stream.h termio.h term$(OBJ): headers.h machine.h config.h term$(OBJ): depend.h printf.h term$(OBJ): stream.h kctype.h term$(OBJ): typesize.h string.h termio.h term$(OBJ): term.h stream$(OBJ): headers.h machine.h config.h stream$(OBJ): depend.h typesize.h malloc.h sysemu.h stream$(OBJ): dirent.h unixemu.h stream$(OBJ): stream.h pathname.h termio.h stream$(OBJ): socket.h string$(OBJ): headers.h machine.h config.h string$(OBJ): kctype.h depend.h string$(OBJ): string.h malloc$(OBJ): headers.h machine.h config.h malloc$(OBJ): printf.h stream.h depend.h malloc.h malloc$(OBJ): sysemu.h dirent.h unixemu.h time$(OBJ): headers.h machine.h config.h time$(OBJ): typesize.h time$(OBJ): string.h time.h pathname$(OBJ): fd.h headers.h machine.h config.h pathname$(OBJ): depend.h printf.h stream.h kctype.h pathname$(OBJ): string.h malloc.h pathname$(OBJ): dirent.h unixemu.h pathname$(OBJ): sysemu.h pathname.h typesize.h pathname$(OBJ): url.h system$(OBJ): fd.h headers.h machine.h config.h system$(OBJ): depend.h printf.h stream.h kctype.h system$(OBJ): string.h malloc.h system$(OBJ): term.h types.h typesize.h lsparse.h namelist.h kconv.h system$(OBJ): dirent.h unixemu.h system$(OBJ): sysemu.h system.h pathname.h termio.h system$(OBJ): wait.h system$(OBJ): termemu.h posixsh.h socket.h url.h system$(OBJ): urldisk.h auth.h posixsh$(OBJ): fd.h headers.h machine.h config.h posixsh$(OBJ): depend.h printf.h stream.h kctype.h posixsh$(OBJ): string.h malloc.h posixsh$(OBJ): sysemu.h dirent.h unixemu.h posixsh$(OBJ): system.h pathname.h typesize.h posixsh$(OBJ): termio.h posixsh$(OBJ): wait.h posixsh$(OBJ): termemu.h time.h posixsh.h term.h doscom$(OBJ): fd.h headers.h machine.h config.h doscom$(OBJ): depend.h printf.h stream.h kctype.h doscom$(OBJ): string.h malloc.h doscom$(OBJ): term.h types.h typesize.h lsparse.h namelist.h dirent.h doscom$(OBJ): unixemu.h doscom$(OBJ): sysemu.h system.h pathname.h termio.h doscom$(OBJ): wait.h doscom$(OBJ): realpath.h urldisk.h url.h auth.h log$(OBJ): fd.h headers.h machine.h config.h log$(OBJ): depend.h printf.h log$(OBJ): stream.h kctype.h log$(OBJ): string.h malloc.h func.h sysemu.h dirent.h unixemu.h log$(OBJ): pathname.h log$(OBJ): typesize.h term.h types.h lsparse.h namelist.h dosdisk.h sysemu$(OBJ): fd.h headers.h machine.h config.h sysemu$(OBJ): depend.h printf.h stream.h kctype.h sysemu$(OBJ): string.h malloc.h sysemu$(OBJ): kconv.h sysemu.h dirent.h unixemu.h sysemu$(OBJ): log.h pathname.h typesize.h termio.h sysemu$(OBJ): realpath.h dosdisk.h socket.h sysemu$(OBJ): urldisk.h namelist.h url.h auth.h dosdisk$(OBJ): headers.h machine.h config.h dosdisk$(OBJ): depend.h kctype.h dosdisk$(OBJ): string.h time.h sysemu.h dirent.h dosdisk$(OBJ): unixemu.h dosdisk$(OBJ): stream.h pathname.h typesize.h dosdisk.h unixdisk.h kconv.h unixdisk$(OBJ): headers.h machine.h config.h unixdisk$(OBJ): depend.h kctype.h unixdisk$(OBJ): string.h sysemu.h dirent.h unixemu.h unixdisk$(OBJ): stream.h unixdisk$(OBJ): pathname.h typesize.h dosdisk.h unixdisk.h realpath$(OBJ): fd.h headers.h machine.h config.h realpath$(OBJ): depend.h printf.h stream.h kctype.h realpath$(OBJ): string.h malloc.h realpath$(OBJ): sysemu.h dirent.h unixemu.h realpath$(OBJ): pathname.h typesize.h realpath.h realpath$(OBJ): url.h encode$(OBJ): headers.h machine.h config.h encode$(OBJ): kctype.h depend.h encode$(OBJ): sysemu.h dirent.h unixemu.h encode$(OBJ): stream.h encode$(OBJ): pathname.h typesize.h encode.h libc$(OBJ): fd.h headers.h machine.h config.h libc$(OBJ): depend.h printf.h libc$(OBJ): stream.h kctype.h libc$(OBJ): string.h malloc.h log.h realpath.h parse.h kconv.h func.h libc$(OBJ): sysemu.h dirent.h unixemu.h libc$(OBJ): pathname.h typesize.h term.h types.h libc$(OBJ): lsparse.h namelist.h dosdisk.h kanji.h catalog.h system.h libc$(OBJ): termio.h libc$(OBJ): wait.h libc$(OBJ): termemu.h url.h file$(OBJ): fd.h headers.h machine.h config.h file$(OBJ): depend.h printf.h file$(OBJ): stream.h kctype.h file$(OBJ): string.h malloc.h time.h termio.h file$(OBJ): realpath.h file$(OBJ): kconv.h func.h sysemu.h dirent.h unixemu.h file$(OBJ): pathname.h typesize.h term.h types.h file$(OBJ): lsparse.h namelist.h dosdisk.h kanji.h catalog.h urldisk.h file$(OBJ): url.h auth.h mntinfo$(OBJ): headers.h machine.h config.h mntinfo$(OBJ): kctype.h depend.h mntinfo$(OBJ): string.h malloc.h pathname.h mntinfo$(OBJ): typesize.h mntinfo.h fsinfo.h statfs$(OBJ): headers.h machine.h config.h statfs$(OBJ): fsinfo.h apply$(OBJ): fd.h headers.h machine.h config.h apply$(OBJ): depend.h printf.h stream.h kctype.h apply$(OBJ): string.h malloc.h apply$(OBJ): time.h realpath.h parse.h func.h sysemu.h dirent.h unixemu.h apply$(OBJ): pathname.h apply$(OBJ): typesize.h term.h types.h lsparse.h namelist.h dosdisk.h apply$(OBJ): kanji.h catalog.h pty$(OBJ): fd.h headers.h machine.h config.h pty$(OBJ): depend.h printf.h pty$(OBJ): stream.h kctype.h pty$(OBJ): string.h malloc.h sysemu.h dirent.h unixemu.h pty$(OBJ): pathname.h pty$(OBJ): typesize.h termio.h termemu$(OBJ): fd.h headers.h machine.h config.h termemu$(OBJ): depend.h printf.h stream.h kctype.h termemu$(OBJ): string.h malloc.h termemu$(OBJ): wait.h unixemu.h termio.h termemu$(OBJ): func.h sysemu.h dirent.h termemu$(OBJ): pathname.h termemu$(OBJ): typesize.h term.h types.h lsparse.h namelist.h dosdisk.h termemu$(OBJ): kanji.h catalog.h system.h termemu.h frontend$(OBJ): fd.h headers.h machine.h config.h frontend$(OBJ): depend.h printf.h stream.h kctype.h frontend$(OBJ): string.h malloc.h frontend$(OBJ): wait.h unixemu.h parse.h func.h frontend$(OBJ): sysemu.h dirent.h frontend$(OBJ): pathname.h typesize.h term.h frontend$(OBJ): types.h lsparse.h namelist.h dosdisk.h funcno.h kanji.h frontend$(OBJ): catalog.h system.h termio.h frontend$(OBJ): termemu.h frontend$(OBJ): roman.h backend$(OBJ): fd.h headers.h machine.h config.h backend$(OBJ): depend.h printf.h stream.h kctype.h backend$(OBJ): string.h malloc.h backend$(OBJ): termio.h backend$(OBJ): kconv.h func.h sysemu.h backend$(OBJ): dirent.h unixemu.h backend$(OBJ): pathname.h typesize.h term.h types.h backend$(OBJ): lsparse.h namelist.h dosdisk.h system.h wait.h backend$(OBJ): termemu.h parse$(OBJ): fd.h headers.h machine.h config.h parse$(OBJ): depend.h printf.h stream.h kctype.h parse$(OBJ): string.h malloc.h parse$(OBJ): pathname.h typesize.h term.h types.h lsparse.h namelist.h parse$(OBJ): kconv.h sysemu.h dirent.h unixemu.h parse$(OBJ): realpath.h parse.h system.h termio.h parse$(OBJ): wait.h builtin$(OBJ): fd.h headers.h machine.h config.h builtin$(OBJ): depend.h printf.h stream.h kctype.h builtin$(OBJ): string.h malloc.h builtin$(OBJ): encode.h parse.h kconv.h func.h sysemu.h dirent.h unixemu.h builtin$(OBJ): pathname.h builtin$(OBJ): typesize.h term.h types.h lsparse.h namelist.h dosdisk.h builtin$(OBJ): funcno.h kanji.h catalog.h system.h termio.h builtin$(OBJ): wait.h builtin$(OBJ): termemu.h roman.h shell$(OBJ): fd.h headers.h machine.h config.h shell$(OBJ): depend.h printf.h stream.h kctype.h shell$(OBJ): string.h malloc.h shell$(OBJ): realpath.h parse.h kconv.h func.h sysemu.h dirent.h unixemu.h shell$(OBJ): pathname.h shell$(OBJ): typesize.h term.h types.h lsparse.h namelist.h dosdisk.h shell$(OBJ): kanji.h catalog.h system.h termio.h shell$(OBJ): wait.h shell$(OBJ): termemu.h socket$(OBJ): headers.h machine.h config.h socket$(OBJ): depend.h printf.h stream.h kctype.h socket$(OBJ): typesize.h malloc.h socket$(OBJ): sysemu.h dirent.h unixemu.h socket$(OBJ): termio.h socket$(OBJ): socket.h url$(OBJ): headers.h machine.h config.h url$(OBJ): depend.h printf.h url$(OBJ): stream.h kctype.h url$(OBJ): typesize.h string.h malloc.h sysemu.h dirent.h unixemu.h url$(OBJ): pathname.h url.h auth$(OBJ): headers.h machine.h config.h auth$(OBJ): depend.h printf.h auth$(OBJ): stream.h string.h malloc.h time.h pathname.h typesize.h auth$(OBJ): encode.h parse.h socket.h auth.h url.h auth$(OBJ): system.h termio.h auth$(OBJ): wait.h auth$(OBJ): unixemu.h kanji.h catalog.h ftp$(OBJ): headers.h machine.h config.h ftp$(OBJ): depend.h printf.h ftp$(OBJ): stream.h kctype.h ftp$(OBJ): string.h malloc.h time.h sysemu.h dirent.h unixemu.h ftp$(OBJ): pathname.h ftp$(OBJ): typesize.h termio.h ftp$(OBJ): parse.h ftp$(OBJ): lsparse.h namelist.h socket.h auth.h ftp$(OBJ): url.h urldisk.h html$(OBJ): headers.h machine.h config.h html$(OBJ): depend.h printf.h html$(OBJ): stream.h kctype.h html$(OBJ): typesize.h string.h malloc.h sysemu.h dirent.h unixemu.h html$(OBJ): pathname.h termio.h html$(OBJ): parse.h html.h urldisk.h html$(OBJ): namelist.h url.h auth.h http$(OBJ): headers.h machine.h config.h http$(OBJ): depend.h printf.h http$(OBJ): stream.h kctype.h http$(OBJ): string.h malloc.h time.h sysemu.h dirent.h unixemu.h http$(OBJ): pathname.h http$(OBJ): typesize.h termio.h http$(OBJ): parse.h http$(OBJ): lsparse.h namelist.h socket.h auth.h http$(OBJ): url.h html.h urldisk.h urldisk$(OBJ): headers.h machine.h config.h urldisk$(OBJ): depend.h printf.h stream.h string.h urldisk$(OBJ): malloc.h time.h sysemu.h dirent.h unixemu.h urldisk$(OBJ): pathname.h urldisk$(OBJ): typesize.h termio.h urldisk$(OBJ): realpath.h urldisk$(OBJ): lsparse.h namelist.h socket.h urldisk$(OBJ): urldisk.h url.h auth.h catalog$(OBJ): fd.h headers.h machine.h config.h catalog$(OBJ): depend.h printf.h stream.h kctype.h catalog$(OBJ): string.h malloc.h catalog$(OBJ): termio.h catalog$(OBJ): func.h sysemu.h dirent.h catalog$(OBJ): unixemu.h catalog$(OBJ): pathname.h typesize.h term.h types.h lsparse.h namelist.h catalog$(OBJ): dosdisk.h kanji.h catalog.h kconv$(OBJ): fd.h headers.h machine.h config.h kconv$(OBJ): depend.h printf.h stream.h kctype.h kconv$(OBJ): string.h malloc.h kconv$(OBJ): termio.h kconv$(OBJ): realpath.h parse.h func.h kconv$(OBJ): sysemu.h dirent.h unixemu.h kconv$(OBJ): pathname.h typesize.h term.h types.h kconv$(OBJ): lsparse.h namelist.h dosdisk.h kconv.h termemu.h input$(OBJ): fd.h headers.h machine.h config.h input$(OBJ): depend.h printf.h stream.h kctype.h input$(OBJ): string.h malloc.h input$(OBJ): wait.h unixemu.h parse.h kconv.h func.h input$(OBJ): sysemu.h dirent.h input$(OBJ): pathname.h typesize.h term.h types.h lsparse.h namelist.h input$(OBJ): dosdisk.h kanji.h catalog.h system.h termio.h input$(OBJ): termemu.h ime$(OBJ): fd.h headers.h machine.h config.h ime$(OBJ): depend.h printf.h ime$(OBJ): stream.h kctype.h ime$(OBJ): string.h malloc.h wait.h unixemu.h ime$(OBJ): parse.h kconv.h roman.h func.h sysemu.h dirent.h ime$(OBJ): pathname.h ime$(OBJ): typesize.h term.h types.h lsparse.h namelist.h dosdisk.h ime$(OBJ): kanji.h catalog.h termemu.h dict$(OBJ): fd.h headers.h machine.h config.h dict$(OBJ): depend.h printf.h dict$(OBJ): stream.h kctype.h dict$(OBJ): string.h malloc.h termio.h dict$(OBJ): roman.h dict$(OBJ): hinsi.h func.h sysemu.h dirent.h unixemu.h dict$(OBJ): pathname.h typesize.h term.h types.h dict$(OBJ): lsparse.h namelist.h dosdisk.h parse.h kconv.h roman$(OBJ): headers.h machine.h config.h roman$(OBJ): depend.h kctype.h roman$(OBJ): typesize.h string.h kconv.h roman.h info$(OBJ): fd.h headers.h machine.h config.h info$(OBJ): depend.h printf.h info$(OBJ): stream.h kctype.h info$(OBJ): string.h malloc.h dirent.h unixemu.h info$(OBJ): sysemu.h pathname.h typesize.h term.h info$(OBJ): types.h lsparse.h namelist.h funcno.h kanji.h catalog.h info$(OBJ): unixdisk.h mntinfo.h fsinfo.h rockridg$(OBJ): fd.h headers.h machine.h config.h rockridg$(OBJ): depend.h printf.h stream.h kctype.h rockridg$(OBJ): string.h malloc.h rockridg$(OBJ): device.h parse.h func.h sysemu.h dirent.h unixemu.h rockridg$(OBJ): pathname.h rockridg$(OBJ): typesize.h term.h types.h lsparse.h namelist.h dosdisk.h tree$(OBJ): fd.h headers.h machine.h config.h tree$(OBJ): depend.h printf.h tree$(OBJ): stream.h kctype.h tree$(OBJ): string.h malloc.h func.h sysemu.h dirent.h unixemu.h tree$(OBJ): pathname.h tree$(OBJ): typesize.h term.h types.h lsparse.h namelist.h dosdisk.h tree$(OBJ): kanji.h catalog.h lsparse$(OBJ): fd.h headers.h machine.h config.h lsparse$(OBJ): depend.h printf.h stream.h kctype.h lsparse$(OBJ): string.h malloc.h lsparse$(OBJ): time.h dirent.h unixemu.h lsparse$(OBJ): pathname.h typesize.h device.h lsparse$(OBJ): parse.h lsparse.h namelist.h kconv.h archive$(OBJ): fd.h headers.h machine.h config.h archive$(OBJ): depend.h printf.h stream.h kctype.h archive$(OBJ): string.h malloc.h archive$(OBJ): realpath.h kconv.h func.h sysemu.h dirent.h unixemu.h archive$(OBJ): pathname.h archive$(OBJ): typesize.h term.h types.h lsparse.h namelist.h dosdisk.h archive$(OBJ): kanji.h catalog.h system.h termio.h archive$(OBJ): wait.h archive$(OBJ): termemu.h custom$(OBJ): fd.h headers.h machine.h config.h custom$(OBJ): depend.h printf.h stream.h kctype.h custom$(OBJ): string.h malloc.h custom$(OBJ): parse.h kconv.h func.h sysemu.h dirent.h unixemu.h custom$(OBJ): pathname.h custom$(OBJ): typesize.h term.h types.h lsparse.h namelist.h dosdisk.h custom$(OBJ): funcno.h kanji.h catalog.h system.h termio.h custom$(OBJ): wait.h custom$(OBJ): termemu.h urldisk.h url.h auth.h command$(OBJ): fd.h headers.h machine.h config.h command$(OBJ): depend.h printf.h stream.h kctype.h command$(OBJ): string.h malloc.h command$(OBJ): parse.h func.h sysemu.h dirent.h unixemu.h command$(OBJ): pathname.h command$(OBJ): typesize.h term.h types.h lsparse.h namelist.h dosdisk.h command$(OBJ): funcno.h kanji.h catalog.h system.h termio.h command$(OBJ): wait.h command$(OBJ): termemu.h functabl.h browse$(OBJ): fd.h headers.h machine.h config.h browse$(OBJ): depend.h printf.h stream.h kctype.h browse$(OBJ): string.h malloc.h browse$(OBJ): device.h parse.h kconv.h func.h sysemu.h dirent.h unixemu.h browse$(OBJ): pathname.h browse$(OBJ): typesize.h term.h types.h lsparse.h namelist.h dosdisk.h browse$(OBJ): funcno.h kanji.h catalog.h termemu.h unitbl$(OBJ): headers.h machine.h config.h dicttbl$(OBJ): headers.h machine.h config.h sprintf$(OBJ): headers.h machine.h config.h sprintf$(OBJ): depend.h printf.h stream.h kctype.h sprintf$(OBJ): typesize.h string.h stermio$(OBJ): headers.h machine.h config.h stermio$(OBJ): depend.h typesize.h sysemu.h dirent.h stermio$(OBJ): unixemu.h stermio$(OBJ): stream.h termio.h sstream$(OBJ): headers.h machine.h config.h sstream$(OBJ): depend.h typesize.h malloc.h sysemu.h sstream$(OBJ): dirent.h unixemu.h sstream$(OBJ): stream.h pathname.h termio.h sstring$(OBJ): headers.h machine.h config.h sstring$(OBJ): kctype.h depend.h sstring$(OBJ): string.h smalloc$(OBJ): headers.h machine.h config.h smalloc$(OBJ): printf.h stream.h depend.h malloc.h smalloc$(OBJ): sysemu.h dirent.h unixemu.h stime$(OBJ): headers.h machine.h config.h stime$(OBJ): typesize.h string.h time.h spathnam$(OBJ): headers.h machine.h config.h spathnam$(OBJ): depend.h spathnam$(OBJ): printf.h stream.h kctype.h spathnam$(OBJ): string.h malloc.h dirent.h unixemu.h spathnam$(OBJ): sysemu.h spathnam$(OBJ): pathname.h typesize.h ssystem$(OBJ): headers.h machine.h config.h ssystem$(OBJ): depend.h printf.h stream.h kctype.h ssystem$(OBJ): string.h malloc.h ssystem$(OBJ): dirent.h unixemu.h ssystem$(OBJ): sysemu.h system.h pathname.h ssystem$(OBJ): typesize.h termio.h ssystem$(OBJ): wait.h ssystem$(OBJ): termemu.h time.h posixsh.h sposixsh$(OBJ): headers.h machine.h config.h sposixsh$(OBJ): depend.h printf.h stream.h kctype.h sposixsh$(OBJ): string.h malloc.h sposixsh$(OBJ): sysemu.h dirent.h unixemu.h sposixsh$(OBJ): system.h pathname.h typesize.h sposixsh$(OBJ): termio.h sposixsh$(OBJ): wait.h sposixsh$(OBJ): termemu.h time.h posixsh.h sdoscom$(OBJ): headers.h machine.h config.h sdoscom$(OBJ): depend.h printf.h stream.h kctype.h sdoscom$(OBJ): string.h malloc.h sdoscom$(OBJ): dirent.h unixemu.h sdoscom$(OBJ): sysemu.h system.h pathname.h sdoscom$(OBJ): typesize.h termio.h sdoscom$(OBJ): wait.h ssysemu$(OBJ): headers.h machine.h config.h ssysemu$(OBJ): depend.h printf.h stream.h kctype.h ssysemu$(OBJ): string.h malloc.h ssysemu$(OBJ): sysemu.h dirent.h unixemu.h ssysemu$(OBJ): log.h pathname.h typesize.h termio.h ssysemu$(OBJ): realpath.h bprintf$(OBJ): headers.h machine.h config.h bprintf$(OBJ): depend.h printf.h stream.h kctype.h bprintf$(OBJ): typesize.h string.h btermio$(OBJ): headers.h machine.h config.h btermio$(OBJ): depend.h typesize.h sysemu.h dirent.h btermio$(OBJ): unixemu.h btermio$(OBJ): stream.h termio.h bstream$(OBJ): headers.h machine.h config.h bstream$(OBJ): depend.h typesize.h malloc.h sysemu.h bstream$(OBJ): dirent.h unixemu.h bstream$(OBJ): stream.h pathname.h termio.h bstring$(OBJ): headers.h machine.h config.h bstring$(OBJ): kctype.h depend.h bstring$(OBJ): string.h bmalloc$(OBJ): headers.h machine.h config.h bmalloc$(OBJ): printf.h stream.h depend.h malloc.h bmalloc$(OBJ): sysemu.h dirent.h unixemu.h bpathnam$(OBJ): headers.h machine.h config.h bpathnam$(OBJ): depend.h bpathnam$(OBJ): printf.h stream.h kctype.h bpathnam$(OBJ): string.h malloc.h dirent.h unixemu.h bpathnam$(OBJ): sysemu.h bpathnam$(OBJ): pathname.h typesize.h bsystem$(OBJ): headers.h machine.h config.h bsystem$(OBJ): depend.h printf.h stream.h kctype.h bsystem$(OBJ): string.h malloc.h bsystem$(OBJ): dirent.h unixemu.h bsystem$(OBJ): sysemu.h system.h pathname.h bsystem$(OBJ): typesize.h termio.h bsystem$(OBJ): wait.h bsystem$(OBJ): termemu.h bdoscom$(OBJ): headers.h machine.h config.h bdoscom$(OBJ): depend.h printf.h stream.h kctype.h bdoscom$(OBJ): string.h malloc.h bdoscom$(OBJ): dirent.h unixemu.h bdoscom$(OBJ): sysemu.h system.h pathname.h bdoscom$(OBJ): typesize.h termio.h bdoscom$(OBJ): wait.h bsysemu$(OBJ): headers.h machine.h config.h bsysemu$(OBJ): depend.h printf.h stream.h kctype.h bsysemu$(OBJ): string.h malloc.h bsysemu$(OBJ): sysemu.h dirent.h unixemu.h bsysemu$(OBJ): log.h pathname.h typesize.h termio.h bsysemu$(OBJ): realpath.h nprintf$(OBJ): headers.h machine.h config.h nprintf$(OBJ): depend.h printf.h stream.h kctype.h nprintf$(OBJ): typesize.h string.h ntermio$(OBJ): headers.h machine.h config.h ntermio$(OBJ): depend.h typesize.h sysemu.h dirent.h ntermio$(OBJ): unixemu.h ntermio$(OBJ): stream.h termio.h nstream$(OBJ): headers.h machine.h config.h nstream$(OBJ): depend.h typesize.h malloc.h sysemu.h nstream$(OBJ): dirent.h unixemu.h nstream$(OBJ): stream.h pathname.h termio.h nstream$(OBJ): socket.h nstring$(OBJ): headers.h machine.h config.h nstring$(OBJ): kctype.h depend.h nstring$(OBJ): string.h nmalloc$(OBJ): headers.h machine.h config.h nmalloc$(OBJ): printf.h stream.h depend.h malloc.h nmalloc$(OBJ): sysemu.h dirent.h unixemu.h ntime$(OBJ): headers.h machine.h config.h ntime$(OBJ): typesize.h string.h time.h npathnam$(OBJ): headers.h machine.h config.h npathnam$(OBJ): depend.h npathnam$(OBJ): printf.h stream.h kctype.h npathnam$(OBJ): string.h malloc.h dirent.h unixemu.h npathnam$(OBJ): sysemu.h npathnam$(OBJ): pathname.h typesize.h url.h nsystem$(OBJ): headers.h machine.h config.h nsystem$(OBJ): depend.h printf.h stream.h kctype.h nsystem$(OBJ): string.h malloc.h nsystem$(OBJ): dirent.h unixemu.h nsystem$(OBJ): sysemu.h system.h pathname.h nsystem$(OBJ): typesize.h termio.h nsystem$(OBJ): wait.h nsystem$(OBJ): termemu.h time.h posixsh.h socket.h nsystem$(OBJ): url.h urldisk.h namelist.h auth.h nposixsh$(OBJ): headers.h machine.h config.h nposixsh$(OBJ): depend.h printf.h stream.h kctype.h nposixsh$(OBJ): string.h malloc.h nposixsh$(OBJ): sysemu.h dirent.h unixemu.h nposixsh$(OBJ): system.h pathname.h typesize.h nposixsh$(OBJ): termio.h nposixsh$(OBJ): wait.h nposixsh$(OBJ): termemu.h time.h posixsh.h ndoscom$(OBJ): headers.h machine.h config.h ndoscom$(OBJ): depend.h printf.h stream.h kctype.h ndoscom$(OBJ): string.h malloc.h ndoscom$(OBJ): dirent.h unixemu.h ndoscom$(OBJ): sysemu.h system.h pathname.h ndoscom$(OBJ): typesize.h termio.h ndoscom$(OBJ): wait.h ndoscom$(OBJ): realpath.h urldisk.h namelist.h url.h ndoscom$(OBJ): auth.h nsysemu$(OBJ): headers.h machine.h config.h nsysemu$(OBJ): depend.h printf.h stream.h kctype.h nsysemu$(OBJ): string.h malloc.h nsysemu$(OBJ): sysemu.h dirent.h unixemu.h nsysemu$(OBJ): log.h pathname.h typesize.h termio.h nsysemu$(OBJ): realpath.h socket.h nsysemu$(OBJ): urldisk.h namelist.h url.h auth.h nrealpat$(OBJ): headers.h machine.h config.h nrealpat$(OBJ): depend.h nrealpat$(OBJ): printf.h stream.h kctype.h nrealpat$(OBJ): string.h sysemu.h dirent.h unixemu.h nrealpat$(OBJ): pathname.h nrealpat$(OBJ): typesize.h realpath.h url.h nencode$(OBJ): headers.h machine.h config.h nencode$(OBJ): kctype.h depend.h nencode$(OBJ): sysemu.h dirent.h unixemu.h nencode$(OBJ): stream.h nencode$(OBJ): pathname.h typesize.h encode.h nparse$(OBJ): headers.h machine.h config.h nparse$(OBJ): depend.h printf.h stream.h kctype.h nparse$(OBJ): string.h malloc.h nparse$(OBJ): sysemu.h dirent.h unixemu.h nparse$(OBJ): realpath.h parse.h system.h nparse$(OBJ): pathname.h typesize.h termio.h nparse$(OBJ): wait.h nsocket$(OBJ): headers.h machine.h config.h nsocket$(OBJ): depend.h printf.h stream.h kctype.h nsocket$(OBJ): typesize.h malloc.h nsocket$(OBJ): sysemu.h dirent.h unixemu.h nsocket$(OBJ): termio.h nsocket$(OBJ): socket.h nurl$(OBJ): headers.h machine.h config.h nurl$(OBJ): depend.h printf.h nurl$(OBJ): stream.h kctype.h nurl$(OBJ): typesize.h string.h malloc.h sysemu.h dirent.h unixemu.h nurl$(OBJ): pathname.h url.h nauth$(OBJ): headers.h machine.h config.h nauth$(OBJ): depend.h printf.h stream.h string.h nauth$(OBJ): malloc.h time.h pathname.h typesize.h encode.h parse.h nauth$(OBJ): socket.h auth.h url.h system.h nauth$(OBJ): termio.h nauth$(OBJ): wait.h unixemu.h nauth$(OBJ): sysemu.h dirent.h nftp$(OBJ): headers.h machine.h config.h nftp$(OBJ): depend.h printf.h nftp$(OBJ): stream.h kctype.h nftp$(OBJ): string.h malloc.h time.h sysemu.h dirent.h unixemu.h nftp$(OBJ): pathname.h nftp$(OBJ): typesize.h termio.h nftp$(OBJ): parse.h nftp$(OBJ): lsparse.h namelist.h socket.h auth.h nftp$(OBJ): url.h urldisk.h nhtml$(OBJ): headers.h machine.h config.h nhtml$(OBJ): depend.h printf.h stream.h kctype.h nhtml$(OBJ): typesize.h string.h nhtml$(OBJ): malloc.h sysemu.h dirent.h unixemu.h nhtml$(OBJ): pathname.h termio.h nhtml$(OBJ): parse.h html.h urldisk.h nhtml$(OBJ): namelist.h url.h auth.h nhttp$(OBJ): headers.h machine.h config.h nhttp$(OBJ): depend.h printf.h stream.h kctype.h nhttp$(OBJ): string.h malloc.h nhttp$(OBJ): time.h sysemu.h dirent.h unixemu.h nhttp$(OBJ): pathname.h typesize.h termio.h nhttp$(OBJ): parse.h lsparse.h namelist.h nhttp$(OBJ): socket.h auth.h url.h html.h nhttp$(OBJ): urldisk.h nurldisk$(OBJ): headers.h machine.h config.h nurldisk$(OBJ): depend.h printf.h stream.h string.h nurldisk$(OBJ): malloc.h time.h sysemu.h dirent.h unixemu.h nurldisk$(OBJ): pathname.h nurldisk$(OBJ): typesize.h termio.h nurldisk$(OBJ): realpath.h nurldisk$(OBJ): lsparse.h namelist.h socket.h nurldisk$(OBJ): urldisk.h url.h auth.h nlsparse$(OBJ): headers.h machine.h config.h nlsparse$(OBJ): depend.h kctype.h nlsparse$(OBJ): string.h malloc.h time.h dirent.h nlsparse$(OBJ): unixemu.h nlsparse$(OBJ): pathname.h typesize.h device.h parse.h lsparse.h namelist.h evalopt$(OBJ): headers.h machine.h config.h evalopt$(OBJ): evalopt.h gentbl$(OBJ): headers.h machine.h config.h gentbl$(OBJ): gentbl.h mkunitbl$(OBJ): headers.h machine.h config.h mkunitbl$(OBJ): typesize.h evalopt.h gentbl.h mkdict$(OBJ): headers.h machine.h config.h mkdict$(OBJ): kctype.h depend.h mkdict$(OBJ): typesize.h string.h kconv.h roman.h mkdict$(OBJ): hinsi.h evalopt.h gentbl.h mktankan$(OBJ): headers.h machine.h config.h mktankan$(OBJ): kctype.h depend.h mktankan$(OBJ): typesize.h kconv.h roman.h mkkanji$(OBJ): headers.h machine.h config.h mkkanji$(OBJ): typesize.h mkcat$(OBJ): headers.h machine.h config.h mkcat$(OBJ): kctype.h depend.h mkcat$(OBJ): typesize.h version.h evalopt.h gentbl.h mkdir_p$(OBJ): headers.h machine.h config.h mkdir_p$(OBJ): kctype.h depend.h mkdir_p$(OBJ): typesize.h kanjicnv$(OBJ): headers.h machine.h config.h kanjicnv$(OBJ): evalopt.h expfunc$(OBJ): headers.h machine.h config.h mkfuncno$(OBJ): fd.h headers.h machine.h config.h mkfuncno$(OBJ): depend.h types.h typesize.h stream.h mkfuncno$(OBJ): lsparse.h namelist.h functabl.h tstring$(OBJ): headers.h machine.h config.h tstring$(OBJ): kctype.h depend.h tstring$(OBJ): string.h troman$(OBJ): headers.h machine.h config.h troman$(OBJ): depend.h kctype.h troman$(OBJ): typesize.h string.h kconv.h roman.h tkconv$(OBJ): headers.h machine.h config.h tkconv$(OBJ): depend.h kctype.h tkconv$(OBJ): typesize.h string.h unixemu.h kconv.h tkconv$(OBJ): termemu.h pathname.h tevalopt$(OBJ): headers.h machine.h config.h tevalopt$(OBJ): evalopt.h tgentbl$(OBJ): headers.h machine.h config.h tgentbl$(OBJ): gentbl.h tunitbl$(OBJ): headers.h machine.h config.h FD-3.01j/makefile.d98100644 2105 1751 153656 13516612560 13044 0ustar shiraiuser# # Makefile for fd # TITLE = FD- VERMAJ = 3 VERSION = 3.01j PREFIX = CONFDIR = BUILD = MANSEC = 1 BINTOP = $(PREFIX)\bin BINDIR = $(BUILD)$(BINTOP) DATATOP = $(PREFIX)\share DATADIR = $(BUILD)$(DATATOP)\fd MANTOP = $(PREFIX)\man MANDIR = $(BUILD)$(MANTOP)\man$(MANSEC) CATDIR = $(BUILD)$(MANTOP)\cat$(MANSEC) JMANDIR = $(BUILD)$(MANTOP)\man$(MANSEC) JCATDIR = $(BUILD)$(MANTOP)\cat$(MANSEC) IPKWDIR = .\ipk.work IPKTDIR = .\ipk.tmp DEPDIR = .\depend.tmp DIST = none DEFRC = $(CONFDIR)\fd2rc BLDRC = $(BUILD)$(DEFRC) DOSRC = ~FD\\fd2rc UNITBL = fd-unicd.tbl DICTTBL = fd-dict.tbl DICTTXT = fd-dict.txt DICTSRC = CATTBL = fd-cat.ja ECATTBL = fd-cat.C TABLES = $(UNITBL) $(CATTBL) $(ECATTBL) SRC = main.c printf.c termio.c term.c stream.c \ string.c malloc.c time.c \ pathname.c system.c posixsh.c doscom.c \ log.c sysemu.c dosdisk.c unixdisk.c \ realpath.c encode.c \ libc.c file.c mntinfo.c statfs.c apply.c \ pty.c termemu.c frontend.c backend.c \ parse.c builtin.c shell.c \ socket.c url.c auth.c \ ftp.c html.c http.c urldisk.c \ catalog.c \ kconv.c input.c ime.c dict.c roman.c \ info.c rockridg.c tree.c \ lsparse.c archive.c \ custom.c command.c browse.c HSRC = evalopt.c gentbl.c \ mkunitbl.c mkdict.c mktankan.c \ mkkanji.c mkcat.c mkdir_p.c \ kanjicnv.c expfunc.c \ mkfuncno.c DSRC = $(DEPDIR)\unitbl.c $(DEPDIR)\dicttbl.c HEADER = fd.h \ headers.h machine.h \ depend.h \ printf.h kctype.h typesize.h \ string.h malloc.h time.h \ dirent.h sysemu.h log.h \ pathname.h system.h posixsh.h wait.h \ termio.h term.h stream.h \ types.h namelist.h \ dosdisk.h unixdisk.h unixemu.h \ realpath.h encode.h termemu.h \ mntinfo.h fsinfo.h device.h parse.h lsparse.h \ socket.h url.h auth.h html.h urldisk.h \ catalog.h \ evalopt.h gentbl.h \ kconv.h roman.h hinsi.h \ func.h functabl.h SSRC = printf.c termio.c stream.c \ string.c malloc.c time.c \ pathname.c system.c posixsh.c doscom.c \ sysemu.c BSRC = printf.c termio.c stream.c \ string.c malloc.c \ pathname.c system.c doscom.c \ sysemu.c NSRC = printf.c termio.c stream.c \ string.c malloc.c time.c \ pathname.c system.c posixsh.c doscom.c \ sysemu.c \ realpath.c encode.c \ parse.c \ socket.c url.c auth.c \ ftp.c html.c http.c urldisk.c \ lsparse.c TSRC = string.c roman.c kconv.c evalopt.c gentbl.c unitbl.c DOC = README.eng HISTORY.eng FAQ.eng TECHKNOW.eng \ Install.eng ToAdmin.eng LICENSES.eng JDOC = README HISTORY FAQ TECHKNOW \ Install ToAdmin LICENSES MANSRC = fd_e.man MANCAT = fd_e.cat JMANSRC = fd.man JMANCAT = fd.cat RUNCOM = fdrc ARGS = object.arg SARGS = sobject.arg NARGS = nobject.arg SRCS = $(DOC) $(MANSRC) $(MANCAT) \ Configur Makefile Makefile.in $(SRC) $(HSRC) $(HEADER) \ makefile.gpc makefile.g98 \ makefile.dpc makefile.d98 \ makefile.lpc makefile.l98 \ makefile.bpc makefile.b98 \ mkmfdosg.sed mkmfdosd.sed mkmfdosl.sed mkmfdosb.sed \ mkmfsed.c \ config.hin version.h \ _fdrc _fdrc.dif fd.spec JSRCS = $(JDOC) $(JMANSRC) $(JMANCAT) \ kanji.hin SOURCES = $(SRCS) $(JSRCS) SHSOURCES = $(NSRC) \ headers.h machine.h \ depend.h \ printf.h kctype.h typesize.h \ string.h malloc.h time.h \ dirent.h sysemu.h log.h \ pathname.h system.h posixsh.h wait.h \ termio.h stream.h \ namelist.h \ unixemu.h \ realpath.h encode.h \ device.h parse.h lsparse.h \ socket.h url.h auth.h html.h urldisk.h \ kanjicnv.c expfunc.c mkmfsed.c \ Configur Makefile Makefile.in \ makefile.gpc makefile.g98 \ makefile.dpc makefile.d98 \ makefile.lpc makefile.l98 \ makefile.bpc makefile.b98 \ mkmfdosg.sed mkmfdosd.sed mkmfdosl.sed mkmfdosb.sed \ config.hin version.h CC = gcc HOSTCC = $(CC) INSTALL = copy /y MAKE = make SHELL = \bin\sh SED = sed ECHO = echo CP = copy /y RM = del LN = copy /y MV = mv CHMOD = chmod LINT = lint TAR = tar LHA = lha SHAR = shar EXE = .exe OBJ = .o PROGRAM = fd ALIAS = fdsh DOSOBJS = unixdisk$(OBJ) IMEOBJS = ime$(OBJ) dict$(OBJ) roman$(OBJ) SCKOBJS = socket$(OBJ) url$(OBJ) auth$(OBJ) \ ftp$(OBJ) html$(OBJ) http$(OBJ) urldisk$(OBJ) OBJ1 = main$(OBJ) printf$(OBJ) termio$(OBJ) term$(OBJ) stream$(OBJ) \ string$(OBJ) malloc$(OBJ) time$(OBJ) OBJ2 = pathname$(OBJ) system$(OBJ) posixsh$(OBJ) doscom$(OBJ) \ log$(OBJ) sysemu$(OBJ) dosdisk$(OBJ) $(DOSOBJS) OBJ3 = realpath$(OBJ) encode$(OBJ) \ libc$(OBJ) file$(OBJ) mntinfo$(OBJ) statfs$(OBJ) apply$(OBJ) \ pty$(OBJ) termemu$(OBJ) frontend$(OBJ) backend$(OBJ) OBJ4 = parse$(OBJ) builtin$(OBJ) shell$(OBJ) OBJ5 = catalog$(OBJ) \ kconv$(OBJ) input$(OBJ) OBJ6 = info$(OBJ) rockridg$(OBJ) tree$(OBJ) \ lsparse$(OBJ) archive$(OBJ) \ custom$(OBJ) command$(OBJ) browse$(OBJ) SOBJ1 = sprintf$(OBJ) stermio$(OBJ) sstream$(OBJ) \ sstring$(OBJ) smalloc$(OBJ) stime$(OBJ) SOBJ2 = spathnam$(OBJ) ssystem$(OBJ) sposixsh$(OBJ) sdoscom$(OBJ) \ ssysemu$(OBJ) BOBJ = bprintf$(OBJ) btermio$(OBJ) bstream$(OBJ) \ bstring$(OBJ) bmalloc$(OBJ) \ bpathnam$(OBJ) bsystem$(OBJ) bdoscom$(OBJ) \ bsysemu$(OBJ) NOBJ1 = nprintf$(OBJ) ntermio$(OBJ) nstream$(OBJ) \ nstring$(OBJ) nmalloc$(OBJ) ntime$(OBJ) NOBJ2 = npathnam$(OBJ) nsystem$(OBJ) nposixsh$(OBJ) ndoscom$(OBJ) \ nsysemu$(OBJ) \ nrealpat$(OBJ) nencode$(OBJ) NOBJ3 = nparse$(OBJ) \ nsocket$(OBJ) nurl$(OBJ) nauth$(OBJ) \ nftp$(OBJ) nhtml$(OBJ) nhttp$(OBJ) nurldisk$(OBJ) \ nlsparse$(OBJ) KOBJ = tevalopt$(OBJ) COBJ = tevalopt$(OBJ) tgentbl$(OBJ) UOBJ = tevalopt$(OBJ) tgentbl$(OBJ) TOBJ = tstring$(OBJ) troman$(OBJ) tkconv$(OBJ) tevalopt$(OBJ) tgentbl$(OBJ) ALLOC = DEBUG = CFLAGS = -O HOSTCFLAGS = $(CFLAGS) CPPFLAGS = HOSTCPPFLAGS = $(CPPFLAGS) LDFLAGS = HOSTLDFLAGS = $(LDFLAGS) OSOPTS = -DPC98 COPTS = $(OSOPTS) $(DEBUG) $(CFLAGS) HOSTCOPTS = $(COPTS) FLDFLAGS = $(ALLOC) $(LDFLAGS) SLDFLAGS = $(ALLOC) $(LDFLAGS) NLDFLAGS = $(ALLOC) $(LDFLAGS) BUILDFLAGS = $(COPTS) $(CPPFLAGS) FDCFLAGS = $(BUILDFLAGS) -DFD=$(VERMAJ) SHCFLAGS = $(BUILDFLAGS) -DFDSH=$(VERMAJ) BSHCFLAGS = $(BUILDFLAGS) -DFDSH=$(VERMAJ) -DMINIMUMSHELL NSHCFLAGS = $(BUILDFLAGS) -DFDSH=$(VERMAJ) -DWITHNETWORK DEFCFLAGS = -DDEFRC='"'$(DOSRC)'"' .SUFFIXES: .h .c .o .exe ############################################################ # Dependency Rules ############################################################ all: $(PROGRAM)$(EXE) $(PROGRAM).$(MANSEC) $(TABLES) $(PROGRAM)$(EXE): $(OBJ1) $(OBJ2) $(OBJ3) $(OBJ4) $(OBJ5) $(OBJ6) $(ARGS) # @sleep 1 $(CC) -o $@ @$(ARGS) $(FLDFLAGS) # @ren $@ $(PROGRAM) # @aout2exe $(PROGRAM) # @del $(PROGRAM) $(ARGS): $(OBJ1) $(OBJ2) $(OBJ3) $(OBJ4) $(OBJ5) $(OBJ6) # @sleep 1 @$(ECHO) $(OBJ1) > $(ARGS) @$(ECHO) $(OBJ2) >> $(ARGS) @$(ECHO) $(OBJ3) >> $(ARGS) @$(ECHO) $(OBJ4) >> $(ARGS) @$(ECHO) $(OBJ5) >> $(ARGS) @$(ECHO) $(OBJ6) >> $(ARGS) # @sleep 1 main$(OBJ): main.c $(CC) $(FDCFLAGS) $(DEFCFLAGS) -c -o $@ $*.c termio$(OBJ): termio.c $(CC) $(FDCFLAGS) -c -o $@ $*.c system$(OBJ): system.c $(CC) $(FDCFLAGS) $(DEFCFLAGS) -c -o $@ $*.c custom$(OBJ): custom.c $(CC) $(FDCFLAGS) -c -o $@ $*.c .c.o: $(CC) $(FDCFLAGS) -c -o $@ $*.c ############################################################ # kanji using module $(PROGRAM).$(MANSEC): kanjicnv$(EXE) $(JMANSRC) .\kanjicnv$(EXE) -s -c $(JMANSRC) $@ $(PROGRAM).$(MANSEC)c: kanjicnv$(EXE) $(JMANCAT) .\kanjicnv$(EXE) -s $(JMANCAT) $@ $(PROGRAM).eng: kanjicnv$(EXE) $(MANCAT) .\kanjicnv$(EXE) -b $(MANCAT) $@ $(PROGRAM).doc: kanjicnv$(EXE) $(JMANCAT) .\kanjicnv$(EXE) -s -b $(JMANCAT) $@ README.doc: kanjicnv$(EXE) README .\kanjicnv$(EXE) -s README $@ HISTORY.doc: kanjicnv$(EXE) HISTORY .\kanjicnv$(EXE) -s HISTORY $@ FAQ.doc: kanjicnv$(EXE) FAQ .\kanjicnv$(EXE) -s FAQ $@ LICENSES.doc: kanjicnv$(EXE) LICENSES .\kanjicnv$(EXE) -s LICENSES $@ kanjicnv$(EXE): kanjicnv$(OBJ) $(KOBJ) # @sleep 1 $(HOSTCC) $(HOSTCOPTS) $(HOSTLDFLAGS) -o $@ kanjicnv$(OBJ) $(KOBJ) # @ren $@ kanjicnv # @aout2exe kanjicnv # @del kanjicnv # @sleep 1 kanjicnv$(OBJ): kanjicnv.c $(HOSTCC) $(HOSTCOPTS) $(HOSTCPPFLAGS) -c -o $@ $*.c ############################################################ # message catalog module kanji.h: mkkanji$(EXE) kanjicnv$(EXE) kanji.hin .\mkkanji$(EXE) kanji.hin | \ .\kanjicnv$(EXE) -s -c - $@ # @sleep 1 mkkanji$(EXE): mkkanji$(OBJ) # @sleep 1 $(HOSTCC) $(HOSTCOPTS) $(HOSTLDFLAGS) -o $@ mkkanji$(OBJ) # @ren $@ mkkanji # @aout2exe mkkanji # @del mkkanji # @sleep 1 mkkanji$(OBJ): mkkanji.c $(HOSTCC) $(HOSTCOPTS) $(HOSTCPPFLAGS) -c -o $@ $*.c _fd-cat.ja: mkcat$(EXE) kanji.h .\mkcat$(EXE) -c 1 kanji.h $@ # @sleep 1 _fd-cat.C: mkcat$(EXE) kanji.h .\mkcat$(EXE) -c 2 kanji.h $@ # @sleep 1 fd-cat.ja: mkcat$(EXE) _fd-cat.ja .\mkcat$(EXE) _fd-cat.ja $@ fd-cat.C: mkcat$(EXE) _fd-cat.C .\mkcat$(EXE) _fd-cat.C $@ mkcat$(EXE): mkcat$(OBJ) $(COBJ) # @sleep 1 $(HOSTCC) $(HOSTCOPTS) $(HOSTLDFLAGS) -o $@ mkcat$(OBJ) $(COBJ) # @ren $@ mkcat # @aout2exe mkcat # @del mkcat # @sleep 1 mkcat$(OBJ): mkcat.c $(HOSTCC) $(HOSTCOPTS) $(HOSTCPPFLAGS) -c -o $@ $*.c ############################################################ # function list using module funcno.h: mkfuncno$(EXE) .\mkfuncno$(EXE) $@ # @sleep 1 mkfuncno$(EXE): mkfuncno$(OBJ) # @sleep 1 $(HOSTCC) $(HOSTCOPTS) $(HOSTLDFLAGS) -o $@ mkfuncno$(OBJ) # @ren $@ mkfuncno # @aout2exe mkfuncno # @del mkfuncno # @sleep 1 mkfuncno$(OBJ): mkfuncno.c $(HOSTCC) $(HOSTCOPTS) $(HOSTCPPFLAGS) -DFD=$(VERMAJ) -c -o $@ $*.c ############################################################ # UNICODE table generating module $(UNITBL): mkunitbl$(EXE) .\mkunitbl$(EXE) $@ unitbl.c: mkunitbl$(EXE) .\mkunitbl$(EXE) -t $@ $(DEPDIR)\unitbl.c: mkunitbl$(EXE) [ -d $(DEPDIR) ] || mkdir $(DEPDIR) .\mkunitbl$(EXE) -t -n $@ mkunitbl$(EXE): mkunitbl$(OBJ) $(UOBJ) # @sleep 1 $(HOSTCC) $(HOSTCOPTS) $(HOSTLDFLAGS) -o $@ mkunitbl$(OBJ) $(UOBJ) # @ren $@ mkunitbl # @aout2exe mkunitbl # @del mkunitbl # @sleep 1 mkunitbl$(OBJ): mkunitbl.c $(HOSTCC) $(HOSTCOPTS) $(HOSTCPPFLAGS) -c -o $@ $*.c tunitbl$(OBJ): unitbl.c $(HOSTCC) $(HOSTCOPTS) $(HOSTCPPFLAGS) -c -o $@ unitbl.c ############################################################ # Kanji transfer table generating module $(DICTTBL): mkdict$(EXE) $(DICTSRC) .\mkdict$(EXE) $@ $(DICTSRC) dicttbl.c: mkdict$(EXE) $(DICTSRC) .\mkdict$(EXE) -t $@ $(DICTSRC) $(DEPDIR)\dicttbl.c: mkdict$(EXE) $(DICTSRC) [ -d $(DEPDIR) ] || mkdir $(DEPDIR) .\mkdict$(EXE) -t -n $@ $(DICTSRC) mkdict$(EXE): mkdict$(OBJ) $(TOBJ) # @sleep 1 $(HOSTCC) $(HOSTCOPTS) $(HOSTLDFLAGS) -o $@ mkdict$(OBJ) $(TOBJ) # @ren $@ mkdict # @aout2exe mkdict # @del mkdict # @sleep 1 mktankan$(EXE): mktankan$(OBJ) $(TOBJ) # @sleep 1 $(HOSTCC) $(HOSTCOPTS) $(HOSTLDFLAGS) -o $@ mktankan$(OBJ) $(TOBJ) # @ren $@ mktankan # @aout2exe mktankan # @del mktankan # @sleep 1 mkdict$(OBJ): mkdict.c $(HOSTCC) $(HOSTCOPTS) $(HOSTCPPFLAGS) -c -o $@ $*.c mktankan$(OBJ): mktankan.c $(HOSTCC) $(HOSTCOPTS) $(HOSTCPPFLAGS) -c -o $@ $*.c tstring$(OBJ): string.c $(HOSTCC) $(HOSTCOPTS) $(HOSTCPPFLAGS) -c -o $@ string.c troman$(OBJ): roman.c $(HOSTCC) $(HOSTCOPTS) $(HOSTCPPFLAGS) -c -o $@ roman.c tkconv$(OBJ): kconv.c $(HOSTCC) $(HOSTCOPTS) $(HOSTCPPFLAGS) -c -o $@ kconv.c tevalopt$(OBJ): evalopt.c $(HOSTCC) $(HOSTCOPTS) $(HOSTCPPFLAGS) -c -o $@ evalopt.c tgentbl$(OBJ): gentbl.c $(HOSTCC) $(HOSTCOPTS) $(HOSTCPPFLAGS) -c -o $@ gentbl.c rmdict: -$(RM) $(DICTTBL) $(DICTTXT): mktankan$(EXE) .\mktankan$(EXE) $@ # @sleep 1 ############################################################ # Directory generating module mkdir_p$(EXE): mkdir_p$(OBJ) # @sleep 1 $(HOSTCC) $(HOSTCOPTS) $(HOSTLDFLAGS) -o $@ mkdir_p$(OBJ) # @ren $@ mkdir_p # @aout2exe mkdir_p # @del mkdir_p # @sleep 1 mkdir_p$(OBJ): mkdir_p.c $(HOSTCC) $(HOSTCOPTS) $(HOSTCPPFLAGS) -c -o $@ $*.c ############################################################ # to install all install: install-bin install-runcom install-man install-jman install-bin: $(PROGRAM)$(EXE) mkdir_p$(EXE) install-table [ -d $(BINDIR) ] || .\mkdir_p$(EXE) $(BINDIR) $(INSTALL) $(PROGRAM)$(EXE) $(BINDIR) $(CHMOD) a+rx $(BINDIR)\$(PROGRAM)$(EXE) -$(RM) $(BINDIR)\$(ALIAS)$(EXE) $(LN) $(BINDIR)\$(PROGRAM)$(EXE) $(BINDIR)\$(ALIAS)$(EXE) $(CHMOD) a+rx $(BINDIR)\$(ALIAS)$(EXE) install-runcom: -if [ -f $(RUNCOM) ]; then \ $(INSTALL) $(RUNCOM) $(BLDRC); \ $(CHMOD) a+r-x $(BLDRC); \ fi install-table: $(TABLE) mkdir_p$(EXE) -if [ -f $(UNITBL) ]; then \ [ -d $(BINDIR) ] || .\mkdir_p$(EXE) $(BINDIR); \ $(INSTALL) $(UNITBL) $(BINDIR); \ $(CHMOD) a+r-x $(BINDIR)\$(UNITBL); \ fi -if [ -f $(DICTTBL) ]; then \ [ -d $(BINDIR) ] || .\mkdir_p$(EXE) $(BINDIR); \ $(INSTALL) $(DICTTBL) $(BINDIR); \ $(CHMOD) a+r-x $(BINDIR)\$(DICTTBL); \ fi -if [ -f $(CATTBL) ]; then \ [ -d $(BINDIR) ] || .\mkdir_p$(EXE) $(BINDIR); \ $(INSTALL) $(CATTBL) $(BINDIR); \ $(CHMOD) a+r-x $(BINDIR)\$(CATTBL); \ fi -if [ -f $(ECATTBL) ]; then \ [ -d $(BINDIR) ] || .\mkdir_p$(EXE) $(BINDIR); \ $(INSTALL) $(ECATTBL) $(BINDIR); \ $(CHMOD) a+r-x $(BINDIR)\$(ECATTBL); \ fi install-man: $(MANSRC) mkdir_p$(EXE) [ -d $(MANDIR) ] || .\mkdir_p$(EXE) $(MANDIR) $(INSTALL) $(MANSRC) $(MANDIR)\$(PROGRAM).$(MANSEC) $(CHMOD) a+r-x $(MANDIR)\$(PROGRAM).$(MANSEC) -$(RM) $(MANDIR)\$(ALIAS).$(MANSEC) $(LN) $(MANDIR)\$(PROGRAM).$(MANSEC) $(MANDIR)\$(ALIAS).$(MANSEC) $(CHMOD) a+r-x $(MANDIR)\$(ALIAS).$(MANSEC) install-jman: $(PROGRAM).$(MANSEC) mkdir_p$(EXE) [ -d $(JMANDIR) ] || .\mkdir_p$(EXE) $(JMANDIR) [ "$(JMANDIR)" = "$(MANDIR)" ] || \ $(INSTALL) $(PROGRAM).$(MANSEC) $(JMANDIR)\$(PROGRAM).$(MANSEC) $(CHMOD) a+r-x $(JMANDIR)\$(PROGRAM).$(MANSEC) -$(RM) $(JMANDIR)\$(ALIAS).$(MANSEC) $(LN) $(JMANDIR)\$(PROGRAM).$(MANSEC) $(JMANDIR)\$(ALIAS).$(MANSEC) $(CHMOD) a+r-x $(JMANDIR)\$(ALIAS).$(MANSEC) catman: $(MANCAT) mkdir_p$(EXE) [ -d $(CATDIR) ] || .\mkdir_p$(EXE) $(CATDIR) $(INSTALL) $(MANCAT) $(CATDIR)\$(PROGRAM).$(MANSEC) $(CHMOD) a+r-x $(CATDIR)\$(PROGRAM).$(MANSEC) -$(RM) $(CATDIR)\$(ALIAS).$(MANSEC) $(LN) $(CATDIR)\$(PROGRAM).$(MANSEC) $(CATDIR)\$(ALIAS).$(MANSEC) $(CHMOD) a+r-x $(CATDIR)\$(ALIAS).$(MANSEC) catman-b: $(PROGRAM).eng mkdir_p$(EXE) [ -d $(CATDIR) ] || .\mkdir_p$(EXE) $(CATDIR) $(INSTALL) $(PROGRAM).eng $(CATDIR)\$(PROGRAM).$(MANSEC) $(CHMOD) a+r-x $(CATDIR)\$(PROGRAM).$(MANSEC) -$(RM) $(CATDIR)\$(ALIAS).$(MANSEC) $(LN) $(CATDIR)\$(PROGRAM).$(MANSEC) $(CATDIR)\$(ALIAS).$(MANSEC) $(CHMOD) a+r-x $(CATDIR)\$(ALIAS).$(MANSEC) compman: catman -$(RM) $(CATDIR)\$(ALIAS).$(MANSEC) compress -f $(CATDIR)\$(PROGRAM).$(MANSEC) -$(RM) $(CATDIR)\$(ALIAS).$(MANSEC).Z $(LN) $(CATDIR)\$(PROGRAM).$(MANSEC).Z $(CATDIR)\$(ALIAS).$(MANSEC).Z compman-b: catman-b -$(RM) $(CATDIR)\$(ALIAS).$(MANSEC) compress -f $(CATDIR)\$(PROGRAM).$(MANSEC) -$(RM) $(CATDIR)\$(ALIAS).$(MANSEC).Z $(LN) $(CATDIR)\$(PROGRAM).$(MANSEC).Z $(CATDIR)\$(ALIAS).$(MANSEC).Z jcatman: catman $(PROGRAM).$(MANSEC)c mkdir_p$(EXE) [ -d $(JCATDIR) ] || .\mkdir_p$(EXE) $(JCATDIR) $(INSTALL) $(PROGRAM).$(MANSEC)c $(JCATDIR)\$(PROGRAM).$(MANSEC) $(CHMOD) a+r-x $(JCATDIR)\$(PROGRAM).$(MANSEC) -$(RM) $(JCATDIR)\$(ALIAS).$(MANSEC) $(LN) $(JCATDIR)\$(PROGRAM).$(MANSEC) $(JCATDIR)\$(ALIAS).$(MANSEC) $(CHMOD) a+r-x $(JCATDIR)\$(ALIAS).$(MANSEC) jcatman-b: catman-b $(PROGRAM).doc mkdir_p$(EXE) [ -d $(JCATDIR) ] || .\mkdir_p$(EXE) $(JCATDIR) $(INSTALL) $(PROGRAM).doc $(JCATDIR)\$(PROGRAM).$(MANSEC) $(CHMOD) a+r-x $(JCATDIR)\$(PROGRAM).$(MANSEC) -$(RM) $(JCATDIR)\$(ALIAS).$(MANSEC) $(LN) $(JCATDIR)\$(PROGRAM).$(MANSEC) $(JCATDIR)\$(ALIAS).$(MANSEC) $(CHMOD) a+r-x $(JCATDIR)\$(ALIAS).$(MANSEC) jcompman: compman jcatman -$(RM) $(JCATDIR)\$(ALIAS).$(MANSEC) compress -f $(JCATDIR)\$(PROGRAM).$(MANSEC) -$(RM) $(JCATDIR)\$(ALIAS).$(MANSEC).Z $(LN) $(JCATDIR)\$(PROGRAM).$(MANSEC).Z $(JCATDIR)\$(ALIAS).$(MANSEC).Z jcompman-b: compman-b jcatman-b -$(RM) $(JCATDIR)\$(ALIAS).$(MANSEC) compress -f $(JCATDIR)\$(PROGRAM).$(MANSEC) -$(RM) $(JCATDIR)\$(ALIAS).$(MANSEC).Z $(LN) $(JCATDIR)\$(PROGRAM).$(MANSEC).Z $(JCATDIR)\$(ALIAS).$(MANSEC).Z ############################################################ # to make dependency depend: $(SRC) $(HSRC) $(DSRC) config.h kanji.h funcno.h [ -d $(DEPDIR) ] || mkdir $(DEPDIR) for f in $(SRC) $(HSRC); do \ $(SED) -e 's:^\(# *\)include "\(.*\).h":\1include "_\2.h":' \ $${f} > $(DEPDIR)\$${f}; \ done for f in $(DSRC); do \ $(SED) -e 's:^\(# *\)include "\(.*\).h":\1include "_\2.h":' \ $${f} > $${f}o; \ $(MV) $${f}o $${f}; \ done for f in $(SSRC); do \ $(RM) $(DEPDIR)\s$${f}; \ $(LN) $(DEPDIR)\$${f} $(DEPDIR)\s$${f}; \ done for f in $(BSRC); do \ $(RM) $(DEPDIR)\b$${f} && \ $(LN) $(DEPDIR)\$${f} $(DEPDIR)\b$${f}; \ done for f in $(NSRC); do \ $(RM) $(DEPDIR)\n$${f} && \ $(LN) $(DEPDIR)\$${f} $(DEPDIR)\n$${f}; \ done for f in $(TSRC); do \ $(RM) $(DEPDIR)\t$${f} && \ $(LN) $(DEPDIR)\$${f} $(DEPDIR)\t$${f}; \ done for f in $(HEADER) config.h kanji.h funcno.h version.h; do \ $(SED) -e 's:^\(# *\)include "\(.*\).h":\1include "_\2.h":' \ $${f} > $(DEPDIR)\_$${f}; \ done $(CP) Makefile.in Makefile.tmp $(DEPDIR) $(CP) Makefile.tmp $(DEPDIR)\Makefile.sh $(CP) Makefile.tmp $(DEPDIR)\Makefile.bsh $(CP) Makefile.tmp $(DEPDIR)\Makefile.nsh $(CP) Makefile.tmp $(DEPDIR)\Makefile.tr cd $(DEPDIR); makedepend \ -s "# DO NOT DELETE THIS LINE -- make depend depends on it." \ -f Makefile.tmp -- $(FDCFLAGS) -- \ $(SRC) \ `for f in $(DSRC); do $(ECHO) $${f}|$(SED) -e 's:^.*\::'; done` cd $(DEPDIR); makedepend \ -s "# DO NOT DELETE THIS LINE -- make depend depends on it." \ -f Makefile.sh -- $(SHCFLAGS) -- \ `for f in $(SSRC); do $(ECHO) s$${f}; done` cd $(DEPDIR); makedepend \ -s "# DO NOT DELETE THIS LINE -- make depend depends on it." \ -f Makefile.bsh -- $(BSHCFLAGS) -- \ `for f in $(BSRC); do $(ECHO) b$${f}; done` cd $(DEPDIR); makedepend \ -s "# DO NOT DELETE THIS LINE -- make depend depends on it." \ -f Makefile.nsh -- $(NSHCFLAGS) -- \ `for f in $(NSRC); do $(ECHO) n$${f}; done` cd $(DEPDIR); makedepend \ -s "# DO NOT DELETE THIS LINE -- make depend depends on it." \ -f Makefile.tr -- $(HOSTCOPTS) -- \ $(HSRC) \ `for f in $(TSRC); do $(ECHO) t$${f}; done` $(SED) -e '\^# DO NOT DELETE THIS LINE\,$$d' $(DEPDIR)\Makefile.in \ > Makefile.in $(ECHO) "# DO NOT DELETE THIS LINE -- make depend depends on it." \ >> Makefile.in $(SED) -e '1,\^# DO NOT DELETE THIS LINE\d' \ -e 's:^\(........\).*\.o:\1.o:' \ -e 's:\\[^ ]* *::g' \ -e 's:\.o:\$$(OBJ):g' \ -e 's:_\([^ ]*.h\):\1:g' \ -e 's: *$$::' \ -e '\: *$$\d' $(DEPDIR)\Makefile.tmp >> Makefile.in $(SED) -e '1,\^# DO NOT DELETE THIS LINE\d' \ -e 's:^\(........\).*\.o:\1.o:' \ -e 's:\\[^ ]* *::g' \ -e 's:\.o:\$$(OBJ):g' \ -e 's:_\([^ ]*.h\):\1:g' \ -e 's: *$$::' \ -e '\: *$$\d' $(DEPDIR)\Makefile.sh >> Makefile.in $(SED) -e '1,\^# DO NOT DELETE THIS LINE\d' \ -e 's:^\(........\).*\.o:\1.o:' \ -e 's:\\[^ ]* *::g' \ -e 's:\.o:\$$(OBJ):g' \ -e 's:_\([^ ]*.h\):\1:g' \ -e 's: *$$::' \ -e '\: *$$\d' $(DEPDIR)\Makefile.bsh >> Makefile.in $(SED) -e '1,\^# DO NOT DELETE THIS LINE\d' \ -e 's:^\(........\).*\.o:\1.o:' \ -e 's:\\[^ ]* *::g' \ -e 's:\.o:\$$(OBJ):g' \ -e 's:_\([^ ]*.h\):\1:g' \ -e 's: *$$::' \ -e '\: *$$\d' $(DEPDIR)\Makefile.nsh >> Makefile.in $(SED) -e '1,\^# DO NOT DELETE THIS LINE\d' \ -e 's:^\(........\).*\.o:\1.o:' \ -e 's:\\[^ ]* *::g' \ -e 's:\.o:\$$(OBJ):g' \ -e 's:_\([^ ]*.h\):\1:g' \ -e 's: *$$::' \ -e '\: *$$\d' $(DEPDIR)\Makefile.tr >> Makefile.in -rm -rf $(DEPDIR) ############################################################ # to verify sources lint: $(SRC) $(HSRC) config.h kanji.h funcno.h $(LINT) $(OSOPTS) -DFD=$(VERMAJ) `$(SED) -e "s:\$(OBJ):\.c:g" $(ARGS)` SRCS=`$(ECHO) $(UOBJ)|$(SED) -e "s:t\([^ ]*\)\$(OBJ):\1\.c:g"`; \ $(LINT) $(OSOPTS) mkunitbl.c $${SRCS} SRCS=`$(ECHO) $(TOBJ)|$(SED) -e "s:t\([^ ]*\)\$(OBJ):\1\.c:g"`; \ $(LINT) $(OSOPTS) mkdict.c $${SRCS}; \ $(LINT) $(OSOPTS) mktankan.c $${SRCS} $(LINT) $(OSOPTS) mkkanji.c SRCS=`$(ECHO) $(COBJ)|$(SED) -e "s:t\([^ ]*\)\$(OBJ):\1\.c:g"`; \ $(LINT) $(OSOPTS) mkcat.c $${SRCS} $(LINT) $(OSOPTS) mkdir_p.c SRCS=`$(ECHO) $(KOBJ)|$(SED) -e "s:t\([^ ]*\)\$(OBJ):\1\.c:g"`; \ $(LINT) $(OSOPTS) kanjicnv.c $${SRCS} $(LINT) $(OSOPTS) expfunc.c $(LINT) $(OSOPTS) mkfuncno.c ############################################################ # to make configuration file manually config: Configur expfunc.c -if ($(ECHO) 't() { echo $1; }; t test' | $(SHELL) >\dev\null 2>&1); then \ $(SED) -e "2,3d" -e "s:__cc__:gcc:" Configur \ | $(SHELL) > config.h; \ elif $(MAKE) -f Makefile.tmp expfunc$(EXE); then \ $(SED) -e "2,3d" -e "s:__cc__:gcc:" Configur \ | .\expfunc$(EXE) | $(SHELL) > config.h; \ fi # @sleep 1 config.h: config.hin $(CP) config.hin $@ # @sleep 1 expfunc$(EXE): expfunc$(OBJ) # @sleep 1 $(HOSTCC) $(HOSTCOPTS) $(HOSTLDFLAGS) -o $@ expfunc$(OBJ) # @ren $@ expfunc # @aout2exe expfunc # @del expfunc # @sleep 1 expfunc$(OBJ): expfunc.c $(HOSTCC) $(HOSTCOPTS) $(HOSTCPPFLAGS) -c -o $@ $*.c ############################################################ # sample program for pseudo system(3) sh: fdsh$(EXE) fdsh$(EXE): $(SOBJ1) $(SOBJ2) $(SARGS) # @sleep 1 $(CC) -o $@ @$(SARGS) $(SLDFLAGS) # @ren $@ fdsh # @aout2exe fdsh # @del fdsh $(SARGS): $(SOBJ1) $(SOBJ2) # @sleep 1 @$(ECHO) $(SOBJ1) > $(SARGS) @$(ECHO) $(SOBJ2) >> $(SARGS) # @sleep 1 sprintf$(OBJ): printf.c $(CC) $(SHCFLAGS) -c -o $@ printf.c stermio$(OBJ): termio.c $(CC) $(SHCFLAGS) -c -o $@ termio.c sstream$(OBJ): stream.c $(CC) $(SHCFLAGS) -c -o $@ stream.c sstring$(OBJ): string.c $(CC) $(SHCFLAGS) -c -o $@ string.c smalloc$(OBJ): malloc.c $(CC) $(SHCFLAGS) -c -o $@ malloc.c stime$(OBJ): time.c $(CC) $(SHCFLAGS) -c -o $@ time.c spathnam$(OBJ): pathname.c $(CC) $(SHCFLAGS) -c -o $@ pathname.c ssystem$(OBJ): system.c $(CC) $(SHCFLAGS) -c -o $@ system.c sposixsh$(OBJ): posixsh.c $(CC) $(SHCFLAGS) -c -o $@ posixsh.c sdoscom$(OBJ): doscom.c $(CC) $(SHCFLAGS) -c -o $@ doscom.c ssysemu$(OBJ): sysemu.c $(CC) $(SHCFLAGS) -c -o $@ sysemu.c ############################################################ # Bourne shell bsh: fdbsh$(EXE) fdbsh$(EXE): $(BOBJ) # @sleep 1 $(CC) -o $@ $(BOBJ) $(SLDFLAGS) # @ren $@ fdbsh # @aout2exe fdbsh # @del fdbsh bprintf$(OBJ): printf.c $(CC) $(BSHCFLAGS) -c -o $@ printf.c btermio$(OBJ): termio.c $(CC) $(BSHCFLAGS) -c -o $@ termio.c bstream$(OBJ): stream.c $(CC) $(BSHCFLAGS) -c -o $@ stream.c bstring$(OBJ): string.c $(CC) $(BSHCFLAGS) -c -o $@ string.c bmalloc$(OBJ): malloc.c $(CC) $(BSHCFLAGS) -c -o $@ malloc.c bpathnam$(OBJ): pathname.c $(CC) $(BSHCFLAGS) -c -o $@ pathname.c bsystem$(OBJ): system.c $(CC) $(BSHCFLAGS) -c -o $@ system.c bdoscom$(OBJ): doscom.c $(CC) $(BSHCFLAGS) -c -o $@ doscom.c bsysemu$(OBJ): sysemu.c $(CC) $(BSHCFLAGS) -c -o $@ sysemu.c ############################################################ # Network shell nsh: fdnsh$(EXE) fdnsh$(EXE): $(NOBJ1) $(NOBJ2) $(NOBJ3) $(NARGS) # @sleep 1 $(CC) -o $@ @$(NARGS) $(NLDFLAGS) # @ren $@ fdnsh # @aout2exe fdnsh # @del fdnsh $(NARGS): $(NOBJ1) $(NOBJ2) $(NOBJ3) # @sleep 1 @$(ECHO) $(NOBJ1) > $(NARGS) @$(ECHO) $(NOBJ2) >> $(NARGS) @$(ECHO) $(NOBJ3) >> $(NARGS) # @sleep 1 nprintf$(OBJ): printf.c $(CC) $(NSHCFLAGS) -c -o $@ printf.c ntermio$(OBJ): termio.c $(CC) $(NSHCFLAGS) -c -o $@ termio.c nstream$(OBJ): stream.c $(CC) $(NSHCFLAGS) -c -o $@ stream.c nstring$(OBJ): string.c $(CC) $(NSHCFLAGS) -c -o $@ string.c nmalloc$(OBJ): malloc.c $(CC) $(NSHCFLAGS) -c -o $@ malloc.c ntime$(OBJ): time.c $(CC) $(NSHCFLAGS) -c -o $@ time.c npathnam$(OBJ): pathname.c $(CC) $(NSHCFLAGS) -c -o $@ pathname.c nsystem$(OBJ): system.c $(CC) $(NSHCFLAGS) -c -o $@ system.c nposixsh$(OBJ): posixsh.c $(CC) $(NSHCFLAGS) -c -o $@ posixsh.c ndoscom$(OBJ): doscom.c $(CC) $(NSHCFLAGS) -c -o $@ doscom.c nsysemu$(OBJ): sysemu.c $(CC) $(NSHCFLAGS) -c -o $@ sysemu.c nrealpat$(OBJ): realpath.c $(CC) $(NSHCFLAGS) -c -o $@ realpath.c nencode$(OBJ): encode.c $(CC) $(NSHCFLAGS) -c -o $@ encode.c nparse$(OBJ): parse.c $(CC) $(NSHCFLAGS) -c -o $@ parse.c nsocket$(OBJ): socket.c $(CC) $(NSHCFLAGS) -c -o $@ socket.c nurl$(OBJ): url.c $(CC) $(NSHCFLAGS) -c -o $@ url.c nauth$(OBJ): auth.c $(CC) $(NSHCFLAGS) -c -o $@ auth.c nftp$(OBJ): ftp.c $(CC) $(NSHCFLAGS) -c -o $@ ftp.c nhtml$(OBJ): html.c $(CC) $(NSHCFLAGS) -c -o $@ html.c nhttp$(OBJ): http.c $(CC) $(NSHCFLAGS) -c -o $@ http.c nurldisk$(OBJ): urldisk.c $(CC) $(NSHCFLAGS) -c -o $@ urldisk.c nlsparse$(OBJ): lsparse.c $(CC) $(NSHCFLAGS) -c -o $@ lsparse.c ############################################################ # for programer's maintenance tar: $(SOURCES) $(TAR) cvf $(TITLE)$(VERSION).tar $(SOURCES) compress -f $(TITLE)$(VERSION).tar gtar: $(SOURCES) $(TAR) cvf $(TITLE)$(VERSION).tar $(SOURCES) gzip -f $(TITLE)$(VERSION).tar shtar: $(SHSOURCES) (VER=`date '+%y%m%d'`; \ $(TAR) cvf $(TITLE)sh-$${VER}.tar $(SHSOURCES); \ gzip -f $(TITLE)sh-$${VER}.tar) lzh: $(SOURCES) -$(RM) $(TITLE)$(VERSION).lzh $(LHA) a $(TITLE)$(VERSION).lzh $(SOURCES) shar: $(SOURCES) -$(RM) $(TITLE)$(VERSION).shar.[0-9][0-9] $(SHAR) -L50 -apc -n $(TITLE)$(VERSION) -o $(TITLE)$(VERSION).shar \ -T $(SRCS) -C $(JSRCS) ipk: $(PROGRAM)$(EXE) $(TABLES) mkdir_p$(EXE) -[ -d $(IPKWDIR)\$(BINDIR) ] || .\mkdir_p$(EXE) $(IPKWDIR)\$(BINDIR) -[ -d $(IPKWDIR)\$(BINDIR) ] || .\mkdir_p$(EXE) $(IPKWDIR)\$(BINDIR) -[ -d $(IPKWDIR)\$(BINDIR) ] || .\mkdir_p$(EXE) $(IPKWDIR)\$(BINDIR) -[ -d $(IPKWDIR)\$(CONFDIR) ] || .\mkdir_p$(EXE) $(IPKWDIR)\$(CONFDIR) -[ -d $(IPKWDIR)\CONTROL ] || .\mkdir_p$(EXE) $(IPKWDIR)\CONTROL -[ -d $(IPKTDIR) ] || .\mkdir_p$(EXE) $(IPKTDIR) $(CP) -p $(PROGRAM)$(EXE) $(IPKWDIR)\$(BINDIR) -[ -z "$(STRIP)" ] || $(STRIP) $(IPKWDIR)\$(BINDIR)\$(PROGRAM)$(EXE) $(CHMOD) a+rx $(IPKWDIR)\$(BINDIR)\$(PROGRAM)$(EXE) -$(RM) $(IPKWDIR)\$(BINDIR)\$(ALIAS)$(EXE) $(LN) $(IPKWDIR)\$(BINDIR)\$(PROGRAM)$(EXE) \ $(IPKWDIR)\$(BINDIR)\$(ALIAS)$(EXE) $(CHMOD) a+rx $(IPKWDIR)\$(BINDIR)\$(ALIAS)$(EXE) $(SED) -e 's:#TMPDIR=.*:TMPDIR=\home\tmp:' \ -e 's:#LANGUAGE=.*:LANGUAGE=euc:' \ -e 's:#INPUTKCODE=.*:INPUTKCODE=euc:' \ -e 's:#FNAMEKCODE=.*:FNAMEKCODE=utf8:' \ -e '\# launcher definition\,\^$$\ {' \ -e '\^$$\ {' \ -e 'i \' \ -e 'launch ".tar.Z" "gzip -cd %C|tar tvf -" "%a %u\%g %s %y-%m-%d %t %*f"' \ -e 'i \' \ -e 'launch ".taZ" "gzip -cd %C|tar tvf -" "%a %u\%g %s %y-%m-%d %t %*f"' \ -e 'i \' \ -e 'launch ".ipk" "gzip -cd %C|tar xOf - .\data.tar.gz|gzip -cd|tar tvf -" \\' \ -e 'i \' \ -e ' "%a %u\%g %s %y-%m-%d %t %*f"' \ -e 'i \' \ -e 'launch ".deb" "ar -p %C data.tar.gz|gzip -cd|tar tvf -" \\' \ -e 'i \' \ -e ' "%a %u\%g %s %y-%m-%d %t %*f"' \ -e '}' \ -e '}' \ -e '\# archiver definition\,\^$$\ {' \ -e '\^$$\ {' \ -e 'i \' \ -e 'arch ".tar.Z" "echo ERROR; false" "gzip -cd %C|tar xf - %TA"' \ -e 'i \' \ -e 'arch ".taZ" "echo ERROR; false" "gzip -cd %C|tar xf - %TA"' \ -e 'i \' \ -e 'arch ".ipk" "echo ERROR; false" \\' \ -e 'i \' \ -e ' "gzip -cd %C|tar xOf - .\data.tar.gz|gzip -cd|tar xf - %TA"' \ -e 'i \' \ -e 'arch ".deb" "echo ERROR; false" \\' \ -e 'i \' \ -e ' "ar -p %C data.tar.gz|gzip -cd|tar xf - %TA"' \ -e '}' \ -e '}' \ -e '$$ {' \ -e 'a \' \ -e 'if [ " $$TERM" = " vt100" -a " $$CONSOLE" = " \dev\console" ]; then' \ -e 'a \' \ -e ' keymap BS "^?"' \ -e 'a \' \ -e ' keymap DEL "\\033[3~"' \ -e 'a \' \ -e ' keymap HOME "\\033[H"' \ -e 'a \' \ -e ' keymap END "\\033[F"' \ -e 'a \' \ -e 'fi' \ -e '}' \ _fdrc > $(IPKWDIR)\$(BLDRC) $(CHMOD) a+r-x $(IPKWDIR)\$(BLDRC) -if [ -f $(UNITBL) ]; then \ cp -p $(UNITBL) $(IPKWDIR)\$(BINDIR); \ $(CHMOD) a+r-x $(IPKWDIR)\$(BINDIR)\$(UNITBL); \ fi -if [ -f $(DICTTBL) ]; then \ cp -p $(DICTTBL) $(IPKWDIR)\$(BINDIR); \ $(CHMOD) a+r-x $(IPKWDIR)\$(BINDIR)\$(DICTTBL); \ fi -if [ -f $(CATTBL) ]; then \ cp -p $(CATTBL) $(IPKWDIR)\$(BINDIR); \ $(CHMOD) a+r-x $(IPKWDIR)\$(BINDIR)\$(CATTBL); \ fi -if [ -f $(ECATTBL) ]; then \ cp -p $(ECATTBL) $(IPKWDIR)\$(BINDIR); \ $(CHMOD) a+r-x $(IPKWDIR)\$(BINDIR)\$(ECATTBL); \ fi $(ECHO) "Package: fd" > $(IPKWDIR)\CONTROL\control $(ECHO) "Priority: optional" >> $(IPKWDIR)\CONTROL\control $(ECHO) "Section: extras" >> $(IPKWDIR)\CONTROL\control $(ECHO) "Maintainer: $(DIST)" >> $(IPKWDIR)\CONTROL\control $(ECHO) "Architecture: arm" >> $(IPKWDIR)\CONTROL\control $(ECHO) "Version: $(VERSION)-1" >> $(IPKWDIR)\CONTROL\control $(ECHO) "Depends: ncurses" >> $(IPKWDIR)\CONTROL\control $(ECHO) "Description: a file & directory maintenance tool." \ >> $(IPKWDIR)\CONTROL\control (cd $(IPKWDIR); tar cf ..\data.tar --exclude=CONTROL .) (cd $(IPKWDIR)\CONTROL; tar cf ..\..\control.tar .) gzip .\data.tar $(MV) .\data.tar.gz $(IPKTDIR) gzip .\control.tar $(MV) .\control.tar.gz $(IPKTDIR) $(ECHO) "2.0" > $(IPKTDIR)\debian-binary (cd $(IPKTDIR); \ tar cf ..\ipk.tar .\debian-binary .\data.tar.gz .\control.tar.gz) gzip .\ipk.tar $(MV) .\ipk.tar.gz .\fd_$(VERSION)-1_arm.ipk -$(RM) -r $(IPKWDIR) $(IPKTDIR) clean: -$(RM) core -$(RM) *$(OBJ) -$(RM) funcno.h -$(RM) kanji.h -$(RM) _fd-cat.ja -$(RM) _fd-cat.C -$(RM) fd-cat.* -$(RM) kanjicnv$(EXE) -$(RM) expfunc$(EXE) -$(RM) mkdir_p$(EXE) -$(RM) mkfuncno$(EXE) -$(RM) mkunitbl$(EXE) -$(RM) mkdict$(EXE) -$(RM) mktankan$(EXE) -$(RM) mkkanji$(EXE) -$(RM) mkcat$(EXE) -$(RM) fdsh$(EXE) -$(RM) fdbsh$(EXE) -$(RM) fdnsh$(EXE) -$(RM) $(PROGRAM)$(EXE) -$(RM) $(PROGRAM).$(MANSEC) -$(RM) $(PROGRAM).$(MANSEC)c -$(RM) $(PROGRAM).eng -$(RM) $(PROGRAM).doc -$(RM) $(ARGS) -$(RM) $(SARGS) -$(RM) $(NARGS) -$(RM) $(UNITBL) -$(RM) unitbl.c -$(RM) dicttbl.c -$(RM) $(DICTTXT) -$(RM) $(DICTTBL) # DO NOT DELETE THIS LINE -- make depend depends on it. main$(OBJ): fd.h headers.h machine.h config.h main$(OBJ): depend.h printf.h main$(OBJ): stream.h kctype.h main$(OBJ): string.h malloc.h time.h log.h termio.h main$(OBJ): realpath.h main$(OBJ): parse.h kconv.h func.h sysemu.h dirent.h unixemu.h main$(OBJ): pathname.h main$(OBJ): typesize.h term.h types.h lsparse.h namelist.h dosdisk.h main$(OBJ): kanji.h catalog.h version.h system.h wait.h main$(OBJ): termemu.h roman.h urldisk.h url.h auth.h printf$(OBJ): headers.h machine.h config.h printf$(OBJ): depend.h printf.h stream.h kctype.h printf$(OBJ): typesize.h string.h printf$(OBJ): kconv.h termio$(OBJ): headers.h machine.h config.h termio$(OBJ): depend.h typesize.h sysemu.h dirent.h termio$(OBJ): unixemu.h termio$(OBJ): stream.h termio.h term$(OBJ): headers.h machine.h config.h term$(OBJ): depend.h printf.h term$(OBJ): stream.h kctype.h term$(OBJ): typesize.h string.h termio.h term$(OBJ): term.h stream$(OBJ): headers.h machine.h config.h stream$(OBJ): depend.h typesize.h malloc.h sysemu.h stream$(OBJ): dirent.h unixemu.h stream$(OBJ): stream.h pathname.h termio.h stream$(OBJ): socket.h string$(OBJ): headers.h machine.h config.h string$(OBJ): kctype.h depend.h string$(OBJ): string.h malloc$(OBJ): headers.h machine.h config.h malloc$(OBJ): printf.h stream.h depend.h malloc.h malloc$(OBJ): sysemu.h dirent.h unixemu.h time$(OBJ): headers.h machine.h config.h time$(OBJ): typesize.h time$(OBJ): string.h time.h pathname$(OBJ): fd.h headers.h machine.h config.h pathname$(OBJ): depend.h printf.h stream.h kctype.h pathname$(OBJ): string.h malloc.h pathname$(OBJ): dirent.h unixemu.h pathname$(OBJ): sysemu.h pathname.h typesize.h pathname$(OBJ): url.h system$(OBJ): fd.h headers.h machine.h config.h system$(OBJ): depend.h printf.h stream.h kctype.h system$(OBJ): string.h malloc.h system$(OBJ): term.h types.h typesize.h lsparse.h namelist.h kconv.h system$(OBJ): dirent.h unixemu.h system$(OBJ): sysemu.h system.h pathname.h termio.h system$(OBJ): wait.h system$(OBJ): termemu.h posixsh.h socket.h url.h system$(OBJ): urldisk.h auth.h posixsh$(OBJ): fd.h headers.h machine.h config.h posixsh$(OBJ): depend.h printf.h stream.h kctype.h posixsh$(OBJ): string.h malloc.h posixsh$(OBJ): sysemu.h dirent.h unixemu.h posixsh$(OBJ): system.h pathname.h typesize.h posixsh$(OBJ): termio.h posixsh$(OBJ): wait.h posixsh$(OBJ): termemu.h time.h posixsh.h term.h doscom$(OBJ): fd.h headers.h machine.h config.h doscom$(OBJ): depend.h printf.h stream.h kctype.h doscom$(OBJ): string.h malloc.h doscom$(OBJ): term.h types.h typesize.h lsparse.h namelist.h dirent.h doscom$(OBJ): unixemu.h doscom$(OBJ): sysemu.h system.h pathname.h termio.h doscom$(OBJ): wait.h doscom$(OBJ): realpath.h urldisk.h url.h auth.h log$(OBJ): fd.h headers.h machine.h config.h log$(OBJ): depend.h printf.h log$(OBJ): stream.h kctype.h log$(OBJ): string.h malloc.h func.h sysemu.h dirent.h unixemu.h log$(OBJ): pathname.h log$(OBJ): typesize.h term.h types.h lsparse.h namelist.h dosdisk.h sysemu$(OBJ): fd.h headers.h machine.h config.h sysemu$(OBJ): depend.h printf.h stream.h kctype.h sysemu$(OBJ): string.h malloc.h sysemu$(OBJ): kconv.h sysemu.h dirent.h unixemu.h sysemu$(OBJ): log.h pathname.h typesize.h termio.h sysemu$(OBJ): realpath.h dosdisk.h socket.h sysemu$(OBJ): urldisk.h namelist.h url.h auth.h dosdisk$(OBJ): headers.h machine.h config.h dosdisk$(OBJ): depend.h kctype.h dosdisk$(OBJ): string.h time.h sysemu.h dirent.h dosdisk$(OBJ): unixemu.h dosdisk$(OBJ): stream.h pathname.h typesize.h dosdisk.h unixdisk.h kconv.h unixdisk$(OBJ): headers.h machine.h config.h unixdisk$(OBJ): depend.h kctype.h unixdisk$(OBJ): string.h sysemu.h dirent.h unixemu.h unixdisk$(OBJ): stream.h unixdisk$(OBJ): pathname.h typesize.h dosdisk.h unixdisk.h realpath$(OBJ): fd.h headers.h machine.h config.h realpath$(OBJ): depend.h printf.h stream.h kctype.h realpath$(OBJ): string.h malloc.h realpath$(OBJ): sysemu.h dirent.h unixemu.h realpath$(OBJ): pathname.h typesize.h realpath.h realpath$(OBJ): url.h encode$(OBJ): headers.h machine.h config.h encode$(OBJ): kctype.h depend.h encode$(OBJ): sysemu.h dirent.h unixemu.h encode$(OBJ): stream.h encode$(OBJ): pathname.h typesize.h encode.h libc$(OBJ): fd.h headers.h machine.h config.h libc$(OBJ): depend.h printf.h libc$(OBJ): stream.h kctype.h libc$(OBJ): string.h malloc.h log.h realpath.h parse.h kconv.h func.h libc$(OBJ): sysemu.h dirent.h unixemu.h libc$(OBJ): pathname.h typesize.h term.h types.h libc$(OBJ): lsparse.h namelist.h dosdisk.h kanji.h catalog.h system.h libc$(OBJ): termio.h libc$(OBJ): wait.h libc$(OBJ): termemu.h url.h file$(OBJ): fd.h headers.h machine.h config.h file$(OBJ): depend.h printf.h file$(OBJ): stream.h kctype.h file$(OBJ): string.h malloc.h time.h termio.h file$(OBJ): realpath.h file$(OBJ): kconv.h func.h sysemu.h dirent.h unixemu.h file$(OBJ): pathname.h typesize.h term.h types.h file$(OBJ): lsparse.h namelist.h dosdisk.h kanji.h catalog.h urldisk.h file$(OBJ): url.h auth.h mntinfo$(OBJ): headers.h machine.h config.h mntinfo$(OBJ): kctype.h depend.h mntinfo$(OBJ): string.h malloc.h pathname.h mntinfo$(OBJ): typesize.h mntinfo.h fsinfo.h statfs$(OBJ): headers.h machine.h config.h statfs$(OBJ): fsinfo.h apply$(OBJ): fd.h headers.h machine.h config.h apply$(OBJ): depend.h printf.h stream.h kctype.h apply$(OBJ): string.h malloc.h apply$(OBJ): time.h realpath.h parse.h func.h sysemu.h dirent.h unixemu.h apply$(OBJ): pathname.h apply$(OBJ): typesize.h term.h types.h lsparse.h namelist.h dosdisk.h apply$(OBJ): kanji.h catalog.h pty$(OBJ): fd.h headers.h machine.h config.h pty$(OBJ): depend.h printf.h pty$(OBJ): stream.h kctype.h pty$(OBJ): string.h malloc.h sysemu.h dirent.h unixemu.h pty$(OBJ): pathname.h pty$(OBJ): typesize.h termio.h termemu$(OBJ): fd.h headers.h machine.h config.h termemu$(OBJ): depend.h printf.h stream.h kctype.h termemu$(OBJ): string.h malloc.h termemu$(OBJ): wait.h unixemu.h termio.h termemu$(OBJ): func.h sysemu.h dirent.h termemu$(OBJ): pathname.h termemu$(OBJ): typesize.h term.h types.h lsparse.h namelist.h dosdisk.h termemu$(OBJ): kanji.h catalog.h system.h termemu.h frontend$(OBJ): fd.h headers.h machine.h config.h frontend$(OBJ): depend.h printf.h stream.h kctype.h frontend$(OBJ): string.h malloc.h frontend$(OBJ): wait.h unixemu.h parse.h func.h frontend$(OBJ): sysemu.h dirent.h frontend$(OBJ): pathname.h typesize.h term.h frontend$(OBJ): types.h lsparse.h namelist.h dosdisk.h funcno.h kanji.h frontend$(OBJ): catalog.h system.h termio.h frontend$(OBJ): termemu.h frontend$(OBJ): roman.h backend$(OBJ): fd.h headers.h machine.h config.h backend$(OBJ): depend.h printf.h stream.h kctype.h backend$(OBJ): string.h malloc.h backend$(OBJ): termio.h backend$(OBJ): kconv.h func.h sysemu.h backend$(OBJ): dirent.h unixemu.h backend$(OBJ): pathname.h typesize.h term.h types.h backend$(OBJ): lsparse.h namelist.h dosdisk.h system.h wait.h backend$(OBJ): termemu.h parse$(OBJ): fd.h headers.h machine.h config.h parse$(OBJ): depend.h printf.h stream.h kctype.h parse$(OBJ): string.h malloc.h parse$(OBJ): pathname.h typesize.h term.h types.h lsparse.h namelist.h parse$(OBJ): kconv.h sysemu.h dirent.h unixemu.h parse$(OBJ): realpath.h parse.h system.h termio.h parse$(OBJ): wait.h builtin$(OBJ): fd.h headers.h machine.h config.h builtin$(OBJ): depend.h printf.h stream.h kctype.h builtin$(OBJ): string.h malloc.h builtin$(OBJ): encode.h parse.h kconv.h func.h sysemu.h dirent.h unixemu.h builtin$(OBJ): pathname.h builtin$(OBJ): typesize.h term.h types.h lsparse.h namelist.h dosdisk.h builtin$(OBJ): funcno.h kanji.h catalog.h system.h termio.h builtin$(OBJ): wait.h builtin$(OBJ): termemu.h roman.h shell$(OBJ): fd.h headers.h machine.h config.h shell$(OBJ): depend.h printf.h stream.h kctype.h shell$(OBJ): string.h malloc.h shell$(OBJ): realpath.h parse.h kconv.h func.h sysemu.h dirent.h unixemu.h shell$(OBJ): pathname.h shell$(OBJ): typesize.h term.h types.h lsparse.h namelist.h dosdisk.h shell$(OBJ): kanji.h catalog.h system.h termio.h shell$(OBJ): wait.h shell$(OBJ): termemu.h socket$(OBJ): headers.h machine.h config.h socket$(OBJ): depend.h printf.h stream.h kctype.h socket$(OBJ): typesize.h malloc.h socket$(OBJ): sysemu.h dirent.h unixemu.h socket$(OBJ): termio.h socket$(OBJ): socket.h url$(OBJ): headers.h machine.h config.h url$(OBJ): depend.h printf.h url$(OBJ): stream.h kctype.h url$(OBJ): typesize.h string.h malloc.h sysemu.h dirent.h unixemu.h url$(OBJ): pathname.h url.h auth$(OBJ): headers.h machine.h config.h auth$(OBJ): depend.h printf.h auth$(OBJ): stream.h string.h malloc.h time.h pathname.h typesize.h auth$(OBJ): encode.h parse.h socket.h auth.h url.h auth$(OBJ): system.h termio.h auth$(OBJ): wait.h auth$(OBJ): unixemu.h kanji.h catalog.h ftp$(OBJ): headers.h machine.h config.h ftp$(OBJ): depend.h printf.h ftp$(OBJ): stream.h kctype.h ftp$(OBJ): string.h malloc.h time.h sysemu.h dirent.h unixemu.h ftp$(OBJ): pathname.h ftp$(OBJ): typesize.h termio.h ftp$(OBJ): parse.h ftp$(OBJ): lsparse.h namelist.h socket.h auth.h ftp$(OBJ): url.h urldisk.h html$(OBJ): headers.h machine.h config.h html$(OBJ): depend.h printf.h html$(OBJ): stream.h kctype.h html$(OBJ): typesize.h string.h malloc.h sysemu.h dirent.h unixemu.h html$(OBJ): pathname.h termio.h html$(OBJ): parse.h html.h urldisk.h html$(OBJ): namelist.h url.h auth.h http$(OBJ): headers.h machine.h config.h http$(OBJ): depend.h printf.h http$(OBJ): stream.h kctype.h http$(OBJ): string.h malloc.h time.h sysemu.h dirent.h unixemu.h http$(OBJ): pathname.h http$(OBJ): typesize.h termio.h http$(OBJ): parse.h http$(OBJ): lsparse.h namelist.h socket.h auth.h http$(OBJ): url.h html.h urldisk.h urldisk$(OBJ): headers.h machine.h config.h urldisk$(OBJ): depend.h printf.h stream.h string.h urldisk$(OBJ): malloc.h time.h sysemu.h dirent.h unixemu.h urldisk$(OBJ): pathname.h urldisk$(OBJ): typesize.h termio.h urldisk$(OBJ): realpath.h urldisk$(OBJ): lsparse.h namelist.h socket.h urldisk$(OBJ): urldisk.h url.h auth.h catalog$(OBJ): fd.h headers.h machine.h config.h catalog$(OBJ): depend.h printf.h stream.h kctype.h catalog$(OBJ): string.h malloc.h catalog$(OBJ): termio.h catalog$(OBJ): func.h sysemu.h dirent.h catalog$(OBJ): unixemu.h catalog$(OBJ): pathname.h typesize.h term.h types.h lsparse.h namelist.h catalog$(OBJ): dosdisk.h kanji.h catalog.h kconv$(OBJ): fd.h headers.h machine.h config.h kconv$(OBJ): depend.h printf.h stream.h kctype.h kconv$(OBJ): string.h malloc.h kconv$(OBJ): termio.h kconv$(OBJ): realpath.h parse.h func.h kconv$(OBJ): sysemu.h dirent.h unixemu.h kconv$(OBJ): pathname.h typesize.h term.h types.h kconv$(OBJ): lsparse.h namelist.h dosdisk.h kconv.h termemu.h input$(OBJ): fd.h headers.h machine.h config.h input$(OBJ): depend.h printf.h stream.h kctype.h input$(OBJ): string.h malloc.h input$(OBJ): wait.h unixemu.h parse.h kconv.h func.h input$(OBJ): sysemu.h dirent.h input$(OBJ): pathname.h typesize.h term.h types.h lsparse.h namelist.h input$(OBJ): dosdisk.h kanji.h catalog.h system.h termio.h input$(OBJ): termemu.h ime$(OBJ): fd.h headers.h machine.h config.h ime$(OBJ): depend.h printf.h ime$(OBJ): stream.h kctype.h ime$(OBJ): string.h malloc.h wait.h unixemu.h ime$(OBJ): parse.h kconv.h roman.h func.h sysemu.h dirent.h ime$(OBJ): pathname.h ime$(OBJ): typesize.h term.h types.h lsparse.h namelist.h dosdisk.h ime$(OBJ): kanji.h catalog.h termemu.h dict$(OBJ): fd.h headers.h machine.h config.h dict$(OBJ): depend.h printf.h dict$(OBJ): stream.h kctype.h dict$(OBJ): string.h malloc.h termio.h dict$(OBJ): roman.h dict$(OBJ): hinsi.h func.h sysemu.h dirent.h unixemu.h dict$(OBJ): pathname.h typesize.h term.h types.h dict$(OBJ): lsparse.h namelist.h dosdisk.h parse.h kconv.h roman$(OBJ): headers.h machine.h config.h roman$(OBJ): depend.h kctype.h roman$(OBJ): typesize.h string.h kconv.h roman.h info$(OBJ): fd.h headers.h machine.h config.h info$(OBJ): depend.h printf.h info$(OBJ): stream.h kctype.h info$(OBJ): string.h malloc.h dirent.h unixemu.h info$(OBJ): sysemu.h pathname.h typesize.h term.h info$(OBJ): types.h lsparse.h namelist.h funcno.h kanji.h catalog.h info$(OBJ): unixdisk.h mntinfo.h fsinfo.h rockridg$(OBJ): fd.h headers.h machine.h config.h rockridg$(OBJ): depend.h printf.h stream.h kctype.h rockridg$(OBJ): string.h malloc.h rockridg$(OBJ): device.h parse.h func.h sysemu.h dirent.h unixemu.h rockridg$(OBJ): pathname.h rockridg$(OBJ): typesize.h term.h types.h lsparse.h namelist.h dosdisk.h tree$(OBJ): fd.h headers.h machine.h config.h tree$(OBJ): depend.h printf.h tree$(OBJ): stream.h kctype.h tree$(OBJ): string.h malloc.h func.h sysemu.h dirent.h unixemu.h tree$(OBJ): pathname.h tree$(OBJ): typesize.h term.h types.h lsparse.h namelist.h dosdisk.h tree$(OBJ): kanji.h catalog.h lsparse$(OBJ): fd.h headers.h machine.h config.h lsparse$(OBJ): depend.h printf.h stream.h kctype.h lsparse$(OBJ): string.h malloc.h lsparse$(OBJ): time.h dirent.h unixemu.h lsparse$(OBJ): pathname.h typesize.h device.h lsparse$(OBJ): parse.h lsparse.h namelist.h kconv.h archive$(OBJ): fd.h headers.h machine.h config.h archive$(OBJ): depend.h printf.h stream.h kctype.h archive$(OBJ): string.h malloc.h archive$(OBJ): realpath.h kconv.h func.h sysemu.h dirent.h unixemu.h archive$(OBJ): pathname.h archive$(OBJ): typesize.h term.h types.h lsparse.h namelist.h dosdisk.h archive$(OBJ): kanji.h catalog.h system.h termio.h archive$(OBJ): wait.h archive$(OBJ): termemu.h custom$(OBJ): fd.h headers.h machine.h config.h custom$(OBJ): depend.h printf.h stream.h kctype.h custom$(OBJ): string.h malloc.h custom$(OBJ): parse.h kconv.h func.h sysemu.h dirent.h unixemu.h custom$(OBJ): pathname.h custom$(OBJ): typesize.h term.h types.h lsparse.h namelist.h dosdisk.h custom$(OBJ): funcno.h kanji.h catalog.h system.h termio.h custom$(OBJ): wait.h custom$(OBJ): termemu.h urldisk.h url.h auth.h command$(OBJ): fd.h headers.h machine.h config.h command$(OBJ): depend.h printf.h stream.h kctype.h command$(OBJ): string.h malloc.h command$(OBJ): parse.h func.h sysemu.h dirent.h unixemu.h command$(OBJ): pathname.h command$(OBJ): typesize.h term.h types.h lsparse.h namelist.h dosdisk.h command$(OBJ): funcno.h kanji.h catalog.h system.h termio.h command$(OBJ): wait.h command$(OBJ): termemu.h functabl.h browse$(OBJ): fd.h headers.h machine.h config.h browse$(OBJ): depend.h printf.h stream.h kctype.h browse$(OBJ): string.h malloc.h browse$(OBJ): device.h parse.h kconv.h func.h sysemu.h dirent.h unixemu.h browse$(OBJ): pathname.h browse$(OBJ): typesize.h term.h types.h lsparse.h namelist.h dosdisk.h browse$(OBJ): funcno.h kanji.h catalog.h termemu.h unitbl$(OBJ): headers.h machine.h config.h dicttbl$(OBJ): headers.h machine.h config.h sprintf$(OBJ): headers.h machine.h config.h sprintf$(OBJ): depend.h printf.h stream.h kctype.h sprintf$(OBJ): typesize.h string.h stermio$(OBJ): headers.h machine.h config.h stermio$(OBJ): depend.h typesize.h sysemu.h dirent.h stermio$(OBJ): unixemu.h stermio$(OBJ): stream.h termio.h sstream$(OBJ): headers.h machine.h config.h sstream$(OBJ): depend.h typesize.h malloc.h sysemu.h sstream$(OBJ): dirent.h unixemu.h sstream$(OBJ): stream.h pathname.h termio.h sstring$(OBJ): headers.h machine.h config.h sstring$(OBJ): kctype.h depend.h sstring$(OBJ): string.h smalloc$(OBJ): headers.h machine.h config.h smalloc$(OBJ): printf.h stream.h depend.h malloc.h smalloc$(OBJ): sysemu.h dirent.h unixemu.h stime$(OBJ): headers.h machine.h config.h stime$(OBJ): typesize.h string.h time.h spathnam$(OBJ): headers.h machine.h config.h spathnam$(OBJ): depend.h spathnam$(OBJ): printf.h stream.h kctype.h spathnam$(OBJ): string.h malloc.h dirent.h unixemu.h spathnam$(OBJ): sysemu.h spathnam$(OBJ): pathname.h typesize.h ssystem$(OBJ): headers.h machine.h config.h ssystem$(OBJ): depend.h printf.h stream.h kctype.h ssystem$(OBJ): string.h malloc.h ssystem$(OBJ): dirent.h unixemu.h ssystem$(OBJ): sysemu.h system.h pathname.h ssystem$(OBJ): typesize.h termio.h ssystem$(OBJ): wait.h ssystem$(OBJ): termemu.h time.h posixsh.h sposixsh$(OBJ): headers.h machine.h config.h sposixsh$(OBJ): depend.h printf.h stream.h kctype.h sposixsh$(OBJ): string.h malloc.h sposixsh$(OBJ): sysemu.h dirent.h unixemu.h sposixsh$(OBJ): system.h pathname.h typesize.h sposixsh$(OBJ): termio.h sposixsh$(OBJ): wait.h sposixsh$(OBJ): termemu.h time.h posixsh.h sdoscom$(OBJ): headers.h machine.h config.h sdoscom$(OBJ): depend.h printf.h stream.h kctype.h sdoscom$(OBJ): string.h malloc.h sdoscom$(OBJ): dirent.h unixemu.h sdoscom$(OBJ): sysemu.h system.h pathname.h sdoscom$(OBJ): typesize.h termio.h sdoscom$(OBJ): wait.h ssysemu$(OBJ): headers.h machine.h config.h ssysemu$(OBJ): depend.h printf.h stream.h kctype.h ssysemu$(OBJ): string.h malloc.h ssysemu$(OBJ): sysemu.h dirent.h unixemu.h ssysemu$(OBJ): log.h pathname.h typesize.h termio.h ssysemu$(OBJ): realpath.h bprintf$(OBJ): headers.h machine.h config.h bprintf$(OBJ): depend.h printf.h stream.h kctype.h bprintf$(OBJ): typesize.h string.h btermio$(OBJ): headers.h machine.h config.h btermio$(OBJ): depend.h typesize.h sysemu.h dirent.h btermio$(OBJ): unixemu.h btermio$(OBJ): stream.h termio.h bstream$(OBJ): headers.h machine.h config.h bstream$(OBJ): depend.h typesize.h malloc.h sysemu.h bstream$(OBJ): dirent.h unixemu.h bstream$(OBJ): stream.h pathname.h termio.h bstring$(OBJ): headers.h machine.h config.h bstring$(OBJ): kctype.h depend.h bstring$(OBJ): string.h bmalloc$(OBJ): headers.h machine.h config.h bmalloc$(OBJ): printf.h stream.h depend.h malloc.h bmalloc$(OBJ): sysemu.h dirent.h unixemu.h bpathnam$(OBJ): headers.h machine.h config.h bpathnam$(OBJ): depend.h bpathnam$(OBJ): printf.h stream.h kctype.h bpathnam$(OBJ): string.h malloc.h dirent.h unixemu.h bpathnam$(OBJ): sysemu.h bpathnam$(OBJ): pathname.h typesize.h bsystem$(OBJ): headers.h machine.h config.h bsystem$(OBJ): depend.h printf.h stream.h kctype.h bsystem$(OBJ): string.h malloc.h bsystem$(OBJ): dirent.h unixemu.h bsystem$(OBJ): sysemu.h system.h pathname.h bsystem$(OBJ): typesize.h termio.h bsystem$(OBJ): wait.h bsystem$(OBJ): termemu.h bdoscom$(OBJ): headers.h machine.h config.h bdoscom$(OBJ): depend.h printf.h stream.h kctype.h bdoscom$(OBJ): string.h malloc.h bdoscom$(OBJ): dirent.h unixemu.h bdoscom$(OBJ): sysemu.h system.h pathname.h bdoscom$(OBJ): typesize.h termio.h bdoscom$(OBJ): wait.h bsysemu$(OBJ): headers.h machine.h config.h bsysemu$(OBJ): depend.h printf.h stream.h kctype.h bsysemu$(OBJ): string.h malloc.h bsysemu$(OBJ): sysemu.h dirent.h unixemu.h bsysemu$(OBJ): log.h pathname.h typesize.h termio.h bsysemu$(OBJ): realpath.h nprintf$(OBJ): headers.h machine.h config.h nprintf$(OBJ): depend.h printf.h stream.h kctype.h nprintf$(OBJ): typesize.h string.h ntermio$(OBJ): headers.h machine.h config.h ntermio$(OBJ): depend.h typesize.h sysemu.h dirent.h ntermio$(OBJ): unixemu.h ntermio$(OBJ): stream.h termio.h nstream$(OBJ): headers.h machine.h config.h nstream$(OBJ): depend.h typesize.h malloc.h sysemu.h nstream$(OBJ): dirent.h unixemu.h nstream$(OBJ): stream.h pathname.h termio.h nstream$(OBJ): socket.h nstring$(OBJ): headers.h machine.h config.h nstring$(OBJ): kctype.h depend.h nstring$(OBJ): string.h nmalloc$(OBJ): headers.h machine.h config.h nmalloc$(OBJ): printf.h stream.h depend.h malloc.h nmalloc$(OBJ): sysemu.h dirent.h unixemu.h ntime$(OBJ): headers.h machine.h config.h ntime$(OBJ): typesize.h string.h time.h npathnam$(OBJ): headers.h machine.h config.h npathnam$(OBJ): depend.h npathnam$(OBJ): printf.h stream.h kctype.h npathnam$(OBJ): string.h malloc.h dirent.h unixemu.h npathnam$(OBJ): sysemu.h npathnam$(OBJ): pathname.h typesize.h url.h nsystem$(OBJ): headers.h machine.h config.h nsystem$(OBJ): depend.h printf.h stream.h kctype.h nsystem$(OBJ): string.h malloc.h nsystem$(OBJ): dirent.h unixemu.h nsystem$(OBJ): sysemu.h system.h pathname.h nsystem$(OBJ): typesize.h termio.h nsystem$(OBJ): wait.h nsystem$(OBJ): termemu.h time.h posixsh.h socket.h nsystem$(OBJ): url.h urldisk.h namelist.h auth.h nposixsh$(OBJ): headers.h machine.h config.h nposixsh$(OBJ): depend.h printf.h stream.h kctype.h nposixsh$(OBJ): string.h malloc.h nposixsh$(OBJ): sysemu.h dirent.h unixemu.h nposixsh$(OBJ): system.h pathname.h typesize.h nposixsh$(OBJ): termio.h nposixsh$(OBJ): wait.h nposixsh$(OBJ): termemu.h time.h posixsh.h ndoscom$(OBJ): headers.h machine.h config.h ndoscom$(OBJ): depend.h printf.h stream.h kctype.h ndoscom$(OBJ): string.h malloc.h ndoscom$(OBJ): dirent.h unixemu.h ndoscom$(OBJ): sysemu.h system.h pathname.h ndoscom$(OBJ): typesize.h termio.h ndoscom$(OBJ): wait.h ndoscom$(OBJ): realpath.h urldisk.h namelist.h url.h ndoscom$(OBJ): auth.h nsysemu$(OBJ): headers.h machine.h config.h nsysemu$(OBJ): depend.h printf.h stream.h kctype.h nsysemu$(OBJ): string.h malloc.h nsysemu$(OBJ): sysemu.h dirent.h unixemu.h nsysemu$(OBJ): log.h pathname.h typesize.h termio.h nsysemu$(OBJ): realpath.h socket.h nsysemu$(OBJ): urldisk.h namelist.h url.h auth.h nrealpat$(OBJ): headers.h machine.h config.h nrealpat$(OBJ): depend.h nrealpat$(OBJ): printf.h stream.h kctype.h nrealpat$(OBJ): string.h sysemu.h dirent.h unixemu.h nrealpat$(OBJ): pathname.h nrealpat$(OBJ): typesize.h realpath.h url.h nencode$(OBJ): headers.h machine.h config.h nencode$(OBJ): kctype.h depend.h nencode$(OBJ): sysemu.h dirent.h unixemu.h nencode$(OBJ): stream.h nencode$(OBJ): pathname.h typesize.h encode.h nparse$(OBJ): headers.h machine.h config.h nparse$(OBJ): depend.h printf.h stream.h kctype.h nparse$(OBJ): string.h malloc.h nparse$(OBJ): sysemu.h dirent.h unixemu.h nparse$(OBJ): realpath.h parse.h system.h nparse$(OBJ): pathname.h typesize.h termio.h nparse$(OBJ): wait.h nsocket$(OBJ): headers.h machine.h config.h nsocket$(OBJ): depend.h printf.h stream.h kctype.h nsocket$(OBJ): typesize.h malloc.h nsocket$(OBJ): sysemu.h dirent.h unixemu.h nsocket$(OBJ): termio.h nsocket$(OBJ): socket.h nurl$(OBJ): headers.h machine.h config.h nurl$(OBJ): depend.h printf.h nurl$(OBJ): stream.h kctype.h nurl$(OBJ): typesize.h string.h malloc.h sysemu.h dirent.h unixemu.h nurl$(OBJ): pathname.h url.h nauth$(OBJ): headers.h machine.h config.h nauth$(OBJ): depend.h printf.h stream.h string.h nauth$(OBJ): malloc.h time.h pathname.h typesize.h encode.h parse.h nauth$(OBJ): socket.h auth.h url.h system.h nauth$(OBJ): termio.h nauth$(OBJ): wait.h unixemu.h nauth$(OBJ): sysemu.h dirent.h nftp$(OBJ): headers.h machine.h config.h nftp$(OBJ): depend.h printf.h nftp$(OBJ): stream.h kctype.h nftp$(OBJ): string.h malloc.h time.h sysemu.h dirent.h unixemu.h nftp$(OBJ): pathname.h nftp$(OBJ): typesize.h termio.h nftp$(OBJ): parse.h nftp$(OBJ): lsparse.h namelist.h socket.h auth.h nftp$(OBJ): url.h urldisk.h nhtml$(OBJ): headers.h machine.h config.h nhtml$(OBJ): depend.h printf.h stream.h kctype.h nhtml$(OBJ): typesize.h string.h nhtml$(OBJ): malloc.h sysemu.h dirent.h unixemu.h nhtml$(OBJ): pathname.h termio.h nhtml$(OBJ): parse.h html.h urldisk.h nhtml$(OBJ): namelist.h url.h auth.h nhttp$(OBJ): headers.h machine.h config.h nhttp$(OBJ): depend.h printf.h stream.h kctype.h nhttp$(OBJ): string.h malloc.h nhttp$(OBJ): time.h sysemu.h dirent.h unixemu.h nhttp$(OBJ): pathname.h typesize.h termio.h nhttp$(OBJ): parse.h lsparse.h namelist.h nhttp$(OBJ): socket.h auth.h url.h html.h nhttp$(OBJ): urldisk.h nurldisk$(OBJ): headers.h machine.h config.h nurldisk$(OBJ): depend.h printf.h stream.h string.h nurldisk$(OBJ): malloc.h time.h sysemu.h dirent.h unixemu.h nurldisk$(OBJ): pathname.h nurldisk$(OBJ): typesize.h termio.h nurldisk$(OBJ): realpath.h nurldisk$(OBJ): lsparse.h namelist.h socket.h nurldisk$(OBJ): urldisk.h url.h auth.h nlsparse$(OBJ): headers.h machine.h config.h nlsparse$(OBJ): depend.h kctype.h nlsparse$(OBJ): string.h malloc.h time.h dirent.h nlsparse$(OBJ): unixemu.h nlsparse$(OBJ): pathname.h typesize.h device.h parse.h lsparse.h namelist.h evalopt$(OBJ): headers.h machine.h config.h evalopt$(OBJ): evalopt.h gentbl$(OBJ): headers.h machine.h config.h gentbl$(OBJ): gentbl.h mkunitbl$(OBJ): headers.h machine.h config.h mkunitbl$(OBJ): typesize.h evalopt.h gentbl.h mkdict$(OBJ): headers.h machine.h config.h mkdict$(OBJ): kctype.h depend.h mkdict$(OBJ): typesize.h string.h kconv.h roman.h mkdict$(OBJ): hinsi.h evalopt.h gentbl.h mktankan$(OBJ): headers.h machine.h config.h mktankan$(OBJ): kctype.h depend.h mktankan$(OBJ): typesize.h kconv.h roman.h mkkanji$(OBJ): headers.h machine.h config.h mkkanji$(OBJ): typesize.h mkcat$(OBJ): headers.h machine.h config.h mkcat$(OBJ): kctype.h depend.h mkcat$(OBJ): typesize.h version.h evalopt.h gentbl.h mkdir_p$(OBJ): headers.h machine.h config.h mkdir_p$(OBJ): kctype.h depend.h mkdir_p$(OBJ): typesize.h kanjicnv$(OBJ): headers.h machine.h config.h kanjicnv$(OBJ): evalopt.h expfunc$(OBJ): headers.h machine.h config.h mkfuncno$(OBJ): fd.h headers.h machine.h config.h mkfuncno$(OBJ): depend.h types.h typesize.h stream.h mkfuncno$(OBJ): lsparse.h namelist.h functabl.h tstring$(OBJ): headers.h machine.h config.h tstring$(OBJ): kctype.h depend.h tstring$(OBJ): string.h troman$(OBJ): headers.h machine.h config.h troman$(OBJ): depend.h kctype.h troman$(OBJ): typesize.h string.h kconv.h roman.h tkconv$(OBJ): headers.h machine.h config.h tkconv$(OBJ): depend.h kctype.h tkconv$(OBJ): typesize.h string.h unixemu.h kconv.h tkconv$(OBJ): termemu.h pathname.h tevalopt$(OBJ): headers.h machine.h config.h tevalopt$(OBJ): evalopt.h tgentbl$(OBJ): headers.h machine.h config.h tgentbl$(OBJ): gentbl.h tunitbl$(OBJ): headers.h machine.h config.h FD-3.01j/makefile.lpc100644 2105 1751 154225 13516612560 13207 0ustar shiraiuser# # Makefile for fd # TITLE = FD- VERMAJ = 3 VERSION = 3.01j PREFIX = CONFDIR = BUILD = MANSEC = 1 BINTOP = $(PREFIX)\bin BINDIR = $(BUILD)$(BINTOP) DATATOP = $(PREFIX)\share DATADIR = $(BUILD)$(DATATOP)\fd MANTOP = $(PREFIX)\man MANDIR = $(BUILD)$(MANTOP)\man$(MANSEC) CATDIR = $(BUILD)$(MANTOP)\cat$(MANSEC) JMANDIR = $(BUILD)$(MANTOP)\man$(MANSEC) JCATDIR = $(BUILD)$(MANTOP)\cat$(MANSEC) IPKWDIR = .\ipk.work IPKTDIR = .\ipk.tmp DEPDIR = .\depend.tmp DIST = none DEFRC = $(CONFDIR)\fd2rc BLDRC = $(BUILD)$(DEFRC) DOSRC = ~FD\\fd2rc UNITBL = fd-unicd.tbl DICTTBL = fd-dict.tbl DICTTXT = fd-dict.txt DICTSRC = CATTBL = fd-cat.ja ECATTBL = fd-cat.C TABLES = $(UNITBL) $(CATTBL) $(ECATTBL) SRC = main.c printf.c termio.c term.c stream.c \ string.c malloc.c time.c \ pathname.c system.c posixsh.c doscom.c \ log.c sysemu.c dosdisk.c unixdisk.c \ realpath.c encode.c \ libc.c file.c mntinfo.c statfs.c apply.c \ pty.c termemu.c frontend.c backend.c \ parse.c builtin.c shell.c \ socket.c url.c auth.c \ ftp.c html.c http.c urldisk.c \ catalog.c \ kconv.c input.c ime.c dict.c roman.c \ info.c rockridg.c tree.c \ lsparse.c archive.c \ custom.c command.c browse.c HSRC = evalopt.c gentbl.c \ mkunitbl.c mkdict.c mktankan.c \ mkkanji.c mkcat.c mkdir_p.c \ kanjicnv.c expfunc.c \ mkfuncno.c DSRC = $(DEPDIR)\unitbl.c $(DEPDIR)\dicttbl.c HEADER = fd.h \ headers.h machine.h \ depend.h \ printf.h kctype.h typesize.h \ string.h malloc.h time.h \ dirent.h sysemu.h log.h \ pathname.h system.h posixsh.h wait.h \ termio.h term.h stream.h \ types.h namelist.h \ dosdisk.h unixdisk.h unixemu.h \ realpath.h encode.h termemu.h \ mntinfo.h fsinfo.h device.h parse.h lsparse.h \ socket.h url.h auth.h html.h urldisk.h \ catalog.h \ evalopt.h gentbl.h \ kconv.h roman.h hinsi.h \ func.h functabl.h SSRC = printf.c termio.c stream.c \ string.c malloc.c time.c \ pathname.c system.c posixsh.c doscom.c \ sysemu.c BSRC = printf.c termio.c stream.c \ string.c malloc.c \ pathname.c system.c doscom.c \ sysemu.c NSRC = printf.c termio.c stream.c \ string.c malloc.c time.c \ pathname.c system.c posixsh.c doscom.c \ sysemu.c \ realpath.c encode.c \ parse.c \ socket.c url.c auth.c \ ftp.c html.c http.c urldisk.c \ lsparse.c TSRC = string.c roman.c kconv.c evalopt.c gentbl.c unitbl.c DOC = README.eng HISTORY.eng FAQ.eng TECHKNOW.eng \ Install.eng ToAdmin.eng LICENSES.eng JDOC = README HISTORY FAQ TECHKNOW \ Install ToAdmin LICENSES MANSRC = fd_e.man MANCAT = fd_e.cat JMANSRC = fd.man JMANCAT = fd.cat RUNCOM = fdrc ARGS = object.arg SARGS = sobject.arg NARGS = nobject.arg SRCS = $(DOC) $(MANSRC) $(MANCAT) \ Configur Makefile Makefile.in $(SRC) $(HSRC) $(HEADER) \ makefile.gpc makefile.g98 \ makefile.dpc makefile.d98 \ makefile.lpc makefile.l98 \ makefile.bpc makefile.b98 \ mkmfdosg.sed mkmfdosd.sed mkmfdosl.sed mkmfdosb.sed \ mkmfsed.c \ config.hin version.h \ _fdrc _fdrc.dif fd.spec JSRCS = $(JDOC) $(JMANSRC) $(JMANCAT) \ kanji.hin SOURCES = $(SRCS) $(JSRCS) SHSOURCES = $(NSRC) \ headers.h machine.h \ depend.h \ printf.h kctype.h typesize.h \ string.h malloc.h time.h \ dirent.h sysemu.h log.h \ pathname.h system.h posixsh.h wait.h \ termio.h stream.h \ namelist.h \ unixemu.h \ realpath.h encode.h \ device.h parse.h lsparse.h \ socket.h url.h auth.h html.h urldisk.h \ kanjicnv.c expfunc.c mkmfsed.c \ Configur Makefile Makefile.in \ makefile.gpc makefile.g98 \ makefile.dpc makefile.d98 \ makefile.lpc makefile.l98 \ makefile.bpc makefile.b98 \ mkmfdosg.sed mkmfdosd.sed mkmfdosl.sed mkmfdosb.sed \ config.hin version.h CC = lcc86 HOSTCC = $(CC) INSTALL = copy /y MAKE = make SHELL = \bin\sh SED = sed ECHO = command /c echo CP = copy /y RM = del LN = copy /y MV = mv CHMOD = chmod LINT = lint TAR = tar LHA = lha SHAR = shar EXE = .exe OBJ = .obj PROGRAM = fd ALIAS = fdsh DOSOBJS = unixdisk$(OBJ) IMEOBJS = ime$(OBJ) dict$(OBJ) roman$(OBJ) SCKOBJS = socket$(OBJ) url$(OBJ) auth$(OBJ) \ ftp$(OBJ) html$(OBJ) http$(OBJ) urldisk$(OBJ) OBJ1 = main$(OBJ) printf$(OBJ) termio$(OBJ) term$(OBJ) stream$(OBJ) \ string$(OBJ) malloc$(OBJ) time$(OBJ) OBJ2 = pathname$(OBJ) system$(OBJ) posixsh$(OBJ) doscom$(OBJ) \ log$(OBJ) sysemu$(OBJ) dosdisk$(OBJ) $(DOSOBJS) OBJ3 = realpath$(OBJ) encode$(OBJ) \ libc$(OBJ) file$(OBJ) mntinfo$(OBJ) statfs$(OBJ) apply$(OBJ) \ pty$(OBJ) termemu$(OBJ) frontend$(OBJ) backend$(OBJ) OBJ4 = parse$(OBJ) builtin$(OBJ) shell$(OBJ) OBJ5 = catalog$(OBJ) \ kconv$(OBJ) input$(OBJ) OBJ6 = info$(OBJ) rockridg$(OBJ) tree$(OBJ) \ lsparse$(OBJ) archive$(OBJ) \ custom$(OBJ) command$(OBJ) browse$(OBJ) SOBJ1 = sprintf$(OBJ) stermio$(OBJ) sstream$(OBJ) \ sstring$(OBJ) smalloc$(OBJ) stime$(OBJ) SOBJ2 = spathnam$(OBJ) ssystem$(OBJ) sposixsh$(OBJ) sdoscom$(OBJ) \ ssysemu$(OBJ) BOBJ = bprintf$(OBJ) btermio$(OBJ) bstream$(OBJ) \ bstring$(OBJ) bmalloc$(OBJ) \ bpathnam$(OBJ) bsystem$(OBJ) bdoscom$(OBJ) \ bsysemu$(OBJ) NOBJ1 = nprintf$(OBJ) ntermio$(OBJ) nstream$(OBJ) \ nstring$(OBJ) nmalloc$(OBJ) ntime$(OBJ) NOBJ2 = npathnam$(OBJ) nsystem$(OBJ) nposixsh$(OBJ) ndoscom$(OBJ) \ nsysemu$(OBJ) \ nrealpat$(OBJ) nencode$(OBJ) NOBJ3 = nparse$(OBJ) \ nsocket$(OBJ) nurl$(OBJ) nauth$(OBJ) \ nftp$(OBJ) nhtml$(OBJ) nhttp$(OBJ) nurldisk$(OBJ) \ nlsparse$(OBJ) KOBJ = tevalopt$(OBJ) COBJ = tevalopt$(OBJ) tgentbl$(OBJ) UOBJ = tevalopt$(OBJ) tgentbl$(OBJ) TOBJ = tstring$(OBJ) troman$(OBJ) tkconv$(OBJ) tevalopt$(OBJ) tgentbl$(OBJ) ALLOC = DEBUG = CFLAGS = -O HOSTCFLAGS = $(CFLAGS) CPPFLAGS = HOSTCPPFLAGS = $(CPPFLAGS) LDFLAGS = HOSTLDFLAGS = $(LDFLAGS) OSOPTS = -DDOSV COPTS = $(OSOPTS) $(DEBUG) $(CFLAGS) HOSTCOPTS = $(COPTS) FLDFLAGS = -lintlib -ltinymain.obj $(ALLOC) $(LDFLAGS) SLDFLAGS = -lintlib -ltinymain.obj $(ALLOC) $(LDFLAGS) NLDFLAGS = -lintlib -ltinymain.obj $(ALLOC) $(LDFLAGS) BUILDFLAGS = $(COPTS) $(CPPFLAGS) FDCFLAGS = $(BUILDFLAGS) -ml -h -k"-s 3000" -DFD=$(VERMAJ) SHCFLAGS = $(BUILDFLAGS) -mp -h -k"-s 8000" -DFDSH=$(VERMAJ) BSHCFLAGS = $(BUILDFLAGS) -ms -k"-s 8000" -DFDSH=$(VERMAJ) -DMINIMUMSHELL NSHCFLAGS = $(BUILDFLAGS) -mp -h -k"-s 8000" -DFDSH=$(VERMAJ) -DWITHNETWORK DEFCFLAGS = -DDEFRC=\\\"$(DOSRC)\\\" .SUFFIXES: .h .c .obj .exe ############################################################ # Dependency Rules ############################################################ all: $(PROGRAM)$(EXE) $(PROGRAM).$(MANSEC) $(TABLES) $(PROGRAM)$(EXE): $(OBJ1) $(OBJ2) $(OBJ3) $(OBJ4) $(OBJ5) $(OBJ6) $(ARGS) # @sleep 1 $(CC) -ml -h -k"-s 3000" -o $@ @$(ARGS) $(FLDFLAGS) # @ren $@ $(PROGRAM) # @aout2exe $(PROGRAM) # @del $(PROGRAM) $(ARGS): $(OBJ1) $(OBJ2) $(OBJ3) $(OBJ4) $(OBJ5) $(OBJ6) # @sleep 1 @$(ECHO) $(OBJ1) > $(ARGS) @$(ECHO) $(OBJ2) >> $(ARGS) @$(ECHO) $(OBJ3) >> $(ARGS) @$(ECHO) $(OBJ4) >> $(ARGS) @$(ECHO) $(OBJ5) >> $(ARGS) @$(ECHO) $(OBJ6) >> $(ARGS) # @sleep 1 main$(OBJ): main.c $(CC) $(FDCFLAGS) $(DEFCFLAGS) -c -o $@ $*.c termio$(OBJ): termio.c $(CC) $(FDCFLAGS) -c -o $@ $*.c system$(OBJ): system.c $(CC) $(FDCFLAGS) $(DEFCFLAGS) -c -o $@ $*.c custom$(OBJ): custom.c $(CC) $(FDCFLAGS) -c -o $@ $*.c .c.obj: $(CC) $(FDCFLAGS) -c -o $@ $*.c ############################################################ # kanji using module $(PROGRAM).$(MANSEC): kanjicnv$(EXE) $(JMANSRC) .\kanjicnv$(EXE) -s $(JMANSRC) $@ $(PROGRAM).$(MANSEC)c: kanjicnv$(EXE) $(JMANCAT) .\kanjicnv$(EXE) -s $(JMANCAT) $@ $(PROGRAM).eng: kanjicnv$(EXE) $(MANCAT) .\kanjicnv$(EXE) -b $(MANCAT) $@ $(PROGRAM).doc: kanjicnv$(EXE) $(JMANCAT) .\kanjicnv$(EXE) -s -b $(JMANCAT) $@ README.doc: kanjicnv$(EXE) README .\kanjicnv$(EXE) -s README $@ HISTORY.doc: kanjicnv$(EXE) HISTORY .\kanjicnv$(EXE) -s HISTORY $@ FAQ.doc: kanjicnv$(EXE) FAQ .\kanjicnv$(EXE) -s FAQ $@ LICENSES.doc: kanjicnv$(EXE) LICENSES .\kanjicnv$(EXE) -s LICENSES $@ kanjicnv$(EXE): kanjicnv$(OBJ) $(KOBJ) # @sleep 1 $(HOSTCC) $(HOSTCOPTS) $(HOSTLDFLAGS) -o $@ kanjicnv$(OBJ) $(KOBJ) # @ren $@ kanjicnv # @aout2exe kanjicnv # @del kanjicnv # @sleep 1 kanjicnv$(OBJ): kanjicnv.c $(HOSTCC) $(HOSTCOPTS) $(HOSTCPPFLAGS) -c -o $@ $*.c ############################################################ # message catalog module kanji.h: mkkanji$(EXE) kanjicnv$(EXE) kanji.hin .\mkkanji$(EXE) kanji.hin | \ .\kanjicnv$(EXE) -s - $@ # @sleep 1 mkkanji$(EXE): mkkanji$(OBJ) # @sleep 1 $(HOSTCC) $(HOSTCOPTS) $(HOSTLDFLAGS) -o $@ mkkanji$(OBJ) # @ren $@ mkkanji # @aout2exe mkkanji # @del mkkanji # @sleep 1 mkkanji$(OBJ): mkkanji.c $(HOSTCC) $(HOSTCOPTS) $(HOSTCPPFLAGS) -c -o $@ $*.c _fd-cat.ja: mkcat$(EXE) kanji.h .\mkcat$(EXE) -c 1 kanji.h $@ # @sleep 1 _fd-cat.C: mkcat$(EXE) kanji.h .\mkcat$(EXE) -c 2 kanji.h $@ # @sleep 1 fd-cat.ja: mkcat$(EXE) _fd-cat.ja .\mkcat$(EXE) _fd-cat.ja $@ fd-cat.C: mkcat$(EXE) _fd-cat.C .\mkcat$(EXE) _fd-cat.C $@ mkcat$(EXE): mkcat$(OBJ) $(COBJ) # @sleep 1 $(HOSTCC) $(HOSTCOPTS) $(HOSTLDFLAGS) -o $@ mkcat$(OBJ) $(COBJ) # @ren $@ mkcat # @aout2exe mkcat # @del mkcat # @sleep 1 mkcat$(OBJ): mkcat.c $(HOSTCC) $(HOSTCOPTS) $(HOSTCPPFLAGS) -c -o $@ $*.c ############################################################ # function list using module funcno.h: mkfuncno$(EXE) .\mkfuncno$(EXE) $@ # @sleep 1 mkfuncno$(EXE): mkfuncno$(OBJ) # @sleep 1 $(HOSTCC) $(HOSTCOPTS) $(HOSTLDFLAGS) -o $@ mkfuncno$(OBJ) # @ren $@ mkfuncno # @aout2exe mkfuncno # @del mkfuncno # @sleep 1 mkfuncno$(OBJ): mkfuncno.c $(HOSTCC) $(HOSTCOPTS) $(HOSTCPPFLAGS) -DFD=$(VERMAJ) -c -o $@ $*.c ############################################################ # UNICODE table generating module $(UNITBL): mkunitbl$(EXE) .\mkunitbl$(EXE) $@ unitbl.c: mkunitbl$(EXE) .\mkunitbl$(EXE) -t $@ $(DEPDIR)\unitbl.c: mkunitbl$(EXE) [ -d $(DEPDIR) ] || mkdir $(DEPDIR) .\mkunitbl$(EXE) -t -n $@ mkunitbl$(EXE): mkunitbl$(OBJ) $(UOBJ) # @sleep 1 $(HOSTCC) $(HOSTCOPTS) $(HOSTLDFLAGS) -o $@ mkunitbl$(OBJ) $(UOBJ) # @ren $@ mkunitbl # @aout2exe mkunitbl # @del mkunitbl # @sleep 1 mkunitbl$(OBJ): mkunitbl.c $(HOSTCC) $(HOSTCOPTS) $(HOSTCPPFLAGS) -c -o $@ $*.c tunitbl$(OBJ): unitbl.c $(HOSTCC) $(HOSTCOPTS) $(HOSTCPPFLAGS) -c -o $@ unitbl.c ############################################################ # Kanji transfer table generating module $(DICTTBL): mkdict$(EXE) $(DICTSRC) .\mkdict$(EXE) $@ $(DICTSRC) dicttbl.c: mkdict$(EXE) $(DICTSRC) .\mkdict$(EXE) -t $@ $(DICTSRC) $(DEPDIR)\dicttbl.c: mkdict$(EXE) $(DICTSRC) [ -d $(DEPDIR) ] || mkdir $(DEPDIR) .\mkdict$(EXE) -t -n $@ $(DICTSRC) mkdict$(EXE): mkdict$(OBJ) $(TOBJ) # @sleep 1 $(HOSTCC) $(HOSTCOPTS) $(HOSTLDFLAGS) -o $@ mkdict$(OBJ) $(TOBJ) # @ren $@ mkdict # @aout2exe mkdict # @del mkdict # @sleep 1 mktankan$(EXE): mktankan$(OBJ) $(TOBJ) # @sleep 1 $(HOSTCC) $(HOSTCOPTS) $(HOSTLDFLAGS) -o $@ mktankan$(OBJ) $(TOBJ) # @ren $@ mktankan # @aout2exe mktankan # @del mktankan # @sleep 1 mkdict$(OBJ): mkdict.c $(HOSTCC) $(HOSTCOPTS) $(HOSTCPPFLAGS) -c -o $@ $*.c mktankan$(OBJ): mktankan.c $(HOSTCC) $(HOSTCOPTS) $(HOSTCPPFLAGS) -c -o $@ $*.c tstring$(OBJ): string.c $(HOSTCC) $(HOSTCOPTS) $(HOSTCPPFLAGS) -c -o $@ string.c troman$(OBJ): roman.c $(HOSTCC) $(HOSTCOPTS) $(HOSTCPPFLAGS) -c -o $@ roman.c tkconv$(OBJ): kconv.c $(HOSTCC) $(HOSTCOPTS) $(HOSTCPPFLAGS) -c -o $@ kconv.c tevalopt$(OBJ): evalopt.c $(HOSTCC) $(HOSTCOPTS) $(HOSTCPPFLAGS) -c -o $@ evalopt.c tgentbl$(OBJ): gentbl.c $(HOSTCC) $(HOSTCOPTS) $(HOSTCPPFLAGS) -c -o $@ gentbl.c rmdict: -$(RM) $(DICTTBL) $(DICTTXT): mktankan$(EXE) .\mktankan$(EXE) $@ # @sleep 1 ############################################################ # Directory generating module mkdir_p$(EXE): mkdir_p$(OBJ) # @sleep 1 $(HOSTCC) $(HOSTCOPTS) $(HOSTLDFLAGS) -o $@ mkdir_p$(OBJ) # @ren $@ mkdir_p # @aout2exe mkdir_p # @del mkdir_p # @sleep 1 mkdir_p$(OBJ): mkdir_p.c $(HOSTCC) $(HOSTCOPTS) $(HOSTCPPFLAGS) -c -o $@ $*.c ############################################################ # to install all install: install-bin install-runcom install-man install-jman install-bin: $(PROGRAM)$(EXE) mkdir_p$(EXE) install-table [ -d $(BINDIR) ] || .\mkdir_p$(EXE) $(BINDIR) $(INSTALL) $(PROGRAM)$(EXE) $(BINDIR) $(CHMOD) a+rx $(BINDIR)\$(PROGRAM)$(EXE) -$(RM) $(BINDIR)\$(ALIAS)$(EXE) $(LN) $(BINDIR)\$(PROGRAM)$(EXE) $(BINDIR)\$(ALIAS)$(EXE) $(CHMOD) a+rx $(BINDIR)\$(ALIAS)$(EXE) install-runcom: -if [ -f $(RUNCOM) ]; then \ $(INSTALL) $(RUNCOM) $(BLDRC); \ $(CHMOD) a+r-x $(BLDRC); \ fi install-table: $(TABLE) mkdir_p$(EXE) -if [ -f $(UNITBL) ]; then \ [ -d $(BINDIR) ] || .\mkdir_p$(EXE) $(BINDIR); \ $(INSTALL) $(UNITBL) $(BINDIR); \ $(CHMOD) a+r-x $(BINDIR)\$(UNITBL); \ fi -if [ -f $(DICTTBL) ]; then \ [ -d $(BINDIR) ] || .\mkdir_p$(EXE) $(BINDIR); \ $(INSTALL) $(DICTTBL) $(BINDIR); \ $(CHMOD) a+r-x $(BINDIR)\$(DICTTBL); \ fi -if [ -f $(CATTBL) ]; then \ [ -d $(BINDIR) ] || .\mkdir_p$(EXE) $(BINDIR); \ $(INSTALL) $(CATTBL) $(BINDIR); \ $(CHMOD) a+r-x $(BINDIR)\$(CATTBL); \ fi -if [ -f $(ECATTBL) ]; then \ [ -d $(BINDIR) ] || .\mkdir_p$(EXE) $(BINDIR); \ $(INSTALL) $(ECATTBL) $(BINDIR); \ $(CHMOD) a+r-x $(BINDIR)\$(ECATTBL); \ fi install-man: $(MANSRC) mkdir_p$(EXE) [ -d $(MANDIR) ] || .\mkdir_p$(EXE) $(MANDIR) $(INSTALL) $(MANSRC) $(MANDIR)\$(PROGRAM).$(MANSEC) $(CHMOD) a+r-x $(MANDIR)\$(PROGRAM).$(MANSEC) -$(RM) $(MANDIR)\$(ALIAS).$(MANSEC) $(LN) $(MANDIR)\$(PROGRAM).$(MANSEC) $(MANDIR)\$(ALIAS).$(MANSEC) $(CHMOD) a+r-x $(MANDIR)\$(ALIAS).$(MANSEC) install-jman: $(PROGRAM).$(MANSEC) mkdir_p$(EXE) [ -d $(JMANDIR) ] || .\mkdir_p$(EXE) $(JMANDIR) [ "$(JMANDIR)" = "$(MANDIR)" ] || \ $(INSTALL) $(PROGRAM).$(MANSEC) $(JMANDIR)\$(PROGRAM).$(MANSEC) $(CHMOD) a+r-x $(JMANDIR)\$(PROGRAM).$(MANSEC) -$(RM) $(JMANDIR)\$(ALIAS).$(MANSEC) $(LN) $(JMANDIR)\$(PROGRAM).$(MANSEC) $(JMANDIR)\$(ALIAS).$(MANSEC) $(CHMOD) a+r-x $(JMANDIR)\$(ALIAS).$(MANSEC) catman: $(MANCAT) mkdir_p$(EXE) [ -d $(CATDIR) ] || .\mkdir_p$(EXE) $(CATDIR) $(INSTALL) $(MANCAT) $(CATDIR)\$(PROGRAM).$(MANSEC) $(CHMOD) a+r-x $(CATDIR)\$(PROGRAM).$(MANSEC) -$(RM) $(CATDIR)\$(ALIAS).$(MANSEC) $(LN) $(CATDIR)\$(PROGRAM).$(MANSEC) $(CATDIR)\$(ALIAS).$(MANSEC) $(CHMOD) a+r-x $(CATDIR)\$(ALIAS).$(MANSEC) catman-b: $(PROGRAM).eng mkdir_p$(EXE) [ -d $(CATDIR) ] || .\mkdir_p$(EXE) $(CATDIR) $(INSTALL) $(PROGRAM).eng $(CATDIR)\$(PROGRAM).$(MANSEC) $(CHMOD) a+r-x $(CATDIR)\$(PROGRAM).$(MANSEC) -$(RM) $(CATDIR)\$(ALIAS).$(MANSEC) $(LN) $(CATDIR)\$(PROGRAM).$(MANSEC) $(CATDIR)\$(ALIAS).$(MANSEC) $(CHMOD) a+r-x $(CATDIR)\$(ALIAS).$(MANSEC) compman: catman -$(RM) $(CATDIR)\$(ALIAS).$(MANSEC) compress -f $(CATDIR)\$(PROGRAM).$(MANSEC) -$(RM) $(CATDIR)\$(ALIAS).$(MANSEC).Z $(LN) $(CATDIR)\$(PROGRAM).$(MANSEC).Z $(CATDIR)\$(ALIAS).$(MANSEC).Z compman-b: catman-b -$(RM) $(CATDIR)\$(ALIAS).$(MANSEC) compress -f $(CATDIR)\$(PROGRAM).$(MANSEC) -$(RM) $(CATDIR)\$(ALIAS).$(MANSEC).Z $(LN) $(CATDIR)\$(PROGRAM).$(MANSEC).Z $(CATDIR)\$(ALIAS).$(MANSEC).Z jcatman: catman $(PROGRAM).$(MANSEC)c mkdir_p$(EXE) [ -d $(JCATDIR) ] || .\mkdir_p$(EXE) $(JCATDIR) $(INSTALL) $(PROGRAM).$(MANSEC)c $(JCATDIR)\$(PROGRAM).$(MANSEC) $(CHMOD) a+r-x $(JCATDIR)\$(PROGRAM).$(MANSEC) -$(RM) $(JCATDIR)\$(ALIAS).$(MANSEC) $(LN) $(JCATDIR)\$(PROGRAM).$(MANSEC) $(JCATDIR)\$(ALIAS).$(MANSEC) $(CHMOD) a+r-x $(JCATDIR)\$(ALIAS).$(MANSEC) jcatman-b: catman-b $(PROGRAM).doc mkdir_p$(EXE) [ -d $(JCATDIR) ] || .\mkdir_p$(EXE) $(JCATDIR) $(INSTALL) $(PROGRAM).doc $(JCATDIR)\$(PROGRAM).$(MANSEC) $(CHMOD) a+r-x $(JCATDIR)\$(PROGRAM).$(MANSEC) -$(RM) $(JCATDIR)\$(ALIAS).$(MANSEC) $(LN) $(JCATDIR)\$(PROGRAM).$(MANSEC) $(JCATDIR)\$(ALIAS).$(MANSEC) $(CHMOD) a+r-x $(JCATDIR)\$(ALIAS).$(MANSEC) jcompman: compman jcatman -$(RM) $(JCATDIR)\$(ALIAS).$(MANSEC) compress -f $(JCATDIR)\$(PROGRAM).$(MANSEC) -$(RM) $(JCATDIR)\$(ALIAS).$(MANSEC).Z $(LN) $(JCATDIR)\$(PROGRAM).$(MANSEC).Z $(JCATDIR)\$(ALIAS).$(MANSEC).Z jcompman-b: compman-b jcatman-b -$(RM) $(JCATDIR)\$(ALIAS).$(MANSEC) compress -f $(JCATDIR)\$(PROGRAM).$(MANSEC) -$(RM) $(JCATDIR)\$(ALIAS).$(MANSEC).Z $(LN) $(JCATDIR)\$(PROGRAM).$(MANSEC).Z $(JCATDIR)\$(ALIAS).$(MANSEC).Z ############################################################ # to make dependency depend: $(SRC) $(HSRC) $(DSRC) config.h kanji.h funcno.h [ -d $(DEPDIR) ] || mkdir $(DEPDIR) for f in $(SRC) $(HSRC); do \ $(SED) -e 's:^\(# *\)include "\(.*\).h":\1include "_\2.h":' \ $${f} > $(DEPDIR)\$${f}; \ done for f in $(DSRC); do \ $(SED) -e 's:^\(# *\)include "\(.*\).h":\1include "_\2.h":' \ $${f} > $${f}o; \ $(MV) $${f}o $${f}; \ done for f in $(SSRC); do \ $(RM) $(DEPDIR)\s$${f}; \ $(LN) $(DEPDIR)\$${f} $(DEPDIR)\s$${f}; \ done for f in $(BSRC); do \ $(RM) $(DEPDIR)\b$${f} && \ $(LN) $(DEPDIR)\$${f} $(DEPDIR)\b$${f}; \ done for f in $(NSRC); do \ $(RM) $(DEPDIR)\n$${f} && \ $(LN) $(DEPDIR)\$${f} $(DEPDIR)\n$${f}; \ done for f in $(TSRC); do \ $(RM) $(DEPDIR)\t$${f} && \ $(LN) $(DEPDIR)\$${f} $(DEPDIR)\t$${f}; \ done for f in $(HEADER) config.h kanji.h funcno.h version.h; do \ $(SED) -e 's:^\(# *\)include "\(.*\).h":\1include "_\2.h":' \ $${f} > $(DEPDIR)\_$${f}; \ done $(CP) Makefile.in Makefile.tmp $(DEPDIR) $(CP) Makefile.tmp $(DEPDIR)\Makefile.sh $(CP) Makefile.tmp $(DEPDIR)\Makefile.bsh $(CP) Makefile.tmp $(DEPDIR)\Makefile.nsh $(CP) Makefile.tmp $(DEPDIR)\Makefile.tr cd $(DEPDIR); makedepend \ -s "# DO NOT DELETE THIS LINE -- make depend depends on it." \ -f Makefile.tmp -- $(FDCFLAGS) -- \ $(SRC) \ `for f in $(DSRC); do $(ECHO) $${f}|$(SED) -e 's:^.*\::'; done` cd $(DEPDIR); makedepend \ -s "# DO NOT DELETE THIS LINE -- make depend depends on it." \ -f Makefile.sh -- $(SHCFLAGS) -- \ `for f in $(SSRC); do $(ECHO) s$${f}; done` cd $(DEPDIR); makedepend \ -s "# DO NOT DELETE THIS LINE -- make depend depends on it." \ -f Makefile.bsh -- $(BSHCFLAGS) -- \ `for f in $(BSRC); do $(ECHO) b$${f}; done` cd $(DEPDIR); makedepend \ -s "# DO NOT DELETE THIS LINE -- make depend depends on it." \ -f Makefile.nsh -- $(NSHCFLAGS) -- \ `for f in $(NSRC); do $(ECHO) n$${f}; done` cd $(DEPDIR); makedepend \ -s "# DO NOT DELETE THIS LINE -- make depend depends on it." \ -f Makefile.tr -- $(HOSTCOPTS) -- \ $(HSRC) \ `for f in $(TSRC); do $(ECHO) t$${f}; done` $(SED) -e '\^# DO NOT DELETE THIS LINE\,$$d' $(DEPDIR)\Makefile.in \ > Makefile.in $(ECHO) "# DO NOT DELETE THIS LINE -- make depend depends on it." \ >> Makefile.in $(SED) -e '1,\^# DO NOT DELETE THIS LINE\d' \ -e 's:^\(........\).*\.o:\1.o:' \ -e 's:\\[^ ]* *::g' \ -e 's:\.o:\$$(OBJ):g' \ -e 's:_\([^ ]*.h\):\1:g' \ -e 's: *$$::' \ -e '\: *$$\d' $(DEPDIR)\Makefile.tmp >> Makefile.in $(SED) -e '1,\^# DO NOT DELETE THIS LINE\d' \ -e 's:^\(........\).*\.o:\1.o:' \ -e 's:\\[^ ]* *::g' \ -e 's:\.o:\$$(OBJ):g' \ -e 's:_\([^ ]*.h\):\1:g' \ -e 's: *$$::' \ -e '\: *$$\d' $(DEPDIR)\Makefile.sh >> Makefile.in $(SED) -e '1,\^# DO NOT DELETE THIS LINE\d' \ -e 's:^\(........\).*\.o:\1.o:' \ -e 's:\\[^ ]* *::g' \ -e 's:\.o:\$$(OBJ):g' \ -e 's:_\([^ ]*.h\):\1:g' \ -e 's: *$$::' \ -e '\: *$$\d' $(DEPDIR)\Makefile.bsh >> Makefile.in $(SED) -e '1,\^# DO NOT DELETE THIS LINE\d' \ -e 's:^\(........\).*\.o:\1.o:' \ -e 's:\\[^ ]* *::g' \ -e 's:\.o:\$$(OBJ):g' \ -e 's:_\([^ ]*.h\):\1:g' \ -e 's: *$$::' \ -e '\: *$$\d' $(DEPDIR)\Makefile.nsh >> Makefile.in $(SED) -e '1,\^# DO NOT DELETE THIS LINE\d' \ -e 's:^\(........\).*\.o:\1.o:' \ -e 's:\\[^ ]* *::g' \ -e 's:\.o:\$$(OBJ):g' \ -e 's:_\([^ ]*.h\):\1:g' \ -e 's: *$$::' \ -e '\: *$$\d' $(DEPDIR)\Makefile.tr >> Makefile.in -rm -rf $(DEPDIR) ############################################################ # to verify sources lint: $(SRC) $(HSRC) config.h kanji.h funcno.h $(LINT) $(OSOPTS) -DFD=$(VERMAJ) `$(SED) -e "s:\$(OBJ):\.c:g" $(ARGS)` SRCS=`$(ECHO) $(UOBJ)|$(SED) -e "s:t\([^ ]*\)\$(OBJ):\1\.c:g"`; \ $(LINT) $(OSOPTS) mkunitbl.c $${SRCS} SRCS=`$(ECHO) $(TOBJ)|$(SED) -e "s:t\([^ ]*\)\$(OBJ):\1\.c:g"`; \ $(LINT) $(OSOPTS) mkdict.c $${SRCS}; \ $(LINT) $(OSOPTS) mktankan.c $${SRCS} $(LINT) $(OSOPTS) mkkanji.c SRCS=`$(ECHO) $(COBJ)|$(SED) -e "s:t\([^ ]*\)\$(OBJ):\1\.c:g"`; \ $(LINT) $(OSOPTS) mkcat.c $${SRCS} $(LINT) $(OSOPTS) mkdir_p.c SRCS=`$(ECHO) $(KOBJ)|$(SED) -e "s:t\([^ ]*\)\$(OBJ):\1\.c:g"`; \ $(LINT) $(OSOPTS) kanjicnv.c $${SRCS} $(LINT) $(OSOPTS) expfunc.c $(LINT) $(OSOPTS) mkfuncno.c ############################################################ # to make configuration file manually config: Configur expfunc.c -if ($(ECHO) 't() { echo $1; }; t test' | $(SHELL) >\dev\null 2>&1); then \ $(SED) -e "2,3d" -e "s:__cc__:lcc86:" Configur \ | $(SHELL) > config.h; \ elif $(MAKE) -f Makefile.tmp expfunc$(EXE); then \ $(SED) -e "2,3d" -e "s:__cc__:lcc86:" Configur \ | .\expfunc$(EXE) | $(SHELL) > config.h; \ fi # @sleep 1 config.h: config.hin $(CP) config.hin $@ # @sleep 1 expfunc$(EXE): expfunc$(OBJ) # @sleep 1 $(HOSTCC) $(HOSTCOPTS) $(HOSTLDFLAGS) -o $@ expfunc$(OBJ) # @ren $@ expfunc # @aout2exe expfunc # @del expfunc # @sleep 1 expfunc$(OBJ): expfunc.c $(HOSTCC) $(HOSTCOPTS) $(HOSTCPPFLAGS) -c -o $@ $*.c ############################################################ # sample program for pseudo system(3) sh: fdsh$(EXE) fdsh$(EXE): $(SOBJ1) $(SOBJ2) $(SARGS) # @sleep 1 $(CC) -mp -h -k"-s 8000" -o $@ @$(SARGS) $(SLDFLAGS) # @ren $@ fdsh # @aout2exe fdsh # @del fdsh $(SARGS): $(SOBJ1) $(SOBJ2) # @sleep 1 @$(ECHO) $(SOBJ1) > $(SARGS) @$(ECHO) $(SOBJ2) >> $(SARGS) # @sleep 1 sprintf$(OBJ): printf.c $(CC) $(SHCFLAGS) -c -o $@ printf.c stermio$(OBJ): termio.c $(CC) $(SHCFLAGS) -c -o $@ termio.c sstream$(OBJ): stream.c $(CC) $(SHCFLAGS) -c -o $@ stream.c sstring$(OBJ): string.c $(CC) $(SHCFLAGS) -c -o $@ string.c smalloc$(OBJ): malloc.c $(CC) $(SHCFLAGS) -c -o $@ malloc.c stime$(OBJ): time.c $(CC) $(SHCFLAGS) -c -o $@ time.c spathnam$(OBJ): pathname.c $(CC) $(SHCFLAGS) -c -o $@ pathname.c ssystem$(OBJ): system.c $(CC) $(SHCFLAGS) -c -o $@ system.c sposixsh$(OBJ): posixsh.c $(CC) $(SHCFLAGS) -c -o $@ posixsh.c sdoscom$(OBJ): doscom.c $(CC) $(SHCFLAGS) -c -o $@ doscom.c ssysemu$(OBJ): sysemu.c $(CC) $(SHCFLAGS) -c -o $@ sysemu.c ############################################################ # Bourne shell bsh: fdbsh$(EXE) fdbsh$(EXE): $(BOBJ) # @sleep 1 $(CC) -ms -k"-s 8000" -o $@ $(BOBJ) $(SLDFLAGS) # @ren $@ fdbsh # @aout2exe fdbsh # @del fdbsh bprintf$(OBJ): printf.c $(CC) $(BSHCFLAGS) -c -o $@ printf.c btermio$(OBJ): termio.c $(CC) $(BSHCFLAGS) -c -o $@ termio.c bstream$(OBJ): stream.c $(CC) $(BSHCFLAGS) -c -o $@ stream.c bstring$(OBJ): string.c $(CC) $(BSHCFLAGS) -c -o $@ string.c bmalloc$(OBJ): malloc.c $(CC) $(BSHCFLAGS) -c -o $@ malloc.c bpathnam$(OBJ): pathname.c $(CC) $(BSHCFLAGS) -c -o $@ pathname.c bsystem$(OBJ): system.c $(CC) $(BSHCFLAGS) -c -o $@ system.c bdoscom$(OBJ): doscom.c $(CC) $(BSHCFLAGS) -c -o $@ doscom.c bsysemu$(OBJ): sysemu.c $(CC) $(BSHCFLAGS) -c -o $@ sysemu.c ############################################################ # Network shell nsh: fdnsh$(EXE) fdnsh$(EXE): $(NOBJ1) $(NOBJ2) $(NOBJ3) $(NARGS) # @sleep 1 $(CC) -mp -h -k"-s 8000" -o $@ @$(NARGS) $(NLDFLAGS) # @ren $@ fdnsh # @aout2exe fdnsh # @del fdnsh $(NARGS): $(NOBJ1) $(NOBJ2) $(NOBJ3) # @sleep 1 @$(ECHO) $(NOBJ1) > $(NARGS) @$(ECHO) $(NOBJ2) >> $(NARGS) @$(ECHO) $(NOBJ3) >> $(NARGS) # @sleep 1 nprintf$(OBJ): printf.c $(CC) $(NSHCFLAGS) -c -o $@ printf.c ntermio$(OBJ): termio.c $(CC) $(NSHCFLAGS) -c -o $@ termio.c nstream$(OBJ): stream.c $(CC) $(NSHCFLAGS) -c -o $@ stream.c nstring$(OBJ): string.c $(CC) $(NSHCFLAGS) -c -o $@ string.c nmalloc$(OBJ): malloc.c $(CC) $(NSHCFLAGS) -c -o $@ malloc.c ntime$(OBJ): time.c $(CC) $(NSHCFLAGS) -c -o $@ time.c npathnam$(OBJ): pathname.c $(CC) $(NSHCFLAGS) -c -o $@ pathname.c nsystem$(OBJ): system.c $(CC) $(NSHCFLAGS) -c -o $@ system.c nposixsh$(OBJ): posixsh.c $(CC) $(NSHCFLAGS) -c -o $@ posixsh.c ndoscom$(OBJ): doscom.c $(CC) $(NSHCFLAGS) -c -o $@ doscom.c nsysemu$(OBJ): sysemu.c $(CC) $(NSHCFLAGS) -c -o $@ sysemu.c nrealpat$(OBJ): realpath.c $(CC) $(NSHCFLAGS) -c -o $@ realpath.c nencode$(OBJ): encode.c $(CC) $(NSHCFLAGS) -c -o $@ encode.c nparse$(OBJ): parse.c $(CC) $(NSHCFLAGS) -c -o $@ parse.c nsocket$(OBJ): socket.c $(CC) $(NSHCFLAGS) -c -o $@ socket.c nurl$(OBJ): url.c $(CC) $(NSHCFLAGS) -c -o $@ url.c nauth$(OBJ): auth.c $(CC) $(NSHCFLAGS) -c -o $@ auth.c nftp$(OBJ): ftp.c $(CC) $(NSHCFLAGS) -c -o $@ ftp.c nhtml$(OBJ): html.c $(CC) $(NSHCFLAGS) -c -o $@ html.c nhttp$(OBJ): http.c $(CC) $(NSHCFLAGS) -c -o $@ http.c nurldisk$(OBJ): urldisk.c $(CC) $(NSHCFLAGS) -c -o $@ urldisk.c nlsparse$(OBJ): lsparse.c $(CC) $(NSHCFLAGS) -c -o $@ lsparse.c ############################################################ # for programer's maintenance tar: $(SOURCES) $(TAR) cvf $(TITLE)$(VERSION).tar $(SOURCES) compress -f $(TITLE)$(VERSION).tar gtar: $(SOURCES) $(TAR) cvf $(TITLE)$(VERSION).tar $(SOURCES) gzip -f $(TITLE)$(VERSION).tar shtar: $(SHSOURCES) (VER=`date '+%y%m%d'`; \ $(TAR) cvf $(TITLE)sh-$${VER}.tar $(SHSOURCES); \ gzip -f $(TITLE)sh-$${VER}.tar) lzh: $(SOURCES) -$(RM) $(TITLE)$(VERSION).lzh $(LHA) a $(TITLE)$(VERSION).lzh $(SOURCES) shar: $(SOURCES) -$(RM) $(TITLE)$(VERSION).shar.[0-9][0-9] $(SHAR) -L50 -apc -n $(TITLE)$(VERSION) -o $(TITLE)$(VERSION).shar \ -T $(SRCS) -C $(JSRCS) ipk: $(PROGRAM)$(EXE) $(TABLES) mkdir_p$(EXE) -[ -d $(IPKWDIR)\$(BINDIR) ] || .\mkdir_p$(EXE) $(IPKWDIR)\$(BINDIR) -[ -d $(IPKWDIR)\$(BINDIR) ] || .\mkdir_p$(EXE) $(IPKWDIR)\$(BINDIR) -[ -d $(IPKWDIR)\$(BINDIR) ] || .\mkdir_p$(EXE) $(IPKWDIR)\$(BINDIR) -[ -d $(IPKWDIR)\$(CONFDIR) ] || .\mkdir_p$(EXE) $(IPKWDIR)\$(CONFDIR) -[ -d $(IPKWDIR)\CONTROL ] || .\mkdir_p$(EXE) $(IPKWDIR)\CONTROL -[ -d $(IPKTDIR) ] || .\mkdir_p$(EXE) $(IPKTDIR) $(CP) -p $(PROGRAM)$(EXE) $(IPKWDIR)\$(BINDIR) -[ -z "$(STRIP)" ] || $(STRIP) $(IPKWDIR)\$(BINDIR)\$(PROGRAM)$(EXE) $(CHMOD) a+rx $(IPKWDIR)\$(BINDIR)\$(PROGRAM)$(EXE) -$(RM) $(IPKWDIR)\$(BINDIR)\$(ALIAS)$(EXE) $(LN) $(IPKWDIR)\$(BINDIR)\$(PROGRAM)$(EXE) \ $(IPKWDIR)\$(BINDIR)\$(ALIAS)$(EXE) $(CHMOD) a+rx $(IPKWDIR)\$(BINDIR)\$(ALIAS)$(EXE) $(SED) -e 's:#TMPDIR=.*:TMPDIR=\home\tmp:' \ -e 's:#LANGUAGE=.*:LANGUAGE=euc:' \ -e 's:#INPUTKCODE=.*:INPUTKCODE=euc:' \ -e 's:#FNAMEKCODE=.*:FNAMEKCODE=utf8:' \ -e '\# launcher definition\,\^$$\ {' \ -e '\^$$\ {' \ -e 'i \' \ -e 'launch ".tar.Z" "gzip -cd %C|tar tvf -" "%a %u\%g %s %y-%m-%d %t %*f"' \ -e 'i \' \ -e 'launch ".taZ" "gzip -cd %C|tar tvf -" "%a %u\%g %s %y-%m-%d %t %*f"' \ -e 'i \' \ -e 'launch ".ipk" "gzip -cd %C|tar xOf - .\data.tar.gz|gzip -cd|tar tvf -" \\' \ -e 'i \' \ -e ' "%a %u\%g %s %y-%m-%d %t %*f"' \ -e 'i \' \ -e 'launch ".deb" "ar -p %C data.tar.gz|gzip -cd|tar tvf -" \\' \ -e 'i \' \ -e ' "%a %u\%g %s %y-%m-%d %t %*f"' \ -e '}' \ -e '}' \ -e '\# archiver definition\,\^$$\ {' \ -e '\^$$\ {' \ -e 'i \' \ -e 'arch ".tar.Z" "echo ERROR; false" "gzip -cd %C|tar xf - %TA"' \ -e 'i \' \ -e 'arch ".taZ" "echo ERROR; false" "gzip -cd %C|tar xf - %TA"' \ -e 'i \' \ -e 'arch ".ipk" "echo ERROR; false" \\' \ -e 'i \' \ -e ' "gzip -cd %C|tar xOf - .\data.tar.gz|gzip -cd|tar xf - %TA"' \ -e 'i \' \ -e 'arch ".deb" "echo ERROR; false" \\' \ -e 'i \' \ -e ' "ar -p %C data.tar.gz|gzip -cd|tar xf - %TA"' \ -e '}' \ -e '}' \ -e '$$ {' \ -e 'a \' \ -e 'if [ " $$TERM" = " vt100" -a " $$CONSOLE" = " \dev\console" ]; then' \ -e 'a \' \ -e ' keymap BS "^?"' \ -e 'a \' \ -e ' keymap DEL "\\033[3~"' \ -e 'a \' \ -e ' keymap HOME "\\033[H"' \ -e 'a \' \ -e ' keymap END "\\033[F"' \ -e 'a \' \ -e 'fi' \ -e '}' \ _fdrc > $(IPKWDIR)\$(BLDRC) $(CHMOD) a+r-x $(IPKWDIR)\$(BLDRC) -if [ -f $(UNITBL) ]; then \ cp -p $(UNITBL) $(IPKWDIR)\$(BINDIR); \ $(CHMOD) a+r-x $(IPKWDIR)\$(BINDIR)\$(UNITBL); \ fi -if [ -f $(DICTTBL) ]; then \ cp -p $(DICTTBL) $(IPKWDIR)\$(BINDIR); \ $(CHMOD) a+r-x $(IPKWDIR)\$(BINDIR)\$(DICTTBL); \ fi -if [ -f $(CATTBL) ]; then \ cp -p $(CATTBL) $(IPKWDIR)\$(BINDIR); \ $(CHMOD) a+r-x $(IPKWDIR)\$(BINDIR)\$(CATTBL); \ fi -if [ -f $(ECATTBL) ]; then \ cp -p $(ECATTBL) $(IPKWDIR)\$(BINDIR); \ $(CHMOD) a+r-x $(IPKWDIR)\$(BINDIR)\$(ECATTBL); \ fi $(ECHO) "Package: fd" > $(IPKWDIR)\CONTROL\control $(ECHO) "Priority: optional" >> $(IPKWDIR)\CONTROL\control $(ECHO) "Section: extras" >> $(IPKWDIR)\CONTROL\control $(ECHO) "Maintainer: $(DIST)" >> $(IPKWDIR)\CONTROL\control $(ECHO) "Architecture: arm" >> $(IPKWDIR)\CONTROL\control $(ECHO) "Version: $(VERSION)-1" >> $(IPKWDIR)\CONTROL\control $(ECHO) "Depends: ncurses" >> $(IPKWDIR)\CONTROL\control $(ECHO) "Description: a file & directory maintenance tool." \ >> $(IPKWDIR)\CONTROL\control (cd $(IPKWDIR); tar cf ..\data.tar --exclude=CONTROL .) (cd $(IPKWDIR)\CONTROL; tar cf ..\..\control.tar .) gzip .\data.tar $(MV) .\data.tar.gz $(IPKTDIR) gzip .\control.tar $(MV) .\control.tar.gz $(IPKTDIR) $(ECHO) "2.0" > $(IPKTDIR)\debian-binary (cd $(IPKTDIR); \ tar cf ..\ipk.tar .\debian-binary .\data.tar.gz .\control.tar.gz) gzip .\ipk.tar $(MV) .\ipk.tar.gz .\fd_$(VERSION)-1_arm.ipk -$(RM) -r $(IPKWDIR) $(IPKTDIR) clean: -$(RM) core -$(RM) *$(OBJ) -$(RM) funcno.h -$(RM) kanji.h -$(RM) _fd-cat.ja -$(RM) _fd-cat.C -$(RM) fd-cat.* -$(RM) kanjicnv$(EXE) -$(RM) expfunc$(EXE) -$(RM) mkdir_p$(EXE) -$(RM) mkfuncno$(EXE) -$(RM) mkunitbl$(EXE) -$(RM) mkdict$(EXE) -$(RM) mktankan$(EXE) -$(RM) mkkanji$(EXE) -$(RM) mkcat$(EXE) -$(RM) fdsh$(EXE) -$(RM) fdbsh$(EXE) -$(RM) fdnsh$(EXE) -$(RM) $(PROGRAM)$(EXE) -$(RM) $(PROGRAM).$(MANSEC) -$(RM) $(PROGRAM).$(MANSEC)c -$(RM) $(PROGRAM).eng -$(RM) $(PROGRAM).doc -$(RM) $(ARGS) -$(RM) $(SARGS) -$(RM) $(NARGS) -$(RM) $(UNITBL) -$(RM) unitbl.c -$(RM) dicttbl.c -$(RM) $(DICTTXT) -$(RM) $(DICTTBL) # DO NOT DELETE THIS LINE -- make depend depends on it. main$(OBJ): fd.h headers.h machine.h config.h main$(OBJ): depend.h printf.h main$(OBJ): stream.h kctype.h main$(OBJ): string.h malloc.h time.h log.h termio.h main$(OBJ): realpath.h main$(OBJ): parse.h kconv.h func.h sysemu.h dirent.h unixemu.h main$(OBJ): pathname.h main$(OBJ): typesize.h term.h types.h lsparse.h namelist.h dosdisk.h main$(OBJ): kanji.h catalog.h version.h system.h wait.h main$(OBJ): termemu.h roman.h urldisk.h url.h auth.h printf$(OBJ): headers.h machine.h config.h printf$(OBJ): depend.h printf.h stream.h kctype.h printf$(OBJ): typesize.h string.h printf$(OBJ): kconv.h termio$(OBJ): headers.h machine.h config.h termio$(OBJ): depend.h typesize.h sysemu.h dirent.h termio$(OBJ): unixemu.h termio$(OBJ): stream.h termio.h term$(OBJ): headers.h machine.h config.h term$(OBJ): depend.h printf.h term$(OBJ): stream.h kctype.h term$(OBJ): typesize.h string.h termio.h term$(OBJ): term.h stream$(OBJ): headers.h machine.h config.h stream$(OBJ): depend.h typesize.h malloc.h sysemu.h stream$(OBJ): dirent.h unixemu.h stream$(OBJ): stream.h pathname.h termio.h stream$(OBJ): socket.h string$(OBJ): headers.h machine.h config.h string$(OBJ): kctype.h depend.h string$(OBJ): string.h malloc$(OBJ): headers.h machine.h config.h malloc$(OBJ): printf.h stream.h depend.h malloc.h malloc$(OBJ): sysemu.h dirent.h unixemu.h time$(OBJ): headers.h machine.h config.h time$(OBJ): typesize.h time$(OBJ): string.h time.h pathname$(OBJ): fd.h headers.h machine.h config.h pathname$(OBJ): depend.h printf.h stream.h kctype.h pathname$(OBJ): string.h malloc.h pathname$(OBJ): dirent.h unixemu.h pathname$(OBJ): sysemu.h pathname.h typesize.h pathname$(OBJ): url.h system$(OBJ): fd.h headers.h machine.h config.h system$(OBJ): depend.h printf.h stream.h kctype.h system$(OBJ): string.h malloc.h system$(OBJ): term.h types.h typesize.h lsparse.h namelist.h kconv.h system$(OBJ): dirent.h unixemu.h system$(OBJ): sysemu.h system.h pathname.h termio.h system$(OBJ): wait.h system$(OBJ): termemu.h posixsh.h socket.h url.h system$(OBJ): urldisk.h auth.h posixsh$(OBJ): fd.h headers.h machine.h config.h posixsh$(OBJ): depend.h printf.h stream.h kctype.h posixsh$(OBJ): string.h malloc.h posixsh$(OBJ): sysemu.h dirent.h unixemu.h posixsh$(OBJ): system.h pathname.h typesize.h posixsh$(OBJ): termio.h posixsh$(OBJ): wait.h posixsh$(OBJ): termemu.h time.h posixsh.h term.h doscom$(OBJ): fd.h headers.h machine.h config.h doscom$(OBJ): depend.h printf.h stream.h kctype.h doscom$(OBJ): string.h malloc.h doscom$(OBJ): term.h types.h typesize.h lsparse.h namelist.h dirent.h doscom$(OBJ): unixemu.h doscom$(OBJ): sysemu.h system.h pathname.h termio.h doscom$(OBJ): wait.h doscom$(OBJ): realpath.h urldisk.h url.h auth.h log$(OBJ): fd.h headers.h machine.h config.h log$(OBJ): depend.h printf.h log$(OBJ): stream.h kctype.h log$(OBJ): string.h malloc.h func.h sysemu.h dirent.h unixemu.h log$(OBJ): pathname.h log$(OBJ): typesize.h term.h types.h lsparse.h namelist.h dosdisk.h sysemu$(OBJ): fd.h headers.h machine.h config.h sysemu$(OBJ): depend.h printf.h stream.h kctype.h sysemu$(OBJ): string.h malloc.h sysemu$(OBJ): kconv.h sysemu.h dirent.h unixemu.h sysemu$(OBJ): log.h pathname.h typesize.h termio.h sysemu$(OBJ): realpath.h dosdisk.h socket.h sysemu$(OBJ): urldisk.h namelist.h url.h auth.h dosdisk$(OBJ): headers.h machine.h config.h dosdisk$(OBJ): depend.h kctype.h dosdisk$(OBJ): string.h time.h sysemu.h dirent.h dosdisk$(OBJ): unixemu.h dosdisk$(OBJ): stream.h pathname.h typesize.h dosdisk.h unixdisk.h kconv.h unixdisk$(OBJ): headers.h machine.h config.h unixdisk$(OBJ): depend.h kctype.h unixdisk$(OBJ): string.h sysemu.h dirent.h unixemu.h unixdisk$(OBJ): stream.h unixdisk$(OBJ): pathname.h typesize.h dosdisk.h unixdisk.h realpath$(OBJ): fd.h headers.h machine.h config.h realpath$(OBJ): depend.h printf.h stream.h kctype.h realpath$(OBJ): string.h malloc.h realpath$(OBJ): sysemu.h dirent.h unixemu.h realpath$(OBJ): pathname.h typesize.h realpath.h realpath$(OBJ): url.h encode$(OBJ): headers.h machine.h config.h encode$(OBJ): kctype.h depend.h encode$(OBJ): sysemu.h dirent.h unixemu.h encode$(OBJ): stream.h encode$(OBJ): pathname.h typesize.h encode.h libc$(OBJ): fd.h headers.h machine.h config.h libc$(OBJ): depend.h printf.h libc$(OBJ): stream.h kctype.h libc$(OBJ): string.h malloc.h log.h realpath.h parse.h kconv.h func.h libc$(OBJ): sysemu.h dirent.h unixemu.h libc$(OBJ): pathname.h typesize.h term.h types.h libc$(OBJ): lsparse.h namelist.h dosdisk.h kanji.h catalog.h system.h libc$(OBJ): termio.h libc$(OBJ): wait.h libc$(OBJ): termemu.h url.h file$(OBJ): fd.h headers.h machine.h config.h file$(OBJ): depend.h printf.h file$(OBJ): stream.h kctype.h file$(OBJ): string.h malloc.h time.h termio.h file$(OBJ): realpath.h file$(OBJ): kconv.h func.h sysemu.h dirent.h unixemu.h file$(OBJ): pathname.h typesize.h term.h types.h file$(OBJ): lsparse.h namelist.h dosdisk.h kanji.h catalog.h urldisk.h file$(OBJ): url.h auth.h mntinfo$(OBJ): headers.h machine.h config.h mntinfo$(OBJ): kctype.h depend.h mntinfo$(OBJ): string.h malloc.h pathname.h mntinfo$(OBJ): typesize.h mntinfo.h fsinfo.h statfs$(OBJ): headers.h machine.h config.h statfs$(OBJ): fsinfo.h apply$(OBJ): fd.h headers.h machine.h config.h apply$(OBJ): depend.h printf.h stream.h kctype.h apply$(OBJ): string.h malloc.h apply$(OBJ): time.h realpath.h parse.h func.h sysemu.h dirent.h unixemu.h apply$(OBJ): pathname.h apply$(OBJ): typesize.h term.h types.h lsparse.h namelist.h dosdisk.h apply$(OBJ): kanji.h catalog.h pty$(OBJ): fd.h headers.h machine.h config.h pty$(OBJ): depend.h printf.h pty$(OBJ): stream.h kctype.h pty$(OBJ): string.h malloc.h sysemu.h dirent.h unixemu.h pty$(OBJ): pathname.h pty$(OBJ): typesize.h termio.h termemu$(OBJ): fd.h headers.h machine.h config.h termemu$(OBJ): depend.h printf.h stream.h kctype.h termemu$(OBJ): string.h malloc.h termemu$(OBJ): wait.h unixemu.h termio.h termemu$(OBJ): func.h sysemu.h dirent.h termemu$(OBJ): pathname.h termemu$(OBJ): typesize.h term.h types.h lsparse.h namelist.h dosdisk.h termemu$(OBJ): kanji.h catalog.h system.h termemu.h frontend$(OBJ): fd.h headers.h machine.h config.h frontend$(OBJ): depend.h printf.h stream.h kctype.h frontend$(OBJ): string.h malloc.h frontend$(OBJ): wait.h unixemu.h parse.h func.h frontend$(OBJ): sysemu.h dirent.h frontend$(OBJ): pathname.h typesize.h term.h frontend$(OBJ): types.h lsparse.h namelist.h dosdisk.h funcno.h kanji.h frontend$(OBJ): catalog.h system.h termio.h frontend$(OBJ): termemu.h frontend$(OBJ): roman.h backend$(OBJ): fd.h headers.h machine.h config.h backend$(OBJ): depend.h printf.h stream.h kctype.h backend$(OBJ): string.h malloc.h backend$(OBJ): termio.h backend$(OBJ): kconv.h func.h sysemu.h backend$(OBJ): dirent.h unixemu.h backend$(OBJ): pathname.h typesize.h term.h types.h backend$(OBJ): lsparse.h namelist.h dosdisk.h system.h wait.h backend$(OBJ): termemu.h parse$(OBJ): fd.h headers.h machine.h config.h parse$(OBJ): depend.h printf.h stream.h kctype.h parse$(OBJ): string.h malloc.h parse$(OBJ): pathname.h typesize.h term.h types.h lsparse.h namelist.h parse$(OBJ): kconv.h sysemu.h dirent.h unixemu.h parse$(OBJ): realpath.h parse.h system.h termio.h parse$(OBJ): wait.h builtin$(OBJ): fd.h headers.h machine.h config.h builtin$(OBJ): depend.h printf.h stream.h kctype.h builtin$(OBJ): string.h malloc.h builtin$(OBJ): encode.h parse.h kconv.h func.h sysemu.h dirent.h unixemu.h builtin$(OBJ): pathname.h builtin$(OBJ): typesize.h term.h types.h lsparse.h namelist.h dosdisk.h builtin$(OBJ): funcno.h kanji.h catalog.h system.h termio.h builtin$(OBJ): wait.h builtin$(OBJ): termemu.h roman.h shell$(OBJ): fd.h headers.h machine.h config.h shell$(OBJ): depend.h printf.h stream.h kctype.h shell$(OBJ): string.h malloc.h shell$(OBJ): realpath.h parse.h kconv.h func.h sysemu.h dirent.h unixemu.h shell$(OBJ): pathname.h shell$(OBJ): typesize.h term.h types.h lsparse.h namelist.h dosdisk.h shell$(OBJ): kanji.h catalog.h system.h termio.h shell$(OBJ): wait.h shell$(OBJ): termemu.h socket$(OBJ): headers.h machine.h config.h socket$(OBJ): depend.h printf.h stream.h kctype.h socket$(OBJ): typesize.h malloc.h socket$(OBJ): sysemu.h dirent.h unixemu.h socket$(OBJ): termio.h socket$(OBJ): socket.h url$(OBJ): headers.h machine.h config.h url$(OBJ): depend.h printf.h url$(OBJ): stream.h kctype.h url$(OBJ): typesize.h string.h malloc.h sysemu.h dirent.h unixemu.h url$(OBJ): pathname.h url.h auth$(OBJ): headers.h machine.h config.h auth$(OBJ): depend.h printf.h auth$(OBJ): stream.h string.h malloc.h time.h pathname.h typesize.h auth$(OBJ): encode.h parse.h socket.h auth.h url.h auth$(OBJ): system.h termio.h auth$(OBJ): wait.h auth$(OBJ): unixemu.h kanji.h catalog.h ftp$(OBJ): headers.h machine.h config.h ftp$(OBJ): depend.h printf.h ftp$(OBJ): stream.h kctype.h ftp$(OBJ): string.h malloc.h time.h sysemu.h dirent.h unixemu.h ftp$(OBJ): pathname.h ftp$(OBJ): typesize.h termio.h ftp$(OBJ): parse.h ftp$(OBJ): lsparse.h namelist.h socket.h auth.h ftp$(OBJ): url.h urldisk.h html$(OBJ): headers.h machine.h config.h html$(OBJ): depend.h printf.h html$(OBJ): stream.h kctype.h html$(OBJ): typesize.h string.h malloc.h sysemu.h dirent.h unixemu.h html$(OBJ): pathname.h termio.h html$(OBJ): parse.h html.h urldisk.h html$(OBJ): namelist.h url.h auth.h http$(OBJ): headers.h machine.h config.h http$(OBJ): depend.h printf.h http$(OBJ): stream.h kctype.h http$(OBJ): string.h malloc.h time.h sysemu.h dirent.h unixemu.h http$(OBJ): pathname.h http$(OBJ): typesize.h termio.h http$(OBJ): parse.h http$(OBJ): lsparse.h namelist.h socket.h auth.h http$(OBJ): url.h html.h urldisk.h urldisk$(OBJ): headers.h machine.h config.h urldisk$(OBJ): depend.h printf.h stream.h string.h urldisk$(OBJ): malloc.h time.h sysemu.h dirent.h unixemu.h urldisk$(OBJ): pathname.h urldisk$(OBJ): typesize.h termio.h urldisk$(OBJ): realpath.h urldisk$(OBJ): lsparse.h namelist.h socket.h urldisk$(OBJ): urldisk.h url.h auth.h catalog$(OBJ): fd.h headers.h machine.h config.h catalog$(OBJ): depend.h printf.h stream.h kctype.h catalog$(OBJ): string.h malloc.h catalog$(OBJ): termio.h catalog$(OBJ): func.h sysemu.h dirent.h catalog$(OBJ): unixemu.h catalog$(OBJ): pathname.h typesize.h term.h types.h lsparse.h namelist.h catalog$(OBJ): dosdisk.h kanji.h catalog.h kconv$(OBJ): fd.h headers.h machine.h config.h kconv$(OBJ): depend.h printf.h stream.h kctype.h kconv$(OBJ): string.h malloc.h kconv$(OBJ): termio.h kconv$(OBJ): realpath.h parse.h func.h kconv$(OBJ): sysemu.h dirent.h unixemu.h kconv$(OBJ): pathname.h typesize.h term.h types.h kconv$(OBJ): lsparse.h namelist.h dosdisk.h kconv.h termemu.h input$(OBJ): fd.h headers.h machine.h config.h input$(OBJ): depend.h printf.h stream.h kctype.h input$(OBJ): string.h malloc.h input$(OBJ): wait.h unixemu.h parse.h kconv.h func.h input$(OBJ): sysemu.h dirent.h input$(OBJ): pathname.h typesize.h term.h types.h lsparse.h namelist.h input$(OBJ): dosdisk.h kanji.h catalog.h system.h termio.h input$(OBJ): termemu.h ime$(OBJ): fd.h headers.h machine.h config.h ime$(OBJ): depend.h printf.h ime$(OBJ): stream.h kctype.h ime$(OBJ): string.h malloc.h wait.h unixemu.h ime$(OBJ): parse.h kconv.h roman.h func.h sysemu.h dirent.h ime$(OBJ): pathname.h ime$(OBJ): typesize.h term.h types.h lsparse.h namelist.h dosdisk.h ime$(OBJ): kanji.h catalog.h termemu.h dict$(OBJ): fd.h headers.h machine.h config.h dict$(OBJ): depend.h printf.h dict$(OBJ): stream.h kctype.h dict$(OBJ): string.h malloc.h termio.h dict$(OBJ): roman.h dict$(OBJ): hinsi.h func.h sysemu.h dirent.h unixemu.h dict$(OBJ): pathname.h typesize.h term.h types.h dict$(OBJ): lsparse.h namelist.h dosdisk.h parse.h kconv.h roman$(OBJ): headers.h machine.h config.h roman$(OBJ): depend.h kctype.h roman$(OBJ): typesize.h string.h kconv.h roman.h info$(OBJ): fd.h headers.h machine.h config.h info$(OBJ): depend.h printf.h info$(OBJ): stream.h kctype.h info$(OBJ): string.h malloc.h dirent.h unixemu.h info$(OBJ): sysemu.h pathname.h typesize.h term.h info$(OBJ): types.h lsparse.h namelist.h funcno.h kanji.h catalog.h info$(OBJ): unixdisk.h mntinfo.h fsinfo.h rockridg$(OBJ): fd.h headers.h machine.h config.h rockridg$(OBJ): depend.h printf.h stream.h kctype.h rockridg$(OBJ): string.h malloc.h rockridg$(OBJ): device.h parse.h func.h sysemu.h dirent.h unixemu.h rockridg$(OBJ): pathname.h rockridg$(OBJ): typesize.h term.h types.h lsparse.h namelist.h dosdisk.h tree$(OBJ): fd.h headers.h machine.h config.h tree$(OBJ): depend.h printf.h tree$(OBJ): stream.h kctype.h tree$(OBJ): string.h malloc.h func.h sysemu.h dirent.h unixemu.h tree$(OBJ): pathname.h tree$(OBJ): typesize.h term.h types.h lsparse.h namelist.h dosdisk.h tree$(OBJ): kanji.h catalog.h lsparse$(OBJ): fd.h headers.h machine.h config.h lsparse$(OBJ): depend.h printf.h stream.h kctype.h lsparse$(OBJ): string.h malloc.h lsparse$(OBJ): time.h dirent.h unixemu.h lsparse$(OBJ): pathname.h typesize.h device.h lsparse$(OBJ): parse.h lsparse.h namelist.h kconv.h archive$(OBJ): fd.h headers.h machine.h config.h archive$(OBJ): depend.h printf.h stream.h kctype.h archive$(OBJ): string.h malloc.h archive$(OBJ): realpath.h kconv.h func.h sysemu.h dirent.h unixemu.h archive$(OBJ): pathname.h archive$(OBJ): typesize.h term.h types.h lsparse.h namelist.h dosdisk.h archive$(OBJ): kanji.h catalog.h system.h termio.h archive$(OBJ): wait.h archive$(OBJ): termemu.h custom$(OBJ): fd.h headers.h machine.h config.h custom$(OBJ): depend.h printf.h stream.h kctype.h custom$(OBJ): string.h malloc.h custom$(OBJ): parse.h kconv.h func.h sysemu.h dirent.h unixemu.h custom$(OBJ): pathname.h custom$(OBJ): typesize.h term.h types.h lsparse.h namelist.h dosdisk.h custom$(OBJ): funcno.h kanji.h catalog.h system.h termio.h custom$(OBJ): wait.h custom$(OBJ): termemu.h urldisk.h url.h auth.h command$(OBJ): fd.h headers.h machine.h config.h command$(OBJ): depend.h printf.h stream.h kctype.h command$(OBJ): string.h malloc.h command$(OBJ): parse.h func.h sysemu.h dirent.h unixemu.h command$(OBJ): pathname.h command$(OBJ): typesize.h term.h types.h lsparse.h namelist.h dosdisk.h command$(OBJ): funcno.h kanji.h catalog.h system.h termio.h command$(OBJ): wait.h command$(OBJ): termemu.h functabl.h browse$(OBJ): fd.h headers.h machine.h config.h browse$(OBJ): depend.h printf.h stream.h kctype.h browse$(OBJ): string.h malloc.h browse$(OBJ): device.h parse.h kconv.h func.h sysemu.h dirent.h unixemu.h browse$(OBJ): pathname.h browse$(OBJ): typesize.h term.h types.h lsparse.h namelist.h dosdisk.h browse$(OBJ): funcno.h kanji.h catalog.h termemu.h unitbl$(OBJ): headers.h machine.h config.h dicttbl$(OBJ): headers.h machine.h config.h sprintf$(OBJ): headers.h machine.h config.h sprintf$(OBJ): depend.h printf.h stream.h kctype.h sprintf$(OBJ): typesize.h string.h stermio$(OBJ): headers.h machine.h config.h stermio$(OBJ): depend.h typesize.h sysemu.h dirent.h stermio$(OBJ): unixemu.h stermio$(OBJ): stream.h termio.h sstream$(OBJ): headers.h machine.h config.h sstream$(OBJ): depend.h typesize.h malloc.h sysemu.h sstream$(OBJ): dirent.h unixemu.h sstream$(OBJ): stream.h pathname.h termio.h sstring$(OBJ): headers.h machine.h config.h sstring$(OBJ): kctype.h depend.h sstring$(OBJ): string.h smalloc$(OBJ): headers.h machine.h config.h smalloc$(OBJ): printf.h stream.h depend.h malloc.h smalloc$(OBJ): sysemu.h dirent.h unixemu.h stime$(OBJ): headers.h machine.h config.h stime$(OBJ): typesize.h string.h time.h spathnam$(OBJ): headers.h machine.h config.h spathnam$(OBJ): depend.h spathnam$(OBJ): printf.h stream.h kctype.h spathnam$(OBJ): string.h malloc.h dirent.h unixemu.h spathnam$(OBJ): sysemu.h spathnam$(OBJ): pathname.h typesize.h ssystem$(OBJ): headers.h machine.h config.h ssystem$(OBJ): depend.h printf.h stream.h kctype.h ssystem$(OBJ): string.h malloc.h ssystem$(OBJ): dirent.h unixemu.h ssystem$(OBJ): sysemu.h system.h pathname.h ssystem$(OBJ): typesize.h termio.h ssystem$(OBJ): wait.h ssystem$(OBJ): termemu.h time.h posixsh.h sposixsh$(OBJ): headers.h machine.h config.h sposixsh$(OBJ): depend.h printf.h stream.h kctype.h sposixsh$(OBJ): string.h malloc.h sposixsh$(OBJ): sysemu.h dirent.h unixemu.h sposixsh$(OBJ): system.h pathname.h typesize.h sposixsh$(OBJ): termio.h sposixsh$(OBJ): wait.h sposixsh$(OBJ): termemu.h time.h posixsh.h sdoscom$(OBJ): headers.h machine.h config.h sdoscom$(OBJ): depend.h printf.h stream.h kctype.h sdoscom$(OBJ): string.h malloc.h sdoscom$(OBJ): dirent.h unixemu.h sdoscom$(OBJ): sysemu.h system.h pathname.h sdoscom$(OBJ): typesize.h termio.h sdoscom$(OBJ): wait.h ssysemu$(OBJ): headers.h machine.h config.h ssysemu$(OBJ): depend.h printf.h stream.h kctype.h ssysemu$(OBJ): string.h malloc.h ssysemu$(OBJ): sysemu.h dirent.h unixemu.h ssysemu$(OBJ): log.h pathname.h typesize.h termio.h ssysemu$(OBJ): realpath.h bprintf$(OBJ): headers.h machine.h config.h bprintf$(OBJ): depend.h printf.h stream.h kctype.h bprintf$(OBJ): typesize.h string.h btermio$(OBJ): headers.h machine.h config.h btermio$(OBJ): depend.h typesize.h sysemu.h dirent.h btermio$(OBJ): unixemu.h btermio$(OBJ): stream.h termio.h bstream$(OBJ): headers.h machine.h config.h bstream$(OBJ): depend.h typesize.h malloc.h sysemu.h bstream$(OBJ): dirent.h unixemu.h bstream$(OBJ): stream.h pathname.h termio.h bstring$(OBJ): headers.h machine.h config.h bstring$(OBJ): kctype.h depend.h bstring$(OBJ): string.h bmalloc$(OBJ): headers.h machine.h config.h bmalloc$(OBJ): printf.h stream.h depend.h malloc.h bmalloc$(OBJ): sysemu.h dirent.h unixemu.h bpathnam$(OBJ): headers.h machine.h config.h bpathnam$(OBJ): depend.h bpathnam$(OBJ): printf.h stream.h kctype.h bpathnam$(OBJ): string.h malloc.h dirent.h unixemu.h bpathnam$(OBJ): sysemu.h bpathnam$(OBJ): pathname.h typesize.h bsystem$(OBJ): headers.h machine.h config.h bsystem$(OBJ): depend.h printf.h stream.h kctype.h bsystem$(OBJ): string.h malloc.h bsystem$(OBJ): dirent.h unixemu.h bsystem$(OBJ): sysemu.h system.h pathname.h bsystem$(OBJ): typesize.h termio.h bsystem$(OBJ): wait.h bsystem$(OBJ): termemu.h bdoscom$(OBJ): headers.h machine.h config.h bdoscom$(OBJ): depend.h printf.h stream.h kctype.h bdoscom$(OBJ): string.h malloc.h bdoscom$(OBJ): dirent.h unixemu.h bdoscom$(OBJ): sysemu.h system.h pathname.h bdoscom$(OBJ): typesize.h termio.h bdoscom$(OBJ): wait.h bsysemu$(OBJ): headers.h machine.h config.h bsysemu$(OBJ): depend.h printf.h stream.h kctype.h bsysemu$(OBJ): string.h malloc.h bsysemu$(OBJ): sysemu.h dirent.h unixemu.h bsysemu$(OBJ): log.h pathname.h typesize.h termio.h bsysemu$(OBJ): realpath.h nprintf$(OBJ): headers.h machine.h config.h nprintf$(OBJ): depend.h printf.h stream.h kctype.h nprintf$(OBJ): typesize.h string.h ntermio$(OBJ): headers.h machine.h config.h ntermio$(OBJ): depend.h typesize.h sysemu.h dirent.h ntermio$(OBJ): unixemu.h ntermio$(OBJ): stream.h termio.h nstream$(OBJ): headers.h machine.h config.h nstream$(OBJ): depend.h typesize.h malloc.h sysemu.h nstream$(OBJ): dirent.h unixemu.h nstream$(OBJ): stream.h pathname.h termio.h nstream$(OBJ): socket.h nstring$(OBJ): headers.h machine.h config.h nstring$(OBJ): kctype.h depend.h nstring$(OBJ): string.h nmalloc$(OBJ): headers.h machine.h config.h nmalloc$(OBJ): printf.h stream.h depend.h malloc.h nmalloc$(OBJ): sysemu.h dirent.h unixemu.h ntime$(OBJ): headers.h machine.h config.h ntime$(OBJ): typesize.h string.h time.h npathnam$(OBJ): headers.h machine.h config.h npathnam$(OBJ): depend.h npathnam$(OBJ): printf.h stream.h kctype.h npathnam$(OBJ): string.h malloc.h dirent.h unixemu.h npathnam$(OBJ): sysemu.h npathnam$(OBJ): pathname.h typesize.h url.h nsystem$(OBJ): headers.h machine.h config.h nsystem$(OBJ): depend.h printf.h stream.h kctype.h nsystem$(OBJ): string.h malloc.h nsystem$(OBJ): dirent.h unixemu.h nsystem$(OBJ): sysemu.h system.h pathname.h nsystem$(OBJ): typesize.h termio.h nsystem$(OBJ): wait.h nsystem$(OBJ): termemu.h time.h posixsh.h socket.h nsystem$(OBJ): url.h urldisk.h namelist.h auth.h nposixsh$(OBJ): headers.h machine.h config.h nposixsh$(OBJ): depend.h printf.h stream.h kctype.h nposixsh$(OBJ): string.h malloc.h nposixsh$(OBJ): sysemu.h dirent.h unixemu.h nposixsh$(OBJ): system.h pathname.h typesize.h nposixsh$(OBJ): termio.h nposixsh$(OBJ): wait.h nposixsh$(OBJ): termemu.h time.h posixsh.h ndoscom$(OBJ): headers.h machine.h config.h ndoscom$(OBJ): depend.h printf.h stream.h kctype.h ndoscom$(OBJ): string.h malloc.h ndoscom$(OBJ): dirent.h unixemu.h ndoscom$(OBJ): sysemu.h system.h pathname.h ndoscom$(OBJ): typesize.h termio.h ndoscom$(OBJ): wait.h ndoscom$(OBJ): realpath.h urldisk.h namelist.h url.h ndoscom$(OBJ): auth.h nsysemu$(OBJ): headers.h machine.h config.h nsysemu$(OBJ): depend.h printf.h stream.h kctype.h nsysemu$(OBJ): string.h malloc.h nsysemu$(OBJ): sysemu.h dirent.h unixemu.h nsysemu$(OBJ): log.h pathname.h typesize.h termio.h nsysemu$(OBJ): realpath.h socket.h nsysemu$(OBJ): urldisk.h namelist.h url.h auth.h nrealpat$(OBJ): headers.h machine.h config.h nrealpat$(OBJ): depend.h nrealpat$(OBJ): printf.h stream.h kctype.h nrealpat$(OBJ): string.h sysemu.h dirent.h unixemu.h nrealpat$(OBJ): pathname.h nrealpat$(OBJ): typesize.h realpath.h url.h nencode$(OBJ): headers.h machine.h config.h nencode$(OBJ): kctype.h depend.h nencode$(OBJ): sysemu.h dirent.h unixemu.h nencode$(OBJ): stream.h nencode$(OBJ): pathname.h typesize.h encode.h nparse$(OBJ): headers.h machine.h config.h nparse$(OBJ): depend.h printf.h stream.h kctype.h nparse$(OBJ): string.h malloc.h nparse$(OBJ): sysemu.h dirent.h unixemu.h nparse$(OBJ): realpath.h parse.h system.h nparse$(OBJ): pathname.h typesize.h termio.h nparse$(OBJ): wait.h nsocket$(OBJ): headers.h machine.h config.h nsocket$(OBJ): depend.h printf.h stream.h kctype.h nsocket$(OBJ): typesize.h malloc.h nsocket$(OBJ): sysemu.h dirent.h unixemu.h nsocket$(OBJ): termio.h nsocket$(OBJ): socket.h nurl$(OBJ): headers.h machine.h config.h nurl$(OBJ): depend.h printf.h nurl$(OBJ): stream.h kctype.h nurl$(OBJ): typesize.h string.h malloc.h sysemu.h dirent.h unixemu.h nurl$(OBJ): pathname.h url.h nauth$(OBJ): headers.h machine.h config.h nauth$(OBJ): depend.h printf.h stream.h string.h nauth$(OBJ): malloc.h time.h pathname.h typesize.h encode.h parse.h nauth$(OBJ): socket.h auth.h url.h system.h nauth$(OBJ): termio.h nauth$(OBJ): wait.h unixemu.h nauth$(OBJ): sysemu.h dirent.h nftp$(OBJ): headers.h machine.h config.h nftp$(OBJ): depend.h printf.h nftp$(OBJ): stream.h kctype.h nftp$(OBJ): string.h malloc.h time.h sysemu.h dirent.h unixemu.h nftp$(OBJ): pathname.h nftp$(OBJ): typesize.h termio.h nftp$(OBJ): parse.h nftp$(OBJ): lsparse.h namelist.h socket.h auth.h nftp$(OBJ): url.h urldisk.h nhtml$(OBJ): headers.h machine.h config.h nhtml$(OBJ): depend.h printf.h stream.h kctype.h nhtml$(OBJ): typesize.h string.h nhtml$(OBJ): malloc.h sysemu.h dirent.h unixemu.h nhtml$(OBJ): pathname.h termio.h nhtml$(OBJ): parse.h html.h urldisk.h nhtml$(OBJ): namelist.h url.h auth.h nhttp$(OBJ): headers.h machine.h config.h nhttp$(OBJ): depend.h printf.h stream.h kctype.h nhttp$(OBJ): string.h malloc.h nhttp$(OBJ): time.h sysemu.h dirent.h unixemu.h nhttp$(OBJ): pathname.h typesize.h termio.h nhttp$(OBJ): parse.h lsparse.h namelist.h nhttp$(OBJ): socket.h auth.h url.h html.h nhttp$(OBJ): urldisk.h nurldisk$(OBJ): headers.h machine.h config.h nurldisk$(OBJ): depend.h printf.h stream.h string.h nurldisk$(OBJ): malloc.h time.h sysemu.h dirent.h unixemu.h nurldisk$(OBJ): pathname.h nurldisk$(OBJ): typesize.h termio.h nurldisk$(OBJ): realpath.h nurldisk$(OBJ): lsparse.h namelist.h socket.h nurldisk$(OBJ): urldisk.h url.h auth.h nlsparse$(OBJ): headers.h machine.h config.h nlsparse$(OBJ): depend.h kctype.h nlsparse$(OBJ): string.h malloc.h time.h dirent.h nlsparse$(OBJ): unixemu.h nlsparse$(OBJ): pathname.h typesize.h device.h parse.h lsparse.h namelist.h evalopt$(OBJ): headers.h machine.h config.h evalopt$(OBJ): evalopt.h gentbl$(OBJ): headers.h machine.h config.h gentbl$(OBJ): gentbl.h mkunitbl$(OBJ): headers.h machine.h config.h mkunitbl$(OBJ): typesize.h evalopt.h gentbl.h mkdict$(OBJ): headers.h machine.h config.h mkdict$(OBJ): kctype.h depend.h mkdict$(OBJ): typesize.h string.h kconv.h roman.h mkdict$(OBJ): hinsi.h evalopt.h gentbl.h mktankan$(OBJ): headers.h machine.h config.h mktankan$(OBJ): kctype.h depend.h mktankan$(OBJ): typesize.h kconv.h roman.h mkkanji$(OBJ): headers.h machine.h config.h mkkanji$(OBJ): typesize.h mkcat$(OBJ): headers.h machine.h config.h mkcat$(OBJ): kctype.h depend.h mkcat$(OBJ): typesize.h version.h evalopt.h gentbl.h mkdir_p$(OBJ): headers.h machine.h config.h mkdir_p$(OBJ): kctype.h depend.h mkdir_p$(OBJ): typesize.h kanjicnv$(OBJ): headers.h machine.h config.h kanjicnv$(OBJ): evalopt.h expfunc$(OBJ): headers.h machine.h config.h mkfuncno$(OBJ): fd.h headers.h machine.h config.h mkfuncno$(OBJ): depend.h types.h typesize.h stream.h mkfuncno$(OBJ): lsparse.h namelist.h functabl.h tstring$(OBJ): headers.h machine.h config.h tstring$(OBJ): kctype.h depend.h tstring$(OBJ): string.h troman$(OBJ): headers.h machine.h config.h troman$(OBJ): depend.h kctype.h troman$(OBJ): typesize.h string.h kconv.h roman.h tkconv$(OBJ): headers.h machine.h config.h tkconv$(OBJ): depend.h kctype.h tkconv$(OBJ): typesize.h string.h unixemu.h kconv.h tkconv$(OBJ): termemu.h pathname.h tevalopt$(OBJ): headers.h machine.h config.h tevalopt$(OBJ): evalopt.h tgentbl$(OBJ): headers.h machine.h config.h tgentbl$(OBJ): gentbl.h tunitbl$(OBJ): headers.h machine.h config.h FD-3.01j/makefile.l98100644 2105 1751 154225 13516612560 13045 0ustar shiraiuser# # Makefile for fd # TITLE = FD- VERMAJ = 3 VERSION = 3.01j PREFIX = CONFDIR = BUILD = MANSEC = 1 BINTOP = $(PREFIX)\bin BINDIR = $(BUILD)$(BINTOP) DATATOP = $(PREFIX)\share DATADIR = $(BUILD)$(DATATOP)\fd MANTOP = $(PREFIX)\man MANDIR = $(BUILD)$(MANTOP)\man$(MANSEC) CATDIR = $(BUILD)$(MANTOP)\cat$(MANSEC) JMANDIR = $(BUILD)$(MANTOP)\man$(MANSEC) JCATDIR = $(BUILD)$(MANTOP)\cat$(MANSEC) IPKWDIR = .\ipk.work IPKTDIR = .\ipk.tmp DEPDIR = .\depend.tmp DIST = none DEFRC = $(CONFDIR)\fd2rc BLDRC = $(BUILD)$(DEFRC) DOSRC = ~FD\\fd2rc UNITBL = fd-unicd.tbl DICTTBL = fd-dict.tbl DICTTXT = fd-dict.txt DICTSRC = CATTBL = fd-cat.ja ECATTBL = fd-cat.C TABLES = $(UNITBL) $(CATTBL) $(ECATTBL) SRC = main.c printf.c termio.c term.c stream.c \ string.c malloc.c time.c \ pathname.c system.c posixsh.c doscom.c \ log.c sysemu.c dosdisk.c unixdisk.c \ realpath.c encode.c \ libc.c file.c mntinfo.c statfs.c apply.c \ pty.c termemu.c frontend.c backend.c \ parse.c builtin.c shell.c \ socket.c url.c auth.c \ ftp.c html.c http.c urldisk.c \ catalog.c \ kconv.c input.c ime.c dict.c roman.c \ info.c rockridg.c tree.c \ lsparse.c archive.c \ custom.c command.c browse.c HSRC = evalopt.c gentbl.c \ mkunitbl.c mkdict.c mktankan.c \ mkkanji.c mkcat.c mkdir_p.c \ kanjicnv.c expfunc.c \ mkfuncno.c DSRC = $(DEPDIR)\unitbl.c $(DEPDIR)\dicttbl.c HEADER = fd.h \ headers.h machine.h \ depend.h \ printf.h kctype.h typesize.h \ string.h malloc.h time.h \ dirent.h sysemu.h log.h \ pathname.h system.h posixsh.h wait.h \ termio.h term.h stream.h \ types.h namelist.h \ dosdisk.h unixdisk.h unixemu.h \ realpath.h encode.h termemu.h \ mntinfo.h fsinfo.h device.h parse.h lsparse.h \ socket.h url.h auth.h html.h urldisk.h \ catalog.h \ evalopt.h gentbl.h \ kconv.h roman.h hinsi.h \ func.h functabl.h SSRC = printf.c termio.c stream.c \ string.c malloc.c time.c \ pathname.c system.c posixsh.c doscom.c \ sysemu.c BSRC = printf.c termio.c stream.c \ string.c malloc.c \ pathname.c system.c doscom.c \ sysemu.c NSRC = printf.c termio.c stream.c \ string.c malloc.c time.c \ pathname.c system.c posixsh.c doscom.c \ sysemu.c \ realpath.c encode.c \ parse.c \ socket.c url.c auth.c \ ftp.c html.c http.c urldisk.c \ lsparse.c TSRC = string.c roman.c kconv.c evalopt.c gentbl.c unitbl.c DOC = README.eng HISTORY.eng FAQ.eng TECHKNOW.eng \ Install.eng ToAdmin.eng LICENSES.eng JDOC = README HISTORY FAQ TECHKNOW \ Install ToAdmin LICENSES MANSRC = fd_e.man MANCAT = fd_e.cat JMANSRC = fd.man JMANCAT = fd.cat RUNCOM = fdrc ARGS = object.arg SARGS = sobject.arg NARGS = nobject.arg SRCS = $(DOC) $(MANSRC) $(MANCAT) \ Configur Makefile Makefile.in $(SRC) $(HSRC) $(HEADER) \ makefile.gpc makefile.g98 \ makefile.dpc makefile.d98 \ makefile.lpc makefile.l98 \ makefile.bpc makefile.b98 \ mkmfdosg.sed mkmfdosd.sed mkmfdosl.sed mkmfdosb.sed \ mkmfsed.c \ config.hin version.h \ _fdrc _fdrc.dif fd.spec JSRCS = $(JDOC) $(JMANSRC) $(JMANCAT) \ kanji.hin SOURCES = $(SRCS) $(JSRCS) SHSOURCES = $(NSRC) \ headers.h machine.h \ depend.h \ printf.h kctype.h typesize.h \ string.h malloc.h time.h \ dirent.h sysemu.h log.h \ pathname.h system.h posixsh.h wait.h \ termio.h stream.h \ namelist.h \ unixemu.h \ realpath.h encode.h \ device.h parse.h lsparse.h \ socket.h url.h auth.h html.h urldisk.h \ kanjicnv.c expfunc.c mkmfsed.c \ Configur Makefile Makefile.in \ makefile.gpc makefile.g98 \ makefile.dpc makefile.d98 \ makefile.lpc makefile.l98 \ makefile.bpc makefile.b98 \ mkmfdosg.sed mkmfdosd.sed mkmfdosl.sed mkmfdosb.sed \ config.hin version.h CC = lcc86 HOSTCC = $(CC) INSTALL = copy /y MAKE = make SHELL = \bin\sh SED = sed ECHO = command /c echo CP = copy /y RM = del LN = copy /y MV = mv CHMOD = chmod LINT = lint TAR = tar LHA = lha SHAR = shar EXE = .exe OBJ = .obj PROGRAM = fd ALIAS = fdsh DOSOBJS = unixdisk$(OBJ) IMEOBJS = ime$(OBJ) dict$(OBJ) roman$(OBJ) SCKOBJS = socket$(OBJ) url$(OBJ) auth$(OBJ) \ ftp$(OBJ) html$(OBJ) http$(OBJ) urldisk$(OBJ) OBJ1 = main$(OBJ) printf$(OBJ) termio$(OBJ) term$(OBJ) stream$(OBJ) \ string$(OBJ) malloc$(OBJ) time$(OBJ) OBJ2 = pathname$(OBJ) system$(OBJ) posixsh$(OBJ) doscom$(OBJ) \ log$(OBJ) sysemu$(OBJ) dosdisk$(OBJ) $(DOSOBJS) OBJ3 = realpath$(OBJ) encode$(OBJ) \ libc$(OBJ) file$(OBJ) mntinfo$(OBJ) statfs$(OBJ) apply$(OBJ) \ pty$(OBJ) termemu$(OBJ) frontend$(OBJ) backend$(OBJ) OBJ4 = parse$(OBJ) builtin$(OBJ) shell$(OBJ) OBJ5 = catalog$(OBJ) \ kconv$(OBJ) input$(OBJ) OBJ6 = info$(OBJ) rockridg$(OBJ) tree$(OBJ) \ lsparse$(OBJ) archive$(OBJ) \ custom$(OBJ) command$(OBJ) browse$(OBJ) SOBJ1 = sprintf$(OBJ) stermio$(OBJ) sstream$(OBJ) \ sstring$(OBJ) smalloc$(OBJ) stime$(OBJ) SOBJ2 = spathnam$(OBJ) ssystem$(OBJ) sposixsh$(OBJ) sdoscom$(OBJ) \ ssysemu$(OBJ) BOBJ = bprintf$(OBJ) btermio$(OBJ) bstream$(OBJ) \ bstring$(OBJ) bmalloc$(OBJ) \ bpathnam$(OBJ) bsystem$(OBJ) bdoscom$(OBJ) \ bsysemu$(OBJ) NOBJ1 = nprintf$(OBJ) ntermio$(OBJ) nstream$(OBJ) \ nstring$(OBJ) nmalloc$(OBJ) ntime$(OBJ) NOBJ2 = npathnam$(OBJ) nsystem$(OBJ) nposixsh$(OBJ) ndoscom$(OBJ) \ nsysemu$(OBJ) \ nrealpat$(OBJ) nencode$(OBJ) NOBJ3 = nparse$(OBJ) \ nsocket$(OBJ) nurl$(OBJ) nauth$(OBJ) \ nftp$(OBJ) nhtml$(OBJ) nhttp$(OBJ) nurldisk$(OBJ) \ nlsparse$(OBJ) KOBJ = tevalopt$(OBJ) COBJ = tevalopt$(OBJ) tgentbl$(OBJ) UOBJ = tevalopt$(OBJ) tgentbl$(OBJ) TOBJ = tstring$(OBJ) troman$(OBJ) tkconv$(OBJ) tevalopt$(OBJ) tgentbl$(OBJ) ALLOC = DEBUG = CFLAGS = -O HOSTCFLAGS = $(CFLAGS) CPPFLAGS = HOSTCPPFLAGS = $(CPPFLAGS) LDFLAGS = HOSTLDFLAGS = $(LDFLAGS) OSOPTS = -DPC98 COPTS = $(OSOPTS) $(DEBUG) $(CFLAGS) HOSTCOPTS = $(COPTS) FLDFLAGS = -lintlib -ltinymain.obj $(ALLOC) $(LDFLAGS) SLDFLAGS = -lintlib -ltinymain.obj $(ALLOC) $(LDFLAGS) NLDFLAGS = -lintlib -ltinymain.obj $(ALLOC) $(LDFLAGS) BUILDFLAGS = $(COPTS) $(CPPFLAGS) FDCFLAGS = $(BUILDFLAGS) -ml -h -k"-s 3000" -DFD=$(VERMAJ) SHCFLAGS = $(BUILDFLAGS) -mp -h -k"-s 8000" -DFDSH=$(VERMAJ) BSHCFLAGS = $(BUILDFLAGS) -ms -k"-s 8000" -DFDSH=$(VERMAJ) -DMINIMUMSHELL NSHCFLAGS = $(BUILDFLAGS) -mp -h -k"-s 8000" -DFDSH=$(VERMAJ) -DWITHNETWORK DEFCFLAGS = -DDEFRC=\\\"$(DOSRC)\\\" .SUFFIXES: .h .c .obj .exe ############################################################ # Dependency Rules ############################################################ all: $(PROGRAM)$(EXE) $(PROGRAM).$(MANSEC) $(TABLES) $(PROGRAM)$(EXE): $(OBJ1) $(OBJ2) $(OBJ3) $(OBJ4) $(OBJ5) $(OBJ6) $(ARGS) # @sleep 1 $(CC) -ml -h -k"-s 3000" -o $@ @$(ARGS) $(FLDFLAGS) # @ren $@ $(PROGRAM) # @aout2exe $(PROGRAM) # @del $(PROGRAM) $(ARGS): $(OBJ1) $(OBJ2) $(OBJ3) $(OBJ4) $(OBJ5) $(OBJ6) # @sleep 1 @$(ECHO) $(OBJ1) > $(ARGS) @$(ECHO) $(OBJ2) >> $(ARGS) @$(ECHO) $(OBJ3) >> $(ARGS) @$(ECHO) $(OBJ4) >> $(ARGS) @$(ECHO) $(OBJ5) >> $(ARGS) @$(ECHO) $(OBJ6) >> $(ARGS) # @sleep 1 main$(OBJ): main.c $(CC) $(FDCFLAGS) $(DEFCFLAGS) -c -o $@ $*.c termio$(OBJ): termio.c $(CC) $(FDCFLAGS) -c -o $@ $*.c system$(OBJ): system.c $(CC) $(FDCFLAGS) $(DEFCFLAGS) -c -o $@ $*.c custom$(OBJ): custom.c $(CC) $(FDCFLAGS) -c -o $@ $*.c .c.obj: $(CC) $(FDCFLAGS) -c -o $@ $*.c ############################################################ # kanji using module $(PROGRAM).$(MANSEC): kanjicnv$(EXE) $(JMANSRC) .\kanjicnv$(EXE) -s $(JMANSRC) $@ $(PROGRAM).$(MANSEC)c: kanjicnv$(EXE) $(JMANCAT) .\kanjicnv$(EXE) -s $(JMANCAT) $@ $(PROGRAM).eng: kanjicnv$(EXE) $(MANCAT) .\kanjicnv$(EXE) -b $(MANCAT) $@ $(PROGRAM).doc: kanjicnv$(EXE) $(JMANCAT) .\kanjicnv$(EXE) -s -b $(JMANCAT) $@ README.doc: kanjicnv$(EXE) README .\kanjicnv$(EXE) -s README $@ HISTORY.doc: kanjicnv$(EXE) HISTORY .\kanjicnv$(EXE) -s HISTORY $@ FAQ.doc: kanjicnv$(EXE) FAQ .\kanjicnv$(EXE) -s FAQ $@ LICENSES.doc: kanjicnv$(EXE) LICENSES .\kanjicnv$(EXE) -s LICENSES $@ kanjicnv$(EXE): kanjicnv$(OBJ) $(KOBJ) # @sleep 1 $(HOSTCC) $(HOSTCOPTS) $(HOSTLDFLAGS) -o $@ kanjicnv$(OBJ) $(KOBJ) # @ren $@ kanjicnv # @aout2exe kanjicnv # @del kanjicnv # @sleep 1 kanjicnv$(OBJ): kanjicnv.c $(HOSTCC) $(HOSTCOPTS) $(HOSTCPPFLAGS) -c -o $@ $*.c ############################################################ # message catalog module kanji.h: mkkanji$(EXE) kanjicnv$(EXE) kanji.hin .\mkkanji$(EXE) kanji.hin | \ .\kanjicnv$(EXE) -s - $@ # @sleep 1 mkkanji$(EXE): mkkanji$(OBJ) # @sleep 1 $(HOSTCC) $(HOSTCOPTS) $(HOSTLDFLAGS) -o $@ mkkanji$(OBJ) # @ren $@ mkkanji # @aout2exe mkkanji # @del mkkanji # @sleep 1 mkkanji$(OBJ): mkkanji.c $(HOSTCC) $(HOSTCOPTS) $(HOSTCPPFLAGS) -c -o $@ $*.c _fd-cat.ja: mkcat$(EXE) kanji.h .\mkcat$(EXE) -c 1 kanji.h $@ # @sleep 1 _fd-cat.C: mkcat$(EXE) kanji.h .\mkcat$(EXE) -c 2 kanji.h $@ # @sleep 1 fd-cat.ja: mkcat$(EXE) _fd-cat.ja .\mkcat$(EXE) _fd-cat.ja $@ fd-cat.C: mkcat$(EXE) _fd-cat.C .\mkcat$(EXE) _fd-cat.C $@ mkcat$(EXE): mkcat$(OBJ) $(COBJ) # @sleep 1 $(HOSTCC) $(HOSTCOPTS) $(HOSTLDFLAGS) -o $@ mkcat$(OBJ) $(COBJ) # @ren $@ mkcat # @aout2exe mkcat # @del mkcat # @sleep 1 mkcat$(OBJ): mkcat.c $(HOSTCC) $(HOSTCOPTS) $(HOSTCPPFLAGS) -c -o $@ $*.c ############################################################ # function list using module funcno.h: mkfuncno$(EXE) .\mkfuncno$(EXE) $@ # @sleep 1 mkfuncno$(EXE): mkfuncno$(OBJ) # @sleep 1 $(HOSTCC) $(HOSTCOPTS) $(HOSTLDFLAGS) -o $@ mkfuncno$(OBJ) # @ren $@ mkfuncno # @aout2exe mkfuncno # @del mkfuncno # @sleep 1 mkfuncno$(OBJ): mkfuncno.c $(HOSTCC) $(HOSTCOPTS) $(HOSTCPPFLAGS) -DFD=$(VERMAJ) -c -o $@ $*.c ############################################################ # UNICODE table generating module $(UNITBL): mkunitbl$(EXE) .\mkunitbl$(EXE) $@ unitbl.c: mkunitbl$(EXE) .\mkunitbl$(EXE) -t $@ $(DEPDIR)\unitbl.c: mkunitbl$(EXE) [ -d $(DEPDIR) ] || mkdir $(DEPDIR) .\mkunitbl$(EXE) -t -n $@ mkunitbl$(EXE): mkunitbl$(OBJ) $(UOBJ) # @sleep 1 $(HOSTCC) $(HOSTCOPTS) $(HOSTLDFLAGS) -o $@ mkunitbl$(OBJ) $(UOBJ) # @ren $@ mkunitbl # @aout2exe mkunitbl # @del mkunitbl # @sleep 1 mkunitbl$(OBJ): mkunitbl.c $(HOSTCC) $(HOSTCOPTS) $(HOSTCPPFLAGS) -c -o $@ $*.c tunitbl$(OBJ): unitbl.c $(HOSTCC) $(HOSTCOPTS) $(HOSTCPPFLAGS) -c -o $@ unitbl.c ############################################################ # Kanji transfer table generating module $(DICTTBL): mkdict$(EXE) $(DICTSRC) .\mkdict$(EXE) $@ $(DICTSRC) dicttbl.c: mkdict$(EXE) $(DICTSRC) .\mkdict$(EXE) -t $@ $(DICTSRC) $(DEPDIR)\dicttbl.c: mkdict$(EXE) $(DICTSRC) [ -d $(DEPDIR) ] || mkdir $(DEPDIR) .\mkdict$(EXE) -t -n $@ $(DICTSRC) mkdict$(EXE): mkdict$(OBJ) $(TOBJ) # @sleep 1 $(HOSTCC) $(HOSTCOPTS) $(HOSTLDFLAGS) -o $@ mkdict$(OBJ) $(TOBJ) # @ren $@ mkdict # @aout2exe mkdict # @del mkdict # @sleep 1 mktankan$(EXE): mktankan$(OBJ) $(TOBJ) # @sleep 1 $(HOSTCC) $(HOSTCOPTS) $(HOSTLDFLAGS) -o $@ mktankan$(OBJ) $(TOBJ) # @ren $@ mktankan # @aout2exe mktankan # @del mktankan # @sleep 1 mkdict$(OBJ): mkdict.c $(HOSTCC) $(HOSTCOPTS) $(HOSTCPPFLAGS) -c -o $@ $*.c mktankan$(OBJ): mktankan.c $(HOSTCC) $(HOSTCOPTS) $(HOSTCPPFLAGS) -c -o $@ $*.c tstring$(OBJ): string.c $(HOSTCC) $(HOSTCOPTS) $(HOSTCPPFLAGS) -c -o $@ string.c troman$(OBJ): roman.c $(HOSTCC) $(HOSTCOPTS) $(HOSTCPPFLAGS) -c -o $@ roman.c tkconv$(OBJ): kconv.c $(HOSTCC) $(HOSTCOPTS) $(HOSTCPPFLAGS) -c -o $@ kconv.c tevalopt$(OBJ): evalopt.c $(HOSTCC) $(HOSTCOPTS) $(HOSTCPPFLAGS) -c -o $@ evalopt.c tgentbl$(OBJ): gentbl.c $(HOSTCC) $(HOSTCOPTS) $(HOSTCPPFLAGS) -c -o $@ gentbl.c rmdict: -$(RM) $(DICTTBL) $(DICTTXT): mktankan$(EXE) .\mktankan$(EXE) $@ # @sleep 1 ############################################################ # Directory generating module mkdir_p$(EXE): mkdir_p$(OBJ) # @sleep 1 $(HOSTCC) $(HOSTCOPTS) $(HOSTLDFLAGS) -o $@ mkdir_p$(OBJ) # @ren $@ mkdir_p # @aout2exe mkdir_p # @del mkdir_p # @sleep 1 mkdir_p$(OBJ): mkdir_p.c $(HOSTCC) $(HOSTCOPTS) $(HOSTCPPFLAGS) -c -o $@ $*.c ############################################################ # to install all install: install-bin install-runcom install-man install-jman install-bin: $(PROGRAM)$(EXE) mkdir_p$(EXE) install-table [ -d $(BINDIR) ] || .\mkdir_p$(EXE) $(BINDIR) $(INSTALL) $(PROGRAM)$(EXE) $(BINDIR) $(CHMOD) a+rx $(BINDIR)\$(PROGRAM)$(EXE) -$(RM) $(BINDIR)\$(ALIAS)$(EXE) $(LN) $(BINDIR)\$(PROGRAM)$(EXE) $(BINDIR)\$(ALIAS)$(EXE) $(CHMOD) a+rx $(BINDIR)\$(ALIAS)$(EXE) install-runcom: -if [ -f $(RUNCOM) ]; then \ $(INSTALL) $(RUNCOM) $(BLDRC); \ $(CHMOD) a+r-x $(BLDRC); \ fi install-table: $(TABLE) mkdir_p$(EXE) -if [ -f $(UNITBL) ]; then \ [ -d $(BINDIR) ] || .\mkdir_p$(EXE) $(BINDIR); \ $(INSTALL) $(UNITBL) $(BINDIR); \ $(CHMOD) a+r-x $(BINDIR)\$(UNITBL); \ fi -if [ -f $(DICTTBL) ]; then \ [ -d $(BINDIR) ] || .\mkdir_p$(EXE) $(BINDIR); \ $(INSTALL) $(DICTTBL) $(BINDIR); \ $(CHMOD) a+r-x $(BINDIR)\$(DICTTBL); \ fi -if [ -f $(CATTBL) ]; then \ [ -d $(BINDIR) ] || .\mkdir_p$(EXE) $(BINDIR); \ $(INSTALL) $(CATTBL) $(BINDIR); \ $(CHMOD) a+r-x $(BINDIR)\$(CATTBL); \ fi -if [ -f $(ECATTBL) ]; then \ [ -d $(BINDIR) ] || .\mkdir_p$(EXE) $(BINDIR); \ $(INSTALL) $(ECATTBL) $(BINDIR); \ $(CHMOD) a+r-x $(BINDIR)\$(ECATTBL); \ fi install-man: $(MANSRC) mkdir_p$(EXE) [ -d $(MANDIR) ] || .\mkdir_p$(EXE) $(MANDIR) $(INSTALL) $(MANSRC) $(MANDIR)\$(PROGRAM).$(MANSEC) $(CHMOD) a+r-x $(MANDIR)\$(PROGRAM).$(MANSEC) -$(RM) $(MANDIR)\$(ALIAS).$(MANSEC) $(LN) $(MANDIR)\$(PROGRAM).$(MANSEC) $(MANDIR)\$(ALIAS).$(MANSEC) $(CHMOD) a+r-x $(MANDIR)\$(ALIAS).$(MANSEC) install-jman: $(PROGRAM).$(MANSEC) mkdir_p$(EXE) [ -d $(JMANDIR) ] || .\mkdir_p$(EXE) $(JMANDIR) [ "$(JMANDIR)" = "$(MANDIR)" ] || \ $(INSTALL) $(PROGRAM).$(MANSEC) $(JMANDIR)\$(PROGRAM).$(MANSEC) $(CHMOD) a+r-x $(JMANDIR)\$(PROGRAM).$(MANSEC) -$(RM) $(JMANDIR)\$(ALIAS).$(MANSEC) $(LN) $(JMANDIR)\$(PROGRAM).$(MANSEC) $(JMANDIR)\$(ALIAS).$(MANSEC) $(CHMOD) a+r-x $(JMANDIR)\$(ALIAS).$(MANSEC) catman: $(MANCAT) mkdir_p$(EXE) [ -d $(CATDIR) ] || .\mkdir_p$(EXE) $(CATDIR) $(INSTALL) $(MANCAT) $(CATDIR)\$(PROGRAM).$(MANSEC) $(CHMOD) a+r-x $(CATDIR)\$(PROGRAM).$(MANSEC) -$(RM) $(CATDIR)\$(ALIAS).$(MANSEC) $(LN) $(CATDIR)\$(PROGRAM).$(MANSEC) $(CATDIR)\$(ALIAS).$(MANSEC) $(CHMOD) a+r-x $(CATDIR)\$(ALIAS).$(MANSEC) catman-b: $(PROGRAM).eng mkdir_p$(EXE) [ -d $(CATDIR) ] || .\mkdir_p$(EXE) $(CATDIR) $(INSTALL) $(PROGRAM).eng $(CATDIR)\$(PROGRAM).$(MANSEC) $(CHMOD) a+r-x $(CATDIR)\$(PROGRAM).$(MANSEC) -$(RM) $(CATDIR)\$(ALIAS).$(MANSEC) $(LN) $(CATDIR)\$(PROGRAM).$(MANSEC) $(CATDIR)\$(ALIAS).$(MANSEC) $(CHMOD) a+r-x $(CATDIR)\$(ALIAS).$(MANSEC) compman: catman -$(RM) $(CATDIR)\$(ALIAS).$(MANSEC) compress -f $(CATDIR)\$(PROGRAM).$(MANSEC) -$(RM) $(CATDIR)\$(ALIAS).$(MANSEC).Z $(LN) $(CATDIR)\$(PROGRAM).$(MANSEC).Z $(CATDIR)\$(ALIAS).$(MANSEC).Z compman-b: catman-b -$(RM) $(CATDIR)\$(ALIAS).$(MANSEC) compress -f $(CATDIR)\$(PROGRAM).$(MANSEC) -$(RM) $(CATDIR)\$(ALIAS).$(MANSEC).Z $(LN) $(CATDIR)\$(PROGRAM).$(MANSEC).Z $(CATDIR)\$(ALIAS).$(MANSEC).Z jcatman: catman $(PROGRAM).$(MANSEC)c mkdir_p$(EXE) [ -d $(JCATDIR) ] || .\mkdir_p$(EXE) $(JCATDIR) $(INSTALL) $(PROGRAM).$(MANSEC)c $(JCATDIR)\$(PROGRAM).$(MANSEC) $(CHMOD) a+r-x $(JCATDIR)\$(PROGRAM).$(MANSEC) -$(RM) $(JCATDIR)\$(ALIAS).$(MANSEC) $(LN) $(JCATDIR)\$(PROGRAM).$(MANSEC) $(JCATDIR)\$(ALIAS).$(MANSEC) $(CHMOD) a+r-x $(JCATDIR)\$(ALIAS).$(MANSEC) jcatman-b: catman-b $(PROGRAM).doc mkdir_p$(EXE) [ -d $(JCATDIR) ] || .\mkdir_p$(EXE) $(JCATDIR) $(INSTALL) $(PROGRAM).doc $(JCATDIR)\$(PROGRAM).$(MANSEC) $(CHMOD) a+r-x $(JCATDIR)\$(PROGRAM).$(MANSEC) -$(RM) $(JCATDIR)\$(ALIAS).$(MANSEC) $(LN) $(JCATDIR)\$(PROGRAM).$(MANSEC) $(JCATDIR)\$(ALIAS).$(MANSEC) $(CHMOD) a+r-x $(JCATDIR)\$(ALIAS).$(MANSEC) jcompman: compman jcatman -$(RM) $(JCATDIR)\$(ALIAS).$(MANSEC) compress -f $(JCATDIR)\$(PROGRAM).$(MANSEC) -$(RM) $(JCATDIR)\$(ALIAS).$(MANSEC).Z $(LN) $(JCATDIR)\$(PROGRAM).$(MANSEC).Z $(JCATDIR)\$(ALIAS).$(MANSEC).Z jcompman-b: compman-b jcatman-b -$(RM) $(JCATDIR)\$(ALIAS).$(MANSEC) compress -f $(JCATDIR)\$(PROGRAM).$(MANSEC) -$(RM) $(JCATDIR)\$(ALIAS).$(MANSEC).Z $(LN) $(JCATDIR)\$(PROGRAM).$(MANSEC).Z $(JCATDIR)\$(ALIAS).$(MANSEC).Z ############################################################ # to make dependency depend: $(SRC) $(HSRC) $(DSRC) config.h kanji.h funcno.h [ -d $(DEPDIR) ] || mkdir $(DEPDIR) for f in $(SRC) $(HSRC); do \ $(SED) -e 's:^\(# *\)include "\(.*\).h":\1include "_\2.h":' \ $${f} > $(DEPDIR)\$${f}; \ done for f in $(DSRC); do \ $(SED) -e 's:^\(# *\)include "\(.*\).h":\1include "_\2.h":' \ $${f} > $${f}o; \ $(MV) $${f}o $${f}; \ done for f in $(SSRC); do \ $(RM) $(DEPDIR)\s$${f}; \ $(LN) $(DEPDIR)\$${f} $(DEPDIR)\s$${f}; \ done for f in $(BSRC); do \ $(RM) $(DEPDIR)\b$${f} && \ $(LN) $(DEPDIR)\$${f} $(DEPDIR)\b$${f}; \ done for f in $(NSRC); do \ $(RM) $(DEPDIR)\n$${f} && \ $(LN) $(DEPDIR)\$${f} $(DEPDIR)\n$${f}; \ done for f in $(TSRC); do \ $(RM) $(DEPDIR)\t$${f} && \ $(LN) $(DEPDIR)\$${f} $(DEPDIR)\t$${f}; \ done for f in $(HEADER) config.h kanji.h funcno.h version.h; do \ $(SED) -e 's:^\(# *\)include "\(.*\).h":\1include "_\2.h":' \ $${f} > $(DEPDIR)\_$${f}; \ done $(CP) Makefile.in Makefile.tmp $(DEPDIR) $(CP) Makefile.tmp $(DEPDIR)\Makefile.sh $(CP) Makefile.tmp $(DEPDIR)\Makefile.bsh $(CP) Makefile.tmp $(DEPDIR)\Makefile.nsh $(CP) Makefile.tmp $(DEPDIR)\Makefile.tr cd $(DEPDIR); makedepend \ -s "# DO NOT DELETE THIS LINE -- make depend depends on it." \ -f Makefile.tmp -- $(FDCFLAGS) -- \ $(SRC) \ `for f in $(DSRC); do $(ECHO) $${f}|$(SED) -e 's:^.*\::'; done` cd $(DEPDIR); makedepend \ -s "# DO NOT DELETE THIS LINE -- make depend depends on it." \ -f Makefile.sh -- $(SHCFLAGS) -- \ `for f in $(SSRC); do $(ECHO) s$${f}; done` cd $(DEPDIR); makedepend \ -s "# DO NOT DELETE THIS LINE -- make depend depends on it." \ -f Makefile.bsh -- $(BSHCFLAGS) -- \ `for f in $(BSRC); do $(ECHO) b$${f}; done` cd $(DEPDIR); makedepend \ -s "# DO NOT DELETE THIS LINE -- make depend depends on it." \ -f Makefile.nsh -- $(NSHCFLAGS) -- \ `for f in $(NSRC); do $(ECHO) n$${f}; done` cd $(DEPDIR); makedepend \ -s "# DO NOT DELETE THIS LINE -- make depend depends on it." \ -f Makefile.tr -- $(HOSTCOPTS) -- \ $(HSRC) \ `for f in $(TSRC); do $(ECHO) t$${f}; done` $(SED) -e '\^# DO NOT DELETE THIS LINE\,$$d' $(DEPDIR)\Makefile.in \ > Makefile.in $(ECHO) "# DO NOT DELETE THIS LINE -- make depend depends on it." \ >> Makefile.in $(SED) -e '1,\^# DO NOT DELETE THIS LINE\d' \ -e 's:^\(........\).*\.o:\1.o:' \ -e 's:\\[^ ]* *::g' \ -e 's:\.o:\$$(OBJ):g' \ -e 's:_\([^ ]*.h\):\1:g' \ -e 's: *$$::' \ -e '\: *$$\d' $(DEPDIR)\Makefile.tmp >> Makefile.in $(SED) -e '1,\^# DO NOT DELETE THIS LINE\d' \ -e 's:^\(........\).*\.o:\1.o:' \ -e 's:\\[^ ]* *::g' \ -e 's:\.o:\$$(OBJ):g' \ -e 's:_\([^ ]*.h\):\1:g' \ -e 's: *$$::' \ -e '\: *$$\d' $(DEPDIR)\Makefile.sh >> Makefile.in $(SED) -e '1,\^# DO NOT DELETE THIS LINE\d' \ -e 's:^\(........\).*\.o:\1.o:' \ -e 's:\\[^ ]* *::g' \ -e 's:\.o:\$$(OBJ):g' \ -e 's:_\([^ ]*.h\):\1:g' \ -e 's: *$$::' \ -e '\: *$$\d' $(DEPDIR)\Makefile.bsh >> Makefile.in $(SED) -e '1,\^# DO NOT DELETE THIS LINE\d' \ -e 's:^\(........\).*\.o:\1.o:' \ -e 's:\\[^ ]* *::g' \ -e 's:\.o:\$$(OBJ):g' \ -e 's:_\([^ ]*.h\):\1:g' \ -e 's: *$$::' \ -e '\: *$$\d' $(DEPDIR)\Makefile.nsh >> Makefile.in $(SED) -e '1,\^# DO NOT DELETE THIS LINE\d' \ -e 's:^\(........\).*\.o:\1.o:' \ -e 's:\\[^ ]* *::g' \ -e 's:\.o:\$$(OBJ):g' \ -e 's:_\([^ ]*.h\):\1:g' \ -e 's: *$$::' \ -e '\: *$$\d' $(DEPDIR)\Makefile.tr >> Makefile.in -rm -rf $(DEPDIR) ############################################################ # to verify sources lint: $(SRC) $(HSRC) config.h kanji.h funcno.h $(LINT) $(OSOPTS) -DFD=$(VERMAJ) `$(SED) -e "s:\$(OBJ):\.c:g" $(ARGS)` SRCS=`$(ECHO) $(UOBJ)|$(SED) -e "s:t\([^ ]*\)\$(OBJ):\1\.c:g"`; \ $(LINT) $(OSOPTS) mkunitbl.c $${SRCS} SRCS=`$(ECHO) $(TOBJ)|$(SED) -e "s:t\([^ ]*\)\$(OBJ):\1\.c:g"`; \ $(LINT) $(OSOPTS) mkdict.c $${SRCS}; \ $(LINT) $(OSOPTS) mktankan.c $${SRCS} $(LINT) $(OSOPTS) mkkanji.c SRCS=`$(ECHO) $(COBJ)|$(SED) -e "s:t\([^ ]*\)\$(OBJ):\1\.c:g"`; \ $(LINT) $(OSOPTS) mkcat.c $${SRCS} $(LINT) $(OSOPTS) mkdir_p.c SRCS=`$(ECHO) $(KOBJ)|$(SED) -e "s:t\([^ ]*\)\$(OBJ):\1\.c:g"`; \ $(LINT) $(OSOPTS) kanjicnv.c $${SRCS} $(LINT) $(OSOPTS) expfunc.c $(LINT) $(OSOPTS) mkfuncno.c ############################################################ # to make configuration file manually config: Configur expfunc.c -if ($(ECHO) 't() { echo $1; }; t test' | $(SHELL) >\dev\null 2>&1); then \ $(SED) -e "2,3d" -e "s:__cc__:lcc86:" Configur \ | $(SHELL) > config.h; \ elif $(MAKE) -f Makefile.tmp expfunc$(EXE); then \ $(SED) -e "2,3d" -e "s:__cc__:lcc86:" Configur \ | .\expfunc$(EXE) | $(SHELL) > config.h; \ fi # @sleep 1 config.h: config.hin $(CP) config.hin $@ # @sleep 1 expfunc$(EXE): expfunc$(OBJ) # @sleep 1 $(HOSTCC) $(HOSTCOPTS) $(HOSTLDFLAGS) -o $@ expfunc$(OBJ) # @ren $@ expfunc # @aout2exe expfunc # @del expfunc # @sleep 1 expfunc$(OBJ): expfunc.c $(HOSTCC) $(HOSTCOPTS) $(HOSTCPPFLAGS) -c -o $@ $*.c ############################################################ # sample program for pseudo system(3) sh: fdsh$(EXE) fdsh$(EXE): $(SOBJ1) $(SOBJ2) $(SARGS) # @sleep 1 $(CC) -mp -h -k"-s 8000" -o $@ @$(SARGS) $(SLDFLAGS) # @ren $@ fdsh # @aout2exe fdsh # @del fdsh $(SARGS): $(SOBJ1) $(SOBJ2) # @sleep 1 @$(ECHO) $(SOBJ1) > $(SARGS) @$(ECHO) $(SOBJ2) >> $(SARGS) # @sleep 1 sprintf$(OBJ): printf.c $(CC) $(SHCFLAGS) -c -o $@ printf.c stermio$(OBJ): termio.c $(CC) $(SHCFLAGS) -c -o $@ termio.c sstream$(OBJ): stream.c $(CC) $(SHCFLAGS) -c -o $@ stream.c sstring$(OBJ): string.c $(CC) $(SHCFLAGS) -c -o $@ string.c smalloc$(OBJ): malloc.c $(CC) $(SHCFLAGS) -c -o $@ malloc.c stime$(OBJ): time.c $(CC) $(SHCFLAGS) -c -o $@ time.c spathnam$(OBJ): pathname.c $(CC) $(SHCFLAGS) -c -o $@ pathname.c ssystem$(OBJ): system.c $(CC) $(SHCFLAGS) -c -o $@ system.c sposixsh$(OBJ): posixsh.c $(CC) $(SHCFLAGS) -c -o $@ posixsh.c sdoscom$(OBJ): doscom.c $(CC) $(SHCFLAGS) -c -o $@ doscom.c ssysemu$(OBJ): sysemu.c $(CC) $(SHCFLAGS) -c -o $@ sysemu.c ############################################################ # Bourne shell bsh: fdbsh$(EXE) fdbsh$(EXE): $(BOBJ) # @sleep 1 $(CC) -ms -k"-s 8000" -o $@ $(BOBJ) $(SLDFLAGS) # @ren $@ fdbsh # @aout2exe fdbsh # @del fdbsh bprintf$(OBJ): printf.c $(CC) $(BSHCFLAGS) -c -o $@ printf.c btermio$(OBJ): termio.c $(CC) $(BSHCFLAGS) -c -o $@ termio.c bstream$(OBJ): stream.c $(CC) $(BSHCFLAGS) -c -o $@ stream.c bstring$(OBJ): string.c $(CC) $(BSHCFLAGS) -c -o $@ string.c bmalloc$(OBJ): malloc.c $(CC) $(BSHCFLAGS) -c -o $@ malloc.c bpathnam$(OBJ): pathname.c $(CC) $(BSHCFLAGS) -c -o $@ pathname.c bsystem$(OBJ): system.c $(CC) $(BSHCFLAGS) -c -o $@ system.c bdoscom$(OBJ): doscom.c $(CC) $(BSHCFLAGS) -c -o $@ doscom.c bsysemu$(OBJ): sysemu.c $(CC) $(BSHCFLAGS) -c -o $@ sysemu.c ############################################################ # Network shell nsh: fdnsh$(EXE) fdnsh$(EXE): $(NOBJ1) $(NOBJ2) $(NOBJ3) $(NARGS) # @sleep 1 $(CC) -mp -h -k"-s 8000" -o $@ @$(NARGS) $(NLDFLAGS) # @ren $@ fdnsh # @aout2exe fdnsh # @del fdnsh $(NARGS): $(NOBJ1) $(NOBJ2) $(NOBJ3) # @sleep 1 @$(ECHO) $(NOBJ1) > $(NARGS) @$(ECHO) $(NOBJ2) >> $(NARGS) @$(ECHO) $(NOBJ3) >> $(NARGS) # @sleep 1 nprintf$(OBJ): printf.c $(CC) $(NSHCFLAGS) -c -o $@ printf.c ntermio$(OBJ): termio.c $(CC) $(NSHCFLAGS) -c -o $@ termio.c nstream$(OBJ): stream.c $(CC) $(NSHCFLAGS) -c -o $@ stream.c nstring$(OBJ): string.c $(CC) $(NSHCFLAGS) -c -o $@ string.c nmalloc$(OBJ): malloc.c $(CC) $(NSHCFLAGS) -c -o $@ malloc.c ntime$(OBJ): time.c $(CC) $(NSHCFLAGS) -c -o $@ time.c npathnam$(OBJ): pathname.c $(CC) $(NSHCFLAGS) -c -o $@ pathname.c nsystem$(OBJ): system.c $(CC) $(NSHCFLAGS) -c -o $@ system.c nposixsh$(OBJ): posixsh.c $(CC) $(NSHCFLAGS) -c -o $@ posixsh.c ndoscom$(OBJ): doscom.c $(CC) $(NSHCFLAGS) -c -o $@ doscom.c nsysemu$(OBJ): sysemu.c $(CC) $(NSHCFLAGS) -c -o $@ sysemu.c nrealpat$(OBJ): realpath.c $(CC) $(NSHCFLAGS) -c -o $@ realpath.c nencode$(OBJ): encode.c $(CC) $(NSHCFLAGS) -c -o $@ encode.c nparse$(OBJ): parse.c $(CC) $(NSHCFLAGS) -c -o $@ parse.c nsocket$(OBJ): socket.c $(CC) $(NSHCFLAGS) -c -o $@ socket.c nurl$(OBJ): url.c $(CC) $(NSHCFLAGS) -c -o $@ url.c nauth$(OBJ): auth.c $(CC) $(NSHCFLAGS) -c -o $@ auth.c nftp$(OBJ): ftp.c $(CC) $(NSHCFLAGS) -c -o $@ ftp.c nhtml$(OBJ): html.c $(CC) $(NSHCFLAGS) -c -o $@ html.c nhttp$(OBJ): http.c $(CC) $(NSHCFLAGS) -c -o $@ http.c nurldisk$(OBJ): urldisk.c $(CC) $(NSHCFLAGS) -c -o $@ urldisk.c nlsparse$(OBJ): lsparse.c $(CC) $(NSHCFLAGS) -c -o $@ lsparse.c ############################################################ # for programer's maintenance tar: $(SOURCES) $(TAR) cvf $(TITLE)$(VERSION).tar $(SOURCES) compress -f $(TITLE)$(VERSION).tar gtar: $(SOURCES) $(TAR) cvf $(TITLE)$(VERSION).tar $(SOURCES) gzip -f $(TITLE)$(VERSION).tar shtar: $(SHSOURCES) (VER=`date '+%y%m%d'`; \ $(TAR) cvf $(TITLE)sh-$${VER}.tar $(SHSOURCES); \ gzip -f $(TITLE)sh-$${VER}.tar) lzh: $(SOURCES) -$(RM) $(TITLE)$(VERSION).lzh $(LHA) a $(TITLE)$(VERSION).lzh $(SOURCES) shar: $(SOURCES) -$(RM) $(TITLE)$(VERSION).shar.[0-9][0-9] $(SHAR) -L50 -apc -n $(TITLE)$(VERSION) -o $(TITLE)$(VERSION).shar \ -T $(SRCS) -C $(JSRCS) ipk: $(PROGRAM)$(EXE) $(TABLES) mkdir_p$(EXE) -[ -d $(IPKWDIR)\$(BINDIR) ] || .\mkdir_p$(EXE) $(IPKWDIR)\$(BINDIR) -[ -d $(IPKWDIR)\$(BINDIR) ] || .\mkdir_p$(EXE) $(IPKWDIR)\$(BINDIR) -[ -d $(IPKWDIR)\$(BINDIR) ] || .\mkdir_p$(EXE) $(IPKWDIR)\$(BINDIR) -[ -d $(IPKWDIR)\$(CONFDIR) ] || .\mkdir_p$(EXE) $(IPKWDIR)\$(CONFDIR) -[ -d $(IPKWDIR)\CONTROL ] || .\mkdir_p$(EXE) $(IPKWDIR)\CONTROL -[ -d $(IPKTDIR) ] || .\mkdir_p$(EXE) $(IPKTDIR) $(CP) -p $(PROGRAM)$(EXE) $(IPKWDIR)\$(BINDIR) -[ -z "$(STRIP)" ] || $(STRIP) $(IPKWDIR)\$(BINDIR)\$(PROGRAM)$(EXE) $(CHMOD) a+rx $(IPKWDIR)\$(BINDIR)\$(PROGRAM)$(EXE) -$(RM) $(IPKWDIR)\$(BINDIR)\$(ALIAS)$(EXE) $(LN) $(IPKWDIR)\$(BINDIR)\$(PROGRAM)$(EXE) \ $(IPKWDIR)\$(BINDIR)\$(ALIAS)$(EXE) $(CHMOD) a+rx $(IPKWDIR)\$(BINDIR)\$(ALIAS)$(EXE) $(SED) -e 's:#TMPDIR=.*:TMPDIR=\home\tmp:' \ -e 's:#LANGUAGE=.*:LANGUAGE=euc:' \ -e 's:#INPUTKCODE=.*:INPUTKCODE=euc:' \ -e 's:#FNAMEKCODE=.*:FNAMEKCODE=utf8:' \ -e '\# launcher definition\,\^$$\ {' \ -e '\^$$\ {' \ -e 'i \' \ -e 'launch ".tar.Z" "gzip -cd %C|tar tvf -" "%a %u\%g %s %y-%m-%d %t %*f"' \ -e 'i \' \ -e 'launch ".taZ" "gzip -cd %C|tar tvf -" "%a %u\%g %s %y-%m-%d %t %*f"' \ -e 'i \' \ -e 'launch ".ipk" "gzip -cd %C|tar xOf - .\data.tar.gz|gzip -cd|tar tvf -" \\' \ -e 'i \' \ -e ' "%a %u\%g %s %y-%m-%d %t %*f"' \ -e 'i \' \ -e 'launch ".deb" "ar -p %C data.tar.gz|gzip -cd|tar tvf -" \\' \ -e 'i \' \ -e ' "%a %u\%g %s %y-%m-%d %t %*f"' \ -e '}' \ -e '}' \ -e '\# archiver definition\,\^$$\ {' \ -e '\^$$\ {' \ -e 'i \' \ -e 'arch ".tar.Z" "echo ERROR; false" "gzip -cd %C|tar xf - %TA"' \ -e 'i \' \ -e 'arch ".taZ" "echo ERROR; false" "gzip -cd %C|tar xf - %TA"' \ -e 'i \' \ -e 'arch ".ipk" "echo ERROR; false" \\' \ -e 'i \' \ -e ' "gzip -cd %C|tar xOf - .\data.tar.gz|gzip -cd|tar xf - %TA"' \ -e 'i \' \ -e 'arch ".deb" "echo ERROR; false" \\' \ -e 'i \' \ -e ' "ar -p %C data.tar.gz|gzip -cd|tar xf - %TA"' \ -e '}' \ -e '}' \ -e '$$ {' \ -e 'a \' \ -e 'if [ " $$TERM" = " vt100" -a " $$CONSOLE" = " \dev\console" ]; then' \ -e 'a \' \ -e ' keymap BS "^?"' \ -e 'a \' \ -e ' keymap DEL "\\033[3~"' \ -e 'a \' \ -e ' keymap HOME "\\033[H"' \ -e 'a \' \ -e ' keymap END "\\033[F"' \ -e 'a \' \ -e 'fi' \ -e '}' \ _fdrc > $(IPKWDIR)\$(BLDRC) $(CHMOD) a+r-x $(IPKWDIR)\$(BLDRC) -if [ -f $(UNITBL) ]; then \ cp -p $(UNITBL) $(IPKWDIR)\$(BINDIR); \ $(CHMOD) a+r-x $(IPKWDIR)\$(BINDIR)\$(UNITBL); \ fi -if [ -f $(DICTTBL) ]; then \ cp -p $(DICTTBL) $(IPKWDIR)\$(BINDIR); \ $(CHMOD) a+r-x $(IPKWDIR)\$(BINDIR)\$(DICTTBL); \ fi -if [ -f $(CATTBL) ]; then \ cp -p $(CATTBL) $(IPKWDIR)\$(BINDIR); \ $(CHMOD) a+r-x $(IPKWDIR)\$(BINDIR)\$(CATTBL); \ fi -if [ -f $(ECATTBL) ]; then \ cp -p $(ECATTBL) $(IPKWDIR)\$(BINDIR); \ $(CHMOD) a+r-x $(IPKWDIR)\$(BINDIR)\$(ECATTBL); \ fi $(ECHO) "Package: fd" > $(IPKWDIR)\CONTROL\control $(ECHO) "Priority: optional" >> $(IPKWDIR)\CONTROL\control $(ECHO) "Section: extras" >> $(IPKWDIR)\CONTROL\control $(ECHO) "Maintainer: $(DIST)" >> $(IPKWDIR)\CONTROL\control $(ECHO) "Architecture: arm" >> $(IPKWDIR)\CONTROL\control $(ECHO) "Version: $(VERSION)-1" >> $(IPKWDIR)\CONTROL\control $(ECHO) "Depends: ncurses" >> $(IPKWDIR)\CONTROL\control $(ECHO) "Description: a file & directory maintenance tool." \ >> $(IPKWDIR)\CONTROL\control (cd $(IPKWDIR); tar cf ..\data.tar --exclude=CONTROL .) (cd $(IPKWDIR)\CONTROL; tar cf ..\..\control.tar .) gzip .\data.tar $(MV) .\data.tar.gz $(IPKTDIR) gzip .\control.tar $(MV) .\control.tar.gz $(IPKTDIR) $(ECHO) "2.0" > $(IPKTDIR)\debian-binary (cd $(IPKTDIR); \ tar cf ..\ipk.tar .\debian-binary .\data.tar.gz .\control.tar.gz) gzip .\ipk.tar $(MV) .\ipk.tar.gz .\fd_$(VERSION)-1_arm.ipk -$(RM) -r $(IPKWDIR) $(IPKTDIR) clean: -$(RM) core -$(RM) *$(OBJ) -$(RM) funcno.h -$(RM) kanji.h -$(RM) _fd-cat.ja -$(RM) _fd-cat.C -$(RM) fd-cat.* -$(RM) kanjicnv$(EXE) -$(RM) expfunc$(EXE) -$(RM) mkdir_p$(EXE) -$(RM) mkfuncno$(EXE) -$(RM) mkunitbl$(EXE) -$(RM) mkdict$(EXE) -$(RM) mktankan$(EXE) -$(RM) mkkanji$(EXE) -$(RM) mkcat$(EXE) -$(RM) fdsh$(EXE) -$(RM) fdbsh$(EXE) -$(RM) fdnsh$(EXE) -$(RM) $(PROGRAM)$(EXE) -$(RM) $(PROGRAM).$(MANSEC) -$(RM) $(PROGRAM).$(MANSEC)c -$(RM) $(PROGRAM).eng -$(RM) $(PROGRAM).doc -$(RM) $(ARGS) -$(RM) $(SARGS) -$(RM) $(NARGS) -$(RM) $(UNITBL) -$(RM) unitbl.c -$(RM) dicttbl.c -$(RM) $(DICTTXT) -$(RM) $(DICTTBL) # DO NOT DELETE THIS LINE -- make depend depends on it. main$(OBJ): fd.h headers.h machine.h config.h main$(OBJ): depend.h printf.h main$(OBJ): stream.h kctype.h main$(OBJ): string.h malloc.h time.h log.h termio.h main$(OBJ): realpath.h main$(OBJ): parse.h kconv.h func.h sysemu.h dirent.h unixemu.h main$(OBJ): pathname.h main$(OBJ): typesize.h term.h types.h lsparse.h namelist.h dosdisk.h main$(OBJ): kanji.h catalog.h version.h system.h wait.h main$(OBJ): termemu.h roman.h urldisk.h url.h auth.h printf$(OBJ): headers.h machine.h config.h printf$(OBJ): depend.h printf.h stream.h kctype.h printf$(OBJ): typesize.h string.h printf$(OBJ): kconv.h termio$(OBJ): headers.h machine.h config.h termio$(OBJ): depend.h typesize.h sysemu.h dirent.h termio$(OBJ): unixemu.h termio$(OBJ): stream.h termio.h term$(OBJ): headers.h machine.h config.h term$(OBJ): depend.h printf.h term$(OBJ): stream.h kctype.h term$(OBJ): typesize.h string.h termio.h term$(OBJ): term.h stream$(OBJ): headers.h machine.h config.h stream$(OBJ): depend.h typesize.h malloc.h sysemu.h stream$(OBJ): dirent.h unixemu.h stream$(OBJ): stream.h pathname.h termio.h stream$(OBJ): socket.h string$(OBJ): headers.h machine.h config.h string$(OBJ): kctype.h depend.h string$(OBJ): string.h malloc$(OBJ): headers.h machine.h config.h malloc$(OBJ): printf.h stream.h depend.h malloc.h malloc$(OBJ): sysemu.h dirent.h unixemu.h time$(OBJ): headers.h machine.h config.h time$(OBJ): typesize.h time$(OBJ): string.h time.h pathname$(OBJ): fd.h headers.h machine.h config.h pathname$(OBJ): depend.h printf.h stream.h kctype.h pathname$(OBJ): string.h malloc.h pathname$(OBJ): dirent.h unixemu.h pathname$(OBJ): sysemu.h pathname.h typesize.h pathname$(OBJ): url.h system$(OBJ): fd.h headers.h machine.h config.h system$(OBJ): depend.h printf.h stream.h kctype.h system$(OBJ): string.h malloc.h system$(OBJ): term.h types.h typesize.h lsparse.h namelist.h kconv.h system$(OBJ): dirent.h unixemu.h system$(OBJ): sysemu.h system.h pathname.h termio.h system$(OBJ): wait.h system$(OBJ): termemu.h posixsh.h socket.h url.h system$(OBJ): urldisk.h auth.h posixsh$(OBJ): fd.h headers.h machine.h config.h posixsh$(OBJ): depend.h printf.h stream.h kctype.h posixsh$(OBJ): string.h malloc.h posixsh$(OBJ): sysemu.h dirent.h unixemu.h posixsh$(OBJ): system.h pathname.h typesize.h posixsh$(OBJ): termio.h posixsh$(OBJ): wait.h posixsh$(OBJ): termemu.h time.h posixsh.h term.h doscom$(OBJ): fd.h headers.h machine.h config.h doscom$(OBJ): depend.h printf.h stream.h kctype.h doscom$(OBJ): string.h malloc.h doscom$(OBJ): term.h types.h typesize.h lsparse.h namelist.h dirent.h doscom$(OBJ): unixemu.h doscom$(OBJ): sysemu.h system.h pathname.h termio.h doscom$(OBJ): wait.h doscom$(OBJ): realpath.h urldisk.h url.h auth.h log$(OBJ): fd.h headers.h machine.h config.h log$(OBJ): depend.h printf.h log$(OBJ): stream.h kctype.h log$(OBJ): string.h malloc.h func.h sysemu.h dirent.h unixemu.h log$(OBJ): pathname.h log$(OBJ): typesize.h term.h types.h lsparse.h namelist.h dosdisk.h sysemu$(OBJ): fd.h headers.h machine.h config.h sysemu$(OBJ): depend.h printf.h stream.h kctype.h sysemu$(OBJ): string.h malloc.h sysemu$(OBJ): kconv.h sysemu.h dirent.h unixemu.h sysemu$(OBJ): log.h pathname.h typesize.h termio.h sysemu$(OBJ): realpath.h dosdisk.h socket.h sysemu$(OBJ): urldisk.h namelist.h url.h auth.h dosdisk$(OBJ): headers.h machine.h config.h dosdisk$(OBJ): depend.h kctype.h dosdisk$(OBJ): string.h time.h sysemu.h dirent.h dosdisk$(OBJ): unixemu.h dosdisk$(OBJ): stream.h pathname.h typesize.h dosdisk.h unixdisk.h kconv.h unixdisk$(OBJ): headers.h machine.h config.h unixdisk$(OBJ): depend.h kctype.h unixdisk$(OBJ): string.h sysemu.h dirent.h unixemu.h unixdisk$(OBJ): stream.h unixdisk$(OBJ): pathname.h typesize.h dosdisk.h unixdisk.h realpath$(OBJ): fd.h headers.h machine.h config.h realpath$(OBJ): depend.h printf.h stream.h kctype.h realpath$(OBJ): string.h malloc.h realpath$(OBJ): sysemu.h dirent.h unixemu.h realpath$(OBJ): pathname.h typesize.h realpath.h realpath$(OBJ): url.h encode$(OBJ): headers.h machine.h config.h encode$(OBJ): kctype.h depend.h encode$(OBJ): sysemu.h dirent.h unixemu.h encode$(OBJ): stream.h encode$(OBJ): pathname.h typesize.h encode.h libc$(OBJ): fd.h headers.h machine.h config.h libc$(OBJ): depend.h printf.h libc$(OBJ): stream.h kctype.h libc$(OBJ): string.h malloc.h log.h realpath.h parse.h kconv.h func.h libc$(OBJ): sysemu.h dirent.h unixemu.h libc$(OBJ): pathname.h typesize.h term.h types.h libc$(OBJ): lsparse.h namelist.h dosdisk.h kanji.h catalog.h system.h libc$(OBJ): termio.h libc$(OBJ): wait.h libc$(OBJ): termemu.h url.h file$(OBJ): fd.h headers.h machine.h config.h file$(OBJ): depend.h printf.h file$(OBJ): stream.h kctype.h file$(OBJ): string.h malloc.h time.h termio.h file$(OBJ): realpath.h file$(OBJ): kconv.h func.h sysemu.h dirent.h unixemu.h file$(OBJ): pathname.h typesize.h term.h types.h file$(OBJ): lsparse.h namelist.h dosdisk.h kanji.h catalog.h urldisk.h file$(OBJ): url.h auth.h mntinfo$(OBJ): headers.h machine.h config.h mntinfo$(OBJ): kctype.h depend.h mntinfo$(OBJ): string.h malloc.h pathname.h mntinfo$(OBJ): typesize.h mntinfo.h fsinfo.h statfs$(OBJ): headers.h machine.h config.h statfs$(OBJ): fsinfo.h apply$(OBJ): fd.h headers.h machine.h config.h apply$(OBJ): depend.h printf.h stream.h kctype.h apply$(OBJ): string.h malloc.h apply$(OBJ): time.h realpath.h parse.h func.h sysemu.h dirent.h unixemu.h apply$(OBJ): pathname.h apply$(OBJ): typesize.h term.h types.h lsparse.h namelist.h dosdisk.h apply$(OBJ): kanji.h catalog.h pty$(OBJ): fd.h headers.h machine.h config.h pty$(OBJ): depend.h printf.h pty$(OBJ): stream.h kctype.h pty$(OBJ): string.h malloc.h sysemu.h dirent.h unixemu.h pty$(OBJ): pathname.h pty$(OBJ): typesize.h termio.h termemu$(OBJ): fd.h headers.h machine.h config.h termemu$(OBJ): depend.h printf.h stream.h kctype.h termemu$(OBJ): string.h malloc.h termemu$(OBJ): wait.h unixemu.h termio.h termemu$(OBJ): func.h sysemu.h dirent.h termemu$(OBJ): pathname.h termemu$(OBJ): typesize.h term.h types.h lsparse.h namelist.h dosdisk.h termemu$(OBJ): kanji.h catalog.h system.h termemu.h frontend$(OBJ): fd.h headers.h machine.h config.h frontend$(OBJ): depend.h printf.h stream.h kctype.h frontend$(OBJ): string.h malloc.h frontend$(OBJ): wait.h unixemu.h parse.h func.h frontend$(OBJ): sysemu.h dirent.h frontend$(OBJ): pathname.h typesize.h term.h frontend$(OBJ): types.h lsparse.h namelist.h dosdisk.h funcno.h kanji.h frontend$(OBJ): catalog.h system.h termio.h frontend$(OBJ): termemu.h frontend$(OBJ): roman.h backend$(OBJ): fd.h headers.h machine.h config.h backend$(OBJ): depend.h printf.h stream.h kctype.h backend$(OBJ): string.h malloc.h backend$(OBJ): termio.h backend$(OBJ): kconv.h func.h sysemu.h backend$(OBJ): dirent.h unixemu.h backend$(OBJ): pathname.h typesize.h term.h types.h backend$(OBJ): lsparse.h namelist.h dosdisk.h system.h wait.h backend$(OBJ): termemu.h parse$(OBJ): fd.h headers.h machine.h config.h parse$(OBJ): depend.h printf.h stream.h kctype.h parse$(OBJ): string.h malloc.h parse$(OBJ): pathname.h typesize.h term.h types.h lsparse.h namelist.h parse$(OBJ): kconv.h sysemu.h dirent.h unixemu.h parse$(OBJ): realpath.h parse.h system.h termio.h parse$(OBJ): wait.h builtin$(OBJ): fd.h headers.h machine.h config.h builtin$(OBJ): depend.h printf.h stream.h kctype.h builtin$(OBJ): string.h malloc.h builtin$(OBJ): encode.h parse.h kconv.h func.h sysemu.h dirent.h unixemu.h builtin$(OBJ): pathname.h builtin$(OBJ): typesize.h term.h types.h lsparse.h namelist.h dosdisk.h builtin$(OBJ): funcno.h kanji.h catalog.h system.h termio.h builtin$(OBJ): wait.h builtin$(OBJ): termemu.h roman.h shell$(OBJ): fd.h headers.h machine.h config.h shell$(OBJ): depend.h printf.h stream.h kctype.h shell$(OBJ): string.h malloc.h shell$(OBJ): realpath.h parse.h kconv.h func.h sysemu.h dirent.h unixemu.h shell$(OBJ): pathname.h shell$(OBJ): typesize.h term.h types.h lsparse.h namelist.h dosdisk.h shell$(OBJ): kanji.h catalog.h system.h termio.h shell$(OBJ): wait.h shell$(OBJ): termemu.h socket$(OBJ): headers.h machine.h config.h socket$(OBJ): depend.h printf.h stream.h kctype.h socket$(OBJ): typesize.h malloc.h socket$(OBJ): sysemu.h dirent.h unixemu.h socket$(OBJ): termio.h socket$(OBJ): socket.h url$(OBJ): headers.h machine.h config.h url$(OBJ): depend.h printf.h url$(OBJ): stream.h kctype.h url$(OBJ): typesize.h string.h malloc.h sysemu.h dirent.h unixemu.h url$(OBJ): pathname.h url.h auth$(OBJ): headers.h machine.h config.h auth$(OBJ): depend.h printf.h auth$(OBJ): stream.h string.h malloc.h time.h pathname.h typesize.h auth$(OBJ): encode.h parse.h socket.h auth.h url.h auth$(OBJ): system.h termio.h auth$(OBJ): wait.h auth$(OBJ): unixemu.h kanji.h catalog.h ftp$(OBJ): headers.h machine.h config.h ftp$(OBJ): depend.h printf.h ftp$(OBJ): stream.h kctype.h ftp$(OBJ): string.h malloc.h time.h sysemu.h dirent.h unixemu.h ftp$(OBJ): pathname.h ftp$(OBJ): typesize.h termio.h ftp$(OBJ): parse.h ftp$(OBJ): lsparse.h namelist.h socket.h auth.h ftp$(OBJ): url.h urldisk.h html$(OBJ): headers.h machine.h config.h html$(OBJ): depend.h printf.h html$(OBJ): stream.h kctype.h html$(OBJ): typesize.h string.h malloc.h sysemu.h dirent.h unixemu.h html$(OBJ): pathname.h termio.h html$(OBJ): parse.h html.h urldisk.h html$(OBJ): namelist.h url.h auth.h http$(OBJ): headers.h machine.h config.h http$(OBJ): depend.h printf.h http$(OBJ): stream.h kctype.h http$(OBJ): string.h malloc.h time.h sysemu.h dirent.h unixemu.h http$(OBJ): pathname.h http$(OBJ): typesize.h termio.h http$(OBJ): parse.h http$(OBJ): lsparse.h namelist.h socket.h auth.h http$(OBJ): url.h html.h urldisk.h urldisk$(OBJ): headers.h machine.h config.h urldisk$(OBJ): depend.h printf.h stream.h string.h urldisk$(OBJ): malloc.h time.h sysemu.h dirent.h unixemu.h urldisk$(OBJ): pathname.h urldisk$(OBJ): typesize.h termio.h urldisk$(OBJ): realpath.h urldisk$(OBJ): lsparse.h namelist.h socket.h urldisk$(OBJ): urldisk.h url.h auth.h catalog$(OBJ): fd.h headers.h machine.h config.h catalog$(OBJ): depend.h printf.h stream.h kctype.h catalog$(OBJ): string.h malloc.h catalog$(OBJ): termio.h catalog$(OBJ): func.h sysemu.h dirent.h catalog$(OBJ): unixemu.h catalog$(OBJ): pathname.h typesize.h term.h types.h lsparse.h namelist.h catalog$(OBJ): dosdisk.h kanji.h catalog.h kconv$(OBJ): fd.h headers.h machine.h config.h kconv$(OBJ): depend.h printf.h stream.h kctype.h kconv$(OBJ): string.h malloc.h kconv$(OBJ): termio.h kconv$(OBJ): realpath.h parse.h func.h kconv$(OBJ): sysemu.h dirent.h unixemu.h kconv$(OBJ): pathname.h typesize.h term.h types.h kconv$(OBJ): lsparse.h namelist.h dosdisk.h kconv.h termemu.h input$(OBJ): fd.h headers.h machine.h config.h input$(OBJ): depend.h printf.h stream.h kctype.h input$(OBJ): string.h malloc.h input$(OBJ): wait.h unixemu.h parse.h kconv.h func.h input$(OBJ): sysemu.h dirent.h input$(OBJ): pathname.h typesize.h term.h types.h lsparse.h namelist.h input$(OBJ): dosdisk.h kanji.h catalog.h system.h termio.h input$(OBJ): termemu.h ime$(OBJ): fd.h headers.h machine.h config.h ime$(OBJ): depend.h printf.h ime$(OBJ): stream.h kctype.h ime$(OBJ): string.h malloc.h wait.h unixemu.h ime$(OBJ): parse.h kconv.h roman.h func.h sysemu.h dirent.h ime$(OBJ): pathname.h ime$(OBJ): typesize.h term.h types.h lsparse.h namelist.h dosdisk.h ime$(OBJ): kanji.h catalog.h termemu.h dict$(OBJ): fd.h headers.h machine.h config.h dict$(OBJ): depend.h printf.h dict$(OBJ): stream.h kctype.h dict$(OBJ): string.h malloc.h termio.h dict$(OBJ): roman.h dict$(OBJ): hinsi.h func.h sysemu.h dirent.h unixemu.h dict$(OBJ): pathname.h typesize.h term.h types.h dict$(OBJ): lsparse.h namelist.h dosdisk.h parse.h kconv.h roman$(OBJ): headers.h machine.h config.h roman$(OBJ): depend.h kctype.h roman$(OBJ): typesize.h string.h kconv.h roman.h info$(OBJ): fd.h headers.h machine.h config.h info$(OBJ): depend.h printf.h info$(OBJ): stream.h kctype.h info$(OBJ): string.h malloc.h dirent.h unixemu.h info$(OBJ): sysemu.h pathname.h typesize.h term.h info$(OBJ): types.h lsparse.h namelist.h funcno.h kanji.h catalog.h info$(OBJ): unixdisk.h mntinfo.h fsinfo.h rockridg$(OBJ): fd.h headers.h machine.h config.h rockridg$(OBJ): depend.h printf.h stream.h kctype.h rockridg$(OBJ): string.h malloc.h rockridg$(OBJ): device.h parse.h func.h sysemu.h dirent.h unixemu.h rockridg$(OBJ): pathname.h rockridg$(OBJ): typesize.h term.h types.h lsparse.h namelist.h dosdisk.h tree$(OBJ): fd.h headers.h machine.h config.h tree$(OBJ): depend.h printf.h tree$(OBJ): stream.h kctype.h tree$(OBJ): string.h malloc.h func.h sysemu.h dirent.h unixemu.h tree$(OBJ): pathname.h tree$(OBJ): typesize.h term.h types.h lsparse.h namelist.h dosdisk.h tree$(OBJ): kanji.h catalog.h lsparse$(OBJ): fd.h headers.h machine.h config.h lsparse$(OBJ): depend.h printf.h stream.h kctype.h lsparse$(OBJ): string.h malloc.h lsparse$(OBJ): time.h dirent.h unixemu.h lsparse$(OBJ): pathname.h typesize.h device.h lsparse$(OBJ): parse.h lsparse.h namelist.h kconv.h archive$(OBJ): fd.h headers.h machine.h config.h archive$(OBJ): depend.h printf.h stream.h kctype.h archive$(OBJ): string.h malloc.h archive$(OBJ): realpath.h kconv.h func.h sysemu.h dirent.h unixemu.h archive$(OBJ): pathname.h archive$(OBJ): typesize.h term.h types.h lsparse.h namelist.h dosdisk.h archive$(OBJ): kanji.h catalog.h system.h termio.h archive$(OBJ): wait.h archive$(OBJ): termemu.h custom$(OBJ): fd.h headers.h machine.h config.h custom$(OBJ): depend.h printf.h stream.h kctype.h custom$(OBJ): string.h malloc.h custom$(OBJ): parse.h kconv.h func.h sysemu.h dirent.h unixemu.h custom$(OBJ): pathname.h custom$(OBJ): typesize.h term.h types.h lsparse.h namelist.h dosdisk.h custom$(OBJ): funcno.h kanji.h catalog.h system.h termio.h custom$(OBJ): wait.h custom$(OBJ): termemu.h urldisk.h url.h auth.h command$(OBJ): fd.h headers.h machine.h config.h command$(OBJ): depend.h printf.h stream.h kctype.h command$(OBJ): string.h malloc.h command$(OBJ): parse.h func.h sysemu.h dirent.h unixemu.h command$(OBJ): pathname.h command$(OBJ): typesize.h term.h types.h lsparse.h namelist.h dosdisk.h command$(OBJ): funcno.h kanji.h catalog.h system.h termio.h command$(OBJ): wait.h command$(OBJ): termemu.h functabl.h browse$(OBJ): fd.h headers.h machine.h config.h browse$(OBJ): depend.h printf.h stream.h kctype.h browse$(OBJ): string.h malloc.h browse$(OBJ): device.h parse.h kconv.h func.h sysemu.h dirent.h unixemu.h browse$(OBJ): pathname.h browse$(OBJ): typesize.h term.h types.h lsparse.h namelist.h dosdisk.h browse$(OBJ): funcno.h kanji.h catalog.h termemu.h unitbl$(OBJ): headers.h machine.h config.h dicttbl$(OBJ): headers.h machine.h config.h sprintf$(OBJ): headers.h machine.h config.h sprintf$(OBJ): depend.h printf.h stream.h kctype.h sprintf$(OBJ): typesize.h string.h stermio$(OBJ): headers.h machine.h config.h stermio$(OBJ): depend.h typesize.h sysemu.h dirent.h stermio$(OBJ): unixemu.h stermio$(OBJ): stream.h termio.h sstream$(OBJ): headers.h machine.h config.h sstream$(OBJ): depend.h typesize.h malloc.h sysemu.h sstream$(OBJ): dirent.h unixemu.h sstream$(OBJ): stream.h pathname.h termio.h sstring$(OBJ): headers.h machine.h config.h sstring$(OBJ): kctype.h depend.h sstring$(OBJ): string.h smalloc$(OBJ): headers.h machine.h config.h smalloc$(OBJ): printf.h stream.h depend.h malloc.h smalloc$(OBJ): sysemu.h dirent.h unixemu.h stime$(OBJ): headers.h machine.h config.h stime$(OBJ): typesize.h string.h time.h spathnam$(OBJ): headers.h machine.h config.h spathnam$(OBJ): depend.h spathnam$(OBJ): printf.h stream.h kctype.h spathnam$(OBJ): string.h malloc.h dirent.h unixemu.h spathnam$(OBJ): sysemu.h spathnam$(OBJ): pathname.h typesize.h ssystem$(OBJ): headers.h machine.h config.h ssystem$(OBJ): depend.h printf.h stream.h kctype.h ssystem$(OBJ): string.h malloc.h ssystem$(OBJ): dirent.h unixemu.h ssystem$(OBJ): sysemu.h system.h pathname.h ssystem$(OBJ): typesize.h termio.h ssystem$(OBJ): wait.h ssystem$(OBJ): termemu.h time.h posixsh.h sposixsh$(OBJ): headers.h machine.h config.h sposixsh$(OBJ): depend.h printf.h stream.h kctype.h sposixsh$(OBJ): string.h malloc.h sposixsh$(OBJ): sysemu.h dirent.h unixemu.h sposixsh$(OBJ): system.h pathname.h typesize.h sposixsh$(OBJ): termio.h sposixsh$(OBJ): wait.h sposixsh$(OBJ): termemu.h time.h posixsh.h sdoscom$(OBJ): headers.h machine.h config.h sdoscom$(OBJ): depend.h printf.h stream.h kctype.h sdoscom$(OBJ): string.h malloc.h sdoscom$(OBJ): dirent.h unixemu.h sdoscom$(OBJ): sysemu.h system.h pathname.h sdoscom$(OBJ): typesize.h termio.h sdoscom$(OBJ): wait.h ssysemu$(OBJ): headers.h machine.h config.h ssysemu$(OBJ): depend.h printf.h stream.h kctype.h ssysemu$(OBJ): string.h malloc.h ssysemu$(OBJ): sysemu.h dirent.h unixemu.h ssysemu$(OBJ): log.h pathname.h typesize.h termio.h ssysemu$(OBJ): realpath.h bprintf$(OBJ): headers.h machine.h config.h bprintf$(OBJ): depend.h printf.h stream.h kctype.h bprintf$(OBJ): typesize.h string.h btermio$(OBJ): headers.h machine.h config.h btermio$(OBJ): depend.h typesize.h sysemu.h dirent.h btermio$(OBJ): unixemu.h btermio$(OBJ): stream.h termio.h bstream$(OBJ): headers.h machine.h config.h bstream$(OBJ): depend.h typesize.h malloc.h sysemu.h bstream$(OBJ): dirent.h unixemu.h bstream$(OBJ): stream.h pathname.h termio.h bstring$(OBJ): headers.h machine.h config.h bstring$(OBJ): kctype.h depend.h bstring$(OBJ): string.h bmalloc$(OBJ): headers.h machine.h config.h bmalloc$(OBJ): printf.h stream.h depend.h malloc.h bmalloc$(OBJ): sysemu.h dirent.h unixemu.h bpathnam$(OBJ): headers.h machine.h config.h bpathnam$(OBJ): depend.h bpathnam$(OBJ): printf.h stream.h kctype.h bpathnam$(OBJ): string.h malloc.h dirent.h unixemu.h bpathnam$(OBJ): sysemu.h bpathnam$(OBJ): pathname.h typesize.h bsystem$(OBJ): headers.h machine.h config.h bsystem$(OBJ): depend.h printf.h stream.h kctype.h bsystem$(OBJ): string.h malloc.h bsystem$(OBJ): dirent.h unixemu.h bsystem$(OBJ): sysemu.h system.h pathname.h bsystem$(OBJ): typesize.h termio.h bsystem$(OBJ): wait.h bsystem$(OBJ): termemu.h bdoscom$(OBJ): headers.h machine.h config.h bdoscom$(OBJ): depend.h printf.h stream.h kctype.h bdoscom$(OBJ): string.h malloc.h bdoscom$(OBJ): dirent.h unixemu.h bdoscom$(OBJ): sysemu.h system.h pathname.h bdoscom$(OBJ): typesize.h termio.h bdoscom$(OBJ): wait.h bsysemu$(OBJ): headers.h machine.h config.h bsysemu$(OBJ): depend.h printf.h stream.h kctype.h bsysemu$(OBJ): string.h malloc.h bsysemu$(OBJ): sysemu.h dirent.h unixemu.h bsysemu$(OBJ): log.h pathname.h typesize.h termio.h bsysemu$(OBJ): realpath.h nprintf$(OBJ): headers.h machine.h config.h nprintf$(OBJ): depend.h printf.h stream.h kctype.h nprintf$(OBJ): typesize.h string.h ntermio$(OBJ): headers.h machine.h config.h ntermio$(OBJ): depend.h typesize.h sysemu.h dirent.h ntermio$(OBJ): unixemu.h ntermio$(OBJ): stream.h termio.h nstream$(OBJ): headers.h machine.h config.h nstream$(OBJ): depend.h typesize.h malloc.h sysemu.h nstream$(OBJ): dirent.h unixemu.h nstream$(OBJ): stream.h pathname.h termio.h nstream$(OBJ): socket.h nstring$(OBJ): headers.h machine.h config.h nstring$(OBJ): kctype.h depend.h nstring$(OBJ): string.h nmalloc$(OBJ): headers.h machine.h config.h nmalloc$(OBJ): printf.h stream.h depend.h malloc.h nmalloc$(OBJ): sysemu.h dirent.h unixemu.h ntime$(OBJ): headers.h machine.h config.h ntime$(OBJ): typesize.h string.h time.h npathnam$(OBJ): headers.h machine.h config.h npathnam$(OBJ): depend.h npathnam$(OBJ): printf.h stream.h kctype.h npathnam$(OBJ): string.h malloc.h dirent.h unixemu.h npathnam$(OBJ): sysemu.h npathnam$(OBJ): pathname.h typesize.h url.h nsystem$(OBJ): headers.h machine.h config.h nsystem$(OBJ): depend.h printf.h stream.h kctype.h nsystem$(OBJ): string.h malloc.h nsystem$(OBJ): dirent.h unixemu.h nsystem$(OBJ): sysemu.h system.h pathname.h nsystem$(OBJ): typesize.h termio.h nsystem$(OBJ): wait.h nsystem$(OBJ): termemu.h time.h posixsh.h socket.h nsystem$(OBJ): url.h urldisk.h namelist.h auth.h nposixsh$(OBJ): headers.h machine.h config.h nposixsh$(OBJ): depend.h printf.h stream.h kctype.h nposixsh$(OBJ): string.h malloc.h nposixsh$(OBJ): sysemu.h dirent.h unixemu.h nposixsh$(OBJ): system.h pathname.h typesize.h nposixsh$(OBJ): termio.h nposixsh$(OBJ): wait.h nposixsh$(OBJ): termemu.h time.h posixsh.h ndoscom$(OBJ): headers.h machine.h config.h ndoscom$(OBJ): depend.h printf.h stream.h kctype.h ndoscom$(OBJ): string.h malloc.h ndoscom$(OBJ): dirent.h unixemu.h ndoscom$(OBJ): sysemu.h system.h pathname.h ndoscom$(OBJ): typesize.h termio.h ndoscom$(OBJ): wait.h ndoscom$(OBJ): realpath.h urldisk.h namelist.h url.h ndoscom$(OBJ): auth.h nsysemu$(OBJ): headers.h machine.h config.h nsysemu$(OBJ): depend.h printf.h stream.h kctype.h nsysemu$(OBJ): string.h malloc.h nsysemu$(OBJ): sysemu.h dirent.h unixemu.h nsysemu$(OBJ): log.h pathname.h typesize.h termio.h nsysemu$(OBJ): realpath.h socket.h nsysemu$(OBJ): urldisk.h namelist.h url.h auth.h nrealpat$(OBJ): headers.h machine.h config.h nrealpat$(OBJ): depend.h nrealpat$(OBJ): printf.h stream.h kctype.h nrealpat$(OBJ): string.h sysemu.h dirent.h unixemu.h nrealpat$(OBJ): pathname.h nrealpat$(OBJ): typesize.h realpath.h url.h nencode$(OBJ): headers.h machine.h config.h nencode$(OBJ): kctype.h depend.h nencode$(OBJ): sysemu.h dirent.h unixemu.h nencode$(OBJ): stream.h nencode$(OBJ): pathname.h typesize.h encode.h nparse$(OBJ): headers.h machine.h config.h nparse$(OBJ): depend.h printf.h stream.h kctype.h nparse$(OBJ): string.h malloc.h nparse$(OBJ): sysemu.h dirent.h unixemu.h nparse$(OBJ): realpath.h parse.h system.h nparse$(OBJ): pathname.h typesize.h termio.h nparse$(OBJ): wait.h nsocket$(OBJ): headers.h machine.h config.h nsocket$(OBJ): depend.h printf.h stream.h kctype.h nsocket$(OBJ): typesize.h malloc.h nsocket$(OBJ): sysemu.h dirent.h unixemu.h nsocket$(OBJ): termio.h nsocket$(OBJ): socket.h nurl$(OBJ): headers.h machine.h config.h nurl$(OBJ): depend.h printf.h nurl$(OBJ): stream.h kctype.h nurl$(OBJ): typesize.h string.h malloc.h sysemu.h dirent.h unixemu.h nurl$(OBJ): pathname.h url.h nauth$(OBJ): headers.h machine.h config.h nauth$(OBJ): depend.h printf.h stream.h string.h nauth$(OBJ): malloc.h time.h pathname.h typesize.h encode.h parse.h nauth$(OBJ): socket.h auth.h url.h system.h nauth$(OBJ): termio.h nauth$(OBJ): wait.h unixemu.h nauth$(OBJ): sysemu.h dirent.h nftp$(OBJ): headers.h machine.h config.h nftp$(OBJ): depend.h printf.h nftp$(OBJ): stream.h kctype.h nftp$(OBJ): string.h malloc.h time.h sysemu.h dirent.h unixemu.h nftp$(OBJ): pathname.h nftp$(OBJ): typesize.h termio.h nftp$(OBJ): parse.h nftp$(OBJ): lsparse.h namelist.h socket.h auth.h nftp$(OBJ): url.h urldisk.h nhtml$(OBJ): headers.h machine.h config.h nhtml$(OBJ): depend.h printf.h stream.h kctype.h nhtml$(OBJ): typesize.h string.h nhtml$(OBJ): malloc.h sysemu.h dirent.h unixemu.h nhtml$(OBJ): pathname.h termio.h nhtml$(OBJ): parse.h html.h urldisk.h nhtml$(OBJ): namelist.h url.h auth.h nhttp$(OBJ): headers.h machine.h config.h nhttp$(OBJ): depend.h printf.h stream.h kctype.h nhttp$(OBJ): string.h malloc.h nhttp$(OBJ): time.h sysemu.h dirent.h unixemu.h nhttp$(OBJ): pathname.h typesize.h termio.h nhttp$(OBJ): parse.h lsparse.h namelist.h nhttp$(OBJ): socket.h auth.h url.h html.h nhttp$(OBJ): urldisk.h nurldisk$(OBJ): headers.h machine.h config.h nurldisk$(OBJ): depend.h printf.h stream.h string.h nurldisk$(OBJ): malloc.h time.h sysemu.h dirent.h unixemu.h nurldisk$(OBJ): pathname.h nurldisk$(OBJ): typesize.h termio.h nurldisk$(OBJ): realpath.h nurldisk$(OBJ): lsparse.h namelist.h socket.h nurldisk$(OBJ): urldisk.h url.h auth.h nlsparse$(OBJ): headers.h machine.h config.h nlsparse$(OBJ): depend.h kctype.h nlsparse$(OBJ): string.h malloc.h time.h dirent.h nlsparse$(OBJ): unixemu.h nlsparse$(OBJ): pathname.h typesize.h device.h parse.h lsparse.h namelist.h evalopt$(OBJ): headers.h machine.h config.h evalopt$(OBJ): evalopt.h gentbl$(OBJ): headers.h machine.h config.h gentbl$(OBJ): gentbl.h mkunitbl$(OBJ): headers.h machine.h config.h mkunitbl$(OBJ): typesize.h evalopt.h gentbl.h mkdict$(OBJ): headers.h machine.h config.h mkdict$(OBJ): kctype.h depend.h mkdict$(OBJ): typesize.h string.h kconv.h roman.h mkdict$(OBJ): hinsi.h evalopt.h gentbl.h mktankan$(OBJ): headers.h machine.h config.h mktankan$(OBJ): kctype.h depend.h mktankan$(OBJ): typesize.h kconv.h roman.h mkkanji$(OBJ): headers.h machine.h config.h mkkanji$(OBJ): typesize.h mkcat$(OBJ): headers.h machine.h config.h mkcat$(OBJ): kctype.h depend.h mkcat$(OBJ): typesize.h version.h evalopt.h gentbl.h mkdir_p$(OBJ): headers.h machine.h config.h mkdir_p$(OBJ): kctype.h depend.h mkdir_p$(OBJ): typesize.h kanjicnv$(OBJ): headers.h machine.h config.h kanjicnv$(OBJ): evalopt.h expfunc$(OBJ): headers.h machine.h config.h mkfuncno$(OBJ): fd.h headers.h machine.h config.h mkfuncno$(OBJ): depend.h types.h typesize.h stream.h mkfuncno$(OBJ): lsparse.h namelist.h functabl.h tstring$(OBJ): headers.h machine.h config.h tstring$(OBJ): kctype.h depend.h tstring$(OBJ): string.h troman$(OBJ): headers.h machine.h config.h troman$(OBJ): depend.h kctype.h troman$(OBJ): typesize.h string.h kconv.h roman.h tkconv$(OBJ): headers.h machine.h config.h tkconv$(OBJ): depend.h kctype.h tkconv$(OBJ): typesize.h string.h unixemu.h kconv.h tkconv$(OBJ): termemu.h pathname.h tevalopt$(OBJ): headers.h machine.h config.h tevalopt$(OBJ): evalopt.h tgentbl$(OBJ): headers.h machine.h config.h tgentbl$(OBJ): gentbl.h tunitbl$(OBJ): headers.h machine.h config.h FD-3.01j/makefile.bpc100644 2105 1751 153650 13516612560 13176 0ustar shiraiuser# # Makefile for fd # TITLE = FD- VERMAJ = 3 VERSION = 3.01j PREFIX = CONFDIR = BUILD = MANSEC = 1 BINTOP = $(PREFIX)\bin BINDIR = $(BUILD)$(BINTOP) DATATOP = $(PREFIX)\share DATADIR = $(BUILD)$(DATATOP)\fd MANTOP = $(PREFIX)\man MANDIR = $(BUILD)$(MANTOP)\man$(MANSEC) CATDIR = $(BUILD)$(MANTOP)\cat$(MANSEC) JMANDIR = $(BUILD)$(MANTOP)\man$(MANSEC) JCATDIR = $(BUILD)$(MANTOP)\cat$(MANSEC) IPKWDIR = .\ipk.work IPKTDIR = .\ipk.tmp DEPDIR = .\depend.tmp DIST = none DEFRC = $(CONFDIR)\fd2rc BLDRC = $(BUILD)$(DEFRC) DOSRC = ~FD\\fd2rc UNITBL = fd-unicd.tbl DICTTBL = fd-dict.tbl DICTTXT = fd-dict.txt DICTSRC = CATTBL = fd-cat.ja ECATTBL = fd-cat.C TABLES = $(UNITBL) $(CATTBL) $(ECATTBL) SRC = main.c printf.c termio.c term.c stream.c \ string.c malloc.c time.c \ pathname.c system.c posixsh.c doscom.c \ log.c sysemu.c dosdisk.c unixdisk.c \ realpath.c encode.c \ libc.c file.c mntinfo.c statfs.c apply.c \ pty.c termemu.c frontend.c backend.c \ parse.c builtin.c shell.c \ socket.c url.c auth.c \ ftp.c html.c http.c urldisk.c \ catalog.c \ kconv.c input.c ime.c dict.c roman.c \ info.c rockridg.c tree.c \ lsparse.c archive.c \ custom.c command.c browse.c HSRC = evalopt.c gentbl.c \ mkunitbl.c mkdict.c mktankan.c \ mkkanji.c mkcat.c mkdir_p.c \ kanjicnv.c expfunc.c \ mkfuncno.c DSRC = $(DEPDIR)\unitbl.c $(DEPDIR)\dicttbl.c HEADER = fd.h \ headers.h machine.h \ depend.h \ printf.h kctype.h typesize.h \ string.h malloc.h time.h \ dirent.h sysemu.h log.h \ pathname.h system.h posixsh.h wait.h \ termio.h term.h stream.h \ types.h namelist.h \ dosdisk.h unixdisk.h unixemu.h \ realpath.h encode.h termemu.h \ mntinfo.h fsinfo.h device.h parse.h lsparse.h \ socket.h url.h auth.h html.h urldisk.h \ catalog.h \ evalopt.h gentbl.h \ kconv.h roman.h hinsi.h \ func.h functabl.h SSRC = printf.c termio.c stream.c \ string.c malloc.c time.c \ pathname.c system.c posixsh.c doscom.c \ sysemu.c BSRC = printf.c termio.c stream.c \ string.c malloc.c \ pathname.c system.c doscom.c \ sysemu.c NSRC = printf.c termio.c stream.c \ string.c malloc.c time.c \ pathname.c system.c posixsh.c doscom.c \ sysemu.c \ realpath.c encode.c \ parse.c \ socket.c url.c auth.c \ ftp.c html.c http.c urldisk.c \ lsparse.c TSRC = string.c roman.c kconv.c evalopt.c gentbl.c unitbl.c DOC = README.eng HISTORY.eng FAQ.eng TECHKNOW.eng \ Install.eng ToAdmin.eng LICENSES.eng JDOC = README HISTORY FAQ TECHKNOW \ Install ToAdmin LICENSES MANSRC = fd_e.man MANCAT = fd_e.cat JMANSRC = fd.man JMANCAT = fd.cat RUNCOM = fdrc ARGS = object.arg SARGS = sobject.arg NARGS = nobject.arg SRCS = $(DOC) $(MANSRC) $(MANCAT) \ Configur Makefile Makefile.in $(SRC) $(HSRC) $(HEADER) \ makefile.gpc makefile.g98 \ makefile.dpc makefile.d98 \ makefile.lpc makefile.l98 \ makefile.bpc makefile.b98 \ mkmfdosg.sed mkmfdosd.sed mkmfdosl.sed mkmfdosb.sed \ mkmfsed.c \ config.hin version.h \ _fdrc _fdrc.dif fd.spec JSRCS = $(JDOC) $(JMANSRC) $(JMANCAT) \ kanji.hin SOURCES = $(SRCS) $(JSRCS) SHSOURCES = $(NSRC) \ headers.h machine.h \ depend.h \ printf.h kctype.h typesize.h \ string.h malloc.h time.h \ dirent.h sysemu.h log.h \ pathname.h system.h posixsh.h wait.h \ termio.h stream.h \ namelist.h \ unixemu.h \ realpath.h encode.h \ device.h parse.h lsparse.h \ socket.h url.h auth.h html.h urldisk.h \ kanjicnv.c expfunc.c mkmfsed.c \ Configur Makefile Makefile.in \ makefile.gpc makefile.g98 \ makefile.dpc makefile.d98 \ makefile.lpc makefile.l98 \ makefile.bpc makefile.b98 \ mkmfdosg.sed mkmfdosd.sed mkmfdosl.sed mkmfdosb.sed \ config.hin version.h CC = bcc HOSTCC = $(CC) INSTALL = copy /y MAKE = make SHELL = \bin\sh SED = sed ECHO = command /c echo CP = copy /y RM = del LN = copy /y MV = mv CHMOD = chmod LINT = lint TAR = tar LHA = lha SHAR = shar EXE = .exe OBJ = .obj PROGRAM = fd ALIAS = fdsh DOSOBJS = unixdisk$(OBJ) IMEOBJS = ime$(OBJ) dict$(OBJ) roman$(OBJ) SCKOBJS = socket$(OBJ) url$(OBJ) auth$(OBJ) \ ftp$(OBJ) html$(OBJ) http$(OBJ) urldisk$(OBJ) OBJ1 = main$(OBJ) printf$(OBJ) termio$(OBJ) term$(OBJ) stream$(OBJ) \ string$(OBJ) malloc$(OBJ) time$(OBJ) OBJ2 = pathname$(OBJ) system$(OBJ) posixsh$(OBJ) doscom$(OBJ) \ log$(OBJ) sysemu$(OBJ) dosdisk$(OBJ) $(DOSOBJS) OBJ3 = realpath$(OBJ) encode$(OBJ) \ libc$(OBJ) file$(OBJ) mntinfo$(OBJ) statfs$(OBJ) apply$(OBJ) \ pty$(OBJ) termemu$(OBJ) frontend$(OBJ) backend$(OBJ) OBJ4 = parse$(OBJ) builtin$(OBJ) shell$(OBJ) OBJ5 = catalog$(OBJ) \ kconv$(OBJ) input$(OBJ) OBJ6 = info$(OBJ) rockridg$(OBJ) tree$(OBJ) \ lsparse$(OBJ) archive$(OBJ) \ custom$(OBJ) command$(OBJ) browse$(OBJ) SOBJ1 = sprintf$(OBJ) stermio$(OBJ) sstream$(OBJ) \ sstring$(OBJ) smalloc$(OBJ) stime$(OBJ) SOBJ2 = spathnam$(OBJ) ssystem$(OBJ) sposixsh$(OBJ) sdoscom$(OBJ) \ ssysemu$(OBJ) BOBJ = bprintf$(OBJ) btermio$(OBJ) bstream$(OBJ) \ bstring$(OBJ) bmalloc$(OBJ) \ bpathnam$(OBJ) bsystem$(OBJ) bdoscom$(OBJ) \ bsysemu$(OBJ) NOBJ1 = nprintf$(OBJ) ntermio$(OBJ) nstream$(OBJ) \ nstring$(OBJ) nmalloc$(OBJ) ntime$(OBJ) NOBJ2 = npathnam$(OBJ) nsystem$(OBJ) nposixsh$(OBJ) ndoscom$(OBJ) \ nsysemu$(OBJ) \ nrealpat$(OBJ) nencode$(OBJ) NOBJ3 = nparse$(OBJ) \ nsocket$(OBJ) nurl$(OBJ) nauth$(OBJ) \ nftp$(OBJ) nhtml$(OBJ) nhttp$(OBJ) nurldisk$(OBJ) \ nlsparse$(OBJ) KOBJ = tevalopt$(OBJ) COBJ = tevalopt$(OBJ) tgentbl$(OBJ) UOBJ = tevalopt$(OBJ) tgentbl$(OBJ) TOBJ = tstring$(OBJ) troman$(OBJ) tkconv$(OBJ) tevalopt$(OBJ) tgentbl$(OBJ) ALLOC = DEBUG = CFLAGS = -O -N -d -w-par -w-rch -w-ccc -w-pia HOSTCFLAGS = $(CFLAGS) CPPFLAGS = HOSTCPPFLAGS = $(CPPFLAGS) LDFLAGS = HOSTLDFLAGS = $(LDFLAGS) OSOPTS = -DDOSV COPTS = $(OSOPTS) $(DEBUG) $(CFLAGS) HOSTCOPTS = $(COPTS) FLDFLAGS = $(ALLOC) $(LDFLAGS) SLDFLAGS = $(ALLOC) $(LDFLAGS) NLDFLAGS = $(ALLOC) $(LDFLAGS) BUILDFLAGS = $(COPTS) $(CPPFLAGS) FDCFLAGS = $(BUILDFLAGS) -ml -DFD=$(VERMAJ) SHCFLAGS = $(BUILDFLAGS) -mm -DFDSH=$(VERMAJ) BSHCFLAGS = $(BUILDFLAGS) -mm -DFDSH=$(VERMAJ) -DMINIMUMSHELL NSHCFLAGS = $(BUILDFLAGS) -ml -DFDSH=$(VERMAJ) -DWITHNETWORK DEFCFLAGS = -DDEFRC=\"$(DOSRC)\" .SUFFIXES: .h .c .obj .exe ############################################################ # Dependency Rules ############################################################ all: $(PROGRAM)$(EXE) $(PROGRAM).$(MANSEC) $(TABLES) $(PROGRAM)$(EXE): $(OBJ1) $(OBJ2) $(OBJ3) $(OBJ4) $(OBJ5) $(OBJ6) $(ARGS) # @sleep 1 $(CC) -ml -e$@ @$(ARGS) $(FLDFLAGS) # @ren $@ $(PROGRAM) # @aout2exe $(PROGRAM) # @del $(PROGRAM) $(ARGS): $(OBJ1) $(OBJ2) $(OBJ3) $(OBJ4) $(OBJ5) $(OBJ6) # @sleep 1 @$(ECHO) $(OBJ1) > $(ARGS) @$(ECHO) $(OBJ2) >> $(ARGS) @$(ECHO) $(OBJ3) >> $(ARGS) @$(ECHO) $(OBJ4) >> $(ARGS) @$(ECHO) $(OBJ5) >> $(ARGS) @$(ECHO) $(OBJ6) >> $(ARGS) # @sleep 1 main$(OBJ): main.c $(CC) $(FDCFLAGS) $(DEFCFLAGS) -c -o$@ $*.c termio$(OBJ): termio.c $(CC) $(FDCFLAGS) -c -o$@ $*.c system$(OBJ): system.c $(CC) $(FDCFLAGS) $(DEFCFLAGS) -c -o$@ $*.c custom$(OBJ): custom.c $(CC) $(FDCFLAGS) -c -o$@ $*.c .c.obj: $(CC) $(FDCFLAGS) -c -o$@ $*.c ############################################################ # kanji using module $(PROGRAM).$(MANSEC): kanjicnv$(EXE) $(JMANSRC) .\kanjicnv$(EXE) -s $(JMANSRC) $@ $(PROGRAM).$(MANSEC)c: kanjicnv$(EXE) $(JMANCAT) .\kanjicnv$(EXE) -s $(JMANCAT) $@ $(PROGRAM).eng: kanjicnv$(EXE) $(MANCAT) .\kanjicnv$(EXE) -b $(MANCAT) $@ $(PROGRAM).doc: kanjicnv$(EXE) $(JMANCAT) .\kanjicnv$(EXE) -s -b $(JMANCAT) $@ README.doc: kanjicnv$(EXE) README .\kanjicnv$(EXE) -s README $@ HISTORY.doc: kanjicnv$(EXE) HISTORY .\kanjicnv$(EXE) -s HISTORY $@ FAQ.doc: kanjicnv$(EXE) FAQ .\kanjicnv$(EXE) -s FAQ $@ LICENSES.doc: kanjicnv$(EXE) LICENSES .\kanjicnv$(EXE) -s LICENSES $@ kanjicnv$(EXE): kanjicnv$(OBJ) $(KOBJ) # @sleep 1 $(HOSTCC) $(HOSTCOPTS) $(HOSTLDFLAGS) -e$@ kanjicnv$(OBJ) $(KOBJ) # @ren $@ kanjicnv # @aout2exe kanjicnv # @del kanjicnv # @sleep 1 kanjicnv$(OBJ): kanjicnv.c $(HOSTCC) $(HOSTCOPTS) $(HOSTCPPFLAGS) -c -o$@ $*.c ############################################################ # message catalog module kanji.h: mkkanji$(EXE) kanjicnv$(EXE) kanji.hin .\mkkanji$(EXE) kanji.hin | \ .\kanjicnv$(EXE) -s - $@ # @sleep 1 mkkanji$(EXE): mkkanji$(OBJ) # @sleep 1 $(HOSTCC) $(HOSTCOPTS) $(HOSTLDFLAGS) -e$@ mkkanji$(OBJ) # @ren $@ mkkanji # @aout2exe mkkanji # @del mkkanji # @sleep 1 mkkanji$(OBJ): mkkanji.c $(HOSTCC) $(HOSTCOPTS) $(HOSTCPPFLAGS) -c -o$@ $*.c _fd-cat.ja: mkcat$(EXE) kanji.h .\mkcat$(EXE) -c 1 kanji.h $@ # @sleep 1 _fd-cat.C: mkcat$(EXE) kanji.h .\mkcat$(EXE) -c 2 kanji.h $@ # @sleep 1 fd-cat.ja: mkcat$(EXE) _fd-cat.ja .\mkcat$(EXE) _fd-cat.ja $@ fd-cat.C: mkcat$(EXE) _fd-cat.C .\mkcat$(EXE) _fd-cat.C $@ mkcat$(EXE): mkcat$(OBJ) $(COBJ) # @sleep 1 $(HOSTCC) $(HOSTCOPTS) $(HOSTLDFLAGS) -e$@ mkcat$(OBJ) $(COBJ) # @ren $@ mkcat # @aout2exe mkcat # @del mkcat # @sleep 1 mkcat$(OBJ): mkcat.c $(HOSTCC) $(HOSTCOPTS) $(HOSTCPPFLAGS) -c -o$@ $*.c ############################################################ # function list using module funcno.h: mkfuncno$(EXE) .\mkfuncno$(EXE) $@ # @sleep 1 mkfuncno$(EXE): mkfuncno$(OBJ) # @sleep 1 $(HOSTCC) $(HOSTCOPTS) $(HOSTLDFLAGS) -e$@ mkfuncno$(OBJ) # @ren $@ mkfuncno # @aout2exe mkfuncno # @del mkfuncno # @sleep 1 mkfuncno$(OBJ): mkfuncno.c $(HOSTCC) $(HOSTCOPTS) $(HOSTCPPFLAGS) -DFD=$(VERMAJ) -c -o$@ $*.c ############################################################ # UNICODE table generating module $(UNITBL): mkunitbl$(EXE) .\mkunitbl$(EXE) $@ unitbl.c: mkunitbl$(EXE) .\mkunitbl$(EXE) -t $@ $(DEPDIR)\unitbl.c: mkunitbl$(EXE) [ -d $(DEPDIR) ] || mkdir $(DEPDIR) .\mkunitbl$(EXE) -t -n $@ mkunitbl$(EXE): mkunitbl$(OBJ) $(UOBJ) # @sleep 1 $(HOSTCC) $(HOSTCOPTS) $(HOSTLDFLAGS) -e$@ mkunitbl$(OBJ) $(UOBJ) # @ren $@ mkunitbl # @aout2exe mkunitbl # @del mkunitbl # @sleep 1 mkunitbl$(OBJ): mkunitbl.c $(HOSTCC) $(HOSTCOPTS) $(HOSTCPPFLAGS) -c -o$@ $*.c tunitbl$(OBJ): unitbl.c $(HOSTCC) $(HOSTCOPTS) $(HOSTCPPFLAGS) -c -o$@ unitbl.c ############################################################ # Kanji transfer table generating module $(DICTTBL): mkdict$(EXE) $(DICTSRC) .\mkdict$(EXE) $@ $(DICTSRC) dicttbl.c: mkdict$(EXE) $(DICTSRC) .\mkdict$(EXE) -t $@ $(DICTSRC) $(DEPDIR)\dicttbl.c: mkdict$(EXE) $(DICTSRC) [ -d $(DEPDIR) ] || mkdir $(DEPDIR) .\mkdict$(EXE) -t -n $@ $(DICTSRC) mkdict$(EXE): mkdict$(OBJ) $(TOBJ) # @sleep 1 $(HOSTCC) $(HOSTCOPTS) $(HOSTLDFLAGS) -e$@ mkdict$(OBJ) $(TOBJ) # @ren $@ mkdict # @aout2exe mkdict # @del mkdict # @sleep 1 mktankan$(EXE): mktankan$(OBJ) $(TOBJ) # @sleep 1 $(HOSTCC) $(HOSTCOPTS) $(HOSTLDFLAGS) -e$@ mktankan$(OBJ) $(TOBJ) # @ren $@ mktankan # @aout2exe mktankan # @del mktankan # @sleep 1 mkdict$(OBJ): mkdict.c $(HOSTCC) $(HOSTCOPTS) $(HOSTCPPFLAGS) -c -o$@ $*.c mktankan$(OBJ): mktankan.c $(HOSTCC) $(HOSTCOPTS) $(HOSTCPPFLAGS) -c -o$@ $*.c tstring$(OBJ): string.c $(HOSTCC) $(HOSTCOPTS) $(HOSTCPPFLAGS) -c -o$@ string.c troman$(OBJ): roman.c $(HOSTCC) $(HOSTCOPTS) $(HOSTCPPFLAGS) -c -o$@ roman.c tkconv$(OBJ): kconv.c $(HOSTCC) $(HOSTCOPTS) $(HOSTCPPFLAGS) -c -o$@ kconv.c tevalopt$(OBJ): evalopt.c $(HOSTCC) $(HOSTCOPTS) $(HOSTCPPFLAGS) -c -o$@ evalopt.c tgentbl$(OBJ): gentbl.c $(HOSTCC) $(HOSTCOPTS) $(HOSTCPPFLAGS) -c -o$@ gentbl.c rmdict: -$(RM) $(DICTTBL) $(DICTTXT): mktankan$(EXE) .\mktankan$(EXE) $@ # @sleep 1 ############################################################ # Directory generating module mkdir_p$(EXE): mkdir_p$(OBJ) # @sleep 1 $(HOSTCC) $(HOSTCOPTS) $(HOSTLDFLAGS) -e$@ mkdir_p$(OBJ) # @ren $@ mkdir_p # @aout2exe mkdir_p # @del mkdir_p # @sleep 1 mkdir_p$(OBJ): mkdir_p.c $(HOSTCC) $(HOSTCOPTS) $(HOSTCPPFLAGS) -c -o$@ $*.c ############################################################ # to install all install: install-bin install-runcom install-man install-jman install-bin: $(PROGRAM)$(EXE) mkdir_p$(EXE) install-table [ -d $(BINDIR) ] || .\mkdir_p$(EXE) $(BINDIR) $(INSTALL) $(PROGRAM)$(EXE) $(BINDIR) $(CHMOD) a+rx $(BINDIR)\$(PROGRAM)$(EXE) -$(RM) $(BINDIR)\$(ALIAS)$(EXE) $(LN) $(BINDIR)\$(PROGRAM)$(EXE) $(BINDIR)\$(ALIAS)$(EXE) $(CHMOD) a+rx $(BINDIR)\$(ALIAS)$(EXE) install-runcom: -if [ -f $(RUNCOM) ]; then \ $(INSTALL) $(RUNCOM) $(BLDRC); \ $(CHMOD) a+r-x $(BLDRC); \ fi install-table: $(TABLE) mkdir_p$(EXE) -if [ -f $(UNITBL) ]; then \ [ -d $(BINDIR) ] || .\mkdir_p$(EXE) $(BINDIR); \ $(INSTALL) $(UNITBL) $(BINDIR); \ $(CHMOD) a+r-x $(BINDIR)\$(UNITBL); \ fi -if [ -f $(DICTTBL) ]; then \ [ -d $(BINDIR) ] || .\mkdir_p$(EXE) $(BINDIR); \ $(INSTALL) $(DICTTBL) $(BINDIR); \ $(CHMOD) a+r-x $(BINDIR)\$(DICTTBL); \ fi -if [ -f $(CATTBL) ]; then \ [ -d $(BINDIR) ] || .\mkdir_p$(EXE) $(BINDIR); \ $(INSTALL) $(CATTBL) $(BINDIR); \ $(CHMOD) a+r-x $(BINDIR)\$(CATTBL); \ fi -if [ -f $(ECATTBL) ]; then \ [ -d $(BINDIR) ] || .\mkdir_p$(EXE) $(BINDIR); \ $(INSTALL) $(ECATTBL) $(BINDIR); \ $(CHMOD) a+r-x $(BINDIR)\$(ECATTBL); \ fi install-man: $(MANSRC) mkdir_p$(EXE) [ -d $(MANDIR) ] || .\mkdir_p$(EXE) $(MANDIR) $(INSTALL) $(MANSRC) $(MANDIR)\$(PROGRAM).$(MANSEC) $(CHMOD) a+r-x $(MANDIR)\$(PROGRAM).$(MANSEC) -$(RM) $(MANDIR)\$(ALIAS).$(MANSEC) $(LN) $(MANDIR)\$(PROGRAM).$(MANSEC) $(MANDIR)\$(ALIAS).$(MANSEC) $(CHMOD) a+r-x $(MANDIR)\$(ALIAS).$(MANSEC) install-jman: $(PROGRAM).$(MANSEC) mkdir_p$(EXE) [ -d $(JMANDIR) ] || .\mkdir_p$(EXE) $(JMANDIR) [ "$(JMANDIR)" = "$(MANDIR)" ] || \ $(INSTALL) $(PROGRAM).$(MANSEC) $(JMANDIR)\$(PROGRAM).$(MANSEC) $(CHMOD) a+r-x $(JMANDIR)\$(PROGRAM).$(MANSEC) -$(RM) $(JMANDIR)\$(ALIAS).$(MANSEC) $(LN) $(JMANDIR)\$(PROGRAM).$(MANSEC) $(JMANDIR)\$(ALIAS).$(MANSEC) $(CHMOD) a+r-x $(JMANDIR)\$(ALIAS).$(MANSEC) catman: $(MANCAT) mkdir_p$(EXE) [ -d $(CATDIR) ] || .\mkdir_p$(EXE) $(CATDIR) $(INSTALL) $(MANCAT) $(CATDIR)\$(PROGRAM).$(MANSEC) $(CHMOD) a+r-x $(CATDIR)\$(PROGRAM).$(MANSEC) -$(RM) $(CATDIR)\$(ALIAS).$(MANSEC) $(LN) $(CATDIR)\$(PROGRAM).$(MANSEC) $(CATDIR)\$(ALIAS).$(MANSEC) $(CHMOD) a+r-x $(CATDIR)\$(ALIAS).$(MANSEC) catman-b: $(PROGRAM).eng mkdir_p$(EXE) [ -d $(CATDIR) ] || .\mkdir_p$(EXE) $(CATDIR) $(INSTALL) $(PROGRAM).eng $(CATDIR)\$(PROGRAM).$(MANSEC) $(CHMOD) a+r-x $(CATDIR)\$(PROGRAM).$(MANSEC) -$(RM) $(CATDIR)\$(ALIAS).$(MANSEC) $(LN) $(CATDIR)\$(PROGRAM).$(MANSEC) $(CATDIR)\$(ALIAS).$(MANSEC) $(CHMOD) a+r-x $(CATDIR)\$(ALIAS).$(MANSEC) compman: catman -$(RM) $(CATDIR)\$(ALIAS).$(MANSEC) compress -f $(CATDIR)\$(PROGRAM).$(MANSEC) -$(RM) $(CATDIR)\$(ALIAS).$(MANSEC).Z $(LN) $(CATDIR)\$(PROGRAM).$(MANSEC).Z $(CATDIR)\$(ALIAS).$(MANSEC).Z compman-b: catman-b -$(RM) $(CATDIR)\$(ALIAS).$(MANSEC) compress -f $(CATDIR)\$(PROGRAM).$(MANSEC) -$(RM) $(CATDIR)\$(ALIAS).$(MANSEC).Z $(LN) $(CATDIR)\$(PROGRAM).$(MANSEC).Z $(CATDIR)\$(ALIAS).$(MANSEC).Z jcatman: catman $(PROGRAM).$(MANSEC)c mkdir_p$(EXE) [ -d $(JCATDIR) ] || .\mkdir_p$(EXE) $(JCATDIR) $(INSTALL) $(PROGRAM).$(MANSEC)c $(JCATDIR)\$(PROGRAM).$(MANSEC) $(CHMOD) a+r-x $(JCATDIR)\$(PROGRAM).$(MANSEC) -$(RM) $(JCATDIR)\$(ALIAS).$(MANSEC) $(LN) $(JCATDIR)\$(PROGRAM).$(MANSEC) $(JCATDIR)\$(ALIAS).$(MANSEC) $(CHMOD) a+r-x $(JCATDIR)\$(ALIAS).$(MANSEC) jcatman-b: catman-b $(PROGRAM).doc mkdir_p$(EXE) [ -d $(JCATDIR) ] || .\mkdir_p$(EXE) $(JCATDIR) $(INSTALL) $(PROGRAM).doc $(JCATDIR)\$(PROGRAM).$(MANSEC) $(CHMOD) a+r-x $(JCATDIR)\$(PROGRAM).$(MANSEC) -$(RM) $(JCATDIR)\$(ALIAS).$(MANSEC) $(LN) $(JCATDIR)\$(PROGRAM).$(MANSEC) $(JCATDIR)\$(ALIAS).$(MANSEC) $(CHMOD) a+r-x $(JCATDIR)\$(ALIAS).$(MANSEC) jcompman: compman jcatman -$(RM) $(JCATDIR)\$(ALIAS).$(MANSEC) compress -f $(JCATDIR)\$(PROGRAM).$(MANSEC) -$(RM) $(JCATDIR)\$(ALIAS).$(MANSEC).Z $(LN) $(JCATDIR)\$(PROGRAM).$(MANSEC).Z $(JCATDIR)\$(ALIAS).$(MANSEC).Z jcompman-b: compman-b jcatman-b -$(RM) $(JCATDIR)\$(ALIAS).$(MANSEC) compress -f $(JCATDIR)\$(PROGRAM).$(MANSEC) -$(RM) $(JCATDIR)\$(ALIAS).$(MANSEC).Z $(LN) $(JCATDIR)\$(PROGRAM).$(MANSEC).Z $(JCATDIR)\$(ALIAS).$(MANSEC).Z ############################################################ # to make dependency depend: $(SRC) $(HSRC) $(DSRC) config.h kanji.h funcno.h [ -d $(DEPDIR) ] || mkdir $(DEPDIR) for f in $(SRC) $(HSRC); do \ $(SED) -e 's:^\(# *\)include "\(.*\).h":\1include "_\2.h":' \ $${f} > $(DEPDIR)\$${f}; \ done for f in $(DSRC); do \ $(SED) -e 's:^\(# *\)include "\(.*\).h":\1include "_\2.h":' \ $${f} > $${f}o; \ $(MV) $${f}o $${f}; \ done for f in $(SSRC); do \ $(RM) $(DEPDIR)\s$${f}; \ $(LN) $(DEPDIR)\$${f} $(DEPDIR)\s$${f}; \ done for f in $(BSRC); do \ $(RM) $(DEPDIR)\b$${f} && \ $(LN) $(DEPDIR)\$${f} $(DEPDIR)\b$${f}; \ done for f in $(NSRC); do \ $(RM) $(DEPDIR)\n$${f} && \ $(LN) $(DEPDIR)\$${f} $(DEPDIR)\n$${f}; \ done for f in $(TSRC); do \ $(RM) $(DEPDIR)\t$${f} && \ $(LN) $(DEPDIR)\$${f} $(DEPDIR)\t$${f}; \ done for f in $(HEADER) config.h kanji.h funcno.h version.h; do \ $(SED) -e 's:^\(# *\)include "\(.*\).h":\1include "_\2.h":' \ $${f} > $(DEPDIR)\_$${f}; \ done $(CP) Makefile.in Makefile.tmp $(DEPDIR) $(CP) Makefile.tmp $(DEPDIR)\Makefile.sh $(CP) Makefile.tmp $(DEPDIR)\Makefile.bsh $(CP) Makefile.tmp $(DEPDIR)\Makefile.nsh $(CP) Makefile.tmp $(DEPDIR)\Makefile.tr cd $(DEPDIR); makedepend \ -s "# DO NOT DELETE THIS LINE -- make depend depends on it." \ -f Makefile.tmp -- $(FDCFLAGS) -- \ $(SRC) \ `for f in $(DSRC); do $(ECHO) $${f}|$(SED) -e 's:^.*\::'; done` cd $(DEPDIR); makedepend \ -s "# DO NOT DELETE THIS LINE -- make depend depends on it." \ -f Makefile.sh -- $(SHCFLAGS) -- \ `for f in $(SSRC); do $(ECHO) s$${f}; done` cd $(DEPDIR); makedepend \ -s "# DO NOT DELETE THIS LINE -- make depend depends on it." \ -f Makefile.bsh -- $(BSHCFLAGS) -- \ `for f in $(BSRC); do $(ECHO) b$${f}; done` cd $(DEPDIR); makedepend \ -s "# DO NOT DELETE THIS LINE -- make depend depends on it." \ -f Makefile.nsh -- $(NSHCFLAGS) -- \ `for f in $(NSRC); do $(ECHO) n$${f}; done` cd $(DEPDIR); makedepend \ -s "# DO NOT DELETE THIS LINE -- make depend depends on it." \ -f Makefile.tr -- $(HOSTCOPTS) -- \ $(HSRC) \ `for f in $(TSRC); do $(ECHO) t$${f}; done` $(SED) -e '\^# DO NOT DELETE THIS LINE\,$$d' $(DEPDIR)\Makefile.in \ > Makefile.in $(ECHO) "# DO NOT DELETE THIS LINE -- make depend depends on it." \ >> Makefile.in $(SED) -e '1,\^# DO NOT DELETE THIS LINE\d' \ -e 's:^\(........\).*\.o:\1.o:' \ -e 's:\\[^ ]* *::g' \ -e 's:\.o:\$$(OBJ):g' \ -e 's:_\([^ ]*.h\):\1:g' \ -e 's: *$$::' \ -e '\: *$$\d' $(DEPDIR)\Makefile.tmp >> Makefile.in $(SED) -e '1,\^# DO NOT DELETE THIS LINE\d' \ -e 's:^\(........\).*\.o:\1.o:' \ -e 's:\\[^ ]* *::g' \ -e 's:\.o:\$$(OBJ):g' \ -e 's:_\([^ ]*.h\):\1:g' \ -e 's: *$$::' \ -e '\: *$$\d' $(DEPDIR)\Makefile.sh >> Makefile.in $(SED) -e '1,\^# DO NOT DELETE THIS LINE\d' \ -e 's:^\(........\).*\.o:\1.o:' \ -e 's:\\[^ ]* *::g' \ -e 's:\.o:\$$(OBJ):g' \ -e 's:_\([^ ]*.h\):\1:g' \ -e 's: *$$::' \ -e '\: *$$\d' $(DEPDIR)\Makefile.bsh >> Makefile.in $(SED) -e '1,\^# DO NOT DELETE THIS LINE\d' \ -e 's:^\(........\).*\.o:\1.o:' \ -e 's:\\[^ ]* *::g' \ -e 's:\.o:\$$(OBJ):g' \ -e 's:_\([^ ]*.h\):\1:g' \ -e 's: *$$::' \ -e '\: *$$\d' $(DEPDIR)\Makefile.nsh >> Makefile.in $(SED) -e '1,\^# DO NOT DELETE THIS LINE\d' \ -e 's:^\(........\).*\.o:\1.o:' \ -e 's:\\[^ ]* *::g' \ -e 's:\.o:\$$(OBJ):g' \ -e 's:_\([^ ]*.h\):\1:g' \ -e 's: *$$::' \ -e '\: *$$\d' $(DEPDIR)\Makefile.tr >> Makefile.in -rm -rf $(DEPDIR) ############################################################ # to verify sources lint: $(SRC) $(HSRC) config.h kanji.h funcno.h $(LINT) $(OSOPTS) -DFD=$(VERMAJ) `$(SED) -e "s:\$(OBJ):\.c:g" $(ARGS)` SRCS=`$(ECHO) $(UOBJ)|$(SED) -e "s:t\([^ ]*\)\$(OBJ):\1\.c:g"`; \ $(LINT) $(OSOPTS) mkunitbl.c $${SRCS} SRCS=`$(ECHO) $(TOBJ)|$(SED) -e "s:t\([^ ]*\)\$(OBJ):\1\.c:g"`; \ $(LINT) $(OSOPTS) mkdict.c $${SRCS}; \ $(LINT) $(OSOPTS) mktankan.c $${SRCS} $(LINT) $(OSOPTS) mkkanji.c SRCS=`$(ECHO) $(COBJ)|$(SED) -e "s:t\([^ ]*\)\$(OBJ):\1\.c:g"`; \ $(LINT) $(OSOPTS) mkcat.c $${SRCS} $(LINT) $(OSOPTS) mkdir_p.c SRCS=`$(ECHO) $(KOBJ)|$(SED) -e "s:t\([^ ]*\)\$(OBJ):\1\.c:g"`; \ $(LINT) $(OSOPTS) kanjicnv.c $${SRCS} $(LINT) $(OSOPTS) expfunc.c $(LINT) $(OSOPTS) mkfuncno.c ############################################################ # to make configuration file manually config: Configur expfunc.c -if ($(ECHO) 't() { echo $1; }; t test' | $(SHELL) >\dev\null 2>&1); then \ $(SED) -e "2,3d" -e "s:__cc__:bcc:" Configur \ | $(SHELL) > config.h; \ elif $(MAKE) -f Makefile.tmp expfunc$(EXE); then \ $(SED) -e "2,3d" -e "s:__cc__:bcc:" Configur \ | .\expfunc$(EXE) | $(SHELL) > config.h; \ fi # @sleep 1 config.h: config.hin $(CP) config.hin $@ # @sleep 1 expfunc$(EXE): expfunc$(OBJ) # @sleep 1 $(HOSTCC) $(HOSTCOPTS) $(HOSTLDFLAGS) -e$@ expfunc$(OBJ) # @ren $@ expfunc # @aout2exe expfunc # @del expfunc # @sleep 1 expfunc$(OBJ): expfunc.c $(HOSTCC) $(HOSTCOPTS) $(HOSTCPPFLAGS) -c -o$@ $*.c ############################################################ # sample program for pseudo system(3) sh: fdsh$(EXE) fdsh$(EXE): $(SOBJ1) $(SOBJ2) $(SARGS) # @sleep 1 $(CC) -mm -e$@ @$(SARGS) $(SLDFLAGS) # @ren $@ fdsh # @aout2exe fdsh # @del fdsh $(SARGS): $(SOBJ1) $(SOBJ2) # @sleep 1 @$(ECHO) $(SOBJ1) > $(SARGS) @$(ECHO) $(SOBJ2) >> $(SARGS) # @sleep 1 sprintf$(OBJ): printf.c $(CC) $(SHCFLAGS) -c -o$@ printf.c stermio$(OBJ): termio.c $(CC) $(SHCFLAGS) -c -o$@ termio.c sstream$(OBJ): stream.c $(CC) $(SHCFLAGS) -c -o$@ stream.c sstring$(OBJ): string.c $(CC) $(SHCFLAGS) -c -o$@ string.c smalloc$(OBJ): malloc.c $(CC) $(SHCFLAGS) -c -o$@ malloc.c stime$(OBJ): time.c $(CC) $(SHCFLAGS) -c -o$@ time.c spathnam$(OBJ): pathname.c $(CC) $(SHCFLAGS) -c -o$@ pathname.c ssystem$(OBJ): system.c $(CC) $(SHCFLAGS) -c -o$@ system.c sposixsh$(OBJ): posixsh.c $(CC) $(SHCFLAGS) -c -o$@ posixsh.c sdoscom$(OBJ): doscom.c $(CC) $(SHCFLAGS) -c -o$@ doscom.c ssysemu$(OBJ): sysemu.c $(CC) $(SHCFLAGS) -c -o$@ sysemu.c ############################################################ # Bourne shell bsh: fdbsh$(EXE) fdbsh$(EXE): $(BOBJ) # @sleep 1 $(CC) -mm -e$@ $(BOBJ) $(SLDFLAGS) # @ren $@ fdbsh # @aout2exe fdbsh # @del fdbsh bprintf$(OBJ): printf.c $(CC) $(BSHCFLAGS) -c -o$@ printf.c btermio$(OBJ): termio.c $(CC) $(BSHCFLAGS) -c -o$@ termio.c bstream$(OBJ): stream.c $(CC) $(BSHCFLAGS) -c -o$@ stream.c bstring$(OBJ): string.c $(CC) $(BSHCFLAGS) -c -o$@ string.c bmalloc$(OBJ): malloc.c $(CC) $(BSHCFLAGS) -c -o$@ malloc.c bpathnam$(OBJ): pathname.c $(CC) $(BSHCFLAGS) -c -o$@ pathname.c bsystem$(OBJ): system.c $(CC) $(BSHCFLAGS) -c -o$@ system.c bdoscom$(OBJ): doscom.c $(CC) $(BSHCFLAGS) -c -o$@ doscom.c bsysemu$(OBJ): sysemu.c $(CC) $(BSHCFLAGS) -c -o$@ sysemu.c ############################################################ # Network shell nsh: fdnsh$(EXE) fdnsh$(EXE): $(NOBJ1) $(NOBJ2) $(NOBJ3) $(NARGS) # @sleep 1 $(CC) -ml -e$@ @$(NARGS) $(NLDFLAGS) # @ren $@ fdnsh # @aout2exe fdnsh # @del fdnsh $(NARGS): $(NOBJ1) $(NOBJ2) $(NOBJ3) # @sleep 1 @$(ECHO) $(NOBJ1) > $(NARGS) @$(ECHO) $(NOBJ2) >> $(NARGS) @$(ECHO) $(NOBJ3) >> $(NARGS) # @sleep 1 nprintf$(OBJ): printf.c $(CC) $(NSHCFLAGS) -c -o$@ printf.c ntermio$(OBJ): termio.c $(CC) $(NSHCFLAGS) -c -o$@ termio.c nstream$(OBJ): stream.c $(CC) $(NSHCFLAGS) -c -o$@ stream.c nstring$(OBJ): string.c $(CC) $(NSHCFLAGS) -c -o$@ string.c nmalloc$(OBJ): malloc.c $(CC) $(NSHCFLAGS) -c -o$@ malloc.c ntime$(OBJ): time.c $(CC) $(NSHCFLAGS) -c -o$@ time.c npathnam$(OBJ): pathname.c $(CC) $(NSHCFLAGS) -c -o$@ pathname.c nsystem$(OBJ): system.c $(CC) $(NSHCFLAGS) -c -o$@ system.c nposixsh$(OBJ): posixsh.c $(CC) $(NSHCFLAGS) -c -o$@ posixsh.c ndoscom$(OBJ): doscom.c $(CC) $(NSHCFLAGS) -c -o$@ doscom.c nsysemu$(OBJ): sysemu.c $(CC) $(NSHCFLAGS) -c -o$@ sysemu.c nrealpat$(OBJ): realpath.c $(CC) $(NSHCFLAGS) -c -o$@ realpath.c nencode$(OBJ): encode.c $(CC) $(NSHCFLAGS) -c -o$@ encode.c nparse$(OBJ): parse.c $(CC) $(NSHCFLAGS) -c -o$@ parse.c nsocket$(OBJ): socket.c $(CC) $(NSHCFLAGS) -c -o$@ socket.c nurl$(OBJ): url.c $(CC) $(NSHCFLAGS) -c -o$@ url.c nauth$(OBJ): auth.c $(CC) $(NSHCFLAGS) -c -o$@ auth.c nftp$(OBJ): ftp.c $(CC) $(NSHCFLAGS) -c -o$@ ftp.c nhtml$(OBJ): html.c $(CC) $(NSHCFLAGS) -c -o$@ html.c nhttp$(OBJ): http.c $(CC) $(NSHCFLAGS) -c -o$@ http.c nurldisk$(OBJ): urldisk.c $(CC) $(NSHCFLAGS) -c -o$@ urldisk.c nlsparse$(OBJ): lsparse.c $(CC) $(NSHCFLAGS) -c -o$@ lsparse.c ############################################################ # for programer's maintenance tar: $(SOURCES) $(TAR) cvf $(TITLE)$(VERSION).tar $(SOURCES) compress -f $(TITLE)$(VERSION).tar gtar: $(SOURCES) $(TAR) cvf $(TITLE)$(VERSION).tar $(SOURCES) gzip -f $(TITLE)$(VERSION).tar shtar: $(SHSOURCES) (VER=`date '+%y%m%d'`; \ $(TAR) cvf $(TITLE)sh-$${VER}.tar $(SHSOURCES); \ gzip -f $(TITLE)sh-$${VER}.tar) lzh: $(SOURCES) -$(RM) $(TITLE)$(VERSION).lzh $(LHA) a $(TITLE)$(VERSION).lzh $(SOURCES) shar: $(SOURCES) -$(RM) $(TITLE)$(VERSION).shar.[0-9][0-9] $(SHAR) -L50 -apc -n $(TITLE)$(VERSION) -o $(TITLE)$(VERSION).shar \ -T $(SRCS) -C $(JSRCS) ipk: $(PROGRAM)$(EXE) $(TABLES) mkdir_p$(EXE) -[ -d $(IPKWDIR)\$(BINDIR) ] || .\mkdir_p$(EXE) $(IPKWDIR)\$(BINDIR) -[ -d $(IPKWDIR)\$(BINDIR) ] || .\mkdir_p$(EXE) $(IPKWDIR)\$(BINDIR) -[ -d $(IPKWDIR)\$(BINDIR) ] || .\mkdir_p$(EXE) $(IPKWDIR)\$(BINDIR) -[ -d $(IPKWDIR)\$(CONFDIR) ] || .\mkdir_p$(EXE) $(IPKWDIR)\$(CONFDIR) -[ -d $(IPKWDIR)\CONTROL ] || .\mkdir_p$(EXE) $(IPKWDIR)\CONTROL -[ -d $(IPKTDIR) ] || .\mkdir_p$(EXE) $(IPKTDIR) $(CP) -p $(PROGRAM)$(EXE) $(IPKWDIR)\$(BINDIR) -[ -z "$(STRIP)" ] || $(STRIP) $(IPKWDIR)\$(BINDIR)\$(PROGRAM)$(EXE) $(CHMOD) a+rx $(IPKWDIR)\$(BINDIR)\$(PROGRAM)$(EXE) -$(RM) $(IPKWDIR)\$(BINDIR)\$(ALIAS)$(EXE) $(LN) $(IPKWDIR)\$(BINDIR)\$(PROGRAM)$(EXE) \ $(IPKWDIR)\$(BINDIR)\$(ALIAS)$(EXE) $(CHMOD) a+rx $(IPKWDIR)\$(BINDIR)\$(ALIAS)$(EXE) $(SED) -e 's:#TMPDIR=.*:TMPDIR=\home\tmp:' \ -e 's:#LANGUAGE=.*:LANGUAGE=euc:' \ -e 's:#INPUTKCODE=.*:INPUTKCODE=euc:' \ -e 's:#FNAMEKCODE=.*:FNAMEKCODE=utf8:' \ -e '\# launcher definition\,\^$$\ {' \ -e '\^$$\ {' \ -e 'i \' \ -e 'launch ".tar.Z" "gzip -cd %C|tar tvf -" "%a %u\%g %s %y-%m-%d %t %*f"' \ -e 'i \' \ -e 'launch ".taZ" "gzip -cd %C|tar tvf -" "%a %u\%g %s %y-%m-%d %t %*f"' \ -e 'i \' \ -e 'launch ".ipk" "gzip -cd %C|tar xOf - .\data.tar.gz|gzip -cd|tar tvf -" \\' \ -e 'i \' \ -e ' "%a %u\%g %s %y-%m-%d %t %*f"' \ -e 'i \' \ -e 'launch ".deb" "ar -p %C data.tar.gz|gzip -cd|tar tvf -" \\' \ -e 'i \' \ -e ' "%a %u\%g %s %y-%m-%d %t %*f"' \ -e '}' \ -e '}' \ -e '\# archiver definition\,\^$$\ {' \ -e '\^$$\ {' \ -e 'i \' \ -e 'arch ".tar.Z" "echo ERROR; false" "gzip -cd %C|tar xf - %TA"' \ -e 'i \' \ -e 'arch ".taZ" "echo ERROR; false" "gzip -cd %C|tar xf - %TA"' \ -e 'i \' \ -e 'arch ".ipk" "echo ERROR; false" \\' \ -e 'i \' \ -e ' "gzip -cd %C|tar xOf - .\data.tar.gz|gzip -cd|tar xf - %TA"' \ -e 'i \' \ -e 'arch ".deb" "echo ERROR; false" \\' \ -e 'i \' \ -e ' "ar -p %C data.tar.gz|gzip -cd|tar xf - %TA"' \ -e '}' \ -e '}' \ -e '$$ {' \ -e 'a \' \ -e 'if [ " $$TERM" = " vt100" -a " $$CONSOLE" = " \dev\console" ]; then' \ -e 'a \' \ -e ' keymap BS "^?"' \ -e 'a \' \ -e ' keymap DEL "\\033[3~"' \ -e 'a \' \ -e ' keymap HOME "\\033[H"' \ -e 'a \' \ -e ' keymap END "\\033[F"' \ -e 'a \' \ -e 'fi' \ -e '}' \ _fdrc > $(IPKWDIR)\$(BLDRC) $(CHMOD) a+r-x $(IPKWDIR)\$(BLDRC) -if [ -f $(UNITBL) ]; then \ cp -p $(UNITBL) $(IPKWDIR)\$(BINDIR); \ $(CHMOD) a+r-x $(IPKWDIR)\$(BINDIR)\$(UNITBL); \ fi -if [ -f $(DICTTBL) ]; then \ cp -p $(DICTTBL) $(IPKWDIR)\$(BINDIR); \ $(CHMOD) a+r-x $(IPKWDIR)\$(BINDIR)\$(DICTTBL); \ fi -if [ -f $(CATTBL) ]; then \ cp -p $(CATTBL) $(IPKWDIR)\$(BINDIR); \ $(CHMOD) a+r-x $(IPKWDIR)\$(BINDIR)\$(CATTBL); \ fi -if [ -f $(ECATTBL) ]; then \ cp -p $(ECATTBL) $(IPKWDIR)\$(BINDIR); \ $(CHMOD) a+r-x $(IPKWDIR)\$(BINDIR)\$(ECATTBL); \ fi $(ECHO) "Package: fd" > $(IPKWDIR)\CONTROL\control $(ECHO) "Priority: optional" >> $(IPKWDIR)\CONTROL\control $(ECHO) "Section: extras" >> $(IPKWDIR)\CONTROL\control $(ECHO) "Maintainer: $(DIST)" >> $(IPKWDIR)\CONTROL\control $(ECHO) "Architecture: arm" >> $(IPKWDIR)\CONTROL\control $(ECHO) "Version: $(VERSION)-1" >> $(IPKWDIR)\CONTROL\control $(ECHO) "Depends: ncurses" >> $(IPKWDIR)\CONTROL\control $(ECHO) "Description: a file & directory maintenance tool." \ >> $(IPKWDIR)\CONTROL\control (cd $(IPKWDIR); tar cf ..\data.tar --exclude=CONTROL .) (cd $(IPKWDIR)\CONTROL; tar cf ..\..\control.tar .) gzip .\data.tar $(MV) .\data.tar.gz $(IPKTDIR) gzip .\control.tar $(MV) .\control.tar.gz $(IPKTDIR) $(ECHO) "2.0" > $(IPKTDIR)\debian-binary (cd $(IPKTDIR); \ tar cf ..\ipk.tar .\debian-binary .\data.tar.gz .\control.tar.gz) gzip .\ipk.tar $(MV) .\ipk.tar.gz .\fd_$(VERSION)-1_arm.ipk -$(RM) -r $(IPKWDIR) $(IPKTDIR) clean: -$(RM) core -$(RM) *$(OBJ) -$(RM) funcno.h -$(RM) kanji.h -$(RM) _fd-cat.ja -$(RM) _fd-cat.C -$(RM) fd-cat.* -$(RM) kanjicnv$(EXE) -$(RM) expfunc$(EXE) -$(RM) mkdir_p$(EXE) -$(RM) mkfuncno$(EXE) -$(RM) mkunitbl$(EXE) -$(RM) mkdict$(EXE) -$(RM) mktankan$(EXE) -$(RM) mkkanji$(EXE) -$(RM) mkcat$(EXE) -$(RM) fdsh$(EXE) -$(RM) fdbsh$(EXE) -$(RM) fdnsh$(EXE) -$(RM) $(PROGRAM)$(EXE) -$(RM) $(PROGRAM).$(MANSEC) -$(RM) $(PROGRAM).$(MANSEC)c -$(RM) $(PROGRAM).eng -$(RM) $(PROGRAM).doc -$(RM) $(ARGS) -$(RM) $(SARGS) -$(RM) $(NARGS) -$(RM) $(UNITBL) -$(RM) unitbl.c -$(RM) dicttbl.c -$(RM) $(DICTTXT) -$(RM) $(DICTTBL) # DO NOT DELETE THIS LINE -- make depend depends on it. main$(OBJ): fd.h headers.h machine.h config.h main$(OBJ): depend.h printf.h main$(OBJ): stream.h kctype.h main$(OBJ): string.h malloc.h time.h log.h termio.h main$(OBJ): realpath.h main$(OBJ): parse.h kconv.h func.h sysemu.h dirent.h unixemu.h main$(OBJ): pathname.h main$(OBJ): typesize.h term.h types.h lsparse.h namelist.h dosdisk.h main$(OBJ): kanji.h catalog.h version.h system.h wait.h main$(OBJ): termemu.h roman.h urldisk.h url.h auth.h printf$(OBJ): headers.h machine.h config.h printf$(OBJ): depend.h printf.h stream.h kctype.h printf$(OBJ): typesize.h string.h printf$(OBJ): kconv.h termio$(OBJ): headers.h machine.h config.h termio$(OBJ): depend.h typesize.h sysemu.h dirent.h termio$(OBJ): unixemu.h termio$(OBJ): stream.h termio.h term$(OBJ): headers.h machine.h config.h term$(OBJ): depend.h printf.h term$(OBJ): stream.h kctype.h term$(OBJ): typesize.h string.h termio.h term$(OBJ): term.h stream$(OBJ): headers.h machine.h config.h stream$(OBJ): depend.h typesize.h malloc.h sysemu.h stream$(OBJ): dirent.h unixemu.h stream$(OBJ): stream.h pathname.h termio.h stream$(OBJ): socket.h string$(OBJ): headers.h machine.h config.h string$(OBJ): kctype.h depend.h string$(OBJ): string.h malloc$(OBJ): headers.h machine.h config.h malloc$(OBJ): printf.h stream.h depend.h malloc.h malloc$(OBJ): sysemu.h dirent.h unixemu.h time$(OBJ): headers.h machine.h config.h time$(OBJ): typesize.h time$(OBJ): string.h time.h pathname$(OBJ): fd.h headers.h machine.h config.h pathname$(OBJ): depend.h printf.h stream.h kctype.h pathname$(OBJ): string.h malloc.h pathname$(OBJ): dirent.h unixemu.h pathname$(OBJ): sysemu.h pathname.h typesize.h pathname$(OBJ): url.h system$(OBJ): fd.h headers.h machine.h config.h system$(OBJ): depend.h printf.h stream.h kctype.h system$(OBJ): string.h malloc.h system$(OBJ): term.h types.h typesize.h lsparse.h namelist.h kconv.h system$(OBJ): dirent.h unixemu.h system$(OBJ): sysemu.h system.h pathname.h termio.h system$(OBJ): wait.h system$(OBJ): termemu.h posixsh.h socket.h url.h system$(OBJ): urldisk.h auth.h posixsh$(OBJ): fd.h headers.h machine.h config.h posixsh$(OBJ): depend.h printf.h stream.h kctype.h posixsh$(OBJ): string.h malloc.h posixsh$(OBJ): sysemu.h dirent.h unixemu.h posixsh$(OBJ): system.h pathname.h typesize.h posixsh$(OBJ): termio.h posixsh$(OBJ): wait.h posixsh$(OBJ): termemu.h time.h posixsh.h term.h doscom$(OBJ): fd.h headers.h machine.h config.h doscom$(OBJ): depend.h printf.h stream.h kctype.h doscom$(OBJ): string.h malloc.h doscom$(OBJ): term.h types.h typesize.h lsparse.h namelist.h dirent.h doscom$(OBJ): unixemu.h doscom$(OBJ): sysemu.h system.h pathname.h termio.h doscom$(OBJ): wait.h doscom$(OBJ): realpath.h urldisk.h url.h auth.h log$(OBJ): fd.h headers.h machine.h config.h log$(OBJ): depend.h printf.h log$(OBJ): stream.h kctype.h log$(OBJ): string.h malloc.h func.h sysemu.h dirent.h unixemu.h log$(OBJ): pathname.h log$(OBJ): typesize.h term.h types.h lsparse.h namelist.h dosdisk.h sysemu$(OBJ): fd.h headers.h machine.h config.h sysemu$(OBJ): depend.h printf.h stream.h kctype.h sysemu$(OBJ): string.h malloc.h sysemu$(OBJ): kconv.h sysemu.h dirent.h unixemu.h sysemu$(OBJ): log.h pathname.h typesize.h termio.h sysemu$(OBJ): realpath.h dosdisk.h socket.h sysemu$(OBJ): urldisk.h namelist.h url.h auth.h dosdisk$(OBJ): headers.h machine.h config.h dosdisk$(OBJ): depend.h kctype.h dosdisk$(OBJ): string.h time.h sysemu.h dirent.h dosdisk$(OBJ): unixemu.h dosdisk$(OBJ): stream.h pathname.h typesize.h dosdisk.h unixdisk.h kconv.h unixdisk$(OBJ): headers.h machine.h config.h unixdisk$(OBJ): depend.h kctype.h unixdisk$(OBJ): string.h sysemu.h dirent.h unixemu.h unixdisk$(OBJ): stream.h unixdisk$(OBJ): pathname.h typesize.h dosdisk.h unixdisk.h realpath$(OBJ): fd.h headers.h machine.h config.h realpath$(OBJ): depend.h printf.h stream.h kctype.h realpath$(OBJ): string.h malloc.h realpath$(OBJ): sysemu.h dirent.h unixemu.h realpath$(OBJ): pathname.h typesize.h realpath.h realpath$(OBJ): url.h encode$(OBJ): headers.h machine.h config.h encode$(OBJ): kctype.h depend.h encode$(OBJ): sysemu.h dirent.h unixemu.h encode$(OBJ): stream.h encode$(OBJ): pathname.h typesize.h encode.h libc$(OBJ): fd.h headers.h machine.h config.h libc$(OBJ): depend.h printf.h libc$(OBJ): stream.h kctype.h libc$(OBJ): string.h malloc.h log.h realpath.h parse.h kconv.h func.h libc$(OBJ): sysemu.h dirent.h unixemu.h libc$(OBJ): pathname.h typesize.h term.h types.h libc$(OBJ): lsparse.h namelist.h dosdisk.h kanji.h catalog.h system.h libc$(OBJ): termio.h libc$(OBJ): wait.h libc$(OBJ): termemu.h url.h file$(OBJ): fd.h headers.h machine.h config.h file$(OBJ): depend.h printf.h file$(OBJ): stream.h kctype.h file$(OBJ): string.h malloc.h time.h termio.h file$(OBJ): realpath.h file$(OBJ): kconv.h func.h sysemu.h dirent.h unixemu.h file$(OBJ): pathname.h typesize.h term.h types.h file$(OBJ): lsparse.h namelist.h dosdisk.h kanji.h catalog.h urldisk.h file$(OBJ): url.h auth.h mntinfo$(OBJ): headers.h machine.h config.h mntinfo$(OBJ): kctype.h depend.h mntinfo$(OBJ): string.h malloc.h pathname.h mntinfo$(OBJ): typesize.h mntinfo.h fsinfo.h statfs$(OBJ): headers.h machine.h config.h statfs$(OBJ): fsinfo.h apply$(OBJ): fd.h headers.h machine.h config.h apply$(OBJ): depend.h printf.h stream.h kctype.h apply$(OBJ): string.h malloc.h apply$(OBJ): time.h realpath.h parse.h func.h sysemu.h dirent.h unixemu.h apply$(OBJ): pathname.h apply$(OBJ): typesize.h term.h types.h lsparse.h namelist.h dosdisk.h apply$(OBJ): kanji.h catalog.h pty$(OBJ): fd.h headers.h machine.h config.h pty$(OBJ): depend.h printf.h pty$(OBJ): stream.h kctype.h pty$(OBJ): string.h malloc.h sysemu.h dirent.h unixemu.h pty$(OBJ): pathname.h pty$(OBJ): typesize.h termio.h termemu$(OBJ): fd.h headers.h machine.h config.h termemu$(OBJ): depend.h printf.h stream.h kctype.h termemu$(OBJ): string.h malloc.h termemu$(OBJ): wait.h unixemu.h termio.h termemu$(OBJ): func.h sysemu.h dirent.h termemu$(OBJ): pathname.h termemu$(OBJ): typesize.h term.h types.h lsparse.h namelist.h dosdisk.h termemu$(OBJ): kanji.h catalog.h system.h termemu.h frontend$(OBJ): fd.h headers.h machine.h config.h frontend$(OBJ): depend.h printf.h stream.h kctype.h frontend$(OBJ): string.h malloc.h frontend$(OBJ): wait.h unixemu.h parse.h func.h frontend$(OBJ): sysemu.h dirent.h frontend$(OBJ): pathname.h typesize.h term.h frontend$(OBJ): types.h lsparse.h namelist.h dosdisk.h funcno.h kanji.h frontend$(OBJ): catalog.h system.h termio.h frontend$(OBJ): termemu.h frontend$(OBJ): roman.h backend$(OBJ): fd.h headers.h machine.h config.h backend$(OBJ): depend.h printf.h stream.h kctype.h backend$(OBJ): string.h malloc.h backend$(OBJ): termio.h backend$(OBJ): kconv.h func.h sysemu.h backend$(OBJ): dirent.h unixemu.h backend$(OBJ): pathname.h typesize.h term.h types.h backend$(OBJ): lsparse.h namelist.h dosdisk.h system.h wait.h backend$(OBJ): termemu.h parse$(OBJ): fd.h headers.h machine.h config.h parse$(OBJ): depend.h printf.h stream.h kctype.h parse$(OBJ): string.h malloc.h parse$(OBJ): pathname.h typesize.h term.h types.h lsparse.h namelist.h parse$(OBJ): kconv.h sysemu.h dirent.h unixemu.h parse$(OBJ): realpath.h parse.h system.h termio.h parse$(OBJ): wait.h builtin$(OBJ): fd.h headers.h machine.h config.h builtin$(OBJ): depend.h printf.h stream.h kctype.h builtin$(OBJ): string.h malloc.h builtin$(OBJ): encode.h parse.h kconv.h func.h sysemu.h dirent.h unixemu.h builtin$(OBJ): pathname.h builtin$(OBJ): typesize.h term.h types.h lsparse.h namelist.h dosdisk.h builtin$(OBJ): funcno.h kanji.h catalog.h system.h termio.h builtin$(OBJ): wait.h builtin$(OBJ): termemu.h roman.h shell$(OBJ): fd.h headers.h machine.h config.h shell$(OBJ): depend.h printf.h stream.h kctype.h shell$(OBJ): string.h malloc.h shell$(OBJ): realpath.h parse.h kconv.h func.h sysemu.h dirent.h unixemu.h shell$(OBJ): pathname.h shell$(OBJ): typesize.h term.h types.h lsparse.h namelist.h dosdisk.h shell$(OBJ): kanji.h catalog.h system.h termio.h shell$(OBJ): wait.h shell$(OBJ): termemu.h socket$(OBJ): headers.h machine.h config.h socket$(OBJ): depend.h printf.h stream.h kctype.h socket$(OBJ): typesize.h malloc.h socket$(OBJ): sysemu.h dirent.h unixemu.h socket$(OBJ): termio.h socket$(OBJ): socket.h url$(OBJ): headers.h machine.h config.h url$(OBJ): depend.h printf.h url$(OBJ): stream.h kctype.h url$(OBJ): typesize.h string.h malloc.h sysemu.h dirent.h unixemu.h url$(OBJ): pathname.h url.h auth$(OBJ): headers.h machine.h config.h auth$(OBJ): depend.h printf.h auth$(OBJ): stream.h string.h malloc.h time.h pathname.h typesize.h auth$(OBJ): encode.h parse.h socket.h auth.h url.h auth$(OBJ): system.h termio.h auth$(OBJ): wait.h auth$(OBJ): unixemu.h kanji.h catalog.h ftp$(OBJ): headers.h machine.h config.h ftp$(OBJ): depend.h printf.h ftp$(OBJ): stream.h kctype.h ftp$(OBJ): string.h malloc.h time.h sysemu.h dirent.h unixemu.h ftp$(OBJ): pathname.h ftp$(OBJ): typesize.h termio.h ftp$(OBJ): parse.h ftp$(OBJ): lsparse.h namelist.h socket.h auth.h ftp$(OBJ): url.h urldisk.h html$(OBJ): headers.h machine.h config.h html$(OBJ): depend.h printf.h html$(OBJ): stream.h kctype.h html$(OBJ): typesize.h string.h malloc.h sysemu.h dirent.h unixemu.h html$(OBJ): pathname.h termio.h html$(OBJ): parse.h html.h urldisk.h html$(OBJ): namelist.h url.h auth.h http$(OBJ): headers.h machine.h config.h http$(OBJ): depend.h printf.h http$(OBJ): stream.h kctype.h http$(OBJ): string.h malloc.h time.h sysemu.h dirent.h unixemu.h http$(OBJ): pathname.h http$(OBJ): typesize.h termio.h http$(OBJ): parse.h http$(OBJ): lsparse.h namelist.h socket.h auth.h http$(OBJ): url.h html.h urldisk.h urldisk$(OBJ): headers.h machine.h config.h urldisk$(OBJ): depend.h printf.h stream.h string.h urldisk$(OBJ): malloc.h time.h sysemu.h dirent.h unixemu.h urldisk$(OBJ): pathname.h urldisk$(OBJ): typesize.h termio.h urldisk$(OBJ): realpath.h urldisk$(OBJ): lsparse.h namelist.h socket.h urldisk$(OBJ): urldisk.h url.h auth.h catalog$(OBJ): fd.h headers.h machine.h config.h catalog$(OBJ): depend.h printf.h stream.h kctype.h catalog$(OBJ): string.h malloc.h catalog$(OBJ): termio.h catalog$(OBJ): func.h sysemu.h dirent.h catalog$(OBJ): unixemu.h catalog$(OBJ): pathname.h typesize.h term.h types.h lsparse.h namelist.h catalog$(OBJ): dosdisk.h kanji.h catalog.h kconv$(OBJ): fd.h headers.h machine.h config.h kconv$(OBJ): depend.h printf.h stream.h kctype.h kconv$(OBJ): string.h malloc.h kconv$(OBJ): termio.h kconv$(OBJ): realpath.h parse.h func.h kconv$(OBJ): sysemu.h dirent.h unixemu.h kconv$(OBJ): pathname.h typesize.h term.h types.h kconv$(OBJ): lsparse.h namelist.h dosdisk.h kconv.h termemu.h input$(OBJ): fd.h headers.h machine.h config.h input$(OBJ): depend.h printf.h stream.h kctype.h input$(OBJ): string.h malloc.h input$(OBJ): wait.h unixemu.h parse.h kconv.h func.h input$(OBJ): sysemu.h dirent.h input$(OBJ): pathname.h typesize.h term.h types.h lsparse.h namelist.h input$(OBJ): dosdisk.h kanji.h catalog.h system.h termio.h input$(OBJ): termemu.h ime$(OBJ): fd.h headers.h machine.h config.h ime$(OBJ): depend.h printf.h ime$(OBJ): stream.h kctype.h ime$(OBJ): string.h malloc.h wait.h unixemu.h ime$(OBJ): parse.h kconv.h roman.h func.h sysemu.h dirent.h ime$(OBJ): pathname.h ime$(OBJ): typesize.h term.h types.h lsparse.h namelist.h dosdisk.h ime$(OBJ): kanji.h catalog.h termemu.h dict$(OBJ): fd.h headers.h machine.h config.h dict$(OBJ): depend.h printf.h dict$(OBJ): stream.h kctype.h dict$(OBJ): string.h malloc.h termio.h dict$(OBJ): roman.h dict$(OBJ): hinsi.h func.h sysemu.h dirent.h unixemu.h dict$(OBJ): pathname.h typesize.h term.h types.h dict$(OBJ): lsparse.h namelist.h dosdisk.h parse.h kconv.h roman$(OBJ): headers.h machine.h config.h roman$(OBJ): depend.h kctype.h roman$(OBJ): typesize.h string.h kconv.h roman.h info$(OBJ): fd.h headers.h machine.h config.h info$(OBJ): depend.h printf.h info$(OBJ): stream.h kctype.h info$(OBJ): string.h malloc.h dirent.h unixemu.h info$(OBJ): sysemu.h pathname.h typesize.h term.h info$(OBJ): types.h lsparse.h namelist.h funcno.h kanji.h catalog.h info$(OBJ): unixdisk.h mntinfo.h fsinfo.h rockridg$(OBJ): fd.h headers.h machine.h config.h rockridg$(OBJ): depend.h printf.h stream.h kctype.h rockridg$(OBJ): string.h malloc.h rockridg$(OBJ): device.h parse.h func.h sysemu.h dirent.h unixemu.h rockridg$(OBJ): pathname.h rockridg$(OBJ): typesize.h term.h types.h lsparse.h namelist.h dosdisk.h tree$(OBJ): fd.h headers.h machine.h config.h tree$(OBJ): depend.h printf.h tree$(OBJ): stream.h kctype.h tree$(OBJ): string.h malloc.h func.h sysemu.h dirent.h unixemu.h tree$(OBJ): pathname.h tree$(OBJ): typesize.h term.h types.h lsparse.h namelist.h dosdisk.h tree$(OBJ): kanji.h catalog.h lsparse$(OBJ): fd.h headers.h machine.h config.h lsparse$(OBJ): depend.h printf.h stream.h kctype.h lsparse$(OBJ): string.h malloc.h lsparse$(OBJ): time.h dirent.h unixemu.h lsparse$(OBJ): pathname.h typesize.h device.h lsparse$(OBJ): parse.h lsparse.h namelist.h kconv.h archive$(OBJ): fd.h headers.h machine.h config.h archive$(OBJ): depend.h printf.h stream.h kctype.h archive$(OBJ): string.h malloc.h archive$(OBJ): realpath.h kconv.h func.h sysemu.h dirent.h unixemu.h archive$(OBJ): pathname.h archive$(OBJ): typesize.h term.h types.h lsparse.h namelist.h dosdisk.h archive$(OBJ): kanji.h catalog.h system.h termio.h archive$(OBJ): wait.h archive$(OBJ): termemu.h custom$(OBJ): fd.h headers.h machine.h config.h custom$(OBJ): depend.h printf.h stream.h kctype.h custom$(OBJ): string.h malloc.h custom$(OBJ): parse.h kconv.h func.h sysemu.h dirent.h unixemu.h custom$(OBJ): pathname.h custom$(OBJ): typesize.h term.h types.h lsparse.h namelist.h dosdisk.h custom$(OBJ): funcno.h kanji.h catalog.h system.h termio.h custom$(OBJ): wait.h custom$(OBJ): termemu.h urldisk.h url.h auth.h command$(OBJ): fd.h headers.h machine.h config.h command$(OBJ): depend.h printf.h stream.h kctype.h command$(OBJ): string.h malloc.h command$(OBJ): parse.h func.h sysemu.h dirent.h unixemu.h command$(OBJ): pathname.h command$(OBJ): typesize.h term.h types.h lsparse.h namelist.h dosdisk.h command$(OBJ): funcno.h kanji.h catalog.h system.h termio.h command$(OBJ): wait.h command$(OBJ): termemu.h functabl.h browse$(OBJ): fd.h headers.h machine.h config.h browse$(OBJ): depend.h printf.h stream.h kctype.h browse$(OBJ): string.h malloc.h browse$(OBJ): device.h parse.h kconv.h func.h sysemu.h dirent.h unixemu.h browse$(OBJ): pathname.h browse$(OBJ): typesize.h term.h types.h lsparse.h namelist.h dosdisk.h browse$(OBJ): funcno.h kanji.h catalog.h termemu.h unitbl$(OBJ): headers.h machine.h config.h dicttbl$(OBJ): headers.h machine.h config.h sprintf$(OBJ): headers.h machine.h config.h sprintf$(OBJ): depend.h printf.h stream.h kctype.h sprintf$(OBJ): typesize.h string.h stermio$(OBJ): headers.h machine.h config.h stermio$(OBJ): depend.h typesize.h sysemu.h dirent.h stermio$(OBJ): unixemu.h stermio$(OBJ): stream.h termio.h sstream$(OBJ): headers.h machine.h config.h sstream$(OBJ): depend.h typesize.h malloc.h sysemu.h sstream$(OBJ): dirent.h unixemu.h sstream$(OBJ): stream.h pathname.h termio.h sstring$(OBJ): headers.h machine.h config.h sstring$(OBJ): kctype.h depend.h sstring$(OBJ): string.h smalloc$(OBJ): headers.h machine.h config.h smalloc$(OBJ): printf.h stream.h depend.h malloc.h smalloc$(OBJ): sysemu.h dirent.h unixemu.h stime$(OBJ): headers.h machine.h config.h stime$(OBJ): typesize.h string.h time.h spathnam$(OBJ): headers.h machine.h config.h spathnam$(OBJ): depend.h spathnam$(OBJ): printf.h stream.h kctype.h spathnam$(OBJ): string.h malloc.h dirent.h unixemu.h spathnam$(OBJ): sysemu.h spathnam$(OBJ): pathname.h typesize.h ssystem$(OBJ): headers.h machine.h config.h ssystem$(OBJ): depend.h printf.h stream.h kctype.h ssystem$(OBJ): string.h malloc.h ssystem$(OBJ): dirent.h unixemu.h ssystem$(OBJ): sysemu.h system.h pathname.h ssystem$(OBJ): typesize.h termio.h ssystem$(OBJ): wait.h ssystem$(OBJ): termemu.h time.h posixsh.h sposixsh$(OBJ): headers.h machine.h config.h sposixsh$(OBJ): depend.h printf.h stream.h kctype.h sposixsh$(OBJ): string.h malloc.h sposixsh$(OBJ): sysemu.h dirent.h unixemu.h sposixsh$(OBJ): system.h pathname.h typesize.h sposixsh$(OBJ): termio.h sposixsh$(OBJ): wait.h sposixsh$(OBJ): termemu.h time.h posixsh.h sdoscom$(OBJ): headers.h machine.h config.h sdoscom$(OBJ): depend.h printf.h stream.h kctype.h sdoscom$(OBJ): string.h malloc.h sdoscom$(OBJ): dirent.h unixemu.h sdoscom$(OBJ): sysemu.h system.h pathname.h sdoscom$(OBJ): typesize.h termio.h sdoscom$(OBJ): wait.h ssysemu$(OBJ): headers.h machine.h config.h ssysemu$(OBJ): depend.h printf.h stream.h kctype.h ssysemu$(OBJ): string.h malloc.h ssysemu$(OBJ): sysemu.h dirent.h unixemu.h ssysemu$(OBJ): log.h pathname.h typesize.h termio.h ssysemu$(OBJ): realpath.h bprintf$(OBJ): headers.h machine.h config.h bprintf$(OBJ): depend.h printf.h stream.h kctype.h bprintf$(OBJ): typesize.h string.h btermio$(OBJ): headers.h machine.h config.h btermio$(OBJ): depend.h typesize.h sysemu.h dirent.h btermio$(OBJ): unixemu.h btermio$(OBJ): stream.h termio.h bstream$(OBJ): headers.h machine.h config.h bstream$(OBJ): depend.h typesize.h malloc.h sysemu.h bstream$(OBJ): dirent.h unixemu.h bstream$(OBJ): stream.h pathname.h termio.h bstring$(OBJ): headers.h machine.h config.h bstring$(OBJ): kctype.h depend.h bstring$(OBJ): string.h bmalloc$(OBJ): headers.h machine.h config.h bmalloc$(OBJ): printf.h stream.h depend.h malloc.h bmalloc$(OBJ): sysemu.h dirent.h unixemu.h bpathnam$(OBJ): headers.h machine.h config.h bpathnam$(OBJ): depend.h bpathnam$(OBJ): printf.h stream.h kctype.h bpathnam$(OBJ): string.h malloc.h dirent.h unixemu.h bpathnam$(OBJ): sysemu.h bpathnam$(OBJ): pathname.h typesize.h bsystem$(OBJ): headers.h machine.h config.h bsystem$(OBJ): depend.h printf.h stream.h kctype.h bsystem$(OBJ): string.h malloc.h bsystem$(OBJ): dirent.h unixemu.h bsystem$(OBJ): sysemu.h system.h pathname.h bsystem$(OBJ): typesize.h termio.h bsystem$(OBJ): wait.h bsystem$(OBJ): termemu.h bdoscom$(OBJ): headers.h machine.h config.h bdoscom$(OBJ): depend.h printf.h stream.h kctype.h bdoscom$(OBJ): string.h malloc.h bdoscom$(OBJ): dirent.h unixemu.h bdoscom$(OBJ): sysemu.h system.h pathname.h bdoscom$(OBJ): typesize.h termio.h bdoscom$(OBJ): wait.h bsysemu$(OBJ): headers.h machine.h config.h bsysemu$(OBJ): depend.h printf.h stream.h kctype.h bsysemu$(OBJ): string.h malloc.h bsysemu$(OBJ): sysemu.h dirent.h unixemu.h bsysemu$(OBJ): log.h pathname.h typesize.h termio.h bsysemu$(OBJ): realpath.h nprintf$(OBJ): headers.h machine.h config.h nprintf$(OBJ): depend.h printf.h stream.h kctype.h nprintf$(OBJ): typesize.h string.h ntermio$(OBJ): headers.h machine.h config.h ntermio$(OBJ): depend.h typesize.h sysemu.h dirent.h ntermio$(OBJ): unixemu.h ntermio$(OBJ): stream.h termio.h nstream$(OBJ): headers.h machine.h config.h nstream$(OBJ): depend.h typesize.h malloc.h sysemu.h nstream$(OBJ): dirent.h unixemu.h nstream$(OBJ): stream.h pathname.h termio.h nstream$(OBJ): socket.h nstring$(OBJ): headers.h machine.h config.h nstring$(OBJ): kctype.h depend.h nstring$(OBJ): string.h nmalloc$(OBJ): headers.h machine.h config.h nmalloc$(OBJ): printf.h stream.h depend.h malloc.h nmalloc$(OBJ): sysemu.h dirent.h unixemu.h ntime$(OBJ): headers.h machine.h config.h ntime$(OBJ): typesize.h string.h time.h npathnam$(OBJ): headers.h machine.h config.h npathnam$(OBJ): depend.h npathnam$(OBJ): printf.h stream.h kctype.h npathnam$(OBJ): string.h malloc.h dirent.h unixemu.h npathnam$(OBJ): sysemu.h npathnam$(OBJ): pathname.h typesize.h url.h nsystem$(OBJ): headers.h machine.h config.h nsystem$(OBJ): depend.h printf.h stream.h kctype.h nsystem$(OBJ): string.h malloc.h nsystem$(OBJ): dirent.h unixemu.h nsystem$(OBJ): sysemu.h system.h pathname.h nsystem$(OBJ): typesize.h termio.h nsystem$(OBJ): wait.h nsystem$(OBJ): termemu.h time.h posixsh.h socket.h nsystem$(OBJ): url.h urldisk.h namelist.h auth.h nposixsh$(OBJ): headers.h machine.h config.h nposixsh$(OBJ): depend.h printf.h stream.h kctype.h nposixsh$(OBJ): string.h malloc.h nposixsh$(OBJ): sysemu.h dirent.h unixemu.h nposixsh$(OBJ): system.h pathname.h typesize.h nposixsh$(OBJ): termio.h nposixsh$(OBJ): wait.h nposixsh$(OBJ): termemu.h time.h posixsh.h ndoscom$(OBJ): headers.h machine.h config.h ndoscom$(OBJ): depend.h printf.h stream.h kctype.h ndoscom$(OBJ): string.h malloc.h ndoscom$(OBJ): dirent.h unixemu.h ndoscom$(OBJ): sysemu.h system.h pathname.h ndoscom$(OBJ): typesize.h termio.h ndoscom$(OBJ): wait.h ndoscom$(OBJ): realpath.h urldisk.h namelist.h url.h ndoscom$(OBJ): auth.h nsysemu$(OBJ): headers.h machine.h config.h nsysemu$(OBJ): depend.h printf.h stream.h kctype.h nsysemu$(OBJ): string.h malloc.h nsysemu$(OBJ): sysemu.h dirent.h unixemu.h nsysemu$(OBJ): log.h pathname.h typesize.h termio.h nsysemu$(OBJ): realpath.h socket.h nsysemu$(OBJ): urldisk.h namelist.h url.h auth.h nrealpat$(OBJ): headers.h machine.h config.h nrealpat$(OBJ): depend.h nrealpat$(OBJ): printf.h stream.h kctype.h nrealpat$(OBJ): string.h sysemu.h dirent.h unixemu.h nrealpat$(OBJ): pathname.h nrealpat$(OBJ): typesize.h realpath.h url.h nencode$(OBJ): headers.h machine.h config.h nencode$(OBJ): kctype.h depend.h nencode$(OBJ): sysemu.h dirent.h unixemu.h nencode$(OBJ): stream.h nencode$(OBJ): pathname.h typesize.h encode.h nparse$(OBJ): headers.h machine.h config.h nparse$(OBJ): depend.h printf.h stream.h kctype.h nparse$(OBJ): string.h malloc.h nparse$(OBJ): sysemu.h dirent.h unixemu.h nparse$(OBJ): realpath.h parse.h system.h nparse$(OBJ): pathname.h typesize.h termio.h nparse$(OBJ): wait.h nsocket$(OBJ): headers.h machine.h config.h nsocket$(OBJ): depend.h printf.h stream.h kctype.h nsocket$(OBJ): typesize.h malloc.h nsocket$(OBJ): sysemu.h dirent.h unixemu.h nsocket$(OBJ): termio.h nsocket$(OBJ): socket.h nurl$(OBJ): headers.h machine.h config.h nurl$(OBJ): depend.h printf.h nurl$(OBJ): stream.h kctype.h nurl$(OBJ): typesize.h string.h malloc.h sysemu.h dirent.h unixemu.h nurl$(OBJ): pathname.h url.h nauth$(OBJ): headers.h machine.h config.h nauth$(OBJ): depend.h printf.h stream.h string.h nauth$(OBJ): malloc.h time.h pathname.h typesize.h encode.h parse.h nauth$(OBJ): socket.h auth.h url.h system.h nauth$(OBJ): termio.h nauth$(OBJ): wait.h unixemu.h nauth$(OBJ): sysemu.h dirent.h nftp$(OBJ): headers.h machine.h config.h nftp$(OBJ): depend.h printf.h nftp$(OBJ): stream.h kctype.h nftp$(OBJ): string.h malloc.h time.h sysemu.h dirent.h unixemu.h nftp$(OBJ): pathname.h nftp$(OBJ): typesize.h termio.h nftp$(OBJ): parse.h nftp$(OBJ): lsparse.h namelist.h socket.h auth.h nftp$(OBJ): url.h urldisk.h nhtml$(OBJ): headers.h machine.h config.h nhtml$(OBJ): depend.h printf.h stream.h kctype.h nhtml$(OBJ): typesize.h string.h nhtml$(OBJ): malloc.h sysemu.h dirent.h unixemu.h nhtml$(OBJ): pathname.h termio.h nhtml$(OBJ): parse.h html.h urldisk.h nhtml$(OBJ): namelist.h url.h auth.h nhttp$(OBJ): headers.h machine.h config.h nhttp$(OBJ): depend.h printf.h stream.h kctype.h nhttp$(OBJ): string.h malloc.h nhttp$(OBJ): time.h sysemu.h dirent.h unixemu.h nhttp$(OBJ): pathname.h typesize.h termio.h nhttp$(OBJ): parse.h lsparse.h namelist.h nhttp$(OBJ): socket.h auth.h url.h html.h nhttp$(OBJ): urldisk.h nurldisk$(OBJ): headers.h machine.h config.h nurldisk$(OBJ): depend.h printf.h stream.h string.h nurldisk$(OBJ): malloc.h time.h sysemu.h dirent.h unixemu.h nurldisk$(OBJ): pathname.h nurldisk$(OBJ): typesize.h termio.h nurldisk$(OBJ): realpath.h nurldisk$(OBJ): lsparse.h namelist.h socket.h nurldisk$(OBJ): urldisk.h url.h auth.h nlsparse$(OBJ): headers.h machine.h config.h nlsparse$(OBJ): depend.h kctype.h nlsparse$(OBJ): string.h malloc.h time.h dirent.h nlsparse$(OBJ): unixemu.h nlsparse$(OBJ): pathname.h typesize.h device.h parse.h lsparse.h namelist.h evalopt$(OBJ): headers.h machine.h config.h evalopt$(OBJ): evalopt.h gentbl$(OBJ): headers.h machine.h config.h gentbl$(OBJ): gentbl.h mkunitbl$(OBJ): headers.h machine.h config.h mkunitbl$(OBJ): typesize.h evalopt.h gentbl.h mkdict$(OBJ): headers.h machine.h config.h mkdict$(OBJ): kctype.h depend.h mkdict$(OBJ): typesize.h string.h kconv.h roman.h mkdict$(OBJ): hinsi.h evalopt.h gentbl.h mktankan$(OBJ): headers.h machine.h config.h mktankan$(OBJ): kctype.h depend.h mktankan$(OBJ): typesize.h kconv.h roman.h mkkanji$(OBJ): headers.h machine.h config.h mkkanji$(OBJ): typesize.h mkcat$(OBJ): headers.h machine.h config.h mkcat$(OBJ): kctype.h depend.h mkcat$(OBJ): typesize.h version.h evalopt.h gentbl.h mkdir_p$(OBJ): headers.h machine.h config.h mkdir_p$(OBJ): kctype.h depend.h mkdir_p$(OBJ): typesize.h kanjicnv$(OBJ): headers.h machine.h config.h kanjicnv$(OBJ): evalopt.h expfunc$(OBJ): headers.h machine.h config.h mkfuncno$(OBJ): fd.h headers.h machine.h config.h mkfuncno$(OBJ): depend.h types.h typesize.h stream.h mkfuncno$(OBJ): lsparse.h namelist.h functabl.h tstring$(OBJ): headers.h machine.h config.h tstring$(OBJ): kctype.h depend.h tstring$(OBJ): string.h troman$(OBJ): headers.h machine.h config.h troman$(OBJ): depend.h kctype.h troman$(OBJ): typesize.h string.h kconv.h roman.h tkconv$(OBJ): headers.h machine.h config.h tkconv$(OBJ): depend.h kctype.h tkconv$(OBJ): typesize.h string.h unixemu.h kconv.h tkconv$(OBJ): termemu.h pathname.h tevalopt$(OBJ): headers.h machine.h config.h tevalopt$(OBJ): evalopt.h tgentbl$(OBJ): headers.h machine.h config.h tgentbl$(OBJ): gentbl.h tunitbl$(OBJ): headers.h machine.h config.h FD-3.01j/makefile.b98100644 2105 1751 153650 13516612560 13034 0ustar shiraiuser# # Makefile for fd # TITLE = FD- VERMAJ = 3 VERSION = 3.01j PREFIX = CONFDIR = BUILD = MANSEC = 1 BINTOP = $(PREFIX)\bin BINDIR = $(BUILD)$(BINTOP) DATATOP = $(PREFIX)\share DATADIR = $(BUILD)$(DATATOP)\fd MANTOP = $(PREFIX)\man MANDIR = $(BUILD)$(MANTOP)\man$(MANSEC) CATDIR = $(BUILD)$(MANTOP)\cat$(MANSEC) JMANDIR = $(BUILD)$(MANTOP)\man$(MANSEC) JCATDIR = $(BUILD)$(MANTOP)\cat$(MANSEC) IPKWDIR = .\ipk.work IPKTDIR = .\ipk.tmp DEPDIR = .\depend.tmp DIST = none DEFRC = $(CONFDIR)\fd2rc BLDRC = $(BUILD)$(DEFRC) DOSRC = ~FD\\fd2rc UNITBL = fd-unicd.tbl DICTTBL = fd-dict.tbl DICTTXT = fd-dict.txt DICTSRC = CATTBL = fd-cat.ja ECATTBL = fd-cat.C TABLES = $(UNITBL) $(CATTBL) $(ECATTBL) SRC = main.c printf.c termio.c term.c stream.c \ string.c malloc.c time.c \ pathname.c system.c posixsh.c doscom.c \ log.c sysemu.c dosdisk.c unixdisk.c \ realpath.c encode.c \ libc.c file.c mntinfo.c statfs.c apply.c \ pty.c termemu.c frontend.c backend.c \ parse.c builtin.c shell.c \ socket.c url.c auth.c \ ftp.c html.c http.c urldisk.c \ catalog.c \ kconv.c input.c ime.c dict.c roman.c \ info.c rockridg.c tree.c \ lsparse.c archive.c \ custom.c command.c browse.c HSRC = evalopt.c gentbl.c \ mkunitbl.c mkdict.c mktankan.c \ mkkanji.c mkcat.c mkdir_p.c \ kanjicnv.c expfunc.c \ mkfuncno.c DSRC = $(DEPDIR)\unitbl.c $(DEPDIR)\dicttbl.c HEADER = fd.h \ headers.h machine.h \ depend.h \ printf.h kctype.h typesize.h \ string.h malloc.h time.h \ dirent.h sysemu.h log.h \ pathname.h system.h posixsh.h wait.h \ termio.h term.h stream.h \ types.h namelist.h \ dosdisk.h unixdisk.h unixemu.h \ realpath.h encode.h termemu.h \ mntinfo.h fsinfo.h device.h parse.h lsparse.h \ socket.h url.h auth.h html.h urldisk.h \ catalog.h \ evalopt.h gentbl.h \ kconv.h roman.h hinsi.h \ func.h functabl.h SSRC = printf.c termio.c stream.c \ string.c malloc.c time.c \ pathname.c system.c posixsh.c doscom.c \ sysemu.c BSRC = printf.c termio.c stream.c \ string.c malloc.c \ pathname.c system.c doscom.c \ sysemu.c NSRC = printf.c termio.c stream.c \ string.c malloc.c time.c \ pathname.c system.c posixsh.c doscom.c \ sysemu.c \ realpath.c encode.c \ parse.c \ socket.c url.c auth.c \ ftp.c html.c http.c urldisk.c \ lsparse.c TSRC = string.c roman.c kconv.c evalopt.c gentbl.c unitbl.c DOC = README.eng HISTORY.eng FAQ.eng TECHKNOW.eng \ Install.eng ToAdmin.eng LICENSES.eng JDOC = README HISTORY FAQ TECHKNOW \ Install ToAdmin LICENSES MANSRC = fd_e.man MANCAT = fd_e.cat JMANSRC = fd.man JMANCAT = fd.cat RUNCOM = fdrc ARGS = object.arg SARGS = sobject.arg NARGS = nobject.arg SRCS = $(DOC) $(MANSRC) $(MANCAT) \ Configur Makefile Makefile.in $(SRC) $(HSRC) $(HEADER) \ makefile.gpc makefile.g98 \ makefile.dpc makefile.d98 \ makefile.lpc makefile.l98 \ makefile.bpc makefile.b98 \ mkmfdosg.sed mkmfdosd.sed mkmfdosl.sed mkmfdosb.sed \ mkmfsed.c \ config.hin version.h \ _fdrc _fdrc.dif fd.spec JSRCS = $(JDOC) $(JMANSRC) $(JMANCAT) \ kanji.hin SOURCES = $(SRCS) $(JSRCS) SHSOURCES = $(NSRC) \ headers.h machine.h \ depend.h \ printf.h kctype.h typesize.h \ string.h malloc.h time.h \ dirent.h sysemu.h log.h \ pathname.h system.h posixsh.h wait.h \ termio.h stream.h \ namelist.h \ unixemu.h \ realpath.h encode.h \ device.h parse.h lsparse.h \ socket.h url.h auth.h html.h urldisk.h \ kanjicnv.c expfunc.c mkmfsed.c \ Configur Makefile Makefile.in \ makefile.gpc makefile.g98 \ makefile.dpc makefile.d98 \ makefile.lpc makefile.l98 \ makefile.bpc makefile.b98 \ mkmfdosg.sed mkmfdosd.sed mkmfdosl.sed mkmfdosb.sed \ config.hin version.h CC = bcc HOSTCC = $(CC) INSTALL = copy /y MAKE = make SHELL = \bin\sh SED = sed ECHO = command /c echo CP = copy /y RM = del LN = copy /y MV = mv CHMOD = chmod LINT = lint TAR = tar LHA = lha SHAR = shar EXE = .exe OBJ = .obj PROGRAM = fd ALIAS = fdsh DOSOBJS = unixdisk$(OBJ) IMEOBJS = ime$(OBJ) dict$(OBJ) roman$(OBJ) SCKOBJS = socket$(OBJ) url$(OBJ) auth$(OBJ) \ ftp$(OBJ) html$(OBJ) http$(OBJ) urldisk$(OBJ) OBJ1 = main$(OBJ) printf$(OBJ) termio$(OBJ) term$(OBJ) stream$(OBJ) \ string$(OBJ) malloc$(OBJ) time$(OBJ) OBJ2 = pathname$(OBJ) system$(OBJ) posixsh$(OBJ) doscom$(OBJ) \ log$(OBJ) sysemu$(OBJ) dosdisk$(OBJ) $(DOSOBJS) OBJ3 = realpath$(OBJ) encode$(OBJ) \ libc$(OBJ) file$(OBJ) mntinfo$(OBJ) statfs$(OBJ) apply$(OBJ) \ pty$(OBJ) termemu$(OBJ) frontend$(OBJ) backend$(OBJ) OBJ4 = parse$(OBJ) builtin$(OBJ) shell$(OBJ) OBJ5 = catalog$(OBJ) \ kconv$(OBJ) input$(OBJ) OBJ6 = info$(OBJ) rockridg$(OBJ) tree$(OBJ) \ lsparse$(OBJ) archive$(OBJ) \ custom$(OBJ) command$(OBJ) browse$(OBJ) SOBJ1 = sprintf$(OBJ) stermio$(OBJ) sstream$(OBJ) \ sstring$(OBJ) smalloc$(OBJ) stime$(OBJ) SOBJ2 = spathnam$(OBJ) ssystem$(OBJ) sposixsh$(OBJ) sdoscom$(OBJ) \ ssysemu$(OBJ) BOBJ = bprintf$(OBJ) btermio$(OBJ) bstream$(OBJ) \ bstring$(OBJ) bmalloc$(OBJ) \ bpathnam$(OBJ) bsystem$(OBJ) bdoscom$(OBJ) \ bsysemu$(OBJ) NOBJ1 = nprintf$(OBJ) ntermio$(OBJ) nstream$(OBJ) \ nstring$(OBJ) nmalloc$(OBJ) ntime$(OBJ) NOBJ2 = npathnam$(OBJ) nsystem$(OBJ) nposixsh$(OBJ) ndoscom$(OBJ) \ nsysemu$(OBJ) \ nrealpat$(OBJ) nencode$(OBJ) NOBJ3 = nparse$(OBJ) \ nsocket$(OBJ) nurl$(OBJ) nauth$(OBJ) \ nftp$(OBJ) nhtml$(OBJ) nhttp$(OBJ) nurldisk$(OBJ) \ nlsparse$(OBJ) KOBJ = tevalopt$(OBJ) COBJ = tevalopt$(OBJ) tgentbl$(OBJ) UOBJ = tevalopt$(OBJ) tgentbl$(OBJ) TOBJ = tstring$(OBJ) troman$(OBJ) tkconv$(OBJ) tevalopt$(OBJ) tgentbl$(OBJ) ALLOC = DEBUG = CFLAGS = -O -N -d -w-par -w-rch -w-ccc -w-pia HOSTCFLAGS = $(CFLAGS) CPPFLAGS = HOSTCPPFLAGS = $(CPPFLAGS) LDFLAGS = HOSTLDFLAGS = $(LDFLAGS) OSOPTS = -DPC98 COPTS = $(OSOPTS) $(DEBUG) $(CFLAGS) HOSTCOPTS = $(COPTS) FLDFLAGS = $(ALLOC) $(LDFLAGS) SLDFLAGS = $(ALLOC) $(LDFLAGS) NLDFLAGS = $(ALLOC) $(LDFLAGS) BUILDFLAGS = $(COPTS) $(CPPFLAGS) FDCFLAGS = $(BUILDFLAGS) -ml -DFD=$(VERMAJ) SHCFLAGS = $(BUILDFLAGS) -mm -DFDSH=$(VERMAJ) BSHCFLAGS = $(BUILDFLAGS) -mm -DFDSH=$(VERMAJ) -DMINIMUMSHELL NSHCFLAGS = $(BUILDFLAGS) -ml -DFDSH=$(VERMAJ) -DWITHNETWORK DEFCFLAGS = -DDEFRC=\"$(DOSRC)\" .SUFFIXES: .h .c .obj .exe ############################################################ # Dependency Rules ############################################################ all: $(PROGRAM)$(EXE) $(PROGRAM).$(MANSEC) $(TABLES) $(PROGRAM)$(EXE): $(OBJ1) $(OBJ2) $(OBJ3) $(OBJ4) $(OBJ5) $(OBJ6) $(ARGS) # @sleep 1 $(CC) -ml -e$@ @$(ARGS) $(FLDFLAGS) # @ren $@ $(PROGRAM) # @aout2exe $(PROGRAM) # @del $(PROGRAM) $(ARGS): $(OBJ1) $(OBJ2) $(OBJ3) $(OBJ4) $(OBJ5) $(OBJ6) # @sleep 1 @$(ECHO) $(OBJ1) > $(ARGS) @$(ECHO) $(OBJ2) >> $(ARGS) @$(ECHO) $(OBJ3) >> $(ARGS) @$(ECHO) $(OBJ4) >> $(ARGS) @$(ECHO) $(OBJ5) >> $(ARGS) @$(ECHO) $(OBJ6) >> $(ARGS) # @sleep 1 main$(OBJ): main.c $(CC) $(FDCFLAGS) $(DEFCFLAGS) -c -o$@ $*.c termio$(OBJ): termio.c $(CC) $(FDCFLAGS) -c -o$@ $*.c system$(OBJ): system.c $(CC) $(FDCFLAGS) $(DEFCFLAGS) -c -o$@ $*.c custom$(OBJ): custom.c $(CC) $(FDCFLAGS) -c -o$@ $*.c .c.obj: $(CC) $(FDCFLAGS) -c -o$@ $*.c ############################################################ # kanji using module $(PROGRAM).$(MANSEC): kanjicnv$(EXE) $(JMANSRC) .\kanjicnv$(EXE) -s $(JMANSRC) $@ $(PROGRAM).$(MANSEC)c: kanjicnv$(EXE) $(JMANCAT) .\kanjicnv$(EXE) -s $(JMANCAT) $@ $(PROGRAM).eng: kanjicnv$(EXE) $(MANCAT) .\kanjicnv$(EXE) -b $(MANCAT) $@ $(PROGRAM).doc: kanjicnv$(EXE) $(JMANCAT) .\kanjicnv$(EXE) -s -b $(JMANCAT) $@ README.doc: kanjicnv$(EXE) README .\kanjicnv$(EXE) -s README $@ HISTORY.doc: kanjicnv$(EXE) HISTORY .\kanjicnv$(EXE) -s HISTORY $@ FAQ.doc: kanjicnv$(EXE) FAQ .\kanjicnv$(EXE) -s FAQ $@ LICENSES.doc: kanjicnv$(EXE) LICENSES .\kanjicnv$(EXE) -s LICENSES $@ kanjicnv$(EXE): kanjicnv$(OBJ) $(KOBJ) # @sleep 1 $(HOSTCC) $(HOSTCOPTS) $(HOSTLDFLAGS) -e$@ kanjicnv$(OBJ) $(KOBJ) # @ren $@ kanjicnv # @aout2exe kanjicnv # @del kanjicnv # @sleep 1 kanjicnv$(OBJ): kanjicnv.c $(HOSTCC) $(HOSTCOPTS) $(HOSTCPPFLAGS) -c -o$@ $*.c ############################################################ # message catalog module kanji.h: mkkanji$(EXE) kanjicnv$(EXE) kanji.hin .\mkkanji$(EXE) kanji.hin | \ .\kanjicnv$(EXE) -s - $@ # @sleep 1 mkkanji$(EXE): mkkanji$(OBJ) # @sleep 1 $(HOSTCC) $(HOSTCOPTS) $(HOSTLDFLAGS) -e$@ mkkanji$(OBJ) # @ren $@ mkkanji # @aout2exe mkkanji # @del mkkanji # @sleep 1 mkkanji$(OBJ): mkkanji.c $(HOSTCC) $(HOSTCOPTS) $(HOSTCPPFLAGS) -c -o$@ $*.c _fd-cat.ja: mkcat$(EXE) kanji.h .\mkcat$(EXE) -c 1 kanji.h $@ # @sleep 1 _fd-cat.C: mkcat$(EXE) kanji.h .\mkcat$(EXE) -c 2 kanji.h $@ # @sleep 1 fd-cat.ja: mkcat$(EXE) _fd-cat.ja .\mkcat$(EXE) _fd-cat.ja $@ fd-cat.C: mkcat$(EXE) _fd-cat.C .\mkcat$(EXE) _fd-cat.C $@ mkcat$(EXE): mkcat$(OBJ) $(COBJ) # @sleep 1 $(HOSTCC) $(HOSTCOPTS) $(HOSTLDFLAGS) -e$@ mkcat$(OBJ) $(COBJ) # @ren $@ mkcat # @aout2exe mkcat # @del mkcat # @sleep 1 mkcat$(OBJ): mkcat.c $(HOSTCC) $(HOSTCOPTS) $(HOSTCPPFLAGS) -c -o$@ $*.c ############################################################ # function list using module funcno.h: mkfuncno$(EXE) .\mkfuncno$(EXE) $@ # @sleep 1 mkfuncno$(EXE): mkfuncno$(OBJ) # @sleep 1 $(HOSTCC) $(HOSTCOPTS) $(HOSTLDFLAGS) -e$@ mkfuncno$(OBJ) # @ren $@ mkfuncno # @aout2exe mkfuncno # @del mkfuncno # @sleep 1 mkfuncno$(OBJ): mkfuncno.c $(HOSTCC) $(HOSTCOPTS) $(HOSTCPPFLAGS) -DFD=$(VERMAJ) -c -o$@ $*.c ############################################################ # UNICODE table generating module $(UNITBL): mkunitbl$(EXE) .\mkunitbl$(EXE) $@ unitbl.c: mkunitbl$(EXE) .\mkunitbl$(EXE) -t $@ $(DEPDIR)\unitbl.c: mkunitbl$(EXE) [ -d $(DEPDIR) ] || mkdir $(DEPDIR) .\mkunitbl$(EXE) -t -n $@ mkunitbl$(EXE): mkunitbl$(OBJ) $(UOBJ) # @sleep 1 $(HOSTCC) $(HOSTCOPTS) $(HOSTLDFLAGS) -e$@ mkunitbl$(OBJ) $(UOBJ) # @ren $@ mkunitbl # @aout2exe mkunitbl # @del mkunitbl # @sleep 1 mkunitbl$(OBJ): mkunitbl.c $(HOSTCC) $(HOSTCOPTS) $(HOSTCPPFLAGS) -c -o$@ $*.c tunitbl$(OBJ): unitbl.c $(HOSTCC) $(HOSTCOPTS) $(HOSTCPPFLAGS) -c -o$@ unitbl.c ############################################################ # Kanji transfer table generating module $(DICTTBL): mkdict$(EXE) $(DICTSRC) .\mkdict$(EXE) $@ $(DICTSRC) dicttbl.c: mkdict$(EXE) $(DICTSRC) .\mkdict$(EXE) -t $@ $(DICTSRC) $(DEPDIR)\dicttbl.c: mkdict$(EXE) $(DICTSRC) [ -d $(DEPDIR) ] || mkdir $(DEPDIR) .\mkdict$(EXE) -t -n $@ $(DICTSRC) mkdict$(EXE): mkdict$(OBJ) $(TOBJ) # @sleep 1 $(HOSTCC) $(HOSTCOPTS) $(HOSTLDFLAGS) -e$@ mkdict$(OBJ) $(TOBJ) # @ren $@ mkdict # @aout2exe mkdict # @del mkdict # @sleep 1 mktankan$(EXE): mktankan$(OBJ) $(TOBJ) # @sleep 1 $(HOSTCC) $(HOSTCOPTS) $(HOSTLDFLAGS) -e$@ mktankan$(OBJ) $(TOBJ) # @ren $@ mktankan # @aout2exe mktankan # @del mktankan # @sleep 1 mkdict$(OBJ): mkdict.c $(HOSTCC) $(HOSTCOPTS) $(HOSTCPPFLAGS) -c -o$@ $*.c mktankan$(OBJ): mktankan.c $(HOSTCC) $(HOSTCOPTS) $(HOSTCPPFLAGS) -c -o$@ $*.c tstring$(OBJ): string.c $(HOSTCC) $(HOSTCOPTS) $(HOSTCPPFLAGS) -c -o$@ string.c troman$(OBJ): roman.c $(HOSTCC) $(HOSTCOPTS) $(HOSTCPPFLAGS) -c -o$@ roman.c tkconv$(OBJ): kconv.c $(HOSTCC) $(HOSTCOPTS) $(HOSTCPPFLAGS) -c -o$@ kconv.c tevalopt$(OBJ): evalopt.c $(HOSTCC) $(HOSTCOPTS) $(HOSTCPPFLAGS) -c -o$@ evalopt.c tgentbl$(OBJ): gentbl.c $(HOSTCC) $(HOSTCOPTS) $(HOSTCPPFLAGS) -c -o$@ gentbl.c rmdict: -$(RM) $(DICTTBL) $(DICTTXT): mktankan$(EXE) .\mktankan$(EXE) $@ # @sleep 1 ############################################################ # Directory generating module mkdir_p$(EXE): mkdir_p$(OBJ) # @sleep 1 $(HOSTCC) $(HOSTCOPTS) $(HOSTLDFLAGS) -e$@ mkdir_p$(OBJ) # @ren $@ mkdir_p # @aout2exe mkdir_p # @del mkdir_p # @sleep 1 mkdir_p$(OBJ): mkdir_p.c $(HOSTCC) $(HOSTCOPTS) $(HOSTCPPFLAGS) -c -o$@ $*.c ############################################################ # to install all install: install-bin install-runcom install-man install-jman install-bin: $(PROGRAM)$(EXE) mkdir_p$(EXE) install-table [ -d $(BINDIR) ] || .\mkdir_p$(EXE) $(BINDIR) $(INSTALL) $(PROGRAM)$(EXE) $(BINDIR) $(CHMOD) a+rx $(BINDIR)\$(PROGRAM)$(EXE) -$(RM) $(BINDIR)\$(ALIAS)$(EXE) $(LN) $(BINDIR)\$(PROGRAM)$(EXE) $(BINDIR)\$(ALIAS)$(EXE) $(CHMOD) a+rx $(BINDIR)\$(ALIAS)$(EXE) install-runcom: -if [ -f $(RUNCOM) ]; then \ $(INSTALL) $(RUNCOM) $(BLDRC); \ $(CHMOD) a+r-x $(BLDRC); \ fi install-table: $(TABLE) mkdir_p$(EXE) -if [ -f $(UNITBL) ]; then \ [ -d $(BINDIR) ] || .\mkdir_p$(EXE) $(BINDIR); \ $(INSTALL) $(UNITBL) $(BINDIR); \ $(CHMOD) a+r-x $(BINDIR)\$(UNITBL); \ fi -if [ -f $(DICTTBL) ]; then \ [ -d $(BINDIR) ] || .\mkdir_p$(EXE) $(BINDIR); \ $(INSTALL) $(DICTTBL) $(BINDIR); \ $(CHMOD) a+r-x $(BINDIR)\$(DICTTBL); \ fi -if [ -f $(CATTBL) ]; then \ [ -d $(BINDIR) ] || .\mkdir_p$(EXE) $(BINDIR); \ $(INSTALL) $(CATTBL) $(BINDIR); \ $(CHMOD) a+r-x $(BINDIR)\$(CATTBL); \ fi -if [ -f $(ECATTBL) ]; then \ [ -d $(BINDIR) ] || .\mkdir_p$(EXE) $(BINDIR); \ $(INSTALL) $(ECATTBL) $(BINDIR); \ $(CHMOD) a+r-x $(BINDIR)\$(ECATTBL); \ fi install-man: $(MANSRC) mkdir_p$(EXE) [ -d $(MANDIR) ] || .\mkdir_p$(EXE) $(MANDIR) $(INSTALL) $(MANSRC) $(MANDIR)\$(PROGRAM).$(MANSEC) $(CHMOD) a+r-x $(MANDIR)\$(PROGRAM).$(MANSEC) -$(RM) $(MANDIR)\$(ALIAS).$(MANSEC) $(LN) $(MANDIR)\$(PROGRAM).$(MANSEC) $(MANDIR)\$(ALIAS).$(MANSEC) $(CHMOD) a+r-x $(MANDIR)\$(ALIAS).$(MANSEC) install-jman: $(PROGRAM).$(MANSEC) mkdir_p$(EXE) [ -d $(JMANDIR) ] || .\mkdir_p$(EXE) $(JMANDIR) [ "$(JMANDIR)" = "$(MANDIR)" ] || \ $(INSTALL) $(PROGRAM).$(MANSEC) $(JMANDIR)\$(PROGRAM).$(MANSEC) $(CHMOD) a+r-x $(JMANDIR)\$(PROGRAM).$(MANSEC) -$(RM) $(JMANDIR)\$(ALIAS).$(MANSEC) $(LN) $(JMANDIR)\$(PROGRAM).$(MANSEC) $(JMANDIR)\$(ALIAS).$(MANSEC) $(CHMOD) a+r-x $(JMANDIR)\$(ALIAS).$(MANSEC) catman: $(MANCAT) mkdir_p$(EXE) [ -d $(CATDIR) ] || .\mkdir_p$(EXE) $(CATDIR) $(INSTALL) $(MANCAT) $(CATDIR)\$(PROGRAM).$(MANSEC) $(CHMOD) a+r-x $(CATDIR)\$(PROGRAM).$(MANSEC) -$(RM) $(CATDIR)\$(ALIAS).$(MANSEC) $(LN) $(CATDIR)\$(PROGRAM).$(MANSEC) $(CATDIR)\$(ALIAS).$(MANSEC) $(CHMOD) a+r-x $(CATDIR)\$(ALIAS).$(MANSEC) catman-b: $(PROGRAM).eng mkdir_p$(EXE) [ -d $(CATDIR) ] || .\mkdir_p$(EXE) $(CATDIR) $(INSTALL) $(PROGRAM).eng $(CATDIR)\$(PROGRAM).$(MANSEC) $(CHMOD) a+r-x $(CATDIR)\$(PROGRAM).$(MANSEC) -$(RM) $(CATDIR)\$(ALIAS).$(MANSEC) $(LN) $(CATDIR)\$(PROGRAM).$(MANSEC) $(CATDIR)\$(ALIAS).$(MANSEC) $(CHMOD) a+r-x $(CATDIR)\$(ALIAS).$(MANSEC) compman: catman -$(RM) $(CATDIR)\$(ALIAS).$(MANSEC) compress -f $(CATDIR)\$(PROGRAM).$(MANSEC) -$(RM) $(CATDIR)\$(ALIAS).$(MANSEC).Z $(LN) $(CATDIR)\$(PROGRAM).$(MANSEC).Z $(CATDIR)\$(ALIAS).$(MANSEC).Z compman-b: catman-b -$(RM) $(CATDIR)\$(ALIAS).$(MANSEC) compress -f $(CATDIR)\$(PROGRAM).$(MANSEC) -$(RM) $(CATDIR)\$(ALIAS).$(MANSEC).Z $(LN) $(CATDIR)\$(PROGRAM).$(MANSEC).Z $(CATDIR)\$(ALIAS).$(MANSEC).Z jcatman: catman $(PROGRAM).$(MANSEC)c mkdir_p$(EXE) [ -d $(JCATDIR) ] || .\mkdir_p$(EXE) $(JCATDIR) $(INSTALL) $(PROGRAM).$(MANSEC)c $(JCATDIR)\$(PROGRAM).$(MANSEC) $(CHMOD) a+r-x $(JCATDIR)\$(PROGRAM).$(MANSEC) -$(RM) $(JCATDIR)\$(ALIAS).$(MANSEC) $(LN) $(JCATDIR)\$(PROGRAM).$(MANSEC) $(JCATDIR)\$(ALIAS).$(MANSEC) $(CHMOD) a+r-x $(JCATDIR)\$(ALIAS).$(MANSEC) jcatman-b: catman-b $(PROGRAM).doc mkdir_p$(EXE) [ -d $(JCATDIR) ] || .\mkdir_p$(EXE) $(JCATDIR) $(INSTALL) $(PROGRAM).doc $(JCATDIR)\$(PROGRAM).$(MANSEC) $(CHMOD) a+r-x $(JCATDIR)\$(PROGRAM).$(MANSEC) -$(RM) $(JCATDIR)\$(ALIAS).$(MANSEC) $(LN) $(JCATDIR)\$(PROGRAM).$(MANSEC) $(JCATDIR)\$(ALIAS).$(MANSEC) $(CHMOD) a+r-x $(JCATDIR)\$(ALIAS).$(MANSEC) jcompman: compman jcatman -$(RM) $(JCATDIR)\$(ALIAS).$(MANSEC) compress -f $(JCATDIR)\$(PROGRAM).$(MANSEC) -$(RM) $(JCATDIR)\$(ALIAS).$(MANSEC).Z $(LN) $(JCATDIR)\$(PROGRAM).$(MANSEC).Z $(JCATDIR)\$(ALIAS).$(MANSEC).Z jcompman-b: compman-b jcatman-b -$(RM) $(JCATDIR)\$(ALIAS).$(MANSEC) compress -f $(JCATDIR)\$(PROGRAM).$(MANSEC) -$(RM) $(JCATDIR)\$(ALIAS).$(MANSEC).Z $(LN) $(JCATDIR)\$(PROGRAM).$(MANSEC).Z $(JCATDIR)\$(ALIAS).$(MANSEC).Z ############################################################ # to make dependency depend: $(SRC) $(HSRC) $(DSRC) config.h kanji.h funcno.h [ -d $(DEPDIR) ] || mkdir $(DEPDIR) for f in $(SRC) $(HSRC); do \ $(SED) -e 's:^\(# *\)include "\(.*\).h":\1include "_\2.h":' \ $${f} > $(DEPDIR)\$${f}; \ done for f in $(DSRC); do \ $(SED) -e 's:^\(# *\)include "\(.*\).h":\1include "_\2.h":' \ $${f} > $${f}o; \ $(MV) $${f}o $${f}; \ done for f in $(SSRC); do \ $(RM) $(DEPDIR)\s$${f}; \ $(LN) $(DEPDIR)\$${f} $(DEPDIR)\s$${f}; \ done for f in $(BSRC); do \ $(RM) $(DEPDIR)\b$${f} && \ $(LN) $(DEPDIR)\$${f} $(DEPDIR)\b$${f}; \ done for f in $(NSRC); do \ $(RM) $(DEPDIR)\n$${f} && \ $(LN) $(DEPDIR)\$${f} $(DEPDIR)\n$${f}; \ done for f in $(TSRC); do \ $(RM) $(DEPDIR)\t$${f} && \ $(LN) $(DEPDIR)\$${f} $(DEPDIR)\t$${f}; \ done for f in $(HEADER) config.h kanji.h funcno.h version.h; do \ $(SED) -e 's:^\(# *\)include "\(.*\).h":\1include "_\2.h":' \ $${f} > $(DEPDIR)\_$${f}; \ done $(CP) Makefile.in Makefile.tmp $(DEPDIR) $(CP) Makefile.tmp $(DEPDIR)\Makefile.sh $(CP) Makefile.tmp $(DEPDIR)\Makefile.bsh $(CP) Makefile.tmp $(DEPDIR)\Makefile.nsh $(CP) Makefile.tmp $(DEPDIR)\Makefile.tr cd $(DEPDIR); makedepend \ -s "# DO NOT DELETE THIS LINE -- make depend depends on it." \ -f Makefile.tmp -- $(FDCFLAGS) -- \ $(SRC) \ `for f in $(DSRC); do $(ECHO) $${f}|$(SED) -e 's:^.*\::'; done` cd $(DEPDIR); makedepend \ -s "# DO NOT DELETE THIS LINE -- make depend depends on it." \ -f Makefile.sh -- $(SHCFLAGS) -- \ `for f in $(SSRC); do $(ECHO) s$${f}; done` cd $(DEPDIR); makedepend \ -s "# DO NOT DELETE THIS LINE -- make depend depends on it." \ -f Makefile.bsh -- $(BSHCFLAGS) -- \ `for f in $(BSRC); do $(ECHO) b$${f}; done` cd $(DEPDIR); makedepend \ -s "# DO NOT DELETE THIS LINE -- make depend depends on it." \ -f Makefile.nsh -- $(NSHCFLAGS) -- \ `for f in $(NSRC); do $(ECHO) n$${f}; done` cd $(DEPDIR); makedepend \ -s "# DO NOT DELETE THIS LINE -- make depend depends on it." \ -f Makefile.tr -- $(HOSTCOPTS) -- \ $(HSRC) \ `for f in $(TSRC); do $(ECHO) t$${f}; done` $(SED) -e '\^# DO NOT DELETE THIS LINE\,$$d' $(DEPDIR)\Makefile.in \ > Makefile.in $(ECHO) "# DO NOT DELETE THIS LINE -- make depend depends on it." \ >> Makefile.in $(SED) -e '1,\^# DO NOT DELETE THIS LINE\d' \ -e 's:^\(........\).*\.o:\1.o:' \ -e 's:\\[^ ]* *::g' \ -e 's:\.o:\$$(OBJ):g' \ -e 's:_\([^ ]*.h\):\1:g' \ -e 's: *$$::' \ -e '\: *$$\d' $(DEPDIR)\Makefile.tmp >> Makefile.in $(SED) -e '1,\^# DO NOT DELETE THIS LINE\d' \ -e 's:^\(........\).*\.o:\1.o:' \ -e 's:\\[^ ]* *::g' \ -e 's:\.o:\$$(OBJ):g' \ -e 's:_\([^ ]*.h\):\1:g' \ -e 's: *$$::' \ -e '\: *$$\d' $(DEPDIR)\Makefile.sh >> Makefile.in $(SED) -e '1,\^# DO NOT DELETE THIS LINE\d' \ -e 's:^\(........\).*\.o:\1.o:' \ -e 's:\\[^ ]* *::g' \ -e 's:\.o:\$$(OBJ):g' \ -e 's:_\([^ ]*.h\):\1:g' \ -e 's: *$$::' \ -e '\: *$$\d' $(DEPDIR)\Makefile.bsh >> Makefile.in $(SED) -e '1,\^# DO NOT DELETE THIS LINE\d' \ -e 's:^\(........\).*\.o:\1.o:' \ -e 's:\\[^ ]* *::g' \ -e 's:\.o:\$$(OBJ):g' \ -e 's:_\([^ ]*.h\):\1:g' \ -e 's: *$$::' \ -e '\: *$$\d' $(DEPDIR)\Makefile.nsh >> Makefile.in $(SED) -e '1,\^# DO NOT DELETE THIS LINE\d' \ -e 's:^\(........\).*\.o:\1.o:' \ -e 's:\\[^ ]* *::g' \ -e 's:\.o:\$$(OBJ):g' \ -e 's:_\([^ ]*.h\):\1:g' \ -e 's: *$$::' \ -e '\: *$$\d' $(DEPDIR)\Makefile.tr >> Makefile.in -rm -rf $(DEPDIR) ############################################################ # to verify sources lint: $(SRC) $(HSRC) config.h kanji.h funcno.h $(LINT) $(OSOPTS) -DFD=$(VERMAJ) `$(SED) -e "s:\$(OBJ):\.c:g" $(ARGS)` SRCS=`$(ECHO) $(UOBJ)|$(SED) -e "s:t\([^ ]*\)\$(OBJ):\1\.c:g"`; \ $(LINT) $(OSOPTS) mkunitbl.c $${SRCS} SRCS=`$(ECHO) $(TOBJ)|$(SED) -e "s:t\([^ ]*\)\$(OBJ):\1\.c:g"`; \ $(LINT) $(OSOPTS) mkdict.c $${SRCS}; \ $(LINT) $(OSOPTS) mktankan.c $${SRCS} $(LINT) $(OSOPTS) mkkanji.c SRCS=`$(ECHO) $(COBJ)|$(SED) -e "s:t\([^ ]*\)\$(OBJ):\1\.c:g"`; \ $(LINT) $(OSOPTS) mkcat.c $${SRCS} $(LINT) $(OSOPTS) mkdir_p.c SRCS=`$(ECHO) $(KOBJ)|$(SED) -e "s:t\([^ ]*\)\$(OBJ):\1\.c:g"`; \ $(LINT) $(OSOPTS) kanjicnv.c $${SRCS} $(LINT) $(OSOPTS) expfunc.c $(LINT) $(OSOPTS) mkfuncno.c ############################################################ # to make configuration file manually config: Configur expfunc.c -if ($(ECHO) 't() { echo $1; }; t test' | $(SHELL) >\dev\null 2>&1); then \ $(SED) -e "2,3d" -e "s:__cc__:bcc:" Configur \ | $(SHELL) > config.h; \ elif $(MAKE) -f Makefile.tmp expfunc$(EXE); then \ $(SED) -e "2,3d" -e "s:__cc__:bcc:" Configur \ | .\expfunc$(EXE) | $(SHELL) > config.h; \ fi # @sleep 1 config.h: config.hin $(CP) config.hin $@ # @sleep 1 expfunc$(EXE): expfunc$(OBJ) # @sleep 1 $(HOSTCC) $(HOSTCOPTS) $(HOSTLDFLAGS) -e$@ expfunc$(OBJ) # @ren $@ expfunc # @aout2exe expfunc # @del expfunc # @sleep 1 expfunc$(OBJ): expfunc.c $(HOSTCC) $(HOSTCOPTS) $(HOSTCPPFLAGS) -c -o$@ $*.c ############################################################ # sample program for pseudo system(3) sh: fdsh$(EXE) fdsh$(EXE): $(SOBJ1) $(SOBJ2) $(SARGS) # @sleep 1 $(CC) -mm -e$@ @$(SARGS) $(SLDFLAGS) # @ren $@ fdsh # @aout2exe fdsh # @del fdsh $(SARGS): $(SOBJ1) $(SOBJ2) # @sleep 1 @$(ECHO) $(SOBJ1) > $(SARGS) @$(ECHO) $(SOBJ2) >> $(SARGS) # @sleep 1 sprintf$(OBJ): printf.c $(CC) $(SHCFLAGS) -c -o$@ printf.c stermio$(OBJ): termio.c $(CC) $(SHCFLAGS) -c -o$@ termio.c sstream$(OBJ): stream.c $(CC) $(SHCFLAGS) -c -o$@ stream.c sstring$(OBJ): string.c $(CC) $(SHCFLAGS) -c -o$@ string.c smalloc$(OBJ): malloc.c $(CC) $(SHCFLAGS) -c -o$@ malloc.c stime$(OBJ): time.c $(CC) $(SHCFLAGS) -c -o$@ time.c spathnam$(OBJ): pathname.c $(CC) $(SHCFLAGS) -c -o$@ pathname.c ssystem$(OBJ): system.c $(CC) $(SHCFLAGS) -c -o$@ system.c sposixsh$(OBJ): posixsh.c $(CC) $(SHCFLAGS) -c -o$@ posixsh.c sdoscom$(OBJ): doscom.c $(CC) $(SHCFLAGS) -c -o$@ doscom.c ssysemu$(OBJ): sysemu.c $(CC) $(SHCFLAGS) -c -o$@ sysemu.c ############################################################ # Bourne shell bsh: fdbsh$(EXE) fdbsh$(EXE): $(BOBJ) # @sleep 1 $(CC) -mm -e$@ $(BOBJ) $(SLDFLAGS) # @ren $@ fdbsh # @aout2exe fdbsh # @del fdbsh bprintf$(OBJ): printf.c $(CC) $(BSHCFLAGS) -c -o$@ printf.c btermio$(OBJ): termio.c $(CC) $(BSHCFLAGS) -c -o$@ termio.c bstream$(OBJ): stream.c $(CC) $(BSHCFLAGS) -c -o$@ stream.c bstring$(OBJ): string.c $(CC) $(BSHCFLAGS) -c -o$@ string.c bmalloc$(OBJ): malloc.c $(CC) $(BSHCFLAGS) -c -o$@ malloc.c bpathnam$(OBJ): pathname.c $(CC) $(BSHCFLAGS) -c -o$@ pathname.c bsystem$(OBJ): system.c $(CC) $(BSHCFLAGS) -c -o$@ system.c bdoscom$(OBJ): doscom.c $(CC) $(BSHCFLAGS) -c -o$@ doscom.c bsysemu$(OBJ): sysemu.c $(CC) $(BSHCFLAGS) -c -o$@ sysemu.c ############################################################ # Network shell nsh: fdnsh$(EXE) fdnsh$(EXE): $(NOBJ1) $(NOBJ2) $(NOBJ3) $(NARGS) # @sleep 1 $(CC) -ml -e$@ @$(NARGS) $(NLDFLAGS) # @ren $@ fdnsh # @aout2exe fdnsh # @del fdnsh $(NARGS): $(NOBJ1) $(NOBJ2) $(NOBJ3) # @sleep 1 @$(ECHO) $(NOBJ1) > $(NARGS) @$(ECHO) $(NOBJ2) >> $(NARGS) @$(ECHO) $(NOBJ3) >> $(NARGS) # @sleep 1 nprintf$(OBJ): printf.c $(CC) $(NSHCFLAGS) -c -o$@ printf.c ntermio$(OBJ): termio.c $(CC) $(NSHCFLAGS) -c -o$@ termio.c nstream$(OBJ): stream.c $(CC) $(NSHCFLAGS) -c -o$@ stream.c nstring$(OBJ): string.c $(CC) $(NSHCFLAGS) -c -o$@ string.c nmalloc$(OBJ): malloc.c $(CC) $(NSHCFLAGS) -c -o$@ malloc.c ntime$(OBJ): time.c $(CC) $(NSHCFLAGS) -c -o$@ time.c npathnam$(OBJ): pathname.c $(CC) $(NSHCFLAGS) -c -o$@ pathname.c nsystem$(OBJ): system.c $(CC) $(NSHCFLAGS) -c -o$@ system.c nposixsh$(OBJ): posixsh.c $(CC) $(NSHCFLAGS) -c -o$@ posixsh.c ndoscom$(OBJ): doscom.c $(CC) $(NSHCFLAGS) -c -o$@ doscom.c nsysemu$(OBJ): sysemu.c $(CC) $(NSHCFLAGS) -c -o$@ sysemu.c nrealpat$(OBJ): realpath.c $(CC) $(NSHCFLAGS) -c -o$@ realpath.c nencode$(OBJ): encode.c $(CC) $(NSHCFLAGS) -c -o$@ encode.c nparse$(OBJ): parse.c $(CC) $(NSHCFLAGS) -c -o$@ parse.c nsocket$(OBJ): socket.c $(CC) $(NSHCFLAGS) -c -o$@ socket.c nurl$(OBJ): url.c $(CC) $(NSHCFLAGS) -c -o$@ url.c nauth$(OBJ): auth.c $(CC) $(NSHCFLAGS) -c -o$@ auth.c nftp$(OBJ): ftp.c $(CC) $(NSHCFLAGS) -c -o$@ ftp.c nhtml$(OBJ): html.c $(CC) $(NSHCFLAGS) -c -o$@ html.c nhttp$(OBJ): http.c $(CC) $(NSHCFLAGS) -c -o$@ http.c nurldisk$(OBJ): urldisk.c $(CC) $(NSHCFLAGS) -c -o$@ urldisk.c nlsparse$(OBJ): lsparse.c $(CC) $(NSHCFLAGS) -c -o$@ lsparse.c ############################################################ # for programer's maintenance tar: $(SOURCES) $(TAR) cvf $(TITLE)$(VERSION).tar $(SOURCES) compress -f $(TITLE)$(VERSION).tar gtar: $(SOURCES) $(TAR) cvf $(TITLE)$(VERSION).tar $(SOURCES) gzip -f $(TITLE)$(VERSION).tar shtar: $(SHSOURCES) (VER=`date '+%y%m%d'`; \ $(TAR) cvf $(TITLE)sh-$${VER}.tar $(SHSOURCES); \ gzip -f $(TITLE)sh-$${VER}.tar) lzh: $(SOURCES) -$(RM) $(TITLE)$(VERSION).lzh $(LHA) a $(TITLE)$(VERSION).lzh $(SOURCES) shar: $(SOURCES) -$(RM) $(TITLE)$(VERSION).shar.[0-9][0-9] $(SHAR) -L50 -apc -n $(TITLE)$(VERSION) -o $(TITLE)$(VERSION).shar \ -T $(SRCS) -C $(JSRCS) ipk: $(PROGRAM)$(EXE) $(TABLES) mkdir_p$(EXE) -[ -d $(IPKWDIR)\$(BINDIR) ] || .\mkdir_p$(EXE) $(IPKWDIR)\$(BINDIR) -[ -d $(IPKWDIR)\$(BINDIR) ] || .\mkdir_p$(EXE) $(IPKWDIR)\$(BINDIR) -[ -d $(IPKWDIR)\$(BINDIR) ] || .\mkdir_p$(EXE) $(IPKWDIR)\$(BINDIR) -[ -d $(IPKWDIR)\$(CONFDIR) ] || .\mkdir_p$(EXE) $(IPKWDIR)\$(CONFDIR) -[ -d $(IPKWDIR)\CONTROL ] || .\mkdir_p$(EXE) $(IPKWDIR)\CONTROL -[ -d $(IPKTDIR) ] || .\mkdir_p$(EXE) $(IPKTDIR) $(CP) -p $(PROGRAM)$(EXE) $(IPKWDIR)\$(BINDIR) -[ -z "$(STRIP)" ] || $(STRIP) $(IPKWDIR)\$(BINDIR)\$(PROGRAM)$(EXE) $(CHMOD) a+rx $(IPKWDIR)\$(BINDIR)\$(PROGRAM)$(EXE) -$(RM) $(IPKWDIR)\$(BINDIR)\$(ALIAS)$(EXE) $(LN) $(IPKWDIR)\$(BINDIR)\$(PROGRAM)$(EXE) \ $(IPKWDIR)\$(BINDIR)\$(ALIAS)$(EXE) $(CHMOD) a+rx $(IPKWDIR)\$(BINDIR)\$(ALIAS)$(EXE) $(SED) -e 's:#TMPDIR=.*:TMPDIR=\home\tmp:' \ -e 's:#LANGUAGE=.*:LANGUAGE=euc:' \ -e 's:#INPUTKCODE=.*:INPUTKCODE=euc:' \ -e 's:#FNAMEKCODE=.*:FNAMEKCODE=utf8:' \ -e '\# launcher definition\,\^$$\ {' \ -e '\^$$\ {' \ -e 'i \' \ -e 'launch ".tar.Z" "gzip -cd %C|tar tvf -" "%a %u\%g %s %y-%m-%d %t %*f"' \ -e 'i \' \ -e 'launch ".taZ" "gzip -cd %C|tar tvf -" "%a %u\%g %s %y-%m-%d %t %*f"' \ -e 'i \' \ -e 'launch ".ipk" "gzip -cd %C|tar xOf - .\data.tar.gz|gzip -cd|tar tvf -" \\' \ -e 'i \' \ -e ' "%a %u\%g %s %y-%m-%d %t %*f"' \ -e 'i \' \ -e 'launch ".deb" "ar -p %C data.tar.gz|gzip -cd|tar tvf -" \\' \ -e 'i \' \ -e ' "%a %u\%g %s %y-%m-%d %t %*f"' \ -e '}' \ -e '}' \ -e '\# archiver definition\,\^$$\ {' \ -e '\^$$\ {' \ -e 'i \' \ -e 'arch ".tar.Z" "echo ERROR; false" "gzip -cd %C|tar xf - %TA"' \ -e 'i \' \ -e 'arch ".taZ" "echo ERROR; false" "gzip -cd %C|tar xf - %TA"' \ -e 'i \' \ -e 'arch ".ipk" "echo ERROR; false" \\' \ -e 'i \' \ -e ' "gzip -cd %C|tar xOf - .\data.tar.gz|gzip -cd|tar xf - %TA"' \ -e 'i \' \ -e 'arch ".deb" "echo ERROR; false" \\' \ -e 'i \' \ -e ' "ar -p %C data.tar.gz|gzip -cd|tar xf - %TA"' \ -e '}' \ -e '}' \ -e '$$ {' \ -e 'a \' \ -e 'if [ " $$TERM" = " vt100" -a " $$CONSOLE" = " \dev\console" ]; then' \ -e 'a \' \ -e ' keymap BS "^?"' \ -e 'a \' \ -e ' keymap DEL "\\033[3~"' \ -e 'a \' \ -e ' keymap HOME "\\033[H"' \ -e 'a \' \ -e ' keymap END "\\033[F"' \ -e 'a \' \ -e 'fi' \ -e '}' \ _fdrc > $(IPKWDIR)\$(BLDRC) $(CHMOD) a+r-x $(IPKWDIR)\$(BLDRC) -if [ -f $(UNITBL) ]; then \ cp -p $(UNITBL) $(IPKWDIR)\$(BINDIR); \ $(CHMOD) a+r-x $(IPKWDIR)\$(BINDIR)\$(UNITBL); \ fi -if [ -f $(DICTTBL) ]; then \ cp -p $(DICTTBL) $(IPKWDIR)\$(BINDIR); \ $(CHMOD) a+r-x $(IPKWDIR)\$(BINDIR)\$(DICTTBL); \ fi -if [ -f $(CATTBL) ]; then \ cp -p $(CATTBL) $(IPKWDIR)\$(BINDIR); \ $(CHMOD) a+r-x $(IPKWDIR)\$(BINDIR)\$(CATTBL); \ fi -if [ -f $(ECATTBL) ]; then \ cp -p $(ECATTBL) $(IPKWDIR)\$(BINDIR); \ $(CHMOD) a+r-x $(IPKWDIR)\$(BINDIR)\$(ECATTBL); \ fi $(ECHO) "Package: fd" > $(IPKWDIR)\CONTROL\control $(ECHO) "Priority: optional" >> $(IPKWDIR)\CONTROL\control $(ECHO) "Section: extras" >> $(IPKWDIR)\CONTROL\control $(ECHO) "Maintainer: $(DIST)" >> $(IPKWDIR)\CONTROL\control $(ECHO) "Architecture: arm" >> $(IPKWDIR)\CONTROL\control $(ECHO) "Version: $(VERSION)-1" >> $(IPKWDIR)\CONTROL\control $(ECHO) "Depends: ncurses" >> $(IPKWDIR)\CONTROL\control $(ECHO) "Description: a file & directory maintenance tool." \ >> $(IPKWDIR)\CONTROL\control (cd $(IPKWDIR); tar cf ..\data.tar --exclude=CONTROL .) (cd $(IPKWDIR)\CONTROL; tar cf ..\..\control.tar .) gzip .\data.tar $(MV) .\data.tar.gz $(IPKTDIR) gzip .\control.tar $(MV) .\control.tar.gz $(IPKTDIR) $(ECHO) "2.0" > $(IPKTDIR)\debian-binary (cd $(IPKTDIR); \ tar cf ..\ipk.tar .\debian-binary .\data.tar.gz .\control.tar.gz) gzip .\ipk.tar $(MV) .\ipk.tar.gz .\fd_$(VERSION)-1_arm.ipk -$(RM) -r $(IPKWDIR) $(IPKTDIR) clean: -$(RM) core -$(RM) *$(OBJ) -$(RM) funcno.h -$(RM) kanji.h -$(RM) _fd-cat.ja -$(RM) _fd-cat.C -$(RM) fd-cat.* -$(RM) kanjicnv$(EXE) -$(RM) expfunc$(EXE) -$(RM) mkdir_p$(EXE) -$(RM) mkfuncno$(EXE) -$(RM) mkunitbl$(EXE) -$(RM) mkdict$(EXE) -$(RM) mktankan$(EXE) -$(RM) mkkanji$(EXE) -$(RM) mkcat$(EXE) -$(RM) fdsh$(EXE) -$(RM) fdbsh$(EXE) -$(RM) fdnsh$(EXE) -$(RM) $(PROGRAM)$(EXE) -$(RM) $(PROGRAM).$(MANSEC) -$(RM) $(PROGRAM).$(MANSEC)c -$(RM) $(PROGRAM).eng -$(RM) $(PROGRAM).doc -$(RM) $(ARGS) -$(RM) $(SARGS) -$(RM) $(NARGS) -$(RM) $(UNITBL) -$(RM) unitbl.c -$(RM) dicttbl.c -$(RM) $(DICTTXT) -$(RM) $(DICTTBL) # DO NOT DELETE THIS LINE -- make depend depends on it. main$(OBJ): fd.h headers.h machine.h config.h main$(OBJ): depend.h printf.h main$(OBJ): stream.h kctype.h main$(OBJ): string.h malloc.h time.h log.h termio.h main$(OBJ): realpath.h main$(OBJ): parse.h kconv.h func.h sysemu.h dirent.h unixemu.h main$(OBJ): pathname.h main$(OBJ): typesize.h term.h types.h lsparse.h namelist.h dosdisk.h main$(OBJ): kanji.h catalog.h version.h system.h wait.h main$(OBJ): termemu.h roman.h urldisk.h url.h auth.h printf$(OBJ): headers.h machine.h config.h printf$(OBJ): depend.h printf.h stream.h kctype.h printf$(OBJ): typesize.h string.h printf$(OBJ): kconv.h termio$(OBJ): headers.h machine.h config.h termio$(OBJ): depend.h typesize.h sysemu.h dirent.h termio$(OBJ): unixemu.h termio$(OBJ): stream.h termio.h term$(OBJ): headers.h machine.h config.h term$(OBJ): depend.h printf.h term$(OBJ): stream.h kctype.h term$(OBJ): typesize.h string.h termio.h term$(OBJ): term.h stream$(OBJ): headers.h machine.h config.h stream$(OBJ): depend.h typesize.h malloc.h sysemu.h stream$(OBJ): dirent.h unixemu.h stream$(OBJ): stream.h pathname.h termio.h stream$(OBJ): socket.h string$(OBJ): headers.h machine.h config.h string$(OBJ): kctype.h depend.h string$(OBJ): string.h malloc$(OBJ): headers.h machine.h config.h malloc$(OBJ): printf.h stream.h depend.h malloc.h malloc$(OBJ): sysemu.h dirent.h unixemu.h time$(OBJ): headers.h machine.h config.h time$(OBJ): typesize.h time$(OBJ): string.h time.h pathname$(OBJ): fd.h headers.h machine.h config.h pathname$(OBJ): depend.h printf.h stream.h kctype.h pathname$(OBJ): string.h malloc.h pathname$(OBJ): dirent.h unixemu.h pathname$(OBJ): sysemu.h pathname.h typesize.h pathname$(OBJ): url.h system$(OBJ): fd.h headers.h machine.h config.h system$(OBJ): depend.h printf.h stream.h kctype.h system$(OBJ): string.h malloc.h system$(OBJ): term.h types.h typesize.h lsparse.h namelist.h kconv.h system$(OBJ): dirent.h unixemu.h system$(OBJ): sysemu.h system.h pathname.h termio.h system$(OBJ): wait.h system$(OBJ): termemu.h posixsh.h socket.h url.h system$(OBJ): urldisk.h auth.h posixsh$(OBJ): fd.h headers.h machine.h config.h posixsh$(OBJ): depend.h printf.h stream.h kctype.h posixsh$(OBJ): string.h malloc.h posixsh$(OBJ): sysemu.h dirent.h unixemu.h posixsh$(OBJ): system.h pathname.h typesize.h posixsh$(OBJ): termio.h posixsh$(OBJ): wait.h posixsh$(OBJ): termemu.h time.h posixsh.h term.h doscom$(OBJ): fd.h headers.h machine.h config.h doscom$(OBJ): depend.h printf.h stream.h kctype.h doscom$(OBJ): string.h malloc.h doscom$(OBJ): term.h types.h typesize.h lsparse.h namelist.h dirent.h doscom$(OBJ): unixemu.h doscom$(OBJ): sysemu.h system.h pathname.h termio.h doscom$(OBJ): wait.h doscom$(OBJ): realpath.h urldisk.h url.h auth.h log$(OBJ): fd.h headers.h machine.h config.h log$(OBJ): depend.h printf.h log$(OBJ): stream.h kctype.h log$(OBJ): string.h malloc.h func.h sysemu.h dirent.h unixemu.h log$(OBJ): pathname.h log$(OBJ): typesize.h term.h types.h lsparse.h namelist.h dosdisk.h sysemu$(OBJ): fd.h headers.h machine.h config.h sysemu$(OBJ): depend.h printf.h stream.h kctype.h sysemu$(OBJ): string.h malloc.h sysemu$(OBJ): kconv.h sysemu.h dirent.h unixemu.h sysemu$(OBJ): log.h pathname.h typesize.h termio.h sysemu$(OBJ): realpath.h dosdisk.h socket.h sysemu$(OBJ): urldisk.h namelist.h url.h auth.h dosdisk$(OBJ): headers.h machine.h config.h dosdisk$(OBJ): depend.h kctype.h dosdisk$(OBJ): string.h time.h sysemu.h dirent.h dosdisk$(OBJ): unixemu.h dosdisk$(OBJ): stream.h pathname.h typesize.h dosdisk.h unixdisk.h kconv.h unixdisk$(OBJ): headers.h machine.h config.h unixdisk$(OBJ): depend.h kctype.h unixdisk$(OBJ): string.h sysemu.h dirent.h unixemu.h unixdisk$(OBJ): stream.h unixdisk$(OBJ): pathname.h typesize.h dosdisk.h unixdisk.h realpath$(OBJ): fd.h headers.h machine.h config.h realpath$(OBJ): depend.h printf.h stream.h kctype.h realpath$(OBJ): string.h malloc.h realpath$(OBJ): sysemu.h dirent.h unixemu.h realpath$(OBJ): pathname.h typesize.h realpath.h realpath$(OBJ): url.h encode$(OBJ): headers.h machine.h config.h encode$(OBJ): kctype.h depend.h encode$(OBJ): sysemu.h dirent.h unixemu.h encode$(OBJ): stream.h encode$(OBJ): pathname.h typesize.h encode.h libc$(OBJ): fd.h headers.h machine.h config.h libc$(OBJ): depend.h printf.h libc$(OBJ): stream.h kctype.h libc$(OBJ): string.h malloc.h log.h realpath.h parse.h kconv.h func.h libc$(OBJ): sysemu.h dirent.h unixemu.h libc$(OBJ): pathname.h typesize.h term.h types.h libc$(OBJ): lsparse.h namelist.h dosdisk.h kanji.h catalog.h system.h libc$(OBJ): termio.h libc$(OBJ): wait.h libc$(OBJ): termemu.h url.h file$(OBJ): fd.h headers.h machine.h config.h file$(OBJ): depend.h printf.h file$(OBJ): stream.h kctype.h file$(OBJ): string.h malloc.h time.h termio.h file$(OBJ): realpath.h file$(OBJ): kconv.h func.h sysemu.h dirent.h unixemu.h file$(OBJ): pathname.h typesize.h term.h types.h file$(OBJ): lsparse.h namelist.h dosdisk.h kanji.h catalog.h urldisk.h file$(OBJ): url.h auth.h mntinfo$(OBJ): headers.h machine.h config.h mntinfo$(OBJ): kctype.h depend.h mntinfo$(OBJ): string.h malloc.h pathname.h mntinfo$(OBJ): typesize.h mntinfo.h fsinfo.h statfs$(OBJ): headers.h machine.h config.h statfs$(OBJ): fsinfo.h apply$(OBJ): fd.h headers.h machine.h config.h apply$(OBJ): depend.h printf.h stream.h kctype.h apply$(OBJ): string.h malloc.h apply$(OBJ): time.h realpath.h parse.h func.h sysemu.h dirent.h unixemu.h apply$(OBJ): pathname.h apply$(OBJ): typesize.h term.h types.h lsparse.h namelist.h dosdisk.h apply$(OBJ): kanji.h catalog.h pty$(OBJ): fd.h headers.h machine.h config.h pty$(OBJ): depend.h printf.h pty$(OBJ): stream.h kctype.h pty$(OBJ): string.h malloc.h sysemu.h dirent.h unixemu.h pty$(OBJ): pathname.h pty$(OBJ): typesize.h termio.h termemu$(OBJ): fd.h headers.h machine.h config.h termemu$(OBJ): depend.h printf.h stream.h kctype.h termemu$(OBJ): string.h malloc.h termemu$(OBJ): wait.h unixemu.h termio.h termemu$(OBJ): func.h sysemu.h dirent.h termemu$(OBJ): pathname.h termemu$(OBJ): typesize.h term.h types.h lsparse.h namelist.h dosdisk.h termemu$(OBJ): kanji.h catalog.h system.h termemu.h frontend$(OBJ): fd.h headers.h machine.h config.h frontend$(OBJ): depend.h printf.h stream.h kctype.h frontend$(OBJ): string.h malloc.h frontend$(OBJ): wait.h unixemu.h parse.h func.h frontend$(OBJ): sysemu.h dirent.h frontend$(OBJ): pathname.h typesize.h term.h frontend$(OBJ): types.h lsparse.h namelist.h dosdisk.h funcno.h kanji.h frontend$(OBJ): catalog.h system.h termio.h frontend$(OBJ): termemu.h frontend$(OBJ): roman.h backend$(OBJ): fd.h headers.h machine.h config.h backend$(OBJ): depend.h printf.h stream.h kctype.h backend$(OBJ): string.h malloc.h backend$(OBJ): termio.h backend$(OBJ): kconv.h func.h sysemu.h backend$(OBJ): dirent.h unixemu.h backend$(OBJ): pathname.h typesize.h term.h types.h backend$(OBJ): lsparse.h namelist.h dosdisk.h system.h wait.h backend$(OBJ): termemu.h parse$(OBJ): fd.h headers.h machine.h config.h parse$(OBJ): depend.h printf.h stream.h kctype.h parse$(OBJ): string.h malloc.h parse$(OBJ): pathname.h typesize.h term.h types.h lsparse.h namelist.h parse$(OBJ): kconv.h sysemu.h dirent.h unixemu.h parse$(OBJ): realpath.h parse.h system.h termio.h parse$(OBJ): wait.h builtin$(OBJ): fd.h headers.h machine.h config.h builtin$(OBJ): depend.h printf.h stream.h kctype.h builtin$(OBJ): string.h malloc.h builtin$(OBJ): encode.h parse.h kconv.h func.h sysemu.h dirent.h unixemu.h builtin$(OBJ): pathname.h builtin$(OBJ): typesize.h term.h types.h lsparse.h namelist.h dosdisk.h builtin$(OBJ): funcno.h kanji.h catalog.h system.h termio.h builtin$(OBJ): wait.h builtin$(OBJ): termemu.h roman.h shell$(OBJ): fd.h headers.h machine.h config.h shell$(OBJ): depend.h printf.h stream.h kctype.h shell$(OBJ): string.h malloc.h shell$(OBJ): realpath.h parse.h kconv.h func.h sysemu.h dirent.h unixemu.h shell$(OBJ): pathname.h shell$(OBJ): typesize.h term.h types.h lsparse.h namelist.h dosdisk.h shell$(OBJ): kanji.h catalog.h system.h termio.h shell$(OBJ): wait.h shell$(OBJ): termemu.h socket$(OBJ): headers.h machine.h config.h socket$(OBJ): depend.h printf.h stream.h kctype.h socket$(OBJ): typesize.h malloc.h socket$(OBJ): sysemu.h dirent.h unixemu.h socket$(OBJ): termio.h socket$(OBJ): socket.h url$(OBJ): headers.h machine.h config.h url$(OBJ): depend.h printf.h url$(OBJ): stream.h kctype.h url$(OBJ): typesize.h string.h malloc.h sysemu.h dirent.h unixemu.h url$(OBJ): pathname.h url.h auth$(OBJ): headers.h machine.h config.h auth$(OBJ): depend.h printf.h auth$(OBJ): stream.h string.h malloc.h time.h pathname.h typesize.h auth$(OBJ): encode.h parse.h socket.h auth.h url.h auth$(OBJ): system.h termio.h auth$(OBJ): wait.h auth$(OBJ): unixemu.h kanji.h catalog.h ftp$(OBJ): headers.h machine.h config.h ftp$(OBJ): depend.h printf.h ftp$(OBJ): stream.h kctype.h ftp$(OBJ): string.h malloc.h time.h sysemu.h dirent.h unixemu.h ftp$(OBJ): pathname.h ftp$(OBJ): typesize.h termio.h ftp$(OBJ): parse.h ftp$(OBJ): lsparse.h namelist.h socket.h auth.h ftp$(OBJ): url.h urldisk.h html$(OBJ): headers.h machine.h config.h html$(OBJ): depend.h printf.h html$(OBJ): stream.h kctype.h html$(OBJ): typesize.h string.h malloc.h sysemu.h dirent.h unixemu.h html$(OBJ): pathname.h termio.h html$(OBJ): parse.h html.h urldisk.h html$(OBJ): namelist.h url.h auth.h http$(OBJ): headers.h machine.h config.h http$(OBJ): depend.h printf.h http$(OBJ): stream.h kctype.h http$(OBJ): string.h malloc.h time.h sysemu.h dirent.h unixemu.h http$(OBJ): pathname.h http$(OBJ): typesize.h termio.h http$(OBJ): parse.h http$(OBJ): lsparse.h namelist.h socket.h auth.h http$(OBJ): url.h html.h urldisk.h urldisk$(OBJ): headers.h machine.h config.h urldisk$(OBJ): depend.h printf.h stream.h string.h urldisk$(OBJ): malloc.h time.h sysemu.h dirent.h unixemu.h urldisk$(OBJ): pathname.h urldisk$(OBJ): typesize.h termio.h urldisk$(OBJ): realpath.h urldisk$(OBJ): lsparse.h namelist.h socket.h urldisk$(OBJ): urldisk.h url.h auth.h catalog$(OBJ): fd.h headers.h machine.h config.h catalog$(OBJ): depend.h printf.h stream.h kctype.h catalog$(OBJ): string.h malloc.h catalog$(OBJ): termio.h catalog$(OBJ): func.h sysemu.h dirent.h catalog$(OBJ): unixemu.h catalog$(OBJ): pathname.h typesize.h term.h types.h lsparse.h namelist.h catalog$(OBJ): dosdisk.h kanji.h catalog.h kconv$(OBJ): fd.h headers.h machine.h config.h kconv$(OBJ): depend.h printf.h stream.h kctype.h kconv$(OBJ): string.h malloc.h kconv$(OBJ): termio.h kconv$(OBJ): realpath.h parse.h func.h kconv$(OBJ): sysemu.h dirent.h unixemu.h kconv$(OBJ): pathname.h typesize.h term.h types.h kconv$(OBJ): lsparse.h namelist.h dosdisk.h kconv.h termemu.h input$(OBJ): fd.h headers.h machine.h config.h input$(OBJ): depend.h printf.h stream.h kctype.h input$(OBJ): string.h malloc.h input$(OBJ): wait.h unixemu.h parse.h kconv.h func.h input$(OBJ): sysemu.h dirent.h input$(OBJ): pathname.h typesize.h term.h types.h lsparse.h namelist.h input$(OBJ): dosdisk.h kanji.h catalog.h system.h termio.h input$(OBJ): termemu.h ime$(OBJ): fd.h headers.h machine.h config.h ime$(OBJ): depend.h printf.h ime$(OBJ): stream.h kctype.h ime$(OBJ): string.h malloc.h wait.h unixemu.h ime$(OBJ): parse.h kconv.h roman.h func.h sysemu.h dirent.h ime$(OBJ): pathname.h ime$(OBJ): typesize.h term.h types.h lsparse.h namelist.h dosdisk.h ime$(OBJ): kanji.h catalog.h termemu.h dict$(OBJ): fd.h headers.h machine.h config.h dict$(OBJ): depend.h printf.h dict$(OBJ): stream.h kctype.h dict$(OBJ): string.h malloc.h termio.h dict$(OBJ): roman.h dict$(OBJ): hinsi.h func.h sysemu.h dirent.h unixemu.h dict$(OBJ): pathname.h typesize.h term.h types.h dict$(OBJ): lsparse.h namelist.h dosdisk.h parse.h kconv.h roman$(OBJ): headers.h machine.h config.h roman$(OBJ): depend.h kctype.h roman$(OBJ): typesize.h string.h kconv.h roman.h info$(OBJ): fd.h headers.h machine.h config.h info$(OBJ): depend.h printf.h info$(OBJ): stream.h kctype.h info$(OBJ): string.h malloc.h dirent.h unixemu.h info$(OBJ): sysemu.h pathname.h typesize.h term.h info$(OBJ): types.h lsparse.h namelist.h funcno.h kanji.h catalog.h info$(OBJ): unixdisk.h mntinfo.h fsinfo.h rockridg$(OBJ): fd.h headers.h machine.h config.h rockridg$(OBJ): depend.h printf.h stream.h kctype.h rockridg$(OBJ): string.h malloc.h rockridg$(OBJ): device.h parse.h func.h sysemu.h dirent.h unixemu.h rockridg$(OBJ): pathname.h rockridg$(OBJ): typesize.h term.h types.h lsparse.h namelist.h dosdisk.h tree$(OBJ): fd.h headers.h machine.h config.h tree$(OBJ): depend.h printf.h tree$(OBJ): stream.h kctype.h tree$(OBJ): string.h malloc.h func.h sysemu.h dirent.h unixemu.h tree$(OBJ): pathname.h tree$(OBJ): typesize.h term.h types.h lsparse.h namelist.h dosdisk.h tree$(OBJ): kanji.h catalog.h lsparse$(OBJ): fd.h headers.h machine.h config.h lsparse$(OBJ): depend.h printf.h stream.h kctype.h lsparse$(OBJ): string.h malloc.h lsparse$(OBJ): time.h dirent.h unixemu.h lsparse$(OBJ): pathname.h typesize.h device.h lsparse$(OBJ): parse.h lsparse.h namelist.h kconv.h archive$(OBJ): fd.h headers.h machine.h config.h archive$(OBJ): depend.h printf.h stream.h kctype.h archive$(OBJ): string.h malloc.h archive$(OBJ): realpath.h kconv.h func.h sysemu.h dirent.h unixemu.h archive$(OBJ): pathname.h archive$(OBJ): typesize.h term.h types.h lsparse.h namelist.h dosdisk.h archive$(OBJ): kanji.h catalog.h system.h termio.h archive$(OBJ): wait.h archive$(OBJ): termemu.h custom$(OBJ): fd.h headers.h machine.h config.h custom$(OBJ): depend.h printf.h stream.h kctype.h custom$(OBJ): string.h malloc.h custom$(OBJ): parse.h kconv.h func.h sysemu.h dirent.h unixemu.h custom$(OBJ): pathname.h custom$(OBJ): typesize.h term.h types.h lsparse.h namelist.h dosdisk.h custom$(OBJ): funcno.h kanji.h catalog.h system.h termio.h custom$(OBJ): wait.h custom$(OBJ): termemu.h urldisk.h url.h auth.h command$(OBJ): fd.h headers.h machine.h config.h command$(OBJ): depend.h printf.h stream.h kctype.h command$(OBJ): string.h malloc.h command$(OBJ): parse.h func.h sysemu.h dirent.h unixemu.h command$(OBJ): pathname.h command$(OBJ): typesize.h term.h types.h lsparse.h namelist.h dosdisk.h command$(OBJ): funcno.h kanji.h catalog.h system.h termio.h command$(OBJ): wait.h command$(OBJ): termemu.h functabl.h browse$(OBJ): fd.h headers.h machine.h config.h browse$(OBJ): depend.h printf.h stream.h kctype.h browse$(OBJ): string.h malloc.h browse$(OBJ): device.h parse.h kconv.h func.h sysemu.h dirent.h unixemu.h browse$(OBJ): pathname.h browse$(OBJ): typesize.h term.h types.h lsparse.h namelist.h dosdisk.h browse$(OBJ): funcno.h kanji.h catalog.h termemu.h unitbl$(OBJ): headers.h machine.h config.h dicttbl$(OBJ): headers.h machine.h config.h sprintf$(OBJ): headers.h machine.h config.h sprintf$(OBJ): depend.h printf.h stream.h kctype.h sprintf$(OBJ): typesize.h string.h stermio$(OBJ): headers.h machine.h config.h stermio$(OBJ): depend.h typesize.h sysemu.h dirent.h stermio$(OBJ): unixemu.h stermio$(OBJ): stream.h termio.h sstream$(OBJ): headers.h machine.h config.h sstream$(OBJ): depend.h typesize.h malloc.h sysemu.h sstream$(OBJ): dirent.h unixemu.h sstream$(OBJ): stream.h pathname.h termio.h sstring$(OBJ): headers.h machine.h config.h sstring$(OBJ): kctype.h depend.h sstring$(OBJ): string.h smalloc$(OBJ): headers.h machine.h config.h smalloc$(OBJ): printf.h stream.h depend.h malloc.h smalloc$(OBJ): sysemu.h dirent.h unixemu.h stime$(OBJ): headers.h machine.h config.h stime$(OBJ): typesize.h string.h time.h spathnam$(OBJ): headers.h machine.h config.h spathnam$(OBJ): depend.h spathnam$(OBJ): printf.h stream.h kctype.h spathnam$(OBJ): string.h malloc.h dirent.h unixemu.h spathnam$(OBJ): sysemu.h spathnam$(OBJ): pathname.h typesize.h ssystem$(OBJ): headers.h machine.h config.h ssystem$(OBJ): depend.h printf.h stream.h kctype.h ssystem$(OBJ): string.h malloc.h ssystem$(OBJ): dirent.h unixemu.h ssystem$(OBJ): sysemu.h system.h pathname.h ssystem$(OBJ): typesize.h termio.h ssystem$(OBJ): wait.h ssystem$(OBJ): termemu.h time.h posixsh.h sposixsh$(OBJ): headers.h machine.h config.h sposixsh$(OBJ): depend.h printf.h stream.h kctype.h sposixsh$(OBJ): string.h malloc.h sposixsh$(OBJ): sysemu.h dirent.h unixemu.h sposixsh$(OBJ): system.h pathname.h typesize.h sposixsh$(OBJ): termio.h sposixsh$(OBJ): wait.h sposixsh$(OBJ): termemu.h time.h posixsh.h sdoscom$(OBJ): headers.h machine.h config.h sdoscom$(OBJ): depend.h printf.h stream.h kctype.h sdoscom$(OBJ): string.h malloc.h sdoscom$(OBJ): dirent.h unixemu.h sdoscom$(OBJ): sysemu.h system.h pathname.h sdoscom$(OBJ): typesize.h termio.h sdoscom$(OBJ): wait.h ssysemu$(OBJ): headers.h machine.h config.h ssysemu$(OBJ): depend.h printf.h stream.h kctype.h ssysemu$(OBJ): string.h malloc.h ssysemu$(OBJ): sysemu.h dirent.h unixemu.h ssysemu$(OBJ): log.h pathname.h typesize.h termio.h ssysemu$(OBJ): realpath.h bprintf$(OBJ): headers.h machine.h config.h bprintf$(OBJ): depend.h printf.h stream.h kctype.h bprintf$(OBJ): typesize.h string.h btermio$(OBJ): headers.h machine.h config.h btermio$(OBJ): depend.h typesize.h sysemu.h dirent.h btermio$(OBJ): unixemu.h btermio$(OBJ): stream.h termio.h bstream$(OBJ): headers.h machine.h config.h bstream$(OBJ): depend.h typesize.h malloc.h sysemu.h bstream$(OBJ): dirent.h unixemu.h bstream$(OBJ): stream.h pathname.h termio.h bstring$(OBJ): headers.h machine.h config.h bstring$(OBJ): kctype.h depend.h bstring$(OBJ): string.h bmalloc$(OBJ): headers.h machine.h config.h bmalloc$(OBJ): printf.h stream.h depend.h malloc.h bmalloc$(OBJ): sysemu.h dirent.h unixemu.h bpathnam$(OBJ): headers.h machine.h config.h bpathnam$(OBJ): depend.h bpathnam$(OBJ): printf.h stream.h kctype.h bpathnam$(OBJ): string.h malloc.h dirent.h unixemu.h bpathnam$(OBJ): sysemu.h bpathnam$(OBJ): pathname.h typesize.h bsystem$(OBJ): headers.h machine.h config.h bsystem$(OBJ): depend.h printf.h stream.h kctype.h bsystem$(OBJ): string.h malloc.h bsystem$(OBJ): dirent.h unixemu.h bsystem$(OBJ): sysemu.h system.h pathname.h bsystem$(OBJ): typesize.h termio.h bsystem$(OBJ): wait.h bsystem$(OBJ): termemu.h bdoscom$(OBJ): headers.h machine.h config.h bdoscom$(OBJ): depend.h printf.h stream.h kctype.h bdoscom$(OBJ): string.h malloc.h bdoscom$(OBJ): dirent.h unixemu.h bdoscom$(OBJ): sysemu.h system.h pathname.h bdoscom$(OBJ): typesize.h termio.h bdoscom$(OBJ): wait.h bsysemu$(OBJ): headers.h machine.h config.h bsysemu$(OBJ): depend.h printf.h stream.h kctype.h bsysemu$(OBJ): string.h malloc.h bsysemu$(OBJ): sysemu.h dirent.h unixemu.h bsysemu$(OBJ): log.h pathname.h typesize.h termio.h bsysemu$(OBJ): realpath.h nprintf$(OBJ): headers.h machine.h config.h nprintf$(OBJ): depend.h printf.h stream.h kctype.h nprintf$(OBJ): typesize.h string.h ntermio$(OBJ): headers.h machine.h config.h ntermio$(OBJ): depend.h typesize.h sysemu.h dirent.h ntermio$(OBJ): unixemu.h ntermio$(OBJ): stream.h termio.h nstream$(OBJ): headers.h machine.h config.h nstream$(OBJ): depend.h typesize.h malloc.h sysemu.h nstream$(OBJ): dirent.h unixemu.h nstream$(OBJ): stream.h pathname.h termio.h nstream$(OBJ): socket.h nstring$(OBJ): headers.h machine.h config.h nstring$(OBJ): kctype.h depend.h nstring$(OBJ): string.h nmalloc$(OBJ): headers.h machine.h config.h nmalloc$(OBJ): printf.h stream.h depend.h malloc.h nmalloc$(OBJ): sysemu.h dirent.h unixemu.h ntime$(OBJ): headers.h machine.h config.h ntime$(OBJ): typesize.h string.h time.h npathnam$(OBJ): headers.h machine.h config.h npathnam$(OBJ): depend.h npathnam$(OBJ): printf.h stream.h kctype.h npathnam$(OBJ): string.h malloc.h dirent.h unixemu.h npathnam$(OBJ): sysemu.h npathnam$(OBJ): pathname.h typesize.h url.h nsystem$(OBJ): headers.h machine.h config.h nsystem$(OBJ): depend.h printf.h stream.h kctype.h nsystem$(OBJ): string.h malloc.h nsystem$(OBJ): dirent.h unixemu.h nsystem$(OBJ): sysemu.h system.h pathname.h nsystem$(OBJ): typesize.h termio.h nsystem$(OBJ): wait.h nsystem$(OBJ): termemu.h time.h posixsh.h socket.h nsystem$(OBJ): url.h urldisk.h namelist.h auth.h nposixsh$(OBJ): headers.h machine.h config.h nposixsh$(OBJ): depend.h printf.h stream.h kctype.h nposixsh$(OBJ): string.h malloc.h nposixsh$(OBJ): sysemu.h dirent.h unixemu.h nposixsh$(OBJ): system.h pathname.h typesize.h nposixsh$(OBJ): termio.h nposixsh$(OBJ): wait.h nposixsh$(OBJ): termemu.h time.h posixsh.h ndoscom$(OBJ): headers.h machine.h config.h ndoscom$(OBJ): depend.h printf.h stream.h kctype.h ndoscom$(OBJ): string.h malloc.h ndoscom$(OBJ): dirent.h unixemu.h ndoscom$(OBJ): sysemu.h system.h pathname.h ndoscom$(OBJ): typesize.h termio.h ndoscom$(OBJ): wait.h ndoscom$(OBJ): realpath.h urldisk.h namelist.h url.h ndoscom$(OBJ): auth.h nsysemu$(OBJ): headers.h machine.h config.h nsysemu$(OBJ): depend.h printf.h stream.h kctype.h nsysemu$(OBJ): string.h malloc.h nsysemu$(OBJ): sysemu.h dirent.h unixemu.h nsysemu$(OBJ): log.h pathname.h typesize.h termio.h nsysemu$(OBJ): realpath.h socket.h nsysemu$(OBJ): urldisk.h namelist.h url.h auth.h nrealpat$(OBJ): headers.h machine.h config.h nrealpat$(OBJ): depend.h nrealpat$(OBJ): printf.h stream.h kctype.h nrealpat$(OBJ): string.h sysemu.h dirent.h unixemu.h nrealpat$(OBJ): pathname.h nrealpat$(OBJ): typesize.h realpath.h url.h nencode$(OBJ): headers.h machine.h config.h nencode$(OBJ): kctype.h depend.h nencode$(OBJ): sysemu.h dirent.h unixemu.h nencode$(OBJ): stream.h nencode$(OBJ): pathname.h typesize.h encode.h nparse$(OBJ): headers.h machine.h config.h nparse$(OBJ): depend.h printf.h stream.h kctype.h nparse$(OBJ): string.h malloc.h nparse$(OBJ): sysemu.h dirent.h unixemu.h nparse$(OBJ): realpath.h parse.h system.h nparse$(OBJ): pathname.h typesize.h termio.h nparse$(OBJ): wait.h nsocket$(OBJ): headers.h machine.h config.h nsocket$(OBJ): depend.h printf.h stream.h kctype.h nsocket$(OBJ): typesize.h malloc.h nsocket$(OBJ): sysemu.h dirent.h unixemu.h nsocket$(OBJ): termio.h nsocket$(OBJ): socket.h nurl$(OBJ): headers.h machine.h config.h nurl$(OBJ): depend.h printf.h nurl$(OBJ): stream.h kctype.h nurl$(OBJ): typesize.h string.h malloc.h sysemu.h dirent.h unixemu.h nurl$(OBJ): pathname.h url.h nauth$(OBJ): headers.h machine.h config.h nauth$(OBJ): depend.h printf.h stream.h string.h nauth$(OBJ): malloc.h time.h pathname.h typesize.h encode.h parse.h nauth$(OBJ): socket.h auth.h url.h system.h nauth$(OBJ): termio.h nauth$(OBJ): wait.h unixemu.h nauth$(OBJ): sysemu.h dirent.h nftp$(OBJ): headers.h machine.h config.h nftp$(OBJ): depend.h printf.h nftp$(OBJ): stream.h kctype.h nftp$(OBJ): string.h malloc.h time.h sysemu.h dirent.h unixemu.h nftp$(OBJ): pathname.h nftp$(OBJ): typesize.h termio.h nftp$(OBJ): parse.h nftp$(OBJ): lsparse.h namelist.h socket.h auth.h nftp$(OBJ): url.h urldisk.h nhtml$(OBJ): headers.h machine.h config.h nhtml$(OBJ): depend.h printf.h stream.h kctype.h nhtml$(OBJ): typesize.h string.h nhtml$(OBJ): malloc.h sysemu.h dirent.h unixemu.h nhtml$(OBJ): pathname.h termio.h nhtml$(OBJ): parse.h html.h urldisk.h nhtml$(OBJ): namelist.h url.h auth.h nhttp$(OBJ): headers.h machine.h config.h nhttp$(OBJ): depend.h printf.h stream.h kctype.h nhttp$(OBJ): string.h malloc.h nhttp$(OBJ): time.h sysemu.h dirent.h unixemu.h nhttp$(OBJ): pathname.h typesize.h termio.h nhttp$(OBJ): parse.h lsparse.h namelist.h nhttp$(OBJ): socket.h auth.h url.h html.h nhttp$(OBJ): urldisk.h nurldisk$(OBJ): headers.h machine.h config.h nurldisk$(OBJ): depend.h printf.h stream.h string.h nurldisk$(OBJ): malloc.h time.h sysemu.h dirent.h unixemu.h nurldisk$(OBJ): pathname.h nurldisk$(OBJ): typesize.h termio.h nurldisk$(OBJ): realpath.h nurldisk$(OBJ): lsparse.h namelist.h socket.h nurldisk$(OBJ): urldisk.h url.h auth.h nlsparse$(OBJ): headers.h machine.h config.h nlsparse$(OBJ): depend.h kctype.h nlsparse$(OBJ): string.h malloc.h time.h dirent.h nlsparse$(OBJ): unixemu.h nlsparse$(OBJ): pathname.h typesize.h device.h parse.h lsparse.h namelist.h evalopt$(OBJ): headers.h machine.h config.h evalopt$(OBJ): evalopt.h gentbl$(OBJ): headers.h machine.h config.h gentbl$(OBJ): gentbl.h mkunitbl$(OBJ): headers.h machine.h config.h mkunitbl$(OBJ): typesize.h evalopt.h gentbl.h mkdict$(OBJ): headers.h machine.h config.h mkdict$(OBJ): kctype.h depend.h mkdict$(OBJ): typesize.h string.h kconv.h roman.h mkdict$(OBJ): hinsi.h evalopt.h gentbl.h mktankan$(OBJ): headers.h machine.h config.h mktankan$(OBJ): kctype.h depend.h mktankan$(OBJ): typesize.h kconv.h roman.h mkkanji$(OBJ): headers.h machine.h config.h mkkanji$(OBJ): typesize.h mkcat$(OBJ): headers.h machine.h config.h mkcat$(OBJ): kctype.h depend.h mkcat$(OBJ): typesize.h version.h evalopt.h gentbl.h mkdir_p$(OBJ): headers.h machine.h config.h mkdir_p$(OBJ): kctype.h depend.h mkdir_p$(OBJ): typesize.h kanjicnv$(OBJ): headers.h machine.h config.h kanjicnv$(OBJ): evalopt.h expfunc$(OBJ): headers.h machine.h config.h mkfuncno$(OBJ): fd.h headers.h machine.h config.h mkfuncno$(OBJ): depend.h types.h typesize.h stream.h mkfuncno$(OBJ): lsparse.h namelist.h functabl.h tstring$(OBJ): headers.h machine.h config.h tstring$(OBJ): kctype.h depend.h tstring$(OBJ): string.h troman$(OBJ): headers.h machine.h config.h troman$(OBJ): depend.h kctype.h troman$(OBJ): typesize.h string.h kconv.h roman.h tkconv$(OBJ): headers.h machine.h config.h tkconv$(OBJ): depend.h kctype.h tkconv$(OBJ): typesize.h string.h unixemu.h kconv.h tkconv$(OBJ): termemu.h pathname.h tevalopt$(OBJ): headers.h machine.h config.h tevalopt$(OBJ): evalopt.h tgentbl$(OBJ): headers.h machine.h config.h tgentbl$(OBJ): gentbl.h tunitbl$(OBJ): headers.h machine.h config.h FD-3.01j/mkmfdosg.sed100644 2105 1751 2306 13516612560 13166 0ustar shiraiusers:/:\\:g s:__PREFIX__:: s:__CONFDIR__:: s:__EXE__:.exe:g s:__OBJ__:.o:g s:__DOSOBJS__:$(DOSOBJS): s:__IMEOBJS__:: s:__DICTSRC__:: s:__MKDICTOPTION__:: s:__SOCKETOBJS__:: s:__SOCKETLIBS__:: s:__OBJLIST__:@$(ARGS): s:__SOBJLIST__:@$(SARGS): s:__NOBJLIST__:@$(NARGS): s:__DEFRC__:'"'$(DOSRC)'"': s:__TBLPATH__:: s:__DATADIR__:$(BINDIR):g s:__DATADIR2__:$(BINDIR):g s:__SLEEP__:#: s:__DJGPP1__:: s:__ECHO__:command /c echo: s:__COPY__:copy /y: s:__RM__:del: s:__LANGDIR__:: s:__WITHUTF8__:: s:__PRESETKCODE__:: s:__INSTALL__:copy /y: s:__INSTSTRIP__:: s:__LN__:copy /y: s:__CC__:gcc: s:__CFLAGS__:-O: s:__CPPFLAGS__:: s:__LDFLAGS__:: s:__HOSTCC__:$(CC): s:__HOSTCFLAGS__:$(CFLAGS): s:__HOSTCPPFLAGS__:$(CPPFLAGS): s:__HOSTLDFLAGS__:$(LDFLAGS): s:__COPTS__:$(OSOPTS) $(DEBUG) $(CFLAGS): s:__HOSTCOPTS__:$(COPTS): s:__FDSETSIZE__:: s:__MEM__:: s:__SHMEM__:: s:__BSHMEM__:: s:__NSHMEM__:: s:__OUT__:-o $@: s:__LNK__:-o $@: s:__FLDFLAGS__:$(ALLOC) $(LDFLAGS): s:__SLDFLAGS__:$(ALLOC) $(LDFLAGS): s:__NLDFLAGS__:$(ALLOC) $(LDFLAGS): s:__KCODEOPTION__:-s: s:__KDOCOPTION__:-s: s:__MSBOPTION__:: s:__TABLES__:$(UNITBL) $(CATTBL) $(ECATTBL): s:__UNITBLOBJ__:: s:__TUNITBLOBJ__:: s:__PREFIXOPTION__:: s:[ ]*$:: /^[ ][ ]*-*\$(RM)$/d FD-3.01j/mkmfdosd.sed100644 2105 1751 2276 13516612560 13171 0ustar shiraiusers:/:\\:g s:__PREFIX__:: s:__CONFDIR__:: s:__EXE__:.exe:g s:__OBJ__:.o:g s:__DOSOBJS__:$(DOSOBJS): s:__IMEOBJS__:: s:__DICTSRC__:: s:__MKDICTOPTION__:: s:__SOCKETOBJS__:: s:__SOCKETLIBS__:: s:__OBJLIST__:@$(ARGS): s:__SOBJLIST__:@$(SARGS): s:__NOBJLIST__:@$(NARGS): s:__DEFRC__:'"'$(DOSRC)'"': s:__TBLPATH__:: s:__DATADIR__:$(BINDIR):g s:__DATADIR2__:$(BINDIR):g s:__SLEEP__:#: s:__DJGPP1__:#: s:__ECHO__:echo: s:__COPY__:copy /y: s:__RM__:del: s:__LANGDIR__:: s:__WITHUTF8__:: s:__PRESETKCODE__:: s:__INSTALL__:copy /y: s:__INSTSTRIP__:: s:__LN__:copy /y: s:__CC__:gcc: s:__CFLAGS__:-O: s:__CPPFLAGS__:: s:__LDFLAGS__:: s:__HOSTCC__:$(CC): s:__HOSTCFLAGS__:$(CFLAGS): s:__HOSTCPPFLAGS__:$(CPPFLAGS): s:__HOSTLDFLAGS__:$(LDFLAGS): s:__COPTS__:$(OSOPTS) $(DEBUG) $(CFLAGS): s:__HOSTCOPTS__:$(COPTS): s:__FDSETSIZE__:: s:__MEM__:: s:__SHMEM__:: s:__BSHMEM__:: s:__NSHMEM__:: s:__OUT__:-o $@: s:__LNK__:-o $@: s:__FLDFLAGS__:$(ALLOC) $(LDFLAGS): s:__SLDFLAGS__:$(ALLOC) $(LDFLAGS): s:__NLDFLAGS__:$(ALLOC) $(LDFLAGS): s:__KCODEOPTION__:-s: s:__KDOCOPTION__:-s: s:__MSBOPTION__:: s:__TABLES__:$(UNITBL) $(CATTBL) $(ECATTBL): s:__UNITBLOBJ__:: s:__TUNITBLOBJ__:: s:__PREFIXOPTION__:-c: s:[ ]*$:: /^[ ][ ]*-*\$(RM)$/d FD-3.01j/mkmfsed.c100644 2105 1751 24725 13516612560 12505 0ustar shiraiuser/* * mkmfsed.c * * sed script maker for Makefile */ #define __FD_PRIMAL__ #define __HOST_CC__ #if defined (__ANDROID__) || defined (__BIONIC__) #include #endif #include "fd.h" #include "version.h" #ifdef USESELECTH #include #endif #ifdef __CYGWIN__ #include #endif #if defined (USESYSCONF) && defined (_SC_OPEN_MAX) #define MAXOPENFILE (int)sysconf(_SC_OPEN_MAX) #else /* !USESYSCONF || !_SC_OPEN_MAX */ # ifdef NOFILE # define MAXOPENFILE NOFILE # else /* !NOFILE */ # ifdef OPEN_MAX # define MAXOPENFILE OPEN_MAX # else # define MAXOPENFILE 64 # endif # endif /* !NOFILE */ #endif /* !USESYSCONF || !_SC_OPEN_MAX */ #define MAXLINEBUF 255 #define UTF8_MAC 1 #define UTF8_ICONV 2 #define TMPLINK "mkmfsed.lnk" #ifndef PREFIX #define PREFIX "/usr/local" #endif #ifndef CONFDIR #define CONFDIR "/etc" #endif #ifndef CCCOMMAND #define CCCOMMAND "cc" #endif #ifndef CFLAGS #define CFLAGS "" #endif #ifndef CPPFLAGS #define CPPFLAGS "" #endif #ifndef LDFLAGS #define LDFLAGS "" #endif #ifndef DICTSRC #define DICTSRC "" #endif #define ver_newer(a, i, j, n) ((a) > (j) || ((a) == (j) && (i) >= (n))) #define gcc_newer(ma, mi) ver_newer(__GNUC__, __GNUC_MINOR__, ma, mi) #define h_gcc_newer(ma, mi) ver_newer(H___GNUC__, H___GNUC_MINOR__, ma, mi) #define clang_newer(ma, mi) ver_newer(__clang_major__, \ __clang_minor__, ma, mi) #define h_clang_newer(ma, mi) ver_newer(H___clang_major__, \ H___clang_minor__, ma, mi) static CONST char *NEAR Xstrstr __P_((CONST char *, CONST char *)); static VOID NEAR strappend __P_((char *, CONST char *)); int main __P_((int, char *CONST [])); static CONST char *NEAR Xstrstr(s1, s2) CONST char *s1, *s2; { int i, c1, c2; while (*s1) { for (i = 0;; i++) { if (!s2[i]) return(s1); c1 = s1[i]; c2 = s2[i]; if (c1 >= 'A' && c1 <= 'Z') c1 += 'a' - 'A'; if (c2 >= 'A' && c2 <= 'Z') c2 += 'a' - 'A'; if (c1 != c2) break; if (!s1[i]) break; } s1++; } return(NULL); } static VOID NEAR strappend(buf, s) char *buf; CONST char *s; { int len, len2; if (!buf || !s) return; len = strlen(buf); len2 = strlen(s); if (len >= MAXLINEBUF) return; if (len + 1 + len2 >= MAXLINEBUF) len2 = MAXLINEBUF - (len + 1); if (len2 <= 0) return; if (len) buf[len++] = ' '; memcpy(&(buf[len]), s, len2); buf[len + len2] = '\0'; } /*ARGSUSED*/ int main(argc, argv) int argc; char *CONST argv[]; { CONST char *utf; char buf1[MAXLINEBUF + 1], buf2[MAXLINEBUF + 1], buf3[MAXLINEBUF + 1]; CONST char *cp; int n; printf("s:__VERMAJ__:%d:\n", FD); #if FD >= 2 printf("s:__RCVERSION__:%d:\n", 2); #else printf("s:__RCVERSION__::\n"); #endif if (!(cp = strchr(version, ' '))) cp = version; else while (*cp == ' ') cp++; for (n = 0; cp[n]; n++) if (cp[n] == ' ') break; printf("s:__VERSION__:%-.*s:\n", n, cp); if (!distributor || !*distributor) distributor = "none"; printf("s:__DIST__:%s:\n", distributor); printf("s:__PREFIX__:%s:\n", PREFIX); printf("s:__CONFDIR__:%s:\n", CONFDIR); #ifdef __CYGWIN__ printf("s:__EXE__:.exe:g\n"); #else printf("s:__EXE__::g\n"); #endif printf("s:__OBJ__:.o:g\n"); printf("s:__DOSOBJS__::\n"); #ifdef DEP_IME printf("s:__IMEOBJS__:$(IMEOBJS):\n"); if (DICTSRC[0]) { printf("s:__DICTSRC__:%s:\n", DICTSRC); printf("s:__MKDICTOPTION__:-h -v:\n"); } else { printf("s:__DICTSRC__:$(DICTTXT):\n"); printf("s:__MKDICTOPTION__::\n"); } #else /* !DEP_IME */ printf("s:__IMEOBJS__::\n"); printf("s:__DICTSRC__::\n"); printf("s:__MKDICTOPTION__::\n"); #endif /* !DEP_IME */ #ifdef _NOSOCKET printf("s:__SOCKETOBJS__::\n"); printf("s:__SOCKETLIBS__::\n"); #else printf("s:__SOCKETOBJS__:$(SCKOBJS):\n"); printf("s:__SOCKETLIBS__:%s:\n", SOCKETLIB); #endif printf("s:__OBJLIST__:$(OBJ1) $(OBJ2) $(OBJ3) $(OBJ4) $(OBJ5) $(OBJ6):\n"); printf("s:__SOBJLIST__:$(SOBJ1) $(SOBJ2):\n"); printf("s:__NOBJLIST__:$(NOBJ1) $(NOBJ2) $(NOBJ3):\n"); printf("s:__DEFRC__:'\"'$(DEFRC)'\"':\n"); #ifdef USEDATADIR printf("s:__TBLPATH__:-DBINDIR='\"'$(BINDIR)'\"' -DDATADIR='\"'$(DATADIR)'\"':\n"); printf("s:__DATADIR__:$(DATADIR):g\n"); printf("s:__DATADIR2__:$(DATADIR)/$(VERSION):g\n"); #else printf("s:__TBLPATH__:-DBINDIR='\"'$(BINDIR)'\"':\n"); printf("s:__DATADIR__:$(BINDIR):g\n"); printf("s:__DATADIR2__:$(BINDIR):g\n"); #endif #ifdef BUGGYMAKE printf("s:__SLEEP__::\n"); #else printf("s:__SLEEP__:#:\n"); #endif printf("s:__DJGPP1__:#:\n"); printf("s:__ECHO__:echo:\n"); printf("s:__COPY__:cp:\n"); printf("s:__RM__:rm -f:\n"); #if !defined (__CYGWIN__) || !defined (CYGWIN_VERSION_DLL_MAJOR) n = 1; #else /* __CYGWIN__ && CYGWIN_VERSION_DLL_MAJOR */ n = (CYGWIN_VERSION_DLL_MAJOR) * 1000; # ifdef CYGWIN_VERSION_DLL_MINOR n += CYGWIN_VERSION_DLL_MINOR; # endif #endif /* __CYGWIN__ && CYGWIN_VERSION_DLL_MAJOR */ #ifdef OSTYPE2 printf("s:__OSTYPE__:%s=%d -D%s=1:\n", OSTYPE, n, OSTYPE2); #else printf("s:__OSTYPE__:%s=%d:\n", OSTYPE, n); #endif cp = (char *)getenv("LANG"); #ifdef USEMANLANG if (cp && *cp) { n = strlen(cp); # ifdef LANGWIDTH if (n > LANGWIDTH) n = LANGWIDTH; # endif printf("s:__LANGDIR__:/%-.*s:\n", n, cp); } else #endif /* USEMANLANG */ printf("s:__LANGDIR__::\n"); #ifndef UTF8DOC utf = NULL; #else /* UTF8DOC */ # ifdef DEFKCODE utf = DEFKCODE; # else utf = ""; # endif #endif /* UTF8DOC */ #ifdef UTF8LANG if (cp && Xstrstr(cp, "UTF")) utf = UTF8LANG; #endif if (utf) { n = 0; if (Xstrstr(utf, "utf8-mac")) n = UTF8_MAC; else if (Xstrstr(utf, "utf8-iconv")) n = UTF8_ICONV; printf("s:__WITHUTF8__:-DWITHUTF8=%d:\n", n); } else printf("s:__WITHUTF8__::\n"); if (utf && *utf) printf("s:__PRESETKCODE__:-DPRESETKCODE='\"'%s'\"':\n", utf); else printf("s:__PRESETKCODE__::\n"); #ifdef BSDINSTALL # ifdef BSDINSTCMD printf("s:__INSTALL__:%s -c:\n", BSDINSTCMD); # else printf("s:__INSTALL__:install -c:\n"); # endif printf("s:__INSTSTRIP__:-s:\n"); #else /* !BSDINSTALL */ printf("s:__INSTALL__:cp -p:\n"); printf("s:__INSTSTRIP__::\n"); #endif /* !BSDINSTALL */ #if !defined (H___CROSS_CC__) \ && (defined (__ANDROID__) || defined (__BIONIC__)) VOID_C unlink(TMPLINK); n = link(__FILE__, TMPLINK); if (n < 0 && errno != EACCES) n = 0; VOID_C unlink(TMPLINK); if (n < 0) printf("s:__LN__:ln -s:\n"); else #endif /* !H___CROSS_CC__ && (__ANDROID__ || __BIONIC__) */ printf("s:__LN__:ln:\n"); *buf1 = *buf2 = *buf3 = '\0'; printf("s:__CC__:%s:\n", CCCOMMAND); printf("s:__CFLAGS__:%s:\n", CFLAGS); printf("s:__CPPFLAGS__:%s:\n", CPPFLAGS); printf("s:__LDFLAGS__:%s:\n", LDFLAGS); strappend(buf1, "$(OSOPTS)"); strappend(buf1, EXTENDCCOPT); strappend(buf1, "$(DEBUG)"); #if defined (__GNUC__) && defined (__GNUC_MINOR__) # if gcc_newer(4, 3) || defined (__clang__) strappend(buf3, "-Wno-empty-body"); # endif # if !defined (CODEUTF8) && defined (__clang__) && clang_newer(3, 1) strappend(buf3, "-Wno-invalid-source-encoding"); # endif # if gcc_newer(6, 0) || (defined (__clang__) && clang_newer(3, 7)) strappend(buf3, "-Wno-shift-negative-value"); # endif #endif /* __GNUC__ && __GNUC_MINOR__ */ #ifdef HOSTCCCOMMAND if (strcmp(CCCOMMAND, HOSTCCCOMMAND)) { printf("s:__HOSTCC__:%s:\n", HOSTCCCOMMAND); printf("s:__HOSTCFLAGS__:%s:\n", HOSTCFLAGS); printf("s:__HOSTCPPFLAGS__:%s:\n", HOSTCPPFLAGS); printf("s:__HOSTLDFLAGS__:%s:\n", HOSTLDFLAGS); strappend(buf1, "$(CFLAGS)"); # if defined (H___GNUC__) && defined (H___GNUC_MINOR__) # if h_gcc_newer(4, 3) || defined (H___clang__) strappend(buf1, "-Wno-empty-body"); # endif # if !defined (CODEUTF8) && defined (H___clang__) && h_clang_newer(3, 1) strappend(buf1, "-Wno-invalid-source-encoding"); # endif # if h_gcc_newer(6, 0) || (defined (H___clang__) && h_clang_newer(3, 7)) strappend(buf1, "-Wno-shift-negative-value"); # endif # endif /* H___GNUC__ && H___GNUC_MINOR__ */ strappend(buf2, "$(OSOPTS)"); strappend(buf2, "-D__HOST_LANG__"); strappend(buf2, "$(HOSTCFLAGS)"); # if defined (__GNUC__) && defined (__GNUC_MINOR__) strappend(buf2, buf3); # endif } else #endif /* HOSTCCCOMMAND */ { printf("s:__HOSTCC__:$(CC):\n"); printf("s:__HOSTCFLAGS__:$(CFLAGS):\n"); printf("s:__HOSTCPPFLAGS__:$(CPPFLAGS):\n"); printf("s:__HOSTLDFLAGS__:$(LDFLAGS):\n"); strappend(buf1, "$(CFLAGS)"); # if defined (__GNUC__) && defined (__GNUC_MINOR__) strappend(buf1, buf3); # endif strappend(buf2, "$(COPTS)"); } printf("s:__COPTS__:%s:\n", buf1); printf("s:__HOSTCOPTS__:%s:\n", buf2); #if defined (DEFFDSETSIZE) && defined (FD_SETSIZE) if (FD_SETSIZE < MAXOPENFILE) printf("s:__FDSETSIZE__:-DFD_SETSIZE=%d:\n", MAXOPENFILE); else #endif printf("s:__FDSETSIZE__::\n"); printf("s:__MEM__::\n"); printf("s:__SHMEM__::\n"); printf("s:__BSHMEM__::\n"); printf("s:__NSHMEM__::\n"); #ifdef CCOUTOPT printf("s:__OUT__:%s:\n", CCOUTOPT); #else printf("s:__OUT__:-o $@:\n"); #endif #ifdef CCLNKOPT printf("s:__LNK__:%s:\n", CCLNKOPT); #else printf("s:__LNK__:-o $@:\n"); #endif *buf1 = *buf2 = *buf3 = '\0'; strappend(buf1, TERMCAPLIB); #ifdef _NOORIGGLOB strappend(buf1, REGEXPLIB); strappend(buf2, REGEXPLIB); strappend(buf3, REGEXPLIB); #endif #ifndef _NOSOCKET strappend(buf1, SOCKETLIB); strappend(buf3, SOCKETLIB); #endif strappend(buf1, EXTENDLIB); strappend(buf2, EXTENDLIB); strappend(buf3, EXTENDLIB); cp = "$(ALLOC)"; strappend(buf1, cp); strappend(buf2, cp); strappend(buf3, cp); cp = "$(LDFLAGS)"; strappend(buf1, cp); strappend(buf2, cp); strappend(buf3, cp); printf("s:__FLDFLAGS__:%s:\n", buf1); printf("s:__SLDFLAGS__:%s:\n", buf2); printf("s:__NLDFLAGS__:%s:\n", buf3); #ifdef CODEEUC cp = "-e"; #else cp = "-s"; #endif printf("s:__KCODEOPTION__:%s:\n", cp); printf("s:__KDOCOPTION__:%s:\n", (utf) ? "-u" : cp); #ifdef CPP7BIT printf("s:__MSBOPTION__:-7:\n"); #else printf("s:__MSBOPTION__::\n"); #endif *buf1 = '\0'; #if defined (DEP_UNICODE) && !defined (DEP_EMBEDUNITBL) strappend(buf1, "$(UNITBL)"); #endif #if defined (DEP_IME) && !defined (DEP_EMBEDDICTTBL) strappend(buf1, "$(DICTTBL)"); #endif #ifndef _NOCATALOG strappend(buf1, "$(CATTBL)"); strappend(buf1, "$(ECATTBL)"); #endif printf("s:__TABLES__:%s:\n", buf1); #if defined (DEP_UNICODE) && defined (DEP_EMBEDUNITBL) printf("s:__UNITBLOBJ__:unitbl$(OBJ):\n"); #else printf("s:__UNITBLOBJ__::\n"); #endif printf("s:__TUNITBLOBJ__:%s:\n", (utf) ? "tunitbl$(OBJ)" : ""); #if defined (DEP_IME) && defined (DEP_EMBEDDICTTBL) printf("s:__DICTTBLOBJ__:dicttbl$(OBJ):\n"); #else printf("s:__DICTTBLOBJ__::\n"); #endif #ifdef SUPPORTSJIS printf("s:__PREFIXOPTION__::\n"); #else printf("s:__PREFIXOPTION__:-c:\n"); #endif printf("s:[\t ]*$::\n"); printf("/^[\t ][\t ]*-*\\$(RM) *$/d\n"); return(0); } FD-3.01j/mkmfdosl.sed100644 2105 1751 2540 13516612560 13173 0ustar shiraiusers:/:\\:g s:__PREFIX__:: s:__CONFDIR__:: s:__EXE__:.exe:g s:__OBJ__:.obj:g s:__DOSOBJS__:$(DOSOBJS): s:__IMEOBJS__:: s:__DICTSRC__:: s:__MKDICTOPTION__:: s:__SOCKETOBJS__:: s:__SOCKETLIBS__:: s:__OBJLIST__:@$(ARGS): s:__SOBJLIST__:@$(SARGS): s:__NOBJLIST__:@$(NARGS): s:__DEFRC__:\\\\\\"$(DOSRC)\\\\\\": s:__TBLPATH__:: s:__DATADIR__:$(BINDIR):g s:__DATADIR2__:$(BINDIR):g s:__SLEEP__:#: s:__DJGPP1__:#: s:__ECHO__:command /c echo: s:__COPY__:copy /y: s:__RM__:del: s:__LANGDIR__:: s:__WITHUTF8__:: s:__PRESETKCODE__:: s:__INSTALL__:copy /y: s:__INSTSTRIP__:: s:__LN__:copy /y: s:__CC__:lcc86: s:__CFLAGS__:-O: s:__CPPFLAGS__:: s:__LDFLAGS__:: s:__HOSTCC__:$(CC): s:__HOSTCFLAGS__:$(CFLAGS): s:__HOSTCPPFLAGS__:$(CPPFLAGS): s:__HOSTLDFLAGS__:$(LDFLAGS): s:__COPTS__:$(OSOPTS) $(DEBUG) $(CFLAGS): s:__HOSTCOPTS__:$(COPTS): s:__FDSETSIZE__:: s:__MEM__:-ml -h -k"-s 3000": s:__SHMEM__:-mp -h -k"-s 8000": s:__BSHMEM__:-ms -k"-s 8000": s:__NSHMEM__:-mp -h -k"-s 8000": s:__OUT__:-o $@: s:__LNK__:-o $@: s:__FLDFLAGS__:-lintlib -ltinymain.obj $(ALLOC) $(LDFLAGS): s:__SLDFLAGS__:-lintlib -ltinymain.obj $(ALLOC) $(LDFLAGS): s:__NLDFLAGS__:-lintlib -ltinymain.obj $(ALLOC) $(LDFLAGS): s:__KCODEOPTION__:-s: s:__KDOCOPTION__:-s: s:__MSBOPTION__:: s:__TABLES__:$(UNITBL) $(CATTBL) $(ECATTBL): s:__UNITBLOBJ__:: s:__TUNITBLOBJ__:: s:__PREFIXOPTION__:: s:[ ]*$:: /^[ ][ ]*-*\$(RM)$/d FD-3.01j/mkmfdosb.sed100644 2105 1751 2365 13516612560 13166 0ustar shiraiusers:/:\\:g s:__PREFIX__:: s:__CONFDIR__:: s:__EXE__:.exe:g s:__OBJ__:.obj:g s:__DOSOBJS__:$(DOSOBJS): s:__IMEOBJS__:: s:__DICTSRC__:: s:__MKDICTOPTION__:: s:__SOCKETOBJS__:: s:__SOCKETLIBS__:: s:__OBJLIST__:@$(ARGS): s:__SOBJLIST__:@$(SARGS): s:__NOBJLIST__:@$(NARGS): s:__DEFRC__:\\"$(DOSRC)\\": s:__TBLPATH__:: s:__DATADIR__:$(BINDIR):g s:__DATADIR2__:$(BINDIR):g s:__SLEEP__:#: s:__DJGPP1__:#: s:__ECHO__:command /c echo: s:__COPY__:copy /y: s:__RM__:del: s:__LANGDIR__:: s:__WITHUTF8__:: s:__PRESETKCODE__:: s:__INSTALL__:copy /y: s:__INSTSTRIP__:: s:__LN__:copy /y: s:__CC__:bcc: s:__CFLAGS__:-O -N -d -w-par -w-rch -w-ccc -w-pia: s:__CPPFLAGS__:: s:__LDFLAGS__:: s:__HOSTCC__:$(CC): s:__HOSTCFLAGS__:$(CFLAGS): s:__HOSTCPPFLAGS__:$(CPPFLAGS): s:__HOSTLDFLAGS__:$(LDFLAGS): s:__COPTS__:$(OSOPTS) $(DEBUG) $(CFLAGS): s:__HOSTCOPTS__:$(COPTS): s:__FDSETSIZE__:: s:__MEM__:-ml: s:__SHMEM__:-mm: s:__BSHMEM__:-mm: s:__NSHMEM__:-ml: s:__OUT__:-o$@: s:__LNK__:-e$@: s:__FLDFLAGS__:$(ALLOC) $(LDFLAGS): s:__SLDFLAGS__:$(ALLOC) $(LDFLAGS): s:__NLDFLAGS__:$(ALLOC) $(LDFLAGS): s:__KCODEOPTION__:-s: s:__KDOCOPTION__:-s: s:__MSBOPTION__:: s:__TABLES__:$(UNITBL) $(CATTBL) $(ECATTBL): s:__UNITBLOBJ__:: s:__TUNITBLOBJ__:: s:__PREFIXOPTION__:: s:[ ]*$:: /^[ ][ ]*-*\$(RM)$/d FD-3.01j/config.hin100644 2105 1751 62 13516612560 12564 0ustar shiraiuser/* * config.h * * definitions for each OS */ FD-3.01j/version.h100644 2105 1751 170 13516612560 12475 0ustar shiraiuser/* * version.h * * version number */ char *distributor = NULL; static char version[] = "@(#)fd.c 3.01j 07/27/19"; FD-3.01j/_fdrc100644 2105 1751 45601 13516612560 11707 0ustar shiraiuser# Initialize file for FD # # whether if limit configuration items or not in the customizer # 0: not limit (Default) # >= 1: limit #BASICCUSTOM=0 # default sort type # 0: not sort (Default) # 1: alphabetical 9: alphabetical (reversal) # 2: extension 10: extension (reversal) # 3: size 11: size (reversal) # 4: date 12: date (reversal) # 5: length 13: length (reversal) # 100-113: preserve previous sort type # 200-213: preserve previous sort type also in the archive browser # (the least 2 digits are effective just after initialize) #SORTTYPE=0 # default display mode # 0: normal (Default) # 1: sym-link status # 2: file type symbol # 3: sym-link status & file type symbol # 4: invisible dot file # 5: sym-link status & invisible dot file # 6: file type symbol & invisible dot file # 7: sym-link status & file type symbol & invisible dot file #DISPLAYMODE=0 # whether if sort or not in tree mode # 0: not sort (Default) # >= 1: sort according to SORTTYPE #SORTTREE=0 # behavior about writing over directory on file system # 0: confirm to write or not, after directory arranged (Default) # 1: write directory only if commanded # 2: never write over directory even if commanded #WRITEFS=0 # whether if ignore uppercase or lowercase in filename comparison # 0: not ignore (Default) # >= 1: ignore #IGNORECASE=0 # whether if inherit timestamp or not when copying # 0: not inherit (Default) # >= 1: inherit #INHERITCOPY=0 # whether if display progress bar on copying/moving files # 0: not dislpay (Default) # >= 1: dislpay #PROGRESSBAR=0 # whether if query overwriting policy in advance before copying/moving files # 0: not query (Default) # >= 1: query #PRECOPYMENU=0 # whether if adjust tty or not when exiting # 0: not adjust (Default) # >= 1: adjust #ADJTTY=0 # whether if prioritize VT100 escape sequence or not for getting terminal size # 0: not prioritize (Default) # >= 1: prioritize #USEGETCURSOR=0 # default columns of file in 1 line # 1: 1 column # 2: 2 columns (Default) # 3: 3 columns # 5: 5 columns #DEFCOLUMNS=2 # minimum columns of filename field # Default: 12 #MINFILENAME=12 # widen digit for the number of pages & files # 0: not widen (Default) # >= 1: widen #WIDEDIGIT=0 # use SI unit with huge file size # 0: not use SI unit (Default) # >= 1: use SI unit #SIZEUNIT=0 # history file of sh mode # Default: ~/.fd_history #HISTFILE=~/.fd_history # history file of path input # Default: none #DIRHISTFILE="" # history size of sh mode # Default: 50 #HISTSIZE=50 # history size of path input # Default: 50 #DIRHIST=50 # size of saved command history # Default: 50 #SAVEHIST=50 # size of saved directory history # Default: 50 #SAVEDIRHIST=50 # file creation mask for command history # Default: 022 #HISTUMASK=022 # file creation mask for directory history # Default: 022 #DIRHISTUMASK=022 # limit of counting files in directory, on tree mode # Default: 50 #DIRCOUNTLIMIT=50 # whether if make MS-DOS drive effective # 0: not use (Default) # >= 1: effective #DOSDRIVE=0 # whether if display the second hand of clock # 0: not display (Default) # >= 1: display #SECOND=0 # interval seconds to update browser automatically # 0: invalid (Default) # >= 1: valid #AUTOUPDATE=0 # whether if use the screen layout based on the traditional "FD" # 0: original layout (Default) # >= 1: traditional layout #TRADLAYOUT=0 # whether if show the info. of filesize # 0: not show (Default) # >= 1: show #SIZEINFO=0 # layout form of the function line # value: n * 100 + size # n: the number of function keys # size: the block size of function keys # Default: 10 * 100 + 5 #FUNCLAYOUT=1005 # key to invoke tiny Kanji Input Method Editor # Default: none #IMEKEY="" # whether if hold the Kana-Kanji translation table on memory # 0: not hold (Default) # 1: only Hinsi info. table # 2: also includes index table # 3: hold all tables #IMEBUFFER=0 # learning level for the Kana-Kanji translation # default: 16 #IMELEARNING=16 # file creation mask for the Kana-Kanji translation frequency # Default: 022 #FREQUMASK=022 # whether if support ANSI color escape sequence # 0: monochrome (Default) # 1: color # 2: color & force background to blacken # 3: color & force foreground to blacken #ANSICOLOR=0 # color palette in the ANSI color mode # Default: none # 0: black # 1: red # 2: green # 3: yellow # 4: blue # 5: magenta # 6: cyan # 7: white # 8: default color for foreground # 9: default color for background # default palette: 89624351888 # ||||||||||| # normal file -----+|||||||||| # background -------+||||||||| # directory ---------+|||||||| # unwritable ---------+||||||| # unreadable ----------+|||||| # symbolic link --------+||||| # socket ----------------+|||| # fifo (named pipe) ------+||| # block device ------------+|| # character device ---------+| # exectable -----------------+ #ANSIPALETTE="" # edit mode with your favorite editor type # emacs: ^P, ^N, ^F, ^B, ... (Default) # wordstar ^E, ^X, ^D, ^S, ... # vi: k, j, l, h, ... #EDITMODE=emacs # whether if loop cursor moving within the same page # 0: not loop (Default) # >= 1: loop #LOOPCURSOR=0 # temporary directory where archive file is unpacked # Default: /tmp #TMPDIR=/tmp # file creation mask for the temporary directory # Default: 022 #TMPUMASK=022 # mount point of CD-ROM with iso-9660 rock ridge format # Default: none #RRPATH="" # directories on which browsing precedes getting file status # Default: none #PRECEDEPATH="" # shell prompt strings # Default: "$ " #PS1="$ " # continuous shell prompt strings # Default: "> " #PS2="> " # whether if not use control sequences in the internal shell # 0: use (Default) # >= 1: not use #DUMBSHELL=0 # whether if use pseudo terminal # 0: not use (Default) # >= 1: use #PTYMODE=0 # value of the environ variable "TERM" for pseudo terminal # Default: "vt100" #PTYTERM="vt100" # key to open pseudo terminal menu # Default: none #PTYMENUKEY="" # filename for logging # Default: none #LOGFILE="" # file size for logging # Default: 1024 (KB) #LOGSIZE=1024 # whether if use syslog for logging # 0: not use (Default) # >= 1: use #USESYSLOG=0 # logging level for normal users # 0: not logging (Default) # 1: for warning # 2: for notice # 3: for information # >= 4: for debug #LOGLEVEL=0 # logging level for the super user # 0: not logging # 1: for warning (Default) # 2: for notice # 3: for information # >= 4: for debug #ROOTLOGLEVEL=1 # whether if pass through the startup arguments as is # 0: evaluate arguments (Default) # >= 1: pass through #THRUARGS=0 # whether if make URL drive effective # 0: not use (Default) # >= 1: effective #URLDRIVE=0 # timeout seconds for communications on URL drive # 0: invalid (Default) # >= 1: valid #URLTIMEOUT=0 # communication options for URL drive # 0: normal (Default) # 1: deny PASV # 2: deny PORT # 3: deny PASV & PORT # 4: deny MDTM # 5: deny PASV & MDTM # 6: deny PORT & MDTM # 7: deny PASV & PORT & MDTM # 8: deny FEAT # 9: deny PASV & FEAT # 10: deny PORT & FEAT # 11: deny PASV & PORT & FEAT # 12: deny MDTM & FEAT # 13: deny PASV & MDTM & FEAT # 14: deny PORT & MDTM & FEAT # 15: deny PASV & PORT & MDTM & FEAT # 16: get HTTP detail status # 17: deny PASV & get HTTP detail status # 18: deny PORT & get HTTP detail status # 19: deny PASV & PORT & get HTTP detail status # 20: deny MDTM & get HTTP detail status # 21: deny PASV & MDTM & get HTTP detail status # 22: deny PORT & MDTM & get HTTP detail status # 23: deny PASV & PORT & MDTM & get HTTP detail status # 24: deny FEAT & get HTTP detail status # 25: deny PASV & FEAT & get HTTP detail status # 26: deny PORT & FEAT & get HTTP detail status # 27: deny PASV & PORT & FEAT & get HTTP detail status # 28: deny MDTM & FEAT & get HTTP detail status # 29: deny PASV & MDTM & FEAT & get HTTP detail status # 30: deny PORT & MDTM & FEAT & get HTTP detail status # 31: deny PASV & PORT & MDTM & FEAT & get HTTP detail status #URLOPTIONS=0 # whether if suppress displaying '*' with password input # 0: display '*' (Default) # >= 1: display none #HIDEPASSWD=0 # mail address for anonymous FTP # Default: "FDclone@" #FTPADDRESS="FDclone@" # FTP proxy address # Default: none #FTPPROXY="" # filename for logging FTP communications # Default: none #FTPLOGFILE="" # HTTP proxy address # Default: none #HTTPPROXY="" # filename for logging HTTP communications # Default: none #HTTPLOGFILE="" # filename for logging received HTML # Default: none #HTMLLOGFILE="" # whether if hold the UNICODE translation table on memory # 0: not hold (Default) # >= 1: hold #UNICODEBUFFER=0 # language code to be displayed # Default: No convert # euc, EUC: EUC-JP # sjis, SJIS: Shift JIS # jis, JIS: 7bits JIS # jis8, JIS8: 8bits JIS # junet, JUNET: ISO-2022-JP # ojis, OJIS: old 7bits JIS # ojis8, OJIS8: old 8bits JIS # ojunet, OJUNET: old ISO-2022-JP # utf8, UTF8: UTF-8 # utf8-mac, UTF8-MAC: UTF-8 for Mac OS X # utf8-iconv, UTF8-ICONV: UTF-8 for iconv # en, EN, C: English #LANGUAGE="" # system default Kanji code # Default: No convert # euc, EUC: EUC-JP # sjis, SJIS: Shift JIS # jis, JIS: 7bits JIS # jis8, JIS8: 8bits JIS # junet, JUNET: ISO-2022-JP # ojis, OJIS: old 7bits JIS # ojis8, OJIS8: old 8bits JIS # ojunet, OJUNET: old ISO-2022-JP # hex, HEX: HEX # cap, CAP: CAP # utf8, UTF8: UTF-8 # utf8-mac, UTF8-MAC: UTF-8 for Mac OS X # utf8-iconv, UTF8-ICONV: UTF-8 for iconv #DEFKCODE="" # Kanji code to be inputted # Default: No convert # euc, EUC: EUC-JP # sjis, SJIS: Shift JIS # utf8, UTF8: UTF-8 # utf8-mac, UTF8-MAC: UTF-8 for Mac OS X # utf8-iconv, UTF8-ICONV: UTF-8 for iconv #INPUTKCODE="" # Kanji code to be inputted to the pseudo terminal # Default: No convert # euc, EUC: EUC-JP # sjis, SJIS: Shift JIS # utf8, UTF8: UTF-8 # utf8-mac, UTF8-MAC: UTF-8 for Mac OS X # utf8-iconv, UTF8-ICONV: UTF-8 for iconv #PTYINKCODE="" # Kanji code to be outputted from the pseudo terminal # Default: No convert # euc, EUC: EUC-JP # sjis, SJIS: Shift JIS # utf8, UTF8: UTF-8 # utf8-mac, UTF8-MAC: UTF-8 for Mac OS X # utf8-iconv, UTF8-ICONV: UTF-8 for iconv #PTYOUTKCODE="" # Kanji code in filename # Default: No convert # euc, EUC: EUC-JP # sjis, SJIS: Shift JIS # jis, JIS: 7bits JIS # jis8, JIS8: 8bits JIS # junet, JUNET: ISO-2022-JP # ojis, OJIS: old 7bits JIS # ojis8, OJIS8: old 8bits JIS # ojunet, OJUNET: old ISO-2022-JP # hex, HEX: HEX # cap, CAP: CAP # utf8, UTF8: UTF-8 # utf8-mac, UTF8-MAC: UTF-8 for Mac OS X # utf8-iconv, UTF8-ICONV: UTF-8 for iconv #FNAMEKCODE="" # Kanji code in filename on URL drive # Default: No convert # euc, EUC: EUC-JP # sjis, SJIS: Shift JIS # jis, JIS: 7bits JIS # jis8, JIS8: 8bits JIS # junet, JUNET: ISO-2022-JP # ojis, OJIS: old 7bits JIS # ojis8, OJIS8: old 8bits JIS # ojunet, OJUNET: old ISO-2022-JP # hex, HEX: HEX # cap, CAP: CAP # utf8, UTF8: UTF-8 # utf8-mac, UTF8-MAC: UTF-8 for Mac OS X # utf8-iconv, UTF8-ICONV: UTF-8 for iconv #URLKCODE="" # language code to be displayed # Default: according to LANGUAGE # en, EN, C: English # ja: Japanese #MESSAGELANG="" # directories on which Kanji code in filename is SJIS # Default: none #SJISPATH="" # directories on which Kanji code in filename is EUC-JP # Default: none #EUCPATH="" # directories on which Kanji code in filename is 7bits JIS # Default: none #JISPATH="" # directories on which Kanji code in filename is 8bits JIS # Default: none #JIS8PATH="" # directories on which Kanji code in filename is ISO-2022-JP # Default: none #JUNETPATH="" # directories on which Kanji code in filename is old 7bits JIS # Default: none #OJISPATH="" # directories on which Kanji code in filename is old 8bits JIS # Default: none #OJIS8PATH="" # directories on which Kanji code in filename is old ISO-2022-JP # Default: none #OJUNETPATH="" # directories on which Kanji code in filename is HEX # Default: none #HEXPATH="" # directories on which Kanji code in filename is CAP # Default: none #CAPPATH="" # directories on which Kanji code in filename is UTF-8 # Default: none #UTF8PATH="" # directories on which Kanji code in filename is UTF-8 for Mac OS X # Default: none #UTF8MACPATH="" # directories on which Kanji code in filename is UTF-8 for iconv # Default: none #UTF8ICONVPATH="" # directories on which Kanji code in filename is not converted # Default: none #NOCONVPATH="" #PAGER=more%K #EDITOR=vi #SHELL=/bin/sh # for Mischievous Japanese OS (see `man fd') #export LANG=C # launcher definition #(Default) #launch ".lzh" "lha l" \ # -f "%a %u/%g %s %x %m %d %{yt} %*f" \ # -f "%9a %u/%g %s %x %m %d %{yt} %*f" \ # -i " PERMSSN * UID*GID *" \ # -i "----------*" \ # -i " Total * file* ???.*%*" \ #launch ".tar" "tar tvf" \ # -f "%a %u/%g %s %m %d %t %y %*f" \ # -f "%a %u/%g %s %y-%m-%d %t %*f" \ # -f "%a %l %u %g %s %m %d %{yt} %*f" \ # -f "%10a %u/%g %s %m %d %t %y %*f" \ # -f "%9a %u/%g %s %m %d %t %y %*f" \ # -f "%a %u %g %s %m %d %t %y %*f" \ # -f "%a %u/%g %m %d %t %y %*f" #launch ".tar.Z" "zcat %C|tar tvf -" \ # -f "%a %u/%g %s %m %d %t %y %*f" \ # -f "%a %u/%g %s %y-%m-%d %t %*f" \ # -f "%a %l %u %g %s %m %d %{yt} %*f" \ # -f "%10a %u/%g %s %m %d %t %y %*f" \ # -f "%9a %u/%g %s %m %d %t %y %*f" \ # -f "%a %u %g %s %m %d %t %y %*f" \ # -f "%a %u/%g %m %d %t %y %*f" #launch ".tar.gz" "gzip -cd %C|tar tvf -" \ # -f "%a %u/%g %s %m %d %t %y %*f" \ # -f "%a %u/%g %s %y-%m-%d %t %*f" \ # -f "%a %l %u %g %s %m %d %{yt} %*f" \ # -f "%10a %u/%g %s %m %d %t %y %*f" \ # -f "%9a %u/%g %s %m %d %t %y %*f" \ # -f "%a %u %g %s %m %d %t %y %*f" \ # -f "%a %u/%g %m %d %t %y %*f" #launch ".tar.bz2" "bzip2 -cd %C|tar tvf -" \ # -f "%a %u/%g %s %m %d %t %y %*f" \ # -f "%a %u/%g %s %y-%m-%d %t %*f" \ # -f "%a %l %u %g %s %m %d %{yt} %*f" \ # -f "%10a %u/%g %s %m %d %t %y %*f" \ # -f "%9a %u/%g %s %m %d %t %y %*f" \ # -f "%a %u %g %s %m %d %t %y %*f" \ # -f "%a %u/%g %m %d %t %y %*f" #launch ".taZ" "zcat %C|tar tvf -" \ # -f "%a %u/%g %s %m %d %t %y %*f" \ # -f "%a %u/%g %s %y-%m-%d %t %*f" \ # -f "%a %l %u %g %s %m %d %{yt} %*f" \ # -f "%10a %u/%g %s %m %d %t %y %*f" \ # -f "%9a %u/%g %s %m %d %t %y %*f" \ # -f "%a %u %g %s %m %d %t %y %*f" \ # -f "%a %u/%g %m %d %t %y %*f" #launch ".taz" "gzip -cd %C|tar tvf -" \ # -f "%a %u/%g %s %m %d %t %y %*f" \ # -f "%a %u/%g %s %y-%m-%d %t %*f" \ # -f "%a %l %u %g %s %m %d %{yt} %*f" \ # -f "%10a %u/%g %s %m %d %t %y %*f" \ # -f "%9a %u/%g %s %m %d %t %y %*f" \ # -f "%a %u %g %s %m %d %t %y %*f" \ # -f "%a %u/%g %m %d %t %y %*f" #launch ".tgz" "gzip -cd %C|tar tvf -" \ # -f "%a %u/%g %s %m %d %t %y %*f" \ # -f "%a %u/%g %s %y-%m-%d %t %*f" \ # -f "%a %l %u %g %s %m %d %{yt} %*f" \ # -f "%10a %u/%g %s %m %d %t %y %*f" \ # -f "%9a %u/%g %s %m %d %t %y %*f" \ # -f "%a %u %g %s %m %d %t %y %*f" \ # -f "%a %u/%g %m %d %t %y %*f" #(Examples) #launch ".zip" "unzip -lqq" " %s %m-%d-%y %t %*f" #launch ".zoo" "zoo lq" " %s %x %x %d %m %y %t %*f" #launch ".rar" "unrar v" \ # -f " %*f\n%s %x %x %d-%m-%y %t %a" \ # -i "UNRAR *" \ # -i "RAR *" \ # -i "Shareware version *" \ # -i "Verifying authenticity *" \ # -i "Solid archive *" \ # -i "Archive *" \ # -i "Pathname/Comment" \ # -i "Size * Packed *" \ # -i "----------*" \ # -i "* * * ??%" \ # -i "Old style *" \ # -i "Archive *.rar" \ # -i "created at ??:??:?? *" \ # -i "by * *" \ # -i "" #launch ".Z" "zcat %C|$PAGER" #launch ".gz" "gzip -cd %C|$PAGER" #launch ".bz2" "bzip2 -cd %C|$PAGER" # examples for MS-DOS #launch ".lzh" "lha v %S" % # -f "%*f\n%s %x %x %y-%m-%d %t %a" % # -f "%1x %12f %s %x %x %y-%m-%d %t %a" % # -i "Listing of archive : *" % # -i " Name Original *" % # -i "--------------*" % # -i "* files * ???.?%%%% ??-??-?? ??:??:??" % # -i "" #launch ".tar.Z" "gzip -cd %S|tar tvf -" % # -f "%a %u/%g %s %m %d %t %y %*f" % # -f "%a %u/%g %s %y-%m-%d %t %*f" % # -f "%a %u/%g %s %m %d %y %t %*f" % #launch ".tar.gz" "gzip -cd %S|tar tvf -" % # -f "%a %u/%g %s %m %d %t %y %*f" % # -f "%a %u/%g %s %y-%m-%d %t %*f" % # -f "%a %u/%g %s %m %d %y %t %*f" % #launch ".tar.bz2" "bzip2 -cd %S|tar tvf -" % # -f "%a %u/%g %s %m %d %t %y %*f" % # -f "%a %u/%g %s %y-%m-%d %t %*f" % # -f "%a %u/%g %s %m %d %y %t %*f" % #launch ".taz" "gzip -cd %S|tar tvf -" % # -f "%a %u/%g %s %m %d %t %y %*f" % # -f "%a %u/%g %s %y-%m-%d %t %*f" % # -f "%a %u/%g %s %m %d %y %t %*f" % #launch ".tgz" "gzip -cd %S|tar tvf -" % # -f "%a %u/%g %s %m %d %t %y %*f" % # -f "%a %u/%g %s %y-%m-%d %t %*f" % # -f "%a %u/%g %s %m %d %y %t %*f" % #launch ".zip" "unzip -lqq %S" " %s %y-%m-%d %t %*f" #launch ".zip" "pkunzip -vb %S" " %s %x %x %x %y-%m-%d %t %*f" 14 2 # archiver definition #(Default) #arch ".lzh" "lha aq %C %TA" "lha xq %C %TA" #arch ".tar" "tar cf %C %T" "tar xf %C %TA" #arch ".tar.Z" "tar cf - %T|compress -c > %C" "zcat %C|tar xf - %TA" #arch ".tar.gz" "tar cf - %T|gzip -c > %C" "gzip -cd %C|tar xf - %TA" #arch ".tar.bz2" \ # "tar cf - %T|bzip2 -c > %C" "bzip2 -cd %C|tar xf - %TA" #arch ".taZ" "tar cf - %T|compress -c > %C" "zcat %C|tar xf - %TA" #arch ".taz" "tar cf - %T|gzip -c > %C" "gzip -cd %C|tar xf - %TA" #arch ".tgz" "tar cf - %T|gzip -c > %C" "gzip -cd %C|tar xf - %TA" #(Examples) #arch ".zip" "zip -q %C %TA" "unzip -q %C %TA" #arch ".zoo" "zoo aq %C %TA" "zoo xq %C %TA" #arch ".rar" "rar a -inul %C %TA" "unrar x -inul %C %TA" # examples for MS-DOS #arch ".lzh" "lha a %S %TA" "lha x %S %TA" #arch ".tar.Z" "tar cf - %T|compress -c > %C" "gzip -cd %S|tar xf - %TA" #arch ".tar.gz" "tar cf - %T|gzip -c > %C" "gzip -cd %S|tar xf - %TA" #arch ".tar.bz2" % # "tar cf - %T|bzip2 -c > %C" "bzip2 -cd %S|tar xf - %TA" #arch ".taz" "tar cf - %T|compress -c > %C" "gzip -cd %S|tar xf - %TA" #arch ".tgz" "tar cf - %T|gzip -c > %C" "gzip -cd %S|tar xf - %TA" #arch ".zip" "pkzip %S %TA" "pkunzip %S %TA" # key bind definition #(Examples) #bind 'I' "dir -d %C" #bind 'g' "gzip %C%K" WARNING_BELL #bind 'G' "gzip -d %C%K" WARNING_BELL #bind 'R' "grep %R %C" #bind '{' ROLL_UP #bind '}' ROLL_DOWN #bind '~' "cd ~%N%K" #bind 'F1' "man fd%N%K" :Manual # function definition #(Example1) #rename() { # MARK_ALL 0 # MARK_FIND $1 ## RENAME_FILE $2 # evalmacro mv %M $2 #} # #(Example2: used in archiver definition) #maketaz() { # evalmacro tar cf %X.tar %T # evalmacro $1 %X.tar # evalmacro mv %X.tar.$2 %X.$3 #} # #(Example3: ftp browsing) #getftp() { # FHOST=$1 # FPATH= # browse -@ - <<'EOF0' # 'ftp -n $FHOST <<-EOF # user ftp `whoami`@`hostname` # dir $FPATH # quit # EOF' # -f "%a %l %u %g %s %m %d %{yt} %*f" # -i "total *" # -e "Not connected." # -e "Login incorrect." # -e "Login failed." # -p 'FPATH=$1; while [ "$#" -gt 1 ]; do shift; FPATH=$1/$FPATH; done' # -d loop # # 'dir=`readline "Dir: "` && [ -d "$dir" ] \ # && yesno "copy \"$FPATH\" to \"$dir\" ?" \ # && ftp -n $FHOST <<-EOF \ # && echo "copy \"$FPATH\" to \"$dir\"." %K \ # || echo canceled. # user ftp `whoami`@`hostname` # get $FPATH $dir/${FPATH##*/} # quit # EOF' #EOF0 #} # MS-DOS drive definition #(Example) #setdrv B "/dev/rfd00a" 2, 18, 80 # alias definition #(Example) #alias dir="ls -laF" # keymap definition #(Example) #keymap DEL "\033[3~" FD-3.01j/_fdrc.dif100644 2105 1751 50665 13516612560 12456 0ustar shiraiuser--- ../FD-1.03u/_fdrc Tue Dec 18 00:00:00 2001 +++ _fdrc Fri Aug 3 00:00:00 2012 @@ -1,6 +1,11 @@ # Initialize file for FD # +# whether if limit configuration items or not in the customizer +# 0: not limit (Default) +# >= 1: limit +#BASICCUSTOM=0 + # default sort type # 0: not sort (Default) # 1: alphabetical 9: alphabetical (reversal) @@ -9,8 +14,9 @@ # 4: date 12: date (reversal) # 5: length 13: length (reversal) # 100-113: preserve previous sort type +# 200-213: preserve previous sort type also in the archive browser # (the least 2 digits are effective just after initialize) -#SORTTYPE = 0 +#SORTTYPE=0 # default display mode # 0: normal (Default) @@ -21,98 +27,389 @@ # 5: sym-link status & invisible dot file # 6: file type symbol & invisible dot file # 7: sym-link status & file type symbol & invisible dot file -#DISPLAYMODE = 0 +#DISPLAYMODE=0 # whether if sort or not in tree mode # 0: not sort (Default) # >= 1: sort according to SORTTYPE -#SORTTREE = 0 +#SORTTREE=0 # behavior about writing over directory on file system # 0: confirm to write or not, after directory arranged (Default) # 1: write directory only if commanded # 2: never write over directory even if commanded -#WRITEFS = 0 +#WRITEFS=0 + +# whether if ignore uppercase or lowercase in filename comparison +# 0: not ignore (Default) +# >= 1: ignore +#IGNORECASE=0 + +# whether if inherit timestamp or not when copying +# 0: not inherit (Default) +# >= 1: inherit +#INHERITCOPY=0 + +# whether if display progress bar on copying/moving files +# 0: not dislpay (Default) +# >= 1: dislpay +#PROGRESSBAR=0 + +# whether if query overwriting policy in advance before copying/moving files +# 0: not query (Default) +# >= 1: query +#PRECOPYMENU=0 # whether if adjust tty or not when exiting # 0: not adjust (Default) # >= 1: adjust -#ADJTTY = 0 +#ADJTTY=0 + +# whether if prioritize VT100 escape sequence or not for getting terminal size +# 0: not prioritize (Default) +# >= 1: prioritize +#USEGETCURSOR=0 # default columns of file in 1 line # 1: 1 column # 2: 2 columns (Default) # 3: 3 columns # 5: 5 columns -#COLUMNS = 2 +#DEFCOLUMNS=2 # minimum columns of filename field # Default: 12 -#MINFILENAME = 12 +#MINFILENAME=12 + +# widen digit for the number of pages & files +# 0: not widen (Default) +# >= 1: widen +#WIDEDIGIT=0 + +# use SI unit with huge file size +# 0: not use SI unit (Default) +# >= 1: use SI unit +#SIZEUNIT=0 + +# history file of sh mode +# Default: ~/.fd_history +#HISTFILE=~/.fd_history + +# history file of path input +# Default: none +#DIRHISTFILE="" # history size of sh mode # Default: 50 -#HISTSIZE = 50 +#HISTSIZE=50 # history size of path input # Default: 50 -#DIRHIST = 50 +#DIRHIST=50 + +# size of saved command history +# Default: 50 +#SAVEHIST=50 -# size of saved history +# size of saved directory history # Default: 50 -#SAVEHIST = 50 +#SAVEDIRHIST=50 + +# file creation mask for command history +# Default: 022 +#HISTUMASK=022 + +# file creation mask for directory history +# Default: 022 +#DIRHISTUMASK=022 # limit of counting files in directory, on tree mode # Default: 50 -#DIRCOUNTLIMIT = 50 +#DIRCOUNTLIMIT=50 # whether if make MS-DOS drive effective # 0: not use (Default) # >= 1: effective -#DOSDRIVE = 0 +#DOSDRIVE=0 # whether if display the second hand of clock # 0: not display (Default) # >= 1: display -#SECOND = 0 +#SECOND=0 + +# interval seconds to update browser automatically +# 0: invalid (Default) +# >= 1: valid +#AUTOUPDATE=0 + +# whether if use the screen layout based on the traditional "FD" +# 0: original layout (Default) +# >= 1: traditional layout +#TRADLAYOUT=0 # whether if show the info. of filesize # 0: not show (Default) # >= 1: show -#SIZEINFO = 0 +#SIZEINFO=0 + +# layout form of the function line +# value: n * 100 + size +# n: the number of function keys +# size: the block size of function keys +# Default: 10 * 100 + 5 +#FUNCLAYOUT=1005 + +# key to invoke tiny Kanji Input Method Editor +# Default: none +#IMEKEY="" + +# whether if hold the Kana-Kanji translation table on memory +# 0: not hold (Default) +# 1: only Hinsi info. table +# 2: also includes index table +# 3: hold all tables +#IMEBUFFER=0 + +# learning level for the Kana-Kanji translation +# default: 16 +#IMELEARNING=16 + +# file creation mask for the Kana-Kanji translation frequency +# Default: 022 +#FREQUMASK=022 # whether if support ANSI color escape sequence # 0: monochrome (Default) # 1: color # 2: color & force background to blacken # 3: color & force foreground to blacken -#ANSICOLOR = 0 +#ANSICOLOR=0 + +# color palette in the ANSI color mode +# Default: none +# 0: black +# 1: red +# 2: green +# 3: yellow +# 4: blue +# 5: magenta +# 6: cyan +# 7: white +# 8: default color for foreground +# 9: default color for background +# default palette: 89624351888 +# ||||||||||| +# normal file -----+|||||||||| +# background -------+||||||||| +# directory ---------+|||||||| +# unwritable ---------+||||||| +# unreadable ----------+|||||| +# symbolic link --------+||||| +# socket ----------------+|||| +# fifo (named pipe) ------+||| +# block device ------------+|| +# character device ---------+| +# exectable -----------------+ +#ANSIPALETTE="" # edit mode with your favorite editor type # emacs: ^P, ^N, ^F, ^B, ... (Default) # wordstar ^E, ^X, ^D, ^S, ... # vi: k, j, l, h, ... -#EDITMODE = emacs +#EDITMODE=emacs + +# whether if loop cursor moving within the same page +# 0: not loop (Default) +# >= 1: loop +#LOOPCURSOR=0 # temporary directory where archive file is unpacked # Default: /tmp -#TMPDIR = /tmp +#TMPDIR=/tmp + +# file creation mask for the temporary directory +# Default: 022 +#TMPUMASK=022 # mount point of CD-ROM with iso-9660 rock ridge format # Default: none -#RRPATH = "" +#RRPATH="" + +# directories on which browsing precedes getting file status +# Default: none +#PRECEDEPATH="" # shell prompt strings -# Default: "sh#" -#PROMPT = "sh#" +# Default: "$ " +#PS1="$ " + +# continuous shell prompt strings +# Default: "> " +#PS2="> " + +# whether if not use control sequences in the internal shell +# 0: use (Default) +# >= 1: not use +#DUMBSHELL=0 + +# whether if use pseudo terminal +# 0: not use (Default) +# >= 1: use +#PTYMODE=0 + +# value of the environ variable "TERM" for pseudo terminal +# Default: "vt100" +#PTYTERM="vt100" + +# key to open pseudo terminal menu +# Default: none +#PTYMENUKEY="" + +# filename for logging +# Default: none +#LOGFILE="" + +# file size for logging +# Default: 1024 (KB) +#LOGSIZE=1024 + +# whether if use syslog for logging +# 0: not use (Default) +# >= 1: use +#USESYSLOG=0 + +# logging level for normal users +# 0: not logging (Default) +# 1: for warning +# 2: for notice +# 3: for information +# >= 4: for debug +#LOGLEVEL=0 + +# logging level for the super user +# 0: not logging +# 1: for warning (Default) +# 2: for notice +# 3: for information +# >= 4: for debug +#ROOTLOGLEVEL=1 + +# whether if pass through the startup arguments as is +# 0: evaluate arguments (Default) +# >= 1: pass through +#THRUARGS=0 + +# whether if make URL drive effective +# 0: not use (Default) +# >= 1: effective +#URLDRIVE=0 + +# timeout seconds for communications on URL drive +# 0: invalid (Default) +# >= 1: valid +#URLTIMEOUT=0 + +# communication options for URL drive +# 0: normal (Default) +# 1: deny PASV +# 2: deny PORT +# 3: deny PASV & PORT +# 4: deny MDTM +# 5: deny PASV & MDTM +# 6: deny PORT & MDTM +# 7: deny PASV & PORT & MDTM +# 8: deny FEAT +# 9: deny PASV & FEAT +# 10: deny PORT & FEAT +# 11: deny PASV & PORT & FEAT +# 12: deny MDTM & FEAT +# 13: deny PASV & MDTM & FEAT +# 14: deny PORT & MDTM & FEAT +# 15: deny PASV & PORT & MDTM & FEAT +# 16: get HTTP detail status +# 17: deny PASV & get HTTP detail status +# 18: deny PORT & get HTTP detail status +# 19: deny PASV & PORT & get HTTP detail status +# 20: deny MDTM & get HTTP detail status +# 21: deny PASV & MDTM & get HTTP detail status +# 22: deny PORT & MDTM & get HTTP detail status +# 23: deny PASV & PORT & MDTM & get HTTP detail status +# 24: deny FEAT & get HTTP detail status +# 25: deny PASV & FEAT & get HTTP detail status +# 26: deny PORT & FEAT & get HTTP detail status +# 27: deny PASV & PORT & FEAT & get HTTP detail status +# 28: deny MDTM & FEAT & get HTTP detail status +# 29: deny PASV & MDTM & FEAT & get HTTP detail status +# 30: deny PORT & MDTM & FEAT & get HTTP detail status +# 31: deny PASV & PORT & MDTM & FEAT & get HTTP detail status +#URLOPTIONS=0 + +# whether if suppress displaying '*' with password input +# 0: display '*' (Default) +# >= 1: display none +#HIDEPASSWD=0 + +# mail address for anonymous FTP +# Default: "FDclone@" +#FTPADDRESS="FDclone@" + +# FTP proxy address +# Default: none +#FTPPROXY="" + +# filename for logging FTP communications +# Default: none +#FTPLOGFILE="" + +# HTTP proxy address +# Default: none +#HTTPPROXY="" + +# filename for logging HTTP communications +# Default: none +#HTTPLOGFILE="" + +# filename for logging received HTML +# Default: none +#HTMLLOGFILE="" + +# whether if hold the UNICODE translation table on memory +# 0: not hold (Default) +# >= 1: hold +#UNICODEBUFFER=0 # language code to be displayed # Default: No convert # euc, EUC: EUC-JP # sjis, SJIS: Shift JIS # jis, JIS: 7bits JIS -# eng, ENG, C: English -#LANGUAGE = "" +# jis8, JIS8: 8bits JIS +# junet, JUNET: ISO-2022-JP +# ojis, OJIS: old 7bits JIS +# ojis8, OJIS8: old 8bits JIS +# ojunet, OJUNET: old ISO-2022-JP +# utf8, UTF8: UTF-8 +# utf8-mac, UTF8-MAC: UTF-8 for Mac OS X +# utf8-iconv, UTF8-ICONV: UTF-8 for iconv +# en, EN, C: English +#LANGUAGE="" + +# system default Kanji code +# Default: No convert +# euc, EUC: EUC-JP +# sjis, SJIS: Shift JIS +# jis, JIS: 7bits JIS +# jis8, JIS8: 8bits JIS +# junet, JUNET: ISO-2022-JP +# ojis, OJIS: old 7bits JIS +# ojis8, OJIS8: old 8bits JIS +# ojunet, OJUNET: old ISO-2022-JP +# hex, HEX: HEX +# cap, CAP: CAP +# utf8, UTF8: UTF-8 +# utf8-mac, UTF8-MAC: UTF-8 for Mac OS X +# utf8-iconv, UTF8-ICONV: UTF-8 for iconv +#DEFKCODE="" # Kanji code to be inputted # Default: No convert @@ -120,49 +417,249 @@ # sjis, SJIS: Shift JIS # utf8, UTF8: UTF-8 # utf8-mac, UTF8-MAC: UTF-8 for Mac OS X -#INPUTKCODE = "" +# utf8-iconv, UTF8-ICONV: UTF-8 for iconv +#INPUTKCODE="" -#PAGER = more%K -#EDITOR = vi -#SHELL = /bin/sh +# Kanji code to be inputted to the pseudo terminal +# Default: No convert +# euc, EUC: EUC-JP +# sjis, SJIS: Shift JIS +# utf8, UTF8: UTF-8 +# utf8-mac, UTF8-MAC: UTF-8 for Mac OS X +# utf8-iconv, UTF8-ICONV: UTF-8 for iconv +#PTYINKCODE="" + +# Kanji code to be outputted from the pseudo terminal +# Default: No convert +# euc, EUC: EUC-JP +# sjis, SJIS: Shift JIS +# utf8, UTF8: UTF-8 +# utf8-mac, UTF8-MAC: UTF-8 for Mac OS X +# utf8-iconv, UTF8-ICONV: UTF-8 for iconv +#PTYOUTKCODE="" + +# Kanji code in filename +# Default: No convert +# euc, EUC: EUC-JP +# sjis, SJIS: Shift JIS +# jis, JIS: 7bits JIS +# jis8, JIS8: 8bits JIS +# junet, JUNET: ISO-2022-JP +# ojis, OJIS: old 7bits JIS +# ojis8, OJIS8: old 8bits JIS +# ojunet, OJUNET: old ISO-2022-JP +# hex, HEX: HEX +# cap, CAP: CAP +# utf8, UTF8: UTF-8 +# utf8-mac, UTF8-MAC: UTF-8 for Mac OS X +# utf8-iconv, UTF8-ICONV: UTF-8 for iconv +#FNAMEKCODE="" + +# Kanji code in filename on URL drive +# Default: No convert +# euc, EUC: EUC-JP +# sjis, SJIS: Shift JIS +# jis, JIS: 7bits JIS +# jis8, JIS8: 8bits JIS +# junet, JUNET: ISO-2022-JP +# ojis, OJIS: old 7bits JIS +# ojis8, OJIS8: old 8bits JIS +# ojunet, OJUNET: old ISO-2022-JP +# hex, HEX: HEX +# cap, CAP: CAP +# utf8, UTF8: UTF-8 +# utf8-mac, UTF8-MAC: UTF-8 for Mac OS X +# utf8-iconv, UTF8-ICONV: UTF-8 for iconv +#URLKCODE="" + +# language code to be displayed +# Default: according to LANGUAGE +# en, EN, C: English +# ja: Japanese +#MESSAGELANG="" + +# directories on which Kanji code in filename is SJIS +# Default: none +#SJISPATH="" + +# directories on which Kanji code in filename is EUC-JP +# Default: none +#EUCPATH="" + +# directories on which Kanji code in filename is 7bits JIS +# Default: none +#JISPATH="" + +# directories on which Kanji code in filename is 8bits JIS +# Default: none +#JIS8PATH="" + +# directories on which Kanji code in filename is ISO-2022-JP +# Default: none +#JUNETPATH="" + +# directories on which Kanji code in filename is old 7bits JIS +# Default: none +#OJISPATH="" + +# directories on which Kanji code in filename is old 8bits JIS +# Default: none +#OJIS8PATH="" + +# directories on which Kanji code in filename is old ISO-2022-JP +# Default: none +#OJUNETPATH="" + +# directories on which Kanji code in filename is HEX +# Default: none +#HEXPATH="" + +# directories on which Kanji code in filename is CAP +# Default: none +#CAPPATH="" + +# directories on which Kanji code in filename is UTF-8 +# Default: none +#UTF8PATH="" + +# directories on which Kanji code in filename is UTF-8 for Mac OS X +# Default: none +#UTF8MACPATH="" + +# directories on which Kanji code in filename is UTF-8 for iconv +# Default: none +#UTF8ICONVPATH="" + +# directories on which Kanji code in filename is not converted +# Default: none +#NOCONVPATH="" + +#PAGER=more%K +#EDITOR=vi +#SHELL=/bin/sh # for Mischievous Japanese OS (see `man fd') #export LANG=C # launcher definition #(Default) -#launch ".lzh" "lha l" 0,0:1,2-'/',2'/',3,7,5,6,7,8:10 -#launch ".tar" "tar tvf" 0,0:1,2-'/',2'/',3,7,4,5,6,8:10 -#launch ".tar.Z" \ -# "zcat %C|tar tvf -" 0,0:1,2-'/',2'/',3,7,4,5,6,8:10 -#launch ".tar.gz" \ -# "gzip -cd %C|tar tvf -" 0,0:1,2-'/',2'/',3,7,4,5,6,8:10 -#launch ".tar.bz2" \ -# "bzip2 -cd %C|tar tvf -" \ -# 0,0:1,2-'/',2'/',3,7,4,5,6,8:10 -#launch ".taZ" "zcat %C|tar tvf -" 0,0:1,2-'/',2'/',3,7,4,5,6,8:10 -#launch ".taz" "gzip -cd %C|tar tvf -" 0,0:1,2-'/',2'/',3,7,4,5,6,8:10 -#launch ".tgz" "gzip -cd %C|tar tvf -" 0,0:1,2-'/',2'/',3,7,4,5,6,8:10 +#launch ".lzh" "lha l" \ +# -f "%a %u/%g %s %x %m %d %{yt} %*f" \ +# -f "%9a %u/%g %s %x %m %d %{yt} %*f" \ +# -i " PERMSSN * UID*GID *" \ +# -i "----------*" \ +# -i " Total * file* ???.*%*" \ +#launch ".tar" "tar tvf" \ +# -f "%a %u/%g %s %m %d %t %y %*f" \ +# -f "%a %u/%g %s %y-%m-%d %t %*f" \ +# -f "%a %l %u %g %s %m %d %{yt} %*f" \ +# -f "%10a %u/%g %s %m %d %t %y %*f" \ +# -f "%9a %u/%g %s %m %d %t %y %*f" \ +# -f "%a %u %g %s %m %d %t %y %*f" \ +# -f "%a %u/%g %m %d %t %y %*f" +#launch ".tar.Z" "zcat %C|tar tvf -" \ +# -f "%a %u/%g %s %m %d %t %y %*f" \ +# -f "%a %u/%g %s %y-%m-%d %t %*f" \ +# -f "%a %l %u %g %s %m %d %{yt} %*f" \ +# -f "%10a %u/%g %s %m %d %t %y %*f" \ +# -f "%9a %u/%g %s %m %d %t %y %*f" \ +# -f "%a %u %g %s %m %d %t %y %*f" \ +# -f "%a %u/%g %m %d %t %y %*f" +#launch ".tar.gz" "gzip -cd %C|tar tvf -" \ +# -f "%a %u/%g %s %m %d %t %y %*f" \ +# -f "%a %u/%g %s %y-%m-%d %t %*f" \ +# -f "%a %l %u %g %s %m %d %{yt} %*f" \ +# -f "%10a %u/%g %s %m %d %t %y %*f" \ +# -f "%9a %u/%g %s %m %d %t %y %*f" \ +# -f "%a %u %g %s %m %d %t %y %*f" \ +# -f "%a %u/%g %m %d %t %y %*f" +#launch ".tar.bz2" "bzip2 -cd %C|tar tvf -" \ +# -f "%a %u/%g %s %m %d %t %y %*f" \ +# -f "%a %u/%g %s %y-%m-%d %t %*f" \ +# -f "%a %l %u %g %s %m %d %{yt} %*f" \ +# -f "%10a %u/%g %s %m %d %t %y %*f" \ +# -f "%9a %u/%g %s %m %d %t %y %*f" \ +# -f "%a %u %g %s %m %d %t %y %*f" \ +# -f "%a %u/%g %m %d %t %y %*f" +#launch ".taZ" "zcat %C|tar tvf -" \ +# -f "%a %u/%g %s %m %d %t %y %*f" \ +# -f "%a %u/%g %s %y-%m-%d %t %*f" \ +# -f "%a %l %u %g %s %m %d %{yt} %*f" \ +# -f "%10a %u/%g %s %m %d %t %y %*f" \ +# -f "%9a %u/%g %s %m %d %t %y %*f" \ +# -f "%a %u %g %s %m %d %t %y %*f" \ +# -f "%a %u/%g %m %d %t %y %*f" +#launch ".taz" "gzip -cd %C|tar tvf -" \ +# -f "%a %u/%g %s %m %d %t %y %*f" \ +# -f "%a %u/%g %s %y-%m-%d %t %*f" \ +# -f "%a %l %u %g %s %m %d %{yt} %*f" \ +# -f "%10a %u/%g %s %m %d %t %y %*f" \ +# -f "%9a %u/%g %s %m %d %t %y %*f" \ +# -f "%a %u %g %s %m %d %t %y %*f" \ +# -f "%a %u/%g %m %d %t %y %*f" +#launch ".tgz" "gzip -cd %C|tar tvf -" \ +# -f "%a %u/%g %s %m %d %t %y %*f" \ +# -f "%a %u/%g %s %y-%m-%d %t %*f" \ +# -f "%a %l %u %g %s %m %d %{yt} %*f" \ +# -f "%10a %u/%g %s %m %d %t %y %*f" \ +# -f "%9a %u/%g %s %m %d %t %y %*f" \ +# -f "%a %u %g %s %m %d %t %y %*f" \ +# -f "%a %u/%g %m %d %t %y %*f" #(Examples) -#launch ".zip" "unzip -lqq" 0,0:0,0,0,1,2[7],2-'-',2'-'-'-',3,4 -#launch ".zoo" "zoo lq" 0,0:0,0,0,1,0,5,4,7-'+',8 +#launch ".zip" "unzip -lqq" " %s %m-%d-%y %t %*f" +#launch ".zoo" "zoo lq" " %s %x %x %d %m %y %t %*f" +#launch ".rar" "unrar v" \ +# -f " %*f\n%s %x %x %d-%m-%y %t %a" \ +# -i "UNRAR *" \ +# -i "RAR *" \ +# -i "Shareware version *" \ +# -i "Verifying authenticity *" \ +# -i "Solid archive *" \ +# -i "Archive *" \ +# -i "Pathname/Comment" \ +# -i "Size * Packed *" \ +# -i "----------*" \ +# -i "* * * ??%" \ +# -i "Old style *" \ +# -i "Archive *.rar" \ +# -i "created at ??:??:?? *" \ +# -i "by * *" \ +# -i "" #launch ".Z" "zcat %C|$PAGER" #launch ".gz" "gzip -cd %C|$PAGER" #launch ".bz2" "bzip2 -cd %C|$PAGER" # examples for MS-DOS -#launch ".lzh" "lha v %S" 5,2:0,0,0,2,5-'-',5'-'-'-',5[7],6,1::2 -#launch ".tar.Z" \ -# "gzip -cd %S|tar tvf -" 0,0:1,2-'/',2'/',3,7,4,5,6,8 -#launch ".tar.gz" \ -# "gzip -cd %S|tar tvf -" 0,0:1,2-'/',2'/',3,7,4,5,6,8 -#launch ".tar.bz2" \ -# "bzip2 -cd %S|tar tvf -" \ -# 0,0:1,2-'/',2'/',3,7,4,5,6,8 -#launch ".taz" "gzip -cd %S|tar tvf -" 0,0:1,2-'/',2'/',3,7,4,5,6,8 -#launch ".tgz" "gzip -cd %S|tar tvf -" 0,0:1,2-'/',2'/',3,7,4,5,6,8 -#launch ".zip" "unzip -lqq %S" 0,0:0,0,0,1,2-'-',2'-'-'-',2[7],3,4 -#launch ".zip" "pkunzip -vb %S" 14,2:0,0,0,1,5-'-',5'-'-'-',5[7],6,7 +#launch ".lzh" "lha v %S" % +# -f "%*f\n%s %x %x %y-%m-%d %t %a" % +# -f "%1x %12f %s %x %x %y-%m-%d %t %a" % +# -i "Listing of archive : *" % +# -i " Name Original *" % +# -i "--------------*" % +# -i "* files * ???.?%%%% ??-??-?? ??:??:??" % +# -i "" +#launch ".tar.Z" "gzip -cd %S|tar tvf -" % +# -f "%a %u/%g %s %m %d %t %y %*f" % +# -f "%a %u/%g %s %y-%m-%d %t %*f" % +# -f "%a %u/%g %s %m %d %y %t %*f" % +#launch ".tar.gz" "gzip -cd %S|tar tvf -" % +# -f "%a %u/%g %s %m %d %t %y %*f" % +# -f "%a %u/%g %s %y-%m-%d %t %*f" % +# -f "%a %u/%g %s %m %d %y %t %*f" % +#launch ".tar.bz2" "bzip2 -cd %S|tar tvf -" % +# -f "%a %u/%g %s %m %d %t %y %*f" % +# -f "%a %u/%g %s %y-%m-%d %t %*f" % +# -f "%a %u/%g %s %m %d %y %t %*f" % +#launch ".taz" "gzip -cd %S|tar tvf -" % +# -f "%a %u/%g %s %m %d %t %y %*f" % +# -f "%a %u/%g %s %y-%m-%d %t %*f" % +# -f "%a %u/%g %s %m %d %y %t %*f" % +#launch ".tgz" "gzip -cd %S|tar tvf -" % +# -f "%a %u/%g %s %m %d %t %y %*f" % +# -f "%a %u/%g %s %y-%m-%d %t %*f" % +# -f "%a %u/%g %s %m %d %y %t %*f" % +#launch ".zip" "unzip -lqq %S" " %s %y-%m-%d %t %*f" +#launch ".zip" "pkunzip -vb %S" " %s %x %x %x %y-%m-%d %t %*f" 14 2 # archiver definition #(Default) @@ -178,6 +675,7 @@ #(Examples) #arch ".zip" "zip -q %C %TA" "unzip -q %C %TA" #arch ".zoo" "zoo aq %C %TA" "zoo xq %C %TA" +#arch ".rar" "rar a -inul %C %TA" "unrar x -inul %C %TA" # examples for MS-DOS #arch ".lzh" "lha a %S %TA" "lha x %S %TA" @@ -198,22 +696,52 @@ #bind '{' ROLL_UP #bind '}' ROLL_DOWN #bind '~' "cd ~%N%K" -#bind 'F1' "man fd%N%K" ;Manual +#bind 'F1' "man fd%N%K" :Manual # function definition #(Example1) -#function rename() { \ -# MARK_ALL 0; \ -# MARK_FIND $1; \ -## RENAME_FILE $2; \ -# mv %M $2%K; \ +#rename() { +# MARK_ALL 0 +# MARK_FIND $1 +## RENAME_FILE $2 +# evalmacro mv %M $2 #} # #(Example2: used in archiver definition) -#function maketaz() { \ -# tar cf %X.tar %T; \ -# $1 %X.tar; \ -# mv %X.tar.$2 %X.$3; \ +#maketaz() { +# evalmacro tar cf %X.tar %T +# evalmacro $1 %X.tar +# evalmacro mv %X.tar.$2 %X.$3 +#} +# +#(Example3: ftp browsing) +#getftp() { +# FHOST=$1 +# FPATH= +# browse -@ - <<'EOF0' +# 'ftp -n $FHOST <<-EOF +# user ftp `whoami`@`hostname` +# dir $FPATH +# quit +# EOF' +# -f "%a %l %u %g %s %m %d %{yt} %*f" +# -i "total *" +# -e "Not connected." +# -e "Login incorrect." +# -e "Login failed." +# -p 'FPATH=$1; while [ "$#" -gt 1 ]; do shift; FPATH=$1/$FPATH; done' +# -d loop +# +# 'dir=`readline "Dir: "` && [ -d "$dir" ] \ +# && yesno "copy \"$FPATH\" to \"$dir\" ?" \ +# && ftp -n $FHOST <<-EOF \ +# && echo "copy \"$FPATH\" to \"$dir\"." %K \ +# || echo canceled. +# user ftp `whoami`@`hostname` +# get $FPATH $dir/${FPATH##*/} +# quit +# EOF' +#EOF0 #} # MS-DOS drive definition @@ -222,7 +750,7 @@ # alias definition #(Example) -#alias dir "ls -laF" +#alias dir="ls -laF" # keymap definition #(Example) FD-3.01j/fd.spec100644 2105 1751 11033 13516612560 12144 0ustar shiraiuser%define lang ja %define mansec 1 Summary: a file & directory maintenance tool. Name: FDclone Version: 3.01j Release: 1 Group: System Environment/Shells URL: http://hp.vector.co.jp/authors/VA012337/soft/fd/index.html Source: FD-%{version}.tar.gz BuildRoot: %{_tmppath}/%{name}-%{version}-root Requires: ncurses License: Freeware BuildRequires: gcc BuildRequires: make BuildRequires: sed BuildRequires: tar BuildRequires: gzip BuildRequires: coreutils BuildRequires: glibc BuildRequires: ncurses-devel %description FDclone is a file & directory maintenance tool for the UNIX based OS. It is a clone of "FD" for MS-DOS, made by Mr. A.Idei in 1989. %description(ja) FDclone ¤Ï¡¢1989ǯ¤Ë A.Idei »á¤Î ¼ê¤Ë¤è¤Ã¤Æ MS-DOS ÍѤ˺îÀ®¤µ¤ì¤¿¡Ø£Æ£Ä¡Ù¤òÌϤ·¤¿¡¢UNIX ¥Ù¡¼ ¥¹¤Î OS ÈÆÍѤΥե¡¥¤¥ë & ¥Ç¥£¥ì¥¯¥È¥ê´ÉÍý¥Ä¡¼¥ë¤Ç¤¹¡£ %prep %setup -q -n FD-%{version} %build sed -e '$ {' \ -e 'a \' \ -e '#define DEFKCODE "utf8-iconv"' \ -e 'a \' \ -e '#define UTF8DOC' \ -e '}' \ config.hin > config.h make PREFIX=%{_prefix} CONFDIR=%{_sysconfdir} LANG=%{lang} sed -e '/# launcher definition/,/^$/ {' \ -e '/^$/ {' \ -e 'i \' \ -e 'launch ".rpm" "rpm2cpio %C|cpio -tv" "%a %l %u %g %s %m %d %{yt} %*f"' \ -e '}' \ -e '}' \ -e '/# archiver definition/,/^$/ {' \ -e '/^$/ {' \ -e 'i \' \ -e 'arch ".rpm" "clear; echo ERROR; false" "rpm2cpio %C|cpio -id %TA"' \ -e '}' \ -e '}' \ _fdrc > fdrc %install rm -rf $RPM_BUILD_ROOT mkdir -p $RPM_BUILD_ROOT/%{_bindir} mkdir -p $RPM_BUILD_ROOT/%{_mandir}/man%{mansec} mkdir -p $RPM_BUILD_ROOT/%{_mandir}/%{lang}/man%{mansec} mkdir -p $RPM_BUILD_ROOT/%{_sysconfdir} make BUILD=$RPM_BUILD_ROOT \ BINTOP=%{_bindir} MANTOP=%{_mandir} LANG=%{lang} \ install %clean rm -rf $RPM_BUILD_ROOT %post %files %defattr(-,root,root) %{_bindir}/fd %{_bindir}/fdsh %{_bindir}/fd-unicd.tbl %{_bindir}/fd-dict.tbl %{_bindir}/fd-cat.ja %{_bindir}/fd-cat.C %{_mandir}/man%{mansec}/fd.%{mansec}* %{_mandir}/man%{mansec}/fdsh.%{mansec}* %{_mandir}/%{lang}/man%{mansec}/fd.%{mansec}* %{_mandir}/%{lang}/man%{mansec}/fdsh.%{mansec}* %config %{_sysconfdir}/fd2rc %doc README HISTORY FAQ TECHKNOW Install ToAdmin LICENSES %doc README.eng HISTORY.eng FAQ.eng TECHKNOW.eng Install.eng ToAdmin.eng LICENSES.eng %changelog * Sat Jul 27 2019 Takashi SHIRAI - for 3.01j * Sat May 25 2019 Takashi SHIRAI - for 3.01i * Sat Aug 11 2018 Takashi SHIRAI - for 3.01h * Sat Jun 2 2018 Takashi SHIRAI - for 3.01g * Sat Apr 14 2018 Takashi SHIRAI - for 3.01f * Sat Jan 20 2018 Takashi SHIRAI - for 3.01e * Mon Dec 25 2017 Takashi SHIRAI - for 3.01d * Tue May 6 2014 Takashi SHIRAI - for 3.01b - add BuildRequires fields * Sat Jun 8 2013 Takashi SHIRAI - for 3.01a * Fri Aug 3 2012 Takashi SHIRAI - for 3.01 * Fri Jul 27 2012 Takashi SHIRAI - for 3.00m * Sat Jun 30 2012 Takashi SHIRAI - for 3.00l - change the default Kanji code from EUC-JP to UTF-8 * Sat Apr 21 2012 Takashi SHIRAI - for 3.00k * Sat Sep 25 2010 Takashi SHIRAI - for 3.00j * Sat Jul 24 2010 Takashi SHIRAI - for 3.00i * Mon Jun 14 2010 Takashi SHIRAI - for 3.00h * Fri Jun 4 2010 Takashi SHIRAI - for 3.00g * Sat May 29 2010 Takashi SHIRAI - for 3.00f * Sat Feb 27 2010 Takashi SHIRAI - for 3.00e * Sun Nov 30 2008 Takashi SHIRAI - for 3.00d * Sun Jul 27 2008 Takashi SHIRAI - for 3.00c * Sun Jul 6 2008 Takashi SHIRAI - for 3.00b * Sat Jun 21 2008 Takashi SHIRAI - for 3.00a * Sat May 31 2008 Takashi SHIRAI - for 3.00 * Thu Apr 26 2007 Takashi SHIRAI - for 2.09d * Fri Mar 16 2007 Takashi SHIRAI - for 2.09c - include fd-dict.tbl in files - change the directory where manuals are installed from /usr/man to %{_mandir} * Tue Jul 7 2004 Takashi SHIRAI - for 2.05g - support the filename in RPM which includes spaces and tabs * Tue Sep 17 2003 Takashi SHIRAI - for 2.04b - extended for portability * Tue Apr 15 2003 Takashi SHIRAI - for 2.03a FD-3.01j/README100644 2105 1751 33501 13516612560 11563 0ustar shiraiuser############################################################ # # FDclone Ver. 3.01 $B$K4X$7$F(B # # Takashi SHIRAI, # Jul 27, 2019 # ############################################################ $B!!(BFDclone $B$O!"(B1989$BG/$K(B A.Idei $B;a(B $B$NeC1$K(B "UNIX" $B$H8F$V(B) $BHFMQ$N%U%!%$%k(B & $B%G(B $B%#%l%/%H%j4IM}%D!<%k$G$9!#(B $B!!;EMMItJ,$K4X$7$F$O!"$G$-$k$@$1%*%j%8%J%k$N!X#F#D!Y$K6aIU$1(B $B$k$h$&$K$7$^$7$?$,!"%$%s%W%j%a%s%H$K4X$7$F$OA4$/$N%*%j%8%J%k(B $B:nIJ$G$9!#(B $B!!%/%m!<%s$H>N$7$F$$$kM}M3$O!"!X#F#D!Y$,M>$j$KIa5Z$7$?$?$a!"(B MS-DOS $B%f!<%6$K$H$C$F$O$3$N(B "FD" $B$H$$$&8F>N$,%U%!%$%k4IM}%D(B $B!<%k$NBeL>;l$H$7$FDjCe$7$F$7$^$C$F$$$k$3$H$K5/0x$7$^$9!#(B $B!!$+$D$F!"I. $B;a:n(B)$B$H$$(B $B$&$b$N$,$"$j$^$7$?$,!"$3$N8x3+8e$NMxMQ>u67$rJ9$$$F$_$k$H!"%7(B $B%'%k$N(B alias $B5!G=$G(B "fd" $B$K2~L>$7$F;H$C$F$$$k$H$$$&%f!<%6$b(B $B$+$J$jB?$+$C$?$H$$$&$3$H$G$9!#(B $B!!(BMS-DOS $B$+$i(B UNIX $B$KF~$C$?%f!<%6$K$H$C$F$O!"%?%$%W$70W$5$b(B $B4^$a$F!"$3$NL>>N$,0lHVFk@w$s$G$$$k$H;W$($^$9!#(B $B!!$H$J$l$P!"$G$-$l$P;EMM>e$b$3$l$K=`$8$?$b$N$r(B UNIX $B>e$G:n$k(B $B$3$H$O!"(BMS-DOS $B%f!<%6=P?H$N(B UNIX $B=i?4e$N$h$&$JM}M3$+$i!"$3$N(B FDclone $B$O:n$i$l$^$7$?!#ESCf!"(B $BD9$-JQA+$H6lFq$NF;$r7P$O$7$^$7$?$,!"$h$&$d$/40@.$N1?$S$H$J$j(B $B8x3+$K$3$.Ce$1$k$3$H$H$J$j9,$$$G$9!#(B -- $B!!(BFDclone-3.01 $B$N%Q%C%1!<%8$K$O!"0J2<$N%U%!%$%k$,4^$^$l$^$9!#(B README $B$3$N%U%!%$%k(B README.eng $B$3$N%U%!%$%k(B ($B1QJ8(B) HISTORY $B$3$l$^$G$N2~DjMzNr(B HISTORY.eng $B$3$l$^$G$N2~DjMzNr(B ($B1QJ8(B) FAQ Q&A $B=8(B (Frequently Asked Question) FAQ.eng Q&A $B=8(B (Frequently Asked Question, $B1QJ8(B) TECHKNOW $B%F%/%K%+%k%N%&%O%&(B TECHKNOW.eng $B%F%/%K%+%k%N%&%O%&(B ($B1QJ8(B) LICENSES $B8"Mx5,Dj$K4X$9$k%I%-%e%a%s%H(B LICENSES.eng $B8"Mx5,Dj$K4X$9$k%I%-%e%a%s%H(B ($B1QJ8(B) Install FDclone $B$N%$%s%9%H!<%kJ}K!$N%I%-%e%a%s%H(B Install.eng FDclone $B$N%$%s%9%H!<%kJ}K!$N%I%-%e%a%s%H(B ($B1QJ8(B) ToAdmin FDclone $B$r1?MQ$9$k4IM}A`:n$K4X$9$k%b%8%e!<%k(B pathname.h pathname.c $BMQ$N%X%C%@(B system.c /bin/sh $B8_49$N(B system(3) $BAjEv%b%8%e!<%k(B system.h system.c $BMQ$N%X%C%@(B posixsh.c system.c $B$G;H$&(B POSIX $B8_49%3%^%s%I(B posixsh.h posixsh.c $BMQ$N%X%C%@(B doscom.c system.c $B$G;H$&(B COMMAND.COM $BFbIt%3%^%s%I(B log.c $B%m%0%U%!%$%k4XO"(B log.h log.c $BMQ$N%X%C%@(B dosdisk.c $B%U%m%C%T!<%I%i%$%V%I%i%$%PItJ,(B dosdisk.h dosdisk.c $BMQ$N%X%C%@(B sysemu.c $B%7%9%F%`4X?t72$N%U%m%C%T!<%I%i%$%VBP1~HG(B sysemu.h sysemu.c $BMQ$N%X%C%@(B unixdisk.c MS-DOS $BMQ%U%!%$%k@)8f4X?t72(B unixdisk.h unixdisk.c $BMQ$N%X%C%@(B realpath.c $B@dBP%Q%9$N@55,2=(B realpath.h realpath.c $BMQ$N%X%C%@(B encode.c MD5 (RFC1321) $B5Z$S(B BASE64 (RFC3548) $B4XO"(B encode.h encode.c $BMQ$N%X%C%@(B pty.c $B5?;wCpJs4XO"(B mntinfo.h mntinfo.c $BMQ$N%X%C%@(B statfs.c statfs() $B$NCV49$((B apply.c $B%U%!%$%k$X$NO"B3E,MQ4XO"(B parse.c $BJ8;zNs2r@O4XO"(B parse.h parse.c $BMQ$N%X%C%@(B builtin.c $BAH9~$_%3%^%s%I4XO"(B shell.c $B%7%'%k%3%^%s%I4XO"(B socket.c $B%=%1%C%H4X?t4XO"(B socket.h socket.c $BMQ$N%X%C%@(B url.c URL $B%Q!<%6(B url.h url.c $BMQ$N%X%C%@(B auth.c $BG'>Z(B (RFC2617) $B4XO"(B auth.h auth.c $BMQ$N%X%C%@(B ftp.c FTP (RFC959) $B4XO"(B html.c HTML (RFC2616) $B4XO"(B html.h html.c $BMQ$N%X%C%@(B http.c HTTP $B4XO"(B urldisk.c URL $B%I%i%$%V%I%i%$%PItJ,(B urldisk.h urldisk.c $BMQ$N%X%C%@(B catalog.c $B%a%C%;!<%8%+%?%m%04XO"(B catalog.h catalog.c $BMQ$N%X%C%@(B kconv.c $B4A;z%3!<%I%3%s%P!<%H4XO"(B kconv.h kconv.c $BMQ$N%X%C%@(B input.c $B%f!<%6F~NO4XO"(B ime.c $B4J0WF|K\8l(B IME roman.c $B%m!<%^;z$+$JJQ494XO"(B roman.h roman.c $BMQ$N%X%C%@(B dict.c $B4A;z<-=q8!:w4XO"(B hinsi.h $BIJ;lJ8K!MQ$N%X%C%@(B info.c $B3FpJsI=<(MQ(B rockridg.c ISO 9660 RockRidge $B3HD%4XO"(B lsparse.c $B%U%!%$%k0lMw=PNO$N%Q!<%6(B lsparse.h lsparse.c $BMQ$N%X%C%@(B archive.c $B%"!<%+%$%P4XO"(B tree.c $B%D%j!pJs$K4X$9$k%X%C%@(B device.h $B%G%P%$%9(B ID $BMQ%X%C%@(B func.h $B%W%m%H%?%$%W@k8@(B functabl.h $BFbIt%3%^%s%I$NB0@-Dj5AMQ(B kanji.hin $BF|K\8lJ8;zNs$N%=!<%9(B (JIS$BHG(B) version.h $B%P!<%8%g%s(B _fdrc .fd2rc $B$N$* ] $B$,(B $BJ];}$7$^$9!#C"$7!"A4$F$N%=!<%9$NG[I[!"2~JQ!"0zMQ!"(B2 $B$G$9$N$G!"<+M3$K:FMxMQ$7$F2<$5$$!#(B $B!!C"$7!"(BFDclone $B$NMxMQ!&G[I[$K@)8B$r2C$($F$7$^$&$h$&$J9T0Y!"(B $BNc$($P!"L5CG$G(B FDclone $B$K4X$9$k%Q%F%s%H?=@A$r9T$J$&$H$$$C$?(B $B$3$H$O!"%U%j!<%=%U%H%&%'%"$NM}G0$KH?$9$k9T0Y$H$J$k$N$G!"0l@Z(B $B$3$l$r6X;_$5$;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Open $B$N8"Mx$r?/32$9$kL\E*$G$O$J$/!"$3$l$i$rAm>N(B $B$9$k8F>N$,>C<:$7$F$7$^$C$?$3$H$K5/0x$9$k!"JX59>e$NI=8=$G$"$k(B $B$3$H$r$4M}2r2<$5$$!#(B -- $Bl$rNN,!"%"%k%U%!%Y%C%H=g!"!V(B@$B!W$r!V(B at $B!W$K$FI=5-(B) $B!&!X#F#D!Y$N:nh$C$F(B $B!!D:$-$^$7$?!#(B kenji at reseau.toyonaka.osaka.jp (Kenji Rikitake) mori at chuo-computer.co.jp ($B?9!!=(OB(B) ohm at kyoto.wide.ad.jp ($B?9Eg98G/(B) saitoh at ics.es.osaka-u.ac.jp ($BsnF#L@5*(B) $B!&&B%F%9%HMQ(B ML $B$N4IM}1?1D$rC4Ev$7$FD:$-$^$7$?!#(B matusita at ics.es.osaka-u.ac.jp (Makoto MATSUSHITA) $B!&(Bfj.sources.d $B$G$NJg=8$reLnJ8M5(B) aki at pic.hitachi-sk.co.jp (Akiyoshi Sakaguchi) ao at orient.tuins.cs.toyo.ac.jp (AOYAGI Yoichi) daikoku at lang2.bs1.fc.nec.co.jp ($BBg9uMN;K(B) fuku at amorph.rim.or.jp (FUKUSHIMA Osamu) go at cclub.tutcc.tut.ac.jp (Go Watanabe) h-inoue at is.aist-nara.ac.jp (Hiroyuki Inoue) h-yagi at zero0.nsis.cl.nec.co.jp ($BH,LZ1QM:(B) hashi at star.rcast.u-tokyo.ac.jp (TAKAHASHI Katsuyuki) hide at mamoru.ee.sophia.ac.jp (Takahide Yamaguchi) hiro at akinus1.aki.che.tohoku.ac.jp (Akiyasu Hirotani) i4579 at info.nara-k.ac.jp (Kimura Masashi) ishida at econ.shinshu-u.ac.jp (Akira Ishida) ito at getz.isc.chubu.ac.jp (Maki ITO) j0442 at cranesv.egg.kushiro-ct.ac.jp (Kazunori Yoshida) j9194169 at ed.yama.sut.ac.jp (Keitarou Yoshimura) jt at ng.nefs.nec.co.jp (Jiro_Takabatake) katsu at cs.uec.ac.jp ($BNkLZ9nL@(B(Katsuaki Suzuki)) ke3057yt at ex.ecip.osaka-u.ac.jp (yosioka tuneo) kimai at av.crl.sony.co.jp (IMAI Kenichi) kjm at yonka.ngy.mhi.co.jp (KOJIMA Hajime/ $B>.EgH%(B) kkubota at crl.go.jp (Kazuo Kubota) kmiya at mm.rd.nttdata.jp (Kunio Miyamoto) kobashi at comp.eng.himeji-tech.ac.jp (kobashi) manabu at saskg.semicon.sony.co.jp (Niizato -Gamer- Manabu) mat at azalea.gose.nara.jp (Matsuo Kazunori) mats at cc.tuat.ac.jp (Seiji Matsumoto) mhirano at avkk.yamaha.co.jp (Mitsuyuki HIRANO) mino at kis-gw.msk.kis.co.jp (MINOMO Kazutoshi) mori at isc.mew.co.jp (Shigeki Morimoto) nino at windy.mech.utsunomiya-u.ac.jp (Nao NINOMIYA) nyoshi at kaba.or.jp (YOSHIDA Nobuaki) ohge at enzan.ee.kansai-u.ac.jp (Hiroki Ohge) ohishi at otc.qnes.nec.co.jp (Isao Ohishi) okubo at mem.cl.nec.co.jp (Shuichi OHKUBO) ozawa at prince.pe.u-tokyo.ac.jp roy at lit.cs.uec.ac.jp (SATOU Masaki / $B:4F#2m5,(B) ryoji at kgupyr.kwansei.ac.jp (Ryoji Nagai) sakai at csl.cl.nec.co.jp (Junji SAKAI) sakanaga at ds.kyoto.omronsoft.co.jp (Toshiyuki Sakanaga) sawada at h3news1.kais.kyoto-u.ac.jp (Yutaka SAWADA) senshu at astro.yamagata-cit.ac.jp (Hiroyuki Senshu / $B@i=)(B) shige at luck.imasy.or.jp (Shigechika Aikawa) shirai at atropos.gen.u-tokyo.ac.jp (Izuru Shirai) taka-mm at super.win.or.jp (Takahasi Mamoru) tan at kei-n.huap.hokudai.ac.jp (Takushi Tanaka) tanaka at inf.ptg.sony.co.jp ("T.Tanaka") tomiyan at cv.sony.co.jp ($BIYED(B $B8wI'(B) tsuka at ohsaki.meidensha.co.jp (Yoshihiro Tsukamoto) uno at meleager.mel.go.jp wakui at casiogw.rd.casio.co.jp (WAKUI Kazuhiko) watanabe at jis.ptg.sony.co.jp (ebaN) yajima at ccedu.sendai-ct.ac.jp (Kuniaki YAJIMA) yaku at jedi.seg.kobe-u.ac.jp (Masao Yakushijin) yamakawa at crdl.pioneer.co.jp (Yuzo Yamakawa) yamamoto at ogw.ei.hosei.ac.jp (Kouya Yamamoto) FD-3.01j/HISTORY100644 2105 1751 164607 13516612560 12023 0ustar shiraiuserVer. 3.01j $B%7%s%\%j%C%/%j%s%/%3%T!<;~$KAjBP%Q%9$,@dBP%Q%9$K$J$kE@$r=$@5!#(B (07/27/19) $B%7%s%\%j%C%/%j%s%/@h$N4A;z%3!<%IJQ49$K<:GT$7$F$$$?E@$r=$@5!#(B Ver. 3.01i Android 9.0 $BBP1~!#(B (05/25/19) clang $B$G%/%m%9%3%s%Q%$%k$K<:GT$9$k$3$H$,$"$kE@$r=$@5!#(B Ver. 3.01h $B%U%!%$%kL>%3!<%IJQ49;~$K(B UTF-8 $B%F!<%V%k$,0lBP0l$rJ]$D$h$&=$@5!#(B (08/11/18) $B0l$DA0$N%8%g%V$,%+%l%s%H%8%g%V$K$J$l$J$$E@$r=$@5!#(B $B30It%3%^%s%I$N=*N;$dDd;_;~$K=PNO$r<:$&$3$H$,$"$kE@$r=$@5!#(B Ver. 3.01g WSL $B4D6-$G%U%!%$%k%7%9%F%`>pJs$,I=<($G$-$J$$E@$r=$@5!#(B (06/02/18) $B%(%i!<%a%C%;!<%8I=<($,GKB;$7$F$$$?E@$r=$@5!#(B $BFbB"%7%'%k$GIT@5$K9=J8%(%i!<$r@8$8$5$;$F$$$?E@$r=$@5!#(B $B0lItAH9~$_%3%^%s%I$ro=*N;$9$kE@$r=$@5!#(B (05/06/14) Linux kernel 2.6.23 $B0J9_$G%^%/%mE83+$K<:GT$9$kE@$r=$@5!#(B bind $B$G%^%/%m3dEv$F$N>e=q$-$K<:GT$9$kE@$r=$@5!#(B $BAH9~$_%3%^%s%I$H(B %M $B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$B%$%s%9%H!<%kMQ$K(B mkdir_p.c $B$rDI2C!#(B (02/27/10) Cygwin 1.7.1 $BBP1~!#(B $BHs(B ANSI C $B4D6-$G%3%s%Q%$%k$K<:GT$9$k$3$H$,$"$kE@$r=$@5!#(B Ver. 3.00d $B0lIt$N4D6-$G%U%!%$%kL>Jd40;~$K%U%j!<%:$9$kE@$r=$@5!#(B (11/30/08) su(1) $B7PM3$G(B login shell $B$H$7$F;HMQ;~$N5/F0%Q%9G'<1%_%9$r=$@5!#(B $BFbItJQ?t(B HISTSIZE $B$KBg$-$JCM$r@_Dj$9$k$H%U%j!<%:$9$kE@$r=$@5!#(B $BAH9~$_%3%^%s%I(B echo $B$,(B - $B$G;O$^$kJ8;zNs$rL5;k$7$F$$$?E@$r=$@5!#(B $B0lIt$N(B VT100 $B8_49Co=*N;$9$kE@$r=$@5!#(B URL $B%I%i%$%V$N(B directory traverse $BLdBj$KBP=h!#(B FTP $BDL?.;~$N(B telnet $B%3%^%s%I~;R$NDI2C!#(B $B%a%C%;!<%8%+%?%m%05!G=$NDI2C!#(B $B3Fe8B$rE1GQ!#(B EDIT_CONFIG $B$,0z?t$KFbItJQ?tL>$r;XDj2DG=$K!#(B $BFbItJQ?t(B AUTOUPDATE $B$NDI2C!#(B $BFbItJQ?t(B VERSION $B$NDI2C!#(B $BFbItJQ?t(B URLDRIVE, URLKCODE, HIDEPASSWD $B$NDI2C!#(B $BFbItJQ?t(B URLOPTIONS, URLTIMEOUT $B$NDI2C!#(B $BFbItJQ?t(B FTPPROXY, FTPLOGFILE, FTPADDRESS $B$NDI2C!#(B $BFbItJQ?t(B HTTPPROXY, HTTPLOGFILE $B$NDI2C!#(B $BFbItJQ?t(B HTMLLOGFILE $B$NDI2C!#(B $BAH9~$_%3%^%s%I(B accept, socketinfo, addcr $B$NDI2C!#(B $BAH9~$_%3%^%s%I(B echo $B$K(B -N $B%*%W%7%g%s$NDI2C!#(B $BAH9~$_%3%^%s%I(B read $B$K(B -N $B%*%W%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d40$KBP1~!#(B $B0lIt$N(B OS $B8~$1$K(B Large File Summit (2GB $BD6%U%!%$%k(B) $BBP1~!#(B $B%U%!%$%k%5%$%:$NI=<(7e?t@)8B$r3HD%!#(B System V $BMQ$KCV49$(4X?t$rMQ0U!#(B $B0lIt(B System V $B$G;R%W%m%;%9c$,$"$C$?E@$r=$@5!#(B $B%7%s%\%j%C%/%j%s%/$r@5$7$/C)$l$J$$>l9g$,$"$C$?E@$r=$@5!#(B fdsh $B$G$N%U%m%C%T!<%I%i%$%V4A;z%3!<%I$N07$$%_%9$r=$@5!#(B $B0lIt$N4D6-$G$N%G%#%l%/%H%j=q9~$_ITNI$r=$@5!#(B Ver. 2.03b $B%3%^%s%I0z?t0J30$N2U=j$K(B %T, %M $B%^%/%m$r;H$($J$+$C$?E@$r=$@5!#(B (05/15/03) $B%U%m%C%T!<%I%i%$%V$NF|K\8l%U%!%$%kL>$,FI$a$J$+$C$?E@$r=$@5!#(B $B%U%m%C%T!<%I%i%$%V$N%G%#%l%/%H%j=q9~$_$,$G$-$J$+$C$?E@$r=$@5!#(B directory $BFb$K(B symbolic link $B$,$"$k$H0[>o=*N;$7$F$$$?E@$r=$@5!#(B System V $B$N?.Mj@-$N$J$$(B signal() $B$KBP=h!#(B $B6uJQ?t$KBP$7(B ${%}, ${#} $B$,$*$+$7$JCM$rJV$7$F$$$?E@$r=$@5!#(B Ver. 2.03a $B%+%i!$K1Q?t;z0J30$r;H$($F$7$^$C$F$$$?E@$r=$@5!#(B $B%+%l%s%H%G%#%l%/%H%jAS<:;~$N;Y>c$r=$@5!#(B Ver. 2.03 $BAH9~$_%3%^%s%I(B browse $B$NDI2C!#(B (03/26/03) $BAH9~$_%3%^%s%I(B readline, yesno $B$NDI2C!#(B $BFbItJQ?t(B ANSIPALETTE $B$NDI2C!#(B $BFbItJQ?t(B TMPUMASK $B$NDI2C!#(B $BAH9~$_%3%^%s%I(B launch $B$K(B -f, -i, -e, -t, -b $B%*%W%7%g%s$NDI2C!#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%"!<%+%$%V%U%!%$%k05=L?-D9$r2DG=$K!#(B (12/25/02) $B0l;~%U%!%$%k$N%G%#%l%/%H%jL>$rMp?t$G@8@.$9$k$h$&2~NI!#(B EXECUTE_SH $B$G0lIt$NFbIt%3%^%s%Io=*N;$9$kE@$r=$@5!#(B $B%U%!%$%kB0@-JQ99;~$K0lIt$N(B OS $B$G0[>o=*N;$7$F$$$?E@$r=$@5!#(B Ver. 2.02 $BAH9~$_%3%^%s%I(B pushd, popd, dirs $B$NDI2C!#(B (11/26/02) $BAH9~$_%3%^%s%I(B cd, pwd $B$K(B -L, -P $B%*%W%7%g%s$NDI2C!#(B $BAH9~$_%3%^%s%I(B set $B$K(B -o physical $B%*%W%7%g%s$NDI2C!#(B %JA $B%^%/%m$NDI2C!#(B $BFbItJQ?t(B MAIL, MAILPATH, MAILCHECK $B$NDI2C!#(B POSIX $B$K9g$;$FCV49(B ${#foo}, ${foo%bar}, ${foo#bar} $B$NDI2C!#(B POSIX $B$K9g$;$FE83+I=8=(B $(command), $((expression)) $B$NDI2C!#(B $BAH9~$_%3%^%s%I(B dtype $B$NDI2C!#(B(MS-DOS $BHG(B) $BAH9~$_%3%^%s%I(B dir $B$K(B /S, /4 $B%*%W%7%g%s$NDI2C!#(B(MS-DOS $BHG(B) fdsh $B$N%3%^%s%I%i%$%sF~NOD9$r(B 2 $B9T$+$i(B 255 $BJ8;z$K3HBg!#(B $B%;%-%e%j%F%#$N$?$a0l;~%U%!%$%kL>$rMp?t$G@8@.$9$k$h$&$K2~NI!#(B $B%U%m%C%T!<%I%i%$%V>e$K!V(B.$B!W!V(B..$B!W$,8=$l$J$$%P%0$r=$@5!#(B $B%R%"%I%-%e%a%s%H(B(<<) $B$,%9%F!<%H%a%s%HFb$G;H$($J$$%P%0$r=$@5!#(B $B%U%m%C%T!<%I%i%$%V$r0z?t$K$7$F5/F0$9$k$H%Q%9$,2u$l$kE@$r=$@5!#(B $B@h9T%U%!%$%kI=<(;~$K0lIt$N%3%^%s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=$@5!#(B Ver. 2.01 POSIX $B$K9g$;$F(B true/false/command/getopts/newgrp/fc $B$NDI2C!#(B (05/08/02) POSIX $B$K9g$;$F(B set $B$K(B -o, -b, -C option $B$NDI2C!#(B -C option $B$KH<$$%j%@%$%l%/%H5-=R;R(B >|, &>| $B$NDI2C!#(B $B%j%@%$%l%/%H5-=R;R(B &>> $B$NDI2C!#(B $BAH9~$_%3%^%s%I(B login, logout, disown $B$NDI2C!#(B $B%3%^%s%I6h@Z$j;R(B &| $B$NDI2C!#(B $B=>Mh$N%Q%$%W5-=R;R(B &| $B$r(B |& $B$KJQ99!#(B $BC(B COLUMNS $B$r(B DEFCOLUMNS $B$K2~L>!#(B ANSI.SYS $B$K0MB8$;$:F0:n2DG=$K$7$?!#(B(MS-DOS $BHG(B) Windows NT $B$G(B .. $B$,I=<($5$l$J$$E@$r=$@5!#(B(MS-DOS $BHG(B) Windows 2000/XP $B$G(B LFN $B$,I=<($G$-$J$$E@$r=$@5!#(B(MS-DOS $BHG(B) $B%R%9%H%jHV9f$N;2>H%_%9$r=$@5!#(B $BAH9~$_%3%^%s%I(B evalmacro $B$,@5>o=*N;$7$J$$E@$r=$@5!#(B %J $B%^%/%m$G0O$^$l$?Cf$K(B %M $B%^%/%m$r5-=R$G$-$J$+$C$?E@$r=$@5!#(B %T $B%^%/%m$ND>A0D>8e$N5-=R$,7+JV$7E83+$5$l$J$+$C$?E@$r=$@5!#(B trap 0 $B$,=*N;;~0J30$K5/F0$7$F$7$^$&$3$H$,$"$kE@$r=$@5!#(B $B;R%W%m%;%9$N=*N;%9%F!<%?%9$rJd40;~$K0[>o=*N;$9$k$3$H$,$"$kE@$r=$@5!#(B [] $B$,%I%C%H%U%!%$%k$K%^%C%A$7$F$$$?E@$r=$@5!#(B case $B%j%9%H=*C<$N(B ;; $B$,>JN,$G$-$J$+$C$?E@$r=$@5!#(B alias $B$K;H$($kJ8;z2A%_%9$r=$@5!#(B ADJTTY $B$,>o$KM-8z$K$J$C$F$7$^$C$F$$$?E@$r=$@5!#(B mount option $B$N(B readonly $BB0@-8!CN%_%9$r=$@5!#(B $BO"B3$9$k(B wild card $B$NE83+%_%9$r=$@5!#(B Ver. 2.00a HP-UX $BMQ$KJd408uJd0lMw$NI=<(0LCV$,$*$+$7$$E@$r=$@5!#(B $B%+%i%`?t$,(B 255 $B$r1[$($kCe=q$-$G$-$J$$E@$r=$@5!#(B $B3F4A;z%3!<%I$NF0E*JQ99$r(B FNAMEKCODE $B$K$h$j2DG=$K!#(B $B@h9T%U%!%$%kI=<(5!G=$r(B PRECEDEPATH $B$K$h$j2DG=$K!#(B $BAH9~$_%3%^%s%I(B checkid, kconv, evalmacro $B$NDI2C!#(B $B%"!<%+%$%V%V%i%&%6EPO?%U%)!<%^%C%H$r%^%/%mJ8;zNs2=!#(B $B%U%!%$%k%3%T!Aw!W%b!<%I$rDI2C!#(B $B%U%!%$%kL>Hf3S;~$NBgJ8;z>.J8;z$r(B IGNORECASE $B$GA*Br2DG=$K!#(B $B%3%T!<;~$N%?%$%`%9%?%s%W7Q>5$r(B INHERITTIME $B$GA*Br2DG=$K!#(B $B0[$J$k%U%!%$%k%7%9%F%`4V$N%G%#%l%/%H%j0\F0$r2DG=$K!#(B $B%+%l%s%H%G%#%l%/%H%j$X$N%G%#%l%/%H%j%3%T!<$r2DG=$K!#(B VT100 $B8_49$NCe=q%b!<%I$rDI2C!#(B $BJ8;zNsF~NO$KBgJ8;z>.J8;zJQ995!G=$rDI2C!#(B $B1QJ8%I%-%e%a%s%H$rF1:-!#(B RRPATH $BEy$N(B delimiter $B$r(B ';' $B$+$i(B ':' $B$KJQ99!#(B alias $B%3%^%s%I$N=q<0;EMMJQ99!#(B bind $B%3%^%s%I$N%3%a%s%H<1JL;R$r(B ';' $B$+$i(B ':' $B$KJQ99!#(B setdrv $B%3%^%s%I$N6h@Z$j;R(B ',' $B$rGQ;_!#(B shell $B4X?t$No=*N;$9$k$3$H$,$"$kE@$r=$@5!#(B (12/18/01) \ $B$r4^$`J8;zNs$N=hM}%_%9$r=$@5!#(B $BCAw%b!<%IHs8_494D6-$KBP1~!#(B $BFbIt%3%^%s%I$r%U%!%$%kL>Jd40BP>]$KDI2C!#(B $B$=$NB>(B Bugfix$B!#(B Ver. 1.03s $B%G%#%l%/%H%j0\F0;~$K0[>o=*N;$9$k$3$H$,$"$k;Y>c$r=$@5!#(B (05/22/01) $B%3%^%s%IF~NO9T$N0zMQId$N07$$$,$*$+$7$$E@$r=$@5!#(B Ver. 1.03r ANSICOLOR=2 $B$N;~$K2hLL$,Mp$l$k;Y>c$r=$@5!#(B (04/03/01) $B5/F0;~;XDj%G%#%l%/%H%j$,L5$$>l9g$K0[>o=*N;$9$k;Y>c$r=$@5!#(B $B%U%k%Q%9$GG<$a$i$l$?%"!<%+%$%V%U%!%$%k$N=hM}%_%9$r=$@5!#(B Solaris 8 $B$N(B compiler $B;EMM$NMI$l$KBP1~!#(B Ver. 1.03q $B=hM}9bB.2=$N$?$a4A;z%3!<%IJQ49$r(B table $B2=!#(B (02/28/01) Linux/Alpha $BBP1~!#(B $B%3%T!<@hMFNLITB-;~$N:F;n9T$rA*Br2DG=$K!#(B $B%+!<%=%k0LCV$N4IM}$r87L)$K!#(B $B3HD%;R=g%=!<%H$NHf3S%k!<%k$N2~NI!#(B $B%U%!%$%k:o=|3NG'$K$D$$$F$N;Y>c$r=$@5!#(B $B%3%T!<;~$N(B timestamp $BJ]B8$r$h$j87L)$K(B (MS-DOS $BHG(B)$B!#(B Ver. 1.03p HDD $B%U%m%C%T!<%I%i%$%V5!G=$N(B Solaris for Intel $BBP1~!#(B (11/11/00) LSI C-86 $BBP1~$NBP>]$r(B 3.30 $B$+$i(B 3.5 $B$KJQ99(B (MS-DOS $BHG(B)$B!#(B $B%U%m%C%T!<%I%i%$%V>pJspJs;2>H%b!<%I$NI=<(%_%9$r=$@5!#(B $B4X?tFb$N(B $1, $2, ... $B$NE83+%_%9$r=$@5!#(B $B%9%F!<%?%99T$N(B symbolic link $B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|LdBj$r(B FAQ, TECHKNOW $B$KDI2C!#(B $B6u%G%#%l%/%H%j$G(B WRITE_DIR $B$,0[>o=*N;$7$F$$$?E@$r=$@5!#(B $B%3%^%s%I%i%$%s9TKv$NF|K\8lJ8;z=hM}$NLdBj$r=$@5!#(B Ver. 1.03k Linux $B$G(B HDD $B%U%m%C%T!<%I%i%$%V5!G=$,8z$+$J$$E@$r=$@5!#(B (09/01/99) SunOS $B$G(B compile $B$G$-$J$$E@$r=$@5!#(B $B%U%!%$%k0\F0;~$K(B file flags $B$,7Q>5$5$l$J$$E@$r=$@5!#(B $B%3%^%s%I9T$K=EJ#$7$?(B / $B$r5-=R$G$-$J$$E@$r=$@5!#(B BACKUP_TAPE $B%3%^%s%I$,;H$($J$+$C$?E@$r=$@5!#(B PACK_FILE $B$,%U%m%C%T!<%I%i%$%V>e$G;H$($J$+$C$?E@$r=$@5!#(B PACK_FILE $B$r%"!<%+%$%V%V%i%&%6>e$G$b;HMQ2DG=$K!#(B $B5l(B DOS $B$G(B LFN $B%3%T!<$G$-$J$$$3$H$,$"$kE@$r=$@5(B (MS-DOS $BHG(B)$B!#(B $B$=$NB>(B Bugfix$B!#(B Ver. 1.03j $B%U%m%C%T!<%I%i%$%V5!G=$N(B file system $BGK2u%P%0$r=$@5!#(B (03/17/99) $B0lIt4D6-$G(B DEL $B%-!<$,8z$+$J$$E@$r=$@5!#(B $B%U%m%C%T!<%I%i%$%V$N%D%j!pJs9T$NI=<($,$*$+$7$/$J$kE@$r=$@5!#(B $B5l(B DOS $B$G(B LFN $B:o=|;~$K%4%_$,;D$kE@$r=$@5(B (MS-DOS $BHG(B)$B!#(B $B$=$NB>(B Bugfix$B!#(B Ver. 1.03i $B%U%m%C%T!<%I%i%$%V5!G=$N(B HDD $BBP1~!#(B (03/03/99) $B%U%m%C%T!<%I%i%$%V5!G=$N%Q%U%)!<%^%s%98~>e!#(B file mode $BI=<($K(B 'S', 'T' $B$rDI2C!#(B($B@_Dj$OIT2D(B) file flags $BBP1~!#(B($B0lIt(B OS $BMQ(B) Meta key $B$X$N%3%^%s%I3dEv$r2DG=$K!#(B keymap $BJ8;zNs$K(B ^@ $B$r5-=R2DG=$K!#(B .fdrc.$TERM $B$NL58B:F5"FI9~$_$rKI;_!#(B $B$=$NB>(B Bugfix$B!#(B Ver. 1.03h $B%a%b%j4IM}$N8zN(2=5Z$S(B Bugfix$B!#(B (08/28/98) FAT32 file system $B%"%/%;%9$K;CDjBP1~!#(B SORTTYPE >= 100 $B$N5!G=$r%"!<%+%$%V%V%i%&%6$G$bM-8z$K!#(B $B%U%m%C%T!<%I%i%$%V>e$K(B . $B$d(B .. $B$r:n$l$F$7$^$&IT6q9g$r=$@5!#(B %ST, %STA, %SM $B%^%/%m$NDI2C(B (MS-DOS $BHG(B)$B!#(B $B%-!<%\!<%I(B BIOS $B$r2p$5$J$$(B Bugfix$B!#(B Ver. 1.03g $B%"!<%+%$%VFb%U%!%$%kL>8!:w5!G=$NDI2C!#(B (02/04/98) %JJ, %JE, %JS $B%^%/%m$NDI2C!#(B $B%9%/%m!<%kHO0O%j%;%C%H$NIT6q9g$r=$@5!#(B $B%$%s%/%j%a%s%?%k%5!<%A$NIT6q9g$r=$@5!#(B ATTR_FILE $B$N0lItF0:nITNI$r2r>C!#(B $B%+%i%`?t$,(B 99 $BJ8;z$r1[$($k2hLL$KBP1~(B (MS-DOS $BHG(B)$B!#(B Ver. 1.03f $B5/F0;~$K%9%/%m!<%kHO0O$r%j%;%C%H$9$k$h$&=$@5!#(B (11/25/97) $B%G%#%l%/%H%jL>KvHx$K(B '\' $B$r5-=R$G$-$k$h$&=$@5(B (MS-DOS $BHG(B)$B!#(B HELP_MESSAGE $B=PNO$KMp$l$,@8$8$k%1!<%9$,$"$C$?$N$r=$@5!#(B UXP/DS $B$KBP$9$kBP=h!#(B Ver. 1.03e $B%G%#%l%/%H%j$N:F5"E*%3%T!$X$NBP1~(B (MS-DOS $BHG(B)$B!#(B DOS7 $B5/F0%G%#%9%/$G(B LFN $B%"%/%;%9$G$-$J$$E@$r=$@5(B (MS-DOS $BHG(B)$B!#(B Ver. 1.03d $BG/$H;~4V$r6&MQ$9$k%"!<%+%$%P=PNO$G8=:_G/$r;2>H$9$k$h$&=$@5!#(B (10/16/97) PROMPT $B$K(B \~ $B$,4^$^$l$k>l9g$N0l;~E83+$NIT6q9g$r=$@5!#(B $B]$NA*Br$,L58z2=$7$F$$$?E@$r=$@5!#(B $B$=$NB>(B TYPO $BE*=$@5!#(B Ver. 1.03b CODEEUC $B;XDj;~$K(B JIS X0201 $B%+%JI=<($,Mp$l$kE@$r=$@5!#(B (09/26/97) $B;`$s$@C$9$k(B OS $BMQ$K=$@5!#(B $B=q9~$_8"$N$J$$%G%P%$%9$b%U%m%C%T!<%I%i%$%V2=2DG=$K!#(B opendir() $B$N:F5"$,e2<%+!<%=%k0\F0$NITHw$r=$@5!#(B $B$=$NB>(B OS $B0MB8$NIT6q9g$r=$@5!#(B Ver. 1.03a %R $B%^%/%mE83+;~$K0zMQId$,DI2C$5$l$F$7$^$&E@$r=$@5!#(B (09/18/97) $B%^!<%/%U%!%$%k$X$N(B ATTR_FILE $B;~$N=i4|CM$N%_%9$r=$@5!#(B $B%+!<%=%k0LCVJs9pJ8;zNs$N%P!<%8%g%s:90[$r5[<}(B (MS-DOS $BHG(B)$B!#(B PC-9801 $BMQ$GFC$7!#(B POSIX $BMQ(B termios $BC$7!#(B $B%\%j%e!<%`%i%Y%k$N=hM}$K$7(B (MS-DOS $BHG(B)$B!#(B Ver. 1.03-bf $B%U%!%$%kL>$K4^$^$l$kFC2A$r8+D>$7!#(B (09/03/97) EXECUTE_SH $B$G$N(B LFN $B<+F0JQ495!G=$rDI2C(B (MS-DOS $BHG(B)$B!#(B PROMPT $BJ8;zNs$KHs0u;zJ8;z$r4^$`$3$H$r5v2D!#(B $B$=$NB>(B Bugfix$B!#(B Ver. 1.03-be $B6uJ8;z$J$IFC$NJd40$KBP1~!#(B (08/26/97) $B0zMQId$NI>2A4p=`$r8+D>$7!#(B _fdrc $B$N%5%s%W%k$r=$@5!#(B Ver. 1.03-bd $BJ8;zNsF~NO;~$N(B ^L $B$N5sF0%_%9$r=$@5!#(B (08/07/97) DOS/V $BMQ$K(B ^@(Ctrl+'2') $B$NF~NO$r2DG=$K!#(B $B3F(B OS $BMQ$N:Y$+$JD4@0!#(B Ver. 1.03-bc $B%U%k%Q%9$GG<$a$i$l$?%"!<%+%$%V%U%!%$%kMQ$N=hM}$rDI2C!#(B (07/31/97) $B3F(B OS $BMQ$N:Y$+$JD4@0!#(B Ver. 1.03-bb keymap $B%3%^%s%I$K%^%C%T%s%02r=|5!G=$rDI2C!#(B (07/23/97) FIND_DIR $BEy$N:GCf$K(B interrupt $B%-!<$K$h$kCfCG$r%5%]!<%H!#(B ${} $BI=5-$N4D6-JQ?tE83+$K<:GT$7$F$$$?E@$r=$@5!#(B Borland C++ $BHG$G(B RAW $B%b!<%I$K$J$C$F$$$J$+$C$?E@$r=$@5!#(B $B3F(B OS $BMQ$N@_Dj5-=R$r6/2=!#(B $B$=$NB>(B Bugfix$B!#(B Ver. 1.03-ba mkfuncno.c $B$,(B cpp $B$r;H$o$J$$$h$&$K;EMMJQ99!#(B (07/07/97) $B>e5-$HF1;~$K(B functabl.c $B$N:o=|!#(B .fdrc $B$rC(B Bugfix$B!#(B Ver. 1.03-b9 $B5l(B DOS $B$G$N(B LFN $B%"%/%;%9$r%5%]!<%H(B (MS-DOS $BHG(B)$B!#(B (05/06/97) Borland C++ 5.00 $B$KBP1~(B (MS-DOS $BHG(B)$B!#(B $B0zMQId$N=hM}$r87L)$K$7$?!#(B $B%U%m%C%T!<%I%i%$%V$N4A;z%U%!%$%kL>(B UNICODE $BJQ49$r%5%]!<%H!#(B $B%U%m%C%T!<%I%i%$%V$N(B BPB $B$N%;%/%?%5%$%:$r2DJQ$K!#(B ANSICOLOR=3 $B$N;EMM$rDI2C!#(B ^@ $B$N%3%^%s%I%i%$%sF~NO$r6X;_!#(B $B2hLL%5%$%:$N2DJQ2=$KBP1~(B (MS-DOS $BHG(B)$B!#(B $B%\%j%e!<%`%i%Y%k$r@5$7$/I=<($G$-$k$h$&=$@5(B (MS-DOS $BHG(B)$B!#(B $B%j!<%I%*%s%j!<%U%!%$%k$N07$$$K4X$9$k=$@5(B (MS-DOS $BHG(B)$B!#(B $B%3%s%Q%$%k;~$N(B warning $B$r6KNOGS=|!#(B $B$=$NB>(B Bugfix$B!#(B Ver. 1.03-b8 ANSI $B7A<0$N%W%m%H%?%$%W@k8@$rDI2C!#(B (03/24/97) NO FILE $B>uBV$+$i$N(B directory $B0\F0$G$N%O%s%0%"%C%W$r=$@5!#(B $B%Q%9L>%G%j%_%?$N=EJ#Hs=EJ#$,:.:_$9$k%"!<%+%$%P=PNO$KBP1~!#(B $B$=$NB>(B Bugfix$B!#(B Ver. 1.03-b7 $BF~NO%i%$%s$N@^JV$70LCV$rJQ99!#(B (03/12/97) djgpp v1.xx $B$G(B LFN $B$r07$($J$+$C$?E@$r=$@5(B (MS-DOS $BHG(B)$B!#(B $B%@%_!<%U%!%$%k(B functabl.c $B$NDI2C!#(B $B%P%$%J%jHRI[$N>l9g!"HRI[%G%j%_%?$r=EJ#I=5-$9$k$h$&$J%"!<%+%$%P=PNO$KBP1~!#(B $B%F%s%]%i%j%G%#%l%/%H%j$r%G%#%l%/%H%j%R%9%H%j$+$i=|30!#(B 64bit OS $BMQ$NBP1~!#(B $B$=$NB>(B Bugfix$B!#(B Ver. 1.03-b6 termios $B%$%s%?%U%'!<%9BP1~!#(B (12/18/96) $B%-!<%3!<%IJ8;zNsCf$K(B "^A" $B7A<0$N5-=R$r5v$9!#(B keymap $BBP>]$K%F%s%-!<$N3F%-!<$rDI2C!#(B getkey $BAH9~$_%3%^%s%I$K%k!<%W2s?t0z?t$rDI2C!#(B make $B;~$N%3%s%Q%$%k4D6-@_Dj$N@0Hw!#(B MARK_REVERSE, MARK_FIND $B;~$NA*Br%5%$%:9g7W$N(B Bugfix$B!#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$BI,MWEY$NDc$$5!G=$r%3%s%Q%$%k;~$KI=<(%+%i!<2=5!G=$NDI2C!#(B $B%"!<%+%$%P$N0lMwI=<($,J#?t9T$KJ,3d$5$l$k%1!<%9$KBP1~!#(B $B%D%j!<2hLL$GE83+$5$l$?%G%#%l%/%H%j$N0l3g2=5!G=$rDI2C!#(B "~FD" $B$G%$%s%9%H!<%k%G%#%l%/%H%j$N;2>H$r2DG=$K!#(B $B$=$NB>(B Bugfix$B!#(B Ver. 1.02-b2 timelocal(), mktime() $B$K4X$9$k0z?t@_Dj%_%9$r(B Bugfix$B!#(B (04/30/96) Ver. 1.02-b1 RockRidge $BL$BP1~(B OS $BMQ$K5?;w(B RockRidge $B3HD%!#(B (04/23/96) $BAH9~$_%3%^%s%I(B "!function" $B$rDI2C!#(B $B%U%!%$%k%5%$%:>pJs9T$NI=<($rA*Br2DG=$K!#(B $BA4$F$NFbIt%3%^%s%I$rAH9~$_%3%^%s%I$H$7$F5/F02DG=$K!#(B DOS7 $BMQ(B floppy $B$N(B LFN $B$rFI=q$-2DG=$K(B ($B1Q?t;z$N$_(B)$B!#(B $B=i4|@_Dj%U%!%$%k$N%3%^%s%IJ#?t9TJ,3d$r2DG=$K!#(B Ver. 1.01h timelocal(), mktime() $B$K4X$9$k0z?t@_Dj%_%9$r(B Bugfix$B!#(B (04/30/96) Ver. 1.01g $B=i4|@_Dj%U%!%$%kFI9~$_;~$N%H!<%/%sJd40$N:]$K=EJ#%U%!%$%kL>$rF10l;k$5$;$?!#(B %M, %XM $B%^%/%m$NF0:nITNI$r(B Bugfix$B!#(B MARK_FIND $B$N=EJ#F0:n$K4X$9$k(B Bugfix$B!#(B $BFbItJQ?t$N:o=|$N5sF0$K4X$9$k(B Bugfix$B!#(B $B$=$NB>(B Bugfix$B!#(B Ver. 1.01f $B3FJd40$,$G$-$J$+$C$?E@$r=$@5!#(B Ver. 1.01c $B%U%m%C%T!<%Q%9L>$r(B MS-DOS $B;EMM$N(B 255 $BJ8;z$^$G$K@)8B$7$?!#(B (03/11/96) $B%U%m%C%T!<%I%i%$%V$N%-%c%C%7%e$K4X$9$k(B Bugfix$B!#(B $B$=$NB>(B Bugfix$B!#(B Ver. 1.01b $B%U%m%C%T!<%I%i%$%V>e$G%U%!%$%kL>$N=*C<(B '.' $BJ8;z$rL5;k$5$;$?!#(B (03/01/96) $B4D6-JQ?t(B LANG $BL$@_Dj;~$N%O%s%0%"%C%W$r(B Bugfix$B!#(B $B$=$NB>(B Bugfix$B!#(B Ver. 1.01a DOS7 $BMQ(B floppy $B$K;CDjBP1~!#(B (02/19/96) strstr(3) $B$N;HMQ$r$d$a!"FH<+$KMQ0U$9$k$3$H$K$7$?!#(B $B%G%#%l%/%H%j%3%T!<$NL58B%k!<%W$rKI;_!#(B $B%+%l%s%H%G%#%l%/%H%j$X$N%G%#%l%/%H%j%3%T!<$r6X;_!#(B $B%U%m%C%T!<%I%i%$%V>e$G$N(B mkdir $B$K4X$9$k(B Bugfix$B!#(B NEXTSTEP $B$KBP$9$kBP=h!#(B $B$=$NB>(B Bugfix$B!#(B Ver. 1.01 $B@5<08x3+%P!<%8%g%s!#(B (02/02/96) $B%I%-%e%a%s%H$K$7!#(B Ver. 1.01-09 1.01-08 $B$N=$@5ItJ,$N5!$KBP$9$k(B Bugfix$B!#(B (12/18/95) $BF1:-%I%-%e%a%s%H$H$7$F(B ToAdmin $B$NDI2C!#(B Ver. 1.01-07 'col -b' $B$N5!G=$r(B kanjicnv $B$KFbB"!#(B (12/11/95) $B%U%m%C%T!<%I%i%$%V$N(B timestamp $B$K4X$9$k(B Bugfix$B!#(B Ver. 1.01-06 timezone $B>pJsC5!G=$rDI2C!#(B (11/07/95) $BF~NO9TKv$N6uGrJ8;z$K4X$9$k=hM}$rDI2C!#(B $B%"!<%+%$%V%U%!%$%k0l;~E83+;~$N%-!e$N%3%T!<$K4X$9$k(B Bugfix$B!#(B (10/20/95) $B$=$NB>3Fe$N%"!<%+%$%V%V%i%&%6$K4X$9$k(B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#%l%/%H%j0\F0$K4X$9$k(B Bugfix$B!#(B $B%3%^%s%I%i%$%s0z?t$K%U%!%$%kL>$r;XDj$7$?>l9g$N(B Bugfix$B!#(B $BJ8;zNsF~NO;~$NB?%P%$%HA^F~:o=|$K$D$$$F(B Bugfix$B!#(B $B%U%!%$%kL>Jd40;~$N%G%#%l%/%H%j$N07$$$K$D$$$F(B Bugfix$B!#(B %R $B%^%/%m;HMQ;~$N%R%9%H%j;2>H$K$D$$$F(B Bugfix$B!#(B $B%^%/%mE83+;~$K6uJ8;z$rIU2C$9$k(B cpp $B$KBP1~!#(B $B$=$NB>(B Bugfix$B!#(B Ver. 1.00 $B@5<08x3+%P!<%8%g%s!#(B (08/07/95) $B%I%-%e%a%s%H$d%3%a%s%H$K$7!#(B Ver. 0.99q off_t $B$N7?$K0MB8$7$J$$$h$&$K%-%c%9%H$rDI2C!#(B (08/03/95) $BI=<($N%0%k!<%WL>$N8e$m$K6uGr$rDI2C!#(B $B9TKv$N(B %X $B$N07$$$K4X$9$k(B Bugfix$B!#(B $B$=$NB>(B Bugfix$B!#(B Ver. 0.99p $B%G%P%$%9%U%!%$%k$N%5%$%:%U%#!<%k%I$r(B ls(1) $B$K9g$o$;$?!#(B (08/02/95) EINTR $B$G5"$C$F$-$?4X?t$N=hM}$rDI2C!#(B Ver. 0.99o $B%U%!%s%/%7%g%s%-!A0$,:.Mp$N85$J$N$G(B Configure $B$K2~L>!#(B Configure $B$N6/2=!#(B Ver. 0.99m NoExecMe $B$N(B Bugfix$B!#(B (07/25/95) expfunc.c $B$G%5%V%7%'%k$G(B Bugfix$B!#(B Ver. 0.99l NoExecMe $B$N6/2=!#(B (07/20/95) $B$=$NB>(B Bugfix$B!#(B Ver. 0.99k $B=q9~$_6X;_%U%!%$%k$N:o=|$KBP$9$k5sF0A*Br$r:Y$+$/$7$?!#(B (07/19/95) $B$=$NB>(B Bugfix$B!#(B Ver. 0.99j $B%+%l%s%H%G%#%l%/%H%j$X$N(B COPY_FILE, MOVE_FILE $B$NBP1~!#(B (07/14/95) $B%^%&%s%H>uBV$N(B Bugfix$B!#(B Ver. 0.99i $B%D%j!!!#(B $B<+F04D6-@_Dj$NH=Dj>r7o$N6/2=!#(B sh $B4X?t$N;H$($J$$(B /bin/sh $BMQ$K4X?tE83+%W%m%0%i%`$rDI2C!#(B $BF1:-%I%-%e%a%s%H$NDI2C!#(BTECHKNOW $B$H(B FAQ$B!#(BTODO $B$O:o=|!#(B UID, GID $B$NJ8;zNs$rEG$/(B tar(1) $B$KBP1~!#(B $B%3%^%s%I9T$N(B "" $BFb$r%^%/%mE83+$7$F$7$^$&E@$r(B Bugfix$B!#(B $B$=$NB>(B Bugfix$B!#(B Ver. 0.99h $B%3%^%s%I9TF,$G$N%U%!%$%kL>Jd40$r%R%9%H%j5!G=$NKu>C!#(B $B<+F04D6-@_Dj$N$?$a!"(Bconfigure $B$NDI2C!#(B $B%U%!%s%/%7%g%s%-!<$N%-!<3dEv$F$r2DG=$K!#(B $B0BA4$N$?$a!"(BESC $B$N%-!<3dEv$F$r6X;_!#(B "!cd" $B$H(B LOG_DIR $B$N5sF0$rEy$7$/$7$?!#(B "-" $B$,D>A0$N%G%#%l%/%H%j$K<($95!G=$rDI2C!#(B FS $B$NMFNL$rI=$9C10L$r(B OS $BKh$K:F8!>Z!#(B $B3HD%;R$K$h$k3FEPO?$G$N%I%C%H%U%!%$%k$N07$$$r(B Bugfix$B!#(B $B$=$NB>(B Bugfix$B!#(B Ver. 0.99g UXP/M $B$KBP$9$kBP=h!#(B (06/21/95) $BAH9~$_%3%^%s%I(B "!cd" $B$rDI2C!#(B $BAH9~$_%3%^%s%I(B "!alias" $B$H(B "!unalias" $B$rDI2C!#(B $BAH9~$_%3%^%s%I(B "!source" $B$rDI2C!#(B $BAH9~$_%3%^%s%I(B "!history" $B$H(B "!!" $B5Z$S(B "!$B?tCM(B" $B$rDI2C!#(B $BAH9~$_%3%^%s%I$N%-!<%^%/%m2=$r2DG=$K$7$?!#(B $B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#(B SUPPORTSJIS cc(1) $B$d(B man(1) $B$,40A4$K(B Shift JIS $B$r@5$7$/07$($^$9!#(B 2 byte $BL\$K(B '\' $B$,Mh$k$h$&$J4A;z$KBP$7$F$b!"$3$N(B '\' $B$r(B meta character $B$H$7$F07$$$^$;$s!#(B BSDINSTALL BSD $B%i%$%/$J(B install(1) $B$,I8=`$N%3%^%s%I8!:w%Q%9>e$K(B $B$,(B "install" $B0J(B $B30$N>l9g!"$=$N%3%^%s%IL>$rDj5A$7$^$9!#(BBSDINSTALL $B$r(B $BDj5A$7$F$$$J$$>l9g$O0UL#$r;}$A$^$;$s!#(B TARUSESPACE tar(1) $B$N(B t $B%*%W%7%g%s$N=PNO$N:]$K!"3F9T$N%U%!%$%k%b(B $B!<%IJ8;zNs(B (Ex:rw-rw-rw-) $B$ND>8e$KI,$:6uGr$,F~$C$F$$(B $B$k>l9g$KDj5A$7$^$9!#(BBSD $B7O$N(B OS $B$G$O!"6uGr$,$J$/D>8e(B $B$K(B UID/GID $B$,B3$/>l9g$,B?$$$h$&$G$9!#(BGNU tar $B$G$O6u(B $BGr$,F~$j$^$9!#(B $B$3$3$G2>$KDj5A$r4V0c$($?$H$7$F$b!"(B.fd2rc $B$d(B /etc/fd2rc $B$N5-=R$GF0E*$KJQ99$9$k$3$H$O2DG=$G$9!#(B TARFROMPAX tar(1) $B$Nl9g$KDj(B $B5A$7$^$9!#(B $B$3$3$G2>$KDj5A$r4V0c$($?$H$7$F$b!"(B.fd2rc $B$d(B /etc/fd2rc $B$N5-=R$GF0E*$KJQ99$9$k$3$H$O2DG=$G$9!#(B BUGGYMAKE make(1) $B$,!"(B1 $BIC0JFb$KO"B3$7$F:n@.$5$l$?%U%!%$%k$N0M(B $BB84X78$r@5$7$/H=CG$G$-$^$;$s!#(B CPP7BIT cpp(1) $B$,!"4A;z$J$I$N(B 8bit $BJ8;z$rDL$9$3$H$,$G$-$^$;(B $B$s!#(B OLDARGINT cc(1) $B$,!"8EE5%?%$%W$N4X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DC__ $B$,%W%j%G%U%!%$%s$5$l$F$$$k$1$l$I$b!"(BK&R $B$N(B $B5l<0$N(B C $B8@8l;EMM$,4|BT$5$l$F$$$k>l9g$KDj5A$7$^$9!#(B NOCONST __STDC__ $B$,%W%j%G%U%!%$%s$5$l$F$$$k$1$l$I$b!"=$>~;R(B const $B$KBP1~$7$F$$$J$$>l9g$KDj5A$7$^$9!#(B NOVOID void $B7?$rMQ$$$k$3$H$,$G$-$^$;$s!#(B NOUINT u_int $B7?$rMQ$$$k$3$H$,$G$-$^$;$s!#(B NOLONGLONG long long $B7?$r;H$&$3$H$,$G$-$^$;$s!#(B HAVELONGLONG long long $B7?$KBP1~$7$F$$$^$9!#(B NOUID_T uid_t, gid_t $B$,(B $B$GDj5A$5$l$F$$$^$;$s!#(B USEPID_T fork(2) $B$d(B wait(2) $B$,%W%m%;%9(B ID $B$H$7$F(B pid_t $B7?$rMQ(B $B$$$^$9!#(B DECLSIGLIST $BBg0hJQ?t(B sys_siglist[] $B$,(B $B$NCf$G@k8@$5$l(B $B$F$*$j!"%=!<%9%j%9%HCf$G2~$a$F@k8@$9$kI,MW$,$"$j$^$;(B $B$s!#(B NOSIGLIST $BBg0hJQ?t(B sys_siglist[] $B$,I8=`%i%$%V%i%j$NCf$KB8:_$7(B $B$^$;$s!#(B DECLERRLIST $BBg0hJQ?t(B sys_errlist[] $B$,(B $B$^$?$O(B $B$NCf$G@k8@$5$l$F$*$j!"%=!<%9%j%9%HCf$G2~$a$F@k8@$9$k(B $BI,MW$,$"$j$^$;$s!#(B PWNEEDERROR /lib/libPW.a $B$r%j%s%/$9$k:]$K!"Bg0hJQ?t(B Error[] $B$r%=(B $B!<%9Cf$KMQ0U$7$J$/$F$O$J$j$^$;$s!#(B NOERRNO $BBg0hJQ?t(B errno $B$,(B $B$NCf$G@k8@$5$l$F$$$^$;$s!#(B NOFILEMODE $B%U%!%$%k%b!<%I$r<($9Dj?t(B S_IRUSR, S_IWUSR $BEy$,(B $B$NCf$GDj5A$5$l$F$$$^$;$s!#(B NOUNISTDH $B$,B8:_$7$^$;$s!#(B NOSTDLIBH $B$,B8:_$7$^$;$s!#(B NOTZFILEH $B$,B8:_$7$^$;$s!#(B USELEAPCNT $B9=B$BN(B tzhead $B$,%a%s%P(B tzh_leapcnt $B$r;}$A$^$9!#(B USESELECTH $B4X?t(B select(2) $B$rMxMQ$9$k:]$KI,MW$J9=B$BN(B fd_set $B$,!"(B $B$NCf$GDj5A$5$l$F$$$^$9!#(B USESYSDIRH $B%G%#%l%/%H%j%U%!%$%k$N%V%m%C%/$r<($9Dj?t(B DEV_BSIZE $B$,!"(B $B$NCf$GDj5A$5$l$F$$$^$9!#(B USETIMEH $B9=B$BN(B tm $B$,!"(B $B$d(B $B$r;2>H$9(B $B$k$@$1$G$ODj5A$5$l$:!"(B $B$,I,MW$G$9!#(B USESTDARGH $B2DJQ0z?t$r07$&(B va_list $B7?$,(B $B$NCf$GDj5A$5(B $B$l$F$$$^$9!#(B USEMKDEVH $B%G%P%$%9HV9fMQ%^%/%m(B ($B$^$?$O4X?t(B) major()/minor() $B$,(B $B$NCf$GDj5A$5$l$F$$$^$9!#(B USEMKNODH $B%G%P%$%9HV9fMQ%^%/%m(B ($B$^$?$O4X?t(B) major()/minor() $B$,(B $B$NCf$GDj5A$5$l$F$$$^$9!#(B USELOCKFH $B%U%!%$%k%m%C%/4X?t(B lockf(2) $B$N%3%^%s%I$r<($93FDj?t$,(B $B$NCf$GDj5A$5$l$F$$$^$9!#(B USETERMIO $BCl9g$K$O(B sgttyb $B9=B$BN$rMQ$$$^$9!#(B HAVECLINE $B9=B$BN(B termios $B$,%a%s%P(B c_line $B$r;}$A$^$9!#(B USEDEVPTMX $B5<;wC $B$,B8:_$7$^$;$s!#(B USEINSYSTMH $B$,(B $B$r;HMQ$9$k$?(B $B$a$KI,MW$G$9!#(B NOHADDRLIST $B9=B$BN(B hostent $B$,%a%s%P(B h_addr_list $B$r;}$A$^$;$s!#(B ($B0J2<$N(B 5 $B8D$OGSB>E*$G$9!#F1;~$KJ#?tDj5A$G$-$^$;$s!#(B) USESTATVFSH $B%U%!%$%k%7%9%F%`>pJs$rF@$k$?$a$K!"(B $B$G(B $B@k8@$5$l$F$$$k4X?t72$rMQ$$$^$9!#(B USESTATFSH $B%U%!%$%k%7%9%F%`>pJs$rF@$k$?$a$K!"(B $B$G(B $B@k8@$5$l$F$$$k4X?t72$rMQ$$$^$9!#(B USEVFSH $B%U%!%$%k%7%9%F%`>pJs$rF@$k$?$a$K!"(B $B$G@k8@(B $B$5$l$F$$$k4X?t72$rMQ$$$^$9!#(B USEMOUNTH $B%U%!%$%k%7%9%F%`>pJs$rF@$k$?$a$K!"(B $B$G@k(B $B8@$5$l$F$$$k4X?t72$rMQ$$$^$9!#(B USEFSDATA $B%U%!%$%k%7%9%F%`>pJs$rF@$k$?$a$K!"9=B$BN(B fs_data $B$r(B $BMQ$$$k4X?t72$rMQ$$$^$9!#(B USEFFSIZE $B9=B$BN(B statfs $B$N%a%s%P$NCf$G!"%U%!%$%k%7%9%F%`$N%V%m(B $B%C%/%5%$%:$H$7$F(B f_fsize $B$r;2>H$7$^$9!#L$Dj5A$N>l9g(B $B$O(B f_bsize $B$r;2>H$7$^$9!#(B USESTATVFSH, USEFSDATA $B$rDj5A$7$?>l9g$O0UL#$r;}$A$^(B $B$;$s!#(B NOFBLOCKS $B9=B$BN(B statfs $B$,%a%s%P(B f_blocks $B$r;}$A$^$;$s!#(B NOFBFREE $B9=B$BN(B statfs $B$,%a%s%P(B f_bfree $B$r;}$A$^$;$s!#(B NOFFILES $B9=B$BN(B statfs $B$,%a%s%P(B f_files $B$r;}$A$^$;$s!#(B USESTATVFS_T $B9=B$BN(B statvfs $B$NBe$o$j$K(B statvfs_t $B$rMQ$$$^$9!#(B STATFSARGS $B4X?t(B statfs(2) $B$NMQ$$$k0z?t$N?t$rDj5A$7$^$9!#(B USESTATVFSH, USEFSDATA $B$rDj5A$7$?>l9g$O0UL#$r;}$A$^(B $B$;$s!#(B USEFSTATFS $B%U%!%$%k%7%9%F%`>pJsE*$G$9!#F1;~$KJ#?tDj5A$G$-$^$;$s!#(B) USEMNTENTH $B%^%&%s%H>pJs$rF@$k$?$a$K!"(B $B$G@k8@$5$l$F$$(B $B$k4X?t72$rMQ$$$^$9!#(B USEMNTTABH $B%^%&%s%H>pJs$rF@$k$?$a$K!"(B $B$G@k8@$5$l(B $B$F$$$k4X?t72$rMQ$$$^$9!#(B USEGETFSSTAT $B%^%&%s%H>pJs$rF@$k$?$a$K!"4X?t(B getfsstat(2) $B$rMQ$$$^(B $B$9!#(B USEGETVFSTAT $B%^%&%s%H>pJs$rF@$k$?$a$K!"4X?t(B getvfsstat(2) $B$rMQ$$(B $B$^$9!#(B USEMNTCTL $B%^%&%s%H>pJs$rF@$k$?$a$K!"4X?t(B mntctl(3) $B$rMQ$$$^$9!#(B USEMNTINFOR $B%^%&%s%H>pJs$rF@$k$?$a$K!"4X?t(B getmntinfo_r(3) $B$rMQ(B $B$$$^$9!#(B USEMNTINFO $B%^%&%s%H>pJs$rF@$k$?$a$K!"4X?t(B getmntinfo(3) $B$rMQ$$(B $B$^$9!#(B USEGETMNT $B%^%&%s%H>pJs$rF@$k$?$a$K!"4X?t(B getmnt(3) $B$rMQ$$$^$9!#(B USEGETFSENT $B%^%&%s%H>pJs$rF@$k$?$a$K!"4X?t(B getfsent(3) $B$rMQ$$$^(B $B$9!#(B ($B$3$NpJs$r)(B $B$a$G$-$^$;$s!#5gM>$N:v$@$H;W$C$F2<$5$$!#(B) USEREADMTAB $B%^%&%s%H>pJs$rF@$k$?$a$K!"(B/etc/mtab $B$rD>@\FI$_$^$9!#(B USEPROCMNT $B%^%&%s%H>pJs%U%!%$%k$H$7$F(B /proc/mounts $B$r;HMQ$7$^$9!#(B ($B$3$NpJs$r)$a$G$-$^$;$s!#5gM>$N:v$@$H;W$C$F(B $B2<$5$$!#(B) HAVEPROCMNT /etc/mtab $B$,B8:_$7$J$$>l9g$K!"%^%&%s%H>pJs%U%!%$%k$H(B $B$7$F(B /proc/mounts $B$r;HMQ$7$^$9!#(B ($B0J2<$N(B 2 $B8D$OGSB>E*$G$9!#F1;~$KJ#?tDj5A$G$-$^$;$s!#>e5-$N(B 8 $B$D$NA*Br;h$N$&$A(B USEMNTINFO $B0J30$rDj5A$7$?>l9g$O0UL#$r;}$A$^(B $B$;$s!#(B) USEVFCNAME $B9=B$BN(B vfsconf $B$N%a%s%P$NCf$G!"%^%&%s%H%?%$%W$rI=$9(B $BJ8;zNs$H$7$F(B vfc_name $B$r;2>H$7$^$9!#$^$?!"(Bvfsconf $B7?(B $B$NH$7$^$9!#(B ($B0J2<$N(B 3 $B8D$OGSB>E*$G$9!#F1;~$KJ#?tDj5A$G$-$^$;$s!#(B) USERE_COMP $B@55,I=8=8!:w$N$?$a$K4X?t(B re_comp(3) $B$rMQ$$$^$9!#(B USEREGCOMP $B@55,I=8=8!:w$N$?$a$K4X?t(B regcomp(3) $B$rMQ$$$^$9!#(B USEREGCMP $B@55,I=8=8!:w$N$?$a$K4X?t(B regcmp(3) $B$rMQ$$$^$9!#(B USERAND48 $BMp?tH/@8MQ4X?t$H$7$F(B random(3) $B$G$O$J$/(B rand48(3) $B$r(B $BMQ$$$^$9!#(B USESETENV $B4D6-JQ?t@_DjMQ4X?t$H$7$F(B setenv(3) $B$,;H$($^$9!#(B NOSELECT $BDc%l%Y%kF~=PNO4X?t(B select(2) $B$r;H$&$3$H$,$G$-$^$;$s!#(B DEFFDSETSIZE $BDc%l%Y%kF~=PNO4X?t(B select(2) $B$r;H$&$?$a$K!"M=$a<1JL(B $B;R(B FD_SETSIZE $B$K%*!<%W%s%U%!%$%k$N:GBg?t$rDj5A$7$F$*(B $B$/I,MW$,$"$j$^$9!#(B SELECTRWONLY $BDc%l%Y%kF~=PNO4X?t(B select(2) $B$,!"FI=q$-MQ$K(B open $B$5(B $B$l$F$$$k%U%!%$%k5-=R;R$KH?1~$7$^$;$s!#(B NOVSPRINTF $B=q<0IU=PNO4X?t(B vsprintf(3) $B$r;H$&$3$H$,$G$-$^$;$s!#(B NOTERMVAR termcap(5) $B%i%$%V%i%jFb$K(B PC, ospeed, BC, UP $B$H$$$C(B $B$?Bg0hJQ?t$,MQ0U$5$l$F$$$^$;$s!#(B USEUTIME $B%?%$%`%9%?%s%W@_Dj4X?t$H$7$F(B utimes(2) $B$rMQ$$$i$l$:!"(B $BBe$o$j$K(B utime(3) $B$rMQ$$$^$9!#(B USEGETWD $B%+%l%s%H%G%#%l%/%H%j8!::4X?t$H$7$F!"(Bgetcwd(3) $B$rMQ$$(B $B$i$l$:!"Be$o$j$K(B getwd(3) $B$rMQ$$$^$9!#(B ULONGIOCTL $BF~=PNO@)8f4X?t(B ioctl(2) $B$NBh(B 2 $B0z?t$H$7$F!"(Bunsigned long $B7?$rMQ$$$^$9!#(B NOFTRUNCATE $B%U%!%$%k%5%$%:@)8f4X?t(B ftruncate(2) $B$r;H$&$3$H$,$G$-(B $B$^$;$s!#(B USEFCNTLOCK $B%U%!%$%k@)8f4X?t(B fcntl(2) $B$r(B flock(2) $B$NBe$o$j$KMQ$$(B $B$^$9!#(B USELOCKF $B%U%!%$%k%m%C%/4X?t$H$7$F(B flock(2) $B$r;H$&$3$H$,$G$-$:!"(B $BBe$o$j$K(B lockf(2) $B$rMQ$$$^$9!#(B NOFLOCK $B%U%!%$%k%m%C%/4X?t$H$7$F(B flock(2) $B$b(B lockf(2) $B$b;H$&(B $B$3$H$,$G$-$^$;$s!#(B NOSYSLOG $B%7%9%F%`%m%,!<4X?t(B syslog(3) $B$r;H$&$3$H$,$G$-$^$;$s!#(B USETIMELOCAL $B;~4VJQ494X?t(B timelocal(3) $B$,(B localtime(3) $B$N5U4X?t$H(B $B$7$F;H$($^$9!#(B USEMKTIME $B;~4VJQ494X?t(B mktime(3) $B$r(B timelocal(3) $B$NBe$o$j$KMQ(B $B$$$^$9!#(B USESYSCONF $B@_Dj>pJspJs$r $B$G(B $BDj5A$5$l$?4X?t72$rM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K$J$j$^$9!#(B(Solaris $B$G$O(B 'd' $B$KB3$/(B '0') Solaris /dev/rdsk/c0d0p0 (IDE) /dev/rdsk/c0t1d0p0 (SCSI) Linux /dev/hda (IDE) /dev/sda (SCSI) FreeBSD /dev/rwd0 (IDE) /dev/rsd0 (SCSI) $B$^$?$O(B /dev/rad0 (IDE) /dev/rda0 (SCSI) NetBSD /dev/rwd0d (IDE) /dev/rsd0d (SCSI) OpenBSD /dev/rwd0c (IDE) /dev/rsd0c (SCSI) 7.$B4X?t(B $B!!(Bsh(1) $B$N4X?tDj5A$HF1$8$G$9!#3NG'$N$?$a!"(BVer. 1.x $B$N4X?t$r(B $B0z?t$KMQ$$$k$3$H$,$G$-$k$3$H$K$"$k$H;W$C$F$$$^$9!#(B $B!!$3$N5!G=$r0lHVH/4x$G$-$kNc$H$7$F!"%o%$%k%I%+!<%I$rMQ$$$F8!(B $B:w$7$?%U%!%$%kL>$KBP$7!"2?$i$+$N%3%^%s%I$rE,MQ$9$k4X?t$r9M$((B $B$F$_$^$7$g$&!#(B delete() { MARK_FIND $1 DELETE_FILE } $B!!;HMQNc$H$7$F$O!"!V(Bdelete '*.bak'$B!W$J$I$H$7$F$d$l$P!"%+%l%s(B $B%H%G%#%l%/%H%jFb$N3HD%;R!V(B.bak$B!W$r;}$D%U%!%$%k$,A4$F>C5n$5$l(B $B$^$9!#(B $B!!(B'' $B$G3g$i$J$$$H!"4X?t(B delete $B$K0z?t$,EO$kA0$K!V(B*.bak$B!W$,E8(B $B3+$5$l$F$7$^$&$N$G5$$r$D$1$^$7$g$&!#(B $B!!$3$N%1!<%9$G$O!"%3%^%s%I%i%$%s$N0z?t$G$"$k!V(B*.bak$B!W$,0LCV(B $B%Q%i%a!<%?(B $1 $B$KBeF~$5$l$k$N$G!"(B1 $B9TL\$O!V(BMARK_FIND *.bak$B!W(B $B$HE83+$5$l$^$9!#(B $B!!(B2 $B9TL\$N(B DELETE_FILE $B$O0z?t$r$,0l$D$b$J$+$C$?>l9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&%6$,(B $B9=C[$5$l$^$9!#(B $B!!$3$N$&$A$$$:$l$+$N%U%!%$%k$rA*Br$9$k$H!"(B4 $B9TL\$NMWAG$@$1$rCj=P$9(B $B$k$h$&$K;X<($7$?%"!<%+%$%V%V%i%&%6MQ%U%)!<%^%C%H$G$9!#$3$N7k(B $B2L!"!V(B1$B!W$+$i!V(B12$B!W$^$G$NCf$+$i$$$:$l$+$rA*$P$;$k$h$&$J%V%i(B $B%&%6$,9=C[$5$l$^$9!#(B $B!!(B6 $B9TL\$O30It%3%^%s%I(B cal $B$r$,J]B8$5$l(B $B$F$$$^$9$N$G!"$=$l$>$l!V(B1$B!W$+$i!V(B12$B!W$^$G$N$$$:$l$+!"!V(B2000$B!W(B $B$+$i!V(B2009$B!W$^$G$N$$$:$l$+$,J]B8$5$l$^$9!#(B $B!!$3$N%3%^%s%I$K$O(B -f $B%*%W%7%g%s$,IUB0$7$F$$$^$;$s$N$G!"$3$3(B $B$G$O$3$N=PNO$OC1$K2hLL$KI=<($5$l$F=*$o$j$G$9!#$=$N$^$^=*$o$C(B $B$F$7$^$C$?$N$G$O=PNO$rFI$`2K$,$"$j$^$;$s$N$G!"!V(B%K$B!W%^%/%m$r(B $B$D$1$F%-!/$7J#;($JNc$r8+$F$_$^$7$g$&!#(B browse \ 'echo "host1 host2 host3"' \ -f "%f" \ -p 'RHOST=$1; RPATH=' \ 'rsh $RHOST "ls -lag $RPATH"' \ -f "%a %l %u %g %s %m %d %{yt} %*f" \ -i "total *" \ -p 'RPATH=$1; while [ "$#" -gt 2 ]; do shift; RPATH=$1/$RPATH; done' \ -d loop \ 'rcp $RHOST:$RPATH ./${RPATH##*/}' $B!!(B1 $B9TL\$O%3%^%s%IL>$G$9!#(B2-4 $B9TL\$O!V(Bhost1$B!W!V(Bhost2$B!W!V(Bhost3$B!W(B $B$r0l9T$:$DI=<($5$;$^$9!#(B5 $B9TL\$O%U%)!<%^%C%H$G$9!#$3$3$^$G$O(B $B>e$NNc$HBg:9$J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1, R9.1, R10.1, R12.3, R13.1) OMRON UniOS-U (Ver3.00) OMRON UniOS-B (2.00) OMRON Luna/Mach (2.5) DEC OSF/1 (V1.2, V2.0, V3.2, V4.x, V5.x) DEC ULTRIX (V4.x) IBM AIX (3.x, 4.x) Apple A/UX (3.0) DG DG/UX (5.4) Fujitsu UXP/M (4.0, 4.1) Fujitsu UXP/DS (V10, V20) Mips RISC/os (4.x, 5.0x) NeXT NEXTSTEP (3.0) (free) 386BSD (R0.1) (free) NetBSD (1.x, 2.x, 3.x, 4.x, 5.x) (free) OpenBSD (2.x, 3.x, 4.x, 5.x) BSDI BSD/OS (1.1, 2.x, 3.0) JCC 4.4BSD-Lite (v1.0) ASCII BSD on Windows (1.0, 1.5) $B$3$N$I$A$i$K$b5s$2$i$l$F$$$J$$(B OS $B$G$O!"$=$N(B OS $B$N4D6-$r(B $B<+F0H=Dj$9$k%W%m%0%i%`$,IUB0$5$l$F$$$^$9$N$G!"(Bmake config $B$H$9$l$P4D6-@_Dj%U%!%$%k$,:n@.$5$l$^$9!#(B $BC"$7!"$3$N<+F0H=Dj$b40`z$G$O$J$$$N$G!"$&$^$/%3%s%Q%$%k$G(B $B$-$J$$$h$&$J$i!"(Bmake config $B$G:n@.$5$l$k(B config.h $B$rJT=8(B $B$7D>$7$F2<$5$$!#=$@5$K$D$$$F$N>\:Y$O(B TECHKNOW $B$r;2>H$7$F(B $B2<$5$$!#(B $B5U$K!">e5-$N$I$A$i$+$K5s$2$i$l$F$$$k(B OS $B$G$O!"(Bmake config $B$,5Q$C$FITE,@Z$J7k2L$r$b$?$i$9$3$H$,$"$k$N$G!"(Bmake config $B$O$7$J$$$G2<$5$$!#(B $BFC$K(B Linux $B$O(B UNIX $B$NCf$G$b$+$J$jFCl9g$O!"H$7$F2<$5$$!#(B $B4D6-JQ?tL>$HA4$/F1$8Dj?tL>$K$7$F$"$j$^$9!#H=CG$G$-$J$1$l(B $B$P$=$N$^$^$K$7$F$*$$$FLdBj$O$"$j$^$;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;E>e$2(B $B$^$7$g$&!#(B $B$3$3$G(B fdrc $B$r:n@.$7$J$1$l$P!"%7%9%F%`6&DL$N@_Dj%U%!%$%k(B $B$O%$%s%9%H!<%k$7$^$;$s!#$=$N>l9g!"%f!<%6$N@_Dj%U%!%$%k$N(B $B$_M-8z$K$J$j$^$9!#(B 7. make install$B!#(B 8. $B@5$7$/%^%K%e%"%k$,%$%s%9%H!<%k$5$l$?(B (man fd $B$G$-$k(B) $B>l(B $B9g$O$3$3$G=*N;$G$9!#(B nroff $B$,F|K\8lBP1~$G$J$$Ey$NM}M3$G%^%K%e%"%k$,@5$7$/%$%s(B $B%9%H!<%k$5$l$J$$>l9g$,$"$j$^$9!#Nc$($P!"J8;z2=$1$7$F$$$?(B $B$j!"(Bman $B%3%^%s%I$,%(%i!<%a%C%;!<%8$rEG$$$?$j!#(B $B$=$N>l9g!"%W%l!<%s%F%-%9%HHG$N%^%K%e%"%k$r%$%s%9%H!<%k$9(B $B$l$P!"@5$7$/%^%K%e%"%k$r;2>H$G$-$^$9!#(B make $B$N%?!<%2%C%H$r(B jcatman -> jcatman-b -> jcompman -> jcompman-b $B$N=g$GJQ99$7$J$,$i=gl9g(B 1. $B0J2<$N%3%s%Q%$%i$GF0:n3NG'$r9T$J$C$F$$$^$9!#(B djgpp 1.1x (g) djgpp 2.0x (d) LSI C-86 Ver. 3.5 (l) Borland C++ 5.xx (b) DOS/V, PC-98x1 $BMQ$K$=$l$>$l(B makefile.?pc, makefile.?98 $B$,(B $BMQ0U$5$l$F$$$^$9$N$G!"$3$l$rMQ$$$^$9!#(B? $B$N2U=j$K$O!"$=$l(B $B$>$l$N%3%s%Q%$%i$K1~$8$F>e5-$N(B () $BFb$NJ8;z$,F~$j$^$9!#(B $B$=$l$>$l$r(B makefile $B$H2~L>$7$F$bNI$$$G$9$7!"(Bmake $B;~$KL@<((B $BE*$K(B make -f makefile.xxx $B$H9T$J$C$F$b9=$$$^$;$s!#(B (LSI C-86 $B;n?)HG$G$O%3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^$7$g$&!#(B $B3F%f!<%6C10L$K@_Dj%U%!%$%k$rMQ0U$7$?$$>l9g$O!"3F%f!<%6$N(B $B%[!<%`%G%#%l%/%H%j$rI=$94D6-JQ?t(B HOME $B$r%f!<%6Kh$K@_Dj$7!"(B $B4D6-JQ?t(B HOME $B$GI=$5$l$k%G%#%l%/%H%j2<$K(B fd2.rc $B$r@_$1$^(B $B$9!#(B $B$J$*!"%R%9%H%j%U%!%$%k(B fd.hst $B$b(B $HOME $B$N2<$K:n$i$l$^$9!#(B 8. $B=*N;!#(B FD-3.01j/ToAdmin100644 2105 1751 12517 13516612560 12165 0ustar shiraiuser[FDclone3 $B1?MQ$K4X$9$k4IM}$r(B $B0lIt$GGc$C$F$7$^$&$h$&$J%$%s%?%U%'!<%9$7$+MQ0U$5$l$F$$$J$$$H(B $B$$$&8=>u$r4U$_!"=i?4l$G$=$NH?1~$r<*$K$9$k(B $B$3$H$,$"$k$N$G$9$,!"e5-$N$h$&$J%]%j%7!<$OI,$:(B $B$7$be:G$b%?%A$N0-$$ItN`$KB0$9$k$H;W$o$l$k$N(B $B$,!"!V?7JF(B root $B$K$h$k(B FDclone $B$rMQ$$$?%7%9%F%`4IM}!W$G$9!#(B $B!!(BFDclone $B$OK0$/$^$G$b%(%s%I%f!<%6$N$?$a$N%D!<%k$G$9!#(B $B!!(Broot $B$?$k0(B root $B$G$N:n6H$r9T$J$&$H$$$&$N$G$"$l$P!"(B $B>/$J$/$H$b%m%0$r;D$9$h$&$K$7$FM_$7$$$H;W$$$^$9!#(B $B!!(BFDclone $B$K$O%m%0$r;D$95!G=$,03n$D$=$l$i$N@_DjJQ(B $B?t$r(B readonly $BB0@-$K$7$F$*$1$P!"(BFDclone $B5/F08e$K@_DjJQ99$K$h(B $B$j%m%0$r2sHr$9$k$3$H$,$G$-$J$/$J$j$^$9!#(B $B!!$3$&$$$C$?!"(Broot $B$J$i$G$O$NLdBjE@$KBP$7!"$-$A$s$HLdBj0U<1(B $B$r;}$C$FD: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=$N;]@bL@$9$k!#(B $B!!EPO?$NJ8LL$G$O!"%=!<%9HRI[EPO?$+%P%$%J%jHRI[$+$,L@3N$KH=$k(B $B$h$&$K$7$F2<$5$$!#F1$8EPO?J8LL$GF1;~$K%=!<%9HRI[EPO?$H%P%$%J(B $B%jHRI[EPO?$r9T$J$&$3$H$,2DG=$G$9!#(B $B!!%P%$%J%jHRI[EPO?$GJ#?t$NF0:n4D6-$KBP$7!"A4$/F1$8JQ99:9J,$K(B $B$h$k:FHRI[$r9T$J$&>l9g$O!"J#?t$NF0:n4D6-$rNs5s$9$k$3$H$G!"0l(B $B$D$NHRI[EPO?$GF1;~$KA4$F$NF0:n4D6-$KBP$7HRI[EPO?$G$-$^$9!#(B $B!!>0!"6qBNE*$J:n6HFbMF$K$D$$$FIT0FFb$JE@$,$"$k>l9g$O!"EPO?A0(B $B$K:n .\" .\" @(#)fd.1 3.01j 07/27/19 .\" fd - File & Directory maintenance tool .TH FD 1 "July 27, 2019" .de sh .br .PP \fB\\$1\fR .PP .. .SH $BL>>N(B fd \- $B%U%!%$%k!&%G%#%l%/%H%j4IM}%D!<%k(B .SH $B7A<0(B .B fd [ .B \-abCefhiklmNnPrSsTtuvx ] [ .BI \- NAME = value ] [ .I directory [ .I directory2 .\|.\|. ]] .br .B fdsh [ .B \-abCcefhiklmNnPrSsTtuvx ] [ .I args ] .SH $B2r@b(B .B fd $B$O!"(B UNIX $BHFMQ$N%F%-%9%HC%f!<%F%#%j%F%#$N%/%m!<%s$rL\;X$7$F$$$^$9!#(B $Be0L8_49$H$J$C$F$$$^$9!#(B .B fd $B$r5/F0$9$k$H!"%U%!%$%k0lMw$N%V%i%&%62hLL$K$J$j$^$9$N$G!"(B $B3F%3%^%s%I$r3dEv$F$F$"$k3F$,;HMQ$G$-$^$9$,!"(B .B fd $B$,2r8e$K%+%l%s%H%G%#%l%/%H%j$r$=$N%G%#%l%/%H%j$K0\F0$7$^$9!#(B .I directory2 .\|.\|. $B$r;XDj$9$k$H!"(B $B%&%#%s%I%&J,3d%b!<%I$G5/F0$7!"(B $BDI2C%&%#%s%I%&B&$N%+%l%s%H%G%#%l%/%H%j$r$=$l$>$l$N%G%#%l%/%H%j$K0\F0$7$^$9!#(B $BFbB"%7%'%kMQ$K;H$($k%*%W%7%g%s$K$O2<5-$N$b$N$,$"$j$^$9!#(B .TP .BI \-c " string" .I string $B$G<($5$l$k%3%^%s%I$rl9g$K$O!"(B $B%7%'%k$,BPOC7?%7%'%k$K$J$j$^$9!#(B .TP .B \-s .B \-s $B$r;XDj$9$k$+!"(B $B$b$7$/$O(B .I " args" $B$r;XDj$7$J$$>l9g$O!"(B $B%7%'%k$N%3%^%s%IF~NO$rI8=`F~NO$+$iFI9~$_$^$9!#(B $B0J9_$N0z?t$O0LCV%Q%i%a!<%?$H$J$j$^$9!#(B .TP .B \-r $B%7%'%k$N5!G=$,0lIt@)8B$5$l$^$9!#(B $B6qBNE*$K$O0J2<$NF0:n$,6X;_$5$l$^$9!#(B .RS 10 .PD 0 .PP $B%+%l%s%H%G%#%l%/%H%j$N0\F0(B .br .BR $PATH , .B $SHELL $B5Z$S(B .B " $ENV" $B$N@_DjJQ99(B .br .B / $B$r4^$`%3%^%s%I$N $B5Z$S(B .BR " >>" ) .ta 1.5i 3i .nf .ft B IN_DIR OUT_DIR LOG_TOP LOG_DIR ATTR_FILE COPY_FILE MOVE_FILE DELETE_FILE DELETE_DIR RENAME_FILE MAKE_DIR WRITE_DIR TREE_DIR BACKUP_TAPE EDIT_FILE UNPACK_FILE PACK_FILE LOG_TREE COPY_TREE MOVE_TREE UNPACK_TREE FIND_DIR ATTR_DIR .ft R .fi .PD .RE .RS .B rfd $B$^$?$O(B .B " rfdsh" $B$H$7$F5/F0$5$l$?>l9g$K$O!"(B $B<+F0E*$K$3$N0lIt@)8B%7%'%k$K$J$j$^$9!#(B .RE .TP .B \-l $B%m%0%$%s%7%'%k$H$7$F5/F0$7$^$9!#(B .TP .B \-N $B5/F0;~$K=i4|@_Dj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U%!%$%kL>I=<(HO0O$r1&%7%U%H(B \fB(\fP \fBFNAME_LEFT\fP $B%U%!%$%kL>I=<(HO0O$r:8%7%U%H(B \fB)\fP \fBONE_COLUMN\fP $B2hLLI=<($r(B 1 $BNs$K$9$k(B \fB1\fP \fBTWO_COLUMNS\fP $B2hLLI=<($r(B 2 $BNs$K$9$k(B \fB2\fP \fBTHREE_COLUMNS\fP $B2hLLI=<($r(B 3 $BNs$K$9$k(B \fB3\fP \fBFIVE_COLUMNS\fP $B2hLLI=<($r(B 5 $BNs$K$9$k(B \fB5\fP \fBMARK_FILE\fP $B%U%!%$%k$N%^!<%/(B \fBTab\fP \fBMARK_FILE2\fP $B%U%!%$%k$N%^!<%/$H2<0\F0(B \fBSpace\fP \fBMARK_FILE3\fP $B%U%!%$%k$N%^!<%/$H2hLLFb0\F0(B \fB^Space\fP(^@) \fBMARK_ALL\fP $BA4%U%!%$%k$K%^!<%/(B \fBHome\fP(+) \fBMARK_REVERSE\fP $BA4%U%!%$%k$r%^!<%/H?E>(B \fBEnd\fP(-) \fBMARK_FIND\fP $B8!:w$7$?%U%!%$%k$K%^!<%/(B \fB\(**\fP \fBIN_DIR\fP $B%5%V%G%#%l%/%H%j$K0\F0(B \fBReturn\fP \fBOUT_DIR\fP $B?F%G%#%l%/%H%j$K0\F0(B \fBBs\fP \fBLOG_TOP\fP $B%k!<%H%G%#%l%/%H%j$K0\F0(B \fB\e\fP \fBREREAD_DIR\fP $BI=<(2hLL$N:FIA2h(B \fB^L\fP \fBPUSH_FILE\fP $B%U%!%$%k$r%9%?%C%/$K@Q$`(B \fBDel\fP(]) \fBPOP_FILE\fP $B%U%!%$%k$r%9%?%C%/$+$i$NJQ99(B \fBF5\fP(r) \fBSORT_DIR\fP $B%U%!%$%k$N%=!<%H(B \fBF6\fP(s) \fBFIND_FILE\fP $B%U%!%$%k$N8!:w(B \fBF7\fP(f) \fBTREE_DIR\fP $B%G%#%l%/%H%j$N%D%j!pJsI=<((B \fBF12\fP(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(B .RS 10 .ta 0.5i .nf \fB/\fP $B%G%#%l%/%H%j(B \fB@\fP symbolic $B%j%s%/(B \fB\(**\fP $B$N%U%!%$%k$r!"(B $B%U%!%$%k0lMwFb$KI=<($7$J$$$h$&$K$7$^$9!#(B $B%H%0%k%9%$%C%A$G%I%C%H%U%!%$%k$NI=<(HsI=<($r@ZBX$($^$9!#(B $B%I%C%H%U%!%$%kHsI=<(%b!<%I$G$O!"(B $B%U%!%s%/%7%g%s9T$N:8C<$K(B .RB " '" H '(Hidden) $B$HI=<($5$l$^$9!#(B .IP "\fB$B%U%!%$%k%U%i%0I=<($N@ZBX$((B\fP" $B3F%U%!%$%k$N%U%!%$%k%b!<%I$NBe$o$j$K!"(B $B0lIt$N(B OS $B$K$"$k%U%!%$%k%U%i%0$rI=<($7$^$9!#(B $B%H%0%k%9%$%C%A$G%U%!%$%k%U%i%0$NI=<($H%U%!%$%k%b!<%I$NI=<($r@ZBX$($^$9!#(B $B%U%!%$%k%U%i%0$N$J$$(B OS $B$G$O5!G=$7$^$;$s!#(B $B3F%7%s%\%k$N0UL#$O=g$K0J2<$N$H$*$j!#(B .B (UNIX) .RS 10 .ta 0.5i .nf \fBA\fP Archived \fBN\fP Nodump \fBa\fP system Append-only \fBc\fP system unChangable (immutable) \fBu\fP system Undeletable \fBa\fP user Append-only \fBc\fP user unChangable (immutable) \fBu\fP user Undeletable .fi .RE .RS $B%U%!%$%k%U%i%0I=<(%b!<%I$G$O!"(B $B%U%!%s%/%7%g%s9T$N:8C<$K(B .RB " '" F '(Flags) $B$HI=<($5$l$^$9!#(B .RE .IP "\fB$B%U%!%$%kL>$N8!:w(B\fP" $B%+%l%s%H%G%#%l%/%H%jFb$G%U%!%$%kL>$r%$%s%/%j%a%s%?%k%5!<%A$7!"(B $B%+!<%=%k$r0\F0$7$F$$$-$^$9!#(B $B%3%^%s%I$r$r%-!$K(B $B%+!<%=%k$,=go%b!<%I$KI|5"$G$-$^$9!#(B .IP "\fB$B%&%#%s%I%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g!"(B $BF~NO9T$N@hF,$K$"$k%?%V$rA4$F:o=|$7$F$+$i%3%^%s%I$KEO$7$^$9!#(B .I n $B$r>JN,$9$k$H!"(B $BI8=`F~NO$r;XDj$7$?$b$N$H8+$J$5$l$^$9!#(B .PD .RE $BC"$7!"(B $B$=$l$>$l$N%j%@%$%l%/%H$G%U%!%$%k$r;XDj$9$k>l9g!"(B $B%U%!%$%kL>$H$7$F(B .RI " `" scheme\fB://\fPhost\fB:\fPport ' $B7A<0$NJ8;zNs$r;XDj$9$k$H!"(B .I scheme $BJ8;zNs$NFbMF$K1~$8$F$=$l$>$l2<5-$N$h$&$J(B TCP $B%=%1%C%H$r%*!<%W%s$7$^$9!#(B $BBTe$N8"8B$K$h$k@)8B$,$"$j$^$9!#(B .B (UNIX) .RS 3 .PD 0 .IP "\fBconnect://\fP\fIhost\fR\fB:\fP\fIport\fR" 10 .I host $B$G<($5$l$k%j%b!<%H%[%9%H$N(B .I " port" $B$G<($5$l$kHV9f$N(B TCP $B%]!<%H$K@\B3$9$k%=%1%C%H$r%*!<%W%s$7$^$9!#(B .IP "\fBaccept://\fP[\fIhost\fR][\fB:\fP\fIport\fR]" .I host $B$G<($5$l$k%m!<%+%k%[%9%H$X$N@\B3$r!"(B .I port $B$G<($5$l$kHV9f$N(B TCP $B%]!<%H$GBTJN,$9$k$HG$0U$N%[%9%H$X$N@\B3$rJN,$9$k$H(B OS $B$NDj$a$?HO0O$NG$0U%]!<%H$rMQ$$$^$9!#(B .IP "\fBbind://\fP[\fIhost\fR][\fB:\fP\fIport\fR]" .I host $B$G<($5$l$k%m!<%+%k%[%9%H$X$N@\B3$r!"(B .I port $B$G<($5$l$kHV9f$N(B TCP $B%]!<%H$KB+G{$5$l$?%=%1%C%H$r%*!<%W%s$7!"(B $BAH9~$_%3%^%s%I(B .B " accept" $B$G$NBTJN,$9$k$HG$0U$N%[%9%H$X$N@\B3$rJN,$9$k$H(B OS $B$NDj$a$?HO0O$NG$0U%]!<%H$rMQ$$$^$9!#(B .PD .RE $B$J$*!"(B $B3F%3%^%s%IF~NO9T$K$*$$$F$O!"(B .RB ' # ' $B$+$i9TKv$^$G!"(B $B5Z$S6u9T$OL5;k$5$l$^$9!#(B $B9T$N:G8eHx$,(B .RB " '" \e ' $B$G=*$C$F$$$k>l9g$O!"(B $B$=$N9T$N5-=R$,l9g$O$3$l$GJ,3d$G$-$^$9!#(B .SS $BAH9~$_%3%^%s%I(B .B fd $B$G$O0J2<$NAH9~$_%3%^%s%I$,MQ0U$5$l$F$$$^$9!#(B $B$3$l$i$NAH9~$_%3%^%s%I$O!"(B .B EXECUTE_SH $B$d=i4|@_Dj%U%!%$%k$NCf$GMQ$$$k$3$H$,$G$-$^$9!#(B .IP "\fBif\fP \fIlist\fR \fBthen\fP [\fBelif\fP \fIlist\fR \fBthen\fP \fIlist\fR] .\|.\|. [\fBelse\fP \fIlist\fR] \fBfi\fP" 14 .B if $B@a5Z$S(B .B " elif" $B@a$N(B .I " list" $B$,@hF,$+$i=g$Kl9g!"(B .B " else" $B@a$N(B .I " list" $B$,l9g$O!"(B .B if $B$O=*N;%9%F!<%?%9(B .B " 0" $B$rJV$7$^$9!#(B .IP "\fBwhile\fP \fIlist\fR \fBdo\fP \fIlist\fR \fBdone\fP" .B while $B@a$N(B .I " list" $B$,7+JV$7l9g$O!"(B .B while $B$O=*N;%9%F!<%?%9(B .B " 0" $B$rJV$7$^$9!#(B .IP "\fBuntil\fP \fIlist\fR \fBdo\fP \fIlist\fR \fBdone\fP" .B until $B@a$N(B .I " list" $B$,7+JV$7l9g$O!"(B .B until $B$O=*N;%9%F!<%?%9(B .B " 0" $B$rJV$7$^$9!#(B .IP "\fBfor\fP \fINAME\fR [\fBin\fP \fIvalue\fR .\|.\|.] \fBdo\fP \fIlist\fR \fBdone\fP" .I value $B%j%9%H$NCM$r0l$D$:$D=g$KFbItJQ?t(B .I " NAME" $B$KBeF~$7!"(B $B$=$N$=$l$>$l$K$D$$$F%3%^%s%I%j%9%H(B .I " list" $B$rJN,$9$k$H!"(B $B0LCV%Q%i%a!<%?$r=g$KBeF~$7$^$9!#(B .IP "\fBcase\fP \fIword\fR \fBin\fP [\fIpattern\fR [\fB\(bv\fP \fIpattern\fR] .\|.\|. \fB)\fP \fIlist\fR \fB;;\fP] .\|.\|. \fBesac\fP" $BJ8;zNs(B .I " word" $B$H3F%Q%?!<%s(B .I " pattern" $B$H$rHf3S$7!"(B $B:G=i$K%^%C%A$7$?(B .I " pattern" $B$KBP1~$9$k%3%^%s%I%j%9%H(B .I " list" $B$ruBV$G(B .I " com" $B$rl9g!"(B .I NAME $B$NDj5A$O4D6-JQ?t$H$7$F$bFbItJQ?t$H$7$F$b;D$j$^$;$s!#(B .I value $B$r>JN,$9$k$H!"FbItJQ?t(B .I " NAME" $B$NCM$H$7$F%J%k$rDj5A$7$^$9!#(B $BFbItJQ?t$NDj5A$r:o=|$9$k>l9g$K$OAH9~$_%3%^%s%I(B .B " unset" $B$rMQ$$$F2<$5$$!#(B .IP "\fIname\fR\fB()\fP \fB{\fP \fIlist\fR; \fB}\fP" $B%3%^%s%I%j%9%H(B .I " list" $B$r4X?t(B .I " name" $B$H$7$FDj5A$7$^$9!#(B $BDj5A$5$l$?4X?t$O!"(B .B EXECUTE_SH $B$NF~NO%i%$%s$N$[$+!"(B $B8e=R$N3F%3%^%s%I%^%/%mFb$KMQ$$$k$3$H$,$G$-$^$9!#(B $B3F%3%^%s%I5-=RFb$G$O0LCV%Q%i%a!<%?(B .BI " $" n $B$,5-=R2DG=$G!"(B $B$3$l$O!"4X?t8F=P;~$N0z?t$r;X$7$F$$$^$9!#(B .B $0 $B$,(B .I " name" $B$=$N$b$N$G!"(B .BR $1 \- $9 $B$^$G$,0z?t$r;X$7$^$9!#(B .B { } $B$d(B .I " list" $B$O>JN,$G$-$^$;$s$,!"(B .I list $B$,C1J8$+$i$J$k>l9g$OA08e$N(B .B " { }" $B$r>JN,$7$F$b9=$$$^$;$s!#(B $B4X?tDj5A$r:o=|$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$kCV49$O:F5"E*$K9T$J$o$l$^$9!#(B .I com $B$r>JN,$9$k$H!"(B .I name $B$N%(%$%j%"%9$rI=<($7$^$9!#(B .I com $B$b(B .I " name" $B$b>JN,$9$k$H!"8=:_Dj5A$5$l$F$$$kA4$F$N%(%$%j%"%9$r0lMwI=<($7$^$9!#(B .IP "\fBarch\fP \fIext\fR [\fIpack unpack\fR]" $B3HD%;R(B .I " ext" $B$N%"!<%+%$%V%U%!%$%k$KBP$9$k%"!<%+%$%P%3%^%s%I$rEPO?$7$^$9!#(B .I pack $B$K$O05=L;~$N%3%^%s%I$r!"(B .I unpack $B$K$O?-D9;~$N%3%^%s%I$r!"(B $B$=$l$>$l(B \fB"\fP $B$G3g$C$?%^%/%mI=5-$G5-=R$7$^$9!#(B .I ext $B$N@hF,$r(B .B " /" $B$G;O$a$k$H!"(B $B3HD%;R$NHf3S$N:]$KBgJ8;z>.J8;z$N0c$$$rL5;k$7$FHf3S$7$^$9!#(B .IR pack , .I unpack $B6&$K>JN,$9$k$H!"3HD%;R(B .I " ext" $B$KBP$9$k%"!<%+%$%P%3%^%s%IEPO?$r:o=|$7$^$9!#(B .IP "\fBbg\fP [\fIjob\fR]" .I job $B$GI=$5$l$k%8%g%V$NJN,$9$k$H%+%l%s%H%8%g%V$r%P%C%/%0%i%&%s%I$G:F3+$7$^$9!#(B .RE .IP "\fBbind\fP \fIc\fR [\fIcom1\fR [\fIcom2\fR] [\fB:\fP\fIcomment\fR]]" $B%-!<(B .I " c" $B$KBP$7$F!"%3%^%s%I(B .I " com1" $B$r3dEv$F$^$9!#(B .I c $B$K%3%s%H%m!<%kJ8;z$r;XDj$7$?$$>l9g$O!"(B .B ^ $B$r4'$7$F(B ^A $B$N$h$&$K(B 2 $BJ8;z$G5-=R$7$^$9!#(B Meta $B%-!<(B (MS-DOS $BHG$G$O(B Alt $B%-!<(B) $B$rJ;MQ$9$kJ8;z$r;XDj$7$?$$>l9g$O!"(B .B @ $B$r4'$7$F(B @a $B$N$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9!#(B .I n $B$,;XDj$5$l$F$$$k$H(B .I " n" $BCJ3,J,%k!<%W$+$iH4$1$^$9!#(B .IP "\fBbrowse\fP [\fB\-@\fP \fIfile\fR]" .PD 0 .IP "\fBbrowse\fP \fIcom\fR [\fB\-ftbie\fP \fIarg\fR] [\fB\-p\fP \fIcom2\fR] [\fB\-dn\fP {\fBnoprep\fP,\fBloop\fP}] .\|.\|." .PD $B%3%^%s%I(B .I " com" $B$rl9g$K!"(B $B$=$N$l$N%3%^%s%I(B .I " com" $B$KB3$$$F5-=R$5$l$?%U%)!<%^%C%H$d%Q%?!<%s$,MQ$$$i$l$^$9!#(B $B0l$DA0$NCJ3,$N%"!<%+%$%V%V%i%&%6$KLa$k$K$O!"(B $B%U%!%$%k(B .B " .\|." $B$rA*$V$+(B .RB " [" Bs ] $B%-!<$r2!$7$^$9!#(B .B QUIT_SYSTEM $B%3%^%s%I$O(B .B " browse" $B$G5/F0$5$l$?A4$F$N%"!<%+%$%V%V%i%&%6$r=*N;$7$^$9!#(B $B$^$?!"(B $B:G8e$K5-=R$5$l$?%3%^%s%I(B .I " com" $B0J30$K$O(B .B " \-f" $B%*%W%7%g%s$,I,?\$G$9!#(B $B:G8e$N(B .I " com" $B$K(B .B " \-f" $B%*%W%7%g%s$,;XDj$5$l$J$+$C$?>l9g$K$O!"(B $B%"!<%+%$%V%V%i%&%6$r5/F0$9$kBe$o$j$KC1$K$=$N%3%^%s%I$r5$5$l$^$9!#(B $B$^$?!"(B $B$=$NCJ3,$N%"!<%+%$%V%V%i%&%6$KE~C#$9$k$^$G$KA*Br$7$F$-$?%U%!%$%kL>$,0LCV%Q%i%a!<%?$K=g$O(B .B " $1" $B$KJ]B8$5$l$F$$$^$9!#(B $B$3$NCM$O%U%!%$%k$rA*Br$9$kETEY99?7$5$l$^$9$N$G!"(B .I com $B$d(B .I " com2" $B$NCf$GAH9~$_%3%^%s%I(B .B " set" $B$d(B .B " shift" $B$r;H$C$F=q49$($F$b!"(B $B$l%G%#%l%/%H%j$@$C$?>l9g$H%G%#%l%/%H%j$G$J$+$C$?>l9g$N@)8f$r5-=R$7$^$9!#(B .B noprep $B$r;XDj$9$k$H(B .B " \-p" $B%*%W%7%g%s$G;XDj$7$?(B .I " com2" $B$rl9g$K$O!"(B $B0z?t$r5-=R$7$?%U%!%$%k(B .I " file" $B$r(B .B " \-@" $B%*%W%7%g%s$G;XDj$9$k$3$H$b$G$-$^$9!#(B .B \-@ $B%*%W%7%g%s$O0z?t$NCf$NG$0U$N>l=j$K5-=R2DG=$G!"(B .I file $B$K5-=R$5$l$?3F0z?t$O(B .B " \-@" $B$N$"$k0LCV$KA^F~$5$l$^$9!#(B .I file $B$H$7$F(B .B " \-" $B$r;XDj$9$k$H%U%!%$%k$NBe$o$j$KI8=`F~NO$+$i0z?t$rFI9~$_$^$9!#(B .I file $B$NCf$K$O0z?t$r6uGrJ8;z$^$?$O2~9T$G6h@Z$C$F5-=R$7$^$9!#(B $B6u9T$^$?$O(B .B " #" $B$G;O$^$k9T$OL5;k$5$l$^$9!#(B .I file $B$NCf$K(B .B " \-@" $B%*%W%7%g%s$r5-=R$7$?>l9g$O!"(B $B:F5"E*$K0z?t%U%!%$%k$,;2>H$5$l$^$9!#(B .IP "\fBbuiltin\fP \fIarg\fR .\|.\|." $BC1=c$JAH9~$_%3%^%s%I$H$7$F(B .I " arg" $B$r$N4X?tDj5A$,$"$C$?>l9g$G$b!"(B $B4X?t$OJN,$9$k$HFbItJQ?t(B .B " HOME" $B$G<($5$l$k%G%#%l%/%H%j$K0\F0$7$^$9!#(B $B%Q%9L>$H$7$F(B "\fB.\fP", "\fB?\fP", "\fB\-\fP", "\fB@\fP" $B$r;XDj$9$k$H!"(B .B LOG_DIR $B$HF1MM$N5sF0$,F@$i$l$^$9!#(B .B \-L $B$,;XDj$5$l$k$H!"(B symbolic $B%j%s%/$rC)$C$FO@M}E*$J%G%#%l%/%H%j0\F0$r9T$J$$$^$9!#(B .B \-P $B$,;XDj$5$l$k$H!"(B symbolic $B%j%s%/$rC)$i$:$KJ*M}E*$J%G%#%l%/%H%j0\F0$r9T$J$$$^$9!#(B $B$I$A$i$b;XDj$7$J$$;~$O!"(B $BAH9~$_%3%^%s%I(B .B " set" $B$N(B .B " physical" $B%*%W%7%g%s$K=>$$$^$9!#(B .IP "\fBcheckid\fP [\fIfile\fR .\|.\|.]" RFC1321 $B$N(B MD5 $B%"%k%4%j%:%`$K=>$C$F!"(B $B;XDj$5$l$?%U%!%$%k$N0l0U$J(B ID $B$r7W;;$7I=<($7$^$9!#(B $BJ#?t$N(B .I " file" $B$r;XDj$9$k$H;XDj$5$l$?A4%U%!%$%k$K$D$$$F(B ID $B$rI=<($7$^$9!#(B $B0l$D$b;XDj$7$J$+$C$?>l9g$O!"(B $BZ$5$l$?%"%k%4%j%:%`$J$N$G!"(B $B%U%!%$%k$NF10l@-$r3NG'$9$kC5n$7$^$9!#(B .IP "\fBcommand\fP [\fB\-p\fP | \fB\-v\fP | \fB\-V\fP] \fIarg\fR .\|.\|." $BC1=c$J%3%^%s%I$H$7$F(B .I " arg" $B$r$N4X?tDj5A$,$"$C$?>l9g$G$b!"(B $B4X?t$OA0$rI=<($7$^$9!#(B .B \-V $B$,;XDj$5$l$k$H(B .B " type" $B$HF1MM$K(B .I " arg" $B$K4X$9$k>\:Y@bL@$rI=<($7$^$9!#(B .IP "\fBcontinue\fP \fIn\fR" $B%k!<%W$NCf$GeAX$N%k!<%W$NCf$G$O(B .I " src" $B$K$J$j$^$9!#(B .I dest $B$r>JN,$9$k$H%+%l%s%H%G%#%l%/%H%j$K%3%T!<$5$l$^$9!#(B $B%3%T!<85$N%U%!%$%k$O(B .B " \+" $B$G6h@Z$k$+%o%$%k%I%+!<%I$rMQ$$$k$+$GJ#?t;XDj$G$-$^$9!#(B .B \+ $B$G6h@Z$C$?>l9g$O$=$l$i$N%U%!%$%k$rO"7k$7$F%3%T!<$7$^$9!#(B $B%o%$%k%I%+!<%I$rMQ$$$?>l9g$O!"(B $B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.RE .IP "\fBdirs\fP" $B8=:_$N%G%#%l%/%H%j%9%?%C%/$N0lMw$rI=<($7$^$9!#(B $B%G%#%l%/%H%j%9%?%C%/$O(B .B " pushd" $B5Z$S(B .B " popd" $B%3%^%s%I$G@Q$_9_$m$7$5$l$^$9!#(B .IP "\fBdisown\fP [\fIjob\fR]" .I job $B$GI=$5$l$k%8%g%V$r%7%'%k$N4IM}2<$+$i30$7$^$9!#(B .B disown $B$5$l$?%8%g%V$O!"(B $BAH9~$_%3%^%s%I(B .B " jobs" $B$d(B .BR " fg" , .B bg $B$G@)8f$G$-$J$/$J$j$^$9!#(B $B%m%0%$%s%7%'%k$H$7$F5/F0$5$l$?;~$K$O!"(B .B disown $B$5$l$F$$$J$$%8%g%V$O%7%'%k=*N;;~$K6/@)=*N;$5$l$^$9!#(B .B (UNIX) .I job $B$r>JN,$9$k$H%+%l%s%H%8%g%V$r%7%'%k$N4IM}2=$+$i30$7$^$9!#(B .IP "\fBdtype\fP \fIfile\fR" .I file $B$G<($5$l$k%U%!%$%k$NFbMF$rI=<($7$^$9!#(B .IP "\fBecho\fP [\fB\-nN\fP] [\fIarg\fR .\|.\|.]" .I arg $B$rI8=`=PNO$K=PNO$7$^$9!#(B .B \-n $B$,;XDj$5$l$J$$>l9g$O(B .I " arg" $B$N:G8e$K2~9T$r=PNO$7$^$9!#(B .B \-N $B$,;XDj$5$l$?>l9g$O=PNO$9$k2~9T$r(B CR-NL (\er\en) $B$K$7$^$9!#(B .BR echo (1) $B$r;2>H$7$F2<$5$$!#(B .IP "\fBenable\fP [\fB\-n\fP] [\fIarg\fR .\|.\|.]" .I arg $B$rAH9~$_%3%^%s%I$H$7$FM-8z$K$7$^$9!#(B .B \-n $B$,;XDj$5$l$?>l9g$OL58z$K$7$^$9!#(B .I arg $B$r>JN,$9$k$H8=:_M-8z$^$?$OL58z$K$J$C$F$$$kAH9~$_%3%^%s%I$N0lMw$rI=<($7$^$9!#(B .IP "\fBeval\fP [\fIarg\fR .\|.\|.]" .I arg $B$rI>2A$7$?8e2A$7$?8e2A$7$^$;$s$N$G!"(B $BMQES$K1~$8$FE,59;H$$J,$1$F2<$5$$!#(B $B$^$?!"(B $B4X?t$NCf$G$O%Q%i%a!<%?%^%/%m$,;H$($J$$$N$G!"(B $B%Q%i%a!<%?%^%/%m$NE83+$K$O$3$N%3%^%s%I$,I,MW$K$J$j$^$9!#(B .IP "\fBexec\fP [\fIcom\fR [\fIarg .\|.\|.\fR]]" .B fd $B$N5$5$;$k$h$&$K$7$^$9!#(B $B0J9_!"(B .I NAME $B$X$NDj5A$OA4$F;R%W%m%;%9$G$b;2>H$5$l$k$h$&$K$J$j$^$9!#(B $BCM$,L$Dj5A$NFbItJQ?t$r(B .B " export" $B$7$?>l9g$O!"(B $B$=$NFbItJQ?t$KCM$,Dj5A$5$l$?;~E@$G=i$a$F4D6-JQ?t$H$J$j$^$9!#(B $BCM$NDj5A$bF1;~$K9T$J$$$?$$>l9g$O!"(B .I value $B$r;XDj$7$F2<$5$$!#(B .B = $B$N$_5-=R$7$F(B .I " value" $B$r>JN,$9$k$H!"4D6-JQ?t(B .I " NAME" $B$NCM$H$7$F%J%k$rDj5A$7$^$9!#(B $B0z?t$J$7$Gl9g$O!"(B $B8=:_(B .B " export" $B$5$l$F$$$k4D6-JQ?t$N0lMw$rI=<($7$^$9!#(B $B4D6-JQ?t$NDj5A$r:o=|$9$k>l9g$K$OAH9~$_%3%^%s%I(B .B " unset" $B$rMQ$$$F2<$5$$!#(B .IP "\fBfalse\fP" $B=*N;%9%F!<%?%9(B .B " 1" $B$rJV$9$@$1$G2?$b$7$^$;$s!#(B .IP "\fBfc\fP [\fB\-l\fP | \fB\-s\fP [\fIold\fR\fB=\fP\fInew\fR .\|.\|.]] [\fB\-nr\fP] [\fB\-e\fP \fIeditor\fR] [\fIfirst\fR [\fIlast\fR]]" $B%3%^%s%IMzNr$rI=<($7$?$jJT=8$7$?$j$7$^$9!#(B .I first $B5Z$S(B .I " last" $B$G%3%^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(B $BJT=8$r=*$($k$HJT=8$5$l$?%3%^%s%I$,I8=`=PNO$KI=<($5$l$J$,$iC`JN,$9$k$H(B .I " first" $B$r;XDj$5$l$?$b$N$H8+$J$7!"(B $B99$K(B .I " first" $B$b>JN,$9$k$H6&$K8=:_$NMzNrHV9f$,;XDj$5$l$?$b$N$H8+$J$7$^$9!#(B .IP "\fBfd\fP [\fIdirectory\fR [\fIdirectory2\fR]]" $BFbB"%7%'%k$+$i(B .B " fd" $B$r5/F0$7$^$9!#(B .I directory $B$r;XDj$9$k$H!"(B $B5/F0D>8e$K%+%l%s%H%G%#%l%/%H%j$r$=$N%G%#%l%/%H%j$K0\F0$7$^$9!#(B .I directory2 $B$r;XDj$9$k$H!"(B $B%&%#%s%I%&J,3d%b!<%I$G5/F0$7!"(B $BDI2C%&%#%s%I%&B&$N%+%l%s%H%G%#%l%/%H%j$r$=$N%G%#%l%/%H%j$K0\F0$7$^$9!#(B .B QUIT_SYSTEM $B$K$h$jFbB"%7%'%k$KLa$j$^$9!#(B .B fdsh $B$H$7$F5/F0$5$l$?;~$N$_M-8z$G$9!#(B .IP "\fBfg\fP [\fIjob\fR]" .I job $B$GI=$5$l$k%8%g%V$NJN,$9$k$H%+%l%s%H%8%g%V$r%U%)%"%0%i%&%s%I$G:F3+$7$^$9!#(B .RE .IP "\fBgetfreq\fP [\fIfile\fR]" $B$+$J4A;zJQ493X=,MQ$N%f!<%6JQ49IQEY%U%!%$%k(B .I " file" $B$NFbMF$rI8=`=PNO$K=PNO$7$^$9!#(B $B=PNO7A<0$O0l9T0l%l%3!<%I$G!"(B $B3F9T$O!VFI$_2>L>!W!VC18l!W!VIQEY?t!W$r%?%VJ8;z$G6h@Z$C$?J8;zNs$K$J$C$F$$$^$9!#(B $B$3$N=PNO$O!"(B .B setfreq $B$KEO$9$3$H$GIQEY>pJs$N%$%s%]!<%H$KMQ$$$k$3$H$,$G$-$^$9!#(B .I file $B$r>JN,$9$k$HFbItJQ?t(B .B " FREQFILE" $B$G;XDj$5$l$?%f!<%6JQ49IQEY%U%!%$%k$r;XDj$7$?$b$N$H8+$J$7$^$9!#(B .B (UNIX) .IP "\fBgetkey\fP [\fInum\fR]" $B2!2<$7$?%-!<$KBP$9$k%-!<%3!<%IJ8;zNs$re$N>l9g$O!"(B .RB [ Space ] $B$r2!$7$F$b=*N;$5$;$k$3$H$,$G$-$^$9!#(B .I num $B$,(B .B " 0" $B2s$N>l9g$K$O(B .RB " [" Space ] $B$,2!$5$l$k$^$GL58B$K7+$jJV$5$l$^$9!#(B $B$3$3$GI=<($5$l$kJ8;zNs$O!"(B $B$=$N$^$^(B .B " keymap" $B%3%^%s%I$N%-!<%3!<%IJ8;zNs$H$7$F;HMQ2DG=$G$9!#(B .B (UNIX) .I num $B$r>JN,$9$k$H!"(B .B 1 $B2s$r;XDj$7$?$b$N$H8+$J$7$^$9!#(B .IP "\fBgetopts\fP \fIoptstr\fR \fINAME\fR [\fIarg .\|.\|.\fR]" .I arg $B$NJB$S$+$i%*%W%7%g%s%Q%i%a!<%?$rE83+$9$k$N$KMQ$$$i$l$^$9!#(B $B%*%W%7%g%s$H$7$FM-8z$JJ8;z$O(B .I " optstr" $B$KNs5s$5$l$?J8;z$@$1$G$9!#(B $B$"$k%*%W%7%g%sJ8;z$,0z?t$rl9g$O!"(B .I optstr $B$N5-=R$NCf$G$=$NJ8;z$N8e$m$K(B .B " :" $B$rB3$1$^$9!#(B .B getopts $B$,8F=P$5$l$kEY$K!"(B .I arg $B$NJB$S$+$iE83+$5$l$??7$7$$%*%W%7%g%sJ8;z$,FbItJQ?t(B .I " NAME" $B$KBeF~$5$l$^$9!#(B $B0z?t$r;}$D%*%W%7%g%sJ8;z$N>l9g$O!"(B $B$=$N0z?t$,FbItJQ?t(B .B " OPTARG" $B$KBeF~$5$l$^$9!#(B $B$^$?!"(B $BJN,$9$k$H!"(B $B0LCV%Q%i%a!<%?$r%*%W%7%g%s%Q%i%a!<%?$KE83+$7$^$9!#(B $B%*%W%7%g%s$N=*C<$KC#$7$?>l9g$O!"(B .B getopts $B$O(B .B " 1" $B$rJV$7$^$9!#(B $B$3$N;~!"(B .I NAME $B$K$O(B .B " ?" $B$,BeF~$5$l$^$9!#(B .I optstr $B$K4^$^$l$J$$%*%W%7%g%sJ8;z$,8+$D$+$C$?>l9g$O!"(B $BI8=`%(%i!<=PNO$K%(%i!<%a%C%;!<%8$rI=<($7!"(B .I NAME $B$K(B .B " ?" $B$rBeF~$7(B .B " OPTARG" $B$r(B .B " unset" $B$7$^$9!#(B $BC"$7!"(B .I optstr $B$,(B .B " :" $B$G;O$^$C$F$$$k$H!"(B $B%(%i!<%a%C%;!<%8$OI=<($;$:$K!"(B $BBe$o$j$K8+$D$+$C$?%*%W%7%g%sJ8;z$r(B .B " OPTARG" $B$KBeF~$7$^$9!#(B $B0z?t$rMW$9$k%*%W%7%g%sJ8;z$K0z?t$,H<$o$J$+$C$?>l9g$O!"(B $BI8=`%(%i!<=PNO$K%(%i!<%a%C%;!<%8$rI=<($7!"(B .I NAME $B$K(B .B " ?" $B$rBeF~$7(B .B " OPTARG" $B$r(B .B " unset" $B$7$^$9!#(B $BC"$7!"(B .I optstr $B$,(B .B " :" $B$G;O$^$C$F$$$k$H!"(B $B%(%i!<%a%C%;!<%8$OI=<($;$:$K!"(B $BBe$o$j$K8+$D$+$C$?%*%W%7%g%sJ8;z$r(B .B " OPTARG" $B$KBeF~$7(B .I " NAME" $B$K(B .B " :" $B$rBeF~$7$^$9!#(B .IP "\fBhash\fP [\fB\-r\fP \(bv \fIcom\fR .\|.\|.]" $B30It%3%^%s%IH$7$F(B .I " com" $B$KBP$9$k@dBP%Q%9$r8!:w$7!"(B $B$=$N7k2L$r%O%C%7%e%F!<%V%k$KEPO?$7$^$9!#(B .I com $B$NBe$o$j$K(B .B " \-r" $B$r;XDj$9$k$H$3$l$^$G5-21$7$F$$$?%O%C%7%e%F!<%V%k$rA4$FGK4~$7$^$9!#(B .I com $B$r>JN,$9$k$H%O%C%7%e%F!<%V%k>pJs$N0lMw$rI=<($7$^$9!#(B .BR hits , .BR cost , .B command $B$O!"(B $B$=$l$>$l$=$N%3%^%s%I$Ne$G8!:w$9$k$N$KMW$7$?;E;vNL!"(B $B%3%^%s%I$N@dBP%Q%9$rI=$7$^$9!#(B $B8!:w$5$l$?%3%^%s%I$,AjBP%G%#%l%/%H%j$K$"$C$?>l9g$O!"(B $B@dBP%Q%9$H$7$FEPO?$5$l$^$;$s$N$G!"(B $B%+%l%s%H%G%#%l%/%H%j$r0\F0$9$kEY$K:F8!:w$9$kI,MW$,$"$j$^$9!#(B $B$3$N$h$&$J%3%^%s%I$G$O!"(B .B hits $B$NCM$KB3$$$F(B .B " \(**" $B$,I=<($5$l$^$9!#(B .IP "\fBhistory\fP [\fIn\fR]" $B:G6a$N(B .I " n" $B8D$N%3%^%s%IMzNr$r!"(B $BMzNrHV9f$rE:$($F0lMwI=<($7$^$9!#(B .I n $B$r>JN,$9$k$H!"(B $B8=:_5-21$5$l$F$$$kA4$F$N%3%^%s%IMzNr$r0lMwI=<($7$^$9!#(B .IP "\fBjobs\fP" $BJN,$9$k$H!"(B $B%3%s%Q%$%k;~$K;XDj$5$l$?4A;z%3!<%I$,;XDj$5$l$?$H8+$J$5$l$^$9!#(B .I outfile $B$r>JN,$9$k$H!"(B $BI8=`=PNO$K=PNO$7$^$9!#(B .I infile $B$b>JN,$9$k$H!"(B $BI8=`F~NO$+$iFI9~$_$^$9!#(B .B (UNIX) .IP "\fBkeymap\fP [\fIc\fR [\fIstr\fR]]" $B3FJN,$9$k$H!"(B .I c $B$KBP$9$k%-!<%3!<%IJ8;zNs$rI=<($7$^$9!#(B .I str $B$b(B .I " c" $B$b>JN,$9$k$H!"8=:_FC$GI=$7$^$9!#(B .I signal $B$r>JN,$9$k$H(B .B " SIGTERM" $B$rAw$j$^$9!#(B .B \-l $B$r;XDj$9$k$H%7%0%J%k$rAw$kBe$o$j$K(B .I " signal" $B$H$7$F;H$($k%7%0%J%kL>$r0lMwI=<($7$^$9!#(B .IP "\fBlaunch\fP \fIext\fR [\fIcom\fR [\fIformat\fR [\fItop\fR \fIbottom\fR]]]" .PD 0 .IP "\fBlaunch\fP \fIext\fR \fIcom\fR [\fB\-f\fP \fIformat\fR] [\fB\-t\fP \fItop\fR\] [\fB\-b\fP \fIbottom\fR] [\fB\-ie\fP \fIpatt\fR\]" .PD $B3HD%;R(B .I " ext" $B$KBP$9$k5sF0$r%i%s%A%c$H$7$FEPO?$7$^$9!#(B .I com $B$K$O%3%^%s%I$N%^%/%mI=5-$r(B \fB"\fP $B$G3g$C$F5-=R$7$^$9!#(B $B%"!<%+%$%V%V%i%&%6$rEPO?$9$k>l9g$K$O!"(B .I com $B$K$O%"!<%+%$%V%U%!%$%k$N0lMwI=<($N$?$a$N%3%^%s%I$r5-=R$7!"(B .I format $B$K0lMwI=<(7A<0$N%U%)!<%^%C%H$r5-=R$7$^$9!#(B .I top $B5Z$S(B .I " bottom" $B$r5-=R$9$k$H!"(B $B0lMwI=<($N$&$A$GITI,MW$J9T$r!"(B $B$=$l$>$l@hF,9T$+$i$N9T?t5Z$S:G=*9T$+$i9T?t$H$7$F;XDj$G$-$^$9!#(B .I ext $B$N@hF,$r(B .B " /" $B$G;O$a$k$H!"(B $B3HD%;R$NHf3S$N:]$KBgJ8;z>.J8;z$N0c$$$rL5;k$7$FHf3S$7$^$9!#(B .I com $B$r>JN,$9$k$H!"3HD%;R(B .I " ext" $B$KBP$9$k%i%s%A%cEPO?$r:o=|$7$^$9!#(B $B%"!<%+%$%V%V%i%&%6$rEPO?$9$k>l9g$K$O!"(B $B8e\:Y$K@)8f$r5-=R$G$-$^$9!#(B .B \-f $B%*%W%7%g%s$rJ#?t5-=R$9$k$3$H$K$h$j!"(B $BJ#?t$N%U%)!<%^%C%H8uJd$r;XDj$G$-$^$9!#(B $B$3$l$i$N%U%)!<%^%C%H8uJd$O5-=R$5$l$?=g$KHf3S$5$l!"(B $B$I$l$b40A4$K%^%C%A$7$J$$>l9g$O0lHV6a$$%U%)!<%^%C%H8uJd$K=>$$$^$9!#(B .B \-i $B5Z$S(B .B " \-e" $B%*%W%7%g%s$G$O!"(B $B$=$l$>$lL5;k$9$k9T$H%(%i!<07$$$K$9$k9T$N%Q%?!<%s(B .I " patt" $B$r;XDj$7$^$9!#(B $B0lMwI=<($NCf$KITI,MW$J9T$,4^$^$l$F$$$k>l9g$K$O!"(B .I top $B$d(B .I " bottom" $B$G;XDj$9$k$3$H$b$G$-$^$9$,!"(B $B@hF,9T$d:G=*9T0J30$N9T$O(B .B " \-i" $B%*%W%7%g%s$rMQ$$$F;XDj$7$F2<$5$$!#(B $B$^$?!"(B $B%"!<%+%$%V%U%!%$%k$NE83+$K<:GT$7$?:]$KFCDj$NJ8;zNs$r4^$s$@=PNO$,$J$5$l$k>l9g$K$O!"(B $B$=$NJ8;zNs$r(B .B " \-e" $B%*%W%7%g%s$rMQ$$$F;XDj$7$F2<$5$$!#(B .B \-i $B5Z$S(B .B " \-e" $B%*%W%7%g%s$O$I$A$i$bJ#?t;XDj$9$k$3$H$,$G$-!"(B $B$=$N$&$A$$$:$l$+$R$H$D$K%^%C%A$9$l$PM-8z$K$J$j$^$9!#(B $B$^$?!"(B $B%Q%?!<%s(B .I " patt" $B$N5-=R$K$O$$$:$l$b%o%$%k%I%+!<%I$rMQ$$$k$3$H$,$G$-$^$9!#(B .IP "\fBmd\fP \fIdir\fR" $B%G%#%l%/%H%j(B .I " dir" $B$r:n@.$7$^$9!#(B .IP "\fBmkdir\fP \fIdir\fR" .B md $B$HF1$8!#(B .B (DOS) .IP "\fBnewgrp\fP [\fIarg .\|.\|.\fR]" .B fd $B$NH$7$F2<$5$$!#(B .B (UNIX) .IP "\fBlogin\fP [\fIarg .\|.\|.\fR]" .B fd $B$NH$7$F2<$5$$!#(B .B (UNIX) .IP "\fBlogout\fP [\fIn\fR]" $B%m%0%$%s%7%'%k$r=*N;$7$^$9!#(B .I n $B$,;XDj$5$l$F$$$k$H=*N;%9%F!<%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aunch\fP [\fIext\fR]" $B3HD%;R(B .I " ext" $B$KBP$7$F%i%s%A%c$H$7$FEPO?$5$l$F$$$k%3%^%s%I%^%/%m$rI=<($7$^$9!#(B $B%"!<%+%$%V%V%i%&%6$H$7$FEPO?$5$l$F$$$k$b$N$K$D$$$F$O!"(B $B0lMwI=<(7A<0$N%U%)!<%^%C%H$rJ;5-$7$^$9!#(B .I ext $B$r>JN,$9$k$H!"(B $B8=:_EPO?$5$l$F$$$kA4$F$N%i%s%A%c$r0lMwI=<($7$^$9!#(B .IP "\fBprintroman\fP [\fIroman\fR]" $B$+$J4A;zJQ49F~NO%b!<%I$GMQ$$$k%m!<%^;z$+$JJQ49%F!<%V%k$rI=<($7$^$9!#(B $B%m!<%^;zJ8;zNs(B .I " roman" $B$KBP$7$F3dEv$F$i$l$?F|K\8lJ8;zNs$rI=<($7$^$9!#(B .B (UNIX) .I roman $B$r>JN,$9$k$H!"(B $B8=:_EPO?$5$l$F$$$kA4$F$N%m!<%^;z$+$JJQ49%F!<%V%k$r0lMwI=<($7$^$9!#(B .IP "\fBpushd\fP [\fIdir\fR]" $B%+%l%s%H%G%#%l%/%H%j$r%G%#%l%/%H%j%9%?%C%/$N0lHV>e$K@Q$_!"(B .B fd $BFb$N%+%l%s%H%G%#%l%/%H%j$r(B .I " dir" $B$K0\F0$7$^$9!#(B $B%Q%9L>$H$7$F(B "\fB.\fP", "\fB?\fP", "\fB\-\fP", "\fB@\fP" $B$r;XDj$9$k$H!"(B .B LOG_DIR $B$HF1MM$N5sF0$,F@$i$l$^$9!#(B symbolic $B%j%s%/$rC)$k$+H]$+$OAH9~$_%3%^%s%I(B .B " set" $B$N(B .B " physical" $B%*%W%7%g%s$K=>$$$^$9!#(B .I dir $B$r>JN,$9$k$H!"(B $B%G%#%l%/%H%j%9%?%C%/$N0lHV>e$N%G%#%l%/%H%j$K0\F0$7!"(B $B$=$N%9%?%C%/FbMF$r%+%l%s%H%G%#%l%/%H%j$KF~$l49$($^$9!#(B $B$=$N>l9g!"(B $B%G%#%l%/%H%j%9%?%C%/$,6u$N;~$K$O<:GT$7$^$9!#(B .IP "\fBpwd\fP [\fB\-LP\fP]" $B%+%l%s%H%G%#%l%/%H%j$r@dBP%Q%9I=5-$G=PNO$7$^$9!#(B .B \-L $B$,;XDj$5$l$k$H!"(B symbolic $B%j%s%/$rC)$C$?O@M}E*$J%Q%9L>$r=PNO$7$^$9!#(B .B \-P $B$,;XDj$5$l$k$H!"(B symbolic $B%j%s%/$r4^$^$J$$J*M}E*$J%Q%9L>$r=PNO$7$^$9!#(B $B$I$A$i$b;XDj$7$J$$;~$O!"(B $BAH9~$_%3%^%s%I(B .B " set" $B$N(B .B " physical" $B%*%W%7%g%s$K=>$$$^$9!#(B .IP "\fBread\fP [\fB-N\fP] [\fINAME .\|.\|.\fR]" $BI8=`F~NO$+$i0l9TFI9~$_!"(B $B$=$NJ8;zNs$rFbItJQ?t(B .I " NAME" $B$KBeF~$7$^$9!#(B $BF~NOJ8;zNs$O(B .B " IFS" $B$G6h@Z$C$FC18lKh$KJ,3d$5$l$^$9!#(B .I NAME $B$,J#?t;XDj$5$l$F$$$?>l9g$O!"(B $B9T$N@hF,$NC18l$+$i=g$K0l$D$:$DBeF~$5$l!"(B $B:G8e$N(B .I " NAME" $B$K;D$jA4It$,BeF~$5$l$^$9!#(B $BF~NO9T$NCf$NC18l?t$,(B .I " NAME" $B$N?t$KK~$?$J$$>l9g$O!"(B $BM>$C$?(B .I " NAME" $B$K$O%J%k$,Dj5A$5$l$^$9!#(B .B \-N $B$,;XDj$5$l$k$H!"(B $B2~9T$r(B CR-NL (\er\en) $B$H8+$J$7$F0l9TFI9~$_$^$9!#(B .IP "\fBreadline\fP [\fIprompt\fR]" $BCl9g$K$OF~NO9T$N@hF,$K$=$NJ8;zNs$rI=<($7$F$+$iF~NO$r3+;O$7$^$9!#(B $B>o$KCJd405!G=$O;H$($^$9!#(B .IP "\fBreadonly\fP [\fINAME\fR[\fB=\fP[\fIvalue\fR]] .\|.\|.]" $BFbItJQ?t(B .I " NAME" $B$rFI9~$_@lMQ$K$7$^$9!#(B $B$3$l0J9_!"(B .I " NAME" $B$NCM$rJQ99$9$k$3$H$O$G$-$J$/$J$j$^$9!#(B $BCM$NDj5A$bF1;~$K9T$J$$$?$$>l9g$O!"(B .I value $B$r;XDj$7$F2<$5$$!#(B .B = $B$N$_5-=R$7$F(B .I " value" $B$r>JN,$9$k$H!"(B $BFbItJQ?t(B .I " NAME" $B$NCM$H$7$F%J%k$rDj5A$7$^$9!#(B $B0z?t$J$7$Gl9g$O!"(B $B8=:_FI9~$_@lMQ$K$5$l$F$$$kFbItJQ?t$N0lMw$rI=<($7$^$9!#(B .IP "\fBrd\fP \fIdir\fR" $B%G%#%l%/%H%j(B .I " dir" $B$r:o=|$7$^$9!#(B $BCf?H$,6u$G$J$$%G%#%l%/%H%j$O:o=|$G$-$^$;$s!#(B .IP "\fBrmdir\fP \fIdir\fR" .B rd $B$HF1$8!#(B .B (DOS) .IP "\fBren\fP \fIold\fR \fInew\fR" .PD 0 .IP "\fBrename\fP \fIold\fR \fInew\fR" .PD $B%U%!%$%kL>$^$?$O%G%#%l%/%H%jL>(B .I " old" $B$r(B .I " new" $B$KJQ99$7$^$9!#(B .I old $B$d(B .I " new" $B$K%o%$%k%I%+!<%I$r;XDj$7$FJ#?t$N%U%!%$%kL>$r0l3g$7$FJQ99$9$k$3$H$b$G$-$^$9!#(B .IP "\fBrem\fP [\fIarg\fR .\|.\|.]" $B2?$b$7$^$;$s!#(B .B : $B$HF1Ey$G$9!#(B .IP "\fBreturn\fP [\fIn\fR]" .I n $B$G;XDj$5$l$?JV$jCM$G4X?t$r=*N;$7$^$9!#(B .I n $B$r>JN,$7$?>l9g$OD>A0$Kl9g$K$O!"(B $B$3$N%3%^%s%I$G$=$N@_Dj$rJ]B8$7$J$$$H0J9_$N(B .B " EXECUTE_SH" $Bl9g$OJ]B8$5$l$?Cl9g$O!"(B $BFbItJQ?t$H4X?t$N0lM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$N@hF,0J30$K$"$k>l9g$bJQ?tDj5A$H$7$F07$$$^$9!#(B .IP "\fB\-m\fP" $B%8%g%V@)8f$rM-8z$K$7$^$9!#(B $B$3$N%*%W%7%g%s$O%G%U%)%k%H$GM-8z$K$J$C$F$$$^$9!#(B .B (UNIX) .IP "\fB\-n\fP" $B%3%^%s%IF~NO$rFI9~$`$@$1$Gl9g!"(B .B EOF $B$rF~NO$7$F$b%7%'%k$r=*N;$7$J$$$h$&$K$7$^$9!#(B .IP "\fBkeyword\fP" .B \-k $B$HF1Ey$G$9!#(B .IP "\fBmonitor\fP" .B \-m $B$HF1Ey$G$9!#(B .IP "\fBnoclobber\fP" .B \-C $B$HF1Ey$G$9!#(B .IP "\fBnoexec\fP" .B \-n $B$HF1Ey$G$9!#(B .IP "\fBnoglob\fP" .B \-f $B$HF1Ey$G$9!#(B .IP "\fBnotify\fP" .B \-b $B$HF1Ey$G$9!#(B .IP "\fBnounset\fP" .B \-u $B$HF1Ey$G$9!#(B .IP "\fBonecmd\fP" .B \-t $B$HF1Ey$G$9!#(B .IP "\fBphysical\fP" .B \-P $B$HF1Ey$G$9!#(B .IP "\fBptyshell\fP" .B \-T $B$HF1Ey$G$9!#(B .IP "\fBverbose\fP" .B \-v $B$HF1Ey$G$9!#(B .IP "\fBvi\fP" .B EDITMODE=vi $B$HF1Ey$G$9!#(B .IP "\fBxtrace\fP" .B \-x $B$HF1Ey$G$9!#(B .RE .RS .I option $B$,>JN,$5$l$k$H!"(B $B8=:_$N%*%W%7%g%s@_DjCM$r0lMwI=<($7$^$9!#(B .RE .IP "\fB\-P\fP" .B cd $B$d(B .B " pwd" $B%3%^%s%I$G!"(B symbolic $B%j%s%/$rC)$C$?O@M}E*$J%G%#%l%/%H%j9=B$$rMQ$$$kBe$o$j$K!"(B $BJ*M}E*$J%G%#%l%/%H%j9=B$$rMQ$$$k$h$&$K$7$^$9!#(B .IP "\fB\-S\fP" $B%3%^%s%IF~NO9T$r=hM}$9$kEY$K<+F0E*$KAH9~$_%3%^%s%I(B .B " savetty" $B$rr7o$KCl9g$OuBV$+$i99$K5?;wCl9g$N$_M-8z$G$9!#(B $BHsBPOC7?%7%'%k$H$7$F5/F0$5$l$?>l9g$O!"(B $B5/F0;~%*%W%7%g%s$G@_Dj$5$l$?>l9g$N$_M-8z$G$9!#(B $B$^$?!"(B .B fd $B$H$7$F5/F0$5$l$?>l9g$O$3$N%*%W%7%g%s$OL5;k$5$l$^$9!#(B .B (UNIX) .IP "\fB\-t\fP" $B8=:_$N%3%^%s%IF~NO9T$rH$5$l$?>l9g$K%(%i!<$H$7$F07$$$^$9!#(B .IP "\fB\-v\fP" $B%3%^%s%IF~NO$rFI9~$`EY$K$=$NF~NOJ8;zNs$rI=<($7$^$9!#(B .IP "\fB\-x\fP" $B%3%^%s%I(B .I " c" $B$K(B .I " device" $B$GI=$5$l$k%G%P%$%9%U%!%$%k$r;XDj$7$^$9!#(B $BF1;~$K!"(B .I device $B$N%I%i%$%P$G07$&%U%)!<%^%C%H$N(B $B%X%C%I(B($B%5%$%I(B)$B?t!"%;%/%??t!"%7%j%s%@(B($B%H%i%C%/(B)$B?t$r!"(B $B$=$l$>$l(B .IR " hd" , .IR sc , .I cl $B$G;XDj$7$^$9!#(B $BFCl9g!"(B .I sc $B$NCM$H$7$F(B .B " 100" $B2C$($?CM(B(108)$B$r;XDj$7$^$9!#(B .B (UNIX) PC $B>e$GF0:n$9$k(B PC-UNIX $B4D6-$G$O!"(B .IR hd , .IR sc , .I cl $B$NBe$o$j$KJ8;zNs(B .B " HDD" $B$b$7$/$O(B .B " HDD98" $B$r;XDj$9$k$3$H$G!"(B MS-DOS $B%U%m%C%T!<$G$O$J$/!"(B $B$=$l$>$l(B PC/AT $B8_495!MQ$H(B PC-98x1 $BMQ$N(B $B%O!<%I%G%#%9%/$N(B MS-DOS $B%Q!<%F%#%7%g%s$rEPO?$9$k$3$H$,$G$-$^$9!#(B $B$3$N>l9g!"(B $B%G%P%$%9%U%!%$%k$K$O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B$KBP$7$F!"(B $BF|K\8lJ8;zNs(B .I " kanji" $B$r3dEv$F$^$9!#(B .I roman $B$O(B 1byte $BJ8;z$N$_$+$i9=@.$5$l$kJ8;zNs$G!"(B .B 4 $BJ8;z$r1[$($kItJ,$OL5;k$5$l$^$9!#(B .I kanji $B$O(B 2bytes $BJ8;z$^$?$O(B 1byte $BJ8;z$+$i9=@.$5$l$kJ8;zNs$G!"(B .B 2 $BJ8;z$r1[$($kItJ,$OL5;k$5$l$^$9!#(B $B$3$N>l9g!"(B 2bytes $BJ8;z$b(B 1byte $BJ8;z$bEy$7$/(B 1 $BJ8;z$H?t$($^$9!#(B .B (UNIX) .I kanji $B$r>JN,$9$k$H!"(B $B%m!<%^;zJ8;zNs(B .I " roman" $B$KBP$9$k%m!<%^;z$+$JJQ49%F!<%V%k$N3dEv$FEPO?$r:o=|$7$^$9!#(B .B -c $B$r;XDj$9$k$H%m!<%^;z$+$JJQ49%F!<%V%k$r%/%j%"$7$F6u$K$7$^$9!#(B .B -r $B$r;XDj$9$k$H$3$l$^$G$N3dEv$FEPO?$r%j%;%C%H$7$F%m!<%^;z$+$JJQ49%F!<%V%k$r=i4|>uBV$KLa$7$^$9!#(B .B -f $B$r;XDj$9$k$H!"(B .I file $B$G<($5$l$k%U%!%$%k$+$i%m!<%^;z$+$JJQ49%F!<%V%k$N3dEv$F$rFI9~$_$^$9!#(B $B$3$N>l9g!"(B .I file $B$K$O3F9T$K(B .I " roman" $B$H(B .I " kanji" $B$NAH$r6uGrJ8;z$G6h@Z$C$F5-=R$7$F2<$5$$!#(B $B$^$?$O(B .B " printroman" $B$N=PNO$r$=$N$^$^<}$a$?%U%!%$%k$G$b9=$$$^$;$s!#(B .IP "\fBshift\fP [\fIn\fR]" .BI $ n\+1 $B0J9_$N0LCV%Q%i%a!<%?$r(B .B " $1" $B$+$i=g$K:F@_Dj$7$^$9!#(B $B85$N(B .B " $1" $B$+$i(B .BI " $" n $B$^$G$N0LCV%Q%i%a!<%?$OGK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!#(B($B%V%m%C%/C10L(B) .IP "\fB\-d\fP" $B%G!<%?%;%0%a%s%H$N:GBgCM!#(B(KB $BC10L(B) .IP "\fB\-f\fP" $B%U%!%$%k%5%$%:$N:GBgCM!#(B($B%V%m%C%/C10L(B) .IP "\fB\-l\fP" $B%a%b%j%m%C%/$N:GBgCM!#(B(KB $BC10L(B) .IP "\fB\-m\fP" $B%W%m%;%9%5%$%:$N:GBgCM!#(B(KB $BC10L(B) .IP "\fB\-n\fP" $BF1;~$K%*!<%W%s$G$-$k%U%!%$%k?t$N:GBgCM!#(B .IP "\fB\-s\fP" $B%9%?%C%/%5%$%:$N:GBgCM!#(B(KB $BC10L(B) .IP "\fB\-t\fP" CPU $B;~4V$N:GBgCM!#(B($BICC10L(B) .IP "\fB\-v\fP" $B2>A[%a%b%j$N:GBgCM!#(B(KB $BC10L(B) .PD .RE .IP "\fBumask\fP [\fInnn\fR]" $B%U%!%$%k@8@.%^%9%/CM$r(B .I " nnn" $B$K@_Dj$7$^$9!#(B .I nnn $B$r>JN,$7$?>l9g$O8=:_$N%U%!%$%k@8@.%^%9%/CM$rI=<($7$^$9!#(B .BR umask (2) $B$r;2>H$7$F2<$5$$!#(B .IP "\fBunalias\fP \fIname\fR" $B%(%$%j%"%9(B .I " name" $B$NDj5A$rC$7$^$9!#(B .I name $B$K$O%o%$%k%I%+!<%I$rMQ$$$k$3$H$,2DG=$G!"(B $B$=$N>l9g$K$O%^%C%A$9$kA4$F$N%(%$%j%"%9Dj5A$rC$7$^$9!#(B "\(**" $B$r;XDj$9$l$P!"A4%(%$%j%"%9Dj5A$,L58z$K$J$j$^$9!#(B .IP "\fBunset\fP [\fINAME\fR .\|.\|.]" $B3F!9$N(B .I " NAME" $B$KBP$7$FDj5A$5$l$F$$$kFbItJQ?t$d4X?t$NDj5A$r:o=|$7$^$9!#(B $BC"$72<5-$NJQ?tDj5A$O:o=|$G$-$^$;$s!#(B .RS 20 .ta 1i 2i 3i .nf .ft B PATH PS1 PS2 IFS MAILCHECK PPID .ft R .fi .RE .IP "\fBunsetdrv\fP \fIc\fR \fIdevice\fR \fIhd\fR \fIsc\fR \fIcl\fR" $B4{$KEPO?$5$l$F$$$k%U%m%C%T!<%I%i%$%V$NEPO?$r:o=|$7$^$9!#(B .IR device , .IR hd , .IR sc , .I cl $B$NA4$F$,0lCW$7$?EPO?$N$_:o=|$5$l$k$N$G!"(B $B$h$/3NG'$7$F:o=|$7$F2<$5$$!#(B .B (UNIX) .B setdrv $B;~$K(B .B " HDD" $B$^$?$O(B .B " HDD98" $B$GEPO?$7$?>l9g$K$O!"(B .IR hd , .IR sc , .I cl $B$NBe$o$j$K$=$l$>$l(B .B " HDD" $B5Z$S(B .B " HDD98" $B$r5-=R$7$^$9!#(B .IP "\fBwait\fP [\fIpid\fR \(bv \fIjob\fR]" $B%W%m%;%9HV9f(B .I " pid" $B$GI=$5$l$k%W%m%;%9$^$?$O(B .I " job" $B$GI=$5$l$k%8%g%V$rBT$A!"$=$N=*N;%9%F!<%?%9$rJV$7$^$9!#(B .I pid $B$b(B .I " job" $B$b;XDj$7$J$$>l9g$O2TF/Cf$NA4%8%g%V$rBT$A$^$9!#(B .B (UNIX) .IP "\fByesno\fP [\fIprompt\fR]" $BCl9g$K$O(B .B " 0" $B$r!"(B .B n $B$,F~NO$5$l$?>l9g$K$O(B .B " 255" $B$r$=$l$>$lJV$7$^$9!#(B .B y $B$^$?$O(B .B " n" $B$rF~NO$9$kBe$o$j$KI=<($5$l$F$$$k(B .B " [Y/N]" $B$NJ8;z$r%+!<%=%k$GA*$s$G(B .RB " [" Return ] $B$r2!$9$H!"(B $BA*Br$5$l$?J8;z$rF~NO$7$?$3$H$K$J$j$^$9!#(B .RB [ Space ] $B$^$?$O(B .RB " [" Esc ] $B$NF~NO$O(B .B " n" $B$rF~NO$7$?$3$H$K$J$j$^$9!#(B .I prompt $B$,;XDj$5$l$?>l9g$K$O(B .B " [Y/N]" $B$NI=<($NA0$K$=$NJ8;zNs$rI=<($7$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!"5/F0$5$l$?(B .B " fd" $B$NB8:_$9$k%G%#%l%/%H%j$K$J$$>l9g$O!"(B $B4A;z$N%U%!%$%kL>$O(B LFN $B7A<0$G$O07$($^$;$s!#(B $B5U$K!"BgJ8;z$N%I%i%$%VL>$rMQ$$$k$H!"(B LFN $B$rL5;k$7$F(B 8+3 $B7A<0$N%U%!%$%kL>$r07$$$^$9!#(B $B$3$N%I%i%$%VL>$NBg>.$K$h$k;EMM$O!"(B MS-DOS $BHG$K$b$=$N$^$^7Q>5$5$l$F$$$^$9!#(B .SS "URL $B%I%i%$%V(B (UNIX)" $B%G%#%l%/%H%jL>$H$7$F(B URL $BJ8;zNs$rMQ$$$k$3$H$G!"(B $B%M%C%H%o!<%/>e$N%j%b!<%H%5!<%S%9$K%"%/%;%9$9$k$3$H$,$G$-$^$9!#(B URL $B$N=q<0$O(B \fIscheme\fR\fB://\fP[\fIuser\fR[\fB:\fP\fIpassword\fR]\fB@\fP]\fIhost\fR[\fB:\fP\fIport\fR]\fB/\fP\fIdirectory\fR\fB/\fP $B$G$9!#(B .I scheme $B$K$O(B .B " ftp" $B$^$?$O(B .B " http" $B$,;XDj$G$-$^$9!#(B .I host $B$K$O%j%b!<%H%[%9%H$NL>A0$^$?$O(B IP $B%"%I%l%9$r;XDj$7$^$9!#(B .I port $B$K$O(B TCP $B%]!<%HHV9f$r;XDj$7$^$9!#(B .I port $B$r>JN,$9$k$H4{Dj%]!<%HHV9f$rMQ$$$^$9!#(B .B ftp $B$N4{Dj%]!<%HHV9f$O(B .BR " 21" $B!"(B .B http $B$N4{Dj%]!<%HHV9f$O(B .B " 80" $B$G$9!#(B .I user $B5Z$S(B .I " password" $B$K$O!"(B $B%j%b!<%H%[%9%H$K@\B3$9$k$?$a$N%"%+%&%s%H>pJs$r5-=R$G$-$^$9!#(B .I user $B$r>JN,$9$k$H!"(B .B ftp $B$N>l9g$O(B anonymous FTP $B$K$h$k@\B3$r9T$J$$!"(B .B http $B$N>l9g$OI,MW$K1~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set" $B$H$$$&J8;zNs$rI=<($7$^$9!#(B .IP "\fB${\fP\fINAME\fR\fB:\+\fP\fIword\fR\fB}\fP" $BFbItJQ?t!"$^$?$O4D6-JQ?t(B .I " NAME" $B$K%J%k0J30$NCM$,@_Dj$5$l$F$$$l$P(B .I " word" $B$KCV$-49$o$j!"(B $B$=$&$G$J$1$l$P%J%k$KCV$-49$o$j$^$9!#(B .IP "\fB${\fP\fINAME\fR\fB\-\fP\fIword\fR\fB}\fP" $BFbItJQ?t!"$^$?$O4D6-JQ?t(B .I " NAME" $B$KCM$,@_Dj$5$l$F$$$l$P$=$NCM$KCV$-49$o$j!"(B $B$=$&$G$J$1$l$P(B .I " word" $B$KCV$-49$o$j$^$9!#(B .IP "\fB${\fP\fINAME\fR\fB=\fP\fIword\fR\fB}\fP" $BFbItJQ?t!"$^$?$O4D6-JQ?t(B .I " NAME" $B$KCM$,@_Dj$5$l$F$$$l$P$=$NCM$KCV$-49$o$j!"(B $B$=$&$G$J$1$l$P(B $BFbItJQ?t(B .I " NAME" $B$K(B .I " word" $B$rBeF~$7!"(B $B$3$N<0<+BN$O(B .I " word" $B$KCV$-49$o$j$^$9!#(B $BC"$7!"(B $B0LCV%Q%i%a!<%?$K$OBeF~$G$-$^$;$s!#(B .IP "\fB${\fP\fINAME\fR\fB?\fP\fIword\fR\fB}\fP" $BFbItJQ?t!"$^$?$O4D6-JQ?t(B .I " NAME" $B$KCM$,@_Dj$5$l$F$$$l$P$=$NCM$KCV$-49$o$j!"(B $B$=$&$G$J$1$l$P(B .I " word" $B$rI=<($7$F%7%'%k$+$iH4$1$^$9!#(B .I word $B$,>JN,$5$l$?>l9g$O!"(B $BBe$o$j$K(B .B " parameter null or not set" $B$H$$$&J8;zNs$rI=<($7$^$9!#(B .IP "\fB${\fP\fINAME\fR\fB\+\fP\fIword\fR\fB}\fP" $BFbItJQ?t!"$^$?$O4D6-JQ?t(B .I " NAME" $B$KCM$,@_Dj$5$l$F$$$l$P(B .I " word" $B$KCV$-49$o$j!"(B $B$=$&$G$J$1$l$P%J%k$KCV$-49$o$j$^$9!#(B .IP "\fB${#\fP\fINAME\fR\fB}\fP" $BFbItJQ?t!"$^$?$O4D6-JQ?t(B .I " NAME" $B$NCM$NJ8;z?t$KCV49$o$j$^$9!#(B .I NAME $B$,(B .B " *" $B$^$?$O(B .B " @" $B$N>l9g$OJ8;z?t$G$J$/0LCV%Q%i%a!<%?$N?t$KCV49$o$j$^$9!#(B .IP "\fB${\fP\fINAME\fR\fB%\fP\fIword\fR\fB}\fP" $BFbItJQ?t!"$^$?$O4D6-JQ?t(B .I " NAME" $B$NCM$N:G8eHx$+$i(B .I " word" $B$G<($5$l$k%Q%?!<%s$K0lCW$9$k:G$bC;$$ItJ,$r:o=|$7$?J8;zNs$KCV49$o$j$^$9!#(B .I NAME $B$,(B .B " *" $B$^$?$O(B .B " @" $B$N>l9g$O3F!9$N0LCV%Q%i%a!<%?$K$D$$$FCV49$($,9T$J$o$l$^$9!#(B (MS-DOS $BHG$G$O(B .B " %" $B$NBe$o$j$K(B .B " \e" $B$rMQ$$$^$9!#(B) .IP "\fB${\fP\fINAME\fR\fB%%\fP\fIword\fR\fB}\fP" $BFbItJQ?t!"$^$?$O4D6-JQ?t(B .I " NAME" $B$NCM$N:G8eHx$+$i(B .I " word" $B$G<($5$l$k%Q%?!<%s$K0lCW$9$k:G$bD9$$ItJ,$r:o=|$7$?J8;zNs$KCV49$o$j$^$9!#(B .I NAME $B$,(B .B " *" $B$^$?$O(B .B " @" $B$N>l9g$O3F!9$N0LCV%Q%i%a!<%?$K$D$$$FCV49$($,9T$J$o$l$^$9!#(B (MS-DOS $BHG$G$O(B .B " %%" $B$NBe$o$j$K(B .B " \e\e" $B$rMQ$$$^$9!#(B) .IP "\fB${\fP\fINAME\fR\fB#\fP\fIword\fR\fB}\fP" $BFbItJQ?t!"$^$?$O4D6-JQ?t(B .I " NAME" $B$NCM$N@hF,$+$i(B .I " word" $B$G<($5$l$k%Q%?!<%s$K0lCW$9$k:G$bC;$$ItJ,$r:o=|$7$?J8;zNs$KCV49$o$j$^$9!#(B .I NAME $B$,(B .B " *" $B$^$?$O(B .B " @" $B$N>l9g$O3F!9$N0LCV%Q%i%a!<%?$K$D$$$FCV49$($,9T$J$o$l$^$9!#(B .IP "\fB${\fP\fINAME\fR\fB##\fP\fIword\fR\fB}\fP" $BFbItJQ?t!"$^$?$O4D6-JQ?t(B .I " NAME" $B$NCM$N@hF,$+$i(B .I " word" $B$G<($5$l$k%Q%?!<%s$K0lCW$9$k:G$bD9$$ItJ,$r:o=|$7$?J8;zNs$KCV49$o$j$^$9!#(B .I NAME $B$,(B .B " *" $B$^$?$O(B .B " @" $B$N>l9g$O3F!9$N0LCV%Q%i%a!<%?$K$D$$$FCV49$($,9T$J$o$l$^$9!#(B .IP "\fB\e\fP\fIc\fR" $BJ8;z(B .I " c" $B<+?H$r<($7$^$9!#(B $B>e5-$N(B .B " ~" $B$d(B .B " $" $B$J$I$N%a%?%-%c%i$rI>2A$;$:$K$=$N$^$^J8;z$H$7$F;H$$$?$$;~$KMQ$$$^$9!#(B .B \e $B<+?H$O(B "\fB\e\e\fP" $B$HI=$7$^$9!#(B $BC"$7!"(BMS-DOS $BHG$G$O!"%Q%9L>%G%j%_%?$KMQ$$$i$l$k(B .B " \e" $B$ODL>oJ8;z$HF1MM$K=hM}$5$l$J$/$F$O$J$i$J$$$?$a!"(B $BJX59>e(B .BI " %" c $B$N7A$G(B .B " \e" $B$NBeMQ$H$7$^$9!#(B .PP .PD $B0J9_$O(B .B " EXECUTE_SH" $B$d(B .B " EXECUTE_FILE" $B$G2A$7$^$9!#(B .IP "\fB$((\fP\fIexpression\fR\fB))\fP" $B?t<0(B .I " expression" $B$rI>2A$7$=$N7k2L$N?tCM$KCV$-49$o$j$^$9!#(B .I expression $B$K$O?tCM$dJQ?t$NB>!"(B $B0J2<$N1i;;;R$rMQ$$$?@0?t1i;;$r5-=R$G$-$^$9!#(B .RS 12 .ta 1.8i 2.6i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.RS 18 .ta 1.5i .nf \fBSJIS\fP, \fBsjis\fP Shift JIS \fBEUC\fP, \fBeuc\fP EUC $B4A;z(B \fBJIS\fP, \fBjis\fP 7bit JIS \fBJIS8\fP, \fBjis8\fP 8bit JIS \fBJUNET\fP, \fBjunet\fP ISO-2022-JP \fBOJIS\fP, \fBojis\fP 7bit JIS (JIS C6226-1978 + roman) \fBOJIS8\fP, \fBojis8\fP 8bit JIS (JIS C6226-1978 + roman) \fBOJUNET\fP, \fBojunet\fP ISO-2022-JP (JIS C6226-1978 + roman) \fBHEX\fP, \fBhex\fP HEX \fBCAP\fP, \fBcap\fP CAP \fBUTF8\fP, \fButf8\fP UTF-8 \fBUTF8-mac\fP, \fBmac\fP Mac OS X $BMQ(B UTF-8 \fBUTF8-iconv\fP iconv $BMQ(B UTF-8 $B%G%U%)%k%H(B $BJQ49$7$J$$(B .fi .RE .IP "\fBDIRCOUNTLIMIT\fP" $B%D%j!e8B?t$r@_Dj$7$^$9!#(B $B8e$m$K(B .RB " '" > ' $B$N$D$$$?%G%#%l%/%H%j$G$"$C$F$b!"(B $B$=$NCf$K%5%V%G%#%l%/%H%j$,0l$D$b$J$1$l$P!"(B $BE83+$7$F$b%D%j!<9=B$$OJQ2=$7$^$;$s!#(B $B%G%#%l%/%H%jFb$N%U%!%$%k?t(B ($B%G%#%l%/%H%j$b4^$`(B) $B$,$3$N?tCM0JFb$G$"$l$P!"(B $B0l$D$b%5%V%G%#%l%/%H%j$r;}$?$J$$%G%#%l%/%H%j$K$O!"(B $B:G=i$+$i(B .RB " '" > ' $B$r$D$1$^$;$s!#(B $B$^$?!"2hLL1&$KI=<($5$l$k%G%#%l%/%H%jFb%U%!%$%k$N0lMw$b!"(B $B$3$N?tCM$r1[$($F$OI=<($7$J$$$h$&$K$J$j$^$9!#(B $B=hM}$NCY$$%^%7%s$G$O!"$3$NCM$r(B .B " 0" $B$K$7$F$*$1$P!"(B $B2wE,$J=hM}B.EY$,H$G$-$k(B $B%G%#%l%/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$5$l$?>l9g$KDI2C$GFI9~$`=i4|@_Dj%U%!%$%k$r;XDj$7$^$9!#(B $B%U%!%$%kL>$O%U%k%Q%9$G;XDj$9$kI,MW$,$"$j$^$9!#(B $B$3$NCM$,@_Dj$5$l$F$$$?>l9g!"(B .B /etc/fd2rc $B$rFI9~$s$@8e!"(B .B .fd2rc $B$d(B .B " .fdshrc" $B$rFI9~$`A0$K!"(B $B$=$N=i4|@_Dj%U%!%$%k$rFI9~$_$^$9!#(B $BC"$7!"(B $Bl9g$d!"(B $Bl9g$K$O!"(B $B$3$NCM$OL5;k$5$l$^$9!#(B .IP "\fBFCEDIT\fP" $BAH9~$_%3%^%s%I(B .B " fc" $B$G;HMQ$9$k%(%G%#%?%3%^%s%I$r;XDj$7$^$9!#(B .IP "\fBFD_VERSION\fP" $B$KMQ$$$k4A;z%3!<%I$r;XDj$7$^$9!#(B $B%U%!%$%k%"%/%;%9$r9T$J$&;~E@$G(B $B$3$3$G@_Dj$7$?4A;z%3!<%I$K%3%s%P!<%H$5$l$^$9$N$G!"(B $B%M%C%H%o!<%/>e$N4A;z%3!<%I$N0[$J$k%^%7%s$+$i!"(B $B4A;z$G=q$+$l$?%U%!%$%k$r;2>H$9$k$3$H$b2DG=$G$9!#(B $B$^$?!"(B $B%"!<%+%$%V%V%i%&%6$dAH9~$_%3%^%s%I(B .B " browse" $B$,%U%!%$%kL>$r$$$^$9!#(B $B$3$N$&$A(B .BR " JIS8" , .BR JUNET , .BR HEX , .B CAP $BEy$O(B Samba $B$GMQ$$$i$l$F$$$k4A;z%3!<%I$G$9!#(B .B (UNIX) .RS 18 .ta 1.5i .nf \fBSJIS\fP, \fBsjis\fP Shift JIS \fBEUC\fP, \fBeuc\fP EUC $B4A;z(B \fBJIS\fP, \fBjis\fP 7bit JIS \fBJIS8\fP, \fBjis8\fP 8bit JIS \fBJUNET\fP, \fBjunet\fP ISO-2022-JP \fBOJIS\fP, \fBojis\fP 7bit JIS (JIS C6226-1978 + roman) \fBOJIS8\fP, \fBojis8\fP 8bit JIS (JIS C6226-1978 + roman) \fBOJUNET\fP, \fBojunet\fP ISO-2022-JP (JIS C6226-1978 + roman) \fBHEX\fP, \fBhex\fP HEX \fBCAP\fP, \fBcap\fP CAP \fBUTF8\fP, \fButf8\fP UTF-8 \fBUTF8-mac\fP, \fBmac\fP Mac OS X $BMQ(B UTF-8 \fBUTF8-iconv\fP iconv $BMQ(B UTF-8 $B%G%U%)%k%H(B $BJQ49$7$J$$(B .fi .RE .IP "\fBFREQFILE\fP" $B$+$J4A;zJQ493X=,MQ$N%f!<%6JQ49IQEY%U%!%$%k$r;XDj$7$^$9!#(B $B%U%!%$%kL>$,L$;XDj$N>l9g$OIQEY>pJs$OJ]B8$b;2>H$b$5$l$^$;$s!#(B $B%G%U%)%k%HCM$O(B .B " ~/.fd_freq" $B$G$9!#(B .B (UNIX) .IP "\fBFREQUMASK\fP" $B$+$J4A;zJQ493X=,MQ$N%f!<%6JQ49IQEY%U%!%$%k$N%U%!%$%k:n@.%^%9%/CM$r(B 8 $B?J?t$G;XDj$7$^$9!#(B $B%f!<%6JQ49IQEY%U%!%$%k$O99?7;~$K>e=q$-$;$:$K:n@.$7D>$9$?$a!"(B $B$3$NCM$O4{B8%U%!%$%k$,B8:_$9$k;~$K$bMQ$$$i$l$^$9!#(B $BC"$7!"(B $BAH9~$_%3%^%s%I(B .B " umask" $B$G@_Dj$7$?%^%9%/CM$,M%@h$5$l$^$9$N$G!"(B $B$r;XDj$7$^$9!#(B $BC"$7!"(B $B%U%k%Q%9$G;XDj$5$l$J$+$C$?>l9g$d%m%0%U%!%$%k$r3JG<$9$k%G%#%l%/%H%j$,MQ0U$5$l$F$$$J$$>l9g$O%m%0=PNO$r9T$J$$$^$;$s!#(B $B%G%U%)%k%HCM$OL$;XDj$G$9!#(B .B (UNIX) .IP "\fBFTPPROXY\fP" URL $B%I%i%$%V$G(B FTP $B@\B3$r9T$J$&:]$K!"(B $B%W%m%-%7%5!<%P$H$7$FMQ$$$k(B URL $B$r;XDj$7$^$9!#(B URL $B$N=q<0$O(B \fIscheme\fR\fB://\fP[\fIuser\fR[\fB:\fP\fIpassword\fR]\fB@\fP]\fIhost\fR[\fB:\fP\fIport\fR] $B$G$9!#(B .I scheme $B$K$O(B .B " ftp" $B$^$?$O(B .B " http" $B$,;XDj$G$-$^$9!#(B .I user $B5Z$S(B .I " password" $B$K$O!"(B $B%W%m%-%7%5!<%P$K@\B3$9$k$?$a$N%"%+%&%s%H>pJs$r5-=R$G$-$^$9!#(B $B%G%U%)%k%HCM$OL$;XDj$G$9!#(B .B (UNIX) .IP "\fBFUNCLAYOUT\fP" $B%U%!%s%/%7%g%s9T$N%l%$%"%&%H$r(B .I " n" * 100 + .I size $B$H$$$&7A<0$NCM$G;XDj$7$^$9!#(B .I n $B$O%U%!%s%/%7%g%s9T$KI=<($9$k%U%!%s%/%7%g%s%-!<$N?t$rI=$7$^$9!#(B .I size $B$O%U%!%s%/%7%g%s%-!<$rI=<($9$k%V%m%C%/C10L$rI=$7$^$9!#(B $B%G%U%)%k%HCM$O(B .B 1005 (10 $B8D$N%U%!%s%/%7%g%s%-!<$r(B 5 $B8DC10L$G$^$H$a$FI=<((B) $B$G$9!#(B .IP "\fBHIDEPASSWD\fP" URL $B%I%i%$%V$G%Q%9%o!<%IF~NO$r9T$J$&:]$K!"(B $BF~NOJ8;z$NBe$o$j$K(B .B " *" $B$rI=<($9$k$N$rM^@)$7!"(B $B2?$bI=<($7$J$$$h$&$K$7$^$9!#(B .B 0 $B$+%J%k0J30$NCM$G$"$l$P!"2?$rDj5A$7$F$bM-8z$G$9!#(B .B (UNIX) .IP "\fBHISTFILE\fP" .B EXECUTE_FILE $B$d(B .B " EXECUTE_SH" $B$G;2>H$G$-$k%3%^%s%IMzNr$N%;!<%V%U%!%$%k$r;XDj$7$^$9!#(B $B%U%!%$%kL>$,L$;XDj$N>l9g$O%3%^%s%IMzNr$O%;!<%V$b%m!<%I$b$5$l$^$;$s!#(B $B%G%U%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N$G!"(B $BpJs$,I=<($5$l$^$9!#(B $BC"$7!"(B $B2hLL$N2#I}$,(B .B 80 $B7e0J>e$J$$>l9g$K$O$3$N;XDj$OL58z$H$J$j$^$9!#(B .B 0 $B$+%J%k0J30$NCM$G$"$l$P!"2?$rDj5A$7$F$bM-8z$G$9!#(B .IP "\fBUNICODEBUFFER\fP" UNICODE $BJQ49%F!<%V%k$r%*%s%a%b%j$G;}$AB3$1$k$h$&$K$7$^$9!#(B $B%U%m%C%T!<%I%i%$%V$N%"%/%;%9$d(B UTF-8 $B$NJQ49$,9bB.2=$9$k$N$G!"(B $B%a%b%j;q8;$,=aBt$K$"$k4D6-$G$OM-MQ$G$7$g$&!#(B .B 0 $B$+%J%k0J30$NCM$G$"$l$P!"2?$rDj5A$7$F$bM-8z$G$9!#(B .IP "\fBURLDRIVE\fP" URL $B%I%i%$%V5!G=$rM-8z$K$7$^$9!#(B .B 0 $B$+%J%k0J30$NCM$G$"$l$P!"2?$rDj5A$7$F$bM-8z$G$9!#(B .B (UNIX) .IP "\fBURLKCODE\fP" URL $B%I%i%$%V$G%[%9%HB&$N%U%!%$%kL>$KMQ$$$k4A;z%3!<%I$r;XDj$7$^$9!#(B $B$3$N$&$A(B .BR " JIS8" , .BR JUNET , .BR HEX , .B CAP $BEy$O(B Samba $B$GMQ$$$i$l$F$$$k4A;z%3!<%I$G$9!#(B .B (UNIX) .RS 18 .ta 1.5i .nf \fBSJIS\fP, \fBsjis\fP Shift JIS \fBEUC\fP, \fBeuc\fP EUC $B4A;z(B \fBJIS\fP, \fBjis\fP 7bit JIS \fBJIS8\fP, \fBjis8\fP 8bit JIS \fBJUNET\fP, \fBjunet\fP ISO-2022-JP \fBOJIS\fP, \fBojis\fP 7bit JIS (JIS C6226-1978 + roman) \fBOJIS8\fP, \fBojis8\fP 8bit JIS (JIS C6226-1978 + roman) \fBOJUNET\fP, \fBojunet\fP ISO-2022-JP (JIS C6226-1978 + roman) \fBHEX\fP, \fBhex\fP HEX \fBCAP\fP, \fBcap\fP CAP \fBUTF8\fP, \fButf8\fP UTF-8 \fBUTF8-mac\fP, \fBmac\fP Mac OS X $BMQ(B UTF-8 \fBUTF8-iconv\fP iconv $BMQ(B UTF-8 $B%G%U%)%k%H(B $BJQ49$7$J$$(B .fi .RE .IP "\fBURLOPTIONS\fP" URL $B%I%i%$%V$G%[%9%H$HDL?.$r9T$J$&:]$NDL?.%*%W%7%g%s$r;XDj$7$^$9!#(B FTP $BDL?.$N:]$K(B PASV, PORT, MDTM, FEAT $B$N3F%3%^%s%I$r6X;_$9$k$+H]$+!"(B $B$^$?(B HTTP $BDL?.$N:]$K@53N$J%U%!%$%k>pJs$r$lFHN)$KA*Br$G$-$^$9!#(B HTTP $B%W%m%H%3%k$G$O!"(B $B%U%!%$%k>pJs$r$^$H$a$FpJs$rJ,$NDL?.;~4V$rMW$7$^$9!#(B $B%G%U%)%k%HCM$O(B .B " 0" $B$G$9!#(B $B@_Dj$9$kCM$O0J2<$N$H$*$j!#(B .B (UNIX) .RS 18 .ta 0.5i 1.3i 2.1i 2.9i 3.7i .nf \fB0\fP $BI8=`(B \fB1\fP PASV \fB2\fP PORT \fB3\fP PASV & PORT \fB4\fP MDTM \fB5\fP PASV & MDTM \fB6\fP PORT & MDTM \fB7\fP PASV & PORT & MDTM \fB8\fP FEAT \fB9\fP PASV & FEAT \fB10\fP PORT & FEAT \fB11\fP PASV & PORT & FEAT \fB12\fP MDTM & FEAT \fB13\fP PASV & MDTM & FEAT \fB14\fP PORT & MDTM & FEAT \fB15\fP PASV & PORT & MDTM & FEAT \fB16\fP HTTP \fB17\fP PASV & HTTP \fB18\fP PORT & HTTP \fB19\fP PASV & PORT & HTTP \fB20\fP MDTM & HTTP \fB21\fP PASV & MDTM & HTTP \fB22\fP PORT & MDTM & HTTP \fB23\fP PASV & PORT & MDTM & HTTP \fB24\fP FEAT & HTTP \fB25\fP PASV & FEAT & HTTP \fB26\fP PORT & FEAT & HTTP \fB27\fP PASV & PORT & FEAT &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tbl .B fd $B$N5/F0%G%#%l%/%H%j$K%$%s%9%H!<%k$5$l$k(B UNICODE $BJQ49%F!<%V%k(B .TP .B fd\-dict.tbl .B fd $B$N5/F0%G%#%l%/%H%j$K%$%s%9%H!<%k$5$l$k$+$J4A;zJQ49<-=q%U%!%$%k(B .TP .B fd2rc .B fd $B$N5/F0%G%#%l%/%H%j$KMQ0U$7$F$*$/(B MS-DOS $BHG$G$N6&DL(B .B " fd" $B=i4|@_Dj%U%!%$%k(B .TP .B $HOME\efd2.rc MS-DOS $BHG$G$N8D?MMQ$N(B .B " fd" $B=i4|@_Dj%U%!%$%k(B .TP .B $HOME\efdsh.rc MS-DOS $BHG$G$N8D?MMQ$N(B .B " fdsh" $B=i4|@_Dj%U%!%$%k(B .TP .B $HOME\efd.hst MS-DOS $BHG$G$N%3%^%s%IMzNr$N%;!<%V%U%!%$%k4{DjCM(B .PD .SH $B@)8B;v9`(B $BCl9g$O!"(B $B$=$N5!G=$rMQ$$$?%-!<$N$G05=L$7$F$"$k>l9g$O!"(B $B%"!<%+%$%V%V%i%&%6$,@5>o$KF/$-$^$;$s!#(B $B%"!<%+%$%V%U%!%$%kFb$N(B symbolic $B%j%s%/$O8DJL$KE83+$G$-$^$;$s!#(B $B%f!<%6%$%s%?%U%'!<%9$,CU@[$G$9!#(B .SH $BCx:n8"(B Copyright (C) 1995-2019 by Takashi SHIRAI FD-3.01j/fd.cat100644 2105 1751 703023 13516612560 12010 0ustar shiraiuserFD(1) UNIX-OS Programmer's Manual FD(1) $BL>(B$BL>>N(B$B>N(B fd - $B%U%!%$%k!&%G%#%l%/%H%j4IM}%D!<%k(B $B7A(B$B7A<0(B$B<0(B ffdd [ --aabbCCeeffhhiikkllmmNNnnPPrrSSssTTttuuvvxx ] [ --_N_A_M_E==_v_a_l_u_e ] [ _d_i_r_e_c_t_o_r_y [ _d_i_r_e_c_t_o_r_y_2 _._._. ]] ffddsshh [ --aabbCCcceeffhhiikkllmmNNnnPPrrSSssTTttuuvv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r%^!<%/H?E>(B EEnndd(-) MMAARRKK_FFIINNDD $B8!:w$7$?%U%!%$%k$K%^!<%/(B ** IINN_DDIIRR $B%5%V%G%#%l%/%H%j$K0\F0(B RReettuurrnn OOUUTT_DDIIRR $B?F%G%#%l%/%H%j$K0\F0(B BBss LLOOGG_TTOOPP $B%k!<%H%G%#%l%/%H%j$K0\F0(B \\ RREERREEAADD_DDIIRR $BI=<(2hLL$N:FIA2h(B ^^LL PPUUSSHH_FFIILLEE $B%U%!%$%k$r%9%?%C%/$K@Q$`(B DDeell(]) PPOOPP_FFIILLEE $B%U%!%$%k$r%9%?%C%/$+$i$NJQ99(B FF55(r) SSOORRTT_DDIIRR $B%U%!%$%k$N%=!<%H(B FF66(s) FFIINNDD_FFIILLEE $B%U%!%$%k$N8!:w(B FF77(f) TTRREEEE_DDIIRR $B%G%#%l%/%H%j$N%D%j!pJsI=<((B FF1122(i) MMOOVVEE_FFIILLEE $B%U%!%$%k$N0\F0(B FF1133(m) DDEELLEETTEE_DDIIRR $B%G%#%l%/%H%j$N:o=|(B FF1144(D) MMAAKKEE_DDIIRR $B%G%#%l%/%H%j$N:n@.(B FF1155(k) EEXXEECCUUTTEE_SSHH $B;R%W%m%;%9$N$NA0J}8!:w(B ^^SS SSEEAARRCCHH_BBAACCKK $B%U%!%$%kL>$N8eJ}8!:w(B ^^RR SSPPLLIITT_WWIINNDDOOWW $B%&%#%s%I%&$NJ,3d(B // NNEEXXTT_WWIINNDDOOWW $B%&%#%s%I%&4V$N0\F0(B ^^ WWIIDDEENN_WWIINNDDOOWW $B%&%#%s%I%&$N3HD%(B WW NNAARRRROOWW_WWIINNDDOOWW $B%&%#%s%I%&$N=L>.(B NN KKIILLLL_WWIINNDDOOWW $B%&%#%s%I%&$NGK4~(B KK EEDDIITT_CCOONNFFIIGG $B%+%9%?%^%$%6$N5/F0(B EE HHEELLPP_MMEESSSSAAGGEE $B%X%k%W2hLL$NI=<((B ?? QQUUIITT_SSYYSSTTEEMM fd $B$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HsI=<(%b!<%I$G$O!"%U%!%s%/%7%g%s9T$N:8(B $BC<$K(B 'HH'(Hidden) $B$HI=<($5$l$^$9!#(B $B%U(B$B%U%!(B$B%!%$(B$B%$%k(B$B%k%U(B$B%U%i(B$B%i%0(B$B%0I=(B$BI=<((B$B<($N(B$B$N@Z(B$B@ZBX(B$BBX$((B$B$((B $B3F%U%!%$%k$N%U%!%$%k%b!<%I$NBe$o$j$K!"0lIt$N(B OS $B$K$"(B $B$k%U%!%$%k%U%i%0$rI=<($7$^$9!#%H%0%k%9%$%C%A$G%U%!%$(B $B%k%U%i%0$NI=<($H%U%!%$%k%b!<%I$NI=<($r@ZBX$($^$9!#%U(B $B%!%$%k%U%i%0$N$J$$(B OS $B$G$O5!G=$7$^$;$s!#3F%7%s%\%k$N(B $B0UL#$O=g$K0J2<$N$H$*$j!#(B((UUNNIIXX)) AA Archived NN Nodump aa system Append-only cc system unChangable (immutable) uu system Undeletable aa user Append-only cc user unChangable (immutable) uu user Undeletable $B%U%!%$%k%U%i%0I=<(%b!<%I$G$O!"%U%!%s%/%7%g%s9T$N:8C<(B $B$K(B 'FF'(Flags) $B$HI=<($5$l$^$9!#(B $B%U(B$B%U%!(B$B%!%$(B$B%$%k(B$B%kL>(B$BL>$N(B$B$N8!(B$B8!:w(B$B:w(B $B%+%l%s%H%G%#%l%/%H%jFb$G%U%!%$%kL>$r%$%s%/%j%a%s%?%k(B $B%5!<%A$7!"%+!<%=%k$r0\F0$7$F$$$-$^$9!#%3%^%s%I$r$r%-!<(B $BF~NO$7$F$$$/$H!"$=$N;~E@$GF~NO$5$l$F$$$kJ8;zNs$K%^%C(B $B%A$9$k%U%!%$%kL>$K%+!<%=%k$,=go%b!<%I$KI|5"$G$-$^$9!#(B $B%&(B$B%&%#(B$B%#%s(B$B%s%I(B$B%I%&(B$B%&$N(B$B$NJ,(B$BJ,3d(B$B3d(B $B8=:_$N%&%#%s%I%&$rJ,3d$7$^$9!#DL>o$N%&%#%s%I%&HsJ,3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NAH9~$_%3%^%s%I$,MQ0U$5$l$F$$$^$9!#$3$l$i$NAH9~(B $B$_%3%^%s%I$O!"(BEEXXEECCUUTTEE_SSHH $B$d=i4|@_Dj%U%!%$%k$NCf$GMQ$$$k$3$H(B $B$,$G$-$^$9!#(B iiff _l_i_s_t tthheenn [eelliiff _l_i_s_t tthheenn _l_i_s_t] ... [eellssee _l_i_s_t] ffii iiff $B@a5Z$S(B eelliiff $B@a$N(B _l_i_s_t $B$,@hF,$+$i=g$Kl9g!"(Beellssee $B@a$N(B _l_i_s_t $B$,l9g$O!"(Biiff $B$O=*N;%9%F!<%?%9(B 00 $B$rJV$7$^$9!#(B wwhhiillee _l_i_s_t ddoo _l_i_s_t ddoonnee wwhhiillee $B@a$N(B _l_i_s_t $B$,7+JV$7l9g$O!"(Bwwhhiillee $B$O=*N;%9%F!<%?%9(B 00 $B$rJV(B $B$7$^$9!#(B uunnttiill _l_i_s_t ddoo _l_i_s_t ddoonnee uunnttiill $B@a$N(B _l_i_s_t $B$,7+JV$7l9g$O!"(Buunnttiill $B$O=*N;%9%F!<%?%9(B 00 $B$rJV(B $B$7$^$9!#(B ffoorr _N_A_M_E [iinn _v_a_l_u_e ...] ddoo _l_i_s_t ddoonnee _v_a_l_u_e $B%j%9%H$NCM$r0l$D$:$D=g$KFbItJQ?t(B _N_A_M_E $B$K(B $BBeF~$7!"$=$N$=$l$>$l$K$D$$$F%3%^%s%I%j%9%H(B _l_i_s_t $B$rJN,$9$k$H!"0LCV(B $B%Q%i%a!<%?$r=g$KBeF~$7$^$9!#(B ccaassee _w_o_r_d iinn [_p_a_t_t_e_r_n [|| _p_a_t_t_e_r_n] ... )) _l_i_s_t ;;;;] ... eessaacc $BJ8;zNs(B _w_o_r_d $B$H3F%Q%?!<%s(B _p_a_t_t_e_r_n $B$H$rHf3S$7!"(B $B:G=i$K%^%C%A$7$?(B _p_a_t_t_e_r_n $B$KBP1~$9$k%3%^%s%I%j(B $B%9%H(B _l_i_s_t $B$ruBV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#(B nnoottiiffyy --bb $B$HF1Ey$G$9!#(B nnoouunnsseett --uu $B$HF1Ey$G$9!#(B oonneeccmmdd --tt $B$HF1Ey$G$9!#(B pphhyyssiiccaall --PP $B$HF1Ey$G$9!#(B ppttyysshheellll --TT $B$HF1Ey$G$9!#(B vveerrbboossee --vv $B$HF1Ey$G$9!#(B vvii EEDDIITTMMOODDEE==vvii $B$HF1Ey$G$9!#(B xxttrraaccee --xx $B$HF1Ey$G$9!#(B _o_p_t_i_o_n $B$,>JN,$5$l$k$H!"8=:_$N%*%W%7%g%s@_(B $BDjCM$r0lMwI=<($7$^$9!#(B --PP ccdd $B$d(B ppwwdd $B%3%^%s%I$G!"(Bsymbolic $B%j%s%/$rC)(B $B$C$?O@M}E*$J%G%#%l%/%H%j9=B$$rMQ$$$kBe$o(B $B$j$K!"J*M}E*$J%G%#%l%/%H%j9=B$$rMQ$$$k$h(B $B$&$K$7$^$9!#(B --SS $B%3%^%s%IF~NO9T$r=hM}$9$kEY$K<+F0E*$KAH9~(B $B$_%3%^%s%I(B ssaavveettttyy $B$rr7o$KCl9g$OuBV$+$i99$K5?;wCl9g$N$_M-8z$G$9!#Hs(B $BBPOC7?%7%'%k$H$7$F5/F0$5$l$?>l9g$O!"5/F0(B $B;~%*%W%7%g%s$G@_Dj$5$l$?>l9g$N$_M-8z$G$9!#(B $B$^$?!"(Bffdd $B$H$7$F5/F0$5$l$?>l9g$O$3$N%*%W(B $B%7%g%s$OL5;k$5$l$^$9!#(B((UUNNIIXX)) --tt $B8=:_$N%3%^%s%IF~NO9T$rH$5$l$?>l9g$K%(%i!<$H$7(B $B$F07$$$^$9!#(B --vv $B%3%^%s%IF~NO$rFI9~$`EY$K$=$NF~NOJ8;zNs$r(B $BI=<($7$^$9!#(B --xx $B%3%^%s%I(B _c $B$K(B _d_e_v_i_c_e $B$GI=$5$l$k%G%P%$%9%U%!%$%k$r;XDj$7$^$9!#F1;~$K!"(B _d_e_v_i_c_e $B$N%I%i%$%P$G07$&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!<%I$G$9!#(B((UUNNIIXX)) SSJJIISS, ssjjiiss Shift JIS EEUUCC, eeuucc EUC $B4A;z(B JJIISS, jjiiss 7bit JIS JJIISS88, jjiiss88 8bit JIS JJUUNNEETT, jjuunneett ISO-2022-JP OOJJIISS, oojjiiss 7bit JIS (JIS C6226-1978 + roman) OOJJIISS88, oojjiiss88 8bit JIS (JIS C6226-1978 + roman) OOJJUUNNEETT, oojjuunneett ISO-2022-JP (JIS C6226-1978 + roman) HHEEXX, hheexx HEX CCAAPP, ccaapp CAP UUTTFF88, uuttff88 UTF-8 UUTTFF88--mmaacc, mmaacc Mac OS X $BMQ(B UTF-8 UUTTFF88--iiccoonnvv iconv $BMQ(B UTF-8 $B%G%U%)%k%H(B $BJQ49$7$J$$(B DDIIRRCCOOUUNNTTLLIIMMIITT $B%D%j!e8B?t$r@_Dj$7$^$9!#8e$m$K(B '>>' $B$N$D$$$?(B $B%G%#%l%/%H%j$G$"$C$F$b!"$=$NCf$K%5%V%G%#%l%/%H(B $B%j$,0l$D$b$J$1$l$P!"E83+$7$F$b%D%j!<9=B$$OJQ2=(B $B$7$^$;$s!#%G%#%l%/%H%jFb$N%U%!%$%k?t(B ($B%G%#%l%/(B $B%H%j$b4^$`(B) $B$,$3$N?tCM0JFb$G$"$l$P!"0l$D$b%5%V(B $B%G%#%l%/%H%j$r;}$?$J$$%G%#%l%/%H%j$K$O!":G=i$+(B $B$i(B '>>' $B$r$D$1$^$;$s!#$^$?!"2hLL1&$KI=<($5$l$k(B $B%G%#%l%/%H%jFb%U%!%$%k$N0lMw$b!"$3$N?tCM$r1[$((B $B$F$OI=<($7$J$$$h$&$K$J$j$^$9!#=hM}$NCY$$%^%7%s(B $B$G$O!"$3$NCM$r(B 00 $B$K$7$F$*$1$P!"2wE,$J=hM}B.EY(B $B$,H$G$-$k%G%#%l%/%H%jMzNr(B $B$N?t$N>e8B$r@_Dj$7$^$9!#%G%U%)%k%HCM$O(B 5500 $B8D$G(B $B$9!#$3$NCM$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$3$NCM$,@_Dj$5$l$F$$$?(B $B>l9g!"(B//eettcc//ffdd22rrcc $B$rFI9~$s$@8e!"(B..ffdd22rrcc $B$d(B ..ffddsshhrrcc $B$rFI9~$`A0$K!"$=$N=i4|@_Dj%U%!%$%k$rFI(B $B9~$_$^$9!#C"$7!"l9g(B $B$d!"l9g$K$O!"$3$NCM(B $B$OL5;k$5$l$^$9!#(B FFCCEEDDIITT $BAH9~$_%3%^%s%I(B ffcc $B$G;HMQ$9$k%(%G%#%?%3%^%s%I$r(B $B;XDj$7$^$9!#(B FFDD_VVEERRSSIIOONN $B$KMQ$$$k4A;z%3!<%I$r;XDj$7$^$9!#%U%!(B $B%$%k%"%/%;%9$r9T$J$&;~E@$G$3$3$G@_Dj$7$?4A;z%3(B $B!<%I$K%3%s%P!<%H$5$l$^$9$N$G!"%M%C%H%o!<%/>e$N(B $B4A;z%3!<%I$N0[$J$k%^%7%s$+$i!"4A;z$G=q$+$l$?%U(B $B%!%$%k$r;2>H$9$k$3$H$b2DG=$G$9!#$^$?!"%"!<%+%$(B $B%V%V%i%&%6$dAH9~$_%3%^%s%I(B bbrroowwssee $B$,%U%!%$%kL>(B $B$r$$(B $B$^$9!#$3$N$&$A(B JJIISS88, JJUUNNEETT, HHEEXX, CCAAPP $BEy$O(B Samba $B$GMQ$$$i$l$F$$$k4A;z%3!<%I$G$9!#(B((UUNNIIXX)) SSJJIISS, ssjjiiss Shift JIS EEUUCC, eeuucc EUC $B4A;z(B JJIISS, jjiiss 7bit JIS JJIISS88, jjiiss88 8bit JIS JJUUNNEETT, jjuunneett ISO-2022-JP OOJJIISS, oojjiiss 7bit JIS (JIS C6226-1978 + roman) OOJJIISS88, oojjiiss88 8bit JIS (JIS C6226-1978 + roman) OOJJUUNNEETT, oojjuunneett ISO-2022-JP (JIS C6226-1978 + roman) HHEEXX, hheexx HEX CCAAPP, ccaapp CAP UUTTFF88, uuttff88 UTF-8 UUTTFF88--mmaacc, mmaacc Mac OS X $BMQ(B UTF-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J30$NCM$G(B $B$"$l$P!"2?$rDj5A$7$F$bM-8z$G$9!#(B UURRLLDDRRIIVVEE URL $B%I%i%$%V5!G=$rM-8z$K$7$^$9!#(B00 $B$+%J%k0J30$N(B $BCM$G$"$l$P!"2?$rDj5A$7$F$bM-8z$G$9!#(B((UUNNIIXX)) UURRLLKKCCOODDEE URL $B%I%i%$%V$G%[%9%HB&$N%U%!%$%kL>$KMQ$$$k4A;z(B $B%3!<%I$r;XDj$7$^$9!#$3$N$&$A(B JJIISS88, JJUUNNEETT, HHEEXX, CCAAPP $BEy$O(B Samba $B$GMQ$$$i$l$F$$$k4A;z%3!<%I$G$9!#(B ((UUNNIIXX)) SSJJIISS, ssjjiiss Shift JIS EEUUCC, eeuucc EUC $B4A;z(B JJIISS, jjiiss 7bit JIS JJIISS88, jjiiss88 8bit JIS JJUUNNEETT, jjuunneett ISO-2022-JP OOJJIISS, oojjiiss 7bit JIS (JIS C6226-1978 + roman) OOJJIISS88, oojjiiss88 8bit JIS (JIS C6226-1978 + roman) OOJJUUNNEETT, oojjuunneett ISO-2022-JP (JIS C6226-1978 + roman) HHEEXX, hheexx HEX CCAAPP, ccaapp CAP UUTTFF88, uuttff88 UTF-8 UUTTFF88--mmaacc, mmaacc Mac OS X $BMQ(B UTF-8 UUTTFF88--iiccoonnvv iconv $BMQ(B UTF-8 $B%G%U%)%k%H(B $BJQ49$7$J$$(B UURRLLOOPPTTIIOONNSS URL $B%I%i%$%V$G%[%9%H$HDL?.$r9T$J$&:]$NDL?.%*%W(B $B%7%g%s$r;XDj$7$^$9!#(BFTP $BDL?.$N:]$K(B PASV, PORT, MDTM, FEAT $B$N3F%3%^%s%I$r6X;_$9$k$+H]$+!"$^$?(B HTTP $BDL?.$N:]$K@53N$J%U%!%$%k>pJs$r$lFHN)$KA*Br$G$-$^$9!#(BHTTP $B%W%m(B $B%H%3%k$G$O!"%U%!%$%k>pJs$r$^$H$a$FpJs$rJ,$NDL?.;~4V$rMW$7$^$9!#%G%U(B $B%)%k%HCM$O(B 00 $B$G$9!#@_Dj$9$kCM$O0J2<$N$H$*$j!#(B ((UUNNIIXX)) 00 $BI8=`(B 11 PASV 22 PORT 33 PASV & PORT 44 MDTM 55 PASV & MDTM 66 PORT & MDTM 77 PASV & PORT & MDTM 88 FEAT 99 PASV & FEAT 1100 PORT & FEAT 1111 PASV & PORT & FEAT 1122 MDTM & FEAT 1133 PASV & MDTM & FEAT 1144 PORT & MDTM & FEAT 1155 PASV & PORT & MDTM & FEAT 1166 HTTP 1177 PASV & HTTP 1188 PORT & HTTP 1199 PASV & PORT & HTTP 2200 MDTM & HTTP 2211 PASV & MDTM & HTTP 2222 PORT & MDTM & HTTP 2233 PASV & PORT & MDTM & HTTP 2244 FEAT & HTTP 2255 PASV & FEAT & HTTP 2266 PORT & FEAT & HTTP 2277 PASV & PORT & FEAT & HTTP 2288 MDTM & FEAT & HTTP 2299 PASV & MDTM & FEAT & HTTP 3300 PORT & MDTM & FEAT & HTTP 3311 PASV & PORT & MDTM & FEAT & HTTP UURRLLTTIIMMEEOOUUTT URL $B%I%i%$%V$G%[%9%H$HDL?.$7$F$$$k:]$N%?%$%`%"(B $B%&%H$rIC?t$G;XDj$7$^$9!#$3$3$G;XDj$7$?IC?t$N4V(B $B%[%9%H$+$i$NDL?.$,ES@d$($k$H!"DL?.$,L58z$K$J$C(B $B$?$b$N$H8+$J$7$F6/@)E*$K@\B3$r@ZCG$7$^$9!#$3$N(B $BCM$,(B 00 $BIC$N;~$K$O%?%$%`%"%&%H=hM}$r$;$:$K1J5W(B $B$K1~Ez$rBT$AB3$1$^$9!#%G%U%)%k%HCM$O(B 00 $BIC$G$9!#(B ((UUNNIIXX)) UUSSEEGGEETTCCUURRSSOORR $BCl9g$O!"$3$l(B $B$rM-8z$K$9$k$H0lCW$9$k$3$H$,$"$j$^$9!#%+!<%=%k(B $B0LCV$l(B 22 $B7e$H(B 44 $B7e$GI=<($5$l$^$9$,!"$3$l$r$=$l$>$l(B 44 $B7e$H(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=$rMQ$$$?(B $B%-!<$N$G05=L$7$F$"$k>l9g(B $B$O!"%"!<%+%$%V%V%i%&%6$,@5>o$KF/$-$^$;$s!#%"!<%+%$%V%U%!%$%k(B $BFb$N(B symbolic $B%j%s%/$O8DJL$KE83+$G$-$^$;$s!#(B $B%f!<%6%$%s%?%U%'!<%9$,CU@[$G$9!#(B $BCx(B$BCx:n(B$B:n8"(B$B8"(B Copyright (C) 1995-2019 by Takashi SHIRAI FD-3.01j/kanji.hin100644 2105 1751 120722 13516612560 12521 0ustar shiraiuser/* * kanji.h * * message strings on Kanji */ #include "catalog.h" #define YESNO_K mesconv("$B$h$m$7$$$G$9$+(B ?", "OK ?") #define HITKY_K mesconv("$B2?$+%-!<$r2!$7$F2<$5$$(B.", "Hit any key.") #define GETKY_K mesconv("$B%-!<$r2!$7$F2<$5$$(B.", "Hit key.") #define SPCED_K mesconv("(Space $B$G=*N;$7$^$9(B.)", "(Terminate with Space.)") #define NOFIL_K mesconv("$B%U%!%$%k$,$"$j$^$;$s(B", "No Files") #define NOCOM_K mesconv("$BIT@5$J%3%^%s%I$G$9(B.", "Invalid command.") #define ILFNC_K mesconv("$B%3%^%s%I$N;H$$J}$,0c$$$^$9(B.", "Illegal function call.") #define RESTR_K mesconv("$B$3$N%3%^%s%I$O;HMQ@)8B$5$l$F$$$^$9(B.", "This command is restricted.") #define WAIT_K mesconv("$B$7$P$i$/$*BT$A2<$5$$(B.", "Wait a minute.") #define DELSP_K mesconv("$B9TKv$K6uGrJ8;z$,$"$j$^$9$,:o=|$7$^$9$+(B ?", "Delete space characters on the end of line ?") #define INTR_K mesconv("$BCfCG%-!<$K$h$j:n6H$rCf;_$7$^$9(B.", "Interrupted by keyboard.") #define RECUR_K mesconv("$B:F5"E*$K(B fdsh $B$r5/F0$9$k$3$H$O$G$-$^$;$s(B.", "Recursive call for fdsh.") #define NTERM_K mesconv("$BC$,L$EPO?$N$?$a(B FD $B$r5/F0$G$-$^$;$s(B.", "Cannot invoke FD because of no terminal entry.") #define USER_K mesconv("$B%f!<%6L>(B:", "User:") #define PASWD_K mesconv("$B%Q%9%o!<%I(B:", "Password:") #define LOGD_K mesconv("$BJQ99$9$k%G%#%l%/%H%jL>(B:", "New current directory:") #define NEXT_K mesconv(": $BB3$-$rFI$_$^$9$+(B ?", ": Next ?") #define PEND_K mesconv("$B1\Mw$r=*N;$7$^$9$+(B ?", "Exit ?") #define ONAME_K mesconv("N: $BL>A0=g(B", "N: fileName") #define OEXT_K mesconv("E: $B3HD%;R(B", "E: Extension") #define OSIZE_K mesconv("S: $B%5%$%:(B", "S: Size") #define ODATE_K mesconv("T: $BF|IU=g(B", "T: Timestamp") #define OLEN_K mesconv("L: $BD9$5=g(B", "L: Length") #define ORAW_K mesconv("X: $B$7$J$$(B", "X: No chg") #define OUST_K mesconv("U: $BDj5A:o=|(B", "U: Unset") #define OINC_K mesconv("U: $B>:$j=g(B", "U: Up") #define ODEC_K mesconv("D: $B9_$j=g(B", "D: Down") #define OMIT_K mesconv("$B>JN,(B", "Omit") #define KILOK_K mesconv("$B%G%#%l%/%H%j%9%?%C%/$rGK4~$7$F$b$h$m$7$$$G$9$+(B ?", "Directory stack will be broken, OK ?") #define WRTOK_K mesconv("$BI=<(%G%#%l%/%H%j$r%G%#%9%/$K=q9~$_$^$9$+(B ?", "Write this displayed directory on disk ?") #define HOMOK_K mesconv("$B8=:_$3$N%G%#%l%/%H%j$rB>$N%f!<%6$,MxMQ$7$F$$$J$$$3$H$r3NG'$7$^$7$?$+(B ?", "Are you the only user on this directory, now ?") #define NOWRT_K mesconv("$B%+%l%s%H%G%#%l%/%H%j$O=q9~$_$G$-$^$;$s(B.", "Current directory unwritable.") #define NOROW_K mesconv("$B2hLL$N9T?t$,B-$j$^$;$s(B.", "Line size is too small for operation.") #define NOWIN_K mesconv("$B$3$l0J>e%&%#%s%I%&J,3d$G$-$^$;$s(B.", "No more window to be split.") #define KILL_K mesconv("$B2TF/Cf$N%W%m%0%i%`$,$"$j$^$9$,6/@)=*N;$5$;$^$9$+(B ?", "Are you sure that running programs will be terminated forcedly ?") #define NOPTY_K mesconv("$B5?;wC(B:", "New directory name:") #define COPYD_K mesconv("$B%3%T!<@h$N%G%#%l%/%H%jL>(B:", "Directory to copy:") #define PRECP_K mesconv("$BF1L>%U%!%$%k$,$"$C$?>l9g$N=hM}$O$I$&$7$^$9$+(B ?", "What do you want when the same name file exists ?") #define SAMEF_K mesconv("[%.*s] $BF1L>$N%U%!%$%k$,$"$j$^$9(B.", "[%.*s] The same named file exists.") #define UPDAT_K mesconv("U: $B?7$7$$F|IU$r(B", "Update") #define RENAM_K mesconv("R: $BL>A0$rJQ$($F(B", "Rename") #define OVERW_K mesconv("O: $BA4$F>e=q$-(B", "Overwrite") #define NOCPY_K mesconv("N: $BF1L>$O%3%T!<$7$J$$(B", "NotCopyTheSameName") #define FORWD_K mesconv("F: $BE>Aw(B", "Forward") #define NEWNM_K mesconv("$B?7$7$$L>A0(B:", "New name:") #define FRWDD_K mesconv("$B8E$$%U%!%$%k$NE>Aw@h(B:", "Forwarding directory:") #define NOSPC_K mesconv("$B%3%T!<@h$N6u$-MFNL$,ITB-$7$F$$$^$9(B. $B%G%#%9%/$r8r49$7$^$9$+!)(B", "No space left on destination device. Do you change another disk?") #define NOCWD_K mesconv("$B:n6H%G%#%l%/%H%j$r<:$C$?$N$G:n6HCfCG$7$^$9(B.", "Working directory is lost, to abandon works.") #define NOPSU_K mesconv("$B5?;w%G%#%l%/%H%j$r<:$C$?$N$G:n6HCfCG$7$F(B:", "Directory to move:") #define ENDMV_K mesconv("$B%U%!%$%k$N0\F0$,=*N;$7$^$7$?(B. $B2?$+%-!<$r2!$7$F2<$5$$(B.", "Move finished. Hit any key.") #define WRONG_K mesconv("$B4{$KB8:_$9$k%U%!%$%kL>$G$9(B.", "Filename already exists.") #define DELFL_K mesconv("[%.*s] $B$r:o=|$7$^$9(B. $B$h$m$7$$$G$9$+(B ?", "Deleting the file [%.*s], OK ?") #define DELMK_K mesconv("$B%^!<%/%U%!%$%k$r:o=|$7$^$9(B. $B$h$m$7$$$G$9$+(B ?", "Deleting the marked files, OK ?") #define DELDR_K mesconv("[%.*s] $B%G%#%l%/%H%j$r:o=|$7$^$9(B. $B$h$m$7$$$G$9$+(B ?", "Deleting the directory [%.*s], OK ?") #define PRERM_K mesconv("$B%"%/%;%9@)8B$5$l$?%U%!%$%k$,$"$C$?>l9g$N=hM}$O$I$&$7$^$9$+(B ?", "What do you want when the restricted file exists ?") #define DELPM_K mesconv("[%.*s] $B%U%!%$%k$N%"%/%;%98"$O@)8B$5$l$F$$$^$9$,:o=|$7$^$9$+(B ?", "[%.*s] The file is restricted on permission, delete really ?") #define ANYES_K mesconv("Y: $B$O$$(B", "Yes") #define ANNO_K mesconv("N: $B$$$$$((B", "No") #define ANCNF_K mesconv("C: $B3NG'$9$k(B", "Confirm") #define ANALL_K mesconv("A: $BA4$F:o=|(B", "All") #define ANKEP_K mesconv("K: $BA4$FJ]B8(B", "KeepAll") #define FINDF_K mesconv("$B8!:w$9$k%U%!%$%kL>(B:", "Filename to find:") #define FINDD_K mesconv("$B:F5"8!:w$9$k%U%!%$%kL>(B:", "Filename to find recursively:") #define FOUND_K mesconv("$B%U%!%$%k$,8+$D$+$j$^$7$?(B. $B%+%l%s%H%G%#%l%/%H%j$rJQ99$7$^$9$+(B ?", "File found. Change current directory ?") #define NOFND_K mesconv("$B;XDj$N%U%!%$%k$O8+$D$+$j$^$;$s$G$7$?(B. $B2?$+%-!<$r2!$7$F2<$5$$(B.", "File not found. Hit any key.") #define SEACH_K mesconv("$B%U%!%$%k8!:wCf(B:", "Searching:") #define SHEXT_K mesconv("`exit' $B$G(B FD $B$KLa$j$^$9(B.", "do `exit' to return FD.") #define PACK_K mesconv("$B=q8K%U%!%$%kL>(B:", "Archive file:") #define UNPAC_K mesconv("$BE83+@h$N%G%#%l%/%H%jL>(B:", "Directory to unpack:") #define UNPTM_K mesconv("$B;XDj%G%#%l%/%H%j$O:o=|$5$l$k0l;~%G%#%l%/%H%j$G$9$,$h$m$7$$$G$9$+(B ?", "Specified directry is temporary to be removed. Are you sure ?") #define UNPNG_K mesconv("$B=q8K$NE83+$K<:GT$7$^$7$?(B.", "Failed to unpack.") #define TMODE_K mesconv("$B%b!<%I(B:", "File mode:") #define TDATE_K mesconv("$BF|IU(B:", "Date:") #define TTIME_K mesconv("$B;~4V(B:", "Time:") #define TFLAG_K mesconv("$B%U%i%0(B:", "Flags:") #define TOLD_K mesconv("$B5l(B", "Old") #define TNEW_K mesconv("$B?7(B", "New") #define TOWN_K mesconv("$B%*!<%J!<(B", "Owner") #define TGRP_K mesconv("$B%0%k!<%W(B", "Group") #define AOWNR_K mesconv("$B%U%!%$%k$N%*!<%J!(B:", "File owner:") #define AGRUP_K mesconv("$B%U%!%$%k$N%0%k!<%WL>(B:", "File group membership:") #define ATTRM_K mesconv("$B%^!<%/%U%!%$%k$NJQ99$r9T$J$$$^$9(B.", "Changing attr. of the marked files.") #define ATTRD_K mesconv("$B%G%#%l%/%H%j0J2<$NJQ99$r9T$J$$$^$9(B.", "Changing attr. under the directory.") #define CMODE_K mesconv("A: $B%U%!%$%k%b!<%I$NJQ99(B", "A: Attribute") #define CDATE_K mesconv("S: $BF|IU(B,$B;~4V$NJQ99(B", "S: timeStamp") #define COWNR_K mesconv("O: $B%*!<%J!<(B,$B%0%k!<%W$NJQ99(B", "O: Owner,group") #define ILTMS_K mesconv("$B%?%$%`%9%?%s%W$N@_Dj$,0c$$$^$9(B.", "Invalid timestamp.") #define ILLNK_K mesconv("$B%7%s%\%j%C%/%j%s%/$NB0@-$OJQ99$G$-$^$;$s(B.", "Cannot change attribute of symbolic link.") #define FSDIR_K mesconv("$B>pJs$rCN$j$?$$%G%#%l%/%H%jL>(B:", "Target directory:") #define FSNAM_K mesconv("$B%U%!%$%k%7%9%F%`(B", "File system") #define FSMNT_K mesconv("$B%^%&%s%H%]%$%s%H(B", "Mount point") #define FSTYP_K mesconv("FS$B%?%$%W(B", "FS type") #define FSTTL_K mesconv("$BA4%G%#%9%/MFNL(B", "Total disk amount") #define FSUSE_K mesconv("$B;HMQ%G%#%9%/MFNL(B", "Used disk amount") #define FSAVL_K mesconv("$B;HMQ2DG=%G%#%9%/MFNL(B", "Available amount") #define FSBSZ_K mesconv("$B%P%$%H?t(B/$B%V%m%C%/(B", "Bytes/block") #define FSINO_K mesconv("i$B%N!<%I:GBg?t(B", "Max i nodes") #define UNIT_K mesconv("$B8D(B", "files") #define BKUP_K mesconv("$B%F!<%W$N%G%P%$%9L>(B:", "Device name of tape:") #define SEAF_K mesconv("I-$B8!:w(B:", "I-search:") #define SEAB_K mesconv("I-$B8eJ}8!:w(B:", "I-search backward:") #define SEAFF_K mesconv("I-$B8!:w(B($B<:GT(B):", "Failing I-search:") #define SEABF_K mesconv("I-$B8eJ}8!:w(B($B<:GT(B):", "Failing I-search backward:") #define PTYAI_K mesconv("S: $B$3$NJ8;z(B(%s)$B$rAw=P(B", "SendAsIs(%s)") #define PTYIC_K mesconv("I: $BJ8;z%3!<%IF~NO(B", "InputCode") #define PTYBR_K mesconv("B: $B6/@)=*N;(B", "Break") #define PTYNW_K mesconv("N: $B%&%#%s%I%&0\F0(B", "NextWindow") #define PTYKJ_K mesconv("K: $B4A;z(B", "Kanji") #define PTYKC_K mesconv("$B%-!<%3!<%I(B:", "Key code:") #define IMERM_K mesconv("$B%m!<%^;zF~NO(B:", "RomanIME:") #define IMEKT_K mesconv("$B%m!<%^;zF~NO(B($BJR2>L>(B):", "RomanIME(Katakana):") #define IMEHN_K mesconv("$B%m!<%^;zF~NO(B($BH>%+%J(B):", "RomanIME(Halfkana):") #define IMEDI_K mesconv("$BD>@\F~NO(B:", "DirectInput:") #define IMEKJ_K mesconv("$B8uJdA*Br(B:", "SelectCandidate:") #define IMEJS_K mesconv("$B4A;zA*Br(B", "SelectKanji") #define CUP_H meslist("$B%+!<%=%k$r>e$K(B", "Cursor up") #define CDWN_H meslist("$B%+!<%=%k$r2<$K(B", "Cursor down") #define CRIG_H meslist("$B%+!<%=%k$r1&$K(B", "Cursor right") #define CLEF_H meslist("$B%+!<%=%k$r:8$K(B", "Cursor left") #define RUP_H meslist("$B$r1&%7%U%H(B", "Right-shift name") #define FNLE_H meslist("FILE$BL>$r:8%7%U%H(B", "Left-shift name") #define COL1_H meslist("$B2hLLI=<($r(B1$BNs$K(B", "Into 1 column") #define COL2_H meslist("$B2hLLI=<($r(B2$BNs$K(B", "Into 2 columns") #define COL3_H meslist("$B2hLLI=<($r(B3$BNs$K(B", "Into 3 columns") #define COL5_H meslist("$B2hLLI=<($r(B5$BNs$K(B", "Into 5 columns") #define MRK_H meslist("FILE$B$N%^!<%/(B", "Mark file") #define MRK2_H meslist("$B%^!<%/$7$F2<0\F0(B", "Mark & down") #define MRKA_H meslist("$BA4(BFILE$B$K%^!<%/(B", "Mark all") #define MRKR_H meslist("$B%^!<%/$rA4H?E>(B", "Mark reversed") #define MRKF_H meslist("$B8!:w(BFILE$B$K%^!<%/(B", "Mark selected") #define IND_H meslist("$B%5%V(BDIR$B$K0\F0(B", "To sub dir") #define OUTD_H meslist("$B?F(BDIR$B$K0\F0(B", "To parent dir") #define LOGT_H meslist("$B%k!<%H$X$N0\F0(B", "To root dir") #define READ_H meslist("$BI=<(2hLL$N:FIA2h(B", "Rewrite") #define PUSH_H meslist("FILE$B$r%9%?%C%/$K(B", "File to stack") #define POP_H meslist("$B%9%?%C%/$+$ipJs(B", "Filesystem info.") #define COPY_H meslist("FILE$B$N%3%T!<(B", "Copy file") #define MOVE_H meslist("FILE$B$N0\F0(B", "Move file") #define DELF_H meslist("FILE$B$N:o=|(B", "Delete file") #define DELD_H meslist("DIR$B$N:o=|(B", "Delete dir") #define RENM_H meslist("FILE$BL>$NJQ99(B", "Rename file") #define MKDR_H meslist("DIR$B$N:n@.(B", "Make dir") #define SORT_H meslist("FILE$B$NJB$SBX$((B", "Sort files") #define EXSH_H meslist("$B;R%W%m%;%9$N$NA0J}8!:w(B", "Search forward") #define SEAB_H meslist("FILE$BL>$N8eJ}8!:w(B", "Search backward") #define SPWN_H meslist("WINDOW$B$NJ,3d(B", "Split windows") #define NXWN_H meslist("WINDOW$B4V$N0\F0(B", "Next window") #define WDWN_H meslist("WINDOW$B$N3HD%(B", "Widen window") #define NRWN_H meslist("WINDOW$B$N=L>.(B", "Narrow window") #define KLWN_H meslist("WINDOW$B$NGK4~(B", "Kill window") #define HELP_H meslist("HELP$B2hLL$NI=<((B", "Show help") #define EDCF_H meslist("$B%+%9%?%^%$%6(B", "Customizer") #define QUIT_H meslist("FD$B$N=*N;(B", "Quit FD") #define WARN_H meslist("$B7Y9p%Y%k(B", "Warning") #define NOOP_H meslist("$B2?$b$7$J$$(B", "No operation") #define UPAR_K mesconv("$B",(B", "Up") #define DWNAR_K mesconv("$B"-(B", "Down") #define RIGAR_K mesconv("$B"*(B", "Right") #define LEFAR_K mesconv("$B"+(B", "Left") #define BSCS_E meslist( \ "$B%+%9%?%^%$%6$N@_Dj9`L\$r4pK\E*$J$b$N$K9J$j$^$9(B.", \ "Limit the configurations to basic ones in the customizer.") #define STTP_E meslist( \ "$B%V%i%&%62hLL$N%G%U%)%k%H$N%=!<%H%?%$%W$r@_Dj$7$^$9(B.", \ "Set the default sort type in browsing mode.") #define DPMD_E meslist( \ "$B5/F0;~$N%U%!%$%kL>I=<(7A<0$r@_Dj$7$^$9(B.", \ "Set the default display mode at the start.") #define STTR_E meslist( \ "$B%D%j!Hf3S;~$KBgJ8;z>.J8;z$rL5;k$7$^$9(B.", \ "Ignore uppercase or lowercase in filename comparison.") #define VCMP_E meslist( \ "$B%U%!%$%kL>Hf3S;~$K?t;z$r%P!<%8%g%sHV9f$H$7$FHf3S$7$^$9(B.", \ "Regard numeric characters as the version in filename comparison.") #define IHTM_E meslist( \ "$B%U%!%$%k$N%3%T!<;~$K%?%$%`%9%?%s%W$r7Q>5$7$^$9(B.", \ "Inherit the timestamp on copying files.") #define PRGB_E meslist( \ "$B%U%!%$%k$N%3%T!<$d0\F0;~$K?JD=>u67$rI=<($7$^$9(B.", \ "Display progress bar on copying/moving files.") #define PCMN_E meslist( \ "$B%U%!%$%k$N%3%T!<$d0\F0A0$KM=$a>e=q$-J}?K$rLd$$9g$o$;$^$9(B.", \ "Query overwriting policy in advance before copying/moving files.") #define AJTY_E meslist( \ "$B=*N;;~$KCI=<(NN0h$N:G>.J8;z?t$r@_Dj$7$^$9(B.", \ "Set the minimum columns of filename field.") #define WDDGT_E meslist( \ "$B%Z!<%8?t$H%U%!%$%k?t$NI=<(7e?t$rA}$d$7$^$9(B.", \ "Widen the displayed digit for the number of pages and files.") #define SZUNT_E meslist( \ "$BBg$-$J%U%!%$%k%5%$%:$r(B SI $B@\F,;R(B (KB, MB, ...) $B$GI=8=$7$^$9(B.", \ "Describe the huge file size with the SI prefix (KB, MB, ...).") #define HSFL_E meslist( \ "$B%3%^%s%IMzNr$N%;!<%V%U%!%$%k$r@_Dj$7$^$9(B.", \ "Define the name of command history file.") #define DHFL_E meslist( \ "$B%G%#%l%/%H%jMzNr$N%;!<%V%U%!%$%k$r@_Dj$7$^$9(B.", \ "Define the name of directory history file.") #define HSSZ_E meslist( \ "$B%3%^%s%IMzNr?t$N>e8B$r@_Dj$7$^$9(B.", \ "Define the maximum size of command history.") #define DRHS_E meslist( \ "$B%G%#%l%/%H%jMzNr?t$N>e8B$r@_Dj$7$^$9(B.", \ "Define the maximum size of directory history.") #define SVHS_E meslist( \ "$B%3%^%s%IMzNr$N%;!<%V%U%!%$%kJ]B8?t$r@_Dj$7$^$9(B.", \ "Define the maximum size of saved command history.") #define SVDH_E meslist( \ "$B%G%#%l%/%H%jMzNr$N%;!<%V%U%!%$%kJ]B8?t$r@_Dj$7$^$9(B.", \ "Define the maximum size of saved directory history.") #define HUMSK_E meslist( \ "$B%3%^%s%IMzNr%;!<%VMQ$N%U%!%$%k@8@.%^%9%/CM$r;XDj$7$^$9(B.", \ "Define the file creation mask for command history.") #define DUMSK_E meslist( \ "$B%G%#%l%/%H%jMzNr%;!<%VMQ$N%U%!%$%k@8@.%^%9%/CM$r;XDj$7$^$9(B.", \ "Define the file creation mask for directory history.") #define DCLM_E meslist( \ "$B%D%j!pJs9T$rI=<($7$^$9(B.", \ "Display the filesize information line.") #define FNLO_E meslist( \ "$B%U%!%s%/%7%g%s9T$N%l%$%"%&%H$r;XDj$7$^$9(B.", \ "Specify the function line layout.") #define IMKY_E meslist( \ "$B$+$J4A;zJQ49F~NO%b!<%I$N@ZBX$(%-!<$r;XDj$7$^$9(B.", \ "Define the toggle key for the Kana-Kanji IME mode.") #define IMBF_E meslist( \ "$B$+$J4A;zJQ49%F!<%V%k$r%*%s%a%b%j$G;}$AB3$1$^$9(B.", \ "Hold the Kana-Kanji translation table on memory.") #define IMLRN_E meslist( \ "$B$+$J4A;zJQ49$N3X=,%l%Y%k$r;XDj$7$^$9(B.", \ "Define the learning level for the Kana-Kanji translation.") #define FRFL_E meslist( \ "$B%f!<%6JQ49IQEY$N%;!<%V%U%!%$%k$r;XDj$7$^$9(B.", \ "Define the name of user translation frequency file.") #define FUMSK_E meslist( \ "$B%f!<%6JQ49IQEYMQ$N%U%!%$%k@8@.%^%9%/CM$r;XDj$7$^$9(B.", \ "Define the file creation mask for user translation frequency.") #define ACOL_E meslist( \ "$B%U%!%$%kI=<($r%+%i!<2=$7$^$9(B.", \ "Display with the ANSI color escape sequence.") #define APAL_E meslist( \ "$B%+%i!$r;XDj$7$^$9(B.", \ "Define the filename for logging.") #define LGSIZ_E meslist( \ "$B%m%0%U%!%$%k$N:GBg%5%$%:$r(B KB $BC10L$G;XDj$7$^$9(B.", \ "Define the file size by KB for logging.") #define USYLG_E meslist( \ "$B%7%9%F%`%m%,!<(B (syslog) $B$rMQ$$$F%m%0$r$rI>2A$;$:AGDL$7$7$^$9(B.", \ "Pass through pathnames in the startup arguments as is.") #define URLD_E meslist( \ "URL $B%I%i%$%V5!G=$rM-8z$K$7$^$9(B.", \ "Make URL drive function effective.") #define URLTO_E meslist( \ "URL $B%I%i%$%V>e$NDL?.%?%$%`%"%&%HIC$r;XDj$7$^$9(B.", \ "Define the timeout second for communications on URL drive.") #define URLOP_E meslist( \ "URL $B%I%i%$%V>e$NDL?.%*%W%7%g%s$r;XDj$7$^$9(B.", \ "Define the options for communications on URL drive.") #define HIDPW_E meslist( \ "URL $B%I%i%$%V$N%Q%9%o!<%IF~NO;~$K2hLL$K!V(B*$B!W$rI=<($7$^$;$s(B.", \ "Suppress displaying '*' on screen with password input on URL drive.") #define FTPAD_E meslist( \ "$BF?L>(B FTP $B@\B3;~$N%a!<%k%"%I%l%9$r;XDj$7$^$9(B.", \ "Define the mail address for anonymous FTP.") #define FTPPR_E meslist( \ "FTP $BDL?.;~$N%W%m%-%7%"%I%l%9$r;XDj$7$^$9(B.", \ "Define the FTP proxy address.") #define FTPLG_E meslist( \ "FTP $BDL?.%m%0%U%!%$%kL>$r;XDj$7$^$9(B.", \ "Define the filename for logging FTP communications.") #define HTPPR_E meslist( \ "HTTP $BDL?.;~$N%W%m%-%7%"%I%l%9$r;XDj$7$^$9(B.", \ "Define the HTTP proxy address.") #define HTPLG_E meslist( \ "HTTP $BDL?.%m%0%U%!%$%kL>$r;XDj$7$^$9(B.", \ "Define the filename for logging HTTP communications.") #define HTMLG_E meslist( \ "$B$r;XDj$7$^$9(B.", \ "Define the filename for logging received HTML.") #define UNBF_E meslist( \ "UNICODE $B$NJQ49%F!<%V%k$r%*%s%a%b%j$G;}$AB3$1$^$9(B.", \ "Hold the UNICODE translation table on memory.") #define LANG_E meslist( \ "$BI=<($9$kJ8;z$N4A;z%3!<%I$^$?$O8@8l$r@_Dj$7$^$9(B.", \ "Set the language code to display.") #define DFKC_E meslist( \ "$B%7%9%F%`I8=`$N4A;z%3!<%I$r@_Dj$7$^$9(B.", \ "Set the system default Kanji code.") #define IPKC_E meslist( \ "$B%-!<%\!<%IF~NOJ8;z$N4A;z%3!<%I$r@_Dj$7$^$9(B.", \ "Set the Kanji code to be inputted.") #define PIKC_E meslist( \ "$B5?;wC$KMQ$$$kJ8;z$N4A;z%3!<%I$r@_Dj$7$^$9(B.", \ "Set the Kanji code used in filename.") #define URLKC_E meslist( \ "URL $B%I%i%$%V>e$N%U%!%$%kL>$KMQ$$$k4A;z%3!<%I$r@_Dj$7$^$9(B.", \ "Set the Kanji code used in filename on URL drive.") #define MESL_E meslist( \ "$BI=<($5$l$k%a%C%;!<%8$N8@8l$r@_Dj$7$^$9(B.", \ "Set the language of displayed messages.") #define SJSP_E meslist( \ "Shift JIS $B$r%U%!%$%kL>$K;H$&%G%#%l%/%H%j$r;XDj$7$^$9(B.", \ "Define the directories includes Shift JIS filename.") #define EUCP_E meslist( \ "EUC $B4A;z$r%U%!%$%kL>$K;H$&%G%#%l%/%H%j$r;XDj$7$^$9(B.", \ "Define the directories includes EUC-JP filename.") #define JISP_E meslist( \ "7bit JIS $B$r%U%!%$%kL>$K;H$&%G%#%l%/%H%j$r;XDj$7$^$9(B.", \ "Define the directories includes 7bit-JIS filename.") #define OJSP_E meslist( \ "7bit $B5l(B JIS $B$r%U%!%$%kL>$K;H$&%G%#%l%/%H%j$r;XDj$7$^$9(B.", \ "Define the directories includes old 7bit-JIS filename.") #define JS8P_E meslist( \ "8bit JIS $B$r%U%!%$%kL>$K;H$&%G%#%l%/%H%j$r;XDj$7$^$9(B.", \ "Define the directories includes 8bit-JIS filename.") #define OJ8P_E meslist( \ "8bit $B5l(B JIS $B$r%U%!%$%kL>$K;H$&%G%#%l%/%H%j$r;XDj$7$^$9(B.", \ "Define the directories includes old 8bit-JIS filename.") #define JNTP_E meslist( \ "ISO-2022-JP $B$r%U%!%$%kL>$K;H$&%G%#%l%/%H%j$r;XDj$7$^$9(B.", \ "Define the directories includes ISO-2022-JP filename.") #define OJNP_E meslist( \ "$B5l(B ISO-2022-JP $B$r%U%!%$%kL>$K;H$&%G%#%l%/%H%j$r;XDj$7$^$9(B.", \ "Define the directories includes old ISO-2022-JP filename.") #define HEXP_E meslist( \ "HEX $B%3!<%I$r%U%!%$%kL>$K;H$&%G%#%l%/%H%j$r;XDj$7$^$9(B.", \ "Define the directories includes HEX code filename.") #define CAPP_E meslist( \ "CAP $B%3!<%I$r%U%!%$%kL>$K;H$&%G%#%l%/%H%j$r;XDj$7$^$9(B.", \ "Define the directories includes CAP code filename.") #define UTF8P_E meslist( \ "UTF-8 $B%3!<%I$r%U%!%$%kL>$K;H$&%G%#%l%/%H%j$r;XDj$7$^$9(B.", \ "Define the directories includes UTF-8 code filename.") #define UTF8M_E meslist( \ "Mac OS X $BMQ(B UTF-8 $B%3!<%I$r%U%!%$%kL>$K;H$&%G%#%l%/%H%j$r;XDj$7$^$9(B.", \ "Define the directories includes Mac OS X UTF-8 code filename.") #define UTF8I_E meslist( \ "iconv $BMQ(B UTF-8 $B%3!<%I$r%U%!%$%kL>$K;H$&%G%#%l%/%H%j$r;XDj$7$^$9(B.", \ "Define the directories includes iconv UTF-8 code filename.") #define NCVP_E meslist( \ "$B4A;z%3!<%IJQ49$7$?$/$J$$%G%#%l%/%H%j$r;XDj$7$^$9(B.", \ "Define the directories with no kanji conversion.") #define PAGR_E meslist( \ "$B%U%!%$%k$N1\Mw$KMQ$$$k%W%m%0%i%`$r;XDj$7$^$9(B.", \ "Define the program to view files.") #define EDIT_E meslist( \ "$B%U%!%$%k$NJT=8$KMQ$$$k%W%m%0%i%`$r;XDj$7$^$9(B.", \ "Define the program to edit files.") #define SHEL_E meslist( \ "$B%3%^%s%I$NA0$N%=!<%H7A<0$rJ];}(B", "preserve last sort type") #define VSARC_K mesconv("$B%"!<%+%$%V%V%i%&%6$G$b%=!<%H7A<0$rJ];}(B", \ "preserve last sort type in archive browser") #define VSRT0_K mesconv("$BJ];}$7$J$$(B", "not preserve") #define VSRT1_K mesconv("$BJ];}$9$k(B", "preserve") #define VSRT2_K mesconv("$B%"!<%+%$%V%V%i%&%6$G$bJ];}$9$k(B", \ "also archive browser") #define VDS1A_K mesconv("$B>pJs(B:", "info.:") #define VDS1B_K mesconv("$BI=<($9$k%7%s%\%j%C%/%j%s%/%U%!%$%k>pJs(B", \ "status information of symbolic link file") #define VDS10_K mesconv("$B%j%s%/(B", "link") #define VDS11_K mesconv("$BK\BN(B", "file") #define VDS2A_K mesconv(", $B%U%!%$%k7?(B:", ", file type:") #define VDS2B_K mesconv("$B%U%!%$%k%?%$%W%7%s%\%k$NIUB0(B", \ "trailing file type symbol") #define VDS20_K mesconv("$BITMW(B", "no display") #define VDS21_K mesconv("$BMW(B", "display") #define VDS3A_K mesconv(", \".\"$B%U%!%$%k(B:", ", dot file:") #define VDS3B_K mesconv("\".\"$B$G;O$^$k%U%!%$%kL>$N07$$(B", \ "whether to hide files whose names begin with \".\"") #define VDS30_K mesconv("$BI=<((B", "visible") #define VDS31_K mesconv("$B1#$9(B", "invisible") #define VDS4A_K mesconv(", $B%U%!%$%k(B:", ", file:") #define VDS4B_K mesconv("$B%U%!%$%k%b!<%IMs$NI=<(>pJs(B", \ "information on file mode column") #define VDS40_K mesconv("$B%b!<%I(B", "mode") #define VDS41_K mesconv("$B%U%i%0(B", "flag") #define VWFS0_K mesconv("$BJB$SBX$(8e$K=q9~$_2D(B", "valid after replacement") #define VWFS1_K mesconv("$B%3%^%s%I$N$_M-8z(B", "command only") #define VWFS2_K mesconv("$B;HMQ6X;_(B", "completely invalid") #define VBIOS_K mesconv(" (BIOS $B7PM3(B)", " (via BIOS)") #define VCOL2_K mesconv("$BGX7J?'$r9u$K(B", "black background") #define VCOL3_K mesconv("$BI=<(?'$r9u$K(B", "black foreground") #define VBLK1_K mesconv("$B9u(B", "BLK") #define VRED1_K mesconv("$B@V(B", "RED") #define VGRN1_K mesconv("$BNP(B", "GRN") #define VYEL1_K mesconv("$B2+(B", "YEL") #define VBLU1_K mesconv("$B@D(B", "BLU") #define VMAG1_K mesconv("$B;g(B", "MAG") #define VCYN1_K mesconv("$B?e(B", "CYN") #define VWHI1_K mesconv("$BGr(B", "WHI") #define VFOR1_K mesconv("$BJ8;z(B", "fore") #define VBAK1_K mesconv("$BGX7J(B", "back") #define VCREG_K mesconv("$BDL>o(B", "regular") #define VCBAK_K mesconv("$BGX7J(B", "back") #define VCDIR_K mesconv("DIR", "dir") #define VCUWR_K mesconv("$B=q6X(B", "unwritable") #define VCURD_K mesconv("$B1#$7(B", "hidden") #define VCLNK_K mesconv("$B%j%s%/(B", "link") #if MSDOS #define VCSCK_K mesconv("$B%7%9%F%`(B", "system") #define VCFIF_K mesconv("VOL", "label") #else #define VCSCK_K mesconv("$B%=%1%C%H(B", "socket") #define VCFIF_K mesconv("FIFO", "FIFO") #endif #define VCBLD_K mesconv("$B%V%m%C%/(B", "block") #define VCCHD_K mesconv("$B%-%c%i(B", "char") #define VCEXE_K mesconv("$B(B.)", \ "Select the options for URL drive. (Inverse with Space.)") #define UOP00_K mesconv("$B2D(B", "OK") #define UOP01_K mesconv("$B6X(B", "No") #define UOP1B_K mesconv("PASV$B6X;_(B", "noPASV") #define UOP2B_K mesconv("PORT$B6X;_(B", "noPORT") #define UOP3B_K mesconv("MDTM$B6X;_(B", "noMDTM") #define UOP4B_K mesconv("FEAT$B6X;_(B", "noFEAT") #define UOP5B_K mesconv("HTTP$B>\:Y>pJs(B", "HTTPdetail") #define UOP50_K mesconv("$B4JN,(B", "Round") #define UOP51_K mesconv("$B>\:Y(B", "Detail") #define IMEB1_K mesconv("$BIJ;l>pJs$N$_(B", "onlyHinsi") #define IMEB2_K mesconv("$B4^%$%s%G%C%/%9(B", "includeIndex") #define IMEB3_K mesconv("$BA4$F(B", "Whole") #define VKYCD_K mesconv("$BFbItJQ?t(B %s $B$K@_Dj$9$k%-!<$r2!$7$F2<$5$$(B:", \ "Push the key which you set to the variable %s:") #define VKYOK_K mesconv("[%s]$B$rFbItJQ?t(B %s $B$K@_Dj$7$F$h$m$7$$$G$9$+(B ?", \ "Do you set [%s] to the variable %s ?") #define VUSET_K mesconv("($BDj5A:o=|(B)", "(unset)") #define VDEF_K mesconv(" ($B4{DjCM(B)", " (default)") #define VUDEF_K mesconv("($BL$Dj5A(B)", "(undefined)") #define USENV_K mesconv("$BFbItJQ?t(B %s $B$NDj5A$r:o=|$7$^$9$+(B ?", \ "Do you unset the variable %s ?") #define NEWET_K mesconv("$B?75,EPO?(B", "NewEntry") #define NIMPL_K mesconv("$B$3$N5!G=$Oe$N?75,EPO?$O$G$-$^$;$s(B.", \ "No more new registration.") #define BINDK_K mesconv("$B%-!<3dEv$F$r9T$J$$$?$$%-!<$r2!$7$F2<$5$$(B:", \ "Push the key which you want to bind command:") #define ESCNG_K mesconv("Esc $B%-!<$N3dEv$FJQ99$O6X;_$5$l$F$$$^$9(B.", \ "Key bind for Esc is inhibited.") #define BINDF_K mesconv("[%s]$B$K3dEv$F$k%3%^%s%I$rA*$s$G2<$5$$(B.", \ "Select the command to bind for [%s].") #define BNDFC_K mesconv("[%s]$BMQ%3%^%s%I(B:", "Command for [%s]:") #define USRDF_K mesconv("$B%f!<%6Dj5A(B", "User define") #define DELKB_K mesconv("$B3dEv$F:o=|(B", "Delete bind") #define DLBOK_K mesconv("[%s]$BMQ$N%-!<3dEv$F$r:o=|$7$^$9(B. $B$h$m$7$$$G$9$+(B ?", \ "Deleting the key bind for [%s], OK ?") #define KBDIR_K mesconv("$B%G%#%l%/%H%jMQ$K$bF1$8%-!<3dEv$F$G9=$$$^$;$s$+(B ?", \ "Do you bind the same command for the directory ?") #define BINDD_K mesconv("$B%G%#%l%/%H%jMQ$K(B[%s]$B$K3dEv$F$k%3%^%s%I$rA*$s$G2<$5$$(B.", \ "Select the command to bind for [%s] on directories.") #define BNDDC_K mesconv("$B%G%#%l%/%H%j8~$1(B[%s]$BMQ%3%^%s%I(B:", \ "Command for [%s] on directories:") #define FCOMM_K mesconv("$B%U%!%s%/%7%g%s9TMQ$N%3%a%s%H(B(6 $BJ8;z0JFb(B):", \ "Comment for the function line (within 6 chars):") #define KYMPK_K mesconv("[%s]$B$N%-!<$r2!$7$F2<$5$$(B:", \ "Push the key named as [%s]:") #define DELKM_K mesconv("[%s]$B$N%-!<%^%C%WEPO?$r:o=|$7$^$9(B. $B$h$m$7$$$G$9$+(B ?", \ "Deleting the keymap for [%s], OK ?") #define SETKM_K mesconv("[%s]$B$N%-!<%^%C%W$r(B[%s]$B$H$7$FEPO?$7$^$9(B. $B$h$m$7$$$G$9$+(B ?", \ "Registering the keymap for [%s] as [%s], OK ?") #define ARADD_K mesconv("[$BDI2C(B]", "[Add]") #define ARUSG_K mesconv("Ret: $BJQ99(B/$BJB$YBX$((B/$B:o=|(B, Esc: $B=*N;(B", \ "Ret: edit/swap/remove, Esc: done") #define AREDT_K mesconv("E: $BJT=8(B", "Edit") #define ARUPW_K mesconv("U: $B0l$D>e$X(B", "Upward") #define ARDWN_K mesconv("D: $B0l$D2<$X(B", "Downward") #define ARDEL_K mesconv("R: $B:o=|(B", "Remove") #define ADLOK_K mesconv("$BA*Br$5$l$?9`L\$r:o=|$7$^$9(B. $B$h$m$7$$$G$9$+(B ?", \ "Deleting the selected item, OK ?") #define ARSEL_K mesconv("$BJT=8$9$k%*%W%7%g%s9`L\$rA*$s$G2<$5$$(B.", \ "Select the option to edit.") #define ARDON_K mesconv("$B=*N;(B", "Done") #define ARCAN_K mesconv("$B%"!<%+%$%V%V%i%&%6$H$7$F$NEPO?$r%-%c%s%;%k$7$^$9$+(B ?", \ "Cancel registration for archive browser ?") #define ARNOT_K mesconv("$B%U%)!<%^%C%H$,EPO?$5$l$F$$$^$;$s(B. $B0lHL$N%i%s%A%c$H$7$FEPO?$7$^$9$+(B ?", \ "No format registered. Register as a normal launcher ?") #define EXTLN_K mesconv("$B%i%s%A%cEPO?MQ3HD%;R(B:", "Extension for launcher:") #define LNCHC_K mesconv("$B%i%s%A%cMQ%3%^%s%I(B:", "Command for launcher:") #define ISARC_K mesconv("$B%"!<%+%$%V%V%i%&%6$H$7$FEPO?$7$^$9$+(B ?", \ "Registration as archive browser ?") #define ARCHF_K mesconv("$B%"!<%+%$%V%V%i%&%6MQ%U%)!<%^%C%H(B:", \ "Format for archive browser:") #define TOPSK_K mesconv("$B@hF,9T$+$i$NITMW9T$N?t(B:", \ "needless line(s) from top:") #define BTMSK_K mesconv("$B:G=*9T$+$i$NITMW9T$N?t(B:", \ "needless line(s) from bottom:") #define ARIGN_K mesconv("$B%"!<%+%$%V%V%i%&%6MQITMW9T$N%Q%?!<%s(B:", \ "Pattern of ingored line for archive browser:") #define ARERR_K mesconv("$B%"!<%+%$%V%V%i%&%6MQ%(%i!<9T$N%Q%?!<%s(B:", \ "Pattern of error line for archive browser:") #define VALNG_K mesconv("$BIT@5$JCM$G$9(B.", "Invalid value.") #define DLLOK_K mesconv("[%s]$BMQ$N%i%s%A%cEPO?$r:o=|$7$^$9(B. $B$h$m$7$$$G$9$+(B ?", \ "Deleting the launcher registration for [%s], OK ?") #define EXTAR_K mesconv("$B%"!<%+%$%PEPO?MQ3HD%;R(B:", "Extension for archiver:") #define PACKC_K mesconv("$B05=LMQ%3%^%s%I(B:", "Command for pack:") #define UPCKC_K mesconv("$B?-D9MQ%3%^%s%I(B:", "Command for unpack:") #define DLAOK_K mesconv("[%s]$BMQ$N%"!<%+%$%PEPO?$r:o=|$7$^$9(B. $B$h$m$7$$$G$9$+(B ?", \ "Deleting the archiver registration for [%s], OK ?") #define DRNAM_K mesconv("$BEPO?$9$k%I%i%$%VL>$rA*$s$G2<$5$$(B.", \ "Select drive to register.") #define DRDEV_K mesconv("[%c:]$BMQ$N%G%P%$%9L>(B:", \ "Device name for [%c:]:") #define DLDOK_K mesconv("[%c:]$BMQ$N%U%m%C%T!<%I%i%$%VEPO?$r:o=|$7$^$9(B. $B$h$m$7$$$G$9$+(B ?", \ "Deleting the floppy drive for [%c:], OK ?") #define DRMED_K mesconv("$BEPO?$9$k%a%G%#%"uBV$KLa$7$^$9(B.", \ "Cancel this customizing and restore old configurations.") #define CCLEA_K mesconv("$B@_Dj$r:o=|$7%G%U%)%k%HCM$KLa$7$^$9(B.", \ "Clear configurations to default value.") #define CLOAD_K mesconv("$B@_Dj$r%U%!%$%k$+$iFI9~$_$^$9(B.", \ "Load configurations from file.") #define CSAVE_K mesconv("$B@_Dj$r%U%!%$%k$KJ]B8$7$^$9(B.", \ "Save configurations to file.") #define COVWR_K mesconv("$B4{B8@_Dj%U%!%$%k$K@_Dj$r>e=q$-$7$^$9(B.", \ "Overwrite configurations to existent file.") #define SREST_K mesconv("$B85$KLa$9HO0O$rA*$s$G2<$5$$(B. (Space $B$GA*Br2r=|(B.)", \ "Select the item to restore. (Cancel with Space.)") #define SCLEA_K mesconv("$B:o=|$9$kHO0O$rA*$s$G2<$5$$(B. (Space $B$GA*Br2r=|(B.)", \ "Select the item to delete. (Cancel with Space.)") #define FLOAD_K mesconv("$BFI9~$_%U%!%$%kL>(B:", "Load filename:") #define FSAVE_K mesconv("$BJ]B8%U%!%$%kL>(B:", "Save filename:") #define FSVOK_K mesconv("$B%U%!%$%k$,B8:_$7$^$9(B. $BJ]B8$rCf;_$7$^$9$+(B ?", \ "File exists. Stop writing, OK ?") #define SSAVE_K mesconv("$BJ]B8$9$kHO0O$rA*$s$G2<$5$$(B. (Space $B$GA*Br2r=|(B.)", \ "Select the item to save. (Cancel with Space.)") #define FOVWR_K mesconv("$B>e=q$-%U%!%$%kL>(B:", "Overwrite filename:") #define FOVOK_K mesconv("$B%U%!%$%k$,B8:_$7$^$;$s(B. $B?75,$K:n@.$7$^$9$+(B ?", \ "No such file. Creating new file, OK ?") #define SOVWR_K mesconv("$B>e=q$-$9$kHO0O$rA*$s$G2<$5$$(B. (Space $B$GA*Br2r=|(B.)", \ "Select the item to overwrite. (Cancel with Space.)") #define NOSAV_K mesconv("$BJQ99$rJ]B8$7$F$$$^$;$s$,$3$N$^$^=*N;$7$F$h$m$7$$$G$9$+(B ?", \ "Exiting without saving changed configurations, OK ?") #define HALAS_K mesconv("$B%3%^%s%I$N%(%$%j%"%9Dj5A$r$7$^$9(B.", \ "Define the alias of command.") #define HBIND_K mesconv("$B3F%-!<$KBP$9$k%3%^%s%I$N3dEv$F$r9T$J$$$^$9(B.", \ "Set the bound command for each key.") #define HKYMP_K mesconv("$B3F