jupp/COPYING010064400000000000000000000305051321207545500100250ustar00 GNU GENERAL PUBLIC LICENSE Version 1, February 1989 Copyright (C) 1989 Free Software Foundation, Inc. 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA Everyone is permitted to copy and distribute verbatim copies of this license document, but changing it is not allowed. Preamble The license agreements of most software companies try to keep users at the mercy of those companies. By contrast, our General Public License is intended to guarantee your freedom to share and change free software--to make sure the software is free for all its users. The General Public License applies to the Free Software Foundation's software and to any other program whose authors commit to using it. You can use it for your programs, too. When we speak of free software, we are referring to freedom, not price. Specifically, the General Public License is designed to make sure that you have the freedom to give away or sell copies of free software, that you receive source code or can get it if you want it, that you can change the software or use pieces of it in new free programs; and that you know you can do these things. To protect your rights, we need to make restrictions that forbid anyone to deny you these rights or to ask you to surrender the rights. These restrictions translate to certain responsibilities for you if you distribute copies of the software, or if you modify it. For example, if you distribute copies of a such a program, whether gratis or for a fee, you must give the recipients all the rights that you have. You must make sure that they, too, receive or can get the source code. And you must tell them their rights. We protect your rights with two steps: (1) copyright the software, and (2) offer you this license which gives you legal permission to copy, distribute and/or modify the software. Also, for each author's protection and ours, we want to make certain that everyone understands that there is no warranty for this free software. If the software is modified by someone else and passed on, we want its recipients to know that what they have is not the original, so that any problems introduced by others will not reflect on the original authors' reputations. The precise terms and conditions for copying, distribution and modification follow. GNU GENERAL PUBLIC LICENSE TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION 0. This License Agreement applies to any program or other work which contains a notice placed by the copyright holder saying it may be distributed under the terms of this General Public License. The "Program", below, refers to any such program or work, and a "work based on the Program" means either the Program or any work containing the Program or a portion of it, either verbatim or with modifications. Each licensee is addressed as "you". 1. You may copy and distribute verbatim copies of the Program's source code as you receive it, in any medium, provided that you conspicuously and appropriately publish on each copy an appropriate copyright notice and disclaimer of warranty; keep intact all the notices that refer to this General Public License and to the absence of any warranty; and give any other recipients of the Program a copy of this General Public License along with the Program. You may charge a fee for the physical act of transferring a copy. 2. You may modify your copy or copies of the Program or any portion of it, and copy and distribute such modifications under the terms of Paragraph 1 above, provided that you also do the following: a) cause the modified files to carry prominent notices stating that you changed the files and the date of any change; and b) cause the whole of any work that you distribute or publish, that in whole or in part contains the Program or any part thereof, either with or without modifications, to be licensed at no charge to all third parties under the terms of this General Public License (except that you may choose to grant warranty protection to some or all third parties, at your option). c) If the modified program normally reads commands interactively when run, you must cause it, when started running for such interactive use in the simplest and most usual way, to print or display an announcement including an appropriate copyright notice and a notice that there is no warranty (or else, saying that you provide a warranty) and that users may redistribute the program under these conditions, and telling the user how to view a copy of this General Public License. d) You may charge a fee for the physical act of transferring a copy, and you may at your option offer warranty protection in exchange for a fee. Mere aggregation of another independent work with the Program (or its derivative) on a volume of a storage or distribution medium does not bring the other work under the scope of these terms. 3. You may copy and distribute the Program (or a portion or derivative of it, under Paragraph 2) in object code or executable form under the terms of Paragraphs 1 and 2 above provided that you also do one of the following: a) accompany it with the complete corresponding machine-readable source code, which must be distributed under the terms of Paragraphs 1 and 2 above; or, b) accompany it with a written offer, valid for at least three years, to give any third party free (except for a nominal charge for the cost of distribution) a complete machine-readable copy of the corresponding source code, to be distributed under the terms of Paragraphs 1 and 2 above; or, c) accompany it with the information you received as to where the corresponding source code may be obtained. (This alternative is allowed only for noncommercial distribution and only if you received the program in object code or executable form alone.) Source code for a work means the preferred form of the work for making modifications to it. For an executable file, complete source code means all the source code for all modules it contains; but, as a special exception, it need not include source code for modules which are standard libraries that accompany the operating system on which the executable file runs, or for standard header files or definitions files that accompany that operating system. 4. You may not copy, modify, sublicense, distribute or transfer the Program except as expressly provided under this General Public License. Any attempt otherwise to copy, modify, sublicense, distribute or transfer the Program is void, and will automatically terminate your rights to use the Program under this License. However, parties who have received copies, or rights to use copies, from you under this General Public License will not have their licenses terminated so long as such parties remain in full compliance. 5. By copying, distributing or modifying the Program (or any work based on the Program) you indicate your acceptance of this license to do so, and all its terms and conditions. 6. Each time you redistribute the Program (or any work based on the Program), the recipient automatically receives a license from the original licensor to copy, distribute or modify the Program subject to these terms and conditions. You may not impose any further restrictions on the recipients' exercise of the rights granted herein. 7. The Free Software Foundation may publish revised and/or new versions of the General Public License from time to time. Such new versions will be similar in spirit to the present version, but may differ in detail to address new problems or concerns. Each version is given a distinguishing version number. If the Program specifies a version number of the license which applies to it and "any later version", you have the option of following the terms and conditions either of that version or of any later version published by the Free Software Foundation. If the Program does not specify a version number of the license, you may choose any version ever published by the Free Software Foundation. 8. If you wish to incorporate parts of the Program into other free programs whose distribution conditions are different, write to the author to ask for permission. For software which is copyrighted by the Free Software Foundation, write to the Free Software Foundation; we sometimes make exceptions for this. Our decision will be guided by the two goals of preserving the free status of all derivatives of our free software and of promoting the sharing and reuse of software generally. NO WARRANTY 9. BECAUSE THE PROGRAM IS LICENSED FREE OF CHARGE, THERE IS NO WARRANTY FOR THE PROGRAM, TO THE EXTENT PERMITTED BY APPLICABLE LAW. EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR OTHER PARTIES PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE PROGRAM IS WITH YOU. SHOULD THE PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF ALL NECESSARY SERVICING, REPAIR OR CORRECTION. 10. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY AND/OR REDISTRIBUTE THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THE USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED TO LOSS OF DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER PROGRAMS), EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES. END OF TERMS AND CONDITIONS Appendix: How to Apply These Terms to Your New Programs If you develop a new program, and you want it to be of the greatest possible use to humanity, the best way to achieve this is to make it free software which everyone can redistribute and change under these terms. To do so, attach the following notices to the program. It is safest to attach them to the start of each source file to most effectively convey the exclusion of warranty; and each file should have at least the "copyright" line and a pointer to where the full notice is found. Copyright (C) 19yy This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 1, or (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston MA 02110-1301 USA Also add information on how to contact you by electronic and paper mail. If the program is interactive, make it output a short notice like this when it starts in an interactive mode: Gnomovision version 69, Copyright (C) 19xx name of author Gnomovision comes with ABSOLUTELY NO WARRANTY; for details type `show w'. This is free software, and you are welcome to redistribute it under certain conditions; type `show c' for details. The hypothetical commands `show w' and `show c' should show the appropriate parts of the General Public License. Of course, the commands you use may be called something other than `show w' and `show c'; they could even be mouse-clicks or menu items--whatever suits your program. You should also get your employer (if you work as a programmer) or your school, if any, to sign a "copyright disclaimer" for the program, if necessary. Here a sample; alter the names: Yoyodyne, Inc., hereby disclaims all copyright interest in the program `Gnomovision' (a program to direct compilers to make passes at assemblers) written by James Hacker. , 1 April 1989 Ty Coon, President of Vice That's all there is to it! jupp/ChangeLog010064400000000000000000001327041363731414500105530ustar00Wed Nov 10 2004 mirabilos Use anonCVS or CVSweb by the MirOS Project to retrieve changes for MirJupp. I don't closely follow GNU coding standards. cf. http://cvs.mirbsd.de/src/share/doc/legal/LICENCE-GNU Direct source: https://www.mirbsd.org/cvs.cgi/contrib/code/jupp/ Direct cvslog: http://news.gmane.org/gmane.os.miros.cvs Sat May 29 2004 Joe Allen Use 'aspell' if it exists. Set Home, End, Insert, Del key bindings, assuming termcap entry is wrong. Fri May 28 2004 Joe Allen Status line updates even if you keep typing. Fri May 28 2004 Joe Allen Now it will use sprintf if snprintf does not exist. Can now build on IRIX 6.2 Thu May 27 2004 Joe Allen Fix segfault due to bad management of 'pieces' in rc/setopt(). Thu May 27 2004 Joe Allen Added asm.jsf.in. Thu May 27 2004 Joe Allen Added diff.jsf.in. Added improved xml.jsf.in Wed May 26 2004 Joe Allen Fix lockup problem: do not allow querysave in prompt windows. Tue May 25 2004 Joe Allen Character set aliases now appear in ^T E tab completion. Mon May 24 2004 Joe Allen Fix bg_reg -> bg_red. Now we understand aliases for character maps, like latin1 -> iso-8859-1 and 8859-1 -> iso-8859-1. Mon May 24 2004 Joe Allen Smart indent and backspace now work even if cursor is not right at indentation point. Also autoindent does not happen if cursor is on a space or tab character. Jmacs: ^W (cut) now works if mark is after point. (Added -autoswap mode). Also: preserve mark and point positions during block operations. Wed May 19 2004 Joe Allen Allow options after strings in syntax files. Wed May 19 2004 Joe Allen More fixes for Cygwin: shell windows now work properly. Tue May 18 2004 Joe Allen Changed ESC y to yank in joerc. Left ESC ^Y as yankpop. Added "spring" escape sequence for help text. Mon May 17 2004 Joe Allen Fix backspace handling in shell windows. Ring bell when we get ^G. Sun May 16 2004 Joe Allen Fix -syntax and -encoding on command line. Check for "pty.h" when openpty is used. Sun May 16 2004 Joe Allen Fix mason bug. Change ^K ^M back to move block. ^K H in jstar mode is "nmark". Fri May 14 2004 Joe Allen Mason highlighter Fri May 14 2004 Joe Allen Many jpicorc.in improvements. Thu May 13 2004 Joe Allen Improve exit messages. Improve 'lose' which is for jmacs. Improve ^X for jpico. Got rid of "end of processs" message in shell windows. Shell windows can now be orphaned and duplicated (process is associated with B instead of BW). Shell window input taken from cmd.c instead of in actual edit functions. Improved 'lose' again- now it fill in windows with any orphaned buffers it can find. Thu May 13 2004 Joe Allen Small compile fix. Wed May 12 2004 Joe Allen Compile now uses shell window (so you can hit ^C during the compile. Shell window termination code fix: now all of the output always makes it to the window. Added query save loop to save all modified files before build. Added scratch buffers: they are ignored during ^K X, ^C and querysave. ^X ^C is now much more like emacs. Fixed annoying occasional screen update glitch: it was caused by SIGALRM causing dropped output in Linux (doesn't happen on SUN). So now we arm SIGALRM only when waiting for input. (SIGALRM is used to keep the clock updated). Wed May 12 2004 Joe Allen Applied Olexiy Avramchenko's patch on configure.ac. Also added mail.jsf.in to Makefile.am Applied Yura Kalinichenko's "openpty" patch. Tue May 11 2004 Joe Allen Added "upper" and "lower" functions (no longer depend on "tr" command). Fix jmacs transpose word command. Tue May 11 2004 Joe Allen Fix marking mode so only window with cursor is effected. Ctrl-space clears selection when cursor is in selection, otherwise it starts a new one. ^K E prompts to load original file from disk. Tue May 11 2004 Joe Allen * b.c ufile.c : Update file date on save. Improve Ctrl- marking. Mon May 10 2004 Joe Allen * ufile.c b.c : Warns if file changed on save. Add 'beep' function and updated jmacsrc.in Mon May 10 2004 Joe Allen * usearch.c, uisrch.c: Added '-wrap' flag. Search wraps when set. Mon May 10 2004 Joe Allen * *rc.in : More globs: .cpp, .hpp, .c++, .h++ Mon May 10 2004 Joe Allen * b.c tw.c : New status line escape sequence: %x shows current context (function cursor is in). More globs in *rc.in files. csh.jsf lisp.jsf Sun May 9 02:30:41 EDT 2004 * sh.jsf.in : Improved shell script highlighter. Fix spelling errors in joe.1.in Sat May 8 2004 Joe Allen * usearch.c : Fixed bug in tab completion in text windows. Change tab completion key to ^K Fri May 7 22:37:49 EDT 2004 * usearch.c : Tab completion at search prompt. ESC-Tab completes within text windows. Fri May 7 16:02:21 EDT 2004 * usearch.c, uisrch.c : Added case insensitive by default option. Fri May 7 2004 Joe Allen * main.c, menu.c, pw.c, qw.c, rc.c, tab.c : joe a b c, now windows are in order a, b, c. TAB completion now works on last path in prompt window: for example '!ls foo', tab will complete the foo. Added menu_explorer option. When set: menu stays up when a directory is seleted. When clear: directory is added to path and menu is closed. Menus are now 40% of window size (or smaller if they are not filled). Cursor is now position after selected menu entry. Thu May 6 2004 Joe Allen * umenu.c : TAB key now cycles through menu entries. This is useful for tab completion: just keep hitting tab until you see the file you want, then hit enter. TAB completion is more "bash"-like: if you complete a directory name a menu does not appear, the directory just gets added to the prompt. Thu May 6 2004 Joe Allen * ublock.c : Added "select" function for Ctrl-arrow selecting. Ctrl-space drops anchor and sets marking mode. Thu May 6 2004 Joe Allen * uerror.c : Improve error parser: require ':' on error lines. Make macro 'compile' for error parsing. 'compile' macro always uses same buffer. ^X ` in jmacs goes to next error. Thu May 6 2004 Joe Allen * uedit.c : Smart tab looks back 10 lines to determine indentation. Wed May 5 2004 Joe Allen * charmap.c : Now parses charmap files. Wed May 5 2004 Joe Allen * bw.c charmap.c main.c qw.c qw.h regex.c regex.h syntax.c types.h uisrch.c usearch.c utf8.c utf8.h: Regex search now works properly with UTF-8 chars. Incremental search now works with UTF-8. Wed May 5 2004 Joe Allen * utils.c, c.jsf.in: Fix c++ keywords. Fix parse_ident, which was breaking fortran highlighter. Tue May 4 2004 Joe Allen * rc.c, selinux.c, syntax.c, ufile.c: Applied new Selinux patch. Checks ~/.joe/syntax for syntax files. Tue May 4 2004 Joe Allen * bw.c, charmap.c, main.c: Print locale on startup line. Print encoding for ^K . Change koi8-T to koi8-t. Tue May 4 2004 Joe Allen * ChangeLog TODO b.c bw.c charmap.c charmap.h cmd.c help.c i18n.c i18n.h joerc.in jpicorc.in jstarrc.in macro.c main.c menu.c pw.c pw.h rc.c regex.c rjoerc.in scrn.c scrn.h syntax.c types.h ublock.c uedit.c uerror.c ufile.c uformat.c umath.c usearch.c ushell.c utag.c utf8.c utils.c utils.h w.c: Everything about character set is now contained in struct charmap. Deprecate ^T U. Now use ^T E to select file encoding. Mon May 3 2004 Joe Allen * : Clean up pass: use internal ctype function everywhere. Also: ^T E sets file encoding. Mon Mai 3 2004 Joe Allen * utils.c, utils.h, utf8.c, syntax.c, configure.ac, Makefile.am, charmap.c, charmap.h: No longer use iconv(). Not 100% sure I'm going to leave it this way. Maybe optionally use iconv(). Mon May 3 2004 Joe Allen *: Eliminate --pedantic warnings. Mon May 3 2004 Joe Allen * bw.c, i18n.c, i18n.h, b.c, configure.ac, regex.c, scrn.c, Makefile.am : Fix highlighter when there are utf-8 characters in file. No longer depend on wctype.h (working towards not depending on iconv()). Sun May 2 2004 Joe Allen * Makefile.am, configure.ac, *rc.in: Fix mutt mode: need -wordwrap, not -autoindent. Fix configure.ac and Makefile.am to link -liconv if necessary. Sat May 30 2004 Joe Allen * syntax.c : Fix segfault problem with load_dfa. Fri Apr 30 2004 Joe Allen *: Improve Fortran again. Added '-indentfirst' option to control how smarthome works. Now syntax files are loaded as needed. New version of automake and autoconf. Print UTF-8 (c) if terminal is utf-8. Thu Apr 29 2004 Joe Allen *: Improve Fortran syntax file. Improve Perl syntax file. Wed Apr 28 2004 Joe Allen *: Improve C and Java syntax files. Wed Apr 28 2004 Joe Allen * syntax.c : More syntax files: tcl Now 'noeat' implies 'recolor=-1', which reduces debug time for syntax definition files. Tue Apr 27 2004 Joe Allen *: More syntax files: html, pascal, vhdl, fortran, java, xml. Allow comment lines in syntax file string lists. Mon Apr 26 2004 Joe Allen * Makefile.am bw.c configure.ac *rc.in utf8.c syntax/perl.jsf.in syntax/verilog.jsf.in: Forgot .pm files for perl. Update colors for perl and verilog. Added mail.jsf: works nicely with mutt Oops- was displaying characters between 0xA0 - 0xBF as control characters in UTF-8. Mon Apr 26 2004 Joe Allen * uedit.c ublock.c : Smart backspace now always fixes the indentation. Indent left and right always fix indentation. Mon Apr 26 2004 Joe Allen * bw.c tty.c uedit.c utf8.c *rc.in: Fix rtarw: was not fixing xcol. TAB key now does smart indenting. smart home goes to real home first, then indentation point. Sun Apr 25 2004 Joe Allen * b.c bw.c scrn.c uedit.c utf8.c utf8.h: Better handling of iconv() conversion errors. Better handling of error UTF-8 sequences. Sat Apr 24 2004 Joe Allen * utf8.c, utf8.h, scrn.c, bw.c : Fixed utf8 encoder for characters between 0x10000 and 0x1FFFF. Print for unicode control characters. Fri Apr 23 2004 Joe Allen Added -guess_crlf and -guess_indent options. Update *rc files. Updated documentation. Thu Apr 22 2004 Joe Allen * cmd.c, pw.c, pw.h, rc.c, syntax.c, syntax.h, types.h, uedit.c, utils.c, utils.h, syntax/c.jsf.in: Fixed uopen() ^] for overtype mode. Added 'istrings' option in syntax files for ignoring case in strings. Added ^T Y- allows you to select syntax during run time (tab completion works too!) Added ^T P- picture mode: can move and type anywhere on the screen, good for drawing ASCII art. Thu Apr 22 2004 Joe Allen * uedit.c: Tab key only inserts when past end of line in overtype mode. Thu Apr 22 2004 Joe Allen * uedit.c: Fixed bugs where overtype and wordwrap modes were interacting. Hope this doesn't cause new bugs... Thu Apr 22 2004 Joe Allen * uedit.c: Now, enter does not insert new line when in overtype mode (unless at end of file). Somebody asked for this. Wed Apr 21 2004 Joe Allen * b.c, b.h, joerc.in, rc.c, types.h, ublock.c, uedit.c: Added -purify option which fixes indentation if necessary for ^K, ^K. and smart backspace. Wed Apr 21 2004 Joe Allen * ublock.c : ^K , and ^K . now have improved purity checking and automatic block selection. Wed Apr 21 2004 Joe Allen * rc.c, uedit.c, types.h, joerc.in: Added 'smartbacks' option. Wed Apr 21 2004 Joe Allen * uedit.c, b.c: Backspace is now smart when 'smarthome' is set. Wed Apr 21 2004 Joe Allen * uedit.c : Fix new bug caused by previous bug fix :-) Tue Apr 20 2004 Joe Allen * uedit.c : Fix bug where double wide characters typed at end of line was screwing up (was assuming that they were one character wide in the utypebw optimization logic). Tue Apr 20 2004 Joe Allen * cmd.c, joerc.in, rc.c, types.h, uedit.c, uedit.h: Applied David Phillips' smart home key patch. Changed ` u to ` x. Sun Apr 18 2004 Joe Allen * syntax.c, uedit.c: Added ` u to insert unicode characters in hex. Fixed typeing of unicode (utypebw() optimization bug). Fixed editor hang when syntax hightlighter hits unicode characters. Sat Apr 17 2004 Joe Allen * bw.c menu.c qw.c scrn.c scrn.h utf8.h w.c w.h: Allow UTF-8 in menu entries. Clear up genfield() and genfmt() stuff. Now control characters in file names are properly displayed. When UTF-8 character decodes to 127 - 159, 0 - 31, display it as a control character. Sat Apr 17 2004 Joe Allen * w.c: Oops: fixed status line. Fri Apr 16 2004 Joe Allen * ChangeLog TODO cmd.c macro.c pw.c pw.h rc.c regex.c ublock.c uedit.c ufile.c umath.c usearch.c ushell.c utag.c utf8.c w.c w.h: UTF-8 now supported in file names and prompts. Search should be partially working. \+ with a UTF-8 character following is broken and \[ ] only works for bytes. Fri Apr 16 2004 Joe Allen * b.c, bw.c, rc.c, rc.h, tw.c, types.h, utf8.c: Fixed bug where '-syntax' on command line had no effect. Now if terminal is UTF-8, the default file type is assumed to be UTF-8. Thu Apr 15 2004 Joe Allen * utf8.c: Added preprocessor directives to utf8.c to check for locale support. Needs more work: should check for iconv() support. Fix bug which happened when no locale env vars set. Thu Apr 15 2004 Joe Allen * Makefile.am, configure.ac, main.c, scrn.c, uedit.c, ufile.c, utf8.c, utf8.h: First attempt at character set conversion iconv(). Now the file's coding can be different from the terminal's coding. Needs error checking... Also, applied secure linux patch from RedHat. Thu Apr 15 2004 Joe Allen * bw.c, help.c, main.c, menu.c, rc.c, scrn.c, scrn.h, syntax.c, syntax.h, uedit.c, w.c: Fix syntax definition file loader so that you don't get seg faults when you refer to a state which doesn't exist. Fix outatr() to work with non-UTF-8 character sets again. Need to start thinking about iconv(). Mess with option strings to make ^T look nicer. Got rid of yellow selection bar from ^T. Wed Apr 14 2004 Joe Allen * b.c b.h macro.c main.c rc.c uedit.c uerror.c uformat.c utag.c utils.c utils.h: Fix many edit fuctions for UTF-8. Now we use iswalnum() when in UTF-8 mode. Paragraph format works. Search is still broken. Tue Apr 13 2004 Joe Allen * bw.c, syntax.c, syntax.h, syntax/php.jsf.in, syntax/c.jsf.in: Added '-NNN' syntax to .jsf files. Allows you to specify number of lines back to start parsing when we don't have the syntax highlighting state. Tue Apr 13 2004 Joe Allen Moved syntax file to syntax/ subdirectory. They still don't get installed in a subdirectory :-( Tue Apr 13 2004 Joe Allen * scrn.c, rc.c, joerc.in: Added -assume_color global option. Need to update other *rc files. Mon Apr 12 2004 Joe Allen * Makefile.am b.c b.h bw.c scrn.c uedit.c utf8.c utf8.h: Input of UTF-8 is now working. For example, you can cut and paste in an xterm. Placed UTF-8 encoder and decoder in separate file. Mon Apr 12 2004 Joe Allen * bw.c: If a double-wide character hits right column, display '>' instead of the character. If a double-wide character is one column to the left of the screen, display '<' instead of the character. Mon Apr 12 2004 Joe Allen * almost all of them...: Added -notite global option: when set, prevents screen from being restored on exit. Added -usetabs global option: when set, uses tabs for cursor position update (which was the default before). Now we don't use tabs by default. Completed change to 'unsigned char *' and elimination of MAXINT. What a mess. No warnings with gcc -pedantic. Fix UTF-8 bugs where cursor was not correct on scrolled screen. Fri Apr 9 2004 Joe Allen * b.c, b.h, bw.c, types.h: Fix lockup bug with down arrow on last line (utf-8). Type change: chars will be banned. Unsigned char * and int will be used for characters. Fri Apr 9 2004 Joe Allen * Makefile.am, b.c, b.h, bw.c, help.c, main.c, menu.c, rc.c, scrn.c, scrn.h, types.h, uedit.c, w.c, wcwidth.c: Initial check-in of UTF-8 support. Use ^T U to enable UTF-8. JOE is likely to have many bugs at this point. Thu Apr 8 2004 Joe Allen * bw.c, b.c, joerc.in, rc.c, rc.h, tw.c, types.h: Fix screen update bug introduced with Apr 7th change. Option settings now can be based on file contents as well as file name. Added syntax indicator for status line. Thu Apr 8 2004 Joe Allen * syntax.c, syntax.h: Clean up syntax.c: use hash table for keywords, use subroutine for allocating new states. Wed Apr 7 2004 Joe ALlen * scrn.c, bw.c: Fix highlighting bug: pointer was not always at start of line. Assume terminal supports color if it looks like an ansi terminal (this should really be an option). Tue Apr 6 2004 Joe Allen * Makefile.am, bw.c, configure.ac, joerc.in, rc.c, scrn.c, scrn.h, syntax.c, syntax.h, c.jsf.in, perl.jsf.in, verilog.jsf.in: Clean up meaning of default color. Allow syntax to be specified in joerc file: "-syntax perl" Add class definitions to syntax files. Add perl and verilog definitions (they need work). Change joerc to assume files with . in their name do not want word wrap enabled (except for .txt). Thu Apr 1 2004 Joe Allen * scrn.c: Fix color handling for terminals which do not use my defaults :-) Basically we revert to the default text color, use ESC [ 0 m, not ESC [ 37 m and ESC [ 40 m. Tue Mar 30 2004 Joe Allen * uedit.c, syntax.c, syntax.h, types.h, bw.c: Next steps for syntax highlighting: Now there is a real parser, so syntax files can be defined (although, it only loads the C language c.jsf for now). The line length limit has been eliminated. It should be faster for large files: we start parsing only 50 lines back when you hit PgUp, not from the start of file each time. Todo: update other windows, allow files of other types to be highlighted, create user interface to allow region names to be assigned colors, create more syntax files. Possibly create program to convert regex NFA to joe DFA syntax file format. Wed Mar 24 2004 Joe Allen * uedit.c: Fix bug where hitting ^Z on first word of file caused joe to lock up Wed Mar 24 2004 Joe Allen * lots of file: First steps at syntax highlighting! This version has support for C only (and the parser is a big hack), and only if all lines in the file are less than 1K. Turn it on with ^T H Todo: some more speed enhancements, a real parser to handle many file types, eliminate long line hack, update other windows during typing, eliminate some cycle saving hacks when highlighting is on. Mon Mar 22 2004 Joe Allen * jmacsrc.in: Added ^X [ and ^X ]. Sat Mar 20 2004 Joe Allen * menu.c, menu.h, joerc.in, jstarrc.in, jmacsrc.in, rjoerc.in, jpicorc.in, cmd.c: File selection menu is now four lines instead of one line. This needs a little more work: user should be able to set how many lines it should be in each context. Sat Mar 20 2004 Joe Allen * usearch.c: After every search we reset window left offset to 0 and then make the minimal left-right scroll necessary to get entire found text completely on the screen. Sat Mar 20 2004 Joe Allen * uerror.c: Slight improvement in compiler error parser. Sat Mar 20 2004 Joe Allen Fix shell window again: instead of running bash if there is no SHELL variable defined, we just print a message. Also noticed that session leader stuff in Cygwin is broken: if you suspend joe the subshell breaks. Sat Mar 20 2004 Joe Allen * tty.c, ushell.c: Fix shell window for Cygwin: The problem was that the SHELL environment variable is not defined. So now, if it's not defined we assume /usr/bin/bash. Also, we have to use /dev/ptmx for Cygwin. There is still a problem: have to refresh the screen after shell starts. Fri Mar 19 2004 Joe Allen * tty.c: Fix shell window for SunOS 5.8 Thu Mar 18 2004 Joe Allen * usearch.c, regex.c, regex.h: Allow full escape sequences in replacement strings fixes bug #828156 Thu Mar 18 2004 Joe Allen * b.c: Automatically detect MS-DOS files (files with ^M^J terminated lines) Thu Mar 18 2004 Joe Allen * tw.c, uedit.c, tty.c: Fix ^C and ^D in shell windows (for linux at least) Mon Jan 19 2004 Marek 'Marx' Grac * utag.c: Correct file position by using tags file generated from ctags 5.5.2 Wed Jul 9 2003 John Morrissey * configure.ac: look for snprintf() in libdb too (fixes compilation on OSF1) Fri Jun 20 2003 Anil Madhavapeddy * usearch.c: fix boundary to snprintf() Mon Jun 16 2003 Vitezslav Samel * uedit.c u_goto_prev()/u_goto_next() fix take two: skip over spaces (return of joe-2.8 behaviour) Sun Jun 1 2003 Vitezslav Samel * cmd.c, tab.c, uisrch.c: don't beep when not asked (suggestion by Marc Joosen ) Sun Jun 1 2003 Vitezslav Samel * configure.ac, ublock.c: NEW FEATURE: when filtering block put JOE_FILENAME= with the right filename into the environment (only when putenv() is available); patch by Marc Joosen Sat May 31 2003 Vitezslav Samel * uedit.c: make u_goto_prev()/u_goto_next() act like ubackw()/u_word_delete() when moving cursor, i.e. operate on the same class of characters Sat May 31 2003 Vitezslav Samel * configure.ac: change version number to include _CVS suffix Mon May 5 2003 Vitezslav Samel *** Release joe-2.9.8 *** * NEWS, configure.ac, main.c: update NEWS; bump up version; update copyright year Sat May 3 2003 Vitezslav Samel * README: delete untrue statements and mention the new build system; this file needs some more work Sat Mar 22 2003 Vitezslav Samel * jstarrc.in, rc.c: fix typos (patch by Jesse McGrew) Sat Mar 22 2003 Vitezslav Samel * cmd.c: fix memleak in docmd() (patch by Jesse McGrew) Sat Mar 22 2003 Vitezslav Samel * path.c: use O_EXCL when creating temporary file Sun Mar 2 2003 Vitezslav Samel * bw.c, cmd.c, hash.c, kbd.c, macro.c, main.c, menu.c, path.c, poshist.c, pw.c, qw.c, rc.c, regex.c, scrn.c, tab.c, termcap.c, tty.c, tw.c, ublock.c, uedit.c, uerror.c, ufile.c, uisrch.c, umath.c, undo.c, usearch.c, ushell.c, utag.c, vfile.c, vs.c, w.c: change 0 to NULL where we're talking about pointers Sun Mar 2 2003 Vitezslav Samel * vs.c, vs.h: make vsrm() and slen() of type sELEMENT * Sat Feb 22 2003 Vitezslav Samel * configure.ac: remove AC_FUNC_MALLOC check; this fixes problem with compilation on alpha; we should check for size == 0 in joe_malloc() Wed Feb 19 2003 Vitezslav Samel * b.c, b.h, cmd.c, cmd.h, help.c, kbd.c, kbd.h, macro.c, macro.h, main.c, rc.c, rc.h, regex.c, uisrch.c: change type of variables holding string to unsigned char * Wed Feb 19 2003 Vitezslav Samel * b.c, tw.c: change type of variables holding time values to time_t Sat Feb 15 2003 Vitezslav Samel * b.c, b.h, bw.c, config.h, macro.c, regex.c, tty.c, ublock.c, uedit.c, uerror.c, uformat.c, uisrch.c, usearch.c, utag.c, utils.c, utils.h, vfile.c, vfile.h: fix segafults in isalpha(): replace MAXINT with NO_MORE_DATA symbol which has value of EOF (-1); that value is permitted to pass into isalpha() type functions Sun Jan 5 2003 Vitezslav Samel * configure.ac: newer versions (>= 2.54) of autoconf need AC_PROG_EGREP to prevent lockup when running configure; this change require autoconf-2.54 at least to properly build joe from CVS Wed Jan 1 2003 Vitezslav Samel * rc.c: eliminate "expr, expr" to make sources more readable; change "magic number" to the sizeof() Wed Jan 1 2003 Vitezslav Samel * b.c: pisbow() should match the beginning of file and piseow() should match the end of file Sat Dec 7 2002 Vitezslav Samel * kbd.c: don't expect all archs have "char == signed char" by default Sat Dec 7 2002 Vitezslav Samel * blocks.c, vfile.c: 64bit arch fixes: don't expect pointer fits into int (now we assume it fits into unsigned long) Sat Dec 7 2002 Vitezslav Samel * types.h, usearch.c: rename restrict() and restrict member of struct search to make joe compile under HPUX with HP C compiler Mon Aug 5 2002 Vitezslav Samel *** SECURITY *** * ufile.c: drop suid and sgid bits (if set) when creating backup files Sat Jul 27 2002 Vitezslav Samel * jmacsrc.in, jpicorc.in, jstarrc.in: use .@7 terminfo entry for "End" key Wed Jun 26 2002 Vitezslav Samel * bw.c, rc.c, rc.h, w.c: rename getcontext() to kmap_getcontext() to prevent conflict with glibc (from Debian patches) Mon Jun 17 2002 Vitezslav Samel * ublock.c: insert braces to make if() block evident Sun Jun 9 2002 Vitezslav Samel * b.c, bw.c, cmd.c, hash.c, kbd.c, macro.c, main.c, rc.c, regex.c, termcap.c, tty.c, ublock.c, umath.c, vfile.c: change "expr, expr" to "expr; expr" where appropriate to make sources more readable (should have no impact on code) (take 2) Sun Jun 9 2002 Vitezslav Samel * hash.c, hash.h: move hnext() definition into hash.c Sun Jun 9 2002 Vitezslav Samel * bw.c, rc.c, termcap.c, ufile.c, usearch.c: kill some warnings when compiled with -Wall Sat Jun 8 2002 Vitezslav Samel * cmd.c: unwrap array elements in initialization of cmds[] Sat Jun 8 2002 Vitezslav Samel * va.c, va.h: change aELEMENT #define to typedef Sat Jun 8 2002 Vitezslav Samel * ufile.c: change write() to joe_write() to avoid partly copied files Sat Jun 8 2002 Vitezslav Samel * termcap.c: strcmp() can return values other than -1/0/+1 Sat Jun 8 2002 Vitezslav Samel * b.c, bw.c, macro.c, path.c, pw.c, queue.h, rc.c, regex.c, scrn.c, scrn.h, tab.c, termcap.c, termidx.c, tty.c, tw.c, ublock.c, uedit.c, uerror.c, ufile.c, uformat.c, undo.c, usearch.c, ushell.c, vfile.c, vs.c, w.c: change "expr, expr" to "expr; expr" where appropriate to make sources more readable (should have no impact on code) Tue Jun 4 2002 Vitezslav Samel * scrn.c: don't clear screen when nonzero skiptop is given (part 2) Mon Jun 3 2002 Vitezslav Samel * scrn.c: don't clear screen when nonzero skiptop is given Sat Jun 1 2002 Vitezslav Samel * configure.ac, utils.c: kill warnings when compilling with -Wundef Tue May 21 2002 Vitezslav Samel * poshist.c, scrn.c, uformat.c: include some headers which are needed to compile without warnings about implicit function declarations Sun May 5 2002 Vitezslav Samel * NEWS: change wrong version for the last entry Sun May 5 2002 Vitezslav Samel * configure.ac: solaris compile fix; check for snprintf - if not available, kick out Sun Mar 10 2002 Vitezslav Samel * uformat.c: remove deadlock when reformating paragraph (badly converted whitel() to isspace() from removed zstr.c in joe-2.9.2) Wed Jan 30 2002 Vitezslav Samel * b.c: use GCHAR macro - clean up the source Wed Jan 30 2002 Vitezslav Samel * b.c: change 0 to NULL when used as pointer Wed Jan 30 2002 Vitezslav Samel * b.c: change "expr, expr" to "expr; expr" Wed Jan 30 2002 Vitezslav Samel * b.c, b.h, types.h: cosmetic cleanup: add comments - this patch doesn't touch code Fri Jan 25 2002 Vitezslav Samel * termcap.c: strcmp() can return values other than -1/0/+1 (fix supplied by Schermann Gabor ) Sat Jan 19 2002 Vitezslav Samel * ublock.c: don't use markb and markk after they are freed (fixes segfault) Sun Jan 13 2002 Vitezslav Samel * regex.c: fix char escaping in \+ case Sat Jan 12 2002 Vitezslav Samel * help.c, types.h: get back context help (vanished in cleaning patch to help by marx_sk) (context help is now only used in search prompt window) Tue Jan 8 2002 Vitezslav Samel * vs.c, vs.h: change sELEMENT #define to typedef Mon Jan 7 2002 Vitezslav Samel * acinclude.m4, configure.ac, tty.c, umath.c, ushell.c, utils.c, utils.h: cleanup signals handling (sigaction() / sigvec() / signal()) Sun Jan 6 2002 Vitezslav Samel * cmd.c: correct "negated macro" for nbuf/pbuf macros Fri Dec 14 2001 Vitezslav Samel *** Release joe-2.9.8-pre1 *** Fri Dec 14 2001 Vitezslav Samel * configure.ac, NEWS: prepare for -pre release; bump up version to 2.9.8-pre1 Fri Dec 14 2001 Vitezslav Samel * Makefile.am: add types.h into distribution package Wed Dec 12 2001 Vitezslav Samel * acinclude.m4, configure.ac: use our own joe_SETPGRP macro (autoconf's is broken for *BSD) Tue Dec 11 2001 Vitezslav Samel * configure.ac, path.c: include if available to get PATH_MAX Sun Dec 09 2001 Vitezslav Samel * b.c, bw.c, cmd.c, hash.c, help.c, kbd.c, macro.c, menu.c, pw.c, queue.c, qw.c, rc.c, scrn.c, tab.c, termcap.c, tty.c, tw.c, ufile.c, uformat.c, uisrch.c, umath.c, undo.c, usearch.c, utils.c, utils.h, va.c, vfile.c, vs.c, w.c: prepare memory allocation functions (change (m|re|c)alloc() and free() into joe_(m|re|c)alloc() and joe_free()) in the utils.c for further checking Sun Dec 09 2001 Vitezslav Samel * b.c, cmd.c, dir.c, hash.c, hash.h, pw.c, pw.h, rc.c, tab.c, tab.h, uedit.c, uedit.h, ufile.c, uisrch.c, uisrch.h, umath.c, umath.h, undo.c, ushell.c, utag.c, w.c: change function declaration "void a(P * p)" to "void a(P *p)" (when using GNU indent we must use -Ttype to achieve this behaviour) Sat Dec 08 2001 Vitezslav Samel * bw.c, scrn.c, scrn.h, uedit.c, w.c: change xlat macro into xlat(int *, char *) function; change indentation of xlat[ac] tables Sat Dec 08 2001 Vitezslav Samel * joerc.in: turn off asis (setlocale(LC_CTYPE) takes care of it); turn off baudrate (leave optimizations of terminal baudrate on the user) Sat Dec 08 2001 Vitezslav Samel * configure.ac, tty.c: make joe compilable (not only) on cygwin - check if siginterrupt() is available on this host Sat Dec 08 2001 Vitezslav Samel * ublock.c: remove feature: exchange points of start and end of the block when checking validity of block pointers Sat Dec 08 2001 Vitezslav Samel * rc.c: change indentation of initialization of pdefault, fdefault and glopts arrays; add comments to [pf]default struct members Sat Dec 01 2001 Vitezslav Samel * configure.ac, path.c, path.h, tty.c, tty.h: move pwd() into path.c; check in autoconf if we have at least one of getcwd() / getwd() Sat Dec 01 2001 Vitezslav Samel * b.c, configure.ac, tty.c, tty.h, tw.c, uedit.c, utils.c, utils.h, vfile.c: move jread() / jwrite() into utils.c and rename them to joe_read() / joe_write(); add checking of size_t and ssize_t into configure scripts Sat Dec 01 2001 Vitezslav Samel * joerc.in: use .@7 terminfo entry for "End" key Sat Dec 01 2001 Vitezslav Samel * joerc.in: use "Ctrl-K H for help" in -rmsg (F1 doesn't work in all cases) Sat Dec 01 2001 Vitezslav Samel * blocks.c, help.c, macro.c, main.c, path.c, rc.c, regex.c, scrn.c, termcap.c, tw.c, ublock.c, uedit.c, usearch.c, vs.c, w.c: change indentation of cases in the switch() statement Sat Dec 01 2001 Vitezslav Samel * b.c, bw.c, main.c, path.c, rc.c, regex.c, scrn.c, termcap.c, termidx.c, tty.c, tw.c, ublock.c, uedit.c, uerror.c, uformat.c, undo.c, utag.c, vfile.c, vs.c, w.c: change indentation of do {} while(); cycles Wed Nov 28 2001 Vitezslav Samel * b.c, b.h, blocks.c, blocks.h, bw.c, bw.h, cmd.c, cmd.h, dir.c, help.c, help.h, kbd.c, kbd.h, macro.c, macro.h, main.c, main.h, menu.c, menu.h, path.c, path.h, poshist.c, poshist.h, pw.c, pw.h, queue.h, qw.c, qw.h, rc.c, rc.h, regex.c, scrn.c, scrn.h, tab.c, tab.h, termcap.c, tty.h, tw.c, tw.h, types.h, ublock.c, ublock.h, uedit.c, uerror.c, ufile.c, ufile.h, uformat.c, uformat.h, uisrch.c, uisrch.h, umath.c, umath.h, undo.c, undo.h, usearch.c, usearch.h, ushell.c, ushell.h, utag.c, utag.h, utils.c, utils.h, va.c, va.h, vfile.c, vfile.h, vs.c, vs.h, w.c, w.h: include only headers which are necessary and since the headers now don't depend on each other, include them in alphabetic order Thu Nov 22 2001 Marek 'Marx' Grac * *.h, *.c: almost all definitions are in types.h (except those from vs.h, va.h). Thu Nov 22 2001 Marek 'marx' Grac * uedit.c: correction of last change Tue Nov 20 2001 Marek 'marx' Grac * w.h, w.c, usearch.c, ufile.c, macro.c, uerror.c, umath.c: MSGBUFSIZE was renamed to JOE_MSGBUFSIZE, because MSGBUFSIZE is defined on BSD like systems. Mon Nov 12 2001 Vitezslav Samel * Makefile.am, deleted chain.asm, kbdhdl.c, kbdhdl.h, msscrn.c, mstty.c, termcap, terminfo: delete unused files from distribution Mon Nov 12 2001 Peter Breitenlohner * Makefile.am: make joe installable into another root dir with "make DESTDIR=/path/ install" Sun Nov 11 2001 Vitezslav Samel * ufile.c: comment out unused functions (nask2()/uask2()) Sun Nov 11 2001 Vitezslav Samel * uedit.c: correct typo: utype(bw, c) --> utypebw(bw,c) I'm not 100% sure about this, but "works for me here"(tm) Sun Nov 11 2001 Vitezslav Samel * termcap.c, termcap.h: correct prototype to the output routine the CAP structure (and setcap()/getcap() etc.) Sun Nov 11 2001 Vitezslav Samel * regex.c, regex.h: change regex pointer to be 'unsigned char *regex' This kills some warnings during build. Sun Nov 11 2001 Vitezslav Samel * cmd.c, menu.c, menu.h, rc.c, tab.c, ufile.c: use mkmenu(W *, ...) instead of mkmenu(BASE *, ...). This kills some warnings during build. Sun Nov 11 2001 Vitezslav Samel * tw.c, w.h: non-code clean up Sun Nov 11 2001 Vitezslav Samel * macro.c, qw.c, qw.h, tw.c, uedit.c, uisrch.c, usearch.c, ushell.c: use mkqw(W *, ...) instead of mkqw(BASE *, ...) (same applies to mkqwna() and mkqwnsr()). This kills a lot of warnings during build. Sun Nov 11 2001 Vitezslav Samel * bw.c, cmd.c, macro.c, main.c, rc.c, tab.c, tw.c, ublock.c, uedit.c, uerror.c, ufile.c, umath.c, undo.c, usearch.c, ushell.c, utag.c, w.c, w.h: use msgnw[t](W *, char *) instead of msgnw[t](BASE *, char *). This kills a lot of warnings during build. Sun Nov 11 2001 Vitezslav Samel * b.c, blocks.c, blocks.h, scrn.c, termcap.c, undo.c, vfile.c, vs.c: use mfwrd() and mbkwd() only as internal functions to mmove(). This kills some of the remaining warnings during build. Wed Nov 07 2001 Vitezslav Samel *** Release joe-2.9.7 *** Wed Nov 07 2001 Vitezslav Samel * configure.ac: bump up version number Wed Nov 07 2001 Vitezslav Samel * NEWS: update - prepare for release Wed Nov 07 2001 Vitezslav Samel * Makefile.am, deleted conf.c: conf.c not used anymore Wed Nov 07 2001 Vitezslav Samel * Makefile.am: add README.cvs and docs/help-system.html to EXTRA_DIST variable Wed Nov 07 2001 Marek 'Marx' Grac * docs/help-system.html: updated Tue Nov 06 2001 Vitezslav Samel * new file README.cvs: documentation file on how to access joe sources via CVS Sun Nov 04 2001 Vitezslav Samel * ufile.c: kill infinite loop when saving unmodified file (sourceforge.net BUG #478290) Sun Nov 04 2001 Vitezslav Samel * ufile.c: remove "feature" added in 2.9.7-pre1 so the user is always asked of the filename saved (sourceforge.net BUG #449489) Wed Oct 31 2001 Vitezslav Samel * bw.h, tty.c, configure.ac: make use of pid_t type Mon Oct 29 2001 Vitezslav Samel *** Release joe-2.9.7-pre3 *** Mon Oct 29 2001 Vitezslav Samel * autoconf.ac: bump pre-version number Sun Oct 28 2001 Vitezslav Samel * autoconf.ac: remove optimizing flags from CFLAGS I'm aware of too much bugreports (in other projects) due to buggy code generated by over-optimized gcc (default '-O2 -g' is O.K. for most instalations - advanced user can change it by setting CFLAGS before running configure, he surely knows, what is he doing ;-)) Sun Oct 28 2001 Vitezslav Samel * Makefile.am, joe.spec: joe.spec deleted - I don't think it belongs to tar.gz package (to make it proper .rpm package there's more to be done - this is work of .rpm packager - he can insert a lot of useful but for joe unnecessary files - think of icons on the desktop etc.) Sun Oct 28 2001 Vitezslav Samel * autoconf.ac: add AC_CANONICAL_(BUILD|HOST) to make "automake -a -c" copy necessary config.guess and config.sub files Sun Oct 28 2001 Vitezslav Samel * files generated by automake package: use automake-1.5 to make joe compile on mips-sgi-irix6.5 with non-GNU make again Sun Oct 28 2001 Jeff Downs * uedit.c: don't change windows when setting mark (using Esc Esc) in multiwindow mode (SourceForge bug #462875) Thu Oct 25 2001 Vitezslav Samel * kbd.c, scrn.c, termcap.h, tty.c, tty.h, va.c, va.h, w.c: clean up warnings raised up by strict prototypes Mon Oct 22 2001 Vitezslav Samel * configure.ac, utils.c, utils.h and new file acinclude.m4: makes the wordwrap work correctly again (SourceForge bugs #418871, #471964) Mon Oct 22 2001 Vitezslav Samel * all *.c and *.h files, autoconf.ac: use strict prototypes if applicable (fairly huge change) Sat Oct 20 2001 Sebastian Wenzler * Makefile.am: when symlinking rjoe etc. to joe use links without absolute path (SourceForge bug #471898) Wed Oct 10 2001 Vitezslav Samel *** Release joe-2.9.7-pre2 *** Wed Oct 10 2001 Vitezslav Samel * config.h, b.c, bw.c, hash.c, help.c, kbd.c, macro.c, main.c, menu.c, path.c, pw.c, queue.c, qw.c, rc.c, tab.c, tw.c, ufile.c, uformat.c, uisrch.c, undo.c, usearch.c, ushell.c, vs.c, w.c: include and only in those files which need them Wed Oct 10 2001 Vitezslav Samel * configure.ac, main.c: autoconf.ac will be the only place where to change version number; use VERSION #define from automake macro when printing version Wed Oct 10 2001 Vitezslav Samel * blocks.c, config.h: cleanup blocks.c; remove cases when AUTOINC is enabled (AUTOINC case is IMHO slower then the other code - and AUTOINC wasn't enabled by default in config.h); change indenting of code in the body of switch() to something more readable Wed Sep 20 2001 Vitezslav Samel * help.c: use unsigned int for lengths; remove local copy of filename; replace "magic numbers" with sizeof(buf); rename members of struct help (it's always clear where it belongs; change indentation of switch(); remove goto's (we have continue ;-)) Wed Sep 20 2001 Vitezslav Samel *** SECURITY *** * configure.ac, path.c: use mkstemp() if available; use if available; this patch changes name of temporary file to joe.tmp.XXXXXX (XXXXXX are unique chars) Wed Sep 20 2001 Vitezslav Samel * configure.ac, path.c: use autoconf's way of finding which of struct direct / struct dirent are available; clean up handling of MS-DOS drive letters in the paths Wed Sep 20 2001 Vitezslav Samel * tty.c: use full definitions of functions (maskit(), unmaskit(), pauseit()) - it removes some compile warnings Wed Sep 20 2001 Vitezslav Samel * tty.c: cleanup SA_INTERRUPT/SV_INTERRUPT handling Wed Sep 20 2001 Vitezslav Samel * main.h: add prototype of edupd() Wed Sep 20 2001 Vitezslav Samel * uedit.c: use jread()/jwrite() which retry when interrupted by a signal Wed Sep 20 2001 Vitezslav Samel * macro.c, uformat.c: include "utils.h" instead of to have isblank() defined Wed Sep 19 2001 Vitezslav Samel * config.h, configure.ac, tty.c: use autoconf's way of detecting which termio()/termios() functions are available; use HAVE_GETWD/HAVE_GETCWD macros instead of TTYPOSIX/TTYSV #defines Wed Sep 19 2001 Vitezslav Samel * configure.ac, tty.c: use autoconf's method of finding which header to include to have TIOCGWINSZ defined Wed Sep 19 2001 Vitezslav Samel * tty.c: replace ugly "method" of detecting setitimer() with HAVE_SETITIMER macro from autoconf Wed Sep 19 2001 Vitezslav Samel * config.h, tty.c: remove improperly used HZ #define Wed Sep 19 2001 Vitezslav Samel * tty.h, vfile.c: add prototypes of jread() / jwrite() Wed Sep 19 2001 Vitezslav Samel * b.c, tty.c, umath.c: various systems use different signal handler prototypes - make use of RETSIGTYPE macro from autoconf Wed Sep 19 2001 Vitezslav Samel * configure.ac, tty.c: various systems use different setpgrp() prototypes - make use of SETPGRP_VOID macro from autoconf Fri Sep 14 2001 Alexandre P. Nunes * configure, configure.ac, missing, Makefile.am, Makefile.in, aclocal.m4, autoconf.h.in, config.h, *rc files, b.c, main.c, path.c, tty.c: use recent automake and autoconf configuration system (at the moment we're using automake-1.4-p4, autoconf-2.52) Thu Jul 20 2001 Marek 'Marx' Grac *** Release joe-2.9.7-pre1 *** Thu Jul 19 2001 Marek 'Marx' Grac * help.c, help.h, main.c: help system was rebuilt Thu Jul 19 2001 Vitezslav Samel * joe.1, ufile.c: new feature 'backup suffix', when the system environment SIMPLE_BACKUP_SUFFIX is set then it is used instead of ~. Inspired by patch program. Thu Jul 19 2001 Vitezslav Samel * lot of files: patch which removes a lot of warnings. Wed Jul 04 2001 Marek 'Marx' Grac * b.c, main.c, path.c, path.h, rc.c, ufile.c: Function 'ossep' was completly removed because it was not possible to access files like test\ in UNIX like systems. Wed Jul 04 2001 Marek 'Marx' Grac * ufile.c: Several minor changes. Wed Jul 04 2001 Marek 'Marx' Grac * ufile.c: Problem with freezing when saving unmodified file is solved. But it is possible that this patch is only partial Wed Jul 04 2001 Marek 'Marx' Grac * ufile.c: Modified flag is now properly set. It can look awful but pre-first undo record has modified flag set on. Wed Jul 03 2001 Marek 'Marx' Grac * joe-2.9.7pre0.tgz: version 2.9.7pre0 was released Wed Jul 02 2001 Marek 'Marx' Grac * lot of files: I get last version without wordwrap bug (2.9.6pre1) and applied almost all patches which are mentioned in NEWS file. Problem with ${sysconfdir}/joerc is probably still actual, because I was not able to find patch :( ______________________________________________________________________ $MirOS: contrib/code/jupp/ChangeLog,v 1.12 2020/03/27 06:08:10 tg Exp $ jupp/HINTS010064400000000000000000000266441431513412300076040ustar00This documentation should go elsewhere, but I haven't gotten around to it yet. GCC --- Disable the following warnings; the code doesn't cope with it: -Wno-pointer-sign -Wno-unused-parameter -Wno-strict-prototypes Useful tricks ------------- $ diff -u filea fileb | jupp -mold notmod - or mc: diff -up %D/%F %f | jupp -mold notmod - also: diff -up %f %D/%F | jupp -mold notmod - %f UTF-8 ----- Do note that the joerc files must be written using the 8-bit encoding, not in UTF-8. Syntax files, on the other hand, absolutely must be written in UTF-8 since jupp29. JOE now handles two classes of character sets: UTF-8 and byte coded (like ISO-8859-1). It can not yet handle other major classes such as UTF-16 or GB2312. There are other restrictions: character sets must use LF (0x0A) or CR-LF (0x0D - 0x0A) as line terminators, space must be 0x20 and tab must be 0x09. Basically, the files must be UNIX or MS-DOS compatible text files. This means EBCDIC will not work properly (but you would need to handle fixed record length lines anyway) and character sets which use CR terminated lines (MACs) will not yet work. The terminal and the file can have different encodings. JOE will translate between the two. Currently, one of the two must be UTF-8 for translation to work. The character set for the terminal and the default character set assumed for files is determined by the 'LC_ALL' environment variable (and if that's not set, LC_CTYPE and LANG are also checked). 'JOECHARMAP' overrides this value. For example, if LC_ALL is set to: de_DE Then the character set will be ISO-8859-1. If LC_ALL is set to: de_DE.UTF-8 The character set will UTF-8. Hit ^T E to change the coding for the file. Hit at this prompt to get a list of available codings. There are a number of built-in character sets, plus you can install character sets in the ~/.jupp/charmaps and /usr/local/etc/joe/charmaps directories. Check: /usr/share/i18n/charmaps for example character set files. Only byte oriented character sets will work. Also, the file should not be gzipped (all of the charmap file in /usr/share/i18n/charmaps on my computer were compressed). The parser is very bad, so basically the file has to look exactly like the example one in /usr/local/etc/joe/charmaps. You can hit ^K to see the current character set. You can hit ` x to enter a UCS character if the file coding is UTF-8. Programming ----------- Try ^K , and ^K . These keys select the current block (based on indentation) and shift it left or right by the -istep and -indentc. Selecting blocks ---------------- The "classic" way is to hit ^K B at the beginning and ^K K at the end. These set pointers called markb and markk. Once these are set you can jump to markb with ^[ b and jump to markk with ^[ k. New way no.1: hit Ctrl-space to start selecting, move the cursor, then hit Ctrl-space to complete the block. Hit Ctrl-space in the block to cancel it. Hit Ctrl-space outside of the block to start selecting a new one. This uses the "toggle_marking" function. Also any block command will complete the block. (joe flavour only) New way no.2: hit Ctrl-rtarw to start selecting rightward. Each time you hit Ctrl-rtarw, the block is extended one more to the right. This uses a simple macro: "begin_marking,rtarw,toggle_marking". Unfortunately, there is no standard way to get the keysequence given by the terminal emulator when you hit Ctrl-rtarw. Instead you have to determine this sequence yourself and enter it directly in the joerc file. Some examples are given for xterm and gnome-terminal. Hit ` rtarw to have the sequence shown on your screen. Note that Putty uses ^[ ^[ [ C which will not appear with ` rtarw (also ^[ ^[ is set book mark, so you need to unbind it to do this in Putty). (joe flavour only) Also you can hit Ctrl-delete to cut and Ctrl-insert to paste if the sequence for these keys are known. (joe flavour only) New way No.3: press down shift, then move the cursor with the arrow keys or, optionally with ctrl, the Home and End keys; release the shift key when done and remember that the cursor indicator on screen is not part of the selection. (all flavours) Also, you can pass "-keymap cua" on the command line to change the key bindings for ^Z (Undo), ^X (Cut), ^C (Copy), ^V (Paste) as in contemporary GUI editors. (joe, rjoe, jstar, jupp flavours only) Using Picture mode and Rectangle mode may help with that. Hex edit mode ------------- When this mode is selected (either put -hex on the command line, or look for "Hex edit mode" after hitting ^T), the buffer is displayed as a hex dump, but all of the editing commands operate the same way. It is most useful to select overtype mode in conjunction with hex dump (hit ^T T). Then typing will not insert. - To enter the hex byte 0xF8 type ` x F 8 - You can use ^KC to copy a block as usual. If overtype mode is selected, the block will overwrite the destination data without changing the size of the file. Otherwise it inserts. - Hit ESC x byte , to jump to a particular byte offset. Hex values can be entered into this prompt like this: 0x2000. - Search, incremental search, and search & replace all operate as usual. Licences (binary package summary) --------------------------------- joe is Copyright © 1992, 2004 Joseph H. Allen © 2001 Marek 'Marx' Grac © 2004, 2006, 2011, 2013, 2014, 2017, 2018, 2020 mirabilos jupp is Copyright © 1997–2022 Thorsten Glaser * jupp is free software; you can redistribute and/or modify it, deal * in the work, etc. under the terms of the GNU General Public Licen- * se, version 1 (of February 1989) as published by the Free Software * Foundation, reproduced in the file COPYING in the jupp source code * distribution. If jupp is combined with other independent work, for * example libraries or when using crunchgen, into a combined binary, * that may be conveyed under any version of the GPL, as published by * the Free Software Foundation, and any compatible licence permitted * by any version of the GPL, as above. jupp is also: * Copyright © 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011, 2012, * 2013, 2014, 2016, 2017, 2018, 2020, 2022 * mirabilos * * Provided that these terms and disclaimer and all copyright notices * are retained or reproduced in an accompanying document, permission * is granted to deal in this work without restriction, including un†* limited rights to use, publicly perform, distribute, sell, modify, * merge, give away, or sublicence. * * This work is provided “AS IS” and WITHOUT WARRANTY of any kind, to * the utmost extent permitted by applicable law, neither express nor * implied; without malicious intent or gross negligence. In no event * may a licensor, author or contributor be held liable for indirect, * direct, other damage, loss, or other issues arising in any way out * of dealing in the work, even if advised of the possibility of such * damage or existence of a defect, except proven that it results out * of said person’s immediate fault when using the work as intended. strlfun.inc (optional) additionally is: * Copyright (c) 1998 Todd C. Miller * * Permission to use, copy, modify, and distribute this software for any * purpose with or without fee is hereby granted, provided that the above * copyright notice and this permission notice appear in all copies. * * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. I18N data is: * Parts Copyright © 1991–2022 Unicode, Inc. All rights reserved. * Distributed under the Terms of Use in: * https://www.unicode.org/copyright.html * * Permission is hereby granted, free of charge, to any person obtaining * a copy of the Unicode data files and any associated documentation * (the "Data Files") or Unicode software and any associated documentation * (the "Software") to deal in the Data Files or Software * without restriction, including without limitation the rights to use, * copy, modify, merge, publish, distribute, and/or sell copies of * the Data Files or Software, and to permit persons to whom the Data Files * or Software are furnished to do so, provided that either * (a) this copyright and permission notice appear with all copies * of the Data Files or Software, or * (b) this copyright and permission notice appear in associated * Documentation. * * THE DATA FILES AND SOFTWARE ARE PROVIDED "AS IS", WITHOUT WARRANTY OF * ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE * WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND * NONINFRINGEMENT OF THIRD PARTY RIGHTS. * IN NO EVENT SHALL THE COPYRIGHT HOLDER OR HOLDERS INCLUDED IN THIS * NOTICE BE LIABLE FOR ANY CLAIM, OR ANY SPECIAL INDIRECT OR CONSEQUENTIAL * DAMAGES, OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, * DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER * TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR * PERFORMANCE OF THE DATA FILES OR SOFTWARE. * * Except as contained in this notice, the name of a copyright holder * shall not be used in advertising or otherwise to promote the sale, * use or other dealings in these Data Files or Software without prior * written authorization of the copyright holder. popen.inc (optional) is: * Copyright (c) 1988, 1993 * The Regents of the University of California. All rights reserved. * * This code is derived from software written by Ken Arnold and * published in UNIX Review, Vol. 6, No. 8. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions * are met: * 1. Redistributions of source code must retain the above copyright * notice, this list of conditions and the following disclaimer. * 2. Redistributions in binary form must reproduce the above copyright * notice, this list of conditions and the following disclaimer in the * documentation and/or other materials provided with the distribution. * 3. Neither the name of the University nor the names of its contributors * may be used to endorse or promote products derived from this software * without specific prior written permission. * * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF * SUCH DAMAGE. ___________________________________________________________________ $MirOS: contrib/code/jupp/HINTS,v 1.22 2022/09/28 21:10:16 tg Exp $ jupp/INFO010064400000000000000000000176771323447624200074720ustar00$MirOS: contrib/code/jupp/INFO,v 1.12 2018/02/01 02:33:43 tg Exp $ ------------------------------------------------------------------ Jupp Joe's Own Editor 3.1 A Free ASCII-Text Screen Editor for UNIX by Joseph Allen (<= 2.8) Marek 'Marx' Grac (=> 2.9) by Joseph Allen again (=> 3.0) by Thorsten "mirabilos" Glaser (jupp mods) Get it from: http://mirbsd.de/jupp http://sourceforge.net/projects/joe-editor If you have questions, problems or suggestions, Use sourceforge: mailing list, bug tracker, discussion groups. JOE is the professional freeware ASCII text screen editor for UNIX. It makes full use of the power and versatility of UNIX, but lacks the steep learning curve and basic nonsense you have to deal with in every other UNIX editor. JOE has the feel of most IBM PC text editors: The key-sequences are reminiscent of WordStar and Turbo-C. JOE is much more powerful than those editors, however. JOE has all of the features a UNIX user should expect: full use of termcap/terminfo, excellent screen update optimizations (JOE is fully usable at 2400 baud), simple installation, and all of the UNIX-integration features of VI. JOE's initialization file determines much of JOE's personality and the name of the initialization file is simply the name of the editor executable followed by "rc". JOE comes with five "rc" files in addition to the basic "joerc", which allow it to emulate these editors: JPICO - An enhanced version of the Pine mailer system's PICO editor. JSTAR - A complete imitation of WordStar in non-document mode including many "JOE" extensions. RJOE - A restricted version of JOE which allowed you to edit only the files specified on the command line. JMACS - A GNU-Emacs imitation which is about one order of magnitude smaller than real GNU-EMACS. JUPP - A modern editor for programmers with WordStar-like bindings; an improvement over classical JSTAR Features: JOE has a well thought-out user-interface with great attention to detail. The Page Up and Page Down functions do not move the cursor relative to the edges of the screen. Left and Right arrow keys work at the beginning and ends of lines. The cursor can move past the ends of lines without jumping, but also without inserting or deleting extra spaces at the ends of lines. Control characters and characters above 127 can be displayed and entered- even ^Q and ^S. The cursor's row and column number can be displayed in the status line. The key layout is made to reduce terminal incompatibility nonsense. ^Q and ^S are not used and both ^H and DEL are mapped to backspace. Case does not matter in key sequences- ^K E, ^K e, and ^K ^E are each mapped to the same function. The arrow keys and PageUp, PageDown, Home, End, Insert and Delete keypad keys are read from the termcap entry and are assigned to the proper functions. A simple initialization file, similar to Semware's Q-EDIT, allows key-bindings, simple macros and help windows to be defined. JOE has full termcap/terminfo support and will work on any terminal. JOE has the best screen update optimization algorithm available. It uses VT100-style scrolling regions the way they are supposed to be used (I.E., without building insert and delete line functions out of them) and has a powerful line shifting (insert/delete character) algorithm which works even if text goes past the ends of lines. JOE has deferred screen update to handle typeahead and uses the baud rate reported by 'stty' to ensure that deferral is not bypassed by tty buffering. JOE has multiple windows and lacks the confusing notion of a named buffers. You just have files and windows. When there are more windows than can fit on the screen, the Goto-Next-Window function scrolls through them. The same file can have multiple windows opened on it. JOE has VI-style unix integration. You can filter a highlighted block through a UNIX command. Also, each place in joe which accepts a file name (including the command line) will also accept: !command to pipe into or out of a command >>filename to append to a file filename,start,size to edit a portion of a file/device - to use stdin or stdout File names on the command line may be preceded by +nnn to start editing at a specified line. JOE has shell windows. You can run a shell in a window and any output from commands run in the shell gets stored in a buffer. JOE has an orthogonal event-driven design. Each prompt is actually a normal edit buffer containing a history of all of the responses entered for that prompt. You can use all of the normal edit commands to create file names and search strings. You can use the up arrow key (or search backwards and any other appropriate edit command) to go back through the history of previous responses. Prompts are reentrant- meaning that edit commands which require prompts can still be used inside of prompts. JOE has TAB-completion and file selection menus. If you hit tab in a file name prompt, the name is either completed or a menu of possible matches appears. JOE stores edit files in a doubly linked list of gap buffers which can spill into a temporary file. You can edit files of any size up to the amount of free disk space and there are no line-length restrictions. Since the buffering system is block-based, JOE will incur only a minimum of swapping on heavily loaded systems. When you ask for help, one of six small help reference cards appears on the screen and remains while you continue to use the editor. Here is the first help card for Joe: CURSOR GO TO BLOCK DELETE MISC EXIT ^B left ^F right ^U prev. screen ^KB begin ^D char. ^KJ reformat ^KX save ^P up ^N down ^V next screen ^KK end ^Y line ^T options ^C abort ^Z previous word ^A beg. of line ^KM move ^W >word ^@ insert ^KZ shell ^X next word ^E end of line ^KC copy ^O word< ^R retype FILE SEARCH ^KU top of file ^KW file ^J >line SPELL ^KE new ^KF find text ^KV end of file ^KY delete ^_ undo ^[N word ^KR insert ^L find next ^KL to line No. ^K/ filter ^^ redo ^[L file ^KD save Other editor flavours differ; to get help for those, press either Ctrl-J (^J) for jstar and jupp, ^G for jpico, Ctrl-X followed (Ctrl depressed) by h (^Xh) for jmacs or, for joe and rjoe, ^KH (Ctrl-K+h). The jupp and jstar flavours attempt to imitate WordStar in non-document mode; see here for more documentation on WordStar keybindings: - http://www.stormbringer.org/pers/siaru/tlg/wsfile.txt - http://www.stormbringer.org/pers/siaru/tlg/ws5file.txt JOE has a powerful set of editing commands suitable for editing both text files and programs: - UTF-8 support - Syntax highlighting - search and replace system, including powerful regular expressions (including matching of balanced C expressions). - tags file search - paragraph format - undo and redo - position history allows you to get back to previous editing contexts and allows you to quickly flip between editing contexts - multiple keyboard macros - block move/copy/delete/filter - rectangle (columnar) mode - overtype/insert modes - indent/unindent - goto matching ( [ { - auto-indent mode Plus many options can be set: - can have EMACS-style cursor re-centering on scrolls - characters between 128-255 can be shown as-is for non-English character sets - Final newline can be forced on end of file - Can start with a help screen on - Left/Right margin settings - Tab width - Indentation step and fill character /* jhallen@world.std.com */ /* Joseph H. Allen */ int a[1817];main(z,p,q,r){for(p=80;q+p-80;p-=2*a[p])for(z=9;z--;)q=3&(r=time(0) +r*57)/7,q=q?q-1?q-2?1-p%79?-1:0:p%79-77?1:0:p<1659?79:0:p>158?-79:0,q?!a[p+q*2 ]?a[p+=a[p+=q]=q]=q:0:0;for(;q++-1817;)printf(q%79?"%c":"%c\n"," #"[!a[q-1]]);} jupp/LIST010064400000000000000000000146751323447624200075050ustar00$MirOS: contrib/code/jupp/LIST,v 1.14 2018/02/01 02:33:43 tg Exp $ ------------------------------------------------------------------ Joe commands grouped by function Background programs ------------------- bknd Run a shell in a window killproc Kill program in current window run Run a unix command in a window Blocks ------ blkcpy Copy marked block to cursor blkdel Delete marked block blkmove Move marked block to cursor blksave Save marked block into a file copy Copy block to kill-ring drop Set markb. If it was already set, eliminate it. toggle_marking If we're in a block: clear markb and markk. If marking is off: set markb and turn on marking. If marking is on: set markk (swap if necessary with markb) and turn marking off. begin_marking If we're on an edge of a block: set markb to other edge and turn on marking mode. Otherwise set markb to cursor and turn on marking mode. select Set markb. If it was already set, do nothing. filt Filter block or file through a unix command markb Set beginning of block mark markk Set end of block mark markl Mark current line nmark Eliminate markb and markk picokill Delete line or block pop Restore markb and markk values from stack psh Push markb and markk values onto a stack swap Switch cursor with markb tomarkb Move cursor to markb tomarkbk Move cursor to markb or markk tomarkk Move cursor to markk yank Insert top of kill ring yankpop Scroll through kill ring yapp Append next kill to top of kill ring upper Convert everything in block to uppercase lower Convert everything in block to lowercase Buffers ------- bufed Buffer menu edit Load file into window: asks to reload if buffer exists switch Load file into window: always uses buffer if it exists scratch Load a scratch buffer into current window nbuf Load next buffer into current window pbuf Load previous buffer into current window Cursor Motion ------------- bof Move cursor to beginning of file bol Move cursor to beginning of line (always) bop Move to beginning of a paragraph bos Move to beginning of screen bkwdc Search backwards for a character byte Move cursor to specific byte offset into the file. col Move cursor to specific column number. dnarw Move cursor down one line eof Move cursor to end of file eol Move cursor to end of line eop Move cursor to end of paragraph fwrdc Search forward for matching character gomark Move cursor to a bookmark home Move cursor to beginning of line ("smart") line Move cursor to specified line ltarw Move cursor left nedge Move cursor to next edge nextpos Move cursor to next position in cursor position history nextword Move cursor to end of next word pedge Move cursor to previous edge prevpos Move cursor to previous position in cursor position history prevword Move cursor to beginning of previous word rtarw Move cursor right rvmatch Move cursor to matching delimiter, ambiguous to the left setmark Set a bookmark tomatch Move cursor to matching delimiter tos Move cursor to top of screen uparw Move cursor up Deletion -------- backs Backspace backw Backspace a word delbol Delete to beginning of line delch Delete character under cursor deleol Delete to end of line dellin Delete entire line delw Delete word to right Error parsing ------------- nxterr Goto next parsed error parserr Parse errors in current file prverr Go to previous parsed error Exit ---- cancel Like abort, but doesn't return failure: useful in macros to escape out of a prompt. abort Abort current buffer/window. Prompt if it is changed. abortbuf Like above, but just fail if it would have to prompt because it's the last window on a modified buffer. ask Prompt to save current file: user says yes return, user says no: run 'abort'. Use in a macro: "ask,query,exsave" exsave Save file and exit lose emacs kill buffer. The buffer is deleted- any windows with it get a replacement scratch buffer. querysave Prompt to save each modified buffer Use in a macro: "querysave,query,killjoe" killjoe Exit joe immediately without checking for modified buffers abendjoe Same, but with errorlevel 1 Files ----- save Save file insf Insert a file Formatting ---------- center Center line fmtblk Format all paragraphs in a block format Format current paragraph lindent Indent to the left rindent Indent to the right Help ---- help Turn help on or off helpcard Turn help on at selected screen hnext Switch to next help screen hprev Switch to previous help screen Inserting --------- ctrl Type next key finish Complete word in text window insc Insert a space open Insert newline quote Insert a control character quote8 Insert a meta character rtn Return key type Insert typed character Macros ------ macros Insert keyboard macros into current file play Execute a macro query Macro query record Record a macro stop Stop recording macro Menu ---- backsmenu Undo in file completion menu bofmenu Move to beginning of menu bolmenu Move to beginning of line in a menu dnarwmenu Move down one line in a menu eolmenu Move cursor to end of line in a menu eofmenu Move cursor to end of menu ltarwmenu Move cursor left in a menu rtarwmenu Move cursor right in menu uparwmenu Move cursor up in menu Misc ---- beep Beep execmd Execute a joe command keymap Switch keymap math Calculator mathins Insert last math expression mathres Insert last math result mode Mode prompt msg Display a message (clear message if empty) nop Do nothing notmod Clear the modified flag retype Refresh screen shell Suspend process or execute a sub-shell stat Display cursor position sync Call sync(2) tag Tags file search txt Insert text Prompts ------- complete Complete a file-name in a prompt Repeat ------ arg Prompt for repeat argument uarg Universal argument Scrolling --------- crawll Pan screen left crawlr Pan screen right dnslide Scroll screen down 1 line pgdn Scroll screen down pgup Scroll screen up upslide Scroll up one line Search and replace ------------------ ffirst Find text fnext Repeat previous search isrch Incremental search forward qrepl Search and replace rfirst Search backwards for text rsrch Reverse incremental search Windows ------- explode Display one window or display all windows dupw Duplicate current window groww Increase size of window nextw Move cursor to next window prevw Go to previous window shrinkw Shrink window splitw Split window into two tw0 Eliminate this window tw1 Show only one window Undo ---- redo Re-execute the latest undone change undo Undo last change jupp/Make-w32.sh010064400000000000000000000053651363731414500106250ustar00#!/bin/mksh # $MirOS: contrib/code/jupp/Make-w32.sh,v 1.25 2020/03/27 06:08:10 tg Exp $ usage() { print -ru2 "Usage: $0 [-bCgn]" print -ru2 ' Builds jupp32 (with debugging if -g): clean (unless -n),' print -ru2 ' configure (unless -n), make, package (unless -b), clean (unless -C)' exit 1 } nopkg=0 nocln=0 debug=0 contb=0 while getopts "bCgn" c; do case $c { (b) nopkg=1 ;; (C) nocln=1 ;; (g) debug=1 ;; (n) contb=1 ;; (*) usage ;; } done extrawarnings="-Wall -Wextra" (( debug )) && extrawarnings="$extrawarnings -g3" extrawarnings="$extrawarnings -Wno-unused-parameter" extrawarnings="$extrawarnings -Wno-strict-prototypes" export LC_ALL=C set -ex [[ -s configure && -s jupprc && -s charmaps/klingon.in ]] jupp=$(sed -n "/^PACKAGE_VERSION='3\.1jupp\([0-9]*\)[~'].*\$/s//\1/p" configure) jwin= jwnt=$jupp while (( jwnt > 34 )); do jwin=${jwin}z (( jwnt -= 25 )) done typeset -i1 tmp (( tmp = 1#a - 10 + jwnt )) jwin=$jwin${tmp#1#} jtop=jwin31$jwin typeset -u jWIN=$jwin if (( contb )); then [[ -s mkw32/build/Makefile ]] else rm -rf mkw32 JWIN31$jWIN.* mkdir mkw32{,/{build,$jtop}} fi date >>JWIN31$jWIN.log cd mkw32/build export CFLAGS='-Os -march=i486 -mtune=pentium-mmx' export CPPFLAGS='-DJUPPRC_BUILTIN_NAME=\"jupp32rc\"' (( contb )) || mksh ../../configure \ --build=i486-pc-cygwin --host=i486-pc-cygwin \ --prefix=c:/windows/system32 \ --sysconfdir=c:/windows/system32 \ --disable-dependency-tracking \ --disable-terminfo \ --disable-search-libs \ --disable-getpwnam \ --disable-termidx \ --enable-win32reloc | tee -a ../../JWIN31$jWIN.log make AM_CFLAGS="$extrawarnings" | tee -a ../../JWIN31$jWIN.log if (( nopkg )); then ln -f joe.exe jupp.exe ln -sf ../../jupprc . exit 0 fi cp charmaps/* syntax/* ../$jtop/ cp jmacsrc joerc jpicorc jstarrc ../$jtop/ cp joe.exe ../$jtop/jupp32.exe cd ../.. cp COPYING mkw32/$jtop/copying.txt cp /bin/cygwin1.dll mkw32/$jtop/ cp joe.txt mkw32/$jtop/jupp32.txt cp jupprc mkw32/$jtop/jupp32rc cd mkw32/$jtop :>setup.inf for x in *; do [[ $x = *[A-Z]* ]] || continue mv "$x" ../_TMP typeset -l lc lc=$x mv ../_TMP "$lc" done sed -b -e "s!@jwin@!$jupp!g" -e "s!@ts@!$(date -u +%m/%d/%Y)!g" \ <../../setup.inf | while IFS= read -r line; do if [[ $line = '@files@'* ]]; then stat -c '%n=1,,%s ' * else print -r -- "$line" fi done >setup.inf sz=$(stat -c '%n=1,,%s ' setup.inf) sed -bi "/^setup.inf=1,,/s/^.*\$/$sz/" setup.inf sz=$(stat -c '%n=1,,%s ' setup.inf) sed -bi "/^setup.inf=1,,/s/^.*\$/$sz/" setup.inf if [[ $sz != "$(stat -c '%n=1,,%s ' setup.inf)" ]]; then print -rnu2 "Size of SETUP.INF destabilises between $sz and " stat -c '%n=1,,%s ' setup.inf exit 1 fi chmod 444 * cd .. zip -D -X -9 -k ../JWIN31$jWIN.ZIP $jtop/* cd .. ls -l JWIN31$jWIN.* (( nocln )) || rm -rf mkw32 jupp/Makefile.am010064400000000000000000000066561374663752300110540ustar00# $MirOS: contrib/code/jupp/Makefile.am,v 1.23 2020/10/29 22:16:24 tg Exp $ AUTOMAKE_OPTIONS = foreign EXTRA_DIST = \ HINTS INFO LIST Make-w32.sh autogen.sh bw-lgen.inc dir.c \ docs/help-system.html jmacsrc.in joe.1.in joe.txt joerc.in \ jpicorc.in jstarrc.in jupprc popen.inc rjoerc.in setup.inf \ strlfun.inc JOE_ALIASES = jmacs jpico jstar jupp rjoe JOE_RCFILES = jmacsrc joerc jpicorc jstarrc rjoerc JOE_RCEXTRA = jupprc JOE_RC_EDIT = sed \ -e 's@''jrcbefore''@$(jrcbefore)g' \ -e 's@''jrcafter''@$(jrcafter)g' \ -e 's@''SPELL''@$(SPELL)g' \ <'$?' >$@~ && mv -f $@~ $@ jmacsrc: jmacsrc.in $(JOE_RC_EDIT) joerc: joerc.in $(JOE_RC_EDIT) jpicorc: jpicorc.in $(JOE_RC_EDIT) jstarrc: jstarrc.in $(JOE_RC_EDIT) rjoerc: rjoerc.in $(JOE_RC_EDIT) INCLUDES = -DJOERC="\"$(sysconf_joedir)/\"" sysconfjoesubdir = @sysconfjoesubdir@ sysconf_joedir = $(sysconfdir)$(sysconfjoesubdir) sysconf_joe_DATA = $(JOE_RCFILES) $(JOE_RCEXTRA) sysconf_syntaxdir = $(sysconf_joedir)/syntax sysconf_syntax_DATA = \ syntax/asm.jsf syntax/c.jsf syntax/conf.jsf syntax/csh.jsf \ syntax/diff.jsf syntax/fortran.jsf syntax/html.jsf \ syntax/java.jsf syntax/lisp.jsf syntax/mail.jsf syntax/mason.jsf \ syntax/pascal.jsf syntax/perl.jsf syntax/php.jsf \ syntax/python.jsf syntax/sh.jsf syntax/tcl.jsf syntax/tex.jsf \ syntax/verilog.jsf syntax/vhdl.jsf syntax/xml.jsf sysconf_charmapsdir = $(sysconf_joedir)/charmaps sysconf_charmaps_DATA = charmaps/klingon man_MANS = joe.1 noinst_HEADERS = \ b.h blocks.h builtin.h bw.h charmap.h cmd.h config.h hash.h \ help.h i18n.h kbd.h macro.h main.h menu.h path.h poshist.h pw.h \ queue.h qw.h rc.h regex.h scrn.h syntax.h tab.h termcap.h tty.h \ tw.h types.h ublock.h uedit.h uerror.h ufile.h uformat.h \ uisrch.h umath.h undo.h usearch.h ushell.h utag.h utf8.h utils.h \ va.h vfile.h vs.h w.h bin_PROGRAMS = joe if WANT_TERMIDX bin_PROGRAMS += termidx endif joe_SOURCES = \ b.c blocks.c builtin.c builtins.c bw.c charmap.c cmd.c compat.c \ hash.c help.c i18n.c kbd.c macro.c main.c menu.c path.c \ poshist.c pw.c queue.c qw.c rc.c regex.c scrn.c selinux.c \ syntax.c tab.c termcap.c tty.c tw.c ublock.c uedit.c uerror.c \ ufile.c uformat.c uisrch.c umath.c undo.c usearch.c ushell.c \ utag.c utf8.c utils.c va.c vfile.c vs.c w.c win32.c termidx_SOURCES = termidx.c man_joeinitfile=@joeinitfile@ man_joeresides=@joeresides@ man_joeinitcopy=@joeinitcopy@ joe.1: joe.1.in sed \ -e 's!@''joeinitfile''@!$(man_joeinitfile)!g' \ -e 's!@''joeresides''@!$(man_joeresides)!g' \ -e 's!@''joeinitcopy''@!$(man_joeinitcopy)!g' \ <'$?' >$@~ mv -f $@~ $@ install-exec-hook: cd $(DESTDIR)$(bindir) && for i in $(JOE_ALIASES); do \ rm -f $$i; \ $(LN_S) joe $$i; \ done install-man: install-man1-symlinks install-man1-symlinks: install-man1 cd $(DESTDIR)$(man1dir) && for i in $(JOE_ALIASES); do \ rm -f $$i.1; \ $(LN_S) joe.1 $$i.1; \ done uninstall-local: for i in $(JOE_ALIASES); do \ rm -f $(DESTDIR)$(bindir)/$$i $(DESTDIR)$(man1dir)/$$i.1; \ done CLEANFILES = $(JOE_RCFILES) joe.1 distclean-local: rm -f *~ rm -f stamp-h.in charmaps/klingon syntax/asm.jsf syntax/c.jsf syntax/conf.jsf syntax/csh.jsf syntax/diff.jsf syntax/fortran.jsf syntax/html.jsf syntax/java.jsf syntax/lisp.jsf syntax/mail.jsf syntax/mason.jsf syntax/pascal.jsf syntax/perl.jsf syntax/php.jsf syntax/python.jsf syntax/sh.jsf syntax/tcl.jsf syntax/tex.jsf syntax/verilog.jsf syntax/vhdl.jsf syntax/xml.jsf .PHONY: termcap jupp/Makefile.bsd-wrapper010064400000000000000000000050651374665315000126700ustar00# $MirOS: contrib/code/jupp/Makefile.bsd-wrapper,v 1.22 2020/10/29 23:54:53 tg Exp $ #- # make -f Makefile.bsd-wrapper CFPREFIX=/usr/mpkg sysconfjoesubdir=/joe MAN= joe.1 INST_TARGET= INSTALL_MAN= install CLEANFILES+= .deps charmap charmaps i18n syntax joe.txt{,~} jupp CFPREFIX?= /usr/local .if ${CFPREFIX} == "/usr" CFMANDIR?= /usr/share/man .endif CFMANDIR?= ${CFPREFIX}/man CFETC?= /etc sysconfjoesubdir?=/jupp CFARGS+= --prefix=${CFPREFIX:Q} \ --bindir=${CFPREFIX:Q}/bin \ --mandir=${CFMANDIR:Q} \ --sysconfdir=${CFETC:Q} \ ${GCFARGS} \ --enable-sysconfjoesubdir=${sysconfjoesubdir:Q} .ifmake winman CFARGS+= --enable-win32reloc .endif .include FSFISLIB= No .ifdef __CRAZY COPTS+= -Wno-unused-parameter . if exists(/usr/include/jupp.tmp.h) && !defined(wnostrict) CPPFLAGS+= -DGCC_Wstrict_prototypes . else COPTS+= -Wno-strict-prototypes . endif .endif joe.1: config.status joe.1.in cd ${FSFOBJDIR} && ${FSFMAKE} $@ all: jupplink jupplink: config.status @ln -sf joe jupp winman: joe.1 nroff -Tcol -man.old -rg1 joe.1 | col -bx >joe.txt~ cat -s joe.txt~ | sed \ -e 's/\(jupp\)\( .global-options\)/\132\2/' \ -e '1d' -e '$$d' -e $$'s/$$/\r/' >joe.txt .ifmake cats V_GROFF!= pkg_info -e 'groff-*' V_GHOSTSCRIPT!= pkg_info -e 'ghostscript-*' . if empty(V_GROFF) || empty(V_GHOSTSCRIPT) . error empty V_GROFF=${V_GROFF} or V_GHOSTSCRIPT=${V_GHOSTSCRIPT} . endif .endif CLEANFILES+= joe.htm joe.ps1 joe.pdf CATS_KW= jmacs, joe, jpico, jstar, jupp, rjoe CATS_TITLE_joe_1=joe - Joe's Own Editor cats: joe.cat1 joe.ps1 set -e; . ${BSDSRCDIR:Q}/scripts/roff2htm; set_target_absolute; \ do_conversion_verbose joe 1 joe.cat1 joe.htm x=$$(ident joe.1 | \ awk '/Mir''OS:/ { print $$4$$5; }' | \ tr -dc 0-9); (( $${#x} == 14 )) || exit 1; exec \ ${MKSH} ${BSDSRCDIR:Q}/contrib/hosted/tg/ps2pdfmir -p pa4 -c \ -o joe.pdf '[' /Author '(The MirOS Project)' \ /Title '('${CATS_TITLE_joe_1:Q}')' \ /Subject '(BSD Reference Manual)' /ModDate "(D:$$x)" \ /Creator '(GNU groff version ${V_GROFF:S/groff-//} \(MirPorts\))' \ /Producer '(Artifex Ghostscript ${V_GHOSTSCRIPT:S/ghostscript-//:S/-artifex//} \(MirPorts\))' \ /Keywords '('${CATS_KW:Q}')' /DOCINFO pdfmark \ -f joe.ps1 alljupps: cd ${.CURDIR:Q} && r=$$( jupp/Makefile.in010064400000000000000000001044771374665437200110660ustar00# Makefile.in generated by automake 1.9.6-MirPorts-6 from Makefile.am. # @configure_input@ # Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, # 2003, 2004, 2005 Free Software Foundation, Inc. # This Makefile.in is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY, to the extent permitted by law; without # even the implied warranty of MERCHANTABILITY or FITNESS FOR A # PARTICULAR PURPOSE. @SET_MAKE@ # $MirOS: contrib/code/jupp/Makefile.in,v 1.21 2020/10/30 00:05:51 tg Exp $ # $miros: contrib/code/jupp/Makefile.am,v 1.23 2020/10/29 22:16:24 tg Exp $ srcdir = @srcdir@ top_srcdir = @top_srcdir@ VPATH = @srcdir@ pkgdatadir = $(datadir)/@PACKAGE@ pkglibdir = $(libdir)/@PACKAGE@ pkgincludedir = $(includedir)/@PACKAGE@ top_builddir = . am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd INSTALL = @INSTALL@ install_sh_DATA = $(SHELL) $(install_sh) -c -m 644 install_sh_PROGRAM = $(SHELL) $(install_sh) -c install_sh_SCRIPT = $(SHELL) $(install_sh) -c INSTALL_HEADER = $(INSTALL_DATA) transform = $(program_transform_name) NORMAL_INSTALL = : PRE_INSTALL = : POST_INSTALL = : NORMAL_UNINSTALL = : PRE_UNINSTALL = : POST_UNINSTALL = : build_triplet = @build@ host_triplet = @host@ target_triplet = @target@ bin_PROGRAMS = joe$(EXEEXT) $(am__EXEEXT_1) @WANT_TERMIDX_TRUE@am__append_1 = termidx DIST_COMMON = README $(am__configure_deps) $(noinst_HEADERS) \ $(srcdir)/Makefile.am $(srcdir)/Makefile.in \ $(srcdir)/autoconf.h.in $(top_srcdir)/charmaps/klingon.in \ $(top_srcdir)/configure $(top_srcdir)/syntax/asm.jsf.in \ $(top_srcdir)/syntax/c.jsf.in $(top_srcdir)/syntax/conf.jsf.in \ $(top_srcdir)/syntax/csh.jsf.in \ $(top_srcdir)/syntax/diff.jsf.in \ $(top_srcdir)/syntax/fortran.jsf.in \ $(top_srcdir)/syntax/html.jsf.in \ $(top_srcdir)/syntax/java.jsf.in \ $(top_srcdir)/syntax/lisp.jsf.in \ $(top_srcdir)/syntax/mail.jsf.in \ $(top_srcdir)/syntax/mason.jsf.in \ $(top_srcdir)/syntax/pascal.jsf.in \ $(top_srcdir)/syntax/perl.jsf.in \ $(top_srcdir)/syntax/php.jsf.in \ $(top_srcdir)/syntax/python.jsf.in \ $(top_srcdir)/syntax/sh.jsf.in $(top_srcdir)/syntax/tcl.jsf.in \ $(top_srcdir)/syntax/tex.jsf.in \ $(top_srcdir)/syntax/verilog.jsf.in \ $(top_srcdir)/syntax/vhdl.jsf.in \ $(top_srcdir)/syntax/xml.jsf.in COPYING ChangeLog NEWS TODO \ config.guess config.sub depcomp install-sh missing \ mkinstalldirs subdir = . ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 am__aclocal_m4_deps = $(top_srcdir)/acinclude.m4 \ $(top_srcdir)/configure.ac am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ $(ACLOCAL_M4) am__CONFIG_DISTCLEAN_FILES = config.status config.cache config.log \ configure.lineno configure.status.lineno mkinstalldirs = $(SHELL) $(top_srcdir)/mkinstalldirs CONFIG_HEADER = autoconf.h CONFIG_CLEAN_FILES = syntax/c.jsf syntax/perl.jsf syntax/verilog.jsf \ syntax/sh.jsf syntax/python.jsf syntax/conf.jsf syntax/php.jsf \ syntax/mail.jsf syntax/pascal.jsf syntax/html.jsf \ syntax/vhdl.jsf syntax/fortran.jsf syntax/java.jsf \ syntax/xml.jsf syntax/tcl.jsf charmaps/klingon syntax/lisp.jsf \ syntax/csh.jsf syntax/mason.jsf syntax/diff.jsf syntax/asm.jsf \ syntax/tex.jsf @WANT_TERMIDX_TRUE@am__EXEEXT_1 = termidx$(EXEEXT) am__installdirs = "$(DESTDIR)$(bindir)" "$(DESTDIR)$(man1dir)" \ "$(DESTDIR)$(sysconf_charmapsdir)" \ "$(DESTDIR)$(sysconf_joedir)" "$(DESTDIR)$(sysconf_syntaxdir)" binPROGRAMS_INSTALL = $(INSTALL_PROGRAM) PROGRAMS = $(bin_PROGRAMS) am_joe_OBJECTS = b.$(OBJEXT) blocks.$(OBJEXT) builtin.$(OBJEXT) \ builtins.$(OBJEXT) bw.$(OBJEXT) charmap.$(OBJEXT) \ cmd.$(OBJEXT) compat.$(OBJEXT) hash.$(OBJEXT) help.$(OBJEXT) \ i18n.$(OBJEXT) kbd.$(OBJEXT) macro.$(OBJEXT) main.$(OBJEXT) \ menu.$(OBJEXT) path.$(OBJEXT) poshist.$(OBJEXT) pw.$(OBJEXT) \ queue.$(OBJEXT) qw.$(OBJEXT) rc.$(OBJEXT) regex.$(OBJEXT) \ scrn.$(OBJEXT) selinux.$(OBJEXT) syntax.$(OBJEXT) \ tab.$(OBJEXT) termcap.$(OBJEXT) tty.$(OBJEXT) tw.$(OBJEXT) \ ublock.$(OBJEXT) uedit.$(OBJEXT) uerror.$(OBJEXT) \ ufile.$(OBJEXT) uformat.$(OBJEXT) uisrch.$(OBJEXT) \ umath.$(OBJEXT) undo.$(OBJEXT) usearch.$(OBJEXT) \ ushell.$(OBJEXT) utag.$(OBJEXT) utf8.$(OBJEXT) utils.$(OBJEXT) \ va.$(OBJEXT) vfile.$(OBJEXT) vs.$(OBJEXT) w.$(OBJEXT) \ win32.$(OBJEXT) joe_OBJECTS = $(am_joe_OBJECTS) joe_LDADD = $(LDADD) am_termidx_OBJECTS = termidx.$(OBJEXT) termidx_OBJECTS = $(am_termidx_OBJECTS) termidx_LDADD = $(LDADD) DEFAULT_INCLUDES = -I. -I$(srcdir) -I. depcomp = $(SHELL) $(top_srcdir)/depcomp am__depfiles_maybe = depfiles COMPILE = $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) \ $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) CCLD = $(CC) LINK = $(CCLD) $(AM_CFLAGS) $(CFLAGS) $(AM_LDFLAGS) $(LDFLAGS) -o $@ SOURCES = $(joe_SOURCES) $(termidx_SOURCES) DIST_SOURCES = $(joe_SOURCES) $(termidx_SOURCES) man1dir = $(mandir)/man1 INSTALL_MAN_AM = install-man NROFF = nroff MANS = $(man_MANS) am__vpath_adj_setup = srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`; am__vpath_adj = case $$p in \ $(srcdir)/*) f=`echo "$$p" | sed "s|^$$srcdirstrip/||"`;; \ *) f=$$p;; \ esac; am__strip_dir = `echo $$p | sed -e 's|^.*/||'`; sysconf_charmapsDATA_INSTALL = $(INSTALL_DATA) sysconf_joeDATA_INSTALL = $(INSTALL_DATA) sysconf_syntaxDATA_INSTALL = $(INSTALL_DATA) DATA = $(sysconf_charmaps_DATA) $(sysconf_joe_DATA) \ $(sysconf_syntax_DATA) HEADERS = $(noinst_HEADERS) ETAGS = etags CTAGS = ctags DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) distdir = $(PACKAGE)-$(VERSION) top_distdir = $(distdir) am__remove_distdir = \ { test ! -d $(distdir) \ || { find $(distdir) -type d ! -perm -200 -exec chmod u+w {} ';' \ && rm -fr $(distdir); }; } DIST_ARCHIVES = $(distdir).tar.gz GZIP_ENV = --best distuninstallcheck_listfiles = find . -type f -print distcleancheck_listfiles = find . -type f -print ACLOCAL = @ACLOCAL@ AMDEP_FALSE = @AMDEP_FALSE@ AMDEP_TRUE = @AMDEP_TRUE@ AMTAR = @AMTAR@ AUTOCONF = @AUTOCONF@ AUTOHEADER = @AUTOHEADER@ AUTOMAKE = @AUTOMAKE@ AWK = @AWK@ CC = @CC@ CCDEPMODE = @CCDEPMODE@ CFLAGS = @CFLAGS@ CPP = @CPP@ CPPFLAGS = @CPPFLAGS@ CYGPATH_W = @CYGPATH_W@ DEFS = @DEFS@ DEPDIR = @DEPDIR@ ECHO_C = @ECHO_C@ ECHO_N = @ECHO_N@ ECHO_T = @ECHO_T@ EGREP = @EGREP@ EXEEXT = @EXEEXT@ GREP = @GREP@ INSTALL_DATA = @INSTALL_DATA@ INSTALL_PROGRAM = @INSTALL_PROGRAM@ INSTALL_SCRIPT = @INSTALL_SCRIPT@ INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ LDFLAGS = @LDFLAGS@ LIBOBJS = @LIBOBJS@ LIBS = @LIBS@ LN_S = @LN_S@ LTLIBOBJS = @LTLIBOBJS@ MAINT = @MAINT@ MAINTAINER_MODE_FALSE = @MAINTAINER_MODE_FALSE@ MAINTAINER_MODE_TRUE = @MAINTAINER_MODE_TRUE@ MAKEINFO = @MAKEINFO@ OBJEXT = @OBJEXT@ PACKAGE = @PACKAGE@ PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@ PACKAGE_NAME = @PACKAGE_NAME@ PACKAGE_STRING = @PACKAGE_STRING@ PACKAGE_TARNAME = @PACKAGE_TARNAME@ PACKAGE_VERSION = @PACKAGE_VERSION@ PATH_SEPARATOR = @PATH_SEPARATOR@ SET_MAKE = @SET_MAKE@ SHELL = @SHELL@ SPELL = @SPELL@ STRIP = @STRIP@ VERSION = @VERSION@ WANT_TERMIDX_FALSE = @WANT_TERMIDX_FALSE@ WANT_TERMIDX_TRUE = @WANT_TERMIDX_TRUE@ ac_ct_CC = @ac_ct_CC@ am__fastdepCC_FALSE = @am__fastdepCC_FALSE@ am__fastdepCC_TRUE = @am__fastdepCC_TRUE@ am__include = @am__include@ am__leading_dot = @am__leading_dot@ am__quote = @am__quote@ am__tar = @am__tar@ am__untar = @am__untar@ bindir = @bindir@ build = @build@ build_alias = @build_alias@ build_cpu = @build_cpu@ build_os = @build_os@ build_vendor = @build_vendor@ datadir = @datadir@ datarootdir = @datarootdir@ docdir = @docdir@ dvidir = @dvidir@ exec_prefix = @exec_prefix@ host = @host@ host_alias = @host_alias@ host_cpu = @host_cpu@ host_os = @host_os@ host_vendor = @host_vendor@ htmldir = @htmldir@ includedir = @includedir@ infodir = @infodir@ install_sh = @install_sh@ joeinitcopy = @joeinitcopy@ joeinitfile = @joeinitfile@ joeresides = @joeresides@ jrcafter = @jrcafter@ jrcbefore = @jrcbefore@ libdir = @libdir@ libexecdir = @libexecdir@ localedir = @localedir@ localstatedir = @localstatedir@ mandir = @mandir@ mkdir_p = @mkdir_p@ oldincludedir = @oldincludedir@ pdfdir = @pdfdir@ prefix = @prefix@ program_transform_name = @program_transform_name@ psdir = @psdir@ sbindir = @sbindir@ sharedstatedir = @sharedstatedir@ sysconfdir = @sysconfdir@ sysconfjoesubdir = @sysconfjoesubdir@ target = @target@ target_alias = @target_alias@ target_cpu = @target_cpu@ target_os = @target_os@ target_vendor = @target_vendor@ AUTOMAKE_OPTIONS = foreign EXTRA_DIST = \ HINTS INFO LIST Make-w32.sh autogen.sh bw-lgen.inc dir.c \ docs/help-system.html jmacsrc.in joe.1.in joe.txt joerc.in \ jpicorc.in jstarrc.in jupprc popen.inc rjoerc.in setup.inf \ strlfun.inc JOE_ALIASES = jmacs jpico jstar jupp rjoe JOE_RCFILES = jmacsrc joerc jpicorc jstarrc rjoerc JOE_RCEXTRA = jupprc JOE_RC_EDIT = sed \ -e 's@''jrcbefore''@$(jrcbefore)g' \ -e 's@''jrcafter''@$(jrcafter)g' \ -e 's@''SPELL''@$(SPELL)g' \ <'$?' >$@~ && mv -f $@~ $@ INCLUDES = -DJOERC="\"$(sysconf_joedir)/\"" sysconf_joedir = $(sysconfdir)$(sysconfjoesubdir) sysconf_joe_DATA = $(JOE_RCFILES) $(JOE_RCEXTRA) sysconf_syntaxdir = $(sysconf_joedir)/syntax sysconf_syntax_DATA = \ syntax/asm.jsf syntax/c.jsf syntax/conf.jsf syntax/csh.jsf \ syntax/diff.jsf syntax/fortran.jsf syntax/html.jsf \ syntax/java.jsf syntax/lisp.jsf syntax/mail.jsf syntax/mason.jsf \ syntax/pascal.jsf syntax/perl.jsf syntax/php.jsf \ syntax/python.jsf syntax/sh.jsf syntax/tcl.jsf syntax/tex.jsf \ syntax/verilog.jsf syntax/vhdl.jsf syntax/xml.jsf sysconf_charmapsdir = $(sysconf_joedir)/charmaps sysconf_charmaps_DATA = charmaps/klingon man_MANS = joe.1 noinst_HEADERS = \ b.h blocks.h builtin.h bw.h charmap.h cmd.h config.h hash.h \ help.h i18n.h kbd.h macro.h main.h menu.h path.h poshist.h pw.h \ queue.h qw.h rc.h regex.h scrn.h syntax.h tab.h termcap.h tty.h \ tw.h types.h ublock.h uedit.h uerror.h ufile.h uformat.h \ uisrch.h umath.h undo.h usearch.h ushell.h utag.h utf8.h utils.h \ va.h vfile.h vs.h w.h joe_SOURCES = \ b.c blocks.c builtin.c builtins.c bw.c charmap.c cmd.c compat.c \ hash.c help.c i18n.c kbd.c macro.c main.c menu.c path.c \ poshist.c pw.c queue.c qw.c rc.c regex.c scrn.c selinux.c \ syntax.c tab.c termcap.c tty.c tw.c ublock.c uedit.c uerror.c \ ufile.c uformat.c uisrch.c umath.c undo.c usearch.c ushell.c \ utag.c utf8.c utils.c va.c vfile.c vs.c w.c win32.c termidx_SOURCES = termidx.c man_joeinitfile = @joeinitfile@ man_joeresides = @joeresides@ man_joeinitcopy = @joeinitcopy@ CLEANFILES = $(JOE_RCFILES) joe.1 all: autoconf.h $(MAKE) $(AM_MAKEFLAGS) all-am .SUFFIXES: .SUFFIXES: .c .o .obj am--refresh: @: $(srcdir)/Makefile.in: @MAINTAINER_MODE_TRUE@ $(srcdir)/Makefile.am $(am__configure_deps) @for dep in $?; do \ case '$(am__configure_deps)' in \ *$$dep*) \ echo ' cd $(srcdir) && $(AUTOMAKE) --foreign '; \ cd $(srcdir) && $(AUTOMAKE) --foreign \ && exit 0; \ exit 1;; \ esac; \ done; \ echo ' cd $(top_srcdir) && $(AUTOMAKE) --foreign Makefile'; \ cd $(top_srcdir) && \ $(AUTOMAKE) --foreign Makefile .PRECIOUS: Makefile Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status @case '$?' in \ *config.status*) \ echo ' $(SHELL) ./config.status'; \ $(SHELL) ./config.status;; \ *) \ echo ' cd $(top_builddir) && $(SHELL) ./config.status $@ $(am__depfiles_maybe)'; \ cd $(top_builddir) && $(SHELL) ./config.status $@ $(am__depfiles_maybe);; \ esac; $(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES) $(SHELL) ./config.status --recheck $(top_srcdir)/configure: @MAINTAINER_MODE_TRUE@ $(am__configure_deps) cd $(srcdir) && $(AUTOCONF) $(ACLOCAL_M4): @MAINTAINER_MODE_TRUE@ $(am__aclocal_m4_deps) cd $(srcdir) && $(ACLOCAL) $(ACLOCAL_AMFLAGS) autoconf.h: stamp-h1 @if test ! -f $@; then \ rm -f stamp-h1; \ $(MAKE) stamp-h1; \ else :; fi stamp-h1: $(srcdir)/autoconf.h.in $(top_builddir)/config.status @rm -f stamp-h1 cd $(top_builddir) && $(SHELL) ./config.status autoconf.h $(srcdir)/autoconf.h.in: @MAINTAINER_MODE_TRUE@ $(am__configure_deps) cd $(top_srcdir) && $(AUTOHEADER) rm -f stamp-h1 touch $@ distclean-hdr: -rm -f autoconf.h stamp-h1 syntax/c.jsf: $(top_builddir)/config.status $(top_srcdir)/syntax/c.jsf.in cd $(top_builddir) && $(SHELL) ./config.status $@ syntax/perl.jsf: $(top_builddir)/config.status $(top_srcdir)/syntax/perl.jsf.in cd $(top_builddir) && $(SHELL) ./config.status $@ syntax/verilog.jsf: $(top_builddir)/config.status $(top_srcdir)/syntax/verilog.jsf.in cd $(top_builddir) && $(SHELL) ./config.status $@ syntax/sh.jsf: $(top_builddir)/config.status $(top_srcdir)/syntax/sh.jsf.in cd $(top_builddir) && $(SHELL) ./config.status $@ syntax/python.jsf: $(top_builddir)/config.status $(top_srcdir)/syntax/python.jsf.in cd $(top_builddir) && $(SHELL) ./config.status $@ syntax/conf.jsf: $(top_builddir)/config.status $(top_srcdir)/syntax/conf.jsf.in cd $(top_builddir) && $(SHELL) ./config.status $@ syntax/php.jsf: $(top_builddir)/config.status $(top_srcdir)/syntax/php.jsf.in cd $(top_builddir) && $(SHELL) ./config.status $@ syntax/mail.jsf: $(top_builddir)/config.status $(top_srcdir)/syntax/mail.jsf.in cd $(top_builddir) && $(SHELL) ./config.status $@ syntax/pascal.jsf: $(top_builddir)/config.status $(top_srcdir)/syntax/pascal.jsf.in cd $(top_builddir) && $(SHELL) ./config.status $@ syntax/html.jsf: $(top_builddir)/config.status $(top_srcdir)/syntax/html.jsf.in cd $(top_builddir) && $(SHELL) ./config.status $@ syntax/vhdl.jsf: $(top_builddir)/config.status $(top_srcdir)/syntax/vhdl.jsf.in cd $(top_builddir) && $(SHELL) ./config.status $@ syntax/fortran.jsf: $(top_builddir)/config.status $(top_srcdir)/syntax/fortran.jsf.in cd $(top_builddir) && $(SHELL) ./config.status $@ syntax/java.jsf: $(top_builddir)/config.status $(top_srcdir)/syntax/java.jsf.in cd $(top_builddir) && $(SHELL) ./config.status $@ syntax/xml.jsf: $(top_builddir)/config.status $(top_srcdir)/syntax/xml.jsf.in cd $(top_builddir) && $(SHELL) ./config.status $@ syntax/tcl.jsf: $(top_builddir)/config.status $(top_srcdir)/syntax/tcl.jsf.in cd $(top_builddir) && $(SHELL) ./config.status $@ charmaps/klingon: $(top_builddir)/config.status $(top_srcdir)/charmaps/klingon.in cd $(top_builddir) && $(SHELL) ./config.status $@ syntax/lisp.jsf: $(top_builddir)/config.status $(top_srcdir)/syntax/lisp.jsf.in cd $(top_builddir) && $(SHELL) ./config.status $@ syntax/csh.jsf: $(top_builddir)/config.status $(top_srcdir)/syntax/csh.jsf.in cd $(top_builddir) && $(SHELL) ./config.status $@ syntax/mason.jsf: $(top_builddir)/config.status $(top_srcdir)/syntax/mason.jsf.in cd $(top_builddir) && $(SHELL) ./config.status $@ syntax/diff.jsf: $(top_builddir)/config.status $(top_srcdir)/syntax/diff.jsf.in cd $(top_builddir) && $(SHELL) ./config.status $@ syntax/asm.jsf: $(top_builddir)/config.status $(top_srcdir)/syntax/asm.jsf.in cd $(top_builddir) && $(SHELL) ./config.status $@ syntax/tex.jsf: $(top_builddir)/config.status $(top_srcdir)/syntax/tex.jsf.in cd $(top_builddir) && $(SHELL) ./config.status $@ install-binPROGRAMS: @$(NORMAL_INSTALL) test -z "$(bindir)" || $(mkdir_p) "$(DESTDIR)$(bindir)" @list='$(bin_PROGRAMS)'; for p in $$list; do \ p1=`echo $$p|sed 's/$(EXEEXT)$$//'`; \ if test -f $$p \ ; then \ f=`echo "$$p1" | sed 's,^.*/,,;$(transform);s/$$/$(EXEEXT)/'`; \ echo " $(INSTALL_PROGRAM_ENV) $(binPROGRAMS_INSTALL) '$$p' '$(DESTDIR)$(bindir)/$$f'"; \ $(INSTALL_PROGRAM_ENV) $(binPROGRAMS_INSTALL) "$$p" "$(DESTDIR)$(bindir)/$$f" || exit 1; \ else :; fi; \ done uninstall-binPROGRAMS: @$(NORMAL_UNINSTALL) @list='$(bin_PROGRAMS)'; for p in $$list; do \ f=`echo "$$p" | sed 's,^.*/,,;s/$(EXEEXT)$$//;$(transform);s/$$/$(EXEEXT)/'`; \ echo " rm -f '$(DESTDIR)$(bindir)/$$f'"; \ rm -f "$(DESTDIR)$(bindir)/$$f"; \ done clean-binPROGRAMS: -test -z "$(bin_PROGRAMS)" || rm -f $(bin_PROGRAMS) joe$(EXEEXT): $(joe_OBJECTS) $(joe_DEPENDENCIES) @rm -f joe$(EXEEXT) $(LINK) $(joe_LDFLAGS) $(joe_OBJECTS) $(joe_LDADD) $(LIBS) termidx$(EXEEXT): $(termidx_OBJECTS) $(termidx_DEPENDENCIES) @rm -f termidx$(EXEEXT) $(LINK) $(termidx_LDFLAGS) $(termidx_OBJECTS) $(termidx_LDADD) $(LIBS) mostlyclean-compile: -rm -f *.$(OBJEXT) distclean-compile: -rm -f *.tab.c @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/b.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/blocks.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/builtin.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/builtins.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/bw.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/charmap.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/cmd.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/compat.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/hash.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/help.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/i18n.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/kbd.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/macro.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/main.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/menu.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/path.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/poshist.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/pw.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/queue.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/qw.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/rc.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/regex.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/scrn.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/selinux.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/syntax.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/tab.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/termcap.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/termidx.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/tty.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/tw.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/ublock.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/uedit.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/uerror.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/ufile.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/uformat.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/uisrch.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/umath.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/undo.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/usearch.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/ushell.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/utag.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/utf8.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/utils.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/va.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/vfile.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/vs.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/w.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/win32.Po@am__quote@ .c.o: @am__fastdepCC_TRUE@ if $(COMPILE) -MT $@ -MD -MP -MF "$(DEPDIR)/$*.Tpo" -c -o $@ $<; \ @am__fastdepCC_TRUE@ then mv -f "$(DEPDIR)/$*.Tpo" "$(DEPDIR)/$*.Po"; else rm -f "$(DEPDIR)/$*.Tpo"; exit 1; fi @AMDEP_TRUE@@am__fastdepCC_FALSE@ source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(COMPILE) -c $< .c.obj: @am__fastdepCC_TRUE@ if $(COMPILE) -MT $@ -MD -MP -MF "$(DEPDIR)/$*.Tpo" -c -o $@ `$(CYGPATH_W) '$<'`; \ @am__fastdepCC_TRUE@ then mv -f "$(DEPDIR)/$*.Tpo" "$(DEPDIR)/$*.Po"; else rm -f "$(DEPDIR)/$*.Tpo"; exit 1; fi @AMDEP_TRUE@@am__fastdepCC_FALSE@ source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(COMPILE) -c `$(CYGPATH_W) '$<'` uninstall-info-am: install-man1: @$(NORMAL_INSTALL) test -z "$(man1dir)" || $(mkdir_p) "$(DESTDIR)$(man1dir)" @list='$(man1_MANS) $(dist_man1_MANS) $(nodist_man1_MANS)'; \ l2='$(man_MANS) $(dist_man_MANS) $(nodist_man_MANS)'; \ for i in $$l2; do \ case "$$i" in \ *.1*) list="$$list $$i" ;; \ esac; \ done; \ for i in $$list; do \ if test -f $(srcdir)/$$i; then file=$(srcdir)/$$i; \ else file=$$i; fi; \ ext=`echo $$i | sed -e 's/^.*\\.//'`; \ case "$$ext" in \ 1*) ;; \ *) ext='1' ;; \ esac; \ inst=`echo $$i | sed -e 's/\\.[0-9a-z]*$$//'`; \ inst=`echo $$inst | sed -e 's/^.*\///'`; \ inst=`echo $$inst | sed '$(transform)'`.$$ext; \ echo " $(INSTALL_DATA) '$$file' '$(DESTDIR)$(man1dir)/$$inst'"; \ $(INSTALL_DATA) "$$file" "$(DESTDIR)$(man1dir)/$$inst"; \ done uninstall-man1: @$(NORMAL_UNINSTALL) @list='$(man1_MANS) $(dist_man1_MANS) $(nodist_man1_MANS)'; \ l2='$(man_MANS) $(dist_man_MANS) $(nodist_man_MANS)'; \ for i in $$l2; do \ case "$$i" in \ *.1*) list="$$list $$i" ;; \ esac; \ done; \ for i in $$list; do \ ext=`echo $$i | sed -e 's/^.*\\.//'`; \ case "$$ext" in \ 1*) ;; \ *) ext='1' ;; \ esac; \ inst=`echo $$i | sed -e 's/\\.[0-9a-z]*$$//'`; \ inst=`echo $$inst | sed -e 's/^.*\///'`; \ inst=`echo $$inst | sed '$(transform)'`.$$ext; \ echo " rm -f '$(DESTDIR)$(man1dir)/$$inst'"; \ rm -f "$(DESTDIR)$(man1dir)/$$inst"; \ done install-sysconf_charmapsDATA: @$(NORMAL_INSTALL) test -z "$(sysconf_charmapsdir)" || $(mkdir_p) "$(DESTDIR)$(sysconf_charmapsdir)" @list='$(sysconf_charmaps_DATA)'; for p in $$list; do \ if test -f "$$p"; then d=; else d="$(srcdir)/"; fi; \ f=$(am__strip_dir) \ echo " $(sysconf_charmapsDATA_INSTALL) '$$d$$p' '$(DESTDIR)$(sysconf_charmapsdir)/$$f'"; \ $(sysconf_charmapsDATA_INSTALL) "$$d$$p" "$(DESTDIR)$(sysconf_charmapsdir)/$$f"; \ done uninstall-sysconf_charmapsDATA: @$(NORMAL_UNINSTALL) @list='$(sysconf_charmaps_DATA)'; for p in $$list; do \ f=$(am__strip_dir) \ echo " rm -f '$(DESTDIR)$(sysconf_charmapsdir)/$$f'"; \ rm -f "$(DESTDIR)$(sysconf_charmapsdir)/$$f"; \ done install-sysconf_joeDATA: @$(NORMAL_INSTALL) test -z "$(sysconf_joedir)" || $(mkdir_p) "$(DESTDIR)$(sysconf_joedir)" @list='$(sysconf_joe_DATA)'; for p in $$list; do \ if test -f "$$p"; then d=; else d="$(srcdir)/"; fi; \ f=$(am__strip_dir) \ echo " $(sysconf_joeDATA_INSTALL) '$$d$$p' '$(DESTDIR)$(sysconf_joedir)/$$f'"; \ $(sysconf_joeDATA_INSTALL) "$$d$$p" "$(DESTDIR)$(sysconf_joedir)/$$f"; \ done uninstall-sysconf_joeDATA: @$(NORMAL_UNINSTALL) @list='$(sysconf_joe_DATA)'; for p in $$list; do \ f=$(am__strip_dir) \ echo " rm -f '$(DESTDIR)$(sysconf_joedir)/$$f'"; \ rm -f "$(DESTDIR)$(sysconf_joedir)/$$f"; \ done install-sysconf_syntaxDATA: @$(NORMAL_INSTALL) test -z "$(sysconf_syntaxdir)" || $(mkdir_p) "$(DESTDIR)$(sysconf_syntaxdir)" @list='$(sysconf_syntax_DATA)'; for p in $$list; do \ if test -f "$$p"; then d=; else d="$(srcdir)/"; fi; \ f=$(am__strip_dir) \ echo " $(sysconf_syntaxDATA_INSTALL) '$$d$$p' '$(DESTDIR)$(sysconf_syntaxdir)/$$f'"; \ $(sysconf_syntaxDATA_INSTALL) "$$d$$p" "$(DESTDIR)$(sysconf_syntaxdir)/$$f"; \ done uninstall-sysconf_syntaxDATA: @$(NORMAL_UNINSTALL) @list='$(sysconf_syntax_DATA)'; for p in $$list; do \ f=$(am__strip_dir) \ echo " rm -f '$(DESTDIR)$(sysconf_syntaxdir)/$$f'"; \ rm -f "$(DESTDIR)$(sysconf_syntaxdir)/$$f"; \ done ID: $(HEADERS) $(SOURCES) $(LISP) $(TAGS_FILES) list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ unique=`for i in $$list; do \ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ done | \ $(AWK) ' { files[$$0] = 1; } \ END { for (i in files) print i; }'`; \ mkid -fID $$unique tags: TAGS TAGS: $(HEADERS) $(SOURCES) autoconf.h.in $(TAGS_DEPENDENCIES) \ $(TAGS_FILES) $(LISP) tags=; \ here=`pwd`; \ list='$(SOURCES) $(HEADERS) autoconf.h.in $(LISP) $(TAGS_FILES)'; \ unique=`for i in $$list; do \ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ done | \ $(AWK) ' { files[$$0] = 1; } \ END { for (i in files) print i; }'`; \ if test -z "$(ETAGS_ARGS)$$tags$$unique"; then :; else \ test -n "$$unique" || unique=$$empty_fix; \ $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ $$tags $$unique; \ fi ctags: CTAGS CTAGS: $(HEADERS) $(SOURCES) autoconf.h.in $(TAGS_DEPENDENCIES) \ $(TAGS_FILES) $(LISP) tags=; \ here=`pwd`; \ list='$(SOURCES) $(HEADERS) autoconf.h.in $(LISP) $(TAGS_FILES)'; \ unique=`for i in $$list; do \ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ done | \ $(AWK) ' { files[$$0] = 1; } \ END { for (i in files) print i; }'`; \ test -z "$(CTAGS_ARGS)$$tags$$unique" \ || $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \ $$tags $$unique GTAGS: here=`$(am__cd) $(top_builddir) && pwd` \ && cd $(top_srcdir) \ && gtags -i $(GTAGS_ARGS) $$here distclean-tags: -rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags distdir: $(DISTFILES) $(am__remove_distdir) mkdir $(distdir) $(mkdir_p) $(distdir)/charmaps $(distdir)/docs $(distdir)/syntax @srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`; \ topsrcdirstrip=`echo "$(top_srcdir)" | sed 's|.|.|g'`; \ list='$(DISTFILES)'; for file in $$list; do \ case $$file in \ $(srcdir)/*) file=`echo "$$file" | sed "s|^$$srcdirstrip/||"`;; \ $(top_srcdir)/*) file=`echo "$$file" | sed "s|^$$topsrcdirstrip/|$(top_builddir)/|"`;; \ esac; \ if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \ dir=`echo "$$file" | sed -e 's,/[^/]*$$,,'`; \ if test "$$dir" != "$$file" && test "$$dir" != "."; then \ dir="/$$dir"; \ $(mkdir_p) "$(distdir)$$dir"; \ else \ dir=''; \ fi; \ if test -d $$d/$$file; then \ if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \ cp -pR $(srcdir)/$$file $(distdir)$$dir || exit 1; \ fi; \ cp -pR $$d/$$file $(distdir)$$dir || exit 1; \ else \ test -f $(distdir)/$$file \ || cp -p $$d/$$file $(distdir)/$$file \ || exit 1; \ fi; \ done -find $(distdir) -type d ! -perm -777 -exec chmod a+rwx {} \; -o \ ! -type d ! -perm -444 -links 1 -exec chmod a+r {} \; -o \ ! -type d ! -perm -400 -exec chmod a+r {} \; -o \ ! -type d ! -perm -444 -exec $(SHELL) $(install_sh) -c -m a+r {} {} \; \ || chmod -R a+r $(distdir) dist-gzip: distdir tardir=$(distdir) && $(am__tar) | GZIP=$(GZIP_ENV) gzip -c >$(distdir).tar.gz $(am__remove_distdir) dist-bzip2: distdir tardir=$(distdir) && $(am__tar) | bzip2 -9 -c >$(distdir).tar.bz2 $(am__remove_distdir) dist-tarZ: distdir tardir=$(distdir) && $(am__tar) | compress -c >$(distdir).tar.Z $(am__remove_distdir) dist-shar: distdir shar $(distdir) | GZIP=$(GZIP_ENV) gzip -c >$(distdir).shar.gz $(am__remove_distdir) dist-zip: distdir -rm -f $(distdir).zip zip -rq $(distdir).zip $(distdir) $(am__remove_distdir) dist dist-all: distdir tardir=$(distdir) && $(am__tar) | GZIP=$(GZIP_ENV) gzip -c >$(distdir).tar.gz $(am__remove_distdir) # This target untars the dist file and tries a VPATH configuration. Then # it guarantees that the distribution is self-contained by making another # tarfile. distcheck: dist case '$(DIST_ARCHIVES)' in \ *.tar.gz*) \ GZIP=$(GZIP_ENV) gunzip -c $(distdir).tar.gz | $(am__untar) ;;\ *.tar.bz2*) \ bunzip2 -c $(distdir).tar.bz2 | $(am__untar) ;;\ *.tar.Z*) \ uncompress -c $(distdir).tar.Z | $(am__untar) ;;\ *.shar.gz*) \ GZIP=$(GZIP_ENV) gunzip -c $(distdir).shar.gz | unshar ;;\ *.zip*) \ unzip $(distdir).zip ;;\ esac chmod -R a-w $(distdir); chmod u+w $(distdir) mkdir $(distdir)/_build mkdir $(distdir)/_inst chmod a-w $(distdir) dc_install_base=`$(am__cd) $(distdir)/_inst && pwd | sed -e 's,^[^:\\/]:[\\/],/,'` \ && dc_destdir="$${TMPDIR-/tmp}/am-dc-$$$$/" \ && cd $(distdir)/_build \ && ../configure --srcdir=.. --prefix="$$dc_install_base" \ $(DISTCHECK_CONFIGURE_FLAGS) \ && $(MAKE) $(AM_MAKEFLAGS) \ && $(MAKE) $(AM_MAKEFLAGS) dvi \ && $(MAKE) $(AM_MAKEFLAGS) check \ && $(MAKE) $(AM_MAKEFLAGS) install \ && $(MAKE) $(AM_MAKEFLAGS) installcheck \ && $(MAKE) $(AM_MAKEFLAGS) uninstall \ && $(MAKE) $(AM_MAKEFLAGS) distuninstallcheck_dir="$$dc_install_base" \ distuninstallcheck \ && chmod -R a-w "$$dc_install_base" \ && ({ \ (cd ../.. && umask 077 && mkdir "$$dc_destdir") \ && $(MAKE) $(AM_MAKEFLAGS) DESTDIR="$$dc_destdir" install \ && $(MAKE) $(AM_MAKEFLAGS) DESTDIR="$$dc_destdir" uninstall \ && $(MAKE) $(AM_MAKEFLAGS) DESTDIR="$$dc_destdir" \ distuninstallcheck_dir="$$dc_destdir" distuninstallcheck; \ } || { rm -rf "$$dc_destdir"; exit 1; }) \ && rm -rf "$$dc_destdir" \ && $(MAKE) $(AM_MAKEFLAGS) dist \ && rm -rf $(DIST_ARCHIVES) \ && $(MAKE) $(AM_MAKEFLAGS) distcleancheck $(am__remove_distdir) @(echo "$(distdir) archives ready for distribution: "; \ list='$(DIST_ARCHIVES)'; for i in $$list; do echo $$i; done) | \ sed -e '1{h;s/./=/g;p;x;}' -e '$${p;x;}' distuninstallcheck: @cd $(distuninstallcheck_dir) \ && test `$(distuninstallcheck_listfiles) | wc -l` -le 1 \ || { echo "ERROR: files left after uninstall:" ; \ if test -n "$(DESTDIR)"; then \ echo " (check DESTDIR support)"; \ fi ; \ $(distuninstallcheck_listfiles) ; \ exit 1; } >&2 distcleancheck: distclean @if test '$(srcdir)' = . ; then \ echo "ERROR: distcleancheck can only run from a VPATH build" ; \ exit 1 ; \ fi @test `$(distcleancheck_listfiles) | wc -l` -eq 0 \ || { echo "ERROR: files left in build directory after distclean:" ; \ $(distcleancheck_listfiles) ; \ exit 1; } >&2 check-am: all-am check: check-am all-am: Makefile $(PROGRAMS) $(MANS) $(DATA) $(HEADERS) autoconf.h installdirs: for dir in "$(DESTDIR)$(bindir)" "$(DESTDIR)$(man1dir)" "$(DESTDIR)$(sysconf_charmapsdir)" "$(DESTDIR)$(sysconf_joedir)" "$(DESTDIR)$(sysconf_syntaxdir)"; do \ test -z "$$dir" || $(mkdir_p) "$$dir"; \ done install: install-am install-exec: install-exec-am install-data: install-data-am uninstall: uninstall-am install-am: @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am installcheck: installcheck-am install-strip: $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ `test -z '$(STRIP)' || \ echo "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'"` install mostlyclean-generic: clean-generic: -test -z "$(CLEANFILES)" || rm -f $(CLEANFILES) distclean-generic: -test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES) maintainer-clean-generic: @echo "This command is intended for maintainers to use" @echo "it deletes files that may require special tools to rebuild." clean: clean-am clean-am: clean-binPROGRAMS clean-generic mostlyclean-am distclean: distclean-am -rm -f $(am__CONFIG_DISTCLEAN_FILES) -rm -rf ./$(DEPDIR) -rm -f Makefile distclean-am: clean-am distclean-compile distclean-generic \ distclean-hdr distclean-local distclean-tags dvi: dvi-am dvi-am: html: html-am info: info-am info-am: install-data-am: $(INSTALL_MAN_AM) install-sysconf_charmapsDATA \ install-sysconf_joeDATA install-sysconf_syntaxDATA install-exec-am: install-binPROGRAMS @$(NORMAL_INSTALL) $(MAKE) $(AM_MAKEFLAGS) install-exec-hook install-info: install-info-am installcheck-am: maintainer-clean: maintainer-clean-am -rm -f $(am__CONFIG_DISTCLEAN_FILES) -rm -rf $(top_srcdir)/autom4te.cache -rm -rf ./$(DEPDIR) -rm -f Makefile maintainer-clean-am: distclean-am maintainer-clean-generic mostlyclean: mostlyclean-am mostlyclean-am: mostlyclean-compile mostlyclean-generic pdf: pdf-am pdf-am: ps: ps-am ps-am: uninstall-am: uninstall-binPROGRAMS uninstall-info-am uninstall-local \ uninstall-man uninstall-sysconf_charmapsDATA \ uninstall-sysconf_joeDATA uninstall-sysconf_syntaxDATA uninstall-man: uninstall-man1 .PHONY: CTAGS GTAGS all all-am am--refresh check check-am clean \ clean-binPROGRAMS clean-generic ctags dist dist-all dist-bzip2 \ dist-gzip dist-shar dist-tarZ dist-zip distcheck distclean \ distclean-compile distclean-generic distclean-hdr \ distclean-local distclean-tags distcleancheck distdir \ distuninstallcheck dvi dvi-am html html-am info info-am \ install install-am install-binPROGRAMS install-data \ install-data-am install-exec install-exec-am install-exec-hook \ install-info install-info-am install-man install-man1 \ install-strip install-sysconf_charmapsDATA \ install-sysconf_joeDATA install-sysconf_syntaxDATA \ installcheck installcheck-am installdirs maintainer-clean \ maintainer-clean-generic mostlyclean mostlyclean-compile \ mostlyclean-generic pdf pdf-am ps ps-am tags uninstall \ uninstall-am uninstall-binPROGRAMS uninstall-info-am \ uninstall-local uninstall-man uninstall-man1 \ uninstall-sysconf_charmapsDATA uninstall-sysconf_joeDATA \ uninstall-sysconf_syntaxDATA jmacsrc: jmacsrc.in $(JOE_RC_EDIT) joerc: joerc.in $(JOE_RC_EDIT) jpicorc: jpicorc.in $(JOE_RC_EDIT) jstarrc: jstarrc.in $(JOE_RC_EDIT) rjoerc: rjoerc.in $(JOE_RC_EDIT) joe.1: joe.1.in sed \ -e 's!@''joeinitfile''@!$(man_joeinitfile)!g' \ -e 's!@''joeresides''@!$(man_joeresides)!g' \ -e 's!@''joeinitcopy''@!$(man_joeinitcopy)!g' \ <'$?' >$@~ mv -f $@~ $@ install-exec-hook: cd $(DESTDIR)$(bindir) && for i in $(JOE_ALIASES); do \ rm -f $$i; \ $(LN_S) joe $$i; \ done install-man: install-man1-symlinks install-man1-symlinks: install-man1 cd $(DESTDIR)$(man1dir) && for i in $(JOE_ALIASES); do \ rm -f $$i.1; \ $(LN_S) joe.1 $$i.1; \ done uninstall-local: for i in $(JOE_ALIASES); do \ rm -f $(DESTDIR)$(bindir)/$$i $(DESTDIR)$(man1dir)/$$i.1; \ done distclean-local: rm -f *~ rm -f stamp-h.in charmaps/klingon syntax/asm.jsf syntax/c.jsf syntax/conf.jsf syntax/csh.jsf syntax/diff.jsf syntax/fortran.jsf syntax/html.jsf syntax/java.jsf syntax/lisp.jsf syntax/mail.jsf syntax/mason.jsf syntax/pascal.jsf syntax/perl.jsf syntax/php.jsf syntax/python.jsf syntax/sh.jsf syntax/tcl.jsf syntax/tex.jsf syntax/verilog.jsf syntax/vhdl.jsf syntax/xml.jsf .PHONY: termcap # Tell versions [3.59,3.63) of GNU make to not export all variables. # Otherwise a system limit (for SysV at least) may be exceeded. .NOEXPORT: jupp/NEWS010064400000000000000000000717211431513412300074670ustar00$MirOS: contrib/code/jupp/NEWS,v 1.144 2022/09/28 21:10:16 tg Exp $ ------------------------------------------------------------------- jupp-current - … JOE 3.1jupp41 - retroactively change jupp40 NEWS entry to reflect correct crash cause - NUL-initialise a number of allocated items - jupprc: fix bkwdc and fwrdc in the help screen - format messages with more consistency - gracefully handle -mnew/-mold argv macros quitting the editor - autoconf --program-transform-name was never supported - more retro compatibility — HP-UX 9 (m68k) c89(1) - popen portability code: fix commands beginning with plus or dash - update to UCD 15.0.0 JOE 3.1jupp40 - update UCD to fix new Hangul Jamo widths (D7B0‥D7FF) - sh.jsf: update list of ksh “keywords” and sort it - manpage: document indent chars for format/fmtblk (Debian #968926) - HINTS: something | jupp -mold notmod - - improve preformatted jupp32 manpage generation; tweak manpage - do not delete a nĹŤn-generated file on “make clean” - fix crash on Ins/^V or ^O with standalone fortify-headers or on Mac OSX - update SELinux client to current API - fix some Coverity warnings JOE 3.1jupp39 - Highlight HTML/XHTML and XML with content sniffing as well - Improve shell highlighting substitution quoting handling - Update autoconf to fix FTBFS on arm64, ppc64le and riscv64 - Fix SETUP.INF generation, make it run on Windows® 95, and remove old upgrade code; install to PROGRA~1 universally - Work around a GCC on MIPS16 asm generation bug in IDSTRING - Highlight more Tₑχ/Lá´¬TᴇΧ extensions - Shrink built-in jupprc size by dropping specialist command ^KF - Use more consistent header guards - Update to UCD 13.0.0 - Major overhaul of charmap handling - Massive dead parameter and code elimination and warning fixes JOE 3.1jupp38 - fix issues pointed out by Coverity - musl says to not use - fix opening files like +DESC - update autoconf infrastructure JOE 3.1jupp37 - fix syntax highlighting for Assembly and Java™: string termination - unbreak reformat block when raw octets are present - update to UCD 11.0.0 - improve line generation / screen output code wrt. UTF-8 - make UTF-8 decoding more robust - fix Makefile.am EXTRA_DIST - highlight .def and .dtx files as Tₑχ/Lá´¬TᴇΧ, .xsl (XSLT) as XML - handle .bin files as binary (no CRLF, hex editing) - improve shell grammar a little wrt. syntax highlighting - fix occasionally stuck CUA marking (LP#1677671) - do not lose the mark during some macros JOE 3.1jupp36 - fix too-wide prompt for ` command (needs only 73 columns now) - make ^QV/^QP after ^K] work - fix Tₑχ/Lá´¬TᴇΧ highlighting on black-on-white terminals - don’t forcibly disable -highlight for NXC files - fix substitution of paths into generated files JOE 3.1jupp35 - rearrange the jupprc help cards, adding missing items - move isrch from ^[S to ^[T - add/prefer ^QT for delbol - move open from ^[b to ^] - fix massive allocation miscalculation typo - correct sizeof(a?b:c) where b=char[] misread as sizeof(pointer) JOE 3.1jupp33 - Fix several issues pointed out by Coverity Scan * dead code * use-after-free (minor) * uninitialised variables (no relevance) * TOCTOU in DEADJOE writing (major) * nil pointer deref (no to minor relevance) * infinite loop (indeed, but no practical relevance) * failure to restore non-local value (minor, unpractical) * memory leaks (minor) * fd leaks (minor) * some Coverity boilerplate - Constify and clean up code further - Allow *any* char for {to,rv}match (goto next same in given direction) - Fix regression: `` did no longer insert a sole ` (etc.) - Improved shebang and diff recognition of syntax highlighting file types - Render instruction to show online help as BLINKING BOLD so it stands out - Let screen scroll back to the left on ^QL, ^B, ^KD, while in hex mode - Slightly safer saving of backup files, using fsync(2) if existent - Add new command “sync” - (crb3) Add ^QV to jupprc; add WordStar documentation references; (tg) Rename ^[! to ^[' to match ^K'; (crb3) Add ^[@ and ^[! - jupprc: Fix eolmenu; replace bol with home for smarthome users; switch ^[? to show macros (matches WS), query moves to ^[/ (which was unused); ^U can abort menu and prompt (matches WS) - Sync improvements across rc files - Remove obsolete GNU autoconf check JOE 3.1jupp32 - Harmonise help rendering in jupprc (also for 2.8, 3.7, (NEW) 4.4) - Update internationalisation data to Unicode 10.0.0 with bugfixes - Don’t limit JOE_FILENAME - Optionally be NOMMU-safe: use vfork(), disable stuff needing fork() - Let ^K] also remove whitespace at EOF - Major code cleanup and a lot of warning fixes - Improve syntax highlighting (conf, c, all dark blue-using ones) - Don’t use sscanf(3) any more (dietlibc complains about bloat) - Add way to disable use of the FPU (including Math), for klibc - Make assume_color[sic!] actually work - Recognise libncursesw for tgetflag(3); add --disable-terminfo - Add a flag to disable SELinux even if found - Modernise C features to C89 (prototypes!) - Do not crash if inserting text from a macro after cursor moved - With -DSMALL, use 8 KiB less .bss - Do not write duplicate entries, e.g. into filename history - Begin handling some pointer polymorphism more correctly - Plug a few memory leaks JOE 3.1jupp31 - Fix usage issue on Haiku - Make some signal handlers a bit more safe - Remove unused Unicode categorisations (~15K in the binary) - Update internationalisation data to Unicode 10.0.0 - Partial fix for redrawing lines with combining characters - Quell stricter GCC 7 warnings - Fall back to /dev/tty if stdin or stdout is not a tty(4) - Add new command “abendjoe” to exit with errorlevel 1, cf. AbEnd - Introduce “presentation mode”, F6 toggles zoom/fullscreen; F7/F8 go one file (“slide”) back/forth, F9 pipes the entire file (needs rectangle mode disabled) and offers previous command - Fix some ctags operations segfaulting JOE 3.1jupp30 - Fix spelling mistakes, some found by lintian (thanks!) - Silence a GCC 6 warning about content of a comment (WTF‽) - Fix segfault trying to fnext a block-restricted search when no block is active - Make Freedroidz macro (^KF) more reliable, simpler, run parserr - Apply several bugfixes and optimisations to the code - Improve the jupp32 build script - Fix a few places where allocated memory was not properly zero’d out - Unbreak syntax highlighting for nĹŤn-UTF8 locales (tty I/O charmaps) - For systems without setlocale, remove optional @modifier part from LC_ALL/LC_CTYPE/LANG (if present) before testing for valid charmap - Disable setlocale for old cygwin32; use the current codepage instead - Add JOECHARMAP override for locale/codepage-detected I/O charmap - Display codes 128–159 in the CharTable help card properly - Avoid the Win32 console beeping on • by making it non-printable (WTF) - Improve some documentation façets - Add “-CYGhack” command line option; use it in right-click menu (WTF²) - Do not force use of /usr/local in configure on Solaris - Use ~/.jupp/, not ~/.joe/, as basepath for user charmap/syntax files JOE 3.1jupp29 - Update internationalisation data to Unicode 9.0.0 - Bind execmd in jstarrc, so all flavours bind it - Fix paths in joe(1) manpage - jupprc: ^Q= searches for merge conflict markers (CVS, git) - Add syntax file for tex (LaTeX; *.cls *.sty *.tex) - Make syntax highlighting code use UTF-8 by individual octets - ^Q] now also works for ASCII quotation marks (jupp, jstar) - ^Q[ is distinct from ^Q] when ambiguous (jupp, jstar) - Unbreak tab-completing filenames with spaces - Fix filenames with backslashes - configure --enable-sysconfjoesubdir to also get the manual page - Apply fixes from lintian, thank you! - Only look in JOERC/termcap if its path does not include a delimiter - Allow overriding the name of the built-in *jupprc (to *jupp32rc, so the jupp32 build can use the pristine source) - Add win32 self-relocation, no hardcoded JOERC any more, optional (used in the jupp32 portable build but NOT for the Cygwin package!) - Fix generating the manpage, now done by the Makefile JOE 3.1jupp28 - Document to not quote the argument to -backpath nor append a comment - Remove unused code, redundant checks - Replace illegible code with better and more standards-conforming one - Access fix for the serial line speed array - Introduce ^KF (jupprc): compile and download NXC program to NXT brick, for Freedroidz, a project of Teckids e.V. sponsored by tarent solutions GmbH - Better const-cleanliness of code - Quell New File message for scratch buffers - Fix URI in ChangeLog file - Actually build with LFS on GNU/Linux JOE 3.1jupp27 - Update complete internationalisation code and data to Unicode 7.0.0 - Minor fixes to C language syntax highlighting; use it for NXC too - Fix compilation on SuSE Linux 1.0 (portability) - Stop trying to match ed(1) diffs for highlighting (false positives) - Add cp437 encoding JOE 3.1jupp26 - Syntax files are now both parsed and applied on bytes, not characters; matching on Unicode characters is possible using buffer/strings though - Prevent segfault on â€`…’ (out-of-bounds keymap array access) - Fix m{,s}{old,new} operation when opening multiple files from cmdline - Update “visible spaces” while typing and fix it for nĹŤn-UTF8 files - jupprc: No longer wordwrap *.{asc,doc,txt} by default - Add five or six hooks for modification to rc files (Natureshadow’s idea) JOE 3.1jupp25 - Better colouring of diffs; better support for CVS and git - New wcwidth code; aligned with Unicode 6.2.0 - Prevent accidentally freeing an environment string - On SIGWINCH, resize menu to avoid using stale columns information - msg command with empty argument now clears message buffer - New "nop" command - Permit changing keymap for prompt windows - Fix CUA keymap paste mode - Handle xterm bracketed paste for prompt windows - In prompt windows (paste or regular), ^L is now nop (screen refresh) - Honour TMPDIR environment variable (before TEMP) - Sanitise handling of temporary files, somewhat - Fix subprocess (pipe) corruption of data (LP#1198221) JOE 3.1jupp24 - Bugfix for all *rc files: -guess_indent is a global option, not a per-file option; using it as the latter led to spurious whitespace mis-detection, remove them (and make *.{asc,doc}=txt) JOE 3.1jupp23 - Overhaul and harmonise syntax detection and editor defaults across all six *rc files (except jupp continues having no wordwrap by default and now disables guess_indent except in *.txt files); improve shell/mail wildcards; recognise a lot more diff files by pathname or content patterns - Recognise more Python keywords in syntax highlighting (patch contributed by Eike Jesinghaus) - Allow building against bionic libc (for Android) - Securely make backup files using mkstemp(3), thanks Han Boetes - Print math results more precisely; if possible, as integer - Permit hexadecimal input in math expressions - Hook up GOTO “byte” offset command as ^QO, “col”umn as ^Q- and scratch+præfix as ^K- in jupprc - ^KE no longer trashes buffers cloned by ^KO and ^K; needs not split - jupp: ^[# inserts last math equation; ^[= its result - Use ${SHELL:-${EXECSHELL:-/bin/sh}} for all shells and check access - After ^KR, the current position is before and ^QP after the insertion - ^[p and xterm-xfree86 paste mode (automatic in the latter) JOE 3.1jupp22 - Fix ternary operator PHP syntax highlighting hiccup - Fix C string percent handling syntax highlighting hiccup - Use unlimited # of sync lines for Assembly, C, Java™, Perl, Python, Shell, Tcl highlighting, too - Refresh wcwidth code from Unicode 6.1.0 - Check names of built-in files converted to lowercase, for Win9x - Improve recognition of debdiffs and 'bzr diff' output - Sync built-in jupprc with full one (a bit of CUA was added) JOE 3.1jupp21 - Fix use of uninitialised memory - Do not underflow attribute buffer in syntax highlighting code - Use automake version fixing CVE-2012-3386 JOE 3.1jupp20 - Fix mistakes in the ctime replacement code for klibc - Fix mistakes in the configure script - Disable CR-LF mode upon entering hex edit mode - Remove junk from files and improve comments - Configure for Large File Support JOE 3.1jupp19 - Support ncurses tinfo split - Use glibc specific get_current_dir_name if existent and PATH_MAX is undefined (as on Debian GNU/Hurd, for example) instead of a fallback value of 4096 with PATH_MAX-using code - Build with dietlibc (wheezy) or klibc 2.0 now works - Default syntax highlighting sync lines elevated to 120 JOE 3.1jupp18 - Fix displaying ASCII tilde in non-UTF-8 encodings - To not make backups is now the default for all flavours - The jmacs flavour behaves a bit more like the jupp flavour (patch contributed by Johannes Langøy) - In xterm, Shift-{Cur{Up,Down,Left,Right},{,Ctrl-}{Home,End}} now select text (idea contributed by Dmitry Geurkov) - Fix bugs in *rc files; sync joerc and rjoerc with each other - Unbreak passing -keymap on the command line - New keymap "cua" (not jpico, jmacs) for GUI-like ^Z ^X ^C ^V JOE 3.1jupp17 - Skip restoring the terminal after exiting jupp - Improve syntax highlighting for shell - Fix restoring context after losing sync for diff - Improve diff detection JOE 3.1jupp16 - Better match for Python files for *rc (except jupprc, which had it already) - Improve jupprc file; split between three versions (2.8/DOS 3.7/*nix 3.1jupp) - The jupprc file now has a character map (ASCII / 8-bit table) - Clean up some compiler warnings; check for strlcpy/strlcat prototypes JOE 3.1jupp15 - Update COPYING file from MirOS master (refreshed from FSF master) - Refresh wcwidth code from Unicode 6.0.0 XXX maybe use MirBSD libc code for {to,is}wc* too, extended beyond BMP - Better error messages when parsing syntax and rc files - Ignore syntax keywords from joe-3.7 diff.jsf that are not yet implemented - Update strlfun.c with an even more portable variant from MirBSD/kern - Port to Minix 3 by request of Alby - Display help hint in initial status line (unless -nonotice) JOE 3.1jupp14 - Update diff syntax file from joe-current - New option (L)ast in search-and-replace - Backport some bugfixes from joe-current - Let execmd cmd accept macros, not just commands - Let macros cmd escape backslash correctly - Flag --disable-getpwnam to link statically with eglibc - Compiler warning cleanup JOE 3.1jupp12 - Fix compiler warnings - Fix the manpage wrt. UTF-8 hyphen/dash/minus - Add missing headers on some platforms - Add support for Debian libbsd - Add way to disable warnings wrt. Anil Madhavapeddy's bounds checker - Unbreak SELinux support - Fix `x## for 80‥FF in !UTF-8 mode - Use the inverse/underlined U+FFFD for some more occurences of undisplayable (control) characters and incomplete multibyte sequences; fix displaying these at end of line - Ensure C0/C1 control characters are never sent to a UTF-8 terminal, even from !UTF-8 documents - Add built-in (minimal) jupprc file, for standalone EXEs - Backport hex editing mode; improve it, use uppercase - Implement `r## in UTF-8 mode (same as `x## in !UTF-8 mode) and `u (interactive) in !UTF-8 mode (same as `x in UTF-8 mode) - Add new Makefile variable sysconfjoesubdir=/joe (to override the /joe in /etc/joe/jupprc for example) - Update config.guess and config.sub - Provide a real ANSI (cp1252) codepage - Fix build on AIX with xlC, Solaris with SUNWcc JOE 3.1jupp11 - Split into two separate lines of *active* development: * JUPP for DOS (joe 2.8 plus some jupp patches and jupprc) * JUPP for Unix (joe 3.1 with all jupp patches and a diverging, more featureful jupprc than joe 3.1jupp10 had) - Use some joe 3.x features in jupprc: assume_color, guess_crlf, guess_indent, purify, smartbacks; some are disabled by default though (autoindent, smarthome, smarthome+indentfirst) - Enable syntax highlighting by default in jupprc, by popular demand, even if I still loathe it personally, like Rob Pike - Add language/syntax selection into jupprc, with Python settings adhering to the most common coding standards - The termidx binary can now be disabled by a configure option - Manual page symbolic links are installed alongside the manpages JOE 3.1jupp10 - Build fixes for Darwin - Fix: smartbacks could not be used without autoindent JOE 3.1jupp9 - Build fixes for AIX, gcc (thanks Adam "replaced" Hoka), any OEs without mksh installed - Synchronise external files with upstream, licence cleanup - Remove CR (DOS line endings) on ^K] as well in jupprc JOE 3.1jupp8 - Bugfix (maybe) for backspace deleting more than it should when smart backspaces or auto-indent are off - In UTF-8 mode, display illegal characters as reversed (inverse) underlined U+FFFD REPLACEMENT CHARACTER, one per octet (if these form a valid part of an invalid multibyte sequence, the first valid octets are not necessarily individually selectable) - In UTF-8 mode, don't display the decimal ASCII value of a wide character; display the correct UCS-2 hex value (or <-2> for an invalid sequence or the 8-bit hex value of the octet for an invalid octet or invalid one-octet multibyte sequence) instead - Upgrade to latest MirOS licence template JOE 3.1jupp7 - Bugfix in bundled strlcat() implementation - Bugfix (off-by-one array bounds) in from_uni() - New option "vispace" to make spaces and tabs visible, like in Microsoft® Works®. Works best with Unicode. - "noxon" and "baud" are now menu entries; these two and "keepup" have been moved to the top so they can be switched quickly if you're in an ssh situation - Disable funny behaviour of keys in menus, fixes POLS - Reduce memory usage a little - In the options menu, if "return" is hit instead of entering a value, and it is not a string, it's handled sensitively: numbers keep their value, syntax gets unset, and encoding gets reset to the fdefault map. - Nicely format the options menu (as columns); print values for the syntax and encoding options as well in the oversight, use ellipsis for strings which aren't displayed otherwise - Spelling fixes in the options menu - Honour internationalisation framework of MirOS #9-current and newer JOE 3.1jupp6 - No code changes, only documentation and upstream sync JOE 3.1jupp4 - Keyboard fixes in "jupprc" - Add "ESC q" as alias for "^Q" in "jupprc" - Update some files from upstream JOE 3.1jupp3 - Fixed using new GNU Autotools - Updated "jupprc" JOE 3.1jupp2 - Fixed string functions - Added "jupp" flavour - No tab completion in search and replace ask windows - UTF-8 works on LOCALE-less OSses (various BSDs) JOE 3.1 - Regex and incremental search (jmacs ^S) now work for UTF-8 - More and improved syntax highlighting files, including Mason - Use ^T E to set character set of file (hit at the prompt for a list of available character sets). - Can install custom "i18n" style byte oriented character set definition files. - No longer depends on iconv() (easier to compile) - Fix bug where right arrow was not doing right thing on last line - Fix UTF-8 codes between 0x10000 - 0x1FFFF - Now prints for unicode control characters - Improved smart home, indent, etc. - TAB completion is now more "bash"-like - When multiple files are given on command line, they end up in same order on the screen in JOE (before they were shuffled). - Menu size is now variable (40% of window size or smaller if it's not filled). - Added -icase option for case insensitive search by default. - Added -wrap option, which makes searches wrap - Added status line sequence %x: shows current context (function name if you're editing C). - Added tab completion at search prompts and ESC-Enter for tab completion within text windows. - Warn if file changed on save. - Added Ctrl-space block selection method - Added Ctrl-arrow key block selection method - ^K E asks if you want to load original version of the file - jmacs bugs fixes: upperase word, transpose words, ^X ^C is more emacs-like., ^X k and ^X ^V more like emacs. - Much improved compile system ^[ c - Much improved jpico - aspell support. JOE 3.0 (23 APR 2004) - UTF-8 - Syntax highlighting - Fixed ^C and ^D in shell windows - Auto detect CR-LF (MS-DOS) files - Fixed (or improved, anyway) shell windows for Cygwin - During search & replace, the scroll found text on to screen - File selection window is now 4 lines instead of 1 - David Phillips "smart home" key. - Enhanced ^K , and ^K . - Enhanced overtype mode - Added picture drawing mode (can hit right arrow at ends of lines) - Auto detect preferred indentation character TAB or SPACE Overview of changes in JOE 2.9.8 (5 May 2003) - fixed signal handling - return of the context help - fixed segfault when moving rectangular block - code clean up - killed deadlock when reformatting paragraph - fixed skiptop handling - SECURITY: drop suid and sgid bits when creating backup files - fixed segfaults in isalpha()-like functions Overview of changes in JOE 2.9.8-pre1 (14 Dec 2001) - BUGFIX: don't exchange start and end point of the block in some cases - defaulting to turn off -asis (locales take care of this; if joe doesn't print characters with 8th bit set properly, check if you have properly installed and set locales or simply turn on -asis option in joerc) - fix to make joe compilable on *BSD - fix to make joe compilable on systems without siginterrupt() - added "support" for End key - code cleanup: warnings removal (some still remaining, working on it) Overview of changes in JOE 2.9.7 (7 Nov 2001) - BUGFIX: always save (even not-modified) file - BUGFIX: solve problem with freezing after saving unmodified file - small documentation update Overview of Changes in JOE 2.9.7-pre3 (29 Oct 2001) - BUGFIX: wordwrap bug fixed (again and I'm sure forever) - BUGFIX: don't change window when setting mark in multiwindow mode - BUGFIX: use automake-1.5 to make joe compile on irix-6.5 with non-GNU make - continuing code clean up: this code adds strict prototypes which raises a lot of warnings (they seem harmless) - we're working on their removal Overview of Changes in JOE 2.9.7-pre2 (10 Oct 2001) - use automake and autoconf for configuration system (for now versions automake-1.4-p4 and autoconf-2.52) - a lot of warnings of compiler were removed - SECURITY:: use mkstemp() for temporary files if available - code clean up Overview of Changes in JOE 2.9.7pre1 (19 Jul 2001) - help system was slightly modified - a lot of warnings of compiler were removed - BUGFIX:: problem with freezing when save was solved (at least partially) - BUGFIX:: undo after save of file (again same patch) - FEATURE:: suffix of backup copy from SIMPLE_BACKUP_SUFFIX environment variable Overview of Changes in JOE 2.9.7pre0 (02 Jul 2001) - major BUGFIX:: wordwrap problem - BUGFIX:: indentation ??* JOE can be compiled on Windows platform again ??* BUGFIX:: problem with ${sysconfdir}/joerc was solved Overview of Changes in JOE 2.9.6 (13 Apr 2001) - BUGFIX:: resizing window - JOE can be compiled on Windows platform again * BUGFIX:: problem with ${sysconfdir}/joerc was solved - BUGFIX:: security patch for sprintf - BUGFIX:: partially solved problem on Solaris with SegFault - BUGFIX:: patch joe-2.8-security (slightly changed) - BUGFIX:: patch joe-2.8-port - BUGFIX:: patch joe-2.8-mips - BUGFIX:: patch joe-2.8-vsmk - BUGFIX:: patch joe2.8-time - *rc files where moved from $(prefix)/lib to $(prefix)/etc or $sysconfdir - Makefile.in (and Makefile) was rewritten - special prefix for package (more in Makefile.in) - use of system independent 'mkinstalldirs' - rc files are not rewritten - TEST FEATURE:: added autoconf support program can be installed by ./configure; make; make install - BUGFIX (v2.9.4):: go to previous word problem solved - JOE can be compiled without locale.h again - BUGFIX:: patch joe2.8-axphack.patch - BUGFIX:: patch joe2.8-resize2.patch - BUGFIX:: fixed problem with :include in rc files - BUGFIX (v2.9.5):: portability problem with is_blank on nonGNU systems Overview of Changes in JOE 2.9.5 (28 Mar 2001) - new BUG:: can't be compiled on non-GNU systems (is_blank()) fixed in v2.9.6 - BUGFIX:: Fixed problem with resizing. - SECURITY:: .[joe|rjoe|jpico|..]rc in actual directory is ignored because in this file can be defined which program run. Overview of Changes in JOE 2.9.4 (27 Mar 2001) - new BUG:: go to previous word; goes one character before this word fixed in v2.9.6 - FEATURE:: locale (LC_CTYPE) is accepted when skipping/deleting/... words Overview of Changes in JOE 2.9 (22 Mar 2001) - version 2.8 with patches from RedHat/Suse Overview of Changes in JOE 2.8 - Fixed problem with TERMPATH string - Added stupid two-letter names to termcap file - Improved jmacs help and command set - Improved README file Overview of Changes in JOE 2.7 - putenv() was not portable - utime was not portable - special utime handling for NeXT - forgot to \\ the \s in the default termcap entry - changed some key defaults in jpicorc - add IXOFF in termio/termios list - left margin limit was incorrect - allow '.' and '/' in file names for error parsing - Needed ptem.h and stream.h for SCO_UNIX window size structure (?) - wordwrap no longer propogates indent prefix - paragraph format was broken for tab indented paragraphs - pipe through shell now goes through stderr too - added '-crlf' option - looks for termcap file in JOERC/termcap Overview of Changes in JOE 2.6 - Fixed stupid bug in termcap.c which prevented terminfo from working - ESC h was missing from jpicorc - Changes suggested by Dan Nelson: - backup files now attempt to have same permissions and times as original - Stat command now ands chars with 255 (don't know why this worked on my system without this...) - Maybe change shell invocation name- have to check this more Overview of Changes in JOE 2.5 - No longer use ^[ O, ^[ A, ^[ B, ^[ C, or ^[ D for anything because they interfere with arrow keys. - Couldn't create new files because of bug in readonly setting - fwrdc/bkwdc were crashing the editor except when called from wordstar - 'tr' command was not called in a portable way in jmacs - 'tr' was causing problems with the spell-check macros as well - filter region was not working: had to add 'query' in ^[ | macro - Changed incremental search so that whatever key the command is bound to can be used to repeat the search (used to only be able to use ^S) Overview of Changes in JOE 2.4 - Closing message was incorrect when exit macros (macros where the last command is abortbuf) were used. - SuperPico rc file added - Write block now writes the entire file if no block is set - Added pico kill function for pico emulation (tried to do this with 'psh,markk,blkdel' where blkdel deletes lines if no block is set, but it didn't group the deletes right in the yank buffer) - Filter block would leave the marks set - Fixed ^@ in joe mode - Fixed help screen glitches in wordstar mode - If joe can't make a backup file it now prompts for you to save anyway - Eliminated IDLEOUT compile option. Now is the user gives - on the command line, joe uses /dev/tty. - Added %o %O %a %A %X and %R status line messages - Starts out in read only mode if loaded file can not be written to - If joe can't find the termcap/terminfo entry, it instead uses the default - termcap routines are now included even if you use terminfo. If your terminal can't be found in the terminfo database, it will look in the termcap database too. - The JOETERM environment variable can be used to bypass the TERM environment variable setting. Overview of Changes in JOE 2.3 - Search & Replace bugs fixed - replace would mess up the end mark of a marked block - a search would trash ^KB if only ^KB was set - regex problem with \* - Was using TCSANOW in posix driver. Should have been using TCSADRAIN - Format paragraph now correctly formats quoted news articles - Attempted fix for SCO - Fix for coherent - Fix for old IRIX/SGI - Fixed bug where if you used search & replace in a macro, and exiting the search & replace loop with right arrow key, then when you played the macro you got an extra ^[ in the input queue - Added file hooks - Added function to insert current keyboard macro into current file - Added range checks to numeric option settings - Restricted joe rc file added - Added ':def' feature for rc files Overview of Changes in JOE 2.2 - First attempt at MS-DOS version of joe - Direct screen write - Modifications for dos file/drive names - Use TEMP variable to figure out where to store temporary file - Smaller virtual memory page size - Backslashes in file name problem - CR before an LF looks like an LF - Backward search ignore-case was not working - Scalable window height was not working fully - Spaces in file-names gave a problem with backup file creation - TILDE option is not available in all versions of BSD - Allow : as seperate for termcap filename list - Next error / Prev. error was not tracking right - tabs not displayed right in nxterr/prverr messages - Block moves where the cursor was to the right of the block was broken Overview of Changes in JOE 2.1 - rc file wasn't giving correct error messages for missing options - the '-nobackups' options was mispelled: '- nobackups' - editor was crashing because of problem in undo - update bypass in utype has a problem when wordwrapping and scrolling jupp/README010064400000000000000000000354761406177676400077040ustar00This is Joe's Own Editor. See the INFO file if you don't know what this is. Well actually, this is jupp, Programmers' Editor, the Editor which sucks less. It's got a Launchpad page, too: https://launchpad.net/jupp Although, you’re encouraged to ask stuff on IRC in #MirBSD on irc.mirbsd.org (Port 6697 SSL, 6667 insecure) or on the miros-discuss public mailing list, see http://www.mirbsd.org/rss.htm#lists for details. =-=-=-=-=-=-=-=-=-=-=-= Installation procedure =-=-=-=-=-=-=-=-=-=-=-= Joe uses automake and autoconf suites to build itself. Type: ./configure make At this point you can try JOE without fully installing it by typing "./joe". However, you need to copy a few files into your home directory first: # This is required for JOE to start: cp joerc ~/.joerc # The following are needed if you want syntax highlighting to work: mkdir ~/.jupp mkdir ~/.jupp/syntax cp syntax/*.jsf ~/.jupp/syntax/ Otherwise you need to do a real install, which generally requires root privileges: su root make install This will copy the executables to /usr/local/bin and runtime files to /usr/local/etc. After installation, you can then try it by typing "joe". =-=-=-=-=-=-=-=-=-=-=-= Verify the installation =-=-=-=-=-=-=-=-=-=-=-= A number of features should be tested: Shell windows: -------------- Please test the installation by trying the shell command: ^K ' A shell prompt should appear in the window and you should be able to type "ls". If not, two things could be broken: JOE could not open a pseudo terminal (pty), which is unfortunately one of the two most incompatible parts of the UNIX API. Take a look at tty.c- there are several methods for opening the pty: mess with the "#ifdefs" until you find a method which works (and send a bug report for your operating system). The SHELL environment variable is not set or exported (Cygwin has this problem). Put: export SHELL=/bin/mksh or setenv SHELL /bin/csh In you .profile or .cshrc file and send mail to the Cygwin mailing list so that they fix this problem. Process groups: --------------- Once you have a shell window open, try to suspend JOE: ^K Z. Then resume it: "fg". The shell window should still be active. If not, your operating system is not handling process groups properly. Look for the setsid() or setprgp() system calls in tty.c (this is the other most incompatible part of the UNIX API). Currently process groups appear to be broken in Cygwin (so if you suspend JOE, any shells get killed). Resize windows: --------------- Try resizing the terminal emulator window: JOE should resize itself to properly fit. If this doesn't work, either ttgtsz() (in tty.c) is not reading the size properly, or the SIGWINCH signal is not being received by JOE (the handler is winchd() in tty.c). JOE requires a certain minimum window size, which differs between the functions needing it. Do not complain if your window is *much* too small. Baud rate: ---------- JOE cares about the baud rate as reported by "stty": 38400 or above: Joe does not issue scrolling commands 9600 - 19200: Joe issues scrolling commands, but does not delay. 0 - 4800: Joe defeats output buffering by sleeping after every chunk of data is sent to the screen, by the amount of time that the data should take to get there as determined by the baud rate. This allows typeahead to interrupt the screen update process: If you hit Page Down 100 times, only the final contents of the screen get sent to the terminal, otherwise you have to wait for all 100 pages to get to the screen before you can do anything. Sleeping should really be used at 9600 baud, but too many systems use 9600 as the default speed for terminal emulators. If you are using a real serial link to a real terminal, you may want to adjust these thresholds: search for "9600" in tty.c. Padding: -------- Ideally either terminals can keep up with the baud rate or they backpressure the computer using hardware flow control (RTS and CTS pins on RS-232 connector). If not, there are two options, both bad: Use XON/XOFF (^S/^Q) flow control: this works, but ^S causes the screen to freeze, which freaks out new users, plus ^S is the search key in "jmacs". Use padding: the termcap database indicates how long each command should take. If padding is enabled, JOE will send enough NUL characters after each command to account for this time. You need set the DOPADDING environment variable or use the -dopadding option. You should just buy a modern terminal :-) =-=-=-=-=-=-=-=-=-=-=-=-=- Common ./configure options =-=-=-=-=-=-=-=-=-=-=-=-=- Here are some common ./configure options: To have "make intall" install JOE into your home directory: ./configure --prefix=$HOME The executables will end up in $HOME/bin and the runtime files will end up in $HOME/etc. You need to have $HOME/bin in your path for this to work. For other install options: ./configure --help To force JOE to use /etc/termcap file using its built-in termcap file parser (which is useful if you want to compile JOE so that it doesn't depend on any libraries other than libc): ./configure --disable-curses --disable-termcap (--disable-termcap prevents JOE from using the termcap emulation functions in the -ltermcap library. --disable-curses prevents JOE from using the termcap emulation functions in the -lcurses library). Otherwise, JOE tries to use the terminfo database via termcap emulation routines: see man tgetent, tgetstr, tgoto, etc. (JOE has its own implementation of "curses", so curses is not required except to get access to the terminfo database). Note that even if you don't have an /etc/termcap file, JOE will run: it will assume that the terminal is "ANSI" (but you need to compile it this way for it to be able to use the builtin ANSI termcap entry). =-=-= Usage =-=-= USAGE: joe filename [filename ...] Optionally precede each filename with +nnn to start at specified line number. Options: -mid Cursor is recentered when scrolling is necessary -marking Text between ^KB and cursor is highlighted (use with -lightoff) -asis Characters 128 - 255 shown as-is -force Force final newline when files are saved -nobackups If you don't want backup files to be created -lightoff Turn off highlighting after block copy or move -exask ^KX always confirms file name -beep Beep on errors and when cursor goes past extremes -nosta Disable top-most status line -keepup %k and %c status line escape sequences updated frequently -pg nnn No. lines to keep for PgUp/PgDn -csmode ^KF after a previous search does a ^L instead -backpath path Directory to store backup files -nonotice Disable copyright notice -noxon Attempt to turn off ^S/^Q processing -orphan Put extra files given on command line in orphaned buffers instead of in windows -dopadding Output pad characters (for when there is no tty handshaking) -lines nnn Set no. screen lines -baud nnn Set baud rate for terminal optimizations -columns nnn Set no. screen columns -help Start with help on -skiptop nnn Don't use top nnn lines of the screen Options before each file name: -wordwrap Wordwrap -autoindent Auto indent -overwrite Overtype mode -lmargin nnn Left margin -rmargin nnn Right margin -tab nnn Tab width -indentc nnn Indentation character (32 for space, 9 for tab) -istep nnn Number of indentation columns -french One space after '.', '?' and '!' for wordwrap and paragraph reformat instead of two. Joe does not change the spacing you give, but sometimes it must put spacing in itself. This selects how much is inserted. -spaces TAB inserts spaces instead of tabs. -linums Enable line numbers on each line -rdonly File is read-only -crlf File is uses CR-LF at ends of lines (MS-DOS files) These options can also be set in the joerc file. The NOXON, LINES, COLUMNS, DOPADDING and BAUD options can also be set with environment variables. The rc files shipped except jupprc also contain documentation and examples for the options. The JOETERM environment variable can be set to override the TERM environment variable. ** IMPORTANT ** The baud rate must be correctly set or either typeahead will not interrupt the screen update and scrolling wont be used or there will be annoying delays in the screen update. If you can't set the baud rate correctly with 'stty', give a numeric value in the environment variable 'BAUD' or to the command line options '-baud'. The baud rate '38400' or 'extb' means infinite to joe. Use it for X windows and hardware console ttys. No delays will be generated and scrolling will not be used. The baud rate '19200' or 'exta' means that joe will use scrolling, but will not delay. Use the LINES and COLUMNS environment variables or the -lines and -columns command line options if you need the terminal size to be different than whatever the termcap entry or stty reports. Since most people use terminal emulators, JOE does not send out pad characters. If you're using a real terminal and the padding matters, set the environment variable DOPADDING or give the command line option -dopadding. If you want joe to try to disable ^S/^Q processing, set the environment variable NOXON or command line option -noxon. A termcap file is included with JOE. You might consider updating your own termcap file with the entries in it, particularly if you use ANSI/VT100ish terminals. JOE understands some capabilities which are not usually supplied in normal termcap (see below). VARIATIONS =-=-=-=-=- Termcap/Terminfo =-=-=-=-=-=-=-=- JOE prefers to use the termcap terminal capability database. It attempts to find this file in: $HOME/.termcap Personal .termcap in your home directory /usr/local/lib/termcap Joe's termcap file /etc/termcap Normal system termcap file Joe copies its own termcap file to /usr/local/lib/termcap (or wherever the system-wide joerc file is going to go) when 'make install' is run. Termcap is better than terminfo because it is a more open standard. Programs can directly access the termcap database and future versions of terminfo may require programs to use curses. The only argument in terminfo's favour is that it is faster than termcap. To fix this problem, JOE will use a termcap index file if it exists and if it is up to date. This is the procedure to make the termcap index file: make termidx ./termidx /etc/termcap.idx The /etc/termcap.idx is a text file which you can look at if you're curious. JOE supports the GNU extensions to the termcap language and also understands several new capabilities: AL DL IC DC RI LE UP DO SF SR Versions of the standard capabilities which accept an argument. For example, RI with and argument of 7 should move the cursor 7 positions to the right. rr Set this flag if the cursor is restricted to move only within the scrolling regions. This is an optional mode on vt220s and several clones assume that this mode is always on. cV Like the 'cv' capability, but the cursor goes to the beginning of the specified line. Like 'ESC [ n H' in ansi/vt100. JPICO =-=-= If you want JPICO to act more like real pico when you hit ^X (I.E., to have it ask before saving), change the line: exsave ^X Exit to: ask,query,lose,query,abortbuf ^X Exit BROKEN TERMINALS =-=-=-=-=-=-=-=- "Joe does not update the screen correctly in Procomm" "My Xenix console does not scroll correctly" Old versions of Procomm, many other DOS comm programs and nearly every PC-UNIX console (with the exception of Linux) does not emulate VT100s properly. There are usually one or more problems: 1) Tabs are destructive 2) Tabs are destructive when inverse mode is set 3) Scrolling regions are not supported 4) Cursor positioning is scrolling region relative instead of screen relative. 5) Some other program set the tab-stops to something other than one tab stop every 8 columns. 6) The erase commands (ESC [ J and ESC [ K) fill with inverse video blanks instead of plain blanks when inverse mode is set. 7) Backspace is destructive Procomm 2.3 works fine- but make sure you have DEC VT100 selected, not 'ANSI BBS' and also that backspace (BS) is set to 'non-destructive'. If you must use an old version of Procomm, try using the 'ansisys' or 'nansisys' termcap entry. Unix consoles usually do not have scrolling regions, but instead have insert and delete line commands. The 'fansi' entry and ones derived from it will work correctly. These termcap entries are provided in the termcap file which came with joe. If at all possible have your sysadmin install these entries in '/etc/termcap'. Even if your system normally uses the terminfo database, you can copy Joe's termcap file into /etc/termcap. "I don't have root access and can't update the system's termcap file. How do I get only Joe to use a different termcap entry?" "My system uses terminfo. How do I get only Joe to use a different termcap entry?" What you should do is copy the termcap file which is provided with joe into '.termcap' of your home directory. Now suppose you want Joe to use the 'fansi' termcap entry: If you use csh or tcsh, place this in your .cshrc file: setenv JOETERM fansi If you use mksh, ksh, sh or GNU bash, place this in your .profile file: JOETERM=fansi; export JOETERM "I don't have root access and can't update the system's termcap file. How do I get all of my programs to use one of Joe's termcap entries?" Again, copy termcap into '.termcap' in your home directory, but set the environment variables like this: setenv TERMCAP $HOME/.termcap setenv TERM fansi "My system uses terminfo... how do I get all of my programs to use one of Joe's termcap entries?" First, compile joe for terminfo. You then have to 'tic' the terminfo version of joe's termcap file into your account. These are the commands for doing this: 1) cd 2) mkdir .info 3) setenv TERMINFO $HOME/.info (or TERMINFO=$HOME/.info; export TERMINFO if you use mksh, ksh, sh or GNU bash) 4) tic joe/terminfo Then put the 'setenv TERMINFO $HOME/.info' line into your .login file or 'TERMINFO=$HOME/.info; export TERMINFO' in your .profile. Now all of your programs should look up the 'TERM' in your own personal terminfo database. USING JOE IN A SHELL SCRIPT =-=-=-=-=-=-=-=-=-=-=-=-=-= Joe used to use /dev/tty to access the terminal. This caused a problem with idle-session killers (they would kill joe because the real tty device was not being accessed for a long time), so now joe only uses /dev/tty if you need to pipe a file into joe, as in: echo "hi" | joe - If you want to use joe in a shell script which has its stdin/stdout redirected, but you don't need to do 'joe -', you should simply redirect joe's stdin/stdout to /dev/tty: joe filename /dev/tty ___________________________________________________________________ $MirOS: contrib/code/jupp/README,v 1.9 2021/06/15 01:09:45 tg Exp $ jupp/TODO010064400000000000000000000335231404164533600074670ustar00F-keys: F1 F2 F3 F4 F5 F6 F7 F8 F9 F10 F11 F12 MirBSD console ^[[11~^[[12~^[[13~^[[14~^[[15~ ^[[17~ ^[[18~ ^[[19~^[[20~^[[21~^[[23~^[[24~ also “ssh 3.2”, PuTTY, rxvt below xterm ^[OP ^[OQ ^[OR ^[OS ^[[15~ ^[[17~ ^[[18~ ^[[19~^[[20~^[[21~^[[23~^[[24~ also cygwin abusch, st izabera gnome-t. below - ^[OQ ^[OR ^[OS ^[[15~~^[[17~~^[[18~~^[[19~^[[20~ - ^[[23~^[[24~ konsole ^[OP ^[OQ ^[OR ^[OS ^[[15~ ^[[17~ ^[[18~ ^[[19~^[[20~^[[21~ - ^[[24~ also yakuake linux console ^[[[A ^[[[B ^[[[C ^[[[D ^[[[E ^[[17~ ^[[18~ ^[[19~^[[20~^[[21~^[[23~^[[24~ also cygwin console below Do something with these keys: ------- ssh 3.2 ------- Arrow:     Home: [2~ (uhg!) End: [4~ Pgup: [5~ Pgdn: [6~ Ins: [2~ Del:  Ctrl-arrow: - Alt-arrow: - (can set Alt=ESC mode, but doesn't work with arrow keys) Shift-arrow: - ----- PuTTY ----- Arrow:     Home: [1~ End: [4~ Pgup: [5~ Pgdn: [6~ Ins: [2~ Del: [3~ Ctrl-arrow: OC OD OA OB Ctrl-home: - Ctrl-end: - Ctrl-pgup: putty scroll back Ctrl-pgdn: putty scroll fwrd Ctrl-ins: - Ctrl-del: - Alt-arrow:     Alt-pgup: [5~ Alt-pgdn: [6~ Alt-home: [1~ Alt-end: [4~ Alt-ins: [2~ Alt-del: [3~ Shift-arrow:     Shift-home: [1~ Shift-end: [4~ Shift-pgup: putty scroll back Shift-pgdn: putty scroll fwrd Shift-ins:  Shift-del: [3~ ----- XTerm ----- Arrow:     Home:  End:  PgUp: [5~ PgDn: [6~ Ins: [2~ Del: [3~ Ctrl-arrow:     Ctrl-home:  Ctrl-end:  Ctrl-pgup: [5;5~ Ctrl-pgdn: [6;5~ Ctrl-ins: [2;5~ Ctrl-del: [3;5~ Shift-arrow:     Shift-home:  Shift-end:  Shift-pgup: - Shift-pgdn: - Shift-ins *DOES NOT WORK* but inserts the X PRIMARY SELECTION Shift-del: [3;2~ Shift-ctrl-arrow:     Alt-ctrl-arrow:     Alt-shift-arrow:     Alt-shift-ctrl-arrow:     Alt-arrow:     Alt-home:  Alt-end:  Alt-pgup: [5;3~ Alt-pgdn: [6;3~ Alt-ins: [2;3~ Alt-del: [3;3~ ---- rxvt ---- Arrow:     Home: [7~ End: [8~ Pgup: [5~ Pgdn: [6~ Ins: [2~ Del: [3~ Ctrl-arrow: Oc Od Oa Ob Ctrl-home: [7^ Ctrl-end: [8^ Ctrl-pgup: [5^ Ctrl-pgdn: [6^ Ctrl-ins: [2^ Ctrl-del: [3^ Shift-arrow:     Shift-ctrl-arrow:     Alt-ctrl-arrow: Oc Od Oa Ob Alt-shift-arrow:     Alt-arrow:     -------------- gnome-terminal -------------- Arrows:     Home: OH End: OF PgUp: [5~ PgDn: [6~ Ins: [2~ Del: [3~ Ctrl-arrow:     Ctrl-home: OH Ctrl-end: OF Ctrl-pgup: - Ctrl-pgdn: - Ctrl-ins: [2;5~ Ctrl-del: [3;5~ Shift-arrows:     Shift-home: - Shift-end: - Shift-pgup: - Shift-pgdn: - Shift-ins: - Shift-del: [3;2~ Alt-arrows:     Alt-home: OH Alt-end: OF Alt-PgUp: [5;3~ Alt-PgDn: [6;3~ Alt-Insert: [2;3~ Alt-Delete: [3;3~ Ctrl-Alt-arrows: - (window manager takes) Ctrl-Shift-arrows:     Ctrl-Shift-Alt-arrows:     ------- konsole ------- Arrows:     Home:  End:  PgUp: [5~ PgDn: [6~ Ins: [2~ Del: [3~ Ctrl-arrows:     Ctrl-home:  Ctrl-end:  Ctrl-PgUp: [5~ Ctrl-PgDn: [6~ Ctrl-ins: [2~ Ctrl-del: [3~ Shift-arrows: - Shift-home:  Shift-end:  Shift-PgUp: - Shift-PgDn: - Shift-Ins: - Shift-Del: [3;2~ Alt-arrows:     Alt-home:  Alt-end:  Alt-PgUp: [5~ Alt-PgDn: [6~ Alt-Ins: [2~ Alt-Del: [3~ ------------- linux console ------------- Arrows:     Home: [1~ End: [4~ PgUp: [5~ PgDn: [6~ Ins: [2~ Del: [3~ Ctrl-arrows:     Ctrl-home: [1~ Ctrl-end: [4~ Ctrl-pgup: [5~ Ctrl-pgdn: [6~ Ctrl-ins: [2~ Ctrl-del: [3~ Shift-arrows:  Shift-home: [1~ Alt-arrows: - (switches console) Alt-home: [1~ -------------- cygwin console -------------- Arrows:     Home: [1~ End: [4~ PgUp: [5~ PgDn: [6~ Ins: [2~ Del: [3~ Ctrl-arrows: - Shift-arrows: - Alt-anything: prefixed with ESC ----------------------- jstar missing sequences ----------------------- ^O options (supposed to be set tab width) ^P print ^U undo (supossed to be unerase) ^^ autoindent on/off ^\ meta (supposed to be refresh screen) ESC $ insert math result money formatted ESC m Memorandum ESC s isearch fwrd (supposed to be Sincerely) ESC c compile (supposed to be center line) — actually ^OC but ncih… ^Q U align paragraph (don't know what this does) ^Q ^Q repeat next command once every second ^Q O spell check entered word ^Q W scroll up- repeat once every second ^Q Z scroll down- repeat once every second ^Q Ins it does something... ^Q Home scroll up repeating ^Q End scroll down repeating ^K M math ^K F run dos comment ^K N column mode on ^K I column replace mode on ^K O copy file ^K E rename file ^K J erase file ^K L change drive ^K uparw rename file ^K dnarw save and exit ^K ltarw save ^K rtarw ^K D save ^K Ins move ^K Home quit ^K End quit ^K ' to markk ----------------------- ----------------- notepad/cua mode? ----------------- ^A select all ^F find ^G goto line ^H replace ^J return ^N new blank file ^O edit file (asks to save current) ^P print ^S save ^V paste (done) ^Z undo (done) ^X cut (done) ^C copy (done) F3 find next F5 date/time - shell window intercept should be smarter. hit ^K ^H- the ^H is going to the shell window. - do not use ^[^[ for anything. it prevents Alt-arrow from being useful. - search should automatically use 'k' mode if block is selected. Cursor should jump to top of block when done. Jump back to start mode? - save all files without asking thing for quick compile - better parsing of compile messages - continued search mode for jpico? - smarter highlighter- need char and string storage. - make ^K F prompt with previous text (PICO)? ^K X leads to segfault? if I use ^K C to move search string into search prompt, it says not found even though it found it. options are screwed up: we copy window to buffer (to get buffer options to the buffer). But if we have multiple windows, buffer options will have stale data. we are missing many query and prompt window abort handlers, which cause small memory leaks. - update help screens: some things have changed (emacs is more like emacs). Fix for next release highlight: other windows why lose state during page down? perl highlighter more syntax files byte to byte conversions? UTF-8 decoder right at input instead of in qw and utype? Update man page. Reload modified files (or current window) don't use -notite by default. (why? we switched back to -notite…) Watch loaded file for changes Save all history buffers and keyboard macros in ~/.joe_state file? Although, if merged, it must be disabled by default like mksh’s HISTFILE is: 18:48⎜«asarch» That would be for a wish list then: to keep the ⎜ list of all opened files with their last position Natureshadow agrees with me that this is a JOE antifeature but then desires the file directory path history Update documentation. shift/alt/ctrl arrow key stuff. (partially done) regex: character classes? a-z matches any letter? parse *rc file only once? different symbol for 'joe' directory can't load terminfo- should switch to termcap or provide compiled ANSI terminfo built in. New features: ----------------------- check all instances of 'chars': use UCS to locale symbols instead. EBCDIC ? - we assume '\n' is line terminator. - there are many references to '\t' and ' '. - EBCDIC used to be fixed record length (80 columns) anyway. Math: octal(?), more functions. (-lm?) Perl compatible regex search. (Ugh. But grouping like \+\(foo\+ \) would be cool.) (Also, alternatives and/or backreferences, think ^Q=) Improvements for regular text ----------------------------- mode where wordwrap wraps rest of paragraph? mode where all editing wraps rest of paragraph? soft wrap (i.e. wrap on screen but not in the file)! Improvements for programming ---------------------------- Jump to definition (tags does this) Show list of references Diff mode (need vertical window) Tie in with CVS Refactoring Syntax Highlighting: -------------------- Bugs: - ksh: ((# … )) is highlighted as comment [probably rather hard, ( is solo] Support for more languages: Paragraph reformat mode for TeX files. ^G Matching for verilog begin ... end, html tags, etc. Reformat paragraph should reformat C function if we're editing C. File loading/storing: Should have switch buffers in current window as more fundamental joe key sequence (it's ^[ u and ^[ v for now). Unnamed buffers should be in bufed list (was fixed in the lost joe 2.9) Jmacs/Jstar/Jpico: search and replace 'fred' to 'foo': find 'Fred', gets 'Foo'. Rectangle mode for emacs yank system Overtype mode works for yank ESC args should work differently in emacs many negative args do not work properly exiting options and i-search with ESC is not pretty (it isn't in emacs either) Shell windows: Better environment settings for shell windows. Documentation: Include documentation for joe hackers. I wrote a lot of this some time, I need to find it. joe should open tty earlier in startup sequence because ^Y is suspend character on sun. UTF-8/Internationalization -------------------------- - right-left mode for Hebrew/Arabic? There is no good way to do this. For all rtol, you could use a reversed xterm. For mixed, you need tags to indicate direction. UI for changing colors in the editor (or at least dark/light mode) More colors: UI for using 256 color xterms. Lock files being edited? one person gets write lock Don't understand: optionally break hardlinks on save? what is "tla"? Use memory mapped files to fast load large files. Have to not count no. lines in each buffer on startup. Emulate other editors? Brief, EDT? Prompts: Sort should be column wise, not row wise? HTML-style thing for option selection? Terminal handling: Emit ESC c to reset terminal on startup? -> no, this power-cycles a hardware DEC VT420 (takes 1-2 minutes) Look into clearing right-most column. Macros: Interactive macros during file load are broken. Think about multiple stack hack (otherwise template based C++ callbacks). Mouse: ` and autoindent mode are a problem for drag and drop. any way we can distinguish normal typing from a drop? xterm can actually do that: it's called bracketed paste mode: you send ^[ [ ? 2 0 0 4 h then any pastes you receive begin with ^[ [ 2 0 0 ~ and end with ^[ [ 2 0 1 ~ until you send ^[ [ ? 2 0 0 4 l but it only works with recent xterm and, while you can wrap the requests between ^[ P and ^[ \ to make them pass GNU screen it would wreck havoc with the other tabs, so we make this conditional on $TERM being xterm-xfree86 offering a generic paste mode in addition via :paste keymap mouse mode: mouse can position cursor. Would be good for jcua... Major new modes: Fixed record length mode Major code improvements: Vertical windows (optionally lock-stepped). Major new features: Folding Options Fix it so all options appear in ^T. Maybe make hook function to handle major changes. Need this for major mode change for hex edit mode. Other requests: -show no. utf characters, not no. bytes (if so, both need to be available) ┌───────────┠│ jupp TODO │ └───────────┠• replace all int with size_t where applicable • default utf8.c:locale_map to utf-8 when applicable (configure-time option perhaps? Android definitely, Cygwin definitely not…) • merge syntax handling code from joe-3.7+ • merge math from joe-3.7+ • write a jupp(1) mdoc page • use mirkev (better code for hashtables) • attach labels to ftypes; allow ftypes to inherit from these labels, instead of fdefault; add UI to apply an ftype, including fdefault, to the current buffer (requested by Wayne Cuddy) • regex needs groups like 「\+\(foo\)」 • regex needs alternative modes (POSIX BRE, ERE; PCRE optional?) because of the \0 vs. \1 confusion (and WTF @ \N letters!) • ^KE could offer the last directory from a file that was saved with a / somewhere (file_prompt in joe 4.4 wmkpw) • bracketed paste mode should disable autoindent, wordwrap, updating the status line, …(?) ⇠implemented using a “paste” labeled ftype (including using not the help cards for indication) • switch from autoconf to mirtoconf2 • ANSI syntax highlighting; auto-turn it on in shell windows (‽) ⇒ would need to hide the ANSI chars, yet enable backspacing • redraw a line if it has been scrolled and had combining characters in it before — actually, scrap that; make that: handle combining characters, *at all* (in the scrn array) • add a soft line break flag: display as line-wrapped, do not save any newlines introduced by that • perhaps wrap at U+00AD? • have an mdoc(7) page actually describing its keybindings • put all “configuration” into /usr/share/ and have them (all, not just *rc) overridable from the user’s home; use XDG dirs while at it maybe? and replace autoconf with mirtoconf, and use serial numbers for versions (jupp-26 follows joe-3.1jupp25) • do charset conversion and support more charsets, both SBCS and UCS (UTF-{16,32}{BE,LE} for example) sponsored by ⮡ tarent • plug memory leaks (Valgrind reports a few) • fix Coverity-pointed-out issues • fixup some joe4.4 jupprc ftypes • proper include, so ~/.jXXrc files can be half a dozen lines • nested syntax highlighting states, with pop to go up • merge neat tricks from website with HINTS, Ă  la mksh.faq • … __________________________________________________________________ $MirOS: contrib/code/jupp/TODO,v 1.55 2021/04/26 23:20:35 tg Exp $ jupp/acinclude.m4010064400000000000000000000041451323447653600111750ustar00dnl $MirOS: contrib/code/jupp/acinclude.m4,v 1.4 2018/02/01 02:36:51 tg Exp $ dnl ------------------ dnl Check if setpgrp must have two arguments dnl autoconf-own macro is damaged for *BSD systems dnl ------------------ AC_DEFUN([joe_SETPGRP], [AC_CACHE_CHECK([whether setpgrp() takes no arguments], [joe_cv_setpgrp_void], [AC_TRY_RUN([ #if HAVE_UNISTD_H #include #endif int main() { /* exit succesfully if setpgrp() takes two args (*BSD systems) */ exit(setpgrp(0, 0) != 0); }], [joe_cv_setpgrp_void=no], [joe_cv_setpgrp_void=yes], [joe_cv_setpgrp_void=yes]) ]) if test "$joe_cv_setpgrp_void" = yes; then AC_DEFINE([SETPGRP_VOID], 1, [Define if setpgrp() takes no arguments]) fi ]) dnl ------------------ dnl Check to see if signal handlers must be reinstalled when invoked dnl ------------------ AC_DEFUN([joe_REINSTALL_SIGHANDLERS], [AC_CACHE_CHECK([whether sighandlers must be reinstalled], [joe_cv_reinstall_sighandlers], [AC_TRY_RUN([ #if HAVE_UNISTD_H #include #endif #if HAVE_SIGNAL_H #include #endif #ifndef HAVE_SIGHANDLER_T typedef RETSIGTYPE (*sighandler_t)(int); #endif int nsigint; void set_signal(int signum, sighandler_t handler) { #if HAVE_SIGACTION struct sigaction sact; sact.sa_handler = handler; sact.sa_flags = 0; sigemptyset(&sact.sa_mask); sigaction(signum, &sact, NULL); #elif HAVE_SIGVEC struct sigvec svec; svec.sv_handler = handler; svec.sv_flags = 0; sigemptyset(&svec.sv_mask); sigvec(signum, &svec, NULL); #else signal(signum, handler); #endif } RETSIGTYPE sigint(int s) { nsigint++; } int main() { nsigint = 0; set_signal(SIGINT, sigint); kill((int)getpid(), SIGINT); kill((int)getpid(), SIGINT); /* exit succesfully if don't have to reinstall sighandler when invoked */ exit(nsigint != 2); }], [joe_cv_reinstall_sighandlers=no], [joe_cv_reinstall_sighandlers=yes], [joe_cv_reinstall_sighandlers=yes]) ]) if test "$joe_cv_reinstall_sighandlers" = yes; then AC_DEFINE([NEED_TO_REINSTALL_SIGNAL], 1, [Define if we have to reinstall signal handler when invoked]) fi ]) jupp/aclocal.m4010064400000000000000000000775041314214452600106420ustar00# generated automatically by aclocal 1.9.6-MirPorts-6 -*- Autoconf -*- # Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004, # 2005 Free Software Foundation, Inc. # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY, to the extent permitted by law; without # even the implied warranty of MERCHANTABILITY or FITNESS FOR A # PARTICULAR PURPOSE. # Copyright (C) 2002, 2003, 2005 Free Software Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # AM_AUTOMAKE_VERSION(VERSION) # ---------------------------- # Automake X.Y traces this macro to ensure aclocal.m4 has been # generated from the m4 files accompanying Automake X.Y. AC_DEFUN([AM_AUTOMAKE_VERSION], [am__api_version="1.9"]) # AM_SET_CURRENT_AUTOMAKE_VERSION # ------------------------------- # Call AM_AUTOMAKE_VERSION so it can be traced. # This function is AC_REQUIREd by AC_INIT_AUTOMAKE. AC_DEFUN([AM_SET_CURRENT_AUTOMAKE_VERSION], [AM_AUTOMAKE_VERSION([1.9.6])]) # AM_AUX_DIR_EXPAND -*- Autoconf -*- # Copyright (C) 2001, 2003, 2005 Free Software Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # For projects using AC_CONFIG_AUX_DIR([foo]), Autoconf sets # $ac_aux_dir to `$srcdir/foo'. In other projects, it is set to # `$srcdir', `$srcdir/..', or `$srcdir/../..'. # # Of course, Automake must honor this variable whenever it calls a # tool from the auxiliary directory. The problem is that $srcdir (and # therefore $ac_aux_dir as well) can be either absolute or relative, # depending on how configure is run. This is pretty annoying, since # it makes $ac_aux_dir quite unusable in subdirectories: in the top # source directory, any form will work fine, but in subdirectories a # relative path needs to be adjusted first. # # $ac_aux_dir/missing # fails when called from a subdirectory if $ac_aux_dir is relative # $top_srcdir/$ac_aux_dir/missing # fails if $ac_aux_dir is absolute, # fails when called from a subdirectory in a VPATH build with # a relative $ac_aux_dir # # The reason of the latter failure is that $top_srcdir and $ac_aux_dir # are both prefixed by $srcdir. In an in-source build this is usually # harmless because $srcdir is `.', but things will broke when you # start a VPATH build or use an absolute $srcdir. # # So we could use something similar to $top_srcdir/$ac_aux_dir/missing, # iff we strip the leading $srcdir from $ac_aux_dir. That would be: # am_aux_dir='\$(top_srcdir)/'`expr "$ac_aux_dir" : "$srcdir//*\(.*\)"` # and then we would define $MISSING as # MISSING="\${SHELL} $am_aux_dir/missing" # This will work as long as MISSING is not called from configure, because # unfortunately $(top_srcdir) has no meaning in configure. # However there are other variables, like CC, which are often used in # configure, and could therefore not use this "fixed" $ac_aux_dir. # # Another solution, used here, is to always expand $ac_aux_dir to an # absolute PATH. The drawback is that using absolute paths prevent a # configured tree to be moved without reconfiguration. AC_DEFUN([AM_AUX_DIR_EXPAND], [dnl Rely on autoconf to set up CDPATH properly. AC_PREREQ([2.50])dnl # expand $ac_aux_dir to an absolute path am_aux_dir=`cd $ac_aux_dir && pwd` ]) # AM_CONDITIONAL -*- Autoconf -*- # Copyright (C) 1997, 2000, 2001, 2003, 2004, 2005 # Free Software Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # serial 7 # AM_CONDITIONAL(NAME, SHELL-CONDITION) # ------------------------------------- # Define a conditional. AC_DEFUN([AM_CONDITIONAL], [AC_PREREQ(2.52)dnl ifelse([$1], [TRUE], [AC_FATAL([$0: invalid condition: $1])], [$1], [FALSE], [AC_FATAL([$0: invalid condition: $1])])dnl AC_SUBST([$1_TRUE]) AC_SUBST([$1_FALSE]) if $2; then $1_TRUE= $1_FALSE='#' else $1_TRUE='#' $1_FALSE= fi AC_CONFIG_COMMANDS_PRE( [if test -z "${$1_TRUE}" && test -z "${$1_FALSE}"; then AC_MSG_ERROR([[conditional "$1" was never defined. Usually this means the macro was only invoked conditionally.]]) fi])]) # Copyright (C) 1999, 2000, 2001, 2002, 2003, 2004, 2005 # Free Software Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # serial 8 # There are a few dirty hacks below to avoid letting `AC_PROG_CC' be # written in clear, in which case automake, when reading aclocal.m4, # will think it sees a *use*, and therefore will trigger all it's # C support machinery. Also note that it means that autoscan, seeing # CC etc. in the Makefile, will ask for an AC_PROG_CC use... # _AM_DEPENDENCIES(NAME) # ---------------------- # See how the compiler implements dependency checking. # NAME is "CC", "CXX", "GCJ", or "OBJC". # We try a few techniques and use that to set a single cache variable. # # We don't AC_REQUIRE the corresponding AC_PROG_CC since the latter was # modified to invoke _AM_DEPENDENCIES(CC); we would have a circular # dependency, and given that the user is not expected to run this macro, # just rely on AC_PROG_CC. AC_DEFUN([_AM_DEPENDENCIES], [AC_REQUIRE([AM_SET_DEPDIR])dnl AC_REQUIRE([AM_OUTPUT_DEPENDENCY_COMMANDS])dnl AC_REQUIRE([AM_MAKE_INCLUDE])dnl AC_REQUIRE([AM_DEP_TRACK])dnl ifelse([$1], CC, [depcc="$CC" am_compiler_list=], [$1], CXX, [depcc="$CXX" am_compiler_list=], [$1], OBJC, [depcc="$OBJC" am_compiler_list='gcc3 gcc'], [$1], GCJ, [depcc="$GCJ" am_compiler_list='gcc3 gcc'], [depcc="$$1" am_compiler_list=]) AC_CACHE_CHECK([dependency style of $depcc], [am_cv_$1_dependencies_compiler_type], [if test -z "$AMDEP_TRUE" && test -f "$am_depcomp"; then # We make a subdir and do the tests there. Otherwise we can end up # making bogus files that we don't know about and never remove. For # instance it was reported that on HP-UX the gcc test will end up # making a dummy file named `D' -- because `-MD' means `put the output # in D'. mkdir conftest.dir # Copy depcomp to subdir because otherwise we won't find it if we're # using a relative directory. cp "$am_depcomp" conftest.dir cd conftest.dir # We will build objects and dependencies in a subdirectory because # it helps to detect inapplicable dependency modes. For instance # both Tru64's cc and ICC support -MD to output dependencies as a # side effect of compilation, but ICC will put the dependencies in # the current directory while Tru64 will put them in the object # directory. mkdir sub am_cv_$1_dependencies_compiler_type=none if test "$am_compiler_list" = ""; then am_compiler_list=`sed -n ['s/^#*\([a-zA-Z0-9]*\))$/\1/p'] < ./depcomp` fi for depmode in $am_compiler_list; do # Setup a source with many dependencies, because some compilers # like to wrap large dependency lists on column 80 (with \), and # we should not choose a depcomp mode which is confused by this. # # We need to recreate these files for each test, as the compiler may # overwrite some of them when testing with obscure command lines. # This happens at least with the AIX C compiler. : > sub/conftest.c for i in 1 2 3 4 5 6; do echo '#include "conftst'$i'.h"' >> sub/conftest.c # Using `: > sub/conftst$i.h' creates only sub/conftst1.h with # Solaris 8's {/usr,}/bin/sh. touch sub/conftst$i.h done echo "${am__include} ${am__quote}sub/conftest.Po${am__quote}" > confmf case $depmode in nosideeffect) # after this tag, mechanisms are not by side-effect, so they'll # only be used when explicitly requested if test "x$enable_dependency_tracking" = xyes; then continue else break fi ;; none) break ;; esac # We check with `-c' and `-o' for the sake of the "dashmstdout" # mode. It turns out that the SunPro C++ compiler does not properly # handle `-M -o', and we need to detect this. if depmode=$depmode \ source=sub/conftest.c object=sub/conftest.${OBJEXT-o} \ depfile=sub/conftest.Po tmpdepfile=sub/conftest.TPo \ $SHELL ./depcomp $depcc -c -o sub/conftest.${OBJEXT-o} sub/conftest.c \ >/dev/null 2>conftest.err && grep sub/conftst6.h sub/conftest.Po > /dev/null 2>&1 && grep sub/conftest.${OBJEXT-o} sub/conftest.Po > /dev/null 2>&1 && ${MAKE-make} -s -f confmf > /dev/null 2>&1; then # icc doesn't choke on unknown options, it will just issue warnings # or remarks (even with -Werror). So we grep stderr for any message # that says an option was ignored or not supported. # When given -MP, icc 7.0 and 7.1 complain thusly: # icc: Command line warning: ignoring option '-M'; no argument required # The diagnosis changed in icc 8.0: # icc: Command line remark: option '-MP' not supported if (grep 'ignoring option' conftest.err || grep 'not supported' conftest.err) >/dev/null 2>&1; then :; else am_cv_$1_dependencies_compiler_type=$depmode break fi fi done cd .. rm -rf conftest.dir else am_cv_$1_dependencies_compiler_type=none fi ]) AC_SUBST([$1DEPMODE], [depmode=$am_cv_$1_dependencies_compiler_type]) AM_CONDITIONAL([am__fastdep$1], [ test "x$enable_dependency_tracking" != xno \ && test "$am_cv_$1_dependencies_compiler_type" = gcc3]) ]) # AM_SET_DEPDIR # ------------- # Choose a directory name for dependency files. # This macro is AC_REQUIREd in _AM_DEPENDENCIES AC_DEFUN([AM_SET_DEPDIR], [AC_REQUIRE([AM_SET_LEADING_DOT])dnl AC_SUBST([DEPDIR], ["${am__leading_dot}deps"])dnl ]) # AM_DEP_TRACK # ------------ AC_DEFUN([AM_DEP_TRACK], [AC_ARG_ENABLE(dependency-tracking, [ --disable-dependency-tracking speeds up one-time build --enable-dependency-tracking do not reject slow dependency extractors]) if test "x$enable_dependency_tracking" != xno; then am_depcomp="$ac_aux_dir/depcomp" AMDEPBACKSLASH='\' fi AM_CONDITIONAL([AMDEP], [test "x$enable_dependency_tracking" != xno]) AC_SUBST([AMDEPBACKSLASH]) ]) # Generate code to set up dependency tracking. -*- Autoconf -*- # Copyright (C) 1999, 2000, 2001, 2002, 2003, 2004, 2005 # Free Software Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. #serial 3 # _AM_OUTPUT_DEPENDENCY_COMMANDS # ------------------------------ AC_DEFUN([_AM_OUTPUT_DEPENDENCY_COMMANDS], [for mf in $CONFIG_FILES; do # Strip MF so we end up with the name of the file. mf=`echo "$mf" | sed -e 's/:.*$//'` # Check whether this is an Automake generated Makefile or not. # We used to match only the files named `Makefile.in', but # some people rename them; so instead we look at the file content. # Grep'ing the first line is not enough: some people post-process # each Makefile.in and add a new line on top of each file to say so. # So let's grep whole file. if grep '^#.*generated by automake' $mf > /dev/null 2>&1; then dirpart=`AS_DIRNAME("$mf")` else continue fi # Extract the definition of DEPDIR, am__include, and am__quote # from the Makefile without running `make'. DEPDIR=`sed -n 's/^DEPDIR = //p' < "$mf"` test -z "$DEPDIR" && continue am__include=`sed -n 's/^am__include = //p' < "$mf"` test -z "am__include" && continue am__quote=`sed -n 's/^am__quote = //p' < "$mf"` # When using ansi2knr, U may be empty or an underscore; expand it U=`sed -n 's/^U = //p' < "$mf"` # Find all dependency output files, they are included files with # $(DEPDIR) in their names. We invoke sed twice because it is the # simplest approach to changing $(DEPDIR) to its actual value in the # expansion. for file in `sed -n " s/^$am__include $am__quote\(.*(DEPDIR).*\)$am__quote"'$/\1/p' <"$mf" | \ sed -e 's/\$(DEPDIR)/'"$DEPDIR"'/g' -e 's/\$U/'"$U"'/g'`; do # Make sure the directory exists. test -f "$dirpart/$file" && continue fdir=`AS_DIRNAME(["$file"])` AS_MKDIR_P([$dirpart/$fdir]) # echo "creating $dirpart/$file" echo '# dummy' > "$dirpart/$file" done done ])# _AM_OUTPUT_DEPENDENCY_COMMANDS # AM_OUTPUT_DEPENDENCY_COMMANDS # ----------------------------- # This macro should only be invoked once -- use via AC_REQUIRE. # # This code is only required when automatic dependency tracking # is enabled. FIXME. This creates each `.P' file that we will # need in order to bootstrap the dependency handling code. AC_DEFUN([AM_OUTPUT_DEPENDENCY_COMMANDS], [AC_CONFIG_COMMANDS([depfiles], [test x"$AMDEP_TRUE" != x"" || _AM_OUTPUT_DEPENDENCY_COMMANDS], [AMDEP_TRUE="$AMDEP_TRUE" ac_aux_dir="$ac_aux_dir"]) ]) # Copyright (C) 1996, 1997, 2000, 2001, 2003, 2005 # Free Software Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # serial 8 # AM_CONFIG_HEADER is obsolete. It has been replaced by AC_CONFIG_HEADERS. AU_DEFUN([AM_CONFIG_HEADER], [AC_CONFIG_HEADERS($@)]) # Do all the work for Automake. -*- Autoconf -*- # Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005 # Free Software Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # serial 12 # This macro actually does too much. Some checks are only needed if # your package does certain things. But this isn't really a big deal. # AM_INIT_AUTOMAKE(PACKAGE, VERSION, [NO-DEFINE]) # AM_INIT_AUTOMAKE([OPTIONS]) # ----------------------------------------------- # The call with PACKAGE and VERSION arguments is the old style # call (pre autoconf-2.50), which is being phased out. PACKAGE # and VERSION should now be passed to AC_INIT and removed from # the call to AM_INIT_AUTOMAKE. # We support both call styles for the transition. After # the next Automake release, Autoconf can make the AC_INIT # arguments mandatory, and then we can depend on a new Autoconf # release and drop the old call support. AC_DEFUN([AM_INIT_AUTOMAKE], [AC_PREREQ([2.58])dnl dnl Autoconf wants to disallow AM_ names. We explicitly allow dnl the ones we care about. m4_pattern_allow([^AM_[A-Z]+FLAGS$])dnl AC_REQUIRE([AM_SET_CURRENT_AUTOMAKE_VERSION])dnl AC_REQUIRE([AC_PROG_INSTALL])dnl # test to see if srcdir already configured if test "`cd $srcdir && pwd`" != "`pwd`" && test -f $srcdir/config.status; then AC_MSG_ERROR([source directory already configured; run "make distclean" there first]) fi # test whether we have cygpath if test -z "$CYGPATH_W"; then if (cygpath --version) >/dev/null 2>/dev/null; then CYGPATH_W='cygpath -w' else CYGPATH_W=echo fi fi AC_SUBST([CYGPATH_W]) # Define the identity of the package. dnl Distinguish between old-style and new-style calls. m4_ifval([$2], [m4_ifval([$3], [_AM_SET_OPTION([no-define])])dnl AC_SUBST([PACKAGE], [$1])dnl AC_SUBST([VERSION], [$2])], [_AM_SET_OPTIONS([$1])dnl AC_SUBST([PACKAGE], ['AC_PACKAGE_TARNAME'])dnl AC_SUBST([VERSION], ['AC_PACKAGE_VERSION'])])dnl _AM_IF_OPTION([no-define],, [AC_DEFINE_UNQUOTED(PACKAGE, "$PACKAGE", [Name of package]) AC_DEFINE_UNQUOTED(VERSION, "$VERSION", [Version number of package])])dnl # Some tools Automake needs. AC_REQUIRE([AM_SANITY_CHECK])dnl AC_REQUIRE([AC_ARG_PROGRAM])dnl AM_MISSING_PROG(ACLOCAL, aclocal-${am__api_version}) AM_MISSING_PROG(AUTOCONF, autoconf) AM_MISSING_PROG(AUTOMAKE, automake-${am__api_version}) AM_MISSING_PROG(AUTOHEADER, autoheader) AM_MISSING_PROG(MAKEINFO, makeinfo) AM_PROG_INSTALL_SH AM_PROG_INSTALL_STRIP AC_REQUIRE([AM_PROG_MKDIR_P])dnl # We need awk for the "check" target. The system "awk" is bad on # some platforms. AC_REQUIRE([AC_PROG_AWK])dnl AC_REQUIRE([AC_PROG_MAKE_SET])dnl AC_REQUIRE([AM_SET_LEADING_DOT])dnl _AM_IF_OPTION([tar-ustar], [_AM_PROG_TAR([ustar])], [_AM_IF_OPTION([tar-pax], [_AM_PROG_TAR([pax])], [_AM_PROG_TAR([v7])])]) _AM_IF_OPTION([no-dependencies],, [AC_PROVIDE_IFELSE([AC_PROG_CC], [_AM_DEPENDENCIES(CC)], [define([AC_PROG_CC], defn([AC_PROG_CC])[_AM_DEPENDENCIES(CC)])])dnl AC_PROVIDE_IFELSE([AC_PROG_CXX], [_AM_DEPENDENCIES(CXX)], [define([AC_PROG_CXX], defn([AC_PROG_CXX])[_AM_DEPENDENCIES(CXX)])])dnl ]) ]) # When config.status generates a header, we must update the stamp-h file. # This file resides in the same directory as the config header # that is generated. The stamp files are numbered to have different names. # Autoconf calls _AC_AM_CONFIG_HEADER_HOOK (when defined) in the # loop where config.status creates the headers, so we can generate # our stamp files there. AC_DEFUN([_AC_AM_CONFIG_HEADER_HOOK], [# Compute $1's index in $config_headers. _am_stamp_count=1 for _am_header in $config_headers :; do case $_am_header in $1 | $1:* ) break ;; * ) _am_stamp_count=`expr $_am_stamp_count + 1` ;; esac done echo "timestamp for $1" >`AS_DIRNAME([$1])`/stamp-h[]$_am_stamp_count]) # Copyright (C) 2001, 2003, 2005 Free Software Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # AM_PROG_INSTALL_SH # ------------------ # Define $install_sh. AC_DEFUN([AM_PROG_INSTALL_SH], [AC_REQUIRE([AM_AUX_DIR_EXPAND])dnl install_sh=${install_sh-"$am_aux_dir/install-sh"} AC_SUBST(install_sh)]) # Copyright (C) 2003, 2005 Free Software Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # serial 2 # Check whether the underlying filesystem supports filenames # with a leading dot. For instance MS-DOS doesn't. AC_DEFUN([AM_SET_LEADING_DOT], [rm -rf .tst 2>/dev/null mkdir .tst 2>/dev/null if test -d .tst; then am__leading_dot=. else am__leading_dot=_ fi rmdir .tst 2>/dev/null AC_SUBST([am__leading_dot])]) # Add --enable-maintainer-mode option to configure. -*- Autoconf -*- # From Jim Meyering # Copyright (C) 1996, 1998, 2000, 2001, 2002, 2003, 2004, 2005 # Free Software Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # serial 4 AC_DEFUN([AM_MAINTAINER_MODE], [AC_MSG_CHECKING([whether to enable maintainer-specific portions of Makefiles]) dnl maintainer-mode is disabled by default AC_ARG_ENABLE(maintainer-mode, [ --enable-maintainer-mode enable make rules and dependencies not useful (and sometimes confusing) to the casual installer], USE_MAINTAINER_MODE=$enableval, USE_MAINTAINER_MODE=no) AC_MSG_RESULT([$USE_MAINTAINER_MODE]) AM_CONDITIONAL(MAINTAINER_MODE, [test $USE_MAINTAINER_MODE = yes]) MAINT=$MAINTAINER_MODE_TRUE AC_SUBST(MAINT)dnl ] ) AU_DEFUN([jm_MAINTAINER_MODE], [AM_MAINTAINER_MODE]) # Check to see how 'make' treats includes. -*- Autoconf -*- # Copyright (C) 2001, 2002, 2003, 2005 Free Software Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # serial 3 # AM_MAKE_INCLUDE() # ----------------- # Check to see how make treats includes. AC_DEFUN([AM_MAKE_INCLUDE], [am_make=${MAKE-make} cat > confinc << 'END' am__doit: @echo done .PHONY: am__doit END # If we don't find an include directive, just comment out the code. AC_MSG_CHECKING([for style of include used by $am_make]) am__include="#" am__quote= _am_result=none # First try GNU make style include. echo "include confinc" > confmf # We grep out `Entering directory' and `Leaving directory' # messages which can occur if `w' ends up in MAKEFLAGS. # In particular we don't look at `^make:' because GNU make might # be invoked under some other name (usually "gmake"), in which # case it prints its new name instead of `make'. if test "`$am_make -s -f confmf 2> /dev/null | grep -v 'ing directory'`" = "done"; then am__include=include am__quote= _am_result=GNU fi # Now try BSD make style include. if test "$am__include" = "#"; then echo '.include "confinc"' > confmf if test "`$am_make -s -f confmf 2> /dev/null`" = "done"; then am__include=.include am__quote="\"" _am_result=BSD fi fi AC_SUBST([am__include]) AC_SUBST([am__quote]) AC_MSG_RESULT([$_am_result]) rm -f confinc confmf ]) # Fake the existence of programs that GNU maintainers use. -*- Autoconf -*- # Copyright (C) 1997, 1999, 2000, 2001, 2003, 2005 # Free Software Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # serial 4 # AM_MISSING_PROG(NAME, PROGRAM) # ------------------------------ AC_DEFUN([AM_MISSING_PROG], [AC_REQUIRE([AM_MISSING_HAS_RUN]) $1=${$1-"${am_missing_run}$2"} AC_SUBST($1)]) # AM_MISSING_HAS_RUN # ------------------ # Define MISSING if not defined so far and test if it supports --run. # If it does, set am_missing_run to use it, otherwise, to nothing. AC_DEFUN([AM_MISSING_HAS_RUN], [AC_REQUIRE([AM_AUX_DIR_EXPAND])dnl test x"${MISSING+set}" = xset || MISSING="\${SHELL} $am_aux_dir/missing" # Use eval to expand $SHELL if eval "$MISSING --run true"; then am_missing_run="$MISSING --run " else am_missing_run= AC_MSG_WARN([`missing' script is too old or missing]) fi ]) # Copyright (C) 2003, 2004, 2005 Free Software Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # AM_PROG_MKDIR_P # --------------- # Check whether `mkdir -p' is supported, fallback to mkinstalldirs otherwise. # # Automake 1.8 used `mkdir -m 0755 -p --' to ensure that directories # created by `make install' are always world readable, even if the # installer happens to have an overly restrictive umask (e.g. 077). # This was a mistake. There are at least two reasons why we must not # use `-m 0755': # - it causes special bits like SGID to be ignored, # - it may be too restrictive (some setups expect 775 directories). # # Do not use -m 0755 and let people choose whatever they expect by # setting umask. # # We cannot accept any implementation of `mkdir' that recognizes `-p'. # Some implementations (such as Solaris 8's) are not thread-safe: if a # parallel make tries to run `mkdir -p a/b' and `mkdir -p a/c' # concurrently, both version can detect that a/ is missing, but only # one can create it and the other will error out. Consequently we # restrict ourselves to GNU make (using the --version option ensures # this.) AC_DEFUN([AM_PROG_MKDIR_P], [if mkdir -p --version . >/dev/null 2>&1 && test ! -d ./--version; then # We used to keeping the `.' as first argument, in order to # allow $(mkdir_p) to be used without argument. As in # $(mkdir_p) $(somedir) # where $(somedir) is conditionally defined. However this is wrong # for two reasons: # 1. if the package is installed by a user who cannot write `.' # make install will fail, # 2. the above comment should most certainly read # $(mkdir_p) $(DESTDIR)$(somedir) # so it does not work when $(somedir) is undefined and # $(DESTDIR) is not. # To support the latter case, we have to write # test -z "$(somedir)" || $(mkdir_p) $(DESTDIR)$(somedir), # so the `.' trick is pointless. mkdir_p='mkdir -p --' else # On NextStep and OpenStep, the `mkdir' command does not # recognize any option. It will interpret all options as # directories to create, and then abort because `.' already # exists. for d in ./-p ./--version; do test -d $d && rmdir $d done # $(mkinstalldirs) is defined by Automake if mkinstalldirs exists. if test -f "$ac_aux_dir/mkinstalldirs"; then mkdir_p='$(mkinstalldirs)' else mkdir_p='$(install_sh) -d' fi fi AC_SUBST([mkdir_p])]) # Helper functions for option handling. -*- Autoconf -*- # Copyright (C) 2001, 2002, 2003, 2005 Free Software Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # serial 3 # _AM_MANGLE_OPTION(NAME) # ----------------------- AC_DEFUN([_AM_MANGLE_OPTION], [[_AM_OPTION_]m4_bpatsubst($1, [[^a-zA-Z0-9_]], [_])]) # _AM_SET_OPTION(NAME) # ------------------------------ # Set option NAME. Presently that only means defining a flag for this option. AC_DEFUN([_AM_SET_OPTION], [m4_define(_AM_MANGLE_OPTION([$1]), 1)]) # _AM_SET_OPTIONS(OPTIONS) # ---------------------------------- # OPTIONS is a space-separated list of Automake options. AC_DEFUN([_AM_SET_OPTIONS], [AC_FOREACH([_AM_Option], [$1], [_AM_SET_OPTION(_AM_Option)])]) # _AM_IF_OPTION(OPTION, IF-SET, [IF-NOT-SET]) # ------------------------------------------- # Execute IF-SET if OPTION is set, IF-NOT-SET otherwise. AC_DEFUN([_AM_IF_OPTION], [m4_ifset(_AM_MANGLE_OPTION([$1]), [$2], [$3])]) # Check to make sure that the build environment is sane. -*- Autoconf -*- # Copyright (C) 1996, 1997, 2000, 2001, 2003, 2005 # Free Software Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # serial 4 # AM_SANITY_CHECK # --------------- AC_DEFUN([AM_SANITY_CHECK], [AC_MSG_CHECKING([whether build environment is sane]) # Just in case sleep 1 echo timestamp > conftest.file # Do `set' in a subshell so we don't clobber the current shell's # arguments. Must try -L first in case configure is actually a # symlink; some systems play weird games with the mod time of symlinks # (eg FreeBSD returns the mod time of the symlink's containing # directory). if ( set X `ls -Lt $srcdir/configure conftest.file 2> /dev/null` if test "$[*]" = "X"; then # -L didn't work. set X `ls -t $srcdir/configure conftest.file` fi rm -f conftest.file if test "$[*]" != "X $srcdir/configure conftest.file" \ && test "$[*]" != "X conftest.file $srcdir/configure"; then # If neither matched, then we have a broken ls. This can happen # if, for instance, CONFIG_SHELL is bash and it inherits a # broken ls alias from the environment. This has actually # happened. Such a system could not be considered "sane". AC_MSG_ERROR([ls -t appears to fail. Make sure there is not a broken alias in your environment]) fi test "$[2]" = conftest.file ) then # Ok. : else AC_MSG_ERROR([newly created file is older than distributed files! Check your system clock]) fi AC_MSG_RESULT(yes)]) # Copyright (C) 2001, 2003, 2005 Free Software Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # AM_PROG_INSTALL_STRIP # --------------------- # One issue with vendor `install' (even GNU) is that you can't # specify the program used to strip binaries. This is especially # annoying in cross-compiling environments, where the build's strip # is unlikely to handle the host's binaries. # Fortunately install-sh will honor a STRIPPROG variable, so we # always use install-sh in `make install-strip', and initialize # STRIPPROG with the value of the STRIP variable (set by the user). AC_DEFUN([AM_PROG_INSTALL_STRIP], [AC_REQUIRE([AM_PROG_INSTALL_SH])dnl # Installed binaries are usually stripped using `strip' when the user # run `make install-strip'. However `strip' might not be the right # tool to use in cross-compilation environments, therefore Automake # will honor the `STRIP' environment variable to overrule this program. dnl Don't test for $cross_compiling = yes, because it might be `maybe'. if test "$cross_compiling" != no; then AC_CHECK_TOOL([STRIP], [strip], :) fi INSTALL_STRIP_PROGRAM="\${SHELL} \$(install_sh) -c -s" AC_SUBST([INSTALL_STRIP_PROGRAM])]) # Check how to create a tarball. -*- Autoconf -*- # Copyright (C) 2004, 2005 Free Software Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # serial 2 # _AM_PROG_TAR(FORMAT) # -------------------- # Check how to create a tarball in format FORMAT. # FORMAT should be one of `v7', `ustar', or `pax'. # # Substitute a variable $(am__tar) that is a command # writing to stdout a FORMAT-tarball containing the directory # $tardir. # tardir=directory && $(am__tar) > result.tar # # Substitute a variable $(am__untar) that extract such # a tarball read from stdin. # $(am__untar) < result.tar AC_DEFUN([_AM_PROG_TAR], [# Always define AMTAR for backward compatibility. AM_MISSING_PROG([AMTAR], [tar]) m4_if([$1], [v7], [am__tar='${AMTAR} chof - "$$tardir"'; am__untar='${AMTAR} xf -'], [m4_case([$1], [ustar],, [pax],, [m4_fatal([Unknown tar format])]) AC_MSG_CHECKING([how to create a $1 tar archive]) # Loop over all known methods to create a tar archive until one works. _am_tools='gnutar m4_if([$1], [ustar], [plaintar]) pax cpio none' _am_tools=${am_cv_prog_tar_$1-$_am_tools} # Do not fold the above two line into one, because Tru64 sh and # Solaris sh will not grok spaces in the rhs of `-'. for _am_tool in $_am_tools do case $_am_tool in gnutar) for _am_tar in tar gnutar gtar; do AM_RUN_LOG([$_am_tar --version]) && break done am__tar="$_am_tar --format=m4_if([$1], [pax], [posix], [$1]) -chf - "'"$$tardir"' am__tar_="$_am_tar --format=m4_if([$1], [pax], [posix], [$1]) -chf - "'"$tardir"' am__untar="$_am_tar -xf -" ;; plaintar) # Must skip GNU tar: if it does not support --format= it doesn't create # ustar tarball either. (tar --version) >/dev/null 2>&1 && continue am__tar='tar chf - "$$tardir"' am__tar_='tar chf - "$tardir"' am__untar='tar xf -' ;; pax) am__tar='pax -L -x $1 -w "$$tardir"' am__tar_='pax -L -x $1 -w "$tardir"' am__untar='pax -r' ;; cpio) am__tar='find "$$tardir" -print | cpio -o -H $1 -L' am__tar_='find "$tardir" -print | cpio -o -H $1 -L' am__untar='cpio -i -H $1 -d' ;; none) am__tar=false am__tar_=false am__untar=false ;; esac # If the value was cached, stop now. We just wanted to have am__tar # and am__untar set. test -n "${am_cv_prog_tar_$1}" && break # tar/untar a dummy directory, and stop if the command works rm -rf conftest.dir mkdir conftest.dir echo GrepMe > conftest.dir/file AM_RUN_LOG([tardir=conftest.dir && eval $am__tar_ >conftest.tar]) rm -rf conftest.dir if test -s conftest.tar; then AM_RUN_LOG([$am__untar /dev/null 2>&1 && break fi done rm -rf conftest.dir AC_CACHE_VAL([am_cv_prog_tar_$1], [am_cv_prog_tar_$1=$_am_tool]) AC_MSG_RESULT([$am_cv_prog_tar_$1])]) AC_SUBST([am__tar]) AC_SUBST([am__untar]) ]) # _AM_PROG_TAR m4_include([acinclude.m4]) jupp/autoconf.h.in010064400000000000000000000216051337207553400113740ustar00/* autoconf.h.in. Generated from configure.ac by autoheader 2.61-MirPorts-3. */ /* Define to 1 if `TIOCGWINSZ' requires . */ #undef GWINSZ_IN_SYS_IOCTL /* Define to 1 if you have the `alarm' function. */ #undef HAVE_ALARM /* Define to 1 if you have the header file. */ #undef HAVE_BSD_STRING_H /* Define to 1 if you have the `ctime' function. */ #undef HAVE_CTIME /* Define to 1 if you have the declaration of `ctime', and to 0 if you don't. */ #undef HAVE_DECL_CTIME /* Define to 1 if you have the declaration of `popen', and to 0 if you don't. */ #undef HAVE_DECL_POPEN /* Define to 1 if you have the declaration of `strlcat', and to 0 if you don't. */ #undef HAVE_DECL_STRLCAT /* Define to 1 if you have the declaration of `strlcpy', and to 0 if you don't. */ #undef HAVE_DECL_STRLCPY /* Define to 1 if you have the header file, and it defines `DIR'. */ #undef HAVE_DIRENT_H /* Define to 1 if you have the header file. */ #undef HAVE_ERRNO_H /* Define to 1 if you have the header file. */ #undef HAVE_FCNTL_H /* Define to 1 if you have the `fork' function. */ #undef HAVE_FORK /* Define to 1 if fseeko (and presumably ftello) exists and is declared. */ #undef HAVE_FSEEKO /* Define to 1 if you have the `fsync' function. */ #undef HAVE_FSYNC /* Define if GCC has Anil's bounds checker */ #undef HAVE_GCC_ATTRIBUTE_BOUNDED /* Define to 1 if you have the `getcwd' function. */ #undef HAVE_GETCWD /* Define to 1 if you have the `getwd' function. */ #undef HAVE_GETWD /* Define to 1 if you have the `get_current_dir_name' function. */ #undef HAVE_GET_CURRENT_DIR_NAME /* Define to 1 if you have the header file. */ #undef HAVE_INTTYPES_H /* Define to 1 if you have the `isatty' function. */ #undef HAVE_ISATTY /* Define to 1 if you have the header file. */ #undef HAVE_LANGINFO_H /* Define to 1 if you have the header file. */ #undef HAVE_LIMITS_H /* Define to 1 if you have the header file. */ #undef HAVE_LOCALE_H /* If we have BSD function login_tty() */ #undef HAVE_LOGIN_TTY /* Define to 1 if `lstat' has the bug that it succeeds when given the zero-length file name argument. */ #undef HAVE_LSTAT_EMPTY_STRING_BUG /* Define to 1 if you have the header file. */ #undef HAVE_MEMORY_H /* Define to 1 if you have the `mkdir' function. */ #undef HAVE_MKDIR /* Define to 1 if you have the `mkstemp' function. */ #undef HAVE_MKSTEMP /* Define to 1 if you have the header file, and it defines `DIR'. */ #undef HAVE_NDIR_H /* Define to 1 if you have the `nl_langinfo' function. */ #undef HAVE_NL_LANGINFO /* If we have BSD function openpty() */ #undef HAVE_OPENPTY /* Define to 1 if you have the header file. */ #undef HAVE_PATHS_H /* Define to 1 if you have the `popen' function. */ #undef HAVE_POPEN /* We have and maybe */ #undef HAVE_POSIX_TERMIOS /* Define to 1 if you have the header file. */ #undef HAVE_PTY_H /* Define to 1 if you have the `putenv' function. */ #undef HAVE_PUTENV /* Define to 1 if you have the header file. */ #undef HAVE_PWD_H /* Define to 1 if you have the header file. */ #undef HAVE_SELINUX_CONTEXT_H /* We have SELinux functions */ #undef HAVE_SELINUX_FUN /* Define to 1 if you have the header file. */ #undef HAVE_SELINUX_SELINUX_H /* Define to 1 if you have the `setitimer' function. */ #undef HAVE_SETITIMER /* Define to 1 if you have the `setlocale' function. */ #undef HAVE_SETLOCALE /* Define to 1 if you have the `setpgid' function. */ #undef HAVE_SETPGID /* Define to 1 if you have the header file. */ #undef HAVE_SGTTY_H /* Define to 1 if you have the `sigaction' function. */ #undef HAVE_SIGACTION /* Define if you have the `sighandler_t' type. */ #undef HAVE_SIGHANDLER_T /* Define to 1 if you have the `siginterrupt' function. */ #undef HAVE_SIGINTERRUPT /* Define to 1 if you have the header file. */ #undef HAVE_SIGNAL_H /* Define to 1 if you have the `sigprocmask' function. */ #undef HAVE_SIGPROCMASK /* Define to 1 if you have the `sigvec' function. */ #undef HAVE_SIGVEC /* If we have snprintf */ #undef HAVE_SNPRINTF /* Define to 1 if `stat' has the bug that it succeeds when given the zero-length file name argument. */ #undef HAVE_STAT_EMPTY_STRING_BUG /* Define to 1 if you have the header file. */ #undef HAVE_STDINT_H /* Define to 1 if you have the header file. */ #undef HAVE_STDLIB_H /* Define to 1 if you have the `strchr' function. */ #undef HAVE_STRCHR /* Define to 1 if you have the `strdup' function. */ #undef HAVE_STRDUP /* Define to 1 if you have the header file. */ #undef HAVE_STRINGS_H /* Define to 1 if you have the header file. */ #undef HAVE_STRING_H /* Define to 1 if you have the `strlcat' function. */ #undef HAVE_STRLCAT /* Define to 1 if you have the `strlcpy' function. */ #undef HAVE_STRLCPY /* Define to 1 if you have the `sync' function. */ #undef HAVE_SYNC /* We have and */ #undef HAVE_SYSV_TERMIO /* Define to 1 if you have the header file. */ #undef HAVE_SYS_DIRENT_H /* Define to 1 if you have the header file, and it defines `DIR'. */ #undef HAVE_SYS_DIR_H /* Define to 1 if you have the header file. */ #undef HAVE_SYS_IOCTL_H /* Define to 1 if you have the header file, and it defines `DIR'. */ #undef HAVE_SYS_NDIR_H /* Define to 1 if you have the header file. */ #undef HAVE_SYS_PARAM_H /* Define to 1 if you have the header file. */ #undef HAVE_SYS_STAT_H /* Define to 1 if you have the header file. */ #undef HAVE_SYS_TERMIO_H /* Define to 1 if you have the header file. */ #undef HAVE_SYS_TIME_H /* Define to 1 if you have the header file. */ #undef HAVE_SYS_TYPES_H /* Define to 1 if you have the header file. */ #undef HAVE_SYS_WAIT_H /* Define to 1 if you have the header file. */ #undef HAVE_TERMIO_H /* Define to 1 if you have the header file. */ #undef HAVE_TIME_H /* Define to 1 if you have the header file. */ #undef HAVE_UNISTD_H /* Define to 1 if you have the `unsetenv' function. */ #undef HAVE_UNSETENV /* Define to 1 if you have the header file. */ #undef HAVE_UTIL_H /* Define to 1 if you have the `utime' function. */ #undef HAVE_UTIME /* Define to 1 if you have the header file. */ #undef HAVE_UTIME_H /* Define to 1 if you have the header file. */ #undef HAVE_UTMP_H /* Use Win32 argv0-relative paths? */ #undef JUPP_WIN32RELOC /* Define to 1 if `lstat' dereferences a symlink specified with a trailing slash. */ #undef LSTAT_FOLLOWS_SLASHED_SYMLINK /* Define if we have to reinstall signal handler when invoked */ #undef NEED_TO_REINSTALL_SIGNAL /* Name of package */ #undef PACKAGE /* Define to the address where bug reports for this package should be sent. */ #undef PACKAGE_BUGREPORT /* Define to the full name of this package. */ #undef PACKAGE_NAME /* Define to the full name and version of this package. */ #undef PACKAGE_STRING /* Define to the one symbol short name of this package. */ #undef PACKAGE_TARNAME /* Define to the version of this package. */ #undef PACKAGE_VERSION /* Define as the return type of signal handlers (`int' or `void'). */ #undef RETSIGTYPE /* Define if setpgrp() takes no arguments */ #undef SETPGRP_VOID /* The size of `char', as computed by sizeof. */ #undef SIZEOF_CHAR /* The size of `int', as computed by sizeof. */ #undef SIZEOF_INT /* The size of `long', as computed by sizeof. */ #undef SIZEOF_LONG /* The size of `long long', as computed by sizeof. */ #undef SIZEOF_LONG_LONG /* The size of `off_t', as computed by sizeof. */ #undef SIZEOF_OFF_T /* The size of `short', as computed by sizeof. */ #undef SIZEOF_SHORT /* The size of `void *', as computed by sizeof. */ #undef SIZEOF_VOID_P /* Reduce memory footprint slightly */ #undef SMALL /* Define to 1 if you have the ANSI C header files. */ #undef STDC_HEADERS /* If we have newer terminfo/termcap capabilities */ #undef TERMINFO /* Define to 1 if you can safely include both and . */ #undef TIME_WITH_SYS_TIME /* Version number of package */ #undef VERSION /* We have fork(2) and want to use it */ #undef WANT_FORK /* Can we use the FPU? */ #undef WANT_MATH /* Number of bits in a file offset, on hosts where this is settable. */ #undef _FILE_OFFSET_BITS /* Define to 1 to make fseeko visible on some hosts (e.g. glibc 2.2). */ #undef _LARGEFILE_SOURCE /* Define for large files, on AIX-style hosts. */ #undef _LARGE_FILES /* Define to empty if `const' does not conform to ANSI C. */ #undef const /* Define to `int' if does not define. */ #undef pid_t /* Define to `unsigned int' if does not define. */ #undef size_t /* Define to `int' if does not define. */ #undef ssize_t jupp/autogen.sh010064400000000000000000000042351321055753000107660ustar00#!/bin/mksh # $MirOS: contrib/code/jupp/autogen.sh,v 1.15 2017/12/02 17:13:33 tg Exp $ #- # Copyright © 2004, 2005, 2006, 2008, 2017 # mirabilos # # Provided that these terms and disclaimer and all copyright notices # are retained or reproduced in an accompanying document, permission # is granted to deal in this work without restriction, including un†# limited rights to use, publicly perform, distribute, sell, modify, # merge, give away, or sublicence. # # This work is provided “AS IS” and WITHOUT WARRANTY of any kind, to # the utmost extent permitted by applicable law, neither express nor # implied; without malicious intent or gross negligence. In no event # may a licensor, author or contributor be held liable for indirect, # direct, other damage, loss, or other issues arising in any way out # of dealing in the work, even if advised of the possibility of such # damage or existence of a defect, except proven that it results out # of said person’s immediate fault when using the work as intended. if [[ -z $AUTOCONF_VERSION ]]; then export AUTOCONF_VERSION=2.61 print -u2 Warning: AUTOCONF_VERSION unset, using $AUTOCONF_VERSION! fi if [[ -z $AUTOMAKE_VERSION ]]; then export AUTOMAKE_VERSION=1.9 print -u2 Warning: AUTOMAKE_VERSION unset, using $AUTOMAKE_VERSION! fi [[ -n $GNUSYSTEM_AUX_DIR ]] || GNUSYSTEM_AUX_DIR=/usr/src/gnu/share export AUTOCONF_VERSION AUTOMAKE_VERSION GNUSYSTEM_AUX_DIR AM_FLAGS= for f in $files ChangeLog ltmain.sh; do [[ -e $f ]] && continue ln -s /dev/null $f done for f in libtool.m4 m4salt.inc m4sugar.inc; do [[ -s $f ]] || ln -sf "$GNUSYSTEM_AUX_DIR/$f" . done set -e set -x ACLOCAL_AMFLAGS= [[ -e Makefile.am ]] && ACLOCAL_AMFLAGS=$(grep '^[:space:]*ACLOCAL_AMFLAGS' \ Makefile.am | cut -d '=' -f 2) aclocal -I . $ACLOCAL_AMFLAGS f=configure.ac [[ ! -e $f ]] && f=configure.in [[ -n $NO_AUTOHEADER ]] || if fgrep -q \ -e AC_CONFIG_HEADER -e AM_CONFIG_HEADER $f; then autoheader fi set +e integer rv=0 [[ ! -e Makefile.am ]] || automake --foreign -a $AM_FLAGS || rv=$? if autoconf; then chmod 664 configure else (( rv = rv ? rv : 1 )) fi rm -rf autom4te.cache *~ find . -type l -print0 | xargs -0 rm exit $rv jupp/b.c010064400000000000000000001414031374670214200073610ustar00/* * Editor engine * Copyright * (C) 1992 Joseph H. Allen * * This file is part of JOE (Joe's Own Editor) */ #define EXTERN_B_C #include "config.h" #include "types.h" __RCSID("$MirOS: contrib/code/jupp/b.c,v 1.42 2020/10/30 03:11:03 tg Exp $"); #include #include #include #include #include #include #include #ifdef HAVE_TIME_H #include #endif #include "b.h" #include "blocks.h" #include "main.h" #include "path.h" #include "queue.h" #include "rc.h" #include "scrn.h" #include "uerror.h" #include "undo.h" #include "utils.h" #include "va.h" #include "vfile.h" #include "vs.h" #include "charmap.h" #include "w.h" #if !HAVE_DECL_CTIME char *ctime(const time_t *); #endif #if !HAVE_DECL_POPEN FILE *popen(const char *, const char *); int pclose(FILE *); #endif unsigned char stdbuf[stdsiz]; int guesscrlf = 0; int guessindent = 0; int error; int force = 0; VFILE *vmem; static int brch_u8(P *); const unsigned char *msgs[] = { UC "No error", UC "New File", UC "Error reading file", UC "Error seeking file", UC "Error opening file", UC "Error writing file", UC "File on disk is newer" }; /* Get size of gap (amount of free space) */ #define GGAPSZ(hdr) ((hdr)->ehole - (hdr)->hole) /* Get number of characters in gap buffer */ #define GSIZE(hdr) (SEGSIZ - GGAPSZ(hdr)) /* Get char from buffer (with jumping around the gap) */ #define GCHAR(p) ((p)->ofst >= (p)->hdr->hole ? (p)->ptr[(p)->ofst + GGAPSZ((p)->hdr)] \ : (p)->ptr[(p)->ofst]) /* Set position of gap */ static void gstgap(H *hdr, unsigned char *ptr, int ofst) { if (ofst > hdr->hole) { mmove(ptr + hdr->hole, ptr + hdr->ehole, ofst - hdr->hole); vchanged(ptr); } else if (ofst < hdr->hole) { mmove(ptr + hdr->ehole - (hdr->hole - ofst), ptr + ofst, hdr->hole - ofst); vchanged(ptr); } hdr->ehole = ofst + hdr->ehole - hdr->hole; hdr->hole = ofst; } /* Insert a block */ static void ginsm(H *hdr, unsigned char *ptr, int ofst, const unsigned char *blk, int size) { if (ofst != hdr->hole) gstgap(hdr, ptr, ofst); mmove(ptr + hdr->hole, blk, size); hdr->hole += size; vchanged(ptr); } /* Read block */ static void grmem(H *hdr, unsigned char *ptr, int ofst, unsigned char *blk, int size) { if (ofst < hdr->hole) if (size > hdr->hole - ofst) { mmove(blk, ptr + ofst, hdr->hole - ofst); mmove(blk + hdr->hole - ofst, ptr + hdr->ehole, size - (hdr->hole - ofst)); } else mmove(blk, ptr + ofst, size); else mmove(blk, ptr + ofst + hdr->ehole - hdr->hole, size); } static H nhdrs = { {&nhdrs, &nhdrs}, 0, 0, 0, 0 }; static H ohdrs = { {&ohdrs, &ohdrs}, 0, 0, 0, 0 }; /* Header allocation */ static H *halloc(void) { H *h; if (qempty(H, link, &ohdrs)) { h = (H *) alitem(&nhdrs, sizeof(H)); h->seg = my_valloc(vmem, (long) SEGSIZ); } else h = deque_f(H, link, ohdrs.link.next); h->hole = 0; h->ehole = SEGSIZ; h->nlines = 0; izque(H, link, h); return h; } static void hfree(H *h) { enquef(H, link, &ohdrs, h); } static void hfreechn(H *h) { splicef(H, link, &ohdrs, h); } static P frptrs = { {&frptrs, &frptrs}, NULL, 0, 0, NULL, 0, 0, 0, 0, 0, 0, NULL }; /* Pointer allocation */ static P *palloc(void) { return alitem(&frptrs, sizeof(P)); } static void pfree(P *p) { enquef(P, link, &frptrs, p); } /* Doubly linked list of buffers and free buffer structures */ static B bufs = { {&bufs, &bufs}, NULL, NULL, NULL, 0, 0, 0, 0, 0, NULL, { NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL }, { NULL, NULL, NULL, 0, 0, 0, 0, 0, 0, 0, 0, NULL, NULL, NULL, NULL, 0, 0, 0, 0, 0, 0, NULL, NULL, NULL, NULL, 0, 0, 0, 0, 0, NULL, NULL, NULL, NULL, 0, 0 }, NULL, NULL, 0, 0, 0, 0, 0, 0 }; static B frebufs = { {&frebufs, &frebufs}, NULL, NULL, NULL, 0, 0, 0, 0, 0, NULL, { NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL }, { NULL, NULL, NULL, 0, 0, 0, 0, 0, 0, 0, 0, NULL, NULL, NULL, NULL, 0, 0, 0, 0, 0, 0, NULL, NULL, NULL, NULL, 0, 0, 0, 0, 0, NULL, NULL, NULL, NULL, 0, 0 }, NULL, NULL, 0, 0, 0, 0, 0, 0 }; B *bnext(void) { B *b; do { b = bufs.link.prev; deque(B, link, &bufs); enqueb(B, link, b, &bufs); } while (b->internal); return b; } B *bprev(void) { B *b; do { b = bufs.link.next; deque(B, link, &bufs); enquef(B, link, b, &bufs); } while (b->internal); return b; } /* Make a buffer out of a chain */ static B *bmkchn(H *chn, B *prop, long amnt, long nlines) { B *b = alitem(&frebufs, sizeof(B)); b->undo = undomk(b); if (prop) b->o = prop->o; else b->o = pdefault; mset(b->marks, 0, sizeof(b->marks)); b->rdonly = 0; b->orphan = 0; b->oldcur = NULL; b->oldtop = NULL; b->backup = 1; b->internal = 1; b->scratch = 0; b->changed = 0; b->count = 1; b->name = NULL; b->er = -3; b->bof = palloc(); izque(P, link, b->bof); b->bof->end = 0; b->bof->b = b; b->bof->owner = NULL; b->bof->hdr = chn; b->bof->ptr = vlock(vmem, b->bof->hdr->seg); b->bof->ofst = 0; b->bof->byte = 0; b->bof->line = 0; b->bof->col = 0; b->bof->xcol = 0; b->bof->valcol = 1; b->eof = pdup(b->bof); b->eof->end = 1; vunlock(b->eof->ptr); b->eof->hdr = chn->link.prev; b->eof->ptr = vlock(vmem, b->eof->hdr->seg); b->eof->ofst = GSIZE(b->eof->hdr); b->eof->byte = amnt; b->eof->line = nlines; b->eof->valcol = 0; b->pid = 0; b->out = -1; enquef(B, link, &bufs, b); pcoalesce(b->bof); pcoalesce(b->eof); return b; } /* Create an empty buffer */ B *bmk(B *prop) { return bmkchn(halloc(), prop, 0L, 0L); } extern B *errbuf; /* Eliminate a buffer */ void brm(B *b) { if (b && !--b->count) { if (b->changed) abrerr(b->name); if (b == errbuf) errbuf = NULL; if (b->undo) undorm(b->undo); hfreechn(b->eof->hdr); while (!qempty(P, link, b->bof)) prm(b->bof->link.next); prm(b->bof); if (b->name) free(b->name); demote(B, link, &frebufs, b); } } P *poffline(P *p) { if (p->ptr) { vunlock(p->ptr); p->ptr = NULL; } return p; } P *ponline(P *p) { if (!p->ptr) p->ptr = vlock(vmem, p->hdr->seg); return p; } B *boffline(B *b) { P *p = b->bof; do { poffline(p); } while ((p = p->link.next) != b->bof); return b; } B *bonline(B *b) { P *p = b->bof; do { ponline(p); } while ((p = p->link.next) != b->bof); return b; } P *pdup(P *p) { P *n = palloc(); n->end = 0; n->ptr = NULL; n->owner = NULL; enquef(P, link, p, n); return pset(n, p); } P *pdupown(P *p, P **o) { P *n = palloc(); n->end = 0; n->ptr = NULL; n->owner = o; enquef(P, link, p, n); pset(n, p); if (*o) prm(*o); *o = n; return n; } void prm(P *p) { if (!p) return; if (p->owner) *p->owner = NULL; if (p->ptr) vunlock(p->ptr); pfree(deque_f(P, link, p)); } P *pset(P *n, P *p) { if (n != p) { n->b = p->b; n->ofst = p->ofst; n->hdr = p->hdr; if (n->ptr) vunlock(n->ptr); if (p->ptr) { n->ptr = p->ptr; vupcount(n->ptr); } else n->ptr = vlock(vmem, n->hdr->seg); n->byte = p->byte; n->line = p->line; n->col = p->col; n->valcol = p->valcol; } return n; } P *p_goto_bof(P *p) { return pset(p, p->b->bof); } P *p_goto_eof(P *p) { return pset(p, p->b->eof); } /* is p at the beginning of file? */ int pisbof(P *p) { return p->hdr == p->b->bof->hdr && !p->ofst; } /* is p at the end of file? */ int piseof(P *p) { return p->ofst == GSIZE(p->hdr); } /* is p at the end of line? */ int piseol(P *p) { int c; if (piseof(p)) return 1; c = brc(p); if (c == '\n') return 1; if (p->b->o.crlf) if (c == '\r') { P *q = pdup(p); pfwrd(q, 1L); if (pgetb(q) == '\n') { prm(q); return 1; } else prm(q); } return 0; } /* is p at the beginning of line? */ int pisbol(P *p) { int c; if (pisbof(p)) return 1; c = prgetb(p); pgetb(p); return c == '\n'; } /* is p at the beginning of word? */ int pisbow(P *p) { P *q = pdup(p); int c = brc(p); int d = prgetc(q); prm(q); if (joe_isalnux(p->b->o.charmap,c) && (!joe_isalnux(p->b->o.charmap,d) || pisbof(p))) return 1; else return 0; } /* is p at the end of word? */ int piseow(P *p) { P *q = pdup(p); int d = brc(q); int c = prgetc(q); prm(q); if (joe_isalnux(p->b->o.charmap,c) && (!joe_isalnux(p->b->o.charmap,d) || piseof(p))) return 1; else return 0; } /* is p on the blank line (ie. full of spaces/tabs)? */ int pisblank(P *p) { P *q = pdup(p); p_goto_bol(q); while (joe_isblank(brc(q))) pgetb(q); if (piseol(q)) { prm(q); return 1; } else { prm(q); return 0; } } /* is p at end of line or spaces followed by end of line? */ int piseolblank(P *p) { P *q = pdup(p); while (joe_isblank(brc(q))) pgetb(q); if (piseol(q)) { prm(q); return 1; } else { prm(q); return 0; } } /* return column of first nonblank character */ long pisindent(P *p) { P *q = pdup(p); long col; p_goto_bol(q); while (joe_isblank(brc(q))) pgetc(q); col = q->col; prm(q); return col; } /* return true if all characters to left of cursor match c */ int pispure(P *p,int c) { P *q = pdup(p); p_goto_bol(q); while (q->byte!=p->byte) if (pgetc(q)!=c) { prm(q); return 0; } prm(q); return 1; } int pnext(P *p) { if (p->hdr == p->b->eof->hdr) { p->ofst = GSIZE(p->hdr); return 0; } p->hdr = p->hdr->link.next; p->ofst = 0; vunlock(p->ptr); p->ptr = vlock(vmem, p->hdr->seg); return 1; } int pprev(P *p) { if (p->hdr == p->b->bof->hdr) { p->ofst = 0; return 0; } p->hdr = p->hdr->link.prev; p->ofst = GSIZE(p->hdr); vunlock(p->ptr); p->ptr = vlock(vmem, p->hdr->seg); return 1; } /* return current byte and move p to the next byte. column will be unchanged. */ int pgetb(P *p) { unsigned char c; if (p->ofst == GSIZE(p->hdr)) return NO_MORE_DATA; c = GCHAR(p); if (++p->ofst == GSIZE(p->hdr)) pnext(p); ++p->byte; if (c == '\n') { ++(p->line); p->col = 0; p->valcol = 1; } else if (p->b->o.crlf && c == '\r') { if (brc(p) == '\n') return pgetb(p); else p->valcol = 0; } else { p->valcol = 0; } return (int)((unsigned int)c); } /* * return current character and move p to the next character. * column will be updated if it was valid. */ int pgetc(P *p) { int c, b, w, valcol; /* remember whether column number was valid */ valcol = p->valcol; /* get first byte */ if ((b = pgetb(p)) == NO_MORE_DATA) return (b); if (joe_maputf(p->b->o.charmap)) { struct utf8_sm utf8_sm; utf8_init(&utf8_sm); decode: switch ((c = utf8_decode(&utf8_sm, b))) { case -1: if ((b = brc(p)) != NO_MORE_DATA && /* due to pgetb() interpreting control chars */ (b & 0x80)) { pgetb(p); goto decode; } --utf8_sm.ptr; /* FALLTHROUGH */ case -2: pbkwd(p, utf8_sm.ptr); c = 0x80000000 | (int)((unsigned int)utf8_sm.buf[0]); w = 1; break; case -3: c = 0x80000000 | b; w = 1; break; default: w = joe_wcwidth(c); break; } } else { c = b; w = 1; } /* update column number if it was valid to start with */ if (valcol) { p->valcol = 1; switch (c) { case '\t': p->col += p->b->o.tab - p->col % p->b->o.tab; break; case '\n': p->col = 0; break; default: p->col += w; break; } } return (c); } /* move p n characters forward */ P *pfwrd(P *p, long n) { if (!n) return p; p->valcol = 0; do { if (p->ofst == GSIZE(p->hdr)) do { if (!p->ofst) { p->byte += GSIZE(p->hdr); n -= GSIZE(p->hdr); p->line += p->hdr->nlines; } if (!pnext(p)) return NULL; } while (n > GSIZE(p->hdr)); if (GCHAR(p) == '\n') ++p->line; ++p->byte; ++p->ofst; } while (--n); if (p->ofst == GSIZE(p->hdr)) pnext(p); return p; } /* move p to the previous byte: does not take into account -crlf mode */ static int prgetb1(P *p) { unsigned char c; if (!p->ofst) if (!pprev(p)) return NO_MORE_DATA; --p->ofst; c = GCHAR(p); --p->byte; p->valcol = 0; if (c == '\n') --p->line; return (c & 0xFF); } /* move p to the previous byte */ int prgetb(P *p) { int c = prgetb1(p); if (p->b->o.crlf && c == '\n') { c = prgetb1(p); if (c == '\r') return '\n'; if (c != NO_MORE_DATA) pgetb(p); c = '\n'; } return c; } /* move p to the previous character (try to keep col updated) */ int prgetc(P *p) { P *q, *r; if (!joe_maputf(p->b->o.charmap) || pisbol(p)) return (prgetb(p)); q = pdup(p); p_goto_bol(q); r = pdup(q); while (q->byte < p->byte) { pset(r, q); pgetc(q); } pset(p, r); prm(r); prm(q); return (brch_u8(p)); } /* move p n characters backwards */ P *pbkwd(P *p, long n) { if (!n) return p; p->valcol = 0; do { if (!p->ofst) do { if (p->ofst) { p->byte -= p->ofst; n -= p->ofst; p->line -= p->hdr->nlines; } if (!pprev(p)) return NULL; } while (n > GSIZE(p->hdr)); --p->ofst; --p->byte; if (GCHAR(p) == '\n') --p->line; } while (--n); return p; } /* move p n characters forwards/backwards according to loc */ P *pgoto(P *p, long loc) { if (loc > p->byte) pfwrd(p, loc - p->byte); else if (loc < p->byte) pbkwd(p, p->byte - loc); return p; } /* make p->col valid */ P *pfcol(P *p) { long pos = p->byte; p_goto_bol(p); while (p->byte < pos) pgetc(p); return p; } /* move p to the beginning of line */ P *p_goto_bol(P *p) { if (pprevl(p)) pgetb(p); p->col = 0; p->valcol = 1; return p; } /* move p to the indentation point */ P *p_goto_indent(P *p, int c) { int d; p_goto_bol(p); while ((d=brc(p)), d==c || ((c==' ' || c=='\t') && (d==' ' || d=='\t'))) pgetc(p); return p; } /* move p to the end of line */ P *p_goto_eol(P *p) { if (p->b->o.crlf || joe_maputf(p->b->o.charmap)) while (!piseol(p)) pgetc(p); else while (p->ofst != GSIZE(p->hdr)) { unsigned char c; c = GCHAR(p); if (c == '\n') break; else { ++p->byte; ++p->ofst; if (c == '\t') p->col += p->b->o.tab - p->col % p->b->o.tab; else ++p->col; if (p->ofst == GSIZE(p->hdr)) pnext(p); } } return p; } /* move p to the beginning of next line */ P *pnextl(P *p) { int c; do { if (p->ofst == GSIZE(p->hdr)) do { p->byte += GSIZE(p->hdr) - p->ofst; if (!pnext(p)) return NULL; } while (!p->hdr->nlines); c = GCHAR(p); ++p->byte; ++p->ofst; } while (c != '\n'); ++p->line; p->col = 0; p->valcol = 1; if (p->ofst == GSIZE(p->hdr)) pnext(p); return p; } /* move p to the end of previous line */ P *pprevl(P *p) { int c; p->valcol = 0; do { if (!p->ofst) do { p->byte -= p->ofst; if (!pprev(p)) return NULL; } while (!p->hdr->nlines); --p->ofst; --p->byte; c = GCHAR(p); } while (c != '\n'); --p->line; if (p->b->o.crlf && c == '\n') { int k = prgetb1(p); if (k != '\r' && k != NO_MORE_DATA) pgetb(p); } return p; } /* move p to the given 'line' line */ P *pline(P *p, long line) { if (line > p->b->eof->line) { pset(p, p->b->eof); return p; } if (line < labs(p->line - line)) pset(p, p->b->bof); if (labs(p->b->eof->line - line) < labs(p->line - line)) pset(p, p->b->eof); if (p->line == line) { p_goto_bol(p); return p; } while (line > p->line) pnextl(p); if (line < p->line) { while (line < p->line) pprevl(p); p_goto_bol(p); } return p; } /* move p to the given 'goalcol' column */ /* lands at exact column or on character which would cause us to go past goalcol */ P *pcol(P *p, long goalcol) { p_goto_bol(p); if(joe_maputf(p->b->o.charmap)) { do { int c; int wid; c = brch_u8(p); if (c == NO_MORE_DATA) break; if (c == '\n') break; if (p->b->o.crlf && c == '\r' && piseol(p)) break; if (c == '\t') wid = p->b->o.tab - p->col % p->b->o.tab; else wid = joe_wcwidth(c); if (p->col + wid > goalcol) break; pgetc(p); } while (p->col != goalcol); } else { do { unsigned char c; int wid; if (p->ofst == GSIZE(p->hdr)) break; c = GCHAR(p); if (c == '\n') break; if (p->b->o.crlf && c == '\r' && piseol(p)) break; if (c == '\t') wid = p->b->o.tab - p->col % p->b->o.tab; else wid = 1; if (p->col + wid > goalcol) break; if (++p->ofst == GSIZE(p->hdr)) pnext(p); ++p->byte; p->col += wid; } while (p->col != goalcol); } return p; } /* Move to goal column, then skip backwards to just after first non-whitespace character */ P *pcolwse(P *p, long goalcol) { int c; pcol(p, goalcol); do { c = prgetc(p); } while (c == ' ' || c == '\t'); if (c != NO_MORE_DATA) pgetc(p); return p; } /* Move p to goalcol: stops after first character which equals or exceeds goal col (unlike pcol() which will stops before character which would exceed goal col) */ P *pcoli(P *p, long goalcol) { p_goto_bol(p); if (joe_maputf(p->b->o.charmap)) { while (p->col < goalcol) { int c; c = brc(p); if (c == NO_MORE_DATA) break; if (c == '\n') break; if (p->b->o.crlf && c=='\r' && piseol(p)) break; pgetc(p); } } else { while (p->col < goalcol) { unsigned char c; if (p->ofst == GSIZE(p->hdr)) break; c = GCHAR(p); if (c == '\n') break; if (p->b->o.crlf && c == '\r' && piseol(p)) break; if (c == '\t') p->col += p->b->o.tab - p->col % p->b->o.tab; else ++p->col; if (++p->ofst == GSIZE(p->hdr)) pnext(p); ++p->byte; } } return p; } /* fill space between curent column and 'to' column with tabs/spaces */ void pfill(P *p, long to, int usetabs) { if (usetabs=='\t') while (piscol(p) < to) if (p->col + p->b->o.tab - p->col % p->b->o.tab <= to) { binsc(p, '\t'); pgetc(p); } else { binsc(p, ' '); pgetc(p); } else while (piscol(p) < to) { binsc(p, usetabs); pgetc(p); } } /* delete sequence of whitespaces - backwards */ void pbackws(P *p) { int c; P *q = pdup(p); do { c = prgetc(q); } while (c == ' ' || c == '\t'); if (c != NO_MORE_DATA) pgetc(q); bdel(q, p); prm(q); } static int frgetc(P *p) { if (!p->ofst) pprev(p); --p->ofst; return GCHAR(p); } static void ffwrd(P *p, int n) { while (n > GSIZE(p->hdr) - p->ofst) { n -= GSIZE(p->hdr) - p->ofst; if (!pnext(p)) return; } if ((p->ofst += n) == GSIZE(p->hdr)) pnext(p); } /* forward find pattern 's' in text pointed by 'p' (Boyer-Moore algorithm) */ static P *ffind(P *p, unsigned char *s, int len) { long amnt = p->b->eof->byte - p->byte; int x; unsigned char table[256], c; if (len > amnt) return NULL; if (!len) return p; p->valcol = 0; mset(table, 255, 256); for (x = 0; x != len - 1; ++x) table[s[x]] = x; ffwrd(p, len); amnt -= len; x = len; do { if ((c = frgetc(p)) != s[--x]) { if (table[c] == 255) { ffwrd(p, len + 1); amnt -= x + 1; } else if (x <= table[c]) { ffwrd(p, len - x + 1); --amnt; } else { ffwrd(p, len - table[c]); amnt -= x - table[c]; } if (amnt < 0) return NULL; else x = len; } } while (x); return p; } /* forward find (case insensitive) pattern 's' in text pointed by 'p' (Boyer-Moore algorithm) */ static P *fifind(P *p, unsigned char *s, int len) { long amnt = p->b->eof->byte - p->byte; int x; union charmap *map = p->b->o.charmap; unsigned char table[256], c; if (len > amnt) return NULL; if (!len) return p; p->valcol = 0; mset(table, 255, 256); for (x = 0; x != len - 1; ++x) table[s[x]] = x; ffwrd(p, len); amnt -= len; x = len; do { if ((c = joe_tolower(map,frgetc(p))) != s[--x]) { if (table[c] == 255) { ffwrd(p, len + 1); amnt -= x + 1; } else if (x <= table[c]) { ffwrd(p, len - x + 1); --amnt; } else { ffwrd(p, len - table[c]); amnt -= x - table[c]; } if (amnt < 0) return NULL; else x = len; } } while (x); return p; } /* move cursor p to q's position and set p's col, line, ofst, byte etc. accordingly */ /* same as rgetto() but p is before q */ static P *getto(P *p, P *q) { while (p->hdr != q->hdr || p->ofst != q->ofst) { if (GCHAR(p) == '\n') ++p->line; ++p->byte; ++p->ofst; if (p->ofst == GSIZE(p->hdr)) pnext(p); while (!p->ofst && p->hdr != q->hdr) { p->byte += GSIZE(p->hdr); p->line += p->hdr->nlines; pnext(p); } } return p; } /* find forward substring s in text pointed by p and set p after found substring */ P *pfind(P *p, unsigned char *s, int len) { P *q = pdup(p); if (ffind(q, s, len)) { getto(p, q); prm(q); return p; } else { prm(q); return NULL; } } /* same as pfind() but case insensitive */ P *pifind(P *p, unsigned char *s, int len) { P *q = pdup(p); if (fifind(q, s, len)) { getto(p, q); prm(q); return p; } else { prm(q); return NULL; } } static void fbkwd(P *p, int n) { while (n > p->ofst) { n -= p->ofst; if (!pprev(p)) return; } if (p->ofst >= n) p->ofst -= n; else p->ofst = 0; } static int fpgetc(P *p) { int c; if (p->ofst == GSIZE(p->hdr)) return NO_MORE_DATA; c = GCHAR(p); if (++p->ofst == GSIZE(p->hdr)) pnext(p); return c; } /* backward find pattern 's' in text pointed by 'p' (Boyer-Moore algorithm) */ static P *frfind(P *p, unsigned char *s, int len) { long amnt = p->byte; int x; unsigned char table[256], c; if (len > p->b->eof->byte - p->byte) { x = len - (p->b->eof->byte - p->byte); if (amnt < x) return NULL; amnt -= x; fbkwd(p, x); } if (!len) return p; p->valcol = 0; mset(table, 255, 256); for (x = len; --x; table[s[x]] = len - x - 1) ; x = 0; do { if ((c = fpgetc(p)) != s[x++]) { if (table[c] == 255) { fbkwd(p, len + 1); amnt -= len - x + 1; } else if (len - table[c] <= x) { fbkwd(p, x + 1); --amnt; } else { fbkwd(p, len - table[c]); amnt -= len - table[c] - x; } if (amnt < 0) return NULL; else x = 0; } } while (x != len); fbkwd(p, len); return p; } /* backward find (case insensitive) pattern 's' in text pointed by 'p' (Boyer-Moore algorithm) */ static P *frifind(P *p, unsigned char *s, int len) { long amnt = p->byte; int x; unsigned char table[256], c; union charmap *map = p->b->o.charmap; if (len > p->b->eof->byte - p->byte) { x = len - (p->b->eof->byte - p->byte); if (amnt < x) return NULL; amnt -= x; fbkwd(p, x); } if (!len) return p; p->valcol = 0; mset(table, 255, 256); for (x = len; --x; table[s[x]] = len - x - 1) ; x = 0; do { if ((c = joe_tolower(map,fpgetc(p))) != s[x++]) { if (table[c] == 255) { fbkwd(p, len + 1); amnt -= len - x + 1; } else if (len - table[c] <= x) { fbkwd(p, x + 1); --amnt; } else { fbkwd(p, len - table[c]); amnt -= len - table[c] - x; } if (amnt < 0) return NULL; else x = 0; } } while (x != len); fbkwd(p, len); return p; } /* move cursor p to q's position and set p's col, line, ofst, byte etc. accordingly */ /* same as getto() but q is before p */ static P *rgetto(P *p, P *q) { while (p->hdr != q->hdr || p->ofst != q->ofst) { if (!p->ofst) do { if (p->ofst) { p->byte -= p->ofst; p->line -= p->hdr->nlines; } pprev(p); } while (p->hdr != q->hdr); --p->ofst; --p->byte; if (GCHAR(p) == '\n') --p->line; } return p; } /* find backward substring s in text pointed by p and set p on the first of found substring */ P *prfind(P *p, unsigned char *s, int len) { P *q = pdup(p); if (frfind(q, s, len)) { rgetto(p, q); prm(q); return p; } else { prm(q); return NULL; } } /* same as prfind() but case insensitive */ P *prifind(P *p, unsigned char *s, int len) { P *q = pdup(p); if (frifind(q, s, len)) { rgetto(p, q); prm(q); return p; } else { prm(q); return NULL; } } /* copy text between 'from' and 'to' into new buffer */ B *bcpy(P *from, P *to) { H anchor, *l; unsigned char *ptr; P *q; if (from->byte >= to->byte) return bmk(from->b); q = pdup(from); izque(H, link, &anchor); if (q->hdr == to->hdr) { l = halloc(); ptr = vlock(vmem, l->seg); if (q->ofst != q->hdr->hole) gstgap(q->hdr, q->ptr, q->ofst); l->nlines = mcnt(q->ptr + q->hdr->ehole, '\n', l->hole = to->ofst - q->ofst); mmove(ptr, q->ptr + q->hdr->ehole, l->hole); vchanged(ptr); vunlock(ptr); enqueb(H, link, &anchor, l); } else { l = halloc(); ptr = vlock(vmem, l->seg); if (q->ofst != q->hdr->hole) gstgap(q->hdr, q->ptr, q->ofst); l->nlines = mcnt(q->ptr + q->hdr->ehole, '\n', l->hole = SEGSIZ - q->hdr->ehole); mmove(ptr, q->ptr + q->hdr->ehole, l->hole); vchanged(ptr); vunlock(ptr); enqueb(H, link, &anchor, l); pnext(q); while (q->hdr != to->hdr) { l = halloc(); ptr = vlock(vmem, l->seg); l->nlines = q->hdr->nlines; mmove(ptr, q->ptr, q->hdr->hole); mmove(ptr + q->hdr->hole, q->ptr + q->hdr->ehole, SEGSIZ - q->hdr->ehole); l->hole = GSIZE(q->hdr); vchanged(ptr); vunlock(ptr); enqueb(H, link, &anchor, l); pnext(q); } if (to->ofst) { l = halloc(); ptr = vlock(vmem, l->seg); if (to->ofst != to->hdr->hole) gstgap(to->hdr, to->ptr, to->ofst); l->nlines = mcnt(to->ptr, '\n', to->ofst); mmove(ptr, to->ptr, l->hole = to->ofst); vchanged(ptr); vunlock(ptr); enqueb(H, link, &anchor, l); } } l = anchor.link.next; deque(H, link, &anchor); prm(q); return bmkchn(l, from->b, to->byte - from->byte, to->line - from->line); } /* Coalesce small blocks into a single larger one */ void pcoalesce(P *p) { if (p->hdr != p->b->eof->hdr && GSIZE(p->hdr) + GSIZE(p->hdr->link.next) <= SEGSIZ - SEGSIZ / 4) { H *hdr = p->hdr->link.next; unsigned char *ptr = vlock(vmem, hdr->seg); int osize = GSIZE(p->hdr); int size = GSIZE(hdr); P *q; gstgap(hdr, ptr, size); ginsm(p->hdr, p->ptr, GSIZE(p->hdr), ptr, size); p->hdr->nlines += hdr->nlines; vunlock(ptr); hfree(deque_f(H, link, hdr)); for (q = p->link.next; q != p; q = q->link.next) if (q->hdr == hdr) { q->hdr = p->hdr; if (q->ptr) { vunlock(q->ptr); q->ptr = vlock(vmem, q->hdr->seg); } q->ofst += osize; } } if (p->hdr != p->b->bof->hdr && GSIZE(p->hdr) + GSIZE(p->hdr->link.prev) <= SEGSIZ - SEGSIZ / 4) { H *hdr = p->hdr->link.prev; unsigned char *ptr = vlock(vmem, hdr->seg); int size = GSIZE(hdr); P *q; gstgap(hdr, ptr, size); ginsm(p->hdr, p->ptr, 0, ptr, size); p->hdr->nlines += hdr->nlines; vunlock(ptr); hfree(deque_f(H, link, hdr)); p->ofst += size; for (q = p->link.next; q != p; q = q->link.next) if (q->hdr == hdr) { q->hdr = p->hdr; if (q->ptr) vunlock(q->ptr); q->ptr = vlock(vmem, q->hdr->seg); } else if (q->hdr == p->hdr) q->ofst += size; } } /* Delete the text between two pointers from a buffer and return it in a new * buffer. * * This routine calls these functions: * gstgap - to position gaps * halloc - to allocate new header/segment pairs * vlock - virtual memory routines * vunlock * vchanged * vupcount * mcnt - to count NLs * snip - queue routines * enqueb * splicef * scrdel - to tell screen update to scroll when NLs are deleted * bmkchn - to make a buffer out of a chain */ /* This is only to be used for bdel() */ static B *bcut(P *from, P *to) { H *h, /* The deleted text */ *i; unsigned char *ptr; P *p; long nlines; /* No. EOLs to delete */ long amnt; /* No. bytes to delete */ int toamnt; /* Amount to delete from segment in 'to' */ int bofmove = 0; /* Set if bof got deleted */ if (!(amnt = to->byte - from->byte)) return NULL; /* ...nothing to delete */ nlines = to->line - from->line; if (from->hdr == to->hdr) { /* Delete is within a single segment */ /* Move gap to deletion point */ if (from->ofst != from->hdr->hole) gstgap(from->hdr, from->ptr, from->ofst); /* Store the deleted text */ h = halloc(); ptr = vlock(vmem, h->seg); mmove(ptr, from->ptr + from->hdr->ehole, (int) amnt); h->hole = amnt; h->nlines = nlines; vchanged(ptr); vunlock(ptr); /* Delete */ from->hdr->ehole += amnt; from->hdr->nlines -= nlines; toamnt = amnt; } else { /* Delete crosses segments */ H *a; if ((toamnt = to->ofst) != 0) { /* Delete beginning of to */ /* Move gap to deletion point */ /* To could be deleted if it's at the end of the file */ if (to->ofst != to->hdr->hole) gstgap(to->hdr, to->ptr, to->ofst); /* Save deleted text */ i = halloc(); ptr = vlock(vmem, i->seg); mmove(ptr, to->ptr, to->hdr->hole); i->hole = to->hdr->hole; i->nlines = mcnt(to->ptr, '\n', to->hdr->hole); vchanged(ptr); vunlock(ptr); /* Delete */ to->hdr->nlines -= i->nlines; to->hdr->hole = 0; } else i = 0; /* Delete end of from */ if (!from->ofst) { /* ... unless from needs to be deleted too */ a = from->hdr->link.prev; h = NULL; if (a == from->b->eof->hdr) bofmove = 1; } else { a = from->hdr; /* Move gap to deletion point */ if (from->ofst != from->hdr->hole) gstgap(from->hdr, from->ptr, from->ofst); /* Save deleted text */ h = halloc(); ptr = vlock(vmem, h->seg); mmove(ptr, from->ptr + from->hdr->ehole, SEGSIZ - from->hdr->ehole); h->hole = SEGSIZ - from->hdr->ehole; h->nlines = mcnt(ptr, '\n', h->hole); vchanged(ptr); vunlock(ptr); /* Delete */ from->hdr->nlines -= h->nlines; from->hdr->ehole = SEGSIZ; } /* Make from point to header/segment of to */ from->hdr = to->hdr; vunlock(from->ptr); from->ptr = to->ptr; vupcount(to->ptr); from->ofst = 0; /* Delete headers/segments between a and to->hdr (if there are any) */ if (a->link.next != to->hdr) if (!h) { h = snip(H, link, a->link.next, to->hdr->link.prev); if (i) enqueb(H, link, h, i); } else { H *hs = snip(H, link, a->link.next, to->hdr->link.prev); splicef(H, link, h, hs); if (i) enqueb(H, link, h, i); } else if (!h) h = i; else if (i) enqueb(H, link, h, i); } /* If to is empty, then it must have been at the end of the file. If the file did not become empty, delete to */ if (!GSIZE(to->hdr) && from->byte) { H *ph = from->hdr->link.prev; hfree(deque_f(H, link, from->hdr)); vunlock(from->ptr); from->hdr = ph; from->ptr = vlock(vmem, from->hdr->seg); from->ofst = GSIZE(ph); vunlock(from->b->eof->ptr); from->b->eof->ptr = from->ptr; vupcount(from->ptr); from->b->eof->hdr = from->hdr; from->b->eof->ofst = from->ofst; } /* The deletion is now done */ /* Scroll if necessary */ if (bofmove) pset(from->b->bof, from); if (nlines && !pisbol(from)) { scrdel(from->b, from->line, nlines, 1); delerr(from->b->name, from->line, nlines); } else { scrdel(from->b, from->line, nlines, 0); delerr(from->b->name, from->line, nlines); } /* Fix pointers */ for (p = from->link.next; p != from; p = p->link.next) if (p->line == from->line && p->byte > from->byte) p->valcol = 0; for (p = from->link.next; p != from; p = p->link.next) { if (p->byte >= from->byte) { if (p->byte <= from->byte + amnt) { if (p->ptr) { pset(p, from); } else { poffline(pset(p, from)); } } else { if (p->hdr == to->hdr) p->ofst -= toamnt; p->byte -= amnt; p->line -= nlines; } } } pcoalesce(from); /* Make buffer out of deleted text and return it */ return bmkchn(h, from->b, amnt, nlines); } void bdel(P *from, P *to) { if (to->byte - from->byte) { B *b = bcut(from, to); if (from->b->undo) undodel(from->b->undo, from->byte, b); else brm(b); from->b->changed = 1; } } /* Split a block at p's ofst */ /* p is placed in the new block such that it points to the same text but with * p->ofst==0 */ static void bsplit(P *p) { if (p->ofst) { H *hdr; unsigned char *ptr; P *pp; hdr = halloc(); ptr = vlock(vmem, hdr->seg); if (p->ofst != p->hdr->hole) gstgap(p->hdr, p->ptr, p->ofst); mmove(ptr, p->ptr + p->hdr->ehole, SEGSIZ - p->hdr->ehole); hdr->hole = SEGSIZ - p->hdr->ehole; hdr->nlines = mcnt(ptr, '\n', hdr->hole); p->hdr->nlines -= hdr->nlines; vchanged(ptr); p->hdr->ehole = SEGSIZ; enquef(H, link, p->hdr, hdr); vunlock(p->ptr); for (pp = p->link.next; pp != p; pp = pp->link.next) if (pp->hdr == p->hdr && pp->ofst >= p->ofst) { pp->hdr = hdr; if (pp->ptr) { vunlock(pp->ptr); pp->ptr = ptr; vupcount(ptr); } pp->ofst -= p->ofst; } p->ptr = ptr; p->hdr = hdr; p->ofst = 0; } } /* Make a chain out of a block of memory (the block must not be empty) */ static H *bldchn(const unsigned char *blk, int size, long *nlines) { H anchor, *l; *nlines = 0; izque(H, link, &anchor); do { unsigned char *ptr; int amnt; ptr = vlock(vmem, (l = halloc())->seg); if (size > SEGSIZ) amnt = SEGSIZ; else amnt = size; mmove(ptr, blk, amnt); l->hole = amnt; l->ehole = SEGSIZ; (*nlines) += (l->nlines = mcnt(ptr, '\n', amnt)); vchanged(ptr); vunlock(ptr); enqueb(H, link, &anchor, l); blk += amnt; size -= amnt; } while (size); l = anchor.link.next; deque(H, link, &anchor); #ifdef CLANG_SCAN_BUILD /* this can only be fixed properly by using ({ … }) in queue.h */ ITEM = NULL; QUEUE = NULL; #endif return l; } /* Insert a chain into a buffer (this does not update pointers) */ static void inschn(P *p, H *a) { if (!p->b->eof->byte) { /* P's buffer is empty: replace the empty segment in p with a */ hfree(p->hdr); p->hdr = a; vunlock(p->ptr); p->ptr = vlock(vmem, a->seg); pset(p->b->bof, p); p->b->eof->hdr = a->link.prev; vunlock(p->b->eof->ptr); p->b->eof->ptr = vlock(vmem, p->b->eof->hdr->seg); p->b->eof->ofst = GSIZE(p->b->eof->hdr); } else if (piseof(p)) { /* We're at the end of the file: append a to the file */ p->b->eof->hdr = a->link.prev; spliceb(H, link, p->b->bof->hdr, a); vunlock(p->b->eof->ptr); p->b->eof->ptr = vlock(vmem, p->b->eof->hdr->seg); p->b->eof->ofst = GSIZE(p->b->eof->hdr); p->hdr = a; vunlock(p->ptr); p->ptr = vlock(vmem, p->hdr->seg); p->ofst = 0; } else if (pisbof(p)) { /* We're at the beginning of the file: insert chain and set bof pointer */ p->hdr = spliceb_f(H, link, p->hdr, a); vunlock(p->ptr); p->ptr = vlock(vmem, a->seg); pset(p->b->bof, p); } else { /* We're in the middle of the file: split and insert */ bsplit(p); p->hdr = spliceb_f(H, link, p->hdr, a); vunlock(p->ptr); p->ptr = vlock(vmem, a->seg); } } static void fixupins(P *p, long amnt, long nlines, H *hdr, int hdramnt) { P *pp; if (nlines && !pisbol(p)) scrins(p->b, p->line, nlines, 1); else scrins(p->b, p->line, nlines, 0); inserr(p->b->name, p->line, nlines, pisbol(p)); /* FIXME: last arg ??? */ for (pp = p->link.next; pp != p; pp = pp->link.next) if (pp->line == p->line && (pp->byte > p->byte || (pp->end && pp->byte == p->byte))) pp->valcol = 0; for (pp = p->link.next; pp != p; pp = pp->link.next) if (pp->byte == p->byte && !pp->end) if (pp->ptr) pset(pp, p); else poffline(pset(pp, p)); else if (pp->byte > p->byte || (pp->end && pp->byte == p->byte)) { pp->byte += amnt; pp->line += nlines; if (pp->hdr == hdr) pp->ofst += hdramnt; } if (p->b->undo) undoins(p->b->undo, p, amnt); p->b->changed = 1; } /* Insert a buffer at pointer position (the buffer goes away) */ P *binsb(P *p, B *b) { if (b->eof->byte) { P *q = pdup(p); inschn(q, b->bof->hdr); b->eof->hdr = halloc(); fixupins(q, b->eof->byte, b->eof->line, NULL, 0); pcoalesce(q); prm(q); } brm(b); return p; } /* insert memory block 'blk' at 'p' */ P *binsm(P *p, const unsigned char *blk, int amnt) { long nlines; H *h = NULL; int hdramnt = 0; P *q; if (!amnt) return p; q = pdup(p); if (amnt <= GGAPSZ(q->hdr)) { h = q->hdr; hdramnt = amnt; ginsm(q->hdr, q->ptr, q->ofst, blk, amnt); q->hdr->nlines += (nlines = mcnt(blk, '\n', amnt)); } else if (!q->ofst && q->hdr != q->b->bof->hdr && amnt <= GGAPSZ(q->hdr->link.prev)) { pprev(q); ginsm(q->hdr, q->ptr, q->ofst, blk, amnt); q->hdr->nlines += (nlines = mcnt(blk, '\n', amnt)); } else { H *a = bldchn(blk, amnt, &nlines); inschn(q, a); } fixupins(q, (long) amnt, nlines, h, hdramnt); pcoalesce(q); prm(q); return p; } /* insert byte 'c' at 'p' */ P *binsbyte(P *p, unsigned char c) { if (p->b->o.crlf && c == '\n') return binsm(p, UC "\r\n", 2); else return binsm(p, &c, 1); } /* UTF-8 encode a character and insert it */ P *binsc(P *p, int c) { if (c>127 && joe_maputf(p->b->o.charmap)) { unsigned char buf[8]; int len = utf8_encode(buf,c); return binsm(p,buf,len); } else { unsigned char ch = c; if (p->b->o.crlf && c == '\n') return binsm(p, UC "\r\n", 2); else return binsm(p, &ch, 1); } } /* insert zero-terminated string 's' at 'p' */ P *binss(P *p, unsigned char *s) { return binsm(p, s, strlen((char *)s)); } /* Read 'size' bytes from file or stream. Stops and returns amnt. read * when requested size has been read or when end of file condition occurs. * Returns with -2 in error for read error or 0 in error for success. */ static int bkread(int fi, unsigned char *buff, int size) { int a, b; if (!size) { error = 0; return 0; } for (a = b = 0; (a < size) && ((b = joe_read(fi, buff + a, size - a)) > 0); a += b) ; if (b < 0) error = -2; else error = 0; return a; } /* Read up to 'max' bytes from a file into a buffer */ /* Returns with 0 in error or -2 in error for read error */ B *bread(int fi, long int max) { H anchor, *l; long lines = 0, total = 0; int amnt; unsigned char *seg; izque(H, link, &anchor); error = 0; while (seg = vlock(vmem, (l = halloc())->seg), !error && (amnt = bkread(fi, seg, max >= SEGSIZ ? SEGSIZ : (int) max))) { total += amnt; max -= amnt; l->hole = amnt; lines += (l->nlines = mcnt(seg, '\n', amnt)); vchanged(seg); vunlock(seg); enqueb(H, link, &anchor, l); } hfree(l); vunlock(seg); if (!total) return bmk(NULL); l = anchor.link.next; deque(H, link, &anchor); return bmkchn(l, NULL, total, lines); } /* Parse file name. * * Removes ',xxx,yyy' from end of name and puts their value into skip and amnt * Replaces ~user/ with directory of given user unless -DJOE_NOPWNAM * Replaces ~/ with $HOME * * Returns new variable length string. */ unsigned char * parsens(const unsigned char *s, long int *skip, long int *amnt) { unsigned char *n = vsncpy(NULL, 0, sz(s)); size_t x; *skip = 0; *amnt = LONG_MAX; for (x = sLEN(n) - 1; x > 0 && ((n[x] >= '0' && n[x] <= '9') || (n[x] | 0x20) == 'x'); --x) /* nothing */; if (n[x] == ',') { void *vp; n[x] = 0; *skip = ustol(n + x + 1, &vp, USTOL_EOS); for (--x; x > 0 && ((n[x] >= '0' && n[x] <= '9') || (n[x] | 0x20) == 'x'); --x) /* nothing */; if (n[x] == ',') { n[x] = 0; if (vp != NULL) *amnt = *skip; *skip = ustol(n + x + 1, NULL, USTOL_EOS); } } if (n[0] == '~') { for (x = 1; n[x] && n[x] != '/'; ++x) ; if (n[x] == '/') { if (x == 1) { unsigned char *z; s = (unsigned char *)getenv("HOME"); z = vsncpy(NULL, 0, sz(s)); z = vsncpy(z, sLEN(z), sz(n + x)); vsrm(n); n = z; #ifndef JOE_NOPWNAM } else { struct passwd *passwd; n[x] = 0; passwd = getpwnam((char *)(n + 1)); n[x] = '/'; if (passwd) { unsigned char *z = vsncpy(NULL, 0, sz((unsigned char *)(passwd->pw_dir))); z = vsncpy(z, sLEN(z), sz(n + x)); vsrm(n); n = z; } #endif } } } return n; } /* Load file into new buffer and return the new buffer */ /* Returns with error set to 0 for success, * -1 for new file (file doesn't exist) * -2 for read error * -3 for seek error * -4 for open error */ B * bload(const unsigned char *s) { unsigned char buffer[SEGSIZ]; FILE *fi; B *b = NULL; long skip, amnt; unsigned char *n; int nowrite = 0; P *p; int x; long mod_time = 0; struct stat sbuf; if (!s || !s[0]) { error = -1; b = bmk(NULL); setopt(b, UC ""); b->rdonly = b->o.readonly; b->er = error; return b; } n = parsens(s, &skip, &amnt); /* Open file or stream */ if (s[0] == '!') { nescape(maint->t); ttclsn(); fi = popen((char *)(n + 1), "r"); } else if (!strcmp(n, "-")) fi = stdin; else { fi = fopen((char *)n, "r+"); if (!fi) nowrite = 1; else fclose(fi); fi = fopen((char *)n, "r"); if (!fi) nowrite = 0; else if (!fstat(fileno(fi), &sbuf)) mod_time = sbuf.st_mtime; } #if HAVE_BACKSLASH_PATHS joesep(n); #endif /* Abort if couldn't open */ if (!fi) { if (errno == ENOENT) error = -1; else error = -4; goto opnerr; } /* Skip data if we need to */ if (skip && lseek(fileno(fi), skip, 0) < 0) { int r; while (skip > SEGSIZ) { r = bkread(fileno(fi), buffer, SEGSIZ); if (r != SEGSIZ || error) { error = -3; goto err; } skip -= SEGSIZ; } skip -= bkread(fileno(fi), buffer, (int) skip); if (skip || error) { error = -3; goto err; } } /* Read from stream into new buffer */ b = bread(fileno(fi), amnt); b->mod_time = mod_time; setopt(b,n); b->rdonly = b->o.readonly; /* Close stream */ err: if (s[0] == '!') pclose(fi); else if (strcmp(n, "-")) fclose(fi); opnerr: if (!b) { /* error case */ b = bmk(NULL); setopt(b,n); b->rdonly = b->o.readonly; } if (s[0] == '!') { ttopnn(); nreturn(maint->t); } /* Set name */ b->name = joesep((unsigned char *)strdup(s)); /* Set flags */ if (error || s[0] == '!' || skip || amnt != LONG_MAX) { b->backup = 1; b->changed = 0; } else if (!strcmp(n, "-")) { b->backup = 1; b->changed = 1; } else { b->backup = 0; b->changed = 0; } if (nowrite) b->rdonly = b->o.readonly = 1; /* If first line has CR-LF, assume MS-DOS file */ if (guesscrlf) { p=pdup(b->bof); b->o.crlf = 0; for(x=0;x!=1024;++x) { int c = pgetc(p); if(c == '\r') { b->o.crlf = 1; break; } if(c == '\n') { b->o.crlf = 0; break; } if(c == NO_MORE_DATA) break; } prm(p); } /* Search backwards through file: if first indented line is indented with a tab, assume indentc is tab */ if (guessindent) { p=pdup(b->eof); for (x=0; x!=20; ++x) { p_goto_bol(p); if (pisindent(p)) { if (brc(p)=='\t') { b->o.indentc = '\t'; b->o.istep = 1; } else { b->o.indentc = ' '; b->o.istep = 2; } break; } if (prgetc(p)==NO_MORE_DATA) break; } prm(p); } /* Eliminate parsed name */ vsrm(n); b->er = error; return b; } /* Find already loaded buffer or load file into new buffer */ B * bfind(const unsigned char *s) { B *b; if (!s || !s[0]) { error = -1; b = bmk(NULL); setopt(b, UC ""); b->rdonly = b->o.readonly; b->internal = 0; b->er = error; return b; } for (b = bufs.link.next; b != &bufs; b = b->link.next) if (b->name && !strcmp(s, b->name)) { if (!b->orphan) ++b->count; else b->orphan = 0; error = 0; b->internal = 0; return b; } b = bload(s); b->internal = 0; return b; } /* Find already loaded buffer or load file into new buffer */ B * bfind_scratch(const unsigned char *s) { B *b; if (!s || !s[0]) { error = -1; b = bmk(NULL); setopt(b, UC ""); b->rdonly = b->o.readonly; b->internal = 0; b->er = error; return b; } for (b = bufs.link.next; b != &bufs; b = b->link.next) if (b->name && !strcmp(s, b->name)) { if (!b->orphan) ++b->count; else b->orphan = 0; error = 0; b->internal = 0; return b; } b = bmk(NULL); error = -1; setopt(b,s); b->internal = 0; b->rdonly = b->o.readonly; b->er = error; b->name = (unsigned char *)strdup((const char *)s); b->scratch = 1; return b; } B * bfind_reload(const unsigned char *s) { B *b; b = bload(s); b->internal = 0; return b; } B * bcheck_loaded(const unsigned char *s) { B *b; if (!s || !s[0]) { return NULL; } for (b = bufs.link.next; b != &bufs; b = b->link.next) if (b->name && !strcmp(s, b->name)) { return b; } return NULL; } unsigned char **getbufs(void) { unsigned char **s = vamk(16); B *b; for (b = bufs.link.next; b != &bufs; b = b->link.next) if (b->name) s = vaadd(s, vsncpy(NULL, 0, sz(b->name))); return s; } /* Find an orphaned buffer */ B *borphan(void) { B *b; for (b = bufs.link.next; b != &bufs; b = b->link.next) if (b->orphan) { b->orphan = 0; return b; } return NULL; } /* Write 'size' bytes from file beginning at 'p' to open file 'fd'. * Returns error. * error is set to -5 for write error or 0 for success. * Don't attempt to write past the end of the file */ int bsavefd(P *p, int fd, long int size) { P *np = pdup(p); int amnt; while (size > (amnt = GSIZE(np->hdr) - np->ofst)) { if (np->ofst < np->hdr->hole) { if (joe_write(fd, np->ptr + np->ofst, np->hdr->hole - np->ofst) < 0) goto err; if (joe_write(fd, np->ptr + np->hdr->ehole, SEGSIZ - np->hdr->ehole) < 0) goto err; } else if (joe_write(fd, np->ptr + np->ofst + GGAPSZ(np->hdr), amnt) < 0) goto err; size -= amnt; pnext(np); } if (size) { if (np->ofst < np->hdr->hole) { if (size > np->hdr->hole - np->ofst) { if (joe_write(fd, np->ptr + np->ofst, np->hdr->hole - np->ofst) < 0) goto err; if (joe_write(fd, np->ptr + np->hdr->ehole, (int) size - np->hdr->hole + np->ofst) < 0) goto err; } else { if (joe_write(fd, np->ptr + np->ofst, (int) size) < 0) goto err; } } else { if (joe_write(fd, np->ptr + np->ofst + GGAPSZ(np->hdr), (int) size) < 0) goto err; } } prm(np); return error = 0; err: prm(np); return error = 5; } /* Save 'size' bytes beginning at 'p' in file 's' */ /* If flag is set, update original time of file if it makes * sense to do so (it's a normal file, we're saving with * same name as buffer or is about to get this name). */ int bsave(P *p, unsigned char *s, long int size, int flag) { FILE *f; long skip, amnt; struct stat sbuf; int norm = 0; char closemethod; s = parsens(s, &skip, &amnt); if (amnt < size) size = amnt; if (s[0] == '!') { nescape(maint->t); ttclsn(); f = popen((char *)(s + 1), "w"); closemethod = 2; } else if (s[0] == '>' && s[1] == '>') { f = fopen((char *)(s + 2), "a"); closemethod = 1; } else if (!strcmp(s, "-")) { nescape(maint->t); ttclsn(); f = stdout; closemethod = 3; } else if (skip || amnt != LONG_MAX) { f = fopen((char *)s, "r+"); closemethod = 1; } else { f = fopen((char *)s, "w"); norm = 1; closemethod = 1; } #if HAVE_BACKSLASH_PATHS joesep(s); #endif if (!f) { error = -4; goto opnerr; } fflush(f); if (skip && lseek(fileno(f), skip, 0) < 0) { error = -3; goto err; } bsavefd(p, fileno(f), size); if (!error && force && size && !skip && amnt == LONG_MAX) { P *q = pdup(p); unsigned char nl = '\n'; pfwrd(q, size - 1); if (brc(q) != '\n' && joe_write(fileno(f), &nl, 1) < 0) error = -5; prm(q); } err: switch (closemethod) { case 1: fclose(f); break; case 2: pclose(f); break; case 3: /* do not close stdout */ fflush(f); break; } /* Update orignal date of file */ /* If it's not named, it's about to be */ if (!error && norm && flag && (!p->b->name || !strcmp((char *)s,p->b->name))) { if (!stat((char *)s,&sbuf)) p->b->mod_time = sbuf.st_mtime; } opnerr: if (s[0] == '!' || !strcmp(s, "-")) { ttopnn(); nreturn(maint->t); } return error; } /* Return byte at p */ int brc(P *p) { if (p->ofst == GSIZE(p->hdr)) return NO_MORE_DATA; return ((int)((unsigned int)(unsigned char)GCHAR(p))); } /* Return character at p */ int brch(P *p) { return (joe_maputf(p->b->o.charmap) ? brch_u8(p) : brc(p)); } static int brch_u8(P *p) { P *q = pdup(p); int c = pgetc(q); prm(q); return (c); } unsigned char *brmem(P *p, unsigned char *blk, int size) { unsigned char *bk = blk; P *np; int amnt; np = pdup(p); while (size > (amnt = GSIZE(np->hdr) - np->ofst)) { grmem(np->hdr, np->ptr, np->ofst, bk, amnt); bk += amnt; size -= amnt; pnext(np); } if (size) grmem(np->hdr, np->ptr, np->ofst, bk, size); prm(np); return blk; } unsigned char *brs(P *p, int size) { unsigned char *s = malloc(size + 1); s[size] = 0; return brmem(p, s, size); } unsigned char *brvs(P *p, int size) { unsigned char *s = vstrunc(NULL, size); return brmem(p, (unsigned char *)s, size); } unsigned char *brzs(P *p, unsigned char *buf, int size) { P *q=pdup(p); p_goto_eol(q); if(q->byte-p->bytebyte - p->byte; prm(q); brmem(p,buf,size); buf[size]=0; return buf; } /* Save edit buffers when editor dies */ RETSIGTYPE ttsig(int sig) { ttabrt(sig, NULL); _exit(1); } void ttabrt(int sig, const char *msg) { time_t tim = time(NULL); B *b; FILE *f; int tmpfd; struct stat sbuf; if (msg) { fprintf(stderr, "\r\n*** Aborting JOE because: %s ***\r\n", msg); fflush(stderr); } if ((tmpfd = open("DEADJOE", O_RDWR | O_EXCL | O_CREAT, 0600)) < 0) { struct stat cbuf; if (lstat("DEADJOE", &sbuf) < 0) _exit(-1); if (!S_ISREG(sbuf.st_mode) || sbuf.st_uid != geteuid()) _exit(-1); if ((tmpfd = open("DEADJOE", O_RDWR | O_APPEND)) < 0) _exit(-1); /* https://stackoverflow.com/a/2917482/2171120 */ if (fstat(tmpfd, &cbuf) < 0 || cbuf.st_dev != sbuf.st_dev || cbuf.st_ino != sbuf.st_ino) _exit(-1); if (fchmod(tmpfd, S_IRUSR | S_IWUSR) < 0) _exit(-1); } if ((f = fdopen(tmpfd, "a")) == NULL) _exit(-1); fprintf(f, "\n*** Modified files in JOE when it aborted on %s", ctime(&tim)); if (msg) fprintf(f, "*** JOE was aborted: %s\n", msg); else if (sig) fprintf(f, "*** JOE was aborted by signal %d\n", sig); else fprintf(f, "*** JOE was aborted because the terminal closed\n"); fflush(f); for (b = bufs.link.next; b != &bufs; b = b->link.next) if (b->changed) { if (b->name) fprintf(f, "\n*** File \'%s\'\n", b->name); else fprintf(f, "\n*** File \'(Unnamed)\'\n"); fflush(f); bsavefd(b->bof, fileno(f), b->eof->byte); } fclose(f); if (sig) ttclsn(); } jupp/b.h010064400000000000000000000076771363731763200074110ustar00/* * Editor engine * Copyright * (C) 1992 Joseph H. Allen * * This file is part of JOE (Joe's Own Editor) */ #ifndef JUPP_B_H #define JUPP_B_H #ifdef EXTERN __IDSTRING(rcsid_b_h, "$MirOS: contrib/code/jupp/b.h,v 1.11 2020/03/27 06:38:55 tg Exp $"); #endif extern unsigned char stdbuf[stdsiz]; extern int force; /* Set to have final '\n' added to file */ extern int tabwidth; /* Default tab width */ extern VFILE *vmem; /* Virtual memory file used for buffer system */ extern const unsigned char *msgs[]; B *bmk(B *prop); void brm(B *b); B *bfind(const unsigned char *s); B *bfind_scratch(const unsigned char *s); B *bcheck_loaded(const unsigned char *s); B *bfind_reload(const unsigned char *s); P *pdup(P *p); P *pdupown(P *p, P **o); P *poffline(P *p); P *ponline(P *p); B *bonline(B *b); B *boffline(B *b); void prm(P *p); P *pset(P *n, P *p); P *p_goto_bof(P *p); /* move cursor to begging of file */ P *p_goto_eof(P *p); /* move cursor to end of file */ P *p_goto_bol(P *p); /* move cursor to begging of line */ P *p_goto_eol(P *p); /* move cursor to end of line */ P *p_goto_indent(P *p,int c); /* move cursor to indentation point */ int pisbof(P *p); int piseof(P *p); int piseol(P *p); int pisbol(P *p); int pisbow(P *p); int piseow(P *p); #define piscol(p) ((p)->valcol ? (p)->col : (pfcol(p), (p)->col)) int pisblank(P *p); int piseolblank(P *p); long pisindent(P *p); int pispure(P *p,int c); int pnext(P *p); int pprev(P *p); int pgetb(P *p); int prgetb(P *p); int pgetc(P *p); int prgetc(P *p); P *pgoto(P *p, long int loc); P *pfwrd(P *p, long int n); P *pbkwd(P *p, long int n); P *pfcol(P *p); P *pnextl(P *p); P *pprevl(P *p); P *pline(P *p, long int line); P *pcolwse(P *p, long int goalcol); P *pcol(P *p, long int goalcol); P *pcoli(P *p, long int goalcol); void pbackws(P *p); void pfill(P *p, long int to, int usetabs); P *pfind(P *p, unsigned char *s, int len); P *pifind(P *p, unsigned char *s, int len); P *prfind(P *p, unsigned char *s, int len); P *prifind(P *p, unsigned char *s, int len); /* copy text between 'from' and 'to' into new buffer */ B *bcpy(P *from, P *to); void pcoalesce(P *p); void bdel(P *from, P *to); /* insert buffer 'b' into another at 'p' */ P *binsb(P *p, B *b); /* insert a block 'blk' of size 'amnt' into buffer at 'p' */ P *binsm(P *p, const unsigned char *blk, int amnt); /* insert character 'c' into buffer at 'p' */ P *binsc(P *p, int c); /* insert byte 'c' into buffer at at 'p' */ P *binsbyte(P *p, unsigned char c); /* insert zero term. string 's' into buffer at 'p' */ P *binss(P *p, unsigned char *s); /* B *bload(char *s); * Load a file into a new buffer * * Returns with errno set to 0 for success, * -1 for new file (file doesn't exist) * -2 for read error * -3 for seek error * -4 for open error */ B *bload(const unsigned char *s); B *bread(int fi, long int max); B *borphan(void); /* Save 'size' bytes beginning at 'p' into file with name in 's' */ int bsave(P *p, unsigned char *s, long int size,int flag); int bsavefd(P *p, int fd, long int size); unsigned char *parsens(const unsigned char *s, long int *skip, long int *amnt); /* Get byte at pointer or return NO_MORE_DATA if pointer is at end of buffer */ int brc(P *p); /* Get character at pointer or return NO_MORE_DATA if pointer is at end of buffer */ int brch(P *p); /* Copy 'size' bytes from a buffer beginning at p into block 'blk' */ unsigned char *brmem(P *p, unsigned char *blk, int size); /* Copy 'size' bytes from a buffer beginning at p into a zero-terminated * C-string in an malloc block. */ unsigned char *brs(P *p, int size); /* Copy 'size' bytes from a buffer beginning at p into a variable length string. */ unsigned char *brvs(P *p, int size); /* Copy line into buffer. Maximum of size bytes will be copied. Buffer needs to be one bigger for NIL */ unsigned char *brzs(P *p, unsigned char *buf, int size); B *bnext(void); B *bprev(void); #define error berror extern int berror; unsigned char **getbufs(void); #endif jupp/blocks.c010064400000000000000000000337351322401411100104040ustar00/* * Fast block move/copy subroutines * Copyright * (C) 1992 Joseph H. Allen * * This file is part of JOE (Joe's Own Editor) */ #include "config.h" __RCSID("$MirOS: contrib/code/jupp/blocks.c,v 1.8 2018/01/06 00:28:30 tg Exp $"); /* This module requires ALIGNED and SIZEOF_INT to be defined correctly */ #include "blocks.h" #define BITS 8 #if SIZEOF_INT == 8 # define SHFT 3 #elif SIZEOF_INT == 4 # define SHFT 2 #endif /* Set 'sz' 'int's beginning at 'd' to the value 'c' */ /* Returns address of block. Does nothing if 'sz' equals zero */ int *msetI(void *dest, int c, int sz) { int *d = dest; int *orgd = dest; while (sz >= 16) { d[0] = c; d[1] = c; d[2] = c; d[3] = c; d[4] = c; d[5] = c; d[6] = c; d[7] = c; d[8] = c; d[9] = c; d[10] = c; d[11] = c; d[12] = c; d[13] = c; d[14] = c; d[15] = c; d += 16; sz -= 16; } switch (sz) { case 15: d[14] = c; /* FALLTHROUGH */ case 14: d[13] = c; /* FALLTHROUGH */ case 13: d[12] = c; /* FALLTHROUGH */ case 12: d[11] = c; /* FALLTHROUGH */ case 11: d[10] = c; /* FALLTHROUGH */ case 10: d[9] = c; /* FALLTHROUGH */ case 9: d[8] = c; /* FALLTHROUGH */ case 8: d[7] = c; /* FALLTHROUGH */ case 7: d[6] = c; /* FALLTHROUGH */ case 6: d[5] = c; /* FALLTHROUGH */ case 5: d[4] = c; /* FALLTHROUGH */ case 4: d[3] = c; /* FALLTHROUGH */ case 3: d[2] = c; /* FALLTHROUGH */ case 2: d[1] = c; /* FALLTHROUGH */ case 1: d[0] = c; /* FALLTHROUGH */ case 0: /* do nothing */; } return orgd; } /* Set 'sz' 'int's beginning at 'd' to the value 'c' */ /* Returns address of block. Does nothing if 'sz' equals zero */ void **msetP(void **d, void *c, int sz) { void **orgd = d; while (sz >= 16) { d[0] = c; d[1] = c; d[2] = c; d[3] = c; d[4] = c; d[5] = c; d[6] = c; d[7] = c; d[8] = c; d[9] = c; d[10] = c; d[11] = c; d[12] = c; d[13] = c; d[14] = c; d[15] = c; d += 16; sz -= 16; } switch (sz) { case 15: d[14] = c; /* FALLTHROUGH */ case 14: d[13] = c; /* FALLTHROUGH */ case 13: d[12] = c; /* FALLTHROUGH */ case 12: d[11] = c; /* FALLTHROUGH */ case 11: d[10] = c; /* FALLTHROUGH */ case 10: d[9] = c; /* FALLTHROUGH */ case 9: d[8] = c; /* FALLTHROUGH */ case 8: d[7] = c; /* FALLTHROUGH */ case 7: d[6] = c; /* FALLTHROUGH */ case 6: d[5] = c; /* FALLTHROUGH */ case 5: d[4] = c; /* FALLTHROUGH */ case 4: d[3] = c; /* FALLTHROUGH */ case 3: d[2] = c; /* FALLTHROUGH */ case 2: d[1] = c; /* FALLTHROUGH */ case 1: d[0] = c; /* FALLTHROUGH */ case 0: /* do nothing */; } return orgd; } /* Set 'sz' 'char's beginning at 'd' to the value 'c' */ /* Returns address of block. Does nothing if 'sz' equals zero */ unsigned char *mset(void *dest, unsigned char c, int sz) { unsigned char *d = dest; unsigned char *orgd = dest; if (sz < 16) { switch (sz) { case 15: d[14] = c; /* FALLTHROUGH */ case 14: d[13] = c; /* FALLTHROUGH */ case 13: d[12] = c; /* FALLTHROUGH */ case 12: d[11] = c; /* FALLTHROUGH */ case 11: d[10] = c; /* FALLTHROUGH */ case 10: d[9] = c; /* FALLTHROUGH */ case 9: d[8] = c; /* FALLTHROUGH */ case 8: d[7] = c; /* FALLTHROUGH */ case 7: d[6] = c; /* FALLTHROUGH */ case 6: d[5] = c; /* FALLTHROUGH */ case 5: d[4] = c; /* FALLTHROUGH */ case 4: d[3] = c; /* FALLTHROUGH */ case 3: d[2] = c; /* FALLTHROUGH */ case 2: d[1] = c; /* FALLTHROUGH */ case 1: d[0] = c; /* FALLTHROUGH */ case 0: /* do nothing */; } } else { unsigned z = SIZEOF_INT - ((unsigned long)d & (SIZEOF_INT - 1)); switch (z) { case SIZEOF_INT: break; #if SIZEOF_INT >= 8 case 7: d[6] = c; /* FALLTHROUGH */ case 6: d[5] = c; /* FALLTHROUGH */ case 5: d[4] = c; /* FALLTHROUGH */ case 4: d[3] = c; /* FALLTHROUGH */ #endif case 3: d[2] = c; /* FALLTHROUGH */ case 2: d[1] = c; /* FALLTHROUGH */ case 1: d[0] = c; /* FALLTHROUGH */ case 0: d += z; sz -= z; break; } msetI(d, #if SIZEOF_INT >= 8 (c << (BITS * 7)) + (c << (BITS * 6)) + (c << (BITS * 5)) + (c << (BITS * 4)) + #endif #if SIZEOF_INT >= 4 (c << (BITS * 3)) + (c << (BITS * 2)) + #endif #if SIZEOF_INT >= 2 (c << BITS) + #endif c, sz >> SHFT); d += sz & ~(SIZEOF_INT - 1); switch (sz & (SIZEOF_INT - 1)) { #if SIZEOF_INT >= 8 case 7: d[6] = c; /* FALLTHROUGH */ case 6: d[5] = c; /* FALLTHROUGH */ case 5: d[4] = c; /* FALLTHROUGH */ case 4: d[3] = c; /* FALLTHROUGH */ #endif case 3: d[2] = c; /* FALLTHROUGH */ case 2: d[1] = c; /* FALLTHROUGH */ case 1: d[0] = c; /* FALLTHROUGH */ case 0: /* do nothing */; } } return orgd; } /* Copy a block of integers */ /* Copy from highest address to lowest */ static int *mbkwdI(void *dest, const void *src, int sz) { int *d = dest; const int *s = src; if (d == s) return d; d += sz; s += sz; while (sz >= 16) { d -= 16; s -= 16; d[15] = s[15]; d[14] = s[14]; d[13] = s[13]; d[12] = s[12]; d[11] = s[11]; d[10] = s[10]; d[9] = s[9]; d[8] = s[8]; d[7] = s[7]; d[6] = s[6]; d[5] = s[5]; d[4] = s[4]; d[3] = s[3]; d[2] = s[2]; d[1] = s[1]; d[0] = s[0]; sz -= 16; } d -= sz; s -= sz; switch (sz) { case 15: d[14] = s[14]; /* FALLTHROUGH */ case 14: d[13] = s[13]; /* FALLTHROUGH */ case 13: d[12] = s[12]; /* FALLTHROUGH */ case 12: d[11] = s[11]; /* FALLTHROUGH */ case 11: d[10] = s[10]; /* FALLTHROUGH */ case 10: d[9] = s[9]; /* FALLTHROUGH */ case 9: d[8] = s[8]; /* FALLTHROUGH */ case 8: d[7] = s[7]; /* FALLTHROUGH */ case 7: d[6] = s[6]; /* FALLTHROUGH */ case 6: d[5] = s[5]; /* FALLTHROUGH */ case 5: d[4] = s[4]; /* FALLTHROUGH */ case 4: d[3] = s[3]; /* FALLTHROUGH */ case 3: d[2] = s[2]; /* FALLTHROUGH */ case 2: d[1] = s[1]; /* FALLTHROUGH */ case 1: d[0] = s[0]; /* FALLTHROUGH */ case 0: /* do nothing */; } return d; } /* Copy a block of 'int's. Copy from lowest address to highest */ static int *mfwrdI(void *dest, const void *src, int sz) { int *d = dest; const int *s = src; int *od = d; if (s == d) return d; while (sz >= 16) { d[0] = s[0]; d[1] = s[1]; d[2] = s[2]; d[3] = s[3]; d[4] = s[4]; d[5] = s[5]; d[6] = s[6]; d[7] = s[7]; d[8] = s[8]; d[9] = s[9]; d[10] = s[10]; d[11] = s[11]; d[12] = s[12]; d[13] = s[13]; d[14] = s[14]; d[15] = s[15]; s += 16; d += 16; sz -= 16; } s -= 15 - sz; d -= 15 - sz; switch (sz) { case 15: d[0] = s[0]; /* FALLTHROUGH */ case 14: d[1] = s[1]; /* FALLTHROUGH */ case 13: d[2] = s[2]; /* FALLTHROUGH */ case 12: d[3] = s[3]; /* FALLTHROUGH */ case 11: d[4] = s[4]; /* FALLTHROUGH */ case 10: d[5] = s[5]; /* FALLTHROUGH */ case 9: d[6] = s[6]; /* FALLTHROUGH */ case 8: d[7] = s[7]; /* FALLTHROUGH */ case 7: d[8] = s[8]; /* FALLTHROUGH */ case 6: d[9] = s[9]; /* FALLTHROUGH */ case 5: d[10] = s[10]; /* FALLTHROUGH */ case 4: d[11] = s[11]; /* FALLTHROUGH */ case 3: d[12] = s[12]; /* FALLTHROUGH */ case 2: d[13] = s[13]; /* FALLTHROUGH */ case 1: d[14] = s[14]; /* FALLTHROUGH */ case 0: /* do nothing */; } return od; } /* Copy the block of 'sz' bytes beginning at 's' to 'd'. If 'sz' is zero or * if 's'=='d', nothing happens. The bytes at the highest address ('s'+'sz'-1) * are copied before the ones at the lowest ('s') are. */ static unsigned char *mbkwd(register unsigned char *d, register const unsigned char *s, register int sz) { if (s == d) return d; s += sz; d += sz; #ifdef ALIGNED if (sz >= 16) #else if (((unsigned long)s & (SIZEOF_INT - 1)) == ((unsigned long)d & (SIZEOF_INT - 1)) && sz >= 16) #endif { unsigned z = ((unsigned long) s & (SIZEOF_INT - 1)); s -= z; d -= z; switch (z) { #if SIZEOF_INT >= 8 case 7: d[6] = s[6]; /* FALLTHROUGH */ case 6: d[5] = s[5]; /* FALLTHROUGH */ case 5: d[4] = s[4]; /* FALLTHROUGH */ case 4: d[3] = s[3]; /* FALLTHROUGH */ #endif case 3: d[2] = s[2]; /* FALLTHROUGH */ case 2: d[1] = s[1]; /* FALLTHROUGH */ case 1: d[0] = s[0]; /* FALLTHROUGH */ case 0: /* do nothing */; } sz -= z; mbkwdI(d - (sz & ~(SIZEOF_INT - 1)), s - (sz & ~(SIZEOF_INT - 1)), sz >> SHFT); d -= sz; s -= sz; switch (sz & (SIZEOF_INT - 1)) { #if SIZEOF_INT >= 8 case 7: d[6] = s[6]; /* FALLTHROUGH */ case 6: d[5] = s[5]; /* FALLTHROUGH */ case 5: d[4] = s[4]; /* FALLTHROUGH */ case 4: d[3] = s[3]; /* FALLTHROUGH */ #endif case 3: d[2] = s[2]; /* FALLTHROUGH */ case 2: d[1] = s[1]; /* FALLTHROUGH */ case 1: d[0] = s[0]; /* FALLTHROUGH */ case 0: /* do nothing */; } } else { while (sz >= 16) { d -= 16; s -= 16; d[15] = s[15]; d[14] = s[14]; d[13] = s[13]; d[12] = s[12]; d[11] = s[11]; d[10] = s[10]; d[9] = s[9]; d[8] = s[8]; d[7] = s[7]; d[6] = s[6]; d[5] = s[5]; d[4] = s[4]; d[3] = s[3]; d[2] = s[2]; d[1] = s[1]; d[0] = s[0]; sz -= 16; } d -= sz; s -= sz; switch (sz) { case 15: d[14] = s[14]; /* FALLTHROUGH */ case 14: d[13] = s[13]; /* FALLTHROUGH */ case 13: d[12] = s[12]; /* FALLTHROUGH */ case 12: d[11] = s[11]; /* FALLTHROUGH */ case 11: d[10] = s[10]; /* FALLTHROUGH */ case 10: d[9] = s[9]; /* FALLTHROUGH */ case 9: d[8] = s[8]; /* FALLTHROUGH */ case 8: d[7] = s[7]; /* FALLTHROUGH */ case 7: d[6] = s[6]; /* FALLTHROUGH */ case 6: d[5] = s[5]; /* FALLTHROUGH */ case 5: d[4] = s[4]; /* FALLTHROUGH */ case 4: d[3] = s[3]; /* FALLTHROUGH */ case 3: d[2] = s[2]; /* FALLTHROUGH */ case 2: d[1] = s[1]; /* FALLTHROUGH */ case 1: d[0] = s[0]; /* FALLTHROUGH */ case 0: /* do nothing */; } } return d; } /* Copy the block of 'sz' bytes beginning at 's' to 'd'. If 'sz' is zero or * if 's'=='d', nothing happens. The bytes at the lowest address ('s') * are copied before the ones at the highest ('s'+'sz'-1) are. */ static unsigned char *mfwrd(register unsigned char *d, register const unsigned char *s, register int sz) { unsigned char *od = d; if (d == s) return d; #ifdef ALIGNED if (sz >= 16) #else if (((unsigned long)d & (SIZEOF_INT - 1)) == ((unsigned long)s & (SIZEOF_INT - 1)) && sz >= 16) #endif { unsigned z = ((unsigned long)s & (SIZEOF_INT - 1)); if (z) { s -= z; d -= z; switch (SIZEOF_INT - z) { #if SIZEOF_INT == 8 case 7: d[1] = s[1]; /* FALLTHROUGH */ case 6: d[2] = s[2]; /* FALLTHROUGH */ case 5: d[3] = s[3]; /* FALLTHROUGH */ case 4: d[4] = s[4]; /* FALLTHROUGH */ case 3: d[5] = s[5]; /* FALLTHROUGH */ case 2: d[6] = s[6]; /* FALLTHROUGH */ case 1: d[7] = s[7]; /* FALLTHROUGH */ case 0: /* do nothing */; #elif SIZEOF_INT == 4 case 3: d[1] = s[1]; /* FALLTHROUGH */ case 2: d[2] = s[2]; /* FALLTHROUGH */ case 1: d[3] = s[3]; /* FALLTHROUGH */ case 0: /* do nothing */; #endif } s += SIZEOF_INT; d += SIZEOF_INT; sz -= SIZEOF_INT - z; } mfwrdI(d, s, sz >> SHFT); s += sz - (SIZEOF_INT - 1); d += sz - (SIZEOF_INT - 1); switch (sz & (SIZEOF_INT - 1)) { #if SIZEOF_INT == 8 case 7: d[0] = s[0]; /* FALLTHROUGH */ case 6: d[1] = s[1]; /* FALLTHROUGH */ case 5: d[2] = s[2]; /* FALLTHROUGH */ case 4: d[3] = s[3]; /* FALLTHROUGH */ case 3: d[4] = s[4]; /* FALLTHROUGH */ case 2: d[5] = s[5]; /* FALLTHROUGH */ case 1: d[6] = s[6]; /* FALLTHROUGH */ case 0: /* do nothing */; #elif SIZEOF_INT == 4 case 3: d[0] = s[0]; /* FALLTHROUGH */ case 2: d[1] = s[1]; /* FALLTHROUGH */ case 1: d[2] = s[2]; /* FALLTHROUGH */ case 0: /* do nothing */; #endif } } else { while (sz >= 16) { d[0] = s[0]; d[1] = s[1]; d[2] = s[2]; d[3] = s[3]; d[4] = s[4]; d[5] = s[5]; d[6] = s[6]; d[7] = s[7]; d[8] = s[8]; d[9] = s[9]; d[10] = s[10]; d[11] = s[11]; d[12] = s[12]; d[13] = s[13]; d[14] = s[14]; d[15] = s[15]; s += 16; d += 16; sz -= 16; } s -= 15 - sz; d -= 15 - sz; switch (sz) { case 15: d[0] = s[0]; /* FALLTHROUGH */ case 14: d[1] = s[1]; /* FALLTHROUGH */ case 13: d[2] = s[2]; /* FALLTHROUGH */ case 12: d[3] = s[3]; /* FALLTHROUGH */ case 11: d[4] = s[4]; /* FALLTHROUGH */ case 10: d[5] = s[5]; /* FALLTHROUGH */ case 9: d[6] = s[6]; /* FALLTHROUGH */ case 8: d[7] = s[7]; /* FALLTHROUGH */ case 7: d[8] = s[8]; /* FALLTHROUGH */ case 6: d[9] = s[9]; /* FALLTHROUGH */ case 5: d[10] = s[10]; /* FALLTHROUGH */ case 4: d[11] = s[11]; /* FALLTHROUGH */ case 3: d[12] = s[12]; /* FALLTHROUGH */ case 2: d[13] = s[13]; /* FALLTHROUGH */ case 1: d[14] = s[14]; /* FALLTHROUGH */ case 0: /* do nothing */; } } return od; } void *mmove(void *d, const void *s, int sz) { if (d > s) mbkwd(d, s, sz); else mfwrd(d, s, sz); return d; } /* Utility to count number of lines within a segment */ int mcnt(register const unsigned char *blk, register unsigned char c, int size) { register int nlines = 0; while (size >= 16) { if (blk[0] == c) ++nlines; if (blk[1] == c) ++nlines; if (blk[2] == c) ++nlines; if (blk[3] == c) ++nlines; if (blk[4] == c) ++nlines; if (blk[5] == c) ++nlines; if (blk[6] == c) ++nlines; if (blk[7] == c) ++nlines; if (blk[8] == c) ++nlines; if (blk[9] == c) ++nlines; if (blk[10] == c) ++nlines; if (blk[11] == c) ++nlines; if (blk[12] == c) ++nlines; if (blk[13] == c) ++nlines; if (blk[14] == c) ++nlines; if (blk[15] == c) ++nlines; blk += 16; size -= 16; } switch (size) { case 15: if (blk[14] == c) ++nlines; /* FALLTHROUGH */ case 14: if (blk[13] == c) ++nlines; /* FALLTHROUGH */ case 13: if (blk[12] == c) ++nlines; /* FALLTHROUGH */ case 12: if (blk[11] == c) ++nlines; /* FALLTHROUGH */ case 11: if (blk[10] == c) ++nlines; /* FALLTHROUGH */ case 10: if (blk[9] == c) ++nlines; /* FALLTHROUGH */ case 9: if (blk[8] == c) ++nlines; /* FALLTHROUGH */ case 8: if (blk[7] == c) ++nlines; /* FALLTHROUGH */ case 7: if (blk[6] == c) ++nlines; /* FALLTHROUGH */ case 6: if (blk[5] == c) ++nlines; /* FALLTHROUGH */ case 5: if (blk[4] == c) ++nlines; /* FALLTHROUGH */ case 4: if (blk[3] == c) ++nlines; /* FALLTHROUGH */ case 3: if (blk[2] == c) ++nlines; /* FALLTHROUGH */ case 2: if (blk[1] == c) ++nlines; /* FALLTHROUGH */ case 1: if (blk[0] == c) ++nlines; /* FALLTHROUGH */ case 0: /* do nothing */; } return nlines; } jupp/blocks.h010064400000000000000000000023441363731763200104270ustar00/* * Fast block move/copy subroutines * Copyright * (C) 1992 Joseph H. Allen * * This file is part of JOE (Joe's Own Editor) */ #ifndef JUPP_BLOCKS_H #define JUPP_BLOCKS_H #ifdef EXTERN_B_C __IDSTRING(rcsid_blocks_h, "$MirOS: contrib/code/jupp/blocks.h,v 1.9 2020/03/27 06:38:55 tg Exp $"); #endif /* char *mmove(char *d,char *s,int sz); Copy 'sz' bytes from 's' to 'd'. * Chooses either mbkwd or mfwrd to do this such that the data won't get * clobbered. */ void *mmove(void *d, const void *s, int sz); /* char *mset(char *d,char c,int sz); Set 'sz' bytes at 'd' to 'c'. * If 'sz'==0 nothing happens * Return original value of 'd' */ unsigned char *mset(void *dest, unsigned char c, int sz); /* int *msetI(int *d,int c,int sz); Set 'sz' ints at 'd' to 'c'. * If 'sz'==0 nothing happens * Returns orininal value of 'd' */ int *msetI(void *dest, int c, int sz); /* void **msetP(void **d,void *c,int sz); Set 'sz' pointers at 'd' to 'c'. * If 'sz'==0 nothing happens * Returns orininal value of 'd' */ void **msetP(void **dest, void *c, int sz); /* int mcnt(char *blk,char c,int size); * * Count the number of occurances a character appears in a block */ int mcnt(const unsigned char *blk, unsigned char c, int size); #endif jupp/builtin.c010064400000000000000000000030601363731414600106040ustar00/* * Built-in config files * Copyright * (C) 2006 Joseph H. Allen * * This file is part of JOE (Joe's Own Editor) */ #include "config.h" __RCSID("$MirOS: contrib/code/jupp/builtin.c,v 1.11 2020/03/27 06:08:11 tg Exp $"); #include #include #include "types.h" #include "builtin.h" #include "utils.h" #define zcmp(a,b) strcmp((const char *)(a), (const char *)(b)) JFILE * jfopen(const unsigned char *name, const char *mode) { if (name[0] == '*') { int x; char *xname, *cp; xname = strdup((const char *)name + 1); cp = xname; while ((x = *cp++)) { if (x >= 'A' && x <= 'Z') cp[-1] = x - 'A' + 'a'; } for (x = 0; builtins[x]; x += 2) { if (!zcmp(builtins[x], xname)) { JFILE *j = malloc(sizeof(JFILE)); j->f = 0; j->p = builtins[x + 1]; free(xname); return j; } } free(xname); return 0; } else { FILE *f = fopen((const char *)name, (const char *)mode); if (f) { JFILE *j = malloc(sizeof(JFILE)); j->f = f; j->p = 0; return j; } else { return 0; } } } int jfclose(JFILE *f) { int rtn = 0; if (f->f) rtn = fclose(f->f); free(f); return rtn; } /*XXX fails to honour len (= 1024, in practice) for builtins */ unsigned char * jfgets(unsigned char *buf, int len, JFILE *f) { if (f->f) return (unsigned char *)fgets((char *)buf, len, f->f); else { if (f->p[0]) { int x; for (x = 0; f->p[x] && f->p[x] != '\n'; ++x) buf[x] = f->p[x]; if (f->p[x] == '\n') { buf[x++] = '\n'; } buf[x] = 0; f->p += x; return buf; } else return 0; } } jupp/builtin.h010064400000000000000000000010531363731763200106140ustar00#ifndef JUPP_BUILTIN_H #define JUPP_BUILTIN_H #ifdef EXTERN_RC_C __IDSTRING(rcsid_builtin_h, "$MirOS: contrib/code/jupp/builtin.h,v 1.7 2020/03/27 06:38:55 tg Exp $"); #endif /* Support for built-in config files */ typedef struct jfile { FILE *f; /* Regular file, or NULL for built-in */ const unsigned char *p; /* Built-in file pointer */ } JFILE; JFILE *jfopen(const unsigned char *name, const char *mode); unsigned char *jfgets(unsigned char *buf,int len,JFILE *f); int jfclose(JFILE *f); extern const unsigned char * const builtins[]; #endif jupp/builtins.c010064400000000000000000000517021431513445300107700ustar00/* Built-in files */ /* LC_ALL=C grep -ve $'^[\t ]' -e '^-syntax' -e freedroidz jupprc | sed \ -e '/^:cua/,$d' -e '/^:Pastecua/,/^$/d' -e 1d \ -e 's/@(#) jupprc/@(#) blt_in/' | cat -s | while IFS= read -r x; do x=${x//\\/\\\\}; print -r -- $'\t\t'\""${x//\"/\\\"}\n"\"; done | perl -pe 's/[^\ca-~]/sprintf "\\x%02X", unpack("U", $&)/eg' */ #include "config.h" #include "types.h" __RCSID("$MirOS: contrib/code/jupp/builtins.c,v 1.35 2022/09/28 21:13:52 tg Exp $"); #ifndef JUPPRC_BUILTIN_NAME #define JUPPRC_BUILTIN_NAME "jupprc" #endif const unsigned char * const builtins[] = { UC JUPPRC_BUILTIN_NAME, UC "-assume_color\n" "-dopadding\n" "--force\n" "-keepup\n" "-mid\n" "-nobackups\n" "-noxon\n" "-notite\n" "-pastetite\n" "-pg 2\n" "-lmsg \\i%k%T%*\\b%n\\b%R\n" "-rmsg R%r<%l C%c\\u%o|%O\\i\\b%a|%A\\b\\i\\u %u\n" "-hmsg \\i\\f\\b^J = Help\\b\\f\n" "-guess_crlf\n" "-french\n" "-indentc 9\n" "-istep 1\n" "--guess_indent\n" "--autoindent\n" "-purify\n" "-highlight\n" "--linums\n" "-lmargin 1\n" "-rmargin 73\n" "--smarthome\n" "--indentfirst\n" "-smartbacks\n" "-tab 8\n" "--wordwrap\n" "\n" "*.bin\n" "--crlf\n" "--guess_crlf\n" "-encoding ascii\n" "-hex\n" "\n" "*.py\n" "-encoding utf8\n" "-tab 4\n" "-indentc 32\n" "-istep 4\n" "-spaces\n" "\n" "*\n" "+#!\\+\\[ ]\\+\\[/a-z0-9._-]/python\n" "-encoding utf8\n" "-tab 4\n" "-indentc 32\n" "-istep 4\n" "-spaces\n" "\n" "*\n" "+#!\\+\\[ ]\\+\\[/a-z0-9._-]/env\\[ ]\\+\\[ ]python\n" "-encoding utf8\n" "-tab 4\n" "-indentc 32\n" "-istep 4\n" "-spaces\n" "\n" "{General\n" "\\i Help Screen turn off with ^J more help with Esc+. (^[.) \\i\n" "\\i \\i \\u\\bEXIT\\b\\u \\u\\bBLOCK DEF\\b\\u \\u\\bBLOCK OP\\b\\u \\u\\bSEARCH\\b\\u \\u\\bDELETE:\\b\\u \\b^H\\b char \\b^QT\\b line \\i \\i\n" "\\i \\i \\u\\bMISC\\b\\u \\b^KL\\b line \\b^KY\\b kill \\b^QA\\b find and replace \\b^T\\b >word \\b^[Y\\b yank \\i \\i\n" "\\i \\i \\b^QM\\b math \\b^KH\\b hide \\b^K/\\b pipe \\b^QG\\b byte backwards \\u\\bSHELL\\b\\u \\u\\bFILE\\b\\u \\i \\i\n" "\\i \\i \\b^O\\b options \\u\\bQUOTE\\b\\u \\u\\bBUFFER\\b\\u \\b^QH\\b byte forwards \\b^KZ\\b suspend \\b^KS\\b save\\das\\d \\i \\i\n" "\\i \\i \\b^[P\\b pastemode \\b`\\b Ctrl \\b^U\\b undo \\b^[R\\b incremental b. \\b^K'\\b window \\b^KR\\b import \\i \\i\n" "\\i \\i \\b^[-\\b cmdprompt \\b^P\\b Meta \\b^^\\b redo \\b^[T\\b incr. forwards \\b^['\\b command \\b^KW\\b export \\i \\i\n" "}\n" "\n" "{Movement\n" "\\i Help Screen turn off with ^J prev. screen ^[, next screen ^[. \\i\n" "\\i \\i \\u\\bMovement in jupp:\\b\\u screen(top) \\i \\i\n" "\\i \\i upslide \\b^QE\\b page(top) file(beginning) \\i \\i\n" "\\i \\i \\b^W\\b (char)up \\b^R\\b \\b^QR\\b \\i \\i\n" "\\i \\i (beginning)line (prev)word left \\b^E\\b right (next)word line(end) \\i \\i\n" "\\i \\i \\b^QS\\b \\b^A\\b \\b^S\\b \\d<+>\\d \\b^D\\b \\b^F\\b \\b^QD\\b \\i \\i\n" "\\i \\i downslide (char)down page(bottom) file(end) \\i \\i\n" "\\i \\i \\b^Z\\b \\b^X\\b \\b^C\\b \\b^QC\\b \\i \\i\n" "\\i \\uWordStar diamond\\u \\i \\b^QX\\b \\d<-\\d screen(bottom) \\i \\i\n" "}\n" "\n" "{Windows\n" "\\i Help Screen turn off with ^J prev. screen ^[, next screen ^[. \\i\n" "\\i \\i \\b^KG\\b make current window bigger \\b^KI\\b show all windows / show one window \\i \\i\n" "\\i \\i \\b^KT\\b make current window smaller \\b^KO\\b split the current window in half \\i \\i\n" "\\i \\i \\b^KP\\b go to the window above \\b^K-\\b edit scratch buffer in new window \\i \\i\n" "\\i \\i \\b^KN\\b go to the window below \\b^KQ\\b eliminate the current window \\i \\i\n" "\\i \\i \\b^KE\\b load file into new window \\b^K;\\b run a ctags search \\i \\i\n" "\\i \\i Note: some commands (\\b^KE\\b \\b^K;\\b \\b^K-\\b) hide the current window; use \\b^KI\\b/\\b^KN\\b then \\i \\i\n" "\\i \\i \\u\\bSpecial help for XON/XOFF aware terminals:\\b\\u \\i \\i\n" "\\i \\i You can type \\b^[q\\b instead of \\b^Q\\b and \\b^[s\\b instead of \\b^S\\b for all commands. \\i \\i\n" "}\n" "\n" "{Orientation\n" "\\i Help Screen turn off with ^J prev. screen ^[, next screen ^[. \\i\n" "\\i \\i \\u\\bGOTO\\b\\u \\u\\bMISC\\b\\u \\u\\bINSERT MATH OR CURRENT\\b\\u \\i \\i\n" "\\i \\i \\b^Q=\\b merge conflict marker \\b^K\\b \\u0-9\\u define bookmark \\b^[#\\b equation \\b^[@\\b date \\i \\i\n" "\\i \\i \\b^QV\\b start of last search \\b^V\\b overtype mode \\b^[=\\b result \\b^[!\\b time \\i \\i\n" "\\i \\i \\b^Q]\\b next matching brace \\u\\bGOTO\\b\\u \\u\\bREFORMAT\\b\\u \\u\\bINDENT LINE\\b\\u \\i \\i\n" "\\i \\i \\b^Q[\\b previous \" \" \\b^Q-\\b column number \\b^B\\b line \\b^K.\\b more \\i \\i\n" "\\i \\i \\b^QP\\b previous place \\b^QI\\b line number \\b^KD\\b block \\b^K,\\b less \\i \\i\n" "\\i \\i \\b^K=\\b next place \\b^QO\\b byte offset \\b^]\\b split line \\b^KA\\b centre \\i \\i\n" "\\i \\i \\b^QB\\b to ^KB \\b^QK\\b to ^KK \\b^Q\\b \\u0-9\\u bookmark #0-9 \\b^K]\\b fix whitespace at EOL/EOF \\i \\i\n" "}\n" "\n" "{Advanced\n" "\\i Help Screen turn off with ^J prev. screen ^[, next screen ^[. \\i\n" "\\i \\i \\u\\bCOMPILING\\b\\u \\u\\bMISC\\b\\u \\i \\i\n" "\\i \\i \\b^[C\\b compile \\uand\\u \\b^[E\\b parse errors \\b^Q.\\b scroll right \\i \\i\n" "\\i \\i \\b^[M\\b goto next... \\b^[N\\b previous error \\b^Q,\\b scroll left \\i \\i\n" "\\i \\i \\b^KF\\b save, compile & upload to NXT brick \\b^QL\\b refresh \\i \\i\n" "\\i \\i \\u\\bMACROS\\b\\u \\b^QQ\\b repeat \\i \\i\n" "\\i \\i \\b^[(\\b record \\b^[/\\b query \\b^[?\\b list defined \\b^Q?\\b status \\i \\i\n" "\\i \\i \\b^[)\\b stop \\b^N\\b play #0 \\b^[\\b \\u0-9\\u play #0-9 \\b^[H\\b message \\i \\i\n" "\\i \\i \\u\\bMATH\\b\\u (hex or double float) variables: \\ubyte\\u \\ucol\\u \\uheight\\u \\uline\\u \\ulines\\u \\utop\\u \\uwidth\\u \\i \\i\n" "}\n" "\n" "{Search\n" "\\i Help Screen turn off with ^J prev. screen ^[, next screen ^[. \\i\n" "\\i \\i \\u\\bSpecial search sequences:\\b\\u \\i \\i\n" "\\i \\i \\b\\\\^\\b \\b\\\\$\\b matches beg./end of line \\b\\\\?\\b match any single char \\i \\i\n" "\\i \\i \\b\\\\<\\b \\b\\\\>\\b matches beg./end of word \\b\\\\*\\b match 0 or more chars \\i \\i\n" "\\i \\i \\b\\\\c\\b matches balanced C expression \\b\\\\\\\\\\b matches a backslash (\\\\) \\i \\i\n" "\\i \\i \\b\\\\[a-z]\\b matches one of a set, ^ inverts \\b\\\\n\\b matches a newline \\i \\i\n" "\\i \\i \\b\\\\+\\b matches 0 or more of the character which follows the \\\\+ \\i \\i\n" "\\i \\i \\u\\bSpecial replace sequences:\\b\\u \\i \\i\n" "\\i \\i \\b\\\\\\\\\\b replaced with a backslash (\\\\) \\b\\\\n\\b replaced with a newline \\i \\i\n" "\\i \\i \\b\\\\&\\b replaced with the text which matched the search string \\i \\i\n" "\\i \\i \\b\\\\\\b\\u0\\u - \\u9\\u replaced with text which matched \\uN+1\\uth \\\\?, \\\\*, \\\\c, \\\\[a-z] or \\\\+ \\i \\i\n" "}\n" "\n" "{Names\n" "\\i Help Screen turn off with ^J prev. screen ^[, next screen ^[. \\i\n" "\\i \\i At file name prompts use the cursor up/down keys to access a history of \\i \\i\n" "\\i \\i recently used files or the tab key to complete them. \\u\\bSpecial file names:\\b\\u \\i \\i\n" "\\i \\i \\b!\\b\\ucommand\\u Pipe in/out of a shell command \\i \\i\n" "\\i \\i \\b>>\\b\\ufilename\\u Append to a file \\i \\i\n" "\\i \\i \\b-\\b Read/Write to/from standard I/O \\i \\i\n" "\\i \\i \\ufilename\\u\\b,\\b\\uSTART\\u\\b,\\b\\uSIZE\\u Read/Write a part of a file/device \\i \\i\n" "\\i \\i Give START/SIZE in decimal (255), octal (0377) or hex (0xFF) \\i \\i\n" "\\i \\i \\u\\bPresentation mode:\\b\\u \\bF6\\b=fullscreen; \\bF7\\b=previous, \\bF8\\b=next win; \\bF9\\b=filter/again \\i \\i\n" "}\n" "\n" "{Joe\n" "\\i Help Screen turn off with ^J prev. screen ^[, next screen ^[. \\i\n" "\\i \\i \\bJUPP\\b is based upon JOE (Joe's Own Editor) 2.8/3.x \\d(GPL v1)\\d by Joe H. Allen; \\i \\i\n" "\\i \\i go to \\uhttp://sf.net/projects/joe-editor/\\u for upstream bug reports. JUPP 2.8 \\i \\i\n" "\\i \\i for DOS compiled by A. Totlis, packed with LHarc 2.13; JUPP 3.x for UNIX\\d(R)\\d \\i \\i\n" "\\i \\i at \\uhttp://mirbsd.de/jupp\\u and by \\bThorsten \"\\dmirabilos\\d\" Glaser <\\utg@mirbsd.org\\u>\\b \\i \\i\n" "\\i \\i @(#) blt_in 2022-03-12; 3.1; autoCR-LF; UTF-8 via locale; per-file encoding \\i \\i\n" "}\n" "\n" "{CharTable\n" "\\i Help Screen turn off with ^J prev. screen ^[, \\uCharacter Map\\u \\i\n" "\\i \\i Dec Hex \\u 0123 4567 89AB CDEF 0123 4567 89AB CDEF \\u Hex Dec \\i \\i\n" "\\i \\i | | \\i \\i\n" "\\i \\i 0 00 | \\u@ABC\\u \\uDEFG\\u \\uHIJK\\u \\uLMNO\\u \x80\x81\x82\x83 \x84\x85\x86\x87 \x88\x89\x8A\x8B \x8C\x8D\x8E\x8F | 80 128 \\i \\i\n" "\\i \\i 16 10 | \\uPQRS\\u \\uTUVW\\u \\uXYZ[\\u \\u\\\\]^_\\u \x90\x91\x92\x93 \x94\x95\x96\x97 \x98\x99\x9A\x9B \x9C\x9D\x9E\x9F | 90 144 \\i \\i\n" "\\i \\i 32 20 | !\"# $%&' ()*+ ,-./ \xA0\xA1\xA2\xA3 \xA4\xA5\xA6\xA7 \xA8\xA9\xAA\xAB \xAC\xAD\xAE\xAF | A0 160 \\i \\i\n" "\\i \\i 48 30 | 0123 4567 89:; <=>? \xB0\xB1\xB2\xB3 \xB4\xB5\xB6\xB7 \xB8\xB9\xBA\xBB \xBC\xBD\xBE\xBF | B0 176 \\i \\i\n" "\\i \\i 64 40 | @ABC DEFG HIJK LMNO \xC0\xC1\xC2\xC3 \xC4\xC5\xC6\xC7 \xC8\xC9\xCA\xCB \xCC\xCD\xCE\xCF | C0 192 \\i \\i\n" "\\i \\i 80 50 | PQRS TUVW XYZ[ \\\\]^_ \xD0\xD1\xD2\xD3 \xD4\xD5\xD6\xD7 \xD8\xD9\xDA\xDB \xDC\xDD\xDE\xDF | D0 208 \\i \\i\n" "\\i \\i 96 60 | `abc defg hijk lmno \xE0\xE1\xE2\xE3 \xE4\xE5\xE6\xE7 \xE8\xE9\xEA\xEB \xEC\xED\xEE\xEF | E0 224 \\i \\i\n" "\\i \\i 112 70 | pqrs tuvw xyz{ |}~\x7F \xF0\xF1\xF2\xF3 \xF4\xF5\xF6\xF7 \xF8\xF9\xFA\xFB \xFC\xFD\xFE\xFF | F0 240 \\i \\i\n" "}\n" "\n" "{Paste\n" "\\i \\i\n" "\\i \\i \\u\\bPaste Mode\\b\\u turn off with \\b^D\\b or \\b^[[201~\\b \\i \\i\n" "}\n" "\n" ":windows\n" "type ^@ TO \xFF\n" "abort ^K Q\n" "abort ^K ^Q\n" "abort ^K q\n" "arg ^Q Q\n" "arg ^Q ^Q\n" "arg ^Q q\n" "arg ^[ q q\n" "explode .k6\n" "explode ^K I\n" "explode ^K ^I\n" "explode ^K i\n" "explode ^[ [ 1 7 ~\n" "help .k1\n" "help ^J\n" "help ^[ [ 1 1 ~\n" "hnext ^[ .\n" "hprev ^[ ,\n" "math ^Q M\n" "math ^Q ^M\n" "math ^Q m\n" "math ^[ q m\n" "mathins ^[ #\n" "mathres ^[ =\n" "msg ^[ H\n" "msg ^[ h\n" "nextw .k8\n" "nextw ^K N\n" "nextw ^K ^N\n" "nextw ^K n\n" "nextw ^[ [ 1 9 ~\n" "play ^[ 0 TO 9\n" "prevw .k7\n" "prevw ^K P\n" "prevw ^K ^P\n" "prevw ^K p\n" "prevw ^[ [ 1 8 ~\n" "query ^[ /\n" "quote `\n" "quote8 ^P\n" "record ^[ (\n" "retype ^Q L\n" "retype ^Q ^L\n" "retype ^Q l\n" "retype ^[ q l\n" "rtn ^M\n" "shell ^K Z\n" "shell ^K ^Z\n" "shell ^K z\n" "stop ^[ )\n" "\n" ":Paste\n" "type ^@ TO \xFF\n" "rtn ^M\n" "msg,\"Entered bracketed paste mode\",rtn ^[ [ 2 0 0 ~\n" "helpcard,rtn,keymap,\"main\",rtn,msg,rtn ^[ [ 2 0 1 ~\n" "helpcard,rtn,keymap,\"main\",rtn ^D\n" "\n" ":Pasteprompt\n" "type ^@ TO \xFF\n" "nop ^L\n" "keymap,\"prompt\",rtn,msg,rtn,rtn ^M\n" "msg,\"Entered bracketed paste mode\",rtn ^[ [ 2 0 0 ~\n" "keymap,\"prompt\",rtn,msg,rtn ^[ [ 2 0 1 ~\n" "keymap,\"prompt\",rtn ^D\n" "\n" ":main\n" ":inherit windows\n" ":def dosrch setmark,\":\",ffirst\n" ":def dorepl setmark,\":\",qrepl\n" ":def pastemain helpcard,\"Paste\",rtn,keymap,\"Paste\",rtn\n" ":def conflictmarker dosrch,\"\\\\^\\\\[<>=]\\\\[<>=]\\\\[<>=]\\\\[<>=]\\\\[<>=]\\\\[<>=]\\\\[<>=]\\\\[ \\\\n]\",rtn,rtn,ltarw\n" ":def fixwhitespace psh,setmark,\":\",eof,\" \",bof,\"a\",qrepl,\"\\\\[\",quote,\"i\",quote,\"k\",quote,\"l\",quote,\"m ]\\\\+\\\\[\",quote,\"i\",quote,\"k\",quote,\"l\",quote,\"m ]\\\\$\",rtn,rtn,rtn,\"r\",eof,rtn,ffirst,\"\\\\^\\\\[^\\\\n]\",rtn,\"b\",rtn,eol,markb,bof,delch,eof,markk,blkdel,ffirst,\"\\\\?\",rtn,\"b\",rtn,eol,rtn,gomark,\":\",eof\n" ":def docompile edit,rtn,filt,query,parserr\n" ":def filtall nmark,filt,uparw\n" ":def pvsrch prevpos,gomark,\":\"\n" ":def inscurdate insf,\"!date '+%Y-%m-%d'\",rtn,eol,delch\n" ":def inscurtime insf,\"!date '+%H:%M:%S'\",rtn,eol,delch\n" "setmark,\":\",uparw,gomark,\":\",begin_marking,uparw,toggle_marking ^[ [ 1 ; 2 A\n" "setmark,\":\",dnarw,gomark,\":\",begin_marking,dnarw,toggle_marking ^[ [ 1 ; 2 B\n" "setmark,\":\",rtarw,gomark,\":\",begin_marking,rtarw,toggle_marking ^[ [ 1 ; 2 C\n" "setmark,\":\",ltarw,gomark,\":\",begin_marking,ltarw,toggle_marking ^[ [ 1 ; 2 D\n" "setmark,\":\",bol,gomark,\":\",begin_marking,bol,toggle_marking ^[ [ 1 ; 2 H\n" "setmark,\":\",eol,gomark,\":\",begin_marking,eol,toggle_marking ^[ [ 1 ; 2 F\n" "setmark,\":\",bof,gomark,\":\",begin_marking,bof,toggle_marking ^[ [ 1 ; 6 H\n" "setmark,\":\",eof,gomark,\":\",begin_marking,eof,toggle_marking ^[ [ 1 ; 6 F\n" "pastemain ^[ P\n" "pastemain ^[ p\n" "pastemain ^[ [ 2 0 0 ~\n" "nop ^[ [ 2 0 1 ~\n" "backs ^?\n" "backs ^H\n" "backw ^[ o\n" "bknd ^K '\n" "bkwdc ^Q G ^@ TO \xFF\n" "bkwdc ^Q ^G ^@ TO \xFF\n" "bkwdc ^Q g ^@ TO \xFF\n" "bkwdc ^[ q g ^@ TO \xFF\n" "blkcpy ^K C\n" "blkcpy ^K ^C\n" "blkcpy ^K c\n" "blkdel ^K Y\n" "blkdel ^K ^Y\n" "blkdel ^K y\n" "blkmove ^K V\n" "blkmove ^K ^V\n" "blkmove ^K v\n" "blksave ^K W\n" "blksave ^K ^W\n" "blksave ^K w\n" "bof ^Q R\n" "bof ^Q ^R\n" "bof ^Q r\n" "bof ^[ [ 1 ; 5 H\n" "bof ^[ q r\n" "home .kh\n" "home ^Q S\n" "home ^Q ^S\n" "home ^Q s\n" "home ^[ [ 1 ~\n" "home ^[ [ 7 ~\n" "home ^[ [ H\n" "home ^[ q s\n" "bos ^Q X\n" "bos ^Q ^X\n" "bos ^Q x\n" "bos ^[ q x\n" "byte ^Q O\n" "byte ^Q ^O\n" "byte ^Q o\n" "byte ^[ q o\n" "center ^K A\n" "center ^K ^A\n" "center ^K a\n" "col ^Q -\n" "col ^[ q -\n" "conflictmarker ^Q =\n" "conflictmarker ^[ q =\n" "crawll ^Q ,\n" "crawll ^[ q ,\n" "crawlr ^Q .\n" "crawlr ^[ q .\n" "delbol ^Q T\n" "delbol ^Q ^?\n" "delbol ^Q ^T\n" "delbol ^Q t\n" "delbol ^[ q ^?\n" "delbol ^[ q t\n" "delch .kD\n" "delch ^G\n" "delch ^[ [ 3 ~\n" "deleol ^Q Y\n" "deleol ^Q ^Y\n" "deleol ^Q y\n" "deleol ^[ q y\n" "dellin ^Y\n" "delw ^T\n" "dnarw .kd\n" "dnarw ^X\n" "dnarw ^[ O B\n" "dnarw ^[ [ B\n" "dnslide ^Z\n" "edit ^K E\n" "edit ^K ^E\n" "edit ^K e\n" "eof ^Q C\n" "eof ^Q ^C\n" "eof ^Q c\n" "eof ^[ [ 1 ; 5 F\n" "eof ^[ q c\n" "eol .@7\n" "eol .kH\n" "eol ^Q D\n" "eol ^Q ^D\n" "eol ^Q d\n" "eol ^[ [ 4 ~\n" "eol ^[ [ 8 ~\n" "eol ^[ [ F\n" "eol ^[ q d\n" "execmd ^[ -\n" "exsave ^K X\n" "exsave ^K ^X\n" "exsave ^K x\n" "dosrch ^Q F\n" "dosrch ^Q ^F\n" "dosrch ^Q f\n" "dosrch ^[ q f\n" "filt ^K /\n" "filtall .k9\n" "filtall ^[ [ 2 0 ~\n" "fixwhitespace ^K ]\n" "fmtblk ^K D\n" "fmtblk ^K ^D\n" "fmtblk ^K d\n" "format ^B\n" "fnext .k3\n" "fnext ^L\n" "fnext ^[ [ 1 3 ~\n" "fwrdc ^Q H ^@ TO \xFF\n" "fwrdc ^Q ^H ^@ TO \xFF\n" "fwrdc ^Q h ^@ TO \xFF\n" "fwrdc ^[ q h ^@ TO \xFF\n" "gomark ^Q 0 TO 9\n" "gomark ^[ q 0 TO 9\n" "groww ^K G\n" "groww ^K ^G\n" "groww ^K g\n" "inscurdate ^[ @\n" "inscurtime ^[ !\n" "insf ^K R\n" "insf ^K ^R\n" "insf ^K r\n" "isrch ^[ T\n" "isrch ^[ t\n" "lindent ^K ,\n" "line ^Q I\n" "line ^Q ^I\n" "line ^Q i\n" "line ^[ q i\n" "ltarw .kl\n" "ltarw ^S\n" "ltarw ^[ O D\n" "ltarw ^[ [ D\n" "ltarw ^[ s\n" "macros ^[ ?\n" "markb ^K B\n" "markb ^K ^B\n" "markb ^K b\n" "markk ^K K\n" "markk ^K ^K\n" "markk ^K k\n" "markl ^K L\n" "markl ^K ^L\n" "markl ^K l\n" "mode ^O\n" "mode,\"T\" .kI\n" "mode,\"T\" ^V\n" "mode,\"T\" ^[ [ 2 ~\n" "mode,\"T\" ^[ [ L\n" "nextpos ^K =\n" "nextword ^F\n" "nextword ^[ [ 1 ; 5 C\n" "nmark ^K H\n" "nmark ^K ^H\n" "nmark ^K h\n" "nxterr ^[ M\n" "nxterr ^[ m\n" "open ^]\n" "docompile ^[ C\n" "docompile ^[ c\n" "parserr ^[ E\n" "parserr ^[ e\n" "pgdn .kN\n" "pgdn ^C\n" "pgdn ^[ [ 6 ~\n" "pgdn ^[ [ G\n" "pgup .kP\n" "pgup ^R\n" "pgup ^[ [ 5 ~\n" "pgup ^[ [ I\n" "play,\"0\" ^N\n" "prevpos ^Q P\n" "prevpos ^Q ^P\n" "prevpos ^Q p\n" "prevpos ^[ q p\n" "prevword ^A\n" "prevword ^[ [ 1 ; 5 D\n" "prverr ^[ N\n" "prverr ^[ n\n" "pvsrch ^Q V\n" "pvsrch ^Q ^V\n" "pvsrch ^Q v\n" "pvsrch ^[ q v\n" "dorepl ^Q A\n" "dorepl ^Q ^A\n" "dorepl ^Q a\n" "dorepl ^[ q a\n" "redo ^^\n" "rindent ^K .\n" "rsrch ^[ R\n" "rsrch ^[ r\n" "rtarw .kr\n" "rtarw ^D\n" "rtarw ^[ O C\n" "rtarw ^[ [ C\n" "run ^[ '\n" "save ^K S\n" "save ^K ^S\n" "save ^K s\n" "scratch,\"(S) \" ^K -\n" "setmark ^K 0 TO 9\n" "shrinkw ^K T\n" "shrinkw ^K ^T\n" "shrinkw ^K t\n" "splitw ^K O\n" "splitw ^K ^O\n" "splitw ^K o\n" "stat ^Q ?\n" "stat ^[ q ?\n" "tag ^K ;\n" "tomarkb ^Q B\n" "tomarkb ^Q ^B\n" "tomarkb ^Q b\n" "tomarkb ^[ q b\n" "tomarkk ^Q K\n" "tomarkk ^Q ^K\n" "tomarkk ^Q k\n" "tomarkk ^[ q k\n" "rvmatch ^Q [\n" "tomatch ^Q ]\n" "rvmatch ^Q ^[\n" "tomatch ^Q ^]\n" "rvmatch ^[ q [\n" "tomatch ^[ q ]\n" "tos ^Q E\n" "tos ^Q ^E\n" "tos ^Q e\n" "tos ^[ q e\n" "undo ^U\n" "undo ^_\n" "uparw .ku\n" "uparw ^E\n" "uparw ^[ O A\n" "uparw ^[ [ A\n" "upslide ^W\n" "yankpop ^[ Y\n" "yankpop ^[ y\n" "\n" ":prompt\n" ":inherit main\n" ":def pasteprompt keymap,\"Pasteprompt\",rtn,msg,\"Entered bracketed paste mode\",rtn\n" "abort ^C\n" "abort ^U\n" "complete ^I\n" "nop ^L\n" "pasteprompt ^[ P\n" "pasteprompt ^[ p\n" "pasteprompt ^[ [ 2 0 0 ~\n" "\n" ":menu\n" ":inherit windows\n" "abort ^U\n" "abort ^[ ^[\n" "backsmenu ^?\n" "backsmenu ^H\n" "bofmenu ^Q R\n" "bofmenu ^Q ^R\n" "bofmenu ^Q r\n" "bofmenu ^[ [ 1 ; 5 H\n" "bofmenu ^[ q r\n" "bolmenu .kh\n" "bolmenu ^Q S\n" "bolmenu ^Q ^S\n" "bolmenu ^Q s\n" "bolmenu ^[ [ 1 ~\n" "bolmenu ^[ [ 7 ~\n" "bolmenu ^[ [ H\n" "bolmenu ^[ q s\n" "dnarwmenu .kd\n" "dnarwmenu ^X\n" "dnarwmenu ^[ O B\n" "dnarwmenu ^[ [ B\n" "eofmenu ^Q C\n" "eofmenu ^Q ^C\n" "eofmenu ^Q c\n" "eofmenu ^[ [ 1 ; 5 F\n" "eofmenu ^[ q c\n" "eolmenu .@7\n" "eolmenu .kH\n" "eolmenu ^Q D\n" "eolmenu ^Q ^D\n" "eolmenu ^Q d\n" "eolmenu ^[ [ 4 ~\n" "eolmenu ^[ [ 8 ~\n" "eolmenu ^[ [ F\n" "eolmenu ^[ q d\n" "ltarwmenu .kl\n" "ltarwmenu ^S\n" "ltarwmenu ^[ O D\n" "ltarwmenu ^[ [ D\n" "ltarwmenu ^[ s\n" "pgdnmenu .kN\n" "pgdnmenu ^C\n" "pgdnmenu ^[ [ 6 ~\n" "pgdnmenu ^[ [ G\n" "pgupmenu .kP\n" "pgupmenu ^R\n" "pgupmenu ^[ [ 5 ~\n" "pgupmenu ^[ [ I\n" "rtarwmenu .kr\n" "rtarwmenu ^D\n" "rtarwmenu ^[ O C\n" "rtarwmenu ^[ [ C\n" "rtn SP\n" "rtn ^J\n" "tabmenu ^I\n" "uparwmenu .ku\n" "uparwmenu ^E\n" "uparwmenu ^[ O A\n" "uparwmenu ^[ [ A\n" "\n" ":query\n" ":inherit windows\n" "\n" ":querya\n" "type ^@ TO \xFF\n" "\n" ":querysr\n" "type ^@ TO \xFF\n" , NULL }; jupp/bw-lgen.inc010064400000000000000000000101361363731414600110220ustar00/* * Edit buffer single line update core loop (twice) * Copyright © 1992 Joseph H. Allen * Copyright © 2018 mirabilos * * This file is part of jupp (Joe’s Own Editor fork) */ #ifdef LGEN_Q __IDSTRING(rcsid_bw_lgen_inc, "$MirOS: contrib/code/jupp/bw-lgen.inc,v 1.6 2020/03/27 06:08:11 tg Exp $"); #define XCOL col #else #define XCOL (scr + x - ox) #endif LGEN_LABEL(loop): /* Display next character */ if (!amnt) goto LGEN_LABEL(noamnt); do { if (ungetit == -1) bc = *bp++; else { bc = ungetit; ungetit = -1; } if (st != -1) atr = syn[idx++]; if (utf8_sm.state && !(bc & 0x80)) goto LGEN_LABEL(ilseq); if (p->b->o.crlf && bc == '\r') { ++byte; if (!--amnt) { LGEN_LABEL(pl): if (bp == p->ptr + SEGSIZ) { if (pnext(p)) { bp = p->ptr; amnt = p->hdr->hole; } else goto LGEN_LABEL(nl); } else { bp = p->ptr + p->hdr->ehole; amnt = SEGSIZ - p->hdr->ehole; if (!amnt) goto LGEN_LABEL(pl); } } if (*bp == '\n') { ++bp; ++byte; ++amnt; goto eobl; } LGEN_LABEL(nl): --byte; ++amnt; } if (square) if (bc == '\t') { long tcol = XCOL + p->b->o.tab - (XCOL % p->b->o.tab); if (tcol > from && tcol <= to) c1 = INVERSE; else c1 = 0; } else if (XCOL >= from && XCOL < to) c1 = INVERSE; else c1 = 0; else if (byte >= from && byte < to) c1 = INVERSE; else c1 = 0; ++byte; if (bc == '\t') { ta = p->b->o.tab - (XCOL % p->b->o.tab); #ifdef LGEN_Q if (ta + col > scr) { ta -= scr - col; goto dota_tab; } if ((col += ta) == scr) { --amnt; goto v_loop; } #else dota_tab: tach1 = tach = ' '; if (bw->o.vispace) tach = 0x2192; goto dota_gen; dota_loop: tach = tach1; dota_gen: outatr(utf8_map, t, screen + x, attr + x, x, y, tach, c1 | atr); if (have) goto bye; if (++x == w) goto eosl; if (--ta) goto dota_loop; #endif } else if (bc == '\n') { goto eobl; } else { int wid = -1; /* * should be joe_maputf(p->b->o.charmap) logically * but they are identical here, and it helps * static analysers like Coverity */ if (joe_maputf(bw->b->o.charmap)) { /* UTF-8 */ c = utf8_decode(&utf8_sm, bc); if (c >= 0) { /* Normal decoded character */ wid = joe_wcwidth(c); } else if (c == -1) { /* Character taken */ wid = -1; } else if (c == -2) { /* Incomplete sequence */ --byte; LGEN_LABEL(ilseq): ++amnt; ungetit = bc; c = 0x1000FFFE; wid = utf8_sm.ptr; utf8_init(&utf8_sm); } else if (c == -3) { /* Invalid byte */ c = 0x1000FFFE; wid = 1; } } else { /* 8-bit charmap */ c = bc; wid = 1; } if (wid >= 0) { #ifdef LGEN_Q col += wid; if (col == scr) { --amnt; goto v_loop; } else if (col > scr) { ta = col - scr; tach1 = tach = '<'; goto dota_gen; } #else if (x + wid > w) { /* Character hits rightmost column */ while (x < w) { /* Display offscreen marker */ outatr(bw->b->o.charmap, t, screen + x, attr + x, x, y, '>', c1 | atr); x++; } } else if (c == 0x1000FFFE) while (wid--) { outatr(bw->b->o.charmap, t, screen + x, attr + x, x, y, 0xFFFD, (c1 | atr | UNDERLINE) ^ INVERSE); x++; } else if (c == 0x20 && bw->o.vispace) { outatr(utf8_map, t, screen + x, attr + x, x, y, 0xB7, c1 | atr); x++; } else { outatr(bw->b->o.charmap, t, screen + x, attr + x, x, y, c, c1 | atr); x += wid; } #endif } else /* Get highlighting character again */ --idx; #ifndef LGEN_Q if (have) goto bye; if (x >= w) goto eosl; #endif } } while (--amnt); LGEN_LABEL(noamnt): if (bp == p->ptr + SEGSIZ) { if (pnext(p)) { bp = p->ptr; amnt = p->hdr->hole; goto LGEN_LABEL(loop); } } else { bp = p->ptr + p->hdr->ehole; amnt = SEGSIZ - p->hdr->ehole; goto LGEN_LABEL(loop); } if (utf8_sm.state) goto LGEN_LABEL(ilseq); goto eof; #undef XCOL jupp/bw.c010064400000000000000000000453311363731414600075550ustar00/* * Edit buffer window generation * Copyright * (C) 1992 Joseph H. Allen * * This file is part of JOE (Joe's Own Editor) */ #include "config.h" #include "types.h" __RCSID("$MirOS: contrib/code/jupp/bw.c,v 1.40 2020/03/27 06:08:11 tg Exp $"); #include #include #ifdef HAVE_BSD_STRING_H #include #endif #include "b.h" #include "bw.h" #include "blocks.h" #include "kbd.h" #include "rc.h" #include "scrn.h" #include "ublock.h" #include "utils.h" #include "syntax.h" #include "charmap.h" #include "w.h" /* Display modes */ int dspasis = 0; int marking = 0; extern int staen; extern SCREEN *maint; static P *getto(P *p, P *cur, P *top, long int line) { if (p == NULL) { P *best = cur; long dist = LONG_MAX; long d; d = (line >= cur->line ? line - cur->line : cur->line - line); if (d < dist) { dist = d; best = cur; } d = (line >= top->line ? line - top->line : top->line - line); if (d < dist) { /* dead store: dist = d; */ best = top; } p = pdup(best); p_goto_bol(p); } while (line > p->line) if (!pnextl(p)) break; if (line < p->line) { while (line < p->line) pprevl(p); p_goto_bol(p); } return p; } /* Scroll window to follow cursor */ int mid = 0; /* For hex */ static void bwfllwh(BW *w) { long dofs = 0; /* Top must be a muliple of 16 bytes */ if (w->top->byte%16) { pbkwd(w->top,w->top->byte%16); } /* Move backward */ if (w->cursor->byte < w->top->byte) { long new_top = w->cursor->byte/16; if (mid) { if (new_top >= w->h / 2) new_top -= w->h / 2; else new_top = 0; } if (w->top->byte/16 - new_top < w->h) nscrldn(w->t->t, w->y, w->y + w->h, (int) (w->top->byte/16 - new_top)); else msetI(w->t->t->updtab + w->y, 1, w->h); pgoto(w->top,new_top*16); } /* Move forward */ if (w->cursor->byte >= w->top->byte+(w->h*16)) { long new_top; if (mid) { new_top = w->cursor->byte/16 - w->h / 2; } else { new_top = w->cursor->byte/16 - (w->h - 1); } if (new_top - w->top->byte/16 < w->h) nscrlup(w->t->t, w->y, w->y + w->h, (int) (new_top - w->top->byte/16)); else { msetI(w->t->t->updtab + w->y, 1, w->h); } pgoto(w->top, new_top*16); } /* Adjust scroll offset */ if (w->cursor->byte % 16 + 60 >= w->w) dofs = w->cursor->byte % 16 + 60 - (w->w - 1); if (w->offset != dofs) { w->offset = dofs; msetI(w->t->t->updtab + w->y, 1, w->h); } } /* For text */ static void bwfllwt(BW *w) { P *newtop; if (w->cursor->line < w->top->line) { newtop = pdup(w->cursor); p_goto_bol(newtop); if (mid) { if (newtop->line >= w->h / 2) pline(newtop, newtop->line - w->h / 2); else pset(newtop, newtop->b->bof); } if (w->top->line - newtop->line < w->h) nscrldn(w->t->t, w->y, w->y + w->h, (int) (w->top->line - newtop->line)); else { msetI(w->t->t->updtab + w->y, 1, w->h); msetI(w->t->t->syntab + w->y, -1, w->h); } pset(w->top, newtop); prm(newtop); } else if (w->cursor->line >= w->top->line + w->h) { pdup(w->top); newtop = getto(NULL, w->cursor, w->top, w->cursor->line - (mid ? (w->h / 2) : (w->h - 1))); if (newtop->line - w->top->line < w->h) nscrlup(w->t->t, w->y, w->y + w->h, (int) (newtop->line - w->top->line)); else { msetI(w->t->t->updtab + w->y, 1, w->h); msetI(w->t->t->syntab + w->y, -1, w->h); } pset(w->top, newtop); prm(newtop); } /* Adjust column */ if (w->cursor->xcol < w->offset) { w->offset = w->cursor->xcol; msetI(w->t->t->updtab + w->y, 1, w->h); } else if (w->cursor->xcol >= w->offset + w->w) { w->offset = w->cursor->xcol - (w->w - 1); msetI(w->t->t->updtab + w->y, 1, w->h); } } /* For either */ void bwfllw(jobject jO) { BW *w = jO.bw; if (w->o.hex) bwfllwh(w); else bwfllwt(w); } /* Determine highlighting state of a particular line on the window. If the state is not known, it is computed and the state for all of the remaining lines of the window are also recalculated. */ static int get_highlight_state(BW *w, int line) { P *tmp = 0; int state; /* Screen y position of requested line */ int y = line-w->top->line+w->y; if(!w->o.highlight || !w->o.syntax) return -1; /* If we know the state, just return it */ if (w->parent->t->t->syntab[y]>=0) return w->parent->t->t->syntab[y]; /* Scan upwards until we have a line with known state or we're on the first line */ while (y > w->y && w->parent->t->t->syntab[y] < 0) --y; /* If we don't have state for this line, calculate by going 100 lines back */ if (w->parent->t->t->syntab[y]<0) { /* We must be on the top line */ state = 0; tmp = pdup(w->top); if(w->o.syntax->sync_lines >= 0 && tmp->line > w->o.syntax->sync_lines) pline(tmp, tmp->line-w->o.syntax->sync_lines); else p_goto_bof(tmp); while(tmp->line!=y-w->y+w->top->line) state = parse(w->o.syntax,tmp,state); w->parent->t->t->syntab[y] = state; w->parent->t->t->updtab[y] = 1; prm(tmp); } /* Color to end of screen */ tmp = pdup(w->top); pline(tmp, y-w->y+w->top->line); state = w->parent->t->t->syntab[y]; while(tmp->line!=w->top->line+w->h-1 && !piseof(tmp)) { state = parse(w->o.syntax,tmp,state); w->parent->t->t->syntab[++y] = state; w->parent->t->t->updtab[y] = 1; /* This could be smarter: update only if we changed what was there before */ } prm(tmp); while(yy+w->h-1) { w->parent->t->t->syntab[++y] = state; } /* Line after window */ /* state = parse_c(state,syn,tmp); */ /* If we changed, fix other windows */ /* w->state = state; */ /* Return state of requested line */ y = line - w->top->line + w->y; return w->parent->t->t->syntab[y]; } /* Scroll a buffer window after an insert occurred. 'flg' is set to 1 if * the first line was split */ void bwins(BW *w, long int l, long int n, int flg) { if (l + flg + n < w->top->line + w->h && l + flg >= w->top->line && l + flg <= w->b->eof->line) { if (flg) w->t->t->sary[w->y + l - w->top->line] = w->t->t->li; nscrldn(w->t->t, (int) (w->y + l + flg - w->top->line), w->y + w->h, (int) n); } if (l < w->top->line + w->h && l >= w->top->line) { if (n >= w->h - (l - w->top->line)) { msetI(w->t->t->updtab + w->y + l - w->top->line, 1, w->h - (int) (l - w->top->line)); msetI(w->t->t->syntab + w->y + l - w->top->line, -1, w->h - (int) (l - w->top->line)); } else { msetI(w->t->t->updtab + w->y + l - w->top->line, 1, (int) n + 1); msetI(w->t->t->syntab + w->y + l - w->top->line, -1, (int) n + 1); } } } /* Scroll current windows after a delete */ void bwdel(BW *w, long int l, long int n, int flg) { /* Update the line where the delete began */ if (l < w->top->line + w->h && l >= w->top->line) w->t->t->updtab[w->y + l - w->top->line] = 1; /* Update highlight for line after first one which changed */ if ((l+1) < w->top->line + w->h && (l+1) >= w->top->line) { w->t->t->syntab[w->y + (l+1) - w->top->line] = -1; w->t->t->updtab[w->y + (l+1) - w->top->line] = 1; } /* Update the line where the delete ended */ if (l + n < w->top->line + w->h && l + n >= w->top->line) w->t->t->updtab[w->y + l + n - w->top->line] = 1; if (l < w->top->line + w->h && (l + n >= w->top->line + w->h || (l + n == w->b->eof->line && w->b->eof->line >= w->top->line + w->h))) { if (l >= w->top->line) /* Update window from l to end */ msetI(w->t->t->updtab + w->y + l - w->top->line, 1, w->h - (int) (l - w->top->line)); else /* Update entire window */ msetI(w->t->t->updtab + w->y, 1, w->h); } else if (l < w->top->line + w->h && l + n == w->b->eof->line && w->b->eof->line < w->top->line + w->h) { if (l >= w->top->line) /* Update window from l to end of file */ msetI(w->t->t->updtab + w->y + l - w->top->line, 1, (int) n); else /* Update from beginning of window to end of file */ msetI(w->t->t->updtab + w->y, 1, (int) (w->b->eof->line - w->top->line)); } else if (l + n < w->top->line + w->h && l + n > w->top->line && l + n < w->b->eof->line) { if (l + flg >= w->top->line) nscrlup(w->t->t, (int) (w->y + l + flg - w->top->line), w->y + w->h, (int) n); else nscrlup(w->t->t, w->y, w->y + w->h, (int) (l + n - w->top->line)); } } /* Update a single line */ static int lgen(SCRN *t, int y, /* screen line address */ int *screen, int *attr, int x, /* window */ int w, /* buffer pointer */ P *p, /* starting column to display */ long int scr, /* range for marked block */ long int from, long int to, int st, BW *bw) { int ox = x; int tach, tach1; int done = 1; long col = 0; long byte = p->byte; unsigned char *bp; /* Buffer pointer, 0 if not set */ int amnt; /* Amount left in this segment of the buffer */ int c, ta, c1 = 0; unsigned char bc = 0; int ungetit = -1; struct utf8_sm utf8_sm; int *syn = NULL; P *tmp; int idx=0; int atr = 0; utf8_init(&utf8_sm); if(st!=-1) { tmp=pdup(p); p_goto_bol(tmp); parse(bw->o.syntax,tmp,st); syn = attr_buf; prm(tmp); } /* Initialise bp and amnt from p */ if (p->ofst >= p->hdr->hole) { bp = p->ptr + p->hdr->ehole + p->ofst - p->hdr->hole; amnt = SEGSIZ - p->hdr->ehole - (p->ofst - p->hdr->hole); } else { bp = p->ptr + p->ofst; amnt = p->hdr->hole - p->ofst; } if (col == scr) goto v_loop; #define LGEN_Q #define LGEN_LABEL(x) q_ ## x #include "bw-lgen.inc" #undef LGEN_LABEL #undef LGEN_Q #define LGEN_LABEL(x) v_ ## x #include "bw-lgen.inc" #undef LGEN_LABEL eobl: /* End of buffer line found. Erase to end of screen line */ ++p->line; eof: done = x == w ? 0 : eraeol(t, x, y); bye: c = 1; if (0) /* FALLTHROUGH */ eosl: done = c = 0; /* End of screen line */ /* Set p to bp/amnt */ if ((p->ofst = bp - p->ptr) > p->hdr->hole) p->ofst -= p->hdr->ehole - p->hdr->hole; p->byte = byte; if (!c) pnextl(p); return (done); } static void gennum(BW *w, int *screen, int *attr, SCRN *t, int y, int *comp) { unsigned char buf[12]; int z; int lin = w->top->line + y - w->y; if (lin <= w->b->eof->line) joe_snprintf_1((char *)buf, sizeof(buf), "%5ld ", w->top->line + y - w->y + 1); else strlcpy((char *)buf, " ",12); for (z = 0; buf[z]; ++z) { outatr(w->b->o.charmap, t, screen + z, attr + z, z, y, buf[z], 0); if (have) return; comp[z] = buf[z]; } } void bwgenh(BW *w) { int *screen; int *attr; P *q = pdup(w->top); int bot = w->h + w->y; int y; SCRN *t = w->t->t; int flg = 0; long from; long to; int dosquare = 0; from = to = 0; if (markv(0) && markk->b == w->b) if (square) { from = markb->xcol; to = markk->xcol; dosquare = 1; } else { from = markb->byte; to = markk->byte; } else if (marking && w == maint->curwin->object.bw && markb && markb->b == w->b && w->cursor->byte != markb->byte && !from) { if (square) { from = long_min(w->cursor->xcol, markb->xcol); to = long_max(w->cursor->xcol, markb->xcol); dosquare = 1; } else { from = long_min(w->cursor->byte, markb->byte); to = long_max(w->cursor->byte, markb->byte); } } if (marking && w == maint->curwin->object.bw) msetI(t->updtab + w->y, 1, w->h); if (dosquare) { from = 0; to = 0; } y=w->y; attr = t->attr + y*w->t->w; for (screen = t->scrn + y * w->t->w; y != bot; ++y, (screen += w->t->w), (attr += w->t->w)) { unsigned char txt[80]; int fmt[80]; unsigned char bf[16]; int x; memset(txt,' ',76); msetI(fmt, /* BG_COLOR(bg_text) */ 0,76); txt[76]=0; if (!flg) { #if SIZEOF_LONG_LONG && SIZEOF_LONG_LONG == SIZEOF_OFF_T joe_snprintf_1((char *)bf,sizeof(bf),"%8llX ",(unsigned long long)q->byte); #else joe_snprintf_1((char *)bf,sizeof(bf),"%8lX ",(unsigned long)q->byte); #endif memcpy(txt,bf,9); for (x=0; x!=8; ++x) { int c; if (q->byte==w->cursor->byte && !flg) { fmt[10+x*3] |= INVERSE; fmt[10+x*3+1] |= INVERSE; } if (q->byte>=from && q->byte= 0) { joe_snprintf_1((char *)bf,sizeof(bf),"%2.2X",c); txt[10+x*3] = bf[0]; txt[10+x*3+1] = bf[1]; if (c >= 0x20 && c <= 0x7E) txt[60+x] = c; else txt[60+x] = '.'; } else flg = 1; } for (x=8; x!=16; ++x) { int c; if (q->byte==w->cursor->byte && !flg) { fmt[11+x*3] |= INVERSE; fmt[11+x*3+1] |= INVERSE; } if (q->byte>=from && q->byte= 0) { joe_snprintf_1((char *)bf,sizeof(bf),"%2.2X",c); txt[11+x*3] = bf[0]; txt[11+x*3+1] = bf[1]; if (c >= 0x20 && c <= 0x7E) txt[60+x] = c; else txt[60+x] = '.'; } else flg = 1; } } genfield(t, screen, attr, 0, y, w->offset, txt, 76, 0, w->w, 1, fmt); } prm(q); } void bwgen(BW *w, int linums) { int *screen; int *attr; P *p = NULL; P *q = pdup(w->cursor); int bot = w->h + w->y; int y; int dosquare = 0; long from, to; long fromline, toline; SCRN *t = w->t->t; fromline = toline = from = to = 0; if (markv(0) && markk->b == w->b) if (square) { from = markb->xcol; to = markk->xcol; dosquare = 1; fromline = markb->line; toline = markk->line; } else { from = markb->byte; to = markk->byte; } else if (marking && w == maint->curwin->object.bw && markb && markb->b == w->b && w->cursor->byte != markb->byte && !from) { if (square) { from = long_min(w->cursor->xcol, markb->xcol); to = long_max(w->cursor->xcol, markb->xcol); fromline = long_min(w->cursor->line, markb->line); toline = long_max(w->cursor->line, markb->line); dosquare = 1; } else { from = long_min(w->cursor->byte, markb->byte); to = long_max(w->cursor->byte, markb->byte); } } if (marking && w == maint->curwin->object.bw) msetI(t->updtab + w->y, 1, w->h); y = w->cursor->line - w->top->line + w->y; attr = t->attr + y*w->t->w; for (screen = t->scrn + y * w->t->w; y != bot; ++y, (screen += w->t->w), (attr += w->t->w)) { if (have && !linums) break; if (linums) gennum(w, screen, attr, t, y, t->compose); if (t->updtab[y]) { p = getto(p, w->cursor, w->top, w->top->line + y - w->y); /* if (t->insdel && !w->x) { pset(q, p); if (dosquare) if (w->top->line + y - w->y >= fromline && w->top->line + y - w->y <= toline) lgena(t, y, t->compose, w->x, w->x + w->w, q, w->offset, from, to); else lgena(t, y, t->compose, w->x, w->x + w->w, q, w->offset, 0L, 0L); else lgena(t, y, t->compose, w->x, w->x + w->w, q, w->offset, from, to); magic(t, y, screen, t->compose, (int) (w->cursor->xcol - w->offset + w->x)); } */ if (dosquare) if (w->top->line + y - w->y >= fromline && w->top->line + y - w->y <= toline) t->updtab[y] = lgen(t, y, screen, attr, w->x, w->x + w->w, p, w->offset, from, to, get_highlight_state(w,w->top->line+y-w->y),w); else t->updtab[y] = lgen(t, y, screen, attr, w->x, w->x + w->w, p, w->offset, 0L, 0L, get_highlight_state(w,w->top->line+y-w->y),w); else t->updtab[y] = lgen(t, y, screen, attr, w->x, w->x + w->w, p, w->offset, from, to, get_highlight_state(w,w->top->line+y-w->y),w); } } y = w->y; attr = t->attr + w->y * w->t->w; for (screen = t->scrn + w->y * w->t->w; y != w->y + w->cursor->line - w->top->line; ++y, (screen += w->t->w), (attr += w->t->w)) { if (have && !linums) break; if (linums) gennum(w, screen, attr, t, y, t->compose); if (t->updtab[y]) { p = getto(p, w->cursor, w->top, w->top->line + y - w->y); /* if (t->insdel && !w->x) { pset(q, p); if (dosquare) if (w->top->line + y - w->y >= fromline && w->top->line + y - w->y <= toline) lgena(t, y, t->compose, w->x, w->x + w->w, q, w->offset, from, to); else lgena(t, y, t->compose, w->x, w->x + w->w, q, w->offset, 0L, 0L); else lgena(t, y, t->compose, w->x, w->x + w->w, q, w->offset, from, to); magic(t, y, screen, t->compose, (int) (w->cursor->xcol - w->offset + w->x)); } */ if (dosquare) if (w->top->line + y - w->y >= fromline && w->top->line + y - w->y <= toline) t->updtab[y] = lgen(t, y, screen, attr, w->x, w->x + w->w, p, w->offset, from, to, get_highlight_state(w,w->top->line+y-w->y),w); else t->updtab[y] = lgen(t, y, screen, attr, w->x, w->x + w->w, p, w->offset, 0L, 0L, get_highlight_state(w,w->top->line+y-w->y),w); else t->updtab[y] = lgen(t, y, screen, attr, w->x, w->x + w->w, p, w->offset, from, to, get_highlight_state(w,w->top->line+y-w->y),w); } } prm(q); if (p) prm(p); } void bwmove(BW *w, int x, int y) { w->x = x; w->y = y; } void bwresz(BW *w, int wi, int he) { if (he > w->h && w->y != -1) { msetI(w->t->t->updtab + w->y + w->h, 1, he - w->h); msetI(w->t->t->syntab + w->y + w->h, -1, he - w->h); } w->w = wi; w->h = he; } BW *bwmk(W *window, B *b, int prompt) { BW *w = malloc(sizeof(BW)); w->parent = window; w->b = b; if (prompt || (!window->y && staen)) { w->y = window->y; w->h = window->h; } else { w->y = window->y + 1; w->h = window->h - 1; } if (b->oldcur) { w->top = b->oldtop; b->oldtop = NULL; w->top->owner = NULL; w->cursor = b->oldcur; b->oldcur = NULL; w->cursor->owner = NULL; } else { w->top = pdup(b->bof); w->cursor = pdup(b->bof); } w->t = window->t; w->object = NULL; w->offset = 0; w->o = w->b->o; if ((w->linums = w->o.linums)) { w->x = window->x + LINCOLS; w->w = window->w - LINCOLS; } else { w->x = window->x; w->w = window->w; } if (window == window->main) { rmkbd(window->kbd); window->kbd = mkkbd(kmap_getcontext(w->o.context, 1)); } w->top->xcol = 0; w->cursor->xcol = 0; w->top_changed = 1; return w; } void bwrm(BW *w) { prm(w->top); prm(w->cursor); brm(w->b); free(w); } int ustat_j(BW *bw) { static unsigned char buf[80]; int c = brch(bw->cursor); if (c == NO_MORE_DATA) joe_snprintf_4((char *)buf, sizeof(buf), "** Line %ld Col %ld Offset %ld(0x%lX) **", bw->cursor->line + 1, piscol(bw->cursor) + 1, bw->cursor->byte, bw->cursor->byte); else joe_snprintf_9((char *)buf, sizeof(buf), "** Line %ld Col %ld Offset %ld(0x%lX) %s %d(0%o/0x%X) Width %d **", bw->cursor->line + 1, piscol(bw->cursor) + 1, bw->cursor->byte, bw->cursor->byte, joe_mapname(bw->b->o.charmap), c, c, c, joe_maputf(bw->o.charmap) ? joe_wcwidth(c) : 1); msgnw(bw->parent, buf); return 0; } int ucrawlr(BW *bw) { int amnt = bw->w / 2; pcol(bw->cursor, bw->cursor->xcol + amnt); bw->cursor->xcol += amnt; bw->offset += amnt; updall(); return 0; } int ucrawll(BW *bw) { int amnt = bw->w / 2; int curamnt = bw->w / 2; if (amnt > bw->offset) { amnt = bw->offset; curamnt = bw->offset; } if (!bw->offset) curamnt = bw->cursor->xcol; if (!curamnt) return -1; pcol(bw->cursor, bw->cursor->xcol - curamnt); bw->cursor->xcol -= curamnt; bw->offset -= amnt; updall(); return 0; } void orphit(BW *bw) { ++bw->b->count; bw->b->orphan = 1; pdupown(bw->cursor, &bw->b->oldcur); pdupown(bw->top, &bw->b->oldtop); } jupp/bw.h010064400000000000000000000013231363731763200075560ustar00/* * Edit buffer window generation * Copyright * (C) 1992 Joseph H. Allen * * This file is part of JOE (Joe's Own Editor) */ #ifndef JUPP_BW_H #define JUPP_BW_H #ifdef EXTERN_CMD_C __IDSTRING(rcsid_bw_h, "$MirOS: contrib/code/jupp/bw.h,v 1.9 2020/03/27 06:38:55 tg Exp $"); #endif extern int dspasis; extern int mid; void bwfllw(jobject); void bwins(BW *w, long int l, long int n, int flg); void bwdel(BW *w, long int l, long int n, int flg); void bwgen(BW *w, int linums); void bwgenh(BW *w); BW *bwmk(W *window, B *b, int prompt); void bwmove(BW *w, int x, int y); void bwresz(BW *w, int wi, int he); void bwrm(BW *w); int ustat_j(BW *bw); int ucrawll(BW *bw); int ucrawlr(BW *bw); void orphit(BW *bw); #endif jupp/charmap.c010064400000000000000000002147211431512623400105520ustar00#if 0 .if "0" == "1" #endif /* * Universal Coded Character Set/ISO-10646 conversion utilities * Copyright * (C) 2004 Joseph H. Allen * * This file is part of JOE (Joe's Own Editor) */ #include "config.h" #include "types.h" __RCSID("$MirOS: contrib/code/jupp/charmap.c,v 1.34 2022/09/28 20:20:17 tg Exp $"); #include #include #include "va.h" #include "utils.h" #include "path.h" #include "charmap.h" const unsigned char JOE_MAPUTFCS[] = "utf-8"; /* Convert from UCS to byte code. Returns -1 for unknown. */ int byte_from_uni(union charmap *cset, int c) { int x, y, z; x = 0; y = cset->byte.from_size - 1; z = -1; /* this is not a bsearch and first/last are in reality from/to */ while (z != (x + y + 1) / 2) { z = (x + y + 1) / 2; if (c > cset->byte.from_map[z].first) x = z; else if (c < cset->byte.from_map[z].first) y = z; else return (cset->byte.from_map[z].last); } return (-1); } /* Builtin maps */ /* Aliases */ static const struct { const unsigned char *alias; const unsigned char *builtin; } alias_table[] = { { UC "c", UC "ascii" }, { UC "posix", UC "ascii" }, { UC "iso646", UC "ascii" }, { UC "8859-1", UC "iso-8859-1" }, { UC "8859-2", UC "iso-8859-2" }, { UC "8859-3", UC "iso-8859-3" }, { UC "8859-4", UC "iso-8859-4" }, { UC "8859-5", UC "iso-8859-5" }, { UC "8859-6", UC "iso-8859-6" }, { UC "8859-7", UC "iso-8859-7" }, { UC "8859-8", UC "iso-8859-8" }, { UC "8859-9", UC "iso-8859-9" }, { UC "8859-10", UC "iso-8859-10" }, { UC "8859-11", UC "iso-8859-11" }, { UC "8859-13", UC "iso-8859-13" }, { UC "8859-14", UC "iso-8859-14" }, { UC "8859-15", UC "iso-8859-15" }, { UC "8859-16", UC "iso-8859-16" }, { UC "oem", UC "cp437" }, { UC "ansi", UC "cp1252" }, { UC "latin1", UC "iso-8859-1" }, { UC "latin2", UC "iso-8859-2" }, { UC "latin3", UC "iso-8859-3" }, { UC "latin4", UC "iso-8859-4" }, { UC "cyrillic", UC "iso-8859-5" }, { UC "arabic", UC "iso-8859-6" }, { UC "greek", UC "iso-8859-7" }, { UC "hebrew", UC "iso-8859-8" }, { UC "latin5", UC "iso-8859-9" }, { UC "turkish", UC "iso-8859-9" }, { UC "latin6", UC "iso-8859-10" }, { UC "nordic", UC "iso-8859-10" }, { UC "thai", UC "iso-8859-11" }, { UC "latin7", UC "iso-8859-13" }, { UC "latin8", UC "iso-8859-14" }, { UC "latin9", UC "iso-8859-15" }, { UC "cp20127", UC "ascii" }, { UC "cp20866", UC "koi8-r" }, { UC "cp21866", UC "koi8-u" }, { UC "cp28591", UC "iso-8859-1" }, { UC "cp28592", UC "iso-8859-2" }, { UC "cp28593", UC "iso-8859-3" }, { UC "cp28594", UC "iso-8859-4" }, { UC "cp28595", UC "iso-8859-5" }, { UC "cp28596", UC "iso-8859-6" }, { UC "cp28597", UC "iso-8859-7" }, { UC "cp28598", UC "iso-8859-8" }, { UC "cp28599", UC "iso-8859-9" }, { UC "cp28603", UC "iso-8859-13" }, { UC "cp28605", UC "iso-8859-15" }, { UC "cp65001", JOE_MAPUTFCS }, { 0, 0 } }; static const struct builtin_charmap { const unsigned char *name; int extra_b7, extra_2192; int to_uni[256]; } builtin_charmaps[] = { { UC "ascii", 0x20, 0x20, { 0x0000, 0x0001, 0x0002, 0x0003, 0x0004, 0x0005, 0x0006, 0x0007, 0x0008, 0x0009, 0x000a, 0x000b, 0x000c, 0x000d, 0x000e, 0x000f, 0x0010, 0x0011, 0x0012, 0x0013, 0x0014, 0x0015, 0x0016, 0x0017, 0x0018, 0x0019, 0x001a, 0x001b, 0x001c, 0x001d, 0x001e, 0x001f, 0x0020, 0x0021, 0x0022, 0x0023, 0x0024, 0x0025, 0x0026, 0x0027, 0x0028, 0x0029, 0x002a, 0x002b, 0x002c, 0x002d, 0x002e, 0x002f, 0x0030, 0x0031, 0x0032, 0x0033, 0x0034, 0x0035, 0x0036, 0x0037, 0x0038, 0x0039, 0x003a, 0x003b, 0x003c, 0x003d, 0x003e, 0x003f, 0x0040, 0x0041, 0x0042, 0x0043, 0x0044, 0x0045, 0x0046, 0x0047, 0x0048, 0x0049, 0x004a, 0x004b, 0x004c, 0x004d, 0x004e, 0x004f, 0x0050, 0x0051, 0x0052, 0x0053, 0x0054, 0x0055, 0x0056, 0x0057, 0x0058, 0x0059, 0x005a, 0x005b, 0x005c, 0x005d, 0x005e, 0x005f, 0x0060, 0x0061, 0x0062, 0x0063, 0x0064, 0x0065, 0x0066, 0x0067, 0x0068, 0x0069, 0x006a, 0x006b, 0x006c, 0x006d, 0x006e, 0x006f, 0x0070, 0x0071, 0x0072, 0x0073, 0x0074, 0x0075, 0x0076, 0x0077, 0x0078, 0x0079, 0x007a, 0x007b, 0x007c, 0x007d, 0x007e, 0x007f, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1 }}, { UC "iso-8859-1", 0xB7, 0xAC, { 0x0000, 0x0001, 0x0002, 0x0003, 0x0004, 0x0005, 0x0006, 0x0007, 0x0008, 0x0009, 0x000a, 0x000b, 0x000c, 0x000d, 0x000e, 0x000f, 0x0010, 0x0011, 0x0012, 0x0013, 0x0014, 0x0015, 0x0016, 0x0017, 0x0018, 0x0019, 0x001a, 0x001b, 0x001c, 0x001d, 0x001e, 0x001f, 0x0020, 0x0021, 0x0022, 0x0023, 0x0024, 0x0025, 0x0026, 0x0027, 0x0028, 0x0029, 0x002a, 0x002b, 0x002c, 0x002d, 0x002e, 0x002f, 0x0030, 0x0031, 0x0032, 0x0033, 0x0034, 0x0035, 0x0036, 0x0037, 0x0038, 0x0039, 0x003a, 0x003b, 0x003c, 0x003d, 0x003e, 0x003f, 0x0040, 0x0041, 0x0042, 0x0043, 0x0044, 0x0045, 0x0046, 0x0047, 0x0048, 0x0049, 0x004a, 0x004b, 0x004c, 0x004d, 0x004e, 0x004f, 0x0050, 0x0051, 0x0052, 0x0053, 0x0054, 0x0055, 0x0056, 0x0057, 0x0058, 0x0059, 0x005a, 0x005b, 0x005c, 0x005d, 0x005e, 0x005f, 0x0060, 0x0061, 0x0062, 0x0063, 0x0064, 0x0065, 0x0066, 0x0067, 0x0068, 0x0069, 0x006a, 0x006b, 0x006c, 0x006d, 0x006e, 0x006f, 0x0070, 0x0071, 0x0072, 0x0073, 0x0074, 0x0075, 0x0076, 0x0077, 0x0078, 0x0079, 0x007a, 0x007b, 0x007c, 0x007d, 0x007e, 0x007f, 0x0080, 0x0081, 0x0082, 0x0083, 0x0084, 0x0085, 0x0086, 0x0087, 0x0088, 0x0089, 0x008a, 0x008b, 0x008c, 0x008d, 0x008e, 0x008f, 0x0090, 0x0091, 0x0092, 0x0093, 0x0094, 0x0095, 0x0096, 0x0097, 0x0098, 0x0099, 0x009a, 0x009b, 0x009c, 0x009d, 0x009e, 0x009f, 0x00a0, 0x00a1, 0x00a2, 0x00a3, 0x00a4, 0x00a5, 0x00a6, 0x00a7, 0x00a8, 0x00a9, 0x00aa, 0x00ab, 0x00ac, 0x00ad, 0x00ae, 0x00af, 0x00b0, 0x00b1, 0x00b2, 0x00b3, 0x00b4, 0x00b5, 0x00b6, 0x00b7, 0x00b8, 0x00b9, 0x00ba, 0x00bb, 0x00bc, 0x00bd, 0x00be, 0x00bf, 0x00c0, 0x00c1, 0x00c2, 0x00c3, 0x00c4, 0x00c5, 0x00c6, 0x00c7, 0x00c8, 0x00c9, 0x00ca, 0x00cb, 0x00cc, 0x00cd, 0x00ce, 0x00cf, 0x00d0, 0x00d1, 0x00d2, 0x00d3, 0x00d4, 0x00d5, 0x00d6, 0x00d7, 0x00d8, 0x00d9, 0x00da, 0x00db, 0x00dc, 0x00dd, 0x00de, 0x00df, 0x00e0, 0x00e1, 0x00e2, 0x00e3, 0x00e4, 0x00e5, 0x00e6, 0x00e7, 0x00e8, 0x00e9, 0x00ea, 0x00eb, 0x00ec, 0x00ed, 0x00ee, 0x00ef, 0x00f0, 0x00f1, 0x00f2, 0x00f3, 0x00f4, 0x00f5, 0x00f6, 0x00f7, 0x00f8, 0x00f9, 0x00fa, 0x00fb, 0x00fc, 0x00fd, 0x00fe, 0x00ff }}, { UC "iso-8859-2", 0x20, 0x20, { 0x0000, 0x0001, 0x0002, 0x0003, 0x0004, 0x0005, 0x0006, 0x0007, 0x0008, 0x0009, 0x000a, 0x000b, 0x000c, 0x000d, 0x000e, 0x000f, 0x0010, 0x0011, 0x0012, 0x0013, 0x0014, 0x0015, 0x0016, 0x0017, 0x0018, 0x0019, 0x001a, 0x001b, 0x001c, 0x001d, 0x001e, 0x001f, 0x0020, 0x0021, 0x0022, 0x0023, 0x0024, 0x0025, 0x0026, 0x0027, 0x0028, 0x0029, 0x002a, 0x002b, 0x002c, 0x002d, 0x002e, 0x002f, 0x0030, 0x0031, 0x0032, 0x0033, 0x0034, 0x0035, 0x0036, 0x0037, 0x0038, 0x0039, 0x003a, 0x003b, 0x003c, 0x003d, 0x003e, 0x003f, 0x0040, 0x0041, 0x0042, 0x0043, 0x0044, 0x0045, 0x0046, 0x0047, 0x0048, 0x0049, 0x004a, 0x004b, 0x004c, 0x004d, 0x004e, 0x004f, 0x0050, 0x0051, 0x0052, 0x0053, 0x0054, 0x0055, 0x0056, 0x0057, 0x0058, 0x0059, 0x005a, 0x005b, 0x005c, 0x005d, 0x005e, 0x005f, 0x0060, 0x0061, 0x0062, 0x0063, 0x0064, 0x0065, 0x0066, 0x0067, 0x0068, 0x0069, 0x006a, 0x006b, 0x006c, 0x006d, 0x006e, 0x006f, 0x0070, 0x0071, 0x0072, 0x0073, 0x0074, 0x0075, 0x0076, 0x0077, 0x0078, 0x0079, 0x007a, 0x007b, 0x007c, 0x007d, 0x007e, 0x007f, 0x0080, 0x0081, 0x0082, 0x0083, 0x0084, 0x0085, 0x0086, 0x0087, 0x0088, 0x0089, 0x008a, 0x008b, 0x008c, 0x008d, 0x008e, 0x008f, 0x0090, 0x0091, 0x0092, 0x0093, 0x0094, 0x0095, 0x0096, 0x0097, 0x0098, 0x0099, 0x009a, 0x009b, 0x009c, 0x009d, 0x009e, 0x009f, 0x00a0, 0x0104, 0x02d8, 0x0141, 0x00a4, 0x013d, 0x015a, 0x00a7, 0x00a8, 0x0160, 0x015e, 0x0164, 0x0179, 0x00ad, 0x017d, 0x017b, 0x00b0, 0x0105, 0x02db, 0x0142, 0x00b4, 0x013e, 0x015b, 0x02c7, 0x00b8, 0x0161, 0x015f, 0x0165, 0x017a, 0x02dd, 0x017e, 0x017c, 0x0154, 0x00c1, 0x00c2, 0x0102, 0x00c4, 0x0139, 0x0106, 0x00c7, 0x010c, 0x00c9, 0x0118, 0x00cb, 0x011a, 0x00cd, 0x00ce, 0x010e, 0x0110, 0x0143, 0x0147, 0x00d3, 0x00d4, 0x0150, 0x00d6, 0x00d7, 0x0158, 0x016e, 0x00da, 0x0170, 0x00dc, 0x00dd, 0x0162, 0x00df, 0x0155, 0x00e1, 0x00e2, 0x0103, 0x00e4, 0x013a, 0x0107, 0x00e7, 0x010d, 0x00e9, 0x0119, 0x00eb, 0x011b, 0x00ed, 0x00ee, 0x010f, 0x0111, 0x0144, 0x0148, 0x00f3, 0x00f4, 0x0151, 0x00f6, 0x00f7, 0x0159, 0x016f, 0x00fa, 0x0171, 0x00fc, 0x00fd, 0x0163, 0x02d9 }}, { UC "iso-8859-3", 0x20, 0x20, { 0x0000, 0x0001, 0x0002, 0x0003, 0x0004, 0x0005, 0x0006, 0x0007, 0x0008, 0x0009, 0x000a, 0x000b, 0x000c, 0x000d, 0x000e, 0x000f, 0x0010, 0x0011, 0x0012, 0x0013, 0x0014, 0x0015, 0x0016, 0x0017, 0x0018, 0x0019, 0x001a, 0x001b, 0x001c, 0x001d, 0x001e, 0x001f, 0x0020, 0x0021, 0x0022, 0x0023, 0x0024, 0x0025, 0x0026, 0x0027, 0x0028, 0x0029, 0x002a, 0x002b, 0x002c, 0x002d, 0x002e, 0x002f, 0x0030, 0x0031, 0x0032, 0x0033, 0x0034, 0x0035, 0x0036, 0x0037, 0x0038, 0x0039, 0x003a, 0x003b, 0x003c, 0x003d, 0x003e, 0x003f, 0x0040, 0x0041, 0x0042, 0x0043, 0x0044, 0x0045, 0x0046, 0x0047, 0x0048, 0x0049, 0x004a, 0x004b, 0x004c, 0x004d, 0x004e, 0x004f, 0x0050, 0x0051, 0x0052, 0x0053, 0x0054, 0x0055, 0x0056, 0x0057, 0x0058, 0x0059, 0x005a, 0x005b, 0x005c, 0x005d, 0x005e, 0x005f, 0x0060, 0x0061, 0x0062, 0x0063, 0x0064, 0x0065, 0x0066, 0x0067, 0x0068, 0x0069, 0x006a, 0x006b, 0x006c, 0x006d, 0x006e, 0x006f, 0x0070, 0x0071, 0x0072, 0x0073, 0x0074, 0x0075, 0x0076, 0x0077, 0x0078, 0x0079, 0x007a, 0x007b, 0x007c, 0x007d, 0x007e, 0x007f, 0x0080, 0x0081, 0x0082, 0x0083, 0x0084, 0x0085, 0x0086, 0x0087, 0x0088, 0x0089, 0x008a, 0x008b, 0x008c, 0x008d, 0x008e, 0x008f, 0x0090, 0x0091, 0x0092, 0x0093, 0x0094, 0x0095, 0x0096, 0x0097, 0x0098, 0x0099, 0x009a, 0x009b, 0x009c, 0x009d, 0x009e, 0x009f, 0x00a0, 0x0126, 0x02d8, 0x00a3, 0x00a4, -1, 0x0124, 0x00a7, 0x00a8, 0x0130, 0x015e, 0x011e, 0x0134, 0x00ad, -1, 0x017b, 0x00b0, 0x0127, 0x00b2, 0x00b3, 0x00b4, 0x00b5, 0x0125, 0x00b7, 0x00b8, 0x0131, 0x015f, 0x011f, 0x0135, 0x00bd, -1, 0x017c, 0x00c0, 0x00c1, 0x00c2, -1, 0x00c4, 0x010a, 0x0108, 0x00c7, 0x00c8, 0x00c9, 0x00ca, 0x00cb, 0x00cc, 0x00cd, 0x00ce, 0x00cf, -1, 0x00d1, 0x00d2, 0x00d3, 0x00d4, 0x0120, 0x00d6, 0x00d7, 0x011c, 0x00d9, 0x00da, 0x00db, 0x00dc, 0x016c, 0x015c, 0x00df, 0x00e0, 0x00e1, 0x00e2, -1, 0x00e4, 0x010b, 0x0109, 0x00e7, 0x00e8, 0x00e9, 0x00ea, 0x00eb, 0x00ec, 0x00ed, 0x00ee, 0x00ef, -1, 0x00f1, 0x00f2, 0x00f3, 0x00f4, 0x0121, 0x00f6, 0x00f7, 0x011d, 0x00f9, 0x00fa, 0x00fb, 0x00fc, 0x016d, 0x015d, 0x02d9 }}, { UC "iso-8859-4", 0x20, 0x20, { 0x0000, 0x0001, 0x0002, 0x0003, 0x0004, 0x0005, 0x0006, 0x0007, 0x0008, 0x0009, 0x000a, 0x000b, 0x000c, 0x000d, 0x000e, 0x000f, 0x0010, 0x0011, 0x0012, 0x0013, 0x0014, 0x0015, 0x0016, 0x0017, 0x0018, 0x0019, 0x001a, 0x001b, 0x001c, 0x001d, 0x001e, 0x001f, 0x0020, 0x0021, 0x0022, 0x0023, 0x0024, 0x0025, 0x0026, 0x0027, 0x0028, 0x0029, 0x002a, 0x002b, 0x002c, 0x002d, 0x002e, 0x002f, 0x0030, 0x0031, 0x0032, 0x0033, 0x0034, 0x0035, 0x0036, 0x0037, 0x0038, 0x0039, 0x003a, 0x003b, 0x003c, 0x003d, 0x003e, 0x003f, 0x0040, 0x0041, 0x0042, 0x0043, 0x0044, 0x0045, 0x0046, 0x0047, 0x0048, 0x0049, 0x004a, 0x004b, 0x004c, 0x004d, 0x004e, 0x004f, 0x0050, 0x0051, 0x0052, 0x0053, 0x0054, 0x0055, 0x0056, 0x0057, 0x0058, 0x0059, 0x005a, 0x005b, 0x005c, 0x005d, 0x005e, 0x005f, 0x0060, 0x0061, 0x0062, 0x0063, 0x0064, 0x0065, 0x0066, 0x0067, 0x0068, 0x0069, 0x006a, 0x006b, 0x006c, 0x006d, 0x006e, 0x006f, 0x0070, 0x0071, 0x0072, 0x0073, 0x0074, 0x0075, 0x0076, 0x0077, 0x0078, 0x0079, 0x007a, 0x007b, 0x007c, 0x007d, 0x007e, 0x007f, 0x0080, 0x0081, 0x0082, 0x0083, 0x0084, 0x0085, 0x0086, 0x0087, 0x0088, 0x0089, 0x008a, 0x008b, 0x008c, 0x008d, 0x008e, 0x008f, 0x0090, 0x0091, 0x0092, 0x0093, 0x0094, 0x0095, 0x0096, 0x0097, 0x0098, 0x0099, 0x009a, 0x009b, 0x009c, 0x009d, 0x009e, 0x009f, 0x00a0, 0x0104, 0x0138, 0x0156, 0x00a4, 0x0128, 0x013b, 0x00a7, 0x00a8, 0x0160, 0x0112, 0x0122, 0x0166, 0x00ad, 0x017d, 0x00af, 0x00b0, 0x0105, 0x02db, 0x0157, 0x00b4, 0x0129, 0x013c, 0x02c7, 0x00b8, 0x0161, 0x0113, 0x0123, 0x0167, 0x014a, 0x017e, 0x014b, 0x0100, 0x00c1, 0x00c2, 0x00c3, 0x00c4, 0x00c5, 0x00c6, 0x012e, 0x010c, 0x00c9, 0x0118, 0x00cb, 0x0116, 0x00cd, 0x00ce, 0x012a, 0x0110, 0x0145, 0x014c, 0x0136, 0x00d4, 0x00d5, 0x00d6, 0x00d7, 0x00d8, 0x0172, 0x00da, 0x00db, 0x00dc, 0x0168, 0x016a, 0x00df, 0x0101, 0x00e1, 0x00e2, 0x00e3, 0x00e4, 0x00e5, 0x00e6, 0x012f, 0x010d, 0x00e9, 0x0119, 0x00eb, 0x0117, 0x00ed, 0x00ee, 0x012b, 0x0111, 0x0146, 0x014d, 0x0137, 0x00f4, 0x00f5, 0x00f6, 0x00f7, 0x00f8, 0x0173, 0x00fa, 0x00fb, 0x00fc, 0x0169, 0x016b, 0x02d9 }}, { UC "iso-8859-5", 0x20, 0x20, { 0x0000, 0x0001, 0x0002, 0x0003, 0x0004, 0x0005, 0x0006, 0x0007, 0x0008, 0x0009, 0x000a, 0x000b, 0x000c, 0x000d, 0x000e, 0x000f, 0x0010, 0x0011, 0x0012, 0x0013, 0x0014, 0x0015, 0x0016, 0x0017, 0x0018, 0x0019, 0x001a, 0x001b, 0x001c, 0x001d, 0x001e, 0x001f, 0x0020, 0x0021, 0x0022, 0x0023, 0x0024, 0x0025, 0x0026, 0x0027, 0x0028, 0x0029, 0x002a, 0x002b, 0x002c, 0x002d, 0x002e, 0x002f, 0x0030, 0x0031, 0x0032, 0x0033, 0x0034, 0x0035, 0x0036, 0x0037, 0x0038, 0x0039, 0x003a, 0x003b, 0x003c, 0x003d, 0x003e, 0x003f, 0x0040, 0x0041, 0x0042, 0x0043, 0x0044, 0x0045, 0x0046, 0x0047, 0x0048, 0x0049, 0x004a, 0x004b, 0x004c, 0x004d, 0x004e, 0x004f, 0x0050, 0x0051, 0x0052, 0x0053, 0x0054, 0x0055, 0x0056, 0x0057, 0x0058, 0x0059, 0x005a, 0x005b, 0x005c, 0x005d, 0x005e, 0x005f, 0x0060, 0x0061, 0x0062, 0x0063, 0x0064, 0x0065, 0x0066, 0x0067, 0x0068, 0x0069, 0x006a, 0x006b, 0x006c, 0x006d, 0x006e, 0x006f, 0x0070, 0x0071, 0x0072, 0x0073, 0x0074, 0x0075, 0x0076, 0x0077, 0x0078, 0x0079, 0x007a, 0x007b, 0x007c, 0x007d, 0x007e, 0x007f, 0x0080, 0x0081, 0x0082, 0x0083, 0x0084, 0x0085, 0x0086, 0x0087, 0x0088, 0x0089, 0x008a, 0x008b, 0x008c, 0x008d, 0x008e, 0x008f, 0x0090, 0x0091, 0x0092, 0x0093, 0x0094, 0x0095, 0x0096, 0x0097, 0x0098, 0x0099, 0x009a, 0x009b, 0x009c, 0x009d, 0x009e, 0x009f, 0x00a0, 0x0401, 0x0402, 0x0403, 0x0404, 0x0405, 0x0406, 0x0407, 0x0408, 0x0409, 0x040a, 0x040b, 0x040c, 0x00ad, 0x040e, 0x040f, 0x0410, 0x0411, 0x0412, 0x0413, 0x0414, 0x0415, 0x0416, 0x0417, 0x0418, 0x0419, 0x041a, 0x041b, 0x041c, 0x041d, 0x041e, 0x041f, 0x0420, 0x0421, 0x0422, 0x0423, 0x0424, 0x0425, 0x0426, 0x0427, 0x0428, 0x0429, 0x042a, 0x042b, 0x042c, 0x042d, 0x042e, 0x042f, 0x0430, 0x0431, 0x0432, 0x0433, 0x0434, 0x0435, 0x0436, 0x0437, 0x0438, 0x0439, 0x043a, 0x043b, 0x043c, 0x043d, 0x043e, 0x043f, 0x0440, 0x0441, 0x0442, 0x0443, 0x0444, 0x0445, 0x0446, 0x0447, 0x0448, 0x0449, 0x044a, 0x044b, 0x044c, 0x044d, 0x044e, 0x044f, 0x2116, 0x0451, 0x0452, 0x0453, 0x0454, 0x0455, 0x0456, 0x0457, 0x0458, 0x0459, 0x045a, 0x045b, 0x045c, 0x00a7, 0x045e, 0x045f }}, { UC "iso-8859-6", 0x20, 0x20, { 0x0000, 0x0001, 0x0002, 0x0003, 0x0004, 0x0005, 0x0006, 0x0007, 0x0008, 0x0009, 0x000a, 0x000b, 0x000c, 0x000d, 0x000e, 0x000f, 0x0010, 0x0011, 0x0012, 0x0013, 0x0014, 0x0015, 0x0016, 0x0017, 0x0018, 0x0019, 0x001a, 0x001b, 0x001c, 0x001d, 0x001e, 0x001f, 0x0020, 0x0021, 0x0022, 0x0023, 0x0024, 0x0025, 0x0026, 0x0027, 0x0028, 0x0029, 0x002a, 0x002b, 0x002c, 0x002d, 0x002e, 0x002f, 0x0030, 0x0031, 0x0032, 0x0033, 0x0034, 0x0035, 0x0036, 0x0037, 0x0038, 0x0039, 0x003a, 0x003b, 0x003c, 0x003d, 0x003e, 0x003f, 0x0040, 0x0041, 0x0042, 0x0043, 0x0044, 0x0045, 0x0046, 0x0047, 0x0048, 0x0049, 0x004a, 0x004b, 0x004c, 0x004d, 0x004e, 0x004f, 0x0050, 0x0051, 0x0052, 0x0053, 0x0054, 0x0055, 0x0056, 0x0057, 0x0058, 0x0059, 0x005a, 0x005b, 0x005c, 0x005d, 0x005e, 0x005f, 0x0060, 0x0061, 0x0062, 0x0063, 0x0064, 0x0065, 0x0066, 0x0067, 0x0068, 0x0069, 0x006a, 0x006b, 0x006c, 0x006d, 0x006e, 0x006f, 0x0070, 0x0071, 0x0072, 0x0073, 0x0074, 0x0075, 0x0076, 0x0077, 0x0078, 0x0079, 0x007a, 0x007b, 0x007c, 0x007d, 0x007e, 0x007f, 0x0080, 0x0081, 0x0082, 0x0083, 0x0084, 0x0085, 0x0086, 0x0087, 0x0088, 0x0089, 0x008a, 0x008b, 0x008c, 0x008d, 0x008e, 0x008f, 0x0090, 0x0091, 0x0092, 0x0093, 0x0094, 0x0095, 0x0096, 0x0097, 0x0098, 0x0099, 0x009a, 0x009b, 0x009c, 0x009d, 0x009e, 0x009f, 0x00a0, -1, -1, -1, 0x00a4, -1, -1, -1, -1, -1, -1, -1, 0x060c, 0x00ad, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 0x061b, -1, -1, -1, 0x061f, -1, 0x0621, 0x0622, 0x0623, 0x0624, 0x0625, 0x0626, 0x0627, 0x0628, 0x0629, 0x062a, 0x062b, 0x062c, 0x062d, 0x062e, 0x062f, 0x0630, 0x0631, 0x0632, 0x0633, 0x0634, 0x0635, 0x0636, 0x0637, 0x0638, 0x0639, 0x063a, -1, -1, -1, -1, -1, 0x0640, 0x0641, 0x0642, 0x0643, 0x0644, 0x0645, 0x0646, 0x0647, 0x0648, 0x0649, 0x064a, 0x064b, 0x064c, 0x064d, 0x064e, 0x064f, 0x0650, 0x0651, 0x0652, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1 }}, { UC "iso-8859-7", 0x20, 0x20, { 0x0000, 0x0001, 0x0002, 0x0003, 0x0004, 0x0005, 0x0006, 0x0007, 0x0008, 0x0009, 0x000a, 0x000b, 0x000c, 0x000d, 0x000e, 0x000f, 0x0010, 0x0011, 0x0012, 0x0013, 0x0014, 0x0015, 0x0016, 0x0017, 0x0018, 0x0019, 0x001a, 0x001b, 0x001c, 0x001d, 0x001e, 0x001f, 0x0020, 0x0021, 0x0022, 0x0023, 0x0024, 0x0025, 0x0026, 0x0027, 0x0028, 0x0029, 0x002a, 0x002b, 0x002c, 0x002d, 0x002e, 0x002f, 0x0030, 0x0031, 0x0032, 0x0033, 0x0034, 0x0035, 0x0036, 0x0037, 0x0038, 0x0039, 0x003a, 0x003b, 0x003c, 0x003d, 0x003e, 0x003f, 0x0040, 0x0041, 0x0042, 0x0043, 0x0044, 0x0045, 0x0046, 0x0047, 0x0048, 0x0049, 0x004a, 0x004b, 0x004c, 0x004d, 0x004e, 0x004f, 0x0050, 0x0051, 0x0052, 0x0053, 0x0054, 0x0055, 0x0056, 0x0057, 0x0058, 0x0059, 0x005a, 0x005b, 0x005c, 0x005d, 0x005e, 0x005f, 0x0060, 0x0061, 0x0062, 0x0063, 0x0064, 0x0065, 0x0066, 0x0067, 0x0068, 0x0069, 0x006a, 0x006b, 0x006c, 0x006d, 0x006e, 0x006f, 0x0070, 0x0071, 0x0072, 0x0073, 0x0074, 0x0075, 0x0076, 0x0077, 0x0078, 0x0079, 0x007a, 0x007b, 0x007c, 0x007d, 0x007e, 0x007f, 0x0080, 0x0081, 0x0082, 0x0083, 0x0084, 0x0085, 0x0086, 0x0087, 0x0088, 0x0089, 0x008a, 0x008b, 0x008c, 0x008d, 0x008e, 0x008f, 0x0090, 0x0091, 0x0092, 0x0093, 0x0094, 0x0095, 0x0096, 0x0097, 0x0098, 0x0099, 0x009a, 0x009b, 0x009c, 0x009d, 0x009e, 0x009f, 0x00a0, 0x2018, 0x2019, 0x00a3, -1, -1, 0x00a6, 0x00a7, 0x00a8, 0x00a9, -1, 0x00ab, 0x00ac, 0x00ad, -1, 0x2015, 0x00b0, 0x00b1, 0x00b2, 0x00b3, 0x0384, 0x0385, 0x0386, 0x00b7, 0x0388, 0x0389, 0x038a, 0x00bb, 0x038c, 0x00bd, 0x038e, 0x038f, 0x0390, 0x0391, 0x0392, 0x0393, 0x0394, 0x0395, 0x0396, 0x0397, 0x0398, 0x0399, 0x039a, 0x039b, 0x039c, 0x039d, 0x039e, 0x039f, 0x03a0, 0x03a1, -1, 0x03a3, 0x03a4, 0x03a5, 0x03a6, 0x03a7, 0x03a8, 0x03a9, 0x03aa, 0x03ab, 0x03ac, 0x03ad, 0x03ae, 0x03af, 0x03b0, 0x03b1, 0x03b2, 0x03b3, 0x03b4, 0x03b5, 0x03b6, 0x03b7, 0x03b8, 0x03b9, 0x03ba, 0x03bb, 0x03bc, 0x03bd, 0x03be, 0x03bf, 0x03c0, 0x03c1, 0x03c2, 0x03c3, 0x03c4, 0x03c5, 0x03c6, 0x03c7, 0x03c8, 0x03c9, 0x03ca, 0x03cb, 0x03cc, 0x03cd, 0x03ce, -1 }}, { UC "iso-8859-8", 0x20, 0x20, { 0x0000, 0x0001, 0x0002, 0x0003, 0x0004, 0x0005, 0x0006, 0x0007, 0x0008, 0x0009, 0x000a, 0x000b, 0x000c, 0x000d, 0x000e, 0x000f, 0x0010, 0x0011, 0x0012, 0x0013, 0x0014, 0x0015, 0x0016, 0x0017, 0x0018, 0x0019, 0x001a, 0x001b, 0x001c, 0x001d, 0x001e, 0x001f, 0x0020, 0x0021, 0x0022, 0x0023, 0x0024, 0x0025, 0x0026, 0x0027, 0x0028, 0x0029, 0x002a, 0x002b, 0x002c, 0x002d, 0x002e, 0x002f, 0x0030, 0x0031, 0x0032, 0x0033, 0x0034, 0x0035, 0x0036, 0x0037, 0x0038, 0x0039, 0x003a, 0x003b, 0x003c, 0x003d, 0x003e, 0x003f, 0x0040, 0x0041, 0x0042, 0x0043, 0x0044, 0x0045, 0x0046, 0x0047, 0x0048, 0x0049, 0x004a, 0x004b, 0x004c, 0x004d, 0x004e, 0x004f, 0x0050, 0x0051, 0x0052, 0x0053, 0x0054, 0x0055, 0x0056, 0x0057, 0x0058, 0x0059, 0x005a, 0x005b, 0x005c, 0x005d, 0x005e, 0x005f, 0x0060, 0x0061, 0x0062, 0x0063, 0x0064, 0x0065, 0x0066, 0x0067, 0x0068, 0x0069, 0x006a, 0x006b, 0x006c, 0x006d, 0x006e, 0x006f, 0x0070, 0x0071, 0x0072, 0x0073, 0x0074, 0x0075, 0x0076, 0x0077, 0x0078, 0x0079, 0x007a, 0x007b, 0x007c, 0x007d, 0x007e, 0x007f, 0x0080, 0x0081, 0x0082, 0x0083, 0x0084, 0x0085, 0x0086, 0x0087, 0x0088, 0x0089, 0x008a, 0x008b, 0x008c, 0x008d, 0x008e, 0x008f, 0x0090, 0x0091, 0x0092, 0x0093, 0x0094, 0x0095, 0x0096, 0x0097, 0x0098, 0x0099, 0x009a, 0x009b, 0x009c, 0x009d, 0x009e, 0x009f, 0x00a0, -1, 0x00a2, 0x00a3, 0x00a4, 0x00a5, 0x00a6, 0x00a7, 0x00a8, 0x00a9, 0x00d7, 0x00ab, 0x00ac, 0x00ad, 0x00ae, 0x00af, 0x00b0, 0x00b1, 0x00b2, 0x00b3, 0x00b4, 0x00b5, 0x00b6, 0x00b7, 0x00b8, 0x00b9, 0x00f7, 0x00bb, 0x00bc, 0x00bd, 0x00be, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 0x2017, 0x05d0, 0x05d1, 0x05d2, 0x05d3, 0x05d4, 0x05d5, 0x05d6, 0x05d7, 0x05d8, 0x05d9, 0x05da, 0x05db, 0x05dc, 0x05dd, 0x05de, 0x05df, 0x05e0, 0x05e1, 0x05e2, 0x05e3, 0x05e4, 0x05e5, 0x05e6, 0x05e7, 0x05e8, 0x05e9, 0x05ea, -1, -1, 0x200e, 0x200f, -1 }}, { UC "iso-8859-9", 0x20, 0x20, { 0x0000, 0x0001, 0x0002, 0x0003, 0x0004, 0x0005, 0x0006, 0x0007, 0x0008, 0x0009, 0x000a, 0x000b, 0x000c, 0x000d, 0x000e, 0x000f, 0x0010, 0x0011, 0x0012, 0x0013, 0x0014, 0x0015, 0x0016, 0x0017, 0x0018, 0x0019, 0x001a, 0x001b, 0x001c, 0x001d, 0x001e, 0x001f, 0x0020, 0x0021, 0x0022, 0x0023, 0x0024, 0x0025, 0x0026, 0x0027, 0x0028, 0x0029, 0x002a, 0x002b, 0x002c, 0x002d, 0x002e, 0x002f, 0x0030, 0x0031, 0x0032, 0x0033, 0x0034, 0x0035, 0x0036, 0x0037, 0x0038, 0x0039, 0x003a, 0x003b, 0x003c, 0x003d, 0x003e, 0x003f, 0x0040, 0x0041, 0x0042, 0x0043, 0x0044, 0x0045, 0x0046, 0x0047, 0x0048, 0x0049, 0x004a, 0x004b, 0x004c, 0x004d, 0x004e, 0x004f, 0x0050, 0x0051, 0x0052, 0x0053, 0x0054, 0x0055, 0x0056, 0x0057, 0x0058, 0x0059, 0x005a, 0x005b, 0x005c, 0x005d, 0x005e, 0x005f, 0x0060, 0x0061, 0x0062, 0x0063, 0x0064, 0x0065, 0x0066, 0x0067, 0x0068, 0x0069, 0x006a, 0x006b, 0x006c, 0x006d, 0x006e, 0x006f, 0x0070, 0x0071, 0x0072, 0x0073, 0x0074, 0x0075, 0x0076, 0x0077, 0x0078, 0x0079, 0x007a, 0x007b, 0x007c, 0x007d, 0x007e, 0x007f, 0x0080, 0x0081, 0x0082, 0x0083, 0x0084, 0x0085, 0x0086, 0x0087, 0x0088, 0x0089, 0x008a, 0x008b, 0x008c, 0x008d, 0x008e, 0x008f, 0x0090, 0x0091, 0x0092, 0x0093, 0x0094, 0x0095, 0x0096, 0x0097, 0x0098, 0x0099, 0x009a, 0x009b, 0x009c, 0x009d, 0x009e, 0x009f, 0x00a0, 0x00a1, 0x00a2, 0x00a3, 0x00a4, 0x00a5, 0x00a6, 0x00a7, 0x00a8, 0x00a9, 0x00aa, 0x00ab, 0x00ac, 0x00ad, 0x00ae, 0x00af, 0x00b0, 0x00b1, 0x00b2, 0x00b3, 0x00b4, 0x00b5, 0x00b6, 0x00b7, 0x00b8, 0x00b9, 0x00ba, 0x00bb, 0x00bc, 0x00bd, 0x00be, 0x00bf, 0x00c0, 0x00c1, 0x00c2, 0x00c3, 0x00c4, 0x00c5, 0x00c6, 0x00c7, 0x00c8, 0x00c9, 0x00ca, 0x00cb, 0x00cc, 0x00cd, 0x00ce, 0x00cf, 0x011e, 0x00d1, 0x00d2, 0x00d3, 0x00d4, 0x00d5, 0x00d6, 0x00d7, 0x00d8, 0x00d9, 0x00da, 0x00db, 0x00dc, 0x0130, 0x015e, 0x00df, 0x00e0, 0x00e1, 0x00e2, 0x00e3, 0x00e4, 0x00e5, 0x00e6, 0x00e7, 0x00e8, 0x00e9, 0x00ea, 0x00eb, 0x00ec, 0x00ed, 0x00ee, 0x00ef, 0x011f, 0x00f1, 0x00f2, 0x00f3, 0x00f4, 0x00f5, 0x00f6, 0x00f7, 0x00f8, 0x00f9, 0x00fa, 0x00fb, 0x00fc, 0x0131, 0x015f, 0x00ff }}, { UC "iso-8859-10", 0x20, 0x20, { 0x0000, 0x0001, 0x0002, 0x0003, 0x0004, 0x0005, 0x0006, 0x0007, 0x0008, 0x0009, 0x000a, 0x000b, 0x000c, 0x000d, 0x000e, 0x000f, 0x0010, 0x0011, 0x0012, 0x0013, 0x0014, 0x0015, 0x0016, 0x0017, 0x0018, 0x0019, 0x001a, 0x001b, 0x001c, 0x001d, 0x001e, 0x001f, 0x0020, 0x0021, 0x0022, 0x0023, 0x0024, 0x0025, 0x0026, 0x0027, 0x0028, 0x0029, 0x002a, 0x002b, 0x002c, 0x002d, 0x002e, 0x002f, 0x0030, 0x0031, 0x0032, 0x0033, 0x0034, 0x0035, 0x0036, 0x0037, 0x0038, 0x0039, 0x003a, 0x003b, 0x003c, 0x003d, 0x003e, 0x003f, 0x0040, 0x0041, 0x0042, 0x0043, 0x0044, 0x0045, 0x0046, 0x0047, 0x0048, 0x0049, 0x004a, 0x004b, 0x004c, 0x004d, 0x004e, 0x004f, 0x0050, 0x0051, 0x0052, 0x0053, 0x0054, 0x0055, 0x0056, 0x0057, 0x0058, 0x0059, 0x005a, 0x005b, 0x005c, 0x005d, 0x005e, 0x005f, 0x0060, 0x0061, 0x0062, 0x0063, 0x0064, 0x0065, 0x0066, 0x0067, 0x0068, 0x0069, 0x006a, 0x006b, 0x006c, 0x006d, 0x006e, 0x006f, 0x0070, 0x0071, 0x0072, 0x0073, 0x0074, 0x0075, 0x0076, 0x0077, 0x0078, 0x0079, 0x007a, 0x007b, 0x007c, 0x007d, 0x007e, 0x007f, 0x0080, 0x0081, 0x0082, 0x0083, 0x0084, 0x0085, 0x0086, 0x0087, 0x0088, 0x0089, 0x008a, 0x008b, 0x008c, 0x008d, 0x008e, 0x008f, 0x0090, 0x0091, 0x0092, 0x0093, 0x0094, 0x0095, 0x0096, 0x0097, 0x0098, 0x0099, 0x009a, 0x009b, 0x009c, 0x009d, 0x009e, 0x009f, 0x00a0, 0x0104, 0x0112, 0x0122, 0x012a, 0x0128, 0x0136, 0x00a7, 0x013b, 0x0110, 0x0160, 0x0166, 0x017d, 0x00ad, 0x016a, 0x014a, 0x00b0, 0x0105, 0x0113, 0x0123, 0x012b, 0x0129, 0x0137, 0x00b7, 0x013c, 0x0111, 0x0161, 0x0167, 0x017e, 0x2015, 0x016b, 0x014b, 0x0100, 0x00c1, 0x00c2, 0x00c3, 0x00c4, 0x00c5, 0x00c6, 0x012e, 0x010c, 0x00c9, 0x0118, 0x00cb, 0x0116, 0x00cd, 0x00ce, 0x00cf, 0x00d0, 0x0145, 0x014c, 0x00d3, 0x00d4, 0x00d5, 0x00d6, 0x0168, 0x00d8, 0x0172, 0x00da, 0x00db, 0x00dc, 0x00dd, 0x00de, 0x00df, 0x0101, 0x00e1, 0x00e2, 0x00e3, 0x00e4, 0x00e5, 0x00e6, 0x012f, 0x010d, 0x00e9, 0x0119, 0x00eb, 0x0117, 0x00ed, 0x00ee, 0x00ef, 0x00f0, 0x0146, 0x014d, 0x00f3, 0x00f4, 0x00f5, 0x00f6, 0x0169, 0x00f8, 0x0173, 0x00fa, 0x00fb, 0x00fc, 0x00fd, 0x00fe, 0x0138 }}, { UC "iso-8859-11", 0x20, 0x20, { 0x0000, 0x0001, 0x0002, 0x0003, 0x0004, 0x0005, 0x0006, 0x0007, 0x0008, 0x0009, 0x000a, 0x000b, 0x000c, 0x000d, 0x000e, 0x000f, 0x0010, 0x0011, 0x0012, 0x0013, 0x0014, 0x0015, 0x0016, 0x0017, 0x0018, 0x0019, 0x001a, 0x001b, 0x001c, 0x001d, 0x001e, 0x001f, 0x0020, 0x0021, 0x0022, 0x0023, 0x0024, 0x0025, 0x0026, 0x0027, 0x0028, 0x0029, 0x002a, 0x002b, 0x002c, 0x002d, 0x002e, 0x002f, 0x0030, 0x0031, 0x0032, 0x0033, 0x0034, 0x0035, 0x0036, 0x0037, 0x0038, 0x0039, 0x003a, 0x003b, 0x003c, 0x003d, 0x003e, 0x003f, 0x0040, 0x0041, 0x0042, 0x0043, 0x0044, 0x0045, 0x0046, 0x0047, 0x0048, 0x0049, 0x004a, 0x004b, 0x004c, 0x004d, 0x004e, 0x004f, 0x0050, 0x0051, 0x0052, 0x0053, 0x0054, 0x0055, 0x0056, 0x0057, 0x0058, 0x0059, 0x005a, 0x005b, 0x005c, 0x005d, 0x005e, 0x005f, 0x0060, 0x0061, 0x0062, 0x0063, 0x0064, 0x0065, 0x0066, 0x0067, 0x0068, 0x0069, 0x006a, 0x006b, 0x006c, 0x006d, 0x006e, 0x006f, 0x0070, 0x0071, 0x0072, 0x0073, 0x0074, 0x0075, 0x0076, 0x0077, 0x0078, 0x0079, 0x007a, 0x007b, 0x007c, 0x007d, 0x007e, 0x007f, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 0x00a0, 0x0e01, 0x0e02, 0x0e03, 0x0e04, 0x0e05, 0x0e06, 0x0e07, 0x0e08, 0x0e09, 0x0e0a, 0x0e0b, 0x0e0c, 0x0e0d, 0x0e0e, 0x0e0f, 0x0e10, 0x0e11, 0x0e12, 0x0e13, 0x0e14, 0x0e15, 0x0e16, 0x0e17, 0x0e18, 0x0e19, 0x0e1a, 0x0e1b, 0x0e1c, 0x0e1d, 0x0e1e, 0x0e1f, 0x0e20, 0x0e21, 0x0e22, 0x0e23, 0x0e24, 0x0e25, 0x0e26, 0x0e27, 0x0e28, 0x0e29, 0x0e2a, 0x0e2b, 0x0e2c, 0x0e2d, 0x0e2e, 0x0e2f, 0x0e30, 0x0e31, 0x0e32, 0x0e33, 0x0e34, 0x0e35, 0x0e36, 0x0e37, 0x0e38, 0x0e39, 0x0e3a, -1, -1, -1, -1, 0x0e3f, 0x0e40, 0x0e41, 0x0e42, 0x0e43, 0x0e44, 0x0e45, 0x0e46, 0x0e47, 0x0e48, 0x0e49, 0x0e4a, 0x0e4b, 0x0e4c, 0x0e4d, 0x0e4e, 0x0e4f, 0x0e50, 0x0e51, 0x0e52, 0x0e53, 0x0e54, 0x0e55, 0x0e56, 0x0e57, 0x0e58, 0x0e59, 0x0e5a, 0x0e5b, -1, -1, -1, -1 }}, { UC "iso-8859-13", 0x20, 0x20, { 0x0000, 0x0001, 0x0002, 0x0003, 0x0004, 0x0005, 0x0006, 0x0007, 0x0008, 0x0009, 0x000a, 0x000b, 0x000c, 0x000d, 0x000e, 0x000f, 0x0010, 0x0011, 0x0012, 0x0013, 0x0014, 0x0015, 0x0016, 0x0017, 0x0018, 0x0019, 0x001a, 0x001b, 0x001c, 0x001d, 0x001e, 0x001f, 0x0020, 0x0021, 0x0022, 0x0023, 0x0024, 0x0025, 0x0026, 0x0027, 0x0028, 0x0029, 0x002a, 0x002b, 0x002c, 0x002d, 0x002e, 0x002f, 0x0030, 0x0031, 0x0032, 0x0033, 0x0034, 0x0035, 0x0036, 0x0037, 0x0038, 0x0039, 0x003a, 0x003b, 0x003c, 0x003d, 0x003e, 0x003f, 0x0040, 0x0041, 0x0042, 0x0043, 0x0044, 0x0045, 0x0046, 0x0047, 0x0048, 0x0049, 0x004a, 0x004b, 0x004c, 0x004d, 0x004e, 0x004f, 0x0050, 0x0051, 0x0052, 0x0053, 0x0054, 0x0055, 0x0056, 0x0057, 0x0058, 0x0059, 0x005a, 0x005b, 0x005c, 0x005d, 0x005e, 0x005f, 0x0060, 0x0061, 0x0062, 0x0063, 0x0064, 0x0065, 0x0066, 0x0067, 0x0068, 0x0069, 0x006a, 0x006b, 0x006c, 0x006d, 0x006e, 0x006f, 0x0070, 0x0071, 0x0072, 0x0073, 0x0074, 0x0075, 0x0076, 0x0077, 0x0078, 0x0079, 0x007a, 0x007b, 0x007c, 0x007d, 0x007e, 0x007f, 0x0080, 0x0081, 0x0082, 0x0083, 0x0084, 0x0085, 0x0086, 0x0087, 0x0088, 0x0089, 0x008a, 0x008b, 0x008c, 0x008d, 0x008e, 0x008f, 0x0090, 0x0091, 0x0092, 0x0093, 0x0094, 0x0095, 0x0096, 0x0097, 0x0098, 0x0099, 0x009a, 0x009b, 0x009c, 0x009d, 0x009e, 0x009f, 0x00a0, 0x201d, 0x00a2, 0x00a3, 0x00a4, 0x201e, 0x00a6, 0x00a7, 0x00d8, 0x00a9, 0x0156, 0x00ab, 0x00ac, 0x00ad, 0x00ae, 0x00c6, 0x00b0, 0x00b1, 0x00b2, 0x00b3, 0x201c, 0x00b5, 0x00b6, 0x00b7, 0x00f8, 0x00b9, 0x0157, 0x00bb, 0x00bc, 0x00bd, 0x00be, 0x00e6, 0x0104, 0x012e, 0x0100, 0x0106, 0x00c4, 0x00c5, 0x0118, 0x0112, 0x010c, 0x00c9, 0x0179, 0x0116, 0x0122, 0x0136, 0x012a, 0x013b, 0x0160, 0x0143, 0x0145, 0x00d3, 0x014c, 0x00d5, 0x00d6, 0x00d7, 0x0172, 0x0141, 0x015a, 0x016a, 0x00dc, 0x017b, 0x017d, 0x00df, 0x0105, 0x012f, 0x0101, 0x0107, 0x00e4, 0x00e5, 0x0119, 0x0113, 0x010d, 0x00e9, 0x017a, 0x0117, 0x0123, 0x0137, 0x012b, 0x013c, 0x0161, 0x0144, 0x0146, 0x00f3, 0x014d, 0x00f5, 0x00f6, 0x00f7, 0x0173, 0x0142, 0x015b, 0x016b, 0x00fc, 0x017c, 0x017e, 0x2019 }}, { UC "iso-8859-14", 0x20, 0x20, { 0x0000, 0x0001, 0x0002, 0x0003, 0x0004, 0x0005, 0x0006, 0x0007, 0x0008, 0x0009, 0x000a, 0x000b, 0x000c, 0x000d, 0x000e, 0x000f, 0x0010, 0x0011, 0x0012, 0x0013, 0x0014, 0x0015, 0x0016, 0x0017, 0x0018, 0x0019, 0x001a, 0x001b, 0x001c, 0x001d, 0x001e, 0x001f, 0x0020, 0x0021, 0x0022, 0x0023, 0x0024, 0x0025, 0x0026, 0x0027, 0x0028, 0x0029, 0x002a, 0x002b, 0x002c, 0x002d, 0x002e, 0x002f, 0x0030, 0x0031, 0x0032, 0x0033, 0x0034, 0x0035, 0x0036, 0x0037, 0x0038, 0x0039, 0x003a, 0x003b, 0x003c, 0x003d, 0x003e, 0x003f, 0x0040, 0x0041, 0x0042, 0x0043, 0x0044, 0x0045, 0x0046, 0x0047, 0x0048, 0x0049, 0x004a, 0x004b, 0x004c, 0x004d, 0x004e, 0x004f, 0x0050, 0x0051, 0x0052, 0x0053, 0x0054, 0x0055, 0x0056, 0x0057, 0x0058, 0x0059, 0x005a, 0x005b, 0x005c, 0x005d, 0x005e, 0x005f, 0x0060, 0x0061, 0x0062, 0x0063, 0x0064, 0x0065, 0x0066, 0x0067, 0x0068, 0x0069, 0x006a, 0x006b, 0x006c, 0x006d, 0x006e, 0x006f, 0x0070, 0x0071, 0x0072, 0x0073, 0x0074, 0x0075, 0x0076, 0x0077, 0x0078, 0x0079, 0x007a, 0x007b, 0x007c, 0x007d, 0x007e, 0x007f, 0x0080, 0x0081, 0x0082, 0x0083, 0x0084, 0x0085, 0x0086, 0x0087, 0x0088, 0x0089, 0x008a, 0x008b, 0x008c, 0x008d, 0x008e, 0x008f, 0x0090, 0x0091, 0x0092, 0x0093, 0x0094, 0x0095, 0x0096, 0x0097, 0x0098, 0x0099, 0x009a, 0x009b, 0x009c, 0x009d, 0x009e, 0x009f, 0x00a0, 0x1e02, 0x1e03, 0x00a3, 0x010a, 0x010b, 0x1e0a, 0x00a7, 0x1e80, 0x00a9, 0x1e82, 0x1e0b, 0x1ef2, 0x00ad, 0x00ae, 0x0178, 0x1e1e, 0x1e1f, 0x0120, 0x0121, 0x1e40, 0x1e41, 0x00b6, 0x1e56, 0x1e81, 0x1e57, 0x1e83, 0x1e60, 0x1ef3, 0x1e84, 0x1e85, 0x1e61, 0x00c0, 0x00c1, 0x00c2, 0x00c3, 0x00c4, 0x00c5, 0x00c6, 0x00c7, 0x00c8, 0x00c9, 0x00ca, 0x00cb, 0x00cc, 0x00cd, 0x00ce, 0x00cf, 0x0174, 0x00d1, 0x00d2, 0x00d3, 0x00d4, 0x00d5, 0x00d6, 0x1e6a, 0x00d8, 0x00d9, 0x00da, 0x00db, 0x00dc, 0x00dd, 0x0176, 0x00df, 0x00e0, 0x00e1, 0x00e2, 0x00e3, 0x00e4, 0x00e5, 0x00e6, 0x00e7, 0x00e8, 0x00e9, 0x00ea, 0x00eb, 0x00ec, 0x00ed, 0x00ee, 0x00ef, 0x0175, 0x00f1, 0x00f2, 0x00f3, 0x00f4, 0x00f5, 0x00f6, 0x1e6b, 0x00f8, 0x00f9, 0x00fa, 0x00fb, 0x00fc, 0x00fd, 0x0177, 0x00ff }}, { UC "iso-8859-15", 0x20, 0x20, { 0x0000, 0x0001, 0x0002, 0x0003, 0x0004, 0x0005, 0x0006, 0x0007, 0x0008, 0x0009, 0x000a, 0x000b, 0x000c, 0x000d, 0x000e, 0x000f, 0x0010, 0x0011, 0x0012, 0x0013, 0x0014, 0x0015, 0x0016, 0x0017, 0x0018, 0x0019, 0x001a, 0x001b, 0x001c, 0x001d, 0x001e, 0x001f, 0x0020, 0x0021, 0x0022, 0x0023, 0x0024, 0x0025, 0x0026, 0x0027, 0x0028, 0x0029, 0x002a, 0x002b, 0x002c, 0x002d, 0x002e, 0x002f, 0x0030, 0x0031, 0x0032, 0x0033, 0x0034, 0x0035, 0x0036, 0x0037, 0x0038, 0x0039, 0x003a, 0x003b, 0x003c, 0x003d, 0x003e, 0x003f, 0x0040, 0x0041, 0x0042, 0x0043, 0x0044, 0x0045, 0x0046, 0x0047, 0x0048, 0x0049, 0x004a, 0x004b, 0x004c, 0x004d, 0x004e, 0x004f, 0x0050, 0x0051, 0x0052, 0x0053, 0x0054, 0x0055, 0x0056, 0x0057, 0x0058, 0x0059, 0x005a, 0x005b, 0x005c, 0x005d, 0x005e, 0x005f, 0x0060, 0x0061, 0x0062, 0x0063, 0x0064, 0x0065, 0x0066, 0x0067, 0x0068, 0x0069, 0x006a, 0x006b, 0x006c, 0x006d, 0x006e, 0x006f, 0x0070, 0x0071, 0x0072, 0x0073, 0x0074, 0x0075, 0x0076, 0x0077, 0x0078, 0x0079, 0x007a, 0x007b, 0x007c, 0x007d, 0x007e, 0x007f, 0x0080, 0x0081, 0x0082, 0x0083, 0x0084, 0x0085, 0x0086, 0x0087, 0x0088, 0x0089, 0x008a, 0x008b, 0x008c, 0x008d, 0x008e, 0x008f, 0x0090, 0x0091, 0x0092, 0x0093, 0x0094, 0x0095, 0x0096, 0x0097, 0x0098, 0x0099, 0x009a, 0x009b, 0x009c, 0x009d, 0x009e, 0x009f, 0x00a0, 0x00a1, 0x00a2, 0x00a3, 0x20ac, 0x00a5, 0x0160, 0x00a7, 0x0161, 0x00a9, 0x00aa, 0x00ab, 0x00ac, 0x00ad, 0x00ae, 0x00af, 0x00b0, 0x00b1, 0x00b2, 0x00b3, 0x017d, 0x00b5, 0x00b6, 0x00b7, 0x017e, 0x00b9, 0x00ba, 0x00bb, 0x0152, 0x0153, 0x0178, 0x00bf, 0x00c0, 0x00c1, 0x00c2, 0x00c3, 0x00c4, 0x00c5, 0x00c6, 0x00c7, 0x00c8, 0x00c9, 0x00ca, 0x00cb, 0x00cc, 0x00cd, 0x00ce, 0x00cf, 0x00d0, 0x00d1, 0x00d2, 0x00d3, 0x00d4, 0x00d5, 0x00d6, 0x00d7, 0x00d8, 0x00d9, 0x00da, 0x00db, 0x00dc, 0x00dd, 0x00de, 0x00df, 0x00e0, 0x00e1, 0x00e2, 0x00e3, 0x00e4, 0x00e5, 0x00e6, 0x00e7, 0x00e8, 0x00e9, 0x00ea, 0x00eb, 0x00ec, 0x00ed, 0x00ee, 0x00ef, 0x00f0, 0x00f1, 0x00f2, 0x00f3, 0x00f4, 0x00f5, 0x00f6, 0x00f7, 0x00f8, 0x00f9, 0x00fa, 0x00fb, 0x00fc, 0x00fd, 0x00fe, 0x00ff }}, { UC "iso-8859-16", 0x20, 0x20, { 0x0000, 0x0001, 0x0002, 0x0003, 0x0004, 0x0005, 0x0006, 0x0007, 0x0008, 0x0009, 0x000a, 0x000b, 0x000c, 0x000d, 0x000e, 0x000f, 0x0010, 0x0011, 0x0012, 0x0013, 0x0014, 0x0015, 0x0016, 0x0017, 0x0018, 0x0019, 0x001a, 0x001b, 0x001c, 0x001d, 0x001e, 0x001f, 0x0020, 0x0021, 0x0022, 0x0023, 0x0024, 0x0025, 0x0026, 0x0027, 0x0028, 0x0029, 0x002a, 0x002b, 0x002c, 0x002d, 0x002e, 0x002f, 0x0030, 0x0031, 0x0032, 0x0033, 0x0034, 0x0035, 0x0036, 0x0037, 0x0038, 0x0039, 0x003a, 0x003b, 0x003c, 0x003d, 0x003e, 0x003f, 0x0040, 0x0041, 0x0042, 0x0043, 0x0044, 0x0045, 0x0046, 0x0047, 0x0048, 0x0049, 0x004a, 0x004b, 0x004c, 0x004d, 0x004e, 0x004f, 0x0050, 0x0051, 0x0052, 0x0053, 0x0054, 0x0055, 0x0056, 0x0057, 0x0058, 0x0059, 0x005a, 0x005b, 0x005c, 0x005d, 0x005e, 0x005f, 0x0060, 0x0061, 0x0062, 0x0063, 0x0064, 0x0065, 0x0066, 0x0067, 0x0068, 0x0069, 0x006a, 0x006b, 0x006c, 0x006d, 0x006e, 0x006f, 0x0070, 0x0071, 0x0072, 0x0073, 0x0074, 0x0075, 0x0076, 0x0077, 0x0078, 0x0079, 0x007a, 0x007b, 0x007c, 0x007d, 0x007e, 0x007f, 0x0080, 0x0081, 0x0082, 0x0083, 0x0084, 0x0085, 0x0086, 0x0087, 0x0088, 0x0089, 0x008a, 0x008b, 0x008c, 0x008d, 0x008e, 0x008f, 0x0090, 0x0091, 0x0092, 0x0093, 0x0094, 0x0095, 0x0096, 0x0097, 0x0098, 0x0099, 0x009a, 0x009b, 0x009c, 0x009d, 0x009e, 0x009f, 0x00a0, 0x0104, 0x0105, 0x0141, 0x20ac, 0x201e, 0x0160, 0x00a7, 0x0161, 0x00a9, 0x0218, 0x00ab, 0x0179, 0x00ad, 0x017a, 0x017b, 0x00b0, 0x00b1, 0x010c, 0x0142, 0x017d, 0x201d, 0x00b6, 0x00b7, 0x017e, 0x010d, 0x0219, 0x00bb, 0x0152, 0x0153, 0x0178, 0x017c, 0x00c0, 0x00c1, 0x00c2, 0x0102, 0x00c4, 0x0106, 0x00c6, 0x00c7, 0x00c8, 0x00c9, 0x00ca, 0x00cb, 0x00cc, 0x00cd, 0x00ce, 0x00cf, 0x0110, 0x0143, 0x00d2, 0x00d3, 0x00d4, 0x0150, 0x00d6, 0x015a, 0x0170, 0x00d9, 0x00da, 0x00db, 0x00dc, 0x0118, 0x021a, 0x00df, 0x00e0, 0x00e1, 0x00e2, 0x0103, 0x00e4, 0x0107, 0x00e6, 0x00e7, 0x00e8, 0x00e9, 0x00ea, 0x00eb, 0x00ec, 0x00ed, 0x00ee, 0x00ef, 0x0111, 0x0144, 0x00f2, 0x00f3, 0x00f4, 0x0151, 0x00f6, 0x015b, 0x0171, 0x00f9, 0x00fa, 0x00fb, 0x00fc, 0x0119, 0x021b, 0x00ff }}, { UC "koi-8", 0x20, 0x20, { 0x0000, 0x0001, 0x0002, 0x0003, 0x0004, 0x0005, 0x0006, 0x0007, 0x0008, 0x0009, 0x000a, 0x000b, 0x000c, 0x000d, 0x000e, 0x000f, 0x0010, 0x0011, 0x0012, 0x0013, 0x0014, 0x0015, 0x0016, 0x0017, 0x0018, 0x0019, 0x001a, 0x001b, 0x001c, 0x001d, 0x001e, 0x001f, 0x0020, 0x0021, 0x0022, 0x0023, 0x0024, 0x0025, 0x0026, 0x0027, 0x0028, 0x0029, 0x002a, 0x002b, 0x002c, 0x002d, 0x002e, 0x002f, 0x0030, 0x0031, 0x0032, 0x0033, 0x0034, 0x0035, 0x0036, 0x0037, 0x0038, 0x0039, 0x003a, 0x003b, 0x003c, 0x003d, 0x003e, 0x003f, 0x0040, 0x0041, 0x0042, 0x0043, 0x0044, 0x0045, 0x0046, 0x0047, 0x0048, 0x0049, 0x004a, 0x004b, 0x004c, 0x004d, 0x004e, 0x004f, 0x0050, 0x0051, 0x0052, 0x0053, 0x0054, 0x0055, 0x0056, 0x0057, 0x0058, 0x0059, 0x005a, 0x005b, 0x005c, 0x005d, 0x005e, 0x005f, 0x0060, 0x0061, 0x0062, 0x0063, 0x0064, 0x0065, 0x0066, 0x0067, 0x0068, 0x0069, 0x006a, 0x006b, 0x006c, 0x006d, 0x006e, 0x006f, 0x0070, 0x0071, 0x0072, 0x0073, 0x0074, 0x0075, 0x0076, 0x0077, 0x0078, 0x0079, 0x007a, 0x007b, 0x007c, 0x007d, 0x007e, 0x007f, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 0x044e, 0x0430, 0x0431, 0x0446, 0x0434, 0x0435, 0x0444, 0x0433, 0x0445, 0x0438, 0x0439, 0x043a, 0x043b, 0x043c, 0x043d, 0x043e, 0x043f, 0x044f, 0x0440, 0x0441, 0x0442, 0x0443, 0x0436, 0x0432, 0x044c, 0x044b, 0x0437, 0x0448, 0x044d, 0x0449, 0x0447, 0x044a, 0x042e, 0x0410, 0x0411, 0x0426, 0x0414, 0x0415, 0x0424, 0x0413, 0x0425, 0x0418, 0x0419, 0x041a, 0x041b, 0x041c, 0x041d, 0x041e, 0x041f, 0x042f, 0x0420, 0x0421, 0x0422, 0x0423, 0x0416, 0x0412, 0x042c, 0x042b, 0x0417, 0x0428, 0x042d, 0x0429, 0x0427, -1 }}, { UC "koi8-r", 0x20, 0x20, { 0x0000, 0x0001, 0x0002, 0x0003, 0x0004, 0x0005, 0x0006, 0x0007, 0x0008, 0x0009, 0x000a, 0x000b, 0x000c, 0x000d, 0x000e, 0x000f, 0x0010, 0x0011, 0x0012, 0x0013, 0x0014, 0x0015, 0x0016, 0x0017, 0x0018, 0x0019, 0x001a, 0x001b, 0x001c, 0x001d, 0x001e, 0x001f, 0x0020, 0x0021, 0x0022, 0x0023, 0x0024, 0x0025, 0x0026, 0x0027, 0x0028, 0x0029, 0x002a, 0x002b, 0x002c, 0x002d, 0x002e, 0x002f, 0x0030, 0x0031, 0x0032, 0x0033, 0x0034, 0x0035, 0x0036, 0x0037, 0x0038, 0x0039, 0x003a, 0x003b, 0x003c, 0x003d, 0x003e, 0x003f, 0x0040, 0x0041, 0x0042, 0x0043, 0x0044, 0x0045, 0x0046, 0x0047, 0x0048, 0x0049, 0x004a, 0x004b, 0x004c, 0x004d, 0x004e, 0x004f, 0x0050, 0x0051, 0x0052, 0x0053, 0x0054, 0x0055, 0x0056, 0x0057, 0x0058, 0x0059, 0x005a, 0x005b, 0x005c, 0x005d, 0x005e, 0x005f, 0x0060, 0x0061, 0x0062, 0x0063, 0x0064, 0x0065, 0x0066, 0x0067, 0x0068, 0x0069, 0x006a, 0x006b, 0x006c, 0x006d, 0x006e, 0x006f, 0x0070, 0x0071, 0x0072, 0x0073, 0x0074, 0x0075, 0x0076, 0x0077, 0x0078, 0x0079, 0x007a, 0x007b, 0x007c, 0x007d, 0x007e, 0x007f, 0x2500, 0x2502, 0x250c, 0x2510, 0x2514, 0x2518, 0x251c, 0x2524, 0x252c, 0x2534, 0x253c, 0x2580, 0x2584, 0x2588, 0x258c, 0x2590, 0x2591, 0x2592, 0x2593, 0x2320, 0x25a0, 0x2219, 0x221a, 0x2248, 0x2264, 0x2265, 0x00a0, 0x2321, 0x00b0, 0x00b2, 0x00b7, 0x00f7, 0x2550, 0x2551, 0x2552, 0x0451, 0x2553, 0x2554, 0x2555, 0x2556, 0x2557, 0x2558, 0x2559, 0x255a, 0x255b, 0x255c, 0x255d, 0x255e, 0x255f, 0x2560, 0x2561, 0x0401, 0x2562, 0x2563, 0x2564, 0x2565, 0x2566, 0x2567, 0x2568, 0x2569, 0x256a, 0x256b, 0x256c, 0x00a9, 0x044e, 0x0430, 0x0431, 0x0446, 0x0434, 0x0435, 0x0444, 0x0433, 0x0445, 0x0438, 0x0439, 0x043a, 0x043b, 0x043c, 0x043d, 0x043e, 0x043f, 0x044f, 0x0440, 0x0441, 0x0442, 0x0443, 0x0436, 0x0432, 0x044c, 0x044b, 0x0437, 0x0448, 0x044d, 0x0449, 0x0447, 0x044a, 0x042e, 0x0410, 0x0411, 0x0426, 0x0414, 0x0415, 0x0424, 0x0413, 0x0425, 0x0418, 0x0419, 0x041a, 0x041b, 0x041c, 0x041d, 0x041e, 0x041f, 0x042f, 0x0420, 0x0421, 0x0422, 0x0423, 0x0416, 0x0412, 0x042c, 0x042b, 0x0417, 0x0428, 0x042d, 0x0429, 0x0427, 0x042a }}, { UC "koi8-t", 0x20, 0x20, { 0x0000, 0x0001, 0x0002, 0x0003, 0x0004, 0x0005, 0x0006, 0x0007, 0x0008, 0x0009, 0x000a, 0x000b, 0x000c, 0x000d, 0x000e, 0x000f, 0x0010, 0x0011, 0x0012, 0x0013, 0x0014, 0x0015, 0x0016, 0x0017, 0x0018, 0x0019, 0x001a, 0x001b, 0x001c, 0x001d, 0x001e, 0x001f, 0x0020, 0x0021, 0x0022, 0x0023, 0x0024, 0x0025, 0x0026, 0x0027, 0x0028, 0x0029, 0x002a, 0x002b, 0x002c, 0x002d, 0x002e, 0x002f, 0x0030, 0x0031, 0x0032, 0x0033, 0x0034, 0x0035, 0x0036, 0x0037, 0x0038, 0x0039, 0x003a, 0x003b, 0x003c, 0x003d, 0x003e, 0x003f, 0x0040, 0x0041, 0x0042, 0x0043, 0x0044, 0x0045, 0x0046, 0x0047, 0x0048, 0x0049, 0x004a, 0x004b, 0x004c, 0x004d, 0x004e, 0x004f, 0x0050, 0x0051, 0x0052, 0x0053, 0x0054, 0x0055, 0x0056, 0x0057, 0x0058, 0x0059, 0x005a, 0x005b, 0x005c, 0x005d, 0x005e, 0x005f, 0x0060, 0x0061, 0x0062, 0x0063, 0x0064, 0x0065, 0x0066, 0x0067, 0x0068, 0x0069, 0x006a, 0x006b, 0x006c, 0x006d, 0x006e, 0x006f, 0x0070, 0x0071, 0x0072, 0x0073, 0x0074, 0x0075, 0x0076, 0x0077, 0x0078, 0x0079, 0x007a, 0x007b, 0x007c, 0x007d, 0x007e, 0x007f, 0x049b, 0x0493, 0x201a, 0x0492, 0x201e, 0x2026, 0x2020, 0x2021, -1, 0x2030, 0x04b3, 0x2039, 0x04b2, 0x04b7, 0x04b6, -1, 0x049a, 0x2018, 0x2019, 0x201c, 0x201d, 0x2022, 0x2013, 0x2014, -1, 0x2122, -1, 0x203a, -1, -1, -1, -1, -1, 0x04ef, 0x04ee, 0x0451, 0x00a4, 0x04e3, 0x00a6, 0x00a7, -1, -1, -1, 0x00ab, 0x00ac, 0x00ad, 0x00ae, -1, 0x00b0, 0x00b1, 0x00b2, 0x0401, -1, 0x04e2, 0x00b6, 0x00b7, -1, 0x2116, -1, 0x00bb, -1, -1, -1, 0x00a9, 0x044e, 0x0430, 0x0431, 0x0446, 0x0434, 0x0435, 0x0444, 0x0433, 0x0445, 0x0438, 0x0439, 0x043a, 0x043b, 0x043c, 0x043d, 0x043e, 0x043f, 0x044f, 0x0440, 0x0441, 0x0442, 0x0443, 0x0436, 0x0432, 0x044c, 0x044b, 0x0437, 0x0448, 0x044d, 0x0449, 0x0447, 0x044a, 0x042e, 0x0410, 0x0411, 0x0426, 0x0414, 0x0415, 0x0424, 0x0413, 0x0425, 0x0418, 0x0419, 0x041a, 0x041b, 0x041c, 0x041d, 0x041e, 0x041f, 0x042f, 0x0420, 0x0421, 0x0422, 0x0423, 0x0416, 0x0412, 0x042c, 0x042b, 0x0417, 0x0428, 0x042d, 0x0429, 0x0427, 0x042a }}, { UC "koi8-u", 0x20, 0x20, { 0x0000, 0x0001, 0x0002, 0x0003, 0x0004, 0x0005, 0x0006, 0x0007, 0x0008, 0x0009, 0x000a, 0x000b, 0x000c, 0x000d, 0x000e, 0x000f, 0x0010, 0x0011, 0x0012, 0x0013, 0x0014, 0x0015, 0x0016, 0x0017, 0x0018, 0x0019, 0x001a, 0x001b, 0x001c, 0x001d, 0x001e, 0x001f, 0x0020, 0x0021, 0x0022, 0x0023, 0x0024, 0x0025, 0x0026, 0x0027, 0x0028, 0x0029, 0x002a, 0x002b, 0x002c, 0x002d, 0x002e, 0x002f, 0x0030, 0x0031, 0x0032, 0x0033, 0x0034, 0x0035, 0x0036, 0x0037, 0x0038, 0x0039, 0x003a, 0x003b, 0x003c, 0x003d, 0x003e, 0x003f, 0x0040, 0x0041, 0x0042, 0x0043, 0x0044, 0x0045, 0x0046, 0x0047, 0x0048, 0x0049, 0x004a, 0x004b, 0x004c, 0x004d, 0x004e, 0x004f, 0x0050, 0x0051, 0x0052, 0x0053, 0x0054, 0x0055, 0x0056, 0x0057, 0x0058, 0x0059, 0x005a, 0x005b, 0x005c, 0x005d, 0x005e, 0x005f, 0x0060, 0x0061, 0x0062, 0x0063, 0x0064, 0x0065, 0x0066, 0x0067, 0x0068, 0x0069, 0x006a, 0x006b, 0x006c, 0x006d, 0x006e, 0x006f, 0x0070, 0x0071, 0x0072, 0x0073, 0x0074, 0x0075, 0x0076, 0x0077, 0x0078, 0x0079, 0x007a, 0x007b, 0x007c, 0x007d, 0x007e, 0x007f, 0x2500, 0x2502, 0x250c, 0x2510, 0x2514, 0x2518, 0x251c, 0x2524, 0x252c, 0x2534, 0x253c, 0x2580, 0x2584, 0x2588, 0x258c, 0x2590, 0x2591, 0x2592, 0x2593, 0x2320, 0x25a0, 0x2219, 0x221a, 0x2248, 0x2264, 0x2265, 0x00a0, 0x2321, 0x00b0, 0x00b2, 0x00b7, 0x00f7, 0x2550, 0x2551, 0x2552, 0x0451, 0x0454, 0x2554, 0x0456, 0x0457, 0x2557, 0x2558, 0x2559, 0x255a, 0x255b, 0x0491, 0x255d, 0x255e, 0x255f, 0x2560, 0x2561, 0x0401, 0x0404, 0x2563, 0x0406, 0x0407, 0x2566, 0x2567, 0x2568, 0x2569, 0x256a, 0x0490, 0x256c, 0x00a9, 0x044e, 0x0430, 0x0431, 0x0446, 0x0434, 0x0435, 0x0444, 0x0433, 0x0445, 0x0438, 0x0439, 0x043a, 0x043b, 0x043c, 0x043d, 0x043e, 0x043f, 0x044f, 0x0440, 0x0441, 0x0442, 0x0443, 0x0436, 0x0432, 0x044c, 0x044b, 0x0437, 0x0448, 0x044d, 0x0449, 0x0447, 0x044a, 0x042e, 0x0410, 0x0411, 0x0426, 0x0414, 0x0415, 0x0424, 0x0413, 0x0425, 0x0418, 0x0419, 0x041a, 0x041b, 0x041c, 0x041d, 0x041e, 0x041f, 0x042f, 0x0420, 0x0421, 0x0422, 0x0423, 0x0416, 0x0412, 0x042c, 0x042b, 0x0417, 0x0428, 0x042d, 0x0429, 0x0427, 0x042a }}, { UC "cp437", 0xF9, 0xAA, { /* From: src/share/i18n/csmapper/CP/CP437%UCS.src,v 1.2 2014/06/26 18:58:50 tg Exp $ */ 0x0000, 0x0001, 0x0002, 0x0003, 0x0004, 0x0005, 0x0006, 0x0007, 0x0008, 0x0009, 0x000A, 0x000B, 0x000C, 0x000D, 0x000E, 0x000F, 0x0010, 0x0011, 0x0012, 0x0013, 0x0014, 0x0015, 0x0016, 0x0017, 0x0018, 0x0019, 0x001A, 0x001B, 0x001C, 0x001D, 0x001E, 0x001F, 0x0020, 0x0021, 0x0022, 0x0023, 0x0024, 0x0025, 0x0026, 0x0027, 0x0028, 0x0029, 0x002A, 0x002B, 0x002C, 0x002D, 0x002E, 0x002F, 0x0030, 0x0031, 0x0032, 0x0033, 0x0034, 0x0035, 0x0036, 0x0037, 0x0038, 0x0039, 0x003A, 0x003B, 0x003C, 0x003D, 0x003E, 0x003F, 0x0040, 0x0041, 0x0042, 0x0043, 0x0044, 0x0045, 0x0046, 0x0047, 0x0048, 0x0049, 0x004A, 0x004B, 0x004C, 0x004D, 0x004E, 0x004F, 0x0050, 0x0051, 0x0052, 0x0053, 0x0054, 0x0055, 0x0056, 0x0057, 0x0058, 0x0059, 0x005A, 0x005B, 0x005C, 0x005D, 0x005E, 0x005F, 0x0060, 0x0061, 0x0062, 0x0063, 0x0064, 0x0065, 0x0066, 0x0067, 0x0068, 0x0069, 0x006A, 0x006B, 0x006C, 0x006D, 0x006E, 0x006F, 0x0070, 0x0071, 0x0072, 0x0073, 0x0074, 0x0075, 0x0076, 0x0077, 0x0078, 0x0079, 0x007A, 0x007B, 0x007C, 0x007D, 0x007E, 0x007F, 0x00C7, 0x00FC, 0x00E9, 0x00E2, 0x00E4, 0x00E0, 0x00E5, 0x00E7, 0x00EA, 0x00EB, 0x00E8, 0x00EF, 0x00EE, 0x00EC, 0x00C4, 0x00C5, 0x00C9, 0x00E6, 0x00C6, 0x00F4, 0x00F6, 0x00F2, 0x00FB, 0x00F9, 0x00FF, 0x00D6, 0x00DC, 0x00A2, 0x00A3, 0x00A5, 0x20A7, 0x0192, 0x00E1, 0x00ED, 0x00F3, 0x00FA, 0x00F1, 0x00D1, 0x00AA, 0x00BA, 0x00BF, 0x2310, 0x00AC, 0x00BD, 0x00BC, 0x00A1, 0x00AB, 0x00BB, 0x2591, 0x2592, 0x2593, 0x2502, 0x2524, 0x2561, 0x2562, 0x2556, 0x2555, 0x2563, 0x2551, 0x2557, 0x255D, 0x255C, 0x255B, 0x2510, 0x2514, 0x2534, 0x252C, 0x251C, 0x2500, 0x253C, 0x255E, 0x255F, 0x255A, 0x2554, 0x2569, 0x2566, 0x2560, 0x2550, 0x256C, 0x2567, 0x2568, 0x2564, 0x2565, 0x2559, 0x2558, 0x2552, 0x2553, 0x256B, 0x256A, 0x2518, 0x250C, 0x2588, 0x2584, 0x258C, 0x2590, 0x2580, 0x03B1, 0x00DF, 0x0393, 0x03C0, 0x03A3, 0x03C3, 0x00B5, 0x03C4, 0x03A6, 0x0398, 0x03A9, 0x03B4, 0x221E, 0x03C6, 0x03B5, 0x2229, 0x2261, 0x00B1, 0x2265, 0x2264, 0x2320, 0x2321, 0x00F7, 0x2248, 0x00B0, 0x2219, 0x00B7, 0x221A, 0x207F, 0x00B2, 0x25A0, 0x00A0 }}, { UC "cp1251", 0x20, 0x20, { 0x0000, 0x0001, 0x0002, 0x0003, 0x0004, 0x0005, 0x0006, 0x0007, 0x0008, 0x0009, 0x000a, 0x000b, 0x000c, 0x000d, 0x000e, 0x000f, 0x0010, 0x0011, 0x0012, 0x0013, 0x0014, 0x0015, 0x0016, 0x0017, 0x0018, 0x0019, 0x001a, 0x001b, 0x001c, 0x001d, 0x001e, 0x001f, 0x0020, 0x0021, 0x0022, 0x0023, 0x0024, 0x0025, 0x0026, 0x0027, 0x0028, 0x0029, 0x002a, 0x002b, 0x002c, 0x002d, 0x002e, 0x002f, 0x0030, 0x0031, 0x0032, 0x0033, 0x0034, 0x0035, 0x0036, 0x0037, 0x0038, 0x0039, 0x003a, 0x003b, 0x003c, 0x003d, 0x003e, 0x003f, 0x0040, 0x0041, 0x0042, 0x0043, 0x0044, 0x0045, 0x0046, 0x0047, 0x0048, 0x0049, 0x004a, 0x004b, 0x004c, 0x004d, 0x004e, 0x004f, 0x0050, 0x0051, 0x0052, 0x0053, 0x0054, 0x0055, 0x0056, 0x0057, 0x0058, 0x0059, 0x005a, 0x005b, 0x005c, 0x005d, 0x005e, 0x005f, 0x0060, 0x0061, 0x0062, 0x0063, 0x0064, 0x0065, 0x0066, 0x0067, 0x0068, 0x0069, 0x006a, 0x006b, 0x006c, 0x006d, 0x006e, 0x006f, 0x0070, 0x0071, 0x0072, 0x0073, 0x0074, 0x0075, 0x0076, 0x0077, 0x0078, 0x0079, 0x007a, 0x007b, 0x007c, 0x007d, 0x007e, 0x007f, 0x0402, 0x0403, 0x201a, 0x0453, 0x201e, 0x2026, 0x2020, 0x2021, 0x20ac, 0x2030, 0x0409, 0x2039, 0x040a, 0x040c, 0x040b, 0x040f, 0x0452, 0x2018, 0x2019, 0x201c, 0x201d, 0x2022, 0x2013, 0x2014, -1, 0x2122, 0x0459, 0x203a, 0x045a, 0x045c, 0x045b, 0x045f, 0x00a0, 0x040e, 0x045e, 0x0408, 0x00a4, 0x0490, 0x00a6, 0x00a7, 0x0401, 0x00a9, 0x0404, 0x00ab, 0x00ac, 0x00ad, 0x00ae, 0x0407, 0x00b0, 0x00b1, 0x0406, 0x0456, 0x0491, 0x00b5, 0x00b6, 0x00b7, 0x0451, 0x2116, 0x0454, 0x00bb, 0x0458, 0x0405, 0x0455, 0x0457, 0x0410, 0x0411, 0x0412, 0x0413, 0x0414, 0x0415, 0x0416, 0x0417, 0x0418, 0x0419, 0x041a, 0x041b, 0x041c, 0x041d, 0x041e, 0x041f, 0x0420, 0x0421, 0x0422, 0x0423, 0x0424, 0x0425, 0x0426, 0x0427, 0x0428, 0x0429, 0x042a, 0x042b, 0x042c, 0x042d, 0x042e, 0x042f, 0x0430, 0x0431, 0x0432, 0x0433, 0x0434, 0x0435, 0x0436, 0x0437, 0x0438, 0x0439, 0x043a, 0x043b, 0x043c, 0x043d, 0x043e, 0x043f, 0x0440, 0x0441, 0x0442, 0x0443, 0x0444, 0x0445, 0x0446, 0x0447, 0x0448, 0x0449, 0x044a, 0x044b, 0x044c, 0x044d, 0x044e, 0x044f }}, { UC "cp1252", 0xB7, 0xAC, { 0x0000, 0x0001, 0x0002, 0x0003, 0x0004, 0x0005, 0x0006, 0x0007, 0x0008, 0x0009, 0x000a, 0x000b, 0x000c, 0x000d, 0x000e, 0x000f, 0x0010, 0x0011, 0x0012, 0x0013, 0x0014, 0x0015, 0x0016, 0x0017, 0x0018, 0x0019, 0x001a, 0x001b, 0x001c, 0x001d, 0x001e, 0x001f, 0x0020, 0x0021, 0x0022, 0x0023, 0x0024, 0x0025, 0x0026, 0x0027, 0x0028, 0x0029, 0x002a, 0x002b, 0x002c, 0x002d, 0x002e, 0x002f, 0x0030, 0x0031, 0x0032, 0x0033, 0x0034, 0x0035, 0x0036, 0x0037, 0x0038, 0x0039, 0x003a, 0x003b, 0x003c, 0x003d, 0x003e, 0x003f, 0x0040, 0x0041, 0x0042, 0x0043, 0x0044, 0x0045, 0x0046, 0x0047, 0x0048, 0x0049, 0x004a, 0x004b, 0x004c, 0x004d, 0x004e, 0x004f, 0x0050, 0x0051, 0x0052, 0x0053, 0x0054, 0x0055, 0x0056, 0x0057, 0x0058, 0x0059, 0x005a, 0x005b, 0x005c, 0x005d, 0x005e, 0x005f, 0x0060, 0x0061, 0x0062, 0x0063, 0x0064, 0x0065, 0x0066, 0x0067, 0x0068, 0x0069, 0x006a, 0x006b, 0x006c, 0x006d, 0x006e, 0x006f, 0x0070, 0x0071, 0x0072, 0x0073, 0x0074, 0x0075, 0x0076, 0x0077, 0x0078, 0x0079, 0x007a, 0x007b, 0x007c, 0x007d, 0x007e, 0x007f, 0x20AC, -1, 0x201A, 0x0192, 0x201E, 0x2026, 0x2020, 0x2021, 0x02C6, 0x2030, 0x0160, 0x2039, 0x0152, -1, 0x017D, -1, -1, 0x2018, 0x2019, 0x201C, 0x201D, 0x2022, 0x2013, 0x2014, 0x02DC, 0x2122, 0x0161, 0x203A, 0x0153, -1, 0x017E, 0x0178, 0x00a0, 0x00a1, 0x00a2, 0x00a3, 0x00a4, 0x00a5, 0x00a6, 0x00a7, 0x00a8, 0x00a9, 0x00aa, 0x00ab, 0x00ac, 0x00ad, 0x00ae, 0x00af, 0x00b0, 0x00b1, 0x00b2, 0x00b3, 0x00b4, 0x00b5, 0x00b6, 0x00b7, 0x00b8, 0x00b9, 0x00ba, 0x00bb, 0x00bc, 0x00bd, 0x00be, 0x00bf, 0x00c0, 0x00c1, 0x00c2, 0x00c3, 0x00c4, 0x00c5, 0x00c6, 0x00c7, 0x00c8, 0x00c9, 0x00ca, 0x00cb, 0x00cc, 0x00cd, 0x00ce, 0x00cf, 0x00d0, 0x00d1, 0x00d2, 0x00d3, 0x00d4, 0x00d5, 0x00d6, 0x00d7, 0x00d8, 0x00d9, 0x00da, 0x00db, 0x00dc, 0x00dd, 0x00de, 0x00df, 0x00e0, 0x00e1, 0x00e2, 0x00e3, 0x00e4, 0x00e5, 0x00e6, 0x00e7, 0x00e8, 0x00e9, 0x00ea, 0x00eb, 0x00ec, 0x00ed, 0x00ee, 0x00ef, 0x00f0, 0x00f1, 0x00f2, 0x00f3, 0x00f4, 0x00f5, 0x00f6, 0x00f7, 0x00f8, 0x00f9, 0x00fa, 0x00fb, 0x00fc, 0x00fd, 0x00fe, 0x00ff }}, { UC "cp1255", 0x20, 0x20, { 0x0000, 0x0001, 0x0002, 0x0003, 0x0004, 0x0005, 0x0006, 0x0007, 0x0008, 0x0009, 0x000a, 0x000b, 0x000c, 0x000d, 0x000e, 0x000f, 0x0010, 0x0011, 0x0012, 0x0013, 0x0014, 0x0015, 0x0016, 0x0017, 0x0018, 0x0019, 0x001a, 0x001b, 0x001c, 0x001d, 0x001e, 0x001f, 0x0020, 0x0021, 0x0022, 0x0023, 0x0024, 0x0025, 0x0026, 0x0027, 0x0028, 0x0029, 0x002a, 0x002b, 0x002c, 0x002d, 0x002e, 0x002f, 0x0030, 0x0031, 0x0032, 0x0033, 0x0034, 0x0035, 0x0036, 0x0037, 0x0038, 0x0039, 0x003a, 0x003b, 0x003c, 0x003d, 0x003e, 0x003f, 0x0040, 0x0041, 0x0042, 0x0043, 0x0044, 0x0045, 0x0046, 0x0047, 0x0048, 0x0049, 0x004a, 0x004b, 0x004c, 0x004d, 0x004e, 0x004f, 0x0050, 0x0051, 0x0052, 0x0053, 0x0054, 0x0055, 0x0056, 0x0057, 0x0058, 0x0059, 0x005a, 0x005b, 0x005c, 0x005d, 0x005e, 0x005f, 0x0060, 0x0061, 0x0062, 0x0063, 0x0064, 0x0065, 0x0066, 0x0067, 0x0068, 0x0069, 0x006a, 0x006b, 0x006c, 0x006d, 0x006e, 0x006f, 0x0070, 0x0071, 0x0072, 0x0073, 0x0074, 0x0075, 0x0076, 0x0077, 0x0078, 0x0079, 0x007a, 0x007b, 0x007c, 0x007d, 0x007e, 0x007f, 0x20ac, -1, 0x201a, 0x0192, 0x201e, 0x2026, 0x2020, 0x2021, 0x02c6, 0x2030, -1, 0x2039, -1, -1, -1, -1, -1, 0x2018, 0x2019, 0x201c, 0x201d, 0x2022, 0x2013, 0x2014, 0x02dc, 0x2122, -1, 0x203a, -1, -1, -1, -1, 0x00a0, 0x00a1, 0x00a2, 0x00a3, 0x20aa, 0x00a5, 0x00a6, 0x00a7, 0x00a8, 0x00a9, 0x00d7, 0x00ab, 0x00ac, 0x00ad, 0x00ae, 0x00af, 0x00b0, 0x00b1, 0x00b2, 0x00b3, 0x00b4, 0x00b5, 0x00b6, 0x00b7, 0x00b8, 0x00b9, 0x00f7, 0x00bb, 0x00bc, 0x00bd, 0x00be, 0x00bf, 0x05b0, 0x05b1, 0x05b2, 0x05b3, 0x05b4, 0x05b5, 0x05b6, 0x05b7, 0x05b8, 0x05b9, -1, 0x05bb, 0x05bc, 0x05bd, 0x05be, 0x05bf, 0x05c0, 0x05c1, 0x05c2, 0x05c3, 0x05f0, 0x05f1, 0x05f2, 0x05f3, 0x05f4, -1, -1, -1, -1, -1, -1, -1, 0x05d0, 0x05d1, 0x05d2, 0x05d3, 0x05d4, 0x05d5, 0x05d6, 0x05d7, 0x05d8, 0x05d9, 0x05da, 0x05db, 0x05dc, 0x05dd, 0x05de, 0x05df, 0x05e0, 0x05e1, 0x05e2, 0x05e3, 0x05e4, 0x05e5, 0x05e6, 0x05e7, 0x05e8, 0x05e9, 0x05ea, -1, -1, 0x200e, 0x200f, -1 }}, { UC "cp1256", 0x20, 0x20, { 0x0000, 0x0001, 0x0002, 0x0003, 0x0004, 0x0005, 0x0006, 0x0007, 0x0008, 0x0009, 0x000a, 0x000b, 0x000c, 0x000d, 0x000e, 0x000f, 0x0010, 0x0011, 0x0012, 0x0013, 0x0014, 0x0015, 0x0016, 0x0017, 0x0018, 0x0019, 0x001a, 0x001b, 0x001c, 0x001d, 0x001e, 0x001f, 0x0020, 0x0021, 0x0022, 0x0023, 0x0024, 0x0025, 0x0026, 0x0027, 0x0028, 0x0029, 0x002a, 0x002b, 0x002c, 0x002d, 0x002e, 0x002f, 0x0030, 0x0031, 0x0032, 0x0033, 0x0034, 0x0035, 0x0036, 0x0037, 0x0038, 0x0039, 0x003a, 0x003b, 0x003c, 0x003d, 0x003e, 0x003f, 0x0040, 0x0041, 0x0042, 0x0043, 0x0044, 0x0045, 0x0046, 0x0047, 0x0048, 0x0049, 0x004a, 0x004b, 0x004c, 0x004d, 0x004e, 0x004f, 0x0050, 0x0051, 0x0052, 0x0053, 0x0054, 0x0055, 0x0056, 0x0057, 0x0058, 0x0059, 0x005a, 0x005b, 0x005c, 0x005d, 0x005e, 0x005f, 0x0060, 0x0061, 0x0062, 0x0063, 0x0064, 0x0065, 0x0066, 0x0067, 0x0068, 0x0069, 0x006a, 0x006b, 0x006c, 0x006d, 0x006e, 0x006f, 0x0070, 0x0071, 0x0072, 0x0073, 0x0074, 0x0075, 0x0076, 0x0077, 0x0078, 0x0079, 0x007a, 0x007b, 0x007c, 0x007d, 0x007e, 0x007f, 0x20ac, 0x067e, 0x201a, 0x0192, 0x201e, 0x2026, 0x2020, 0x2021, 0x02c6, 0x2030, 0x0679, 0x2039, 0x0152, 0x0686, 0x0698, 0x0688, 0x06af, 0x2018, 0x2019, 0x201c, 0x201d, 0x2022, 0x2013, 0x2014, 0x06a9, 0x2122, 0x0691, 0x203a, 0x0153, 0x200c, 0x200d, 0x06ba, 0x00a0, 0x060c, 0x00a2, 0x00a3, 0x00a4, 0x00a5, 0x00a6, 0x00a7, 0x00a8, 0x00a9, 0x06be, 0x00ab, 0x00ac, 0x00ad, 0x00ae, 0x00af, 0x00b0, 0x00b1, 0x00b2, 0x00b3, 0x00b4, 0x00b5, 0x00b6, 0x00b7, 0x00b8, 0x00b9, 0x061b, 0x00bb, 0x00bc, 0x00bd, 0x00be, 0x061f, 0x06c1, 0x0621, 0x0622, 0x0623, 0x0624, 0x0625, 0x0626, 0x0627, 0x0628, 0x0629, 0x062a, 0x062b, 0x062c, 0x062d, 0x062e, 0x062f, 0x0630, 0x0631, 0x0632, 0x0633, 0x0634, 0x0635, 0x0636, 0x00d7, 0x0637, 0x0638, 0x0639, 0x063a, 0x0640, 0x0641, 0x0642, 0x0643, 0x00e0, 0x0644, 0x00e2, 0x0645, 0x0646, 0x0647, 0x0648, 0x00e7, 0x00e8, 0x00e9, 0x00ea, 0x00eb, 0x0649, 0x064a, 0x00ee, 0x00ef, 0x064b, 0x064c, 0x064d, 0x064e, 0x00f4, 0x064f, 0x0650, 0x00f7, 0x0651, 0x00f9, 0x0652, 0x00fb, 0x00fc, 0x200e, 0x200f, 0x06d2 }}, { UC "armscii-8", 0x20, 0x20, { 0x0000, 0x0001, 0x0002, 0x0003, 0x0004, 0x0005, 0x0006, 0x0007, 0x0008, 0x0009, 0x000a, 0x000b, 0x000c, 0x000d, 0x000e, 0x000f, 0x0010, 0x0011, 0x0012, 0x0013, 0x0014, 0x0015, 0x0016, 0x0017, 0x0018, 0x0019, 0x001a, 0x001b, 0x001c, 0x001d, 0x001e, 0x001f, 0x0020, 0x0021, 0x0022, 0x0023, 0x0024, 0x0025, 0x0026, 0x0027, 0x0028, 0x0029, 0x002a, 0x002b, 0x002c, 0x002d, 0x002e, 0x002f, 0x0030, 0x0031, 0x0032, 0x0033, 0x0034, 0x0035, 0x0036, 0x0037, 0x0038, 0x0039, 0x003a, 0x003b, 0x003c, 0x003d, 0x003e, 0x003f, 0x0040, 0x0041, 0x0042, 0x0043, 0x0044, 0x0045, 0x0046, 0x0047, 0x0048, 0x0049, 0x004a, 0x004b, 0x004c, 0x004d, 0x004e, 0x004f, 0x0050, 0x0051, 0x0052, 0x0053, 0x0054, 0x0055, 0x0056, 0x0057, 0x0058, 0x0059, 0x005a, 0x005b, 0x005c, 0x005d, 0x005e, 0x005f, 0x0060, 0x0061, 0x0062, 0x0063, 0x0064, 0x0065, 0x0066, 0x0067, 0x0068, 0x0069, 0x006a, 0x006b, 0x006c, 0x006d, 0x006e, 0x006f, 0x0070, 0x0071, 0x0072, 0x0073, 0x0074, 0x0075, 0x0076, 0x0077, 0x0078, 0x0079, 0x007a, 0x007b, 0x007c, 0x007d, 0x007e, 0x007f, 0x0080, 0x0081, 0x0082, 0x0083, 0x0084, 0x0085, 0x0086, 0x0087, 0x0088, 0x0089, 0x008a, 0x008b, 0x008c, 0x008d, 0x008e, 0x008f, 0x0090, 0x0091, 0x0092, 0x0093, 0x0094, 0x0095, 0x0096, 0x0097, 0x0098, 0x0099, 0x009a, 0x009b, 0x009c, 0x009d, 0x009e, 0x009f, 0x00a0, -1, 0x0587, 0x0589, 0x0029, 0x0028, 0x00bb, 0x00ab, 0x2014, 0x002e, 0x055d, 0x002c, 0x002d, 0x058a, 0x2026, 0x055c, 0x055b, 0x055e, 0x0531, 0x0561, 0x0532, 0x0562, 0x0533, 0x0563, 0x0534, 0x0564, 0x0535, 0x0565, 0x0536, 0x0566, 0x0537, 0x0567, 0x0538, 0x0568, 0x0539, 0x0569, 0x053a, 0x056a, 0x053b, 0x056b, 0x053c, 0x056c, 0x053d, 0x056d, 0x053e, 0x056e, 0x053f, 0x056f, 0x0540, 0x0570, 0x0541, 0x0571, 0x0542, 0x0572, 0x0543, 0x0573, 0x0544, 0x0574, 0x0545, 0x0575, 0x0546, 0x0576, 0x0547, 0x0577, 0x0548, 0x0578, 0x0549, 0x0579, 0x054a, 0x057a, 0x054b, 0x057b, 0x054c, 0x057c, 0x054d, 0x057d, 0x054e, 0x057e, 0x054f, 0x057f, 0x0550, 0x0580, 0x0551, 0x0581, 0x0552, 0x0582, 0x0553, 0x0583, 0x0554, 0x0584, 0x0555, 0x0585, 0x0556, 0x0586, 0x055a, -1 }}, { UC "tis-620", 0x20, 0x20, { 0x0000, 0x0001, 0x0002, 0x0003, 0x0004, 0x0005, 0x0006, 0x0007, 0x0008, 0x0009, 0x000a, 0x000b, 0x000c, 0x000d, 0x000e, 0x000f, 0x0010, 0x0011, 0x0012, 0x0013, 0x0014, 0x0015, 0x0016, 0x0017, 0x0018, 0x0019, 0x001a, 0x001b, 0x001c, 0x001d, 0x001e, 0x001f, 0x0020, 0x0021, 0x0022, 0x0023, 0x0024, 0x0025, 0x0026, 0x0027, 0x0028, 0x0029, 0x002a, 0x002b, 0x002c, 0x002d, 0x002e, 0x002f, 0x0030, 0x0031, 0x0032, 0x0033, 0x0034, 0x0035, 0x0036, 0x0037, 0x0038, 0x0039, 0x003a, 0x003b, 0x003c, 0x003d, 0x003e, 0x003f, 0x0040, 0x0041, 0x0042, 0x0043, 0x0044, 0x0045, 0x0046, 0x0047, 0x0048, 0x0049, 0x004a, 0x004b, 0x004c, 0x004d, 0x004e, 0x004f, 0x0050, 0x0051, 0x0052, 0x0053, 0x0054, 0x0055, 0x0056, 0x0057, 0x0058, 0x0059, 0x005a, 0x005b, 0x005c, 0x005d, 0x005e, 0x005f, 0x0060, 0x0061, 0x0062, 0x0063, 0x0064, 0x0065, 0x0066, 0x0067, 0x0068, 0x0069, 0x006a, 0x006b, 0x006c, 0x006d, 0x006e, 0x006f, 0x0070, 0x0071, 0x0072, 0x0073, 0x0074, 0x0075, 0x0076, 0x0077, 0x0078, 0x0079, 0x007a, 0x007b, 0x007c, 0x007d, 0x007e, 0x007f, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 0x0e01, 0x0e02, 0x0e03, 0x0e04, 0x0e05, 0x0e06, 0x0e07, 0x0e08, 0x0e09, 0x0e0a, 0x0e0b, 0x0e0c, 0x0e0d, 0x0e0e, 0x0e0f, 0x0e10, 0x0e11, 0x0e12, 0x0e13, 0x0e14, 0x0e15, 0x0e16, 0x0e17, 0x0e18, 0x0e19, 0x0e1a, 0x0e1b, 0x0e1c, 0x0e1d, 0x0e1e, 0x0e1f, 0x0e20, 0x0e21, 0x0e22, 0x0e23, 0x0e24, 0x0e25, 0x0e26, 0x0e27, 0x0e28, 0x0e29, 0x0e2a, 0x0e2b, 0x0e2c, 0x0e2d, 0x0e2e, 0x0e2f, 0x0e30, 0x0e31, 0x0e32, 0x0e33, 0x0e34, 0x0e35, 0x0e36, 0x0e37, 0x0e38, 0x0e39, 0x0e3a, -1, -1, -1, -1, 0x0e3f, 0x0e40, 0x0e41, 0x0e42, 0x0e43, 0x0e44, 0x0e45, 0x0e46, 0x0e47, 0x0e48, 0x0e49, 0x0e4a, 0x0e4b, 0x0e4c, 0x0e4d, 0x0e4e, 0x0e4f, 0x0e50, 0x0e51, 0x0e52, 0x0e53, 0x0e54, 0x0e55, 0x0e56, 0x0e57, 0x0e58, 0x0e59, 0x0e5a, 0x0e5b, -1, -1, -1, -1 }}, { UC "georgian-ps", 0x20, 0x20, { 0x0000, 0x0001, 0x0002, 0x0003, 0x0004, 0x0005, 0x0006, 0x0007, 0x0008, 0x0009, 0x000a, 0x000b, 0x000c, 0x000d, 0x000e, 0x000f, 0x0010, 0x0011, 0x0012, 0x0013, 0x0014, 0x0015, 0x0016, 0x0017, 0x0018, 0x0019, 0x001a, 0x001b, 0x001c, 0x001d, 0x001e, 0x001f, 0x0020, 0x0021, 0x0022, 0x0023, 0x0024, 0x0025, 0x0026, 0x0027, 0x0028, 0x0029, 0x002a, 0x002b, 0x002c, 0x002d, 0x002e, 0x002f, 0x0030, 0x0031, 0x0032, 0x0033, 0x0034, 0x0035, 0x0036, 0x0037, 0x0038, 0x0039, 0x003a, 0x003b, 0x003c, 0x003d, 0x003e, 0x003f, 0x0040, 0x0041, 0x0042, 0x0043, 0x0044, 0x0045, 0x0046, 0x0047, 0x0048, 0x0049, 0x004a, 0x004b, 0x004c, 0x004d, 0x004e, 0x004f, 0x0050, 0x0051, 0x0052, 0x0053, 0x0054, 0x0055, 0x0056, 0x0057, 0x0058, 0x0059, 0x005a, 0x005b, 0x005c, 0x005d, 0x005e, 0x005f, 0x0060, 0x0061, 0x0062, 0x0063, 0x0064, 0x0065, 0x0066, 0x0067, 0x0068, 0x0069, 0x006a, 0x006b, 0x006c, 0x006d, 0x006e, 0x006f, 0x0070, 0x0071, 0x0072, 0x0073, 0x0074, 0x0075, 0x0076, 0x0077, 0x0078, 0x0079, 0x007a, 0x007b, 0x007c, 0x007d, 0x007e, 0x007f, 0x0080, 0x0081, 0x201a, 0x0192, 0x201e, 0x2026, 0x2020, 0x2021, 0x02c6, 0x2030, 0x0160, 0x2039, 0x0152, 0x008d, 0x008e, 0x008f, 0x0090, 0x2018, 0x2019, 0x201c, 0x201d, 0x2022, 0x2013, 0x2014, 0x02dc, 0x2122, 0x0161, 0x203a, 0x0153, 0x009d, 0x009e, 0x0178, 0x00a0, 0x00a1, 0x00a2, 0x00a3, 0x00a4, 0x00a5, 0x00a6, 0x00a7, 0x00a8, 0x00a9, 0x00aa, 0x00ab, 0x00ac, 0x00ad, 0x00ae, 0x00af, 0x00b0, 0x00b1, 0x00b2, 0x00b3, 0x00b4, 0x00b5, 0x00b6, 0x00b7, 0x00b8, 0x00b9, 0x00ba, 0x00bb, 0x00bc, 0x00bd, 0x00be, 0x00bf, 0x10d0, 0x10d1, 0x10d2, 0x10d3, 0x10d4, 0x10d5, 0x10d6, 0x10f1, 0x10d7, 0x10d8, 0x10d9, 0x10da, 0x10db, 0x10dc, 0x10f2, 0x10dd, 0x10de, 0x10df, 0x10e0, 0x10e1, 0x10e2, 0x10f3, 0x10e3, 0x10e4, 0x10e5, 0x10e6, 0x10e7, 0x10e8, 0x10e9, 0x10ea, 0x10eb, 0x10ec, 0x10ed, 0x10ee, 0x10f4, 0x10ef, 0x10f0, 0x10f5, 0x00e6, 0x00e7, 0x00e8, 0x00e9, 0x00ea, 0x00eb, 0x00ec, 0x00ed, 0x00ee, 0x00ef, 0x00f0, 0x00f1, 0x00f2, 0x00f3, 0x00f4, 0x00f5, 0x00f6, 0x00f7, 0x00f8, 0x00f9, 0x00fa, 0x00fb, 0x00fc, 0x00fd, 0x00fe, 0x00ff }} }; /* For qsort() */ static int pair_cmp(struct pair *a, struct pair *b) { if (a->first > b->first) return (1); else if (a->first < b->first) return (-1); else return (0); } /* Predicate and conversion functions for byte-oriented charmaps */ int byte_ispunct(union charmap *map, int c) { if (c >= 0 && c <= 255) { int ofst = (c >> 3); int bitn = (1 << (c & 7)); return (((map->byte.print_map[ofst] & bitn) != 0) && ((map->byte.alnux_map[ofst] & bitn) == 0)); } return (0); } int byte_isprint(union charmap *map, int c) { if (c >= 0 && c <= 255) { int ofst = (c >> 3); int bitn = (1 << (c & 7)); return ((map->byte.print_map[ofst] & bitn) != 0); } return (0); } int byte_isalphx(union charmap *map, int c) { if (c >= 0 && c <= 255) { int ofst = (c >> 3); int bitn = (1 << (c & 7)); return ((map->byte.alphx_map[ofst] & bitn) != 0); } return (0); } int byte_isalnux(union charmap *map, int c) { if (c >= 0 && c <= 255) { int ofst = (c >> 3); int bitn = (1 << (c & 7)); return ((map->byte.alnux_map[ofst] & bitn) != 0); } return (0); } int byte_tolower(union charmap *map, int c) { return ((c < 0 || c > 255) ? c : map->byte.lower_map[c]); } int byte_toupper(union charmap *map, int c) { return ((c < 0 || c > 255) ? c : map->byte.upper_map[c]); } /* Load built-in character maps */ static void set_bit(unsigned char *map, int n) { map[n >> 3] |= (1 << (n & 7)); } /* loaded character sets */ static union charmap *charmaps = NULL; /* Process a byte-oriented character map and add it to database. Consults database "i18n.c" to determine which characters are uppercase, etc. */ static union charmap * process_builtin(const struct builtin_charmap *builtin) { int x, c, extra_b7, extra_2192; union charmap *map; extra_b7 = builtin->extra_b7; extra_2192 = builtin->extra_2192; map = calloc(1, sizeof(struct charmap_byte)); map->head.cs = builtin->name; map->byte.to_map = builtin->to_uni; for (x = 0; x != 256; ++x) { if ((c = map->byte.to_map[x]) != -1) { map->byte.from_map[map->byte.from_size].first = c; map->byte.from_map[map->byte.from_size].last = x; ++map->byte.from_size; if (c == 0xB7) extra_b7 = -1; if (c == 0x2192) extra_2192 = -1; } } if (extra_b7 > 0) { map->byte.from_map[map->byte.from_size].first = 0xB7; map->byte.from_map[map->byte.from_size].last = extra_b7; ++map->byte.from_size; } if (extra_2192 > 0) { map->byte.from_map[map->byte.from_size].first = 0x2192; map->byte.from_map[map->byte.from_size].last = extra_2192; ++map->byte.from_size; } qsort(map->byte.from_map, map->byte.from_size, sizeof(struct pair), (int (*)(const void *, const void *))pair_cmp); for (x = 0; x != 256; ++x) { map->byte.lower_map[x] = x; map->byte.upper_map[x] = x; if ((c = map->byte.to_map[x]) != -1) { int y, z; if (joe_iswprint(c)) set_bit(map->byte.print_map, x); if (joe_iswalpha(c)) { set_bit(map->byte.alphx_map, x); set_bit(map->byte.alnux_map, x); } y = joe_towlower(c); if ((z = byte_from_uni(map, y)) != -1) map->byte.lower_map[x] = z; y = joe_towupper(c); if ((z = byte_from_uni(map, y)) != -1) map->byte.upper_map[x] = z; } } /* Set underbar */ if ((c = byte_from_uni(map, 0x5F)) != -1) { set_bit(map->byte.alphx_map, c); set_bit(map->byte.alnux_map, c); } /* Put digits into alnum map */ for (x = 0x30; x != 0x3A; ++x) { if ((c = byte_from_uni(map, x)) != -1) set_bit(map->byte.alnux_map, c); } map->head.next = charmaps; charmaps = map; return (map); } static void load_builtins(void) { struct charmap_head *map; /* install UTF-8 map (ties into i18n module) */ map = malloc(sizeof(struct charmap_head)); map->cs = NULL; map->next = charmaps; charmaps = (union charmap *)map; } /* Parse character map file */ static struct builtin_charmap * parse_charmap(const unsigned char *name, FILE *f) { unsigned char buf[1024]; unsigned char bf1[1024]; unsigned comment_char = '#'; int in_map = 0; int x; struct builtin_charmap *b; if (!f) return (NULL); b = malloc(sizeof(struct builtin_charmap)); b->name = (unsigned char *)strdup((const char *)name); for (x = 0; x != 256; ++x) b->to_uni[x] = -1; /* This is a _really_bad_ parser. The file has to be perfect. */ while (fgets((char *)buf, 1023, f)) { unsigned char *p = buf; parse_ws(&p, comment_char); parse_tows(&p, bf1); if (!strcmp((char *)bf1, "")) { parse_ws(&p, comment_char); parse_tows(&p, bf1); comment_char = bf1[0]; } else if (!strcmp((char *)bf1, "")) { parse_ws(&p, comment_char); parse_tows(&p, bf1); } else if (!strcmp((char *)bf1, "CHARMAP")) { in_map = 1; } else if (!strcmp((char *)bf1, "END")) { in_map = 0; } else if (in_map && bf1[0] == '<' && bf1[1] == 'U') { int uni; int byt; uni = ustolb(bf1 + 2, NULL, 0, 0x10FFFF, USTOL_HEX); parse_ws(&p, comment_char); parse_tows(&p, bf1); byt = ustolb(bf1 + 2, NULL, 0, 255, USTOL_HEX); b->to_uni[byt] = uni; } } fclose(f); return (b); } /* Byte wide character map to UCS conversion */ /* * Compare character map names. * Ignores '-'s and '_'s and terminates string on '.'. * Chicken and egg problem here... */ static int map_up(int c) { return ((c >= 'a' && c <= 'z') ? (c + 'A' - 'a') : c); } static int map_name_cmp(const unsigned char *a, const unsigned char *b) { unsigned char ca, cb; goto into_the_loop; loop_beg: if (!(ca = *a) || !(cb = *b) || (map_up(ca) != map_up(cb))) goto loop_end; ++a; ++b; into_the_loop: while ((ca = *a) == '-' || ca == '_') ++a; while ((cb = *b) == '-' || cb == '_') ++b; goto loop_beg; loop_end: return ((!*a && (*b == '.' || !*b)) ? 0 : 1); } /* Find a character map */ union charmap * find_charmap(const unsigned char *name) { unsigned char buf[1024]; unsigned char *p; union charmap *m; struct builtin_charmap *b; FILE *f = NULL; int y; if (!name) return (0); /* Install some initial character maps */ if (!charmaps) load_builtins(); /* Alias? */ for (y = 0; alias_table[y].alias; ++y) if (!map_name_cmp(alias_table[y].alias, name)) { name = alias_table[y].builtin; break; } /* Already loaded? */ for (m = charmaps; m; m = m->head.next) if (!map_name_cmp(joe_mapname(m), name)) return (m); /* Check ~/.jupp/charmaps */ p = (unsigned char *)getenv("HOME"); if (p) { joe_snprintf_2((char *)buf, sizeof(buf), "%s/.jupp/charmaps/%s", p, name); f = fopen((char *)buf, "r"); } /* Check JOERCcharmaps */ if (!f && has_JOERC) { joe_snprintf_2((char *)buf, sizeof(buf), "%scharmaps/%s", get_JOERC, name); f = fopen((char *)buf, "r"); } /* Parse and install character map from file */ if (f && (b = parse_charmap(name, f))) { m = process_builtin(b); free(b); return (m); } /* Check builtin sets */ for (y = 0; y != NELEM(builtin_charmaps); ++y) if (!map_name_cmp(builtin_charmaps[y].name, name)) return (process_builtin(builtin_charmaps + y)); return (NULL); } /* Test */ #ifdef TEST_CHARMAP int main(int argc, char *argv[]) { union charmap *map; int u; int uni; if (argc != 3) { printf("Syntax: %s charmap codepoint\n", argv[0]); return (1); } if (!(map = find_charmap(argv[1]))) { printf("Not found\n"); return (1); } u = ustol(argv[2], NULL, USTOL_TRIM | USTOL_EOS); printf("UCS=%X\n", uni = joe_to_uni(map, u)); printf("Local=%X\n", joe_from_uni(map, uni)); return (0); } #endif /* Get names of available encodings (for tab completion of ^T E prompt) */ unsigned char ** get_encodings(void) { int y, x; unsigned char **encodings = 0; unsigned char **t; unsigned char *r; unsigned char *oldpwd = pwd(); unsigned char *p; unsigned char buf[1024]; /* Builtin maps */ r = vsncpy(NULL, 0, sc(JOE_MAPUTFCS)); encodings = vaadd(encodings, r); for (y = 0; y != NELEM(builtin_charmaps); ++y) { r = vsncpy(NULL, 0, sz(builtin_charmaps[y].name)); encodings = vaadd(encodings, r); } /* Aliases */ for (y = 0; alias_table[y].alias; ++y) { r = vsncpy(NULL, 0, sz(alias_table[y].alias)); encodings = vaadd(encodings, r); } /* External maps */ if ((p = (unsigned char *)getenv("HOME"))) { joe_snprintf_1((char *)buf, sizeof(buf), "%s/.jupp/charmaps", p); if (!chpwd(buf) && (t = rexpnd(UC "*"))) { for (x = 0; x != aLEN(t); ++x) if (strcmp(t[x], "..")) { for (y = 0; y != aLEN(encodings); ++y) if (!strcmp(t[x], encodings[y])) break; if (y == aLEN(encodings)) { r = vsncpy(NULL, 0, sv(t[x])); encodings = vaadd(encodings, r); } } varm(t); } } if (!chJpwd(UC "charmaps") && (t = rexpnd(UC "*"))) { for (x = 0; x != aLEN(t); ++x) if (strcmp(t[x], "..")) { for (y = 0; y != aLEN(encodings); ++y) if (!strcmp(t[x], encodings[y])) break; if (y == aLEN(encodings)) { r = vsncpy(NULL, 0, sv(t[x])); encodings = vaadd(encodings, r); } } varm(t); } chpwd(oldpwd); return (encodings); } /* This is not correct... (EBCDIC for example) */ int joe_isblank(int c) { return (c == 32 || c == 9); } int joe_isspace_eof(union charmap *map, int c) { return ((c == 0) || joe_isspace(map, c)); } unsigned char * joe_strtolower(unsigned char *s) { unsigned char *t; for (t = s; *t; t++) *t = joe_tolower(locale_map, *t); return (s); } #if 0 .endif PROG= charmap SRCS= charmap.c SRCS+= compat.c i18n.c path.c utf8.c utils.c va.c vs.c NOMAN= Yes CPPFLAGS+= -DTEST -DTEST_CHARMAP CPPFLAGS+= -DJUPP_WIN32RELOC=0 -D'JOERC="/etc/joe"' .include .ifdef __CRAZY . if exists(/usr/include/jupp.tmp.h) && !defined(wnostrict) CPPFLAGS+= -DGCC_Wstrict_prototypes . else COPTS+= -Wno-strict-prototypes . endif .endif .include #endif jupp/charmap.h010064400000000000000000000053571363731763300105750ustar00/* * Character sets * Copyright * (C) 2004 Joseph H. Allen * * This file is part of JOE (Joe's Own Editor) */ #ifndef JUPP_CHARMAP_H #define JUPP_CHARMAP_H #ifdef EXTERN __RCSID("$MirOS: contrib/code/jupp/charmap.h,v 1.14 2020/03/27 06:38:56 tg Exp $"); #endif /* For sorted from_map entries */ struct pair { int first; /* Unicode */ int last; /* Byte */ }; /* A character set */ union charmap; struct charmap_head { /* linked list of loaded character maps */ union charmap *next; /* name of this character map, NULL = JOE_MAPUTFCS (UTF-8) */ const unsigned char *cs; }; struct charmap_byte { struct charmap_head head; /* convert byte to UCS */ const int *to_map; /* number of pairs in from_map */ int from_size; /* case conversion */ unsigned char lower_map[256]; unsigned char upper_map[256]; /* bitmap of attributes */ unsigned char alnux_map[32]; unsigned char alphx_map[32]; unsigned char print_map[32]; /* convert UCS to bytes */ struct pair from_map[256 + 2]; }; union charmap { struct charmap_head head; struct charmap_byte byte; }; /* Predicates */ extern const unsigned char JOE_MAPUTFCS[]; #define joe_maputf(map) ((map)->head.cs == NULL) #define joe_mapname(map) (joe_maputf(map) ? JOE_MAPUTFCS : \ (map)->head.cs) #define joe_ispunct(map,c) (joe_maputf(map) ? joe_iswpunct(c) : \ byte_ispunct((map),(c))) #define joe_isprint(map,c) (joe_maputf(map) ? joe_iswprint(c) : \ byte_isprint((map),(c))) #define joe_isspace(map,c) (joe_maputf(map) ? joe_iswspace(c) : \ ((c) == 32 || ((c) >= 9 && (c) <= 13))) #define joe_isalphx(map,c) (joe_maputf(map) ? joe_iswalpha(c) : \ byte_isalphx((map),(c))) #define joe_isalnux(map,c) (joe_maputf(map) ? joe_iswalnum(c) : \ byte_isalnux((map),(c))) int joe_isblank(int c); int joe_isspace_eof(union charmap *map, int c); /* Conversion functions */ #define joe_tolower(map,c) (joe_maputf(map) ? joe_towlower(c) : \ byte_tolower((map),(c))) #define joe_toupper(map,c) (joe_maputf(map) ? joe_towupper(c) : \ byte_toupper((map),(c))) #define joe_to_uni(map,c) (joe_maputf(map) ? (c) : \ (map)->byte.to_map[(c)]) #define joe_from_uni(map,c) (joe_maputf(map) ? (c) : \ byte_from_uni((map),(c))) unsigned char *joe_strtolower(unsigned char *s); /* Find (load if necessary) a character set */ union charmap *find_charmap(const unsigned char *name); /* Get available encodings */ unsigned char **get_encodings(void); int byte_from_uni(union charmap *, int); int byte_ispunct(union charmap *, int); int byte_isprint(union charmap *, int); int byte_isalphx(union charmap *, int); int byte_isalnux(union charmap *, int); int byte_tolower(union charmap *, int); int byte_toupper(union charmap *, int); #include "utf8.h" #endif jupp/cmd.c010064400000000000000000000415021323021431200076630ustar00/* * Command execution * Copyright * (C) 1992 Joseph H. Allen * * This file is part of JOE (Joe's Own Editor) */ #define EXTERN_CMD_C #include "config.h" #include "types.h" __RCSID("$MirOS: contrib/code/jupp/cmd.c,v 1.30 2018/01/18 21:59:11 tg Exp $"); #include #include #include "b.h" #include "bw.h" #include "cmd.h" #include "hash.h" #include "help.h" #include "kbd.h" #include "macro.h" #include "main.h" #include "menu.h" #include "path.h" #include "poshist.h" #include "pw.h" #include "rc.h" #include "tty.h" #include "tw.h" #include "ublock.h" #include "uedit.h" #include "uerror.h" #include "ufile.h" #include "uformat.h" #include "uisrch.h" #include "umath.h" #include "undo.h" #include "usearch.h" #include "ushell.h" #include "utag.h" #include "utils.h" #include "va.h" #include "vs.h" #include "utf8.h" #include "w.h" extern int marking; extern int smode; int dobeep = 0; int uexecmd(BW *bw); /* Command table */ static int ubeep(void) { ttputc(7); return 0; } extern char main_context[]; static int do_keymap(BW *bw, unsigned char *s, void *object, int *notify) { KMAP *new_kmap; if (notify) *notify = 1; if (!*s || !(new_kmap = kmap_getcontext(s, 0))) { vsrm(s); return (-1); } if (bw->o.context != (unsigned char *)main_context) free(bw->o.context); bw->o.context = strcmp((char *)s, main_context) ? (unsigned char *)strdup((char *)s) : (unsigned char *)main_context; rmkbd(bw->parent->kbd); bw->parent->kbd = mkkbd(new_kmap); joe_snprintf_1((char *)msgbuf, JOE_MSGBUFSIZE, "New keymap: %s", s); vsrm(s); msgnw(bw->parent, msgbuf); return (0); } static int ukeymap(BW *bw) { if (wmkpw(bw->parent, UC "Name of keymap to switch to: ", NULL, do_keymap, NULL, NULL, utypebw, NULL, NULL, locale_map)) { return (0); } return (-1); } static int unop(void) { return (0); } #if !WANT_FORK static int unommu(BW *bw) { msgnw(bw->parent, UC "Sorry, not supported without MMU"); return (-1); } #define ubknd unommu #define ubuild unommu #define urun unommu #endif #define C(name,flag,func,m,arg,negarg) { UC name, UC negarg, func, m, flag, arg } CMD cmds[] = { C("abendjoe", TYPETW + TYPEPW + TYPEMENU + TYPEQW, uabendjoe, NULL, 0, NULL), C("abort", TYPETW + TYPEPW + TYPEMENU + TYPEQW, uabort, NULL, 0, NULL), C("abortbuf", TYPETW, uabortbuf, NULL, 0, NULL), C("arg", TYPETW + TYPEPW + TYPEMENU + TYPEQW, uarg, NULL, 0, NULL), C("ask", TYPETW + TYPEPW, uask, NULL, 0, NULL), C("backs", TYPETW + TYPEPW + ECHKXCOL + EFIXXCOL + EMINOR + EKILL + EMOD, ubacks, NULL, 1, "delch"), C("backsmenu", TYPEMENU, umbacks, NULL, 1, NULL), C("backw", TYPETW + TYPEPW + ECHKXCOL + EFIXXCOL + EKILL + EMOD, ubackw, NULL, 1, "delw"), C("beep", TYPETW + TYPEPW + TYPEMENU + TYPEQW, ubeep, NULL, 0, NULL), C("begin_marking", TYPETW + TYPEPW, ubegin_marking, NULL, 0, NULL), C("bknd", TYPETW + TYPEPW, ubknd, NULL, 0, NULL), C("bkwdc", TYPETW + TYPEPW, ubkwdc, NULL, 1, "fwrdc"), C("blkcpy", TYPETW + TYPEPW + EFIXXCOL + EMOD + EBLOCK, ublkcpy, NULL, 1, NULL), C("blkdel", TYPETW + TYPEPW + EFIXXCOL + EKILL + EMOD + EBLOCK, ublkdel, NULL, 0, NULL), C("blkmove", TYPETW + TYPEPW + EFIXXCOL + EMOD + EBLOCK, ublkmove, NULL, 0, NULL), C("blksave", TYPETW + TYPEPW + EBLOCK, ublksave, NULL, 0, NULL), C("bof", TYPETW + TYPEPW + EMOVE + EFIXXCOL, u_goto_bof, NULL, 0, NULL), C("bofmenu", TYPEMENU, umbof, NULL, 0, NULL), C("bol", TYPETW + TYPEPW + EFIXXCOL, u_goto_bol, NULL, 0, NULL), C("bolmenu", TYPEMENU, umbol, NULL, 0, NULL), C("bop", TYPETW + TYPEPW + EFIXXCOL, ubop, NULL, 1, "eop"), C("bos", TYPETW + TYPEPW + EMOVE, ubos, NULL, 0, NULL), C("bufed", TYPETW, ubufed, NULL, 0, NULL), C("build", TYPETW + TYPEPW, ubuild, NULL, 0, NULL), C("byte", TYPETW + TYPEPW, ubyte, NULL, 0, NULL), C("cancel", TYPETW + TYPEPW + TYPEMENU + TYPEQW, ucancel, NULL, 0, NULL), C("center", TYPETW + TYPEPW + EFIXXCOL + EMOD, ucenter, NULL, 1, NULL), C("col", TYPETW + TYPEPW, ucol, NULL, 0, NULL), C("complete", TYPEPW + EMINOR + EMOD, ucmplt, NULL, 0, NULL), C("copy", TYPETW + TYPEPW, ucopy, NULL, 0, NULL), C("crawll", TYPETW + TYPEPW, ucrawll, NULL, 1, "crawlr"), C("crawlr", TYPETW + TYPEPW, ucrawlr, NULL, 1, "crawll"), C("ctrl", TYPETW + TYPEPW + EMOD, uctrl, NULL, 0, NULL), C("delbol", TYPETW + TYPEPW + EFIXXCOL + EKILL + EMOD, udelbl, NULL, 1, "deleol"), C("delch", TYPETW + TYPEPW + ECHKXCOL + EFIXXCOL + EMINOR + EKILL + EMOD, udelch, NULL, 1, "backs"), C("deleol", TYPETW + TYPEPW + EKILL + EMOD, udelel, NULL, 1, "delbol"), C("dellin", TYPETW + TYPEPW + EFIXXCOL + EKILL + EMOD, udelln, NULL, 1, NULL), C("delw", TYPETW + TYPEPW + EFIXXCOL + ECHKXCOL + EKILL + EMOD, u_word_delete, NULL, 1, "backw"), C("dnarw", TYPETW + TYPEPW + EMOVE, udnarw, NULL, 1, "uparw"), C("dnarwmenu", TYPEMENU, umdnarw, NULL, 1, "uparwmenu"), C("dnslide", TYPETW + TYPEPW + TYPEMENU + TYPEQW + EMOVE, udnslide, NULL, 1, "upslide"), C("drop", TYPETW + TYPEPW, udrop, NULL, 0, NULL), C("dupw", TYPETW, uduptw, NULL, 0, NULL), C("edit", TYPETW, uedit, NULL, 0, NULL), C("eof", TYPETW + TYPEPW + EFIXXCOL + EMOVE, u_goto_eof, NULL, 0, NULL), C("eofmenu", TYPEMENU, umeof, NULL, 0, NULL), C("eol", TYPETW + TYPEPW + EFIXXCOL, u_goto_eol, NULL, 0, NULL), C("eolmenu", TYPEMENU, umeol, NULL, 0, NULL), C("eop", TYPETW + TYPEPW + EFIXXCOL, ueop, NULL, 1, "bop"), C("execmd", TYPETW + TYPEPW, uexecmd, NULL, 0, NULL), C("explode", TYPETW + TYPEPW + TYPEMENU + TYPEQW, uexpld, NULL, 0, NULL), C("exsave", TYPETW + TYPEPW, uexsve, NULL, 0, NULL), C("ffirst", TYPETW + TYPEPW, pffirst, NULL, 0, NULL), C("filt", TYPETW + TYPEPW + EMOD + EBLOCK, ufilt, NULL, 0, NULL), C("finish", TYPETW + TYPEPW + EMOD, ufinish, NULL, 1, NULL), C("fmtblk", TYPETW + EMOD + EFIXXCOL + EBLOCK + ECHK0COL, ufmtblk, NULL, 1, NULL), C("fnext", TYPETW + TYPEPW, pfnext, NULL, 1, NULL), C("format", TYPETW + TYPEPW + EFIXXCOL + EMOD + ECHK0COL, uformat, NULL, 1, NULL), C("fwrdc", TYPETW + TYPEPW, ufwrdc, NULL, 1, "bkwdc"), C("gomark", TYPETW + TYPEPW + EMOVE, ugomark, NULL, 0, NULL), C("groww", TYPETW, ugroww, NULL, 1, "shrinkw"), C("help", TYPETW + TYPEPW + TYPEQW, u_help, NULL, 0, NULL), C("helpcard", TYPETW + TYPEPW + TYPEQW, u_helpcard, NULL, 0, NULL), C("hnext", TYPETW + TYPEPW + TYPEQW, u_help_next, NULL, 0, NULL), C("home", TYPETW + TYPEPW + EFIXXCOL, uhome, NULL, 0, NULL), C("hprev", TYPETW + TYPEPW + TYPEQW, u_help_prev, NULL, 0, NULL), C("insc", TYPETW + TYPEPW + EFIXXCOL + EMOD, uinsc, NULL, 1, "delch"), C("insf", TYPETW + TYPEPW + EMOD, uinsf, NULL, 0, NULL), C("isrch", TYPETW + TYPEPW, uisrch, NULL, 0, NULL), C("keymap", TYPETW + TYPEPW, ukeymap, NULL, 0, NULL), C("killjoe", TYPETW + TYPEPW + TYPEMENU + TYPEQW, ukilljoe, NULL, 0, NULL), C("killproc", TYPETW + TYPEPW, ukillpid, NULL, 0, NULL), C("lindent", TYPETW + TYPEPW + EFIXXCOL + EMOD + EBLOCK, ulindent, NULL, 1, "rindent"), C("line", TYPETW + TYPEPW, uline, NULL, 0, NULL), C("lose", TYPETW + TYPEPW, ulose, NULL, 0, NULL), C("lower", TYPETW + TYPEPW + EMOD + EBLOCK, ulower, NULL, 0, NULL), C("ltarw", TYPETW + TYPEPW /* + EFIXXCOL + ECHKXCOL */, u_goto_left, NULL, 1, "rtarw"), C("ltarwmenu", TYPEMENU, umltarw, NULL, 1, "rtarwmenu"), C("macros", TYPETW + EFIXXCOL, umacros, NULL, 0, NULL), C("markb", TYPETW + TYPEPW, umarkb, NULL, 0, NULL), C("markk", TYPETW + TYPEPW, umarkk, NULL, 0, NULL), C("markl", TYPETW + TYPEPW, umarkl, NULL, 0, NULL), C("math", TYPETW + TYPEPW, umath, NULL, 0, NULL), C("mathins", TYPETW + TYPEPW, umathins, NULL, 0, NULL), C("mathres", TYPETW + TYPEPW, umathres, NULL, 0, NULL), C("mode", TYPETW + TYPEPW + TYPEQW, umode, NULL, 0, NULL), C("msg", TYPETW + TYPEPW + TYPEQW + TYPEMENU, umsg, NULL, 0, NULL), C("nbuf", TYPETW, unbuf, NULL, 1, "pbuf"), C("nedge", TYPETW + TYPEPW + EFIXXCOL, unedge, NULL, 1, "pedge"), C("nextpos", TYPETW + TYPEPW + EFIXXCOL + EMID + EPOS, unextpos, NULL, 1, "prevpos"), C("nextw", TYPETW + TYPEPW + TYPEMENU + TYPEQW, unextw, NULL, 1, "prevw"), C("nextword", TYPETW + TYPEPW + EFIXXCOL, u_goto_next, NULL, 1, "prevword"), C("nmark", TYPETW + TYPEPW, unmark, NULL, 0, NULL), C("nop", TYPETW + TYPEPW + TYPEMENU + TYPEQW, unop, NULL, 0, NULL), C("notmod", TYPETW, unotmod, NULL, 0, NULL), C("nxterr", TYPETW, unxterr, NULL, 1, "prverr"), C("open", TYPETW + TYPEPW + EFIXXCOL + EMOD, uopen, NULL, 1, "deleol"), C("parserr", TYPETW, uparserr, NULL, 0, NULL), C("pbuf", TYPETW, upbuf, NULL, 1, "nbuf"), C("pedge", TYPETW + TYPEPW + EFIXXCOL, upedge, NULL, 1, "nedge"), C("pgdn", TYPETW + TYPEPW + TYPEMENU + TYPEQW + EMOVE, upgdn, NULL, 1, "pgup"), C("pgdnmenu", TYPEMENU, umpgdn, NULL, 1, "pgupmenu"), C("pgup", TYPETW + TYPEPW + TYPEMENU + TYPEQW + EMOVE, upgup, NULL, 1, "pgdn"), C("pgupmenu", TYPEMENU, umpgup, NULL, 1, "pgdnmenu"), C("picokill", TYPETW + TYPEPW + EFIXXCOL + EKILL + EMOD, upicokill, NULL, 1, NULL), C("play", TYPETW + TYPEPW + TYPEMENU + TYPEQW, uplay, NULL, 1, NULL), /* EFIXX? */ C("pop", TYPETW + TYPEPW + TYPEMENU + TYPEQW, upop, NULL, 0, NULL), C("prevpos", TYPETW + TYPEPW + EPOS + EMID + EFIXXCOL, uprevpos, NULL, 1, "nextpos"), C("prevw", TYPETW + TYPEPW + TYPEMENU + TYPEQW, uprevw, NULL, 1, "nextw"), C("prevword", TYPETW + TYPEPW + EFIXXCOL + ECHKXCOL, u_goto_prev, NULL, 1, "nextword"), C("prverr", TYPETW, uprverr, NULL, 1, "nxterr"), C("psh", TYPETW + TYPEPW + TYPEMENU + TYPEQW, upsh, NULL, 0, NULL), C("qrepl", TYPETW + TYPEPW + EMOD, pqrepl, NULL, 0, NULL), C("query", TYPETW + TYPEPW + TYPEMENU + TYPEQW, uquery, NULL, 0, NULL), C("querysave", TYPETW, uquerysave, NULL, 0, NULL), C("quote", TYPETW + TYPEPW + EMOD, uquote, NULL, 0, NULL), C("quote8", TYPETW + TYPEPW + EMOD, uquote8, NULL, 0, NULL), C("record", TYPETW + TYPEPW + TYPEMENU + TYPEQW, urecord, NULL, 0, NULL), C("redo", TYPETW + TYPEPW + EFIXXCOL, uredo, NULL, 1, "undo"), C("retype", TYPETW + TYPEPW + TYPEMENU + TYPEQW + ECHK0COL, uretyp, NULL, 0, NULL), C("rfirst", TYPETW + TYPEPW, prfirst, NULL, 0, NULL), C("rindent", TYPETW + TYPEPW + EFIXXCOL + EMOD + EBLOCK, urindent, NULL, 1, "lindent"), C("rsrch", TYPETW + TYPEPW, ursrch, NULL, 0, NULL), C("rtarw", TYPETW + TYPEPW /* + EFIXXCOL */, u_goto_right, NULL, 1, "ltarw"), /* EFIX removed for picture mode */ C("rtarwmenu", TYPEMENU, umrtarw, NULL, 1, "ltarwmenu"), C("rtn", TYPETW + TYPEPW + TYPEMENU + TYPEQW + EMOD, urtn, NULL, 1, NULL), C("run", TYPETW + TYPEPW, urun, NULL, 0, NULL), C("rvmatch", TYPETW + TYPEPW + EFIXXCOL, urvmatch, NULL, 0, NULL), C("save", TYPETW, usave, NULL, 0, NULL), C("scratch", TYPETW + TYPEPW, uscratch, NULL, 0, NULL), C("select", TYPETW + TYPEPW, uselect, NULL, 0, NULL), C("setmark", TYPETW + TYPEPW, usetmark, NULL, 0, NULL), C("shell", TYPETW + TYPEPW + TYPEMENU + TYPEQW, ushell, NULL, 0, NULL), C("shrinkw", TYPETW, ushrnk, NULL, 1, "groww"), C("splitw", TYPETW, usplitw, NULL, 0, NULL), C("stat", TYPETW + TYPEPW, ustat_j, NULL, 0, NULL), C("stop", TYPETW + TYPEPW + TYPEMENU + TYPEQW, ustop, NULL, 0, NULL), C("sync", TYPETW + TYPEPW + TYPEMENU + TYPEQW, usync, NULL, 0, NULL), C("swap", TYPETW + TYPEPW + EFIXXCOL, uswap, NULL, 0, NULL), C("switch", TYPETW + TYPEPW, uswitch, NULL, 0, NULL), C("tabmenu", TYPEMENU, umtab, NULL, 1, "ltarwmenu"), C("tag", TYPETW + TYPEPW, utag, NULL, 0, NULL), C("toggle_marking", TYPETW + TYPEPW, utoggle_marking, NULL, 0, NULL), C("tomarkb", TYPETW + TYPEPW + EFIXXCOL + EBLOCK, utomarkb, NULL, 0, NULL), C("tomarkbk", TYPETW + TYPEPW + EFIXXCOL + EBLOCK, utomarkbk, NULL, 0, NULL), C("tomarkk", TYPETW + TYPEPW + EFIXXCOL + EBLOCK, utomarkk, NULL, 0, NULL), C("tomatch", TYPETW + TYPEPW + EFIXXCOL, utomatch, NULL, 0, NULL), C("tos", TYPETW + TYPEPW + EMOVE, utos, NULL, 0, NULL), C("tw0", TYPETW + TYPEPW + TYPEQW + TYPEMENU, utw0, NULL, 0, NULL), C("tw1", TYPETW + TYPEPW + TYPEQW + TYPEMENU, utw1, NULL, 0, NULL), C("txt", TYPETW + TYPEPW, utxt, NULL, 0, NULL), C("type", TYPETW + TYPEPW + TYPEQW + TYPEMENU + EMINOR + EMOD, utype, NULL, 1, "backs"), C("uarg", TYPETW + TYPEPW + TYPEMENU + TYPEQW, uuarg, NULL, 0, NULL), C("undo", TYPETW + TYPEPW + EFIXXCOL, uundo, NULL, 1, "redo"), C("uparw", TYPETW + TYPEPW + EMOVE, uuparw, NULL, 1, "dnarw"), C("uparwmenu", TYPEMENU, umuparw, NULL, 1, "dnarwmenu"), C("upper", TYPETW + TYPEPW + EMOD + EBLOCK, uupper, NULL, 0, NULL), C("upslide", TYPETW + TYPEPW + TYPEMENU + TYPEQW + EMOVE, uupslide, NULL, 1, "dnslide"), C("yank", TYPETW + TYPEPW + EFIXXCOL + EMOD, uyank, NULL, 1, NULL), C("yankpop", TYPETW + TYPEPW + EFIXXCOL + EMOD, uyankpop, NULL, 1, NULL), C("yapp", TYPETW + TYPEPW + EKILL, uyapp, NULL, 0, NULL) }; /* Execute a command n with key k */ int execmd(CMD *cmd, int k) { BW *bw = maint->curwin->object.bw; int ret = -1; /* Send data to shell window: this is broken ^K ^H (help) sends its ^H to shell */ if ((maint->curwin->watom->what & TYPETW) && bw->b->pid && piseof(bw->cursor) && (k==3 || k==13 || k==8 || k==127 || k==4 || ((cmd->func==utype) && (k>=32) && (k<256)))) { unsigned char c = k; joe_write(bw->b->out, &c, 1); return 0; } if (cmd->m) return exmacro(cmd->m, 0); /* We don't execute if we have to fix the column position first * (i.e., left arrow when cursor is in middle of nowhere) */ if (cmd->flag & ECHKXCOL) { if (bw->o.hex) bw->cursor->xcol = piscol(bw->cursor); else if (bw->cursor->xcol != piscol(bw->cursor)) goto skip; } /* Don't execute command if we're in wrong type of window */ if (!(cmd->flag & maint->curwin->watom->what)) goto skip; /* Complete selection for block commands */ if ((cmd->flag & EBLOCK) && marking) utoggle_marking(maint->curwin->object.bw); if ((maint->curwin->watom->what & TYPETW) && bw->b->rdonly && (cmd->flag & EMOD)) { msgnw(bw->parent, UC "Read only"); if (dobeep) ttputc(7); goto skip; } /* Execute command */ ret = cmd->func(maint->curwin->object, k); if (smode) --smode; /* Don't update anything if we're going to leave */ if (leave) return 0; /* cmd->func could have changed bw on us */ bw = maint->curwin->object.bw; /* Maintain position history */ /* If command was not a positioning command */ if (!(cmd->flag & EPOS) && (maint->curwin->watom->what & (TYPETW | TYPEPW))) afterpos(); /* If command was not a movement */ if (!(cmd->flag & (EMOVE | EPOS)) && (maint->curwin->watom->what & (TYPETW | TYPEPW))) aftermove(maint->curwin, bw->cursor); if (cmd->flag & EKILL) justkilled = 1; else justkilled = 0; skip: /* scroll screen to the left */ if ((cmd->flag & ECHK0COL) && bw->offset != 0) { bw->offset = 0; updall(); } /* * Make displayed cursor column equal the actual cursor column * for commands which aren't simple vertical movements */ if (cmd->flag & EFIXXCOL) bw->cursor->xcol = piscol(bw->cursor); /* Recenter cursor to middle of screen */ if (cmd->flag & EMID) { int omid = mid; mid = 1; dofollows(); mid = omid; } if (dobeep && ret) ttputc(7); return ret; } /* Return command table index for given command name */ HASH *cmdhash = NULL; static void izcmds(void) { int x; cmdhash = htmk(256); for (x = 0; x != sizeof(cmds) / sizeof(CMD); ++x) htadd(cmdhash, cmds[x].name, cmds + x); } CMD *findcmd(const unsigned char *s) { if (!cmdhash) izcmds(); return (CMD *) htfind(cmdhash, s); } void addcmd(const unsigned char *s, MACRO *m) { CMD *cmd = malloc(sizeof(CMD)); if (!cmdhash) izcmds(); cmd->name = (unsigned char *)strdup((const char *)s); cmd->flag = 0; cmd->func = NULL; cmd->m = m; cmd->arg = 1; cmd->negarg = NULL; htadd(cmdhash, cmd->name, cmd); } static unsigned char **getcmds(void) { unsigned char **s = vaensure(NULL, sizeof(cmds) / sizeof(CMD)); int x; HENTRY *e; for (x = 0; x != cmdhash->len; ++x) for (e = cmdhash->tab[x]; e; e = e->next) s = vaadd(s, vsncpy(NULL, 0, sz(e->name))); vasort(s, aLen(s)); return s; } /* Command line */ unsigned char **scmds = NULL; /* Array of command names */ static int cmdcmplt(BW *bw) { if (!scmds) scmds = getcmds(); /*XXX simple_cmplt does p_goto_bol, better only to last comma */ return simple_cmplt(bw, scmds); } static int docmd(BW *bw, unsigned char *s, void *object, int *notify) { MACRO *mac; int ret = -1; if (s) { mac = mparse(NULL, s, &ret); if (ret < 0 || !mac) msgnw(bw->parent, UC "No such command"); else { ret = exmacro(mac, 1); rmmacro(mac); } } vsrm(s); /* allocated in pw.c::rtnpw() */ if (notify) *notify = 1; return ret; } B *cmdhist = NULL; int uexecmd(BW *bw) { if (wmkpw(bw->parent, UC "cmd: ", &cmdhist, docmd, UC "cmd", NULL, cmdcmplt, NULL, NULL, locale_map)) { return 0; } else { return -1; } } /* * Show help screen at a specific card */ static int do_helpcard(BASE *base, unsigned char *s, void *object, int *notify) { struct help *new_help; if (notify) *notify = 1; if (!*s) { vsrm(s); while (help_actual->prev != NULL) /* find the first help entry */ help_actual = help_actual->prev; help_off(base->parent->t); return (0); } if ((new_help = find_context_help(s)) != NULL) { vsrm(s); help_actual = new_help; return (help_on(base->parent->t)); } vsrm(s); return (-1); } int u_helpcard(BASE *base) { if (wmkpw(base->parent, UC "Name of help card to show: ", NULL, do_helpcard, NULL, NULL, utypebw, NULL, NULL, locale_map)) { return (0); } return (-1); } jupp/cmd.h010064400000000000000000000023431363731763300077150ustar00/* * Command execution * Copyright * (C) 1992 Joseph H. Allen * * This file is part of JOE (Joe's Own Editor) */ #ifndef JUPP_CMD_H #define JUPP_CMD_H #ifdef EXTERN_CMD_C __IDSTRING(rcsid_cmd_h, "$MirOS: contrib/code/jupp/cmd.h,v 1.10 2020/03/27 06:38:56 tg Exp $"); #endif extern CMD cmds[]; /* Built-in commands */ extern int dobeep; /* Command execution flags */ #define EMID 1 /* Recenter screen */ #define ECHKXCOL 2 /* Don't execute command if cursor column is wrong */ #define EFIXXCOL 4 /* Fix column position after command has executed */ #define EMINOR 8 /* Full screen update not needed */ #define EPOS 16 /* A position history command */ #define EMOVE 32 /* A movement for position history purposes */ #define EKILL 64 /* Function is a kill */ #define EMOD 128 /* Not allowed on readonly files */ /* These use same bits as TYPE* in types.h */ #define EBLOCK 0x4000 /* Finish block selection */ #define ECHK0COL 0x8000 /* Reposition screen from leftmost */ /* CMD *findcmd(char *s); * Return command address for given name */ CMD *findcmd(const unsigned char *s); void addcmd(const unsigned char *s, MACRO *m); /* Execute a command. Returns return value of command */ int execmd(CMD *cmd, int k); #endif jupp/compat.c010064400000000000000000000263621430552046400104260ustar00/*- * Copyright © 2004, 2005, 2006, 2007, 2009, 2010, 2011, 2012, * 2013, 2014, 2016, 2017, 2018, 2022 * mirabilos * * Provided that these terms and disclaimer and all copyright notices * are retained or reproduced in an accompanying document, permission * is granted to deal in this work without restriction, including un†* limited rights to use, publicly perform, distribute, sell, modify, * merge, give away, or sublicence. * * This work is provided “AS IS” and WITHOUT WARRANTY of any kind, to * the utmost extent permitted by applicable law, neither express nor * implied; without malicious intent or gross negligence. In no event * may a licensor, author or contributor be held liable for indirect, * direct, other damage, loss, or other issues arising in any way out * of dealing in the work, even if advised of the possibility of such * damage or existence of a defect, except proven that it results out * of said person’s immediate fault when using the work as intended. *- * Compatibility and fully new utility functions for jupp. * * - jalloc: based on lalloc.c,v 1.26 from mksh * – ctime: based on mirtime from MirBSD libc; not leap second capable * src/kern/include/mirtime.h,v 1.2 2011/11/20 23:40:11 tg Exp * src/kern/c/mirtime.c,v 1.3 2011/11/20 23:40:10 tg Exp * – strlcpy, strlcat: pulled in via "strlfun.inc" * – popen, pclose: pulled in via "popen.inc" * - ustoc_{hex,oct}, ustol: parse integers */ #include "config.h" #include "types.h" __RCSID("$MirOS: contrib/code/jupp/compat.c,v 1.12 2022/09/06 01:23:37 tg Exp $"); #include #include #include #ifdef MKSH_ALLOC_CATCH_UNDERRUNS #include #include #endif #include "tty.h" #include "utils.h" /* jalloc */ #define malloc_osi(sz) malloc(sz) #define realloc_osi(p,sz) realloc((p), (sz)) #define free_osimalloc(p) free(p) #ifndef DEBUG #define Sabrt void #else #define Sabrt const char *emsg #endif static void abrt_do(Sabrt) __attribute__((__noreturn__)); static void abrt_do(Sabrt) { #ifdef DEBUG fputs(emsg, stderr); #endif #ifdef TEST write(2, "memory allocation error\n", 24); #else ttabrt(0, "memory allocation error"); #endif /* try to get a coredump */ abort(); } #ifndef DEBUG #define abrt(x) abrt_do() #else #define abrt(x) abrt_do(x) #endif /* build with CPPFLAGS+= -DUSE_REALLOC_MALLOC=0 on ancient systems */ #if defined(USE_REALLOC_MALLOC) && (USE_REALLOC_MALLOC == 0) #define remalloc(p,n) ((p) == NULL ? malloc_osi(n) : realloc_osi((p), (n))) #else #define remalloc(p,n) realloc_osi((p), (n)) #endif #ifndef MKSH_ALLOC_CATCH_UNDERRUNS #define ALLOC_ISUNALIGNED(p) (((size_t)(p)) % sizeof(struct jalloc_common)) #else #define ALLOC_ISUNALIGNED(p) (((size_t)(p)) & 4095) #undef remalloc #undef free_osimalloc static void free_osimalloc(void *ptr) { struct jalloc_item *lp = ptr; if (munmap(lp, lp->len)) abrt("free_osimalloc"); } static void * remalloc(void *ptr, size_t size) { struct jalloc_item *lp, *lold = ptr; size = (size + 4095) & ~(size_t)4095; if (lold && lold->len >= size) return (ptr); if ((lp = mmap(NULL, size, PROT_READ | PROT_WRITE, MAP_ANON | MAP_PRIVATE, -1, (off_t)0)) == MAP_FAILED) abrt("remalloc: mmap"); if (ALLOC_ISUNALIGNED(lp)) abrt("remalloc: unaligned"); if (mprotect(((char *)lp) + 4096, 4096, PROT_NONE)) abrt("remalloc: mprotect"); lp->len = size; if (lold) { memcpy(((char *)lp) + 8192, ((char *)lold) + 8192, lold->len - 8192); if (munmap(lold, lold->len)) abrt("remalloc: munmap"); } return (lp); } #endif void jalloc_init(void) { #ifdef MKSH_ALLOC_CATCH_UNDERRUNS long pgsz; if ((pgsz = sysconf(_SC_PAGESIZE)) != 4096) errx(1, "fatal: pagesize %lu not 4096!", pgsz); #endif } void * jalloc(void *ptr, size_t nmemb, size_t siz) { ALLOC_ITEM *lp; size_t usiz; if (notoktomul(nmemb, siz)) abrt("jalloc nmemb*siz"); usiz = nmemb * siz; if (notoktoadd(usiz, siz)) abrt("jalloc usiz + terminator"); usiz += siz; if (notoktoadd(usiz, sizeof(ALLOC_ITEM))) abrt("jalloc usiz + header"); if (ptr) { #ifdef DEBUG if (ALLOC_ISUNALIGNED(ptr)) abrt("jalloc realloc unaligned"); #endif lp = jalloc_krnl(ptr); } else lp = NULL; if ((lp = remalloc(lp, usiz + sizeof(ALLOC_ITEM))) == NULL) abrt("jalloc remalloc failed"); #ifdef DEBUG if (ALLOC_ISUNALIGNED(lp)) abrt("jalloc remalloc unaligned"); #endif if (!ptr) lp->ALLOC_INFO(elen) = 0; lp->ALLOC_INFO(esiz) = nmemb; return (jalloc_user(lp)); } void jfree(void *ptr) { ALLOC_ITEM *lp; if (ptr != NULL) { #ifdef DEBUG if (ALLOC_ISUNALIGNED(ptr)) abrt("jalloc free unaligned"); #endif lp = jalloc_krnl(ptr); free_osimalloc(lp); } } /* strlcpy/strlcat */ #undef L_strlcat #undef L_strlcpy #ifndef HAVE_STRLCAT #define L_strlcat #endif #ifndef HAVE_STRLCPY #define L_strlcpy #endif #if defined(L_strlcat) || defined(L_strlcpy) #undef __RCSID #define __RCSID(x) __IDSTRING(rcsid_strlfun_inc,x) #define OUTSIDE_OF_LIBKERN #include "strlfun.inc" #endif /* ctime */ #ifndef HAVE_CTIME #ifdef TIME_WITH_SYS_TIME # include # include #else # ifdef HAVE_SYS_TIME_H # include # else # include # endif #endif typedef struct { int tm_sec; /* seconds [0-60] */ int tm_min; /* minutes [0-59] */ int tm_hour; /* hours [0-23] */ int tm_mday; /* day of month [1-31] */ int tm_mon; /* month of year - 1 [0-11] */ int tm_year; /* year - 1900 */ int tm_wday; /* day of week (0 = sunday) */ } joe_tm; static void joe_timet2tm(joe_tm *, const time_t *); #if !HAVE_DECL_CTIME char *ctime(const time_t *); #endif /* 302 / 1000 is log10(2.0) rounded up */ #define T_SIGNED(t) (((t)-1) < 0) #define T_MAXLEN(t) ((sizeof(t) * CHAR_BIT - T_SIGNED(t)) * 302 / 1000 + \ /* div.trunc. */ 1 + /* minus sign */ T_SIGNED(t)) static const char joe_days[7][4] = { "Sun", "Mon", "Tue", "Wed", "Thu", "Fri", "Sat" }; static const char joe_months[12][4] = { "Jan", "Feb", "Mar", "Apr", "May", "Jun", "Jul", "Aug", "Sep", "Oct", "Nov", "Dec" }; /*- * Dimensions for the buffer, example formats: * "Sun Jan 1 12:34:56 1234\n" * "Sat Dec 31 12:34:56 12345\n" * <- 24 -----------------> + max.length of a year + NL + NUL */ static char joe_ctime_buf[24 + T_MAXLEN(time_t) + 2]; char * ctime(const time_t *tp) { int year; joe_tm tm; joe_timet2tm(&tm, tp); year = (int)(tm.tm_year + 1900); joe_snprintf_7(joe_ctime_buf, sizeof(joe_ctime_buf), (year >= -999 && year <= 9999) ? "%s %s %2d %02d:%02d:%02d %04d\n" : "%s %s %2d %02d:%02d:%02d %d\n", joe_days[tm.tm_wday], joe_months[tm.tm_mon], tm.tm_mday, tm.tm_hour, tm.tm_min, tm.tm_sec, year); return (joe_ctime_buf); } static void joe_timet2tm(joe_tm *tm, const time_t *tp) { int sec, day, mon; time_t y; /* convert to MJD */ y = *tp; sec = (int)(y % 86400); y /= 86400; y += 40587; while (sec < 0) { --y; sec += 86400; } /* calculate 400-year cycle (y) and offset in it (day) */ day = (int)(y % 146097); y /= 146097; /* add bias: 678881 = days between "convenient origin" and MJD 0 */ /* convenient origin is Wed(3) 1 March 0(fictional)/-1(real) */ day += 678881; /* recalculate offset in cycle (Gregorian Period) */ y += day / 146097; day %= 146097; /* days in 400 years are cyclic, they have 20871 weeks */ tm->tm_wday = (day + 3) % 7; /* calculate year from period, taking leap years into account */ y *= 4; /* a long (Julian) century is at the end of each Gregorian Period */ if (day == 146096) { y += 3; day = 36524; } else { y += day / 36524; day %= 36524; } y *= 25; y += day / 1461; day %= 1461; y *= 4; /* March to December, or January/February? */ /* a leap year is at the end of each olympiad */ if (day == 1460) { y += 3; day = 365; } else { y += day / 365; day %= 365; } /* count days and months from 1st March using fixed-point */ day *= 10; mon = (day + 5) / 306; day = (day + 5) % 306; day /= 10; /* adjust for Jan/Feb offset */ if (mon >= 10) { mon -= 10; ++y; } else { mon += 2; } /* adjust for year 0(fictional) which did not exist */ if (y < 1) --y; /* fill in the values still missing */ tm->tm_sec = sec % 60; sec /= 60; tm->tm_min = sec % 60; tm->tm_hour = sec / 60; tm->tm_mday = day + 1; tm->tm_mon = mon; /*XXX truncate, for joe_snprintf doesn't know %lld portably */ tm->tm_year = (int)(y - 1900); } #endif /* ndef HAVE_CTIME */ /* popen */ #ifndef HAVE_POPEN #undef __RCSID #define __RCSID(x) __IDSTRING(rcsid_popen_inc,x) #include "popen.inc" #endif /* utility stuff */ size_t ustoc_hex(const void *us, int *dp, size_t lim) { unsigned char c; const unsigned char *s = (const unsigned char *)us; int rv = 0, rounds = 0; while (rounds++ < 2 && lim-- > 0) if ((c = *s++) >= '0' && c <= '9') rv = (rv << 4) | (c & 15); else if ((c |= 0x20) >= 'a' && c <= 'f') rv = (rv << 4) | (c - 'a' + 10); else { --s; break; } *dp = rv; return (s - (const unsigned char *)us); } size_t ustoc_oct(const void *us, int *dp, size_t lim) { unsigned char c; const unsigned char *s = (const unsigned char *)us; int rv = 0, rounds = 0; while (rounds++ < 3 && lim-- > 0) if ((c = *s++) >= '0' && c <= '7') rv = (rv << 3) | (c & 7); else { --s; break; } *dp = rv; return (s - (const unsigned char *)us); } #define USTOL_MODEMASK 0x03 static const char ustol_wsp[] = "\t\x0B\x0C\r "; long ustol(void *us, void **dpp, int flags) { unsigned char c, *s = (unsigned char *)us; unsigned long a = 0; unsigned char *sp; unsigned char neg = 0; if (flags & USTOL_LTRIM) while ((c = *s) && strchr(ustol_wsp, c)) ++s; switch (flags & USTOL_MODEMASK) { case USTOL_HEX: if (s[0] == '0' && (s[1] | 0x20) == 'x') s += 2; break; case USTOL_AUTO: if (s[0] != '0') flags |= USTOL_DEC; else if ((s[1] | 0x20) != 'x') flags |= USTOL_OCT; else { flags |= USTOL_HEX; s += 2; } break; } sp = s; switch (flags & USTOL_MODEMASK) { case USTOL_OCT: while ((c = *s++) >= '0' && c <= '7') { /* overflow check */ if (a > (ULONG_MAX >> 3)) goto err; /* accumulate trivially */ a = (a << 3) | (c & 7); } break; case USTOL_HEX: while ((c = *s++) >= '0') { if (c <= '9') c &= 15; else if ((c |= 0x20) >= 'a' && c <= 'f') c = c - 'a' + 10; else break; /* overflow check */ if (a > (ULONG_MAX >> 4)) goto err; /* accumulate trivially */ a = (a << 4) | c; } break; default: switch (*s) { case '-': neg = 1; /* FALLTHROUGH */ case '+': sp = ++s; } while ((c = *s++) >= '0' && c <= '9') { c &= 15; if (a > (ULONG_MAX / 10)) goto err; a *= 10; if (a > (ULONG_MAX - c)) goto err; a += c; } if (neg) { if (a > (((unsigned long)(-(LONG_MIN + 1L))) + 1UL)) goto err; a = -a; } else if (a > (unsigned long)LONG_MAX) goto err; } /* check we had at least one digit */ if (--s == sp) goto err; if (flags & USTOL_RTRIM) while ((c = *s) && strchr(ustol_wsp, c)) ++s; /* don’t check for EOS, or arrived at EOS */ if (!(flags & USTOL_EOS) || !*s) goto out; err: s = NULL; a = 0; out: if (dpp) *dpp = (void *)s; return ((long)a); } long ustolb(void *us, void **dpp, long lower, long upper, int flags) { void *dp; long rv; rv = ustol(us, &dp, flags); if (dp != NULL && (rv < lower || rv > upper)) { dp = NULL; rv = 0; } if (dpp) *dpp = dp; return (rv); } jupp/config.guess010064400000000000000000001311471353422525500113150ustar00#! /bin/sh # $MirOS: contrib/code/jupp/config.guess,v 1.9 2019/09/05 15:32:34 tg Exp $ # $miros: contrib/gnu/config/config.guess,v 1.19 2019/09/05 15:26:05 tg Exp $ #- # Attempt to guess a canonical system name. # Copyright (C) 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999, # 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010, # 2011, 2012, 2013 Free Software Foundation, Inc. # Copyright © 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2013, 2019 # mirabilos # Maintenance, due to licence changes upstream, no longer is with FSF. timestamp='2019-09-05 (MirOS, GNU 2012-12-23)' # This file is free software; you can redistribute it and/or modify it # under the terms of the GNU General Public License as published by # the Free Software Foundation; either version 2 of the License, or # (at your option) any later version. # # This program is distributed in the hope that it will be useful, but # WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU # General Public License for more details. # # You should have received a copy of the GNU General Public License # along with this program; if not, see . # # As a special exception to the GNU General Public License, if you # distribute this file as part of a program that contains a # configuration script generated by Autoconf, you may include it under # the same distribution terms that you use for the rest of that program. # Originally written by Per Bothner. Please send patches (context # diff format) to and include a ChangeLog # entry. # # This script attempts to guess a canonical system name similar to # config.sub. If it succeeds, it prints the system name on stdout, and # exits with 0. Otherwise, it exits with 1. # # You can get the latest version of this script from: # http://git.savannah.gnu.org/gitweb/?p=config.git;a=blob_plain;f=config.guess;hb=HEAD me=`echo "$0" | sed -e 's,.*/,,'` usage="\ Usage: $0 [OPTION] Output the configuration name of the system \`$me' is run on. Operation modes: -h, --help print this help, then exit -t, --time-stamp print date of last modification, then exit -v, --version print version number, then exit Report bugs and patches to ." version="\ GNU config.guess ($timestamp) Originally written by Per Bothner. Copyright (C) 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011, 2012, 2013 Free Software Foundation, Inc. This is free software; see the source for copying conditions. There is NO warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE." help=" Try \`$me --help' for more information." # Parse command line while test $# -gt 0 ; do case $1 in --time-stamp | --time* | -t ) echo "$timestamp" ; exit ;; --version | -v ) echo "$version" ; exit ;; --help | --h* | -h ) echo "$usage"; exit ;; -- ) # Stop option processing shift; break ;; - ) # Use stdin as input. break ;; -* ) echo "$me: invalid option $1$help" >&2 exit 1 ;; * ) break ;; esac done if test $# != 0; then echo "$me: too many arguments$help" >&2 exit 1 fi trap 'exit 1' 1 2 15 # CC_FOR_BUILD -- compiler used by this script. Note that the use of a # compiler to aid in system detection is discouraged as it requires # temporary files to be created and, as you can see below, it is a # headache to deal with in a portable fashion. # Historically, `CC_FOR_BUILD' used to be named `HOST_CC'. We still # use `HOST_CC' if defined, but it is deprecated. # Portable tmp directory creation inspired by the Autoconf team. set_cc_for_build=' trap "exitcode=\$?; (rm -f \$tmpfiles 2>/dev/null; rmdir \$tmp 2>/dev/null) && exit \$exitcode" 0 ; trap "rm -f \$tmpfiles 2>/dev/null; rmdir \$tmp 2>/dev/null; exit 1" 1 2 13 15 ; : ${TMPDIR=/tmp} ; { tmp=`(umask 077 && mktemp -d "$TMPDIR/cgXXXXXXXXXX") 2>/dev/null` && test -n "$tmp" && test -d "$tmp" ; } || { test -n "$RANDOM" && tmp=$TMPDIR/cg$$-$RANDOM && (umask 077 && mkdir $tmp) ; } || { tmp=$TMPDIR/cg-$$ && (umask 077 && mkdir $tmp) && echo "Warning: creating insecure temp directory" >&2 ; } || { echo "$me: cannot create a temporary directory in $TMPDIR" >&2 ; exit 1 ; } ; dummy=$tmp/dummy ; tmpfiles="$dummy.c $dummy.o $dummy.rel $dummy" ; case $CC_FOR_BUILD,$HOST_CC,$CC in ,,) echo "int x;" > $dummy.c ; for c in cc gcc c89 c99 ; do if ($c -c -o $dummy.o $dummy.c) >/dev/null 2>&1 ; then CC_FOR_BUILD="$c"; break ; fi ; done ; if test x"$CC_FOR_BUILD" = x ; then CC_FOR_BUILD=no_compiler_found ; fi ;; ,,*) CC_FOR_BUILD=$CC ;; ,*,*) CC_FOR_BUILD=$HOST_CC ;; esac ; set_cc_for_build= ;' # This is needed to find uname on a Pyramid OSx when run in the BSD universe. # (ghazi@noc.rutgers.edu 1994-08-24) if (test -f /.attbin/uname) >/dev/null 2>&1 ; then PATH=$PATH:/.attbin ; export PATH fi UNAME_MACHINE=`(uname -m) 2>/dev/null` || UNAME_MACHINE=unknown UNAME_RELEASE=`(uname -r) 2>/dev/null` || UNAME_RELEASE=unknown UNAME_SYSTEM=`(uname -s) 2>/dev/null` || UNAME_SYSTEM=unknown UNAME_VERSION=`(uname -v) 2>/dev/null` || UNAME_VERSION=unknown # Note: order is significant - the case branches are not exclusive. case "${UNAME_MACHINE}:${UNAME_SYSTEM}:${UNAME_RELEASE}:${UNAME_VERSION}" in *:NetBSD:*:*) # NetBSD (nbsd) targets should (where applicable) match one or # more of the tuples: *-*-netbsdelf*, *-*-netbsdaout*, # *-*-netbsdecoff* and *-*-netbsd*. For targets that recently # switched to ELF, *-*-netbsd* would select the old # object file format. This provides both forward # compatibility and a consistent mechanism for selecting the # object file format. # # Note: NetBSD doesn't particularly care about the vendor # portion of the name. We always set it to "unknown". sysctl="sysctl -n hw.machine_arch" UNAME_MACHINE_ARCH=`(/sbin/$sysctl 2>/dev/null || \ /usr/sbin/$sysctl 2>/dev/null || echo unknown)` case "${UNAME_MACHINE_ARCH}" in armeb) machine=armeb-unknown ;; arm*) machine=arm-unknown ;; sh3el) machine=shl-unknown ;; sh3eb) machine=sh-unknown ;; sh5el) machine=sh5le-unknown ;; *) machine=${UNAME_MACHINE_ARCH}-unknown ;; esac # The Operating System including object format, if it has switched # to ELF recently, or will in the future. case "${UNAME_MACHINE_ARCH}" in arm*|i386|m68k|ns32k|sh3*|sparc|vax) eval $set_cc_for_build if echo __ELF__ | $CC_FOR_BUILD -E - 2>/dev/null \ | grep -q __ELF__ then # Once all utilities can be ECOFF (netbsdecoff) or a.out (netbsdaout). # Return netbsd for either. FIX? os=netbsd else os=netbsdelf fi ;; *) os=netbsd ;; esac # The OS release # Debian GNU/NetBSD machines have a different userland, and # thus, need a distinct triplet. However, they do not need # kernel version information, so it can be replaced with a # suitable tag, in the style of linux-gnu. case "${UNAME_VERSION}" in Debian*) release='-gnu' ;; *) release=`echo ${UNAME_RELEASE}|sed -e 's/[-_].*/\./'` ;; esac # Since CPU_TYPE-MANUFACTURER-KERNEL-OPERATING_SYSTEM: # contains redundant information, the shorter form: # CPU_TYPE-MANUFACTURER-OPERATING_SYSTEM is used. echo "${machine}-${os}${release}" exit ;; *:Bitrig:*:*) UNAME_MACHINE_ARCH=`arch | sed 's/Bitrig.//'` echo ${UNAME_MACHINE_ARCH}-unknown-bitrig${UNAME_RELEASE} exit ;; *:OpenBSD:*:*) UNAME_MACHINE_ARCH=`arch | sed 's/OpenBSD.//'` echo ${UNAME_MACHINE_ARCH}-unknown-openbsd${UNAME_RELEASE} exit ;; *:ekkoBSD:*:*) echo ${UNAME_MACHINE}-unknown-ekkobsd${UNAME_RELEASE} exit ;; *:SolidBSD:*:*) echo ${UNAME_MACHINE}-unknown-solidbsd${UNAME_RELEASE} exit ;; macppc:MirBSD:*:*) echo powerpc-ecce-mirbsd${UNAME_RELEASE} exit ;; *:MirBSD:*:*) echo ${UNAME_MACHINE}-ecce-mirbsd${UNAME_RELEASE} exit ;; *:MidnightBSD:*:*) UNAME_RELEASE=`echo "${UNAME_RELEASE}" | sed -e 's/[-(].*//'` echo ${UNAME_MACHINE}-unknown-midnightbsd${UNAME_RELEASE} exit ;; alpha:OSF1:*:*) case $UNAME_RELEASE in *4.0) UNAME_RELEASE=`/usr/sbin/sizer -v | awk '{print $3}'` ;; *5.*) UNAME_RELEASE=`/usr/sbin/sizer -v | awk '{print $4}'` ;; esac # According to Compaq, /usr/sbin/psrinfo has been available on # OSF/1 and Tru64 systems produced since 1995. I hope that # covers most systems running today. This code pipes the CPU # types through head -n 1, so we only detect the type of CPU 0. ALPHA_CPU_TYPE=`/usr/sbin/psrinfo -v | sed -n -e 's/^ The alpha \(.*\) processor.*$/\1/p' | head -n 1` case "$ALPHA_CPU_TYPE" in "EV4 (21064)") UNAME_MACHINE="alpha" ;; "EV4.5 (21064)") UNAME_MACHINE="alpha" ;; "LCA4 (21066/21068)") UNAME_MACHINE="alpha" ;; "EV5 (21164)") UNAME_MACHINE="alphaev5" ;; "EV5.6 (21164A)") UNAME_MACHINE="alphaev56" ;; "EV5.6 (21164PC)") UNAME_MACHINE="alphapca56" ;; "EV5.7 (21164PC)") UNAME_MACHINE="alphapca57" ;; "EV6 (21264)") UNAME_MACHINE="alphaev6" ;; "EV6.7 (21264A)") UNAME_MACHINE="alphaev67" ;; "EV6.8CB (21264C)") UNAME_MACHINE="alphaev68" ;; "EV6.8AL (21264B)") UNAME_MACHINE="alphaev68" ;; "EV6.8CX (21264D)") UNAME_MACHINE="alphaev68" ;; "EV6.9A (21264/EV69A)") UNAME_MACHINE="alphaev69" ;; "EV7 (21364)") UNAME_MACHINE="alphaev7" ;; "EV7.9 (21364A)") UNAME_MACHINE="alphaev79" ;; esac # A Pn.n version is a patched version. # A Vn.n version is a released version. # A Tn.n version is a released field test version. # A Xn.n version is an unreleased experimental baselevel. # 1.2 uses "1.2" for uname -r. echo ${UNAME_MACHINE}-dec-osf`echo ${UNAME_RELEASE} | sed -e 's/^[PVTX]//' | tr 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz'` # Reset EXIT trap before exiting to avoid spurious non-zero exit code. exitcode=$? trap '' 0 exit $exitcode ;; Alpha\ *:Windows_NT*:*) # How do we know it's Interix rather than the generic POSIX subsystem? # Should we change UNAME_MACHINE based on the output of uname instead # of the specific Alpha model? echo alpha-pc-interix exit ;; 21064:Windows_NT:50:3) echo alpha-dec-winnt3.5 exit ;; Amiga*:UNIX_System_V:4.0:*) echo m68k-unknown-sysv4 exit ;; *:[Aa]miga[Oo][Ss]:*:*) echo ${UNAME_MACHINE}-unknown-amigaos exit ;; *:[Mm]orph[Oo][Ss]:*:*) echo ${UNAME_MACHINE}-unknown-morphos exit ;; *:OS/390:*:*) echo i370-ibm-openedition exit ;; *:z/VM:*:*) echo s390-ibm-zvmoe exit ;; *:OS400:*:*) echo powerpc-ibm-os400 exit ;; arm:RISC*:1.[012]*:*|arm:riscix:1.[012]*:*) echo arm-acorn-riscix${UNAME_RELEASE} exit ;; arm*:riscos:*:*|arm*:RISCOS:*:*) echo arm-unknown-riscos exit ;; SR2?01:HI-UX/MPP:*:* | SR8000:HI-UX/MPP:*:*) echo hppa1.1-hitachi-hiuxmpp exit ;; Pyramid*:OSx*:*:* | MIS*:OSx*:*:* | MIS*:SMP_DC-OSx*:*:*) # akee@wpdis03.wpafb.af.mil (Earle F. Ake) contributed MIS and NILE. if test "`(/bin/universe) 2>/dev/null`" = att ; then echo pyramid-pyramid-sysv3 else echo pyramid-pyramid-bsd fi exit ;; NILE*:*:*:dcosx) echo pyramid-pyramid-svr4 exit ;; DRS?6000:unix:4.0:6*) echo sparc-icl-nx6 exit ;; DRS?6000:UNIX_SV:4.2*:7* | DRS?6000:isis:4.2*:7*) case `/usr/bin/uname -p` in sparc) echo sparc-icl-nx7; exit ;; esac ;; s390x:SunOS:*:*) echo ${UNAME_MACHINE}-ibm-solaris2`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'` exit ;; sun4H:SunOS:5.*:*) echo sparc-hal-solaris2`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'` exit ;; sun4*:SunOS:5.*:* | tadpole*:SunOS:5.*:*) echo sparc-sun-solaris2`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'` exit ;; i86pc:AuroraUX:5.*:* | i86xen:AuroraUX:5.*:*) echo i386-pc-auroraux${UNAME_RELEASE} exit ;; i86pc:SunOS:5.*:* | i86xen:SunOS:5.*:*) eval $set_cc_for_build SUN_ARCH="i386" # If there is a compiler, see if it is configured for 64-bit objects. # Note that the Sun cc does not turn __LP64__ into 1 like gcc does. # This test works for both compilers. if [ "$CC_FOR_BUILD" != 'no_compiler_found' ]; then if (echo '#ifdef __amd64'; echo IS_64BIT_ARCH; echo '#endif') | \ (CCOPTS= $CC_FOR_BUILD -E - 2>/dev/null) | \ grep IS_64BIT_ARCH >/dev/null then SUN_ARCH="x86_64" fi fi echo ${SUN_ARCH}-pc-solaris2`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'` exit ;; sun4*:SunOS:6*:*) # According to config.sub, this is the proper way to canonicalize # SunOS6. Hard to guess exactly what SunOS6 will be like, but # it's likely to be more like Solaris than SunOS4. echo sparc-sun-solaris3`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'` exit ;; sun4*:SunOS:*:*) case "`/usr/bin/arch -k`" in Series*|S4*) UNAME_RELEASE=`uname -v` ;; esac # Japanese Language versions have a version number like `4.1.3-JL'. echo sparc-sun-sunos`echo ${UNAME_RELEASE}|sed -e 's/-/_/'` exit ;; sun3*:SunOS:*:*) echo m68k-sun-sunos${UNAME_RELEASE} exit ;; sun*:*:4.2BSD:*) UNAME_RELEASE=`(sed 1q /etc/motd | awk '{print substr($5,1,3)}') 2>/dev/null` test "x${UNAME_RELEASE}" = "x" && UNAME_RELEASE=3 case "`/bin/arch`" in sun3) echo m68k-sun-sunos${UNAME_RELEASE} ;; sun4) echo sparc-sun-sunos${UNAME_RELEASE} ;; esac exit ;; aushp:SunOS:*:*) echo sparc-auspex-sunos${UNAME_RELEASE} exit ;; # The situation for MiNT is a little confusing. The machine name # can be virtually everything (everything which is not # "atarist" or "atariste" at least should have a processor # > m68000). The system name ranges from "MiNT" over "FreeMiNT" # to the lowercase version "mint" (or "freemint"). Finally # the system name "TOS" denotes a system which is actually not # MiNT. But MiNT is downward compatible to TOS, so this should # be no problem. atarist[e]:*MiNT:*:* | atarist[e]:*mint:*:* | atarist[e]:*TOS:*:*) echo m68k-atari-mint${UNAME_RELEASE} exit ;; atari*:*MiNT:*:* | atari*:*mint:*:* | atarist[e]:*TOS:*:*) echo m68k-atari-mint${UNAME_RELEASE} exit ;; *falcon*:*MiNT:*:* | *falcon*:*mint:*:* | *falcon*:*TOS:*:*) echo m68k-atari-mint${UNAME_RELEASE} exit ;; milan*:*MiNT:*:* | milan*:*mint:*:* | *milan*:*TOS:*:*) echo m68k-milan-mint${UNAME_RELEASE} exit ;; hades*:*MiNT:*:* | hades*:*mint:*:* | *hades*:*TOS:*:*) echo m68k-hades-mint${UNAME_RELEASE} exit ;; *:*MiNT:*:* | *:*mint:*:* | *:*TOS:*:*) echo m68k-unknown-mint${UNAME_RELEASE} exit ;; m68k:machten:*:*) echo m68k-apple-machten${UNAME_RELEASE} exit ;; powerpc:machten:*:*) echo powerpc-apple-machten${UNAME_RELEASE} exit ;; RISC*:Mach:*:*) echo mips-dec-mach_bsd4.3 exit ;; RISC*:ULTRIX:*:*) echo mips-dec-ultrix${UNAME_RELEASE} exit ;; VAX*:ULTRIX*:*:*) echo vax-dec-ultrix${UNAME_RELEASE} exit ;; 2020:CLIX:*:* | 2430:CLIX:*:*) echo clipper-intergraph-clix${UNAME_RELEASE} exit ;; mips:*:*:UMIPS | mips:*:*:RISCos) eval $set_cc_for_build sed 's/^ //' << EOF >$dummy.c #ifdef __cplusplus #include /* for printf() prototype */ int main (int argc, char *argv[]) { #else int main (argc, argv) int argc; char *argv[]; { #endif #if defined (host_mips) && defined (MIPSEB) #if defined (SYSTYPE_SYSV) printf ("mips-mips-riscos%ssysv\n", argv[1]); exit (0); #endif #if defined (SYSTYPE_SVR4) printf ("mips-mips-riscos%ssvr4\n", argv[1]); exit (0); #endif #if defined (SYSTYPE_BSD43) || defined(SYSTYPE_BSD) printf ("mips-mips-riscos%sbsd\n", argv[1]); exit (0); #endif #endif exit (-1); } EOF $CC_FOR_BUILD -o $dummy $dummy.c && dummyarg=`echo "${UNAME_RELEASE}" | sed -n 's/\([0-9]*\).*/\1/p'` && SYSTEM_NAME=`$dummy $dummyarg` && { echo "$SYSTEM_NAME"; exit; } echo mips-mips-riscos${UNAME_RELEASE} exit ;; Motorola:PowerMAX_OS:*:*) echo powerpc-motorola-powermax exit ;; Motorola:*:4.3:PL8-*) echo powerpc-harris-powermax exit ;; Night_Hawk:*:*:PowerMAX_OS | Synergy:PowerMAX_OS:*:*) echo powerpc-harris-powermax exit ;; Night_Hawk:Power_UNIX:*:*) echo powerpc-harris-powerunix exit ;; m88k:CX/UX:7*:*) echo m88k-harris-cxux7 exit ;; m88k:*:4*:R4*) echo m88k-motorola-sysv4 exit ;; m88k:*:3*:R3*) echo m88k-motorola-sysv3 exit ;; AViiON:dgux:*:*) # DG/UX returns AViiON for all architectures UNAME_PROCESSOR=`/usr/bin/uname -p` if [ $UNAME_PROCESSOR = mc88100 ] || [ $UNAME_PROCESSOR = mc88110 ] then if [ ${TARGET_BINARY_INTERFACE}x = m88kdguxelfx ] || \ [ ${TARGET_BINARY_INTERFACE}x = x ] then echo m88k-dg-dgux${UNAME_RELEASE} else echo m88k-dg-dguxbcs${UNAME_RELEASE} fi else echo i586-dg-dgux${UNAME_RELEASE} fi exit ;; M88*:DolphinOS:*:*) # DolphinOS (SVR3) echo m88k-dolphin-sysv3 exit ;; M88*:*:R3*:*) # Delta 88k system running SVR3 echo m88k-motorola-sysv3 exit ;; XD88*:*:*:*) # Tektronix XD88 system running UTekV (SVR3) echo m88k-tektronix-sysv3 exit ;; Tek43[0-9][0-9]:UTek:*:*) # Tektronix 4300 system running UTek (BSD) echo m68k-tektronix-bsd exit ;; *:IRIX*:*:*) echo mips-sgi-irix`echo ${UNAME_RELEASE}|sed -e 's/-/_/g'` exit ;; ????????:AIX?:[12].1:2) # AIX 2.2.1 or AIX 2.1.1 is RT/PC AIX. echo romp-ibm-aix # uname -m gives an 8 hex-code CPU id exit ;; # Note that: echo "'`uname -s`'" gives 'AIX ' i*86:AIX:*:*) echo i386-ibm-aix exit ;; ia64:AIX:*:*) if [ -x /usr/bin/oslevel ] ; then IBM_REV=`/usr/bin/oslevel` else IBM_REV=${UNAME_VERSION}.${UNAME_RELEASE} fi echo ${UNAME_MACHINE}-ibm-aix${IBM_REV} exit ;; *:AIX:2:3) if grep bos325 /usr/include/stdio.h >/dev/null 2>&1; then eval $set_cc_for_build sed 's/^ //' << EOF >$dummy.c #include main() { if (!__power_pc()) exit(1); puts("powerpc-ibm-aix3.2.5"); exit(0); } EOF if $CC_FOR_BUILD -o $dummy $dummy.c && SYSTEM_NAME=`$dummy` then echo "$SYSTEM_NAME" else echo rs6000-ibm-aix3.2.5 fi elif grep bos324 /usr/include/stdio.h >/dev/null 2>&1; then echo rs6000-ibm-aix3.2.4 else echo rs6000-ibm-aix3.2 fi exit ;; *:AIX:*:[4567]) IBM_CPU_ID=`/usr/sbin/lsdev -C -c processor -S available | sed 1q | awk '{ print $1 }'` if /usr/sbin/lsattr -El ${IBM_CPU_ID} | grep ' POWER' >/dev/null 2>&1; then IBM_ARCH=rs6000 else IBM_ARCH=powerpc fi if [ -x /usr/bin/oslevel ] ; then IBM_REV=`/usr/bin/oslevel` else IBM_REV=${UNAME_VERSION}.${UNAME_RELEASE} fi echo ${IBM_ARCH}-ibm-aix${IBM_REV} exit ;; *:AIX:*:*) echo rs6000-ibm-aix exit ;; ibmrt:4.4BSD:*|romp-ibm:BSD:*) echo romp-ibm-bsd4.4 exit ;; ibmrt:*BSD:*|romp-ibm:BSD:*) # covers RT/PC BSD and echo romp-ibm-bsd${UNAME_RELEASE} # 4.3 with uname added to exit ;; # report: romp-ibm BSD 4.3 *:BOSX:*:*) echo rs6000-bull-bosx exit ;; DPX/2?00:B.O.S.:*:*) echo m68k-bull-sysv3 exit ;; 9000/[34]??:4.3bsd:1.*:*) echo m68k-hp-bsd exit ;; hp300:4.4BSD:*:* | 9000/[34]??:4.3bsd:2.*:*) echo m68k-hp-bsd4.4 exit ;; 9000/[34678]??:HP-UX:*:*) HPUX_REV=`echo ${UNAME_RELEASE}|sed -e 's/[^.]*.[0B]*//'` case "${UNAME_MACHINE}" in 9000/31? ) HP_ARCH=m68000 ;; 9000/[34]?? ) HP_ARCH=m68k ;; 9000/[678][0-9][0-9]) if [ -x /usr/bin/getconf ]; then sc_cpu_version=`/usr/bin/getconf SC_CPU_VERSION 2>/dev/null` sc_kernel_bits=`/usr/bin/getconf SC_KERNEL_BITS 2>/dev/null` case "${sc_cpu_version}" in 523) HP_ARCH="hppa1.0" ;; # CPU_PA_RISC1_0 528) HP_ARCH="hppa1.1" ;; # CPU_PA_RISC1_1 532) # CPU_PA_RISC2_0 case "${sc_kernel_bits}" in 32) HP_ARCH="hppa2.0n" ;; 64) HP_ARCH="hppa2.0w" ;; '') HP_ARCH="hppa2.0" ;; # HP-UX 10.20 esac ;; esac fi if [ "${HP_ARCH}" = "" ]; then eval $set_cc_for_build sed 's/^ //' << EOF >$dummy.c #define _HPUX_SOURCE #include #include int main () { #if defined(_SC_KERNEL_BITS) long bits = sysconf(_SC_KERNEL_BITS); #endif long cpu = sysconf (_SC_CPU_VERSION); switch (cpu) { case CPU_PA_RISC1_0: puts ("hppa1.0"); break; case CPU_PA_RISC1_1: puts ("hppa1.1"); break; case CPU_PA_RISC2_0: #if defined(_SC_KERNEL_BITS) switch (bits) { case 64: puts ("hppa2.0w"); break; case 32: puts ("hppa2.0n"); break; default: puts ("hppa2.0"); break; } break; #else /* !defined(_SC_KERNEL_BITS) */ puts ("hppa2.0"); break; #endif default: puts ("hppa1.0"); break; } exit (0); } EOF (CCOPTS= $CC_FOR_BUILD -o $dummy $dummy.c 2>/dev/null) && HP_ARCH=`$dummy` test -z "$HP_ARCH" && HP_ARCH=hppa fi ;; esac if [ ${HP_ARCH} = "hppa2.0w" ] then eval $set_cc_for_build # hppa2.0w-hp-hpux* has a 64-bit kernel and a compiler generating # 32-bit code. hppa64-hp-hpux* has the same kernel and a compiler # generating 64-bit code. GNU and HP use different nomenclature: # # $ CC_FOR_BUILD=cc ./config.guess # => hppa2.0w-hp-hpux11.23 # $ CC_FOR_BUILD="cc +DA2.0w" ./config.guess # => hppa64-hp-hpux11.23 if echo __LP64__ | (CCOPTS= $CC_FOR_BUILD -E - 2>/dev/null) | grep -q __LP64__ then HP_ARCH="hppa2.0w" else HP_ARCH="hppa64" fi fi echo ${HP_ARCH}-hp-hpux${HPUX_REV} exit ;; ia64:HP-UX:*:*) HPUX_REV=`echo ${UNAME_RELEASE}|sed -e 's/[^.]*.[0B]*//'` echo ia64-hp-hpux${HPUX_REV} exit ;; 3050*:HI-UX:*:*) eval $set_cc_for_build sed 's/^ //' << EOF >$dummy.c #include int main () { long cpu = sysconf (_SC_CPU_VERSION); /* The order matters, because CPU_IS_HP_MC68K erroneously returns true for CPU_PA_RISC1_0. CPU_IS_PA_RISC returns correct results, however. */ if (CPU_IS_PA_RISC (cpu)) { switch (cpu) { case CPU_PA_RISC1_0: puts ("hppa1.0-hitachi-hiuxwe2"); break; case CPU_PA_RISC1_1: puts ("hppa1.1-hitachi-hiuxwe2"); break; case CPU_PA_RISC2_0: puts ("hppa2.0-hitachi-hiuxwe2"); break; default: puts ("hppa-hitachi-hiuxwe2"); break; } } else if (CPU_IS_HP_MC68K (cpu)) puts ("m68k-hitachi-hiuxwe2"); else puts ("unknown-hitachi-hiuxwe2"); exit (0); } EOF $CC_FOR_BUILD -o $dummy $dummy.c && SYSTEM_NAME=`$dummy` && { echo "$SYSTEM_NAME"; exit; } echo unknown-hitachi-hiuxwe2 exit ;; 9000/7??:4.3bsd:*:* | 9000/8?[79]:4.3bsd:*:* ) echo hppa1.1-hp-bsd exit ;; 9000/8??:4.3bsd:*:*) echo hppa1.0-hp-bsd exit ;; *9??*:MPE/iX:*:* | *3000*:MPE/iX:*:*) echo hppa1.0-hp-mpeix exit ;; hp7??:OSF1:*:* | hp8?[79]:OSF1:*:* ) echo hppa1.1-hp-osf exit ;; hp8??:OSF1:*:*) echo hppa1.0-hp-osf exit ;; i*86:OSF1:*:*) if [ -x /usr/sbin/sysversion ] ; then echo ${UNAME_MACHINE}-unknown-osf1mk else echo ${UNAME_MACHINE}-unknown-osf1 fi exit ;; parisc*:Lites*:*:*) echo hppa1.1-hp-lites exit ;; C1*:ConvexOS:*:* | convex:ConvexOS:C1*:*) echo c1-convex-bsd exit ;; C2*:ConvexOS:*:* | convex:ConvexOS:C2*:*) if getsysinfo -f scalar_acc then echo c32-convex-bsd else echo c2-convex-bsd fi exit ;; C34*:ConvexOS:*:* | convex:ConvexOS:C34*:*) echo c34-convex-bsd exit ;; C38*:ConvexOS:*:* | convex:ConvexOS:C38*:*) echo c38-convex-bsd exit ;; C4*:ConvexOS:*:* | convex:ConvexOS:C4*:*) echo c4-convex-bsd exit ;; CRAY*Y-MP:*:*:*) echo ymp-cray-unicos${UNAME_RELEASE} | sed -e 's/\.[^.]*$/.X/' exit ;; CRAY*[A-Z]90:*:*:*) echo ${UNAME_MACHINE}-cray-unicos${UNAME_RELEASE} \ | sed -e 's/CRAY.*\([A-Z]90\)/\1/' \ -e y/ABCDEFGHIJKLMNOPQRSTUVWXYZ/abcdefghijklmnopqrstuvwxyz/ \ -e 's/\.[^.]*$/.X/' exit ;; CRAY*TS:*:*:*) echo t90-cray-unicos${UNAME_RELEASE} | sed -e 's/\.[^.]*$/.X/' exit ;; CRAY*T3E:*:*:*) echo alphaev5-cray-unicosmk${UNAME_RELEASE} | sed -e 's/\.[^.]*$/.X/' exit ;; CRAY*SV1:*:*:*) echo sv1-cray-unicos${UNAME_RELEASE} | sed -e 's/\.[^.]*$/.X/' exit ;; *:UNICOS/mp:*:*) echo craynv-cray-unicosmp${UNAME_RELEASE} | sed -e 's/\.[^.]*$/.X/' exit ;; F30[01]:UNIX_System_V:*:* | F700:UNIX_System_V:*:*) FUJITSU_PROC=`uname -m | tr 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz'` FUJITSU_SYS=`uname -p | tr 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz' | sed -e 's/\///'` FUJITSU_REL=`echo ${UNAME_RELEASE} | sed -e 's/ /_/'` echo "${FUJITSU_PROC}-fujitsu-${FUJITSU_SYS}${FUJITSU_REL}" exit ;; 5000:UNIX_System_V:4.*:*) FUJITSU_SYS=`uname -p | tr 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz' | sed -e 's/\///'` FUJITSU_REL=`echo ${UNAME_RELEASE} | tr 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz' | sed -e 's/ /_/'` echo "sparc-fujitsu-${FUJITSU_SYS}${FUJITSU_REL}" exit ;; i*86:BSD/386:*:* | i*86:BSD/OS:*:* | *:Ascend\ Embedded/OS:*:*) echo ${UNAME_MACHINE}-pc-bsdi${UNAME_RELEASE} exit ;; sparc*:BSD/OS:*:*) echo sparc-unknown-bsdi${UNAME_RELEASE} exit ;; *:BSD/OS:*:*) echo ${UNAME_MACHINE}-unknown-bsdi${UNAME_RELEASE} exit ;; *:FreeBSD:*:*) UNAME_PROCESSOR=`/usr/bin/uname -p` case ${UNAME_PROCESSOR} in amd64) echo x86_64-unknown-freebsd`echo ${UNAME_RELEASE}|sed -e 's/[-(].*//'` ;; *) echo ${UNAME_PROCESSOR}-unknown-freebsd`echo ${UNAME_RELEASE}|sed -e 's/[-(].*//'` ;; esac exit ;; i*:CYGWIN*:*) echo ${UNAME_MACHINE}-pc-cygwin exit ;; *:MINGW64*:*) echo ${UNAME_MACHINE}-pc-mingw64 exit ;; *:MINGW*:*) echo ${UNAME_MACHINE}-pc-mingw32 exit ;; i*:MSYS*:*) echo ${UNAME_MACHINE}-pc-msys exit ;; i*:windows32*:*) # uname -m includes "-pc" on this system. echo ${UNAME_MACHINE}-mingw32 exit ;; i*:PW*:*) echo ${UNAME_MACHINE}-pc-pw32 exit ;; *:Interix*:*) case ${UNAME_MACHINE} in x86) echo i586-pc-interix${UNAME_RELEASE} exit ;; authenticamd | genuineintel | EM64T) echo x86_64-unknown-interix${UNAME_RELEASE} exit ;; IA64) echo ia64-unknown-interix${UNAME_RELEASE} exit ;; esac ;; [345]86:Windows_95:* | [345]86:Windows_98:* | [345]86:Windows_NT:*) echo i${UNAME_MACHINE}-pc-mks exit ;; 8664:Windows_NT:*) echo x86_64-pc-mks exit ;; i*:Windows_NT*:* | Pentium*:Windows_NT*:*) # How do we know it's Interix rather than the generic POSIX subsystem? # It also conflicts with pre-2.0 versions of AT&T UWIN. Should we # UNAME_MACHINE based on the output of uname instead of i386? echo i586-pc-interix exit ;; i*:UWIN*:*) echo ${UNAME_MACHINE}-pc-uwin exit ;; amd64:CYGWIN*:*:* | x86_64:CYGWIN*:*:*) echo x86_64-unknown-cygwin exit ;; p*:CYGWIN*:*) echo powerpcle-unknown-cygwin exit ;; prep*:SunOS:5.*:*) echo powerpcle-unknown-solaris2`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'` exit ;; *:GNU:*:*) # the GNU system echo `echo ${UNAME_MACHINE}|sed -e 's,[-/].*$,,'`-unknown-gnu`echo ${UNAME_RELEASE}|sed -e 's,/.*$,,'` exit ;; *:GNU/*:*:*) # other systems with GNU libc and userland echo ${UNAME_MACHINE}-unknown-`echo ${UNAME_SYSTEM} | sed 's,^[^/]*/,,' | tr '[A-Z]' '[a-z]'``echo ${UNAME_RELEASE}|sed -e 's/[-(].*//'`-gnu exit ;; i*86:Minix:*:*) echo ${UNAME_MACHINE}-pc-minix exit ;; aarch64:Linux:*:*) echo ${UNAME_MACHINE}-unknown-linux-gnu exit ;; aarch64_be:Linux:*:*) UNAME_MACHINE=aarch64_be echo ${UNAME_MACHINE}-unknown-linux-gnu exit ;; alpha:Linux:*:*) case `sed -n '/^cpu model/s/^.*: \(.*\)/\1/p' < /proc/cpuinfo` in EV5) UNAME_MACHINE=alphaev5 ;; EV56) UNAME_MACHINE=alphaev56 ;; PCA56) UNAME_MACHINE=alphapca56 ;; PCA57) UNAME_MACHINE=alphapca56 ;; EV6) UNAME_MACHINE=alphaev6 ;; EV67) UNAME_MACHINE=alphaev67 ;; EV68*) UNAME_MACHINE=alphaev68 ;; esac objdump --private-headers /bin/sh | grep -q ld.so.1 if test "$?" = 0 ; then LIBC="libc1" ; else LIBC="" ; fi echo ${UNAME_MACHINE}-unknown-linux-gnu${LIBC} exit ;; arm*:Linux:*:*) eval $set_cc_for_build if echo __ARM_EABI__ | $CC_FOR_BUILD -E - 2>/dev/null \ | grep -q __ARM_EABI__ then echo ${UNAME_MACHINE}-unknown-linux-gnu else if echo __ARM_PCS_VFP | $CC_FOR_BUILD -E - 2>/dev/null \ | grep -q __ARM_PCS_VFP then echo ${UNAME_MACHINE}-unknown-linux-gnueabi else echo ${UNAME_MACHINE}-unknown-linux-gnueabihf fi fi exit ;; avr32*:Linux:*:*) echo ${UNAME_MACHINE}-unknown-linux-gnu exit ;; cris:Linux:*:*) echo ${UNAME_MACHINE}-axis-linux-gnu exit ;; crisv32:Linux:*:*) echo ${UNAME_MACHINE}-axis-linux-gnu exit ;; frv:Linux:*:*) echo ${UNAME_MACHINE}-unknown-linux-gnu exit ;; hexagon:Linux:*:*) echo ${UNAME_MACHINE}-unknown-linux-gnu exit ;; i*86:Linux:*:*) LIBC=gnu eval $set_cc_for_build sed 's/^ //' << EOF >$dummy.c #ifdef __dietlibc__ LIBC=dietlibc #endif EOF eval `$CC_FOR_BUILD -E $dummy.c 2>/dev/null | grep '^LIBC'` echo "${UNAME_MACHINE}-pc-linux-${LIBC}" exit ;; ia64:Linux:*:*) echo ${UNAME_MACHINE}-unknown-linux-gnu exit ;; m32r*:Linux:*:*) echo ${UNAME_MACHINE}-unknown-linux-gnu exit ;; m68*:Linux:*:*) echo ${UNAME_MACHINE}-unknown-linux-gnu exit ;; mips:Linux:*:* | mips64:Linux:*:*) eval $set_cc_for_build sed 's/^ //' << EOF >$dummy.c #undef CPU #undef ${UNAME_MACHINE} #undef ${UNAME_MACHINE}el #if defined(__MIPSEL__) || defined(__MIPSEL) || defined(_MIPSEL) || defined(MIPSEL) CPU=${UNAME_MACHINE}el #else #if defined(__MIPSEB__) || defined(__MIPSEB) || defined(_MIPSEB) || defined(MIPSEB) CPU=${UNAME_MACHINE} #else CPU= #endif #endif EOF eval `$CC_FOR_BUILD -E $dummy.c 2>/dev/null | grep '^CPU'` test x"${CPU}" != x && { echo "${CPU}-unknown-linux-gnu"; exit; } ;; or32:Linux:*:*) echo ${UNAME_MACHINE}-unknown-linux-gnu exit ;; padre:Linux:*:*) echo sparc-unknown-linux-gnu exit ;; parisc64:Linux:*:* | hppa64:Linux:*:*) echo hppa64-unknown-linux-gnu exit ;; parisc:Linux:*:* | hppa:Linux:*:*) # Look for CPU level case `grep '^cpu[^a-z]*:' /proc/cpuinfo 2>/dev/null | cut -d' ' -f2` in PA7*) echo hppa1.1-unknown-linux-gnu ;; PA8*) echo hppa2.0-unknown-linux-gnu ;; *) echo hppa-unknown-linux-gnu ;; esac exit ;; ppc64le:Linux:*:*) echo powerpc64le-unknown-linux-gnu exit ;; ppc64:Linux:*:*) echo powerpc64-unknown-linux-gnu exit ;; ppcle:Linux:*:*) echo powerpcle-unknown-linux-gnu exit ;; ppc:Linux:*:*) echo powerpc-unknown-linux-gnu exit ;; riscv32:Linux:*:* | riscv64:Linux:*:*) echo ${UNAME_MACHINE}-unknown-linux-gnu exit ;; s390:Linux:*:* | s390x:Linux:*:*) echo ${UNAME_MACHINE}-ibm-linux exit ;; sh64*:Linux:*:*) echo ${UNAME_MACHINE}-unknown-linux-gnu exit ;; sh*:Linux:*:*) echo ${UNAME_MACHINE}-unknown-linux-gnu exit ;; sparc:Linux:*:* | sparc64:Linux:*:*) echo ${UNAME_MACHINE}-unknown-linux-gnu exit ;; tile*:Linux:*:*) echo ${UNAME_MACHINE}-unknown-linux-gnu exit ;; vax:Linux:*:*) echo ${UNAME_MACHINE}-dec-linux-gnu exit ;; x86_64:Linux:*:*) echo ${UNAME_MACHINE}-unknown-linux-gnu exit ;; xtensa*:Linux:*:*) echo ${UNAME_MACHINE}-unknown-linux-gnu exit ;; i*86:DYNIX/ptx:4*:*) # ptx 4.0 does uname -s correctly, with DYNIX/ptx in there. # earlier versions are messed up and put the nodename in both # sysname and nodename. echo i386-sequent-sysv4 exit ;; i*86:UNIX_SV:4.2MP:2.*) # Unixware is an offshoot of SVR4, but it has its own version # number series starting with 2... # I am not positive that other SVR4 systems won't match this, # I just have to hope. -- rms. # Use sysv4.2uw... so that sysv4* matches it. echo ${UNAME_MACHINE}-pc-sysv4.2uw${UNAME_VERSION} exit ;; i*86:OS/2:*:*) # If we were able to find `uname', then EMX Unix compatibility # is probably installed. echo ${UNAME_MACHINE}-pc-os2-emx exit ;; i*86:XTS-300:*:STOP) echo ${UNAME_MACHINE}-unknown-stop exit ;; i*86:atheos:*:*) echo ${UNAME_MACHINE}-unknown-atheos exit ;; i*86:syllable:*:*) echo ${UNAME_MACHINE}-pc-syllable exit ;; i*86:LynxOS:2.*:* | i*86:LynxOS:3.[01]*:* | i*86:LynxOS:4.[02]*:*) echo i386-unknown-lynxos${UNAME_RELEASE} exit ;; i*86:*DOS:*:*) echo ${UNAME_MACHINE}-pc-msdosdjgpp exit ;; i*86:*:4.*:* | i*86:SYSTEM_V:4.*:*) UNAME_REL=`echo ${UNAME_RELEASE} | sed 's/\/MP$//'` if grep Novell /usr/include/link.h >/dev/null 2>/dev/null; then echo ${UNAME_MACHINE}-univel-sysv${UNAME_REL} else echo ${UNAME_MACHINE}-pc-sysv${UNAME_REL} fi exit ;; i*86:*:5:[678]*) # UnixWare 7.x, OpenUNIX and OpenServer 6. case `/bin/uname -X | grep "^Machine"` in *486*) UNAME_MACHINE=i486 ;; *Pentium) UNAME_MACHINE=i586 ;; *Pent*|*Celeron) UNAME_MACHINE=i686 ;; esac echo ${UNAME_MACHINE}-unknown-sysv${UNAME_RELEASE}${UNAME_SYSTEM}${UNAME_VERSION} exit ;; i*86:*:3.2:*) if test -f /usr/options/cb.name; then UNAME_REL=`sed -n 's/.*Version //p' /dev/null >/dev/null ; then UNAME_REL=`(/bin/uname -X|grep Release|sed -e 's/.*= //')` (/bin/uname -X|grep i80486 >/dev/null) && UNAME_MACHINE=i486 (/bin/uname -X|grep '^Machine.*Pentium' >/dev/null) \ && UNAME_MACHINE=i586 (/bin/uname -X|grep '^Machine.*Pent *II' >/dev/null) \ && UNAME_MACHINE=i686 (/bin/uname -X|grep '^Machine.*Pentium Pro' >/dev/null) \ && UNAME_MACHINE=i686 echo ${UNAME_MACHINE}-pc-sco$UNAME_REL else echo ${UNAME_MACHINE}-pc-sysv32 fi exit ;; pc:*:*:*) # Left here for compatibility: # uname -m prints for DJGPP always 'pc', but it prints nothing about # the processor, so we play safe by assuming i586. # Note: whatever this is, it MUST be the same as what config.sub # prints for the "djgpp" host, or else GDB configury will decide that # this is a cross-build. echo i586-pc-msdosdjgpp exit ;; Intel:Mach:3*:*) echo i386-pc-mach3 exit ;; paragon:*:*:*) echo i860-intel-osf1 exit ;; i860:*:4.*:*) # i860-SVR4 if grep Stardent /usr/include/sys/uadmin.h >/dev/null 2>&1 ; then echo i860-stardent-sysv${UNAME_RELEASE} # Stardent Vistra i860-SVR4 else # Add other i860-SVR4 vendors below as they are discovered. echo i860-unknown-sysv${UNAME_RELEASE} # Unknown i860-SVR4 fi exit ;; mini*:CTIX:SYS*5:*) # "miniframe" echo m68010-convergent-sysv exit ;; mc68k:UNIX:SYSTEM5:3.51m) echo m68k-convergent-sysv exit ;; M680?0:D-NIX:5.3:*) echo m68k-diab-dnix exit ;; M68*:*:R3V[5678]*:*) test -r /sysV68 && { echo 'm68k-motorola-sysv'; exit; } ;; 3[345]??:*:4.0:3.0 | 3[34]??A:*:4.0:3.0 | 3[34]??,*:*:4.0:3.0 | 3[34]??/*:*:4.0:3.0 | 4400:*:4.0:3.0 | 4850:*:4.0:3.0 | SKA40:*:4.0:3.0 | SDS2:*:4.0:3.0 | SHG2:*:4.0:3.0 | S7501*:*:4.0:3.0) OS_REL='' test -r /etc/.relid \ && OS_REL=.`sed -n 's/[^ ]* [^ ]* \([0-9][0-9]\).*/\1/p' < /etc/.relid` /bin/uname -p 2>/dev/null | grep 86 >/dev/null \ && { echo i486-ncr-sysv4.3${OS_REL}; exit; } /bin/uname -p 2>/dev/null | /bin/grep entium >/dev/null \ && { echo i586-ncr-sysv4.3${OS_REL}; exit; } ;; 3[34]??:*:4.0:* | 3[34]??,*:*:4.0:*) /bin/uname -p 2>/dev/null | grep 86 >/dev/null \ && { echo i486-ncr-sysv4; exit; } ;; NCR*:*:4.2:* | MPRAS*:*:4.2:*) OS_REL='.3' test -r /etc/.relid \ && OS_REL=.`sed -n 's/[^ ]* [^ ]* \([0-9][0-9]\).*/\1/p' < /etc/.relid` /bin/uname -p 2>/dev/null | grep 86 >/dev/null \ && { echo i486-ncr-sysv4.3${OS_REL}; exit; } /bin/uname -p 2>/dev/null | /bin/grep entium >/dev/null \ && { echo i586-ncr-sysv4.3${OS_REL}; exit; } /bin/uname -p 2>/dev/null | /bin/grep pteron >/dev/null \ && { echo i586-ncr-sysv4.3${OS_REL}; exit; } ;; m68*:LynxOS:2.*:* | m68*:LynxOS:3.0*:*) echo m68k-unknown-lynxos${UNAME_RELEASE} exit ;; mc68030:UNIX_System_V:4.*:*) echo m68k-atari-sysv4 exit ;; TSUNAMI:LynxOS:2.*:*) echo sparc-unknown-lynxos${UNAME_RELEASE} exit ;; rs6000:LynxOS:2.*:*) echo rs6000-unknown-lynxos${UNAME_RELEASE} exit ;; PowerPC:LynxOS:2.*:* | PowerPC:LynxOS:3.[01]*:* | PowerPC:LynxOS:4.[02]*:*) echo powerpc-unknown-lynxos${UNAME_RELEASE} exit ;; SM[BE]S:UNIX_SV:*:*) echo mips-dde-sysv${UNAME_RELEASE} exit ;; RM*:ReliantUNIX-*:*:*) echo mips-sni-sysv4 exit ;; RM*:SINIX-*:*:*) echo mips-sni-sysv4 exit ;; *:SINIX-*:*:*) if uname -p 2>/dev/null >/dev/null ; then UNAME_MACHINE=`(uname -p) 2>/dev/null` echo ${UNAME_MACHINE}-sni-sysv4 else echo ns32k-sni-sysv fi exit ;; PENTIUM:*:4.0*:*) # Unisys `ClearPath HMP IX 4000' SVR4/MP effort # says echo i586-unisys-sysv4 exit ;; *:UNIX_System_V:4*:FTX*) # From Gerald Hewes . # How about differentiating between stratus architectures? -djm echo hppa1.1-stratus-sysv4 exit ;; *:*:*:FTX*) # From seanf@swdc.stratus.com. echo i860-stratus-sysv4 exit ;; i*86:VOS:*:*) # From Paul.Green@stratus.com. echo ${UNAME_MACHINE}-stratus-vos exit ;; *:VOS:*:*) # From Paul.Green@stratus.com. echo hppa1.1-stratus-vos exit ;; mc68*:A/UX:*:*) echo m68k-apple-aux${UNAME_RELEASE} exit ;; news*:NEWS-OS:6*:*) echo mips-sony-newsos6 exit ;; R[34]000:*System_V*:*:* | R4000:UNIX_SYSV:*:* | R*000:UNIX_SV:*:*) if [ -d /usr/nec ]; then echo mips-nec-sysv${UNAME_RELEASE} else echo mips-unknown-sysv${UNAME_RELEASE} fi exit ;; BeBox:BeOS:*:*) # BeOS running on hardware made by Be, PPC only. echo powerpc-be-beos exit ;; BeMac:BeOS:*:*) # BeOS running on Mac or Mac clone, PPC only. echo powerpc-apple-beos exit ;; BePC:BeOS:*:*) # BeOS running on Intel PC compatible. echo i586-pc-beos exit ;; BePC:Haiku:*:*) # Haiku running on Intel PC compatible. echo i586-pc-haiku exit ;; x86_64:Haiku:*:*) echo x86_64-unknown-haiku exit ;; SX-4:SUPER-UX:*:*) echo sx4-nec-superux${UNAME_RELEASE} exit ;; SX-5:SUPER-UX:*:*) echo sx5-nec-superux${UNAME_RELEASE} exit ;; SX-6:SUPER-UX:*:*) echo sx6-nec-superux${UNAME_RELEASE} exit ;; SX-7:SUPER-UX:*:*) echo sx7-nec-superux${UNAME_RELEASE} exit ;; SX-8:SUPER-UX:*:*) echo sx8-nec-superux${UNAME_RELEASE} exit ;; SX-8R:SUPER-UX:*:*) echo sx8r-nec-superux${UNAME_RELEASE} exit ;; Power*:Rhapsody:*:*) echo powerpc-apple-rhapsody${UNAME_RELEASE} exit ;; *:Rhapsody:*:*) echo ${UNAME_MACHINE}-apple-rhapsody${UNAME_RELEASE} exit ;; *:Darwin:*:*) UNAME_PROCESSOR=`uname -p` || UNAME_PROCESSOR=unknown case $UNAME_PROCESSOR in i386) eval $set_cc_for_build if [ "$CC_FOR_BUILD" != 'no_compiler_found' ]; then if (echo '#ifdef __LP64__'; echo IS_64BIT_ARCH; echo '#endif') | \ (CCOPTS= $CC_FOR_BUILD -E - 2>/dev/null) | \ grep IS_64BIT_ARCH >/dev/null then UNAME_PROCESSOR="x86_64" fi fi ;; unknown) UNAME_PROCESSOR=powerpc ;; esac echo ${UNAME_PROCESSOR}-apple-darwin${UNAME_RELEASE} exit ;; *:procnto*:*:* | *:QNX:[0123456789]*:*) UNAME_PROCESSOR=`uname -p` if test "$UNAME_PROCESSOR" = "x86"; then UNAME_PROCESSOR=i386 UNAME_MACHINE=pc fi echo ${UNAME_PROCESSOR}-${UNAME_MACHINE}-nto-qnx${UNAME_RELEASE} exit ;; *:QNX:*:4*) echo i386-pc-qnx exit ;; NEO-?:NONSTOP_KERNEL:*:*) echo neo-tandem-nsk${UNAME_RELEASE} exit ;; NSE-*:NONSTOP_KERNEL:*:*) echo nse-tandem-nsk${UNAME_RELEASE} exit ;; NSR-?:NONSTOP_KERNEL:*:*) echo nsr-tandem-nsk${UNAME_RELEASE} exit ;; *:NonStop-UX:*:*) echo mips-compaq-nonstopux exit ;; BS2000:POSIX*:*:*) echo bs2000-siemens-sysv exit ;; DS/*:UNIX_System_V:*:*) echo ${UNAME_MACHINE}-${UNAME_SYSTEM}-${UNAME_RELEASE} exit ;; *:Plan9:*:*) # "uname -m" is not consistent, so use $cputype instead. 386 # is converted to i386 for consistency with other x86 # operating systems. if test "$cputype" = "386"; then UNAME_MACHINE=i386 else UNAME_MACHINE="$cputype" fi echo ${UNAME_MACHINE}-unknown-plan9 exit ;; *:TOPS-10:*:*) echo pdp10-unknown-tops10 exit ;; *:TENEX:*:*) echo pdp10-unknown-tenex exit ;; KS10:TOPS-20:*:* | KL10:TOPS-20:*:* | TYPE4:TOPS-20:*:*) echo pdp10-dec-tops20 exit ;; XKL-1:TOPS-20:*:* | TYPE5:TOPS-20:*:*) echo pdp10-xkl-tops20 exit ;; *:TOPS-20:*:*) echo pdp10-unknown-tops20 exit ;; *:ITS:*:*) echo pdp10-unknown-its exit ;; SEI:*:*:SEIUX) echo mips-sei-seiux${UNAME_RELEASE} exit ;; *:DragonFly:*:*) echo ${UNAME_MACHINE}-unknown-dragonfly`echo ${UNAME_RELEASE}|sed -e 's/[-(].*//'` exit ;; *:*VMS:*:*) UNAME_MACHINE=`(uname -p) 2>/dev/null` case "${UNAME_MACHINE}" in A*) echo alpha-dec-vms ; exit ;; I*) echo ia64-dec-vms ; exit ;; V*) echo vax-dec-vms ; exit ;; esac ;; *:XENIX:*:SysV) echo i386-pc-xenix exit ;; i*86:skyos:*:*) echo ${UNAME_MACHINE}-pc-skyos`echo ${UNAME_RELEASE}` | sed -e 's/ .*$//' exit ;; i*86:rdos:*:*) echo ${UNAME_MACHINE}-pc-rdos exit ;; i*86:AROS:*:*) echo ${UNAME_MACHINE}-pc-aros exit ;; x86_64:VMkernel:*:*) echo ${UNAME_MACHINE}-unknown-esx exit ;; esac eval $set_cc_for_build cat >$dummy.c < # include #endif main () { #if defined (sony) #if defined (MIPSEB) /* BFD wants "bsd" instead of "newsos". Perhaps BFD should be changed, I don't know.... */ printf ("mips-sony-bsd\n"); exit (0); #else #include printf ("m68k-sony-newsos%s\n", #ifdef NEWSOS4 "4" #else "" #endif ); exit (0); #endif #endif #if defined (__arm) && defined (__acorn) && defined (__unix) printf ("arm-acorn-riscix\n"); exit (0); #endif #if defined (hp300) && !defined (hpux) printf ("m68k-hp-bsd\n"); exit (0); #endif #if defined (NeXT) #if !defined (__ARCHITECTURE__) #define __ARCHITECTURE__ "m68k" #endif int version; version=`(hostinfo | sed -n 's/.*NeXT Mach \([0-9]*\).*/\1/p') 2>/dev/null`; if (version < 4) printf ("%s-next-nextstep%d\n", __ARCHITECTURE__, version); else printf ("%s-next-openstep%d\n", __ARCHITECTURE__, version); exit (0); #endif #if defined (MULTIMAX) || defined (n16) #if defined (UMAXV) printf ("ns32k-encore-sysv\n"); exit (0); #else #if defined (CMU) printf ("ns32k-encore-mach\n"); exit (0); #else printf ("ns32k-encore-bsd\n"); exit (0); #endif #endif #endif #if defined (__386BSD__) printf ("i386-pc-bsd\n"); exit (0); #endif #if defined (sequent) #if defined (i386) printf ("i386-sequent-dynix\n"); exit (0); #endif #if defined (ns32000) printf ("ns32k-sequent-dynix\n"); exit (0); #endif #endif #if defined (_SEQUENT_) struct utsname un; uname(&un); if (strncmp(un.version, "V2", 2) == 0) { printf ("i386-sequent-ptx2\n"); exit (0); } if (strncmp(un.version, "V1", 2) == 0) { /* XXX is V1 correct? */ printf ("i386-sequent-ptx1\n"); exit (0); } printf ("i386-sequent-ptx\n"); exit (0); #endif #if defined (vax) # if !defined (ultrix) # include # if defined (BSD) # if BSD == 43 printf ("vax-dec-bsd4.3\n"); exit (0); # else # if BSD == 199006 printf ("vax-dec-bsd4.3reno\n"); exit (0); # else printf ("vax-dec-bsd\n"); exit (0); # endif # endif # else printf ("vax-dec-bsd\n"); exit (0); # endif # else printf ("vax-dec-ultrix\n"); exit (0); # endif #endif #if defined (alliant) && defined (i860) printf ("i860-alliant-bsd\n"); exit (0); #endif exit (1); } EOF $CC_FOR_BUILD -o $dummy $dummy.c 2>/dev/null && SYSTEM_NAME=`$dummy` && { echo "$SYSTEM_NAME"; exit; } # Apollos put the system type in the environment. test -d /usr/apollo && { echo ${ISP}-apollo-${SYSTYPE}; exit; } # Convex versions that predate uname can use getsysinfo(1) if [ -x /usr/convex/getsysinfo ] then case `getsysinfo -f cpu_type` in c1*) echo c1-convex-bsd exit ;; c2*) if getsysinfo -f scalar_acc then echo c32-convex-bsd else echo c2-convex-bsd fi exit ;; c34*) echo c34-convex-bsd exit ;; c38*) echo c38-convex-bsd exit ;; c4*) echo c4-convex-bsd exit ;; esac fi cat >&2 < in order to provide the needed information to handle your system. config.guess timestamp = $timestamp uname -m = `(uname -m) 2>/dev/null || echo unknown` uname -r = `(uname -r) 2>/dev/null || echo unknown` uname -s = `(uname -s) 2>/dev/null || echo unknown` uname -v = `(uname -v) 2>/dev/null || echo unknown` /usr/bin/uname -p = `(/usr/bin/uname -p) 2>/dev/null` /bin/uname -X = `(/bin/uname -X) 2>/dev/null` hostinfo = `(hostinfo) 2>/dev/null` /bin/universe = `(/bin/universe) 2>/dev/null` /usr/bin/arch -k = `(/usr/bin/arch -k) 2>/dev/null` /bin/arch = `(/bin/arch) 2>/dev/null` /usr/bin/oslevel = `(/usr/bin/oslevel) 2>/dev/null` /usr/convex/getsysinfo = `(/usr/convex/getsysinfo) 2>/dev/null` UNAME_MACHINE = ${UNAME_MACHINE} UNAME_RELEASE = ${UNAME_RELEASE} UNAME_SYSTEM = ${UNAME_SYSTEM} UNAME_VERSION = ${UNAME_VERSION} EOF exit 1 # Local variables: # eval: (add-hook 'write-file-hooks 'time-stamp) # time-stamp-start: "timestamp='" # time-stamp-format: "%:y-%02m-%02d" # time-stamp-end: "'" # End: jupp/config.h010064400000000000000000000115211364306522300104050ustar00#ifndef JUPP_CONFIG_H #define JUPP_CONFIG_H /* see bottom for RCSID on this one */ #ifndef TEST #include "autoconf.h" #else #define HAVE_CTIME 1 #define HAVE_STRLCAT 1 #define HAVE_STRLCPY 1 #define HAVE_DECL_STRLCAT 1 #define HAVE_DECL_STRLCPY 1 #define HAVE_GETCWD 1 #define HAVE_MKSTEMP 1 #define HAVE_SNPRINTF 1 #define HAVE_SYS_TYPES_H 1 #define HAVE_SYS_STAT_H 1 #define HAVE_DIRENT_H 1 #define HAVE_LIMITS_H 1 #define HAVE_SIGNAL_H 1 #define HAVE_STDLIB_H 1 #define HAVE_UNISTD_H 1 #define RETSIGTYPE void #endif #ifdef HAVE_SYS_TYPES_H #include #endif #ifdef HAVE_SNPRINTF #define joe_snprintf_0(buf,len,fmt) snprintf((buf),(len),(fmt)) #define joe_snprintf_1(buf,len,fmt,a) snprintf((buf),(len),(fmt),(a)) #define joe_snprintf_2(buf,len,fmt,a,b) snprintf((buf),(len),(fmt),(a),(b)) #define joe_snprintf_3(buf,len,fmt,a,b,c) snprintf((buf),(len),(fmt),(a),(b),(c)) #define joe_snprintf_4(buf,len,fmt,a,b,c,d) snprintf((buf),(len),(fmt),(a),(b),(c),(d)) #define joe_snprintf_5(buf,len,fmt,a,b,c,d,e) snprintf((buf),(len),(fmt),(a),(b),(c),(d),(e)) #define joe_snprintf_6(buf,len,fmt,a,b,c,d,e,f) snprintf((buf),(len),(fmt),(a),(b),(c),(d),(e),(f)) #define joe_snprintf_7(buf,len,fmt,a,b,c,d,e,f,g) snprintf((buf),(len),(fmt),(a),(b),(c),(d),(e),(f),(g)) #define joe_snprintf_8(buf,len,fmt,a,b,c,d,e,f,g,h) snprintf((buf),(len),(fmt),(a),(b),(c),(d),(e),(f),(g),(h)) #define joe_snprintf_9(buf,len,fmt,a,b,c,d,e,f,g,h,i) snprintf((buf),(len),(fmt),(a),(b),(c),(d),(e),(f),(g),(h),(i)) #define joe_snprintf_10(buf,len,fmt,a,b,c,d,e,f,g,h,i,j) snprintf((buf),(len),(fmt),(a),(b),(c),(d),(e),(f),(g),(h),(i),(j)) #else #define joe_snprintf_0(buf,len,fmt) sprintf((buf),(fmt)) #define joe_snprintf_1(buf,len,fmt,a) sprintf((buf),(fmt),(a)) #define joe_snprintf_2(buf,len,fmt,a,b) sprintf((buf),(fmt),(a),(b)) #define joe_snprintf_3(buf,len,fmt,a,b,c) sprintf((buf),(fmt),(a),(b),(c)) #define joe_snprintf_4(buf,len,fmt,a,b,c,d) sprintf((buf),(fmt),(a),(b),(c),(d)) #define joe_snprintf_5(buf,len,fmt,a,b,c,d,e) sprintf((buf),(fmt),(a),(b),(c),(d),(e)) #define joe_snprintf_6(buf,len,fmt,a,b,c,d,e,f) sprintf((buf),(fmt),(a),(b),(c),(d),(e),(f)) #define joe_snprintf_7(buf,len,fmt,a,b,c,d,e,f,g) sprintf((buf),(fmt),(a),(b),(c),(d),(e),(f),(g)) #define joe_snprintf_8(buf,len,fmt,a,b,c,d,e,f,g,h) sprintf((buf),(fmt),(a),(b),(c),(d),(e),(f),(g),(h)) #define joe_snprintf_9(buf,len,fmt,a,b,c,d,e,f,g,h,i) sprintf((buf),(fmt),(a),(b),(c),(d),(e),(f),(g),(h),(i)) #define joe_snprintf_10(buf,len,fmt,a,b,c,d,e,f,g,h,i,j) sprintf((buf),(fmt),(a),(b),(c),(d),(e),(f),(g),(h),(i),(j)) #endif #include #ifndef EOF #define EOF (-1) #endif #define NO_MORE_DATA EOF #ifdef PAGE_SIZE #define PGSIZE PAGE_SIZE #else #define PGSIZE 4096 #endif #define SEGSIZ PGSIZE #define LPGSIZE 12 #define ILIMIT (PGSIZE*1024) #define HTSIZE 2048 #if !defined(__GNUC__) && !defined(__attribute__) #define __attribute__(p) /* nothing */ #endif #ifdef HAVE_GCC_ATTRIBUTE_BOUNDED #define ATTR_BOUNDED(p) __attribute__((__bounded__ p)) #else #define ATTR_BOUNDED(p) /* nothing */ #endif #if !HAVE_DECL_STRLCAT size_t strlcat(char *, const char *, size_t) ATTR_BOUNDED((__string__, 1, 3)); #endif #if !HAVE_DECL_STRLCPY size_t strlcpy(char *, const char *, size_t) ATTR_BOUNDED((__string__, 1, 3)); #endif /* from mksh */ #define BIT(i) (1U << (i)) #define NELEM(a) (sizeof(a) / sizeof((a)[0])) #if defined(MirBSD) && (MirBSD >= 0x09A1) && \ defined(__ELF__) && defined(__GNUC__) && \ !defined(__llvm__) && !defined(__NWCC__) /* * We got usable __IDSTRING __COPYRIGHT __RCSID __SCCSID macros * which work for all cases; no need to redefine them using the * "portable" macros from below when we might have the "better" * gcc+ELF specific macros or other system dependent ones. */ #else #undef __IDSTRING #undef __IDSTRING_CONCAT #undef __IDSTRING_EXPAND #undef __COPYRIGHT #undef __RCSID #undef __SCCSID #define __IDSTRING_CONCAT(l,p) __LINTED__ ## l ## _ ## p #define __IDSTRING_EXPAND(l,p) __IDSTRING_CONCAT(l,p) #ifdef MKSH_DONT_EMIT_IDSTRING #define __IDSTRING(prefix,string) /* nothing */ #elif defined(__ELF__) && defined(__GNUC__) && \ !(defined(__GNUC__) && defined(__mips16) && (__GNUC__ >= 8)) && \ !defined(__llvm__) && !defined(__NWCC__) && !defined(NO_ASM) #define __IDSTRING(prefix,string) \ __asm__(".section .comment" \ "\n .ascii \"@(\"\"#)" #prefix ": \"" \ "\n .asciz \"" string "\"" \ "\n .previous") #else #define __IDSTRING(prefix,string) \ static const char __IDSTRING_EXPAND(__LINE__,prefix) [] \ __attribute__((__used__)) = "@(""#)" #prefix ": " string #endif #define __COPYRIGHT(x) __IDSTRING(copyright,x) #define __RCSID(x) __IDSTRING(rcsid,x) #define __SCCSID(x) __IDSTRING(sccsid,x) #endif #ifdef EXTERN __IDSTRING(rcsid_config_h, "$MirOS: contrib/code/jupp/config.h,v 1.18 2020/04/07 11:56:40 tg Exp $"); #endif #endif /* ifndef JUPP_CONFIG_H */ jupp/config.sub010064400000000000000000001065671353422525600107710ustar00#! /bin/sh # $MirOS: contrib/code/jupp/config.sub,v 1.9 2019/09/05 15:32:35 tg Exp $ # $miros: contrib/gnu/config/config.sub,v 1.16 2019/09/05 15:26:05 tg Exp $ #- # Configuration validation subroutine script. # Copyright (C) 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999, # 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010, # 2011, 2012, 2013 Free Software Foundation, Inc. # Copyright © 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2013, 2019 # mirabilos # Maintenance, due to licence changes upstream, no longer is with FSF. timestamp='2019-09-05 (MirOS, GNU 2012-12-23)' # This file is (in principle) common to ALL GNU software. # The presence of a machine in this file suggests that SOME GNU software # can handle that machine. It does not imply ALL GNU software can. # # This file is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation; either version 2 of the License, or # (at your option) any later version. # # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU General Public License for more details. # # You should have received a copy of the GNU General Public License # along with this program; if not, see . # # As a special exception to the GNU General Public License, if you # distribute this file as part of a program that contains a # configuration script generated by Autoconf, you may include it under # the same distribution terms that you use for the rest of that program. # Please send patches to . Submit a context # diff and a properly formatted GNU ChangeLog entry. # # Configuration subroutine to validate and canonicalize a configuration type. # Supply the specified configuration type as an argument. # If it is invalid, we print an error message on stderr and exit with code 1. # Otherwise, we print the canonical config type on stdout and succeed. # You can get the latest version of this script from: # http://git.savannah.gnu.org/gitweb/?p=config.git;a=blob_plain;f=config.sub;hb=HEAD # This file is supposed to be the same for all GNU packages # and recognize all the CPU types, system types and aliases # that are meaningful with *any* GNU software. # Each package is responsible for reporting which valid configurations # it does not support. The user should be able to distinguish # a failure to support a valid configuration from a meaningless # configuration. # The goal of this file is to map all the various variations of a given # machine specification into a single specification in the form: # CPU_TYPE-MANUFACTURER-OPERATING_SYSTEM # or in some cases, the newer four-part form: # CPU_TYPE-MANUFACTURER-KERNEL-OPERATING_SYSTEM # It is wrong to echo any other type of specification. me=`echo "$0" | sed -e 's,.*/,,'` usage="\ Usage: $0 [OPTION] CPU-MFR-OPSYS $0 [OPTION] ALIAS Canonicalize a configuration name. Operation modes: -h, --help print this help, then exit -t, --time-stamp print date of last modification, then exit -v, --version print version number, then exit Report bugs and patches to ." version="\ GNU config.sub ($timestamp) Copyright (C) 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011, 2012, 2013 Free Software Foundation, Inc. This is free software; see the source for copying conditions. There is NO warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE." help=" Try \`$me --help' for more information." # Parse command line while test $# -gt 0 ; do case $1 in --time-stamp | --time* | -t ) echo "$timestamp" ; exit ;; --version | -v ) echo "$version" ; exit ;; --help | --h* | -h ) echo "$usage"; exit ;; -- ) # Stop option processing shift; break ;; - ) # Use stdin as input. break ;; -* ) echo "$me: invalid option $1$help" exit 1 ;; *local*) # First pass through any local machine types. echo $1 exit ;; * ) break ;; esac done case $# in 0) echo "$me: missing argument$help" >&2 exit 1;; 1) ;; *) echo "$me: too many arguments$help" >&2 exit 1;; esac # Separate what the user gave into CPU-COMPANY and OS or KERNEL-OS (if any). # Here we must recognize all the valid KERNEL-OS combinations. maybe_os=`echo $1 | sed 's/^\(.*\)-\([^-]*-[^-]*\)$/\2/'` case $maybe_os in nto-qnx* | linux-gnu* | linux-android* | linux-dietlibc | linux-newlib* | \ linux-musl* | linux-uclibc* | uclinux-uclibc* | uclinux-gnu* | kfreebsd*-gnu* | \ knetbsd*-gnu* | netbsd*-gnu* | \ kopensolaris*-gnu* | \ storm-chaos* | os2-emx* | rtmk-nova*) os=-$maybe_os basic_machine=`echo $1 | sed 's/^\(.*\)-\([^-]*-[^-]*\)$/\1/'` ;; android-linux) os=-linux-android basic_machine=`echo $1 | sed 's/^\(.*\)-\([^-]*-[^-]*\)$/\1/'`-unknown ;; *) basic_machine=`echo $1 | sed 's/-[^-]*$//'` if [ $basic_machine != $1 ] then os=`echo $1 | sed 's/.*-/-/'` else os=; fi ;; esac ### Let's recognize common machines as not being operating systems so ### that things like config.sub decstation-3100 work. We also ### recognize some manufacturers as not being operating systems, so we ### can provide default operating systems below. case $os in -sun*os*) # Prevent following clause from handling this invalid input. ;; -dec* | -mips* | -sequent* | -encore* | -pc532* | -sgi* | -sony* | \ -att* | -7300* | -3300* | -delta* | -motorola* | -sun[234]* | \ -unicom* | -ibm* | -next | -hp | -isi* | -apollo | -altos* | \ -convergent* | -ncr* | -news | -32* | -3600* | -3100* | -hitachi* |\ -c[123]* | -convex* | -sun | -crds | -omron* | -dg | -ultra | -tti* | \ -harris | -dolphin | -highlevel | -gould | -cbm | -ns | -masscomp | \ -apple | -axis | -knuth | -cray | -microblaze*) os= basic_machine=$1 ;; -bluegene*) os=-cnk ;; -sim | -cisco | -oki | -wec | -winbond) os= basic_machine=$1 ;; -scout) ;; -wrs) os=-vxworks basic_machine=$1 ;; -chorusos*) os=-chorusos basic_machine=$1 ;; -chorusrdb) os=-chorusrdb basic_machine=$1 ;; -hiux*) os=-hiuxwe2 ;; -sco6) os=-sco5v6 basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'` ;; -sco5) os=-sco3.2v5 basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'` ;; -sco4) os=-sco3.2v4 basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'` ;; -sco3.2.[4-9]*) os=`echo $os | sed -e 's/sco3.2./sco3.2v/'` basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'` ;; -sco3.2v[4-9]*) # Don't forget version if it is 3.2v4 or newer. basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'` ;; -sco5v6*) # Don't forget version if it is 3.2v4 or newer. basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'` ;; -sco*) os=-sco3.2v2 basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'` ;; -udk*) basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'` ;; -isc) os=-isc2.2 basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'` ;; -clix*) basic_machine=clipper-intergraph ;; -isc*) basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'` ;; -lynx*178) os=-lynxos178 ;; -lynx*5) os=-lynxos5 ;; -lynx*) os=-lynxos ;; -ptx*) basic_machine=`echo $1 | sed -e 's/86-.*/86-sequent/'` ;; -windowsnt*) os=`echo $os | sed -e 's/windowsnt/winnt/'` ;; -psos*) os=-psos ;; -mint | -mint[0-9]*) basic_machine=m68k-atari os=-mint ;; esac # Decode aliases for certain CPU-COMPANY combinations. case $basic_machine in # Recognize the basic CPU types without company name. # Some are omitted here because they have special meanings below. 1750a | 580 \ | a29k \ | aarch64 | aarch64_be \ | alpha | alphaev[4-8] | alphaev56 | alphaev6[78] | alphapca5[67] \ | alpha64 | alpha64ev[4-8] | alpha64ev56 | alpha64ev6[78] | alpha64pca5[67] \ | am33_2.0 \ | arc \ | arm | arm[bl]e | arme[lb] | armv[2-8] | armv[3-8][lb] | armv7[arm] \ | avr | avr32 \ | be32 | be64 \ | bfin \ | c4x | clipper \ | d10v | d30v | dlx | dsp16xx \ | epiphany \ | fido | fr30 | frv \ | h8300 | h8500 | hppa | hppa1.[01] | hppa2.0 | hppa2.0[nw] | hppa64 \ | hexagon \ | i370 | i860 | i960 | ia64 \ | ip2k | iq2000 \ | le32 | le64 \ | lm32 \ | m32c | m32r | m32rle | m68000 | m68k | m88k \ | maxq | mb | microblaze | microblazeel | mcore | mep | metag \ | mips | mipsbe | mipseb | mipsel | mipsle \ | mips16 \ | mips64 | mips64el \ | mips64octeon | mips64octeonel \ | mips64orion | mips64orionel \ | mips64r5900 | mips64r5900el \ | mips64vr | mips64vrel \ | mips64vr4100 | mips64vr4100el \ | mips64vr4300 | mips64vr4300el \ | mips64vr5000 | mips64vr5000el \ | mips64vr5900 | mips64vr5900el \ | mipsisa32 | mipsisa32el \ | mipsisa32r2 | mipsisa32r2el \ | mipsisa64 | mipsisa64el \ | mipsisa64r2 | mipsisa64r2el \ | mipsisa64sb1 | mipsisa64sb1el \ | mipsisa64sr71k | mipsisa64sr71kel \ | mipstx39 | mipstx39el \ | mn10200 | mn10300 \ | moxie \ | mt \ | msp430 \ | nds32 | nds32le | nds32be \ | nios | nios2 \ | ns16k | ns32k \ | open8 \ | or32 \ | pdp10 | pdp11 | pj | pjl \ | powerpc | powerpc64 | powerpc64le | powerpcle \ | pyramid \ | riscv32 | riscv64 \ | rl78 | rx \ | score \ | sh | sh[1234] | sh[24]a | sh[24]aeb | sh[23]e | sh[34]eb | sheb | shbe | shle | sh[1234]le | sh3ele \ | sh64 | sh64le \ | sparc | sparc64 | sparc64b | sparc64v | sparc86x | sparclet | sparclite \ | sparcv8 | sparcv9 | sparcv9b | sparcv9v \ | spu \ | tahoe | tic4x | tic54x | tic55x | tic6x | tic80 | tron \ | ubicom32 \ | v850 | v850e | v850e1 | v850e2 | v850es | v850e2v3 \ | we32k \ | x86 | xc16x | xstormy16 | xtensa \ | z8k | z80) basic_machine=$basic_machine-unknown ;; c54x) basic_machine=tic54x-unknown ;; c55x) basic_machine=tic55x-unknown ;; c6x) basic_machine=tic6x-unknown ;; m6811 | m68hc11 | m6812 | m68hc12 | m68hcs12x | picochip) basic_machine=$basic_machine-unknown os=-none ;; m88110 | m680[12346]0 | m683?2 | m68360 | m5200 | v70 | w65 | z8k) ;; ms1) basic_machine=mt-unknown ;; strongarm | thumb | xscale) basic_machine=arm-unknown ;; xgate) basic_machine=$basic_machine-unknown os=-none ;; xscaleeb) basic_machine=armeb-unknown ;; xscaleel) basic_machine=armel-unknown ;; # We use `pc' rather than `unknown' # because (1) that's what they normally are, and # (2) the word "unknown" tends to confuse beginning users. i*86 | x86_64) basic_machine=$basic_machine-pc ;; # Object if more than one company name word. *-*-*) echo Invalid configuration \`$1\': machine \`$basic_machine\' not recognized 1>&2 exit 1 ;; # Recognize the basic CPU types with company name. 580-* \ | a29k-* \ | aarch64-* | aarch64_be-* \ | alpha-* | alphaev[4-8]-* | alphaev56-* | alphaev6[78]-* \ | alpha64-* | alpha64ev[4-8]-* | alpha64ev56-* | alpha64ev6[78]-* \ | alphapca5[67]-* | alpha64pca5[67]-* | arc-* \ | arm-* | armbe-* | armle-* | armeb-* | armv*-* \ | avr-* | avr32-* \ | be32-* | be64-* \ | bfin-* | bs2000-* \ | c[123]* | c30-* | [cjt]90-* | c4x-* \ | clipper-* | craynv-* | cydra-* \ | d10v-* | d30v-* | dlx-* \ | elxsi-* \ | f30[01]-* | f700-* | fido-* | fr30-* | frv-* | fx80-* \ | h8300-* | h8500-* \ | hppa-* | hppa1.[01]-* | hppa2.0-* | hppa2.0[nw]-* | hppa64-* \ | hexagon-* \ | i*86-* | i860-* | i960-* | ia64-* \ | ip2k-* | iq2000-* \ | le32-* | le64-* \ | lm32-* \ | m32c-* | m32r-* | m32rle-* \ | m68000-* | m680[012346]0-* | m68360-* | m683?2-* | m68k-* \ | m88110-* | m88k-* | maxq-* | mcore-* | metag-* \ | microblaze-* | microblazeel-* \ | mips-* | mipsbe-* | mipseb-* | mipsel-* | mipsle-* \ | mips16-* \ | mips64-* | mips64el-* \ | mips64octeon-* | mips64octeonel-* \ | mips64orion-* | mips64orionel-* \ | mips64r5900-* | mips64r5900el-* \ | mips64vr-* | mips64vrel-* \ | mips64vr4100-* | mips64vr4100el-* \ | mips64vr4300-* | mips64vr4300el-* \ | mips64vr5000-* | mips64vr5000el-* \ | mips64vr5900-* | mips64vr5900el-* \ | mipsisa32-* | mipsisa32el-* \ | mipsisa32r2-* | mipsisa32r2el-* \ | mipsisa64-* | mipsisa64el-* \ | mipsisa64r2-* | mipsisa64r2el-* \ | mipsisa64sb1-* | mipsisa64sb1el-* \ | mipsisa64sr71k-* | mipsisa64sr71kel-* \ | mipstx39-* | mipstx39el-* \ | mmix-* \ | mt-* \ | msp430-* \ | nds32-* | nds32le-* | nds32be-* \ | nios-* | nios2-* \ | none-* | np1-* | ns16k-* | ns32k-* \ | open8-* \ | orion-* \ | pdp10-* | pdp11-* | pj-* | pjl-* | pn-* | power-* \ | powerpc-* | powerpc64-* | powerpc64le-* | powerpcle-* \ | pyramid-* \ | riscv32-* | riscv64-* \ | rl78-* | romp-* | rs6000-* | rx-* \ | sh-* | sh[1234]-* | sh[24]a-* | sh[24]aeb-* | sh[23]e-* | sh[34]eb-* | sheb-* | shbe-* \ | shle-* | sh[1234]le-* | sh3ele-* | sh64-* | sh64le-* \ | sparc-* | sparc64-* | sparc64b-* | sparc64v-* | sparc86x-* | sparclet-* \ | sparclite-* \ | sparcv8-* | sparcv9-* | sparcv9b-* | sparcv9v-* | sv1-* | sx?-* \ | tahoe-* \ | tic30-* | tic4x-* | tic54x-* | tic55x-* | tic6x-* | tic80-* \ | tile*-* \ | tron-* \ | ubicom32-* \ | v850-* | v850e-* | v850e1-* | v850es-* | v850e2-* | v850e2v3-* \ | vax-* \ | we32k-* \ | x86-* | x86_64-* | xc16x-* | xps100-* \ | xstormy16-* | xtensa*-* \ | ymp-* \ | z8k-* | z80-*) ;; # Recognize the basic CPU types without company name, with glob match. xtensa*) basic_machine=$basic_machine-unknown ;; # Recognize the various machine names and aliases which stand # for a CPU type and a company and sometimes even an OS. 386bsd) basic_machine=i386-unknown os=-bsd ;; 3b1 | 7300 | 7300-att | att-7300 | pc7300 | safari | unixpc) basic_machine=m68000-att ;; 3b*) basic_machine=we32k-att ;; a29khif) basic_machine=a29k-amd os=-udi ;; abacus) basic_machine=abacus-unknown ;; adobe68k) basic_machine=m68010-adobe os=-scout ;; alliant | fx80) basic_machine=fx80-alliant ;; altos | altos3068) basic_machine=m68k-altos ;; am29k) basic_machine=a29k-none os=-bsd ;; amd64) basic_machine=x86_64-pc ;; amd64-*) basic_machine=x86_64-`echo $basic_machine | sed 's/^[^-]*-//'` ;; amdahl) basic_machine=580-amdahl os=-sysv ;; amiga | amiga-*) basic_machine=m68k-unknown ;; amigaos | amigados) basic_machine=m68k-unknown os=-amigaos ;; amigaunix | amix) basic_machine=m68k-unknown os=-sysv4 ;; apollo68) basic_machine=m68k-apollo os=-sysv ;; apollo68bsd) basic_machine=m68k-apollo os=-bsd ;; aros) basic_machine=i386-pc os=-aros ;; aux) basic_machine=m68k-apple os=-aux ;; balance) basic_machine=ns32k-sequent os=-dynix ;; blackfin) basic_machine=bfin-unknown os=-linux ;; blackfin-*) basic_machine=bfin-`echo $basic_machine | sed 's/^[^-]*-//'` os=-linux ;; bluegene*) basic_machine=powerpc-ibm os=-cnk ;; c54x-*) basic_machine=tic54x-`echo $basic_machine | sed 's/^[^-]*-//'` ;; c55x-*) basic_machine=tic55x-`echo $basic_machine | sed 's/^[^-]*-//'` ;; c6x-*) basic_machine=tic6x-`echo $basic_machine | sed 's/^[^-]*-//'` ;; c90) basic_machine=c90-cray os=-unicos ;; cegcc) basic_machine=arm-unknown os=-cegcc ;; convex-c1) basic_machine=c1-convex os=-bsd ;; convex-c2) basic_machine=c2-convex os=-bsd ;; convex-c32) basic_machine=c32-convex os=-bsd ;; convex-c34) basic_machine=c34-convex os=-bsd ;; convex-c38) basic_machine=c38-convex os=-bsd ;; cray | j90) basic_machine=j90-cray os=-unicos ;; craynv) basic_machine=craynv-cray os=-unicosmp ;; cr16 | cr16-*) basic_machine=cr16-unknown os=-elf ;; crds | unos) basic_machine=m68k-crds ;; crisv32 | crisv32-* | etraxfs*) basic_machine=crisv32-axis ;; cris | cris-* | etrax*) basic_machine=cris-axis ;; crx) basic_machine=crx-unknown os=-elf ;; da30 | da30-*) basic_machine=m68k-da30 ;; decstation | decstation-3100 | pmax | pmax-* | pmin | dec3100 | decstatn) basic_machine=mips-dec ;; decsystem10* | dec10*) basic_machine=pdp10-dec os=-tops10 ;; decsystem20* | dec20*) basic_machine=pdp10-dec os=-tops20 ;; delta | 3300 | motorola-3300 | motorola-delta \ | 3300-motorola | delta-motorola) basic_machine=m68k-motorola ;; delta88) basic_machine=m88k-motorola os=-sysv3 ;; dicos) basic_machine=i686-pc os=-dicos ;; djgpp) basic_machine=i586-pc os=-msdosdjgpp ;; dpx20 | dpx20-*) basic_machine=rs6000-bull os=-bosx ;; dpx2* | dpx2*-bull) basic_machine=m68k-bull os=-sysv3 ;; ebmon29k) basic_machine=a29k-amd os=-ebmon ;; elxsi) basic_machine=elxsi-elxsi os=-bsd ;; encore | umax | mmax) basic_machine=ns32k-encore ;; es1800 | OSE68k | ose68k | ose | OSE) basic_machine=m68k-ericsson os=-ose ;; fx2800) basic_machine=i860-alliant ;; genix) basic_machine=ns32k-ns ;; gmicro) basic_machine=tron-gmicro os=-sysv ;; go32) basic_machine=i386-pc os=-go32 ;; h3050r* | hiux*) basic_machine=hppa1.1-hitachi os=-hiuxwe2 ;; h8300hms) basic_machine=h8300-hitachi os=-hms ;; h8300xray) basic_machine=h8300-hitachi os=-xray ;; h8500hms) basic_machine=h8500-hitachi os=-hms ;; harris) basic_machine=m88k-harris os=-sysv3 ;; hp300-*) basic_machine=m68k-hp ;; hp300bsd) basic_machine=m68k-hp os=-bsd ;; hp300hpux) basic_machine=m68k-hp os=-hpux ;; hp3k9[0-9][0-9] | hp9[0-9][0-9]) basic_machine=hppa1.0-hp ;; hp9k2[0-9][0-9] | hp9k31[0-9]) basic_machine=m68000-hp ;; hp9k3[2-9][0-9]) basic_machine=m68k-hp ;; hp9k6[0-9][0-9] | hp6[0-9][0-9]) basic_machine=hppa1.0-hp ;; hp9k7[0-79][0-9] | hp7[0-79][0-9]) basic_machine=hppa1.1-hp ;; hp9k78[0-9] | hp78[0-9]) # FIXME: really hppa2.0-hp basic_machine=hppa1.1-hp ;; hp9k8[67]1 | hp8[67]1 | hp9k80[24] | hp80[24] | hp9k8[78]9 | hp8[78]9 | hp9k893 | hp893) # FIXME: really hppa2.0-hp basic_machine=hppa1.1-hp ;; hp9k8[0-9][13679] | hp8[0-9][13679]) basic_machine=hppa1.1-hp ;; hp9k8[0-9][0-9] | hp8[0-9][0-9]) basic_machine=hppa1.0-hp ;; hppa-next) os=-nextstep3 ;; hppaosf) basic_machine=hppa1.1-hp os=-osf ;; hppro) basic_machine=hppa1.1-hp os=-proelf ;; i370-ibm* | ibm*) basic_machine=i370-ibm ;; i*86v32) basic_machine=`echo $1 | sed -e 's/86.*/86-pc/'` os=-sysv32 ;; i*86v4*) basic_machine=`echo $1 | sed -e 's/86.*/86-pc/'` os=-sysv4 ;; i*86v) basic_machine=`echo $1 | sed -e 's/86.*/86-pc/'` os=-sysv ;; i*86sol2) basic_machine=`echo $1 | sed -e 's/86.*/86-pc/'` os=-solaris2 ;; i386mach) basic_machine=i386-mach os=-mach ;; i386-vsta | vsta) basic_machine=i386-unknown os=-vsta ;; iris | iris4d) basic_machine=mips-sgi case $os in -irix*) ;; *) os=-irix4 ;; esac ;; isi68 | isi) basic_machine=m68k-isi os=-sysv ;; m68knommu) basic_machine=m68k-unknown os=-linux ;; m68knommu-*) basic_machine=m68k-`echo $basic_machine | sed 's/^[^-]*-//'` os=-linux ;; m88k-omron*) basic_machine=m88k-omron ;; magnum | m3230) basic_machine=mips-mips os=-sysv ;; merlin) basic_machine=ns32k-utek os=-sysv ;; microblaze*) basic_machine=microblaze-xilinx ;; mingw64) basic_machine=x86_64-pc os=-mingw64 ;; mingw32) basic_machine=i386-pc os=-mingw32 ;; mingw32ce) basic_machine=arm-unknown os=-mingw32ce ;; miniframe) basic_machine=m68000-convergent ;; *mint | -mint[0-9]* | *MiNT | *MiNT[0-9]*) basic_machine=m68k-atari os=-mint ;; mips3*-*) basic_machine=`echo $basic_machine | sed -e 's/mips3/mips64/'` ;; mips3*) basic_machine=`echo $basic_machine | sed -e 's/mips3/mips64/'`-unknown ;; monitor) basic_machine=m68k-rom68k os=-coff ;; morphos) basic_machine=powerpc-unknown os=-morphos ;; msdos) basic_machine=i386-pc os=-msdos ;; ms1-*) basic_machine=`echo $basic_machine | sed -e 's/ms1-/mt-/'` ;; msys) basic_machine=i386-pc os=-msys ;; mvs) basic_machine=i370-ibm os=-mvs ;; nacl) basic_machine=le32-unknown os=-nacl ;; ncr3000) basic_machine=i486-ncr os=-sysv4 ;; netbsd386) basic_machine=i386-unknown os=-netbsd ;; netwinder) basic_machine=armv4l-rebel os=-linux ;; news | news700 | news800 | news900) basic_machine=m68k-sony os=-newsos ;; news1000) basic_machine=m68030-sony os=-newsos ;; news-3600 | risc-news) basic_machine=mips-sony os=-newsos ;; necv70) basic_machine=v70-nec os=-sysv ;; next | m*-next ) basic_machine=m68k-next case $os in -nextstep* ) ;; -ns2*) os=-nextstep2 ;; *) os=-nextstep3 ;; esac ;; nh3000) basic_machine=m68k-harris os=-cxux ;; nh[45]000) basic_machine=m88k-harris os=-cxux ;; nindy960) basic_machine=i960-intel os=-nindy ;; mon960) basic_machine=i960-intel os=-mon960 ;; nonstopux) basic_machine=mips-compaq os=-nonstopux ;; np1) basic_machine=np1-gould ;; neo-tandem) basic_machine=neo-tandem ;; nse-tandem) basic_machine=nse-tandem ;; nsr-tandem) basic_machine=nsr-tandem ;; op50n-* | op60c-*) basic_machine=hppa1.1-oki os=-proelf ;; openrisc | openrisc-*) basic_machine=or32-unknown ;; os400) basic_machine=powerpc-ibm os=-os400 ;; OSE68000 | ose68000) basic_machine=m68000-ericsson os=-ose ;; os68k) basic_machine=m68k-none os=-os68k ;; pa-hitachi) basic_machine=hppa1.1-hitachi os=-hiuxwe2 ;; paragon) basic_machine=i860-intel os=-osf ;; parisc) basic_machine=hppa-unknown os=-linux ;; parisc-*) basic_machine=hppa-`echo $basic_machine | sed 's/^[^-]*-//'` os=-linux ;; pbd) basic_machine=sparc-tti ;; pbb) basic_machine=m68k-tti ;; pc532 | pc532-*) basic_machine=ns32k-pc532 ;; pc98) basic_machine=i386-pc ;; pc98-*) basic_machine=i386-`echo $basic_machine | sed 's/^[^-]*-//'` ;; pentium | p5 | k5 | k6 | nexgen | viac3) basic_machine=i586-pc ;; pentiumpro | p6 | 6x86 | athlon | athlon_*) basic_machine=i686-pc ;; pentiumii | pentium2 | pentiumiii | pentium3) basic_machine=i686-pc ;; pentium4) basic_machine=i786-pc ;; pentium-* | p5-* | k5-* | k6-* | nexgen-* | viac3-*) basic_machine=i586-`echo $basic_machine | sed 's/^[^-]*-//'` ;; pentiumpro-* | p6-* | 6x86-* | athlon-*) basic_machine=i686-`echo $basic_machine | sed 's/^[^-]*-//'` ;; pentiumii-* | pentium2-* | pentiumiii-* | pentium3-*) basic_machine=i686-`echo $basic_machine | sed 's/^[^-]*-//'` ;; pentium4-*) basic_machine=i786-`echo $basic_machine | sed 's/^[^-]*-//'` ;; pn) basic_machine=pn-gould ;; power) basic_machine=power-ibm ;; ppc | ppcbe) basic_machine=powerpc-unknown ;; ppc-* | ppcbe-*) basic_machine=powerpc-`echo $basic_machine | sed 's/^[^-]*-//'` ;; ppcle | powerpclittle | ppc-le | powerpc-little) basic_machine=powerpcle-unknown ;; ppcle-* | powerpclittle-*) basic_machine=powerpcle-`echo $basic_machine | sed 's/^[^-]*-//'` ;; ppc64) basic_machine=powerpc64-unknown ;; ppc64-*) basic_machine=powerpc64-`echo $basic_machine | sed 's/^[^-]*-//'` ;; ppc64le | powerpc64little | ppc64-le | powerpc64-little) basic_machine=powerpc64le-unknown ;; ppc64le-* | powerpc64little-*) basic_machine=powerpc64le-`echo $basic_machine | sed 's/^[^-]*-//'` ;; ps2) basic_machine=i386-ibm ;; pw32) basic_machine=i586-unknown os=-pw32 ;; rdos | rdos64) basic_machine=x86_64-pc os=-rdos ;; rdos32) basic_machine=i386-pc os=-rdos ;; rom68k) basic_machine=m68k-rom68k os=-coff ;; rm[46]00) basic_machine=mips-siemens ;; rtpc | rtpc-*) basic_machine=romp-ibm ;; s390 | s390-*) basic_machine=s390-ibm ;; s390x | s390x-*) basic_machine=s390x-ibm ;; sa29200) basic_machine=a29k-amd os=-udi ;; sb1) basic_machine=mipsisa64sb1-unknown ;; sb1el) basic_machine=mipsisa64sb1el-unknown ;; sde) basic_machine=mipsisa32-sde os=-elf ;; sei) basic_machine=mips-sei os=-seiux ;; sequent) basic_machine=i386-sequent ;; sh) basic_machine=sh-hitachi os=-hms ;; sh5el) basic_machine=sh5le-unknown ;; sh64) basic_machine=sh64-unknown ;; sparclite-wrs | simso-wrs) basic_machine=sparclite-wrs os=-vxworks ;; sps7) basic_machine=m68k-bull os=-sysv2 ;; spur) basic_machine=spur-unknown ;; st2000) basic_machine=m68k-tandem ;; stratus) basic_machine=i860-stratus os=-sysv4 ;; strongarm-* | thumb-*) basic_machine=arm-`echo $basic_machine | sed 's/^[^-]*-//'` ;; sun2) basic_machine=m68000-sun ;; sun2os3) basic_machine=m68000-sun os=-sunos3 ;; sun2os4) basic_machine=m68000-sun os=-sunos4 ;; sun3os3) basic_machine=m68k-sun os=-sunos3 ;; sun3os4) basic_machine=m68k-sun os=-sunos4 ;; sun4os3) basic_machine=sparc-sun os=-sunos3 ;; sun4os4) basic_machine=sparc-sun os=-sunos4 ;; sun4sol2) basic_machine=sparc-sun os=-solaris2 ;; sun3 | sun3-*) basic_machine=m68k-sun ;; sun4) basic_machine=sparc-sun ;; sun386 | sun386i | roadrunner) basic_machine=i386-sun ;; sv1) basic_machine=sv1-cray os=-unicos ;; symmetry) basic_machine=i386-sequent os=-dynix ;; t3e) basic_machine=alphaev5-cray os=-unicos ;; t90) basic_machine=t90-cray os=-unicos ;; tile*) basic_machine=$basic_machine-unknown os=-linux-gnu ;; tx39) basic_machine=mipstx39-unknown ;; tx39el) basic_machine=mipstx39el-unknown ;; toad1) basic_machine=pdp10-xkl os=-tops20 ;; tower | tower-32) basic_machine=m68k-ncr ;; tpf) basic_machine=s390x-ibm os=-tpf ;; udi29k) basic_machine=a29k-amd os=-udi ;; ultra3) basic_machine=a29k-nyu os=-sym1 ;; v810 | necv810) basic_machine=v810-nec os=-none ;; vaxv) basic_machine=vax-dec os=-sysv ;; vms) basic_machine=vax-dec os=-vms ;; vpp*|vx|vx-*) basic_machine=f301-fujitsu ;; vxworks960) basic_machine=i960-wrs os=-vxworks ;; vxworks68) basic_machine=m68k-wrs os=-vxworks ;; vxworks29k) basic_machine=a29k-wrs os=-vxworks ;; w65*) basic_machine=w65-wdc os=-none ;; w89k-*) basic_machine=hppa1.1-winbond os=-proelf ;; xbox) basic_machine=i686-pc os=-mingw32 ;; xps | xps100) basic_machine=xps100-honeywell ;; xscale-* | xscalee[bl]-*) basic_machine=`echo $basic_machine | sed 's/^xscale/arm/'` ;; ymp) basic_machine=ymp-cray os=-unicos ;; z8k-*-coff) basic_machine=z8k-unknown os=-sim ;; z80-*-coff) basic_machine=z80-unknown os=-sim ;; none) basic_machine=none-none os=-none ;; # Here we handle the default manufacturer of certain CPU types. It is in # some cases the only manufacturer, in others, it is the most popular. w89k) basic_machine=hppa1.1-winbond ;; op50n) basic_machine=hppa1.1-oki ;; op60c) basic_machine=hppa1.1-oki ;; romp) basic_machine=romp-ibm ;; mmix) basic_machine=mmix-knuth ;; rs6000) basic_machine=rs6000-ibm ;; vax) basic_machine=vax-dec ;; pdp10) # there are many clones, so DEC is not a safe bet basic_machine=pdp10-unknown ;; pdp11) basic_machine=pdp11-dec ;; we32k) basic_machine=we32k-att ;; sh[1234] | sh[24]a | sh[24]aeb | sh[34]eb | sh[1234]le | sh[23]ele) basic_machine=sh-unknown ;; sparc | sparcv8 | sparcv9 | sparcv9b | sparcv9v) basic_machine=sparc-sun ;; cydra) basic_machine=cydra-cydrome ;; orion) basic_machine=orion-highlevel ;; orion105) basic_machine=clipper-highlevel ;; mac | mpw | mac-mpw) basic_machine=m68k-apple ;; pmac | pmac-mpw) basic_machine=powerpc-apple ;; *-unknown) # Make sure to match an already-canonicalized machine name. ;; *) echo Invalid configuration \`$1\': machine \`$basic_machine\' not recognized 1>&2 exit 1 ;; esac # Here we canonicalize certain aliases for manufacturers. case $basic_machine in *-digital*) basic_machine=`echo $basic_machine | sed 's/digital.*/dec/'` ;; *-commodore*) basic_machine=`echo $basic_machine | sed 's/commodore.*/cbm/'` ;; *) ;; esac # Decode manufacturer-specific aliases for certain operating systems. if [ x"$os" != x"" ] then case $os in # First match some system type aliases # that might get confused with valid system types. # -solaris* is a basic system type, with this one exception. -auroraux) os=-auroraux ;; -solaris1 | -solaris1.*) os=`echo $os | sed -e 's|solaris1|sunos4|'` ;; -solaris) os=-solaris2 ;; -svr4*) os=-sysv4 ;; -unixware*) os=-sysv4.2uw ;; -gnu/linux*) os=`echo $os | sed -e 's|gnu/linux|linux-gnu|'` ;; # First accept the basic system types. # The portable systems comes first. # Each alternative MUST END IN A *, to match a version number. # -sysv* is not here because it comes later, after sysvr4. -gnu* | -bsd* | -mach* | -minix* | -genix* | -ultrix* | -irix* \ | -*vms* | -sco* | -esix* | -isc* | -aix* | -cnk* | -sunos | -sunos[34]*\ | -hpux* | -unos* | -osf* | -luna* | -dgux* | -auroraux* | -solaris* \ | -sym* | -kopensolaris* \ | -amigaos* | -amigados* | -msdos* | -newsos* | -unicos* | -aof* \ | -aos* | -aros* \ | -nindy* | -vxsim* | -vxworks* | -ebmon* | -hms* | -mvs* \ | -clix* | -riscos* | -uniplus* | -iris* | -rtu* | -xenix* \ | -hiux* | -386bsd* | -knetbsd* | -mirbsd* | -netbsd* \ | -bitrig* | -openbsd* | -solidbsd* | -midnightbsd* \ | -ekkobsd* | -kfreebsd* | -freebsd* | -riscix* | -lynxos* \ | -bosx* | -nextstep* | -cxux* | -aout* | -elf* | -oabi* \ | -ptx* | -coff* | -ecoff* | -winnt* | -domain* | -vsta* \ | -udi* | -eabi* | -lites* | -ieee* | -go32* | -aux* \ | -chorusos* | -chorusrdb* | -cegcc* \ | -cygwin* | -msys* | -pe* | -psos* | -moss* | -proelf* | -rtems* \ | -mingw32* | -mingw64* | -linux-gnu* | -linux-android* \ | -linux-newlib* | -linux-musl* | -linux-uclibc* \ | -uxpv* | -beos* | -mpeix* | -udk* \ | -interix* | -uwin* | -mks* | -rhapsody* | -darwin* | -opened* \ | -openstep* | -oskit* | -conix* | -pw32* | -nonstopux* \ | -storm-chaos* | -tops10* | -tenex* | -tops20* | -its* \ | -os2* | -vos* | -palmos* | -uclinux* | -nucleus* \ | -morphos* | -superux* | -rtmk* | -rtmk-nova* | -windiss* \ | -powermax* | -dnix* | -nx6 | -nx7 | -sei* | -dragonfly* \ | -skyos* | -haiku* | -rdos* | -toppers* | -drops* | -es*) # Remember, each alternative MUST END IN *, to match a version number. ;; -qnx*) case $basic_machine in x86-* | i*86-*) ;; *) os=-nto$os ;; esac ;; -nto-qnx*) ;; -nto*) os=`echo $os | sed -e 's|nto|nto-qnx|'` ;; -sim | -es1800* | -hms* | -xray | -os68k* | -none* | -v88r* \ | -windows* | -osx | -abug | -netware* | -os9* | -beos* | -haiku* \ | -macos* | -mpw* | -magic* | -mmixware* | -mon960* | -lnews*) ;; -mac*) os=`echo $os | sed -e 's|mac|macos|'` ;; -linux-dietlibc) os=-linux-dietlibc ;; -linux*) os=`echo $os | sed -e 's|linux|linux-gnu|'` ;; -sunos5*) os=`echo $os | sed -e 's|sunos5|solaris2|'` ;; -sunos6*) os=`echo $os | sed -e 's|sunos6|solaris3|'` ;; -opened*) os=-openedition ;; -os400*) os=-os400 ;; -wince*) os=-wince ;; -osfrose*) os=-osfrose ;; -osf*) os=-osf ;; -utek*) os=-bsd ;; -dynix*) os=-bsd ;; -acis*) os=-aos ;; -atheos*) os=-atheos ;; -syllable*) os=-syllable ;; -386bsd) os=-bsd ;; -ctix* | -uts*) os=-sysv ;; -nova*) os=-rtmk-nova ;; -ns2 ) os=-nextstep2 ;; -nsk*) os=-nsk ;; # Preserve the version number of sinix5. -sinix5.*) os=`echo $os | sed -e 's|sinix|sysv|'` ;; -sinix*) os=-sysv4 ;; -tpf*) os=-tpf ;; -triton*) os=-sysv3 ;; -oss*) os=-sysv3 ;; -svr4) os=-sysv4 ;; -svr3) os=-sysv3 ;; -sysvr4) os=-sysv4 ;; # This must come after -sysvr4. -sysv*) ;; -ose*) os=-ose ;; -es1800*) os=-ose ;; -xenix) os=-xenix ;; -*mint | -mint[0-9]* | -*MiNT | -MiNT[0-9]*) os=-mint ;; -aros*) os=-aros ;; -kaos*) os=-kaos ;; -zvmoe) os=-zvmoe ;; -dicos*) os=-dicos ;; -nacl*) ;; -none) ;; *) # Get rid of the `-' at the beginning of $os. os=`echo $os | sed 's/[^-]*-//'` echo Invalid configuration \`$1\': system \`$os\' not recognized 1>&2 exit 1 ;; esac else # Here we handle the default operating systems that come with various machines. # The value should be what the vendor currently ships out the door with their # machine or put another way, the most popular os provided with the machine. # Note that if you're going to try to match "-MANUFACTURER" here (say, # "-sun"), then you have to tell the case statement up towards the top # that MANUFACTURER isn't an operating system. Otherwise, code above # will signal an error saying that MANUFACTURER isn't an operating # system, and we'll never get to this point. case $basic_machine in score-*) os=-elf ;; spu-*) os=-elf ;; *-acorn) os=-riscix1.2 ;; arm*-rebel) os=-linux ;; arm*-semi) os=-aout ;; c4x-* | tic4x-*) os=-coff ;; hexagon-*) os=-elf ;; tic54x-*) os=-coff ;; tic55x-*) os=-coff ;; tic6x-*) os=-coff ;; # This must come before the *-dec entry. pdp10-*) os=-tops20 ;; pdp11-*) os=-none ;; *-dec | vax-*) os=-ultrix4.2 ;; m68*-apollo) os=-domain ;; i386-sun) os=-sunos4.0.2 ;; m68000-sun) os=-sunos3 ;; m68*-cisco) os=-aout ;; mep-*) os=-elf ;; mips*-cisco) os=-elf ;; mips*-*) os=-elf ;; or32-*) os=-coff ;; *-tti) # must be before sparc entry or we get the wrong os. os=-sysv3 ;; sparc-* | *-sun) os=-sunos4.1.1 ;; *-be) os=-beos ;; *-haiku) os=-haiku ;; *-ibm) os=-aix ;; *-knuth) os=-mmixware ;; *-wec) os=-proelf ;; *-winbond) os=-proelf ;; *-oki) os=-proelf ;; *-hp) os=-hpux ;; *-hitachi) os=-hiux ;; i860-* | *-att | *-ncr | *-altos | *-motorola | *-convergent) os=-sysv ;; *-cbm) os=-amigaos ;; *-dg) os=-dgux ;; *-dolphin) os=-sysv3 ;; m68k-ccur) os=-rtu ;; m88k-omron*) os=-luna ;; *-next ) os=-nextstep ;; *-sequent) os=-ptx ;; *-crds) os=-unos ;; *-ns) os=-genix ;; i370-*) os=-mvs ;; *-next) os=-nextstep3 ;; *-gould) os=-sysv ;; *-highlevel) os=-bsd ;; *-encore) os=-bsd ;; *-sgi) os=-irix ;; *-siemens) os=-sysv4 ;; *-masscomp) os=-rtu ;; f30[01]-fujitsu | f700-fujitsu) os=-uxpv ;; *-rom68k) os=-coff ;; *-*bug) os=-coff ;; *-apple) os=-macos ;; *-atari*) os=-mint ;; *) os=-none ;; esac fi # Here we handle the case where we know the os, and the CPU type, but not the # manufacturer. We pick the logical manufacturer. vendor=unknown case $basic_machine in *-unknown) case $os in -riscix*) vendor=acorn ;; -sunos*) vendor=sun ;; -cnk*|-aix*) vendor=ibm ;; -beos*) vendor=be ;; -hpux*) vendor=hp ;; -mpeix*) vendor=hp ;; -hiux*) vendor=hitachi ;; -unos*) vendor=crds ;; -dgux*) vendor=dg ;; -luna*) vendor=omron ;; -genix*) vendor=ns ;; -mvs* | -opened*) vendor=ibm ;; -os400*) vendor=ibm ;; -ptx*) vendor=sequent ;; -tpf*) vendor=ibm ;; -vxsim* | -vxworks* | -windiss*) vendor=wrs ;; -aux*) vendor=apple ;; -hms*) vendor=hitachi ;; -mpw* | -macos*) vendor=apple ;; -*mint | -mint[0-9]* | -*MiNT | -MiNT[0-9]*) vendor=atari ;; -vos*) vendor=stratus ;; -mirbsd*) vendor=ecce ;; esac basic_machine=`echo $basic_machine | sed "s/unknown/$vendor/"` ;; esac echo $basic_machine$os exit # Local variables: # eval: (add-hook 'write-file-hooks 'time-stamp) # time-stamp-start: "timestamp='" # time-stamp-format: "%:y-%02m-%02d" # time-stamp-end: "'" # End: jupp/configure010064400000000000000000011771351431513445400107120ustar00#! /bin/sh # Guess values for system-dependent variables and create Makefiles. # Generated by GNU Autoconf 2.61-MirPorts-3 for joe 3.1jupp41. # # Copyright (C) 1992, 1993, 1994, 1995, 1996, 1998, 1999, 2000, 2001, # 2002, 2003, 2004, 2005, 2006 Free Software Foundation, Inc. # This configure script is free software; the Free Software Foundation # gives unlimited permission to copy, distribute and modify it. ## --------------------- ## ## M4sh Initialization. ## ## --------------------- ## # Be more Bourne compatible DUALCASE=1; export DUALCASE # for MKS sh if test -n "${ZSH_VERSION+set}" && (emulate sh) >/dev/null 2>&1; then emulate sh NULLCMD=: # Zsh 3.x and 4.x performs word splitting on ${1+"$@"}, which # is contrary to our usage. Disable this feature. alias -g '${1+"$@"}'='"$@"' setopt NO_GLOB_SUBST else case `(set -o) 2>/dev/null` in *posix*) set -o posix ;; esac fi # PATH needs CR # Avoid depending upon Character Ranges. as_cr_letters='abcdefghijklmnopqrstuvwxyz' as_cr_LETTERS='ABCDEFGHIJKLMNOPQRSTUVWXYZ' as_cr_Letters=$as_cr_letters$as_cr_LETTERS as_cr_digits='0123456789' as_cr_alnum=$as_cr_Letters$as_cr_digits # The user is always right. if test "${PATH_SEPARATOR+set}" != set; then echo "#! /bin/sh" >conf$$.sh echo "exit 0" >>conf$$.sh chmod +x conf$$.sh if (PATH="/nonexistent;."; conf$$.sh) >/dev/null 2>&1; then PATH_SEPARATOR=';' else PATH_SEPARATOR=: fi rm -f conf$$.sh fi # Support unset when possible. if ( (MAIL=60; unset MAIL) || exit) >/dev/null 2>&1; then as_unset=unset else as_unset=false fi # IFS # We need space, tab and new line, in precisely that order. Quoting is # there to prevent editors from complaining about space-tab. # (If _AS_PATH_WALK were called with IFS unset, it would disable word # splitting by setting IFS to empty value.) as_nl=' ' IFS=" "" $as_nl" # Find who we are. Look in the path if we contain no directory separator. case $0 in *[\\/]* ) as_myself=$0 ;; *) as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. test -r "$as_dir/$0" && as_myself=$as_dir/$0 && break done IFS=$as_save_IFS ;; esac # We did not find ourselves, most probably we were run as `sh COMMAND' # in which case we are not to be found in the path. if test "x$as_myself" = x; then as_myself=$0 fi if test ! -f "$as_myself"; then echo "$as_myself: error: cannot find myself; rerun with an absolute file name" >&2 { (exit 1); exit 1; } fi # Work around bugs in pre-3.0 UWIN ksh. for as_var in ENV MAIL MAILPATH do ($as_unset $as_var) >/dev/null 2>&1 && $as_unset $as_var done PS1='$ ' PS2='> ' PS4='+ ' # NLS nuisances. for as_var in \ LANG LANGUAGE LC_ADDRESS LC_ALL LC_COLLATE LC_CTYPE LC_IDENTIFICATION \ LC_MEASUREMENT LC_MESSAGES LC_MONETARY LC_NAME LC_NUMERIC LC_PAPER \ LC_TELEPHONE LC_TIME do if (set +x; test -z "`(eval $as_var=C; export $as_var) 2>&1`"); then eval $as_var=C; export $as_var else ($as_unset $as_var) >/dev/null 2>&1 && $as_unset $as_var fi done # Required to use basename. if expr a : '\(a\)' >/dev/null 2>&1 && test "X`expr 00001 : '.*\(...\)'`" = X001; then as_expr=expr else as_expr=false fi if (basename -- /) >/dev/null 2>&1 && test "X`basename -- / 2>&1`" = "X/"; then as_basename=basename else as_basename=false fi # Name of the executable. as_me=`$as_basename -- "$0" || $as_expr X/"$0" : '.*/\([^/][^/]*\)/*$' \| \ X"$0" : 'X\(//\)$' \| \ X"$0" : 'X\(/\)' \| . 2>/dev/null || echo X/"$0" | sed '/^.*\/\([^/][^/]*\)\/*$/{ s//\1/ q } /^X\/\(\/\/\)$/{ s//\1/ q } /^X\/\(\/\).*/{ s//\1/ q } s/.*/./; q'` # CDPATH. $as_unset CDPATH if test "x$CONFIG_SHELL" = x; then if (eval ":") 2>/dev/null; then as_have_required=yes else as_have_required=no fi if test $as_have_required = yes && (eval ": (as_func_return () { (exit \$1) } as_func_success () { as_func_return 0 } as_func_failure () { as_func_return 1 } as_func_ret_success () { return 0 } as_func_ret_failure () { return 1 } exitcode=0 if as_func_success; then : else exitcode=1 echo as_func_success failed. fi if as_func_failure; then exitcode=1 echo as_func_failure succeeded. fi if as_func_ret_success; then : else exitcode=1 echo as_func_ret_success failed. fi if as_func_ret_failure; then exitcode=1 echo as_func_ret_failure succeeded. fi if ( set x; as_func_ret_success y && test x = \"\$1\" ); then : else exitcode=1 echo positional parameters were not saved. fi test \$exitcode = 0) || { (exit 1); exit 1; } ( as_lineno_1=\$LINENO as_lineno_2=\$LINENO test \"x\$as_lineno_1\" != \"x\$as_lineno_2\" && test \"x\`expr \$as_lineno_1 + 1\`\" = \"x\$as_lineno_2\") || { (exit 1); exit 1; } ") 2> /dev/null; then : else as_candidate_shells= as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in /bin$PATH_SEPARATOR/usr/bin$PATH_SEPARATOR$PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. case $as_dir in /*) for as_base in sh bash ksh sh5; do as_candidate_shells="$as_candidate_shells $as_dir/$as_base" done;; esac done IFS=$as_save_IFS for as_shell in $as_candidate_shells $SHELL; do # Try only shells that exist, to save several forks. if { test -f "$as_shell" || test -f "$as_shell.exe"; } && { ("$as_shell") 2> /dev/null <<\_ASEOF if test -n "${ZSH_VERSION+set}" && (emulate sh) >/dev/null 2>&1; then emulate sh NULLCMD=: # Zsh 3.x and 4.x performs word splitting on ${1+"$@"}, which # is contrary to our usage. Disable this feature. alias -g '${1+"$@"}'='"$@"' setopt NO_GLOB_SUBST else case `(set -o) 2>/dev/null` in *posix*) set -o posix ;; esac fi : _ASEOF }; then CONFIG_SHELL=$as_shell as_have_required=yes if { "$as_shell" 2> /dev/null <<\_ASEOF if test -n "${ZSH_VERSION+set}" && (emulate sh) >/dev/null 2>&1; then emulate sh NULLCMD=: # Zsh 3.x and 4.x performs word splitting on ${1+"$@"}, which # is contrary to our usage. Disable this feature. alias -g '${1+"$@"}'='"$@"' setopt NO_GLOB_SUBST else case `(set -o) 2>/dev/null` in *posix*) set -o posix ;; esac fi : (as_func_return () { (exit $1) } as_func_success () { as_func_return 0 } as_func_failure () { as_func_return 1 } as_func_ret_success () { return 0 } as_func_ret_failure () { return 1 } exitcode=0 if as_func_success; then : else exitcode=1 echo as_func_success failed. fi if as_func_failure; then exitcode=1 echo as_func_failure succeeded. fi if as_func_ret_success; then : else exitcode=1 echo as_func_ret_success failed. fi if as_func_ret_failure; then exitcode=1 echo as_func_ret_failure succeeded. fi if ( set x; as_func_ret_success y && test x = "$1" ); then : else exitcode=1 echo positional parameters were not saved. fi test $exitcode = 0) || { (exit 1); exit 1; } ( as_lineno_1=$LINENO as_lineno_2=$LINENO test "x$as_lineno_1" != "x$as_lineno_2" && test "x`expr $as_lineno_1 + 1`" = "x$as_lineno_2") || { (exit 1); exit 1; } _ASEOF }; then break fi fi done if test "x$CONFIG_SHELL" != x; then for as_var in BASH_ENV ENV do ($as_unset $as_var) >/dev/null 2>&1 && $as_unset $as_var done export CONFIG_SHELL exec "$CONFIG_SHELL" "$as_myself" ${1+"$@"} fi if test $as_have_required = no; then echo This script requires a shell more modern than all the echo shells that I found on your system. Please install a echo modern shell, or manually run the script under such a echo shell if you do have one. { (exit 1); exit 1; } fi fi fi (eval "as_func_return () { (exit \$1) } as_func_success () { as_func_return 0 } as_func_failure () { as_func_return 1 } as_func_ret_success () { return 0 } as_func_ret_failure () { return 1 } exitcode=0 if as_func_success; then : else exitcode=1 echo as_func_success failed. fi if as_func_failure; then exitcode=1 echo as_func_failure succeeded. fi if as_func_ret_success; then : else exitcode=1 echo as_func_ret_success failed. fi if as_func_ret_failure; then exitcode=1 echo as_func_ret_failure succeeded. fi if ( set x; as_func_ret_success y && test x = \"\$1\" ); then : else exitcode=1 echo positional parameters were not saved. fi test \$exitcode = 0") || { echo No shell found that supports shell functions. echo Please tell autoconf@gnu.org about your system, echo including any error possibly output before this echo message } as_lineno_1=$LINENO as_lineno_2=$LINENO test "x$as_lineno_1" != "x$as_lineno_2" && test "x`expr $as_lineno_1 + 1`" = "x$as_lineno_2" || { # Create $as_me.lineno as a copy of $as_myself, but with $LINENO # uniformly replaced by the line number. The first 'sed' inserts a # line-number line after each line using $LINENO; the second 'sed' # does the real work. The second script uses 'N' to pair each # line-number line with the line containing $LINENO, and appends # trailing '-' during substitution so that $LINENO is not a special # case at line end. # (Raja R Harinath suggested sed '=', and Paul Eggert wrote the # scripts with optimization help from Paolo Bonzini. Blame Lee # E. McMahon (1931-1989) for sed's syntax. :-) sed -n ' p /[$]LINENO/= ' <$as_myself | sed ' s/[$]LINENO.*/&-/ t lineno b :lineno N :loop s/[$]LINENO\([^'$as_cr_alnum'_].*\n\)\(.*\)/\2\1\2/ t loop s/-\n.*// ' >$as_me.lineno && chmod +x "$as_me.lineno" || { echo "$as_me: error: cannot create $as_me.lineno; rerun with a POSIX shell" >&2 { (exit 1); exit 1; }; } # Don't try to exec as it changes $[0], causing all sort of problems # (the dirname of $[0] is not the place where we might find the # original and so on. Autoconf is especially sensitive to this). . "./$as_me.lineno" # Exit status is that of the last command. exit } if (as_dir=`dirname -- /` && test "X$as_dir" = X/) >/dev/null 2>&1; then as_dirname=dirname else as_dirname=false fi ECHO_C= ECHO_N= ECHO_T= case `echo -n x` in -n*) case `echo 'x\c'` in *c*) ECHO_T=' ';; # ECHO_T is single tab character. *) ECHO_C='\c';; esac;; *) ECHO_N='-n';; esac if expr a : '\(a\)' >/dev/null 2>&1 && test "X`expr 00001 : '.*\(...\)'`" = X001; then as_expr=expr else as_expr=false fi rm -f conf$$ conf$$.exe conf$$.file if test -d conf$$.dir; then rm -f conf$$.dir/conf$$.file else rm -f conf$$.dir mkdir conf$$.dir fi echo >conf$$.file if ln -s conf$$.file conf$$ 2>/dev/null; then as_ln_s='ln -s' # ... but there are two gotchas: # 1) On MSYS, both `ln -s file dir' and `ln file dir' fail. # 2) DJGPP < 2.04 has no symlinks; `ln -s' creates a wrapper executable. # In both cases, we have to default to `cp -p'. ln -s conf$$.file conf$$.dir 2>/dev/null && test ! -f conf$$.exe || as_ln_s='cp -p' elif ln conf$$.file conf$$ 2>/dev/null; then as_ln_s=ln else as_ln_s='cp -p' fi rm -f conf$$ conf$$.exe conf$$.dir/conf$$.file conf$$.file rmdir conf$$.dir 2>/dev/null if mkdir -p . 2>/dev/null; then as_mkdir_p=: else test -d ./-p && rmdir ./-p as_mkdir_p=false fi if test -x / >/dev/null 2>&1; then as_test_x='test -x' else if ls -dL / >/dev/null 2>&1; then as_ls_L_option=L else as_ls_L_option= fi as_test_x=' eval sh -c '\'' if test -d "$1"; then test -d "$1/."; else case $1 in -*)set "./$1";; esac; case `ls -ld'$as_ls_L_option' "$1" 2>/dev/null` in ???[sx]*):;;*)false;;esac;fi '\'' sh ' fi as_executable_p=$as_test_x # Sed expression to map a string onto a valid CPP name. as_tr_cpp="eval sed 'y%*$as_cr_letters%P$as_cr_LETTERS%;s%[^_$as_cr_alnum]%_%g'" # Sed expression to map a string onto a valid variable name. as_tr_sh="eval sed 'y%*+%pp%;s%[^_$as_cr_alnum]%_%g'" exec 7<&0 &1 # Name of the host. # hostname on some systems (SVR3.2, Linux) returns a bogus exit status, # so uname gets run too. ac_hostname=`(hostname || uname -n) 2>/dev/null | sed 1q` # # Initializations. # ac_default_prefix=/usr/local ac_clean_files= ac_config_libobj_dir=. LIBOBJS= cross_compiling=no subdirs= MFLAGS= MAKEFLAGS= SHELL=${CONFIG_SHELL-/bin/sh} # Identity of this package. PACKAGE_NAME='joe' PACKAGE_TARNAME='joe' PACKAGE_VERSION='3.1jupp41' PACKAGE_STRING='joe 3.1jupp41' PACKAGE_BUGREPORT='' ac_unique_file="b.c" # Factoring default headers for most tests. ac_includes_default="\ #include #ifdef HAVE_SYS_TYPES_H # include #endif #ifdef HAVE_SYS_STAT_H # include #endif #ifdef STDC_HEADERS # include # include #else # ifdef HAVE_STDLIB_H # include # endif #endif #ifdef HAVE_STRING_H # if !defined STDC_HEADERS && defined HAVE_MEMORY_H # include # endif # include #endif #ifdef HAVE_STRINGS_H # include #endif #ifdef HAVE_INTTYPES_H # include #endif #ifdef HAVE_STDINT_H # include #endif #ifdef HAVE_UNISTD_H # include #endif" ac_subst_vars='SHELL PATH_SEPARATOR PACKAGE_NAME PACKAGE_TARNAME PACKAGE_VERSION PACKAGE_STRING PACKAGE_BUGREPORT exec_prefix prefix program_transform_name bindir sbindir libexecdir datarootdir datadir sysconfdir sharedstatedir localstatedir includedir oldincludedir docdir infodir htmldir dvidir pdfdir psdir libdir localedir mandir DEFS ECHO_C ECHO_N ECHO_T LIBS build_alias host_alias target_alias build build_cpu build_vendor build_os host host_cpu host_vendor host_os target target_cpu target_vendor target_os INSTALL_PROGRAM INSTALL_SCRIPT INSTALL_DATA CYGPATH_W PACKAGE VERSION ACLOCAL AUTOCONF AUTOMAKE AUTOHEADER MAKEINFO install_sh STRIP INSTALL_STRIP_PROGRAM mkdir_p AWK SET_MAKE am__leading_dot AMTAR am__tar am__untar MAINTAINER_MODE_TRUE MAINTAINER_MODE_FALSE MAINT CC CFLAGS LDFLAGS CPPFLAGS ac_ct_CC EXEEXT OBJEXT DEPDIR am__include am__quote AMDEP_TRUE AMDEP_FALSE AMDEPBACKSLASH CCDEPMODE am__fastdepCC_TRUE am__fastdepCC_FALSE CPP GREP EGREP LN_S WANT_TERMIDX_TRUE WANT_TERMIDX_FALSE sysconfjoesubdir joeinitfile joeinitcopy joeresides jrcbefore jrcafter LIBOBJS SPELL LTLIBOBJS' ac_subst_files='' ac_precious_vars='build_alias host_alias target_alias CC CFLAGS LDFLAGS LIBS CPPFLAGS CPP' # Initialize some variables set by options. ac_init_help= ac_init_version=false # The variables have the same names as the options, with # dashes changed to underlines. cache_file=/dev/null exec_prefix=NONE no_create= no_recursion= prefix=NONE program_prefix=NONE program_suffix=NONE program_transform_name=s,x,x, silent= site= srcdir= verbose= x_includes=NONE x_libraries=NONE # Installation directory options. # These are left unexpanded so users can "make install exec_prefix=/foo" # and all the variables that are supposed to be based on exec_prefix # by default will actually change. # Use braces instead of parens because sh, perl, etc. also accept them. # (The list follows the same order as the GNU Coding Standards.) bindir='${exec_prefix}/bin' sbindir='${exec_prefix}/sbin' libexecdir='${exec_prefix}/libexec' datarootdir='${prefix}/share' datadir='${datarootdir}' sysconfdir='${prefix}/etc' sharedstatedir='${prefix}/com' localstatedir='${prefix}/var' includedir='${prefix}/include' oldincludedir='/usr/include' docdir='${datarootdir}/doc/${PACKAGE_TARNAME}' infodir='${datarootdir}/info' htmldir='${docdir}' dvidir='${docdir}' pdfdir='${docdir}' psdir='${docdir}' libdir='${exec_prefix}/lib' localedir='${datarootdir}/locale' mandir='${datarootdir}/man' ac_prev= ac_dashdash= for ac_option do # If the previous option needs an argument, assign it. if test -n "$ac_prev"; then eval $ac_prev=\$ac_option ac_prev= continue fi case $ac_option in *=*) ac_optarg=`expr "X$ac_option" : '[^=]*=\(.*\)'` ;; *) ac_optarg=yes ;; esac # Accept the important Cygnus configure options, so we can diagnose typos. case $ac_dashdash$ac_option in --) ac_dashdash=yes ;; -bindir | --bindir | --bindi | --bind | --bin | --bi) ac_prev=bindir ;; -bindir=* | --bindir=* | --bindi=* | --bind=* | --bin=* | --bi=*) bindir=$ac_optarg ;; -build | --build | --buil | --bui | --bu) ac_prev=build_alias ;; -build=* | --build=* | --buil=* | --bui=* | --bu=*) build_alias=$ac_optarg ;; -cache-file | --cache-file | --cache-fil | --cache-fi \ | --cache-f | --cache- | --cache | --cach | --cac | --ca | --c) ac_prev=cache_file ;; -cache-file=* | --cache-file=* | --cache-fil=* | --cache-fi=* \ | --cache-f=* | --cache-=* | --cache=* | --cach=* | --cac=* | --ca=* | --c=*) cache_file=$ac_optarg ;; --config-cache | -C) cache_file=config.cache ;; -datadir | --datadir | --datadi | --datad) ac_prev=datadir ;; -datadir=* | --datadir=* | --datadi=* | --datad=*) datadir=$ac_optarg ;; -datarootdir | --datarootdir | --datarootdi | --datarootd | --dataroot \ | --dataroo | --dataro | --datar) ac_prev=datarootdir ;; -datarootdir=* | --datarootdir=* | --datarootdi=* | --datarootd=* \ | --dataroot=* | --dataroo=* | --dataro=* | --datar=*) datarootdir=$ac_optarg ;; -disable-* | --disable-*) ac_feature=`expr "x$ac_option" : 'x-*disable-\(.*\)'` # Reject names that are not valid shell variable names. expr "x$ac_feature" : ".*[^-._$as_cr_alnum]" >/dev/null && { echo "$as_me: error: invalid feature name: $ac_feature" >&2 { (exit 1); exit 1; }; } ac_feature=`echo $ac_feature | sed 's/[-.]/_/g'` eval enable_$ac_feature=no ;; -docdir | --docdir | --docdi | --doc | --do) ac_prev=docdir ;; -docdir=* | --docdir=* | --docdi=* | --doc=* | --do=*) docdir=$ac_optarg ;; -dvidir | --dvidir | --dvidi | --dvid | --dvi | --dv) ac_prev=dvidir ;; -dvidir=* | --dvidir=* | --dvidi=* | --dvid=* | --dvi=* | --dv=*) dvidir=$ac_optarg ;; -enable-* | --enable-*) ac_feature=`expr "x$ac_option" : 'x-*enable-\([^=]*\)'` # Reject names that are not valid shell variable names. expr "x$ac_feature" : ".*[^-._$as_cr_alnum]" >/dev/null && { echo "$as_me: error: invalid feature name: $ac_feature" >&2 { (exit 1); exit 1; }; } ac_feature=`echo $ac_feature | sed 's/[-.]/_/g'` eval enable_$ac_feature=\$ac_optarg ;; -exec-prefix | --exec_prefix | --exec-prefix | --exec-prefi \ | --exec-pref | --exec-pre | --exec-pr | --exec-p | --exec- \ | --exec | --exe | --ex) ac_prev=exec_prefix ;; -exec-prefix=* | --exec_prefix=* | --exec-prefix=* | --exec-prefi=* \ | --exec-pref=* | --exec-pre=* | --exec-pr=* | --exec-p=* | --exec-=* \ | --exec=* | --exe=* | --ex=*) exec_prefix=$ac_optarg ;; -gas | --gas | --ga | --g) # Obsolete; use --with-gas. with_gas=yes ;; -help | --help | --hel | --he | -h) ac_init_help=long ;; -help=r* | --help=r* | --hel=r* | --he=r* | -hr*) ac_init_help=recursive ;; -help=s* | --help=s* | --hel=s* | --he=s* | -hs*) ac_init_help=short ;; -host | --host | --hos | --ho) ac_prev=host_alias ;; -host=* | --host=* | --hos=* | --ho=*) host_alias=$ac_optarg ;; -htmldir | --htmldir | --htmldi | --htmld | --html | --htm | --ht) ac_prev=htmldir ;; -htmldir=* | --htmldir=* | --htmldi=* | --htmld=* | --html=* | --htm=* \ | --ht=*) htmldir=$ac_optarg ;; -includedir | --includedir | --includedi | --included | --include \ | --includ | --inclu | --incl | --inc) ac_prev=includedir ;; -includedir=* | --includedir=* | --includedi=* | --included=* | --include=* \ | --includ=* | --inclu=* | --incl=* | --inc=*) includedir=$ac_optarg ;; -infodir | --infodir | --infodi | --infod | --info | --inf) ac_prev=infodir ;; -infodir=* | --infodir=* | --infodi=* | --infod=* | --info=* | --inf=*) infodir=$ac_optarg ;; -libdir | --libdir | --libdi | --libd) ac_prev=libdir ;; -libdir=* | --libdir=* | --libdi=* | --libd=*) libdir=$ac_optarg ;; -libexecdir | --libexecdir | --libexecdi | --libexecd | --libexec \ | --libexe | --libex | --libe) ac_prev=libexecdir ;; -libexecdir=* | --libexecdir=* | --libexecdi=* | --libexecd=* | --libexec=* \ | --libexe=* | --libex=* | --libe=*) libexecdir=$ac_optarg ;; -localedir | --localedir | --localedi | --localed | --locale) ac_prev=localedir ;; -localedir=* | --localedir=* | --localedi=* | --localed=* | --locale=*) localedir=$ac_optarg ;; -localstatedir | --localstatedir | --localstatedi | --localstated \ | --localstate | --localstat | --localsta | --localst | --locals) ac_prev=localstatedir ;; -localstatedir=* | --localstatedir=* | --localstatedi=* | --localstated=* \ | --localstate=* | --localstat=* | --localsta=* | --localst=* | --locals=*) localstatedir=$ac_optarg ;; -mandir | --mandir | --mandi | --mand | --man | --ma | --m) ac_prev=mandir ;; -mandir=* | --mandir=* | --mandi=* | --mand=* | --man=* | --ma=* | --m=*) mandir=$ac_optarg ;; -nfp | --nfp | --nf) # Obsolete; use --without-fp. with_fp=no ;; -no-create | --no-create | --no-creat | --no-crea | --no-cre \ | --no-cr | --no-c | -n) no_create=yes ;; -no-recursion | --no-recursion | --no-recursio | --no-recursi \ | --no-recurs | --no-recur | --no-recu | --no-rec | --no-re | --no-r) no_recursion=yes ;; -oldincludedir | --oldincludedir | --oldincludedi | --oldincluded \ | --oldinclude | --oldinclud | --oldinclu | --oldincl | --oldinc \ | --oldin | --oldi | --old | --ol | --o) ac_prev=oldincludedir ;; -oldincludedir=* | --oldincludedir=* | --oldincludedi=* | --oldincluded=* \ | --oldinclude=* | --oldinclud=* | --oldinclu=* | --oldincl=* | --oldinc=* \ | --oldin=* | --oldi=* | --old=* | --ol=* | --o=*) oldincludedir=$ac_optarg ;; -prefix | --prefix | --prefi | --pref | --pre | --pr | --p) ac_prev=prefix ;; -prefix=* | --prefix=* | --prefi=* | --pref=* | --pre=* | --pr=* | --p=*) prefix=$ac_optarg ;; -program-prefix | --program-prefix | --program-prefi | --program-pref \ | --program-pre | --program-pr | --program-p) ac_prev=program_prefix ;; -program-prefix=* | --program-prefix=* | --program-prefi=* \ | --program-pref=* | --program-pre=* | --program-pr=* | --program-p=*) program_prefix=$ac_optarg ;; -program-suffix | --program-suffix | --program-suffi | --program-suff \ | --program-suf | --program-su | --program-s) ac_prev=program_suffix ;; -program-suffix=* | --program-suffix=* | --program-suffi=* \ | --program-suff=* | --program-suf=* | --program-su=* | --program-s=*) program_suffix=$ac_optarg ;; -program-transform-name | --program-transform-name \ | --program-transform-nam | --program-transform-na \ | --program-transform-n | --program-transform- \ | --program-transform | --program-transfor \ | --program-transfo | --program-transf \ | --program-trans | --program-tran \ | --progr-tra | --program-tr | --program-t) ac_prev=program_transform_name ;; -program-transform-name=* | --program-transform-name=* \ | --program-transform-nam=* | --program-transform-na=* \ | --program-transform-n=* | --program-transform-=* \ | --program-transform=* | --program-transfor=* \ | --program-transfo=* | --program-transf=* \ | --program-trans=* | --program-tran=* \ | --progr-tra=* | --program-tr=* | --program-t=*) program_transform_name=$ac_optarg ;; -pdfdir | --pdfdir | --pdfdi | --pdfd | --pdf | --pd) ac_prev=pdfdir ;; -pdfdir=* | --pdfdir=* | --pdfdi=* | --pdfd=* | --pdf=* | --pd=*) pdfdir=$ac_optarg ;; -psdir | --psdir | --psdi | --psd | --ps) ac_prev=psdir ;; -psdir=* | --psdir=* | --psdi=* | --psd=* | --ps=*) psdir=$ac_optarg ;; -q | -quiet | --quiet | --quie | --qui | --qu | --q \ | -silent | --silent | --silen | --sile | --sil) silent=yes ;; -sbindir | --sbindir | --sbindi | --sbind | --sbin | --sbi | --sb) ac_prev=sbindir ;; -sbindir=* | --sbindir=* | --sbindi=* | --sbind=* | --sbin=* \ | --sbi=* | --sb=*) sbindir=$ac_optarg ;; -sharedstatedir | --sharedstatedir | --sharedstatedi \ | --sharedstated | --sharedstate | --sharedstat | --sharedsta \ | --sharedst | --shareds | --shared | --share | --shar \ | --sha | --sh) ac_prev=sharedstatedir ;; -sharedstatedir=* | --sharedstatedir=* | --sharedstatedi=* \ | --sharedstated=* | --sharedstate=* | --sharedstat=* | --sharedsta=* \ | --sharedst=* | --shareds=* | --shared=* | --share=* | --shar=* \ | --sha=* | --sh=*) sharedstatedir=$ac_optarg ;; -site | --site | --sit) ac_prev=site ;; -site=* | --site=* | --sit=*) site=$ac_optarg ;; -srcdir | --srcdir | --srcdi | --srcd | --src | --sr) ac_prev=srcdir ;; -srcdir=* | --srcdir=* | --srcdi=* | --srcd=* | --src=* | --sr=*) srcdir=$ac_optarg ;; -sysconfdir | --sysconfdir | --sysconfdi | --sysconfd | --sysconf \ | --syscon | --sysco | --sysc | --sys | --sy) ac_prev=sysconfdir ;; -sysconfdir=* | --sysconfdir=* | --sysconfdi=* | --sysconfd=* | --sysconf=* \ | --syscon=* | --sysco=* | --sysc=* | --sys=* | --sy=*) sysconfdir=$ac_optarg ;; -target | --target | --targe | --targ | --tar | --ta | --t) ac_prev=target_alias ;; -target=* | --target=* | --targe=* | --targ=* | --tar=* | --ta=* | --t=*) target_alias=$ac_optarg ;; -v | -verbose | --verbose | --verbos | --verbo | --verb) verbose=yes ;; -version | --version | --versio | --versi | --vers | -V) ac_init_version=: ;; -with-* | --with-*) ac_package=`expr "x$ac_option" : 'x-*with-\([^=]*\)'` # Reject names that are not valid shell variable names. expr "x$ac_package" : ".*[^-._$as_cr_alnum]" >/dev/null && { echo "$as_me: error: invalid package name: $ac_package" >&2 { (exit 1); exit 1; }; } ac_package=`echo $ac_package | sed 's/[-.]/_/g'` eval with_$ac_package=\$ac_optarg ;; -without-* | --without-*) ac_package=`expr "x$ac_option" : 'x-*without-\(.*\)'` # Reject names that are not valid shell variable names. expr "x$ac_package" : ".*[^-._$as_cr_alnum]" >/dev/null && { echo "$as_me: error: invalid package name: $ac_package" >&2 { (exit 1); exit 1; }; } ac_package=`echo $ac_package | sed 's/[-.]/_/g'` eval with_$ac_package=no ;; --x) # Obsolete; use --with-x. with_x=yes ;; -x-includes | --x-includes | --x-include | --x-includ | --x-inclu \ | --x-incl | --x-inc | --x-in | --x-i) ac_prev=x_includes ;; -x-includes=* | --x-includes=* | --x-include=* | --x-includ=* | --x-inclu=* \ | --x-incl=* | --x-inc=* | --x-in=* | --x-i=*) x_includes=$ac_optarg ;; -x-libraries | --x-libraries | --x-librarie | --x-librari \ | --x-librar | --x-libra | --x-libr | --x-lib | --x-li | --x-l) ac_prev=x_libraries ;; -x-libraries=* | --x-libraries=* | --x-librarie=* | --x-librari=* \ | --x-librar=* | --x-libra=* | --x-libr=* | --x-lib=* | --x-li=* | --x-l=*) x_libraries=$ac_optarg ;; -*) { echo "$as_me: error: unrecognized option: $ac_option Try \`$0 --help' for more information." >&2 { (exit 1); exit 1; }; } ;; *=*) ac_envvar=`expr "x$ac_option" : 'x\([^=]*\)='` # Reject names that are not valid shell variable names. expr "x$ac_envvar" : ".*[^_$as_cr_alnum]" >/dev/null && { echo "$as_me: error: invalid variable name: $ac_envvar" >&2 { (exit 1); exit 1; }; } eval $ac_envvar=\$ac_optarg export $ac_envvar ;; *) # FIXME: should be removed in autoconf 3.0. echo "$as_me: WARNING: you should use --build, --host, --target" >&2 expr "x$ac_option" : ".*[^-._$as_cr_alnum]" >/dev/null && echo "$as_me: WARNING: invalid host type: $ac_option" >&2 : ${build_alias=$ac_option} ${host_alias=$ac_option} ${target_alias=$ac_option} ;; esac done if test -n "$ac_prev"; then ac_option=--`echo $ac_prev | sed 's/_/-/g'` { echo "$as_me: error: missing argument to $ac_option" >&2 { (exit 1); exit 1; }; } fi # Be sure to have absolute directory names. for ac_var in exec_prefix prefix bindir sbindir libexecdir datarootdir \ datadir sysconfdir sharedstatedir localstatedir includedir \ oldincludedir docdir infodir htmldir dvidir pdfdir psdir \ libdir localedir mandir do eval ac_val=\$$ac_var case $ac_val in [\\/$]* | ?:[\\/]* ) continue;; NONE | '' ) case $ac_var in *prefix ) continue;; esac;; esac { echo "$as_me: error: expected an absolute directory name for --$ac_var: $ac_val" >&2 { (exit 1); exit 1; }; } done # There might be people who depend on the old broken behavior: `$host' # used to hold the argument of --host etc. # FIXME: To remove some day. build=$build_alias host=$host_alias target=$target_alias # FIXME: To remove some day. if test "x$host_alias" != x; then if test "x$build_alias" = x; then cross_compiling=maybe echo "$as_me: WARNING: If you wanted to set the --build type, don't use --host. If a cross compiler is detected then cross compile mode will be used." >&2 elif test "x$build_alias" != "x$host_alias"; then cross_compiling=yes fi fi ac_tool_prefix= test -n "$host_alias" && ac_tool_prefix=$host_alias- test "$silent" = yes && exec 6>/dev/null ac_pwd=`pwd` && test -n "$ac_pwd" && ac_ls_di=`ls -di .` && ac_pwd_ls_di=`cd "$ac_pwd" && ls -di .` || { echo "$as_me: error: Working directory cannot be determined" >&2 { (exit 1); exit 1; }; } test "X$ac_ls_di" = "X$ac_pwd_ls_di" || { echo "$as_me: error: pwd does not report name of working directory" >&2 { (exit 1); exit 1; }; } # Find the source files, if location was not specified. if test -z "$srcdir"; then ac_srcdir_defaulted=yes # Try the directory containing this script, then the parent directory. ac_confdir=`$as_dirname -- "$0" || $as_expr X"$0" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ X"$0" : 'X\(//\)[^/]' \| \ X"$0" : 'X\(//\)$' \| \ X"$0" : 'X\(/\)' \| . 2>/dev/null || echo X"$0" | sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/ q } /^X\(\/\/\)[^/].*/{ s//\1/ q } /^X\(\/\/\)$/{ s//\1/ q } /^X\(\/\).*/{ s//\1/ q } s/.*/./; q'` srcdir=$ac_confdir if test ! -r "$srcdir/$ac_unique_file"; then srcdir=.. fi else ac_srcdir_defaulted=no fi if test ! -r "$srcdir/$ac_unique_file"; then test "$ac_srcdir_defaulted" = yes && srcdir="$ac_confdir or .." { echo "$as_me: error: cannot find sources ($ac_unique_file) in $srcdir" >&2 { (exit 1); exit 1; }; } fi ac_msg="sources are in $srcdir, but \`cd $srcdir' does not work" ac_abs_confdir=`( cd "$srcdir" && test -r "./$ac_unique_file" || { echo "$as_me: error: $ac_msg" >&2 { (exit 1); exit 1; }; } pwd)` # When building in place, set srcdir=. if test "$ac_abs_confdir" = "$ac_pwd"; then srcdir=. fi # Remove unnecessary trailing slashes from srcdir. # Double slashes in file names in object file debugging info # mess up M-x gdb in Emacs. case $srcdir in */) srcdir=`expr "X$srcdir" : 'X\(.*[^/]\)' \| "X$srcdir" : 'X\(.*\)'`;; esac for ac_var in $ac_precious_vars; do eval ac_env_${ac_var}_set=\${${ac_var}+set} eval ac_env_${ac_var}_value=\$${ac_var} eval ac_cv_env_${ac_var}_set=\${${ac_var}+set} eval ac_cv_env_${ac_var}_value=\$${ac_var} done # # Report the --help message. # if test "$ac_init_help" = "long"; then # Omit some internal or obsolete options to make the list less imposing. # This message is too long to be a string in the A/UX 3.1 sh. cat <<_ACEOF \`configure' configures joe 3.1jupp41 to adapt to many kinds of systems. Usage: $0 [OPTION]... [VAR=VALUE]... To assign environment variables (e.g., CC, CFLAGS...), specify them as VAR=VALUE. See below for descriptions of some of the useful variables. Defaults for the options are specified in brackets. Configuration: -h, --help display this help and exit --help=short display options specific to this package --help=recursive display the short help of all the included packages -V, --version display version information and exit -q, --quiet, --silent do not print \`checking...' messages --cache-file=FILE cache test results in FILE [disabled] -C, --config-cache alias for \`--cache-file=config.cache' -n, --no-create do not create output files --srcdir=DIR find the sources in DIR [configure dir or \`..'] Installation directories: --prefix=PREFIX install architecture-independent files in PREFIX [$ac_default_prefix] --exec-prefix=EPREFIX install architecture-dependent files in EPREFIX [PREFIX] By default, \`make install' will install all the files in \`$ac_default_prefix/bin', \`$ac_default_prefix/lib' etc. You can specify an installation prefix other than \`$ac_default_prefix' using \`--prefix', for instance \`--prefix=\$HOME'. For better control, use the options below. Fine tuning of the installation directories: --bindir=DIR user executables [EPREFIX/bin] --sbindir=DIR system admin executables [EPREFIX/sbin] --libexecdir=DIR program executables [EPREFIX/libexec] --sysconfdir=DIR read-only single-machine data [PREFIX/etc] --sharedstatedir=DIR modifiable architecture-independent data [PREFIX/com] --localstatedir=DIR modifiable single-machine data [PREFIX/var] --libdir=DIR object code libraries [EPREFIX/lib] --includedir=DIR C header files [PREFIX/include] --oldincludedir=DIR C header files for non-gcc [/usr/include] --datarootdir=DIR read-only arch.-independent data root [PREFIX/share] --datadir=DIR read-only architecture-independent data [DATAROOTDIR] --infodir=DIR info documentation [DATAROOTDIR/info] --localedir=DIR locale-dependent data [DATAROOTDIR/locale] --mandir=DIR man documentation [DATAROOTDIR/man] --docdir=DIR documentation root [DATAROOTDIR/doc/joe] --htmldir=DIR html documentation [DOCDIR] --dvidir=DIR dvi documentation [DOCDIR] --pdfdir=DIR pdf documentation [DOCDIR] --psdir=DIR ps documentation [DOCDIR] _ACEOF cat <<\_ACEOF Program names: --program-prefix=PREFIX prepend PREFIX to installed program names --program-suffix=SUFFIX append SUFFIX to installed program names --program-transform-name=PROGRAM run sed PROGRAM on installed program names System types: --build=BUILD configure for building on BUILD [guessed] --host=HOST cross-compile to build programs to run on HOST [BUILD] --target=TARGET configure for building compilers for TARGET [HOST] _ACEOF fi if test -n "$ac_init_help"; then case $ac_init_help in short | recursive ) echo "Configuration of joe 3.1jupp41:";; esac cat <<\_ACEOF Optional Features: --disable-FEATURE do not include FEATURE (same as --enable-FEATURE=no) --enable-FEATURE[=ARG] include FEATURE [ARG=yes] --enable-maintainer-mode enable make rules and dependencies not useful (and sometimes confusing) to the casual installer --disable-dependency-tracking speeds up one-time build --enable-dependency-tracking do not reject slow dependency extractors --disable-curses disable use of curses library --disable-termcap disable use of termcap library --disable-terminfo disable use of terminfo functions --disable-selinux disable SELinux context copying --disable-search-libs do not search in any external libraries --disable-getpwnam disable use of getpwnam function --disable-termidx do not build the termidx binary --enable-sysconfjoesubdir=/joe (default value) --enable-win32reloc enable win32 self-relocation --disable-largefile omit support for large files --disable-fork disable use of fork --disable-fpu disable use of floating point arithmetics --enable-small reduce memory footprint by a few KiB Some influential environment variables: CC C compiler command CFLAGS C compiler flags LDFLAGS linker flags, e.g. -L if you have libraries in a nonstandard directory LIBS libraries to pass to the linker, e.g. -l CPPFLAGS C/C++/Objective C preprocessor flags, e.g. -I if you have headers in a nonstandard directory CPP C preprocessor Use these variables to override the choices made by `configure' or to help it to find libraries and programs with nonstandard names/locations. _ACEOF ac_status=$? fi if test "$ac_init_help" = "recursive"; then # If there are subdirs, report their specific --help. for ac_dir in : $ac_subdirs_all; do test "x$ac_dir" = x: && continue test -d "$ac_dir" || continue ac_builddir=. case "$ac_dir" in .) ac_dir_suffix= ac_top_builddir_sub=. ac_top_build_prefix= ;; *) ac_dir_suffix=/`echo "$ac_dir" | sed 's,^\.[\\/],,'` # A ".." for each directory in $ac_dir_suffix. ac_top_builddir_sub=`echo "$ac_dir_suffix" | sed 's,/[^\\/]*,/..,g;s,/,,'` case $ac_top_builddir_sub in "") ac_top_builddir_sub=. ac_top_build_prefix= ;; *) ac_top_build_prefix=$ac_top_builddir_sub/ ;; esac ;; esac ac_abs_top_builddir=$ac_pwd ac_abs_builddir=$ac_pwd$ac_dir_suffix # for backward compatibility: ac_top_builddir=$ac_top_build_prefix case $srcdir in .) # We are building in place. ac_srcdir=. ac_top_srcdir=$ac_top_builddir_sub ac_abs_top_srcdir=$ac_pwd ;; [\\/]* | ?:[\\/]* ) # Absolute name. ac_srcdir=$srcdir$ac_dir_suffix; ac_top_srcdir=$srcdir ac_abs_top_srcdir=$srcdir ;; *) # Relative name. ac_srcdir=$ac_top_build_prefix$srcdir$ac_dir_suffix ac_top_srcdir=$ac_top_build_prefix$srcdir ac_abs_top_srcdir=$ac_pwd/$srcdir ;; esac ac_abs_srcdir=$ac_abs_top_srcdir$ac_dir_suffix cd "$ac_dir" || { ac_status=$?; continue; } # Check for guested configure. if test -f "$ac_srcdir/configure.gnu"; then echo && $SHELL "$ac_srcdir/configure.gnu" --help=recursive elif test -f "$ac_srcdir/configure"; then echo && $SHELL "$ac_srcdir/configure" --help=recursive else echo "$as_me: WARNING: no configuration information is in $ac_dir" >&2 fi || ac_status=$? cd "$ac_pwd" || { ac_status=$?; break; } done fi test -n "$ac_init_help" && exit $ac_status if $ac_init_version; then cat <<\_ACEOF joe configure 3.1jupp41 generated by GNU Autoconf 2.61-MirPorts-3 Copyright (C) 1992, 1993, 1994, 1995, 1996, 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006 Free Software Foundation, Inc. This configure script is free software; the Free Software Foundation gives unlimited permission to copy, distribute and modify it. _ACEOF exit fi cat >config.log <<_ACEOF This file contains any messages produced by compilers while running configure, to aid debugging if configure makes a mistake. It was created by joe $as_me 3.1jupp41, which was generated by GNU Autoconf 2.61-MirPorts-3. Invocation command line was $ $0 $@ _ACEOF exec 5>>config.log { cat <<_ASUNAME ## --------- ## ## Platform. ## ## --------- ## hostname = `(hostname || uname -n) 2>/dev/null | sed 1q` uname -m = `(uname -m) 2>/dev/null || echo unknown` uname -r = `(uname -r) 2>/dev/null || echo unknown` uname -s = `(uname -s) 2>/dev/null || echo unknown` uname -v = `(uname -v) 2>/dev/null || echo unknown` /usr/bin/uname -p = `(/usr/bin/uname -p) 2>/dev/null || echo unknown` /bin/uname -X = `(/bin/uname -X) 2>/dev/null || echo unknown` /bin/arch = `(/bin/arch) 2>/dev/null || echo unknown` /usr/bin/arch -k = `(/usr/bin/arch -k) 2>/dev/null || echo unknown` /usr/convex/getsysinfo = `(/usr/convex/getsysinfo) 2>/dev/null || echo unknown` /usr/bin/hostinfo = `(/usr/bin/hostinfo) 2>/dev/null || echo unknown` /bin/machine = `(/bin/machine) 2>/dev/null || echo unknown` /usr/bin/oslevel = `(/usr/bin/oslevel) 2>/dev/null || echo unknown` /bin/universe = `(/bin/universe) 2>/dev/null || echo unknown` _ASUNAME as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. echo "PATH: $as_dir" done IFS=$as_save_IFS } >&5 cat >&5 <<_ACEOF ## ----------- ## ## Core tests. ## ## ----------- ## _ACEOF # Keep a trace of the command line. # Strip out --no-create and --no-recursion so they do not pile up. # Strip out --silent because we don't want to record it for future runs. # Also quote any args containing shell meta-characters. # Make two passes to allow for proper duplicate-argument suppression. ac_configure_args= ac_configure_args0= ac_configure_args1= ac_must_keep_next=false for ac_pass in 1 2 do for ac_arg do case $ac_arg in -no-create | --no-c* | -n | -no-recursion | --no-r*) continue ;; -q | -quiet | --quiet | --quie | --qui | --qu | --q \ | -silent | --silent | --silen | --sile | --sil) continue ;; *\'*) ac_arg=`echo "$ac_arg" | sed "s/'/'\\\\\\\\''/g"` ;; esac case $ac_pass in 1) ac_configure_args0="$ac_configure_args0 '$ac_arg'" ;; 2) ac_configure_args1="$ac_configure_args1 '$ac_arg'" if test $ac_must_keep_next = true; then ac_must_keep_next=false # Got value, back to normal. else case $ac_arg in *=* | --config-cache | -C | -disable-* | --disable-* \ | -enable-* | --enable-* | -gas | --g* | -nfp | --nf* \ | -q | -quiet | --q* | -silent | --sil* | -v | -verb* \ | -with-* | --with-* | -without-* | --without-* | --x) case "$ac_configure_args0 " in "$ac_configure_args1"*" '$ac_arg' "* ) continue ;; esac ;; -* ) ac_must_keep_next=true ;; esac fi ac_configure_args="$ac_configure_args '$ac_arg'" ;; esac done done $as_unset ac_configure_args0 || test "${ac_configure_args0+set}" != set || { ac_configure_args0=; export ac_configure_args0; } $as_unset ac_configure_args1 || test "${ac_configure_args1+set}" != set || { ac_configure_args1=; export ac_configure_args1; } # When interrupted or exit'd, cleanup temporary files, and complete # config.log. We remove comments because anyway the quotes in there # would cause problems or look ugly. # WARNING: Use '\'' to represent an apostrophe within the trap. # WARNING: Do not start the trap code with a newline, due to a FreeBSD 4.0 bug. trap 'exit_status=$? # Save into config.log some information that might help in debugging. { echo cat <<\_ASBOX ## ---------------- ## ## Cache variables. ## ## ---------------- ## _ASBOX echo # The following way of writing the cache mishandles newlines in values, ( for ac_var in `(set) 2>&1 | sed -n '\''s/^\([a-zA-Z_][a-zA-Z0-9_]*\)=.*/\1/p'\''`; do eval ac_val=\$$ac_var case $ac_val in #( *${as_nl}*) case $ac_var in #( *_cv_*) { echo "$as_me:$LINENO: WARNING: Cache variable $ac_var contains a newline." >&5 echo "$as_me: WARNING: Cache variable $ac_var contains a newline." >&2;} ;; esac case $ac_var in #( _ | IFS | as_nl) ;; #( *) $as_unset $ac_var ;; esac ;; esac done (set) 2>&1 | case $as_nl`(ac_space='\'' '\''; set) 2>&1` in #( *${as_nl}ac_space=\ *) sed -n \ "s/'\''/'\''\\\\'\'''\''/g; s/^\\([_$as_cr_alnum]*_cv_[_$as_cr_alnum]*\\)=\\(.*\\)/\\1='\''\\2'\''/p" ;; #( *) sed -n "/^[_$as_cr_alnum]*_cv_[_$as_cr_alnum]*=/p" ;; esac | sort ) echo cat <<\_ASBOX ## ----------------- ## ## Output variables. ## ## ----------------- ## _ASBOX echo for ac_var in $ac_subst_vars do eval ac_val=\$$ac_var case $ac_val in *\'\''*) ac_val=`echo "$ac_val" | sed "s/'\''/'\''\\\\\\\\'\'''\''/g"`;; esac echo "$ac_var='\''$ac_val'\''" done | sort echo if test -n "$ac_subst_files"; then cat <<\_ASBOX ## ------------------- ## ## File substitutions. ## ## ------------------- ## _ASBOX echo for ac_var in $ac_subst_files do eval ac_val=\$$ac_var case $ac_val in *\'\''*) ac_val=`echo "$ac_val" | sed "s/'\''/'\''\\\\\\\\'\'''\''/g"`;; esac echo "$ac_var='\''$ac_val'\''" done | sort echo fi if test -s confdefs.h; then cat <<\_ASBOX ## ----------- ## ## confdefs.h. ## ## ----------- ## _ASBOX echo cat confdefs.h echo fi test "$ac_signal" != 0 && echo "$as_me: caught signal $ac_signal" echo "$as_me: exit $exit_status" } >&5 rm -f core *.core core.conftest.* && rm -f -r conftest* confdefs* conf$$* $ac_clean_files && exit $exit_status ' 0 for ac_signal in 1 2 13 15; do trap 'ac_signal='$ac_signal'; { (exit 1); exit 1; }' $ac_signal done ac_signal=0 # confdefs.h avoids OS command line length limits that DEFS can exceed. rm -f -r conftest* confdefs.h # Predefined preprocessor variables. cat >>confdefs.h <<_ACEOF #define PACKAGE_NAME "$PACKAGE_NAME" _ACEOF cat >>confdefs.h <<_ACEOF #define PACKAGE_TARNAME "$PACKAGE_TARNAME" _ACEOF cat >>confdefs.h <<_ACEOF #define PACKAGE_VERSION "$PACKAGE_VERSION" _ACEOF cat >>confdefs.h <<_ACEOF #define PACKAGE_STRING "$PACKAGE_STRING" _ACEOF cat >>confdefs.h <<_ACEOF #define PACKAGE_BUGREPORT "$PACKAGE_BUGREPORT" _ACEOF # Let the site file select an alternate cache file if it wants to. # Prefer explicitly selected file to automatically selected ones. if test -n "$CONFIG_SITE"; then set x "$CONFIG_SITE" elif test "x$prefix" != xNONE; then set x "$prefix/share/config.site" "$prefix/etc/config.site" else set x "$ac_default_prefix/share/config.site" \ "$ac_default_prefix/etc/config.site" fi shift for ac_site_file do if test -r "$ac_site_file"; then { echo "$as_me:$LINENO: loading site script $ac_site_file" >&5 echo "$as_me: loading site script $ac_site_file" >&6;} sed 's/^/| /' "$ac_site_file" >&5 . "$ac_site_file" fi done if test -r "$cache_file"; then # Some versions of bash will fail to source /dev/null (special # files actually), so we avoid doing that. if test -f "$cache_file"; then { echo "$as_me:$LINENO: loading cache $cache_file" >&5 echo "$as_me: loading cache $cache_file" >&6;} case $cache_file in [\\/]* | ?:[\\/]* ) . "$cache_file";; *) . "./$cache_file";; esac fi else { echo "$as_me:$LINENO: creating cache $cache_file" >&5 echo "$as_me: creating cache $cache_file" >&6;} >$cache_file fi # Check that the precious variables saved in the cache have kept the same # value. ac_cache_corrupted=false for ac_var in $ac_precious_vars; do eval ac_old_set=\$ac_cv_env_${ac_var}_set eval ac_new_set=\$ac_env_${ac_var}_set eval ac_old_val=\$ac_cv_env_${ac_var}_value eval ac_new_val=\$ac_env_${ac_var}_value case $ac_old_set,$ac_new_set in set,) { echo "$as_me:$LINENO: error: \`$ac_var' was set to \`$ac_old_val' in the previous run" >&5 echo "$as_me: error: \`$ac_var' was set to \`$ac_old_val' in the previous run" >&2;} ac_cache_corrupted=: ;; ,set) { echo "$as_me:$LINENO: error: \`$ac_var' was not set in the previous run" >&5 echo "$as_me: error: \`$ac_var' was not set in the previous run" >&2;} ac_cache_corrupted=: ;; ,);; *) if test "x$ac_old_val" != "x$ac_new_val"; then { echo "$as_me:$LINENO: error: \`$ac_var' has changed since the previous run:" >&5 echo "$as_me: error: \`$ac_var' has changed since the previous run:" >&2;} { echo "$as_me:$LINENO: former value: $ac_old_val" >&5 echo "$as_me: former value: $ac_old_val" >&2;} { echo "$as_me:$LINENO: current value: $ac_new_val" >&5 echo "$as_me: current value: $ac_new_val" >&2;} ac_cache_corrupted=: fi;; esac # Pass precious variables to config.status. if test "$ac_new_set" = set; then case $ac_new_val in *\'*) ac_arg=$ac_var=`echo "$ac_new_val" | sed "s/'/'\\\\\\\\''/g"` ;; *) ac_arg=$ac_var=$ac_new_val ;; esac case " $ac_configure_args " in *" '$ac_arg' "*) ;; # Avoid dups. Use of quotes ensures accuracy. *) ac_configure_args="$ac_configure_args '$ac_arg'" ;; esac fi done if $ac_cache_corrupted; then { echo "$as_me:$LINENO: error: changes in the environment can compromise the build" >&5 echo "$as_me: error: changes in the environment can compromise the build" >&2;} { { echo "$as_me:$LINENO: error: run \`make distclean' and/or \`rm $cache_file' and start over" >&5 echo "$as_me: error: run \`make distclean' and/or \`rm $cache_file' and start over" >&2;} { (exit 1); exit 1; }; } fi ac_ext=c ac_cpp='$CPP $CPPFLAGS' ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' ac_compiler_gnu=$ac_cv_c_compiler_gnu #### But see main.c for the Copyright (c) owner and year! #### ac_aux_dir= for ac_dir in $GNUSYSTEM_AUX_DIR "$srcdir" "$srcdir/.." "$srcdir/../.."; do if test -f "$ac_dir/install-sh"; then ac_aux_dir=$ac_dir ac_install_sh="$ac_aux_dir/install-sh -c" break elif test -f "$ac_dir/install.sh"; then ac_aux_dir=$ac_dir ac_install_sh="$ac_aux_dir/install.sh -c" break elif test -f "$ac_dir/shtool"; then ac_aux_dir=$ac_dir ac_install_sh="$ac_aux_dir/shtool install -c" break fi done if test -z "$ac_aux_dir"; then { { echo "$as_me:$LINENO: error: cannot find install-sh or install.sh in \"$srcdir\" \"$srcdir/..\" \"$srcdir/../..\"" >&5 echo "$as_me: error: cannot find install-sh or install.sh in \"$srcdir\" \"$srcdir/..\" \"$srcdir/../..\"" >&2;} { (exit 1); exit 1; }; } fi # These three variables are undocumented and unsupported, # and are intended to be withdrawn in a future Autoconf release. # They can cause serious problems if a builder's source tree is in a directory # whose full name contains unusual characters. ac_config_guess="$SHELL $ac_aux_dir/config.guess" # Please don't use this var. ac_config_sub="$SHELL $ac_aux_dir/config.sub" # Please don't use this var. ac_configure="$SHELL $ac_aux_dir/configure" # Please don't use this var. # Make sure we can run config.sub. $SHELL "$ac_aux_dir/config.sub" sun4 >/dev/null 2>&1 || { { echo "$as_me:$LINENO: error: cannot run $SHELL $ac_aux_dir/config.sub" >&5 echo "$as_me: error: cannot run $SHELL $ac_aux_dir/config.sub" >&2;} { (exit 1); exit 1; }; } { echo "$as_me:$LINENO: checking build system type" >&5 echo $ECHO_N "checking build system type... $ECHO_C" >&6; } if test "${ac_cv_build+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else ac_build_alias=$build_alias test "x$ac_build_alias" = x && ac_build_alias=`$SHELL "$ac_aux_dir/config.guess"` test "x$ac_build_alias" = x && { { echo "$as_me:$LINENO: error: cannot guess build type; you must specify one" >&5 echo "$as_me: error: cannot guess build type; you must specify one" >&2;} { (exit 1); exit 1; }; } ac_cv_build=`$SHELL "$ac_aux_dir/config.sub" $ac_build_alias` || { { echo "$as_me:$LINENO: error: $SHELL $ac_aux_dir/config.sub $ac_build_alias failed" >&5 echo "$as_me: error: $SHELL $ac_aux_dir/config.sub $ac_build_alias failed" >&2;} { (exit 1); exit 1; }; } fi { echo "$as_me:$LINENO: result: $ac_cv_build" >&5 echo "${ECHO_T}$ac_cv_build" >&6; } case $ac_cv_build in *-*-*) ;; *) { { echo "$as_me:$LINENO: error: invalid value of canonical build" >&5 echo "$as_me: error: invalid value of canonical build" >&2;} { (exit 1); exit 1; }; };; esac build=$ac_cv_build ac_save_IFS=$IFS; IFS='-' set x $ac_cv_build shift build_cpu=$1 build_vendor=$2 shift; shift # Remember, the first character of IFS is used to create $*, # except with old shells: build_os=$* IFS=$ac_save_IFS case $build_os in *\ *) build_os=`echo "$build_os" | sed 's/ /-/g'`;; esac { echo "$as_me:$LINENO: checking host system type" >&5 echo $ECHO_N "checking host system type... $ECHO_C" >&6; } if test "${ac_cv_host+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else if test "x$host_alias" = x; then ac_cv_host=$ac_cv_build else ac_cv_host=`$SHELL "$ac_aux_dir/config.sub" $host_alias` || { { echo "$as_me:$LINENO: error: $SHELL $ac_aux_dir/config.sub $host_alias failed" >&5 echo "$as_me: error: $SHELL $ac_aux_dir/config.sub $host_alias failed" >&2;} { (exit 1); exit 1; }; } fi fi { echo "$as_me:$LINENO: result: $ac_cv_host" >&5 echo "${ECHO_T}$ac_cv_host" >&6; } case $ac_cv_host in *-*-*) ;; *) { { echo "$as_me:$LINENO: error: invalid value of canonical host" >&5 echo "$as_me: error: invalid value of canonical host" >&2;} { (exit 1); exit 1; }; };; esac host=$ac_cv_host ac_save_IFS=$IFS; IFS='-' set x $ac_cv_host shift host_cpu=$1 host_vendor=$2 shift; shift # Remember, the first character of IFS is used to create $*, # except with old shells: host_os=$* IFS=$ac_save_IFS case $host_os in *\ *) host_os=`echo "$host_os" | sed 's/ /-/g'`;; esac { echo "$as_me:$LINENO: checking target system type" >&5 echo $ECHO_N "checking target system type... $ECHO_C" >&6; } if test "${ac_cv_target+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else if test "x$target_alias" = x; then ac_cv_target=$ac_cv_host else ac_cv_target=`$SHELL "$ac_aux_dir/config.sub" $target_alias` || { { echo "$as_me:$LINENO: error: $SHELL $ac_aux_dir/config.sub $target_alias failed" >&5 echo "$as_me: error: $SHELL $ac_aux_dir/config.sub $target_alias failed" >&2;} { (exit 1); exit 1; }; } fi fi { echo "$as_me:$LINENO: result: $ac_cv_target" >&5 echo "${ECHO_T}$ac_cv_target" >&6; } case $ac_cv_target in *-*-*) ;; *) { { echo "$as_me:$LINENO: error: invalid value of canonical target" >&5 echo "$as_me: error: invalid value of canonical target" >&2;} { (exit 1); exit 1; }; };; esac target=$ac_cv_target ac_save_IFS=$IFS; IFS='-' set x $ac_cv_target shift target_cpu=$1 target_vendor=$2 shift; shift # Remember, the first character of IFS is used to create $*, # except with old shells: target_os=$* IFS=$ac_save_IFS case $target_os in *\ *) target_os=`echo "$target_os" | sed 's/ /-/g'`;; esac # The aliases save the names the user supplied, while $host etc. # will get canonicalized. test -n "$target_alias" && test "$program_prefix$program_suffix$program_transform_name" = \ NONENONEs,x,x, && program_prefix=${target_alias}- # Init automake am__api_version="1.9" # Find a good install program. We prefer a C program (faster), # so one script is as good as another. But avoid the broken or # incompatible versions: # SysV /etc/install, /usr/sbin/install # SunOS /usr/etc/install # IRIX /sbin/install # AIX /bin/install # AmigaOS /C/install, which installs bootblocks on floppy discs # AIX 4 /usr/bin/installbsd, which doesn't work without a -g flag # AFS /usr/afsws/bin/install, which mishandles nonexistent args # SVR4 /usr/ucb/install, which tries to use the nonexistent group "staff" # OS/2's system install, which has a completely different semantic # ./install, which can be erroneously created by make from ./install.sh. { echo "$as_me:$LINENO: checking for a BSD-compatible install" >&5 echo $ECHO_N "checking for a BSD-compatible install... $ECHO_C" >&6; } if test -z "$INSTALL"; then if test "${ac_cv_path_install+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. # Account for people who put trailing slashes in PATH elements. case $as_dir/ in ./ | .// | /cC/* | \ /etc/* | /usr/sbin/* | /usr/etc/* | /sbin/* | /usr/afsws/bin/* | \ ?:\\/os2\\/install\\/* | ?:\\/OS2\\/INSTALL\\/* | \ /usr/ucb/* ) ;; *) # OSF1 and SCO ODT 3.0 have their own names for install. # Don't use installbsd from OSF since it installs stuff as root # by default. for ac_prog in ginstall scoinst install; do for ac_exec_ext in '' $ac_executable_extensions; do if { test -f "$as_dir/$ac_prog$ac_exec_ext" && $as_test_x "$as_dir/$ac_prog$ac_exec_ext"; }; then if test $ac_prog = install && grep dspmsg "$as_dir/$ac_prog$ac_exec_ext" >/dev/null 2>&1; then # AIX install. It has an incompatible calling convention. : elif test $ac_prog = install && grep pwplus "$as_dir/$ac_prog$ac_exec_ext" >/dev/null 2>&1; then # program-specific install script used by HP pwplus--don't use. : else ac_cv_path_install="$as_dir/$ac_prog$ac_exec_ext -c" break 3 fi fi done done ;; esac done IFS=$as_save_IFS fi if test "${ac_cv_path_install+set}" = set; then INSTALL=$ac_cv_path_install else # As a last resort, use the slow shell script. Don't cache a # value for INSTALL within a source directory, because that will # break other packages using the cache if that directory is # removed, or if the value is a relative name. INSTALL="$SHELL $ac_install_sh" fi fi { echo "$as_me:$LINENO: result: $INSTALL" >&5 echo "${ECHO_T}$INSTALL" >&6; } # Use test -z because SunOS4 sh mishandles braces in ${var-val}. # It thinks the first close brace ends the variable substitution. test -z "$INSTALL_PROGRAM" && INSTALL_PROGRAM='${INSTALL}' test -z "$INSTALL_SCRIPT" && INSTALL_SCRIPT='${INSTALL}' test -z "$INSTALL_DATA" && INSTALL_DATA='${INSTALL} -m 644' { echo "$as_me:$LINENO: checking whether build environment is sane" >&5 echo $ECHO_N "checking whether build environment is sane... $ECHO_C" >&6; } # Just in case sleep 1 echo timestamp > conftest.file # Do `set' in a subshell so we don't clobber the current shell's # arguments. Must try -L first in case configure is actually a # symlink; some systems play weird games with the mod time of symlinks # (eg FreeBSD returns the mod time of the symlink's containing # directory). if ( set X `ls -Lt $srcdir/configure conftest.file 2> /dev/null` if test "$*" = "X"; then # -L didn't work. set X `ls -t $srcdir/configure conftest.file` fi rm -f conftest.file if test "$*" != "X $srcdir/configure conftest.file" \ && test "$*" != "X conftest.file $srcdir/configure"; then # If neither matched, then we have a broken ls. This can happen # if, for instance, CONFIG_SHELL is bash and it inherits a # broken ls alias from the environment. This has actually # happened. Such a system could not be considered "sane". { { echo "$as_me:$LINENO: error: ls -t appears to fail. Make sure there is not a broken alias in your environment" >&5 echo "$as_me: error: ls -t appears to fail. Make sure there is not a broken alias in your environment" >&2;} { (exit 1); exit 1; }; } fi test "$2" = conftest.file ) then # Ok. : else { { echo "$as_me:$LINENO: error: newly created file is older than distributed files! Check your system clock" >&5 echo "$as_me: error: newly created file is older than distributed files! Check your system clock" >&2;} { (exit 1); exit 1; }; } fi { echo "$as_me:$LINENO: result: yes" >&5 echo "${ECHO_T}yes" >&6; } test "$program_prefix" != NONE && program_transform_name="s&^&$program_prefix&;$program_transform_name" # Use a double $ so make ignores it. test "$program_suffix" != NONE && program_transform_name="s&\$&$program_suffix&;$program_transform_name" # Double any \ or $. echo might interpret backslashes. # By default was `s,x,x', remove it if useless. cat <<\_ACEOF >conftest.sed s/[\\$]/&&/g;s/;s,x,x,$// _ACEOF program_transform_name=`echo $program_transform_name | sed -f conftest.sed` rm -f conftest.sed # expand $ac_aux_dir to an absolute path am_aux_dir=`cd $ac_aux_dir && pwd` test x"${MISSING+set}" = xset || MISSING="\${SHELL} $am_aux_dir/missing" # Use eval to expand $SHELL if eval "$MISSING --run true"; then am_missing_run="$MISSING --run " else am_missing_run= { echo "$as_me:$LINENO: WARNING: \`missing' script is too old or missing" >&5 echo "$as_me: WARNING: \`missing' script is too old or missing" >&2;} fi if mkdir -p --version . >/dev/null 2>&1 && test ! -d ./--version; then # We used to keeping the `.' as first argument, in order to # allow $(mkdir_p) to be used without argument. As in # $(mkdir_p) $(somedir) # where $(somedir) is conditionally defined. However this is wrong # for two reasons: # 1. if the package is installed by a user who cannot write `.' # make install will fail, # 2. the above comment should most certainly read # $(mkdir_p) $(DESTDIR)$(somedir) # so it does not work when $(somedir) is undefined and # $(DESTDIR) is not. # To support the latter case, we have to write # test -z "$(somedir)" || $(mkdir_p) $(DESTDIR)$(somedir), # so the `.' trick is pointless. mkdir_p='mkdir -p --' else # On NextStep and OpenStep, the `mkdir' command does not # recognize any option. It will interpret all options as # directories to create, and then abort because `.' already # exists. for d in ./-p ./--version; do test -d $d && rmdir $d done # $(mkinstalldirs) is defined by Automake if mkinstalldirs exists. if test -f "$ac_aux_dir/mkinstalldirs"; then mkdir_p='$(mkinstalldirs)' else mkdir_p='$(install_sh) -d' fi fi for ac_prog in gawk mawk nawk awk do # Extract the first word of "$ac_prog", so it can be a program name with args. set dummy $ac_prog; ac_word=$2 { echo "$as_me:$LINENO: checking for $ac_word" >&5 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6; } if test "${ac_cv_prog_AWK+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else if test -n "$AWK"; then ac_cv_prog_AWK="$AWK" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then ac_cv_prog_AWK="$ac_prog" echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi AWK=$ac_cv_prog_AWK if test -n "$AWK"; then { echo "$as_me:$LINENO: result: $AWK" >&5 echo "${ECHO_T}$AWK" >&6; } else { echo "$as_me:$LINENO: result: no" >&5 echo "${ECHO_T}no" >&6; } fi test -n "$AWK" && break done { echo "$as_me:$LINENO: checking whether ${MAKE-make} sets \$(MAKE)" >&5 echo $ECHO_N "checking whether ${MAKE-make} sets \$(MAKE)... $ECHO_C" >&6; } set x ${MAKE-make}; ac_make=`echo "$2" | sed 's/+/p/g; s/[^a-zA-Z0-9_]/_/g'` if { as_var=ac_cv_prog_make_${ac_make}_set; eval "test \"\${$as_var+set}\" = set"; }; then echo $ECHO_N "(cached) $ECHO_C" >&6 else cat >conftest.make <<\_ACEOF SHELL = /bin/sh all: @echo '@@@%%%=$(MAKE)=@@@%%%' _ACEOF # GNU make sometimes prints "make[1]: Entering...", which would confuse us. case `${MAKE-make} -f conftest.make 2>/dev/null` in *@@@%%%=?*=@@@%%%*) eval ac_cv_prog_make_${ac_make}_set=yes;; *) eval ac_cv_prog_make_${ac_make}_set=no;; esac rm -f conftest.make fi if eval test \$ac_cv_prog_make_${ac_make}_set = yes; then { echo "$as_me:$LINENO: result: yes" >&5 echo "${ECHO_T}yes" >&6; } SET_MAKE= else { echo "$as_me:$LINENO: result: no" >&5 echo "${ECHO_T}no" >&6; } SET_MAKE="MAKE=${MAKE-make}" fi rm -rf .tst 2>/dev/null mkdir .tst 2>/dev/null if test -d .tst; then am__leading_dot=. else am__leading_dot=_ fi rmdir .tst 2>/dev/null # test to see if srcdir already configured if test "`cd $srcdir && pwd`" != "`pwd`" && test -f $srcdir/config.status; then { { echo "$as_me:$LINENO: error: source directory already configured; run \"make distclean\" there first" >&5 echo "$as_me: error: source directory already configured; run \"make distclean\" there first" >&2;} { (exit 1); exit 1; }; } fi # test whether we have cygpath if test -z "$CYGPATH_W"; then if (cygpath --version) >/dev/null 2>/dev/null; then CYGPATH_W='cygpath -w' else CYGPATH_W=echo fi fi # Define the identity of the package. PACKAGE='joe' VERSION='3.1jupp41' cat >>confdefs.h <<_ACEOF #define PACKAGE "$PACKAGE" _ACEOF cat >>confdefs.h <<_ACEOF #define VERSION "$VERSION" _ACEOF # Some tools Automake needs. ACLOCAL=${ACLOCAL-"${am_missing_run}aclocal-${am__api_version}"} AUTOCONF=${AUTOCONF-"${am_missing_run}autoconf"} AUTOMAKE=${AUTOMAKE-"${am_missing_run}automake-${am__api_version}"} AUTOHEADER=${AUTOHEADER-"${am_missing_run}autoheader"} MAKEINFO=${MAKEINFO-"${am_missing_run}makeinfo"} install_sh=${install_sh-"$am_aux_dir/install-sh"} # Installed binaries are usually stripped using `strip' when the user # run `make install-strip'. However `strip' might not be the right # tool to use in cross-compilation environments, therefore Automake # will honor the `STRIP' environment variable to overrule this program. if test "$cross_compiling" != no; then if test -n "$ac_tool_prefix"; then # Extract the first word of "${ac_tool_prefix}strip", so it can be a program name with args. set dummy ${ac_tool_prefix}strip; ac_word=$2 { echo "$as_me:$LINENO: checking for $ac_word" >&5 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6; } if test "${ac_cv_prog_STRIP+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else if test -n "$STRIP"; then ac_cv_prog_STRIP="$STRIP" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then ac_cv_prog_STRIP="${ac_tool_prefix}strip" echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi STRIP=$ac_cv_prog_STRIP if test -n "$STRIP"; then { echo "$as_me:$LINENO: result: $STRIP" >&5 echo "${ECHO_T}$STRIP" >&6; } else { echo "$as_me:$LINENO: result: no" >&5 echo "${ECHO_T}no" >&6; } fi fi if test -z "$ac_cv_prog_STRIP"; then ac_ct_STRIP=$STRIP # Extract the first word of "strip", so it can be a program name with args. set dummy strip; ac_word=$2 { echo "$as_me:$LINENO: checking for $ac_word" >&5 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6; } if test "${ac_cv_prog_ac_ct_STRIP+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else if test -n "$ac_ct_STRIP"; then ac_cv_prog_ac_ct_STRIP="$ac_ct_STRIP" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then ac_cv_prog_ac_ct_STRIP="strip" echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi ac_ct_STRIP=$ac_cv_prog_ac_ct_STRIP if test -n "$ac_ct_STRIP"; then { echo "$as_me:$LINENO: result: $ac_ct_STRIP" >&5 echo "${ECHO_T}$ac_ct_STRIP" >&6; } else { echo "$as_me:$LINENO: result: no" >&5 echo "${ECHO_T}no" >&6; } fi if test "x$ac_ct_STRIP" = x; then STRIP=":" else case $cross_compiling:$ac_tool_warned in yes:) { echo "$as_me:$LINENO: WARNING: In the future, Autoconf will not detect cross-tools whose name does not start with the host triplet. If you think this configuration is useful to you, please write to autoconf@gnu.org." >&5 echo "$as_me: WARNING: In the future, Autoconf will not detect cross-tools whose name does not start with the host triplet. If you think this configuration is useful to you, please write to autoconf@gnu.org." >&2;} ac_tool_warned=yes ;; esac STRIP=$ac_ct_STRIP fi else STRIP="$ac_cv_prog_STRIP" fi fi INSTALL_STRIP_PROGRAM="\${SHELL} \$(install_sh) -c -s" # We need awk for the "check" target. The system "awk" is bad on # some platforms. # Always define AMTAR for backward compatibility. AMTAR=${AMTAR-"${am_missing_run}tar"} am__tar='${AMTAR} chof - "$$tardir"'; am__untar='${AMTAR} xf -' { echo "$as_me:$LINENO: checking whether to enable maintainer-specific portions of Makefiles" >&5 echo $ECHO_N "checking whether to enable maintainer-specific portions of Makefiles... $ECHO_C" >&6; } # Check whether --enable-maintainer-mode was given. if test "${enable_maintainer_mode+set}" = set; then enableval=$enable_maintainer_mode; USE_MAINTAINER_MODE=$enableval else USE_MAINTAINER_MODE=no fi { echo "$as_me:$LINENO: result: $USE_MAINTAINER_MODE" >&5 echo "${ECHO_T}$USE_MAINTAINER_MODE" >&6; } if test $USE_MAINTAINER_MODE = yes; then MAINTAINER_MODE_TRUE= MAINTAINER_MODE_FALSE='#' else MAINTAINER_MODE_TRUE='#' MAINTAINER_MODE_FALSE= fi MAINT=$MAINTAINER_MODE_TRUE ac_config_headers="$ac_config_headers autoconf.h" # Checks for programs. ac_ext=c ac_cpp='$CPP $CPPFLAGS' ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' ac_compiler_gnu=$ac_cv_c_compiler_gnu if test -n "$ac_tool_prefix"; then # Extract the first word of "${ac_tool_prefix}gcc", so it can be a program name with args. set dummy ${ac_tool_prefix}gcc; ac_word=$2 { echo "$as_me:$LINENO: checking for $ac_word" >&5 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6; } if test "${ac_cv_prog_CC+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else if test -n "$CC"; then ac_cv_prog_CC="$CC" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then ac_cv_prog_CC="${ac_tool_prefix}gcc" echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi CC=$ac_cv_prog_CC if test -n "$CC"; then { echo "$as_me:$LINENO: result: $CC" >&5 echo "${ECHO_T}$CC" >&6; } else { echo "$as_me:$LINENO: result: no" >&5 echo "${ECHO_T}no" >&6; } fi fi if test -z "$ac_cv_prog_CC"; then ac_ct_CC=$CC # Extract the first word of "gcc", so it can be a program name with args. set dummy gcc; ac_word=$2 { echo "$as_me:$LINENO: checking for $ac_word" >&5 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6; } if test "${ac_cv_prog_ac_ct_CC+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else if test -n "$ac_ct_CC"; then ac_cv_prog_ac_ct_CC="$ac_ct_CC" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then ac_cv_prog_ac_ct_CC="gcc" echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi ac_ct_CC=$ac_cv_prog_ac_ct_CC if test -n "$ac_ct_CC"; then { echo "$as_me:$LINENO: result: $ac_ct_CC" >&5 echo "${ECHO_T}$ac_ct_CC" >&6; } else { echo "$as_me:$LINENO: result: no" >&5 echo "${ECHO_T}no" >&6; } fi if test "x$ac_ct_CC" = x; then CC="" else case $cross_compiling:$ac_tool_warned in yes:) { echo "$as_me:$LINENO: WARNING: In the future, Autoconf will not detect cross-tools whose name does not start with the host triplet. If you think this configuration is useful to you, please write to autoconf@gnu.org." >&5 echo "$as_me: WARNING: In the future, Autoconf will not detect cross-tools whose name does not start with the host triplet. If you think this configuration is useful to you, please write to autoconf@gnu.org." >&2;} ac_tool_warned=yes ;; esac CC=$ac_ct_CC fi else CC="$ac_cv_prog_CC" fi if test -z "$CC"; then if test -n "$ac_tool_prefix"; then # Extract the first word of "${ac_tool_prefix}cc", so it can be a program name with args. set dummy ${ac_tool_prefix}cc; ac_word=$2 { echo "$as_me:$LINENO: checking for $ac_word" >&5 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6; } if test "${ac_cv_prog_CC+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else if test -n "$CC"; then ac_cv_prog_CC="$CC" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then ac_cv_prog_CC="${ac_tool_prefix}cc" echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi CC=$ac_cv_prog_CC if test -n "$CC"; then { echo "$as_me:$LINENO: result: $CC" >&5 echo "${ECHO_T}$CC" >&6; } else { echo "$as_me:$LINENO: result: no" >&5 echo "${ECHO_T}no" >&6; } fi fi fi if test -z "$CC"; then # Extract the first word of "cc", so it can be a program name with args. set dummy cc; ac_word=$2 { echo "$as_me:$LINENO: checking for $ac_word" >&5 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6; } if test "${ac_cv_prog_CC+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else if test -n "$CC"; then ac_cv_prog_CC="$CC" # Let the user override the test. else ac_prog_rejected=no as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then if test "$as_dir/$ac_word$ac_exec_ext" = "/usr/ucb/cc"; then ac_prog_rejected=yes continue fi ac_cv_prog_CC="cc" echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS if test $ac_prog_rejected = yes; then # We found a bogon in the path, so make sure we never use it. set dummy $ac_cv_prog_CC shift if test $# != 0; then # We chose a different compiler from the bogus one. # However, it has the same basename, so the bogon will be chosen # first if we set CC to just the basename; use the full file name. shift ac_cv_prog_CC="$as_dir/$ac_word${1+' '}$@" fi fi fi fi CC=$ac_cv_prog_CC if test -n "$CC"; then { echo "$as_me:$LINENO: result: $CC" >&5 echo "${ECHO_T}$CC" >&6; } else { echo "$as_me:$LINENO: result: no" >&5 echo "${ECHO_T}no" >&6; } fi fi if test -z "$CC"; then if test -n "$ac_tool_prefix"; then for ac_prog in cl.exe do # Extract the first word of "$ac_tool_prefix$ac_prog", so it can be a program name with args. set dummy $ac_tool_prefix$ac_prog; ac_word=$2 { echo "$as_me:$LINENO: checking for $ac_word" >&5 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6; } if test "${ac_cv_prog_CC+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else if test -n "$CC"; then ac_cv_prog_CC="$CC" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then ac_cv_prog_CC="$ac_tool_prefix$ac_prog" echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi CC=$ac_cv_prog_CC if test -n "$CC"; then { echo "$as_me:$LINENO: result: $CC" >&5 echo "${ECHO_T}$CC" >&6; } else { echo "$as_me:$LINENO: result: no" >&5 echo "${ECHO_T}no" >&6; } fi test -n "$CC" && break done fi if test -z "$CC"; then ac_ct_CC=$CC for ac_prog in cl.exe do # Extract the first word of "$ac_prog", so it can be a program name with args. set dummy $ac_prog; ac_word=$2 { echo "$as_me:$LINENO: checking for $ac_word" >&5 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6; } if test "${ac_cv_prog_ac_ct_CC+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else if test -n "$ac_ct_CC"; then ac_cv_prog_ac_ct_CC="$ac_ct_CC" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then ac_cv_prog_ac_ct_CC="$ac_prog" echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi ac_ct_CC=$ac_cv_prog_ac_ct_CC if test -n "$ac_ct_CC"; then { echo "$as_me:$LINENO: result: $ac_ct_CC" >&5 echo "${ECHO_T}$ac_ct_CC" >&6; } else { echo "$as_me:$LINENO: result: no" >&5 echo "${ECHO_T}no" >&6; } fi test -n "$ac_ct_CC" && break done if test "x$ac_ct_CC" = x; then CC="" else case $cross_compiling:$ac_tool_warned in yes:) { echo "$as_me:$LINENO: WARNING: In the future, Autoconf will not detect cross-tools whose name does not start with the host triplet. If you think this configuration is useful to you, please write to autoconf@gnu.org." >&5 echo "$as_me: WARNING: In the future, Autoconf will not detect cross-tools whose name does not start with the host triplet. If you think this configuration is useful to you, please write to autoconf@gnu.org." >&2;} ac_tool_warned=yes ;; esac CC=$ac_ct_CC fi fi fi test -z "$CC" && { { echo "$as_me:$LINENO: error: no acceptable C compiler found in \$PATH See \`config.log' for more details." >&5 echo "$as_me: error: no acceptable C compiler found in \$PATH See \`config.log' for more details." >&2;} { (exit 1); exit 1; }; } # Provide some information about the compiler. echo "$as_me:$LINENO: checking for C compiler version" >&5 ac_compiler=`set X $ac_compile; echo $2` { (ac_try="$ac_compiler --version >&5" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_compiler --version >&5") 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } { (ac_try="$ac_compiler -v >&5" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_compiler -v >&5") 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } { (ac_try="$ac_compiler -V >&5" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_compiler -V >&5") 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ int main () { ; return 0; } _ACEOF ac_clean_files_save=$ac_clean_files ac_clean_files="$ac_clean_files a.out a.exe b.out" # Try to create an executable without -o first, disregard a.out. # It will help us diagnose broken compilers, and finding out an intuition # of exeext. { echo "$as_me:$LINENO: checking for C compiler default output file name" >&5 echo $ECHO_N "checking for C compiler default output file name... $ECHO_C" >&6; } ac_link_default=`echo "$ac_link" | sed 's/ -o *conftest[^ ]*//'` # # List of possible output files, starting from the most likely. # The algorithm is not robust to junk in `.', hence go to wildcards (a.*) # only as a last resort. b.out is created by i960 compilers. ac_files='a_out.exe a.exe conftest.exe a.out conftest a.* conftest.* b.out' # # The IRIX 6 linker writes into existing files which may not be # executable, retaining their permissions. Remove them first so a # subsequent execution test works. ac_rmfiles= for ac_file in $ac_files do case $ac_file in *.$ac_ext | *.xcoff | *.tds | *.d | *.pdb | *.xSYM | *.bb | *.bbg | *.map | *.inf | *.o | *.obj ) ;; * ) ac_rmfiles="$ac_rmfiles $ac_file";; esac done rm -f $ac_rmfiles if { (ac_try="$ac_link_default" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_link_default") 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; then # Autoconf-2.13 could set the ac_cv_exeext variable to `no'. # So ignore a value of `no', otherwise this would lead to `EXEEXT = no' # in a Makefile. We should not override ac_cv_exeext if it was cached, # so that the user can short-circuit this test for compilers unknown to # Autoconf. for ac_file in $ac_files '' do test -f "$ac_file" || continue case $ac_file in *.$ac_ext | *.xcoff | *.tds | *.d | *.pdb | *.xSYM | *.bb | *.bbg | *.map | *.inf | *.o | *.obj ) ;; [ab].out ) # We found the default executable, but exeext='' is most # certainly right. break;; *.* ) if test "${ac_cv_exeext+set}" = set && test "$ac_cv_exeext" != no; then :; else ac_cv_exeext=`expr "$ac_file" : '[^.]*\(\..*\)'` fi # We set ac_cv_exeext here because the later test for it is not # safe: cross compilers may not add the suffix if given an `-o' # argument, so we may need to know it at that point already. # Even if this section looks crufty: it has the advantage of # actually working. break;; * ) break;; esac done test "$ac_cv_exeext" = no && ac_cv_exeext= else ac_file='' fi { echo "$as_me:$LINENO: result: $ac_file" >&5 echo "${ECHO_T}$ac_file" >&6; } if test -z "$ac_file"; then echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 { { echo "$as_me:$LINENO: error: C compiler cannot create executables See \`config.log' for more details." >&5 echo "$as_me: error: C compiler cannot create executables See \`config.log' for more details." >&2;} { (exit 77); exit 77; }; } fi ac_exeext=$ac_cv_exeext # Check that the compiler produces executables we can run. If not, either # the compiler is broken, or we cross compile. { echo "$as_me:$LINENO: checking whether the C compiler works" >&5 echo $ECHO_N "checking whether the C compiler works... $ECHO_C" >&6; } # FIXME: These cross compiler hacks should be removed for Autoconf 3.0 # If not cross compiling, check that we can run a simple program. if test "$cross_compiling" != yes; then if { ac_try='./$ac_file' { (case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_try") 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then cross_compiling=no else if test "$cross_compiling" = maybe; then cross_compiling=yes else { { echo "$as_me:$LINENO: error: cannot run C compiled programs. If you meant to cross compile, use \`--host'. See \`config.log' for more details." >&5 echo "$as_me: error: cannot run C compiled programs. If you meant to cross compile, use \`--host'. See \`config.log' for more details." >&2;} { (exit 1); exit 1; }; } fi fi fi { echo "$as_me:$LINENO: result: yes" >&5 echo "${ECHO_T}yes" >&6; } rm -f a.out a.exe conftest$ac_cv_exeext b.out ac_clean_files=$ac_clean_files_save # Check that the compiler produces executables we can run. If not, either # the compiler is broken, or we cross compile. { echo "$as_me:$LINENO: checking whether we are cross compiling" >&5 echo $ECHO_N "checking whether we are cross compiling... $ECHO_C" >&6; } { echo "$as_me:$LINENO: result: $cross_compiling" >&5 echo "${ECHO_T}$cross_compiling" >&6; } { echo "$as_me:$LINENO: checking for suffix of executables" >&5 echo $ECHO_N "checking for suffix of executables... $ECHO_C" >&6; } if { (ac_try="$ac_link" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_link") 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; then # If both `conftest.exe' and `conftest' are `present' (well, observable) # catch `conftest.exe'. For instance with Cygwin, `ls conftest' will # work properly (i.e., refer to `conftest.exe'), while it won't with # `rm'. for ac_file in conftest.exe conftest conftest.*; do test -f "$ac_file" || continue case $ac_file in *.$ac_ext | *.xcoff | *.tds | *.d | *.pdb | *.xSYM | *.bb | *.bbg | *.map | *.inf | *.o | *.obj ) ;; *.* ) ac_cv_exeext=`expr "$ac_file" : '[^.]*\(\..*\)'` break;; * ) break;; esac done else { { echo "$as_me:$LINENO: error: cannot compute suffix of executables: cannot compile and link See \`config.log' for more details." >&5 echo "$as_me: error: cannot compute suffix of executables: cannot compile and link See \`config.log' for more details." >&2;} { (exit 1); exit 1; }; } fi rm -f conftest$ac_cv_exeext { echo "$as_me:$LINENO: result: $ac_cv_exeext" >&5 echo "${ECHO_T}$ac_cv_exeext" >&6; } rm -f conftest.$ac_ext EXEEXT=$ac_cv_exeext ac_exeext=$EXEEXT { echo "$as_me:$LINENO: checking for suffix of object files" >&5 echo $ECHO_N "checking for suffix of object files... $ECHO_C" >&6; } if test "${ac_cv_objext+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ int main () { ; return 0; } _ACEOF rm -f conftest.o conftest.obj if { (ac_try="$ac_compile" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_compile") 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; then for ac_file in conftest.o conftest.obj conftest.*; do test -f "$ac_file" || continue; case $ac_file in *.$ac_ext | *.xcoff | *.tds | *.d | *.pdb | *.xSYM | *.bb | *.bbg | *.map | *.inf ) ;; *) ac_cv_objext=`expr "$ac_file" : '.*\.\(.*\)'` break;; esac done else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 { { echo "$as_me:$LINENO: error: cannot compute suffix of object files: cannot compile See \`config.log' for more details." >&5 echo "$as_me: error: cannot compute suffix of object files: cannot compile See \`config.log' for more details." >&2;} { (exit 1); exit 1; }; } fi rm -f conftest.$ac_cv_objext conftest.$ac_ext fi { echo "$as_me:$LINENO: result: $ac_cv_objext" >&5 echo "${ECHO_T}$ac_cv_objext" >&6; } OBJEXT=$ac_cv_objext ac_objext=$OBJEXT { echo "$as_me:$LINENO: checking whether we are using the GNU C compiler" >&5 echo $ECHO_N "checking whether we are using the GNU C compiler... $ECHO_C" >&6; } if test "${ac_cv_c_compiler_gnu+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ int main () { #ifndef __GNUC__ choke me #endif ; return 0; } _ACEOF rm -f conftest.$ac_objext if { (ac_try="$ac_compile" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then ac_compiler_gnu=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_compiler_gnu=no fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext ac_cv_c_compiler_gnu=$ac_compiler_gnu fi { echo "$as_me:$LINENO: result: $ac_cv_c_compiler_gnu" >&5 echo "${ECHO_T}$ac_cv_c_compiler_gnu" >&6; } GCC=`test $ac_compiler_gnu = yes && echo yes` ac_test_CFLAGS=${CFLAGS+set} ac_save_CFLAGS=$CFLAGS { echo "$as_me:$LINENO: checking whether $CC accepts -g" >&5 echo $ECHO_N "checking whether $CC accepts -g... $ECHO_C" >&6; } if test "${ac_cv_prog_cc_g+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else ac_save_c_werror_flag=$ac_c_werror_flag ac_c_werror_flag=yes ac_cv_prog_cc_g=no CFLAGS="-g" cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ int main () { ; return 0; } _ACEOF rm -f conftest.$ac_objext if { (ac_try="$ac_compile" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then ac_cv_prog_cc_g=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 CFLAGS="" cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ int main () { ; return 0; } _ACEOF rm -f conftest.$ac_objext if { (ac_try="$ac_compile" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then : else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_c_werror_flag=$ac_save_c_werror_flag CFLAGS="-g" cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ int main () { ; return 0; } _ACEOF rm -f conftest.$ac_objext if { (ac_try="$ac_compile" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then ac_cv_prog_cc_g=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext ac_c_werror_flag=$ac_save_c_werror_flag fi { echo "$as_me:$LINENO: result: $ac_cv_prog_cc_g" >&5 echo "${ECHO_T}$ac_cv_prog_cc_g" >&6; } if test "$ac_test_CFLAGS" = set; then CFLAGS=$ac_save_CFLAGS elif test $ac_cv_prog_cc_g = yes; then if test "$GCC" = yes; then CFLAGS="-g -O2" else CFLAGS="-g" fi else if test "$GCC" = yes; then CFLAGS="-O2" else CFLAGS= fi fi { echo "$as_me:$LINENO: checking for $CC option to accept ISO C89" >&5 echo $ECHO_N "checking for $CC option to accept ISO C89... $ECHO_C" >&6; } if test "${ac_cv_prog_cc_c89+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else ac_cv_prog_cc_c89=no ac_save_CC=$CC cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #include #include #include #include /* Most of the following tests are stolen from RCS 5.7's src/conf.sh. */ struct buf { int x; }; FILE * (*rcsopen) (struct buf *, struct stat *, int); static char *e (p, i) char **p; int i; { return p[i]; } static char *f (char * (*g) (char **, int), char **p, ...) { char *s; va_list v; va_start (v,p); s = g (p, va_arg (v,int)); va_end (v); return s; } /* OSF 4.0 Compaq cc is some sort of almost-ANSI by default. It has function prototypes and stuff, but not '\xHH' hex character constants. These don't provoke an error unfortunately, instead are silently treated as 'x'. The following induces an error, until -std is added to get proper ANSI mode. Curiously '\x00'!='x' always comes out true, for an array size at least. It's necessary to write '\x00'==0 to get something that's true only with -std. */ int osf4_cc_array ['\x00' == 0 ? 1 : -1]; /* IBM C 6 for AIX is almost-ANSI by default, but it replaces macro parameters inside strings and character constants. */ #define FOO(x) 'x' int xlc6_cc_array[FOO(a) == 'x' ? 1 : -1]; int test (int i, double x); struct s1 {int (*f) (int a);}; struct s2 {int (*f) (double a);}; int pairnames (int, char **, FILE *(*)(struct buf *, struct stat *, int), int, int); int argc; char **argv; int main () { return f (e, argv, 0) != argv[0] || f (e, argv, 1) != argv[1]; ; return 0; } _ACEOF for ac_arg in '' -qlanglvl=extc89 -qlanglvl=ansi -std \ -Ae "-Aa -D_HPUX_SOURCE" "-Xc -D__EXTENSIONS__" do CC="$ac_save_CC $ac_arg" rm -f conftest.$ac_objext if { (ac_try="$ac_compile" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then ac_cv_prog_cc_c89=$ac_arg else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 fi rm -f core conftest.err conftest.$ac_objext test "x$ac_cv_prog_cc_c89" != "xno" && break done rm -f conftest.$ac_ext CC=$ac_save_CC fi # AC_CACHE_VAL case "x$ac_cv_prog_cc_c89" in x) { echo "$as_me:$LINENO: result: none needed" >&5 echo "${ECHO_T}none needed" >&6; } ;; xno) { echo "$as_me:$LINENO: result: unsupported" >&5 echo "${ECHO_T}unsupported" >&6; } ;; *) CC="$CC $ac_cv_prog_cc_c89" { echo "$as_me:$LINENO: result: $ac_cv_prog_cc_c89" >&5 echo "${ECHO_T}$ac_cv_prog_cc_c89" >&6; } ;; esac ac_ext=c ac_cpp='$CPP $CPPFLAGS' ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' ac_compiler_gnu=$ac_cv_c_compiler_gnu DEPDIR="${am__leading_dot}deps" ac_config_commands="$ac_config_commands depfiles" am_make=${MAKE-make} cat > confinc << 'END' am__doit: @echo done .PHONY: am__doit END # If we don't find an include directive, just comment out the code. { echo "$as_me:$LINENO: checking for style of include used by $am_make" >&5 echo $ECHO_N "checking for style of include used by $am_make... $ECHO_C" >&6; } am__include="#" am__quote= _am_result=none # First try GNU make style include. echo "include confinc" > confmf # We grep out `Entering directory' and `Leaving directory' # messages which can occur if `w' ends up in MAKEFLAGS. # In particular we don't look at `^make:' because GNU make might # be invoked under some other name (usually "gmake"), in which # case it prints its new name instead of `make'. if test "`$am_make -s -f confmf 2> /dev/null | grep -v 'ing directory'`" = "done"; then am__include=include am__quote= _am_result=GNU fi # Now try BSD make style include. if test "$am__include" = "#"; then echo '.include "confinc"' > confmf if test "`$am_make -s -f confmf 2> /dev/null`" = "done"; then am__include=.include am__quote="\"" _am_result=BSD fi fi { echo "$as_me:$LINENO: result: $_am_result" >&5 echo "${ECHO_T}$_am_result" >&6; } rm -f confinc confmf # Check whether --enable-dependency-tracking was given. if test "${enable_dependency_tracking+set}" = set; then enableval=$enable_dependency_tracking; fi if test "x$enable_dependency_tracking" != xno; then am_depcomp="$ac_aux_dir/depcomp" AMDEPBACKSLASH='\' fi if test "x$enable_dependency_tracking" != xno; then AMDEP_TRUE= AMDEP_FALSE='#' else AMDEP_TRUE='#' AMDEP_FALSE= fi depcc="$CC" am_compiler_list= { echo "$as_me:$LINENO: checking dependency style of $depcc" >&5 echo $ECHO_N "checking dependency style of $depcc... $ECHO_C" >&6; } if test "${am_cv_CC_dependencies_compiler_type+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else if test -z "$AMDEP_TRUE" && test -f "$am_depcomp"; then # We make a subdir and do the tests there. Otherwise we can end up # making bogus files that we don't know about and never remove. For # instance it was reported that on HP-UX the gcc test will end up # making a dummy file named `D' -- because `-MD' means `put the output # in D'. mkdir conftest.dir # Copy depcomp to subdir because otherwise we won't find it if we're # using a relative directory. cp "$am_depcomp" conftest.dir cd conftest.dir # We will build objects and dependencies in a subdirectory because # it helps to detect inapplicable dependency modes. For instance # both Tru64's cc and ICC support -MD to output dependencies as a # side effect of compilation, but ICC will put the dependencies in # the current directory while Tru64 will put them in the object # directory. mkdir sub am_cv_CC_dependencies_compiler_type=none if test "$am_compiler_list" = ""; then am_compiler_list=`sed -n 's/^#*\([a-zA-Z0-9]*\))$/\1/p' < ./depcomp` fi for depmode in $am_compiler_list; do # Setup a source with many dependencies, because some compilers # like to wrap large dependency lists on column 80 (with \), and # we should not choose a depcomp mode which is confused by this. # # We need to recreate these files for each test, as the compiler may # overwrite some of them when testing with obscure command lines. # This happens at least with the AIX C compiler. : > sub/conftest.c for i in 1 2 3 4 5 6; do echo '#include "conftst'$i'.h"' >> sub/conftest.c # Using `: > sub/conftst$i.h' creates only sub/conftst1.h with # Solaris 8's {/usr,}/bin/sh. touch sub/conftst$i.h done echo "${am__include} ${am__quote}sub/conftest.Po${am__quote}" > confmf case $depmode in nosideeffect) # after this tag, mechanisms are not by side-effect, so they'll # only be used when explicitly requested if test "x$enable_dependency_tracking" = xyes; then continue else break fi ;; none) break ;; esac # We check with `-c' and `-o' for the sake of the "dashmstdout" # mode. It turns out that the SunPro C++ compiler does not properly # handle `-M -o', and we need to detect this. if depmode=$depmode \ source=sub/conftest.c object=sub/conftest.${OBJEXT-o} \ depfile=sub/conftest.Po tmpdepfile=sub/conftest.TPo \ $SHELL ./depcomp $depcc -c -o sub/conftest.${OBJEXT-o} sub/conftest.c \ >/dev/null 2>conftest.err && grep sub/conftst6.h sub/conftest.Po > /dev/null 2>&1 && grep sub/conftest.${OBJEXT-o} sub/conftest.Po > /dev/null 2>&1 && ${MAKE-make} -s -f confmf > /dev/null 2>&1; then # icc doesn't choke on unknown options, it will just issue warnings # or remarks (even with -Werror). So we grep stderr for any message # that says an option was ignored or not supported. # When given -MP, icc 7.0 and 7.1 complain thusly: # icc: Command line warning: ignoring option '-M'; no argument required # The diagnosis changed in icc 8.0: # icc: Command line remark: option '-MP' not supported if (grep 'ignoring option' conftest.err || grep 'not supported' conftest.err) >/dev/null 2>&1; then :; else am_cv_CC_dependencies_compiler_type=$depmode break fi fi done cd .. rm -rf conftest.dir else am_cv_CC_dependencies_compiler_type=none fi fi { echo "$as_me:$LINENO: result: $am_cv_CC_dependencies_compiler_type" >&5 echo "${ECHO_T}$am_cv_CC_dependencies_compiler_type" >&6; } CCDEPMODE=depmode=$am_cv_CC_dependencies_compiler_type if test "x$enable_dependency_tracking" != xno \ && test "$am_cv_CC_dependencies_compiler_type" = gcc3; then am__fastdepCC_TRUE= am__fastdepCC_FALSE='#' else am__fastdepCC_TRUE='#' am__fastdepCC_FALSE= fi ac_ext=c ac_cpp='$CPP $CPPFLAGS' ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' ac_compiler_gnu=$ac_cv_c_compiler_gnu { echo "$as_me:$LINENO: checking how to run the C preprocessor" >&5 echo $ECHO_N "checking how to run the C preprocessor... $ECHO_C" >&6; } # On Suns, sometimes $CPP names a directory. if test -n "$CPP" && test -d "$CPP"; then CPP= fi if test -z "$CPP"; then if test "${ac_cv_prog_CPP+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else # Double quotes because CPP needs to be expanded for CPP in "$CC -E" "$CC -E -traditional-cpp" "/lib/cpp" do ac_preproc_ok=false for ac_c_preproc_warn_flag in '' yes do # Use a header file that comes with gcc, so configuring glibc # with a fresh cross-compiler works. # Prefer to if __STDC__ is defined, since # exists even on freestanding compilers. # On the NeXT, cc -E runs the code through the compiler's parser, # not just through cpp. "Syntax error" is here to catch this case. cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #ifdef __STDC__ # include #else # include #endif Syntax error _ACEOF if { (ac_try="$ac_cpp conftest.$ac_ext" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_cpp conftest.$ac_ext") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } >/dev/null && { test -z "$ac_c_preproc_warn_flag$ac_c_werror_flag" || test ! -s conftest.err }; then : else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 # Broken: fails on valid input. continue fi rm -f conftest.err conftest.$ac_ext # OK, works on sane cases. Now check whether nonexistent headers # can be detected and how. cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #include _ACEOF if { (ac_try="$ac_cpp conftest.$ac_ext" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_cpp conftest.$ac_ext") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } >/dev/null && { test -z "$ac_c_preproc_warn_flag$ac_c_werror_flag" || test ! -s conftest.err }; then # Broken: success on invalid input. continue else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 # Passes both tests. ac_preproc_ok=: break fi rm -f conftest.err conftest.$ac_ext done # Because of `break', _AC_PREPROC_IFELSE's cleaning code was skipped. rm -f conftest.err conftest.$ac_ext if $ac_preproc_ok; then break fi done ac_cv_prog_CPP=$CPP fi CPP=$ac_cv_prog_CPP else ac_cv_prog_CPP=$CPP fi { echo "$as_me:$LINENO: result: $CPP" >&5 echo "${ECHO_T}$CPP" >&6; } ac_preproc_ok=false for ac_c_preproc_warn_flag in '' yes do # Use a header file that comes with gcc, so configuring glibc # with a fresh cross-compiler works. # Prefer to if __STDC__ is defined, since # exists even on freestanding compilers. # On the NeXT, cc -E runs the code through the compiler's parser, # not just through cpp. "Syntax error" is here to catch this case. cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #ifdef __STDC__ # include #else # include #endif Syntax error _ACEOF if { (ac_try="$ac_cpp conftest.$ac_ext" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_cpp conftest.$ac_ext") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } >/dev/null && { test -z "$ac_c_preproc_warn_flag$ac_c_werror_flag" || test ! -s conftest.err }; then : else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 # Broken: fails on valid input. continue fi rm -f conftest.err conftest.$ac_ext # OK, works on sane cases. Now check whether nonexistent headers # can be detected and how. cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #include _ACEOF if { (ac_try="$ac_cpp conftest.$ac_ext" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_cpp conftest.$ac_ext") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } >/dev/null && { test -z "$ac_c_preproc_warn_flag$ac_c_werror_flag" || test ! -s conftest.err }; then # Broken: success on invalid input. continue else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 # Passes both tests. ac_preproc_ok=: break fi rm -f conftest.err conftest.$ac_ext done # Because of `break', _AC_PREPROC_IFELSE's cleaning code was skipped. rm -f conftest.err conftest.$ac_ext if $ac_preproc_ok; then : else { { echo "$as_me:$LINENO: error: C preprocessor \"$CPP\" fails sanity check See \`config.log' for more details." >&5 echo "$as_me: error: C preprocessor \"$CPP\" fails sanity check See \`config.log' for more details." >&2;} { (exit 1); exit 1; }; } fi ac_ext=c ac_cpp='$CPP $CPPFLAGS' ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' ac_compiler_gnu=$ac_cv_c_compiler_gnu { echo "$as_me:$LINENO: checking for grep that handles long lines and -e" >&5 echo $ECHO_N "checking for grep that handles long lines and -e... $ECHO_C" >&6; } if test "${ac_cv_path_GREP+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else # Extract the first word of "grep ggrep" to use in msg output if test -z "$GREP"; then set dummy grep ggrep; ac_prog_name=$2 if test "${ac_cv_path_GREP+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else ac_path_GREP_found=false # Loop through the user's path and test for each of PROGNAME-LIST as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH$PATH_SEPARATOR/usr/xpg4/bin do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_prog in grep ggrep; do for ac_exec_ext in '' $ac_executable_extensions; do ac_path_GREP="$as_dir/$ac_prog$ac_exec_ext" { test -f "$ac_path_GREP" && $as_test_x "$ac_path_GREP"; } || continue # Check for GNU ac_path_GREP and select it if it is found. # Check for GNU $ac_path_GREP case `"$ac_path_GREP" --version 2>&1` in *GNU*) ac_cv_path_GREP="$ac_path_GREP" ac_path_GREP_found=:;; *) ac_count=0 echo $ECHO_N "0123456789$ECHO_C" >"conftest.in" while : do cat "conftest.in" "conftest.in" >"conftest.tmp" mv "conftest.tmp" "conftest.in" cp "conftest.in" "conftest.nl" echo 'GREP' >> "conftest.nl" "$ac_path_GREP" -e 'GREP$' -e '-(cannot match)-' < "conftest.nl" >"conftest.out" 2>/dev/null || break diff "conftest.out" "conftest.nl" >/dev/null 2>&1 || break ac_count=`expr $ac_count + 1` if test $ac_count -gt ${ac_path_GREP_max-0}; then # Best one so far, save it but keep looking for a better one ac_cv_path_GREP="$ac_path_GREP" ac_path_GREP_max=$ac_count fi # 10*(2^10) chars as input seems more than enough test $ac_count -gt 10 && break done rm -f conftest.in conftest.tmp conftest.nl conftest.out;; esac $ac_path_GREP_found && break 3 done done done IFS=$as_save_IFS fi GREP="$ac_cv_path_GREP" if test -z "$GREP"; then { { echo "$as_me:$LINENO: error: no acceptable $ac_prog_name could be found in $PATH$PATH_SEPARATOR/usr/xpg4/bin" >&5 echo "$as_me: error: no acceptable $ac_prog_name could be found in $PATH$PATH_SEPARATOR/usr/xpg4/bin" >&2;} { (exit 1); exit 1; }; } fi else ac_cv_path_GREP=$GREP fi fi { echo "$as_me:$LINENO: result: $ac_cv_path_GREP" >&5 echo "${ECHO_T}$ac_cv_path_GREP" >&6; } GREP="$ac_cv_path_GREP" { echo "$as_me:$LINENO: checking for egrep" >&5 echo $ECHO_N "checking for egrep... $ECHO_C" >&6; } if test "${ac_cv_path_EGREP+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else if echo a | $GREP -E '(a|b)' >/dev/null 2>&1 then ac_cv_path_EGREP="$GREP -E" else # Extract the first word of "egrep" to use in msg output if test -z "$EGREP"; then set dummy egrep; ac_prog_name=$2 if test "${ac_cv_path_EGREP+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else ac_path_EGREP_found=false # Loop through the user's path and test for each of PROGNAME-LIST as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH$PATH_SEPARATOR/usr/xpg4/bin do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_prog in egrep; do for ac_exec_ext in '' $ac_executable_extensions; do ac_path_EGREP="$as_dir/$ac_prog$ac_exec_ext" { test -f "$ac_path_EGREP" && $as_test_x "$ac_path_EGREP"; } || continue # Check for GNU ac_path_EGREP and select it if it is found. # Check for GNU $ac_path_EGREP case `"$ac_path_EGREP" --version 2>&1` in *GNU*) ac_cv_path_EGREP="$ac_path_EGREP" ac_path_EGREP_found=:;; *) ac_count=0 echo $ECHO_N "0123456789$ECHO_C" >"conftest.in" while : do cat "conftest.in" "conftest.in" >"conftest.tmp" mv "conftest.tmp" "conftest.in" cp "conftest.in" "conftest.nl" echo 'EGREP' >> "conftest.nl" "$ac_path_EGREP" 'EGREP$' < "conftest.nl" >"conftest.out" 2>/dev/null || break diff "conftest.out" "conftest.nl" >/dev/null 2>&1 || break ac_count=`expr $ac_count + 1` if test $ac_count -gt ${ac_path_EGREP_max-0}; then # Best one so far, save it but keep looking for a better one ac_cv_path_EGREP="$ac_path_EGREP" ac_path_EGREP_max=$ac_count fi # 10*(2^10) chars as input seems more than enough test $ac_count -gt 10 && break done rm -f conftest.in conftest.tmp conftest.nl conftest.out;; esac $ac_path_EGREP_found && break 3 done done done IFS=$as_save_IFS fi EGREP="$ac_cv_path_EGREP" if test -z "$EGREP"; then { { echo "$as_me:$LINENO: error: no acceptable $ac_prog_name could be found in $PATH$PATH_SEPARATOR/usr/xpg4/bin" >&5 echo "$as_me: error: no acceptable $ac_prog_name could be found in $PATH$PATH_SEPARATOR/usr/xpg4/bin" >&2;} { (exit 1); exit 1; }; } fi else ac_cv_path_EGREP=$EGREP fi fi fi { echo "$as_me:$LINENO: result: $ac_cv_path_EGREP" >&5 echo "${ECHO_T}$ac_cv_path_EGREP" >&6; } EGREP="$ac_cv_path_EGREP" # Find a good install program. We prefer a C program (faster), # so one script is as good as another. But avoid the broken or # incompatible versions: # SysV /etc/install, /usr/sbin/install # SunOS /usr/etc/install # IRIX /sbin/install # AIX /bin/install # AmigaOS /C/install, which installs bootblocks on floppy discs # AIX 4 /usr/bin/installbsd, which doesn't work without a -g flag # AFS /usr/afsws/bin/install, which mishandles nonexistent args # SVR4 /usr/ucb/install, which tries to use the nonexistent group "staff" # OS/2's system install, which has a completely different semantic # ./install, which can be erroneously created by make from ./install.sh. { echo "$as_me:$LINENO: checking for a BSD-compatible install" >&5 echo $ECHO_N "checking for a BSD-compatible install... $ECHO_C" >&6; } if test -z "$INSTALL"; then if test "${ac_cv_path_install+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. # Account for people who put trailing slashes in PATH elements. case $as_dir/ in ./ | .// | /cC/* | \ /etc/* | /usr/sbin/* | /usr/etc/* | /sbin/* | /usr/afsws/bin/* | \ ?:\\/os2\\/install\\/* | ?:\\/OS2\\/INSTALL\\/* | \ /usr/ucb/* ) ;; *) # OSF1 and SCO ODT 3.0 have their own names for install. # Don't use installbsd from OSF since it installs stuff as root # by default. for ac_prog in ginstall scoinst install; do for ac_exec_ext in '' $ac_executable_extensions; do if { test -f "$as_dir/$ac_prog$ac_exec_ext" && $as_test_x "$as_dir/$ac_prog$ac_exec_ext"; }; then if test $ac_prog = install && grep dspmsg "$as_dir/$ac_prog$ac_exec_ext" >/dev/null 2>&1; then # AIX install. It has an incompatible calling convention. : elif test $ac_prog = install && grep pwplus "$as_dir/$ac_prog$ac_exec_ext" >/dev/null 2>&1; then # program-specific install script used by HP pwplus--don't use. : else ac_cv_path_install="$as_dir/$ac_prog$ac_exec_ext -c" break 3 fi fi done done ;; esac done IFS=$as_save_IFS fi if test "${ac_cv_path_install+set}" = set; then INSTALL=$ac_cv_path_install else # As a last resort, use the slow shell script. Don't cache a # value for INSTALL within a source directory, because that will # break other packages using the cache if that directory is # removed, or if the value is a relative name. INSTALL="$SHELL $ac_install_sh" fi fi { echo "$as_me:$LINENO: result: $INSTALL" >&5 echo "${ECHO_T}$INSTALL" >&6; } # Use test -z because SunOS4 sh mishandles braces in ${var-val}. # It thinks the first close brace ends the variable substitution. test -z "$INSTALL_PROGRAM" && INSTALL_PROGRAM='${INSTALL}' test -z "$INSTALL_SCRIPT" && INSTALL_SCRIPT='${INSTALL}' test -z "$INSTALL_DATA" && INSTALL_DATA='${INSTALL} -m 644' { echo "$as_me:$LINENO: checking whether ln -s works" >&5 echo $ECHO_N "checking whether ln -s works... $ECHO_C" >&6; } LN_S=$as_ln_s if test "$LN_S" = "ln -s"; then { echo "$as_me:$LINENO: result: yes" >&5 echo "${ECHO_T}yes" >&6; } else { echo "$as_me:$LINENO: result: no, using $LN_S" >&5 echo "${ECHO_T}no, using $LN_S" >&6; } fi case $host in *-*-minix*) CPPFLAGS="$CPPFLAGS -D_POSIX_SOURCE -D_POSIX_1_SOURCE=2 -D_MINIX" ;; *-gnu*) CPPFLAGS="$CPPFLAGS -D_GNU_SOURCE" ;; esac case $host in *-*-mirbsd* | *-*-openbsd*) cat >>confdefs.h <<\_ACEOF #define HAVE_GCC_ATTRIBUTE_BOUNDED 1 _ACEOF ;; esac # Checks for libraries. search_libs_selinux="selinux" search_libs_snprintf="snprintf db" search_libs_term="" search_libs_util="util" # Check whether --enable-curses was given. if test "${enable_curses+set}" = set; then enableval=$enable_curses; curses=$enableval else curses=yes fi test x"$curses" = x"yes" && \ search_libs_term="$search_libs_term tinfo ncursesw ncurses curses" # Check whether --enable-termcap was given. if test "${enable_termcap+set}" = set; then enableval=$enable_termcap; termcap=$enableval else termcap=yes fi test x"$termcap" = x"yes" && \ search_libs_term="$search_libs_term termcap" # Check whether --enable-terminfo was given. if test "${enable_terminfo+set}" = set; then enableval=$enable_terminfo; terminfo=$enableval else terminfo=yes fi # Check whether --enable-selinux was given. if test "${enable_selinux+set}" = set; then enableval=$enable_selinux; selinux=$enableval else selinux=yes fi # Check whether --enable-search_libs was given. if test "${enable_search_libs+set}" = set; then enableval=$enable_search_libs; search_libs=$enableval else search_libs=yes fi if test x"$search_libs" = x"no"; then search_libs_selinux="" search_libs_snprintf="" search_libs_term="" search_libs_util="" fi { echo "$as_me:$LINENO: checking for library containing openpty" >&5 echo $ECHO_N "checking for library containing openpty... $ECHO_C" >&6; } if test "${ac_cv_search_openpty+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else ac_func_search_save_LIBS=$LIBS cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ #ifdef __cplusplus extern "C" #endif char openpty (); int main () { return openpty (); ; return 0; } _ACEOF for ac_lib in '' $search_libs_util; do if test -z "$ac_lib"; then ac_res="none required" else ac_res=-l$ac_lib LIBS="-l$ac_lib $ac_func_search_save_LIBS" fi rm -f conftest.$ac_objext conftest$ac_exeext if { (ac_try="$ac_link" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_link") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest$ac_exeext && $as_test_x conftest$ac_exeext; then ac_cv_search_openpty=$ac_res else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 fi rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ conftest$ac_exeext if test "${ac_cv_search_openpty+set}" = set; then break fi done if test "${ac_cv_search_openpty+set}" = set; then : else ac_cv_search_openpty=no fi rm conftest.$ac_ext LIBS=$ac_func_search_save_LIBS fi { echo "$as_me:$LINENO: result: $ac_cv_search_openpty" >&5 echo "${ECHO_T}$ac_cv_search_openpty" >&6; } ac_res=$ac_cv_search_openpty if test "$ac_res" != no; then test "$ac_res" = "none required" || LIBS="$ac_res $LIBS" cat >>confdefs.h <<_ACEOF #define HAVE_OPENPTY 1 _ACEOF fi { echo "$as_me:$LINENO: checking for library containing login_tty" >&5 echo $ECHO_N "checking for library containing login_tty... $ECHO_C" >&6; } if test "${ac_cv_search_login_tty+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else ac_func_search_save_LIBS=$LIBS cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ #ifdef __cplusplus extern "C" #endif char login_tty (); int main () { return login_tty (); ; return 0; } _ACEOF for ac_lib in '' $search_libs_util; do if test -z "$ac_lib"; then ac_res="none required" else ac_res=-l$ac_lib LIBS="-l$ac_lib $ac_func_search_save_LIBS" fi rm -f conftest.$ac_objext conftest$ac_exeext if { (ac_try="$ac_link" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_link") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest$ac_exeext && $as_test_x conftest$ac_exeext; then ac_cv_search_login_tty=$ac_res else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 fi rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ conftest$ac_exeext if test "${ac_cv_search_login_tty+set}" = set; then break fi done if test "${ac_cv_search_login_tty+set}" = set; then : else ac_cv_search_login_tty=no fi rm conftest.$ac_ext LIBS=$ac_func_search_save_LIBS fi { echo "$as_me:$LINENO: result: $ac_cv_search_login_tty" >&5 echo "${ECHO_T}$ac_cv_search_login_tty" >&6; } ac_res=$ac_cv_search_login_tty if test "$ac_res" != no; then test "$ac_res" = "none required" || LIBS="$ac_res $LIBS" cat >>confdefs.h <<_ACEOF #define HAVE_LOGIN_TTY 1 _ACEOF fi if test x"$terminfo" = x"no"; then echo "DISabling looking for terminal libraries entirely!" else { echo "$as_me:$LINENO: checking for library containing tgetflag" >&5 echo $ECHO_N "checking for library containing tgetflag... $ECHO_C" >&6; } if test "${ac_cv_search_tgetflag+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else ac_func_search_save_LIBS=$LIBS cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ #ifdef __cplusplus extern "C" #endif char tgetflag (); int main () { return tgetflag (); ; return 0; } _ACEOF for ac_lib in '' $search_libs_term; do if test -z "$ac_lib"; then ac_res="none required" else ac_res=-l$ac_lib LIBS="-l$ac_lib $ac_func_search_save_LIBS" fi rm -f conftest.$ac_objext conftest$ac_exeext if { (ac_try="$ac_link" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_link") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest$ac_exeext && $as_test_x conftest$ac_exeext; then ac_cv_search_tgetflag=$ac_res else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 fi rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ conftest$ac_exeext if test "${ac_cv_search_tgetflag+set}" = set; then break fi done if test "${ac_cv_search_tgetflag+set}" = set; then : else ac_cv_search_tgetflag=no fi rm conftest.$ac_ext LIBS=$ac_func_search_save_LIBS fi { echo "$as_me:$LINENO: result: $ac_cv_search_tgetflag" >&5 echo "${ECHO_T}$ac_cv_search_tgetflag" >&6; } ac_res=$ac_cv_search_tgetflag if test "$ac_res" != no; then test "$ac_res" = "none required" || LIBS="$ac_res $LIBS" cat >>confdefs.h <<_ACEOF #define TERMINFO 1 _ACEOF fi fi { echo "$as_me:$LINENO: checking for library containing snprintf" >&5 echo $ECHO_N "checking for library containing snprintf... $ECHO_C" >&6; } if test "${ac_cv_search_snprintf+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else ac_func_search_save_LIBS=$LIBS cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ #ifdef __cplusplus extern "C" #endif char snprintf (); int main () { return snprintf (); ; return 0; } _ACEOF for ac_lib in '' $search_libs_snprintf; do if test -z "$ac_lib"; then ac_res="none required" else ac_res=-l$ac_lib LIBS="-l$ac_lib $ac_func_search_save_LIBS" fi rm -f conftest.$ac_objext conftest$ac_exeext if { (ac_try="$ac_link" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_link") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest$ac_exeext && $as_test_x conftest$ac_exeext; then ac_cv_search_snprintf=$ac_res else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 fi rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ conftest$ac_exeext if test "${ac_cv_search_snprintf+set}" = set; then break fi done if test "${ac_cv_search_snprintf+set}" = set; then : else ac_cv_search_snprintf=no fi rm conftest.$ac_ext LIBS=$ac_func_search_save_LIBS fi { echo "$as_me:$LINENO: result: $ac_cv_search_snprintf" >&5 echo "${ECHO_T}$ac_cv_search_snprintf" >&6; } ac_res=$ac_cv_search_snprintf if test "$ac_res" != no; then test "$ac_res" = "none required" || LIBS="$ac_res $LIBS" cat >>confdefs.h <<_ACEOF #define HAVE_SNPRINTF 1 _ACEOF fi if test x"$selinux" = x"no"; then echo "DISabling looking for SELinux support" else { echo "$as_me:$LINENO: checking for library containing is_selinux_enabled" >&5 echo $ECHO_N "checking for library containing is_selinux_enabled... $ECHO_C" >&6; } if test "${ac_cv_search_is_selinux_enabled+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else ac_func_search_save_LIBS=$LIBS cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ #ifdef __cplusplus extern "C" #endif char is_selinux_enabled (); int main () { return is_selinux_enabled (); ; return 0; } _ACEOF for ac_lib in '' $search_libs_selinux; do if test -z "$ac_lib"; then ac_res="none required" else ac_res=-l$ac_lib LIBS="-l$ac_lib $ac_func_search_save_LIBS" fi rm -f conftest.$ac_objext conftest$ac_exeext if { (ac_try="$ac_link" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_link") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest$ac_exeext && $as_test_x conftest$ac_exeext; then ac_cv_search_is_selinux_enabled=$ac_res else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 fi rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ conftest$ac_exeext if test "${ac_cv_search_is_selinux_enabled+set}" = set; then break fi done if test "${ac_cv_search_is_selinux_enabled+set}" = set; then : else ac_cv_search_is_selinux_enabled=no fi rm conftest.$ac_ext LIBS=$ac_func_search_save_LIBS fi { echo "$as_me:$LINENO: result: $ac_cv_search_is_selinux_enabled" >&5 echo "${ECHO_T}$ac_cv_search_is_selinux_enabled" >&6; } ac_res=$ac_cv_search_is_selinux_enabled if test "$ac_res" != no; then test "$ac_res" = "none required" || LIBS="$ac_res $LIBS" cat >>confdefs.h <<_ACEOF #define HAVE_SELINUX_FUN 1 _ACEOF fi fi # other conditionals # Check whether --enable-getpwnam was given. if test "${enable_getpwnam+set}" = set; then enableval=$enable_getpwnam; getpwnam=$enableval else getpwnam=yes fi test x"$getpwnam" = x"no" && CPPFLAGS="$CPPFLAGS -DJOE_NOPWNAM" # Check whether --enable-termidx was given. if test "${enable_termidx+set}" = set; then enableval=$enable_termidx; termidx=$enableval else termidx=yes fi if test x"$termidx" != x"no"; then WANT_TERMIDX_TRUE= WANT_TERMIDX_FALSE='#' else WANT_TERMIDX_TRUE='#' WANT_TERMIDX_FALSE= fi # Check whether --enable-sysconfjoesubdir was given. if test "${enable_sysconfjoesubdir+set}" = set; then enableval=$enable_sysconfjoesubdir; sysconfjoesubdir=$enableval else sysconfjoesubdir=yes fi if test x"$sysconfjoesubdir" = x"yes"; then sysconfjoesubdir=/joe elif test x"$sysconfjoesubdir" = x"no"; then sysconfjoesubdir= fi # Check whether --enable-win32reloc was given. if test "${enable_win32reloc+set}" = set; then enableval=$enable_win32reloc; win32reloc=$enableval else win32reloc=no fi if test x"$win32reloc" = x"yes"; then JUPP_WIN32RELOC=1 else JUPP_WIN32RELOC=0 fi cat >>confdefs.h <<_ACEOF #define JUPP_WIN32RELOC $JUPP_WIN32RELOC _ACEOF if test x"$win32reloc" = x"yes"; then joeinitfile='\\fBjoerc\\fR in the same directory as the binary resides in' joeinitcopy='which resides in the same directory as the binary' joeresides='C:\\eProgramme\\ejupp32\\ejoe.exe' jrcbefore='' jrcafter=' in the same directory as the binary' elif test x"$win32reloc" = x"old"; then joeinitfile='\\fBc:/windows/system32/joe/joerc\\fR' joeinitcopy='which resides in \\fBc:/windows/system32/joe/joerc\\fR' joeresides='c:/windows/system32/joe.exe' jrcbefore='c:/windows/system32/joe/' jrcafter='' else joeinitfile='usually \\fB'$sysconfdir$sysconfjoesubdir'/joerc\\fR' joeinitcopy='which normally resides in \\fB'$sysconfdir$sysconfjoesubdir'/joerc\\fR' joeresides=$bindir'/joe' jrcbefore=$sysconfdir$sysconfjoesubdir/ jrcafter='' fi # Checks for header files. { echo "$as_me:$LINENO: checking for ANSI C header files" >&5 echo $ECHO_N "checking for ANSI C header files... $ECHO_C" >&6; } if test "${ac_cv_header_stdc+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #include #include #include #include int main () { ; return 0; } _ACEOF rm -f conftest.$ac_objext if { (ac_try="$ac_compile" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then ac_cv_header_stdc=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_cv_header_stdc=no fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext if test $ac_cv_header_stdc = yes; then # SunOS 4.x string.h does not declare mem*, contrary to ANSI. cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #include _ACEOF if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | $EGREP "memchr" >/dev/null 2>&1; then : else ac_cv_header_stdc=no fi rm -f conftest* fi if test $ac_cv_header_stdc = yes; then # ISC 2.0.2 stdlib.h does not declare free, contrary to ANSI. cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #include _ACEOF if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | $EGREP "free" >/dev/null 2>&1; then : else ac_cv_header_stdc=no fi rm -f conftest* fi if test $ac_cv_header_stdc = yes; then # /bin/cc in Irix-4.0.5 gets non-ANSI ctype macros unless using -ansi. if test "$cross_compiling" = yes; then : else cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #include #include #if ((' ' & 0x0FF) == 0x020) # define ISLOWER(c) ('a' <= (c) && (c) <= 'z') # define TOUPPER(c) (ISLOWER(c) ? 'A' + ((c) - 'a') : (c)) #else # define ISLOWER(c) \ (('a' <= (c) && (c) <= 'i') \ || ('j' <= (c) && (c) <= 'r') \ || ('s' <= (c) && (c) <= 'z')) # define TOUPPER(c) (ISLOWER(c) ? ((c) | 0x40) : (c)) #endif #define XOR(e, f) (((e) && !(f)) || (!(e) && (f))) int main () { int i; for (i = 0; i < 256; i++) if (XOR (islower (i), ISLOWER (i)) || toupper (i) != TOUPPER (i)) return 2; return 0; } _ACEOF rm -f conftest$ac_exeext if { (ac_try="$ac_link" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_link") 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='./conftest$ac_exeext' { (case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_try") 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then : else echo "$as_me: program exited with status $ac_status" >&5 echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ( exit $ac_status ) ac_cv_header_stdc=no fi rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext fi fi fi { echo "$as_me:$LINENO: result: $ac_cv_header_stdc" >&5 echo "${ECHO_T}$ac_cv_header_stdc" >&6; } if test $ac_cv_header_stdc = yes; then cat >>confdefs.h <<\_ACEOF #define STDC_HEADERS 1 _ACEOF fi # On IRIX 5.3, sys/types and inttypes.h are conflicting. for ac_header in sys/types.h sys/stat.h stdlib.h string.h memory.h strings.h \ inttypes.h stdint.h unistd.h do as_ac_Header=`echo "ac_cv_header_$ac_header" | $as_tr_sh` { echo "$as_me:$LINENO: checking for $ac_header" >&5 echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6; } if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then echo $ECHO_N "(cached) $ECHO_C" >&6 else cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ $ac_includes_default #include <$ac_header> _ACEOF rm -f conftest.$ac_objext if { (ac_try="$ac_compile" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then eval "$as_ac_Header=yes" else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 eval "$as_ac_Header=no" fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi ac_res=`eval echo '${'$as_ac_Header'}'` { echo "$as_me:$LINENO: result: $ac_res" >&5 echo "${ECHO_T}$ac_res" >&6; } if test `eval echo '${'$as_ac_Header'}'` = yes; then cat >>confdefs.h <<_ACEOF #define `echo "HAVE_$ac_header" | $as_tr_cpp` 1 _ACEOF fi done for ac_header in \ sys/dirent.h sys/ioctl.h sys/param.h sys/stat.h sys/termio.h \ sys/time.h sys/types.h sys/wait.h errno.h fcntl.h \ langinfo.h limits.h locale.h paths.h pty.h pwd.h sgtty.h signal.h \ stdlib.h string.h termio.h time.h unistd.h util.h utime.h \ utmp.h bsd/string.h selinux/context.h selinux/selinux.h \ do as_ac_Header=`echo "ac_cv_header_$ac_header" | $as_tr_sh` if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then { echo "$as_me:$LINENO: checking for $ac_header" >&5 echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6; } if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then echo $ECHO_N "(cached) $ECHO_C" >&6 fi ac_res=`eval echo '${'$as_ac_Header'}'` { echo "$as_me:$LINENO: result: $ac_res" >&5 echo "${ECHO_T}$ac_res" >&6; } else # Is the header compilable? { echo "$as_me:$LINENO: checking $ac_header usability" >&5 echo $ECHO_N "checking $ac_header usability... $ECHO_C" >&6; } cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ $ac_includes_default #include <$ac_header> _ACEOF rm -f conftest.$ac_objext if { (ac_try="$ac_compile" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then ac_header_compiler=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_header_compiler=no fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext { echo "$as_me:$LINENO: result: $ac_header_compiler" >&5 echo "${ECHO_T}$ac_header_compiler" >&6; } # Is the header present? { echo "$as_me:$LINENO: checking $ac_header presence" >&5 echo $ECHO_N "checking $ac_header presence... $ECHO_C" >&6; } cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #include <$ac_header> _ACEOF if { (ac_try="$ac_cpp conftest.$ac_ext" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_cpp conftest.$ac_ext") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } >/dev/null && { test -z "$ac_c_preproc_warn_flag$ac_c_werror_flag" || test ! -s conftest.err }; then ac_header_preproc=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_header_preproc=no fi rm -f conftest.err conftest.$ac_ext { echo "$as_me:$LINENO: result: $ac_header_preproc" >&5 echo "${ECHO_T}$ac_header_preproc" >&6; } # So? What about this header? case $ac_header_compiler:$ac_header_preproc:$ac_c_preproc_warn_flag in yes:no: ) { echo "$as_me:$LINENO: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&5 echo "$as_me: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&2;} { echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the compiler's result" >&5 echo "$as_me: WARNING: $ac_header: proceeding with the compiler's result" >&2;} ac_header_preproc=yes ;; no:yes:* ) { echo "$as_me:$LINENO: WARNING: $ac_header: present but cannot be compiled" >&5 echo "$as_me: WARNING: $ac_header: present but cannot be compiled" >&2;} { echo "$as_me:$LINENO: WARNING: $ac_header: check for missing prerequisite headers?" >&5 echo "$as_me: WARNING: $ac_header: check for missing prerequisite headers?" >&2;} { echo "$as_me:$LINENO: WARNING: $ac_header: see the Autoconf documentation" >&5 echo "$as_me: WARNING: $ac_header: see the Autoconf documentation" >&2;} { echo "$as_me:$LINENO: WARNING: $ac_header: section \"Present But Cannot Be Compiled\"" >&5 echo "$as_me: WARNING: $ac_header: section \"Present But Cannot Be Compiled\"" >&2;} { echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the preprocessor's result" >&5 echo "$as_me: WARNING: $ac_header: proceeding with the preprocessor's result" >&2;} { echo "$as_me:$LINENO: WARNING: $ac_header: in the future, the compiler will take precedence" >&5 echo "$as_me: WARNING: $ac_header: in the future, the compiler will take precedence" >&2;} ;; esac { echo "$as_me:$LINENO: checking for $ac_header" >&5 echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6; } if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then echo $ECHO_N "(cached) $ECHO_C" >&6 else eval "$as_ac_Header=\$ac_header_preproc" fi ac_res=`eval echo '${'$as_ac_Header'}'` { echo "$as_me:$LINENO: result: $ac_res" >&5 echo "${ECHO_T}$ac_res" >&6; } fi if test `eval echo '${'$as_ac_Header'}'` = yes; then cat >>confdefs.h <<_ACEOF #define `echo "HAVE_$ac_header" | $as_tr_cpp` 1 _ACEOF fi done ac_header_dirent=no for ac_hdr in dirent.h sys/ndir.h sys/dir.h ndir.h; do as_ac_Header=`echo "ac_cv_header_dirent_$ac_hdr" | $as_tr_sh` { echo "$as_me:$LINENO: checking for $ac_hdr that defines DIR" >&5 echo $ECHO_N "checking for $ac_hdr that defines DIR... $ECHO_C" >&6; } if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then echo $ECHO_N "(cached) $ECHO_C" >&6 else cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #include #include <$ac_hdr> int main () { if ((DIR *) 0) return 0; ; return 0; } _ACEOF rm -f conftest.$ac_objext if { (ac_try="$ac_compile" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then eval "$as_ac_Header=yes" else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 eval "$as_ac_Header=no" fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi ac_res=`eval echo '${'$as_ac_Header'}'` { echo "$as_me:$LINENO: result: $ac_res" >&5 echo "${ECHO_T}$ac_res" >&6; } if test `eval echo '${'$as_ac_Header'}'` = yes; then cat >>confdefs.h <<_ACEOF #define `echo "HAVE_$ac_hdr" | $as_tr_cpp` 1 _ACEOF ac_header_dirent=$ac_hdr; break fi done # Two versions of opendir et al. are in -ldir and -lx on SCO Xenix. if test $ac_header_dirent = dirent.h; then { echo "$as_me:$LINENO: checking for library containing opendir" >&5 echo $ECHO_N "checking for library containing opendir... $ECHO_C" >&6; } if test "${ac_cv_search_opendir+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else ac_func_search_save_LIBS=$LIBS cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ #ifdef __cplusplus extern "C" #endif char opendir (); int main () { return opendir (); ; return 0; } _ACEOF for ac_lib in '' dir; do if test -z "$ac_lib"; then ac_res="none required" else ac_res=-l$ac_lib LIBS="-l$ac_lib $ac_func_search_save_LIBS" fi rm -f conftest.$ac_objext conftest$ac_exeext if { (ac_try="$ac_link" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_link") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest$ac_exeext && $as_test_x conftest$ac_exeext; then ac_cv_search_opendir=$ac_res else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 fi rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ conftest$ac_exeext if test "${ac_cv_search_opendir+set}" = set; then break fi done if test "${ac_cv_search_opendir+set}" = set; then : else ac_cv_search_opendir=no fi rm conftest.$ac_ext LIBS=$ac_func_search_save_LIBS fi { echo "$as_me:$LINENO: result: $ac_cv_search_opendir" >&5 echo "${ECHO_T}$ac_cv_search_opendir" >&6; } ac_res=$ac_cv_search_opendir if test "$ac_res" != no; then test "$ac_res" = "none required" || LIBS="$ac_res $LIBS" fi else { echo "$as_me:$LINENO: checking for library containing opendir" >&5 echo $ECHO_N "checking for library containing opendir... $ECHO_C" >&6; } if test "${ac_cv_search_opendir+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else ac_func_search_save_LIBS=$LIBS cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ #ifdef __cplusplus extern "C" #endif char opendir (); int main () { return opendir (); ; return 0; } _ACEOF for ac_lib in '' x; do if test -z "$ac_lib"; then ac_res="none required" else ac_res=-l$ac_lib LIBS="-l$ac_lib $ac_func_search_save_LIBS" fi rm -f conftest.$ac_objext conftest$ac_exeext if { (ac_try="$ac_link" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_link") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest$ac_exeext && $as_test_x conftest$ac_exeext; then ac_cv_search_opendir=$ac_res else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 fi rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ conftest$ac_exeext if test "${ac_cv_search_opendir+set}" = set; then break fi done if test "${ac_cv_search_opendir+set}" = set; then : else ac_cv_search_opendir=no fi rm conftest.$ac_ext LIBS=$ac_func_search_save_LIBS fi { echo "$as_me:$LINENO: result: $ac_cv_search_opendir" >&5 echo "${ECHO_T}$ac_cv_search_opendir" >&6; } ac_res=$ac_cv_search_opendir if test "$ac_res" != no; then test "$ac_res" = "none required" || LIBS="$ac_res $LIBS" fi fi { echo "$as_me:$LINENO: checking POSIX termios" >&5 echo $ECHO_N "checking POSIX termios... $ECHO_C" >&6; } if test "${ac_cv_sys_posix_termios+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #include #include #include int main () { /* SunOS 4.0.3 has termios.h but not the library calls. */ tcgetattr(0, 0); ; return 0; } _ACEOF rm -f conftest.$ac_objext conftest$ac_exeext if { (ac_try="$ac_link" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_link") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest$ac_exeext && $as_test_x conftest$ac_exeext; then ac_cv_sys_posix_termios=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_cv_sys_posix_termios=no fi rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ conftest$ac_exeext conftest.$ac_ext fi { echo "$as_me:$LINENO: result: $ac_cv_sys_posix_termios" >&5 echo "${ECHO_T}$ac_cv_sys_posix_termios" >&6; } if test "$ac_cv_sys_posix_termios" = "yes"; then cat >>confdefs.h <<\_ACEOF #define HAVE_POSIX_TERMIOS 1 _ACEOF else if test "$ac_cv_header_termio_h" = "yes" -a "$ac_cvs_header_sys_termio_h" = "yes" ]; then cat >>confdefs.h <<\_ACEOF #define HAVE_SYSV_TERMIO 1 _ACEOF fi fi { echo "$as_me:$LINENO: checking whether termios.h defines TIOCGWINSZ" >&5 echo $ECHO_N "checking whether termios.h defines TIOCGWINSZ... $ECHO_C" >&6; } if test "${ac_cv_sys_tiocgwinsz_in_termios_h+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #include #include #ifdef TIOCGWINSZ yes #endif _ACEOF if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | $EGREP "yes" >/dev/null 2>&1; then ac_cv_sys_tiocgwinsz_in_termios_h=yes else ac_cv_sys_tiocgwinsz_in_termios_h=no fi rm -f conftest* fi { echo "$as_me:$LINENO: result: $ac_cv_sys_tiocgwinsz_in_termios_h" >&5 echo "${ECHO_T}$ac_cv_sys_tiocgwinsz_in_termios_h" >&6; } if test $ac_cv_sys_tiocgwinsz_in_termios_h != yes; then { echo "$as_me:$LINENO: checking whether sys/ioctl.h defines TIOCGWINSZ" >&5 echo $ECHO_N "checking whether sys/ioctl.h defines TIOCGWINSZ... $ECHO_C" >&6; } if test "${ac_cv_sys_tiocgwinsz_in_sys_ioctl_h+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #include #include #ifdef TIOCGWINSZ yes #endif _ACEOF if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | $EGREP "yes" >/dev/null 2>&1; then ac_cv_sys_tiocgwinsz_in_sys_ioctl_h=yes else ac_cv_sys_tiocgwinsz_in_sys_ioctl_h=no fi rm -f conftest* fi { echo "$as_me:$LINENO: result: $ac_cv_sys_tiocgwinsz_in_sys_ioctl_h" >&5 echo "${ECHO_T}$ac_cv_sys_tiocgwinsz_in_sys_ioctl_h" >&6; } if test $ac_cv_sys_tiocgwinsz_in_sys_ioctl_h = yes; then cat >>confdefs.h <<\_ACEOF #define GWINSZ_IN_SYS_IOCTL 1 _ACEOF fi fi { echo "$as_me:$LINENO: checking whether time.h and sys/time.h may both be included" >&5 echo $ECHO_N "checking whether time.h and sys/time.h may both be included... $ECHO_C" >&6; } if test "${ac_cv_header_time+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #include #include #include int main () { if ((struct tm *) 0) return 0; ; return 0; } _ACEOF rm -f conftest.$ac_objext if { (ac_try="$ac_compile" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then ac_cv_header_time=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_cv_header_time=no fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi { echo "$as_me:$LINENO: result: $ac_cv_header_time" >&5 echo "${ECHO_T}$ac_cv_header_time" >&6; } if test $ac_cv_header_time = yes; then cat >>confdefs.h <<\_ACEOF #define TIME_WITH_SYS_TIME 1 _ACEOF fi # Checks for typedefs, structures, and compiler characteristics. { echo "$as_me:$LINENO: checking for an ANSI C-conforming const" >&5 echo $ECHO_N "checking for an ANSI C-conforming const... $ECHO_C" >&6; } if test "${ac_cv_c_const+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ int main () { /* FIXME: Include the comments suggested by Paul. */ #ifndef __cplusplus /* Ultrix mips cc rejects this. */ typedef int charset[2]; const charset cs; /* SunOS 4.1.1 cc rejects this. */ char const *const *pcpcc; char **ppc; /* NEC SVR4.0.2 mips cc rejects this. */ struct point {int x, y;}; static struct point const zero = {0,0}; /* AIX XL C 1.02.0.0 rejects this. It does not let you subtract one const X* pointer from another in an arm of an if-expression whose if-part is not a constant expression */ const char *g = "string"; pcpcc = &g + (g ? g-g : 0); /* HPUX 7.0 cc rejects these. */ ++pcpcc; ppc = (char**) pcpcc; pcpcc = (char const *const *) ppc; { /* SCO 3.2v4 cc rejects this. */ char *t; char const *s = 0 ? (char *) 0 : (char const *) 0; *t++ = 0; if (s) return 0; } { /* Someone thinks the Sun supposedly-ANSI compiler will reject this. */ int x[] = {25, 17}; const int *foo = &x[0]; ++foo; } { /* Sun SC1.0 ANSI compiler rejects this -- but not the above. */ typedef const int *iptr; iptr p = 0; ++p; } { /* AIX XL C 1.02.0.0 rejects this saying "k.c", line 2.27: 1506-025 (S) Operand must be a modifiable lvalue. */ struct s { int j; const int *ap[3]; }; struct s *b; b->j = 5; } { /* ULTRIX-32 V3.1 (Rev 9) vcc rejects this */ const int foo = 10; if (!foo) return 0; } return !cs[0] && !zero.x; #endif ; return 0; } _ACEOF rm -f conftest.$ac_objext if { (ac_try="$ac_compile" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then ac_cv_c_const=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_cv_c_const=no fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi { echo "$as_me:$LINENO: result: $ac_cv_c_const" >&5 echo "${ECHO_T}$ac_cv_c_const" >&6; } if test $ac_cv_c_const = no; then cat >>confdefs.h <<\_ACEOF #define const _ACEOF fi # Check whether --enable-largefile was given. if test "${enable_largefile+set}" = set; then enableval=$enable_largefile; fi if test "$enable_largefile" != no; then { echo "$as_me:$LINENO: checking for special C compiler options needed for large files" >&5 echo $ECHO_N "checking for special C compiler options needed for large files... $ECHO_C" >&6; } if test "${ac_cv_sys_largefile_CC+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else ac_cv_sys_largefile_CC=no if test "$GCC" != yes; then ac_save_CC=$CC while :; do # IRIX 6.2 and later do not support large files by default, # so use the C compiler's -n32 option if that helps. cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #include /* Check that off_t can represent 2**63 - 1 correctly. We can't simply define LARGE_OFF_T to be 9223372036854775807, since some C++ compilers masquerading as C compilers incorrectly reject 9223372036854775807. */ #define LARGE_OFF_T (((off_t) 1 << 62) - 1 + ((off_t) 1 << 62)) int off_t_is_large[(LARGE_OFF_T % 2147483629 == 721 && LARGE_OFF_T % 2147483647 == 1) ? 1 : -1]; int main () { ; return 0; } _ACEOF rm -f conftest.$ac_objext if { (ac_try="$ac_compile" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then break else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 fi rm -f core conftest.err conftest.$ac_objext CC="$CC -n32" rm -f conftest.$ac_objext if { (ac_try="$ac_compile" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then ac_cv_sys_largefile_CC=' -n32'; break else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 fi rm -f core conftest.err conftest.$ac_objext break done CC=$ac_save_CC rm -f conftest.$ac_ext fi fi { echo "$as_me:$LINENO: result: $ac_cv_sys_largefile_CC" >&5 echo "${ECHO_T}$ac_cv_sys_largefile_CC" >&6; } if test "$ac_cv_sys_largefile_CC" != no; then CC=$CC$ac_cv_sys_largefile_CC fi { echo "$as_me:$LINENO: checking for _FILE_OFFSET_BITS value needed for large files" >&5 echo $ECHO_N "checking for _FILE_OFFSET_BITS value needed for large files... $ECHO_C" >&6; } if test "${ac_cv_sys_file_offset_bits+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else while :; do cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #include /* Check that off_t can represent 2**63 - 1 correctly. We can't simply define LARGE_OFF_T to be 9223372036854775807, since some C++ compilers masquerading as C compilers incorrectly reject 9223372036854775807. */ #define LARGE_OFF_T (((off_t) 1 << 62) - 1 + ((off_t) 1 << 62)) int off_t_is_large[(LARGE_OFF_T % 2147483629 == 721 && LARGE_OFF_T % 2147483647 == 1) ? 1 : -1]; int main () { ; return 0; } _ACEOF rm -f conftest.$ac_objext if { (ac_try="$ac_compile" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then ac_cv_sys_file_offset_bits=no; break else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #define _FILE_OFFSET_BITS 64 #include /* Check that off_t can represent 2**63 - 1 correctly. We can't simply define LARGE_OFF_T to be 9223372036854775807, since some C++ compilers masquerading as C compilers incorrectly reject 9223372036854775807. */ #define LARGE_OFF_T (((off_t) 1 << 62) - 1 + ((off_t) 1 << 62)) int off_t_is_large[(LARGE_OFF_T % 2147483629 == 721 && LARGE_OFF_T % 2147483647 == 1) ? 1 : -1]; int main () { ; return 0; } _ACEOF rm -f conftest.$ac_objext if { (ac_try="$ac_compile" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then ac_cv_sys_file_offset_bits=64; break else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext ac_cv_sys_file_offset_bits=unknown break done fi { echo "$as_me:$LINENO: result: $ac_cv_sys_file_offset_bits" >&5 echo "${ECHO_T}$ac_cv_sys_file_offset_bits" >&6; } case $ac_cv_sys_file_offset_bits in #( no | unknown) ;; *) cat >>confdefs.h <<_ACEOF #define _FILE_OFFSET_BITS $ac_cv_sys_file_offset_bits _ACEOF ;; esac rm -f conftest* if test $ac_cv_sys_file_offset_bits = unknown; then { echo "$as_me:$LINENO: checking for _LARGE_FILES value needed for large files" >&5 echo $ECHO_N "checking for _LARGE_FILES value needed for large files... $ECHO_C" >&6; } if test "${ac_cv_sys_large_files+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else while :; do cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #include /* Check that off_t can represent 2**63 - 1 correctly. We can't simply define LARGE_OFF_T to be 9223372036854775807, since some C++ compilers masquerading as C compilers incorrectly reject 9223372036854775807. */ #define LARGE_OFF_T (((off_t) 1 << 62) - 1 + ((off_t) 1 << 62)) int off_t_is_large[(LARGE_OFF_T % 2147483629 == 721 && LARGE_OFF_T % 2147483647 == 1) ? 1 : -1]; int main () { ; return 0; } _ACEOF rm -f conftest.$ac_objext if { (ac_try="$ac_compile" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then ac_cv_sys_large_files=no; break else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #define _LARGE_FILES 1 #include /* Check that off_t can represent 2**63 - 1 correctly. We can't simply define LARGE_OFF_T to be 9223372036854775807, since some C++ compilers masquerading as C compilers incorrectly reject 9223372036854775807. */ #define LARGE_OFF_T (((off_t) 1 << 62) - 1 + ((off_t) 1 << 62)) int off_t_is_large[(LARGE_OFF_T % 2147483629 == 721 && LARGE_OFF_T % 2147483647 == 1) ? 1 : -1]; int main () { ; return 0; } _ACEOF rm -f conftest.$ac_objext if { (ac_try="$ac_compile" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then ac_cv_sys_large_files=1; break else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext ac_cv_sys_large_files=unknown break done fi { echo "$as_me:$LINENO: result: $ac_cv_sys_large_files" >&5 echo "${ECHO_T}$ac_cv_sys_large_files" >&6; } case $ac_cv_sys_large_files in #( no | unknown) ;; *) cat >>confdefs.h <<_ACEOF #define _LARGE_FILES $ac_cv_sys_large_files _ACEOF ;; esac rm -f conftest* fi fi if test "$cross_compiling" = "yes" ; then { echo "$as_me:$LINENO: WARNING: cross compiling so assuming defaults for most 32 bit machines" >&5 echo "$as_me: WARNING: cross compiling so assuming defaults for most 32 bit machines" >&2;} fi { echo "$as_me:$LINENO: checking for char" >&5 echo $ECHO_N "checking for char... $ECHO_C" >&6; } if test "${ac_cv_type_char+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ $ac_includes_default typedef char ac__type_new_; int main () { if ((ac__type_new_ *) 0) return 0; if (sizeof (ac__type_new_)) return 0; ; return 0; } _ACEOF rm -f conftest.$ac_objext if { (ac_try="$ac_compile" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then ac_cv_type_char=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_cv_type_char=no fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi { echo "$as_me:$LINENO: result: $ac_cv_type_char" >&5 echo "${ECHO_T}$ac_cv_type_char" >&6; } # The cast to long int works around a bug in the HP C Compiler # version HP92453-01 B.11.11.23709.GP, which incorrectly rejects # declarations like `int a3[[(sizeof (unsigned char)) >= 0]];'. # This bug is HP SR number 8606223364. { echo "$as_me:$LINENO: checking size of char" >&5 echo $ECHO_N "checking size of char... $ECHO_C" >&6; } if test "${ac_cv_sizeof_char+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else if test "$cross_compiling" = yes; then # Depending upon the size, compute the lo and hi bounds. cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ $ac_includes_default typedef char ac__type_sizeof_; int main () { static int test_array [1 - 2 * !(((long int) (sizeof (ac__type_sizeof_))) >= 0)]; test_array [0] = 0 ; return 0; } _ACEOF rm -f conftest.$ac_objext if { (ac_try="$ac_compile" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then ac_lo=0 ac_mid=0 while :; do cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ $ac_includes_default typedef char ac__type_sizeof_; int main () { static int test_array [1 - 2 * !(((long int) (sizeof (ac__type_sizeof_))) <= $ac_mid)]; test_array [0] = 0 ; return 0; } _ACEOF rm -f conftest.$ac_objext if { (ac_try="$ac_compile" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then ac_hi=$ac_mid; break else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_lo=`expr $ac_mid + 1` if test $ac_lo -le $ac_mid; then ac_lo= ac_hi= break fi ac_mid=`expr 2 '*' $ac_mid + 1` fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext done else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ $ac_includes_default typedef char ac__type_sizeof_; int main () { static int test_array [1 - 2 * !(((long int) (sizeof (ac__type_sizeof_))) < 0)]; test_array [0] = 0 ; return 0; } _ACEOF rm -f conftest.$ac_objext if { (ac_try="$ac_compile" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then ac_hi=-1 ac_mid=-1 while :; do cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ $ac_includes_default typedef char ac__type_sizeof_; int main () { static int test_array [1 - 2 * !(((long int) (sizeof (ac__type_sizeof_))) >= $ac_mid)]; test_array [0] = 0 ; return 0; } _ACEOF rm -f conftest.$ac_objext if { (ac_try="$ac_compile" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then ac_lo=$ac_mid; break else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_hi=`expr '(' $ac_mid ')' - 1` if test $ac_mid -le $ac_hi; then ac_lo= ac_hi= break fi ac_mid=`expr 2 '*' $ac_mid` fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext done else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_lo= ac_hi= fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext # Binary search between lo and hi bounds. while test "x$ac_lo" != "x$ac_hi"; do ac_mid=`expr '(' $ac_hi - $ac_lo ')' / 2 + $ac_lo` cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ $ac_includes_default typedef char ac__type_sizeof_; int main () { static int test_array [1 - 2 * !(((long int) (sizeof (ac__type_sizeof_))) <= $ac_mid)]; test_array [0] = 0 ; return 0; } _ACEOF rm -f conftest.$ac_objext if { (ac_try="$ac_compile" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then ac_hi=$ac_mid else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_lo=`expr '(' $ac_mid ')' + 1` fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext done case $ac_lo in ?*) ac_cv_sizeof_char=$ac_lo;; '') if test "$ac_cv_type_char" = yes; then { { echo "$as_me:$LINENO: error: cannot compute sizeof (char) See \`config.log' for more details." >&5 echo "$as_me: error: cannot compute sizeof (char) See \`config.log' for more details." >&2;} { (exit 77); exit 77; }; } else ac_cv_sizeof_char=0 fi ;; esac else cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ $ac_includes_default typedef char ac__type_sizeof_; static long int longval () { return (long int) (sizeof (ac__type_sizeof_)); } static unsigned long int ulongval () { return (long int) (sizeof (ac__type_sizeof_)); } #include #include int main () { FILE *f = fopen ("conftest.val", "w"); if (! f) return 1; if (((long int) (sizeof (ac__type_sizeof_))) < 0) { long int i = longval (); if (i != ((long int) (sizeof (ac__type_sizeof_)))) return 1; fprintf (f, "%ld\n", i); } else { unsigned long int i = ulongval (); if (i != ((long int) (sizeof (ac__type_sizeof_)))) return 1; fprintf (f, "%lu\n", i); } return ferror (f) || fclose (f) != 0; ; return 0; } _ACEOF rm -f conftest$ac_exeext if { (ac_try="$ac_link" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_link") 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='./conftest$ac_exeext' { (case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_try") 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then ac_cv_sizeof_char=`cat conftest.val` else echo "$as_me: program exited with status $ac_status" >&5 echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ( exit $ac_status ) if test "$ac_cv_type_char" = yes; then { { echo "$as_me:$LINENO: error: cannot compute sizeof (char) See \`config.log' for more details." >&5 echo "$as_me: error: cannot compute sizeof (char) See \`config.log' for more details." >&2;} { (exit 77); exit 77; }; } else ac_cv_sizeof_char=0 fi fi rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext fi rm -f conftest.val fi { echo "$as_me:$LINENO: result: $ac_cv_sizeof_char" >&5 echo "${ECHO_T}$ac_cv_sizeof_char" >&6; } cat >>confdefs.h <<_ACEOF #define SIZEOF_CHAR $ac_cv_sizeof_char _ACEOF { echo "$as_me:$LINENO: checking for short" >&5 echo $ECHO_N "checking for short... $ECHO_C" >&6; } if test "${ac_cv_type_short+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ $ac_includes_default typedef short ac__type_new_; int main () { if ((ac__type_new_ *) 0) return 0; if (sizeof (ac__type_new_)) return 0; ; return 0; } _ACEOF rm -f conftest.$ac_objext if { (ac_try="$ac_compile" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then ac_cv_type_short=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_cv_type_short=no fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi { echo "$as_me:$LINENO: result: $ac_cv_type_short" >&5 echo "${ECHO_T}$ac_cv_type_short" >&6; } # The cast to long int works around a bug in the HP C Compiler # version HP92453-01 B.11.11.23709.GP, which incorrectly rejects # declarations like `int a3[[(sizeof (unsigned char)) >= 0]];'. # This bug is HP SR number 8606223364. { echo "$as_me:$LINENO: checking size of short" >&5 echo $ECHO_N "checking size of short... $ECHO_C" >&6; } if test "${ac_cv_sizeof_short+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else if test "$cross_compiling" = yes; then # Depending upon the size, compute the lo and hi bounds. cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ $ac_includes_default typedef short ac__type_sizeof_; int main () { static int test_array [1 - 2 * !(((long int) (sizeof (ac__type_sizeof_))) >= 0)]; test_array [0] = 0 ; return 0; } _ACEOF rm -f conftest.$ac_objext if { (ac_try="$ac_compile" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then ac_lo=0 ac_mid=0 while :; do cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ $ac_includes_default typedef short ac__type_sizeof_; int main () { static int test_array [1 - 2 * !(((long int) (sizeof (ac__type_sizeof_))) <= $ac_mid)]; test_array [0] = 0 ; return 0; } _ACEOF rm -f conftest.$ac_objext if { (ac_try="$ac_compile" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then ac_hi=$ac_mid; break else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_lo=`expr $ac_mid + 1` if test $ac_lo -le $ac_mid; then ac_lo= ac_hi= break fi ac_mid=`expr 2 '*' $ac_mid + 1` fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext done else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ $ac_includes_default typedef short ac__type_sizeof_; int main () { static int test_array [1 - 2 * !(((long int) (sizeof (ac__type_sizeof_))) < 0)]; test_array [0] = 0 ; return 0; } _ACEOF rm -f conftest.$ac_objext if { (ac_try="$ac_compile" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then ac_hi=-1 ac_mid=-1 while :; do cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ $ac_includes_default typedef short ac__type_sizeof_; int main () { static int test_array [1 - 2 * !(((long int) (sizeof (ac__type_sizeof_))) >= $ac_mid)]; test_array [0] = 0 ; return 0; } _ACEOF rm -f conftest.$ac_objext if { (ac_try="$ac_compile" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then ac_lo=$ac_mid; break else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_hi=`expr '(' $ac_mid ')' - 1` if test $ac_mid -le $ac_hi; then ac_lo= ac_hi= break fi ac_mid=`expr 2 '*' $ac_mid` fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext done else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_lo= ac_hi= fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext # Binary search between lo and hi bounds. while test "x$ac_lo" != "x$ac_hi"; do ac_mid=`expr '(' $ac_hi - $ac_lo ')' / 2 + $ac_lo` cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ $ac_includes_default typedef short ac__type_sizeof_; int main () { static int test_array [1 - 2 * !(((long int) (sizeof (ac__type_sizeof_))) <= $ac_mid)]; test_array [0] = 0 ; return 0; } _ACEOF rm -f conftest.$ac_objext if { (ac_try="$ac_compile" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then ac_hi=$ac_mid else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_lo=`expr '(' $ac_mid ')' + 1` fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext done case $ac_lo in ?*) ac_cv_sizeof_short=$ac_lo;; '') if test "$ac_cv_type_short" = yes; then { { echo "$as_me:$LINENO: error: cannot compute sizeof (short) See \`config.log' for more details." >&5 echo "$as_me: error: cannot compute sizeof (short) See \`config.log' for more details." >&2;} { (exit 77); exit 77; }; } else ac_cv_sizeof_short=0 fi ;; esac else cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ $ac_includes_default typedef short ac__type_sizeof_; static long int longval () { return (long int) (sizeof (ac__type_sizeof_)); } static unsigned long int ulongval () { return (long int) (sizeof (ac__type_sizeof_)); } #include #include int main () { FILE *f = fopen ("conftest.val", "w"); if (! f) return 1; if (((long int) (sizeof (ac__type_sizeof_))) < 0) { long int i = longval (); if (i != ((long int) (sizeof (ac__type_sizeof_)))) return 1; fprintf (f, "%ld\n", i); } else { unsigned long int i = ulongval (); if (i != ((long int) (sizeof (ac__type_sizeof_)))) return 1; fprintf (f, "%lu\n", i); } return ferror (f) || fclose (f) != 0; ; return 0; } _ACEOF rm -f conftest$ac_exeext if { (ac_try="$ac_link" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_link") 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='./conftest$ac_exeext' { (case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_try") 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then ac_cv_sizeof_short=`cat conftest.val` else echo "$as_me: program exited with status $ac_status" >&5 echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ( exit $ac_status ) if test "$ac_cv_type_short" = yes; then { { echo "$as_me:$LINENO: error: cannot compute sizeof (short) See \`config.log' for more details." >&5 echo "$as_me: error: cannot compute sizeof (short) See \`config.log' for more details." >&2;} { (exit 77); exit 77; }; } else ac_cv_sizeof_short=0 fi fi rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext fi rm -f conftest.val fi { echo "$as_me:$LINENO: result: $ac_cv_sizeof_short" >&5 echo "${ECHO_T}$ac_cv_sizeof_short" >&6; } cat >>confdefs.h <<_ACEOF #define SIZEOF_SHORT $ac_cv_sizeof_short _ACEOF { echo "$as_me:$LINENO: checking for int" >&5 echo $ECHO_N "checking for int... $ECHO_C" >&6; } if test "${ac_cv_type_int+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ $ac_includes_default typedef int ac__type_new_; int main () { if ((ac__type_new_ *) 0) return 0; if (sizeof (ac__type_new_)) return 0; ; return 0; } _ACEOF rm -f conftest.$ac_objext if { (ac_try="$ac_compile" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then ac_cv_type_int=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_cv_type_int=no fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi { echo "$as_me:$LINENO: result: $ac_cv_type_int" >&5 echo "${ECHO_T}$ac_cv_type_int" >&6; } # The cast to long int works around a bug in the HP C Compiler # version HP92453-01 B.11.11.23709.GP, which incorrectly rejects # declarations like `int a3[[(sizeof (unsigned char)) >= 0]];'. # This bug is HP SR number 8606223364. { echo "$as_me:$LINENO: checking size of int" >&5 echo $ECHO_N "checking size of int... $ECHO_C" >&6; } if test "${ac_cv_sizeof_int+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else if test "$cross_compiling" = yes; then # Depending upon the size, compute the lo and hi bounds. cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ $ac_includes_default typedef int ac__type_sizeof_; int main () { static int test_array [1 - 2 * !(((long int) (sizeof (ac__type_sizeof_))) >= 0)]; test_array [0] = 0 ; return 0; } _ACEOF rm -f conftest.$ac_objext if { (ac_try="$ac_compile" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then ac_lo=0 ac_mid=0 while :; do cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ $ac_includes_default typedef int ac__type_sizeof_; int main () { static int test_array [1 - 2 * !(((long int) (sizeof (ac__type_sizeof_))) <= $ac_mid)]; test_array [0] = 0 ; return 0; } _ACEOF rm -f conftest.$ac_objext if { (ac_try="$ac_compile" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then ac_hi=$ac_mid; break else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_lo=`expr $ac_mid + 1` if test $ac_lo -le $ac_mid; then ac_lo= ac_hi= break fi ac_mid=`expr 2 '*' $ac_mid + 1` fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext done else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ $ac_includes_default typedef int ac__type_sizeof_; int main () { static int test_array [1 - 2 * !(((long int) (sizeof (ac__type_sizeof_))) < 0)]; test_array [0] = 0 ; return 0; } _ACEOF rm -f conftest.$ac_objext if { (ac_try="$ac_compile" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then ac_hi=-1 ac_mid=-1 while :; do cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ $ac_includes_default typedef int ac__type_sizeof_; int main () { static int test_array [1 - 2 * !(((long int) (sizeof (ac__type_sizeof_))) >= $ac_mid)]; test_array [0] = 0 ; return 0; } _ACEOF rm -f conftest.$ac_objext if { (ac_try="$ac_compile" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then ac_lo=$ac_mid; break else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_hi=`expr '(' $ac_mid ')' - 1` if test $ac_mid -le $ac_hi; then ac_lo= ac_hi= break fi ac_mid=`expr 2 '*' $ac_mid` fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext done else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_lo= ac_hi= fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext # Binary search between lo and hi bounds. while test "x$ac_lo" != "x$ac_hi"; do ac_mid=`expr '(' $ac_hi - $ac_lo ')' / 2 + $ac_lo` cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ $ac_includes_default typedef int ac__type_sizeof_; int main () { static int test_array [1 - 2 * !(((long int) (sizeof (ac__type_sizeof_))) <= $ac_mid)]; test_array [0] = 0 ; return 0; } _ACEOF rm -f conftest.$ac_objext if { (ac_try="$ac_compile" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then ac_hi=$ac_mid else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_lo=`expr '(' $ac_mid ')' + 1` fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext done case $ac_lo in ?*) ac_cv_sizeof_int=$ac_lo;; '') if test "$ac_cv_type_int" = yes; then { { echo "$as_me:$LINENO: error: cannot compute sizeof (int) See \`config.log' for more details." >&5 echo "$as_me: error: cannot compute sizeof (int) See \`config.log' for more details." >&2;} { (exit 77); exit 77; }; } else ac_cv_sizeof_int=0 fi ;; esac else cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ $ac_includes_default typedef int ac__type_sizeof_; static long int longval () { return (long int) (sizeof (ac__type_sizeof_)); } static unsigned long int ulongval () { return (long int) (sizeof (ac__type_sizeof_)); } #include #include int main () { FILE *f = fopen ("conftest.val", "w"); if (! f) return 1; if (((long int) (sizeof (ac__type_sizeof_))) < 0) { long int i = longval (); if (i != ((long int) (sizeof (ac__type_sizeof_)))) return 1; fprintf (f, "%ld\n", i); } else { unsigned long int i = ulongval (); if (i != ((long int) (sizeof (ac__type_sizeof_)))) return 1; fprintf (f, "%lu\n", i); } return ferror (f) || fclose (f) != 0; ; return 0; } _ACEOF rm -f conftest$ac_exeext if { (ac_try="$ac_link" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_link") 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='./conftest$ac_exeext' { (case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_try") 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then ac_cv_sizeof_int=`cat conftest.val` else echo "$as_me: program exited with status $ac_status" >&5 echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ( exit $ac_status ) if test "$ac_cv_type_int" = yes; then { { echo "$as_me:$LINENO: error: cannot compute sizeof (int) See \`config.log' for more details." >&5 echo "$as_me: error: cannot compute sizeof (int) See \`config.log' for more details." >&2;} { (exit 77); exit 77; }; } else ac_cv_sizeof_int=0 fi fi rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext fi rm -f conftest.val fi { echo "$as_me:$LINENO: result: $ac_cv_sizeof_int" >&5 echo "${ECHO_T}$ac_cv_sizeof_int" >&6; } cat >>confdefs.h <<_ACEOF #define SIZEOF_INT $ac_cv_sizeof_int _ACEOF { echo "$as_me:$LINENO: checking for long" >&5 echo $ECHO_N "checking for long... $ECHO_C" >&6; } if test "${ac_cv_type_long+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ $ac_includes_default typedef long ac__type_new_; int main () { if ((ac__type_new_ *) 0) return 0; if (sizeof (ac__type_new_)) return 0; ; return 0; } _ACEOF rm -f conftest.$ac_objext if { (ac_try="$ac_compile" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then ac_cv_type_long=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_cv_type_long=no fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi { echo "$as_me:$LINENO: result: $ac_cv_type_long" >&5 echo "${ECHO_T}$ac_cv_type_long" >&6; } # The cast to long int works around a bug in the HP C Compiler # version HP92453-01 B.11.11.23709.GP, which incorrectly rejects # declarations like `int a3[[(sizeof (unsigned char)) >= 0]];'. # This bug is HP SR number 8606223364. { echo "$as_me:$LINENO: checking size of long" >&5 echo $ECHO_N "checking size of long... $ECHO_C" >&6; } if test "${ac_cv_sizeof_long+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else if test "$cross_compiling" = yes; then # Depending upon the size, compute the lo and hi bounds. cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ $ac_includes_default typedef long ac__type_sizeof_; int main () { static int test_array [1 - 2 * !(((long int) (sizeof (ac__type_sizeof_))) >= 0)]; test_array [0] = 0 ; return 0; } _ACEOF rm -f conftest.$ac_objext if { (ac_try="$ac_compile" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then ac_lo=0 ac_mid=0 while :; do cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ $ac_includes_default typedef long ac__type_sizeof_; int main () { static int test_array [1 - 2 * !(((long int) (sizeof (ac__type_sizeof_))) <= $ac_mid)]; test_array [0] = 0 ; return 0; } _ACEOF rm -f conftest.$ac_objext if { (ac_try="$ac_compile" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then ac_hi=$ac_mid; break else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_lo=`expr $ac_mid + 1` if test $ac_lo -le $ac_mid; then ac_lo= ac_hi= break fi ac_mid=`expr 2 '*' $ac_mid + 1` fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext done else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ $ac_includes_default typedef long ac__type_sizeof_; int main () { static int test_array [1 - 2 * !(((long int) (sizeof (ac__type_sizeof_))) < 0)]; test_array [0] = 0 ; return 0; } _ACEOF rm -f conftest.$ac_objext if { (ac_try="$ac_compile" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then ac_hi=-1 ac_mid=-1 while :; do cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ $ac_includes_default typedef long ac__type_sizeof_; int main () { static int test_array [1 - 2 * !(((long int) (sizeof (ac__type_sizeof_))) >= $ac_mid)]; test_array [0] = 0 ; return 0; } _ACEOF rm -f conftest.$ac_objext if { (ac_try="$ac_compile" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then ac_lo=$ac_mid; break else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_hi=`expr '(' $ac_mid ')' - 1` if test $ac_mid -le $ac_hi; then ac_lo= ac_hi= break fi ac_mid=`expr 2 '*' $ac_mid` fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext done else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_lo= ac_hi= fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext # Binary search between lo and hi bounds. while test "x$ac_lo" != "x$ac_hi"; do ac_mid=`expr '(' $ac_hi - $ac_lo ')' / 2 + $ac_lo` cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ $ac_includes_default typedef long ac__type_sizeof_; int main () { static int test_array [1 - 2 * !(((long int) (sizeof (ac__type_sizeof_))) <= $ac_mid)]; test_array [0] = 0 ; return 0; } _ACEOF rm -f conftest.$ac_objext if { (ac_try="$ac_compile" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then ac_hi=$ac_mid else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_lo=`expr '(' $ac_mid ')' + 1` fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext done case $ac_lo in ?*) ac_cv_sizeof_long=$ac_lo;; '') if test "$ac_cv_type_long" = yes; then { { echo "$as_me:$LINENO: error: cannot compute sizeof (long) See \`config.log' for more details." >&5 echo "$as_me: error: cannot compute sizeof (long) See \`config.log' for more details." >&2;} { (exit 77); exit 77; }; } else ac_cv_sizeof_long=0 fi ;; esac else cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ $ac_includes_default typedef long ac__type_sizeof_; static long int longval () { return (long int) (sizeof (ac__type_sizeof_)); } static unsigned long int ulongval () { return (long int) (sizeof (ac__type_sizeof_)); } #include #include int main () { FILE *f = fopen ("conftest.val", "w"); if (! f) return 1; if (((long int) (sizeof (ac__type_sizeof_))) < 0) { long int i = longval (); if (i != ((long int) (sizeof (ac__type_sizeof_)))) return 1; fprintf (f, "%ld\n", i); } else { unsigned long int i = ulongval (); if (i != ((long int) (sizeof (ac__type_sizeof_)))) return 1; fprintf (f, "%lu\n", i); } return ferror (f) || fclose (f) != 0; ; return 0; } _ACEOF rm -f conftest$ac_exeext if { (ac_try="$ac_link" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_link") 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='./conftest$ac_exeext' { (case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_try") 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then ac_cv_sizeof_long=`cat conftest.val` else echo "$as_me: program exited with status $ac_status" >&5 echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ( exit $ac_status ) if test "$ac_cv_type_long" = yes; then { { echo "$as_me:$LINENO: error: cannot compute sizeof (long) See \`config.log' for more details." >&5 echo "$as_me: error: cannot compute sizeof (long) See \`config.log' for more details." >&2;} { (exit 77); exit 77; }; } else ac_cv_sizeof_long=0 fi fi rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext fi rm -f conftest.val fi { echo "$as_me:$LINENO: result: $ac_cv_sizeof_long" >&5 echo "${ECHO_T}$ac_cv_sizeof_long" >&6; } cat >>confdefs.h <<_ACEOF #define SIZEOF_LONG $ac_cv_sizeof_long _ACEOF { echo "$as_me:$LINENO: checking for void *" >&5 echo $ECHO_N "checking for void *... $ECHO_C" >&6; } if test "${ac_cv_type_void_p+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ $ac_includes_default typedef void * ac__type_new_; int main () { if ((ac__type_new_ *) 0) return 0; if (sizeof (ac__type_new_)) return 0; ; return 0; } _ACEOF rm -f conftest.$ac_objext if { (ac_try="$ac_compile" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then ac_cv_type_void_p=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_cv_type_void_p=no fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi { echo "$as_me:$LINENO: result: $ac_cv_type_void_p" >&5 echo "${ECHO_T}$ac_cv_type_void_p" >&6; } # The cast to long int works around a bug in the HP C Compiler # version HP92453-01 B.11.11.23709.GP, which incorrectly rejects # declarations like `int a3[[(sizeof (unsigned char)) >= 0]];'. # This bug is HP SR number 8606223364. { echo "$as_me:$LINENO: checking size of void *" >&5 echo $ECHO_N "checking size of void *... $ECHO_C" >&6; } if test "${ac_cv_sizeof_void_p+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else if test "$cross_compiling" = yes; then # Depending upon the size, compute the lo and hi bounds. cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ $ac_includes_default typedef void * ac__type_sizeof_; int main () { static int test_array [1 - 2 * !(((long int) (sizeof (ac__type_sizeof_))) >= 0)]; test_array [0] = 0 ; return 0; } _ACEOF rm -f conftest.$ac_objext if { (ac_try="$ac_compile" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then ac_lo=0 ac_mid=0 while :; do cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ $ac_includes_default typedef void * ac__type_sizeof_; int main () { static int test_array [1 - 2 * !(((long int) (sizeof (ac__type_sizeof_))) <= $ac_mid)]; test_array [0] = 0 ; return 0; } _ACEOF rm -f conftest.$ac_objext if { (ac_try="$ac_compile" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then ac_hi=$ac_mid; break else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_lo=`expr $ac_mid + 1` if test $ac_lo -le $ac_mid; then ac_lo= ac_hi= break fi ac_mid=`expr 2 '*' $ac_mid + 1` fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext done else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ $ac_includes_default typedef void * ac__type_sizeof_; int main () { static int test_array [1 - 2 * !(((long int) (sizeof (ac__type_sizeof_))) < 0)]; test_array [0] = 0 ; return 0; } _ACEOF rm -f conftest.$ac_objext if { (ac_try="$ac_compile" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then ac_hi=-1 ac_mid=-1 while :; do cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ $ac_includes_default typedef void * ac__type_sizeof_; int main () { static int test_array [1 - 2 * !(((long int) (sizeof (ac__type_sizeof_))) >= $ac_mid)]; test_array [0] = 0 ; return 0; } _ACEOF rm -f conftest.$ac_objext if { (ac_try="$ac_compile" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then ac_lo=$ac_mid; break else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_hi=`expr '(' $ac_mid ')' - 1` if test $ac_mid -le $ac_hi; then ac_lo= ac_hi= break fi ac_mid=`expr 2 '*' $ac_mid` fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext done else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_lo= ac_hi= fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext # Binary search between lo and hi bounds. while test "x$ac_lo" != "x$ac_hi"; do ac_mid=`expr '(' $ac_hi - $ac_lo ')' / 2 + $ac_lo` cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ $ac_includes_default typedef void * ac__type_sizeof_; int main () { static int test_array [1 - 2 * !(((long int) (sizeof (ac__type_sizeof_))) <= $ac_mid)]; test_array [0] = 0 ; return 0; } _ACEOF rm -f conftest.$ac_objext if { (ac_try="$ac_compile" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then ac_hi=$ac_mid else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_lo=`expr '(' $ac_mid ')' + 1` fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext done case $ac_lo in ?*) ac_cv_sizeof_void_p=$ac_lo;; '') if test "$ac_cv_type_void_p" = yes; then { { echo "$as_me:$LINENO: error: cannot compute sizeof (void *) See \`config.log' for more details." >&5 echo "$as_me: error: cannot compute sizeof (void *) See \`config.log' for more details." >&2;} { (exit 77); exit 77; }; } else ac_cv_sizeof_void_p=0 fi ;; esac else cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ $ac_includes_default typedef void * ac__type_sizeof_; static long int longval () { return (long int) (sizeof (ac__type_sizeof_)); } static unsigned long int ulongval () { return (long int) (sizeof (ac__type_sizeof_)); } #include #include int main () { FILE *f = fopen ("conftest.val", "w"); if (! f) return 1; if (((long int) (sizeof (ac__type_sizeof_))) < 0) { long int i = longval (); if (i != ((long int) (sizeof (ac__type_sizeof_)))) return 1; fprintf (f, "%ld\n", i); } else { unsigned long int i = ulongval (); if (i != ((long int) (sizeof (ac__type_sizeof_)))) return 1; fprintf (f, "%lu\n", i); } return ferror (f) || fclose (f) != 0; ; return 0; } _ACEOF rm -f conftest$ac_exeext if { (ac_try="$ac_link" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_link") 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='./conftest$ac_exeext' { (case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_try") 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then ac_cv_sizeof_void_p=`cat conftest.val` else echo "$as_me: program exited with status $ac_status" >&5 echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ( exit $ac_status ) if test "$ac_cv_type_void_p" = yes; then { { echo "$as_me:$LINENO: error: cannot compute sizeof (void *) See \`config.log' for more details." >&5 echo "$as_me: error: cannot compute sizeof (void *) See \`config.log' for more details." >&2;} { (exit 77); exit 77; }; } else ac_cv_sizeof_void_p=0 fi fi rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext fi rm -f conftest.val fi { echo "$as_me:$LINENO: result: $ac_cv_sizeof_void_p" >&5 echo "${ECHO_T}$ac_cv_sizeof_void_p" >&6; } cat >>confdefs.h <<_ACEOF #define SIZEOF_VOID_P $ac_cv_sizeof_void_p _ACEOF { echo "$as_me:$LINENO: checking for long long" >&5 echo $ECHO_N "checking for long long... $ECHO_C" >&6; } if test "${ac_cv_type_long_long+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ $ac_includes_default typedef long long ac__type_new_; int main () { if ((ac__type_new_ *) 0) return 0; if (sizeof (ac__type_new_)) return 0; ; return 0; } _ACEOF rm -f conftest.$ac_objext if { (ac_try="$ac_compile" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then ac_cv_type_long_long=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_cv_type_long_long=no fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi { echo "$as_me:$LINENO: result: $ac_cv_type_long_long" >&5 echo "${ECHO_T}$ac_cv_type_long_long" >&6; } # The cast to long int works around a bug in the HP C Compiler # version HP92453-01 B.11.11.23709.GP, which incorrectly rejects # declarations like `int a3[[(sizeof (unsigned char)) >= 0]];'. # This bug is HP SR number 8606223364. { echo "$as_me:$LINENO: checking size of long long" >&5 echo $ECHO_N "checking size of long long... $ECHO_C" >&6; } if test "${ac_cv_sizeof_long_long+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else if test "$cross_compiling" = yes; then # Depending upon the size, compute the lo and hi bounds. cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ $ac_includes_default typedef long long ac__type_sizeof_; int main () { static int test_array [1 - 2 * !(((long int) (sizeof (ac__type_sizeof_))) >= 0)]; test_array [0] = 0 ; return 0; } _ACEOF rm -f conftest.$ac_objext if { (ac_try="$ac_compile" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then ac_lo=0 ac_mid=0 while :; do cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ $ac_includes_default typedef long long ac__type_sizeof_; int main () { static int test_array [1 - 2 * !(((long int) (sizeof (ac__type_sizeof_))) <= $ac_mid)]; test_array [0] = 0 ; return 0; } _ACEOF rm -f conftest.$ac_objext if { (ac_try="$ac_compile" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then ac_hi=$ac_mid; break else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_lo=`expr $ac_mid + 1` if test $ac_lo -le $ac_mid; then ac_lo= ac_hi= break fi ac_mid=`expr 2 '*' $ac_mid + 1` fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext done else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ $ac_includes_default typedef long long ac__type_sizeof_; int main () { static int test_array [1 - 2 * !(((long int) (sizeof (ac__type_sizeof_))) < 0)]; test_array [0] = 0 ; return 0; } _ACEOF rm -f conftest.$ac_objext if { (ac_try="$ac_compile" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then ac_hi=-1 ac_mid=-1 while :; do cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ $ac_includes_default typedef long long ac__type_sizeof_; int main () { static int test_array [1 - 2 * !(((long int) (sizeof (ac__type_sizeof_))) >= $ac_mid)]; test_array [0] = 0 ; return 0; } _ACEOF rm -f conftest.$ac_objext if { (ac_try="$ac_compile" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then ac_lo=$ac_mid; break else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_hi=`expr '(' $ac_mid ')' - 1` if test $ac_mid -le $ac_hi; then ac_lo= ac_hi= break fi ac_mid=`expr 2 '*' $ac_mid` fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext done else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_lo= ac_hi= fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext # Binary search between lo and hi bounds. while test "x$ac_lo" != "x$ac_hi"; do ac_mid=`expr '(' $ac_hi - $ac_lo ')' / 2 + $ac_lo` cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ $ac_includes_default typedef long long ac__type_sizeof_; int main () { static int test_array [1 - 2 * !(((long int) (sizeof (ac__type_sizeof_))) <= $ac_mid)]; test_array [0] = 0 ; return 0; } _ACEOF rm -f conftest.$ac_objext if { (ac_try="$ac_compile" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then ac_hi=$ac_mid else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_lo=`expr '(' $ac_mid ')' + 1` fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext done case $ac_lo in ?*) ac_cv_sizeof_long_long=$ac_lo;; '') if test "$ac_cv_type_long_long" = yes; then { { echo "$as_me:$LINENO: error: cannot compute sizeof (long long) See \`config.log' for more details." >&5 echo "$as_me: error: cannot compute sizeof (long long) See \`config.log' for more details." >&2;} { (exit 77); exit 77; }; } else ac_cv_sizeof_long_long=0 fi ;; esac else cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ $ac_includes_default typedef long long ac__type_sizeof_; static long int longval () { return (long int) (sizeof (ac__type_sizeof_)); } static unsigned long int ulongval () { return (long int) (sizeof (ac__type_sizeof_)); } #include #include int main () { FILE *f = fopen ("conftest.val", "w"); if (! f) return 1; if (((long int) (sizeof (ac__type_sizeof_))) < 0) { long int i = longval (); if (i != ((long int) (sizeof (ac__type_sizeof_)))) return 1; fprintf (f, "%ld\n", i); } else { unsigned long int i = ulongval (); if (i != ((long int) (sizeof (ac__type_sizeof_)))) return 1; fprintf (f, "%lu\n", i); } return ferror (f) || fclose (f) != 0; ; return 0; } _ACEOF rm -f conftest$ac_exeext if { (ac_try="$ac_link" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_link") 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='./conftest$ac_exeext' { (case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_try") 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then ac_cv_sizeof_long_long=`cat conftest.val` else echo "$as_me: program exited with status $ac_status" >&5 echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ( exit $ac_status ) if test "$ac_cv_type_long_long" = yes; then { { echo "$as_me:$LINENO: error: cannot compute sizeof (long long) See \`config.log' for more details." >&5 echo "$as_me: error: cannot compute sizeof (long long) See \`config.log' for more details." >&2;} { (exit 77); exit 77; }; } else ac_cv_sizeof_long_long=0 fi fi rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext fi rm -f conftest.val fi { echo "$as_me:$LINENO: result: $ac_cv_sizeof_long_long" >&5 echo "${ECHO_T}$ac_cv_sizeof_long_long" >&6; } cat >>confdefs.h <<_ACEOF #define SIZEOF_LONG_LONG $ac_cv_sizeof_long_long _ACEOF { echo "$as_me:$LINENO: checking for off_t" >&5 echo $ECHO_N "checking for off_t... $ECHO_C" >&6; } if test "${ac_cv_type_off_t+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ $ac_includes_default typedef off_t ac__type_new_; int main () { if ((ac__type_new_ *) 0) return 0; if (sizeof (ac__type_new_)) return 0; ; return 0; } _ACEOF rm -f conftest.$ac_objext if { (ac_try="$ac_compile" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then ac_cv_type_off_t=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_cv_type_off_t=no fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi { echo "$as_me:$LINENO: result: $ac_cv_type_off_t" >&5 echo "${ECHO_T}$ac_cv_type_off_t" >&6; } # The cast to long int works around a bug in the HP C Compiler # version HP92453-01 B.11.11.23709.GP, which incorrectly rejects # declarations like `int a3[[(sizeof (unsigned char)) >= 0]];'. # This bug is HP SR number 8606223364. { echo "$as_me:$LINENO: checking size of off_t" >&5 echo $ECHO_N "checking size of off_t... $ECHO_C" >&6; } if test "${ac_cv_sizeof_off_t+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else if test "$cross_compiling" = yes; then # Depending upon the size, compute the lo and hi bounds. cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ $ac_includes_default typedef off_t ac__type_sizeof_; int main () { static int test_array [1 - 2 * !(((long int) (sizeof (ac__type_sizeof_))) >= 0)]; test_array [0] = 0 ; return 0; } _ACEOF rm -f conftest.$ac_objext if { (ac_try="$ac_compile" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then ac_lo=0 ac_mid=0 while :; do cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ $ac_includes_default typedef off_t ac__type_sizeof_; int main () { static int test_array [1 - 2 * !(((long int) (sizeof (ac__type_sizeof_))) <= $ac_mid)]; test_array [0] = 0 ; return 0; } _ACEOF rm -f conftest.$ac_objext if { (ac_try="$ac_compile" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then ac_hi=$ac_mid; break else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_lo=`expr $ac_mid + 1` if test $ac_lo -le $ac_mid; then ac_lo= ac_hi= break fi ac_mid=`expr 2 '*' $ac_mid + 1` fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext done else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ $ac_includes_default typedef off_t ac__type_sizeof_; int main () { static int test_array [1 - 2 * !(((long int) (sizeof (ac__type_sizeof_))) < 0)]; test_array [0] = 0 ; return 0; } _ACEOF rm -f conftest.$ac_objext if { (ac_try="$ac_compile" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then ac_hi=-1 ac_mid=-1 while :; do cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ $ac_includes_default typedef off_t ac__type_sizeof_; int main () { static int test_array [1 - 2 * !(((long int) (sizeof (ac__type_sizeof_))) >= $ac_mid)]; test_array [0] = 0 ; return 0; } _ACEOF rm -f conftest.$ac_objext if { (ac_try="$ac_compile" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then ac_lo=$ac_mid; break else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_hi=`expr '(' $ac_mid ')' - 1` if test $ac_mid -le $ac_hi; then ac_lo= ac_hi= break fi ac_mid=`expr 2 '*' $ac_mid` fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext done else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_lo= ac_hi= fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext # Binary search between lo and hi bounds. while test "x$ac_lo" != "x$ac_hi"; do ac_mid=`expr '(' $ac_hi - $ac_lo ')' / 2 + $ac_lo` cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ $ac_includes_default typedef off_t ac__type_sizeof_; int main () { static int test_array [1 - 2 * !(((long int) (sizeof (ac__type_sizeof_))) <= $ac_mid)]; test_array [0] = 0 ; return 0; } _ACEOF rm -f conftest.$ac_objext if { (ac_try="$ac_compile" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then ac_hi=$ac_mid else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_lo=`expr '(' $ac_mid ')' + 1` fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext done case $ac_lo in ?*) ac_cv_sizeof_off_t=$ac_lo;; '') if test "$ac_cv_type_off_t" = yes; then { { echo "$as_me:$LINENO: error: cannot compute sizeof (off_t) See \`config.log' for more details." >&5 echo "$as_me: error: cannot compute sizeof (off_t) See \`config.log' for more details." >&2;} { (exit 77); exit 77; }; } else ac_cv_sizeof_off_t=0 fi ;; esac else cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ $ac_includes_default typedef off_t ac__type_sizeof_; static long int longval () { return (long int) (sizeof (ac__type_sizeof_)); } static unsigned long int ulongval () { return (long int) (sizeof (ac__type_sizeof_)); } #include #include int main () { FILE *f = fopen ("conftest.val", "w"); if (! f) return 1; if (((long int) (sizeof (ac__type_sizeof_))) < 0) { long int i = longval (); if (i != ((long int) (sizeof (ac__type_sizeof_)))) return 1; fprintf (f, "%ld\n", i); } else { unsigned long int i = ulongval (); if (i != ((long int) (sizeof (ac__type_sizeof_)))) return 1; fprintf (f, "%lu\n", i); } return ferror (f) || fclose (f) != 0; ; return 0; } _ACEOF rm -f conftest$ac_exeext if { (ac_try="$ac_link" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_link") 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='./conftest$ac_exeext' { (case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_try") 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then ac_cv_sizeof_off_t=`cat conftest.val` else echo "$as_me: program exited with status $ac_status" >&5 echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ( exit $ac_status ) if test "$ac_cv_type_off_t" = yes; then { { echo "$as_me:$LINENO: error: cannot compute sizeof (off_t) See \`config.log' for more details." >&5 echo "$as_me: error: cannot compute sizeof (off_t) See \`config.log' for more details." >&2;} { (exit 77); exit 77; }; } else ac_cv_sizeof_off_t=0 fi fi rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext fi rm -f conftest.val fi { echo "$as_me:$LINENO: result: $ac_cv_sizeof_off_t" >&5 echo "${ECHO_T}$ac_cv_sizeof_off_t" >&6; } cat >>confdefs.h <<_ACEOF #define SIZEOF_OFF_T $ac_cv_sizeof_off_t _ACEOF { echo "$as_me:$LINENO: checking for sighandler_t" >&5 echo $ECHO_N "checking for sighandler_t... $ECHO_C" >&6; } if test "${ac_cv_type_sighandler_t+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ /* if you have signal.h header, include it */ #ifdef HAVE_SIGNAL_H #include #endif typedef sighandler_t ac__type_new_; int main () { if ((ac__type_new_ *) 0) return 0; if (sizeof (ac__type_new_)) return 0; ; return 0; } _ACEOF rm -f conftest.$ac_objext if { (ac_try="$ac_compile" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then ac_cv_type_sighandler_t=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_cv_type_sighandler_t=no fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi { echo "$as_me:$LINENO: result: $ac_cv_type_sighandler_t" >&5 echo "${ECHO_T}$ac_cv_type_sighandler_t" >&6; } if test $ac_cv_type_sighandler_t = yes; then cat >>confdefs.h <<\_ACEOF #define HAVE_SIGHANDLER_T 1 _ACEOF fi # Checks for library functions. if test $ac_cv_c_compiler_gnu = yes; then { echo "$as_me:$LINENO: checking whether $CC needs -traditional" >&5 echo $ECHO_N "checking whether $CC needs -traditional... $ECHO_C" >&6; } if test "${ac_cv_prog_gcc_traditional+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else ac_pattern="Autoconf.*'x'" cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #include Autoconf TIOCGETP _ACEOF if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | $EGREP "$ac_pattern" >/dev/null 2>&1; then ac_cv_prog_gcc_traditional=yes else ac_cv_prog_gcc_traditional=no fi rm -f conftest* if test $ac_cv_prog_gcc_traditional = no; then cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #include Autoconf TCGETA _ACEOF if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | $EGREP "$ac_pattern" >/dev/null 2>&1; then ac_cv_prog_gcc_traditional=yes fi rm -f conftest* fi fi { echo "$as_me:$LINENO: result: $ac_cv_prog_gcc_traditional" >&5 echo "${ECHO_T}$ac_cv_prog_gcc_traditional" >&6; } if test $ac_cv_prog_gcc_traditional = yes; then CC="$CC -traditional" fi fi { echo "$as_me:$LINENO: checking for _LARGEFILE_SOURCE value needed for large files" >&5 echo $ECHO_N "checking for _LARGEFILE_SOURCE value needed for large files... $ECHO_C" >&6; } if test "${ac_cv_sys_largefile_source+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else while :; do cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #include int main () { return fseeko (stdin, 0, 0) && (fseeko) (stdin, 0, 0); ; return 0; } _ACEOF rm -f conftest.$ac_objext conftest$ac_exeext if { (ac_try="$ac_link" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_link") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest$ac_exeext && $as_test_x conftest$ac_exeext; then ac_cv_sys_largefile_source=no; break else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 fi rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ conftest$ac_exeext conftest.$ac_ext cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #define _LARGEFILE_SOURCE 1 #include int main () { return fseeko (stdin, 0, 0) && (fseeko) (stdin, 0, 0); ; return 0; } _ACEOF rm -f conftest.$ac_objext conftest$ac_exeext if { (ac_try="$ac_link" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_link") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest$ac_exeext && $as_test_x conftest$ac_exeext; then ac_cv_sys_largefile_source=1; break else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 fi rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ conftest$ac_exeext conftest.$ac_ext ac_cv_sys_largefile_source=unknown break done fi { echo "$as_me:$LINENO: result: $ac_cv_sys_largefile_source" >&5 echo "${ECHO_T}$ac_cv_sys_largefile_source" >&6; } case $ac_cv_sys_largefile_source in #( no | unknown) ;; *) cat >>confdefs.h <<_ACEOF #define _LARGEFILE_SOURCE $ac_cv_sys_largefile_source _ACEOF ;; esac rm -f conftest* # We used to try defining _XOPEN_SOURCE=500 too, to work around a bug # in glibc 2.1.3, but that breaks too many other things. # If you want fseeko and ftello with glibc, upgrade to a fixed glibc. if test $ac_cv_sys_largefile_source != unknown; then cat >>confdefs.h <<\_ACEOF #define HAVE_FSEEKO 1 _ACEOF fi { echo "$as_me:$LINENO: checking whether lstat dereferences a symlink specified with a trailing slash" >&5 echo $ECHO_N "checking whether lstat dereferences a symlink specified with a trailing slash... $ECHO_C" >&6; } if test "${ac_cv_func_lstat_dereferences_slashed_symlink+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else rm -f conftest.sym conftest.file echo >conftest.file if test "$as_ln_s" = "ln -s" && ln -s conftest.file conftest.sym; then if test "$cross_compiling" = yes; then ac_cv_func_lstat_dereferences_slashed_symlink=no else cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ $ac_includes_default int main () { struct stat sbuf; /* Linux will dereference the symlink and fail. That is better in the sense that it means we will not have to compile and use the lstat wrapper. */ return lstat ("conftest.sym/", &sbuf) == 0; ; return 0; } _ACEOF rm -f conftest$ac_exeext if { (ac_try="$ac_link" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_link") 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='./conftest$ac_exeext' { (case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_try") 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then ac_cv_func_lstat_dereferences_slashed_symlink=yes else echo "$as_me: program exited with status $ac_status" >&5 echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ( exit $ac_status ) ac_cv_func_lstat_dereferences_slashed_symlink=no fi rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext fi else # If the `ln -s' command failed, then we probably don't even # have an lstat function. ac_cv_func_lstat_dereferences_slashed_symlink=no fi rm -f conftest.sym conftest.file fi { echo "$as_me:$LINENO: result: $ac_cv_func_lstat_dereferences_slashed_symlink" >&5 echo "${ECHO_T}$ac_cv_func_lstat_dereferences_slashed_symlink" >&6; } test $ac_cv_func_lstat_dereferences_slashed_symlink = yes && cat >>confdefs.h <<_ACEOF #define LSTAT_FOLLOWS_SLASHED_SYMLINK 1 _ACEOF if test $ac_cv_func_lstat_dereferences_slashed_symlink = no; then case " $LIBOBJS " in *" lstat.$ac_objext "* ) ;; *) LIBOBJS="$LIBOBJS lstat.$ac_objext" ;; esac fi { echo "$as_me:$LINENO: checking whether lstat accepts an empty string" >&5 echo $ECHO_N "checking whether lstat accepts an empty string... $ECHO_C" >&6; } if test "${ac_cv_func_lstat_empty_string_bug+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else if test "$cross_compiling" = yes; then ac_cv_func_lstat_empty_string_bug=yes else cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ $ac_includes_default int main () { struct stat sbuf; return lstat ("", &sbuf) == 0; ; return 0; } _ACEOF rm -f conftest$ac_exeext if { (ac_try="$ac_link" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_link") 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='./conftest$ac_exeext' { (case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_try") 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then ac_cv_func_lstat_empty_string_bug=no else echo "$as_me: program exited with status $ac_status" >&5 echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ( exit $ac_status ) ac_cv_func_lstat_empty_string_bug=yes fi rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext fi fi { echo "$as_me:$LINENO: result: $ac_cv_func_lstat_empty_string_bug" >&5 echo "${ECHO_T}$ac_cv_func_lstat_empty_string_bug" >&6; } if test $ac_cv_func_lstat_empty_string_bug = yes; then case " $LIBOBJS " in *" lstat.$ac_objext "* ) ;; *) LIBOBJS="$LIBOBJS lstat.$ac_objext" ;; esac cat >>confdefs.h <<_ACEOF #define HAVE_LSTAT_EMPTY_STRING_BUG 1 _ACEOF fi { echo "$as_me:$LINENO: checking whether setpgrp() takes no arguments" >&5 echo $ECHO_N "checking whether setpgrp() takes no arguments... $ECHO_C" >&6; } if test "${joe_cv_setpgrp_void+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else if test "$cross_compiling" = yes; then joe_cv_setpgrp_void=yes else cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #if HAVE_UNISTD_H #include #endif int main() { /* exit succesfully if setpgrp() takes two args (*BSD systems) */ exit(setpgrp(0, 0) != 0); } _ACEOF rm -f conftest$ac_exeext if { (ac_try="$ac_link" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_link") 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='./conftest$ac_exeext' { (case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_try") 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then joe_cv_setpgrp_void=no else echo "$as_me: program exited with status $ac_status" >&5 echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ( exit $ac_status ) joe_cv_setpgrp_void=yes fi rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext fi fi { echo "$as_me:$LINENO: result: $joe_cv_setpgrp_void" >&5 echo "${ECHO_T}$joe_cv_setpgrp_void" >&6; } if test "$joe_cv_setpgrp_void" = yes; then cat >>confdefs.h <<\_ACEOF #define SETPGRP_VOID 1 _ACEOF fi { echo "$as_me:$LINENO: checking for pid_t" >&5 echo $ECHO_N "checking for pid_t... $ECHO_C" >&6; } if test "${ac_cv_type_pid_t+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ $ac_includes_default typedef pid_t ac__type_new_; int main () { if ((ac__type_new_ *) 0) return 0; if (sizeof (ac__type_new_)) return 0; ; return 0; } _ACEOF rm -f conftest.$ac_objext if { (ac_try="$ac_compile" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then ac_cv_type_pid_t=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_cv_type_pid_t=no fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi { echo "$as_me:$LINENO: result: $ac_cv_type_pid_t" >&5 echo "${ECHO_T}$ac_cv_type_pid_t" >&6; } if test $ac_cv_type_pid_t = yes; then : else cat >>confdefs.h <<_ACEOF #define pid_t int _ACEOF fi { echo "$as_me:$LINENO: checking for size_t" >&5 echo $ECHO_N "checking for size_t... $ECHO_C" >&6; } if test "${ac_cv_type_size_t+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ $ac_includes_default typedef size_t ac__type_new_; int main () { if ((ac__type_new_ *) 0) return 0; if (sizeof (ac__type_new_)) return 0; ; return 0; } _ACEOF rm -f conftest.$ac_objext if { (ac_try="$ac_compile" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then ac_cv_type_size_t=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_cv_type_size_t=no fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi { echo "$as_me:$LINENO: result: $ac_cv_type_size_t" >&5 echo "${ECHO_T}$ac_cv_type_size_t" >&6; } if test $ac_cv_type_size_t = yes; then : else cat >>confdefs.h <<_ACEOF #define size_t unsigned int _ACEOF fi { echo "$as_me:$LINENO: checking for ssize_t" >&5 echo $ECHO_N "checking for ssize_t... $ECHO_C" >&6; } if test "${ac_cv_type_ssize_t+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ $ac_includes_default typedef ssize_t ac__type_new_; int main () { if ((ac__type_new_ *) 0) return 0; if (sizeof (ac__type_new_)) return 0; ; return 0; } _ACEOF rm -f conftest.$ac_objext if { (ac_try="$ac_compile" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then ac_cv_type_ssize_t=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_cv_type_ssize_t=no fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi { echo "$as_me:$LINENO: result: $ac_cv_type_ssize_t" >&5 echo "${ECHO_T}$ac_cv_type_ssize_t" >&6; } if test $ac_cv_type_ssize_t = yes; then : else cat >>confdefs.h <<\_ACEOF #define ssize_t int _ACEOF fi { echo "$as_me:$LINENO: checking return type of signal handlers" >&5 echo $ECHO_N "checking return type of signal handlers... $ECHO_C" >&6; } if test "${ac_cv_type_signal+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #include #include int main () { return *(signal (0, 0)) (0) == 1; ; return 0; } _ACEOF rm -f conftest.$ac_objext if { (ac_try="$ac_compile" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then ac_cv_type_signal=int else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_cv_type_signal=void fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi { echo "$as_me:$LINENO: result: $ac_cv_type_signal" >&5 echo "${ECHO_T}$ac_cv_type_signal" >&6; } cat >>confdefs.h <<_ACEOF #define RETSIGTYPE $ac_cv_type_signal _ACEOF { echo "$as_me:$LINENO: checking whether stat accepts an empty string" >&5 echo $ECHO_N "checking whether stat accepts an empty string... $ECHO_C" >&6; } if test "${ac_cv_func_stat_empty_string_bug+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else if test "$cross_compiling" = yes; then ac_cv_func_stat_empty_string_bug=yes else cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ $ac_includes_default int main () { struct stat sbuf; return stat ("", &sbuf) == 0; ; return 0; } _ACEOF rm -f conftest$ac_exeext if { (ac_try="$ac_link" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_link") 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='./conftest$ac_exeext' { (case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_try") 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then ac_cv_func_stat_empty_string_bug=no else echo "$as_me: program exited with status $ac_status" >&5 echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ( exit $ac_status ) ac_cv_func_stat_empty_string_bug=yes fi rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext fi fi { echo "$as_me:$LINENO: result: $ac_cv_func_stat_empty_string_bug" >&5 echo "${ECHO_T}$ac_cv_func_stat_empty_string_bug" >&6; } if test $ac_cv_func_stat_empty_string_bug = yes; then case " $LIBOBJS " in *" stat.$ac_objext "* ) ;; *) LIBOBJS="$LIBOBJS stat.$ac_objext" ;; esac cat >>confdefs.h <<_ACEOF #define HAVE_STAT_EMPTY_STRING_BUG 1 _ACEOF fi for ac_func in getcwd getwd do as_ac_var=`echo "ac_cv_func_$ac_func" | $as_tr_sh` { echo "$as_me:$LINENO: checking for $ac_func" >&5 echo $ECHO_N "checking for $ac_func... $ECHO_C" >&6; } if { as_var=$as_ac_var; eval "test \"\${$as_var+set}\" = set"; }; then echo $ECHO_N "(cached) $ECHO_C" >&6 else mirsave_CPPFLAGS_set=${CPPFLAGS+ja} mirsave_CPPFLAGS=$CPPFLAGS CPPFLAGS="-D_MIRMAKE_H $CPPFLAGS" cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ /* Define $ac_func to an innocuous variant, in case declares $ac_func. For example, HP-UX 11i declares gettimeofday. */ #define $ac_func innocuous_$ac_func /* System header to define __stub macros and hopefully few prototypes, which can conflict with char $ac_func (); below. Prefer to if __STDC__ is defined, since exists even on freestanding compilers. */ #ifdef __STDC__ # include #else # include #endif #undef $ac_func /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ #ifdef __cplusplus extern "C" #endif char $ac_func (); /* The GNU C library defines this for functions which it implements to always fail with ENOSYS. Some functions are actually named something starting with __ and the normal name is an alias. */ #if defined __stub_$ac_func || defined __stub___$ac_func choke me #endif int main () { return $ac_func (); ; return 0; } _ACEOF rm -f conftest.$ac_objext conftest$ac_exeext if { (ac_try="$ac_link" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_link") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest$ac_exeext && $as_test_x conftest$ac_exeext; then eval "$as_ac_var=yes" else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 eval "$as_ac_var=no" fi rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ conftest$ac_exeext conftest.$ac_ext if test x"ja" = x"$mirsave_CPPFLAGS_set"; then CPPFLAGS=$mirsave_CPPFLAGS else unset CPPFLAGS fi unset mirsave_CPPFLAGS_set unset mirsave_CPPFLAGS fi ac_res=`eval echo '${'$as_ac_var'}'` { echo "$as_me:$LINENO: result: $ac_res" >&5 echo "${ECHO_T}$ac_res" >&6; } if test `eval echo '${'$as_ac_var'}'` = yes; then cat >>confdefs.h <<_ACEOF #define `echo "HAVE_$ac_func" | $as_tr_cpp` 1 _ACEOF fi done if test x"$ac_cv_func_getcwd" != xyes; then if test x"$ac_cv_func_getwd" != xyes; then { { echo "$as_me:$LINENO: error: don't know how to get current working directory" >&5 echo "$as_me: error: don't know how to get current working directory" >&2;} { (exit 1); exit 1; }; } fi fi for ac_func in alarm ctime fsync get_current_dir_name isatty mkdir mkstemp do as_ac_var=`echo "ac_cv_func_$ac_func" | $as_tr_sh` { echo "$as_me:$LINENO: checking for $ac_func" >&5 echo $ECHO_N "checking for $ac_func... $ECHO_C" >&6; } if { as_var=$as_ac_var; eval "test \"\${$as_var+set}\" = set"; }; then echo $ECHO_N "(cached) $ECHO_C" >&6 else mirsave_CPPFLAGS_set=${CPPFLAGS+ja} mirsave_CPPFLAGS=$CPPFLAGS CPPFLAGS="-D_MIRMAKE_H $CPPFLAGS" cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ /* Define $ac_func to an innocuous variant, in case declares $ac_func. For example, HP-UX 11i declares gettimeofday. */ #define $ac_func innocuous_$ac_func /* System header to define __stub macros and hopefully few prototypes, which can conflict with char $ac_func (); below. Prefer to if __STDC__ is defined, since exists even on freestanding compilers. */ #ifdef __STDC__ # include #else # include #endif #undef $ac_func /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ #ifdef __cplusplus extern "C" #endif char $ac_func (); /* The GNU C library defines this for functions which it implements to always fail with ENOSYS. Some functions are actually named something starting with __ and the normal name is an alias. */ #if defined __stub_$ac_func || defined __stub___$ac_func choke me #endif int main () { return $ac_func (); ; return 0; } _ACEOF rm -f conftest.$ac_objext conftest$ac_exeext if { (ac_try="$ac_link" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_link") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest$ac_exeext && $as_test_x conftest$ac_exeext; then eval "$as_ac_var=yes" else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 eval "$as_ac_var=no" fi rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ conftest$ac_exeext conftest.$ac_ext if test x"ja" = x"$mirsave_CPPFLAGS_set"; then CPPFLAGS=$mirsave_CPPFLAGS else unset CPPFLAGS fi unset mirsave_CPPFLAGS_set unset mirsave_CPPFLAGS fi ac_res=`eval echo '${'$as_ac_var'}'` { echo "$as_me:$LINENO: result: $ac_res" >&5 echo "${ECHO_T}$ac_res" >&6; } if test `eval echo '${'$as_ac_var'}'` = yes; then cat >>confdefs.h <<_ACEOF #define `echo "HAVE_$ac_func" | $as_tr_cpp` 1 _ACEOF fi done for ac_func in nl_langinfo popen putenv setitimer setlocale setpgid do as_ac_var=`echo "ac_cv_func_$ac_func" | $as_tr_sh` { echo "$as_me:$LINENO: checking for $ac_func" >&5 echo $ECHO_N "checking for $ac_func... $ECHO_C" >&6; } if { as_var=$as_ac_var; eval "test \"\${$as_var+set}\" = set"; }; then echo $ECHO_N "(cached) $ECHO_C" >&6 else mirsave_CPPFLAGS_set=${CPPFLAGS+ja} mirsave_CPPFLAGS=$CPPFLAGS CPPFLAGS="-D_MIRMAKE_H $CPPFLAGS" cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ /* Define $ac_func to an innocuous variant, in case declares $ac_func. For example, HP-UX 11i declares gettimeofday. */ #define $ac_func innocuous_$ac_func /* System header to define __stub macros and hopefully few prototypes, which can conflict with char $ac_func (); below. Prefer to if __STDC__ is defined, since exists even on freestanding compilers. */ #ifdef __STDC__ # include #else # include #endif #undef $ac_func /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ #ifdef __cplusplus extern "C" #endif char $ac_func (); /* The GNU C library defines this for functions which it implements to always fail with ENOSYS. Some functions are actually named something starting with __ and the normal name is an alias. */ #if defined __stub_$ac_func || defined __stub___$ac_func choke me #endif int main () { return $ac_func (); ; return 0; } _ACEOF rm -f conftest.$ac_objext conftest$ac_exeext if { (ac_try="$ac_link" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_link") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest$ac_exeext && $as_test_x conftest$ac_exeext; then eval "$as_ac_var=yes" else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 eval "$as_ac_var=no" fi rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ conftest$ac_exeext conftest.$ac_ext if test x"ja" = x"$mirsave_CPPFLAGS_set"; then CPPFLAGS=$mirsave_CPPFLAGS else unset CPPFLAGS fi unset mirsave_CPPFLAGS_set unset mirsave_CPPFLAGS fi ac_res=`eval echo '${'$as_ac_var'}'` { echo "$as_me:$LINENO: result: $ac_res" >&5 echo "${ECHO_T}$ac_res" >&6; } if test `eval echo '${'$as_ac_var'}'` = yes; then cat >>confdefs.h <<_ACEOF #define `echo "HAVE_$ac_func" | $as_tr_cpp` 1 _ACEOF fi done for ac_func in sigaction siginterrupt sigprocmask sigvec strchr strdup do as_ac_var=`echo "ac_cv_func_$ac_func" | $as_tr_sh` { echo "$as_me:$LINENO: checking for $ac_func" >&5 echo $ECHO_N "checking for $ac_func... $ECHO_C" >&6; } if { as_var=$as_ac_var; eval "test \"\${$as_var+set}\" = set"; }; then echo $ECHO_N "(cached) $ECHO_C" >&6 else mirsave_CPPFLAGS_set=${CPPFLAGS+ja} mirsave_CPPFLAGS=$CPPFLAGS CPPFLAGS="-D_MIRMAKE_H $CPPFLAGS" cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ /* Define $ac_func to an innocuous variant, in case declares $ac_func. For example, HP-UX 11i declares gettimeofday. */ #define $ac_func innocuous_$ac_func /* System header to define __stub macros and hopefully few prototypes, which can conflict with char $ac_func (); below. Prefer to if __STDC__ is defined, since exists even on freestanding compilers. */ #ifdef __STDC__ # include #else # include #endif #undef $ac_func /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ #ifdef __cplusplus extern "C" #endif char $ac_func (); /* The GNU C library defines this for functions which it implements to always fail with ENOSYS. Some functions are actually named something starting with __ and the normal name is an alias. */ #if defined __stub_$ac_func || defined __stub___$ac_func choke me #endif int main () { return $ac_func (); ; return 0; } _ACEOF rm -f conftest.$ac_objext conftest$ac_exeext if { (ac_try="$ac_link" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_link") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest$ac_exeext && $as_test_x conftest$ac_exeext; then eval "$as_ac_var=yes" else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 eval "$as_ac_var=no" fi rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ conftest$ac_exeext conftest.$ac_ext if test x"ja" = x"$mirsave_CPPFLAGS_set"; then CPPFLAGS=$mirsave_CPPFLAGS else unset CPPFLAGS fi unset mirsave_CPPFLAGS_set unset mirsave_CPPFLAGS fi ac_res=`eval echo '${'$as_ac_var'}'` { echo "$as_me:$LINENO: result: $ac_res" >&5 echo "${ECHO_T}$ac_res" >&6; } if test `eval echo '${'$as_ac_var'}'` = yes; then cat >>confdefs.h <<_ACEOF #define `echo "HAVE_$ac_func" | $as_tr_cpp` 1 _ACEOF fi done for ac_func in strlcat strlcpy sync utime do as_ac_var=`echo "ac_cv_func_$ac_func" | $as_tr_sh` { echo "$as_me:$LINENO: checking for $ac_func" >&5 echo $ECHO_N "checking for $ac_func... $ECHO_C" >&6; } if { as_var=$as_ac_var; eval "test \"\${$as_var+set}\" = set"; }; then echo $ECHO_N "(cached) $ECHO_C" >&6 else mirsave_CPPFLAGS_set=${CPPFLAGS+ja} mirsave_CPPFLAGS=$CPPFLAGS CPPFLAGS="-D_MIRMAKE_H $CPPFLAGS" cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ /* Define $ac_func to an innocuous variant, in case declares $ac_func. For example, HP-UX 11i declares gettimeofday. */ #define $ac_func innocuous_$ac_func /* System header to define __stub macros and hopefully few prototypes, which can conflict with char $ac_func (); below. Prefer to if __STDC__ is defined, since exists even on freestanding compilers. */ #ifdef __STDC__ # include #else # include #endif #undef $ac_func /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ #ifdef __cplusplus extern "C" #endif char $ac_func (); /* The GNU C library defines this for functions which it implements to always fail with ENOSYS. Some functions are actually named something starting with __ and the normal name is an alias. */ #if defined __stub_$ac_func || defined __stub___$ac_func choke me #endif int main () { return $ac_func (); ; return 0; } _ACEOF rm -f conftest.$ac_objext conftest$ac_exeext if { (ac_try="$ac_link" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_link") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest$ac_exeext && $as_test_x conftest$ac_exeext; then eval "$as_ac_var=yes" else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 eval "$as_ac_var=no" fi rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ conftest$ac_exeext conftest.$ac_ext if test x"ja" = x"$mirsave_CPPFLAGS_set"; then CPPFLAGS=$mirsave_CPPFLAGS else unset CPPFLAGS fi unset mirsave_CPPFLAGS_set unset mirsave_CPPFLAGS fi ac_res=`eval echo '${'$as_ac_var'}'` { echo "$as_me:$LINENO: result: $ac_res" >&5 echo "${ECHO_T}$ac_res" >&6; } if test `eval echo '${'$as_ac_var'}'` = yes; then cat >>confdefs.h <<_ACEOF #define `echo "HAVE_$ac_func" | $as_tr_cpp` 1 _ACEOF fi done # Check whether --enable-fork was given. if test "${enable_fork+set}" = set; then enableval=$enable_fork; use_fork=$enableval else use_fork=yes fi test x"$use_fork" = x"no" && ac_cv_func_fork=no for ac_func in fork unsetenv do as_ac_var=`echo "ac_cv_func_$ac_func" | $as_tr_sh` { echo "$as_me:$LINENO: checking for $ac_func" >&5 echo $ECHO_N "checking for $ac_func... $ECHO_C" >&6; } if { as_var=$as_ac_var; eval "test \"\${$as_var+set}\" = set"; }; then echo $ECHO_N "(cached) $ECHO_C" >&6 else mirsave_CPPFLAGS_set=${CPPFLAGS+ja} mirsave_CPPFLAGS=$CPPFLAGS CPPFLAGS="-D_MIRMAKE_H $CPPFLAGS" cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ /* Define $ac_func to an innocuous variant, in case declares $ac_func. For example, HP-UX 11i declares gettimeofday. */ #define $ac_func innocuous_$ac_func /* System header to define __stub macros and hopefully few prototypes, which can conflict with char $ac_func (); below. Prefer to if __STDC__ is defined, since exists even on freestanding compilers. */ #ifdef __STDC__ # include #else # include #endif #undef $ac_func /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ #ifdef __cplusplus extern "C" #endif char $ac_func (); /* The GNU C library defines this for functions which it implements to always fail with ENOSYS. Some functions are actually named something starting with __ and the normal name is an alias. */ #if defined __stub_$ac_func || defined __stub___$ac_func choke me #endif int main () { return $ac_func (); ; return 0; } _ACEOF rm -f conftest.$ac_objext conftest$ac_exeext if { (ac_try="$ac_link" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_link") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest$ac_exeext && $as_test_x conftest$ac_exeext; then eval "$as_ac_var=yes" else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 eval "$as_ac_var=no" fi rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ conftest$ac_exeext conftest.$ac_ext if test x"ja" = x"$mirsave_CPPFLAGS_set"; then CPPFLAGS=$mirsave_CPPFLAGS else unset CPPFLAGS fi unset mirsave_CPPFLAGS_set unset mirsave_CPPFLAGS fi ac_res=`eval echo '${'$as_ac_var'}'` { echo "$as_me:$LINENO: result: $ac_res" >&5 echo "${ECHO_T}$ac_res" >&6; } if test `eval echo '${'$as_ac_var'}'` = yes; then cat >>confdefs.h <<_ACEOF #define `echo "HAVE_$ac_func" | $as_tr_cpp` 1 _ACEOF fi done case $use_fork:$ac_cv_func_fork in no:*) use_fork=0 ;; *:yes) use_fork=1 ;; *) use_fork=0 ;; esac cat >>confdefs.h <<_ACEOF #define WANT_FORK $use_fork _ACEOF if test $use_fork = 1; then echo "Enabling use of fork(), concurrent subshells, etc." else echo "DISabling use of fork() and concurrent subshells (NOMMU)!" fi # Check whether --enable-fpu was given. if test "${enable_fpu+set}" = set; then enableval=$enable_fpu; use_fpu=$enableval else use_fpu=yes fi if test x"$use_fpu" = x"no"; then use_fpu=0 else use_fpu=1 fi cat >>confdefs.h <<_ACEOF #define WANT_MATH $use_fpu _ACEOF if test $use_fpu = 1; then echo "Enabling use of floating point arithmetics" else echo "DISabling Math support for lack of an FPU!" fi # Check whether --enable-small was given. if test "${enable_small+set}" = set; then enableval=$enable_small; use_small=$enableval else use_small=no fi if test x"$use_small" = x"yes"; then # for constrained systems (like 8 MiB RAM total) only cat >>confdefs.h <<\_ACEOF #define SMALL 1 _ACEOF fi { echo "$as_me:$LINENO: checking whether strlcpy is declared" >&5 echo $ECHO_N "checking whether strlcpy is declared... $ECHO_C" >&6; } if test "${ac_cv_have_decl_strlcpy+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ $ac_includes_default int main () { #ifndef strlcpy (void) strlcpy; #endif ; return 0; } _ACEOF rm -f conftest.$ac_objext if { (ac_try="$ac_compile" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then ac_cv_have_decl_strlcpy=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_cv_have_decl_strlcpy=no fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi { echo "$as_me:$LINENO: result: $ac_cv_have_decl_strlcpy" >&5 echo "${ECHO_T}$ac_cv_have_decl_strlcpy" >&6; } if test $ac_cv_have_decl_strlcpy = yes; then cat >>confdefs.h <<_ACEOF #define HAVE_DECL_STRLCPY 1 _ACEOF else cat >>confdefs.h <<_ACEOF #define HAVE_DECL_STRLCPY 0 _ACEOF fi { echo "$as_me:$LINENO: checking whether strlcat is declared" >&5 echo $ECHO_N "checking whether strlcat is declared... $ECHO_C" >&6; } if test "${ac_cv_have_decl_strlcat+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ $ac_includes_default int main () { #ifndef strlcat (void) strlcat; #endif ; return 0; } _ACEOF rm -f conftest.$ac_objext if { (ac_try="$ac_compile" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then ac_cv_have_decl_strlcat=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_cv_have_decl_strlcat=no fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi { echo "$as_me:$LINENO: result: $ac_cv_have_decl_strlcat" >&5 echo "${ECHO_T}$ac_cv_have_decl_strlcat" >&6; } if test $ac_cv_have_decl_strlcat = yes; then cat >>confdefs.h <<_ACEOF #define HAVE_DECL_STRLCAT 1 _ACEOF else cat >>confdefs.h <<_ACEOF #define HAVE_DECL_STRLCAT 0 _ACEOF fi { echo "$as_me:$LINENO: checking whether popen is declared" >&5 echo $ECHO_N "checking whether popen is declared... $ECHO_C" >&6; } if test "${ac_cv_have_decl_popen+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ $ac_includes_default int main () { #ifndef popen (void) popen; #endif ; return 0; } _ACEOF rm -f conftest.$ac_objext if { (ac_try="$ac_compile" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then ac_cv_have_decl_popen=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_cv_have_decl_popen=no fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi { echo "$as_me:$LINENO: result: $ac_cv_have_decl_popen" >&5 echo "${ECHO_T}$ac_cv_have_decl_popen" >&6; } if test $ac_cv_have_decl_popen = yes; then cat >>confdefs.h <<_ACEOF #define HAVE_DECL_POPEN 1 _ACEOF else cat >>confdefs.h <<_ACEOF #define HAVE_DECL_POPEN 0 _ACEOF fi { echo "$as_me:$LINENO: checking whether ctime is declared" >&5 echo $ECHO_N "checking whether ctime is declared... $ECHO_C" >&6; } if test "${ac_cv_have_decl_ctime+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ $ac_includes_default #ifdef TIME_WITH_SYS_TIME # include # include #else # ifdef HAVE_SYS_TIME_H # include # else # include # endif #endif int main () { #ifndef ctime (void) ctime; #endif ; return 0; } _ACEOF rm -f conftest.$ac_objext if { (ac_try="$ac_compile" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then ac_cv_have_decl_ctime=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_cv_have_decl_ctime=no fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi { echo "$as_me:$LINENO: result: $ac_cv_have_decl_ctime" >&5 echo "${ECHO_T}$ac_cv_have_decl_ctime" >&6; } if test $ac_cv_have_decl_ctime = yes; then cat >>confdefs.h <<_ACEOF #define HAVE_DECL_CTIME 1 _ACEOF else cat >>confdefs.h <<_ACEOF #define HAVE_DECL_CTIME 0 _ACEOF fi { echo "$as_me:$LINENO: checking whether sighandlers must be reinstalled" >&5 echo $ECHO_N "checking whether sighandlers must be reinstalled... $ECHO_C" >&6; } if test "${joe_cv_reinstall_sighandlers+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else if test "$cross_compiling" = yes; then joe_cv_reinstall_sighandlers=yes else cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #if HAVE_UNISTD_H #include #endif #if HAVE_SIGNAL_H #include #endif #ifndef HAVE_SIGHANDLER_T typedef RETSIGTYPE (*sighandler_t)(int); #endif int nsigint; void set_signal(int signum, sighandler_t handler) { #if HAVE_SIGACTION struct sigaction sact; sact.sa_handler = handler; sact.sa_flags = 0; sigemptyset(&sact.sa_mask); sigaction(signum, &sact, NULL); #elif HAVE_SIGVEC struct sigvec svec; svec.sv_handler = handler; svec.sv_flags = 0; sigemptyset(&svec.sv_mask); sigvec(signum, &svec, NULL); #else signal(signum, handler); #endif } RETSIGTYPE sigint(int s) { nsigint++; } int main() { nsigint = 0; set_signal(SIGINT, sigint); kill((int)getpid(), SIGINT); kill((int)getpid(), SIGINT); /* exit succesfully if don't have to reinstall sighandler when invoked */ exit(nsigint != 2); } _ACEOF rm -f conftest$ac_exeext if { (ac_try="$ac_link" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_link") 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='./conftest$ac_exeext' { (case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_try") 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then joe_cv_reinstall_sighandlers=no else echo "$as_me: program exited with status $ac_status" >&5 echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ( exit $ac_status ) joe_cv_reinstall_sighandlers=yes fi rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext fi fi { echo "$as_me:$LINENO: result: $joe_cv_reinstall_sighandlers" >&5 echo "${ECHO_T}$joe_cv_reinstall_sighandlers" >&6; } if test "$joe_cv_reinstall_sighandlers" = yes; then cat >>confdefs.h <<\_ACEOF #define NEED_TO_REINSTALL_SIGNAL 1 _ACEOF fi # Check for programs.. # Extract the first word of "aspell", so it can be a program name with args. set dummy aspell; ac_word=$2 { echo "$as_me:$LINENO: checking for $ac_word" >&5 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6; } if test "${ac_cv_prog_SPELL+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else if test -n "$SPELL"; then ac_cv_prog_SPELL="$SPELL" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then ac_cv_prog_SPELL="aspell" echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS test -z "$ac_cv_prog_SPELL" && ac_cv_prog_SPELL="ispell" fi fi SPELL=$ac_cv_prog_SPELL if test -n "$SPELL"; then { echo "$as_me:$LINENO: result: $SPELL" >&5 echo "${ECHO_T}$SPELL" >&6; } else { echo "$as_me:$LINENO: result: no" >&5 echo "${ECHO_T}no" >&6; } fi # strictly speaking, the .jsf files should have no substitutions, # as they don’t do what you think they expand, currently it’s more # expensive however to rename them in CVS, so we keep that until # jupp has converted to mirtoconf ac_config_files="$ac_config_files Makefile syntax/c.jsf syntax/perl.jsf syntax/verilog.jsf syntax/sh.jsf syntax/python.jsf syntax/conf.jsf syntax/php.jsf syntax/mail.jsf syntax/pascal.jsf syntax/html.jsf syntax/vhdl.jsf syntax/fortran.jsf syntax/java.jsf syntax/xml.jsf syntax/tcl.jsf charmaps/klingon syntax/lisp.jsf syntax/csh.jsf syntax/mason.jsf syntax/diff.jsf syntax/asm.jsf syntax/tex.jsf" cat >confcache <<\_ACEOF # This file is a shell script that caches the results of configure # tests run on this system so they can be shared between configure # scripts and configure runs, see configure's option --config-cache. # It is not useful on other systems. If it contains results you don't # want to keep, you may remove or edit it. # # config.status only pays attention to the cache file if you give it # the --recheck option to rerun configure. # # `ac_cv_env_foo' variables (set or unset) will be overridden when # loading this file, other *unset* `ac_cv_foo' will be assigned the # following values. _ACEOF # The following way of writing the cache mishandles newlines in values, # but we know of no workaround that is simple, portable, and efficient. # So, we kill variables containing newlines. # Ultrix sh set writes to stderr and can't be redirected directly, # and sets the high bit in the cache file unless we assign to the vars. ( for ac_var in `(set) 2>&1 | sed -n 's/^\([a-zA-Z_][a-zA-Z0-9_]*\)=.*/\1/p'`; do eval ac_val=\$$ac_var case $ac_val in #( *${as_nl}*) case $ac_var in #( *_cv_*) { echo "$as_me:$LINENO: WARNING: Cache variable $ac_var contains a newline." >&5 echo "$as_me: WARNING: Cache variable $ac_var contains a newline." >&2;} ;; esac case $ac_var in #( _ | IFS | as_nl) ;; #( *) $as_unset $ac_var ;; esac ;; esac done (set) 2>&1 | case $as_nl`(ac_space=' '; set) 2>&1` in #( *${as_nl}ac_space=\ *) # `set' does not quote correctly, so add quotes (double-quote # substitution turns \\\\ into \\, and sed turns \\ into \). sed -n \ "s/'/'\\\\''/g; s/^\\([_$as_cr_alnum]*_cv_[_$as_cr_alnum]*\\)=\\(.*\\)/\\1='\\2'/p" ;; #( *) # `set' quotes correctly as required by POSIX, so do not add quotes. sed -n "/^[_$as_cr_alnum]*_cv_[_$as_cr_alnum]*=/p" ;; esac | sort ) | sed ' /^ac_cv_env_/b end t clear :clear s/^\([^=]*\)=\(.*[{}].*\)$/test "${\1+set}" = set || &/ t end s/^\([^=]*\)=\(.*\)$/\1=${\1=\2}/ :end' >>confcache if diff "$cache_file" confcache >/dev/null 2>&1; then :; else if test -w "$cache_file"; then test "x$cache_file" != "x/dev/null" && { echo "$as_me:$LINENO: updating cache $cache_file" >&5 echo "$as_me: updating cache $cache_file" >&6;} cat confcache >$cache_file else { echo "$as_me:$LINENO: not updating unwritable cache $cache_file" >&5 echo "$as_me: not updating unwritable cache $cache_file" >&6;} fi fi rm -f confcache test "x$prefix" = xNONE && prefix=$ac_default_prefix # Let make expand exec_prefix. test "x$exec_prefix" = xNONE && exec_prefix='${prefix}' DEFS=-DHAVE_CONFIG_H ac_libobjs= ac_ltlibobjs= for ac_i in : $LIBOBJS; do test "x$ac_i" = x: && continue # 1. Remove the extension, and $U if already installed. ac_script='s/\$U\././;s/\.o$//;s/\.obj$//' ac_i=`echo "$ac_i" | sed "$ac_script"` # 2. Prepend LIBOBJDIR. When used with automake>=1.10 LIBOBJDIR # will be set to the directory where LIBOBJS objects are built. ac_libobjs="$ac_libobjs \${LIBOBJDIR}$ac_i\$U.$ac_objext" ac_ltlibobjs="$ac_ltlibobjs \${LIBOBJDIR}$ac_i"'$U.lo' done LIBOBJS=$ac_libobjs LTLIBOBJS=$ac_ltlibobjs if test -z "${MAINTAINER_MODE_TRUE}" && test -z "${MAINTAINER_MODE_FALSE}"; then { { echo "$as_me:$LINENO: error: conditional \"MAINTAINER_MODE\" was never defined. Usually this means the macro was only invoked conditionally." >&5 echo "$as_me: error: conditional \"MAINTAINER_MODE\" was never defined. Usually this means the macro was only invoked conditionally." >&2;} { (exit 1); exit 1; }; } fi if test -z "${AMDEP_TRUE}" && test -z "${AMDEP_FALSE}"; then { { echo "$as_me:$LINENO: error: conditional \"AMDEP\" was never defined. Usually this means the macro was only invoked conditionally." >&5 echo "$as_me: error: conditional \"AMDEP\" was never defined. Usually this means the macro was only invoked conditionally." >&2;} { (exit 1); exit 1; }; } fi if test -z "${am__fastdepCC_TRUE}" && test -z "${am__fastdepCC_FALSE}"; then { { echo "$as_me:$LINENO: error: conditional \"am__fastdepCC\" was never defined. Usually this means the macro was only invoked conditionally." >&5 echo "$as_me: error: conditional \"am__fastdepCC\" was never defined. Usually this means the macro was only invoked conditionally." >&2;} { (exit 1); exit 1; }; } fi if test -z "${WANT_TERMIDX_TRUE}" && test -z "${WANT_TERMIDX_FALSE}"; then { { echo "$as_me:$LINENO: error: conditional \"WANT_TERMIDX\" was never defined. Usually this means the macro was only invoked conditionally." >&5 echo "$as_me: error: conditional \"WANT_TERMIDX\" was never defined. Usually this means the macro was only invoked conditionally." >&2;} { (exit 1); exit 1; }; } fi : ${CONFIG_STATUS=./config.status} ac_clean_files_save=$ac_clean_files ac_clean_files="$ac_clean_files $CONFIG_STATUS" { echo "$as_me:$LINENO: creating $CONFIG_STATUS" >&5 echo "$as_me: creating $CONFIG_STATUS" >&6;} cat >$CONFIG_STATUS <<_ACEOF #! $SHELL # Generated by $as_me. # Run this file to recreate the current configuration. # Compiler output produced by configure, useful for debugging # configure, is in config.log if it exists. debug=false ac_cs_recheck=false ac_cs_silent=false SHELL=\${CONFIG_SHELL-$SHELL} _ACEOF cat >>$CONFIG_STATUS <<\_ACEOF ## --------------------- ## ## M4sh Initialization. ## ## --------------------- ## # Be more Bourne compatible DUALCASE=1; export DUALCASE # for MKS sh if test -n "${ZSH_VERSION+set}" && (emulate sh) >/dev/null 2>&1; then emulate sh NULLCMD=: # Zsh 3.x and 4.x performs word splitting on ${1+"$@"}, which # is contrary to our usage. Disable this feature. alias -g '${1+"$@"}'='"$@"' setopt NO_GLOB_SUBST else case `(set -o) 2>/dev/null` in *posix*) set -o posix ;; esac fi # PATH needs CR # Avoid depending upon Character Ranges. as_cr_letters='abcdefghijklmnopqrstuvwxyz' as_cr_LETTERS='ABCDEFGHIJKLMNOPQRSTUVWXYZ' as_cr_Letters=$as_cr_letters$as_cr_LETTERS as_cr_digits='0123456789' as_cr_alnum=$as_cr_Letters$as_cr_digits # The user is always right. if test "${PATH_SEPARATOR+set}" != set; then echo "#! /bin/sh" >conf$$.sh echo "exit 0" >>conf$$.sh chmod +x conf$$.sh if (PATH="/nonexistent;."; conf$$.sh) >/dev/null 2>&1; then PATH_SEPARATOR=';' else PATH_SEPARATOR=: fi rm -f conf$$.sh fi # Support unset when possible. if ( (MAIL=60; unset MAIL) || exit) >/dev/null 2>&1; then as_unset=unset else as_unset=false fi # IFS # We need space, tab and new line, in precisely that order. Quoting is # there to prevent editors from complaining about space-tab. # (If _AS_PATH_WALK were called with IFS unset, it would disable word # splitting by setting IFS to empty value.) as_nl=' ' IFS=" "" $as_nl" # Find who we are. Look in the path if we contain no directory separator. case $0 in *[\\/]* ) as_myself=$0 ;; *) as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. test -r "$as_dir/$0" && as_myself=$as_dir/$0 && break done IFS=$as_save_IFS ;; esac # We did not find ourselves, most probably we were run as `sh COMMAND' # in which case we are not to be found in the path. if test "x$as_myself" = x; then as_myself=$0 fi if test ! -f "$as_myself"; then echo "$as_myself: error: cannot find myself; rerun with an absolute file name" >&2 { (exit 1); exit 1; } fi # Work around bugs in pre-3.0 UWIN ksh. for as_var in ENV MAIL MAILPATH do ($as_unset $as_var) >/dev/null 2>&1 && $as_unset $as_var done PS1='$ ' PS2='> ' PS4='+ ' # NLS nuisances. for as_var in \ LANG LANGUAGE LC_ADDRESS LC_ALL LC_COLLATE LC_CTYPE LC_IDENTIFICATION \ LC_MEASUREMENT LC_MESSAGES LC_MONETARY LC_NAME LC_NUMERIC LC_PAPER \ LC_TELEPHONE LC_TIME do if (set +x; test -z "`(eval $as_var=C; export $as_var) 2>&1`"); then eval $as_var=C; export $as_var else ($as_unset $as_var) >/dev/null 2>&1 && $as_unset $as_var fi done # Required to use basename. if expr a : '\(a\)' >/dev/null 2>&1 && test "X`expr 00001 : '.*\(...\)'`" = X001; then as_expr=expr else as_expr=false fi if (basename -- /) >/dev/null 2>&1 && test "X`basename -- / 2>&1`" = "X/"; then as_basename=basename else as_basename=false fi # Name of the executable. as_me=`$as_basename -- "$0" || $as_expr X/"$0" : '.*/\([^/][^/]*\)/*$' \| \ X"$0" : 'X\(//\)$' \| \ X"$0" : 'X\(/\)' \| . 2>/dev/null || echo X/"$0" | sed '/^.*\/\([^/][^/]*\)\/*$/{ s//\1/ q } /^X\/\(\/\/\)$/{ s//\1/ q } /^X\/\(\/\).*/{ s//\1/ q } s/.*/./; q'` # CDPATH. $as_unset CDPATH as_lineno_1=$LINENO as_lineno_2=$LINENO test "x$as_lineno_1" != "x$as_lineno_2" && test "x`expr $as_lineno_1 + 1`" = "x$as_lineno_2" || { # Create $as_me.lineno as a copy of $as_myself, but with $LINENO # uniformly replaced by the line number. The first 'sed' inserts a # line-number line after each line using $LINENO; the second 'sed' # does the real work. The second script uses 'N' to pair each # line-number line with the line containing $LINENO, and appends # trailing '-' during substitution so that $LINENO is not a special # case at line end. # (Raja R Harinath suggested sed '=', and Paul Eggert wrote the # scripts with optimization help from Paolo Bonzini. Blame Lee # E. McMahon (1931-1989) for sed's syntax. :-) sed -n ' p /[$]LINENO/= ' <$as_myself | sed ' s/[$]LINENO.*/&-/ t lineno b :lineno N :loop s/[$]LINENO\([^'$as_cr_alnum'_].*\n\)\(.*\)/\2\1\2/ t loop s/-\n.*// ' >$as_me.lineno && chmod +x "$as_me.lineno" || { echo "$as_me: error: cannot create $as_me.lineno; rerun with a POSIX shell" >&2 { (exit 1); exit 1; }; } # Don't try to exec as it changes $[0], causing all sort of problems # (the dirname of $[0] is not the place where we might find the # original and so on. Autoconf is especially sensitive to this). . "./$as_me.lineno" # Exit status is that of the last command. exit } if (as_dir=`dirname -- /` && test "X$as_dir" = X/) >/dev/null 2>&1; then as_dirname=dirname else as_dirname=false fi ECHO_C= ECHO_N= ECHO_T= case `echo -n x` in -n*) case `echo 'x\c'` in *c*) ECHO_T=' ';; # ECHO_T is single tab character. *) ECHO_C='\c';; esac;; *) ECHO_N='-n';; esac if expr a : '\(a\)' >/dev/null 2>&1 && test "X`expr 00001 : '.*\(...\)'`" = X001; then as_expr=expr else as_expr=false fi rm -f conf$$ conf$$.exe conf$$.file if test -d conf$$.dir; then rm -f conf$$.dir/conf$$.file else rm -f conf$$.dir mkdir conf$$.dir fi echo >conf$$.file if ln -s conf$$.file conf$$ 2>/dev/null; then as_ln_s='ln -s' # ... but there are two gotchas: # 1) On MSYS, both `ln -s file dir' and `ln file dir' fail. # 2) DJGPP < 2.04 has no symlinks; `ln -s' creates a wrapper executable. # In both cases, we have to default to `cp -p'. ln -s conf$$.file conf$$.dir 2>/dev/null && test ! -f conf$$.exe || as_ln_s='cp -p' elif ln conf$$.file conf$$ 2>/dev/null; then as_ln_s=ln else as_ln_s='cp -p' fi rm -f conf$$ conf$$.exe conf$$.dir/conf$$.file conf$$.file rmdir conf$$.dir 2>/dev/null if mkdir -p . 2>/dev/null; then as_mkdir_p=: else test -d ./-p && rmdir ./-p as_mkdir_p=false fi if test -x / >/dev/null 2>&1; then as_test_x='test -x' else if ls -dL / >/dev/null 2>&1; then as_ls_L_option=L else as_ls_L_option= fi as_test_x=' eval sh -c '\'' if test -d "$1"; then test -d "$1/."; else case $1 in -*)set "./$1";; esac; case `ls -ld'$as_ls_L_option' "$1" 2>/dev/null` in ???[sx]*):;;*)false;;esac;fi '\'' sh ' fi as_executable_p=$as_test_x # Sed expression to map a string onto a valid CPP name. as_tr_cpp="eval sed 'y%*$as_cr_letters%P$as_cr_LETTERS%;s%[^_$as_cr_alnum]%_%g'" # Sed expression to map a string onto a valid variable name. as_tr_sh="eval sed 'y%*+%pp%;s%[^_$as_cr_alnum]%_%g'" exec 6>&1 # Save the log message, to keep $[0] and so on meaningful, and to # report actual input values of CONFIG_FILES etc. instead of their # values after options handling. ac_log=" This file was extended by joe $as_me 3.1jupp41, which was generated by GNU Autoconf 2.61-MirPorts-3. Invocation command line was CONFIG_FILES = $CONFIG_FILES CONFIG_HEADERS = $CONFIG_HEADERS CONFIG_LINKS = $CONFIG_LINKS CONFIG_COMMANDS = $CONFIG_COMMANDS $ $0 $@ on `(hostname || uname -n) 2>/dev/null | sed 1q` " _ACEOF cat >>$CONFIG_STATUS <<_ACEOF # Files that config.status was made for. config_files="$ac_config_files" config_headers="$ac_config_headers" config_commands="$ac_config_commands" _ACEOF cat >>$CONFIG_STATUS <<\_ACEOF ac_cs_usage="\ \`$as_me' instantiates files from templates according to the current configuration. Usage: $0 [OPTIONS] [FILE]... -h, --help print this help, then exit -V, --version print version number and configuration settings, then exit -q, --quiet do not print progress messages -d, --debug don't remove temporary files --recheck update $as_me by reconfiguring in the same conditions --file=FILE[:TEMPLATE] instantiate the configuration file FILE --header=FILE[:TEMPLATE] instantiate the configuration header FILE Configuration files: $config_files Configuration headers: $config_headers Configuration commands: $config_commands Report bugs to ." _ACEOF cat >>$CONFIG_STATUS <<_ACEOF ac_cs_version="\\ joe config.status 3.1jupp41 configured by $0, generated by GNU Autoconf 2.61-MirPorts-3, with options \\"`echo "$ac_configure_args" | sed 's/^ //; s/[\\""\`\$]/\\\\&/g'`\\" Copyright (C) 2006 Free Software Foundation, Inc. This config.status script is free software; the Free Software Foundation gives unlimited permission to copy, distribute and modify it." ac_pwd='$ac_pwd' srcdir='$srcdir' INSTALL='$INSTALL' _ACEOF cat >>$CONFIG_STATUS <<\_ACEOF # If no file are specified by the user, then we need to provide default # value. By we need to know if files were specified by the user. ac_need_defaults=: while test $# != 0 do case $1 in --*=*) ac_option=`expr "X$1" : 'X\([^=]*\)='` ac_optarg=`expr "X$1" : 'X[^=]*=\(.*\)'` ac_shift=: ;; *) ac_option=$1 ac_optarg=$2 ac_shift=shift ;; esac case $ac_option in # Handling of the options. -recheck | --recheck | --rechec | --reche | --rech | --rec | --re | --r) ac_cs_recheck=: ;; --version | --versio | --versi | --vers | --ver | --ve | --v | -V ) echo "$ac_cs_version"; exit ;; --debug | --debu | --deb | --de | --d | -d ) debug=: ;; --file | --fil | --fi | --f ) $ac_shift CONFIG_FILES="$CONFIG_FILES $ac_optarg" ac_need_defaults=false;; --header | --heade | --head | --hea ) $ac_shift CONFIG_HEADERS="$CONFIG_HEADERS $ac_optarg" ac_need_defaults=false;; --he | --h) # Conflict between --help and --header { echo "$as_me: error: ambiguous option: $1 Try \`$0 --help' for more information." >&2 { (exit 1); exit 1; }; };; --help | --hel | -h ) echo "$ac_cs_usage"; exit ;; -q | -quiet | --quiet | --quie | --qui | --qu | --q \ | -silent | --silent | --silen | --sile | --sil | --si | --s) ac_cs_silent=: ;; # This is an error. -*) { echo "$as_me: error: unrecognized option: $1 Try \`$0 --help' for more information." >&2 { (exit 1); exit 1; }; } ;; *) ac_config_targets="$ac_config_targets $1" ac_need_defaults=false ;; esac shift done ac_configure_extra_args= if $ac_cs_silent; then exec 6>/dev/null ac_configure_extra_args="$ac_configure_extra_args --silent" fi _ACEOF cat >>$CONFIG_STATUS <<_ACEOF if \$ac_cs_recheck; then echo "running CONFIG_SHELL=$SHELL $SHELL $0 "$ac_configure_args \$ac_configure_extra_args " --no-create --no-recursion" >&6 CONFIG_SHELL=$SHELL export CONFIG_SHELL exec $SHELL "$0"$ac_configure_args \$ac_configure_extra_args --no-create --no-recursion fi _ACEOF cat >>$CONFIG_STATUS <<\_ACEOF exec 5>>config.log { echo sed 'h;s/./-/g;s/^.../## /;s/...$/ ##/;p;x;p;x' <<_ASBOX ## Running $as_me. ## _ASBOX echo "$ac_log" } >&5 _ACEOF cat >>$CONFIG_STATUS <<_ACEOF # # INIT-COMMANDS # AMDEP_TRUE="$AMDEP_TRUE" ac_aux_dir="$ac_aux_dir" _ACEOF cat >>$CONFIG_STATUS <<\_ACEOF # Handling of arguments. for ac_config_target in $ac_config_targets do case $ac_config_target in "autoconf.h") CONFIG_HEADERS="$CONFIG_HEADERS autoconf.h" ;; "depfiles") CONFIG_COMMANDS="$CONFIG_COMMANDS depfiles" ;; "Makefile") CONFIG_FILES="$CONFIG_FILES Makefile" ;; "syntax/c.jsf") CONFIG_FILES="$CONFIG_FILES syntax/c.jsf" ;; "syntax/perl.jsf") CONFIG_FILES="$CONFIG_FILES syntax/perl.jsf" ;; "syntax/verilog.jsf") CONFIG_FILES="$CONFIG_FILES syntax/verilog.jsf" ;; "syntax/sh.jsf") CONFIG_FILES="$CONFIG_FILES syntax/sh.jsf" ;; "syntax/python.jsf") CONFIG_FILES="$CONFIG_FILES syntax/python.jsf" ;; "syntax/conf.jsf") CONFIG_FILES="$CONFIG_FILES syntax/conf.jsf" ;; "syntax/php.jsf") CONFIG_FILES="$CONFIG_FILES syntax/php.jsf" ;; "syntax/mail.jsf") CONFIG_FILES="$CONFIG_FILES syntax/mail.jsf" ;; "syntax/pascal.jsf") CONFIG_FILES="$CONFIG_FILES syntax/pascal.jsf" ;; "syntax/html.jsf") CONFIG_FILES="$CONFIG_FILES syntax/html.jsf" ;; "syntax/vhdl.jsf") CONFIG_FILES="$CONFIG_FILES syntax/vhdl.jsf" ;; "syntax/fortran.jsf") CONFIG_FILES="$CONFIG_FILES syntax/fortran.jsf" ;; "syntax/java.jsf") CONFIG_FILES="$CONFIG_FILES syntax/java.jsf" ;; "syntax/xml.jsf") CONFIG_FILES="$CONFIG_FILES syntax/xml.jsf" ;; "syntax/tcl.jsf") CONFIG_FILES="$CONFIG_FILES syntax/tcl.jsf" ;; "charmaps/klingon") CONFIG_FILES="$CONFIG_FILES charmaps/klingon" ;; "syntax/lisp.jsf") CONFIG_FILES="$CONFIG_FILES syntax/lisp.jsf" ;; "syntax/csh.jsf") CONFIG_FILES="$CONFIG_FILES syntax/csh.jsf" ;; "syntax/mason.jsf") CONFIG_FILES="$CONFIG_FILES syntax/mason.jsf" ;; "syntax/diff.jsf") CONFIG_FILES="$CONFIG_FILES syntax/diff.jsf" ;; "syntax/asm.jsf") CONFIG_FILES="$CONFIG_FILES syntax/asm.jsf" ;; "syntax/tex.jsf") CONFIG_FILES="$CONFIG_FILES syntax/tex.jsf" ;; *) { { echo "$as_me:$LINENO: error: invalid argument: $ac_config_target" >&5 echo "$as_me: error: invalid argument: $ac_config_target" >&2;} { (exit 1); exit 1; }; };; esac done # If the user did not use the arguments to specify the items to instantiate, # then the envvar interface is used. Set only those that are not. # We use the long form for the default assignment because of an extremely # bizarre bug on SunOS 4.1.3. if $ac_need_defaults; then test "${CONFIG_FILES+set}" = set || CONFIG_FILES=$config_files test "${CONFIG_HEADERS+set}" = set || CONFIG_HEADERS=$config_headers test "${CONFIG_COMMANDS+set}" = set || CONFIG_COMMANDS=$config_commands fi # Have a temporary directory for convenience. Make it in the build tree # simply because there is no reason against having it here, and in addition, # creating and moving files from /tmp can sometimes cause problems. # Hook for its removal unless debugging. # Note that there is a small window in which the directory will not be cleaned: # after its creation but before its name has been assigned to `$tmp'. $debug || { tmp= trap 'exit_status=$? { test -z "$tmp" || test ! -d "$tmp" || rm -fr "$tmp"; } && exit $exit_status ' 0 trap '{ (exit 1); exit 1; }' 1 2 13 15 } # Create a (secure) tmp directory for tmp files. { tmp=`(umask 077 && mktemp -d "./confXXXXXX") 2>/dev/null` && test -n "$tmp" && test -d "$tmp" } || { tmp=./conf$$-$RANDOM (umask 077 && mkdir "$tmp") } || { echo "$me: cannot create a temporary directory in ." >&2 { (exit 1); exit 1; } } # # Set up the sed scripts for CONFIG_FILES section. # # No need to generate the scripts if there are no CONFIG_FILES. # This happens for instance when ./config.status config.h if test -n "$CONFIG_FILES"; then _ACEOF ac_delim='%!_!# ' for ac_last_try in false false false false false :; do cat >conf$$subs.sed <<_ACEOF SHELL!$SHELL$ac_delim PATH_SEPARATOR!$PATH_SEPARATOR$ac_delim PACKAGE_NAME!$PACKAGE_NAME$ac_delim PACKAGE_TARNAME!$PACKAGE_TARNAME$ac_delim PACKAGE_VERSION!$PACKAGE_VERSION$ac_delim PACKAGE_STRING!$PACKAGE_STRING$ac_delim PACKAGE_BUGREPORT!$PACKAGE_BUGREPORT$ac_delim exec_prefix!$exec_prefix$ac_delim prefix!$prefix$ac_delim program_transform_name!$program_transform_name$ac_delim bindir!$bindir$ac_delim sbindir!$sbindir$ac_delim libexecdir!$libexecdir$ac_delim datarootdir!$datarootdir$ac_delim datadir!$datadir$ac_delim sysconfdir!$sysconfdir$ac_delim sharedstatedir!$sharedstatedir$ac_delim localstatedir!$localstatedir$ac_delim includedir!$includedir$ac_delim oldincludedir!$oldincludedir$ac_delim docdir!$docdir$ac_delim infodir!$infodir$ac_delim htmldir!$htmldir$ac_delim dvidir!$dvidir$ac_delim pdfdir!$pdfdir$ac_delim psdir!$psdir$ac_delim libdir!$libdir$ac_delim localedir!$localedir$ac_delim mandir!$mandir$ac_delim DEFS!$DEFS$ac_delim ECHO_C!$ECHO_C$ac_delim ECHO_N!$ECHO_N$ac_delim ECHO_T!$ECHO_T$ac_delim LIBS!$LIBS$ac_delim build_alias!$build_alias$ac_delim host_alias!$host_alias$ac_delim target_alias!$target_alias$ac_delim build!$build$ac_delim build_cpu!$build_cpu$ac_delim build_vendor!$build_vendor$ac_delim build_os!$build_os$ac_delim host!$host$ac_delim host_cpu!$host_cpu$ac_delim host_vendor!$host_vendor$ac_delim host_os!$host_os$ac_delim target!$target$ac_delim target_cpu!$target_cpu$ac_delim target_vendor!$target_vendor$ac_delim target_os!$target_os$ac_delim INSTALL_PROGRAM!$INSTALL_PROGRAM$ac_delim INSTALL_SCRIPT!$INSTALL_SCRIPT$ac_delim INSTALL_DATA!$INSTALL_DATA$ac_delim CYGPATH_W!$CYGPATH_W$ac_delim PACKAGE!$PACKAGE$ac_delim VERSION!$VERSION$ac_delim ACLOCAL!$ACLOCAL$ac_delim AUTOCONF!$AUTOCONF$ac_delim AUTOMAKE!$AUTOMAKE$ac_delim AUTOHEADER!$AUTOHEADER$ac_delim MAKEINFO!$MAKEINFO$ac_delim install_sh!$install_sh$ac_delim STRIP!$STRIP$ac_delim INSTALL_STRIP_PROGRAM!$INSTALL_STRIP_PROGRAM$ac_delim mkdir_p!$mkdir_p$ac_delim AWK!$AWK$ac_delim SET_MAKE!$SET_MAKE$ac_delim am__leading_dot!$am__leading_dot$ac_delim AMTAR!$AMTAR$ac_delim am__tar!$am__tar$ac_delim am__untar!$am__untar$ac_delim MAINTAINER_MODE_TRUE!$MAINTAINER_MODE_TRUE$ac_delim MAINTAINER_MODE_FALSE!$MAINTAINER_MODE_FALSE$ac_delim MAINT!$MAINT$ac_delim CC!$CC$ac_delim CFLAGS!$CFLAGS$ac_delim LDFLAGS!$LDFLAGS$ac_delim CPPFLAGS!$CPPFLAGS$ac_delim ac_ct_CC!$ac_ct_CC$ac_delim EXEEXT!$EXEEXT$ac_delim OBJEXT!$OBJEXT$ac_delim DEPDIR!$DEPDIR$ac_delim am__include!$am__include$ac_delim am__quote!$am__quote$ac_delim AMDEP_TRUE!$AMDEP_TRUE$ac_delim AMDEP_FALSE!$AMDEP_FALSE$ac_delim AMDEPBACKSLASH!$AMDEPBACKSLASH$ac_delim CCDEPMODE!$CCDEPMODE$ac_delim am__fastdepCC_TRUE!$am__fastdepCC_TRUE$ac_delim am__fastdepCC_FALSE!$am__fastdepCC_FALSE$ac_delim CPP!$CPP$ac_delim GREP!$GREP$ac_delim EGREP!$EGREP$ac_delim LN_S!$LN_S$ac_delim WANT_TERMIDX_TRUE!$WANT_TERMIDX_TRUE$ac_delim WANT_TERMIDX_FALSE!$WANT_TERMIDX_FALSE$ac_delim sysconfjoesubdir!$sysconfjoesubdir$ac_delim joeinitfile!$joeinitfile$ac_delim _ACEOF if test `sed -n "s/.*$ac_delim\$/X/p" conf$$subs.sed | grep -c X` = 97; then break elif $ac_last_try; then { { echo "$as_me:$LINENO: error: could not make $CONFIG_STATUS" >&5 echo "$as_me: error: could not make $CONFIG_STATUS" >&2;} { (exit 1); exit 1; }; } else ac_delim="$ac_delim!$ac_delim _$ac_delim!! " fi done ac_eof=`sed -n '/^CEOF[0-9]*$/s/CEOF/0/p' conf$$subs.sed` if test -n "$ac_eof"; then ac_eof=`echo "$ac_eof" | sort -nru | sed 1q` ac_eof=`expr $ac_eof + 1` fi cat >>$CONFIG_STATUS <<_ACEOF cat >"\$tmp/subs-1.sed" <<\CEOF$ac_eof /@[a-zA-Z_][a-zA-Z_0-9]*@/!b _ACEOF sed ' s/[,\\&]/\\&/g; s/@/@|#_!!_#|/g s/^/s,@/; s/!/@,|#_!!_#|/ :n t n s/'"$ac_delim"'$/,g/; t s/$/\\/; p N; s/^.*\n//; s/[,\\&]/\\&/g; s/@/@|#_!!_#|/g; b n ' >>$CONFIG_STATUS >$CONFIG_STATUS <<_ACEOF CEOF$ac_eof _ACEOF ac_delim='%!_!# ' for ac_last_try in false false false false false :; do cat >conf$$subs.sed <<_ACEOF joeinitcopy!$joeinitcopy$ac_delim joeresides!$joeresides$ac_delim jrcbefore!$jrcbefore$ac_delim jrcafter!$jrcafter$ac_delim LIBOBJS!$LIBOBJS$ac_delim SPELL!$SPELL$ac_delim LTLIBOBJS!$LTLIBOBJS$ac_delim _ACEOF if test `sed -n "s/.*$ac_delim\$/X/p" conf$$subs.sed | grep -c X` = 7; then break elif $ac_last_try; then { { echo "$as_me:$LINENO: error: could not make $CONFIG_STATUS" >&5 echo "$as_me: error: could not make $CONFIG_STATUS" >&2;} { (exit 1); exit 1; }; } else ac_delim="$ac_delim!$ac_delim _$ac_delim!! " fi done ac_eof=`sed -n '/^CEOF[0-9]*$/s/CEOF/0/p' conf$$subs.sed` if test -n "$ac_eof"; then ac_eof=`echo "$ac_eof" | sort -nru | sed 1q` ac_eof=`expr $ac_eof + 1` fi cat >>$CONFIG_STATUS <<_ACEOF cat >"\$tmp/subs-2.sed" <<\CEOF$ac_eof /@[a-zA-Z_][a-zA-Z_0-9]*@/!b end _ACEOF sed ' s/[,\\&]/\\&/g; s/@/@|#_!!_#|/g s/^/s,@/; s/!/@,|#_!!_#|/ :n t n s/'"$ac_delim"'$/,g/; t s/$/\\/; p N; s/^.*\n//; s/[,\\&]/\\&/g; s/@/@|#_!!_#|/g; b n ' >>$CONFIG_STATUS >$CONFIG_STATUS <<_ACEOF :end s/|#_!!_#|//g CEOF$ac_eof _ACEOF # VPATH may cause trouble with some makes, so we remove $(srcdir), # ${srcdir} and @srcdir@ from VPATH if srcdir is ".", strip leading and # trailing colons and then remove the whole line if VPATH becomes empty # (actually we leave an empty line to preserve line numbers). if test "x$srcdir" = x.; then ac_vpsub='/^[ ]*VPATH[ ]*=/{ s/:*\$(srcdir):*/:/ s/:*\${srcdir}:*/:/ s/:*@srcdir@:*/:/ s/^\([^=]*=[ ]*\):*/\1/ s/:*$// s/^[^=]*=[ ]*$// }' fi cat >>$CONFIG_STATUS <<\_ACEOF fi # test -n "$CONFIG_FILES" for ac_tag in :F $CONFIG_FILES :H $CONFIG_HEADERS :C $CONFIG_COMMANDS do case $ac_tag in :[FHLC]) ac_mode=$ac_tag; continue;; esac case $ac_mode$ac_tag in :[FHL]*:*);; :L* | :C*:*) { { echo "$as_me:$LINENO: error: Invalid tag $ac_tag." >&5 echo "$as_me: error: Invalid tag $ac_tag." >&2;} { (exit 1); exit 1; }; };; :[FH]-) ac_tag=-:-;; :[FH]*) ac_tag=$ac_tag:$ac_tag.in;; esac ac_save_IFS=$IFS IFS=: set x $ac_tag IFS=$ac_save_IFS shift ac_file=$1 shift case $ac_mode in :L) ac_source=$1;; :[FH]) ac_file_inputs= for ac_f do case $ac_f in -) ac_f="$tmp/stdin";; *) # Look for the file first in the build tree, then in the source tree # (if the path is not absolute). The absolute path cannot be DOS-style, # because $ac_f cannot contain `:'. test -f "$ac_f" || case $ac_f in [\\/$]*) false;; *) test -f "$srcdir/$ac_f" && ac_f="$srcdir/$ac_f";; esac || { { echo "$as_me:$LINENO: error: cannot find input file: $ac_f" >&5 echo "$as_me: error: cannot find input file: $ac_f" >&2;} { (exit 1); exit 1; }; };; esac ac_file_inputs="$ac_file_inputs $ac_f" done # Let's still pretend it is `configure' which instantiates (i.e., don't # use $as_me), people would be surprised to read: # /* config.h. Generated by config.status. */ configure_input="Generated from "`IFS=: echo $* | sed 's|^[^:]*/||;s|:[^:]*/|, |g'`" by configure." if test x"$ac_file" != x-; then configure_input="$ac_file. $configure_input" { echo "$as_me:$LINENO: creating $ac_file" >&5 echo "$as_me: creating $ac_file" >&6;} fi case $ac_tag in *:-:* | *:-) cat >"$tmp/stdin";; esac ;; esac ac_dir=`$as_dirname -- "$ac_file" || $as_expr X"$ac_file" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ X"$ac_file" : 'X\(//\)[^/]' \| \ X"$ac_file" : 'X\(//\)$' \| \ X"$ac_file" : 'X\(/\)' \| . 2>/dev/null || echo X"$ac_file" | sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/ q } /^X\(\/\/\)[^/].*/{ s//\1/ q } /^X\(\/\/\)$/{ s//\1/ q } /^X\(\/\).*/{ s//\1/ q } s/.*/./; q'` { as_dir="$ac_dir" case $as_dir in #( -*) as_dir=./$as_dir;; esac test -d "$as_dir" || { $as_mkdir_p && mkdir -p "$as_dir"; } || { as_dirs= while :; do case $as_dir in #( *\'*) as_qdir=`echo "$as_dir" | sed "s/'/'\\\\\\\\''/g"`;; #( *) as_qdir=$as_dir;; esac as_dirs="'$as_qdir' $as_dirs" as_dir=`$as_dirname -- "$as_dir" || $as_expr X"$as_dir" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ X"$as_dir" : 'X\(//\)[^/]' \| \ X"$as_dir" : 'X\(//\)$' \| \ X"$as_dir" : 'X\(/\)' \| . 2>/dev/null || echo X"$as_dir" | sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/ q } /^X\(\/\/\)[^/].*/{ s//\1/ q } /^X\(\/\/\)$/{ s//\1/ q } /^X\(\/\).*/{ s//\1/ q } s/.*/./; q'` test -d "$as_dir" && break done test -z "$as_dirs" || eval "mkdir $as_dirs" } || test -d "$as_dir" || { { echo "$as_me:$LINENO: error: cannot create directory $as_dir" >&5 echo "$as_me: error: cannot create directory $as_dir" >&2;} { (exit 1); exit 1; }; }; } ac_builddir=. case "$ac_dir" in .) ac_dir_suffix= ac_top_builddir_sub=. ac_top_build_prefix= ;; *) ac_dir_suffix=/`echo "$ac_dir" | sed 's,^\.[\\/],,'` # A ".." for each directory in $ac_dir_suffix. ac_top_builddir_sub=`echo "$ac_dir_suffix" | sed 's,/[^\\/]*,/..,g;s,/,,'` case $ac_top_builddir_sub in "") ac_top_builddir_sub=. ac_top_build_prefix= ;; *) ac_top_build_prefix=$ac_top_builddir_sub/ ;; esac ;; esac ac_abs_top_builddir=$ac_pwd ac_abs_builddir=$ac_pwd$ac_dir_suffix # for backward compatibility: ac_top_builddir=$ac_top_build_prefix case $srcdir in .) # We are building in place. ac_srcdir=. ac_top_srcdir=$ac_top_builddir_sub ac_abs_top_srcdir=$ac_pwd ;; [\\/]* | ?:[\\/]* ) # Absolute name. ac_srcdir=$srcdir$ac_dir_suffix; ac_top_srcdir=$srcdir ac_abs_top_srcdir=$srcdir ;; *) # Relative name. ac_srcdir=$ac_top_build_prefix$srcdir$ac_dir_suffix ac_top_srcdir=$ac_top_build_prefix$srcdir ac_abs_top_srcdir=$ac_pwd/$srcdir ;; esac ac_abs_srcdir=$ac_abs_top_srcdir$ac_dir_suffix case $ac_mode in :F) # # CONFIG_FILE # case $INSTALL in [\\/$]* | ?:[\\/]* ) ac_INSTALL=$INSTALL ;; *) ac_INSTALL=$ac_top_build_prefix$INSTALL ;; esac _ACEOF cat >>$CONFIG_STATUS <<\_ACEOF # If the template does not know about datarootdir, expand it. # FIXME: This hack should be removed a few years after 2.60. ac_datarootdir_hack=; ac_datarootdir_seen= case `sed -n '/datarootdir/ { p q } /@datadir@/p /@docdir@/p /@infodir@/p /@localedir@/p /@mandir@/p ' $ac_file_inputs` in *datarootdir*) ac_datarootdir_seen=yes;; *@datadir@*|*@docdir@*|*@infodir@*|*@localedir@*|*@mandir@*) { echo "$as_me:$LINENO: WARNING: $ac_file_inputs seems to ignore the --datarootdir setting" >&5 echo "$as_me: WARNING: $ac_file_inputs seems to ignore the --datarootdir setting" >&2;} _ACEOF cat >>$CONFIG_STATUS <<_ACEOF ac_datarootdir_hack=' s&@datadir@&$datadir&g s&@docdir@&$docdir&g s&@infodir@&$infodir&g s&@localedir@&$localedir&g s&@mandir@&$mandir&g s&\\\${datarootdir}&$datarootdir&g' ;; esac _ACEOF # Neutralize VPATH when `$srcdir' = `.'. # Shell code in configure.ac might set extrasub. # FIXME: do we really want to maintain this feature? cat >>$CONFIG_STATUS <<_ACEOF sed "$ac_vpsub $extrasub _ACEOF cat >>$CONFIG_STATUS <<\_ACEOF :t /@[a-zA-Z_][a-zA-Z_0-9]*@/!b s&@configure_input@&$configure_input&;t t s&@top_builddir@&$ac_top_builddir_sub&;t t s&@srcdir@&$ac_srcdir&;t t s&@abs_srcdir@&$ac_abs_srcdir&;t t s&@top_srcdir@&$ac_top_srcdir&;t t s&@abs_top_srcdir@&$ac_abs_top_srcdir&;t t s&@builddir@&$ac_builddir&;t t s&@abs_builddir@&$ac_abs_builddir&;t t s&@abs_top_builddir@&$ac_abs_top_builddir&;t t s&@INSTALL@&$ac_INSTALL&;t t $ac_datarootdir_hack " $ac_file_inputs | sed -f "$tmp/subs-1.sed" | sed -f "$tmp/subs-2.sed" >$tmp/out test -z "$ac_datarootdir_hack$ac_datarootdir_seen" && { ac_out=`sed -n '/\${datarootdir}/p' "$tmp/out"`; test -n "$ac_out"; } && { ac_out=`sed -n '/^[ ]*datarootdir[ ]*:*=/p' "$tmp/out"`; test -z "$ac_out"; } && { echo "$as_me:$LINENO: WARNING: $ac_file contains a reference to the variable \`datarootdir' which seems to be undefined. Please make sure it is defined." >&5 echo "$as_me: WARNING: $ac_file contains a reference to the variable \`datarootdir' which seems to be undefined. Please make sure it is defined." >&2;} rm -f "$tmp/stdin" case $ac_file in -) cat "$tmp/out"; rm -f "$tmp/out";; *) rm -f "$ac_file"; mv "$tmp/out" $ac_file;; esac ;; :H) # # CONFIG_HEADER # _ACEOF # Transform confdefs.h into a sed script `conftest.defines', that # substitutes the proper values into config.h.in to produce config.h. rm -f conftest.defines conftest.tail # First, append a space to every undef/define line, to ease matching. echo 's/$/ /' >conftest.defines # Then, protect against being on the right side of a sed subst, or in # an unquoted here document, in config.status. If some macros were # called several times there might be several #defines for the same # symbol, which is useless. But do not sort them, since the last # AC_DEFINE must be honored. ac_word_re=[_$as_cr_Letters][_$as_cr_alnum]* # These sed commands are passed to sed as "A NAME B PARAMS C VALUE D", where # NAME is the cpp macro being defined, VALUE is the value it is being given. # PARAMS is the parameter list in the macro definition--in most cases, it's # just an empty string. ac_dA='s,^\\([ #]*\\)[^ ]*\\([ ]*' ac_dB='\\)[ (].*,\\1define\\2' ac_dC=' ' ac_dD=' ,' uniq confdefs.h | sed -n ' t rset :rset s/^[ ]*#[ ]*define[ ][ ]*// t ok d :ok s/[\\&,]/\\&/g s/^\('"$ac_word_re"'\)\(([^()]*)\)[ ]*\(.*\)/ '"$ac_dA"'\1'"$ac_dB"'\2'"${ac_dC}"'\3'"$ac_dD"'/p s/^\('"$ac_word_re"'\)[ ]*\(.*\)/'"$ac_dA"'\1'"$ac_dB$ac_dC"'\2'"$ac_dD"'/p ' >>conftest.defines # Remove the space that was appended to ease matching. # Then replace #undef with comments. This is necessary, for # example, in the case of _POSIX_SOURCE, which is predefined and required # on some systems where configure will not decide to define it. # (The regexp can be short, since the line contains either #define or #undef.) echo 's/ $// s,^[ #]*u.*,/* & */,' >>conftest.defines # Break up conftest.defines: ac_max_sed_lines=50 # First sed command is: sed -f defines.sed $ac_file_inputs >"$tmp/out1" # Second one is: sed -f defines.sed "$tmp/out1" >"$tmp/out2" # Third one will be: sed -f defines.sed "$tmp/out2" >"$tmp/out1" # et cetera. ac_in='$ac_file_inputs' ac_out='"$tmp/out1"' ac_nxt='"$tmp/out2"' while : do # Write a here document: cat >>$CONFIG_STATUS <<_ACEOF # First, check the format of the line: cat >"\$tmp/defines.sed" <<\\CEOF /^[ ]*#[ ]*undef[ ][ ]*$ac_word_re[ ]*\$/b def /^[ ]*#[ ]*define[ ][ ]*$ac_word_re[( ]/b def b :def _ACEOF sed ${ac_max_sed_lines}q conftest.defines >>$CONFIG_STATUS echo 'CEOF sed -f "$tmp/defines.sed"' "$ac_in >$ac_out" >>$CONFIG_STATUS ac_in=$ac_out; ac_out=$ac_nxt; ac_nxt=$ac_in sed 1,${ac_max_sed_lines}d conftest.defines >conftest.tail grep . conftest.tail >/dev/null || break rm -f conftest.defines mv conftest.tail conftest.defines done rm -f conftest.defines conftest.tail echo "ac_result=$ac_in" >>$CONFIG_STATUS cat >>$CONFIG_STATUS <<\_ACEOF if test x"$ac_file" != x-; then echo "/* $configure_input */" >"$tmp/config.h" cat "$ac_result" >>"$tmp/config.h" if diff $ac_file "$tmp/config.h" >/dev/null 2>&1; then { echo "$as_me:$LINENO: $ac_file is unchanged" >&5 echo "$as_me: $ac_file is unchanged" >&6;} else rm -f $ac_file mv "$tmp/config.h" $ac_file fi else echo "/* $configure_input */" cat "$ac_result" fi rm -f "$tmp/out12" # Compute $ac_file's index in $config_headers. _am_stamp_count=1 for _am_header in $config_headers :; do case $_am_header in $ac_file | $ac_file:* ) break ;; * ) _am_stamp_count=`expr $_am_stamp_count + 1` ;; esac done echo "timestamp for $ac_file" >`$as_dirname -- $ac_file || $as_expr X$ac_file : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ X$ac_file : 'X\(//\)[^/]' \| \ X$ac_file : 'X\(//\)$' \| \ X$ac_file : 'X\(/\)' \| . 2>/dev/null || echo X$ac_file | sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/ q } /^X\(\/\/\)[^/].*/{ s//\1/ q } /^X\(\/\/\)$/{ s//\1/ q } /^X\(\/\).*/{ s//\1/ q } s/.*/./; q'`/stamp-h$_am_stamp_count ;; :C) { echo "$as_me:$LINENO: executing $ac_file commands" >&5 echo "$as_me: executing $ac_file commands" >&6;} ;; esac case $ac_file$ac_mode in "depfiles":C) test x"$AMDEP_TRUE" != x"" || for mf in $CONFIG_FILES; do # Strip MF so we end up with the name of the file. mf=`echo "$mf" | sed -e 's/:.*$//'` # Check whether this is an Automake generated Makefile or not. # We used to match only the files named `Makefile.in', but # some people rename them; so instead we look at the file content. # Grep'ing the first line is not enough: some people post-process # each Makefile.in and add a new line on top of each file to say so. # So let's grep whole file. if grep '^#.*generated by automake' $mf > /dev/null 2>&1; then dirpart=`$as_dirname -- "$mf" || $as_expr X"$mf" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ X"$mf" : 'X\(//\)[^/]' \| \ X"$mf" : 'X\(//\)$' \| \ X"$mf" : 'X\(/\)' \| . 2>/dev/null || echo X"$mf" | sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/ q } /^X\(\/\/\)[^/].*/{ s//\1/ q } /^X\(\/\/\)$/{ s//\1/ q } /^X\(\/\).*/{ s//\1/ q } s/.*/./; q'` else continue fi # Extract the definition of DEPDIR, am__include, and am__quote # from the Makefile without running `make'. DEPDIR=`sed -n 's/^DEPDIR = //p' < "$mf"` test -z "$DEPDIR" && continue am__include=`sed -n 's/^am__include = //p' < "$mf"` test -z "am__include" && continue am__quote=`sed -n 's/^am__quote = //p' < "$mf"` # When using ansi2knr, U may be empty or an underscore; expand it U=`sed -n 's/^U = //p' < "$mf"` # Find all dependency output files, they are included files with # $(DEPDIR) in their names. We invoke sed twice because it is the # simplest approach to changing $(DEPDIR) to its actual value in the # expansion. for file in `sed -n " s/^$am__include $am__quote\(.*(DEPDIR).*\)$am__quote"'$/\1/p' <"$mf" | \ sed -e 's/\$(DEPDIR)/'"$DEPDIR"'/g' -e 's/\$U/'"$U"'/g'`; do # Make sure the directory exists. test -f "$dirpart/$file" && continue fdir=`$as_dirname -- "$file" || $as_expr X"$file" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ X"$file" : 'X\(//\)[^/]' \| \ X"$file" : 'X\(//\)$' \| \ X"$file" : 'X\(/\)' \| . 2>/dev/null || echo X"$file" | sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/ q } /^X\(\/\/\)[^/].*/{ s//\1/ q } /^X\(\/\/\)$/{ s//\1/ q } /^X\(\/\).*/{ s//\1/ q } s/.*/./; q'` { as_dir=$dirpart/$fdir case $as_dir in #( -*) as_dir=./$as_dir;; esac test -d "$as_dir" || { $as_mkdir_p && mkdir -p "$as_dir"; } || { as_dirs= while :; do case $as_dir in #( *\'*) as_qdir=`echo "$as_dir" | sed "s/'/'\\\\\\\\''/g"`;; #( *) as_qdir=$as_dir;; esac as_dirs="'$as_qdir' $as_dirs" as_dir=`$as_dirname -- "$as_dir" || $as_expr X"$as_dir" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ X"$as_dir" : 'X\(//\)[^/]' \| \ X"$as_dir" : 'X\(//\)$' \| \ X"$as_dir" : 'X\(/\)' \| . 2>/dev/null || echo X"$as_dir" | sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/ q } /^X\(\/\/\)[^/].*/{ s//\1/ q } /^X\(\/\/\)$/{ s//\1/ q } /^X\(\/\).*/{ s//\1/ q } s/.*/./; q'` test -d "$as_dir" && break done test -z "$as_dirs" || eval "mkdir $as_dirs" } || test -d "$as_dir" || { { echo "$as_me:$LINENO: error: cannot create directory $as_dir" >&5 echo "$as_me: error: cannot create directory $as_dir" >&2;} { (exit 1); exit 1; }; }; } # echo "creating $dirpart/$file" echo '# dummy' > "$dirpart/$file" done done ;; esac done # for ac_tag { (exit 0); exit 0; } _ACEOF chmod +x $CONFIG_STATUS ac_clean_files=$ac_clean_files_save # configure is writing to config.log, and then calls config.status. # config.status does its own redirection, appending to config.log. # Unfortunately, on DOS this fails, as config.log is still kept open # by configure, so config.status won't be able to write to it; its # output is simply discarded. So we exec the FD to /dev/null, # effectively closing config.log, so it can be properly (re)opened and # appended to by config.status. When coming back to configure, we # need to make the FD available again. if test "$no_create" != yes; then ac_cs_success=: ac_config_status_args= test "$silent" = yes && ac_config_status_args="$ac_config_status_args --quiet" exec 5>/dev/null $SHELL $CONFIG_STATUS $ac_config_status_args || ac_cs_success=false exec 5>>config.log # Use ||, not &&, to avoid exiting from the if with $? = 1, which # would make configure fail if this is the last instruction. $ac_cs_success || { (exit 1); exit 1; } fi case $program_transform_name in s,x,x,) ;; *) { echo "$as_me:$LINENO: WARNING: Do not rely on --program-prefix, --program-suffix or --program-transform-name!" >&5 echo "$as_me: WARNING: Do not rely on --program-prefix, --program-suffix or --program-transform-name!" >&2;} ;; esac jupp/configure.ac010064400000000000000000000215621431513412400112550ustar00# $MirOS: contrib/code/jupp/configure.ac,v 1.78 2022/09/28 21:10:17 tg Exp $ #- # Process this file with autoconf to produce a configure script. # We need AC_PROG_EGREP AC_PREREQ(2.54) #### Here's the only place where to change version number #### AC_INIT(joe, 3.1jupp41) #### But see main.c for the Copyright (c) owner and year! #### AC_CONFIG_SRCDIR([b.c]) AC_CANONICAL_BUILD AC_CANONICAL_HOST AC_CANONICAL_TARGET # Init automake AM_INIT_AUTOMAKE AM_MAINTAINER_MODE AM_CONFIG_HEADER(autoconf.h) # Checks for programs. AC_PROG_CC AC_PROG_CPP AC_PROG_EGREP AC_PROG_INSTALL AC_PROG_LN_S case $host in *-*-minix*) CPPFLAGS="$CPPFLAGS -D_POSIX_SOURCE -D_POSIX_1_SOURCE=2 -D_MINIX" ;; *-gnu*) CPPFLAGS="$CPPFLAGS -D_GNU_SOURCE" ;; esac case $host in *-*-mirbsd* | *-*-openbsd*) AC_DEFINE(HAVE_GCC_ATTRIBUTE_BOUNDED, 1, [Define if GCC has Anil's bounds checker]) ;; esac # Checks for libraries. search_libs_selinux="selinux" search_libs_snprintf="snprintf db" search_libs_term="" search_libs_util="util" AC_ARG_ENABLE(curses, [ --disable-curses disable use of curses library], curses=$enableval, curses=yes) test x"$curses" = x"yes" && \ search_libs_term="$search_libs_term tinfo ncursesw ncurses curses" AC_ARG_ENABLE(termcap, [ --disable-termcap disable use of termcap library], termcap=$enableval, termcap=yes) test x"$termcap" = x"yes" && \ search_libs_term="$search_libs_term termcap" AC_ARG_ENABLE(terminfo, [ --disable-terminfo disable use of terminfo functions], terminfo=$enableval, terminfo=yes) AC_ARG_ENABLE(selinux, [ --disable-selinux disable SELinux context copying], selinux=$enableval, selinux=yes) AC_ARG_ENABLE([search_libs], [ --disable-search-libs do not search in any external libraries], search_libs=$enableval, search_libs=yes) if test x"$search_libs" = x"no"; then search_libs_selinux="" search_libs_snprintf="" search_libs_term="" search_libs_util="" fi AC_SEARCH_LIBS(openpty, $search_libs_util, AC_DEFINE_UNQUOTED(HAVE_OPENPTY, 1, [If we have BSD function openpty()])) AC_SEARCH_LIBS(login_tty, $search_libs_util, AC_DEFINE_UNQUOTED(HAVE_LOGIN_TTY, 1, [If we have BSD function login_tty()])) if test x"$terminfo" = x"no"; then echo "DISabling looking for terminal libraries entirely!" else AC_SEARCH_LIBS(tgetflag, $search_libs_term, AC_DEFINE_UNQUOTED(TERMINFO, 1, [If we have newer terminfo/termcap capabilities])) fi AC_SEARCH_LIBS(snprintf, $search_libs_snprintf, AC_DEFINE_UNQUOTED(HAVE_SNPRINTF, 1, [If we have snprintf])) if test x"$selinux" = x"no"; then echo "DISabling looking for SELinux support" else AC_SEARCH_LIBS(is_selinux_enabled, $search_libs_selinux, AC_DEFINE_UNQUOTED(HAVE_SELINUX_FUN, 1, [We have SELinux functions])) fi # other conditionals AC_ARG_ENABLE([getpwnam], [ --disable-getpwnam disable use of getpwnam function], getpwnam=$enableval, getpwnam=yes) test x"$getpwnam" = x"no" && CPPFLAGS="$CPPFLAGS -DJOE_NOPWNAM" AC_ARG_ENABLE([termidx], [ --disable-termidx do not build the termidx binary], termidx=$enableval, termidx=yes) AM_CONDITIONAL([WANT_TERMIDX], [test x"$termidx" != x"no"]) AC_ARG_ENABLE([sysconfjoesubdir], [ --enable-sysconfjoesubdir=/joe (default value)], [sysconfjoesubdir=$enableval], [sysconfjoesubdir=yes]) if test x"$sysconfjoesubdir" = x"yes"; then sysconfjoesubdir=/joe elif test x"$sysconfjoesubdir" = x"no"; then sysconfjoesubdir= fi AC_SUBST(sysconfjoesubdir) AC_ARG_ENABLE([win32reloc], [ --enable-win32reloc enable win32 self-relocation], [win32reloc=$enableval], [win32reloc=no]) if test x"$win32reloc" = x"yes"; then JUPP_WIN32RELOC=1 else JUPP_WIN32RELOC=0 fi AC_DEFINE_UNQUOTED([JUPP_WIN32RELOC], [$JUPP_WIN32RELOC], [Use Win32 argv0-relative paths?]) if test x"$win32reloc" = x"yes"; then joeinitfile='\\fBjoerc\\fR in the same directory as the binary resides in' joeinitcopy='which resides in the same directory as the binary' joeresides='C:\\eProgramme\\ejupp32\\ejoe.exe' jrcbefore='' jrcafter=' in the same directory as the binary' elif test x"$win32reloc" = x"old"; then joeinitfile='\\fBc:/windows/system32/joe/joerc\\fR' joeinitcopy='which resides in \\fBc:/windows/system32/joe/joerc\\fR' joeresides='c:/windows/system32/joe.exe' jrcbefore='c:/windows/system32/joe/' jrcafter='' else joeinitfile='usually \\fB'$sysconfdir$sysconfjoesubdir'/joerc\\fR' joeinitcopy='which normally resides in \\fB'$sysconfdir$sysconfjoesubdir'/joerc\\fR' joeresides=$bindir'/joe' jrcbefore=$sysconfdir$sysconfjoesubdir/ jrcafter='' fi AC_SUBST(joeinitfile) AC_SUBST(joeinitcopy) AC_SUBST(joeresides) AC_SUBST(jrcbefore) AC_SUBST(jrcafter) # Checks for header files. AC_CHECK_HEADERS([ \ sys/dirent.h sys/ioctl.h sys/param.h sys/stat.h sys/termio.h \ sys/time.h sys/types.h sys/wait.h errno.h fcntl.h \ langinfo.h limits.h locale.h paths.h pty.h pwd.h sgtty.h signal.h \ stdlib.h string.h termio.h time.h unistd.h util.h utime.h \ utmp.h bsd/string.h selinux/context.h selinux/selinux.h \ ]) AC_HEADER_DIRENT AC_SYS_POSIX_TERMIOS if test "$ac_cv_sys_posix_termios" = "yes"; then AC_DEFINE(HAVE_POSIX_TERMIOS, 1, [We have and maybe ]) else if test "$ac_cv_header_termio_h" = "yes" -a "$ac_cvs_header_sys_termio_h" = "yes" ]; then AC_DEFINE(HAVE_SYSV_TERMIO, 1, [We have and ]) fi fi AC_HEADER_TIOCGWINSZ AC_HEADER_TIME # Checks for typedefs, structures, and compiler characteristics. AC_C_CONST AC_SYS_LARGEFILE if test "$cross_compiling" = "yes" ; then AC_MSG_WARN(cross compiling so assuming defaults for most 32 bit machines) fi AC_CHECK_SIZEOF(char, 1) AC_CHECK_SIZEOF(short, 2) AC_CHECK_SIZEOF(int, 4) AC_CHECK_SIZEOF(long, 4) AC_CHECK_SIZEOF(void *, 4) AC_CHECK_SIZEOF(long long, 8) AC_CHECK_SIZEOF(off_t, 8) AC_CHECK_TYPE([sighandler_t], [AC_DEFINE([HAVE_SIGHANDLER_T], 1, [Define if you have the `sighandler_t' type.])], , [/* if you have signal.h header, include it */ #ifdef HAVE_SIGNAL_H #include #endif]) # Checks for library functions. AC_PROG_GCC_TRADITIONAL AC_FUNC_FSEEKO AC_FUNC_LSTAT joe_SETPGRP AC_TYPE_PID_T AC_TYPE_SIZE_T AC_CHECK_TYPE([ssize_t], [], [ AC_DEFINE([ssize_t], [int], [Define to `int' if does not define.]) ], []) AC_TYPE_SIGNAL AC_FUNC_STAT AC_CHECK_FUNCS([getcwd getwd]) if test x"$ac_cv_func_getcwd" != xyes; then if test x"$ac_cv_func_getwd" != xyes; then AC_MSG_ERROR([don't know how to get current working directory]) fi fi AC_CHECK_FUNCS([alarm ctime fsync get_current_dir_name isatty mkdir mkstemp]) AC_CHECK_FUNCS([nl_langinfo popen putenv setitimer setlocale setpgid]) AC_CHECK_FUNCS([sigaction siginterrupt sigprocmask sigvec strchr strdup]) AC_CHECK_FUNCS([strlcat strlcpy sync utime]) AC_ARG_ENABLE([fork], [ --disable-fork disable use of fork], use_fork=$enableval, use_fork=yes) test x"$use_fork" = x"no" && ac_cv_func_fork=no AC_CHECK_FUNCS([fork unsetenv]) case $use_fork:$ac_cv_func_fork in no:*) use_fork=0 ;; *:yes) use_fork=1 ;; *) use_fork=0 ;; esac AC_DEFINE_UNQUOTED([WANT_FORK], [$use_fork], [We have fork(2) and want to use it]) if test $use_fork = 1; then echo "Enabling use of fork(), concurrent subshells, etc." else echo "DISabling use of fork() and concurrent subshells (NOMMU)!" fi AC_ARG_ENABLE([fpu], [ --disable-fpu disable use of floating point arithmetics], use_fpu=$enableval, use_fpu=yes) if test x"$use_fpu" = x"no"; then use_fpu=0 else use_fpu=1 fi AC_DEFINE_UNQUOTED([WANT_MATH], [$use_fpu], [Can we use the FPU?]) if test $use_fpu = 1; then echo "Enabling use of floating point arithmetics" else echo "DISabling Math support for lack of an FPU!" fi AC_ARG_ENABLE([small], [ --enable-small reduce memory footprint by a few KiB], use_small=$enableval, use_small=no) if test x"$use_small" = x"yes"; then # for constrained systems (like 8 MiB RAM total) only AC_DEFINE([SMALL], [1], [Reduce memory footprint slightly]) fi AC_CHECK_DECLS([strlcpy, strlcat, popen]) AC_CHECK_DECLS([ctime], [], [], [AC_INCLUDES_DEFAULT #ifdef TIME_WITH_SYS_TIME # include # include #else # ifdef HAVE_SYS_TIME_H # include # else # include # endif #endif ]) joe_REINSTALL_SIGHANDLERS # Check for programs.. AC_CHECK_PROG(SPELL,aspell,aspell,ispell) # strictly speaking, the .jsf files should have no substitutions, # as they don’t do what you think they expand, currently it’s more # expensive however to rename them in CVS, so we keep that until # jupp has converted to mirtoconf AC_CONFIG_FILES([Makefile syntax/c.jsf syntax/perl.jsf syntax/verilog.jsf syntax/sh.jsf syntax/python.jsf syntax/conf.jsf syntax/php.jsf syntax/mail.jsf syntax/pascal.jsf syntax/html.jsf syntax/vhdl.jsf syntax/fortran.jsf syntax/java.jsf syntax/xml.jsf syntax/tcl.jsf charmaps/klingon syntax/lisp.jsf syntax/csh.jsf syntax/mason.jsf syntax/diff.jsf syntax/asm.jsf syntax/tex.jsf]) AC_OUTPUT case $program_transform_name in s,x,x,) ;; *) AC_MSG_WARN([Do not rely on --program-prefix, --program-suffix or --program-transform-name!]) ;; esac jupp/depcomp010064400000000000000000000431431101233711200103310ustar00#! /bin/sh # $MirOS: contrib/code/jupp/depcomp,v 1.6 2008/05/13 16:13:39 tg Exp $ # $miros: contrib/gnu/automake/lib/depcomp,v 1.4 2008/05/02 23:31:52 tg Exp $ #- # depcomp - compile a program generating dependencies as side-effects scriptversion=2007-03-29.01 # Copyright (C) 1999, 2000, 2003, 2004, 2005, 2006, 2007 Free Software # Foundation, Inc. # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation; either version 2, or (at your option) # any later version. # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU General Public License for more details. # You should have received a copy of the GNU General Public License # along with this program; if not, write to the Free Software # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA # 02110-1301, USA. # As a special exception to the GNU General Public License, if you # distribute this file as part of a program that contains a # configuration script generated by Autoconf, you may include it under # the same distribution terms that you use for the rest of that program. # Originally written by Alexandre Oliva . case $1 in '') echo "$0: No command. Try \`$0 --help' for more information." 1>&2 exit 1; ;; -h | --h*) cat <<\EOF Usage: depcomp [--help] [--version] PROGRAM [ARGS] Run PROGRAMS ARGS to compile a file, generating dependencies as side-effects. Environment variables: depmode Dependency tracking mode. source Source file read by `PROGRAMS ARGS'. object Object file output by `PROGRAMS ARGS'. DEPDIR directory where to store dependencies. depfile Dependency file to output. tmpdepfile Temporary file to use when outputing dependencies. libtool Whether libtool is used (yes/no). Report bugs to . EOF exit $? ;; -v | --v*) echo "depcomp $scriptversion" exit $? ;; esac if test -z "$depmode" || test -z "$source" || test -z "$object"; then echo "depcomp: Variables source, object and depmode must be set" 1>&2 exit 1 fi # Dependencies for sub/bar.o or sub/bar.obj go into sub/.deps/bar.Po. depfile=${depfile-`echo "$object" | sed 's|[^\\/]*$|'${DEPDIR-.deps}'/&|;s|\.\([^.]*\)$|.P\1|;s|Pobj$|Po|'`} tmpdepfile=${tmpdepfile-`echo "$depfile" | sed 's/\.\([^.]*\)$/.T\1/'`} rm -f "$tmpdepfile" # Some modes work just like other modes, but use different flags. We # parameterize here, but still list the modes in the big case below, # to make depend.m4 easier to write. Note that we *cannot* use a case # here, because this file can only contain one case statement. if test "$depmode" = hp; then # HP compiler uses -M and no extra arg. gccflag=-M depmode=gcc fi if test "$depmode" = dashXmstdout; then # This is just like dashmstdout with a different argument. dashmflag=-xM depmode=dashmstdout fi case "$depmode" in gcc3) ## gcc 3 implements dependency tracking that does exactly what ## we want. Yay! Note: for some reason libtool 1.4 doesn't like ## it if -MD -MP comes after the -MF stuff. Hmm. ## Unfortunately, FreeBSD c89 acceptance of flags depends upon ## the command line argument order; so add the flags where they ## appear in depend2.am. Note that the slowdown incurred here ## affects only configure: in makefiles, %FASTDEP% shortcuts this. for arg do case $arg in -c) set fnord "$@" -MT "$object" -MD -MP -MF "$tmpdepfile" "$arg" ;; *) set fnord "$@" "$arg" ;; esac shift # fnord shift # $arg done "$@" stat=$? if test $stat -eq 0; then : else rm -f "$tmpdepfile" exit $stat fi mv "$tmpdepfile" "$depfile" ;; gcc) ## There are various ways to get dependency output from gcc. Here's ## why we pick this rather obscure method: ## - Don't want to use -MD because we'd like the dependencies to end ## up in a subdir. Having to rename by hand is ugly. ## (We might end up doing this anyway to support other compilers.) ## - The DEPENDENCIES_OUTPUT environment variable makes gcc act like ## -MM, not -M (despite what the docs say). ## - Using -M directly means running the compiler twice (even worse ## than renaming). if test -z "$gccflag"; then gccflag=-MD, fi "$@" -Wp,"$gccflag$tmpdepfile" stat=$? if test $stat -eq 0; then : else rm -f "$tmpdepfile" exit $stat fi rm -f "$depfile" echo "$object : \\" > "$depfile" alpha=ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz ## The second -e expression handles DOS-style file names with drive letters. sed -e 's/^[^:]*: / /' \ -e 's/^['$alpha']:\/[^:]*: / /' < "$tmpdepfile" >> "$depfile" ## This next piece of magic avoids the `deleted header file' problem. ## The problem is that when a header file which appears in a .P file ## is deleted, the dependency causes make to die (because there is ## typically no way to rebuild the header). We avoid this by adding ## dummy dependencies for each header file. Too bad gcc doesn't do ## this for us directly. tr ' ' ' ' < "$tmpdepfile" | ## Some versions of gcc put a space before the `:'. On the theory ## that the space means something, we add a space to the output as ## well. ## Some versions of the HPUX 10.20 sed can't process this invocation ## correctly. Breaking it into two sed invocations is a workaround. sed -e 's/^\\$//' -e '/^$/d' -e '/:$/d' | sed -e 's/$/ :/' >> "$depfile" rm -f "$tmpdepfile" ;; hp) # This case exists only to let depend.m4 do its work. It works by # looking at the text of this script. This case will never be run, # since it is checked for above. exit 1 ;; sgi) if test "$libtool" = yes; then "$@" "-Wp,-MDupdate,$tmpdepfile" else "$@" -MDupdate "$tmpdepfile" fi stat=$? if test $stat -eq 0; then : else rm -f "$tmpdepfile" exit $stat fi rm -f "$depfile" if test -f "$tmpdepfile"; then # yes, the sourcefile depend on other files echo "$object : \\" > "$depfile" # Clip off the initial element (the dependent). Don't try to be # clever and replace this with sed code, as IRIX sed won't handle # lines with more than a fixed number of characters (4096 in # IRIX 6.2 sed, 8192 in IRIX 6.5). We also remove comment lines; # the IRIX cc adds comments like `#:fec' to the end of the # dependency line. tr ' ' ' ' < "$tmpdepfile" \ | sed -e 's/^.*\.o://' -e 's/#.*$//' -e '/^$/ d' | \ tr ' ' ' ' >> $depfile echo >> $depfile # The second pass generates a dummy entry for each header file. tr ' ' ' ' < "$tmpdepfile" \ | sed -e 's/^.*\.o://' -e 's/#.*$//' -e '/^$/ d' -e 's/$/:/' \ >> $depfile else # The sourcefile does not contain any dependencies, so just # store a dummy comment line, to avoid errors with the Makefile # "include basename.Plo" scheme. echo "#dummy" > "$depfile" fi rm -f "$tmpdepfile" ;; aix) # The C for AIX Compiler uses -M and outputs the dependencies # in a .u file. In older versions, this file always lives in the # current directory. Also, the AIX compiler puts `$object:' at the # start of each line; $object doesn't have directory information. # Version 6 uses the directory in both cases. dir=`echo "$object" | sed -e 's|/[^/]*$|/|'` test "x$dir" = "x$object" && dir= base=`echo "$object" | sed -e 's|^.*/||' -e 's/\.o$//' -e 's/\.lo$//'` if test "$libtool" = yes; then tmpdepfile1=$dir$base.u tmpdepfile2=$base.u tmpdepfile3=$dir.libs/$base.u "$@" -Wc,-M else tmpdepfile1=$dir$base.u tmpdepfile2=$dir$base.u tmpdepfile3=$dir$base.u "$@" -M fi stat=$? if test $stat -eq 0; then : else rm -f "$tmpdepfile1" "$tmpdepfile2" "$tmpdepfile3" exit $stat fi for tmpdepfile in "$tmpdepfile1" "$tmpdepfile2" "$tmpdepfile3" do test -f "$tmpdepfile" && break done if test -f "$tmpdepfile"; then # Each line is of the form `foo.o: dependent.h'. # Do two passes, one to just change these to # `$object: dependent.h' and one to simply `dependent.h:'. sed -e "s,^.*\.[a-z]*:,$object:," < "$tmpdepfile" > "$depfile" # That's a tab and a space in the []. sed -e 's,^.*\.[a-z]*:[ ]*,,' -e 's,$,:,' < "$tmpdepfile" >> "$depfile" else # The sourcefile does not contain any dependencies, so just # store a dummy comment line, to avoid errors with the Makefile # "include basename.Plo" scheme. echo "#dummy" > "$depfile" fi rm -f "$tmpdepfile" ;; icc) # Intel's C compiler understands `-MD -MF file'. However on # icc -MD -MF foo.d -c -o sub/foo.o sub/foo.c # ICC 7.0 will fill foo.d with something like # foo.o: sub/foo.c # foo.o: sub/foo.h # which is wrong. We want: # sub/foo.o: sub/foo.c # sub/foo.o: sub/foo.h # sub/foo.c: # sub/foo.h: # ICC 7.1 will output # foo.o: sub/foo.c sub/foo.h # and will wrap long lines using \ : # foo.o: sub/foo.c ... \ # sub/foo.h ... \ # ... "$@" -MD -MF "$tmpdepfile" stat=$? if test $stat -eq 0; then : else rm -f "$tmpdepfile" exit $stat fi rm -f "$depfile" # Each line is of the form `foo.o: dependent.h', # or `foo.o: dep1.h dep2.h \', or ` dep3.h dep4.h \'. # Do two passes, one to just change these to # `$object: dependent.h' and one to simply `dependent.h:'. sed "s,^[^:]*:,$object :," < "$tmpdepfile" > "$depfile" # Some versions of the HPUX 10.20 sed can't process this invocation # correctly. Breaking it into two sed invocations is a workaround. sed 's,^[^:]*: \(.*\)$,\1,;s/^\\$//;/^$/d;/:$/d' < "$tmpdepfile" | sed -e 's/$/ :/' >> "$depfile" rm -f "$tmpdepfile" ;; hp2) # The "hp" stanza above does not work with aCC (C++) and HP's ia64 # compilers, which have integrated preprocessors. The correct option # to use with these is +Maked; it writes dependencies to a file named # 'foo.d', which lands next to the object file, wherever that # happens to be. # Much of this is similar to the tru64 case; see comments there. dir=`echo "$object" | sed -e 's|/[^/]*$|/|'` test "x$dir" = "x$object" && dir= base=`echo "$object" | sed -e 's|^.*/||' -e 's/\.o$//' -e 's/\.lo$//'` if test "$libtool" = yes; then tmpdepfile1=$dir$base.d tmpdepfile2=$dir.libs/$base.d "$@" -Wc,+Maked else tmpdepfile1=$dir$base.d tmpdepfile2=$dir$base.d "$@" +Maked fi stat=$? if test $stat -eq 0; then : else rm -f "$tmpdepfile1" "$tmpdepfile2" exit $stat fi for tmpdepfile in "$tmpdepfile1" "$tmpdepfile2" do test -f "$tmpdepfile" && break done if test -f "$tmpdepfile"; then sed -e "s,^.*\.[a-z]*:,$object:," "$tmpdepfile" > "$depfile" # Add `dependent.h:' lines. sed -ne '2,${; s/^ *//; s/ \\*$//; s/$/:/; p;}' "$tmpdepfile" >> "$depfile" else echo "#dummy" > "$depfile" fi rm -f "$tmpdepfile" "$tmpdepfile2" ;; tru64) # The Tru64 compiler uses -MD to generate dependencies as a side # effect. `cc -MD -o foo.o ...' puts the dependencies into `foo.o.d'. # At least on Alpha/Redhat 6.1, Compaq CCC V6.2-504 seems to put # dependencies in `foo.d' instead, so we check for that too. # Subdirectories are respected. dir=`echo "$object" | sed -e 's|/[^/]*$|/|'` test "x$dir" = "x$object" && dir= base=`echo "$object" | sed -e 's|^.*/||' -e 's/\.o$//' -e 's/\.lo$//'` if test "$libtool" = yes; then # With Tru64 cc, shared objects can also be used to make a # static library. This mechanism is used in libtool 1.4 series to # handle both shared and static libraries in a single compilation. # With libtool 1.4, dependencies were output in $dir.libs/$base.lo.d. # # With libtool 1.5 this exception was removed, and libtool now # generates 2 separate objects for the 2 libraries. These two # compilations output dependencies in $dir.libs/$base.o.d and # in $dir$base.o.d. We have to check for both files, because # one of the two compilations can be disabled. We should prefer # $dir$base.o.d over $dir.libs/$base.o.d because the latter is # automatically cleaned when .libs/ is deleted, while ignoring # the former would cause a distcleancheck panic. tmpdepfile1=$dir.libs/$base.lo.d # libtool 1.4 tmpdepfile2=$dir$base.o.d # libtool 1.5 tmpdepfile3=$dir.libs/$base.o.d # libtool 1.5 tmpdepfile4=$dir.libs/$base.d # Compaq CCC V6.2-504 "$@" -Wc,-MD else tmpdepfile1=$dir$base.o.d tmpdepfile2=$dir$base.d tmpdepfile3=$dir$base.d tmpdepfile4=$dir$base.d "$@" -MD fi stat=$? if test $stat -eq 0; then : else rm -f "$tmpdepfile1" "$tmpdepfile2" "$tmpdepfile3" "$tmpdepfile4" exit $stat fi for tmpdepfile in "$tmpdepfile1" "$tmpdepfile2" "$tmpdepfile3" "$tmpdepfile4" do test -f "$tmpdepfile" && break done if test -f "$tmpdepfile"; then sed -e "s,^.*\.[a-z]*:,$object:," < "$tmpdepfile" > "$depfile" # That's a tab and a space in the []. sed -e 's,^.*\.[a-z]*:[ ]*,,' -e 's,$,:,' < "$tmpdepfile" >> "$depfile" else echo "#dummy" > "$depfile" fi rm -f "$tmpdepfile" ;; #nosideeffect) # This comment above is used by automake to tell side-effect # dependency tracking mechanisms from slower ones. dashmstdout) # Important note: in order to support this mode, a compiler *must* # always write the preprocessed file to stdout, regardless of -o. "$@" || exit $? # Remove the call to Libtool. if test "$libtool" = yes; then while test $1 != '--mode=compile'; do shift done shift fi # Remove `-o $object'. IFS=" " for arg do case $arg in -o) shift ;; $object) shift ;; *) set fnord "$@" "$arg" shift # fnord shift # $arg ;; esac done test -z "$dashmflag" && dashmflag=-M # Require at least two characters before searching for `:' # in the target name. This is to cope with DOS-style filenames: # a dependency such as `c:/foo/bar' could be seen as target `c' otherwise. "$@" $dashmflag | sed 's:^[ ]*[^: ][^:][^:]*\:[ ]*:'"$object"'\: :' > "$tmpdepfile" rm -f "$depfile" cat < "$tmpdepfile" > "$depfile" tr ' ' ' ' < "$tmpdepfile" | \ ## Some versions of the HPUX 10.20 sed can't process this invocation ## correctly. Breaking it into two sed invocations is a workaround. sed -e 's/^\\$//' -e '/^$/d' -e '/:$/d' | sed -e 's/$/ :/' >> "$depfile" rm -f "$tmpdepfile" ;; dashXmstdout) # This case only exists to satisfy depend.m4. It is never actually # run, as this mode is specially recognized in the preamble. exit 1 ;; makedepend) "$@" || exit $? # Remove any Libtool call if test "$libtool" = yes; then while test $1 != '--mode=compile'; do shift done shift fi # X makedepend shift cleared=no for arg in "$@"; do case $cleared in no) set ""; shift cleared=yes ;; esac case "$arg" in -D*|-I*) set fnord "$@" "$arg"; shift ;; # Strip any option that makedepend may not understand. Remove # the object too, otherwise makedepend will parse it as a source file. -*|$object) ;; *) set fnord "$@" "$arg"; shift ;; esac done obj_suffix="`echo $object | sed 's/^.*\././'`" touch "$tmpdepfile" ${MAKEDEPEND-makedepend} -o"$obj_suffix" -f"$tmpdepfile" "$@" rm -f "$depfile" cat < "$tmpdepfile" > "$depfile" sed '1,2d' "$tmpdepfile" | tr ' ' ' ' | \ ## Some versions of the HPUX 10.20 sed can't process this invocation ## correctly. Breaking it into two sed invocations is a workaround. sed -e 's/^\\$//' -e '/^$/d' -e '/:$/d' | sed -e 's/$/ :/' >> "$depfile" rm -f "$tmpdepfile" "$tmpdepfile".bak ;; cpp) # Important note: in order to support this mode, a compiler *must* # always write the preprocessed file to stdout. "$@" || exit $? # Remove the call to Libtool. if test "$libtool" = yes; then while test $1 != '--mode=compile'; do shift done shift fi # Remove `-o $object'. IFS=" " for arg do case $arg in -o) shift ;; $object) shift ;; *) set fnord "$@" "$arg" shift # fnord shift # $arg ;; esac done "$@" -E | sed -n -e '/^# [0-9][0-9]* "\([^"]*\)".*/ s:: \1 \\:p' \ -e '/^#line [0-9][0-9]* "\([^"]*\)".*/ s:: \1 \\:p' | sed '$ s: \\$::' > "$tmpdepfile" rm -f "$depfile" echo "$object : \\" > "$depfile" cat < "$tmpdepfile" >> "$depfile" sed < "$tmpdepfile" '/^$/d;s/^ //;s/ \\$//;s/$/ :/' >> "$depfile" rm -f "$tmpdepfile" ;; msvisualcpp) # Important note: in order to support this mode, a compiler *must* # always write the preprocessed file to stdout, regardless of -o, # because we must use -o when running libtool. "$@" || exit $? IFS=" " for arg do case "$arg" in "-Gm"|"/Gm"|"-Gi"|"/Gi"|"-ZI"|"/ZI") set fnord "$@" shift shift ;; *) set fnord "$@" "$arg" shift shift ;; esac done "$@" -E | sed -n '/^#line [0-9][0-9]* "\([^"]*\)"/ s::echo "`cygpath -u \\"\1\\"`":p' | sort | uniq > "$tmpdepfile" rm -f "$depfile" echo "$object : \\" > "$depfile" . "$tmpdepfile" | sed 's% %\\ %g' | sed -n '/^\(.*\)$/ s:: \1 \\:p' >> "$depfile" echo " " >> "$depfile" . "$tmpdepfile" | sed 's% %\\ %g' | sed -n '/^\(.*\)$/ s::\1\::p' >> "$depfile" rm -f "$tmpdepfile" ;; none) exec "$@" ;; *) echo "Unknown depmode $depmode" 1>&2 exit 1 ;; esac exit 0 # Local Variables: # mode: shell-script # sh-indentation: 2 # eval: (add-hook 'write-file-hooks 'time-stamp) # time-stamp-start: "scriptversion=" # time-stamp-format: "%:y-%02m-%02d.%02H" # time-stamp-end: "$" # End: jupp/dir.c010064400000000000000000000014711321040537100077040ustar00/* * Directory package for older UNIXs * Copyright * (C) 1992 Joseph H. Allen * * This file is part of JOE (Joe's Own Editor) */ __RCSID("$MirOS: contrib/code/jupp/dir.c,v 1.3 2017/12/02 02:07:26 tg Exp $"); struct direct { short d_ino; unsigned char d_name[14]; }; void *opendir(unsigned char *name) { return fopen(name, "r"); } struct direct *readdir(void *f) { static struct direct direct; while (1 == fread(&direct, sizeof(struct direct), 1, (FILE *) f)) { if (direct.d_ino) { return &direct; } } return 0; } void closedir(FILE *f) { fclose(f); } int mkdir(unsigned char *s) { unsigned char *y = NULL; int rtval; y = vsncpy(sv(y), sc("/bin/mkdir ")); y = vsncpy(sv(y), sz(s)); y = vsncpy(sv(y), sc(" 2>/dev/null")); tickoff(); rtval = system(y); tickon(); vsrm(y); return rtval; } jupp/hash.c010064400000000000000000000024741364306522300100650ustar00/* * Simple hash table * Copyright * (C) 1992 Joseph H. Allen * * This file is part of JOE (Joe's Own Editor) */ #include "config.h" #include "types.h" __RCSID("$MirOS: contrib/code/jupp/hash.c,v 1.8 2020/04/07 11:56:40 tg Exp $"); #include #include #include "hash.h" #include "utils.h" #define hnext(accu,c) (((accu) << 4) + ((accu) >> 28) + (c)) static HENTRY *freentry = NULL; unsigned long hash(const unsigned char *s) { unsigned long accu = 0; while (*s) { accu = hnext(accu, *s++); } return accu; } HASH *htmk(int len) { HASH *t = malloc(sizeof(HASH)); t->len = len - 1; t->tab = calloc(len, sizeof(HENTRY *)); return t; } void htrm(HASH *ht) { free(ht->tab); free(ht); } void *htadd(HASH *ht, const unsigned char *name, void *val) { int idx = hash(name) & ht->len; HENTRY *entry; int x; if (!freentry) { entry = ralloc(64, sizeof(HENTRY)); for (x = 0; x != 64; ++x) { entry[x].next = freentry; freentry = entry + x; } } entry = freentry; freentry = entry->next; entry->next = ht->tab[idx]; ht->tab[idx] = entry; entry->name = name; return entry->val = val; } void *htfind(HASH *ht, const unsigned char *name) { HENTRY *e; for (e = ht->tab[hash(name) & ht->len]; e; e = e->next) { if (!strcmp(e->name, name)) { return e->val; } } return NULL; } jupp/hash.h010064400000000000000000000007541363731763300101010ustar00/* * Simple hash table * Copyright * (C) 1992 Joseph H. Allen * * This file is part of JOE (Joe's Own Editor) */ #ifndef JUPP_HASH_H #define JUPP_HASH_H #ifdef EXTERN_CMD_C __IDSTRING(rcsid_hash_h, "$MirOS: contrib/code/jupp/hash.h,v 1.7 2020/03/27 06:38:56 tg Exp $"); #endif unsigned long hash(const unsigned char *s); HASH *htmk(int len); void htrm(HASH *ht); void *htadd(HASH *ht, const unsigned char *name, void *val); void *htfind(HASH *ht, const unsigned char *name); #endif jupp/help.c010064400000000000000000000154101426610340500100610ustar00/* * Help system * Copyright * (C) 1992 Joseph H. Allen * (C) 2001 Marek 'Marx' Grac * Copyright © 2012, 2017, 2018 * mirabilos * * This file is part of JOE (Joe's Own Editor) */ #include "config.h" #include "types.h" __RCSID("$MirOS: contrib/code/jupp/help.c,v 1.20 2022/07/20 22:51:22 tg Exp $"); #include #include #ifdef HAVE_BSD_STRING_H #include #endif #include "blocks.h" #include "builtin.h" #include "help.h" #include "scrn.h" #include "utils.h" #include "vs.h" #include "utf8.h" #include "w.h" struct help *help_actual = NULL; /* actual help screen */ /* * Process help file */ void help_init(const unsigned char *filename) { JFILE *fd; /* help file */ unsigned char buf[1024]; /* input buffer */ struct help *tmp; char *cp; /* open the help file */ if (!(fd = jfopen(filename, "r"))) return; fprintf(stderr, "Processing '%s'...", filename); fflush(stderr); while (jfgets(buf, sizeof(buf), fd)) { if (buf[0] == '{'/*}*/) { /* start of help screen */ tmp = calloc(1, sizeof(struct help)); /* drop newline */ buf[strlen(buf) - 1] = '\0'; tmp->name = (unsigned char *)strdup((char *)buf + 1); /* read text */ while (jfgets(buf, sizeof(buf), fd) && buf[0] != /*{*/'}') { tmp->text = vsncpy(sv(tmp->text), sz(buf)); ++tmp->lines; } /* end of help screen */ if (buf[0] != /*{*/'}') { fprintf(stderr, /*{*/ "\nHelp file '%s' is not properly ended with } on new line.\nDo you want to accept incomplete help screen (y,n)? ", filename); fflush(stderr); if (!fgets((char *)buf, sizeof(buf), stdin) || (buf[0] | 0x20) != 'y') { vsrm(tmp->text); free(tmp->name); free(tmp); goto out; } } /* intern string to save memory */ if ((cp = strdup((char *)tmp->text))) { vsrm(tmp->text); tmp->text = (unsigned char *)cp; } /* set new help screen as actual one */ tmp->prev = help_actual; if (help_actual) help_actual->next = tmp; help_actual = tmp; } } fprintf(stderr, " done\n"); out: /* close help file */ jfclose(fd); /* move to first help screen */ while (help_actual && help_actual->prev) help_actual = help_actual->prev; } /* * Find context help - find help entry with the same name */ struct help * find_context_help(const unsigned char *name) { struct help *tmp = help_actual; while (tmp->prev != NULL) /* find the first help entry */ tmp = tmp->prev; while (tmp != NULL && strcmp(tmp->name, name) != 0) tmp = tmp->next; return tmp; } /* * Display help text */ void help_display(SCREEN *t) { const unsigned char *str; int y, x, z; int atr = 0; if (help_actual) { str = help_actual->text; } else { str = UC ""; } for (y = skiptop; y != t->wind; ++y) { if (t->t->updtab[y]) { const unsigned char *start = str; int width=0; int nspans=0; int spanwidth; int spancount=0; int spanextra; /* First pass: count no. springs \| and determine minimum width */ while(*str && *str!='\n') if (*str++ == '\\') switch(*str) { case 'i': case 'I': case 'u': case 'U': case 'd': case 'D': case 'b': case 'B': case 'f': case 'F': ++str; break; case '|': ++str; ++nspans; break; case 0: break; default: ++str; ++width; } else ++width; str = start; /* Now calculate span width */ if (width >= t->w - 1 || nspans==0) { spanwidth = 0; spanextra = nspans; } else { spanwidth = ((t->w - 1) - width)/nspans; spanextra = nspans - ((t->w - 1) - width - nspans*spanwidth); } /* Second pass: display text */ for (x = 0; x != t->w - 1; ++x) { if (*str == '\n' || !*str) { if (eraeol(t->t, x, y)) { return; } else { break; } } else { if (*str == '\\') { switch (*++str) { case '|': ++str; for (z=0;z!=spanwidth;++z) outatr(locale_map,t->t,t->t->scrn+x+y*t->w+z,t->t->attr+x+y*t->w+z,x+z,y,' ',atr); if (spancount++ >= spanextra) { outatr(locale_map,t->t,t->t->scrn+x+y*t->w+z,t->t->attr+x+y*t->w+z,x+z,y,' ',atr); ++z; } x += z-1; continue; case 'i': case 'I': atr ^= INVERSE; ++str; --x; continue; case 'u': case 'U': atr ^= UNDERLINE; ++str; --x; continue; case 'd': case 'D': atr ^= DIM; ++str; --x; continue; case 'b': case 'B': atr ^= BOLD; ++str; --x; continue; case 'f': case 'F': atr ^= BLINK; ++str; --x; continue; case 0: --x; continue; } } outatr_help(t->t, t->t->scrn + x + y * t->w, t->t->attr + x + y * t->w, x, y, *str++, atr); } } atr = 0; t->t->updtab[y] = 0; } while (*str && *str != '\n') ++str; if (*str == '\n') ++str; } } /* * Show help screen */ int help_on(SCREEN *t) { if (help_actual) { t->wind = help_actual->lines + skiptop; if ((t->h - t->wind) < FITHEIGHT) { t->wind = t->h - FITHEIGHT; } if (t->wind < 0) { t->wind = skiptop; return -1; } wfit(t); msetI(t->t->updtab + skiptop, 1, t->wind); return 0; } else { return -1; } } /* * Hide help screen */ void help_off(SCREEN *t) { t->wind = skiptop; wfit(t); } /* * Show/hide current help screen */ int u_help(BASE *base) { W *w = base->parent; struct help *new_help; if (w->huh && (new_help = find_context_help(w->huh)) != NULL) { if (help_actual != new_help) { if (w->t->wind != skiptop) help_off(w->t); help_actual = new_help; /* prepare context help */ } } if (w->t->wind == skiptop) { return help_on(w->t); /* help screen is hidden, so show the actual one */ } else { help_off(w->t); /* hide actual help screen */ return 0; } } /* * Show next help screen (if it is possible) */ int u_help_next(BASE *base) { W *w = base->parent; if (help_actual && help_actual->next) { /* is there any next help screen? */ if (w->t->wind != skiptop) { help_off(w->t); /* if help screen was visible, then hide it */ } help_actual = help_actual->next; /* change to next help screen */ return help_on(w->t); /* show actual help screen */ } else { return -1; } } /* * Show previous help screen (if it is possible) */ int u_help_prev(BASE *base) { W *w = base->parent; if (help_actual && help_actual->prev) { /* is there any previous help screen? */ if (w->t->wind != skiptop) help_off(w->t); /* if help screen was visible, then hide it */ help_actual = help_actual->prev; /* change to previous help screen */ return help_on(w->t); /* show actual help screen */ } else { return -1; } } jupp/help.h010064400000000000000000000015311363731763300101000ustar00/* * Help system * Copyright * (C) 1992 Joseph H. Allen * (C) 2001 Marek 'Marx' Grac * * This file is part of JOE (Joe's Own Editor) */ #ifndef JUPP_HELP_H #define JUPP_HELP_H #ifdef EXTERN __IDSTRING(rcsid_help_h, "$MirOS: contrib/code/jupp/help.h,v 1.10 2020/03/27 06:38:56 tg Exp $"); #endif extern struct help *help_actual; void help_display(SCREEN *t); /* display text in help window */ void help_off(SCREEN *t); /* turn help off */ int help_on(SCREEN *t); /* turn help on */ void help_init(const unsigned char *filename); /* load help file */ struct help *find_context_help(const unsigned char *name); int u_help(BASE *base); /* toggle help on/off */ int u_helpcard(BASE *base); /* enable help at screen */ int u_help_next(BASE *base); /* goto next help screen */ int u_help_prev(BASE *base); /* goto prev help screen */ #endif jupp/i18n.c010064400000000000000000004142231431510124100077040ustar00#if 0 .if "0" == "1" #endif /* * Universal Coded Character Set/ISO-10646 functions for JOE * Copyright * (C) 1992 Joseph H. Allen * Copyright © 2014, 2017, 2020 * mirabilos * * This file is part of JOE (Joe's Own Editor) */ #include "config.h" #include __RCSID("$MirOS: contrib/code/jupp/i18n.c,v 1.41 2022/09/28 17:21:10 tg Exp $"); /*- * Parts Copyright © 1991–2022 Unicode, Inc. All rights reserved. * Distributed under the Terms of Use in: * https://www.unicode.org/copyright.html * * Permission is hereby granted, free of charge, to any person obtaining * a copy of the Unicode data files and any associated documentation * (the "Data Files") or Unicode software and any associated documentation * (the "Software") to deal in the Data Files or Software * without restriction, including without limitation the rights to use, * copy, modify, merge, publish, distribute, and/or sell copies of * the Data Files or Software, and to permit persons to whom the Data Files * or Software are furnished to do so, provided that either * (a) this copyright and permission notice appear with all copies * of the Data Files or Software, or * (b) this copyright and permission notice appear in associated * Documentation. * * THE DATA FILES AND SOFTWARE ARE PROVIDED "AS IS", WITHOUT WARRANTY OF * ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE * WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND * NONINFRINGEMENT OF THIRD PARTY RIGHTS. * IN NO EVENT SHALL THE COPYRIGHT HOLDER OR HOLDERS INCLUDED IN THIS * NOTICE BE LIABLE FOR ANY CLAIM, OR ANY SPECIAL INDIRECT OR CONSEQUENTIAL * DAMAGES, OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, * DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER * TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR * PERFORMANCE OF THE DATA FILES OR SOFTWARE. * * Except as contained in this notice, the name of a copyright holder * shall not be used in advertising or otherwise to promote the sale, * use or other dealings in these Data Files or Software without prior * written authorization of the copyright holder. */ #include "charmap.h" #include "utils.h" /* From: X11/xc/programs/xterm/wcwidth.c,v 1.10 */ struct mb_ucsrange { unsigned int beg; unsigned int end; }; static size_t mb_ucsbsearch(const struct mb_ucsrange arr[], size_t elems, unsigned int val); /* * Generated from the UCD 15.0.0 - see /usr/share/doc/legal/LICENCE-BSD - by * MirOS: contrib/code/Snippets/eawparse,v 1.15 2020/06/15 20:31:13 tg Exp $ */ static const struct mb_ucsrange mb_ucs_combining[] = { { 0x0300, 0x036F }, { 0x0483, 0x0489 }, { 0x0591, 0x05BD }, { 0x05BF, 0x05BF }, { 0x05C1, 0x05C2 }, { 0x05C4, 0x05C5 }, { 0x05C7, 0x05C7 }, { 0x0610, 0x061A }, { 0x061C, 0x061C }, { 0x064B, 0x065F }, { 0x0670, 0x0670 }, { 0x06D6, 0x06DC }, { 0x06DF, 0x06E4 }, { 0x06E7, 0x06E8 }, { 0x06EA, 0x06ED }, { 0x0711, 0x0711 }, { 0x0730, 0x074A }, { 0x07A6, 0x07B0 }, { 0x07EB, 0x07F3 }, { 0x07FD, 0x07FD }, { 0x0816, 0x0819 }, { 0x081B, 0x0823 }, { 0x0825, 0x0827 }, { 0x0829, 0x082D }, { 0x0859, 0x085B }, { 0x0898, 0x089F }, { 0x08CA, 0x08E1 }, { 0x08E3, 0x0902 }, { 0x093A, 0x093A }, { 0x093C, 0x093C }, { 0x0941, 0x0948 }, { 0x094D, 0x094D }, { 0x0951, 0x0957 }, { 0x0962, 0x0963 }, { 0x0981, 0x0981 }, { 0x09BC, 0x09BC }, { 0x09C1, 0x09C4 }, { 0x09CD, 0x09CD }, { 0x09E2, 0x09E3 }, { 0x09FE, 0x09FE }, { 0x0A01, 0x0A02 }, { 0x0A3C, 0x0A3C }, { 0x0A41, 0x0A42 }, { 0x0A47, 0x0A48 }, { 0x0A4B, 0x0A4D }, { 0x0A51, 0x0A51 }, { 0x0A70, 0x0A71 }, { 0x0A75, 0x0A75 }, { 0x0A81, 0x0A82 }, { 0x0ABC, 0x0ABC }, { 0x0AC1, 0x0AC5 }, { 0x0AC7, 0x0AC8 }, { 0x0ACD, 0x0ACD }, { 0x0AE2, 0x0AE3 }, { 0x0AFA, 0x0AFF }, { 0x0B01, 0x0B01 }, { 0x0B3C, 0x0B3C }, { 0x0B3F, 0x0B3F }, { 0x0B41, 0x0B44 }, { 0x0B4D, 0x0B4D }, { 0x0B55, 0x0B56 }, { 0x0B62, 0x0B63 }, { 0x0B82, 0x0B82 }, { 0x0BC0, 0x0BC0 }, { 0x0BCD, 0x0BCD }, { 0x0C00, 0x0C00 }, { 0x0C04, 0x0C04 }, { 0x0C3C, 0x0C3C }, { 0x0C3E, 0x0C40 }, { 0x0C46, 0x0C48 }, { 0x0C4A, 0x0C4D }, { 0x0C55, 0x0C56 }, { 0x0C62, 0x0C63 }, { 0x0C81, 0x0C81 }, { 0x0CBC, 0x0CBC }, { 0x0CBF, 0x0CBF }, { 0x0CC6, 0x0CC6 }, { 0x0CCC, 0x0CCD }, { 0x0CE2, 0x0CE3 }, { 0x0D00, 0x0D01 }, { 0x0D3B, 0x0D3C }, { 0x0D41, 0x0D44 }, { 0x0D4D, 0x0D4D }, { 0x0D62, 0x0D63 }, { 0x0D81, 0x0D81 }, { 0x0DCA, 0x0DCA }, { 0x0DD2, 0x0DD4 }, { 0x0DD6, 0x0DD6 }, { 0x0E31, 0x0E31 }, { 0x0E34, 0x0E3A }, { 0x0E47, 0x0E4E }, { 0x0EB1, 0x0EB1 }, { 0x0EB4, 0x0EBC }, { 0x0EC8, 0x0ECE }, { 0x0F18, 0x0F19 }, { 0x0F35, 0x0F35 }, { 0x0F37, 0x0F37 }, { 0x0F39, 0x0F39 }, { 0x0F71, 0x0F7E }, { 0x0F80, 0x0F84 }, { 0x0F86, 0x0F87 }, { 0x0F8D, 0x0F97 }, { 0x0F99, 0x0FBC }, { 0x0FC6, 0x0FC6 }, { 0x102D, 0x1030 }, { 0x1032, 0x1037 }, { 0x1039, 0x103A }, { 0x103D, 0x103E }, { 0x1058, 0x1059 }, { 0x105E, 0x1060 }, { 0x1071, 0x1074 }, { 0x1082, 0x1082 }, { 0x1085, 0x1086 }, { 0x108D, 0x108D }, { 0x109D, 0x109D }, { 0x1160, 0x11FF }, { 0x135D, 0x135F }, { 0x1712, 0x1714 }, { 0x1732, 0x1733 }, { 0x1752, 0x1753 }, { 0x1772, 0x1773 }, { 0x17B4, 0x17B5 }, { 0x17B7, 0x17BD }, { 0x17C6, 0x17C6 }, { 0x17C9, 0x17D3 }, { 0x17DD, 0x17DD }, { 0x180B, 0x180F }, { 0x1885, 0x1886 }, { 0x18A9, 0x18A9 }, { 0x1920, 0x1922 }, { 0x1927, 0x1928 }, { 0x1932, 0x1932 }, { 0x1939, 0x193B }, { 0x1A17, 0x1A18 }, { 0x1A1B, 0x1A1B }, { 0x1A56, 0x1A56 }, { 0x1A58, 0x1A5E }, { 0x1A60, 0x1A60 }, { 0x1A62, 0x1A62 }, { 0x1A65, 0x1A6C }, { 0x1A73, 0x1A7C }, { 0x1A7F, 0x1A7F }, { 0x1AB0, 0x1ACE }, { 0x1B00, 0x1B03 }, { 0x1B34, 0x1B34 }, { 0x1B36, 0x1B3A }, { 0x1B3C, 0x1B3C }, { 0x1B42, 0x1B42 }, { 0x1B6B, 0x1B73 }, { 0x1B80, 0x1B81 }, { 0x1BA2, 0x1BA5 }, { 0x1BA8, 0x1BA9 }, { 0x1BAB, 0x1BAD }, { 0x1BE6, 0x1BE6 }, { 0x1BE8, 0x1BE9 }, { 0x1BED, 0x1BED }, { 0x1BEF, 0x1BF1 }, { 0x1C2C, 0x1C33 }, { 0x1C36, 0x1C37 }, { 0x1CD0, 0x1CD2 }, { 0x1CD4, 0x1CE0 }, { 0x1CE2, 0x1CE8 }, { 0x1CED, 0x1CED }, { 0x1CF4, 0x1CF4 }, { 0x1CF8, 0x1CF9 }, { 0x1DC0, 0x1DFF }, { 0x200B, 0x200F }, { 0x202A, 0x202E }, { 0x2060, 0x2064 }, { 0x2066, 0x206F }, { 0x20D0, 0x20F0 }, { 0x2CEF, 0x2CF1 }, { 0x2D7F, 0x2D7F }, { 0x2DE0, 0x2DFF }, { 0x302A, 0x302D }, { 0x3099, 0x309A }, { 0xA66F, 0xA672 }, { 0xA674, 0xA67D }, { 0xA69E, 0xA69F }, { 0xA6F0, 0xA6F1 }, { 0xA802, 0xA802 }, { 0xA806, 0xA806 }, { 0xA80B, 0xA80B }, { 0xA825, 0xA826 }, { 0xA82C, 0xA82C }, { 0xA8C4, 0xA8C5 }, { 0xA8E0, 0xA8F1 }, { 0xA8FF, 0xA8FF }, { 0xA926, 0xA92D }, { 0xA947, 0xA951 }, { 0xA980, 0xA982 }, { 0xA9B3, 0xA9B3 }, { 0xA9B6, 0xA9B9 }, { 0xA9BC, 0xA9BD }, { 0xA9E5, 0xA9E5 }, { 0xAA29, 0xAA2E }, { 0xAA31, 0xAA32 }, { 0xAA35, 0xAA36 }, { 0xAA43, 0xAA43 }, { 0xAA4C, 0xAA4C }, { 0xAA7C, 0xAA7C }, { 0xAAB0, 0xAAB0 }, { 0xAAB2, 0xAAB4 }, { 0xAAB7, 0xAAB8 }, { 0xAABE, 0xAABF }, { 0xAAC1, 0xAAC1 }, { 0xAAEC, 0xAAED }, { 0xAAF6, 0xAAF6 }, { 0xABE5, 0xABE5 }, { 0xABE8, 0xABE8 }, { 0xABED, 0xABED }, { 0xD7B0, 0xD7FF }, { 0xFB1E, 0xFB1E }, { 0xFE00, 0xFE0F }, { 0xFE20, 0xFE2F }, { 0xFEFF, 0xFEFF }, { 0xFFF9, 0xFFFB }, { 0x101FD, 0x101FD }, { 0x102E0, 0x102E0 }, { 0x10376, 0x1037A }, { 0x10A01, 0x10A03 }, { 0x10A05, 0x10A06 }, { 0x10A0C, 0x10A0F }, { 0x10A38, 0x10A3A }, { 0x10A3F, 0x10A3F }, { 0x10AE5, 0x10AE6 }, { 0x10D24, 0x10D27 }, { 0x10EAB, 0x10EAC }, { 0x10EFD, 0x10EFF }, { 0x10F46, 0x10F50 }, { 0x10F82, 0x10F85 }, { 0x11001, 0x11001 }, { 0x11038, 0x11046 }, { 0x11070, 0x11070 }, { 0x11073, 0x11074 }, { 0x1107F, 0x11081 }, { 0x110B3, 0x110B6 }, { 0x110B9, 0x110BA }, { 0x110C2, 0x110C2 }, { 0x11100, 0x11102 }, { 0x11127, 0x1112B }, { 0x1112D, 0x11134 }, { 0x11173, 0x11173 }, { 0x11180, 0x11181 }, { 0x111B6, 0x111BE }, { 0x111C9, 0x111CC }, { 0x111CF, 0x111CF }, { 0x1122F, 0x11231 }, { 0x11234, 0x11234 }, { 0x11236, 0x11237 }, { 0x1123E, 0x1123E }, { 0x11241, 0x11241 }, { 0x112DF, 0x112DF }, { 0x112E3, 0x112EA }, { 0x11300, 0x11301 }, { 0x1133B, 0x1133C }, { 0x11340, 0x11340 }, { 0x11366, 0x1136C }, { 0x11370, 0x11374 }, { 0x11438, 0x1143F }, { 0x11442, 0x11444 }, { 0x11446, 0x11446 }, { 0x1145E, 0x1145E }, { 0x114B3, 0x114B8 }, { 0x114BA, 0x114BA }, { 0x114BF, 0x114C0 }, { 0x114C2, 0x114C3 }, { 0x115B2, 0x115B5 }, { 0x115BC, 0x115BD }, { 0x115BF, 0x115C0 }, { 0x115DC, 0x115DD }, { 0x11633, 0x1163A }, { 0x1163D, 0x1163D }, { 0x1163F, 0x11640 }, { 0x116AB, 0x116AB }, { 0x116AD, 0x116AD }, { 0x116B0, 0x116B5 }, { 0x116B7, 0x116B7 }, { 0x1171D, 0x1171F }, { 0x11722, 0x11725 }, { 0x11727, 0x1172B }, { 0x1182F, 0x11837 }, { 0x11839, 0x1183A }, { 0x1193B, 0x1193C }, { 0x1193E, 0x1193E }, { 0x11943, 0x11943 }, { 0x119D4, 0x119D7 }, { 0x119DA, 0x119DB }, { 0x119E0, 0x119E0 }, { 0x11A01, 0x11A0A }, { 0x11A33, 0x11A38 }, { 0x11A3B, 0x11A3E }, { 0x11A47, 0x11A47 }, { 0x11A51, 0x11A56 }, { 0x11A59, 0x11A5B }, { 0x11A8A, 0x11A96 }, { 0x11A98, 0x11A99 }, { 0x11C30, 0x11C36 }, { 0x11C38, 0x11C3D }, { 0x11C3F, 0x11C3F }, { 0x11C92, 0x11CA7 }, { 0x11CAA, 0x11CB0 }, { 0x11CB2, 0x11CB3 }, { 0x11CB5, 0x11CB6 }, { 0x11D31, 0x11D36 }, { 0x11D3A, 0x11D3A }, { 0x11D3C, 0x11D3D }, { 0x11D3F, 0x11D45 }, { 0x11D47, 0x11D47 }, { 0x11D90, 0x11D91 }, { 0x11D95, 0x11D95 }, { 0x11D97, 0x11D97 }, { 0x11EF3, 0x11EF4 }, { 0x11F00, 0x11F01 }, { 0x11F36, 0x11F3A }, { 0x11F40, 0x11F40 }, { 0x11F42, 0x11F42 }, { 0x13430, 0x13440 }, { 0x13447, 0x13455 }, { 0x16AF0, 0x16AF4 }, { 0x16B30, 0x16B36 }, { 0x16F4F, 0x16F4F }, { 0x16F8F, 0x16F92 }, { 0x16FE4, 0x16FE4 }, { 0x1BC9D, 0x1BC9E }, { 0x1BCA0, 0x1BCA3 }, { 0x1CF00, 0x1CF2D }, { 0x1CF30, 0x1CF46 }, { 0x1D167, 0x1D169 }, { 0x1D173, 0x1D182 }, { 0x1D185, 0x1D18B }, { 0x1D1AA, 0x1D1AD }, { 0x1D242, 0x1D244 }, { 0x1DA00, 0x1DA36 }, { 0x1DA3B, 0x1DA6C }, { 0x1DA75, 0x1DA75 }, { 0x1DA84, 0x1DA84 }, { 0x1DA9B, 0x1DA9F }, { 0x1DAA1, 0x1DAAF }, { 0x1E000, 0x1E006 }, { 0x1E008, 0x1E018 }, { 0x1E01B, 0x1E021 }, { 0x1E023, 0x1E024 }, { 0x1E026, 0x1E02A }, { 0x1E08F, 0x1E08F }, { 0x1E130, 0x1E136 }, { 0x1E2AE, 0x1E2AE }, { 0x1E2EC, 0x1E2EF }, { 0x1E4EC, 0x1E4EF }, { 0x1E8D0, 0x1E8D6 }, { 0x1E944, 0x1E94A }, { 0xE0001, 0xE0001 }, { 0xE0020, 0xE007F }, { 0xE0100, 0xE01EF } }; static const struct mb_ucsrange mb_ucs_fullwidth[] = { { 0x1100, 0x115F }, { 0x231A, 0x231B }, { 0x2329, 0x232A }, { 0x23E9, 0x23EC }, { 0x23F0, 0x23F0 }, { 0x23F3, 0x23F3 }, { 0x25FD, 0x25FE }, { 0x2614, 0x2615 }, { 0x2648, 0x2653 }, { 0x267F, 0x267F }, { 0x2693, 0x2693 }, { 0x26A1, 0x26A1 }, { 0x26AA, 0x26AB }, { 0x26BD, 0x26BE }, { 0x26C4, 0x26C5 }, { 0x26CE, 0x26CE }, { 0x26D4, 0x26D4 }, { 0x26EA, 0x26EA }, { 0x26F2, 0x26F3 }, { 0x26F5, 0x26F5 }, { 0x26FA, 0x26FA }, { 0x26FD, 0x26FD }, { 0x2705, 0x2705 }, { 0x270A, 0x270B }, { 0x2728, 0x2728 }, { 0x274C, 0x274C }, { 0x274E, 0x274E }, { 0x2753, 0x2755 }, { 0x2757, 0x2757 }, { 0x2795, 0x2797 }, { 0x27B0, 0x27B0 }, { 0x27BF, 0x27BF }, { 0x2B1B, 0x2B1C }, { 0x2B50, 0x2B50 }, { 0x2B55, 0x2B55 }, { 0x2E80, 0x3029 }, { 0x302E, 0x303E }, { 0x3040, 0x3098 }, { 0x309B, 0xA4CF }, { 0xA960, 0xA97F }, { 0xAC00, 0xD7A3 }, { 0xF900, 0xFAFF }, { 0xFE10, 0xFE19 }, { 0xFE30, 0xFE6F }, { 0xFF01, 0xFF60 }, { 0xFFE0, 0xFFE6 }, { 0x16FE0, 0x16FE3 }, { 0x16FF0, 0x16FF1 }, { 0x17000, 0x187F7 }, { 0x18800, 0x18CD5 }, { 0x18D00, 0x18D08 }, { 0x1AFF0, 0x1AFF3 }, { 0x1AFF5, 0x1AFFB }, { 0x1AFFD, 0x1AFFE }, { 0x1B000, 0x1B122 }, { 0x1B132, 0x1B132 }, { 0x1B150, 0x1B152 }, { 0x1B155, 0x1B155 }, { 0x1B164, 0x1B167 }, { 0x1B170, 0x1B2FB }, { 0x1F004, 0x1F004 }, { 0x1F0CF, 0x1F0CF }, { 0x1F18E, 0x1F18E }, { 0x1F191, 0x1F19A }, { 0x1F200, 0x1F202 }, { 0x1F210, 0x1F23B }, { 0x1F240, 0x1F248 }, { 0x1F250, 0x1F251 }, { 0x1F260, 0x1F265 }, { 0x1F300, 0x1F320 }, { 0x1F32D, 0x1F335 }, { 0x1F337, 0x1F37C }, { 0x1F37E, 0x1F393 }, { 0x1F3A0, 0x1F3CA }, { 0x1F3CF, 0x1F3D3 }, { 0x1F3E0, 0x1F3F0 }, { 0x1F3F4, 0x1F3F4 }, { 0x1F3F8, 0x1F43E }, { 0x1F440, 0x1F440 }, { 0x1F442, 0x1F4FC }, { 0x1F4FF, 0x1F53D }, { 0x1F54B, 0x1F54E }, { 0x1F550, 0x1F567 }, { 0x1F57A, 0x1F57A }, { 0x1F595, 0x1F596 }, { 0x1F5A4, 0x1F5A4 }, { 0x1F5FB, 0x1F64F }, { 0x1F680, 0x1F6C5 }, { 0x1F6CC, 0x1F6CC }, { 0x1F6D0, 0x1F6D2 }, { 0x1F6D5, 0x1F6D7 }, { 0x1F6DC, 0x1F6DF }, { 0x1F6EB, 0x1F6EC }, { 0x1F6F4, 0x1F6FC }, { 0x1F7E0, 0x1F7EB }, { 0x1F7F0, 0x1F7F0 }, { 0x1F90C, 0x1F93A }, { 0x1F93C, 0x1F945 }, { 0x1F947, 0x1F9FF }, { 0x1FA70, 0x1FA7C }, { 0x1FA80, 0x1FA88 }, { 0x1FA90, 0x1FABD }, { 0x1FABF, 0x1FAC5 }, { 0x1FACE, 0x1FADB }, { 0x1FAE0, 0x1FAE8 }, { 0x1FAF0, 0x1FAF8 }, { 0x20000, 0x2FFFD }, { 0x30000, 0x3FFFD } }; /* simple binary search in ranges, with bounds optimisation */ static size_t mb_ucsbsearch(const struct mb_ucsrange arr[], size_t elems, unsigned int val) { size_t min = 0, mid, max = elems; if (val < arr[min].beg || val > arr[max - 1].end) return ((size_t)-1); while (min < max) { mid = (min + max) / 2; if (val < arr[mid].beg) max = mid; else if (val > arr[mid].end) min = mid + 1; else return (mid); } return ((size_t)-1); } /* Modified for JOE: returns printed width of control and other non-printable characters */ /*XXX possibly more */ static const struct mb_ucsrange joe_ctrlchars[] = { { 0x0080, 0x009F }, { 0x200B, 0x200F }, { 0x2028, 0x202E }, { 0x2060, 0x2063 }, { 0x2066, 0x206F }, { 0xD800, 0xDFFF }, { 0xFDD0, 0xFDEF }, { 0xFEFF, 0xFEFF }, { 0xFFF9, 0xFFFB } }; /* returns column width of control character, 0 for regular */ unsigned char unictrlbuf[11]; int unictrl(unsigned int ucs) { *unictrlbuf = 0; /* C0 control characters and raw octets use one screen column */ if (ucs < 32 || ucs == 0x7F || (ucs & 0x80000000)) return (1); /* not a control or noncharacter? */ if (mb_ucsbsearch(joe_ctrlchars, NELEM(joe_ctrlchars), ucs) == (size_t)-1 && (ucs & 0xFFFE) != 0xFFFE && ucs <= 0x10FFFF) return (0); return (joe_snprintf_1((char *)unictrlbuf, sizeof(unictrlbuf), "<%X>", ucs)); } int joe_wcwidth(unsigned int ucs) { int wide; #ifndef TEST /* If terminal is not UTF-8 or file is not UTF-8: width is 1 */ /* FIXME */ if (!joe_maputf(locale_map)) return (1); #endif if ((wide = unictrl(ucs))) return (wide); /* combining characters use 0 screen columns */ if (mb_ucsbsearch(mb_ucs_combining, NELEM(mb_ucs_combining), ucs) != (size_t)-1) return (0); /* all others use 1 or 2 screen columns */ if (mb_ucsbsearch(mb_ucs_fullwidth, NELEM(mb_ucs_fullwidth), ucs) != (size_t)-1) return (2); return (1); } /* Macro for generating joe_iswXXX functions */ #define MAKE_ISW(what) \ int joe_isw##what(int c) \ { \ return ((mb_ucsbsearch(data_wctype_##what, \ NELEM(data_wctype_##what), \ c) != (size_t)-1) ? 1 : 0); \ } /* MAKE_ISW functions... */ /* From: contrib/hosted/tg/jupptables,v 1.4 2017/07/08 14:53:45 tg Exp $ */ #ifdef TEST_I18N static const struct mb_ucsrange data_wctype_upper[] = { { 0x0041, 0x005A }, { 0x00C0, 0x00D6 }, { 0x00D8, 0x00DE }, { 0x0100, 0x0100 }, { 0x0102, 0x0102 }, { 0x0104, 0x0104 }, { 0x0106, 0x0106 }, { 0x0108, 0x0108 }, { 0x010A, 0x010A }, { 0x010C, 0x010C }, { 0x010E, 0x010E }, { 0x0110, 0x0110 }, { 0x0112, 0x0112 }, { 0x0114, 0x0114 }, { 0x0116, 0x0116 }, { 0x0118, 0x0118 }, { 0x011A, 0x011A }, { 0x011C, 0x011C }, { 0x011E, 0x011E }, { 0x0120, 0x0120 }, { 0x0122, 0x0122 }, { 0x0124, 0x0124 }, { 0x0126, 0x0126 }, { 0x0128, 0x0128 }, { 0x012A, 0x012A }, { 0x012C, 0x012C }, { 0x012E, 0x012E }, { 0x0130, 0x0130 }, { 0x0132, 0x0132 }, { 0x0134, 0x0134 }, { 0x0136, 0x0136 }, { 0x0139, 0x0139 }, { 0x013B, 0x013B }, { 0x013D, 0x013D }, { 0x013F, 0x013F }, { 0x0141, 0x0141 }, { 0x0143, 0x0143 }, { 0x0145, 0x0145 }, { 0x0147, 0x0147 }, { 0x014A, 0x014A }, { 0x014C, 0x014C }, { 0x014E, 0x014E }, { 0x0150, 0x0150 }, { 0x0152, 0x0152 }, { 0x0154, 0x0154 }, { 0x0156, 0x0156 }, { 0x0158, 0x0158 }, { 0x015A, 0x015A }, { 0x015C, 0x015C }, { 0x015E, 0x015E }, { 0x0160, 0x0160 }, { 0x0162, 0x0162 }, { 0x0164, 0x0164 }, { 0x0166, 0x0166 }, { 0x0168, 0x0168 }, { 0x016A, 0x016A }, { 0x016C, 0x016C }, { 0x016E, 0x016E }, { 0x0170, 0x0170 }, { 0x0172, 0x0172 }, { 0x0174, 0x0174 }, { 0x0176, 0x0176 }, { 0x0178, 0x0179 }, { 0x017B, 0x017B }, { 0x017D, 0x017D }, { 0x0181, 0x0182 }, { 0x0184, 0x0184 }, { 0x0186, 0x0187 }, { 0x0189, 0x018B }, { 0x018E, 0x0191 }, { 0x0193, 0x0194 }, { 0x0196, 0x0198 }, { 0x019C, 0x019D }, { 0x019F, 0x01A0 }, { 0x01A2, 0x01A2 }, { 0x01A4, 0x01A4 }, { 0x01A6, 0x01A7 }, { 0x01A9, 0x01A9 }, { 0x01AC, 0x01AC }, { 0x01AE, 0x01AF }, { 0x01B1, 0x01B3 }, { 0x01B5, 0x01B5 }, { 0x01B7, 0x01B8 }, { 0x01BC, 0x01BC }, { 0x01C4, 0x01C5 }, { 0x01C7, 0x01C8 }, { 0x01CA, 0x01CB }, { 0x01CD, 0x01CD }, { 0x01CF, 0x01CF }, { 0x01D1, 0x01D1 }, { 0x01D3, 0x01D3 }, { 0x01D5, 0x01D5 }, { 0x01D7, 0x01D7 }, { 0x01D9, 0x01D9 }, { 0x01DB, 0x01DB }, { 0x01DE, 0x01DE }, { 0x01E0, 0x01E0 }, { 0x01E2, 0x01E2 }, { 0x01E4, 0x01E4 }, { 0x01E6, 0x01E6 }, { 0x01E8, 0x01E8 }, { 0x01EA, 0x01EA }, { 0x01EC, 0x01EC }, { 0x01EE, 0x01EE }, { 0x01F1, 0x01F2 }, { 0x01F4, 0x01F4 }, { 0x01F6, 0x01F8 }, { 0x01FA, 0x01FA }, { 0x01FC, 0x01FC }, { 0x01FE, 0x01FE }, { 0x0200, 0x0200 }, { 0x0202, 0x0202 }, { 0x0204, 0x0204 }, { 0x0206, 0x0206 }, { 0x0208, 0x0208 }, { 0x020A, 0x020A }, { 0x020C, 0x020C }, { 0x020E, 0x020E }, { 0x0210, 0x0210 }, { 0x0212, 0x0212 }, { 0x0214, 0x0214 }, { 0x0216, 0x0216 }, { 0x0218, 0x0218 }, { 0x021A, 0x021A }, { 0x021C, 0x021C }, { 0x021E, 0x021E }, { 0x0220, 0x0220 }, { 0x0222, 0x0222 }, { 0x0224, 0x0224 }, { 0x0226, 0x0226 }, { 0x0228, 0x0228 }, { 0x022A, 0x022A }, { 0x022C, 0x022C }, { 0x022E, 0x022E }, { 0x0230, 0x0230 }, { 0x0232, 0x0232 }, { 0x023A, 0x023B }, { 0x023D, 0x023E }, { 0x0241, 0x0241 }, { 0x0243, 0x0246 }, { 0x0248, 0x0248 }, { 0x024A, 0x024A }, { 0x024C, 0x024C }, { 0x024E, 0x024E }, { 0x0370, 0x0370 }, { 0x0372, 0x0372 }, { 0x0376, 0x0376 }, { 0x037F, 0x037F }, { 0x0386, 0x0386 }, { 0x0388, 0x038A }, { 0x038C, 0x038C }, { 0x038E, 0x038F }, { 0x0391, 0x03A1 }, { 0x03A3, 0x03AB }, { 0x03CF, 0x03CF }, { 0x03D8, 0x03D8 }, { 0x03DA, 0x03DA }, { 0x03DC, 0x03DC }, { 0x03DE, 0x03DE }, { 0x03E0, 0x03E0 }, { 0x03E2, 0x03E2 }, { 0x03E4, 0x03E4 }, { 0x03E6, 0x03E6 }, { 0x03E8, 0x03E8 }, { 0x03EA, 0x03EA }, { 0x03EC, 0x03EC }, { 0x03EE, 0x03EE }, { 0x03F4, 0x03F4 }, { 0x03F7, 0x03F7 }, { 0x03F9, 0x03FA }, { 0x03FD, 0x042F }, { 0x0460, 0x0460 }, { 0x0462, 0x0462 }, { 0x0464, 0x0464 }, { 0x0466, 0x0466 }, { 0x0468, 0x0468 }, { 0x046A, 0x046A }, { 0x046C, 0x046C }, { 0x046E, 0x046E }, { 0x0470, 0x0470 }, { 0x0472, 0x0472 }, { 0x0474, 0x0474 }, { 0x0476, 0x0476 }, { 0x0478, 0x0478 }, { 0x047A, 0x047A }, { 0x047C, 0x047C }, { 0x047E, 0x047E }, { 0x0480, 0x0480 }, { 0x048A, 0x048A }, { 0x048C, 0x048C }, { 0x048E, 0x048E }, { 0x0490, 0x0490 }, { 0x0492, 0x0492 }, { 0x0494, 0x0494 }, { 0x0496, 0x0496 }, { 0x0498, 0x0498 }, { 0x049A, 0x049A }, { 0x049C, 0x049C }, { 0x049E, 0x049E }, { 0x04A0, 0x04A0 }, { 0x04A2, 0x04A2 }, { 0x04A4, 0x04A4 }, { 0x04A6, 0x04A6 }, { 0x04A8, 0x04A8 }, { 0x04AA, 0x04AA }, { 0x04AC, 0x04AC }, { 0x04AE, 0x04AE }, { 0x04B0, 0x04B0 }, { 0x04B2, 0x04B2 }, { 0x04B4, 0x04B4 }, { 0x04B6, 0x04B6 }, { 0x04B8, 0x04B8 }, { 0x04BA, 0x04BA }, { 0x04BC, 0x04BC }, { 0x04BE, 0x04BE }, { 0x04C0, 0x04C1 }, { 0x04C3, 0x04C3 }, { 0x04C5, 0x04C5 }, { 0x04C7, 0x04C7 }, { 0x04C9, 0x04C9 }, { 0x04CB, 0x04CB }, { 0x04CD, 0x04CD }, { 0x04D0, 0x04D0 }, { 0x04D2, 0x04D2 }, { 0x04D4, 0x04D4 }, { 0x04D6, 0x04D6 }, { 0x04D8, 0x04D8 }, { 0x04DA, 0x04DA }, { 0x04DC, 0x04DC }, { 0x04DE, 0x04DE }, { 0x04E0, 0x04E0 }, { 0x04E2, 0x04E2 }, { 0x04E4, 0x04E4 }, { 0x04E6, 0x04E6 }, { 0x04E8, 0x04E8 }, { 0x04EA, 0x04EA }, { 0x04EC, 0x04EC }, { 0x04EE, 0x04EE }, { 0x04F0, 0x04F0 }, { 0x04F2, 0x04F2 }, { 0x04F4, 0x04F4 }, { 0x04F6, 0x04F6 }, { 0x04F8, 0x04F8 }, { 0x04FA, 0x04FA }, { 0x04FC, 0x04FC }, { 0x04FE, 0x04FE }, { 0x0500, 0x0500 }, { 0x0502, 0x0502 }, { 0x0504, 0x0504 }, { 0x0506, 0x0506 }, { 0x0508, 0x0508 }, { 0x050A, 0x050A }, { 0x050C, 0x050C }, { 0x050E, 0x050E }, { 0x0510, 0x0510 }, { 0x0512, 0x0512 }, { 0x0514, 0x0514 }, { 0x0516, 0x0516 }, { 0x0518, 0x0518 }, { 0x051A, 0x051A }, { 0x051C, 0x051C }, { 0x051E, 0x051E }, { 0x0520, 0x0520 }, { 0x0522, 0x0522 }, { 0x0524, 0x0524 }, { 0x0526, 0x0526 }, { 0x0528, 0x0528 }, { 0x052A, 0x052A }, { 0x052C, 0x052C }, { 0x052E, 0x052E }, { 0x0531, 0x0556 }, { 0x10A0, 0x10C5 }, { 0x10C7, 0x10C7 }, { 0x10CD, 0x10CD }, { 0x13A0, 0x13F5 }, { 0x1C90, 0x1CBA }, { 0x1CBD, 0x1CBF }, { 0x1E00, 0x1E00 }, { 0x1E02, 0x1E02 }, { 0x1E04, 0x1E04 }, { 0x1E06, 0x1E06 }, { 0x1E08, 0x1E08 }, { 0x1E0A, 0x1E0A }, { 0x1E0C, 0x1E0C }, { 0x1E0E, 0x1E0E }, { 0x1E10, 0x1E10 }, { 0x1E12, 0x1E12 }, { 0x1E14, 0x1E14 }, { 0x1E16, 0x1E16 }, { 0x1E18, 0x1E18 }, { 0x1E1A, 0x1E1A }, { 0x1E1C, 0x1E1C }, { 0x1E1E, 0x1E1E }, { 0x1E20, 0x1E20 }, { 0x1E22, 0x1E22 }, { 0x1E24, 0x1E24 }, { 0x1E26, 0x1E26 }, { 0x1E28, 0x1E28 }, { 0x1E2A, 0x1E2A }, { 0x1E2C, 0x1E2C }, { 0x1E2E, 0x1E2E }, { 0x1E30, 0x1E30 }, { 0x1E32, 0x1E32 }, { 0x1E34, 0x1E34 }, { 0x1E36, 0x1E36 }, { 0x1E38, 0x1E38 }, { 0x1E3A, 0x1E3A }, { 0x1E3C, 0x1E3C }, { 0x1E3E, 0x1E3E }, { 0x1E40, 0x1E40 }, { 0x1E42, 0x1E42 }, { 0x1E44, 0x1E44 }, { 0x1E46, 0x1E46 }, { 0x1E48, 0x1E48 }, { 0x1E4A, 0x1E4A }, { 0x1E4C, 0x1E4C }, { 0x1E4E, 0x1E4E }, { 0x1E50, 0x1E50 }, { 0x1E52, 0x1E52 }, { 0x1E54, 0x1E54 }, { 0x1E56, 0x1E56 }, { 0x1E58, 0x1E58 }, { 0x1E5A, 0x1E5A }, { 0x1E5C, 0x1E5C }, { 0x1E5E, 0x1E5E }, { 0x1E60, 0x1E60 }, { 0x1E62, 0x1E62 }, { 0x1E64, 0x1E64 }, { 0x1E66, 0x1E66 }, { 0x1E68, 0x1E68 }, { 0x1E6A, 0x1E6A }, { 0x1E6C, 0x1E6C }, { 0x1E6E, 0x1E6E }, { 0x1E70, 0x1E70 }, { 0x1E72, 0x1E72 }, { 0x1E74, 0x1E74 }, { 0x1E76, 0x1E76 }, { 0x1E78, 0x1E78 }, { 0x1E7A, 0x1E7A }, { 0x1E7C, 0x1E7C }, { 0x1E7E, 0x1E7E }, { 0x1E80, 0x1E80 }, { 0x1E82, 0x1E82 }, { 0x1E84, 0x1E84 }, { 0x1E86, 0x1E86 }, { 0x1E88, 0x1E88 }, { 0x1E8A, 0x1E8A }, { 0x1E8C, 0x1E8C }, { 0x1E8E, 0x1E8E }, { 0x1E90, 0x1E90 }, { 0x1E92, 0x1E92 }, { 0x1E94, 0x1E94 }, { 0x1E9E, 0x1E9E }, { 0x1EA0, 0x1EA0 }, { 0x1EA2, 0x1EA2 }, { 0x1EA4, 0x1EA4 }, { 0x1EA6, 0x1EA6 }, { 0x1EA8, 0x1EA8 }, { 0x1EAA, 0x1EAA }, { 0x1EAC, 0x1EAC }, { 0x1EAE, 0x1EAE }, { 0x1EB0, 0x1EB0 }, { 0x1EB2, 0x1EB2 }, { 0x1EB4, 0x1EB4 }, { 0x1EB6, 0x1EB6 }, { 0x1EB8, 0x1EB8 }, { 0x1EBA, 0x1EBA }, { 0x1EBC, 0x1EBC }, { 0x1EBE, 0x1EBE }, { 0x1EC0, 0x1EC0 }, { 0x1EC2, 0x1EC2 }, { 0x1EC4, 0x1EC4 }, { 0x1EC6, 0x1EC6 }, { 0x1EC8, 0x1EC8 }, { 0x1ECA, 0x1ECA }, { 0x1ECC, 0x1ECC }, { 0x1ECE, 0x1ECE }, { 0x1ED0, 0x1ED0 }, { 0x1ED2, 0x1ED2 }, { 0x1ED4, 0x1ED4 }, { 0x1ED6, 0x1ED6 }, { 0x1ED8, 0x1ED8 }, { 0x1EDA, 0x1EDA }, { 0x1EDC, 0x1EDC }, { 0x1EDE, 0x1EDE }, { 0x1EE0, 0x1EE0 }, { 0x1EE2, 0x1EE2 }, { 0x1EE4, 0x1EE4 }, { 0x1EE6, 0x1EE6 }, { 0x1EE8, 0x1EE8 }, { 0x1EEA, 0x1EEA }, { 0x1EEC, 0x1EEC }, { 0x1EEE, 0x1EEE }, { 0x1EF0, 0x1EF0 }, { 0x1EF2, 0x1EF2 }, { 0x1EF4, 0x1EF4 }, { 0x1EF6, 0x1EF6 }, { 0x1EF8, 0x1EF8 }, { 0x1EFA, 0x1EFA }, { 0x1EFC, 0x1EFC }, { 0x1EFE, 0x1EFE }, { 0x1F08, 0x1F0F }, { 0x1F18, 0x1F1D }, { 0x1F28, 0x1F2F }, { 0x1F38, 0x1F3F }, { 0x1F48, 0x1F4D }, { 0x1F59, 0x1F59 }, { 0x1F5B, 0x1F5B }, { 0x1F5D, 0x1F5D }, { 0x1F5F, 0x1F5F }, { 0x1F68, 0x1F6F }, { 0x1F88, 0x1F8F }, { 0x1F98, 0x1F9F }, { 0x1FA8, 0x1FAF }, { 0x1FB8, 0x1FBC }, { 0x1FC8, 0x1FCC }, { 0x1FD8, 0x1FDB }, { 0x1FE8, 0x1FEC }, { 0x1FF8, 0x1FFC }, { 0x2126, 0x2126 }, { 0x212A, 0x212B }, { 0x2132, 0x2132 }, { 0x2160, 0x216F }, { 0x2183, 0x2183 }, { 0x24B6, 0x24CF }, { 0x2C00, 0x2C2F }, { 0x2C60, 0x2C60 }, { 0x2C62, 0x2C64 }, { 0x2C67, 0x2C67 }, { 0x2C69, 0x2C69 }, { 0x2C6B, 0x2C6B }, { 0x2C6D, 0x2C70 }, { 0x2C72, 0x2C72 }, { 0x2C75, 0x2C75 }, { 0x2C7E, 0x2C80 }, { 0x2C82, 0x2C82 }, { 0x2C84, 0x2C84 }, { 0x2C86, 0x2C86 }, { 0x2C88, 0x2C88 }, { 0x2C8A, 0x2C8A }, { 0x2C8C, 0x2C8C }, { 0x2C8E, 0x2C8E }, { 0x2C90, 0x2C90 }, { 0x2C92, 0x2C92 }, { 0x2C94, 0x2C94 }, { 0x2C96, 0x2C96 }, { 0x2C98, 0x2C98 }, { 0x2C9A, 0x2C9A }, { 0x2C9C, 0x2C9C }, { 0x2C9E, 0x2C9E }, { 0x2CA0, 0x2CA0 }, { 0x2CA2, 0x2CA2 }, { 0x2CA4, 0x2CA4 }, { 0x2CA6, 0x2CA6 }, { 0x2CA8, 0x2CA8 }, { 0x2CAA, 0x2CAA }, { 0x2CAC, 0x2CAC }, { 0x2CAE, 0x2CAE }, { 0x2CB0, 0x2CB0 }, { 0x2CB2, 0x2CB2 }, { 0x2CB4, 0x2CB4 }, { 0x2CB6, 0x2CB6 }, { 0x2CB8, 0x2CB8 }, { 0x2CBA, 0x2CBA }, { 0x2CBC, 0x2CBC }, { 0x2CBE, 0x2CBE }, { 0x2CC0, 0x2CC0 }, { 0x2CC2, 0x2CC2 }, { 0x2CC4, 0x2CC4 }, { 0x2CC6, 0x2CC6 }, { 0x2CC8, 0x2CC8 }, { 0x2CCA, 0x2CCA }, { 0x2CCC, 0x2CCC }, { 0x2CCE, 0x2CCE }, { 0x2CD0, 0x2CD0 }, { 0x2CD2, 0x2CD2 }, { 0x2CD4, 0x2CD4 }, { 0x2CD6, 0x2CD6 }, { 0x2CD8, 0x2CD8 }, { 0x2CDA, 0x2CDA }, { 0x2CDC, 0x2CDC }, { 0x2CDE, 0x2CDE }, { 0x2CE0, 0x2CE0 }, { 0x2CE2, 0x2CE2 }, { 0x2CEB, 0x2CEB }, { 0x2CED, 0x2CED }, { 0x2CF2, 0x2CF2 }, { 0xA640, 0xA640 }, { 0xA642, 0xA642 }, { 0xA644, 0xA644 }, { 0xA646, 0xA646 }, { 0xA648, 0xA648 }, { 0xA64A, 0xA64A }, { 0xA64C, 0xA64C }, { 0xA64E, 0xA64E }, { 0xA650, 0xA650 }, { 0xA652, 0xA652 }, { 0xA654, 0xA654 }, { 0xA656, 0xA656 }, { 0xA658, 0xA658 }, { 0xA65A, 0xA65A }, { 0xA65C, 0xA65C }, { 0xA65E, 0xA65E }, { 0xA660, 0xA660 }, { 0xA662, 0xA662 }, { 0xA664, 0xA664 }, { 0xA666, 0xA666 }, { 0xA668, 0xA668 }, { 0xA66A, 0xA66A }, { 0xA66C, 0xA66C }, { 0xA680, 0xA680 }, { 0xA682, 0xA682 }, { 0xA684, 0xA684 }, { 0xA686, 0xA686 }, { 0xA688, 0xA688 }, { 0xA68A, 0xA68A }, { 0xA68C, 0xA68C }, { 0xA68E, 0xA68E }, { 0xA690, 0xA690 }, { 0xA692, 0xA692 }, { 0xA694, 0xA694 }, { 0xA696, 0xA696 }, { 0xA698, 0xA698 }, { 0xA69A, 0xA69A }, { 0xA722, 0xA722 }, { 0xA724, 0xA724 }, { 0xA726, 0xA726 }, { 0xA728, 0xA728 }, { 0xA72A, 0xA72A }, { 0xA72C, 0xA72C }, { 0xA72E, 0xA72E }, { 0xA732, 0xA732 }, { 0xA734, 0xA734 }, { 0xA736, 0xA736 }, { 0xA738, 0xA738 }, { 0xA73A, 0xA73A }, { 0xA73C, 0xA73C }, { 0xA73E, 0xA73E }, { 0xA740, 0xA740 }, { 0xA742, 0xA742 }, { 0xA744, 0xA744 }, { 0xA746, 0xA746 }, { 0xA748, 0xA748 }, { 0xA74A, 0xA74A }, { 0xA74C, 0xA74C }, { 0xA74E, 0xA74E }, { 0xA750, 0xA750 }, { 0xA752, 0xA752 }, { 0xA754, 0xA754 }, { 0xA756, 0xA756 }, { 0xA758, 0xA758 }, { 0xA75A, 0xA75A }, { 0xA75C, 0xA75C }, { 0xA75E, 0xA75E }, { 0xA760, 0xA760 }, { 0xA762, 0xA762 }, { 0xA764, 0xA764 }, { 0xA766, 0xA766 }, { 0xA768, 0xA768 }, { 0xA76A, 0xA76A }, { 0xA76C, 0xA76C }, { 0xA76E, 0xA76E }, { 0xA779, 0xA779 }, { 0xA77B, 0xA77B }, { 0xA77D, 0xA77E }, { 0xA780, 0xA780 }, { 0xA782, 0xA782 }, { 0xA784, 0xA784 }, { 0xA786, 0xA786 }, { 0xA78B, 0xA78B }, { 0xA78D, 0xA78D }, { 0xA790, 0xA790 }, { 0xA792, 0xA792 }, { 0xA796, 0xA796 }, { 0xA798, 0xA798 }, { 0xA79A, 0xA79A }, { 0xA79C, 0xA79C }, { 0xA79E, 0xA79E }, { 0xA7A0, 0xA7A0 }, { 0xA7A2, 0xA7A2 }, { 0xA7A4, 0xA7A4 }, { 0xA7A6, 0xA7A6 }, { 0xA7A8, 0xA7A8 }, { 0xA7AA, 0xA7AE }, { 0xA7B0, 0xA7B4 }, { 0xA7B6, 0xA7B6 }, { 0xA7B8, 0xA7B8 }, { 0xA7BA, 0xA7BA }, { 0xA7BC, 0xA7BC }, { 0xA7BE, 0xA7BE }, { 0xA7C0, 0xA7C0 }, { 0xA7C2, 0xA7C2 }, { 0xA7C4, 0xA7C7 }, { 0xA7C9, 0xA7C9 }, { 0xA7D0, 0xA7D0 }, { 0xA7D6, 0xA7D6 }, { 0xA7D8, 0xA7D8 }, { 0xA7F5, 0xA7F5 }, { 0xFF21, 0xFF3A }, { 0x10400, 0x10427 }, { 0x104B0, 0x104D3 }, { 0x10570, 0x1057A }, { 0x1057C, 0x1058A }, { 0x1058C, 0x10592 }, { 0x10594, 0x10595 }, { 0x10C80, 0x10CB2 }, { 0x118A0, 0x118BF }, { 0x16E40, 0x16E5F }, { 0x1E900, 0x1E921 } }; MAKE_ISW(upper) static const struct mb_ucsrange data_wctype_lower[] = { { 0x0061, 0x007A }, { 0x00B5, 0x00B5 }, { 0x00E0, 0x00F6 }, { 0x00F8, 0x00FF }, { 0x0101, 0x0101 }, { 0x0103, 0x0103 }, { 0x0105, 0x0105 }, { 0x0107, 0x0107 }, { 0x0109, 0x0109 }, { 0x010B, 0x010B }, { 0x010D, 0x010D }, { 0x010F, 0x010F }, { 0x0111, 0x0111 }, { 0x0113, 0x0113 }, { 0x0115, 0x0115 }, { 0x0117, 0x0117 }, { 0x0119, 0x0119 }, { 0x011B, 0x011B }, { 0x011D, 0x011D }, { 0x011F, 0x011F }, { 0x0121, 0x0121 }, { 0x0123, 0x0123 }, { 0x0125, 0x0125 }, { 0x0127, 0x0127 }, { 0x0129, 0x0129 }, { 0x012B, 0x012B }, { 0x012D, 0x012D }, { 0x012F, 0x012F }, { 0x0131, 0x0131 }, { 0x0133, 0x0133 }, { 0x0135, 0x0135 }, { 0x0137, 0x0137 }, { 0x013A, 0x013A }, { 0x013C, 0x013C }, { 0x013E, 0x013E }, { 0x0140, 0x0140 }, { 0x0142, 0x0142 }, { 0x0144, 0x0144 }, { 0x0146, 0x0146 }, { 0x0148, 0x0148 }, { 0x014B, 0x014B }, { 0x014D, 0x014D }, { 0x014F, 0x014F }, { 0x0151, 0x0151 }, { 0x0153, 0x0153 }, { 0x0155, 0x0155 }, { 0x0157, 0x0157 }, { 0x0159, 0x0159 }, { 0x015B, 0x015B }, { 0x015D, 0x015D }, { 0x015F, 0x015F }, { 0x0161, 0x0161 }, { 0x0163, 0x0163 }, { 0x0165, 0x0165 }, { 0x0167, 0x0167 }, { 0x0169, 0x0169 }, { 0x016B, 0x016B }, { 0x016D, 0x016D }, { 0x016F, 0x016F }, { 0x0171, 0x0171 }, { 0x0173, 0x0173 }, { 0x0175, 0x0175 }, { 0x0177, 0x0177 }, { 0x017A, 0x017A }, { 0x017C, 0x017C }, { 0x017E, 0x0180 }, { 0x0183, 0x0183 }, { 0x0185, 0x0185 }, { 0x0188, 0x0188 }, { 0x018C, 0x018C }, { 0x0192, 0x0192 }, { 0x0195, 0x0195 }, { 0x0199, 0x019A }, { 0x019E, 0x019E }, { 0x01A1, 0x01A1 }, { 0x01A3, 0x01A3 }, { 0x01A5, 0x01A5 }, { 0x01A8, 0x01A8 }, { 0x01AD, 0x01AD }, { 0x01B0, 0x01B0 }, { 0x01B4, 0x01B4 }, { 0x01B6, 0x01B6 }, { 0x01B9, 0x01B9 }, { 0x01BD, 0x01BD }, { 0x01BF, 0x01BF }, { 0x01C6, 0x01C6 }, { 0x01C9, 0x01C9 }, { 0x01CC, 0x01CC }, { 0x01CE, 0x01CE }, { 0x01D0, 0x01D0 }, { 0x01D2, 0x01D2 }, { 0x01D4, 0x01D4 }, { 0x01D6, 0x01D6 }, { 0x01D8, 0x01D8 }, { 0x01DA, 0x01DA }, { 0x01DC, 0x01DD }, { 0x01DF, 0x01DF }, { 0x01E1, 0x01E1 }, { 0x01E3, 0x01E3 }, { 0x01E5, 0x01E5 }, { 0x01E7, 0x01E7 }, { 0x01E9, 0x01E9 }, { 0x01EB, 0x01EB }, { 0x01ED, 0x01ED }, { 0x01EF, 0x01EF }, { 0x01F3, 0x01F3 }, { 0x01F5, 0x01F5 }, { 0x01F9, 0x01F9 }, { 0x01FB, 0x01FB }, { 0x01FD, 0x01FD }, { 0x01FF, 0x01FF }, { 0x0201, 0x0201 }, { 0x0203, 0x0203 }, { 0x0205, 0x0205 }, { 0x0207, 0x0207 }, { 0x0209, 0x0209 }, { 0x020B, 0x020B }, { 0x020D, 0x020D }, { 0x020F, 0x020F }, { 0x0211, 0x0211 }, { 0x0213, 0x0213 }, { 0x0215, 0x0215 }, { 0x0217, 0x0217 }, { 0x0219, 0x0219 }, { 0x021B, 0x021B }, { 0x021D, 0x021D }, { 0x021F, 0x021F }, { 0x0223, 0x0223 }, { 0x0225, 0x0225 }, { 0x0227, 0x0227 }, { 0x0229, 0x0229 }, { 0x022B, 0x022B }, { 0x022D, 0x022D }, { 0x022F, 0x022F }, { 0x0231, 0x0231 }, { 0x0233, 0x0233 }, { 0x023C, 0x023C }, { 0x023F, 0x0240 }, { 0x0242, 0x0242 }, { 0x0247, 0x0247 }, { 0x0249, 0x0249 }, { 0x024B, 0x024B }, { 0x024D, 0x024D }, { 0x024F, 0x0254 }, { 0x0256, 0x0257 }, { 0x0259, 0x0259 }, { 0x025B, 0x025C }, { 0x0260, 0x0261 }, { 0x0263, 0x0263 }, { 0x0265, 0x0266 }, { 0x0268, 0x026C }, { 0x026F, 0x026F }, { 0x0271, 0x0272 }, { 0x0275, 0x0275 }, { 0x027D, 0x027D }, { 0x0280, 0x0280 }, { 0x0282, 0x0283 }, { 0x0287, 0x028C }, { 0x0292, 0x0292 }, { 0x029D, 0x029E }, { 0x0345, 0x0345 }, { 0x0371, 0x0371 }, { 0x0373, 0x0373 }, { 0x0377, 0x0377 }, { 0x037B, 0x037D }, { 0x03AC, 0x03AF }, { 0x03B1, 0x03CE }, { 0x03D0, 0x03D1 }, { 0x03D5, 0x03D7 }, { 0x03D9, 0x03D9 }, { 0x03DB, 0x03DB }, { 0x03DD, 0x03DD }, { 0x03DF, 0x03DF }, { 0x03E1, 0x03E1 }, { 0x03E3, 0x03E3 }, { 0x03E5, 0x03E5 }, { 0x03E7, 0x03E7 }, { 0x03E9, 0x03E9 }, { 0x03EB, 0x03EB }, { 0x03ED, 0x03ED }, { 0x03EF, 0x03F3 }, { 0x03F5, 0x03F5 }, { 0x03F8, 0x03F8 }, { 0x03FB, 0x03FB }, { 0x0430, 0x045F }, { 0x0461, 0x0461 }, { 0x0463, 0x0463 }, { 0x0465, 0x0465 }, { 0x0467, 0x0467 }, { 0x0469, 0x0469 }, { 0x046B, 0x046B }, { 0x046D, 0x046D }, { 0x046F, 0x046F }, { 0x0471, 0x0471 }, { 0x0473, 0x0473 }, { 0x0475, 0x0475 }, { 0x0477, 0x0477 }, { 0x0479, 0x0479 }, { 0x047B, 0x047B }, { 0x047D, 0x047D }, { 0x047F, 0x047F }, { 0x0481, 0x0481 }, { 0x048B, 0x048B }, { 0x048D, 0x048D }, { 0x048F, 0x048F }, { 0x0491, 0x0491 }, { 0x0493, 0x0493 }, { 0x0495, 0x0495 }, { 0x0497, 0x0497 }, { 0x0499, 0x0499 }, { 0x049B, 0x049B }, { 0x049D, 0x049D }, { 0x049F, 0x049F }, { 0x04A1, 0x04A1 }, { 0x04A3, 0x04A3 }, { 0x04A5, 0x04A5 }, { 0x04A7, 0x04A7 }, { 0x04A9, 0x04A9 }, { 0x04AB, 0x04AB }, { 0x04AD, 0x04AD }, { 0x04AF, 0x04AF }, { 0x04B1, 0x04B1 }, { 0x04B3, 0x04B3 }, { 0x04B5, 0x04B5 }, { 0x04B7, 0x04B7 }, { 0x04B9, 0x04B9 }, { 0x04BB, 0x04BB }, { 0x04BD, 0x04BD }, { 0x04BF, 0x04BF }, { 0x04C2, 0x04C2 }, { 0x04C4, 0x04C4 }, { 0x04C6, 0x04C6 }, { 0x04C8, 0x04C8 }, { 0x04CA, 0x04CA }, { 0x04CC, 0x04CC }, { 0x04CE, 0x04CF }, { 0x04D1, 0x04D1 }, { 0x04D3, 0x04D3 }, { 0x04D5, 0x04D5 }, { 0x04D7, 0x04D7 }, { 0x04D9, 0x04D9 }, { 0x04DB, 0x04DB }, { 0x04DD, 0x04DD }, { 0x04DF, 0x04DF }, { 0x04E1, 0x04E1 }, { 0x04E3, 0x04E3 }, { 0x04E5, 0x04E5 }, { 0x04E7, 0x04E7 }, { 0x04E9, 0x04E9 }, { 0x04EB, 0x04EB }, { 0x04ED, 0x04ED }, { 0x04EF, 0x04EF }, { 0x04F1, 0x04F1 }, { 0x04F3, 0x04F3 }, { 0x04F5, 0x04F5 }, { 0x04F7, 0x04F7 }, { 0x04F9, 0x04F9 }, { 0x04FB, 0x04FB }, { 0x04FD, 0x04FD }, { 0x04FF, 0x04FF }, { 0x0501, 0x0501 }, { 0x0503, 0x0503 }, { 0x0505, 0x0505 }, { 0x0507, 0x0507 }, { 0x0509, 0x0509 }, { 0x050B, 0x050B }, { 0x050D, 0x050D }, { 0x050F, 0x050F }, { 0x0511, 0x0511 }, { 0x0513, 0x0513 }, { 0x0515, 0x0515 }, { 0x0517, 0x0517 }, { 0x0519, 0x0519 }, { 0x051B, 0x051B }, { 0x051D, 0x051D }, { 0x051F, 0x051F }, { 0x0521, 0x0521 }, { 0x0523, 0x0523 }, { 0x0525, 0x0525 }, { 0x0527, 0x0527 }, { 0x0529, 0x0529 }, { 0x052B, 0x052B }, { 0x052D, 0x052D }, { 0x052F, 0x052F }, { 0x0561, 0x0586 }, { 0x10D0, 0x10FA }, { 0x10FD, 0x10FF }, { 0x13F8, 0x13FD }, { 0x1C80, 0x1C88 }, { 0x1D79, 0x1D79 }, { 0x1D7D, 0x1D7D }, { 0x1D8E, 0x1D8E }, { 0x1E01, 0x1E01 }, { 0x1E03, 0x1E03 }, { 0x1E05, 0x1E05 }, { 0x1E07, 0x1E07 }, { 0x1E09, 0x1E09 }, { 0x1E0B, 0x1E0B }, { 0x1E0D, 0x1E0D }, { 0x1E0F, 0x1E0F }, { 0x1E11, 0x1E11 }, { 0x1E13, 0x1E13 }, { 0x1E15, 0x1E15 }, { 0x1E17, 0x1E17 }, { 0x1E19, 0x1E19 }, { 0x1E1B, 0x1E1B }, { 0x1E1D, 0x1E1D }, { 0x1E1F, 0x1E1F }, { 0x1E21, 0x1E21 }, { 0x1E23, 0x1E23 }, { 0x1E25, 0x1E25 }, { 0x1E27, 0x1E27 }, { 0x1E29, 0x1E29 }, { 0x1E2B, 0x1E2B }, { 0x1E2D, 0x1E2D }, { 0x1E2F, 0x1E2F }, { 0x1E31, 0x1E31 }, { 0x1E33, 0x1E33 }, { 0x1E35, 0x1E35 }, { 0x1E37, 0x1E37 }, { 0x1E39, 0x1E39 }, { 0x1E3B, 0x1E3B }, { 0x1E3D, 0x1E3D }, { 0x1E3F, 0x1E3F }, { 0x1E41, 0x1E41 }, { 0x1E43, 0x1E43 }, { 0x1E45, 0x1E45 }, { 0x1E47, 0x1E47 }, { 0x1E49, 0x1E49 }, { 0x1E4B, 0x1E4B }, { 0x1E4D, 0x1E4D }, { 0x1E4F, 0x1E4F }, { 0x1E51, 0x1E51 }, { 0x1E53, 0x1E53 }, { 0x1E55, 0x1E55 }, { 0x1E57, 0x1E57 }, { 0x1E59, 0x1E59 }, { 0x1E5B, 0x1E5B }, { 0x1E5D, 0x1E5D }, { 0x1E5F, 0x1E5F }, { 0x1E61, 0x1E61 }, { 0x1E63, 0x1E63 }, { 0x1E65, 0x1E65 }, { 0x1E67, 0x1E67 }, { 0x1E69, 0x1E69 }, { 0x1E6B, 0x1E6B }, { 0x1E6D, 0x1E6D }, { 0x1E6F, 0x1E6F }, { 0x1E71, 0x1E71 }, { 0x1E73, 0x1E73 }, { 0x1E75, 0x1E75 }, { 0x1E77, 0x1E77 }, { 0x1E79, 0x1E79 }, { 0x1E7B, 0x1E7B }, { 0x1E7D, 0x1E7D }, { 0x1E7F, 0x1E7F }, { 0x1E81, 0x1E81 }, { 0x1E83, 0x1E83 }, { 0x1E85, 0x1E85 }, { 0x1E87, 0x1E87 }, { 0x1E89, 0x1E89 }, { 0x1E8B, 0x1E8B }, { 0x1E8D, 0x1E8D }, { 0x1E8F, 0x1E8F }, { 0x1E91, 0x1E91 }, { 0x1E93, 0x1E93 }, { 0x1E95, 0x1E95 }, { 0x1E9B, 0x1E9B }, { 0x1EA1, 0x1EA1 }, { 0x1EA3, 0x1EA3 }, { 0x1EA5, 0x1EA5 }, { 0x1EA7, 0x1EA7 }, { 0x1EA9, 0x1EA9 }, { 0x1EAB, 0x1EAB }, { 0x1EAD, 0x1EAD }, { 0x1EAF, 0x1EAF }, { 0x1EB1, 0x1EB1 }, { 0x1EB3, 0x1EB3 }, { 0x1EB5, 0x1EB5 }, { 0x1EB7, 0x1EB7 }, { 0x1EB9, 0x1EB9 }, { 0x1EBB, 0x1EBB }, { 0x1EBD, 0x1EBD }, { 0x1EBF, 0x1EBF }, { 0x1EC1, 0x1EC1 }, { 0x1EC3, 0x1EC3 }, { 0x1EC5, 0x1EC5 }, { 0x1EC7, 0x1EC7 }, { 0x1EC9, 0x1EC9 }, { 0x1ECB, 0x1ECB }, { 0x1ECD, 0x1ECD }, { 0x1ECF, 0x1ECF }, { 0x1ED1, 0x1ED1 }, { 0x1ED3, 0x1ED3 }, { 0x1ED5, 0x1ED5 }, { 0x1ED7, 0x1ED7 }, { 0x1ED9, 0x1ED9 }, { 0x1EDB, 0x1EDB }, { 0x1EDD, 0x1EDD }, { 0x1EDF, 0x1EDF }, { 0x1EE1, 0x1EE1 }, { 0x1EE3, 0x1EE3 }, { 0x1EE5, 0x1EE5 }, { 0x1EE7, 0x1EE7 }, { 0x1EE9, 0x1EE9 }, { 0x1EEB, 0x1EEB }, { 0x1EED, 0x1EED }, { 0x1EEF, 0x1EEF }, { 0x1EF1, 0x1EF1 }, { 0x1EF3, 0x1EF3 }, { 0x1EF5, 0x1EF5 }, { 0x1EF7, 0x1EF7 }, { 0x1EF9, 0x1EF9 }, { 0x1EFB, 0x1EFB }, { 0x1EFD, 0x1EFD }, { 0x1EFF, 0x1F07 }, { 0x1F10, 0x1F15 }, { 0x1F20, 0x1F27 }, { 0x1F30, 0x1F37 }, { 0x1F40, 0x1F45 }, { 0x1F51, 0x1F51 }, { 0x1F53, 0x1F53 }, { 0x1F55, 0x1F55 }, { 0x1F57, 0x1F57 }, { 0x1F60, 0x1F67 }, { 0x1F70, 0x1F7D }, { 0x1F80, 0x1F87 }, { 0x1F90, 0x1F97 }, { 0x1FA0, 0x1FA7 }, { 0x1FB0, 0x1FB1 }, { 0x1FB3, 0x1FB3 }, { 0x1FBE, 0x1FBE }, { 0x1FC3, 0x1FC3 }, { 0x1FD0, 0x1FD1 }, { 0x1FE0, 0x1FE1 }, { 0x1FE5, 0x1FE5 }, { 0x1FF3, 0x1FF3 }, { 0x214E, 0x214E }, { 0x2170, 0x217F }, { 0x2184, 0x2184 }, { 0x24D0, 0x24E9 }, { 0x2C30, 0x2C5F }, { 0x2C61, 0x2C61 }, { 0x2C65, 0x2C66 }, { 0x2C68, 0x2C68 }, { 0x2C6A, 0x2C6A }, { 0x2C6C, 0x2C6C }, { 0x2C73, 0x2C73 }, { 0x2C76, 0x2C76 }, { 0x2C81, 0x2C81 }, { 0x2C83, 0x2C83 }, { 0x2C85, 0x2C85 }, { 0x2C87, 0x2C87 }, { 0x2C89, 0x2C89 }, { 0x2C8B, 0x2C8B }, { 0x2C8D, 0x2C8D }, { 0x2C8F, 0x2C8F }, { 0x2C91, 0x2C91 }, { 0x2C93, 0x2C93 }, { 0x2C95, 0x2C95 }, { 0x2C97, 0x2C97 }, { 0x2C99, 0x2C99 }, { 0x2C9B, 0x2C9B }, { 0x2C9D, 0x2C9D }, { 0x2C9F, 0x2C9F }, { 0x2CA1, 0x2CA1 }, { 0x2CA3, 0x2CA3 }, { 0x2CA5, 0x2CA5 }, { 0x2CA7, 0x2CA7 }, { 0x2CA9, 0x2CA9 }, { 0x2CAB, 0x2CAB }, { 0x2CAD, 0x2CAD }, { 0x2CAF, 0x2CAF }, { 0x2CB1, 0x2CB1 }, { 0x2CB3, 0x2CB3 }, { 0x2CB5, 0x2CB5 }, { 0x2CB7, 0x2CB7 }, { 0x2CB9, 0x2CB9 }, { 0x2CBB, 0x2CBB }, { 0x2CBD, 0x2CBD }, { 0x2CBF, 0x2CBF }, { 0x2CC1, 0x2CC1 }, { 0x2CC3, 0x2CC3 }, { 0x2CC5, 0x2CC5 }, { 0x2CC7, 0x2CC7 }, { 0x2CC9, 0x2CC9 }, { 0x2CCB, 0x2CCB }, { 0x2CCD, 0x2CCD }, { 0x2CCF, 0x2CCF }, { 0x2CD1, 0x2CD1 }, { 0x2CD3, 0x2CD3 }, { 0x2CD5, 0x2CD5 }, { 0x2CD7, 0x2CD7 }, { 0x2CD9, 0x2CD9 }, { 0x2CDB, 0x2CDB }, { 0x2CDD, 0x2CDD }, { 0x2CDF, 0x2CDF }, { 0x2CE1, 0x2CE1 }, { 0x2CE3, 0x2CE3 }, { 0x2CEC, 0x2CEC }, { 0x2CEE, 0x2CEE }, { 0x2CF3, 0x2CF3 }, { 0x2D00, 0x2D25 }, { 0x2D27, 0x2D27 }, { 0x2D2D, 0x2D2D }, { 0xA641, 0xA641 }, { 0xA643, 0xA643 }, { 0xA645, 0xA645 }, { 0xA647, 0xA647 }, { 0xA649, 0xA649 }, { 0xA64B, 0xA64B }, { 0xA64D, 0xA64D }, { 0xA64F, 0xA64F }, { 0xA651, 0xA651 }, { 0xA653, 0xA653 }, { 0xA655, 0xA655 }, { 0xA657, 0xA657 }, { 0xA659, 0xA659 }, { 0xA65B, 0xA65B }, { 0xA65D, 0xA65D }, { 0xA65F, 0xA65F }, { 0xA661, 0xA661 }, { 0xA663, 0xA663 }, { 0xA665, 0xA665 }, { 0xA667, 0xA667 }, { 0xA669, 0xA669 }, { 0xA66B, 0xA66B }, { 0xA66D, 0xA66D }, { 0xA681, 0xA681 }, { 0xA683, 0xA683 }, { 0xA685, 0xA685 }, { 0xA687, 0xA687 }, { 0xA689, 0xA689 }, { 0xA68B, 0xA68B }, { 0xA68D, 0xA68D }, { 0xA68F, 0xA68F }, { 0xA691, 0xA691 }, { 0xA693, 0xA693 }, { 0xA695, 0xA695 }, { 0xA697, 0xA697 }, { 0xA699, 0xA699 }, { 0xA69B, 0xA69B }, { 0xA723, 0xA723 }, { 0xA725, 0xA725 }, { 0xA727, 0xA727 }, { 0xA729, 0xA729 }, { 0xA72B, 0xA72B }, { 0xA72D, 0xA72D }, { 0xA72F, 0xA72F }, { 0xA733, 0xA733 }, { 0xA735, 0xA735 }, { 0xA737, 0xA737 }, { 0xA739, 0xA739 }, { 0xA73B, 0xA73B }, { 0xA73D, 0xA73D }, { 0xA73F, 0xA73F }, { 0xA741, 0xA741 }, { 0xA743, 0xA743 }, { 0xA745, 0xA745 }, { 0xA747, 0xA747 }, { 0xA749, 0xA749 }, { 0xA74B, 0xA74B }, { 0xA74D, 0xA74D }, { 0xA74F, 0xA74F }, { 0xA751, 0xA751 }, { 0xA753, 0xA753 }, { 0xA755, 0xA755 }, { 0xA757, 0xA757 }, { 0xA759, 0xA759 }, { 0xA75B, 0xA75B }, { 0xA75D, 0xA75D }, { 0xA75F, 0xA75F }, { 0xA761, 0xA761 }, { 0xA763, 0xA763 }, { 0xA765, 0xA765 }, { 0xA767, 0xA767 }, { 0xA769, 0xA769 }, { 0xA76B, 0xA76B }, { 0xA76D, 0xA76D }, { 0xA76F, 0xA76F }, { 0xA77A, 0xA77A }, { 0xA77C, 0xA77C }, { 0xA77F, 0xA77F }, { 0xA781, 0xA781 }, { 0xA783, 0xA783 }, { 0xA785, 0xA785 }, { 0xA787, 0xA787 }, { 0xA78C, 0xA78C }, { 0xA791, 0xA791 }, { 0xA793, 0xA794 }, { 0xA797, 0xA797 }, { 0xA799, 0xA799 }, { 0xA79B, 0xA79B }, { 0xA79D, 0xA79D }, { 0xA79F, 0xA79F }, { 0xA7A1, 0xA7A1 }, { 0xA7A3, 0xA7A3 }, { 0xA7A5, 0xA7A5 }, { 0xA7A7, 0xA7A7 }, { 0xA7A9, 0xA7A9 }, { 0xA7B5, 0xA7B5 }, { 0xA7B7, 0xA7B7 }, { 0xA7B9, 0xA7B9 }, { 0xA7BB, 0xA7BB }, { 0xA7BD, 0xA7BD }, { 0xA7BF, 0xA7BF }, { 0xA7C1, 0xA7C1 }, { 0xA7C3, 0xA7C3 }, { 0xA7C8, 0xA7C8 }, { 0xA7CA, 0xA7CA }, { 0xA7D1, 0xA7D1 }, { 0xA7D7, 0xA7D7 }, { 0xA7D9, 0xA7D9 }, { 0xA7F6, 0xA7F6 }, { 0xAB53, 0xAB53 }, { 0xAB70, 0xABBF }, { 0xFF41, 0xFF5A }, { 0x10428, 0x1044F }, { 0x104D8, 0x104FB }, { 0x10597, 0x105A1 }, { 0x105A3, 0x105B1 }, { 0x105B3, 0x105B9 }, { 0x105BB, 0x105BC }, { 0x10CC0, 0x10CF2 }, { 0x118C0, 0x118DF }, { 0x16E60, 0x16E7F }, { 0x1E922, 0x1E943 } }; MAKE_ISW(lower) #endif static const struct mb_ucsrange data_wctype_alpha[] = { { 0x0041, 0x005A }, { 0x005F, 0x005F }, { 0x0061, 0x007A }, { 0x00AA, 0x00AA }, { 0x00B5, 0x00B5 }, { 0x00BA, 0x00BA }, { 0x00C0, 0x00D6 }, { 0x00D8, 0x00F6 }, { 0x00F8, 0x02C1 }, { 0x02C6, 0x02D1 }, { 0x02E0, 0x02E4 }, { 0x02EC, 0x02EC }, { 0x02EE, 0x02EE }, { 0x0345, 0x0345 }, { 0x0370, 0x0374 }, { 0x0376, 0x0377 }, { 0x037A, 0x037D }, { 0x037F, 0x037F }, { 0x0386, 0x0386 }, { 0x0388, 0x038A }, { 0x038C, 0x038C }, { 0x038E, 0x03A1 }, { 0x03A3, 0x03F5 }, { 0x03F7, 0x0481 }, { 0x048A, 0x052F }, { 0x0531, 0x0556 }, { 0x0559, 0x0559 }, { 0x0560, 0x0588 }, { 0x05D0, 0x05EA }, { 0x05EF, 0x05F2 }, { 0x0620, 0x064A }, { 0x066E, 0x066F }, { 0x0671, 0x06D3 }, { 0x06D5, 0x06D5 }, { 0x06E5, 0x06E6 }, { 0x06EE, 0x06EF }, { 0x06FA, 0x06FC }, { 0x06FF, 0x06FF }, { 0x0710, 0x0710 }, { 0x0712, 0x072F }, { 0x074D, 0x07A5 }, { 0x07B1, 0x07B1 }, { 0x07CA, 0x07EA }, { 0x07F4, 0x07F5 }, { 0x07FA, 0x07FA }, { 0x0800, 0x0815 }, { 0x081A, 0x081A }, { 0x0824, 0x0824 }, { 0x0828, 0x0828 }, { 0x0840, 0x0858 }, { 0x0860, 0x086A }, { 0x0870, 0x0887 }, { 0x0889, 0x088E }, { 0x08A0, 0x08C9 }, { 0x0904, 0x0939 }, { 0x093D, 0x093D }, { 0x0950, 0x0950 }, { 0x0958, 0x0961 }, { 0x0971, 0x0980 }, { 0x0985, 0x098C }, { 0x098F, 0x0990 }, { 0x0993, 0x09A8 }, { 0x09AA, 0x09B0 }, { 0x09B2, 0x09B2 }, { 0x09B6, 0x09B9 }, { 0x09BD, 0x09BD }, { 0x09CE, 0x09CE }, { 0x09DC, 0x09DD }, { 0x09DF, 0x09E1 }, { 0x09F0, 0x09F1 }, { 0x09FC, 0x09FC }, { 0x0A05, 0x0A0A }, { 0x0A0F, 0x0A10 }, { 0x0A13, 0x0A28 }, { 0x0A2A, 0x0A30 }, { 0x0A32, 0x0A33 }, { 0x0A35, 0x0A36 }, { 0x0A38, 0x0A39 }, { 0x0A59, 0x0A5C }, { 0x0A5E, 0x0A5E }, { 0x0A72, 0x0A74 }, { 0x0A85, 0x0A8D }, { 0x0A8F, 0x0A91 }, { 0x0A93, 0x0AA8 }, { 0x0AAA, 0x0AB0 }, { 0x0AB2, 0x0AB3 }, { 0x0AB5, 0x0AB9 }, { 0x0ABD, 0x0ABD }, { 0x0AD0, 0x0AD0 }, { 0x0AE0, 0x0AE1 }, { 0x0AF9, 0x0AF9 }, { 0x0B05, 0x0B0C }, { 0x0B0F, 0x0B10 }, { 0x0B13, 0x0B28 }, { 0x0B2A, 0x0B30 }, { 0x0B32, 0x0B33 }, { 0x0B35, 0x0B39 }, { 0x0B3D, 0x0B3D }, { 0x0B5C, 0x0B5D }, { 0x0B5F, 0x0B61 }, { 0x0B71, 0x0B71 }, { 0x0B83, 0x0B83 }, { 0x0B85, 0x0B8A }, { 0x0B8E, 0x0B90 }, { 0x0B92, 0x0B95 }, { 0x0B99, 0x0B9A }, { 0x0B9C, 0x0B9C }, { 0x0B9E, 0x0B9F }, { 0x0BA3, 0x0BA4 }, { 0x0BA8, 0x0BAA }, { 0x0BAE, 0x0BB9 }, { 0x0BD0, 0x0BD0 }, { 0x0C05, 0x0C0C }, { 0x0C0E, 0x0C10 }, { 0x0C12, 0x0C28 }, { 0x0C2A, 0x0C39 }, { 0x0C3D, 0x0C3D }, { 0x0C58, 0x0C5A }, { 0x0C5D, 0x0C5D }, { 0x0C60, 0x0C61 }, { 0x0C80, 0x0C80 }, { 0x0C85, 0x0C8C }, { 0x0C8E, 0x0C90 }, { 0x0C92, 0x0CA8 }, { 0x0CAA, 0x0CB3 }, { 0x0CB5, 0x0CB9 }, { 0x0CBD, 0x0CBD }, { 0x0CDD, 0x0CDE }, { 0x0CE0, 0x0CE1 }, { 0x0CF1, 0x0CF2 }, { 0x0D04, 0x0D0C }, { 0x0D0E, 0x0D10 }, { 0x0D12, 0x0D3A }, { 0x0D3D, 0x0D3D }, { 0x0D4E, 0x0D4E }, { 0x0D54, 0x0D56 }, { 0x0D5F, 0x0D61 }, { 0x0D7A, 0x0D7F }, { 0x0D85, 0x0D96 }, { 0x0D9A, 0x0DB1 }, { 0x0DB3, 0x0DBB }, { 0x0DBD, 0x0DBD }, { 0x0DC0, 0x0DC6 }, { 0x0E01, 0x0E30 }, { 0x0E32, 0x0E33 }, { 0x0E40, 0x0E46 }, { 0x0E81, 0x0E82 }, { 0x0E84, 0x0E84 }, { 0x0E86, 0x0E8A }, { 0x0E8C, 0x0EA3 }, { 0x0EA5, 0x0EA5 }, { 0x0EA7, 0x0EB0 }, { 0x0EB2, 0x0EB3 }, { 0x0EBD, 0x0EBD }, { 0x0EC0, 0x0EC4 }, { 0x0EC6, 0x0EC6 }, { 0x0EDC, 0x0EDF }, { 0x0F00, 0x0F00 }, { 0x0F40, 0x0F47 }, { 0x0F49, 0x0F6C }, { 0x0F88, 0x0F8C }, { 0x1000, 0x102A }, { 0x103F, 0x103F }, { 0x1050, 0x1055 }, { 0x105A, 0x105D }, { 0x1061, 0x1061 }, { 0x1065, 0x1066 }, { 0x106E, 0x1070 }, { 0x1075, 0x1081 }, { 0x108E, 0x108E }, { 0x10A0, 0x10C5 }, { 0x10C7, 0x10C7 }, { 0x10CD, 0x10CD }, { 0x10D0, 0x10FA }, { 0x10FC, 0x1248 }, { 0x124A, 0x124D }, { 0x1250, 0x1256 }, { 0x1258, 0x1258 }, { 0x125A, 0x125D }, { 0x1260, 0x1288 }, { 0x128A, 0x128D }, { 0x1290, 0x12B0 }, { 0x12B2, 0x12B5 }, { 0x12B8, 0x12BE }, { 0x12C0, 0x12C0 }, { 0x12C2, 0x12C5 }, { 0x12C8, 0x12D6 }, { 0x12D8, 0x1310 }, { 0x1312, 0x1315 }, { 0x1318, 0x135A }, { 0x1380, 0x138F }, { 0x13A0, 0x13F5 }, { 0x13F8, 0x13FD }, { 0x1401, 0x166C }, { 0x166F, 0x167F }, { 0x1681, 0x169A }, { 0x16A0, 0x16EA }, { 0x16F1, 0x16F8 }, { 0x1700, 0x1711 }, { 0x171F, 0x1731 }, { 0x1740, 0x1751 }, { 0x1760, 0x176C }, { 0x176E, 0x1770 }, { 0x1780, 0x17B3 }, { 0x17D7, 0x17D7 }, { 0x17DC, 0x17DC }, { 0x1820, 0x1878 }, { 0x1880, 0x1884 }, { 0x1887, 0x18A8 }, { 0x18AA, 0x18AA }, { 0x18B0, 0x18F5 }, { 0x1900, 0x191E }, { 0x1950, 0x196D }, { 0x1970, 0x1974 }, { 0x1980, 0x19AB }, { 0x19B0, 0x19C9 }, { 0x1A00, 0x1A16 }, { 0x1A20, 0x1A54 }, { 0x1AA7, 0x1AA7 }, { 0x1B05, 0x1B33 }, { 0x1B45, 0x1B4C }, { 0x1B83, 0x1BA0 }, { 0x1BAE, 0x1BAF }, { 0x1BBA, 0x1BE5 }, { 0x1C00, 0x1C23 }, { 0x1C4D, 0x1C4F }, { 0x1C5A, 0x1C7D }, { 0x1C80, 0x1C88 }, { 0x1C90, 0x1CBA }, { 0x1CBD, 0x1CBF }, { 0x1CE9, 0x1CEC }, { 0x1CEE, 0x1CF3 }, { 0x1CF5, 0x1CF6 }, { 0x1CFA, 0x1CFA }, { 0x1D00, 0x1DBF }, { 0x1E00, 0x1F15 }, { 0x1F18, 0x1F1D }, { 0x1F20, 0x1F45 }, { 0x1F48, 0x1F4D }, { 0x1F50, 0x1F57 }, { 0x1F59, 0x1F59 }, { 0x1F5B, 0x1F5B }, { 0x1F5D, 0x1F5D }, { 0x1F5F, 0x1F7D }, { 0x1F80, 0x1FB4 }, { 0x1FB6, 0x1FBC }, { 0x1FBE, 0x1FBE }, { 0x1FC2, 0x1FC4 }, { 0x1FC6, 0x1FCC }, { 0x1FD0, 0x1FD3 }, { 0x1FD6, 0x1FDB }, { 0x1FE0, 0x1FEC }, { 0x1FF2, 0x1FF4 }, { 0x1FF6, 0x1FFC }, { 0x2071, 0x2071 }, { 0x207F, 0x207F }, { 0x2090, 0x209C }, { 0x2102, 0x2102 }, { 0x2107, 0x2107 }, { 0x210A, 0x2113 }, { 0x2115, 0x2115 }, { 0x2119, 0x211D }, { 0x2124, 0x2124 }, { 0x2126, 0x2126 }, { 0x2128, 0x2128 }, { 0x212A, 0x212D }, { 0x212F, 0x2139 }, { 0x213C, 0x213F }, { 0x2145, 0x2149 }, { 0x214E, 0x214E }, { 0x2160, 0x217F }, { 0x2183, 0x2184 }, { 0x24B6, 0x24E9 }, { 0x2C00, 0x2CE4 }, { 0x2CEB, 0x2CEE }, { 0x2CF2, 0x2CF3 }, { 0x2D00, 0x2D25 }, { 0x2D27, 0x2D27 }, { 0x2D2D, 0x2D2D }, { 0x2D30, 0x2D67 }, { 0x2D6F, 0x2D6F }, { 0x2D80, 0x2D96 }, { 0x2DA0, 0x2DA6 }, { 0x2DA8, 0x2DAE }, { 0x2DB0, 0x2DB6 }, { 0x2DB8, 0x2DBE }, { 0x2DC0, 0x2DC6 }, { 0x2DC8, 0x2DCE }, { 0x2DD0, 0x2DD6 }, { 0x2DD8, 0x2DDE }, { 0x2E2F, 0x2E2F }, { 0x3005, 0x3006 }, { 0x3031, 0x3035 }, { 0x303B, 0x303C }, { 0x3041, 0x3096 }, { 0x309D, 0x309F }, { 0x30A1, 0x30FA }, { 0x30FC, 0x30FF }, { 0x3105, 0x312F }, { 0x3131, 0x318E }, { 0x31A0, 0x31BF }, { 0x31F0, 0x31FF }, { 0x3400, 0x4DBF }, { 0x4E00, 0xA48C }, { 0xA4D0, 0xA4FD }, { 0xA500, 0xA60C }, { 0xA610, 0xA61F }, { 0xA62A, 0xA62B }, { 0xA640, 0xA66E }, { 0xA67F, 0xA69D }, { 0xA6A0, 0xA6E5 }, { 0xA717, 0xA71F }, { 0xA722, 0xA788 }, { 0xA78B, 0xA7CA }, { 0xA7D0, 0xA7D1 }, { 0xA7D3, 0xA7D3 }, { 0xA7D5, 0xA7D9 }, { 0xA7F2, 0xA801 }, { 0xA803, 0xA805 }, { 0xA807, 0xA80A }, { 0xA80C, 0xA822 }, { 0xA840, 0xA873 }, { 0xA882, 0xA8B3 }, { 0xA8F2, 0xA8F7 }, { 0xA8FB, 0xA8FB }, { 0xA8FD, 0xA8FE }, { 0xA90A, 0xA925 }, { 0xA930, 0xA946 }, { 0xA960, 0xA97C }, { 0xA984, 0xA9B2 }, { 0xA9CF, 0xA9CF }, { 0xA9E0, 0xA9E4 }, { 0xA9E6, 0xA9EF }, { 0xA9FA, 0xA9FE }, { 0xAA00, 0xAA28 }, { 0xAA40, 0xAA42 }, { 0xAA44, 0xAA4B }, { 0xAA60, 0xAA76 }, { 0xAA7A, 0xAA7A }, { 0xAA7E, 0xAAAF }, { 0xAAB1, 0xAAB1 }, { 0xAAB5, 0xAAB6 }, { 0xAAB9, 0xAABD }, { 0xAAC0, 0xAAC0 }, { 0xAAC2, 0xAAC2 }, { 0xAADB, 0xAADD }, { 0xAAE0, 0xAAEA }, { 0xAAF2, 0xAAF4 }, { 0xAB01, 0xAB06 }, { 0xAB09, 0xAB0E }, { 0xAB11, 0xAB16 }, { 0xAB20, 0xAB26 }, { 0xAB28, 0xAB2E }, { 0xAB30, 0xAB5A }, { 0xAB5C, 0xAB69 }, { 0xAB70, 0xABE2 }, { 0xAC00, 0xD7A3 }, { 0xD7B0, 0xD7C6 }, { 0xD7CB, 0xD7FB }, { 0xF900, 0xFA6D }, { 0xFA70, 0xFAD9 }, { 0xFB00, 0xFB06 }, { 0xFB13, 0xFB17 }, { 0xFB1D, 0xFB1D }, { 0xFB1F, 0xFB28 }, { 0xFB2A, 0xFB36 }, { 0xFB38, 0xFB3C }, { 0xFB3E, 0xFB3E }, { 0xFB40, 0xFB41 }, { 0xFB43, 0xFB44 }, { 0xFB46, 0xFBB1 }, { 0xFBD3, 0xFD3D }, { 0xFD50, 0xFD8F }, { 0xFD92, 0xFDC7 }, { 0xFDF0, 0xFDFB }, { 0xFE70, 0xFE74 }, { 0xFE76, 0xFEFC }, { 0xFF21, 0xFF3A }, { 0xFF41, 0xFF5A }, { 0xFF66, 0xFFBE }, { 0xFFC2, 0xFFC7 }, { 0xFFCA, 0xFFCF }, { 0xFFD2, 0xFFD7 }, { 0xFFDA, 0xFFDC }, { 0x10000, 0x1000B }, { 0x1000D, 0x10026 }, { 0x10028, 0x1003A }, { 0x1003C, 0x1003D }, { 0x1003F, 0x1004D }, { 0x10050, 0x1005D }, { 0x10080, 0x100FA }, { 0x10280, 0x1029C }, { 0x102A0, 0x102D0 }, { 0x10300, 0x1031F }, { 0x1032D, 0x10340 }, { 0x10342, 0x10349 }, { 0x10350, 0x10375 }, { 0x10380, 0x1039D }, { 0x103A0, 0x103C3 }, { 0x103C8, 0x103CF }, { 0x10400, 0x1049D }, { 0x104B0, 0x104D3 }, { 0x104D8, 0x104FB }, { 0x10500, 0x10527 }, { 0x10530, 0x10563 }, { 0x10570, 0x1057A }, { 0x1057C, 0x1058A }, { 0x1058C, 0x10592 }, { 0x10594, 0x10595 }, { 0x10597, 0x105A1 }, { 0x105A3, 0x105B1 }, { 0x105B3, 0x105B9 }, { 0x105BB, 0x105BC }, { 0x10600, 0x10736 }, { 0x10740, 0x10755 }, { 0x10760, 0x10767 }, { 0x10780, 0x10785 }, { 0x10787, 0x107B0 }, { 0x107B2, 0x107BA }, { 0x10800, 0x10805 }, { 0x10808, 0x10808 }, { 0x1080A, 0x10835 }, { 0x10837, 0x10838 }, { 0x1083C, 0x1083C }, { 0x1083F, 0x10855 }, { 0x10860, 0x10876 }, { 0x10880, 0x1089E }, { 0x108E0, 0x108F2 }, { 0x108F4, 0x108F5 }, { 0x10900, 0x10915 }, { 0x10920, 0x10939 }, { 0x10980, 0x109B7 }, { 0x109BE, 0x109BF }, { 0x10A00, 0x10A00 }, { 0x10A10, 0x10A13 }, { 0x10A15, 0x10A17 }, { 0x10A19, 0x10A35 }, { 0x10A60, 0x10A7C }, { 0x10A80, 0x10A9C }, { 0x10AC0, 0x10AC7 }, { 0x10AC9, 0x10AE4 }, { 0x10B00, 0x10B35 }, { 0x10B40, 0x10B55 }, { 0x10B60, 0x10B72 }, { 0x10B80, 0x10B91 }, { 0x10C00, 0x10C48 }, { 0x10C80, 0x10CB2 }, { 0x10CC0, 0x10CF2 }, { 0x10D00, 0x10D23 }, { 0x10E80, 0x10EA9 }, { 0x10EB0, 0x10EB1 }, { 0x10F00, 0x10F1C }, { 0x10F27, 0x10F27 }, { 0x10F30, 0x10F45 }, { 0x10F70, 0x10F81 }, { 0x10FB0, 0x10FC4 }, { 0x10FE0, 0x10FF6 }, { 0x11003, 0x11037 }, { 0x11071, 0x11072 }, { 0x11075, 0x11075 }, { 0x11083, 0x110AF }, { 0x110D0, 0x110E8 }, { 0x11103, 0x11126 }, { 0x11144, 0x11144 }, { 0x11147, 0x11147 }, { 0x11150, 0x11172 }, { 0x11176, 0x11176 }, { 0x11183, 0x111B2 }, { 0x111C1, 0x111C4 }, { 0x111DA, 0x111DA }, { 0x111DC, 0x111DC }, { 0x11200, 0x11211 }, { 0x11213, 0x1122B }, { 0x1123F, 0x11240 }, { 0x11280, 0x11286 }, { 0x11288, 0x11288 }, { 0x1128A, 0x1128D }, { 0x1128F, 0x1129D }, { 0x1129F, 0x112A8 }, { 0x112B0, 0x112DE }, { 0x11305, 0x1130C }, { 0x1130F, 0x11310 }, { 0x11313, 0x11328 }, { 0x1132A, 0x11330 }, { 0x11332, 0x11333 }, { 0x11335, 0x11339 }, { 0x1133D, 0x1133D }, { 0x11350, 0x11350 }, { 0x1135D, 0x11361 }, { 0x11400, 0x11434 }, { 0x11447, 0x1144A }, { 0x1145F, 0x11461 }, { 0x11480, 0x114AF }, { 0x114C4, 0x114C5 }, { 0x114C7, 0x114C7 }, { 0x11580, 0x115AE }, { 0x115D8, 0x115DB }, { 0x11600, 0x1162F }, { 0x11644, 0x11644 }, { 0x11680, 0x116AA }, { 0x116B8, 0x116B8 }, { 0x11700, 0x1171A }, { 0x11740, 0x11746 }, { 0x11800, 0x1182B }, { 0x118A0, 0x118DF }, { 0x118FF, 0x11906 }, { 0x11909, 0x11909 }, { 0x1190C, 0x11913 }, { 0x11915, 0x11916 }, { 0x11918, 0x1192F }, { 0x1193F, 0x1193F }, { 0x11941, 0x11941 }, { 0x119A0, 0x119A7 }, { 0x119AA, 0x119D0 }, { 0x119E1, 0x119E1 }, { 0x119E3, 0x119E3 }, { 0x11A00, 0x11A00 }, { 0x11A0B, 0x11A32 }, { 0x11A3A, 0x11A3A }, { 0x11A50, 0x11A50 }, { 0x11A5C, 0x11A89 }, { 0x11A9D, 0x11A9D }, { 0x11AB0, 0x11AF8 }, { 0x11C00, 0x11C08 }, { 0x11C0A, 0x11C2E }, { 0x11C40, 0x11C40 }, { 0x11C72, 0x11C8F }, { 0x11D00, 0x11D06 }, { 0x11D08, 0x11D09 }, { 0x11D0B, 0x11D30 }, { 0x11D46, 0x11D46 }, { 0x11D60, 0x11D65 }, { 0x11D67, 0x11D68 }, { 0x11D6A, 0x11D89 }, { 0x11D98, 0x11D98 }, { 0x11EE0, 0x11EF2 }, { 0x11F02, 0x11F02 }, { 0x11F04, 0x11F10 }, { 0x11F12, 0x11F33 }, { 0x11FB0, 0x11FB0 }, { 0x12000, 0x12399 }, { 0x12480, 0x12543 }, { 0x12F90, 0x12FF0 }, { 0x13000, 0x1342F }, { 0x13441, 0x13446 }, { 0x14400, 0x14646 }, { 0x16800, 0x16A38 }, { 0x16A40, 0x16A5E }, { 0x16A70, 0x16ABE }, { 0x16AD0, 0x16AED }, { 0x16B00, 0x16B2F }, { 0x16B40, 0x16B43 }, { 0x16B63, 0x16B77 }, { 0x16B7D, 0x16B8F }, { 0x16E40, 0x16E7F }, { 0x16F00, 0x16F4A }, { 0x16F50, 0x16F50 }, { 0x16F93, 0x16F9F }, { 0x16FE0, 0x16FE1 }, { 0x16FE3, 0x16FE3 }, { 0x17000, 0x187F7 }, { 0x18800, 0x18CD5 }, { 0x18D00, 0x18D08 }, { 0x1AFF0, 0x1AFF3 }, { 0x1AFF5, 0x1AFFB }, { 0x1AFFD, 0x1AFFE }, { 0x1B000, 0x1B122 }, { 0x1B132, 0x1B132 }, { 0x1B150, 0x1B152 }, { 0x1B155, 0x1B155 }, { 0x1B164, 0x1B167 }, { 0x1B170, 0x1B2FB }, { 0x1BC00, 0x1BC6A }, { 0x1BC70, 0x1BC7C }, { 0x1BC80, 0x1BC88 }, { 0x1BC90, 0x1BC99 }, { 0x1D400, 0x1D454 }, { 0x1D456, 0x1D49C }, { 0x1D49E, 0x1D49F }, { 0x1D4A2, 0x1D4A2 }, { 0x1D4A5, 0x1D4A6 }, { 0x1D4A9, 0x1D4AC }, { 0x1D4AE, 0x1D4B9 }, { 0x1D4BB, 0x1D4BB }, { 0x1D4BD, 0x1D4C3 }, { 0x1D4C5, 0x1D505 }, { 0x1D507, 0x1D50A }, { 0x1D50D, 0x1D514 }, { 0x1D516, 0x1D51C }, { 0x1D51E, 0x1D539 }, { 0x1D53B, 0x1D53E }, { 0x1D540, 0x1D544 }, { 0x1D546, 0x1D546 }, { 0x1D54A, 0x1D550 }, { 0x1D552, 0x1D6A5 }, { 0x1D6A8, 0x1D6C0 }, { 0x1D6C2, 0x1D6DA }, { 0x1D6DC, 0x1D6FA }, { 0x1D6FC, 0x1D714 }, { 0x1D716, 0x1D734 }, { 0x1D736, 0x1D74E }, { 0x1D750, 0x1D76E }, { 0x1D770, 0x1D788 }, { 0x1D78A, 0x1D7A8 }, { 0x1D7AA, 0x1D7C2 }, { 0x1D7C4, 0x1D7CB }, { 0x1DF00, 0x1DF1E }, { 0x1DF25, 0x1DF2A }, { 0x1E030, 0x1E06D }, { 0x1E100, 0x1E12C }, { 0x1E137, 0x1E13D }, { 0x1E14E, 0x1E14E }, { 0x1E290, 0x1E2AD }, { 0x1E2C0, 0x1E2EB }, { 0x1E4D0, 0x1E4EB }, { 0x1E7E0, 0x1E7E6 }, { 0x1E7E8, 0x1E7EB }, { 0x1E7ED, 0x1E7EE }, { 0x1E7F0, 0x1E7FE }, { 0x1E800, 0x1E8C4 }, { 0x1E900, 0x1E943 }, { 0x1E94B, 0x1E94B }, { 0x1EE00, 0x1EE03 }, { 0x1EE05, 0x1EE1F }, { 0x1EE21, 0x1EE22 }, { 0x1EE24, 0x1EE24 }, { 0x1EE27, 0x1EE27 }, { 0x1EE29, 0x1EE32 }, { 0x1EE34, 0x1EE37 }, { 0x1EE39, 0x1EE39 }, { 0x1EE3B, 0x1EE3B }, { 0x1EE42, 0x1EE42 }, { 0x1EE47, 0x1EE47 }, { 0x1EE49, 0x1EE49 }, { 0x1EE4B, 0x1EE4B }, { 0x1EE4D, 0x1EE4F }, { 0x1EE51, 0x1EE52 }, { 0x1EE54, 0x1EE54 }, { 0x1EE57, 0x1EE57 }, { 0x1EE59, 0x1EE59 }, { 0x1EE5B, 0x1EE5B }, { 0x1EE5D, 0x1EE5D }, { 0x1EE5F, 0x1EE5F }, { 0x1EE61, 0x1EE62 }, { 0x1EE64, 0x1EE64 }, { 0x1EE67, 0x1EE6A }, { 0x1EE6C, 0x1EE72 }, { 0x1EE74, 0x1EE77 }, { 0x1EE79, 0x1EE7C }, { 0x1EE7E, 0x1EE7E }, { 0x1EE80, 0x1EE89 }, { 0x1EE8B, 0x1EE9B }, { 0x1EEA1, 0x1EEA3 }, { 0x1EEA5, 0x1EEA9 }, { 0x1EEAB, 0x1EEBB }, { 0x20000, 0x2A6DF }, { 0x2A700, 0x2B739 }, { 0x2B740, 0x2B81D }, { 0x2B820, 0x2CEA1 }, { 0x2CEB0, 0x2EBE0 }, { 0x2F800, 0x2FA1D }, { 0x30000, 0x3134A }, { 0x31350, 0x323AF } }; MAKE_ISW(alpha) int joe_iswalnum(int c) { return ((c >= 0x30 && c <= 0x39) ? 1 : joe_iswalpha(c)); } int joe_iswdigit(int c) { return ((c >= 0x30 && c <= 0x39) ? 1 : 0); } static const struct mb_ucsrange data_wctype_space[] = { { 0x0009, 0x000D }, { 0x0020, 0x0020 }, { 0x1680, 0x1680 }, { 0x2000, 0x2006 }, { 0x2008, 0x200B }, { 0x2028, 0x2029 }, { 0x205F, 0x205F }, { 0x3000, 0x3000 } }; MAKE_ISW(space) #ifdef TEST_I18N static const struct mb_ucsrange data_wctype_cntrl[] = { { 0x0000, 0x001F }, { 0x007F, 0x009F }, { 0x2028, 0x2029 } }; MAKE_ISW(cntrl) #endif static const struct mb_ucsrange data_wctype_punct[] = { { 0x0021, 0x002F }, { 0x003A, 0x0040 }, { 0x005B, 0x0060 }, { 0x007B, 0x007E }, { 0x00A0, 0x00A9 }, { 0x00AB, 0x00B4 }, { 0x00B6, 0x00B9 }, { 0x00BB, 0x00BF }, { 0x00D7, 0x00D7 }, { 0x00F7, 0x00F7 }, { 0x02C2, 0x02C5 }, { 0x02D2, 0x02DF }, { 0x02E5, 0x02EB }, { 0x02ED, 0x02ED }, { 0x02EF, 0x0344 }, { 0x0346, 0x036F }, { 0x0375, 0x0375 }, { 0x037E, 0x037E }, { 0x0384, 0x0385 }, { 0x0387, 0x0387 }, { 0x03F6, 0x03F6 }, { 0x0482, 0x0489 }, { 0x055A, 0x055F }, { 0x0589, 0x058A }, { 0x058D, 0x058F }, { 0x0591, 0x05C7 }, { 0x05F3, 0x05F4 }, { 0x0600, 0x061F }, { 0x064B, 0x066D }, { 0x0670, 0x0670 }, { 0x06D4, 0x06D4 }, { 0x06D6, 0x06E4 }, { 0x06E7, 0x06ED }, { 0x06F0, 0x06F9 }, { 0x06FD, 0x06FE }, { 0x0700, 0x070D }, { 0x070F, 0x070F }, { 0x0711, 0x0711 }, { 0x0730, 0x074A }, { 0x07A6, 0x07B0 }, { 0x07C0, 0x07C9 }, { 0x07EB, 0x07F3 }, { 0x07F6, 0x07F9 }, { 0x07FD, 0x07FF }, { 0x0816, 0x0819 }, { 0x081B, 0x0823 }, { 0x0825, 0x0827 }, { 0x0829, 0x082D }, { 0x0830, 0x083E }, { 0x0859, 0x085B }, { 0x085E, 0x085E }, { 0x0888, 0x0888 }, { 0x0890, 0x0891 }, { 0x0898, 0x089F }, { 0x08CA, 0x0903 }, { 0x093A, 0x093C }, { 0x093E, 0x094F }, { 0x0951, 0x0957 }, { 0x0962, 0x0970 }, { 0x0981, 0x0983 }, { 0x09BC, 0x09BC }, { 0x09BE, 0x09C4 }, { 0x09C7, 0x09C8 }, { 0x09CB, 0x09CD }, { 0x09D7, 0x09D7 }, { 0x09E2, 0x09E3 }, { 0x09E6, 0x09EF }, { 0x09F2, 0x09FB }, { 0x09FD, 0x09FE }, { 0x0A01, 0x0A03 }, { 0x0A3C, 0x0A3C }, { 0x0A3E, 0x0A42 }, { 0x0A47, 0x0A48 }, { 0x0A4B, 0x0A4D }, { 0x0A51, 0x0A51 }, { 0x0A66, 0x0A71 }, { 0x0A75, 0x0A76 }, { 0x0A81, 0x0A83 }, { 0x0ABC, 0x0ABC }, { 0x0ABE, 0x0AC5 }, { 0x0AC7, 0x0AC9 }, { 0x0ACB, 0x0ACD }, { 0x0AE2, 0x0AE3 }, { 0x0AE6, 0x0AF1 }, { 0x0AFA, 0x0AFF }, { 0x0B01, 0x0B03 }, { 0x0B3C, 0x0B3C }, { 0x0B3E, 0x0B44 }, { 0x0B47, 0x0B48 }, { 0x0B4B, 0x0B4D }, { 0x0B55, 0x0B57 }, { 0x0B62, 0x0B63 }, { 0x0B66, 0x0B70 }, { 0x0B72, 0x0B77 }, { 0x0B82, 0x0B82 }, { 0x0BBE, 0x0BC2 }, { 0x0BC6, 0x0BC8 }, { 0x0BCA, 0x0BCD }, { 0x0BD7, 0x0BD7 }, { 0x0BE6, 0x0BFA }, { 0x0C00, 0x0C04 }, { 0x0C3C, 0x0C3C }, { 0x0C3E, 0x0C44 }, { 0x0C46, 0x0C48 }, { 0x0C4A, 0x0C4D }, { 0x0C55, 0x0C56 }, { 0x0C62, 0x0C63 }, { 0x0C66, 0x0C6F }, { 0x0C77, 0x0C7F }, { 0x0C81, 0x0C84 }, { 0x0CBC, 0x0CBC }, { 0x0CBE, 0x0CC4 }, { 0x0CC6, 0x0CC8 }, { 0x0CCA, 0x0CCD }, { 0x0CD5, 0x0CD6 }, { 0x0CE2, 0x0CE3 }, { 0x0CE6, 0x0CEF }, { 0x0CF3, 0x0CF3 }, { 0x0D00, 0x0D03 }, { 0x0D3B, 0x0D3C }, { 0x0D3E, 0x0D44 }, { 0x0D46, 0x0D48 }, { 0x0D4A, 0x0D4D }, { 0x0D4F, 0x0D4F }, { 0x0D57, 0x0D5E }, { 0x0D62, 0x0D63 }, { 0x0D66, 0x0D79 }, { 0x0D81, 0x0D83 }, { 0x0DCA, 0x0DCA }, { 0x0DCF, 0x0DD4 }, { 0x0DD6, 0x0DD6 }, { 0x0DD8, 0x0DDF }, { 0x0DE6, 0x0DEF }, { 0x0DF2, 0x0DF4 }, { 0x0E31, 0x0E31 }, { 0x0E34, 0x0E3A }, { 0x0E3F, 0x0E3F }, { 0x0E47, 0x0E5B }, { 0x0EB1, 0x0EB1 }, { 0x0EB4, 0x0EBC }, { 0x0EC8, 0x0ECE }, { 0x0ED0, 0x0ED9 }, { 0x0F01, 0x0F3F }, { 0x0F71, 0x0F87 }, { 0x0F8D, 0x0F97 }, { 0x0F99, 0x0FBC }, { 0x0FBE, 0x0FCC }, { 0x0FCE, 0x0FDA }, { 0x102B, 0x103E }, { 0x1040, 0x104F }, { 0x1056, 0x1059 }, { 0x105E, 0x1060 }, { 0x1062, 0x1064 }, { 0x1067, 0x106D }, { 0x1071, 0x1074 }, { 0x1082, 0x108D }, { 0x108F, 0x109F }, { 0x10FB, 0x10FB }, { 0x135D, 0x137C }, { 0x1390, 0x1399 }, { 0x1400, 0x1400 }, { 0x166D, 0x166E }, { 0x1680, 0x1680 }, { 0x169B, 0x169C }, { 0x16EB, 0x16F0 }, { 0x1712, 0x1715 }, { 0x1732, 0x1736 }, { 0x1752, 0x1753 }, { 0x1772, 0x1773 }, { 0x17B4, 0x17D6 }, { 0x17D8, 0x17DB }, { 0x17DD, 0x17DD }, { 0x17E0, 0x17E9 }, { 0x17F0, 0x17F9 }, { 0x1800, 0x1819 }, { 0x1885, 0x1886 }, { 0x18A9, 0x18A9 }, { 0x1920, 0x192B }, { 0x1930, 0x193B }, { 0x1940, 0x1940 }, { 0x1944, 0x194F }, { 0x19D0, 0x19DA }, { 0x19DE, 0x19FF }, { 0x1A17, 0x1A1B }, { 0x1A1E, 0x1A1F }, { 0x1A55, 0x1A5E }, { 0x1A60, 0x1A7C }, { 0x1A7F, 0x1A89 }, { 0x1A90, 0x1A99 }, { 0x1AA0, 0x1AA6 }, { 0x1AA8, 0x1AAD }, { 0x1AB0, 0x1ACE }, { 0x1B00, 0x1B04 }, { 0x1B34, 0x1B44 }, { 0x1B50, 0x1B7E }, { 0x1B80, 0x1B82 }, { 0x1BA1, 0x1BAD }, { 0x1BB0, 0x1BB9 }, { 0x1BE6, 0x1BF3 }, { 0x1BFC, 0x1BFF }, { 0x1C24, 0x1C37 }, { 0x1C3B, 0x1C49 }, { 0x1C50, 0x1C59 }, { 0x1C7E, 0x1C7F }, { 0x1CC0, 0x1CC7 }, { 0x1CD0, 0x1CE8 }, { 0x1CED, 0x1CED }, { 0x1CF4, 0x1CF4 }, { 0x1CF7, 0x1CF9 }, { 0x1DC0, 0x1DFF }, { 0x1FBD, 0x1FBD }, { 0x1FBF, 0x1FC1 }, { 0x1FCD, 0x1FCF }, { 0x1FDD, 0x1FDF }, { 0x1FED, 0x1FEF }, { 0x1FFD, 0x1FFE }, { 0x2000, 0x2064 }, { 0x2066, 0x2070 }, { 0x2074, 0x207E }, { 0x2080, 0x208E }, { 0x20A0, 0x20C0 }, { 0x20D0, 0x20F0 }, { 0x2100, 0x2101 }, { 0x2103, 0x2106 }, { 0x2108, 0x2109 }, { 0x2114, 0x2114 }, { 0x2116, 0x2118 }, { 0x211E, 0x2123 }, { 0x2125, 0x2125 }, { 0x2127, 0x2127 }, { 0x2129, 0x2129 }, { 0x212E, 0x212E }, { 0x213A, 0x213B }, { 0x2140, 0x2144 }, { 0x214A, 0x214D }, { 0x214F, 0x215F }, { 0x2180, 0x2182 }, { 0x2185, 0x218B }, { 0x2190, 0x2426 }, { 0x2440, 0x244A }, { 0x2460, 0x24B5 }, { 0x24EA, 0x2B73 }, { 0x2B76, 0x2B95 }, { 0x2B97, 0x2BFF }, { 0x2CE5, 0x2CEA }, { 0x2CEF, 0x2CF1 }, { 0x2CF9, 0x2CFF }, { 0x2D70, 0x2D70 }, { 0x2D7F, 0x2D7F }, { 0x2DE0, 0x2E2E }, { 0x2E30, 0x2E5D }, { 0x2E80, 0x2E99 }, { 0x2E9B, 0x2EF3 }, { 0x2F00, 0x2FD5 }, { 0x2FF0, 0x2FFB }, { 0x3000, 0x3004 }, { 0x3007, 0x3030 }, { 0x3036, 0x303A }, { 0x303D, 0x303F }, { 0x3099, 0x309C }, { 0x30A0, 0x30A0 }, { 0x30FB, 0x30FB }, { 0x3190, 0x319F }, { 0x31C0, 0x31E3 }, { 0x3200, 0x321E }, { 0x3220, 0x33FF }, { 0x4DC0, 0x4DFF }, { 0xA490, 0xA4C6 }, { 0xA4FE, 0xA4FF }, { 0xA60D, 0xA60F }, { 0xA620, 0xA629 }, { 0xA66F, 0xA67E }, { 0xA69E, 0xA69F }, { 0xA6E6, 0xA6F7 }, { 0xA700, 0xA716 }, { 0xA720, 0xA721 }, { 0xA789, 0xA78A }, { 0xA802, 0xA802 }, { 0xA806, 0xA806 }, { 0xA80B, 0xA80B }, { 0xA823, 0xA82C }, { 0xA830, 0xA839 }, { 0xA874, 0xA877 }, { 0xA880, 0xA881 }, { 0xA8B4, 0xA8C5 }, { 0xA8CE, 0xA8D9 }, { 0xA8E0, 0xA8F1 }, { 0xA8F8, 0xA8FA }, { 0xA8FC, 0xA8FC }, { 0xA8FF, 0xA909 }, { 0xA926, 0xA92F }, { 0xA947, 0xA953 }, { 0xA95F, 0xA95F }, { 0xA980, 0xA983 }, { 0xA9B3, 0xA9CD }, { 0xA9D0, 0xA9D9 }, { 0xA9DE, 0xA9DF }, { 0xA9E5, 0xA9E5 }, { 0xA9F0, 0xA9F9 }, { 0xAA29, 0xAA36 }, { 0xAA43, 0xAA43 }, { 0xAA4C, 0xAA4D }, { 0xAA50, 0xAA59 }, { 0xAA5C, 0xAA5F }, { 0xAA77, 0xAA79 }, { 0xAA7B, 0xAA7D }, { 0xAAB0, 0xAAB0 }, { 0xAAB2, 0xAAB4 }, { 0xAAB7, 0xAAB8 }, { 0xAABE, 0xAABF }, { 0xAAC1, 0xAAC1 }, { 0xAADE, 0xAADF }, { 0xAAEB, 0xAAF1 }, { 0xAAF5, 0xAAF6 }, { 0xAB5B, 0xAB5B }, { 0xAB6A, 0xAB6B }, { 0xABE3, 0xABED }, { 0xABF0, 0xABF9 }, { 0xE000, 0xF8FF }, { 0xFB1E, 0xFB1E }, { 0xFB29, 0xFB29 }, { 0xFBB2, 0xFBC2 }, { 0xFD3E, 0xFD4F }, { 0xFDCF, 0xFDCF }, { 0xFDFC, 0xFE19 }, { 0xFE20, 0xFE52 }, { 0xFE54, 0xFE66 }, { 0xFE68, 0xFE6B }, { 0xFEFF, 0xFEFF }, { 0xFF01, 0xFF20 }, { 0xFF3B, 0xFF40 }, { 0xFF5B, 0xFF65 }, { 0xFFE0, 0xFFE6 }, { 0xFFE8, 0xFFEE }, { 0xFFF9, 0xFFFD }, { 0x10100, 0x10102 }, { 0x10107, 0x10133 }, { 0x10137, 0x1018E }, { 0x10190, 0x1019C }, { 0x101A0, 0x101A0 }, { 0x101D0, 0x101FD }, { 0x102E0, 0x102FB }, { 0x10320, 0x10323 }, { 0x10341, 0x10341 }, { 0x1034A, 0x1034A }, { 0x10376, 0x1037A }, { 0x1039F, 0x1039F }, { 0x103D0, 0x103D5 }, { 0x104A0, 0x104A9 }, { 0x1056F, 0x1056F }, { 0x10857, 0x1085F }, { 0x10877, 0x1087F }, { 0x108A7, 0x108AF }, { 0x108FB, 0x108FF }, { 0x10916, 0x1091B }, { 0x1091F, 0x1091F }, { 0x1093F, 0x1093F }, { 0x109BC, 0x109BD }, { 0x109C0, 0x109CF }, { 0x109D2, 0x109FF }, { 0x10A01, 0x10A03 }, { 0x10A05, 0x10A06 }, { 0x10A0C, 0x10A0F }, { 0x10A38, 0x10A3A }, { 0x10A3F, 0x10A48 }, { 0x10A50, 0x10A58 }, { 0x10A7D, 0x10A7F }, { 0x10A9D, 0x10A9F }, { 0x10AC8, 0x10AC8 }, { 0x10AE5, 0x10AE6 }, { 0x10AEB, 0x10AF6 }, { 0x10B39, 0x10B3F }, { 0x10B58, 0x10B5F }, { 0x10B78, 0x10B7F }, { 0x10B99, 0x10B9C }, { 0x10BA9, 0x10BAF }, { 0x10CFA, 0x10CFF }, { 0x10D24, 0x10D27 }, { 0x10D30, 0x10D39 }, { 0x10E60, 0x10E7E }, { 0x10EAB, 0x10EAD }, { 0x10EFD, 0x10EFF }, { 0x10F1D, 0x10F26 }, { 0x10F46, 0x10F59 }, { 0x10F82, 0x10F89 }, { 0x10FC5, 0x10FCB }, { 0x11000, 0x11002 }, { 0x11038, 0x1104D }, { 0x11052, 0x11070 }, { 0x11073, 0x11074 }, { 0x1107F, 0x11082 }, { 0x110B0, 0x110C2 }, { 0x110CD, 0x110CD }, { 0x110F0, 0x110F9 }, { 0x11100, 0x11102 }, { 0x11127, 0x11134 }, { 0x11136, 0x11143 }, { 0x11145, 0x11146 }, { 0x11173, 0x11175 }, { 0x11180, 0x11182 }, { 0x111B3, 0x111C0 }, { 0x111C5, 0x111D9 }, { 0x111DB, 0x111DB }, { 0x111DD, 0x111DF }, { 0x111E1, 0x111F4 }, { 0x1122C, 0x1123E }, { 0x11241, 0x11241 }, { 0x112A9, 0x112A9 }, { 0x112DF, 0x112EA }, { 0x112F0, 0x112F9 }, { 0x11300, 0x11303 }, { 0x1133B, 0x1133C }, { 0x1133E, 0x11344 }, { 0x11347, 0x11348 }, { 0x1134B, 0x1134D }, { 0x11357, 0x11357 }, { 0x11362, 0x11363 }, { 0x11366, 0x1136C }, { 0x11370, 0x11374 }, { 0x11435, 0x11446 }, { 0x1144B, 0x1145B }, { 0x1145D, 0x1145E }, { 0x114B0, 0x114C3 }, { 0x114C6, 0x114C6 }, { 0x114D0, 0x114D9 }, { 0x115AF, 0x115B5 }, { 0x115B8, 0x115D7 }, { 0x115DC, 0x115DD }, { 0x11630, 0x11643 }, { 0x11650, 0x11659 }, { 0x11660, 0x1166C }, { 0x116AB, 0x116B7 }, { 0x116B9, 0x116B9 }, { 0x116C0, 0x116C9 }, { 0x1171D, 0x1172B }, { 0x11730, 0x1173F }, { 0x1182C, 0x1183B }, { 0x118E0, 0x118F2 }, { 0x11930, 0x11935 }, { 0x11937, 0x11938 }, { 0x1193B, 0x1193E }, { 0x11940, 0x11940 }, { 0x11942, 0x11946 }, { 0x11950, 0x11959 }, { 0x119D1, 0x119D7 }, { 0x119DA, 0x119E0 }, { 0x119E2, 0x119E2 }, { 0x119E4, 0x119E4 }, { 0x11A01, 0x11A0A }, { 0x11A33, 0x11A39 }, { 0x11A3B, 0x11A47 }, { 0x11A51, 0x11A5B }, { 0x11A8A, 0x11A9C }, { 0x11A9E, 0x11AA2 }, { 0x11B00, 0x11B09 }, { 0x11C2F, 0x11C36 }, { 0x11C38, 0x11C3F }, { 0x11C41, 0x11C45 }, { 0x11C50, 0x11C6C }, { 0x11C70, 0x11C71 }, { 0x11C92, 0x11CA7 }, { 0x11CA9, 0x11CB6 }, { 0x11D31, 0x11D36 }, { 0x11D3A, 0x11D3A }, { 0x11D3C, 0x11D3D }, { 0x11D3F, 0x11D45 }, { 0x11D47, 0x11D47 }, { 0x11D50, 0x11D59 }, { 0x11D8A, 0x11D8E }, { 0x11D90, 0x11D91 }, { 0x11D93, 0x11D97 }, { 0x11DA0, 0x11DA9 }, { 0x11EF3, 0x11EF8 }, { 0x11F00, 0x11F01 }, { 0x11F03, 0x11F03 }, { 0x11F34, 0x11F3A }, { 0x11F3E, 0x11F59 }, { 0x11FC0, 0x11FF1 }, { 0x11FFF, 0x11FFF }, { 0x12400, 0x1246E }, { 0x12470, 0x12474 }, { 0x12FF1, 0x12FF2 }, { 0x13430, 0x13440 }, { 0x13447, 0x13455 }, { 0x16A60, 0x16A69 }, { 0x16A6E, 0x16A6F }, { 0x16AC0, 0x16AC9 }, { 0x16AF0, 0x16AF5 }, { 0x16B30, 0x16B3F }, { 0x16B44, 0x16B45 }, { 0x16B50, 0x16B59 }, { 0x16B5B, 0x16B61 }, { 0x16E80, 0x16E9A }, { 0x16F4F, 0x16F4F }, { 0x16F51, 0x16F87 }, { 0x16F8F, 0x16F92 }, { 0x16FE2, 0x16FE2 }, { 0x16FE4, 0x16FE4 }, { 0x16FF0, 0x16FF1 }, { 0x1BC9C, 0x1BCA3 }, { 0x1CF00, 0x1CF2D }, { 0x1CF30, 0x1CF46 }, { 0x1CF50, 0x1CFC3 }, { 0x1D000, 0x1D0F5 }, { 0x1D100, 0x1D126 }, { 0x1D129, 0x1D1EA }, { 0x1D200, 0x1D245 }, { 0x1D2C0, 0x1D2D3 }, { 0x1D2E0, 0x1D2F3 }, { 0x1D300, 0x1D356 }, { 0x1D360, 0x1D378 }, { 0x1D6C1, 0x1D6C1 }, { 0x1D6DB, 0x1D6DB }, { 0x1D6FB, 0x1D6FB }, { 0x1D715, 0x1D715 }, { 0x1D735, 0x1D735 }, { 0x1D74F, 0x1D74F }, { 0x1D76F, 0x1D76F }, { 0x1D789, 0x1D789 }, { 0x1D7A9, 0x1D7A9 }, { 0x1D7C3, 0x1D7C3 }, { 0x1D7CE, 0x1DA8B }, { 0x1DA9B, 0x1DA9F }, { 0x1DAA1, 0x1DAAF }, { 0x1E000, 0x1E006 }, { 0x1E008, 0x1E018 }, { 0x1E01B, 0x1E021 }, { 0x1E023, 0x1E024 }, { 0x1E026, 0x1E02A }, { 0x1E08F, 0x1E08F }, { 0x1E130, 0x1E136 }, { 0x1E140, 0x1E149 }, { 0x1E14F, 0x1E14F }, { 0x1E2AE, 0x1E2AE }, { 0x1E2EC, 0x1E2F9 }, { 0x1E2FF, 0x1E2FF }, { 0x1E4EC, 0x1E4F9 }, { 0x1E8C7, 0x1E8D6 }, { 0x1E944, 0x1E94A }, { 0x1E950, 0x1E959 }, { 0x1E95E, 0x1E95F }, { 0x1EC71, 0x1ECB4 }, { 0x1ED01, 0x1ED3D }, { 0x1EEF0, 0x1EEF1 }, { 0x1F000, 0x1F02B }, { 0x1F030, 0x1F093 }, { 0x1F0A0, 0x1F0AE }, { 0x1F0B1, 0x1F0BF }, { 0x1F0C1, 0x1F0CF }, { 0x1F0D1, 0x1F0F5 }, { 0x1F100, 0x1F1AD }, { 0x1F1E6, 0x1F202 }, { 0x1F210, 0x1F23B }, { 0x1F240, 0x1F248 }, { 0x1F250, 0x1F251 }, { 0x1F260, 0x1F265 }, { 0x1F300, 0x1F6D7 }, { 0x1F6DC, 0x1F6EC }, { 0x1F6F0, 0x1F6FC }, { 0x1F700, 0x1F776 }, { 0x1F77B, 0x1F7D9 }, { 0x1F7E0, 0x1F7EB }, { 0x1F7F0, 0x1F7F0 }, { 0x1F800, 0x1F80B }, { 0x1F810, 0x1F847 }, { 0x1F850, 0x1F859 }, { 0x1F860, 0x1F887 }, { 0x1F890, 0x1F8AD }, { 0x1F8B0, 0x1F8B1 }, { 0x1F900, 0x1FA53 }, { 0x1FA60, 0x1FA6D }, { 0x1FA70, 0x1FA7C }, { 0x1FA80, 0x1FA88 }, { 0x1FA90, 0x1FABD }, { 0x1FABF, 0x1FAC5 }, { 0x1FACE, 0x1FADB }, { 0x1FAE0, 0x1FAE8 }, { 0x1FAF0, 0x1FAF8 }, { 0x1FB00, 0x1FB92 }, { 0x1FB94, 0x1FBCA }, { 0x1FBF0, 0x1FBF9 }, { 0xE0001, 0xE0001 }, { 0xE0020, 0xE007F }, { 0xE0100, 0xE01EF }, { 0xF0000, 0xFFFFD }, { 0x100000, 0x10FFFD } }; MAKE_ISW(punct) #ifdef TEST_I18N static const struct mb_ucsrange data_wctype_graph[] = { { 0x0021, 0x007E }, { 0x00A0, 0x0377 }, { 0x037A, 0x037F }, { 0x0384, 0x038A }, { 0x038C, 0x038C }, { 0x038E, 0x03A1 }, { 0x03A3, 0x052F }, { 0x0531, 0x0556 }, { 0x0559, 0x058A }, { 0x058D, 0x058F }, { 0x0591, 0x05C7 }, { 0x05D0, 0x05EA }, { 0x05EF, 0x05F4 }, { 0x0600, 0x070D }, { 0x070F, 0x074A }, { 0x074D, 0x07B1 }, { 0x07C0, 0x07FA }, { 0x07FD, 0x082D }, { 0x0830, 0x083E }, { 0x0840, 0x085B }, { 0x085E, 0x085E }, { 0x0860, 0x086A }, { 0x0870, 0x088E }, { 0x0890, 0x0891 }, { 0x0898, 0x0983 }, { 0x0985, 0x098C }, { 0x098F, 0x0990 }, { 0x0993, 0x09A8 }, { 0x09AA, 0x09B0 }, { 0x09B2, 0x09B2 }, { 0x09B6, 0x09B9 }, { 0x09BC, 0x09C4 }, { 0x09C7, 0x09C8 }, { 0x09CB, 0x09CE }, { 0x09D7, 0x09D7 }, { 0x09DC, 0x09DD }, { 0x09DF, 0x09E3 }, { 0x09E6, 0x09FE }, { 0x0A01, 0x0A03 }, { 0x0A05, 0x0A0A }, { 0x0A0F, 0x0A10 }, { 0x0A13, 0x0A28 }, { 0x0A2A, 0x0A30 }, { 0x0A32, 0x0A33 }, { 0x0A35, 0x0A36 }, { 0x0A38, 0x0A39 }, { 0x0A3C, 0x0A3C }, { 0x0A3E, 0x0A42 }, { 0x0A47, 0x0A48 }, { 0x0A4B, 0x0A4D }, { 0x0A51, 0x0A51 }, { 0x0A59, 0x0A5C }, { 0x0A5E, 0x0A5E }, { 0x0A66, 0x0A76 }, { 0x0A81, 0x0A83 }, { 0x0A85, 0x0A8D }, { 0x0A8F, 0x0A91 }, { 0x0A93, 0x0AA8 }, { 0x0AAA, 0x0AB0 }, { 0x0AB2, 0x0AB3 }, { 0x0AB5, 0x0AB9 }, { 0x0ABC, 0x0AC5 }, { 0x0AC7, 0x0AC9 }, { 0x0ACB, 0x0ACD }, { 0x0AD0, 0x0AD0 }, { 0x0AE0, 0x0AE3 }, { 0x0AE6, 0x0AF1 }, { 0x0AF9, 0x0AFF }, { 0x0B01, 0x0B03 }, { 0x0B05, 0x0B0C }, { 0x0B0F, 0x0B10 }, { 0x0B13, 0x0B28 }, { 0x0B2A, 0x0B30 }, { 0x0B32, 0x0B33 }, { 0x0B35, 0x0B39 }, { 0x0B3C, 0x0B44 }, { 0x0B47, 0x0B48 }, { 0x0B4B, 0x0B4D }, { 0x0B55, 0x0B57 }, { 0x0B5C, 0x0B5D }, { 0x0B5F, 0x0B63 }, { 0x0B66, 0x0B77 }, { 0x0B82, 0x0B83 }, { 0x0B85, 0x0B8A }, { 0x0B8E, 0x0B90 }, { 0x0B92, 0x0B95 }, { 0x0B99, 0x0B9A }, { 0x0B9C, 0x0B9C }, { 0x0B9E, 0x0B9F }, { 0x0BA3, 0x0BA4 }, { 0x0BA8, 0x0BAA }, { 0x0BAE, 0x0BB9 }, { 0x0BBE, 0x0BC2 }, { 0x0BC6, 0x0BC8 }, { 0x0BCA, 0x0BCD }, { 0x0BD0, 0x0BD0 }, { 0x0BD7, 0x0BD7 }, { 0x0BE6, 0x0BFA }, { 0x0C00, 0x0C0C }, { 0x0C0E, 0x0C10 }, { 0x0C12, 0x0C28 }, { 0x0C2A, 0x0C39 }, { 0x0C3C, 0x0C44 }, { 0x0C46, 0x0C48 }, { 0x0C4A, 0x0C4D }, { 0x0C55, 0x0C56 }, { 0x0C58, 0x0C5A }, { 0x0C5D, 0x0C5D }, { 0x0C60, 0x0C63 }, { 0x0C66, 0x0C6F }, { 0x0C77, 0x0C8C }, { 0x0C8E, 0x0C90 }, { 0x0C92, 0x0CA8 }, { 0x0CAA, 0x0CB3 }, { 0x0CB5, 0x0CB9 }, { 0x0CBC, 0x0CC4 }, { 0x0CC6, 0x0CC8 }, { 0x0CCA, 0x0CCD }, { 0x0CD5, 0x0CD6 }, { 0x0CDD, 0x0CDE }, { 0x0CE0, 0x0CE3 }, { 0x0CE6, 0x0CEF }, { 0x0CF1, 0x0CF3 }, { 0x0D00, 0x0D0C }, { 0x0D0E, 0x0D10 }, { 0x0D12, 0x0D44 }, { 0x0D46, 0x0D48 }, { 0x0D4A, 0x0D4F }, { 0x0D54, 0x0D63 }, { 0x0D66, 0x0D7F }, { 0x0D81, 0x0D83 }, { 0x0D85, 0x0D96 }, { 0x0D9A, 0x0DB1 }, { 0x0DB3, 0x0DBB }, { 0x0DBD, 0x0DBD }, { 0x0DC0, 0x0DC6 }, { 0x0DCA, 0x0DCA }, { 0x0DCF, 0x0DD4 }, { 0x0DD6, 0x0DD6 }, { 0x0DD8, 0x0DDF }, { 0x0DE6, 0x0DEF }, { 0x0DF2, 0x0DF4 }, { 0x0E01, 0x0E3A }, { 0x0E3F, 0x0E5B }, { 0x0E81, 0x0E82 }, { 0x0E84, 0x0E84 }, { 0x0E86, 0x0E8A }, { 0x0E8C, 0x0EA3 }, { 0x0EA5, 0x0EA5 }, { 0x0EA7, 0x0EBD }, { 0x0EC0, 0x0EC4 }, { 0x0EC6, 0x0EC6 }, { 0x0EC8, 0x0ECE }, { 0x0ED0, 0x0ED9 }, { 0x0EDC, 0x0EDF }, { 0x0F00, 0x0F47 }, { 0x0F49, 0x0F6C }, { 0x0F71, 0x0F97 }, { 0x0F99, 0x0FBC }, { 0x0FBE, 0x0FCC }, { 0x0FCE, 0x0FDA }, { 0x1000, 0x10C5 }, { 0x10C7, 0x10C7 }, { 0x10CD, 0x10CD }, { 0x10D0, 0x1248 }, { 0x124A, 0x124D }, { 0x1250, 0x1256 }, { 0x1258, 0x1258 }, { 0x125A, 0x125D }, { 0x1260, 0x1288 }, { 0x128A, 0x128D }, { 0x1290, 0x12B0 }, { 0x12B2, 0x12B5 }, { 0x12B8, 0x12BE }, { 0x12C0, 0x12C0 }, { 0x12C2, 0x12C5 }, { 0x12C8, 0x12D6 }, { 0x12D8, 0x1310 }, { 0x1312, 0x1315 }, { 0x1318, 0x135A }, { 0x135D, 0x137C }, { 0x1380, 0x1399 }, { 0x13A0, 0x13F5 }, { 0x13F8, 0x13FD }, { 0x1400, 0x169C }, { 0x16A0, 0x16F8 }, { 0x1700, 0x1715 }, { 0x171F, 0x1736 }, { 0x1740, 0x1753 }, { 0x1760, 0x176C }, { 0x176E, 0x1770 }, { 0x1772, 0x1773 }, { 0x1780, 0x17DD }, { 0x17E0, 0x17E9 }, { 0x17F0, 0x17F9 }, { 0x1800, 0x1819 }, { 0x1820, 0x1878 }, { 0x1880, 0x18AA }, { 0x18B0, 0x18F5 }, { 0x1900, 0x191E }, { 0x1920, 0x192B }, { 0x1930, 0x193B }, { 0x1940, 0x1940 }, { 0x1944, 0x196D }, { 0x1970, 0x1974 }, { 0x1980, 0x19AB }, { 0x19B0, 0x19C9 }, { 0x19D0, 0x19DA }, { 0x19DE, 0x1A1B }, { 0x1A1E, 0x1A5E }, { 0x1A60, 0x1A7C }, { 0x1A7F, 0x1A89 }, { 0x1A90, 0x1A99 }, { 0x1AA0, 0x1AAD }, { 0x1AB0, 0x1ACE }, { 0x1B00, 0x1B4C }, { 0x1B50, 0x1B7E }, { 0x1B80, 0x1BF3 }, { 0x1BFC, 0x1C37 }, { 0x1C3B, 0x1C49 }, { 0x1C4D, 0x1C88 }, { 0x1C90, 0x1CBA }, { 0x1CBD, 0x1CC7 }, { 0x1CD0, 0x1CFA }, { 0x1D00, 0x1F15 }, { 0x1F18, 0x1F1D }, { 0x1F20, 0x1F45 }, { 0x1F48, 0x1F4D }, { 0x1F50, 0x1F57 }, { 0x1F59, 0x1F59 }, { 0x1F5B, 0x1F5B }, { 0x1F5D, 0x1F5D }, { 0x1F5F, 0x1F7D }, { 0x1F80, 0x1FB4 }, { 0x1FB6, 0x1FC4 }, { 0x1FC6, 0x1FD3 }, { 0x1FD6, 0x1FDB }, { 0x1FDD, 0x1FEF }, { 0x1FF2, 0x1FF4 }, { 0x1FF6, 0x1FFE }, { 0x2000, 0x2064 }, { 0x2066, 0x2071 }, { 0x2074, 0x208E }, { 0x2090, 0x209C }, { 0x20A0, 0x20C0 }, { 0x20D0, 0x20F0 }, { 0x2100, 0x218B }, { 0x2190, 0x2426 }, { 0x2440, 0x244A }, { 0x2460, 0x2B73 }, { 0x2B76, 0x2B95 }, { 0x2B97, 0x2CF3 }, { 0x2CF9, 0x2D25 }, { 0x2D27, 0x2D27 }, { 0x2D2D, 0x2D2D }, { 0x2D30, 0x2D67 }, { 0x2D6F, 0x2D70 }, { 0x2D7F, 0x2D96 }, { 0x2DA0, 0x2DA6 }, { 0x2DA8, 0x2DAE }, { 0x2DB0, 0x2DB6 }, { 0x2DB8, 0x2DBE }, { 0x2DC0, 0x2DC6 }, { 0x2DC8, 0x2DCE }, { 0x2DD0, 0x2DD6 }, { 0x2DD8, 0x2DDE }, { 0x2DE0, 0x2E5D }, { 0x2E80, 0x2E99 }, { 0x2E9B, 0x2EF3 }, { 0x2F00, 0x2FD5 }, { 0x2FF0, 0x2FFB }, { 0x3000, 0x303F }, { 0x3041, 0x3096 }, { 0x3099, 0x30FF }, { 0x3105, 0x312F }, { 0x3131, 0x318E }, { 0x3190, 0x31E3 }, { 0x31F0, 0x321E }, { 0x3220, 0xA48C }, { 0xA490, 0xA4C6 }, { 0xA4D0, 0xA62B }, { 0xA640, 0xA6F7 }, { 0xA700, 0xA7CA }, { 0xA7D0, 0xA7D1 }, { 0xA7D3, 0xA7D3 }, { 0xA7D5, 0xA7D9 }, { 0xA7F2, 0xA82C }, { 0xA830, 0xA839 }, { 0xA840, 0xA877 }, { 0xA880, 0xA8C5 }, { 0xA8CE, 0xA8D9 }, { 0xA8E0, 0xA953 }, { 0xA95F, 0xA97C }, { 0xA980, 0xA9CD }, { 0xA9CF, 0xA9D9 }, { 0xA9DE, 0xA9FE }, { 0xAA00, 0xAA36 }, { 0xAA40, 0xAA4D }, { 0xAA50, 0xAA59 }, { 0xAA5C, 0xAAC2 }, { 0xAADB, 0xAAF6 }, { 0xAB01, 0xAB06 }, { 0xAB09, 0xAB0E }, { 0xAB11, 0xAB16 }, { 0xAB20, 0xAB26 }, { 0xAB28, 0xAB2E }, { 0xAB30, 0xAB6B }, { 0xAB70, 0xABED }, { 0xABF0, 0xABF9 }, { 0xAC00, 0xD7A3 }, { 0xD7B0, 0xD7C6 }, { 0xD7CB, 0xD7FB }, { 0xE000, 0xFA6D }, { 0xFA70, 0xFAD9 }, { 0xFB00, 0xFB06 }, { 0xFB13, 0xFB17 }, { 0xFB1D, 0xFB36 }, { 0xFB38, 0xFB3C }, { 0xFB3E, 0xFB3E }, { 0xFB40, 0xFB41 }, { 0xFB43, 0xFB44 }, { 0xFB46, 0xFBC2 }, { 0xFBD3, 0xFD8F }, { 0xFD92, 0xFDC7 }, { 0xFDCF, 0xFDCF }, { 0xFDF0, 0xFE19 }, { 0xFE20, 0xFE52 }, { 0xFE54, 0xFE66 }, { 0xFE68, 0xFE6B }, { 0xFE70, 0xFE74 }, { 0xFE76, 0xFEFC }, { 0xFEFF, 0xFEFF }, { 0xFF01, 0xFFBE }, { 0xFFC2, 0xFFC7 }, { 0xFFCA, 0xFFCF }, { 0xFFD2, 0xFFD7 }, { 0xFFDA, 0xFFDC }, { 0xFFE0, 0xFFE6 }, { 0xFFE8, 0xFFEE }, { 0xFFF9, 0xFFFD }, { 0x10000, 0x1000B }, { 0x1000D, 0x10026 }, { 0x10028, 0x1003A }, { 0x1003C, 0x1003D }, { 0x1003F, 0x1004D }, { 0x10050, 0x1005D }, { 0x10080, 0x100FA }, { 0x10100, 0x10102 }, { 0x10107, 0x10133 }, { 0x10137, 0x1018E }, { 0x10190, 0x1019C }, { 0x101A0, 0x101A0 }, { 0x101D0, 0x101FD }, { 0x10280, 0x1029C }, { 0x102A0, 0x102D0 }, { 0x102E0, 0x102FB }, { 0x10300, 0x10323 }, { 0x1032D, 0x1034A }, { 0x10350, 0x1037A }, { 0x10380, 0x1039D }, { 0x1039F, 0x103C3 }, { 0x103C8, 0x103D5 }, { 0x10400, 0x1049D }, { 0x104A0, 0x104A9 }, { 0x104B0, 0x104D3 }, { 0x104D8, 0x104FB }, { 0x10500, 0x10527 }, { 0x10530, 0x10563 }, { 0x1056F, 0x1057A }, { 0x1057C, 0x1058A }, { 0x1058C, 0x10592 }, { 0x10594, 0x10595 }, { 0x10597, 0x105A1 }, { 0x105A3, 0x105B1 }, { 0x105B3, 0x105B9 }, { 0x105BB, 0x105BC }, { 0x10600, 0x10736 }, { 0x10740, 0x10755 }, { 0x10760, 0x10767 }, { 0x10780, 0x10785 }, { 0x10787, 0x107B0 }, { 0x107B2, 0x107BA }, { 0x10800, 0x10805 }, { 0x10808, 0x10808 }, { 0x1080A, 0x10835 }, { 0x10837, 0x10838 }, { 0x1083C, 0x1083C }, { 0x1083F, 0x10855 }, { 0x10857, 0x1089E }, { 0x108A7, 0x108AF }, { 0x108E0, 0x108F2 }, { 0x108F4, 0x108F5 }, { 0x108FB, 0x1091B }, { 0x1091F, 0x10939 }, { 0x1093F, 0x1093F }, { 0x10980, 0x109B7 }, { 0x109BC, 0x109CF }, { 0x109D2, 0x10A03 }, { 0x10A05, 0x10A06 }, { 0x10A0C, 0x10A13 }, { 0x10A15, 0x10A17 }, { 0x10A19, 0x10A35 }, { 0x10A38, 0x10A3A }, { 0x10A3F, 0x10A48 }, { 0x10A50, 0x10A58 }, { 0x10A60, 0x10A9F }, { 0x10AC0, 0x10AE6 }, { 0x10AEB, 0x10AF6 }, { 0x10B00, 0x10B35 }, { 0x10B39, 0x10B55 }, { 0x10B58, 0x10B72 }, { 0x10B78, 0x10B91 }, { 0x10B99, 0x10B9C }, { 0x10BA9, 0x10BAF }, { 0x10C00, 0x10C48 }, { 0x10C80, 0x10CB2 }, { 0x10CC0, 0x10CF2 }, { 0x10CFA, 0x10D27 }, { 0x10D30, 0x10D39 }, { 0x10E60, 0x10E7E }, { 0x10E80, 0x10EA9 }, { 0x10EAB, 0x10EAD }, { 0x10EB0, 0x10EB1 }, { 0x10EFD, 0x10F27 }, { 0x10F30, 0x10F59 }, { 0x10F70, 0x10F89 }, { 0x10FB0, 0x10FCB }, { 0x10FE0, 0x10FF6 }, { 0x11000, 0x1104D }, { 0x11052, 0x11075 }, { 0x1107F, 0x110C2 }, { 0x110CD, 0x110CD }, { 0x110D0, 0x110E8 }, { 0x110F0, 0x110F9 }, { 0x11100, 0x11134 }, { 0x11136, 0x11147 }, { 0x11150, 0x11176 }, { 0x11180, 0x111DF }, { 0x111E1, 0x111F4 }, { 0x11200, 0x11211 }, { 0x11213, 0x11241 }, { 0x11280, 0x11286 }, { 0x11288, 0x11288 }, { 0x1128A, 0x1128D }, { 0x1128F, 0x1129D }, { 0x1129F, 0x112A9 }, { 0x112B0, 0x112EA }, { 0x112F0, 0x112F9 }, { 0x11300, 0x11303 }, { 0x11305, 0x1130C }, { 0x1130F, 0x11310 }, { 0x11313, 0x11328 }, { 0x1132A, 0x11330 }, { 0x11332, 0x11333 }, { 0x11335, 0x11339 }, { 0x1133B, 0x11344 }, { 0x11347, 0x11348 }, { 0x1134B, 0x1134D }, { 0x11350, 0x11350 }, { 0x11357, 0x11357 }, { 0x1135D, 0x11363 }, { 0x11366, 0x1136C }, { 0x11370, 0x11374 }, { 0x11400, 0x1145B }, { 0x1145D, 0x11461 }, { 0x11480, 0x114C7 }, { 0x114D0, 0x114D9 }, { 0x11580, 0x115B5 }, { 0x115B8, 0x115DD }, { 0x11600, 0x11644 }, { 0x11650, 0x11659 }, { 0x11660, 0x1166C }, { 0x11680, 0x116B9 }, { 0x116C0, 0x116C9 }, { 0x11700, 0x1171A }, { 0x1171D, 0x1172B }, { 0x11730, 0x11746 }, { 0x11800, 0x1183B }, { 0x118A0, 0x118F2 }, { 0x118FF, 0x11906 }, { 0x11909, 0x11909 }, { 0x1190C, 0x11913 }, { 0x11915, 0x11916 }, { 0x11918, 0x11935 }, { 0x11937, 0x11938 }, { 0x1193B, 0x11946 }, { 0x11950, 0x11959 }, { 0x119A0, 0x119A7 }, { 0x119AA, 0x119D7 }, { 0x119DA, 0x119E4 }, { 0x11A00, 0x11A47 }, { 0x11A50, 0x11AA2 }, { 0x11AB0, 0x11AF8 }, { 0x11B00, 0x11B09 }, { 0x11C00, 0x11C08 }, { 0x11C0A, 0x11C36 }, { 0x11C38, 0x11C45 }, { 0x11C50, 0x11C6C }, { 0x11C70, 0x11C8F }, { 0x11C92, 0x11CA7 }, { 0x11CA9, 0x11CB6 }, { 0x11D00, 0x11D06 }, { 0x11D08, 0x11D09 }, { 0x11D0B, 0x11D36 }, { 0x11D3A, 0x11D3A }, { 0x11D3C, 0x11D3D }, { 0x11D3F, 0x11D47 }, { 0x11D50, 0x11D59 }, { 0x11D60, 0x11D65 }, { 0x11D67, 0x11D68 }, { 0x11D6A, 0x11D8E }, { 0x11D90, 0x11D91 }, { 0x11D93, 0x11D98 }, { 0x11DA0, 0x11DA9 }, { 0x11EE0, 0x11EF8 }, { 0x11F00, 0x11F10 }, { 0x11F12, 0x11F3A }, { 0x11F3E, 0x11F59 }, { 0x11FB0, 0x11FB0 }, { 0x11FC0, 0x11FF1 }, { 0x11FFF, 0x12399 }, { 0x12400, 0x1246E }, { 0x12470, 0x12474 }, { 0x12480, 0x12543 }, { 0x12F90, 0x12FF2 }, { 0x13000, 0x13455 }, { 0x14400, 0x14646 }, { 0x16800, 0x16A38 }, { 0x16A40, 0x16A5E }, { 0x16A60, 0x16A69 }, { 0x16A6E, 0x16ABE }, { 0x16AC0, 0x16AC9 }, { 0x16AD0, 0x16AED }, { 0x16AF0, 0x16AF5 }, { 0x16B00, 0x16B45 }, { 0x16B50, 0x16B59 }, { 0x16B5B, 0x16B61 }, { 0x16B63, 0x16B77 }, { 0x16B7D, 0x16B8F }, { 0x16E40, 0x16E9A }, { 0x16F00, 0x16F4A }, { 0x16F4F, 0x16F87 }, { 0x16F8F, 0x16F9F }, { 0x16FE0, 0x16FE4 }, { 0x16FF0, 0x16FF1 }, { 0x17000, 0x187F7 }, { 0x18800, 0x18CD5 }, { 0x18D00, 0x18D08 }, { 0x1AFF0, 0x1AFF3 }, { 0x1AFF5, 0x1AFFB }, { 0x1AFFD, 0x1AFFE }, { 0x1B000, 0x1B122 }, { 0x1B132, 0x1B132 }, { 0x1B150, 0x1B152 }, { 0x1B155, 0x1B155 }, { 0x1B164, 0x1B167 }, { 0x1B170, 0x1B2FB }, { 0x1BC00, 0x1BC6A }, { 0x1BC70, 0x1BC7C }, { 0x1BC80, 0x1BC88 }, { 0x1BC90, 0x1BC99 }, { 0x1BC9C, 0x1BCA3 }, { 0x1CF00, 0x1CF2D }, { 0x1CF30, 0x1CF46 }, { 0x1CF50, 0x1CFC3 }, { 0x1D000, 0x1D0F5 }, { 0x1D100, 0x1D126 }, { 0x1D129, 0x1D1EA }, { 0x1D200, 0x1D245 }, { 0x1D2C0, 0x1D2D3 }, { 0x1D2E0, 0x1D2F3 }, { 0x1D300, 0x1D356 }, { 0x1D360, 0x1D378 }, { 0x1D400, 0x1D454 }, { 0x1D456, 0x1D49C }, { 0x1D49E, 0x1D49F }, { 0x1D4A2, 0x1D4A2 }, { 0x1D4A5, 0x1D4A6 }, { 0x1D4A9, 0x1D4AC }, { 0x1D4AE, 0x1D4B9 }, { 0x1D4BB, 0x1D4BB }, { 0x1D4BD, 0x1D4C3 }, { 0x1D4C5, 0x1D505 }, { 0x1D507, 0x1D50A }, { 0x1D50D, 0x1D514 }, { 0x1D516, 0x1D51C }, { 0x1D51E, 0x1D539 }, { 0x1D53B, 0x1D53E }, { 0x1D540, 0x1D544 }, { 0x1D546, 0x1D546 }, { 0x1D54A, 0x1D550 }, { 0x1D552, 0x1D6A5 }, { 0x1D6A8, 0x1D7CB }, { 0x1D7CE, 0x1DA8B }, { 0x1DA9B, 0x1DA9F }, { 0x1DAA1, 0x1DAAF }, { 0x1DF00, 0x1DF1E }, { 0x1DF25, 0x1DF2A }, { 0x1E000, 0x1E006 }, { 0x1E008, 0x1E018 }, { 0x1E01B, 0x1E021 }, { 0x1E023, 0x1E024 }, { 0x1E026, 0x1E02A }, { 0x1E030, 0x1E06D }, { 0x1E08F, 0x1E08F }, { 0x1E100, 0x1E12C }, { 0x1E130, 0x1E13D }, { 0x1E140, 0x1E149 }, { 0x1E14E, 0x1E14F }, { 0x1E290, 0x1E2AE }, { 0x1E2C0, 0x1E2F9 }, { 0x1E2FF, 0x1E2FF }, { 0x1E4D0, 0x1E4F9 }, { 0x1E7E0, 0x1E7E6 }, { 0x1E7E8, 0x1E7EB }, { 0x1E7ED, 0x1E7EE }, { 0x1E7F0, 0x1E7FE }, { 0x1E800, 0x1E8C4 }, { 0x1E8C7, 0x1E8D6 }, { 0x1E900, 0x1E94B }, { 0x1E950, 0x1E959 }, { 0x1E95E, 0x1E95F }, { 0x1EC71, 0x1ECB4 }, { 0x1ED01, 0x1ED3D }, { 0x1EE00, 0x1EE03 }, { 0x1EE05, 0x1EE1F }, { 0x1EE21, 0x1EE22 }, { 0x1EE24, 0x1EE24 }, { 0x1EE27, 0x1EE27 }, { 0x1EE29, 0x1EE32 }, { 0x1EE34, 0x1EE37 }, { 0x1EE39, 0x1EE39 }, { 0x1EE3B, 0x1EE3B }, { 0x1EE42, 0x1EE42 }, { 0x1EE47, 0x1EE47 }, { 0x1EE49, 0x1EE49 }, { 0x1EE4B, 0x1EE4B }, { 0x1EE4D, 0x1EE4F }, { 0x1EE51, 0x1EE52 }, { 0x1EE54, 0x1EE54 }, { 0x1EE57, 0x1EE57 }, { 0x1EE59, 0x1EE59 }, { 0x1EE5B, 0x1EE5B }, { 0x1EE5D, 0x1EE5D }, { 0x1EE5F, 0x1EE5F }, { 0x1EE61, 0x1EE62 }, { 0x1EE64, 0x1EE64 }, { 0x1EE67, 0x1EE6A }, { 0x1EE6C, 0x1EE72 }, { 0x1EE74, 0x1EE77 }, { 0x1EE79, 0x1EE7C }, { 0x1EE7E, 0x1EE7E }, { 0x1EE80, 0x1EE89 }, { 0x1EE8B, 0x1EE9B }, { 0x1EEA1, 0x1EEA3 }, { 0x1EEA5, 0x1EEA9 }, { 0x1EEAB, 0x1EEBB }, { 0x1EEF0, 0x1EEF1 }, { 0x1F000, 0x1F02B }, { 0x1F030, 0x1F093 }, { 0x1F0A0, 0x1F0AE }, { 0x1F0B1, 0x1F0BF }, { 0x1F0C1, 0x1F0CF }, { 0x1F0D1, 0x1F0F5 }, { 0x1F100, 0x1F1AD }, { 0x1F1E6, 0x1F202 }, { 0x1F210, 0x1F23B }, { 0x1F240, 0x1F248 }, { 0x1F250, 0x1F251 }, { 0x1F260, 0x1F265 }, { 0x1F300, 0x1F6D7 }, { 0x1F6DC, 0x1F6EC }, { 0x1F6F0, 0x1F6FC }, { 0x1F700, 0x1F776 }, { 0x1F77B, 0x1F7D9 }, { 0x1F7E0, 0x1F7EB }, { 0x1F7F0, 0x1F7F0 }, { 0x1F800, 0x1F80B }, { 0x1F810, 0x1F847 }, { 0x1F850, 0x1F859 }, { 0x1F860, 0x1F887 }, { 0x1F890, 0x1F8AD }, { 0x1F8B0, 0x1F8B1 }, { 0x1F900, 0x1FA53 }, { 0x1FA60, 0x1FA6D }, { 0x1FA70, 0x1FA7C }, { 0x1FA80, 0x1FA88 }, { 0x1FA90, 0x1FABD }, { 0x1FABF, 0x1FAC5 }, { 0x1FACE, 0x1FADB }, { 0x1FAE0, 0x1FAE8 }, { 0x1FAF0, 0x1FAF8 }, { 0x1FB00, 0x1FB92 }, { 0x1FB94, 0x1FBCA }, { 0x1FBF0, 0x1FBF9 }, { 0x20000, 0x2A6DF }, { 0x2A700, 0x2B739 }, { 0x2B740, 0x2B81D }, { 0x2B820, 0x2CEA1 }, { 0x2CEB0, 0x2EBE0 }, { 0x2F800, 0x2FA1D }, { 0x30000, 0x3134A }, { 0x31350, 0x323AF }, { 0xE0001, 0xE0001 }, { 0xE0020, 0xE007F }, { 0xE0100, 0xE01EF }, { 0xF0000, 0xFFFFD }, { 0x100000, 0x10FFFD } }; MAKE_ISW(graph) #endif static const struct mb_ucsrange data_wctype_print[] = { { 0x0020, 0x007E }, { 0x00A0, 0x0377 }, { 0x037A, 0x037F }, { 0x0384, 0x038A }, { 0x038C, 0x038C }, { 0x038E, 0x03A1 }, { 0x03A3, 0x052F }, { 0x0531, 0x0556 }, { 0x0559, 0x058A }, { 0x058D, 0x058F }, { 0x0591, 0x05C7 }, { 0x05D0, 0x05EA }, { 0x05EF, 0x05F4 }, { 0x0600, 0x070D }, { 0x070F, 0x074A }, { 0x074D, 0x07B1 }, { 0x07C0, 0x07FA }, { 0x07FD, 0x082D }, { 0x0830, 0x083E }, { 0x0840, 0x085B }, { 0x085E, 0x085E }, { 0x0860, 0x086A }, { 0x0870, 0x088E }, { 0x0890, 0x0891 }, { 0x0898, 0x0983 }, { 0x0985, 0x098C }, { 0x098F, 0x0990 }, { 0x0993, 0x09A8 }, { 0x09AA, 0x09B0 }, { 0x09B2, 0x09B2 }, { 0x09B6, 0x09B9 }, { 0x09BC, 0x09C4 }, { 0x09C7, 0x09C8 }, { 0x09CB, 0x09CE }, { 0x09D7, 0x09D7 }, { 0x09DC, 0x09DD }, { 0x09DF, 0x09E3 }, { 0x09E6, 0x09FE }, { 0x0A01, 0x0A03 }, { 0x0A05, 0x0A0A }, { 0x0A0F, 0x0A10 }, { 0x0A13, 0x0A28 }, { 0x0A2A, 0x0A30 }, { 0x0A32, 0x0A33 }, { 0x0A35, 0x0A36 }, { 0x0A38, 0x0A39 }, { 0x0A3C, 0x0A3C }, { 0x0A3E, 0x0A42 }, { 0x0A47, 0x0A48 }, { 0x0A4B, 0x0A4D }, { 0x0A51, 0x0A51 }, { 0x0A59, 0x0A5C }, { 0x0A5E, 0x0A5E }, { 0x0A66, 0x0A76 }, { 0x0A81, 0x0A83 }, { 0x0A85, 0x0A8D }, { 0x0A8F, 0x0A91 }, { 0x0A93, 0x0AA8 }, { 0x0AAA, 0x0AB0 }, { 0x0AB2, 0x0AB3 }, { 0x0AB5, 0x0AB9 }, { 0x0ABC, 0x0AC5 }, { 0x0AC7, 0x0AC9 }, { 0x0ACB, 0x0ACD }, { 0x0AD0, 0x0AD0 }, { 0x0AE0, 0x0AE3 }, { 0x0AE6, 0x0AF1 }, { 0x0AF9, 0x0AFF }, { 0x0B01, 0x0B03 }, { 0x0B05, 0x0B0C }, { 0x0B0F, 0x0B10 }, { 0x0B13, 0x0B28 }, { 0x0B2A, 0x0B30 }, { 0x0B32, 0x0B33 }, { 0x0B35, 0x0B39 }, { 0x0B3C, 0x0B44 }, { 0x0B47, 0x0B48 }, { 0x0B4B, 0x0B4D }, { 0x0B55, 0x0B57 }, { 0x0B5C, 0x0B5D }, { 0x0B5F, 0x0B63 }, { 0x0B66, 0x0B77 }, { 0x0B82, 0x0B83 }, { 0x0B85, 0x0B8A }, { 0x0B8E, 0x0B90 }, { 0x0B92, 0x0B95 }, { 0x0B99, 0x0B9A }, { 0x0B9C, 0x0B9C }, { 0x0B9E, 0x0B9F }, { 0x0BA3, 0x0BA4 }, { 0x0BA8, 0x0BAA }, { 0x0BAE, 0x0BB9 }, { 0x0BBE, 0x0BC2 }, { 0x0BC6, 0x0BC8 }, { 0x0BCA, 0x0BCD }, { 0x0BD0, 0x0BD0 }, { 0x0BD7, 0x0BD7 }, { 0x0BE6, 0x0BFA }, { 0x0C00, 0x0C0C }, { 0x0C0E, 0x0C10 }, { 0x0C12, 0x0C28 }, { 0x0C2A, 0x0C39 }, { 0x0C3C, 0x0C44 }, { 0x0C46, 0x0C48 }, { 0x0C4A, 0x0C4D }, { 0x0C55, 0x0C56 }, { 0x0C58, 0x0C5A }, { 0x0C5D, 0x0C5D }, { 0x0C60, 0x0C63 }, { 0x0C66, 0x0C6F }, { 0x0C77, 0x0C8C }, { 0x0C8E, 0x0C90 }, { 0x0C92, 0x0CA8 }, { 0x0CAA, 0x0CB3 }, { 0x0CB5, 0x0CB9 }, { 0x0CBC, 0x0CC4 }, { 0x0CC6, 0x0CC8 }, { 0x0CCA, 0x0CCD }, { 0x0CD5, 0x0CD6 }, { 0x0CDD, 0x0CDE }, { 0x0CE0, 0x0CE3 }, { 0x0CE6, 0x0CEF }, { 0x0CF1, 0x0CF3 }, { 0x0D00, 0x0D0C }, { 0x0D0E, 0x0D10 }, { 0x0D12, 0x0D44 }, { 0x0D46, 0x0D48 }, { 0x0D4A, 0x0D4F }, { 0x0D54, 0x0D63 }, { 0x0D66, 0x0D7F }, { 0x0D81, 0x0D83 }, { 0x0D85, 0x0D96 }, { 0x0D9A, 0x0DB1 }, { 0x0DB3, 0x0DBB }, { 0x0DBD, 0x0DBD }, { 0x0DC0, 0x0DC6 }, { 0x0DCA, 0x0DCA }, { 0x0DCF, 0x0DD4 }, { 0x0DD6, 0x0DD6 }, { 0x0DD8, 0x0DDF }, { 0x0DE6, 0x0DEF }, { 0x0DF2, 0x0DF4 }, { 0x0E01, 0x0E3A }, { 0x0E3F, 0x0E5B }, { 0x0E81, 0x0E82 }, { 0x0E84, 0x0E84 }, { 0x0E86, 0x0E8A }, { 0x0E8C, 0x0EA3 }, { 0x0EA5, 0x0EA5 }, { 0x0EA7, 0x0EBD }, { 0x0EC0, 0x0EC4 }, { 0x0EC6, 0x0EC6 }, { 0x0EC8, 0x0ECE }, { 0x0ED0, 0x0ED9 }, { 0x0EDC, 0x0EDF }, { 0x0F00, 0x0F47 }, { 0x0F49, 0x0F6C }, { 0x0F71, 0x0F97 }, { 0x0F99, 0x0FBC }, { 0x0FBE, 0x0FCC }, { 0x0FCE, 0x0FDA }, { 0x1000, 0x10C5 }, { 0x10C7, 0x10C7 }, { 0x10CD, 0x10CD }, { 0x10D0, 0x1248 }, { 0x124A, 0x124D }, { 0x1250, 0x1256 }, { 0x1258, 0x1258 }, { 0x125A, 0x125D }, { 0x1260, 0x1288 }, { 0x128A, 0x128D }, { 0x1290, 0x12B0 }, { 0x12B2, 0x12B5 }, { 0x12B8, 0x12BE }, { 0x12C0, 0x12C0 }, { 0x12C2, 0x12C5 }, { 0x12C8, 0x12D6 }, { 0x12D8, 0x1310 }, { 0x1312, 0x1315 }, { 0x1318, 0x135A }, { 0x135D, 0x137C }, { 0x1380, 0x1399 }, { 0x13A0, 0x13F5 }, { 0x13F8, 0x13FD }, { 0x1400, 0x169C }, { 0x16A0, 0x16F8 }, { 0x1700, 0x1715 }, { 0x171F, 0x1736 }, { 0x1740, 0x1753 }, { 0x1760, 0x176C }, { 0x176E, 0x1770 }, { 0x1772, 0x1773 }, { 0x1780, 0x17DD }, { 0x17E0, 0x17E9 }, { 0x17F0, 0x17F9 }, { 0x1800, 0x1819 }, { 0x1820, 0x1878 }, { 0x1880, 0x18AA }, { 0x18B0, 0x18F5 }, { 0x1900, 0x191E }, { 0x1920, 0x192B }, { 0x1930, 0x193B }, { 0x1940, 0x1940 }, { 0x1944, 0x196D }, { 0x1970, 0x1974 }, { 0x1980, 0x19AB }, { 0x19B0, 0x19C9 }, { 0x19D0, 0x19DA }, { 0x19DE, 0x1A1B }, { 0x1A1E, 0x1A5E }, { 0x1A60, 0x1A7C }, { 0x1A7F, 0x1A89 }, { 0x1A90, 0x1A99 }, { 0x1AA0, 0x1AAD }, { 0x1AB0, 0x1ACE }, { 0x1B00, 0x1B4C }, { 0x1B50, 0x1B7E }, { 0x1B80, 0x1BF3 }, { 0x1BFC, 0x1C37 }, { 0x1C3B, 0x1C49 }, { 0x1C4D, 0x1C88 }, { 0x1C90, 0x1CBA }, { 0x1CBD, 0x1CC7 }, { 0x1CD0, 0x1CFA }, { 0x1D00, 0x1F15 }, { 0x1F18, 0x1F1D }, { 0x1F20, 0x1F45 }, { 0x1F48, 0x1F4D }, { 0x1F50, 0x1F57 }, { 0x1F59, 0x1F59 }, { 0x1F5B, 0x1F5B }, { 0x1F5D, 0x1F5D }, { 0x1F5F, 0x1F7D }, { 0x1F80, 0x1FB4 }, { 0x1FB6, 0x1FC4 }, { 0x1FC6, 0x1FD3 }, { 0x1FD6, 0x1FDB }, { 0x1FDD, 0x1FEF }, { 0x1FF2, 0x1FF4 }, { 0x1FF6, 0x1FFE }, #ifdef __CYGWIN__ /* WTF?! https://blogs.msdn.microsoft.com/oldnewthing/20070104-12/?p=28513 */ { 0x2000, 0x2021 }, { 0x2023, 0x2064 }, #else { 0x2000, 0x2064 }, #endif { 0x2066, 0x2071 }, { 0x2074, 0x208E }, { 0x2090, 0x209C }, { 0x20A0, 0x20C0 }, { 0x20D0, 0x20F0 }, { 0x2100, 0x218B }, { 0x2190, 0x2426 }, { 0x2440, 0x244A }, { 0x2460, 0x2B73 }, { 0x2B76, 0x2B95 }, { 0x2B97, 0x2CF3 }, { 0x2CF9, 0x2D25 }, { 0x2D27, 0x2D27 }, { 0x2D2D, 0x2D2D }, { 0x2D30, 0x2D67 }, { 0x2D6F, 0x2D70 }, { 0x2D7F, 0x2D96 }, { 0x2DA0, 0x2DA6 }, { 0x2DA8, 0x2DAE }, { 0x2DB0, 0x2DB6 }, { 0x2DB8, 0x2DBE }, { 0x2DC0, 0x2DC6 }, { 0x2DC8, 0x2DCE }, { 0x2DD0, 0x2DD6 }, { 0x2DD8, 0x2DDE }, { 0x2DE0, 0x2E5D }, { 0x2E80, 0x2E99 }, { 0x2E9B, 0x2EF3 }, { 0x2F00, 0x2FD5 }, { 0x2FF0, 0x2FFB }, { 0x3000, 0x303F }, { 0x3041, 0x3096 }, { 0x3099, 0x30FF }, { 0x3105, 0x312F }, { 0x3131, 0x318E }, { 0x3190, 0x31E3 }, { 0x31F0, 0x321E }, { 0x3220, 0xA48C }, { 0xA490, 0xA4C6 }, { 0xA4D0, 0xA62B }, { 0xA640, 0xA6F7 }, { 0xA700, 0xA7CA }, { 0xA7D0, 0xA7D1 }, { 0xA7D3, 0xA7D3 }, { 0xA7D5, 0xA7D9 }, { 0xA7F2, 0xA82C }, { 0xA830, 0xA839 }, { 0xA840, 0xA877 }, { 0xA880, 0xA8C5 }, { 0xA8CE, 0xA8D9 }, { 0xA8E0, 0xA953 }, { 0xA95F, 0xA97C }, { 0xA980, 0xA9CD }, { 0xA9CF, 0xA9D9 }, { 0xA9DE, 0xA9FE }, { 0xAA00, 0xAA36 }, { 0xAA40, 0xAA4D }, { 0xAA50, 0xAA59 }, { 0xAA5C, 0xAAC2 }, { 0xAADB, 0xAAF6 }, { 0xAB01, 0xAB06 }, { 0xAB09, 0xAB0E }, { 0xAB11, 0xAB16 }, { 0xAB20, 0xAB26 }, { 0xAB28, 0xAB2E }, { 0xAB30, 0xAB6B }, { 0xAB70, 0xABED }, { 0xABF0, 0xABF9 }, { 0xAC00, 0xD7A3 }, { 0xD7B0, 0xD7C6 }, { 0xD7CB, 0xD7FB }, { 0xE000, 0xFA6D }, { 0xFA70, 0xFAD9 }, { 0xFB00, 0xFB06 }, { 0xFB13, 0xFB17 }, { 0xFB1D, 0xFB36 }, { 0xFB38, 0xFB3C }, { 0xFB3E, 0xFB3E }, { 0xFB40, 0xFB41 }, { 0xFB43, 0xFB44 }, { 0xFB46, 0xFBC2 }, { 0xFBD3, 0xFD8F }, { 0xFD92, 0xFDC7 }, { 0xFDCF, 0xFDCF }, { 0xFDF0, 0xFE19 }, { 0xFE20, 0xFE52 }, { 0xFE54, 0xFE66 }, { 0xFE68, 0xFE6B }, { 0xFE70, 0xFE74 }, { 0xFE76, 0xFEFC }, { 0xFEFF, 0xFEFF }, { 0xFF01, 0xFFBE }, { 0xFFC2, 0xFFC7 }, { 0xFFCA, 0xFFCF }, { 0xFFD2, 0xFFD7 }, { 0xFFDA, 0xFFDC }, { 0xFFE0, 0xFFE6 }, { 0xFFE8, 0xFFEE }, { 0xFFF9, 0xFFFD }, { 0x10000, 0x1000B }, { 0x1000D, 0x10026 }, { 0x10028, 0x1003A }, { 0x1003C, 0x1003D }, { 0x1003F, 0x1004D }, { 0x10050, 0x1005D }, { 0x10080, 0x100FA }, { 0x10100, 0x10102 }, { 0x10107, 0x10133 }, { 0x10137, 0x1018E }, { 0x10190, 0x1019C }, { 0x101A0, 0x101A0 }, { 0x101D0, 0x101FD }, { 0x10280, 0x1029C }, { 0x102A0, 0x102D0 }, { 0x102E0, 0x102FB }, { 0x10300, 0x10323 }, { 0x1032D, 0x1034A }, { 0x10350, 0x1037A }, { 0x10380, 0x1039D }, { 0x1039F, 0x103C3 }, { 0x103C8, 0x103D5 }, { 0x10400, 0x1049D }, { 0x104A0, 0x104A9 }, { 0x104B0, 0x104D3 }, { 0x104D8, 0x104FB }, { 0x10500, 0x10527 }, { 0x10530, 0x10563 }, { 0x1056F, 0x1057A }, { 0x1057C, 0x1058A }, { 0x1058C, 0x10592 }, { 0x10594, 0x10595 }, { 0x10597, 0x105A1 }, { 0x105A3, 0x105B1 }, { 0x105B3, 0x105B9 }, { 0x105BB, 0x105BC }, { 0x10600, 0x10736 }, { 0x10740, 0x10755 }, { 0x10760, 0x10767 }, { 0x10780, 0x10785 }, { 0x10787, 0x107B0 }, { 0x107B2, 0x107BA }, { 0x10800, 0x10805 }, { 0x10808, 0x10808 }, { 0x1080A, 0x10835 }, { 0x10837, 0x10838 }, { 0x1083C, 0x1083C }, { 0x1083F, 0x10855 }, { 0x10857, 0x1089E }, { 0x108A7, 0x108AF }, { 0x108E0, 0x108F2 }, { 0x108F4, 0x108F5 }, { 0x108FB, 0x1091B }, { 0x1091F, 0x10939 }, { 0x1093F, 0x1093F }, { 0x10980, 0x109B7 }, { 0x109BC, 0x109CF }, { 0x109D2, 0x10A03 }, { 0x10A05, 0x10A06 }, { 0x10A0C, 0x10A13 }, { 0x10A15, 0x10A17 }, { 0x10A19, 0x10A35 }, { 0x10A38, 0x10A3A }, { 0x10A3F, 0x10A48 }, { 0x10A50, 0x10A58 }, { 0x10A60, 0x10A9F }, { 0x10AC0, 0x10AE6 }, { 0x10AEB, 0x10AF6 }, { 0x10B00, 0x10B35 }, { 0x10B39, 0x10B55 }, { 0x10B58, 0x10B72 }, { 0x10B78, 0x10B91 }, { 0x10B99, 0x10B9C }, { 0x10BA9, 0x10BAF }, { 0x10C00, 0x10C48 }, { 0x10C80, 0x10CB2 }, { 0x10CC0, 0x10CF2 }, { 0x10CFA, 0x10D27 }, { 0x10D30, 0x10D39 }, { 0x10E60, 0x10E7E }, { 0x10E80, 0x10EA9 }, { 0x10EAB, 0x10EAD }, { 0x10EB0, 0x10EB1 }, { 0x10EFD, 0x10F27 }, { 0x10F30, 0x10F59 }, { 0x10F70, 0x10F89 }, { 0x10FB0, 0x10FCB }, { 0x10FE0, 0x10FF6 }, { 0x11000, 0x1104D }, { 0x11052, 0x11075 }, { 0x1107F, 0x110C2 }, { 0x110CD, 0x110CD }, { 0x110D0, 0x110E8 }, { 0x110F0, 0x110F9 }, { 0x11100, 0x11134 }, { 0x11136, 0x11147 }, { 0x11150, 0x11176 }, { 0x11180, 0x111DF }, { 0x111E1, 0x111F4 }, { 0x11200, 0x11211 }, { 0x11213, 0x11241 }, { 0x11280, 0x11286 }, { 0x11288, 0x11288 }, { 0x1128A, 0x1128D }, { 0x1128F, 0x1129D }, { 0x1129F, 0x112A9 }, { 0x112B0, 0x112EA }, { 0x112F0, 0x112F9 }, { 0x11300, 0x11303 }, { 0x11305, 0x1130C }, { 0x1130F, 0x11310 }, { 0x11313, 0x11328 }, { 0x1132A, 0x11330 }, { 0x11332, 0x11333 }, { 0x11335, 0x11339 }, { 0x1133B, 0x11344 }, { 0x11347, 0x11348 }, { 0x1134B, 0x1134D }, { 0x11350, 0x11350 }, { 0x11357, 0x11357 }, { 0x1135D, 0x11363 }, { 0x11366, 0x1136C }, { 0x11370, 0x11374 }, { 0x11400, 0x1145B }, { 0x1145D, 0x11461 }, { 0x11480, 0x114C7 }, { 0x114D0, 0x114D9 }, { 0x11580, 0x115B5 }, { 0x115B8, 0x115DD }, { 0x11600, 0x11644 }, { 0x11650, 0x11659 }, { 0x11660, 0x1166C }, { 0x11680, 0x116B9 }, { 0x116C0, 0x116C9 }, { 0x11700, 0x1171A }, { 0x1171D, 0x1172B }, { 0x11730, 0x11746 }, { 0x11800, 0x1183B }, { 0x118A0, 0x118F2 }, { 0x118FF, 0x11906 }, { 0x11909, 0x11909 }, { 0x1190C, 0x11913 }, { 0x11915, 0x11916 }, { 0x11918, 0x11935 }, { 0x11937, 0x11938 }, { 0x1193B, 0x11946 }, { 0x11950, 0x11959 }, { 0x119A0, 0x119A7 }, { 0x119AA, 0x119D7 }, { 0x119DA, 0x119E4 }, { 0x11A00, 0x11A47 }, { 0x11A50, 0x11AA2 }, { 0x11AB0, 0x11AF8 }, { 0x11B00, 0x11B09 }, { 0x11C00, 0x11C08 }, { 0x11C0A, 0x11C36 }, { 0x11C38, 0x11C45 }, { 0x11C50, 0x11C6C }, { 0x11C70, 0x11C8F }, { 0x11C92, 0x11CA7 }, { 0x11CA9, 0x11CB6 }, { 0x11D00, 0x11D06 }, { 0x11D08, 0x11D09 }, { 0x11D0B, 0x11D36 }, { 0x11D3A, 0x11D3A }, { 0x11D3C, 0x11D3D }, { 0x11D3F, 0x11D47 }, { 0x11D50, 0x11D59 }, { 0x11D60, 0x11D65 }, { 0x11D67, 0x11D68 }, { 0x11D6A, 0x11D8E }, { 0x11D90, 0x11D91 }, { 0x11D93, 0x11D98 }, { 0x11DA0, 0x11DA9 }, { 0x11EE0, 0x11EF8 }, { 0x11F00, 0x11F10 }, { 0x11F12, 0x11F3A }, { 0x11F3E, 0x11F59 }, { 0x11FB0, 0x11FB0 }, { 0x11FC0, 0x11FF1 }, { 0x11FFF, 0x12399 }, { 0x12400, 0x1246E }, { 0x12470, 0x12474 }, { 0x12480, 0x12543 }, { 0x12F90, 0x12FF2 }, { 0x13000, 0x13455 }, { 0x14400, 0x14646 }, { 0x16800, 0x16A38 }, { 0x16A40, 0x16A5E }, { 0x16A60, 0x16A69 }, { 0x16A6E, 0x16ABE }, { 0x16AC0, 0x16AC9 }, { 0x16AD0, 0x16AED }, { 0x16AF0, 0x16AF5 }, { 0x16B00, 0x16B45 }, { 0x16B50, 0x16B59 }, { 0x16B5B, 0x16B61 }, { 0x16B63, 0x16B77 }, { 0x16B7D, 0x16B8F }, { 0x16E40, 0x16E9A }, { 0x16F00, 0x16F4A }, { 0x16F4F, 0x16F87 }, { 0x16F8F, 0x16F9F }, { 0x16FE0, 0x16FE4 }, { 0x16FF0, 0x16FF1 }, { 0x17000, 0x187F7 }, { 0x18800, 0x18CD5 }, { 0x18D00, 0x18D08 }, { 0x1AFF0, 0x1AFF3 }, { 0x1AFF5, 0x1AFFB }, { 0x1AFFD, 0x1AFFE }, { 0x1B000, 0x1B122 }, { 0x1B132, 0x1B132 }, { 0x1B150, 0x1B152 }, { 0x1B155, 0x1B155 }, { 0x1B164, 0x1B167 }, { 0x1B170, 0x1B2FB }, { 0x1BC00, 0x1BC6A }, { 0x1BC70, 0x1BC7C }, { 0x1BC80, 0x1BC88 }, { 0x1BC90, 0x1BC99 }, { 0x1BC9C, 0x1BCA3 }, { 0x1CF00, 0x1CF2D }, { 0x1CF30, 0x1CF46 }, { 0x1CF50, 0x1CFC3 }, { 0x1D000, 0x1D0F5 }, { 0x1D100, 0x1D126 }, { 0x1D129, 0x1D1EA }, { 0x1D200, 0x1D245 }, { 0x1D2C0, 0x1D2D3 }, { 0x1D2E0, 0x1D2F3 }, { 0x1D300, 0x1D356 }, { 0x1D360, 0x1D378 }, { 0x1D400, 0x1D454 }, { 0x1D456, 0x1D49C }, { 0x1D49E, 0x1D49F }, { 0x1D4A2, 0x1D4A2 }, { 0x1D4A5, 0x1D4A6 }, { 0x1D4A9, 0x1D4AC }, { 0x1D4AE, 0x1D4B9 }, { 0x1D4BB, 0x1D4BB }, { 0x1D4BD, 0x1D4C3 }, { 0x1D4C5, 0x1D505 }, { 0x1D507, 0x1D50A }, { 0x1D50D, 0x1D514 }, { 0x1D516, 0x1D51C }, { 0x1D51E, 0x1D539 }, { 0x1D53B, 0x1D53E }, { 0x1D540, 0x1D544 }, { 0x1D546, 0x1D546 }, { 0x1D54A, 0x1D550 }, { 0x1D552, 0x1D6A5 }, { 0x1D6A8, 0x1D7CB }, { 0x1D7CE, 0x1DA8B }, { 0x1DA9B, 0x1DA9F }, { 0x1DAA1, 0x1DAAF }, { 0x1DF00, 0x1DF1E }, { 0x1DF25, 0x1DF2A }, { 0x1E000, 0x1E006 }, { 0x1E008, 0x1E018 }, { 0x1E01B, 0x1E021 }, { 0x1E023, 0x1E024 }, { 0x1E026, 0x1E02A }, { 0x1E030, 0x1E06D }, { 0x1E08F, 0x1E08F }, { 0x1E100, 0x1E12C }, { 0x1E130, 0x1E13D }, { 0x1E140, 0x1E149 }, { 0x1E14E, 0x1E14F }, { 0x1E290, 0x1E2AE }, { 0x1E2C0, 0x1E2F9 }, { 0x1E2FF, 0x1E2FF }, { 0x1E4D0, 0x1E4F9 }, { 0x1E7E0, 0x1E7E6 }, { 0x1E7E8, 0x1E7EB }, { 0x1E7ED, 0x1E7EE }, { 0x1E7F0, 0x1E7FE }, { 0x1E800, 0x1E8C4 }, { 0x1E8C7, 0x1E8D6 }, { 0x1E900, 0x1E94B }, { 0x1E950, 0x1E959 }, { 0x1E95E, 0x1E95F }, { 0x1EC71, 0x1ECB4 }, { 0x1ED01, 0x1ED3D }, { 0x1EE00, 0x1EE03 }, { 0x1EE05, 0x1EE1F }, { 0x1EE21, 0x1EE22 }, { 0x1EE24, 0x1EE24 }, { 0x1EE27, 0x1EE27 }, { 0x1EE29, 0x1EE32 }, { 0x1EE34, 0x1EE37 }, { 0x1EE39, 0x1EE39 }, { 0x1EE3B, 0x1EE3B }, { 0x1EE42, 0x1EE42 }, { 0x1EE47, 0x1EE47 }, { 0x1EE49, 0x1EE49 }, { 0x1EE4B, 0x1EE4B }, { 0x1EE4D, 0x1EE4F }, { 0x1EE51, 0x1EE52 }, { 0x1EE54, 0x1EE54 }, { 0x1EE57, 0x1EE57 }, { 0x1EE59, 0x1EE59 }, { 0x1EE5B, 0x1EE5B }, { 0x1EE5D, 0x1EE5D }, { 0x1EE5F, 0x1EE5F }, { 0x1EE61, 0x1EE62 }, { 0x1EE64, 0x1EE64 }, { 0x1EE67, 0x1EE6A }, { 0x1EE6C, 0x1EE72 }, { 0x1EE74, 0x1EE77 }, { 0x1EE79, 0x1EE7C }, { 0x1EE7E, 0x1EE7E }, { 0x1EE80, 0x1EE89 }, { 0x1EE8B, 0x1EE9B }, { 0x1EEA1, 0x1EEA3 }, { 0x1EEA5, 0x1EEA9 }, { 0x1EEAB, 0x1EEBB }, { 0x1EEF0, 0x1EEF1 }, { 0x1F000, 0x1F02B }, { 0x1F030, 0x1F093 }, { 0x1F0A0, 0x1F0AE }, { 0x1F0B1, 0x1F0BF }, { 0x1F0C1, 0x1F0CF }, { 0x1F0D1, 0x1F0F5 }, { 0x1F100, 0x1F1AD }, { 0x1F1E6, 0x1F202 }, { 0x1F210, 0x1F23B }, { 0x1F240, 0x1F248 }, { 0x1F250, 0x1F251 }, { 0x1F260, 0x1F265 }, { 0x1F300, 0x1F6D7 }, { 0x1F6DC, 0x1F6EC }, { 0x1F6F0, 0x1F6FC }, { 0x1F700, 0x1F776 }, { 0x1F77B, 0x1F7D9 }, { 0x1F7E0, 0x1F7EB }, { 0x1F7F0, 0x1F7F0 }, { 0x1F800, 0x1F80B }, { 0x1F810, 0x1F847 }, { 0x1F850, 0x1F859 }, { 0x1F860, 0x1F887 }, { 0x1F890, 0x1F8AD }, { 0x1F8B0, 0x1F8B1 }, { 0x1F900, 0x1FA53 }, { 0x1FA60, 0x1FA6D }, { 0x1FA70, 0x1FA7C }, { 0x1FA80, 0x1FA88 }, { 0x1FA90, 0x1FABD }, { 0x1FABF, 0x1FAC5 }, { 0x1FACE, 0x1FADB }, { 0x1FAE0, 0x1FAE8 }, { 0x1FAF0, 0x1FAF8 }, { 0x1FB00, 0x1FB92 }, { 0x1FB94, 0x1FBCA }, { 0x1FBF0, 0x1FBF9 }, { 0x20000, 0x2A6DF }, { 0x2A700, 0x2B739 }, { 0x2B740, 0x2B81D }, { 0x2B820, 0x2CEA1 }, { 0x2CEB0, 0x2EBE0 }, { 0x2F800, 0x2FA1D }, { 0x30000, 0x3134A }, { 0x31350, 0x323AF }, { 0xE0001, 0xE0001 }, { 0xE0020, 0xE007F }, { 0xE0100, 0xE01EF }, { 0xF0000, 0xFFFFD }, { 0x100000, 0x10FFFD } }; MAKE_ISW(print) #ifdef TEST_I18N static const struct mb_ucsrange data_wctype_xdigit[] = { { 0x0030, 0x0039 }, { 0x0041, 0x0046 }, { 0x0061, 0x0066 } }; MAKE_ISW(xdigit) static const struct mb_ucsrange data_wctype_blank[] = { { 0x0009, 0x0009 }, { 0x0020, 0x0020 }, { 0x1680, 0x1680 }, { 0x2000, 0x2006 }, { 0x2008, 0x200B }, { 0x205F, 0x205F }, { 0x3000, 0x3000 } }; MAKE_ISW(blank) #endif /* Conversion functions */ static const struct mb_ucsrange data_wcrange_toupper[] = { { 0x0061, 0x007A }, { 0x00B5, 0x00B5 }, { 0x00E0, 0x00F6 }, { 0x00F8, 0x00FE }, { 0x00FF, 0x00FF }, { 0x0101, 0x0101 }, { 0x0103, 0x0103 }, { 0x0105, 0x0105 }, { 0x0107, 0x0107 }, { 0x0109, 0x0109 }, { 0x010B, 0x010B }, { 0x010D, 0x010D }, { 0x010F, 0x010F }, { 0x0111, 0x0111 }, { 0x0113, 0x0113 }, { 0x0115, 0x0115 }, { 0x0117, 0x0117 }, { 0x0119, 0x0119 }, { 0x011B, 0x011B }, { 0x011D, 0x011D }, { 0x011F, 0x011F }, { 0x0121, 0x0121 }, { 0x0123, 0x0123 }, { 0x0125, 0x0125 }, { 0x0127, 0x0127 }, { 0x0129, 0x0129 }, { 0x012B, 0x012B }, { 0x012D, 0x012D }, { 0x012F, 0x012F }, { 0x0131, 0x0131 }, { 0x0133, 0x0133 }, { 0x0135, 0x0135 }, { 0x0137, 0x0137 }, { 0x013A, 0x013A }, { 0x013C, 0x013C }, { 0x013E, 0x013E }, { 0x0140, 0x0140 }, { 0x0142, 0x0142 }, { 0x0144, 0x0144 }, { 0x0146, 0x0146 }, { 0x0148, 0x0148 }, { 0x014B, 0x014B }, { 0x014D, 0x014D }, { 0x014F, 0x014F }, { 0x0151, 0x0151 }, { 0x0153, 0x0153 }, { 0x0155, 0x0155 }, { 0x0157, 0x0157 }, { 0x0159, 0x0159 }, { 0x015B, 0x015B }, { 0x015D, 0x015D }, { 0x015F, 0x015F }, { 0x0161, 0x0161 }, { 0x0163, 0x0163 }, { 0x0165, 0x0165 }, { 0x0167, 0x0167 }, { 0x0169, 0x0169 }, { 0x016B, 0x016B }, { 0x016D, 0x016D }, { 0x016F, 0x016F }, { 0x0171, 0x0171 }, { 0x0173, 0x0173 }, { 0x0175, 0x0175 }, { 0x0177, 0x0177 }, { 0x017A, 0x017A }, { 0x017C, 0x017C }, { 0x017E, 0x017E }, { 0x017F, 0x017F }, { 0x0180, 0x0180 }, { 0x0183, 0x0183 }, { 0x0185, 0x0185 }, { 0x0188, 0x0188 }, { 0x018C, 0x018C }, { 0x0192, 0x0192 }, { 0x0195, 0x0195 }, { 0x0199, 0x0199 }, { 0x019A, 0x019A }, { 0x019E, 0x019E }, { 0x01A1, 0x01A1 }, { 0x01A3, 0x01A3 }, { 0x01A5, 0x01A5 }, { 0x01A8, 0x01A8 }, { 0x01AD, 0x01AD }, { 0x01B0, 0x01B0 }, { 0x01B4, 0x01B4 }, { 0x01B6, 0x01B6 }, { 0x01B9, 0x01B9 }, { 0x01BD, 0x01BD }, { 0x01BF, 0x01BF }, { 0x01C5, 0x01C5 }, { 0x01C6, 0x01C6 }, { 0x01C8, 0x01C8 }, { 0x01C9, 0x01C9 }, { 0x01CB, 0x01CB }, { 0x01CC, 0x01CC }, { 0x01CE, 0x01CE }, { 0x01D0, 0x01D0 }, { 0x01D2, 0x01D2 }, { 0x01D4, 0x01D4 }, { 0x01D6, 0x01D6 }, { 0x01D8, 0x01D8 }, { 0x01DA, 0x01DA }, { 0x01DC, 0x01DC }, { 0x01DD, 0x01DD }, { 0x01DF, 0x01DF }, { 0x01E1, 0x01E1 }, { 0x01E3, 0x01E3 }, { 0x01E5, 0x01E5 }, { 0x01E7, 0x01E7 }, { 0x01E9, 0x01E9 }, { 0x01EB, 0x01EB }, { 0x01ED, 0x01ED }, { 0x01EF, 0x01EF }, { 0x01F2, 0x01F2 }, { 0x01F3, 0x01F3 }, { 0x01F5, 0x01F5 }, { 0x01F9, 0x01F9 }, { 0x01FB, 0x01FB }, { 0x01FD, 0x01FD }, { 0x01FF, 0x01FF }, { 0x0201, 0x0201 }, { 0x0203, 0x0203 }, { 0x0205, 0x0205 }, { 0x0207, 0x0207 }, { 0x0209, 0x0209 }, { 0x020B, 0x020B }, { 0x020D, 0x020D }, { 0x020F, 0x020F }, { 0x0211, 0x0211 }, { 0x0213, 0x0213 }, { 0x0215, 0x0215 }, { 0x0217, 0x0217 }, { 0x0219, 0x0219 }, { 0x021B, 0x021B }, { 0x021D, 0x021D }, { 0x021F, 0x021F }, { 0x0223, 0x0223 }, { 0x0225, 0x0225 }, { 0x0227, 0x0227 }, { 0x0229, 0x0229 }, { 0x022B, 0x022B }, { 0x022D, 0x022D }, { 0x022F, 0x022F }, { 0x0231, 0x0231 }, { 0x0233, 0x0233 }, { 0x023C, 0x023C }, { 0x023F, 0x0240 }, { 0x0242, 0x0242 }, { 0x0247, 0x0247 }, { 0x0249, 0x0249 }, { 0x024B, 0x024B }, { 0x024D, 0x024D }, { 0x024F, 0x024F }, { 0x0250, 0x0250 }, { 0x0251, 0x0251 }, { 0x0252, 0x0252 }, { 0x0253, 0x0253 }, { 0x0254, 0x0254 }, { 0x0256, 0x0257 }, { 0x0259, 0x0259 }, { 0x025B, 0x025B }, { 0x025C, 0x025C }, { 0x0260, 0x0260 }, { 0x0261, 0x0261 }, { 0x0263, 0x0263 }, { 0x0265, 0x0265 }, { 0x0266, 0x0266 }, { 0x0268, 0x0268 }, { 0x0269, 0x0269 }, { 0x026A, 0x026A }, { 0x026B, 0x026B }, { 0x026C, 0x026C }, { 0x026F, 0x026F }, { 0x0271, 0x0271 }, { 0x0272, 0x0272 }, { 0x0275, 0x0275 }, { 0x027D, 0x027D }, { 0x0280, 0x0280 }, { 0x0282, 0x0282 }, { 0x0283, 0x0283 }, { 0x0287, 0x0287 }, { 0x0288, 0x0288 }, { 0x0289, 0x0289 }, { 0x028A, 0x028B }, { 0x028C, 0x028C }, { 0x0292, 0x0292 }, { 0x029D, 0x029D }, { 0x029E, 0x029E }, { 0x0345, 0x0345 }, { 0x0371, 0x0371 }, { 0x0373, 0x0373 }, { 0x0377, 0x0377 }, { 0x037B, 0x037D }, { 0x03AC, 0x03AC }, { 0x03AD, 0x03AF }, { 0x03B1, 0x03C1 }, { 0x03C2, 0x03C2 }, { 0x03C3, 0x03CB }, { 0x03CC, 0x03CC }, { 0x03CD, 0x03CE }, { 0x03D0, 0x03D0 }, { 0x03D1, 0x03D1 }, { 0x03D5, 0x03D5 }, { 0x03D6, 0x03D6 }, { 0x03D7, 0x03D7 }, { 0x03D9, 0x03D9 }, { 0x03DB, 0x03DB }, { 0x03DD, 0x03DD }, { 0x03DF, 0x03DF }, { 0x03E1, 0x03E1 }, { 0x03E3, 0x03E3 }, { 0x03E5, 0x03E5 }, { 0x03E7, 0x03E7 }, { 0x03E9, 0x03E9 }, { 0x03EB, 0x03EB }, { 0x03ED, 0x03ED }, { 0x03EF, 0x03EF }, { 0x03F0, 0x03F0 }, { 0x03F1, 0x03F1 }, { 0x03F2, 0x03F2 }, { 0x03F3, 0x03F3 }, { 0x03F5, 0x03F5 }, { 0x03F8, 0x03F8 }, { 0x03FB, 0x03FB }, { 0x0430, 0x044F }, { 0x0450, 0x045F }, { 0x0461, 0x0461 }, { 0x0463, 0x0463 }, { 0x0465, 0x0465 }, { 0x0467, 0x0467 }, { 0x0469, 0x0469 }, { 0x046B, 0x046B }, { 0x046D, 0x046D }, { 0x046F, 0x046F }, { 0x0471, 0x0471 }, { 0x0473, 0x0473 }, { 0x0475, 0x0475 }, { 0x0477, 0x0477 }, { 0x0479, 0x0479 }, { 0x047B, 0x047B }, { 0x047D, 0x047D }, { 0x047F, 0x047F }, { 0x0481, 0x0481 }, { 0x048B, 0x048B }, { 0x048D, 0x048D }, { 0x048F, 0x048F }, { 0x0491, 0x0491 }, { 0x0493, 0x0493 }, { 0x0495, 0x0495 }, { 0x0497, 0x0497 }, { 0x0499, 0x0499 }, { 0x049B, 0x049B }, { 0x049D, 0x049D }, { 0x049F, 0x049F }, { 0x04A1, 0x04A1 }, { 0x04A3, 0x04A3 }, { 0x04A5, 0x04A5 }, { 0x04A7, 0x04A7 }, { 0x04A9, 0x04A9 }, { 0x04AB, 0x04AB }, { 0x04AD, 0x04AD }, { 0x04AF, 0x04AF }, { 0x04B1, 0x04B1 }, { 0x04B3, 0x04B3 }, { 0x04B5, 0x04B5 }, { 0x04B7, 0x04B7 }, { 0x04B9, 0x04B9 }, { 0x04BB, 0x04BB }, { 0x04BD, 0x04BD }, { 0x04BF, 0x04BF }, { 0x04C2, 0x04C2 }, { 0x04C4, 0x04C4 }, { 0x04C6, 0x04C6 }, { 0x04C8, 0x04C8 }, { 0x04CA, 0x04CA }, { 0x04CC, 0x04CC }, { 0x04CE, 0x04CE }, { 0x04CF, 0x04CF }, { 0x04D1, 0x04D1 }, { 0x04D3, 0x04D3 }, { 0x04D5, 0x04D5 }, { 0x04D7, 0x04D7 }, { 0x04D9, 0x04D9 }, { 0x04DB, 0x04DB }, { 0x04DD, 0x04DD }, { 0x04DF, 0x04DF }, { 0x04E1, 0x04E1 }, { 0x04E3, 0x04E3 }, { 0x04E5, 0x04E5 }, { 0x04E7, 0x04E7 }, { 0x04E9, 0x04E9 }, { 0x04EB, 0x04EB }, { 0x04ED, 0x04ED }, { 0x04EF, 0x04EF }, { 0x04F1, 0x04F1 }, { 0x04F3, 0x04F3 }, { 0x04F5, 0x04F5 }, { 0x04F7, 0x04F7 }, { 0x04F9, 0x04F9 }, { 0x04FB, 0x04FB }, { 0x04FD, 0x04FD }, { 0x04FF, 0x04FF }, { 0x0501, 0x0501 }, { 0x0503, 0x0503 }, { 0x0505, 0x0505 }, { 0x0507, 0x0507 }, { 0x0509, 0x0509 }, { 0x050B, 0x050B }, { 0x050D, 0x050D }, { 0x050F, 0x050F }, { 0x0511, 0x0511 }, { 0x0513, 0x0513 }, { 0x0515, 0x0515 }, { 0x0517, 0x0517 }, { 0x0519, 0x0519 }, { 0x051B, 0x051B }, { 0x051D, 0x051D }, { 0x051F, 0x051F }, { 0x0521, 0x0521 }, { 0x0523, 0x0523 }, { 0x0525, 0x0525 }, { 0x0527, 0x0527 }, { 0x0529, 0x0529 }, { 0x052B, 0x052B }, { 0x052D, 0x052D }, { 0x052F, 0x052F }, { 0x0561, 0x0586 }, { 0x10D0, 0x10FA }, { 0x10FD, 0x10FF }, { 0x13F8, 0x13FD }, { 0x1C80, 0x1C80 }, { 0x1C81, 0x1C81 }, { 0x1C82, 0x1C82 }, { 0x1C83, 0x1C84 }, { 0x1C85, 0x1C85 }, { 0x1C86, 0x1C86 }, { 0x1C87, 0x1C87 }, { 0x1C88, 0x1C88 }, { 0x1D79, 0x1D79 }, { 0x1D7D, 0x1D7D }, { 0x1D8E, 0x1D8E }, { 0x1E01, 0x1E01 }, { 0x1E03, 0x1E03 }, { 0x1E05, 0x1E05 }, { 0x1E07, 0x1E07 }, { 0x1E09, 0x1E09 }, { 0x1E0B, 0x1E0B }, { 0x1E0D, 0x1E0D }, { 0x1E0F, 0x1E0F }, { 0x1E11, 0x1E11 }, { 0x1E13, 0x1E13 }, { 0x1E15, 0x1E15 }, { 0x1E17, 0x1E17 }, { 0x1E19, 0x1E19 }, { 0x1E1B, 0x1E1B }, { 0x1E1D, 0x1E1D }, { 0x1E1F, 0x1E1F }, { 0x1E21, 0x1E21 }, { 0x1E23, 0x1E23 }, { 0x1E25, 0x1E25 }, { 0x1E27, 0x1E27 }, { 0x1E29, 0x1E29 }, { 0x1E2B, 0x1E2B }, { 0x1E2D, 0x1E2D }, { 0x1E2F, 0x1E2F }, { 0x1E31, 0x1E31 }, { 0x1E33, 0x1E33 }, { 0x1E35, 0x1E35 }, { 0x1E37, 0x1E37 }, { 0x1E39, 0x1E39 }, { 0x1E3B, 0x1E3B }, { 0x1E3D, 0x1E3D }, { 0x1E3F, 0x1E3F }, { 0x1E41, 0x1E41 }, { 0x1E43, 0x1E43 }, { 0x1E45, 0x1E45 }, { 0x1E47, 0x1E47 }, { 0x1E49, 0x1E49 }, { 0x1E4B, 0x1E4B }, { 0x1E4D, 0x1E4D }, { 0x1E4F, 0x1E4F }, { 0x1E51, 0x1E51 }, { 0x1E53, 0x1E53 }, { 0x1E55, 0x1E55 }, { 0x1E57, 0x1E57 }, { 0x1E59, 0x1E59 }, { 0x1E5B, 0x1E5B }, { 0x1E5D, 0x1E5D }, { 0x1E5F, 0x1E5F }, { 0x1E61, 0x1E61 }, { 0x1E63, 0x1E63 }, { 0x1E65, 0x1E65 }, { 0x1E67, 0x1E67 }, { 0x1E69, 0x1E69 }, { 0x1E6B, 0x1E6B }, { 0x1E6D, 0x1E6D }, { 0x1E6F, 0x1E6F }, { 0x1E71, 0x1E71 }, { 0x1E73, 0x1E73 }, { 0x1E75, 0x1E75 }, { 0x1E77, 0x1E77 }, { 0x1E79, 0x1E79 }, { 0x1E7B, 0x1E7B }, { 0x1E7D, 0x1E7D }, { 0x1E7F, 0x1E7F }, { 0x1E81, 0x1E81 }, { 0x1E83, 0x1E83 }, { 0x1E85, 0x1E85 }, { 0x1E87, 0x1E87 }, { 0x1E89, 0x1E89 }, { 0x1E8B, 0x1E8B }, { 0x1E8D, 0x1E8D }, { 0x1E8F, 0x1E8F }, { 0x1E91, 0x1E91 }, { 0x1E93, 0x1E93 }, { 0x1E95, 0x1E95 }, { 0x1E9B, 0x1E9B }, { 0x1EA1, 0x1EA1 }, { 0x1EA3, 0x1EA3 }, { 0x1EA5, 0x1EA5 }, { 0x1EA7, 0x1EA7 }, { 0x1EA9, 0x1EA9 }, { 0x1EAB, 0x1EAB }, { 0x1EAD, 0x1EAD }, { 0x1EAF, 0x1EAF }, { 0x1EB1, 0x1EB1 }, { 0x1EB3, 0x1EB3 }, { 0x1EB5, 0x1EB5 }, { 0x1EB7, 0x1EB7 }, { 0x1EB9, 0x1EB9 }, { 0x1EBB, 0x1EBB }, { 0x1EBD, 0x1EBD }, { 0x1EBF, 0x1EBF }, { 0x1EC1, 0x1EC1 }, { 0x1EC3, 0x1EC3 }, { 0x1EC5, 0x1EC5 }, { 0x1EC7, 0x1EC7 }, { 0x1EC9, 0x1EC9 }, { 0x1ECB, 0x1ECB }, { 0x1ECD, 0x1ECD }, { 0x1ECF, 0x1ECF }, { 0x1ED1, 0x1ED1 }, { 0x1ED3, 0x1ED3 }, { 0x1ED5, 0x1ED5 }, { 0x1ED7, 0x1ED7 }, { 0x1ED9, 0x1ED9 }, { 0x1EDB, 0x1EDB }, { 0x1EDD, 0x1EDD }, { 0x1EDF, 0x1EDF }, { 0x1EE1, 0x1EE1 }, { 0x1EE3, 0x1EE3 }, { 0x1EE5, 0x1EE5 }, { 0x1EE7, 0x1EE7 }, { 0x1EE9, 0x1EE9 }, { 0x1EEB, 0x1EEB }, { 0x1EED, 0x1EED }, { 0x1EEF, 0x1EEF }, { 0x1EF1, 0x1EF1 }, { 0x1EF3, 0x1EF3 }, { 0x1EF5, 0x1EF5 }, { 0x1EF7, 0x1EF7 }, { 0x1EF9, 0x1EF9 }, { 0x1EFB, 0x1EFB }, { 0x1EFD, 0x1EFD }, { 0x1EFF, 0x1EFF }, { 0x1F00, 0x1F07 }, { 0x1F10, 0x1F15 }, { 0x1F20, 0x1F27 }, { 0x1F30, 0x1F37 }, { 0x1F40, 0x1F45 }, { 0x1F51, 0x1F51 }, { 0x1F53, 0x1F53 }, { 0x1F55, 0x1F55 }, { 0x1F57, 0x1F57 }, { 0x1F60, 0x1F67 }, { 0x1F70, 0x1F71 }, { 0x1F72, 0x1F75 }, { 0x1F76, 0x1F77 }, { 0x1F78, 0x1F79 }, { 0x1F7A, 0x1F7B }, { 0x1F7C, 0x1F7D }, { 0x1F80, 0x1F87 }, { 0x1F90, 0x1F97 }, { 0x1FA0, 0x1FA7 }, { 0x1FB0, 0x1FB1 }, { 0x1FB3, 0x1FB3 }, { 0x1FBE, 0x1FBE }, { 0x1FC3, 0x1FC3 }, { 0x1FD0, 0x1FD1 }, { 0x1FE0, 0x1FE1 }, { 0x1FE5, 0x1FE5 }, { 0x1FF3, 0x1FF3 }, { 0x214E, 0x214E }, { 0x2170, 0x217F }, { 0x2184, 0x2184 }, { 0x24D0, 0x24E9 }, { 0x2C30, 0x2C5F }, { 0x2C61, 0x2C61 }, { 0x2C65, 0x2C65 }, { 0x2C66, 0x2C66 }, { 0x2C68, 0x2C68 }, { 0x2C6A, 0x2C6A }, { 0x2C6C, 0x2C6C }, { 0x2C73, 0x2C73 }, { 0x2C76, 0x2C76 }, { 0x2C81, 0x2C81 }, { 0x2C83, 0x2C83 }, { 0x2C85, 0x2C85 }, { 0x2C87, 0x2C87 }, { 0x2C89, 0x2C89 }, { 0x2C8B, 0x2C8B }, { 0x2C8D, 0x2C8D }, { 0x2C8F, 0x2C8F }, { 0x2C91, 0x2C91 }, { 0x2C93, 0x2C93 }, { 0x2C95, 0x2C95 }, { 0x2C97, 0x2C97 }, { 0x2C99, 0x2C99 }, { 0x2C9B, 0x2C9B }, { 0x2C9D, 0x2C9D }, { 0x2C9F, 0x2C9F }, { 0x2CA1, 0x2CA1 }, { 0x2CA3, 0x2CA3 }, { 0x2CA5, 0x2CA5 }, { 0x2CA7, 0x2CA7 }, { 0x2CA9, 0x2CA9 }, { 0x2CAB, 0x2CAB }, { 0x2CAD, 0x2CAD }, { 0x2CAF, 0x2CAF }, { 0x2CB1, 0x2CB1 }, { 0x2CB3, 0x2CB3 }, { 0x2CB5, 0x2CB5 }, { 0x2CB7, 0x2CB7 }, { 0x2CB9, 0x2CB9 }, { 0x2CBB, 0x2CBB }, { 0x2CBD, 0x2CBD }, { 0x2CBF, 0x2CBF }, { 0x2CC1, 0x2CC1 }, { 0x2CC3, 0x2CC3 }, { 0x2CC5, 0x2CC5 }, { 0x2CC7, 0x2CC7 }, { 0x2CC9, 0x2CC9 }, { 0x2CCB, 0x2CCB }, { 0x2CCD, 0x2CCD }, { 0x2CCF, 0x2CCF }, { 0x2CD1, 0x2CD1 }, { 0x2CD3, 0x2CD3 }, { 0x2CD5, 0x2CD5 }, { 0x2CD7, 0x2CD7 }, { 0x2CD9, 0x2CD9 }, { 0x2CDB, 0x2CDB }, { 0x2CDD, 0x2CDD }, { 0x2CDF, 0x2CDF }, { 0x2CE1, 0x2CE1 }, { 0x2CE3, 0x2CE3 }, { 0x2CEC, 0x2CEC }, { 0x2CEE, 0x2CEE }, { 0x2CF3, 0x2CF3 }, { 0x2D00, 0x2D25 }, { 0x2D27, 0x2D27 }, { 0x2D2D, 0x2D2D }, { 0xA641, 0xA641 }, { 0xA643, 0xA643 }, { 0xA645, 0xA645 }, { 0xA647, 0xA647 }, { 0xA649, 0xA649 }, { 0xA64B, 0xA64B }, { 0xA64D, 0xA64D }, { 0xA64F, 0xA64F }, { 0xA651, 0xA651 }, { 0xA653, 0xA653 }, { 0xA655, 0xA655 }, { 0xA657, 0xA657 }, { 0xA659, 0xA659 }, { 0xA65B, 0xA65B }, { 0xA65D, 0xA65D }, { 0xA65F, 0xA65F }, { 0xA661, 0xA661 }, { 0xA663, 0xA663 }, { 0xA665, 0xA665 }, { 0xA667, 0xA667 }, { 0xA669, 0xA669 }, { 0xA66B, 0xA66B }, { 0xA66D, 0xA66D }, { 0xA681, 0xA681 }, { 0xA683, 0xA683 }, { 0xA685, 0xA685 }, { 0xA687, 0xA687 }, { 0xA689, 0xA689 }, { 0xA68B, 0xA68B }, { 0xA68D, 0xA68D }, { 0xA68F, 0xA68F }, { 0xA691, 0xA691 }, { 0xA693, 0xA693 }, { 0xA695, 0xA695 }, { 0xA697, 0xA697 }, { 0xA699, 0xA699 }, { 0xA69B, 0xA69B }, { 0xA723, 0xA723 }, { 0xA725, 0xA725 }, { 0xA727, 0xA727 }, { 0xA729, 0xA729 }, { 0xA72B, 0xA72B }, { 0xA72D, 0xA72D }, { 0xA72F, 0xA72F }, { 0xA733, 0xA733 }, { 0xA735, 0xA735 }, { 0xA737, 0xA737 }, { 0xA739, 0xA739 }, { 0xA73B, 0xA73B }, { 0xA73D, 0xA73D }, { 0xA73F, 0xA73F }, { 0xA741, 0xA741 }, { 0xA743, 0xA743 }, { 0xA745, 0xA745 }, { 0xA747, 0xA747 }, { 0xA749, 0xA749 }, { 0xA74B, 0xA74B }, { 0xA74D, 0xA74D }, { 0xA74F, 0xA74F }, { 0xA751, 0xA751 }, { 0xA753, 0xA753 }, { 0xA755, 0xA755 }, { 0xA757, 0xA757 }, { 0xA759, 0xA759 }, { 0xA75B, 0xA75B }, { 0xA75D, 0xA75D }, { 0xA75F, 0xA75F }, { 0xA761, 0xA761 }, { 0xA763, 0xA763 }, { 0xA765, 0xA765 }, { 0xA767, 0xA767 }, { 0xA769, 0xA769 }, { 0xA76B, 0xA76B }, { 0xA76D, 0xA76D }, { 0xA76F, 0xA76F }, { 0xA77A, 0xA77A }, { 0xA77C, 0xA77C }, { 0xA77F, 0xA77F }, { 0xA781, 0xA781 }, { 0xA783, 0xA783 }, { 0xA785, 0xA785 }, { 0xA787, 0xA787 }, { 0xA78C, 0xA78C }, { 0xA791, 0xA791 }, { 0xA793, 0xA793 }, { 0xA794, 0xA794 }, { 0xA797, 0xA797 }, { 0xA799, 0xA799 }, { 0xA79B, 0xA79B }, { 0xA79D, 0xA79D }, { 0xA79F, 0xA79F }, { 0xA7A1, 0xA7A1 }, { 0xA7A3, 0xA7A3 }, { 0xA7A5, 0xA7A5 }, { 0xA7A7, 0xA7A7 }, { 0xA7A9, 0xA7A9 }, { 0xA7B5, 0xA7B5 }, { 0xA7B7, 0xA7B7 }, { 0xA7B9, 0xA7B9 }, { 0xA7BB, 0xA7BB }, { 0xA7BD, 0xA7BD }, { 0xA7BF, 0xA7BF }, { 0xA7C1, 0xA7C1 }, { 0xA7C3, 0xA7C3 }, { 0xA7C8, 0xA7C8 }, { 0xA7CA, 0xA7CA }, { 0xA7D1, 0xA7D1 }, { 0xA7D7, 0xA7D7 }, { 0xA7D9, 0xA7D9 }, { 0xA7F6, 0xA7F6 }, { 0xAB53, 0xAB53 }, { 0xAB70, 0xABBF }, { 0xFF41, 0xFF5A }, { 0x10428, 0x1044F }, { 0x104D8, 0x104FB }, { 0x10597, 0x105A1 }, { 0x105A3, 0x105B1 }, { 0x105B3, 0x105B9 }, { 0x105BB, 0x105BC }, { 0x10CC0, 0x10CF2 }, { 0x118C0, 0x118DF }, { 0x16E60, 0x16E7F }, { 0x1E922, 0x1E943 } }; static const int data_wcdelta_toupper[] = { 32, -743, 32, 32, -121, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 232, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 300, -195, 1, 1, 1, 1, 1, -97, 1, -163, -130, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, -56, 1, 2, 1, 2, 1, 2, 1, 1, 1, 1, 1, 1, 1, 1, 79, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 2, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, -10815, 1, 1, 1, 1, 1, 1, -10783, -10780, -10782, 210, 206, 205, 202, 203, -42319, 205, -42315, 207, -42280, -42308, 209, 211, -42308, -10743, -42305, 211, -10749, 213, 214, -10727, 218, -42307, 218, -42282, 218, 69, 217, 71, 219, -42261, -42258, -84, 1, 1, 1, -130, 38, 37, 32, 31, 32, 64, 63, 62, 57, 47, 54, 8, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 86, 80, -7, 116, 96, 1, 1, 32, 80, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 15, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 48, -3008, -3008, 8, 6254, 6253, 6244, 6242, 6243, 6236, 6181, -35266, -35332, -3814, -35384, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 59, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, -8, -8, -8, -8, -8, -8, -8, -8, -8, -8, -74, -86, -100, -128, -112, -126, -8, -8, -8, -8, -9, 7205, -9, -8, -8, -7, -9, 28, 16, 1, 26, 48, 1, 10795, 10792, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 7264, 7264, 7264, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, -48, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 928, 38864, 32, 40, 40, 39, 39, 39, 39, 64, 32, 32, 34 }; int joe_towupper(int c) { size_t idx; if ((idx = mb_ucsbsearch(data_wcrange_toupper, NELEM(data_wcrange_toupper), c)) == (size_t)-1) return (c); return (c - data_wcdelta_toupper[idx]); } static const struct mb_ucsrange data_wcrange_tolower[] = { { 0x0041, 0x005A }, { 0x00C0, 0x00D6 }, { 0x00D8, 0x00DE }, { 0x0100, 0x0100 }, { 0x0102, 0x0102 }, { 0x0104, 0x0104 }, { 0x0106, 0x0106 }, { 0x0108, 0x0108 }, { 0x010A, 0x010A }, { 0x010C, 0x010C }, { 0x010E, 0x010E }, { 0x0110, 0x0110 }, { 0x0112, 0x0112 }, { 0x0114, 0x0114 }, { 0x0116, 0x0116 }, { 0x0118, 0x0118 }, { 0x011A, 0x011A }, { 0x011C, 0x011C }, { 0x011E, 0x011E }, { 0x0120, 0x0120 }, { 0x0122, 0x0122 }, { 0x0124, 0x0124 }, { 0x0126, 0x0126 }, { 0x0128, 0x0128 }, { 0x012A, 0x012A }, { 0x012C, 0x012C }, { 0x012E, 0x012E }, { 0x0130, 0x0130 }, { 0x0132, 0x0132 }, { 0x0134, 0x0134 }, { 0x0136, 0x0136 }, { 0x0139, 0x0139 }, { 0x013B, 0x013B }, { 0x013D, 0x013D }, { 0x013F, 0x013F }, { 0x0141, 0x0141 }, { 0x0143, 0x0143 }, { 0x0145, 0x0145 }, { 0x0147, 0x0147 }, { 0x014A, 0x014A }, { 0x014C, 0x014C }, { 0x014E, 0x014E }, { 0x0150, 0x0150 }, { 0x0152, 0x0152 }, { 0x0154, 0x0154 }, { 0x0156, 0x0156 }, { 0x0158, 0x0158 }, { 0x015A, 0x015A }, { 0x015C, 0x015C }, { 0x015E, 0x015E }, { 0x0160, 0x0160 }, { 0x0162, 0x0162 }, { 0x0164, 0x0164 }, { 0x0166, 0x0166 }, { 0x0168, 0x0168 }, { 0x016A, 0x016A }, { 0x016C, 0x016C }, { 0x016E, 0x016E }, { 0x0170, 0x0170 }, { 0x0172, 0x0172 }, { 0x0174, 0x0174 }, { 0x0176, 0x0176 }, { 0x0178, 0x0178 }, { 0x0179, 0x0179 }, { 0x017B, 0x017B }, { 0x017D, 0x017D }, { 0x0181, 0x0181 }, { 0x0182, 0x0182 }, { 0x0184, 0x0184 }, { 0x0186, 0x0186 }, { 0x0187, 0x0187 }, { 0x0189, 0x018A }, { 0x018B, 0x018B }, { 0x018E, 0x018E }, { 0x018F, 0x018F }, { 0x0190, 0x0190 }, { 0x0191, 0x0191 }, { 0x0193, 0x0193 }, { 0x0194, 0x0194 }, { 0x0196, 0x0196 }, { 0x0197, 0x0197 }, { 0x0198, 0x0198 }, { 0x019C, 0x019C }, { 0x019D, 0x019D }, { 0x019F, 0x019F }, { 0x01A0, 0x01A0 }, { 0x01A2, 0x01A2 }, { 0x01A4, 0x01A4 }, { 0x01A6, 0x01A6 }, { 0x01A7, 0x01A7 }, { 0x01A9, 0x01A9 }, { 0x01AC, 0x01AC }, { 0x01AE, 0x01AE }, { 0x01AF, 0x01AF }, { 0x01B1, 0x01B2 }, { 0x01B3, 0x01B3 }, { 0x01B5, 0x01B5 }, { 0x01B7, 0x01B7 }, { 0x01B8, 0x01B8 }, { 0x01BC, 0x01BC }, { 0x01C4, 0x01C4 }, { 0x01C5, 0x01C5 }, { 0x01C7, 0x01C7 }, { 0x01C8, 0x01C8 }, { 0x01CA, 0x01CA }, { 0x01CB, 0x01CB }, { 0x01CD, 0x01CD }, { 0x01CF, 0x01CF }, { 0x01D1, 0x01D1 }, { 0x01D3, 0x01D3 }, { 0x01D5, 0x01D5 }, { 0x01D7, 0x01D7 }, { 0x01D9, 0x01D9 }, { 0x01DB, 0x01DB }, { 0x01DE, 0x01DE }, { 0x01E0, 0x01E0 }, { 0x01E2, 0x01E2 }, { 0x01E4, 0x01E4 }, { 0x01E6, 0x01E6 }, { 0x01E8, 0x01E8 }, { 0x01EA, 0x01EA }, { 0x01EC, 0x01EC }, { 0x01EE, 0x01EE }, { 0x01F1, 0x01F1 }, { 0x01F2, 0x01F2 }, { 0x01F4, 0x01F4 }, { 0x01F6, 0x01F6 }, { 0x01F7, 0x01F7 }, { 0x01F8, 0x01F8 }, { 0x01FA, 0x01FA }, { 0x01FC, 0x01FC }, { 0x01FE, 0x01FE }, { 0x0200, 0x0200 }, { 0x0202, 0x0202 }, { 0x0204, 0x0204 }, { 0x0206, 0x0206 }, { 0x0208, 0x0208 }, { 0x020A, 0x020A }, { 0x020C, 0x020C }, { 0x020E, 0x020E }, { 0x0210, 0x0210 }, { 0x0212, 0x0212 }, { 0x0214, 0x0214 }, { 0x0216, 0x0216 }, { 0x0218, 0x0218 }, { 0x021A, 0x021A }, { 0x021C, 0x021C }, { 0x021E, 0x021E }, { 0x0220, 0x0220 }, { 0x0222, 0x0222 }, { 0x0224, 0x0224 }, { 0x0226, 0x0226 }, { 0x0228, 0x0228 }, { 0x022A, 0x022A }, { 0x022C, 0x022C }, { 0x022E, 0x022E }, { 0x0230, 0x0230 }, { 0x0232, 0x0232 }, { 0x023A, 0x023A }, { 0x023B, 0x023B }, { 0x023D, 0x023D }, { 0x023E, 0x023E }, { 0x0241, 0x0241 }, { 0x0243, 0x0243 }, { 0x0244, 0x0244 }, { 0x0245, 0x0245 }, { 0x0246, 0x0246 }, { 0x0248, 0x0248 }, { 0x024A, 0x024A }, { 0x024C, 0x024C }, { 0x024E, 0x024E }, { 0x0370, 0x0370 }, { 0x0372, 0x0372 }, { 0x0376, 0x0376 }, { 0x037F, 0x037F }, { 0x0386, 0x0386 }, { 0x0388, 0x038A }, { 0x038C, 0x038C }, { 0x038E, 0x038F }, { 0x0391, 0x03A1 }, { 0x03A3, 0x03AB }, { 0x03CF, 0x03CF }, { 0x03D8, 0x03D8 }, { 0x03DA, 0x03DA }, { 0x03DC, 0x03DC }, { 0x03DE, 0x03DE }, { 0x03E0, 0x03E0 }, { 0x03E2, 0x03E2 }, { 0x03E4, 0x03E4 }, { 0x03E6, 0x03E6 }, { 0x03E8, 0x03E8 }, { 0x03EA, 0x03EA }, { 0x03EC, 0x03EC }, { 0x03EE, 0x03EE }, { 0x03F4, 0x03F4 }, { 0x03F7, 0x03F7 }, { 0x03F9, 0x03F9 }, { 0x03FA, 0x03FA }, { 0x03FD, 0x03FF }, { 0x0400, 0x040F }, { 0x0410, 0x042F }, { 0x0460, 0x0460 }, { 0x0462, 0x0462 }, { 0x0464, 0x0464 }, { 0x0466, 0x0466 }, { 0x0468, 0x0468 }, { 0x046A, 0x046A }, { 0x046C, 0x046C }, { 0x046E, 0x046E }, { 0x0470, 0x0470 }, { 0x0472, 0x0472 }, { 0x0474, 0x0474 }, { 0x0476, 0x0476 }, { 0x0478, 0x0478 }, { 0x047A, 0x047A }, { 0x047C, 0x047C }, { 0x047E, 0x047E }, { 0x0480, 0x0480 }, { 0x048A, 0x048A }, { 0x048C, 0x048C }, { 0x048E, 0x048E }, { 0x0490, 0x0490 }, { 0x0492, 0x0492 }, { 0x0494, 0x0494 }, { 0x0496, 0x0496 }, { 0x0498, 0x0498 }, { 0x049A, 0x049A }, { 0x049C, 0x049C }, { 0x049E, 0x049E }, { 0x04A0, 0x04A0 }, { 0x04A2, 0x04A2 }, { 0x04A4, 0x04A4 }, { 0x04A6, 0x04A6 }, { 0x04A8, 0x04A8 }, { 0x04AA, 0x04AA }, { 0x04AC, 0x04AC }, { 0x04AE, 0x04AE }, { 0x04B0, 0x04B0 }, { 0x04B2, 0x04B2 }, { 0x04B4, 0x04B4 }, { 0x04B6, 0x04B6 }, { 0x04B8, 0x04B8 }, { 0x04BA, 0x04BA }, { 0x04BC, 0x04BC }, { 0x04BE, 0x04BE }, { 0x04C0, 0x04C0 }, { 0x04C1, 0x04C1 }, { 0x04C3, 0x04C3 }, { 0x04C5, 0x04C5 }, { 0x04C7, 0x04C7 }, { 0x04C9, 0x04C9 }, { 0x04CB, 0x04CB }, { 0x04CD, 0x04CD }, { 0x04D0, 0x04D0 }, { 0x04D2, 0x04D2 }, { 0x04D4, 0x04D4 }, { 0x04D6, 0x04D6 }, { 0x04D8, 0x04D8 }, { 0x04DA, 0x04DA }, { 0x04DC, 0x04DC }, { 0x04DE, 0x04DE }, { 0x04E0, 0x04E0 }, { 0x04E2, 0x04E2 }, { 0x04E4, 0x04E4 }, { 0x04E6, 0x04E6 }, { 0x04E8, 0x04E8 }, { 0x04EA, 0x04EA }, { 0x04EC, 0x04EC }, { 0x04EE, 0x04EE }, { 0x04F0, 0x04F0 }, { 0x04F2, 0x04F2 }, { 0x04F4, 0x04F4 }, { 0x04F6, 0x04F6 }, { 0x04F8, 0x04F8 }, { 0x04FA, 0x04FA }, { 0x04FC, 0x04FC }, { 0x04FE, 0x04FE }, { 0x0500, 0x0500 }, { 0x0502, 0x0502 }, { 0x0504, 0x0504 }, { 0x0506, 0x0506 }, { 0x0508, 0x0508 }, { 0x050A, 0x050A }, { 0x050C, 0x050C }, { 0x050E, 0x050E }, { 0x0510, 0x0510 }, { 0x0512, 0x0512 }, { 0x0514, 0x0514 }, { 0x0516, 0x0516 }, { 0x0518, 0x0518 }, { 0x051A, 0x051A }, { 0x051C, 0x051C }, { 0x051E, 0x051E }, { 0x0520, 0x0520 }, { 0x0522, 0x0522 }, { 0x0524, 0x0524 }, { 0x0526, 0x0526 }, { 0x0528, 0x0528 }, { 0x052A, 0x052A }, { 0x052C, 0x052C }, { 0x052E, 0x052E }, { 0x0531, 0x0556 }, { 0x10A0, 0x10C5 }, { 0x10C7, 0x10C7 }, { 0x10CD, 0x10CD }, { 0x13A0, 0x13EF }, { 0x13F0, 0x13F5 }, { 0x1C90, 0x1CBA }, { 0x1CBD, 0x1CBF }, { 0x1E00, 0x1E00 }, { 0x1E02, 0x1E02 }, { 0x1E04, 0x1E04 }, { 0x1E06, 0x1E06 }, { 0x1E08, 0x1E08 }, { 0x1E0A, 0x1E0A }, { 0x1E0C, 0x1E0C }, { 0x1E0E, 0x1E0E }, { 0x1E10, 0x1E10 }, { 0x1E12, 0x1E12 }, { 0x1E14, 0x1E14 }, { 0x1E16, 0x1E16 }, { 0x1E18, 0x1E18 }, { 0x1E1A, 0x1E1A }, { 0x1E1C, 0x1E1C }, { 0x1E1E, 0x1E1E }, { 0x1E20, 0x1E20 }, { 0x1E22, 0x1E22 }, { 0x1E24, 0x1E24 }, { 0x1E26, 0x1E26 }, { 0x1E28, 0x1E28 }, { 0x1E2A, 0x1E2A }, { 0x1E2C, 0x1E2C }, { 0x1E2E, 0x1E2E }, { 0x1E30, 0x1E30 }, { 0x1E32, 0x1E32 }, { 0x1E34, 0x1E34 }, { 0x1E36, 0x1E36 }, { 0x1E38, 0x1E38 }, { 0x1E3A, 0x1E3A }, { 0x1E3C, 0x1E3C }, { 0x1E3E, 0x1E3E }, { 0x1E40, 0x1E40 }, { 0x1E42, 0x1E42 }, { 0x1E44, 0x1E44 }, { 0x1E46, 0x1E46 }, { 0x1E48, 0x1E48 }, { 0x1E4A, 0x1E4A }, { 0x1E4C, 0x1E4C }, { 0x1E4E, 0x1E4E }, { 0x1E50, 0x1E50 }, { 0x1E52, 0x1E52 }, { 0x1E54, 0x1E54 }, { 0x1E56, 0x1E56 }, { 0x1E58, 0x1E58 }, { 0x1E5A, 0x1E5A }, { 0x1E5C, 0x1E5C }, { 0x1E5E, 0x1E5E }, { 0x1E60, 0x1E60 }, { 0x1E62, 0x1E62 }, { 0x1E64, 0x1E64 }, { 0x1E66, 0x1E66 }, { 0x1E68, 0x1E68 }, { 0x1E6A, 0x1E6A }, { 0x1E6C, 0x1E6C }, { 0x1E6E, 0x1E6E }, { 0x1E70, 0x1E70 }, { 0x1E72, 0x1E72 }, { 0x1E74, 0x1E74 }, { 0x1E76, 0x1E76 }, { 0x1E78, 0x1E78 }, { 0x1E7A, 0x1E7A }, { 0x1E7C, 0x1E7C }, { 0x1E7E, 0x1E7E }, { 0x1E80, 0x1E80 }, { 0x1E82, 0x1E82 }, { 0x1E84, 0x1E84 }, { 0x1E86, 0x1E86 }, { 0x1E88, 0x1E88 }, { 0x1E8A, 0x1E8A }, { 0x1E8C, 0x1E8C }, { 0x1E8E, 0x1E8E }, { 0x1E90, 0x1E90 }, { 0x1E92, 0x1E92 }, { 0x1E94, 0x1E94 }, { 0x1E9E, 0x1E9E }, { 0x1EA0, 0x1EA0 }, { 0x1EA2, 0x1EA2 }, { 0x1EA4, 0x1EA4 }, { 0x1EA6, 0x1EA6 }, { 0x1EA8, 0x1EA8 }, { 0x1EAA, 0x1EAA }, { 0x1EAC, 0x1EAC }, { 0x1EAE, 0x1EAE }, { 0x1EB0, 0x1EB0 }, { 0x1EB2, 0x1EB2 }, { 0x1EB4, 0x1EB4 }, { 0x1EB6, 0x1EB6 }, { 0x1EB8, 0x1EB8 }, { 0x1EBA, 0x1EBA }, { 0x1EBC, 0x1EBC }, { 0x1EBE, 0x1EBE }, { 0x1EC0, 0x1EC0 }, { 0x1EC2, 0x1EC2 }, { 0x1EC4, 0x1EC4 }, { 0x1EC6, 0x1EC6 }, { 0x1EC8, 0x1EC8 }, { 0x1ECA, 0x1ECA }, { 0x1ECC, 0x1ECC }, { 0x1ECE, 0x1ECE }, { 0x1ED0, 0x1ED0 }, { 0x1ED2, 0x1ED2 }, { 0x1ED4, 0x1ED4 }, { 0x1ED6, 0x1ED6 }, { 0x1ED8, 0x1ED8 }, { 0x1EDA, 0x1EDA }, { 0x1EDC, 0x1EDC }, { 0x1EDE, 0x1EDE }, { 0x1EE0, 0x1EE0 }, { 0x1EE2, 0x1EE2 }, { 0x1EE4, 0x1EE4 }, { 0x1EE6, 0x1EE6 }, { 0x1EE8, 0x1EE8 }, { 0x1EEA, 0x1EEA }, { 0x1EEC, 0x1EEC }, { 0x1EEE, 0x1EEE }, { 0x1EF0, 0x1EF0 }, { 0x1EF2, 0x1EF2 }, { 0x1EF4, 0x1EF4 }, { 0x1EF6, 0x1EF6 }, { 0x1EF8, 0x1EF8 }, { 0x1EFA, 0x1EFA }, { 0x1EFC, 0x1EFC }, { 0x1EFE, 0x1EFE }, { 0x1F08, 0x1F0F }, { 0x1F18, 0x1F1D }, { 0x1F28, 0x1F2F }, { 0x1F38, 0x1F3F }, { 0x1F48, 0x1F4D }, { 0x1F59, 0x1F59 }, { 0x1F5B, 0x1F5B }, { 0x1F5D, 0x1F5D }, { 0x1F5F, 0x1F5F }, { 0x1F68, 0x1F6F }, { 0x1F88, 0x1F8F }, { 0x1F98, 0x1F9F }, { 0x1FA8, 0x1FAF }, { 0x1FB8, 0x1FB9 }, { 0x1FBA, 0x1FBB }, { 0x1FBC, 0x1FBC }, { 0x1FC8, 0x1FCB }, { 0x1FCC, 0x1FCC }, { 0x1FD8, 0x1FD9 }, { 0x1FDA, 0x1FDB }, { 0x1FE8, 0x1FE9 }, { 0x1FEA, 0x1FEB }, { 0x1FEC, 0x1FEC }, { 0x1FF8, 0x1FF9 }, { 0x1FFA, 0x1FFB }, { 0x1FFC, 0x1FFC }, { 0x2126, 0x2126 }, { 0x212A, 0x212A }, { 0x212B, 0x212B }, { 0x2132, 0x2132 }, { 0x2160, 0x216F }, { 0x2183, 0x2183 }, { 0x24B6, 0x24CF }, { 0x2C00, 0x2C2F }, { 0x2C60, 0x2C60 }, { 0x2C62, 0x2C62 }, { 0x2C63, 0x2C63 }, { 0x2C64, 0x2C64 }, { 0x2C67, 0x2C67 }, { 0x2C69, 0x2C69 }, { 0x2C6B, 0x2C6B }, { 0x2C6D, 0x2C6D }, { 0x2C6E, 0x2C6E }, { 0x2C6F, 0x2C6F }, { 0x2C70, 0x2C70 }, { 0x2C72, 0x2C72 }, { 0x2C75, 0x2C75 }, { 0x2C7E, 0x2C7F }, { 0x2C80, 0x2C80 }, { 0x2C82, 0x2C82 }, { 0x2C84, 0x2C84 }, { 0x2C86, 0x2C86 }, { 0x2C88, 0x2C88 }, { 0x2C8A, 0x2C8A }, { 0x2C8C, 0x2C8C }, { 0x2C8E, 0x2C8E }, { 0x2C90, 0x2C90 }, { 0x2C92, 0x2C92 }, { 0x2C94, 0x2C94 }, { 0x2C96, 0x2C96 }, { 0x2C98, 0x2C98 }, { 0x2C9A, 0x2C9A }, { 0x2C9C, 0x2C9C }, { 0x2C9E, 0x2C9E }, { 0x2CA0, 0x2CA0 }, { 0x2CA2, 0x2CA2 }, { 0x2CA4, 0x2CA4 }, { 0x2CA6, 0x2CA6 }, { 0x2CA8, 0x2CA8 }, { 0x2CAA, 0x2CAA }, { 0x2CAC, 0x2CAC }, { 0x2CAE, 0x2CAE }, { 0x2CB0, 0x2CB0 }, { 0x2CB2, 0x2CB2 }, { 0x2CB4, 0x2CB4 }, { 0x2CB6, 0x2CB6 }, { 0x2CB8, 0x2CB8 }, { 0x2CBA, 0x2CBA }, { 0x2CBC, 0x2CBC }, { 0x2CBE, 0x2CBE }, { 0x2CC0, 0x2CC0 }, { 0x2CC2, 0x2CC2 }, { 0x2CC4, 0x2CC4 }, { 0x2CC6, 0x2CC6 }, { 0x2CC8, 0x2CC8 }, { 0x2CCA, 0x2CCA }, { 0x2CCC, 0x2CCC }, { 0x2CCE, 0x2CCE }, { 0x2CD0, 0x2CD0 }, { 0x2CD2, 0x2CD2 }, { 0x2CD4, 0x2CD4 }, { 0x2CD6, 0x2CD6 }, { 0x2CD8, 0x2CD8 }, { 0x2CDA, 0x2CDA }, { 0x2CDC, 0x2CDC }, { 0x2CDE, 0x2CDE }, { 0x2CE0, 0x2CE0 }, { 0x2CE2, 0x2CE2 }, { 0x2CEB, 0x2CEB }, { 0x2CED, 0x2CED }, { 0x2CF2, 0x2CF2 }, { 0xA640, 0xA640 }, { 0xA642, 0xA642 }, { 0xA644, 0xA644 }, { 0xA646, 0xA646 }, { 0xA648, 0xA648 }, { 0xA64A, 0xA64A }, { 0xA64C, 0xA64C }, { 0xA64E, 0xA64E }, { 0xA650, 0xA650 }, { 0xA652, 0xA652 }, { 0xA654, 0xA654 }, { 0xA656, 0xA656 }, { 0xA658, 0xA658 }, { 0xA65A, 0xA65A }, { 0xA65C, 0xA65C }, { 0xA65E, 0xA65E }, { 0xA660, 0xA660 }, { 0xA662, 0xA662 }, { 0xA664, 0xA664 }, { 0xA666, 0xA666 }, { 0xA668, 0xA668 }, { 0xA66A, 0xA66A }, { 0xA66C, 0xA66C }, { 0xA680, 0xA680 }, { 0xA682, 0xA682 }, { 0xA684, 0xA684 }, { 0xA686, 0xA686 }, { 0xA688, 0xA688 }, { 0xA68A, 0xA68A }, { 0xA68C, 0xA68C }, { 0xA68E, 0xA68E }, { 0xA690, 0xA690 }, { 0xA692, 0xA692 }, { 0xA694, 0xA694 }, { 0xA696, 0xA696 }, { 0xA698, 0xA698 }, { 0xA69A, 0xA69A }, { 0xA722, 0xA722 }, { 0xA724, 0xA724 }, { 0xA726, 0xA726 }, { 0xA728, 0xA728 }, { 0xA72A, 0xA72A }, { 0xA72C, 0xA72C }, { 0xA72E, 0xA72E }, { 0xA732, 0xA732 }, { 0xA734, 0xA734 }, { 0xA736, 0xA736 }, { 0xA738, 0xA738 }, { 0xA73A, 0xA73A }, { 0xA73C, 0xA73C }, { 0xA73E, 0xA73E }, { 0xA740, 0xA740 }, { 0xA742, 0xA742 }, { 0xA744, 0xA744 }, { 0xA746, 0xA746 }, { 0xA748, 0xA748 }, { 0xA74A, 0xA74A }, { 0xA74C, 0xA74C }, { 0xA74E, 0xA74E }, { 0xA750, 0xA750 }, { 0xA752, 0xA752 }, { 0xA754, 0xA754 }, { 0xA756, 0xA756 }, { 0xA758, 0xA758 }, { 0xA75A, 0xA75A }, { 0xA75C, 0xA75C }, { 0xA75E, 0xA75E }, { 0xA760, 0xA760 }, { 0xA762, 0xA762 }, { 0xA764, 0xA764 }, { 0xA766, 0xA766 }, { 0xA768, 0xA768 }, { 0xA76A, 0xA76A }, { 0xA76C, 0xA76C }, { 0xA76E, 0xA76E }, { 0xA779, 0xA779 }, { 0xA77B, 0xA77B }, { 0xA77D, 0xA77D }, { 0xA77E, 0xA77E }, { 0xA780, 0xA780 }, { 0xA782, 0xA782 }, { 0xA784, 0xA784 }, { 0xA786, 0xA786 }, { 0xA78B, 0xA78B }, { 0xA78D, 0xA78D }, { 0xA790, 0xA790 }, { 0xA792, 0xA792 }, { 0xA796, 0xA796 }, { 0xA798, 0xA798 }, { 0xA79A, 0xA79A }, { 0xA79C, 0xA79C }, { 0xA79E, 0xA79E }, { 0xA7A0, 0xA7A0 }, { 0xA7A2, 0xA7A2 }, { 0xA7A4, 0xA7A4 }, { 0xA7A6, 0xA7A6 }, { 0xA7A8, 0xA7A8 }, { 0xA7AA, 0xA7AA }, { 0xA7AB, 0xA7AB }, { 0xA7AC, 0xA7AC }, { 0xA7AD, 0xA7AD }, { 0xA7AE, 0xA7AE }, { 0xA7B0, 0xA7B0 }, { 0xA7B1, 0xA7B1 }, { 0xA7B2, 0xA7B2 }, { 0xA7B3, 0xA7B3 }, { 0xA7B4, 0xA7B4 }, { 0xA7B6, 0xA7B6 }, { 0xA7B8, 0xA7B8 }, { 0xA7BA, 0xA7BA }, { 0xA7BC, 0xA7BC }, { 0xA7BE, 0xA7BE }, { 0xA7C0, 0xA7C0 }, { 0xA7C2, 0xA7C2 }, { 0xA7C4, 0xA7C4 }, { 0xA7C5, 0xA7C5 }, { 0xA7C6, 0xA7C6 }, { 0xA7C7, 0xA7C7 }, { 0xA7C9, 0xA7C9 }, { 0xA7D0, 0xA7D0 }, { 0xA7D6, 0xA7D6 }, { 0xA7D8, 0xA7D8 }, { 0xA7F5, 0xA7F5 }, { 0xFF21, 0xFF3A }, { 0x10400, 0x10427 }, { 0x104B0, 0x104D3 }, { 0x10570, 0x1057A }, { 0x1057C, 0x1058A }, { 0x1058C, 0x10592 }, { 0x10594, 0x10595 }, { 0x10C80, 0x10CB2 }, { 0x118A0, 0x118BF }, { 0x16E40, 0x16E5F }, { 0x1E900, 0x1E921 } }; static const int data_wcdelta_tolower[] = { 32, 32, 32, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, -199, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, -121, 1, 1, 1, 210, 1, 1, 206, 1, 205, 1, 79, 202, 203, 1, 205, 207, 211, 209, 1, 211, 213, 214, 1, 1, 1, 218, 1, 218, 1, 218, 1, 217, 1, 1, 219, 1, 1, 2, 1, 2, 1, 2, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 2, 1, 1, -97, -56, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, -130, 1, 1, 1, 1, 1, 1, 1, 1, 1, 10795, 1, -163, 10792, 1, -195, 69, 71, 1, 1, 1, 1, 1, 1, 1, 1, 116, 38, 37, 64, 63, 32, 32, 8, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, -60, 1, -7, 1, -130, 80, 32, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 15, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 48, 7264, 7264, 7264, 38864, 8, -3008, -3008, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, -7615, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, -8, -8, -8, -8, -8, -8, -8, -8, -8, -8, -8, -8, -8, -8, -74, -9, -86, -9, -8, -100, -8, -112, -7, -128, -126, -9, -7517, -8383, -8262, 28, 16, 1, 26, 48, 1, -10743, -3814, -10727, 1, 1, 1, -10780, -10749, -10783, -10782, 1, 1, -10815, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, -35332, 1, 1, 1, 1, 1, 1, -42280, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, -42308, -42319, -42315, -42305, -42308, -42258, -42282, -42261, 928, 1, 1, 1, 1, 1, 1, 1, 1, -48, -42307, -35384, 1, 1, 1, 1, 1, 1, 32, 40, 40, 39, 39, 39, 39, 64, 32, 32, 34 }; int joe_towlower(int c) { size_t idx; if ((idx = mb_ucsbsearch(data_wcrange_tolower, NELEM(data_wcrange_tolower), c)) == (size_t)-1) return (c); return (c + data_wcdelta_tolower[idx]); } /* Test the functions */ #ifdef TEST_I18N int main(int argc,char *argv[]) { int c; void *vp; if (argc != 2) return (1); c = ustolb(argv[1], &vp, 0, 0x10FFFF, USTOL_TRIM | USTOL_EOS); if (!vp) return (1); printf("Properties of character %X:\n",c); printf("upper=%X\n",joe_iswupper(c)); printf("lower=%X\n",joe_iswlower(c)); printf("alpha=%X\n",joe_iswalpha(c)); printf("digit=%X\n",joe_iswdigit(c)); printf("cntrl=%X\n",joe_iswcntrl(c)); printf("punct=%X\n",joe_iswpunct(c)); printf("graph=%X\n",joe_iswgraph(c)); printf("print=%X\n",joe_iswprint(c)); printf("xdigit=%X\n",joe_iswxdigit(c)); printf("blank=%X\n",joe_iswblank(c)); printf("width=%X\n",joe_wcwidth(c)); printf("toupper=%X\n",joe_towupper(c)); printf("tolower=%X\n",joe_towlower(c)); return (0); } #endif #if 0 .endif PROG= i18n SRCS= compat.c i18n.c NOMAN= Yes CPPFLAGS+= -DTEST -DTEST_I18N .include .ifdef __CRAZY . if exists(/usr/include/jupp.tmp.h) && !defined(wnostrict) CPPFLAGS+= -DGCC_Wstrict_prototypes . else COPTS+= -Wno-strict-prototypes . endif .endif .include #endif jupp/i18n.h010064400000000000000000000014561363731763300077350ustar00#ifndef JUPP_I18N_H #define JUPP_I18N_H #ifdef EXTERN __IDSTRING(rcsid_i18n_h, "$MirOS: contrib/code/jupp/i18n.h,v 1.14 2020/03/27 06:38:56 tg Exp $"); #endif #ifdef TEST_I18N int joe_iswupper(int c); int joe_iswlower(int c); #endif /* the following two include _ */ int joe_iswalpha(int c); int joe_iswalnum(int c); int joe_iswdigit(int c); int joe_iswspace(int c); #ifdef TEST_I18N int joe_iswcntrl(int c); #endif int joe_iswpunct(int c); #ifdef TEST_I18N int joe_iswgraph(int c); #endif int joe_iswprint(int c); #ifdef TEST_I18N int joe_iswxdigit(int c); int joe_iswblank(int c); #endif int joe_wcwidth(unsigned int c); /* Looking for wswidth? Take a look at scrn.c/txtwidth() */ int joe_towupper(int c); int joe_towlower(int c); extern unsigned char unictrlbuf[11]; int unictrl(unsigned int c); #endif jupp/install-sh010064400000000000000000000400171337207436000107730ustar00#!/bin/sh # $MirOS: contrib/code/jupp/install-sh,v 1.9 2018/11/11 18:45:41 tg Exp $ # $miros: contrib/gnu/aux/install-sh,v 1.14 2018/11/11 18:42:46 tg Exp $ #- # install - install a program, script, or datafile scriptversion=2018-03-11.20; # UTC # This originates from X11R5 (mit/util/scripts/install.sh), which was # later released in X11R6 (xc/config/util/install.sh) with the # following copyright and license. # # Copyright (C) 1994 X Consortium # # Permission is hereby granted, free of charge, to any person obtaining a copy # of this software and associated documentation files (the "Software"), to # deal in the Software without restriction, including without limitation the # rights to use, copy, modify, merge, publish, distribute, sublicense, and/or # sell copies of the Software, and to permit persons to whom the Software is # furnished to do so, subject to the following conditions: # # The above copyright notice and this permission notice shall be included in # all copies or substantial portions of the Software. # # THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR # IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, # FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE # X CONSORTIUM BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN # AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNEC- # TION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. # # Except as contained in this notice, the name of the X Consortium shall not # be used in advertising or otherwise to promote the sale, use or other deal- # ings in this Software without prior written authorization from the X Consor- # tium. # # # FSF changes to this file are in the public domain. # # Calling this script install-sh is preferred over install.sh, to prevent # 'make' implicit rules from creating a file called install from it # when there is no Makefile. # # This script is compatible with the BSD install script, but was written # from scratch. tab=' ' nl=' ' IFS=" $tab$nl" # Set DOITPROG to "echo" to test this script. # Don't use :- since 4.3BSD and earlier shells don't like it. doit=${DOITPROG-} if test -z "$doit"; then doit_exec=exec else doit_exec=$doit fi # Put in absolute file names if you don't have them in your path; # or use environment vars. chgrpprog=${CHGRPPROG-chgrp} chmodprog=${CHMODPROG-chmod} chownprog=${CHOWNPROG-chown} cmpprog=${CMPPROG-cmp} cpprog=${CPPROG-cp} mkdirprog=${MKDIRPROG-mkdir} mvprog=${MVPROG-mv} rmprog=${RMPROG-rm} stripprog=${STRIPPROG-strip} posix_glob='?' initialise_posix_glob=' test "$posix_glob" != "?" || { if (set -f) 2>/dev/null; then posix_glob= else posix_glob=: fi } ' posix_mkdir= # Desired mode of installed file. mode=0755 chgrpcmd= chmodcmd=$chmodprog chowncmd= mvcmd=$mvprog rmcmd="$rmprog -f" stripcmd= src= dst= dir_arg= dst_arg= copy_on_change=false is_target_a_directory=possibly usage="\ Usage: $0 [OPTION]... [-T] SRCFILE DSTFILE or: $0 [OPTION]... SRCFILES... DIRECTORY or: $0 [OPTION]... -t DIRECTORY SRCFILES... or: $0 [OPTION]... -d DIRECTORIES... In the 1st form, copy SRCFILE to DSTFILE. In the 2nd and 3rd, copy all SRCFILES to DIRECTORY. In the 4th, create DIRECTORIES. Options: --help display this help and exit. --version display version info and exit. -c (ignored) -C install only if different (preserve the last data modification time) -d create directories instead of installing files. -g GROUP $chgrpprog installed files to GROUP. -m MODE $chmodprog installed files to MODE. -o USER $chownprog installed files to USER. -s $stripprog installed files. -t DIRECTORY install into DIRECTORY. -T report an error if DSTFILE is a directory. Environment variables override the default commands: CHGRPPROG CHMODPROG CHOWNPROG CMPPROG CPPROG MKDIRPROG MVPROG RMPROG STRIPPROG " while test $# -ne 0; do case $1 in -c) ;; -C) copy_on_change=true;; -d) dir_arg=true;; -g) chgrpcmd="$chgrpprog $2" shift;; --help) echo "$usage"; exit $?;; -m) mode=$2 case $mode in *' '* | *"$tab"* | *"$nl"* | *'*'* | *'?'* | *'['*) echo "$0: invalid mode: $mode" >&2 exit 1;; esac shift;; -o) chowncmd="$chownprog $2" shift;; -s) stripcmd=$stripprog;; -t) is_target_a_directory=always dst_arg=$2 # Protect names problematic for 'test' and other utilities. case $dst_arg in -* | [=\(\)!]) dst_arg=./$dst_arg;; esac shift;; -T) is_target_a_directory=never;; --version) echo "$0 $scriptversion"; exit $?;; --) shift break;; -*) echo "$0: invalid option: $1" >&2 exit 1;; *) break;; esac shift done # We allow the use of options -d and -T together, by making -d # take the precedence; this is for compatibility with GNU install. if test -n "$dir_arg"; then if test -n "$dst_arg"; then echo "$0: target directory not allowed when installing a directory." >&2 exit 1 fi fi if test $# -ne 0 && test -z "$dir_arg$dst_arg"; then # When -d is used, all remaining arguments are directories to create. # When -t is used, the destination is already specified. # Otherwise, the last argument is the destination. Remove it from $@. for arg do if test -n "$dst_arg"; then # $@ is not empty: it contains at least $arg. set fnord "$@" "$dst_arg" shift # fnord fi shift # arg dst_arg=$arg # Protect names problematic for 'test' and other utilities. case $dst_arg in -* | [=\(\)!]) dst_arg=./$dst_arg;; esac done fi if test $# -eq 0; then if test -z "$dir_arg"; then echo "$0: no input file specified." >&2 exit 1 fi # It's OK to call 'install-sh -d' without argument. # This can happen when creating conditional directories. exit 0 fi if test -z "$dir_arg"; then if test $# -gt 1 || test "$is_target_a_directory" = always; then if test ! -d "$dst_arg"; then echo "$0: $dst_arg: Is not a directory." >&2 exit 1 fi fi fi if test -z "$dir_arg"; then do_exit='(exit $ret); exit $ret' trap "ret=129; $do_exit" 1 trap "ret=130; $do_exit" 2 trap "ret=141; $do_exit" 13 trap "ret=143; $do_exit" 15 # Set umask so as not to create temps with too-generous modes. # However, 'strip' requires both read and write access to temps. case $mode in # Optimize common cases. *644) cp_umask=133;; *755) cp_umask=22;; *[0-7]) if test -z "$stripcmd"; then u_plus_rw= else u_plus_rw='% 200' fi cp_umask=`expr '(' 777 - $mode % 1000 ')' $u_plus_rw`;; *) if test -z "$stripcmd"; then u_plus_rw= else u_plus_rw=,u+rw fi cp_umask=$mode$u_plus_rw;; esac fi for src do # Protect names problematic for 'test' and other utilities. case $src in -* | [=\(\)!]) src=./$src;; esac if test -n "$dir_arg"; then dst=$src dstdir=$dst test -d "$dstdir" dstdir_status=$? else # Waiting for this to be detected by the "$cpprog $src $dsttmp" command # might cause directories to be created, which would be especially bad # if $src (and thus $dsttmp) contains '*'. if test ! -f "$src" && test ! -d "$src"; then echo "$0: $src does not exist." >&2 exit 1 fi if test -z "$dst_arg"; then echo "$0: no destination specified." >&2 exit 1 fi dst=$dst_arg # If destination is a directory, append the input filename. if test -d "$dst"; then if test "$is_target_a_directory" = never; then echo "$0: $dst_arg: Is a directory" >&2 exit 1 fi dstdir=$dst dstbase=${src##*/} case $dst in */) dst=$dst$dstbase;; *) dst=$dst/$dstbase;; esac dstdir_status=0 else # Prefer dirname, but fall back on a substitute if dirname fails. dstdir=` (dirname "$dst") 2>/dev/null || expr X"$dst" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ X"$dst" : 'X\(//\)[^/]' \| \ X"$dst" : 'X\(//\)$' \| \ X"$dst" : 'X\(/\)' \| . 2>/dev/null || echo X"$dst" | sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/ q } /^X\(\/\/\)[^/].*/{ s//\1/ q } /^X\(\/\/\)$/{ s//\1/ q } /^X\(\/\).*/{ s//\1/ q } s/.*/./; q' ` test -d "$dstdir" dstdir_status=$? fi fi case $dstdir in */) dstdirslash=$dstdir;; *) dstdirslash=$dstdir/;; esac obsolete_mkdir_used=false if test $dstdir_status != 0; then case $posix_mkdir in '') # Create intermediate dirs using mode 755 as modified by the umask. # This is like FreeBSD 'install' as of 1997-10-28. umask=`umask` case $stripcmd.$umask in # Optimize common cases. *[2367][2367]) mkdir_umask=$umask;; .*0[02][02] | .[02][02] | .[02]) mkdir_umask=22;; *[0-7]) mkdir_umask=`expr $umask + 22 \ - $umask % 100 % 40 + $umask % 20 \ - $umask % 10 % 4 + $umask % 2 `;; *) mkdir_umask=$umask,go-w;; esac # With -d, create the new directory with the user-specified mode. # Otherwise, rely on $mkdir_umask. if test -n "$dir_arg"; then mkdir_mode=-m$mode else mkdir_mode= fi posix_mkdir=false case $umask in *[123567][0-7][0-7]) # POSIX mkdir -p sets u+wx bits regardless of umask, which # is incompatible with FreeBSD 'install' when (umask & 300) != 0. ;; *) # Note that $RANDOM variable is not portable (e.g. dash); Use it # here however when possible just to lower collision chance. tmpdir=${TMPDIR-/tmp}/ins$RANDOM-$$ trap 'ret=$?; rmdir "$tmpdir/a/b" "$tmpdir/a" "$tmpdir" 2>/dev/null; exit $ret' 0 # Because "mkdir -p" follows existing symlinks and we likely work # directly in world-writable /tmp, make sure that the '$tmpdir' # directory is successfully created first before we actually test # 'mkdir -p' feature. if (umask $mkdir_umask && $mkdirprog $mkdir_mode "$tmpdir" && exec $mkdirprog $mkdir_mode -p -- "$tmpdir/a/b") >/dev/null 2>&1 then if test -z "$dir_arg" || { # Check for POSIX incompatibilities with -m. # HP-UX 11.23 and IRIX 6.5 mkdir -m -p sets group- or # other-writable bit of parent directory when it shouldn't. # FreeBSD 6.1 mkdir -m -p sets mode of existing directory. test_tmpdir="$tmpdir/a" ls_ld_tmpdir=`ls -ld "$test_tmpdir"` case $ls_ld_tmpdir in d????-?r-*) different_mode=700;; d????-?--*) different_mode=755;; *) false;; esac && $mkdirprog -m$different_mode -p -- "$test_tmpdir" && { ls_ld_tmpdir_1=`ls -ld "$test_tmpdir"` test "$ls_ld_tmpdir" = "$ls_ld_tmpdir_1" } } then posix_mkdir=: fi rmdir "$tmpdir/a/b" "$tmpdir/a" "$tmpdir" else # Remove any dirs left behind by ancient mkdir implementations. rmdir ./$mkdir_mode ./-p ./-- "$tmpdir" 2>/dev/null fi trap '' 0;; esac;; esac if $posix_mkdir && ( umask $mkdir_umask && $doit_exec $mkdirprog $mkdir_mode -p -- "$dstdir" ) then : else # The umask is ridiculous, or mkdir does not conform to POSIX, # or it failed possibly due to a race condition. Create the # directory the slow way, step by step, checking for races as we go. case $dstdir in /*) prefix='/';; [-=\(\)!]*) prefix='./';; *) prefix='';; esac eval "$initialise_posix_glob" oIFS=$IFS IFS=/ $posix_glob set -f set fnord $dstdir shift $posix_glob set +f IFS=$oIFS prefixes= for d do test X"$d" = X && continue prefix=$prefix$d if test -d "$prefix"; then prefixes= else if $posix_mkdir; then (umask=$mkdir_umask && $doit_exec $mkdirprog $mkdir_mode -p -- "$dstdir") && break # Don't fail if two instances are running concurrently. test -d "$prefix" || exit 1 else case $prefix in *\'*) qprefix=`echo "$prefix" | sed "s/'/'\\\\\\\\''/g"`;; *) qprefix=$prefix;; esac prefixes="$prefixes '$qprefix'" fi fi prefix=$prefix/ done if test -n "$prefixes"; then # Don't fail if two instances are running concurrently. (umask $mkdir_umask && eval "\$doit_exec \$mkdirprog $prefixes") || test -d "$dstdir" || exit 1 obsolete_mkdir_used=true fi fi fi if test -n "$dir_arg"; then { test -z "$chowncmd" || $doit $chowncmd "$dst"; } && { test -z "$chgrpcmd" || $doit $chgrpcmd "$dst"; } && { test "$obsolete_mkdir_used$chowncmd$chgrpcmd" = false || test -z "$chmodcmd" || $doit $chmodcmd $mode "$dst"; } || exit 1 else # Make a couple of temp file names in the proper directory. dsttmp=${dstdirslash}_inst.$$_ rmtmp=${dstdirslash}_rm.$$_ # Trap to clean up those temp files at exit. trap 'ret=$?; rm -f "$dsttmp" "$rmtmp" && exit $ret' 0 # Copy the file name to the temp name. (umask $cp_umask && $doit_exec $cpprog "$src" "$dsttmp") && # and set any options; do chmod last to preserve setuid bits. # # If any of these fail, we abort the whole thing. If we want to # ignore errors from any of these, just make sure not to ignore # errors from the above "$doit $cpprog $src $dsttmp" command. # { test -z "$chowncmd" || $doit $chowncmd "$dsttmp"; } && { test -z "$chgrpcmd" || $doit $chgrpcmd "$dsttmp"; } && { test -z "$stripcmd" || $doit $stripcmd "$dsttmp"; } && { test -z "$chmodcmd" || $doit $chmodcmd $mode "$dsttmp"; } && # If -C, don't bother to copy if it wouldn't change the file. if $copy_on_change && old=`LC_ALL=C ls -dlL "$dst" 2>/dev/null` && new=`LC_ALL=C ls -dlL "$dsttmp" 2>/dev/null` && eval "$initialise_posix_glob" && $posix_glob set -f && set X $old && old=:$2:$4:$5:$6 && set X $new && new=:$2:$4:$5:$6 && $posix_glob set +f && test "$old" = "$new" && $cmpprog "$dst" "$dsttmp" >/dev/null 2>&1 then rm -f "$dsttmp" else # Rename the file to the real destination. $doit $mvcmd -f "$dsttmp" "$dst" 2>/dev/null || # The rename failed, perhaps because mv can't rename something else # to itself, or perhaps because mv is so ancient that it does not # support -f. { # Now remove or move aside any old file at destination location. # We try this two ways since rm can't unlink itself on some # systems and the destination file might be busy for other # reasons. In this case, the final cleanup might fail but the new # file should still install successfully. { test ! -f "$dst" || $doit $rmcmd -f "$dst" 2>/dev/null || { $doit $mvcmd -f "$dst" "$rmtmp" 2>/dev/null && { $doit $rmcmd -f "$rmtmp" 2>/dev/null; :; } } || { echo "$0: cannot unlink or rename $dst" >&2 (exit 1); exit 1 } } && # Now rename the file to the real destination. $doit $mvcmd "$dsttmp" "$dst" } fi || exit 1 trap '' 0 fi done # Local variables: # eval: (add-hook 'before-save-hook 'time-stamp) # time-stamp-start: "scriptversion=" # time-stamp-format: "%:y-%02m-%02d.%02H" # time-stamp-time-zone: "UTC0" # time-stamp-end: "; # UTC" # End: jupp/jmacsrc.in010064400000000000000000000652471361505650400107600ustar00 $MirOS: contrib/code/jupp/jmacsrc.in,v 1.37 2020/01/31 17:00:25 tg Exp $ Initialisation file for JOE GNU-Emacs Joe This file must be written in the 8-bit encoding, not UTF-8. JOE looks for this file in: 1 - $HOME/.jmacsrc 2 - @jrcbefore@jmacsrc@jrcafter@ This file can include other files by placing the following include command in the first column (comment lines start with space or tab): :include filename FIRST SECTION: Default global options (these options can also be specified on the command line. Also, the NOXON, LINES, COLUMNS, DOPADDING and BAUD options can be specified in environment variables): Put each option you want set in the first column: -option Sets the option --option Clears the option -mid Cursor is recentred when scrolling is necessary -marking Text between ^KB and cursor is highlighted; use with: -lightoff Turn off highlighting after block copy or move -autoswap Swap markb with markk when necessary -asis Characters 128 - 255 shown as-is -hex Hex editing mode -nobackups If you don't want backup files to be created -backpath path Where to store backup files (do not quote, no comment after) -force Force final newline when files are saved -exask ^KX always confirms file name -beep Beep on errors and when cursor goes past extremes -nosta Disable top-most status line -keepup %k and %c status line escape sequences updated frequently -pg 1 No. lines to keep for PgUp/PgDn -csmode ^KF after a pervious search does a ^L instead -nonotice Disable copyright notice -noxon Attempt to turn off ^S/^Q processing -orphan Put extra files given on command line in orphaned buffers instead of in windows -dopadding Output pad characters (for when there is no tty handshaking) -lines nnn Set no. screen lines -baud 19200 Set baud rate for terminal optimisations -columns nnn Set no. screen columns -help Start with help on -skiptop nnn Don't use top nnn lines of the screen -notite Don't send terminal initialisation and termination strings: prevents restoration of screen on exit -pastetite Enter bracketed paste mode automatically for TERM=xterm-xfree86 -usetabs Use tabs to help optimise screen update -assume_color Assume terminal has ANSI colour support even if its termcap or terminfo entry says that it doesn't. This only applies if the terminal otherwise looks like an ANSI terminal (supports bold and capability starts with ESC [). -guess_crlf Automatically detect MS-DOS files and set -crlf appropriately -guess_indent Guess indent character (tab or space) -menu_explorer Stay in menu system when a directory is selected (otherwise directory is added to path and menu is closed) -icase Search is case-insensitive by default -wrap Search wraps Status line definition strings. -lmsg defines the left-justified string, and -rmsg defines the right-justified string. The first character of -rmsg is the background fill character. -hmsg (3.1jupp15) defines the help hint (only about a dozen chars) displayed next to the copyright notice in the initial status line (inverted by default, unless starting with exactly \i). The following escape sequences can be used in these strings: %t 12-hour time %u 24-hour time %T O for overtype mode, I for insert mode %W W if wordwrap is enabled %I A if autoindent is enabled %X rectangle mode indicator %n file name %m '(Modified)' if file has been changed %* '*' if file has been changed %R read-only indicator %r row (line) number %c column number %o byte offset into file (decimal) %O byte offset into file in hex %a ASCII value of character under cursor (decimal) %A ASCII value of character under cursor in hex %p percent of file cursor is at %l number of lines in file %k entered prefix keys %S '*SHELL*' if there is a shell running in window %M macro recording message %y syntax %x context (first non-indented line going backwards) These formatting escape sequences may also be given: \i Inverse \u Underline \b Bold \d Dim \f Blink -lmsg \i%k%T%W%I%X %* [%n] %y %M -rmsg %S Row %r Col %c %u -hmsg \i\f\bHelp: ^Xh\b\f SECOND SECTION: filename-dependent local option settings: Each line with '*' in the first column indicates the modes which should be set for files whose name matches the regular expression. If more than one regular expression matches the file name, then the last matching one is chosen. A file contents regular expression may also be specified on a separate line with '+regex'. If this regular expresssion is given, then both the file name regex and the file contents regex must match for the options to apply. Here is a list of modes which can be set: -keymap name Keymap to use if not 'main' -square Rectangular block mode -overwrite Overtype mode -picture Picture mode (cursor right can go past end of line) -linums Show line numbers in front of each line -rdonly File is read-only -crlf File uses CR-LF at end of lines -encoding utf8 File is UTF-8 encoded -syntax name Specify syntax (syntax file called 'name.jsf' will be loaded) -highlight Enable syntax highlighting -french One space after '.', '?' and '!' for wordwrap and paragraph reformat instead of two. JOE does not change the spacing you give, but sometimes it must put spacing in itself. This selects how much is inserted in those cases. -purify Fixup indentation if necessary for rindent, lindent and backs (for example if indentation uses a mix of tabs and spaces, and indentc is space, indentation will be converted to all spaces) -lmargin nnn Left margin -rmargin nnn Right margin -tab nnn Tab width -indentc nnn Indentation character (32 = space, 9 = tab) -istep nnn Amount of 'indentc's per indentation level -spaces Tab key inserts spaces instead of tabs -wordwrap Wordwrap -autoindent Auto indent -smartbacks Backspace key deletes 'istep' number of 'indentc's if cursor is at first non-space character -smarthome Home key first moves cursor to beginning of line, then if hit again, to first non-blank character -indentfirst Smart home goes to first non-blank character first, instead of to the beginning of the line first -lmsg Status line definition strings; -rmsg see previous section for more info -mnew macro Macro to execute when new files are loaded -mold macro Macro to execute when existing files are loaded -msnew macro Macro to execute when new files are saved -msold macro Macro to execute when existing files are saved Macros for the above options are in the same format as in the key binding section below but without the key name strings. Default local options: -highlight -french -indentc 9 -istep 1 -purify --autoindent -smartbacks -tab 8 --wordwrap #HOOK#1 global/default flags === Generic files No '.' in filename? * Assume it's a text file and, except in jupp, we want wordwrap on. -wordwrap Filename with '.' is probably not a text file. *.* Binary file *.bin --crlf --guess_crlf -encoding ascii -hex === Patterns with multiple wildcards Order is latest match wins, so... */patch-* -highlight -syntax diff * +Only in[ ] -highlight -syntax diff * +Nur in[ ] -highlight -syntax diff * +\[1-9]\+\[0-9]\[cda] -highlight -syntax diff *.sh* -syntax sh *.ksh* -syntax sh *.mksh* -syntax sh *.bash* -syntax sh *tmp/mutt-* -wordwrap -syntax mail *tmp/pico.* -wordwrap -syntax mail */mail/* -syntax mail */patches/* -highlight -syntax diff === Assembly *.asm -syntax asm *.S -syntax asm *.s -syntax asm === C, C++, Objective-C *.C -syntax c *.c -syntax c *.cc -syntax c *.cpp -syntax c *.cxx -syntax c *.c++ -syntax c *.h -syntax c *.hh -syntax c *.hpp -syntax c *.h++ -syntax c *.m -syntax c *.nxc -syntax c === C Shell *.csh -syntax csh *.login -syntax csh *.logout -syntax csh *.tcsh -syntax csh *.tcshrc -syntax csh * +#!\+\[ ]\+\[/a-z0-9._-]/\+tcsh\> -syntax csh * +#!\+\[ ]\+\[/a-z0-9._-]/env\[ ]\+\[ ]\+tcsh\> -syntax csh === Diff *.diff -highlight -syntax diff *.patch -highlight -syntax diff *.rej -highlight -syntax diff *.debdiff -highlight -syntax diff * +---\[ ] -highlight -syntax diff * +***\[ ] -highlight -syntax diff * +Index: \*\n====================================================== -highlight -syntax diff * +Index: \*\ndiff\*\n--- \*\n+++\[ ] -highlight -syntax diff * +\[=?]\*\n--- \*\n+++\[ ] -highlight -syntax diff * +diff\*\n--- \*\n+++\[ ] -highlight -syntax diff * +diff --git\*\nindex\*\n--- \*\n+++\[ ] -highlight -syntax diff === eMail *.eml -syntax mail Not quite eMail but still RFC822 *.mht -syntax mail === FORTRAN *.f -syntax fortran *.for -syntax fortran *.FOR -syntax fortran *.f77 -syntax fortran *.F77 -syntax fortran *.f90 -syntax fortran *.F90 -syntax fortran === GNU autoconf *.ac -syntax conf *.am -syntax conf === HTML *.htm -encoding utf8 -syntax html *.html -encoding utf8 -syntax html * +<\[Hh]\[Tt]\[Mm]\[Ll]\> -encoding utf8 -syntax html * + -encoding utf8 -syntax html === Java *.java -encoding utf8 -syntax java === JOE Syntax File *.jsf -syntax conf === LISP *.lisp -syntax lisp *.lsp -syntax lisp *.el -syntax lisp === Make *akefile -syntax conf *AKEFILE -syntax conf === Mason *.mas -syntax mason === Pascal *.p -syntax pascal *.pas -syntax pascal === Perl *.pl -syntax perl *.pm -syntax perl * +#!\+\[ ]\+\[/a-z0-9._-]/perl -syntax perl * +#!\+\[ ]\+\[/a-z0-9._-]/env\[ ]\+\[ ]perl -syntax perl === PHP *.php -syntax php === Python *.py -encoding utf8 -syntax python -tab 4 -indentc 32 -istep 4 -spaces * +#!\+\[ ]\+\[/a-z0-9._-]/python -encoding utf8 -syntax python -tab 4 -indentc 32 -istep 4 -spaces * +#!\+\[ ]\+\[/a-z0-9._-]/env\[ ]\+\[ ]python -encoding utf8 -syntax python -tab 4 -indentc 32 -istep 4 -spaces === Bourne, Korn, POSIX Shell *profile -syntax sh * +:\[ \n] -syntax sh * +#!\+\[ ]\+\[/a-z0-9._-]/\+\[bda]sh\> -syntax sh * +#!\+\[ ]\+\[/a-z0-9._-]/env\[ ]\+\[ ]\+\[bda]sh\> -syntax sh * +#!\+\[ ]\+\[/a-z0-9._-]/\+\[a-z]ksh\+\[0-9._-]\> -syntax sh * +#!\+\[ ]\+\[/a-z0-9._-]/env\[ ]\+\[ ]\+\[a-z]ksh\+\[0-9._-]\> -syntax sh === TCL *.tcl -syntax tcl === TeX *.cls -syntax tex *.def -syntax tex *.dtx -syntax tex *.lco -syntax tex *.sty -syntax tex *.tex -syntax tex === Verilog *.v -syntax verilog -istep 2 *.vh -syntax verilog -istep 2 === VHDL *.vhd -syntax vhdl -istep 2 === XML *.xml -encoding utf8 -syntax xml *.xsl -encoding utf8 -syntax xml * +]?>\+\[ \n] -encoding utf8 -syntax html === Text (except in jupp) *.asc -wordwrap *.doc -wordwrap *.txt -wordwrap #HOOK#2 filename matching THIRD SECTION: Named help screens: Use \| to insert a spring: all springs in a given line are set to the same width such that the entire line exactly fits in the width of the screen (if it's not an exact multiple so that there are N spaces remaining, the rightmost N springs each get one extra space). Hint: if you want vertical alignment, each line should have the same number of springs. {Basic \i Help Screen \|turn off with ^XH more help with ^X. \i \i \i\|\uCURSOR\u \|\uGO TO\u \|\uUNDO\u \|\uMISC\u \|\uREGION\u \|\uEXIT\u \|\i \i \i \i\|^B left ^F right \|^[V prev screen \|^XU undo \|^[^[ option \|^@ mark \|^XK quit \|\i \i \i \i\|^P up ^N down \|^V next screen \|^^ redo \|^[Q format \|^W cut \|^X^C save \|\i \i \i \i\|^[B prev. word \|^A beg of line \|\uDELETE\u \|^L refresh \|^Y paste \|\uFILE\u \|\i \i \i \i\|^[F next word \|^E end of line \|^D char \|^[$ spell \|^[Y switch \|^X^W save \|\i \i \i \i\|\uSEARCH\u \|^[< top of file \|^K >line \|^[M math \|^XA save \|^XI insert\|\i \i \i \i\|^S forward \|^[> end of file \|^[D >word \|^[% query \|^[| filter \|^X^F load \|\i \i \i \i\|^R backward \|^[G to line No. \|^[ DEL word<\| replace \|^XX swap \|^X^B switch\|\i \i } {Editing \i Help Screen \|turn off with ^XH prev. screen ^X, next screen ^X. \i \i \i\|\uCASE\u \|\uTRANSPOSE\u \|\uINSERT\u \|\uMACROS\u \|\uPROGRAMS\u \|\i \i \i \i\|^[U Up word \|^T Chars \|^O line \|^X( record \|^X^I Indent region \|\i \i \i \i\|^[L Down word \|^[T Words \|^C space \|^X) stop \|^[. Tags file find \|\i \i \i \i\|^[C Cap. word \|^X^T Lines \|` Ctrl- \|^XE play \|^XG To matching ( [ { \|\i \i \i \i\|^X^U Up region \| \|^XT text \|^XQ query suspend \|^XC Parse errors \|\i \i \i \i\|^X^L Down region\| \| \|^U repeat prefix \|^XN / ^XP next/prev err\|\i \i } {Window \i Help Screen \|turn off with ^XH prev. screen ^X, next screen ^X. \i \i \i\|\uWINDOW\u \|\uSCROLL\u \|\uSHELL\u \|\uCURSOR\u \|\i \i \i \i\|^X2 Split window in half \|^X^P up \|^Z Suspend \|^[P prev. paragraph \|\i \i \i \i\|^XO Switch to other window \|^X^N down \|^[! Command \|^[N next paragraph \|\i \i \i \i\|^XZ Grow window \|^X< left \|^[' Window \|^XG to matching ( [ { \|\i \i \i \i\|^X^Z Shrink window \|^X> right \| \|\uBOOKMARK\u \|\i \i \i \i\|^X0 Kill window \| \| \|^XJ set \|\i \i \i \i\|^X1 Kill all other windows \|^X= status\| \|^X/ goto \|\i \i } {Search \i Help Screen \|turn off with ^XH prev. screen ^X, next screen ^X. \i \i \iSpecial search sequences: \|\i \i \i \i \\^ \\$ matches beg./end of line \\? match any single char \|\i \i \i \i \\< \\> matches beg./end of word \\* match 0 or more chars \|\i \i \i \i \\c matches balanced C expression \\\\ matches a \\ \|\i \i \i \i \\[..] matches one of a set \\n matches a newline \|\i \i \i \i \\+ matches 0 or more of the character which follows the \\+ \|\i \i \i \iSpecial replace sequences: \|\i \i \i \i \\& replaced with text which matched search string \|\i \i \i \i \\0 - 9 replaced with text which matched Nth \\*, \\?, \\c, \\+, or \\[..] \|\i \i \i \i \\\\ replaced with \\ \\n replaced with newline \|\i \i } {Names \i Help Screen \|turn off with ^XH prev. screen ^X, next screen ^X. \i \i \i Hit TAB at file name prompts to generate menu of file names \|\i \i \i \i Or use up/down keys to access history of previously entered names \|\i \i \i \i Special file names: \|\i \i \i \i !command Pipe in/out of a shell command \|\i \i \i \i >>filename Append to a file \|\i \i \i \i - Read/Write to/from standard I/O \|\i \i \i \i filename,START,SIZE Read/Write a part of a file/device \|\i \i \i \i Give START/SIZE in decimal (255), octal (0377) or hex (0xFF) \|\i \i } {Joe \i Help Screen \|turn off with ^XH prev. screen ^X, \i \i \i For bug reports and other information, refer to: \uhttp://mirbsd.de/jupp\u \|\i \i } #HOOK#3 additional help screens {CharTable \i Help Screen turn off with ^J prev. screen ^[, \uCharacter Map\u \i \i \i Dec Hex \u 0123 4567 89AB CDEF 0123 4567 89AB CDEF \u Hex Dec \i \i \i \i | | \i \i \i \i 0 00 | \u@ABC\u \uDEFG\u \uHIJK\u \uLMNO\u €‚ „…†‡ ‰Š‹ ŚŤŽŹ | 80 128 \i \i \i \i 16 10 | \uPQRS\u \uTUVW\u \uXYZ[\u \u\\]^_\u ‘’“ ”•–— ™š› śťžź | 90 144 \i \i \i \i 32 20 | !"# $%&' ()*+ ,-./  ˇ˘Ł ¤Ą¦§ ¨©Ş« ¬­®Ż | A0 160 \i \i \i \i 48 30 | 0123 4567 89:; <=>? °±˛ł ´µ¶· ¸ąş» Ľ˝ľż | B0 176 \i \i \i \i 64 40 | @ABC DEFG HIJK LMNO ŔÁÂĂ ÄĹĆÇ ČÉĘË ĚÍÎĎ | C0 192 \i \i \i \i 80 50 | PQRS TUVW XYZ[ \\]^_ ĐŃŇÓ ÔŐÖ× ŘŮÚŰ ÜÝŢß | D0 208 \i \i \i \i 96 60 | `abc defg hijk lmno ŕáâă äĺćç čéęë ěíîď | E0 224 \i \i \i \i 112 70 | pqrs tuvw xyz{ |}~ đńňó ôőö÷ řůúű üýţ˙ | F0 240 \i \i } {Paste \i \i \i \i \u\bPaste Mode\b\u turn off with \b^D\b or \b^[[201~\b \i \i } FOURTH SECTION: Key bindings: Section names you must provide: :main editing window :prompt prompt lines :query single-character query lines :querya singe-character query for quote :querysr search-and-replace single-character query Other sections may be given as well for organisation purposes or for use with the '-keymap' option. Use: :inherit name To copy the named section into the current one :delete key To delete a key sequence from the current section Keys: Use ^@ through ^_ and ^? for C0 control characters and DEL Use SP for space Use a TO b to generate a range of characters You can also use termcap string capability names. For example: .ku Up .kd Down .kl Left .kr Right .kh Home .kH End .kI Insert .kD Delete .kP PgUp .kN PgDn .k1 - .k9 F1 - F9 .k0 F0 or F10 .k; F10 Macros: Simple macros can be made by comma seperating two or more command names. For example: eof,bol ^T Z Goto beginning of last line Also quoted matter is typed in literally (backslashes escape): bol,">",dnarw .k1 Quote news article line Macros may cross lines if they end with a comma. Commands or named macros may be created with :def. For example, you can use... :def foo eof,bol ... to define a command foo which will go to the beginning of the last line. :windows Bindings common to all windows #HOOK#4 common keybindings type ^@ TO ˙ abort ^G Abort window abort ^X ^C abort ^C tw0 ^X 0 Delete window: can make orphan buffers tw1 ^X 1 Delete other windows: can make orphan buffers uarg ^U Repeat prefix uarg ^[ - uarg ^[ 0 TO 9 help .k1 help ^X H help ^X ^H help ^X h Help help ^[ [ 1 1 ~ hnext ^X . hprev ^X , math ^[ m Calculator math ^[ M nextw ^X o Other window pgdn .kN Screen down pgdn ^V pgdn ^[ [ 6 ~ pgdn ^[ [ G SCO pgup .kP Screen up pgup ^[ [ 5 ~ pgup ^[ [ I SCO pgup ^[ v play,"0" ^X e Execute keyboard macro prevw ^X p Previous window (uemacs) query ^X q Query insert record,"0" ^X ( Record macro retype ^L Refresh screen rtn ^M Return shell ^Z Suspend shell ^[ s Suspend (uemacs) stop ^X ) Stop recording macro :Paste type ^@ TO ˙ rtn ^M msg,"Entered bracketed paste mode",rtn ^[ [ 2 0 0 ~ helpcard,rtn,keymap,"main",rtn,msg,rtn ^[ [ 2 0 1 ~ helpcard,rtn,keymap,"main",rtn ^D :Pasteprompt type ^@ TO ˙ nop ^L keymap,"prompt",rtn,msg,rtn,rtn ^M msg,"Entered bracketed paste mode",rtn ^[ [ 2 0 0 ~ keymap,"prompt",rtn,msg,rtn ^[ [ 2 0 1 ~ keymap,"prompt",rtn ^D :main Text editing window :inherit windows compile :def compile switch,"*Build-Log*",rtn,markb,eof," ",markk,blkdel,filt,query,parserr :def compile querysave,query,scratch,"* Build Log *",rtn,bof,markb,eof," ",markk,blkdel,build spell check :def aspellfile filt,"SPLTMP=ispell.tmp;cat >$SPLTMP;aspell -x -c $SPLTMP /dev/tty;cat $SPLTMP;/bin/rm $SPLTMP",rtn,retype :def aspellword psh,nextword,markk,prevword,markb,filt,"SPLTMP=ispell.tmp;cat >$SPLTMP;aspell -x -c $SPLTMP /dev/tty;tr -d <$SPLTMP '\\012';/bin/rm $SPLTMP",rtn,retype,nextword :def ispellfile filt,"cat >ispell.tmp;ispell ispell.tmp /dev/tty;cat ispell.tmp;/bin/rm ispell.tmp",rtn,retype :def ispellword psh,nextword,markk,prevword,markb,filt,"cat >ispell.tmp;ispell ispell.tmp /dev/tty;tr -d >",query ^X a Append region to file retype, arg,"top+height/2-line",rtn,upslide ^L Recenter arg,"top+height/2-line",rtn,dnarw ^[ r Move to center line swap,math,"z=line",rtn, swap,msg,math,"line-z",rtn, " lines in region",rtn ^[ = Count lines region mode,"O" ^X ^Q Toggle read-only compile ^X c Compile nxterr ^X n nxterr ^X ` prverr ^X p backs ^? Backspace backs ^H backw ^[ ^? Backspace word backw ^[ ^H bknd ^X ' Shell window (joe) bof ^[ < Goto beginning of file bof ^X [ bof ^[ [ 1 ; 5 H home ^A Goto beginning of line home .kh home ^[ [ 1 ~ home ^[ [ 7 ~ home ^[ [ H bop ^[ p (uemacs) bufed ^X b bknd ^[ ' Shell window crawlr ^X > Scroll to the right crawll ^X < Scroll to the left delch .kD Delete character delch ^D delch ^[ [ 3 ~ deleol ^K Delete to end of line delw ^[ d Delete word dnarw .kd Go down dnarw ^N dnarw ^[ O B dnarw ^[ [ B dnslide ^X ^N Slide down (uemacs) edit ^X ^F Edit a file: creates orphaned buffers eof ^[ > Go to end of file eof ^X ] eof ^[ [ 1 ; 5 F eol .@7 eol .kH Go to end of line eol ^E eol ^[ [ 4 ~ eol ^[ [ 8 ~ eol ^[ [ F eop ^[ n (uemacs) execmd ^[ x insc ^C (uemacs) ffirst ^S Search forward isrch ^S ffirst ^\ psh,markk,filt,query ^[ | Filter block format ^[ q Format paragraph gomark ^X / Goto bookmark groww ^X ^ Enlarge window groww ^X z (uemacs) insf ^X i Insert a file yapp ^[ ^W Append next kill line ^[ g Goto line (uemacs) ltarw .kl Go left ltarw ^B ltarw ^[ O D ltarw ^[ [ D mode ^[ ^[ Change modes nbuf ^X ^B Next buffer in current window nbuf ^X x (uemacs) nextpos ^K = Goto next position in position history nextword ^[ f Goto next word nextword ^[ [ 1 ; 5 C notmod ^[ ~ Not modified open ^O Split line open ^[ ^O pbuf ^X b Previous buffer in current window prevpos ^K - Goto previous position in position history prevword ^[ b Previous word prevword ^[ [ 1 ; 5 D qrepl ^[ % Query replace qrepl ^[ r Query replace (uemacs) qrepl ^[ ^R Query replace (uemacs) redo ^^ Redo changes rfirst ^R Search backwards rsrch ^R Incremental search backwards rindent ^X ^I Indent to the right rindent ^[ ^\ rtarw .kr Go right rtarw ^F rtarw ^[ O C rtarw ^[ [ C run ^[ ! save ^X ^W Write file setmark ^X j Set bookmark shrinkw ^X ^Z (uemacs) splitw ^X 2 Split window stat ^X l GNU-Emacs Show status stat ^X ? JED stat ^X = GNU-Emacs swap ^X ^X Swap mark and cursor tag ^[ . Tag search tomatch ^X g Goto matching parenthasis (joe) tomatch ^[ ^F (uemacs) txt ^X t Prompt for text to insert undo ^_ Undo changes undo ^X u uparw .ku Go up uparw ^P uparw ^[ O A uparw ^[ [ A upslide ^X ^P Slide up (uemacs) yank ^Y Yank deleted text yankpop ^[ y Yank-pop :prompt Prompt windows :inherit main abort ^G abort ^C complete ^I nop ^L keymap,"Pasteprompt",rtn,msg,"Entered bracketed paste mode",rtn ^[ P keymap,"Pasteprompt",rtn,msg,"Entered bracketed paste mode",rtn ^[ p keymap,"Pasteprompt",rtn,msg,"Entered bracketed paste mode",rtn ^[ [ 2 0 0 ~ :menu Selection menus :inherit windows abort ^[ ^[ backsmenu ^? backsmenu ^H bofmenu ^K U bofmenu ^K ^U bofmenu ^K u bofmenu ^[ [ 1 ; 5 H bolmenu ^A bolmenu .kh bolmenu ^[ [ 1 ~ bolmenu ^[ [ 7 ~ bolmenu ^[ [ H dnarwmenu .kd dnarwmenu ^N dnarwmenu ^[ [ B dnarwmenu ^[ O B eofmenu ^K V eofmenu ^K ^V eofmenu ^K v eofmenu ^[ [ 1 ; 5 F eolmenu .@7 eolmenu .kH eolmenu ^E eolmenu ^[ [ 4 ~ eolmenu ^[ [ 8 ~ eolmenu ^[ [ F ltarwmenu .kl ltarwmenu ^B ltarwmenu ^[ [ D ltarwmenu ^[ O D pgdnmenu .kN pgdnmenu ^V pgdnmenu ^[ [ 6 ~ pgdnmenu ^[ [ G pgupmenu .kP pgupmenu ^[ [ 5 ~ pgupmenu ^[ [ I pgupmenu ^[ v rtarwmenu .kr rtarwmenu ^F rtarwmenu ^[ [ C rtarwmenu ^[ O C rtn SP rtn ^I rtn ^X H rtn ^X h rtn ^X ^H tabmenu ^I uparwmenu .ku uparwmenu ^P uparwmenu ^[ [ A uparwmenu ^[ O A :query Single-key query window :inherit windows :querya Single-key query window for quoting type ^@ TO ˙ :querysr Search & replace query window type ^@ TO ˙ jupp/joe.1.in010064400000000000000000001154111374670214300102410ustar00.\" $MirOS: contrib/code/jupp/joe.1.in,v 1.33 2020/10/30 03:11:04 tg Exp $ .\"- .TH JOE 1 .\" disable pagination if called with -rg1 .if \ng==1 \{\ . ch }H . ch }F .\} .\" define some general macros (from portmdoc) .ie \n(.g \{\ . ds TI \(ti . ds ha \(ha .\} .el \{\ . ds TI ~ . ds ha ^ .\} .ie n \{\ . ds EM \ \(em\ \& .\} .el \{\ . ds EM \f(TR\^\(em\^\fP .\} .SH NAME joe \- Joe's Own Editor .SH SYNTAX .B joe [global-options] [ [local-options] filename ]... .B jstar [global-options] [ [local-options] filename ]... .B jmacs [global-options] [ [local-options] filename ]... .B rjoe [global-options] [ [local-options] filename ]... .B jpico [global-options] [ [local-options] filename ]... .B jupp [global-options] [ [local-options] filename ]... .SH DESCRIPTION JOE is a powerful ASCII text screen editor. It has a "mode-less" user interface which is similar to many user-friendly PC editors. Users of Micro-Pro's WordStar or Borland's "Turbo" languages will feel at home. JOE is a full featured UNIX screen editor though, and has many features for editing programs and text. JOE also emulates several other editors. JSTAR is a close imitation of WordStar with many "JOE" extensions. JPICO is a close imitation of the Pine mailing system's PICO editor, but with many extensions and improvements. JMACS is a GNU EMACS imitation. RJOE is a restricted version of JOE, which allows you to edit only the files specified on the command line. Although JOE is actually six different editors, it still requires only one executable, but one with six different names. The name of the editor with an "rc" appended gives the name of JOE's initialisation file, which determines the personality of the editor. JUPP is free software; you can distribute it and/or modify it under the terms of the GNU General Public License, Version 1, as published by the Free Software Foundation. See main.c (contains more detailed exceptions). I have no plans for turning JOE into a commercial or shareware product. Check the source code for exact authorship and licencing information. JOE is available over the Internet from \fBhttp://joe\-editor.sf.net/\fR. JUPP is available at \fBhttp://mirbsd.de/jupp\fR. .SH USAGE To start the editor, type \fBjoe\fR followed by zero or more names of files you want to edit. Each file name may be preceded by a local option setting (see the local options table which follows). Other global options, which apply to the editor as a whole, may also be placed on the command line (see the global options table which follows). If you are editing a new file, you can either give the name of the new file when you invoke the editor, or in the editor when you save the new file. A modified syntax for file names is provided to allow you to edit program output, standard input/output, or sections of files or devices. See the section \fBFilenames\fR below for details. On cygwin32 systems, the special option \fB\-CYGhack\fR is replaced by anything that comes past it (and separating whitespace) on the command line as \fIone\fR option (to work around a Cygwin bug as it cannot correctly be passed a UNC pathname with spaces as one argument from Explorer \fIat all\fR). Once you are in the editor, you can type in text and use special control character sequences to perform other editing tasks. To find out what the control character sequences are, read the rest of this man page or type \fB^K H\fR for help in the editor. Now for some obscure computer lore: The \fB^\fR means that you hold down the \fBControl\fR key while pressing the following key (the same way the \fBShift\fR key works for uppercase letters). A number of control key sequences are duplicated on other keys, so that you don't need to press the control key: \fBESC\fR will work in place of \fB^[\fR, \fBDel\fR will work in place of \fB^?\fR, \fBBackspace\fR will work in place of \fB^H\fR, \fBTab\fR will work in place of \fB^I\fR, \fBReturn\fR or \fBEnter\fR will work in place of \fB^M\fR and \fBLinefeed\fR will work in place of \fB^J\fR. Some keyboards may give you trouble with some control keys. \fB^_\fR, \fB^^\fR and \fB^@\fR can usually be entered without pressing shift (I.E., try \fB^\-\fR, \fB^6\fR and \fB^2\fR). Other keyboards may reassign these to other keys. Try: \fB^.\fR, \fB^,\fR and \fB^/\fR. \fB^SPACE\fR can usually be used in place of \fB^@\fR. \fB^\\\fR and \fB^]\fR are interpreted by many communication programs, including telnet and kermit. Usually you just hit the key twice to get it to pass through the communication program. Once you have typed \fB^K H\fR, the first help window appears at the top of the screen. You can continue to enter and edit text while the help window is on. To page through other topics, hit ^[, and ^[. (that is, ESC , and ESC .). Use \fB^K H\fR to dismiss the help window. You can customise the keyboard layout, the help screens and a number of behavior defaults by copying JOE's initialisation file (@joeinitfile@) to \fB.joerc\fR in your home directory and then by modifying it. See the section \fBjoerc\fR below. The filename is actually \fB.\fIname\fBrc\fR where \fIname\fR is the \fBargv[0]\fR the editor is called with. Custom syntax files are loaded from \fB.jupp/syntax/\fIname\fB.jsf\fR in your home directory and \fB.jupp/charmaps/\fIname\fR holds custom charmaps (\fIname\fR here is the name of the syntax or charmap). To have JOE used as your default editor for eMail and News, you need to set the \fBEDITOR\fR and \fBVISUAL\fR environment variables in your shell initialisation file (\fB.cshrc\fR or \fB.profile\fR) to refer to JOE (the joe binary usually resides as \fB@joeresides@\fR). There are a number of other obscure invocation parameters which may have to be set, particularly if your terminal screen is not updating as you think it should. See the section \fBEnvironment variables\fR below. .SH COMMAND LINE OPTIONS The following global options may be specified on the command line: .IP \-asis Characters with codes above 127 will be sent to the terminal as-is, instead of as inverse of the corresponding character below 128. If this does not work, check your terminal server. .IP \-backpath\ path If this option is given, backup files will be stored in the specified directory instead of in each file's original directory. .IP \-baud\ nnn Set the baud rate for the purposes of terminal screen optimisation. Joe inserts delays for baud rates below 19200, which bypasses tty buffering so that typeahead will interrupt the screen output. Scrolling commands will not be used for 38400 baud. This is useful for X-Window terminals and other console ttys which really aren't going over a serial line. .IP \-beep Joe will beep on command errors and when the cursor goes past extremes. .IP \-columns\ nnn Sets the number of screen columns. .IP \-csmode Continued search mode: a search immediately following a search will repeat the previous search instead of prompting for new string. This is useful for the the ^[S and ^[R commands and for when joe is trying to be emacs. .IP \-dopadding Joe usually assumes that there is some kind of flow control between it and the tty. If there isn't, this option will make joe output extra ^@s to the tty as specified by the termcap entry. The extra ^@s allow the terminal to catch up after long terminal commands. .IP \-exask This option makes ^KX verify the file name that it's about to write. .IP \-force This option makes sure that the last line of the file has a line feed when it is saved. .IP \-help The editor will start with the help screen on if this option is given. .IP \-keepup Normally the column number and control-key prefix fields of the status lines are on a one second delay to reduce CPU consumption, but with this option they are updated after each keystroke. .IP \-lightoff The block highlighting will go away after any block command if this option is given. .IP \-lines\ nnn Sets the number of screen lines. .IP \-marking Text between ^KB and the cursor is highlighted (use with \-lightoff and a modified joerc file to have drop-anchor style block selection). .IP \-mid If this option is set and the cursor moves off the window, the window will be scrolled so that the cursor is in the center. This option is forced on slow terminals which don't have scrolling commands. .IP \-nobackups This option prevents backup files. .IP \-nonotice This option prevent the copyright notice from being displayed when the editor starts. .IP \-nosta This option eliminates the topmost status line. It's nice for when you only want to see your text on the screen or if you're using a vt52. .IP \-noxon Attempt to turn off ^S/^Q processing. This is useful for when joe is trying to be WordStar or EMACS. .IP \-orphan When this option is active, extra files on the command line will be placed in orphaned buffers instead of in extra windows. This is useful for when joe is trying to be emacs. .IP \-pg\ nnn This specifies the number of lines to keep after PgUp/PgDn (^U/^V). If \-1 is given, half the window is kept. .IP \-skiptop\ nnn Don't use the top nnn lines of the screen. Useful for when joe is used as a BBS editor. .LP Each of these options may be specified in the joerc file as well. In addition, the NOXON, BAUD, LINES, COLUMNS and DOPADDING options may be specified with environment variables. See the section \fBEnvironment variables\fR below. The following options may be specified before each filename on the command line: .IP +nnn The cursor starts on the specified line. .IP \-crlf Joe uses CR-LF as the end of line sequence instead of just LF. This is for editing MS-DOS or VMS files. .IP \-hex Sets the buffer to hex edit mode. .IP \-wordwrap Joe wraps the previous word when you type past the right margin. .IP \-autoindent When you hit Return on an indented line, the indentation is duplicated onto the new line. .IP \-overwrite Typing overwrites existing characters instead of inserting before them. .IP \-lmargin\ nnn Sets the left margin. .IP \-rmargin\ nnn Sets the right margin. .IP \-tab\ nnn Sets the tab width. .IP \-indentc\ nnn Sets the indentation character for ^K, and ^K. (32 for SPACE, 9 for TAB). .IP \-istep\ nnn Sets the indentation step for ^K, and ^K.. .IP \-linums Line numbers are displayed before each line. .IP \-rdonly The file is read only. .IP \-keymap\ name Use an alternate section of the joerc file for the key sequence bindings. For example, .B joe, jstar, rjoe and .B jupp support .B \-keymap cua to make ^Z, ^X, ^C and ^V do the same thing as in contemporary GUI editors. .LP These options can also be specified in the joerc file. They can be set depending on the filename extension. Programs (.c, .h or .p extension) usually have autoindent enabled. Wordwrap is enabled on other files, but rc files have it disabled. .SH EDITING TASKS .SS Basic Editing When you type characters into the editor, they are normally inserted into the file being edited (or appended to the file if the cursor is at the end of the file). This is the normal operating mode of the editor. If you want to replace some existing text, you have to delete the old text before or after you type in the replacement text. The \fBBackspace\fR key can be used for deleting text: move the cursor to right after the text you want to delete and hit \fBBackspace\fR a number of times. Hit the \fBEnter\fR or \fBReturn\fR key to insert a line break. For example, if the cursor was in the middle of a line and you hit \fBReturn\fR, the line would be split into two lines with the cursor appearing at the beginning of the second line. Hit \fBBackspace\fR at the beginning of a line to eliminate a line break. Use the arrow keys to move around the file. If your keyboard doesn't have arrow keys (or if they don't work for some reason), use \fB^F\fR to move forwards (right), \fB^B\fR to move backwards (left), \fB^P\fR to move to the previous line (up), and \fB^N\fR to move to the next line (down). The right and left arrow keys simply move forwards or backwards one character at a time through the text: if you're at the beginning of a line and you press left-arrow, you will end up at the end of the previous line. The up and down arrow keys move forwards and backwards by enough characters so that the cursor appears in the same column that it was in on the original line. If you want to indent the text you enter, you can use the \fBTAB\fR key. This inserts a special control character which makes the characters which follow it begin at the next TAB STOP. TAB STOPS normally occur every 8 columns, but this can be changed with the \fB^T D\fR command. Python programmers often set TAB STOPS on every 4 columns. If for some reason your terminal screen gets messed up (for example, if you receive a mail notice from biff), you can have the editor refresh the screen by hitting \fB^R\fR. There are many other keys for deleting text and moving around the file. For example, hit \fB^D\fR to delete the character the cursor is on instead of deleting backwards like \fBBackspace\fR. \fB^D\fR will also delete a line break if the cursor is at the end of a line. Type \fB^Y\fR to delete the entire line the cursor is on or \fB^J\fR to delete just from the cursor to the end of the line. Hit \fB^A\fR to move the cursor to the beginning of the line it's on. Hit \fB^E\fR to move the cursor to the end of the line. Hit \fB^U\fR or \fB^V\fR for scrolling the cursor up or down 1/2 a screen's worth. "Scrolling" means that the text on the screen moves, but the cursor stays at the same place relative to the screen. Hit \fB^K U\fR or \fB^K V\fR to move the cursor to the beginning or the end of the file. Look at the help screens in the editor to find even more delete and movement commands. If you make a mistake, you can hit \fB^_\fR to "undo" it. On most keyboards you hit just \fB^\-\fR to get \fB^_\fR, but on some you might have to hold both the \fBShift\fR and \fBControl\fR keys down at the same time to get it. If you "undo" too much, you can "redo" the changes back into existence by hitting \fB^^\fR (type this with just \fB^6\fR on most keyboards). If you were editing in one place within the file, and you then temporarily had to look or edit some other place within the file, you can get back to the original place by hitting \fB^K\-\fR. This command actually returns you to the last place you made a change in the file. You can step through a history of places with \fB^K\-\fR and \fB^K =\fR, in the same way you can step through the history of changes with the "undo" and "redo" commands. When you are done editing the file, hit \fB^K X\fR to exit the editor. You will be prompted for a file name if you hadn't already named the file you were editing. When you edit a file, you actually edit only a copy of the file. So if you decide that you don't want the changes you made to a file during a particular edit session, you can hit \fB^C\fR to exit the editor without saving them. If you edit a file and save the changes, a "backup" copy of that file is created in the current directory, with a ~ appended to the name, which contains the original version of the file. .SS Word wrap and formatting If you type past the right edge of the screen in a C language or PASCAL file, the screen will scroll to the right to follow the cursor. If you type past the right edge of the screen in a normal file (one whose name doesn't end in .c, .h or .p), JOE will automatically wrap the last word onto the next line so that you don't have to hit \fBReturn\fR. This is called word-wrap mode. Word-wrap can be turned on or off with the \fB^T W\fR command. JOE's initialisation file is usually set up so that this mode is automatically turned on for all non-program files. See the section below on the \fBjoerc\fR file to change this and other defaults. Aside for Word-wrap mode, JOE does not automatically keep paragraphs formatted like some word processors. Instead, if you need a paragraph to be reformatted, hit \fB^K J\fR. This command "fills in" the paragraph that the cursor is in, fitting as many words in a line as is possible. A paragraph, in this case, is a block of text separated above and below by a blank line or a line beginning with a period ("."). Lines can be indented by tab, any of the \fB!#$%&)*+,\-./:;=>?@\e]\*(ha_|}\*(TI\fR characters or spaces. The margins which JOE uses for paragraph formatting and word-wrap can be set with the \fB^T L\fR and \fB^T R\fR commands. If the left margin is set to a value other than 1, then when you start typing at the beginning of a line, the cursor will immediately jump to the left margin. If you want to center a line within the margins, use the \fB^K A\fR command. .SS Overtype mode Sometimes it's tiresome to have to delete old text before or after you insert new text. This happens, for example, when you are changing a table and you want to maintain the column position of the right side of the table. When this occurs, you can put the editor in overtype mode with \fB^T T\fR. When the editor is in this mode, the characters you type in replace existing characters, in the way an idealised typewriter would. Additionally, \fBBackspace\fR simply moves left instead of deleting the character to the left, when it's not at the end or beginning of a line. Overtype mode is not the natural way of dealing with text electronically, so you should go back to insert mode as soon as possible by typing \fB^T T\fR again. If you need to insert while you're in overtype mode, hit \fB^@\fR. This inserts a single SPACE into the text. .SS Control and Meta characters Each character is represented by a number. For example, the number for 'A' is 65 and the number for '1' is 49. All of the characters which you normally see have numbers in the range of 32\ to\ 126 (this particular arbitrary assignment between characters and numbers is called the ASCII character set). The numbers outside of this range, from 0\ to\ 255, aren't usually displayed, but sometimes have other special meanings. The number 10, for example, is used for the line breaks. You can enter these special, non-displayed \fBcontrol characters\fR by first hitting \fB`\fR and then hitting a character in the range \fB@ A B C ... X Y Z [ ^ ] \e _\fR to get the number 0\ to\ 31, and ? to get 127. For example, if you hit \fB`\ J\fR, you'll insert a line break character, or if you hit \fB`\ I\fR, you'll insert a TAB character (which does the same thing the TAB key does). A useful control character to enter is 12 (\fB`\ L\fR), which causes most printers to advance to the top of the page. You'll notice that JOE displays this character as an underlined L. You can enter the characters above 127, the \fBmeta characters\fR, by first hitting \fB^\e\fR. This adds 128 to the next (possibly control) character entered. JOE displays characters above 128 in inverse video. Some foreign languages, which have more letters than English, use the meta characters for the rest of their alphabet. You have to put the editor in \fBas-is\fR mode (described later) to have these passed untranslated to the terminal. .SS Prompts If you hit \fBTAB\fR at any file name prompt, joe will attempt to complete the name you entered as much as possible. If it couldn't complete the entire name, because there are more than one possible completions, joe beeps. If you hit \fBTAB\fR again, joe list the completions. You can use the arrow keys to move around this directory menu and press RETURN or SPACE to select an item. If you press the first letter of one of the directory entries, it will be selected, or if more than one entry has the same first letter, the cursor will jump between those entries. If you select a subdirectory or .., the directory name is appended to the prompt and the new directory is loaded into the menu. You can hit Backspace to go back to the previous directory. Most prompts record a history of the responses you give them. You can hit up and down arrow to step through these histories. Prompts are actually single line windows with no status line, so you can use any editing command that you normally use on text within the prompts. The prompt history is actually just other lines of the same "prompt file". Thus you can can search backwards though the prompt history with the normal \fB^K F\fR command if you want. Since prompts are windows, you can also switch out of them with \fB^K P\fR and \fB^K N\fR. .SS Where am I? Hit \fB^K SPACE\fR to have JOE report the line number, column number, and byte number on the last line of the screen. The number associated with the character the cursor is on (its ASCII code) is also shown. You can have the line number and/or column number always displayed on the status line by setting placing the appropriate escape sequences in the status line setup strings. Edit the joerc file for details. .SS File operations You can hit \fB^K D\fR to save the current file (possibly under a different name from what the file was called originally). After the file is saved, you can hit \fB^K E\fR to edit a different file. If you want to save only a selected section of the file, see the section on \fBBlocks\fR below. If you want to include another file in the file you're editing, use \fB^K R\fR to insert it. .SS Temporarily suspending the editor If you need to temporarily stop the editor and go back to the shell, hit \fB^K Z\fR. You might want to do this to stop whatever you're editing and answer an eMail message or read this man page, for example. You have to type \fBfg\fR or \fBexit\fR (you'll be told which when you hit \fB^K Z\fR) to return to the editor. .SS Searching for text Hit \fB^K F\fR to have the editor search forwards or backwards for a text fragment (\fBstring\fR) for you. You will be prompted for the text to search for. After you hit \fBReturn\fR, you are prompted to enter options. You can just hit \fBReturn\fR again to have the editor immediately search forwards for the text, or you can enter one or more of these options: .IP \fBb Search backwards instead of forwards. .IP \fBi Treat uppercase and lower case letters as the same when searching. Normally uppercase and lowercase letters are considered to be different. .IP \fBnnn (where \fBnnn\fR is a number) If you enter a number, JOE searches for the Nth occurrence of the text. This is useful for going to specific places in files structured in some regular manner. .IP \fBr Replace text. If you enter the \fBr\fR option, then you will be further prompted for replacement text. Each time the editor finds the search text, you will be prompted as to whether you want to replace the found search text with the replacement text. You hit: \fBy\fR to replace the text and then find the next occurrence, \fBn\fR to not replace this text, but to then find the next occurrence, \fBl\fR to replace the text and then stop searching, \fBr\fR to replace all of the remaining occurrences of the search text in the remainder of the file without asking for confirmation (subject to the \fBnnn\fR option above), or \fB^C\fR to stop searching and replacing. .PP You can hit \fB^L\fR to repeat the previous search. .SS Regular Expressions A number of special character sequences may be entered as search text: .IP \fB\e* This finds zero or more characters. For example, if you give \fBA\e*B\fR as the search text, JOE will try to find an A followed by any number of characters and then a B. .IP \fB\e? This finds exactly one character. For example, if you give \fBA\e?B\fR as the search text, JOE will find AXB, but not AB or AXXB. .IP \fB\e^\ \e$ These match the beginning and end of a line. For example, if you give \fB\e^test\e$\fR, then JOE with find \fBtest\fR on a line by itself. .IP \fB\e<\ \e> These match the beginning and end of a word. For example, if you give \fB\e<\e*is\e*\e>\fR, then joe will find whole words which have the substring \fBis\fR within them. .IP \fB\e[...] This matches any single character which appears within the brackets. For example, if \fB\e[Tt]his\fR is entered as the search string, then JOE finds both \fBThis\fR and \fBthis\fR. Ranges of characters can be entered within the brackets. For example, \fB\e[A\-Z]\fR finds any uppercase letter. If the first character given in the brackets is \fB^\fR, then JOE tries to find any character not given in the the brackets. .IP \fB\ec This works like \fB\e*\fR, but matches a balanced C-language expression. For example, if you search for \fBmalloc(\ec)\fR, then JOE will find all function calls to \fBmalloc\fR, even if there was a \fB)\fR within the parenthesis. .IP \fB\e+ This finds zero or more of the character which immediately follows the \fB\e+\fR. For example, if you give \fB\e[ ]\e+\e[ ]\fR, where the characters within the brackets are both SPACE and TAB, then JOE will find whitespace. .IP \fB\e\e Matches a single \e. .IP \fB\en This finds the special end-of-line or line-break character. .PP A number of special character sequences may also be given in the replacement string: .IP \fB\e& This gets replaced by the text which matched the search string. For example, if the search string was \fB\e<\e*\e>\fR, which matches words, and you give \fB"\e&"\fR, then joe will put quote marks around words. .IP \fB\e0\ -\ \e9 These get replaced with the text which matched the Nth \fB\e*\fR, \fB\e?\fR, \fB\e+\fR, \fB\ec\fR, \fB\e+\fR, or \fB\e[...]\fR in the search string. .IP \fB\e\e Use this if you need to put a \fB\e\fR in the replacement string. .IP \fB\en Use this if you need to put a line break in the replacement string. .PP Some examples: Suppose you have a list of addresses, each on a separate line, which starts with "Address:" and has each element separated by commas. Like so: Address: S. Holmes, 221b Baker St., London, England If you wanted to rearrange the list, to get the country first, then the city, then the person's name, and then the address, you could do this: Type \fB^K F\fR to start the search, and type: \fBAddress:\e*,\e*,\e*,\e*\e$\fR to match "Address:", the four comma-separated elements, and then the end of the line. When asked for options, you would type \fBr\fR to replace the string, and then type: \fBAddress:\e3,\e2,\e0,\e1\fR To shuffle the information the way you want it. After hitting return, the search would begin, and the sample line would be changed to: Address: England, London, S. Holmes, 221b Baker St. .SS Blocks If you want to move, copy, save or delete a specific section of text, you can do it with highlighted blocks. First, move the cursor to the start of the section of text you want to work on, and press \fB^K B\fR. Then move the cursor to the character just after the end of the text you want to affect and press \fB^K K\fR. The text between the \fB^K B\fR and \fB^K K\fR should become highlighted. Now you can move your cursor to someplace else in your document and press \fB^K M\fR to move the highlighted text there. You can press \fB^K C\fR to make a copy of the highlighted text and insert it to where the cursor is positioned. \fB^K Y\fR to deletes the highlighted text. \fB^K W\fR, writes the highlighted text to a file. A very useful command is \fB^K /\fR, which filters a block of text through a unix command. For example, if you select a list of words with \fB^K B\fR and \fB^K K\fR, and then type \fB^K / sort\fR, the list of words will be sorted. Another useful unix command for \fB^K /\fR, is \fBtr\fR. If you type \fB^K / tr a\-z A\-Z\fR, then all of the letters in the highlighted block will be converted to uppercase. After you are finished with some block operations, you can just leave the highlighting on if you don't mind it (of course, if you accidentally hit \fB^K Y\fR without noticing...). If it really bothers you, however, just hit \fB^K B ^K K\fR, to turn the highlighting off. .SS Indenting program blocks Auto-indent mode toggled with the \fB^T I\fR command. The \fBjoerc\fR is normally set up so that files with names ending with .p, .c or .h have auto-indent mode enabled. When auto-indent mode is enabled and you hit \fBReturn\fR, the cursor will be placed in the same column that the first non-SPACE/TAB character was in on the original line. You can use the \fB^K ,\fR and \fB^K .\fR commands to shift a block of text to the left or right. If no highlighting is set when you give these commands, the program block the cursor is located in will be selected, and will be moved by subsequent \fB^K ,\fR and \fB^K .\fR commands. The number of columns these commands shift by can be set through a \fB^T\fR option. .SS Windows You can edit more than one file at the same time or edit two or more different places of the same file. To do this, hit \fB^K O\fR, to split the screen into two windows. Use \fB^K P\fR or \fB^K N\fR to move the cursor into the top window or the lower window. Use \fB^K E\fR to edit a new file in one of the windows. A window will go away when you save the file with \fB^K X\fR or abort the file with \fB^C\fR. If you abort a file which exists in two windows, one of the window goes away, not the file. You can hit \fB^K O\fR within a window to create even more windows. If you have too many windows on the screen, but you don't want to eliminate them, you can hit \fB^K I\fR. This will show only the window the cursor is in, or if there was only one window on the screen to begin with, try to fit all hidden windows on the screen. If there are more windows than can fit on the screen, you can hit \fB^K N\fR on the bottom-most window or \fB^K P\fR on the top-most window to get to them. If you gave more than one file name to JOE on the command line, each file will be placed in a different window. You can change the height of the windows with the \fB^K G\fR and \fB^K T\fR commands. .SS Keyboard macros Macros allow you to record a series of keystrokes and replay them with the press of two keys. This is useful to automate repetitive tasks. To start a macro recording, hit \fB^K [\fR followed by a number from 0\ to\ 9. The status line will display (Macro n recording...). Now, type in the series of keystrokes that you want to be able to repeat. The commands you type will have their usual effect. Hit \fB^K ]\fR to stop recording the macro. Hit \fB^K\fR followed by the number you recorded the macro in to execute one iteration of the keystrokes. For example, if you want to put "**" in front of a number of lines, you can type: \fB^K [ ^A ** \fR \fB^K ]\fR Which starts the macro recording, moves the cursor to the beginning of the line, inserts "**", moves the cursor down one line, and then ends the recording. Since we included the keystrokes needed to position the cursor on the next line, we can repeatedly use this macro without having to move the cursor ourselves, something you should always keep in mind when recording a macro. If you find that the macro you are recording itself has a repeated set of keystrokes in it, you can record a macro within the macro, as long as you use a different macro number. Also you can execute previously recorded macros from within new macros. .SS Repeat You can use the repeat command, \fB^K \e\fR, to repeat a macro, or any other edit command or even a normal character, a specified number of times. Hit \fB^K \e\fR, type in the number of times you want the command repeated and press \fBReturn\fR. The next edit command you now give will be repeated that many times. For example, to delete the next 20 lines of text, type: \fB^K \ 20\fR\fB^Y\fR .SS Rectangle mode Type \fB^T X\fR to have \fB^K B\fR and \fB^K K\fR select rectangular blocks instead of stream-of-text blocks. This mode is useful for moving, copying, deleting or saving columns of text. You can also filter columns of text with the \fB^K /\fR command\*(EMif you want to sort a column, for example. The insert file command, \fB^K R\fR is also effected. When rectangle mode is selected, overtype mode (\fB^T T\fR) is also useful. When overtype mode is selected, rectangles will replace existing text instead of getting inserted before it. Also the delete block command (\fB^K Y\fR) will clear the selected rectangle with SPACEs and TABs instead of deleting it. Overtype mode is especially useful for the filter block command (\fB^K /\fR), since it will maintain the original width of the selected column. .SS Tag search If you are editing a large C program with many source files, you can use the \fBctags\fR program to generate a \fBtags\fR file. This file contains a list of program symbols and the files and positions where the symbols are defined. The \fB^K ;\fR command can be used to lookup a symbol (functions, defined constants, etc.), load the file where the symbol is defined into the current window and position the cursor to where the symbol is defined. \fB^K ;\fR prompts you for the symbol you want, but uses the symbol the cursor was on as a default. Since \fB^K ;\fR loads the definition file into the current window, you probably want to split the window first with \fB^K O\fR, to have both the original file and the definition file loaded. .SS Shell windows Hit \fB^K '\fR to run a command shell in one of JOE's windows. When the cursor is at the end of a shell window (use \fB^K V\fR if it's not), whatever you type is passed to the shell instead of the window. Any output from the shell or from commands executed in the shell is appended to the shell window (the cursor will follow this output if it's at the end of the shell window). This command is useful for recording the results of shell commands\*(EMfor example the output of \fBmake\fR, the result of \fBgrep\fRping a set of files for a string, or directory listings from \fBFTP\fR sessions. Besides typeable characters, the keys ^C, Backspace, DEL, Return and ^D are passed to the shell. Type the shell \fBexit\fR command to stop recording shell output. If you press \fB^C\fR in a shell window, when the cursor is not at the end of the window, the shell is \fBkill\fRed. .SH ENVIRONMENT VARIABLES For JOE to operate correctly, a number of other environment settings must be correct. The throughput (baud rate) of the connection between the computer and your terminal must be set correctly for JOE to update the screen smoothly and allow typeahead to defer the screen update. Use the \fBstty nnn\fR command to set this. You want to set it as close as possible to actual throughput of the connection. For example, if you are connected via a 1200 baud modem, you want to use this value for \fBstty\fR. If you are connected via 14.4k modem, but the terminal server you are connected to connects to the computer a 9600 baud, you want to set your speed as 9600 baud. The special baud rate of 38400 or \fBextb\fR is used to indicate that you have a very high-speed connection, such as a memory mapped console or an X-Window terminal emulator. If you can't use \fBstty\fR to set the actual throughput (perhaps because of a modem communicating with the computer at a different rate than it's communicating over the phone line), you can put a numeric value in the \fBBAUD\fR environment variable instead (use \fBsetenv BAUD 9600\fR for csh or \fBBAUD=9600; export BAUD\fR for sh). The \fBSHELL\fR or \fBEXECSHELL\fR environment variable must be set to the full pathname of a shell executable that accepts the \-i (interactive) and \-c (run a command) arguments of the Korn Shell; otherwise, \fB/bin/sh\fR is used. The \fBTERM\fR environment variable must be set to the type of terminal you're using. If the size (number of lines/columns) of your terminal is different from what is reported in the TERMCAP or TERMINFO entry, you can set this with the \fBstty rows nn cols nn\fR command, or by setting the \fBLINES\fR and \fBCOLUMNS\fR environment variables. The \fBxterm\-xfree86\fR terminal allows automatic entering and leaving of the bracketed paste mode. The \fBJOETERM\fR environment variable may be set to override the regular \fBTERM\fR environment variable for specifying your terminal type. JOE uses two character maps for its operation: the terminal I/O character map, which determines how characters are sent to the terminal and whether the %a/%A message specifiers use UCS, and the file encoding, which can be specified per file using the \fB\-encoding\fR option and changed with the \fB^T E\fR command, and which defaults to the terminal I/O character map, which, in turn, is determined from the current locale, if the system supports such, otherwise the \fBLC_ALL\fR, \fBLC_CTYPE\fR and \fBLANG\fR environment variables (if they contain a period, only the part after it and before an optional "at sign" is used); on cygwin32 before 1.7.2, the codepage is used instead if the POSIX locale environment variables are empty; the environment variable \fBJOECHARMAP\fR can be used to manually force one overriding all methods described above, and can be used together with \fB\-encoding\fR to specify a different default file character map. JOE normally expects that flow control between the computer and your terminal to use ^S/^Q handshaking (I.E., if the computer is sending characters too fast for your terminal, your terminal sends ^S to stop the output and ^Q to restart it). If the flow control uses out-of-band or hardware handshaking or if your terminal is fast enough to always keep up with the computer output and you wish to map ^S/^Q to edit commands, you can set the environment variable \fBNOXON\fR to have JOE attempt to turn off ^S/^Q handshaking. If the connection between the computer and your terminal uses no handshaking and your terminal is not fast enough to keep up with the output of the computer, you can set the environment variable \fBDOPADDING\fR to have \fBJOE\fR slow down the output by interspersing PAD characters between the terminal screen update sequences. .SH FILENAMES Wherever JOE expects you to enter a file name, whether on the command line or in prompts within the editor, you may also type: .IP \fB!command Read or write data to or from a shell command. For example, use \fBjoe '!ls'\fR to get a copy of your directory listing to edit or from within the editor use \fB^K D !mail jhallen@world.std.com\fR to send the file being edited to me. .IP \fB>>filename Use this to have JOE append the edited text to the end of the file "filename." .IP \fBfilename,START,SIZE Use this to access a fixed section of a file or device. \fBSTART\fR and \fBSIZE\fR may be entered in decimal (ex.: 123) octal (ex.: 0777) or hexadecimal (ex.: 0xFF). For example, use \fBjoe /dev/fd0,508,2\fR to edit bytes 508 and 509 of the first floppy drive in Linux. .IP \fB\- Use this to get input from the standard input or to write output to the standard output. For example, you can put joe in a pipe of commands: \fBquota \-v | joe \- | mail root\fR, if you want to complain about your low quota. .SH THE JOERC FILE \fB^T\fR options, the help screens and the key-sequence to editor command bindings are all defined in JOE's initialisation file. If you make a copy of this file (@joeinitcopy@) to \fB$HOME/.joerc\fR, you can customise these settings to your liking. The syntax of the initialisation file should be fairly obvious, and there are further instruction in it. .SH ACKNOWLEDGMENTS JOE was written by Joseph H. Allen. If you have bug reports or questions, eMail them to jhallen@world.std.com. Larry Foard (entropy@world.std.com) and Gary Gray (ggray@world.std.com) also helped with the creation of JOE. Thorsten "mirabilos" Glaser (tg@mirbsd.org) created JUPP, and the 16-bit MS-DOS version of JUPP 2.8 was compiled by Andreas Totlis (atotlis@t\-online.de). .SH BUGS This manual page describes only the JOE flavour; documentation for JUPP is especially missing. jupp/joe.txt010064400000000000000000001240301374665322700103200ustar00JOE(1) UNIX Programmer's Manual JOE(1) NAME joe - Joe's Own Editor SYNTAX joe [global-options] [ [local-options] filename ]... jstar [global-options] [ [local-options] filename ]... jmacs [global-options] [ [local-options] filename ]... rjoe [global-options] [ [local-options] filename ]... jpico [global-options] [ [local-options] filename ]... jupp32 [global-options] [ [local-options] filename ]... DESCRIPTION JOE is a powerful ASCII text screen editor. It has a "mode-less" user interface which is similar to many user- friendly PC editors. Users of Micro-Pro's WordStar or Borland's "Turbo" languages will feel at home. JOE is a full featured UNIX screen editor though, and has many features for editing programs and text. JOE also emulates several other editors. JSTAR is a close imitation of WordStar with many "JOE" extensions. JPICO is a close imitation of the Pine mailing system's PICO editor, but with many extensions and improvements. JMACS is a GNU EMACS imitation. RJOE is a restricted version of JOE, which allows you to edit only the files specified on the command line. Although JOE is actually six different editors, it still requires only one executable, but one with six different names. The name of the editor with an "rc" appended gives the name of JOE's initialisation file, which determines the personality of the editor. JUPP is free software; you can distribute it and/or modify it under the terms of the GNU General Public License, Ver- sion 1, as published by the Free Software Foundation. See main.c (contains more detailed exceptions). I have no plans for turning JOE into a commercial or shareware product. Check the source code for exact authorship and licencing information. JOE is available over the Internet from http://joe-editor.sf.net/. JUPP is available at http://mirbsd.de/jupp. USAGE To start the editor, type joe followed by zero or more names of files you want to edit. Each file name may be preceded by a local option setting (see the local options table which follows). Other global options, which apply to the editor as a whole, may also be placed on the command line (see the global options table which follows). If you are editing a new file, you can either give the name of the new file when you invoke the editor, or in the editor when you save the new file. A modified syntax for file names is provided to allow you to edit program output, standard input/output, or sections of files or devices. See the section Filenames below for details. On cygwin32 systems, the special option -CYGhack is replaced by anything that comes past it (and separating whitespace) on the command line as one option (to work around a Cygwin bug as it cannot correctly be passed a UNC pathname with spaces as one argument from Explorer at all). Once you are in the editor, you can type in text and use special control character sequences to perform other editing tasks. To find out what the control character sequences are, read the rest of this man page or type ^K H for help in the editor. Now for some obscure computer lore: The ^ means that you hold down the Control key while press- ing the following key (the same way the Shift key works for uppercase letters). A number of control key sequences are duplicated on other keys, so that you don't need to press the control key: ESC will work in place of ^[, Del will work in place of ^?, Backspace will work in place of ^H, Tab will work in place of ^I, Return or Enter will work in place of ^M and Linefeed will work in place of ^J. Some keyboards may give you trouble with some control keys. ^_, ^^ and ^@ can usually be entered without pressing shift (I.E., try ^-, ^6 and ^2). Other keyboards may reassign these to other keys. Try: ^., ^, and ^/. ^SPACE can usually be used in place of ^@. ^\ and ^] are interpreted by many communica- tion programs, including telnet and kermit. Usually you just hit the key twice to get it to pass through the commun- ication program. Once you have typed ^K H, the first help window appears at the top of the screen. You can continue to enter and edit text while the help window is on. To page through other topics, hit ^[, and ^[. (that is, ESC , and ESC .). Use ^K H to dismiss the help window. You can customise the keyboard layout, the help screens and a number of behavior defaults by copying JOE's initialisa- tion file (joerc in the same directory as the binary resides in) to .joerc in your home directory and then by modifying it. See the section joerc below. The filename is actually .namerc where name is the argv[0] the editor is called with. Custom syntax files are loaded from .jupp/syntax/name.jsf in your home directory and .jupp/charmaps/name holds custom charmaps (name here is the name of the syntax or charmap). To have JOE used as your default editor for eMail and News, you need to set the EDITOR and VISUAL environment variables in your shell initialisation file (.cshrc or .profile) to refer to JOE (the joe binary usually resides as C:\Programme\jupp32\joe.exe). There are a number of other obscure invocation parameters which may have to be set, particularly if your terminal screen is not updating as you think it should. See the sec- tion Environment variables below. COMMAND LINE OPTIONS The following global options may be specified on the command line: -asis Characters with codes above 127 will be sent to the terminal as-is, instead of as inverse of the corresponding character below 128. If this does not work, check your terminal server. -backpath path If this option is given, backup files will be stored in the specified directory instead of in each file's ori- ginal directory. -baud nnn Set the baud rate for the purposes of terminal screen optimisation. Joe inserts delays for baud rates below 19200, which bypasses tty buffering so that typeahead will interrupt the screen output. Scrolling commands will not be used for 38400 baud. This is useful for X-Window terminals and other console ttys which really aren't going over a serial line. -beep Joe will beep on command errors and when the cursor goes past extremes. -columns nnn Sets the number of screen columns. -csmode Continued search mode: a search immediately following a search will repeat the previous search instead of prompting for new string. This is useful for the the ^[S and ^[R commands and for when joe is trying to be emacs. -dopadding Joe usually assumes that there is some kind of flow control between it and the tty. If there isn't, this option will make joe output extra ^@s to the tty as specified by the termcap entry. The extra ^@s allow the terminal to catch up after long terminal commands. -exask This option makes ^KX verify the file name that it's about to write. -force This option makes sure that the last line of the file has a line feed when it is saved. -help The editor will start with the help screen on if this option is given. -keepup Normally the column number and control-key prefix fields of the status lines are on a one second delay to reduce CPU consumption, but with this option they are updated after each keystroke. -lightoff The block highlighting will go away after any block command if this option is given. -lines nnn Sets the number of screen lines. -marking Text between ^KB and the cursor is highlighted (use with -lightoff and a modified joerc file to have drop- anchor style block selection). -mid If this option is set and the cursor moves off the win- dow, the window will be scrolled so that the cursor is in the center. This option is forced on slow terminals which don't have scrolling commands. -nobackups This option prevents backup files. -nonotice This option prevent the copyright notice from being displayed when the editor starts. -nosta This option eliminates the topmost status line. It's nice for when you only want to see your text on the screen or if you're using a vt52. -noxon Attempt to turn off ^S/^Q processing. This is useful for when joe is trying to be WordStar or EMACS. -orphan When this option is active, extra files on the command line will be placed in orphaned buffers instead of in extra windows. This is useful for when joe is trying to be emacs. -pg nnn This specifies the number of lines to keep after PgUp/PgDn (^U/^V). If -1 is given, half the window is kept. -skiptop nnn Don't use the top nnn lines of the screen. Useful for when joe is used as a BBS editor. Each of these options may be specified in the joerc file as well. In addition, the NOXON, BAUD, LINES, COLUMNS and DOPADDING options may be specified with environment vari- ables. See the section Environment variables below. The following options may be specified before each filename on the command line: +nnn The cursor starts on the specified line. -crlf Joe uses CR-LF as the end of line sequence instead of just LF. This is for editing MS-DOS or VMS files. -hex Sets the buffer to hex edit mode. -wordwrap Joe wraps the previous word when you type past the right margin. -autoindent When you hit Return on an indented line, the indenta- tion is duplicated onto the new line. -overwrite Typing overwrites existing characters instead of inserting before them. -lmargin nnn Sets the left margin. -rmargin nnn Sets the right margin. -tab nnn Sets the tab width. -indentc nnn Sets the indentation character for ^K, and ^K. (32 for SPACE, 9 for TAB). -istep nnn Sets the indentation step for ^K, and ^K.. -linums Line numbers are displayed before each line. -rdonly The file is read only. -keymap name Use an alternate section of the joerc file for the key sequence bindings. For example, joe, jstar, rjoe and jupp support -keymap cua to make ^Z, ^X, ^C and ^V do the same thing as in contemporary GUI editors. These options can also be specified in the joerc file. They can be set depending on the filename extension. Programs (.c, .h or .p extension) usually have autoindent enabled. Wordwrap is enabled on other files, but rc files have it disabled. EDITING TASKS Basic Editing When you type characters into the editor, they are normally inserted into the file being edited (or appended to the file if the cursor is at the end of the file). This is the nor- mal operating mode of the editor. If you want to replace some existing text, you have to delete the old text before or after you type in the replacement text. The Backspace key can be used for deleting text: move the cursor to right after the text you want to delete and hit Backspace a number of times. Hit the Enter or Return key to insert a line break. For example, if the cursor was in the middle of a line and you hit Return, the line would be split into two lines with the cursor appearing at the beginning of the second line. Hit Backspace at the beginning of a line to eliminate a line break. Use the arrow keys to move around the file. If your key- board doesn't have arrow keys (or if they don't work for some reason), use ^F to move forwards (right), ^B to move backwards (left), ^P to move to the previous line (up), and ^N to move to the next line (down). The right and left arrow keys simply move forwards or backwards one character at a time through the text: if you're at the beginning of a line and you press left-arrow, you will end up at the end of the previous line. The up and down arrow keys move forwards and backwards by enough characters so that the cursor appears in the same column that it was in on the original line. If you want to indent the text you enter, you can use the TAB key. This inserts a special control character which makes the characters which follow it begin at the next TAB STOP. TAB STOPS normally occur every 8 columns, but this can be changed with the ^T D command. Python programmers often set TAB STOPS on every 4 columns. If for some reason your terminal screen gets messed up (for example, if you receive a mail notice from biff), you can have the editor refresh the screen by hitting ^R. There are many other keys for deleting text and moving around the file. For example, hit ^D to delete the charac- ter the cursor is on instead of deleting backwards like Backspace. ^D will also delete a line break if the cursor is at the end of a line. Type ^Y to delete the entire line the cursor is on or ^J to delete just from the cursor to the end of the line. Hit ^A to move the cursor to the beginning of the line it's on. Hit ^E to move the cursor to the end of the line. Hit ^U or ^V for scrolling the cursor up or down 1/2 a screen's worth. "Scrolling" means that the text on the screen moves, but the cursor stays at the same place relative to the screen. Hit ^K U or ^K V to move the cursor to the begin- ning or the end of the file. Look at the help screens in the editor to find even more delete and movement commands. If you make a mistake, you can hit ^_ to "undo" it. On most keyboards you hit just ^- to get ^_, but on some you might have to hold both the Shift and Control keys down at the same time to get it. If you "undo" too much, you can "redo" the changes back into existence by hitting ^^ (type this with just ^6 on most keyboards). If you were editing in one place within the file, and you then temporarily had to look or edit some other place within the file, you can get back to the original place by hitting ^K-. This command actually returns you to the last place you made a change in the file. You can step through a his- tory of places with ^K- and ^K =, in the same way you can step through the history of changes with the "undo" and "redo" commands. When you are done editing the file, hit ^K X to exit the editor. You will be prompted for a file name if you hadn't already named the file you were editing. When you edit a file, you actually edit only a copy of the file. So if you decide that you don't want the changes you made to a file during a particular edit session, you can hit ^C to exit the editor without saving them. If you edit a file and save the changes, a "backup" copy of that file is created in the current directory, with a ~ appended to the name, which contains the original version of the file. Word wrap and formatting If you type past the right edge of the screen in a C language or PASCAL file, the screen will scroll to the right to follow the cursor. If you type past the right edge of the screen in a normal file (one whose name doesn't end in .c, .h or .p), JOE will automatically wrap the last word onto the next line so that you don't have to hit Return. This is called word-wrap mode. Word-wrap can be turned on or off with the ^T W command. JOE's initialisation file is usually set up so that this mode is automatically turned on for all non-program files. See the section below on the joerc file to change this and other defaults. Aside for Word-wrap mode, JOE does not automatically keep paragraphs formatted like some word processors. Instead, if you need a paragraph to be reformatted, hit ^K J. This com- mand "fills in" the paragraph that the cursor is in, fitting as many words in a line as is possible. A paragraph, in this case, is a block of text separated above and below by a blank line or a line beginning with a period ("."). Lines can be indented by tab, any of the !#$%&)*+,-./:;=>?@\]^_|}~ characters or spaces. The margins which JOE uses for paragraph formatting and word-wrap can be set with the ^T L and ^T R commands. If the left margin is set to a value other than 1, then when you start typing at the beginning of a line, the cursor will immediately jump to the left margin. If you want to center a line within the margins, use the ^K A command. Overtype mode Sometimes it's tiresome to have to delete old text before or after you insert new text. This happens, for example, when you are changing a table and you want to maintain the column position of the right side of the table. When this occurs, you can put the editor in overtype mode with ^T T. When the editor is in this mode, the characters you type in replace existing characters, in the way an idealised typewriter would. Additionally, Backspace simply moves left instead of deleting the character to the left, when it's not at the end or beginning of a line. Overtype mode is not the natural way of dealing with text electronically, so you should go back to insert mode as soon as possible by typing ^T T again. If you need to insert while you're in overtype mode, hit ^@. This inserts a single SPACE into the text. Control and Meta characters Each character is represented by a number. For example, the number for 'A' is 65 and the number for '1' is 49. All of the characters which you normally see have numbers in the range of 32 to 126 (this particular arbitrary assignment between characters and numbers is called the ASCII character set). The numbers outside of this range, from 0 to 255, aren't usually displayed, but sometimes have other special meanings. The number 10, for example, is used for the line breaks. You can enter these special, non-displayed control characters by first hitting ` and then hitting a character in the range @ A B C ... X Y Z [ ^ ] \ _ to get the number 0 to 31, and ? to get 127. For example, if you hit ` J, you'll insert a line break character, or if you hit ` I, you'll insert a TAB character (which does the same thing the TAB key does). A useful control character to enter is 12 (` L), which causes most printers to advance to the top of the page. You'll notice that JOE displays this character as an underlined L. You can enter the characters above 127, the meta characters, by first hitting ^\. This adds 128 to the next (possibly control) character entered. JOE displays characters above 128 in inverse video. Some foreign languages, which have more letters than English, use the meta characters for the rest of their alphabet. You have to put the editor in as-is mode (described later) to have these passed untranslated to the terminal. Prompts If you hit TAB at any file name prompt, joe will attempt to complete the name you entered as much as possible. If it couldn't complete the entire name, because there are more than one possible completions, joe beeps. If you hit TAB again, joe list the completions. You can use the arrow keys to move around this directory menu and press RETURN or SPACE to select an item. If you press the first letter of one of the directory entries, it will be selected, or if more than one entry has the same first letter, the cursor will jump between those entries. If you select a subdirectory or .., the directory name is appended to the prompt and the new directory is loaded into the menu. You can hit Backspace to go back to the previous directory. Most prompts record a history of the responses you give them. You can hit up and down arrow to step through these histories. Prompts are actually single line windows with no status line, so you can use any editing command that you normally use on text within the prompts. The prompt history is actu- ally just other lines of the same "prompt file". Thus you can can search backwards though the prompt history with the normal ^K F command if you want. Since prompts are windows, you can also switch out of them with ^K P and ^K N. Where am I? Hit ^K SPACE to have JOE report the line number, column number, and byte number on the last line of the screen. The number associated with the character the cursor is on (its ASCII code) is also shown. You can have the line number and/or column number always displayed on the status line by setting placing the appropriate escape sequences in the status line setup strings. Edit the joerc file for details. File operations You can hit ^K D to save the current file (possibly under a different name from what the file was called originally). After the file is saved, you can hit ^K E to edit a dif- ferent file. If you want to save only a selected section of the file, see the section on Blocks below. If you want to include another file in the file you're edit- ing, use ^K R to insert it. Temporarily suspending the editor If you need to temporarily stop the editor and go back to the shell, hit ^K Z. You might want to do this to stop whatever you're editing and answer an eMail message or read this man page, for example. You have to type fg or exit (you'll be told which when you hit ^K Z) to return to the editor. Searching for text Hit ^K F to have the editor search forwards or backwards for a text fragment (string) for you. You will be prompted for the text to search for. After you hit Return, you are prompted to enter options. You can just hit Return again to have the editor immediately search forwards for the text, or you can enter one or more of these options: b Search backwards instead of forwards. i Treat uppercase and lower case letters as the same when searching. Normally uppercase and lowercase letters are considered to be different. nnn (where nnn is a number) If you enter a number, JOE searches for the Nth occurrence of the text. This is useful for going to specific places in files structured in some regular manner. r Replace text. If you enter the r option, then you will be further prompted for replacement text. Each time the editor finds the search text, you will be prompted as to whether you want to replace the found search text with the replacement text. You hit: y to replace the text and then find the next occurrence, n to not replace this text, but to then find the next occurrence, l to replace the text and then stop search- ing, r to replace all of the remaining occurrences of the search text in the remainder of the file without asking for confirmation (subject to the nnn option above), or ^C to stop searching and replacing. You can hit ^L to repeat the previous search. Regular Expressions A number of special character sequences may be entered as search text: \* This finds zero or more characters. For example, if you give A\*B as the search text, JOE will try to find an A followed by any number of characters and then a B. \? This finds exactly one character. For example, if you give A\?B as the search text, JOE will find AXB, but not AB or AXXB. \^ \$ These match the beginning and end of a line. For exam- ple, if you give \^test\$, then JOE with find test on a line by itself. \< \> These match the beginning and end of a word. For exam- ple, if you give \<\*is\*\>, then joe will find whole words which have the substring is within them. \[...] This matches any single character which appears within the brackets. For example, if \[Tt]his is entered as the search string, then JOE finds both This and this. Ranges of characters can be entered within the brack- ets. For example, \[A-Z] finds any uppercase letter. If the first character given in the brackets is ^, then JOE tries to find any character not given in the the brackets. \c This works like \*, but matches a balanced C-language expression. For example, if you search for malloc(\c), then JOE will find all function calls to malloc, even if there was a ) within the parenthesis. \+ This finds zero or more of the character which immedi- ately follows the \+. For example, if you give \[ ]\+\[ ], where the characters within the brackets are both SPACE and TAB, then JOE will find whitespace. \\ Matches a single \. \n This finds the special end-of-line or line-break char- acter. A number of special character sequences may also be given in the replacement string: \& This gets replaced by the text which matched the search string. For example, if the search string was \<\*\>, which matches words, and you give "\&", then joe will put quote marks around words. \0 - \9 These get replaced with the text which matched the Nth \*, \?, \+, \c, \+, or \[...] in the search string. \\ Use this if you need to put a \ in the replacement string. \n Use this if you need to put a line break in the replacement string. Some examples: Suppose you have a list of addresses, each on a separate line, which starts with "Address:" and has each element separated by commas. Like so: Address: S. Holmes, 221b Baker St., London, England If you wanted to rearrange the list, to get the country first, then the city, then the person's name, and then the address, you could do this: Type ^K F to start the search, and type: Address:\*,\*,\*,\*\$ to match "Address:", the four comma-separated elements, and then the end of the line. When asked for options, you would type r to replace the string, and then type: Address:\3,\2,\0,\1 To shuffle the information the way you want it. After hitting return, the search would begin, and the sample line would be changed to: Address: England, London, S. Holmes, 221b Baker St. Blocks If you want to move, copy, save or delete a specific section of text, you can do it with highlighted blocks. First, move the cursor to the start of the section of text you want to work on, and press ^K B. Then move the cursor to the char- acter just after the end of the text you want to affect and press ^K K. The text between the ^K B and ^K K should become highlighted. Now you can move your cursor to some- place else in your document and press ^K M to move the highlighted text there. You can press ^K C to make a copy of the highlighted text and insert it to where the cursor is positioned. ^K Y to deletes the highlighted text. ^K W, writes the highlighted text to a file. A very useful command is ^K /, which filters a block of text through a unix command. For example, if you select a list of words with ^K B and ^K K, and then type ^K / sort, the list of words will be sorted. Another useful unix command for ^K /, is tr. If you type ^K / tr a-z A-Z, then all of the letters in the highlighted block will be converted to uppercase. After you are finished with some block operations, you can just leave the highlighting on if you don't mind it (of course, if you accidentally hit ^K Y without noticing...). If it really bothers you, however, just hit ^K B ^K K, to turn the highlighting off. Indenting program blocks Auto-indent mode toggled with the ^T I command. The joerc is normally set up so that files with names ending with .p, .c or .h have auto-indent mode enabled. When auto-indent mode is enabled and you hit Return, the cursor will be placed in the same column that the first non-SPACE/TAB char- acter was in on the original line. You can use the ^K , and ^K . commands to shift a block of text to the left or right. If no highlighting is set when you give these commands, the program block the cursor is located in will be selected, and will be moved by subsequent ^K , and ^K . commands. The number of columns these com- mands shift by can be set through a ^T option. Windows You can edit more than one file at the same time or edit two or more different places of the same file. To do this, hit ^K O, to split the screen into two windows. Use ^K P or ^K N to move the cursor into the top window or the lower win- dow. Use ^K E to edit a new file in one of the windows. A window will go away when you save the file with ^K X or abort the file with ^C. If you abort a file which exists in two windows, one of the window goes away, not the file. You can hit ^K O within a window to create even more win- dows. If you have too many windows on the screen, but you don't want to eliminate them, you can hit ^K I. This will show only the window the cursor is in, or if there was only one window on the screen to begin with, try to fit all hid- den windows on the screen. If there are more windows than can fit on the screen, you can hit ^K N on the bottom-most window or ^K P on the top-most window to get to them. If you gave more than one file name to JOE on the command line, each file will be placed in a different window. You can change the height of the windows with the ^K G and ^K T commands. Keyboard macros Macros allow you to record a series of keystrokes and replay them with the press of two keys. This is useful to automate repetitive tasks. To start a macro recording, hit ^K [ fol- lowed by a number from 0 to 9. The status line will display (Macro n recording...). Now, type in the series of keys- trokes that you want to be able to repeat. The commands you type will have their usual effect. Hit ^K ] to stop record- ing the macro. Hit ^K followed by the number you recorded the macro in to execute one iteration of the keystrokes. For example, if you want to put "**" in front of a number of lines, you can type: ^K [ ^A ** ^K ] Which starts the macro recording, moves the cursor to the beginning of the line, inserts "**", moves the cursor down one line, and then ends the recording. Since we included the keystrokes needed to position the cursor on the next line, we can repeatedly use this macro without having to move the cursor ourselves, something you should always keep in mind when recording a macro. If you find that the macro you are recording itself has a repeated set of keystrokes in it, you can record a macro within the macro, as long as you use a different macro number. Also you can execute previously recorded macros from within new macros. Repeat You can use the repeat command, ^K \, to repeat a macro, or any other edit command or even a normal character, a speci- fied number of times. Hit ^K \, type in the number of times you want the command repeated and press Return. The next edit command you now give will be repeated that many times. For example, to delete the next 20 lines of text, type: ^K 20^Y Rectangle mode Type ^T X to have ^K B and ^K K select rectangular blocks instead of stream-of-text blocks. This mode is useful for moving, copying, deleting or saving columns of text. You can also filter columns of text with the ^K / command - if you want to sort a column, for example. The insert file command, ^K R is also effected. When rectangle mode is selected, overtype mode (^T T) is also useful. When overtype mode is selected, rectangles will replace existing text instead of getting inserted before it. Also the delete block command (^K Y) will clear the selected rectangle with SPACEs and TABs instead of deleting it. Overtype mode is especially useful for the filter block command (^K /), since it will maintain the ori- ginal width of the selected column. Tag search If you are editing a large C program with many source files, you can use the ctags program to generate a tags file. This file contains a list of program symbols and the files and positions where the symbols are defined. The ^K ; command can be used to lookup a symbol (functions, defined con- stants, etc.), load the file where the symbol is defined into the current window and position the cursor to where the symbol is defined. ^K ; prompts you for the symbol you want, but uses the symbol the cursor was on as a default. Since ^K ; loads the definition file into the current win- dow, you probably want to split the window first with ^K O, to have both the original file and the definition file loaded. Shell windows Hit ^K ' to run a command shell in one of JOE's windows. When the cursor is at the end of a shell window (use ^K V if it's not), whatever you type is passed to the shell instead of the window. Any output from the shell or from commands executed in the shell is appended to the shell window (the cursor will follow this output if it's at the end of the shell window). This command is useful for recording the results of shell commands - for example the output of make, the result of grepping a set of files for a string, or directory listings from FTP sessions. Besides typeable characters, the keys ^C, Backspace, DEL, Return and ^D are passed to the shell. Type the shell exit command to stop recording shell output. If you press ^C in a shell window, when the cursor is not at the end of the window, the shell is killed. ENVIRONMENT VARIABLES For JOE to operate correctly, a number of other environment settings must be correct. The throughput (baud rate) of the connection between the computer and your terminal must be set correctly for JOE to update the screen smoothly and allow typeahead to defer the screen update. Use the stty nnn command to set this. You want to set it as close as possible to actual throughput of the connection. For exam- ple, if you are connected via a 1200 baud modem, you want to use this value for stty. If you are connected via 14.4k modem, but the terminal server you are connected to connects to the computer a 9600 baud, you want to set your speed as 9600 baud. The special baud rate of 38400 or extb is used to indicate that you have a very high-speed connection, such as a memory mapped console or an X-Window terminal emulator. If you can't use stty to set the actual throughput (perhaps because of a modem communicating with the computer at a dif- ferent rate than it's communicating over the phone line), you can put a numeric value in the BAUD environment variable instead (use setenv BAUD 9600 for csh or BAUD=9600; export BAUD for sh). The SHELL or EXECSHELL environment variable must be set to the full pathname of a shell executable that accepts the -i (interactive) and -c (run a command) arguments of the Korn Shell; otherwise, /bin/sh is used. The TERM environment variable must be set to the type of terminal you're using. If the size (number of lines/columns) of your terminal is different from what is reported in the TERMCAP or TERMINFO entry, you can set this with the stty rows nn cols nn command, or by setting the LINES and COLUMNS environment variables. The xterm-xfree86 terminal allows automatic entering and leaving of the bracketed paste mode. The JOETERM environment variable may be set to override the regular TERM environment variable for specifying your termi- nal type. JOE uses two character maps for its operation: the terminal I/O character map, which determines how characters are sent to the terminal and whether the %a/%A message specifiers use UCS, and the file encoding, which can be specified per file using the -encoding option and changed with the ^T E com- mand, and which defaults to the terminal I/O character map, which, in turn, is determined from the current locale, if the system supports such, otherwise the LC_ALL, LC_CTYPE and LANG environment variables (if they contain a period, only the part after it and before an optional "at sign" is used); on cygwin32 before 1.7.2, the codepage is used instead if the POSIX locale environment variables are empty; the environment variable JOECHARMAP can be used to manually force one overriding all methods described above, and can be used together with -encoding to specify a different default file character map. JOE normally expects that flow control between the computer and your terminal to use ^S/^Q handshaking (I.E., if the computer is sending characters too fast for your terminal, your terminal sends ^S to stop the output and ^Q to restart it). If the flow control uses out-of-band or hardware handshaking or if your terminal is fast enough to always keep up with the computer output and you wish to map ^S/^Q to edit commands, you can set the environment variable NOXON to have JOE attempt to turn off ^S/^Q handshaking. If the connection between the computer and your terminal uses no handshaking and your terminal is not fast enough to keep up with the output of the computer, you can set the environment variable DOPADDING to have JOE slow down the output by interspersing PAD characters between the terminal screen update sequences. FILENAMES Wherever JOE expects you to enter a file name, whether on the command line or in prompts within the editor, you may also type: !command Read or write data to or from a shell command. For example, use joe '!ls' to get a copy of your directory listing to edit or from within the editor use ^K D !mail jhallen@world.std.com to send the file being edited to me. >>filename Use this to have JOE append the edited text to the end of the file "filename." filename,START,SIZE Use this to access a fixed section of a file or device. START and SIZE may be entered in decimal (ex.: 123) octal (ex.: 0777) or hexadecimal (ex.: 0xFF). For example, use joe /dev/fd0,508,2 to edit bytes 508 and 509 of the first floppy drive in Linux. - Use this to get input from the standard input or to write output to the standard output. For example, you can put joe in a pipe of commands: quota -v | joe - | mail root, if you want to complain about your low quota. THE JOERC FILE ^T options, the help screens and the key-sequence to editor command bindings are all defined in JOE's initialisation file. If you make a copy of this file (which resides in the same directory as the binary) to $HOME/.joerc, you can cus- tomise these settings to your liking. The syntax of the initialisation file should be fairly obvious, and there are further instruction in it. ACKNOWLEDGMENTS JOE was written by Joseph H. Allen. If you have bug reports or questions, eMail them to jhallen@world.std.com. Larry Foard (entropy@world.std.com) and Gary Gray (ggray@world.std.com) also helped with the creation of JOE. Thorsten "mirabilos" Glaser (tg@mirbsd.org) created JUPP, and the 16-bit MS-DOS version of JUPP 2.8 was compiled by Andreas Totlis (atotlis@t-online.de). BUGS This manual page describes only the JOE flavour; documenta- tion for JUPP is especially missing. jupp/joerc.in010064400000000000000000000702141361505650400104260ustar00 $MirOS: contrib/code/jupp/joerc.in,v 1.37 2020/01/31 17:00:25 tg Exp $ Initialisation file for JOE Standard Joe This file must be written in the 8-bit encoding, not UTF-8. JOE looks for this file in: 1 - $HOME/.joerc 2 - @jrcbefore@joerc@jrcafter@ This file can include other files by placing the following include command in the first column (comment lines start with space or tab): :include filename FIRST SECTION: Default global options (these options can also be specified on the command line. Also, the NOXON, LINES, COLUMNS, DOPADDING and BAUD options can be specified in environment variables): Put each option you want set in the first column: -option Sets the option --option Clears the option -mid Cursor is recentred when scrolling is necessary -marking Text between ^KB and cursor is highlighted; use with: -lightoff Turn off highlighting after block copy or move -autoswap Swap markb with markk when necessary -asis Characters 128 - 255 shown as-is -hex Hex editing mode -nobackups If you don't want backup files to be created -backpath path Where to store backup files (do not quote, no comment after) -force Force final newline when files are saved -exask ^KX always confirms file name -beep Beep on errors and when cursor goes past extremes -nosta Disable top-most status line -keepup %k and %c status line escape sequences updated frequently -pg nnn No. lines to keep for PgUp/PgDn -csmode ^KF after a pervious search does a ^L instead -nonotice Disable copyright notice -noxon Attempt to turn off ^S/^Q processing -orphan Put extra files given on command line in orphaned buffers instead of in windows -dopadding Output pad characters (for when there is no tty handshaking) -lines nnn Set no. screen lines -baud nnn Set baud rate for terminal optimisations -columns nnn Set no. screen columns -help Start with help on -skiptop nnn Don't use top nnn lines of the screen -notite Don't send terminal initialisation and termination strings: prevents restoration of screen on exit -pastetite Enter bracketed paste mode automatically for TERM=xterm-xfree86 -usetabs Use tabs to help optimise screen update -assume_color Assume terminal has ANSI colour support even if its termcap or terminfo entry says that it doesn't. This only applies if the terminal otherwise looks like an ANSI terminal (supports bold and capability starts with ESC [). -guess_crlf Automatically detect MS-DOS files and set -crlf appropriately -guess_indent Guess indent character (tab or space) -menu_explorer Stay in menu system when a directory is selected (otherwise directory is added to path and menu is closed) -icase Search is case-insensitive by default -wrap Search wraps Status line definition strings. -lmsg defines the left-justified string, and -rmsg defines the right-justified string. The first character of -rmsg is the background fill character. -hmsg (3.1jupp15) defines the help hint (only about a dozen chars) displayed next to the copyright notice in the initial status line (inverted by default, unless starting with exactly \i). The following escape sequences can be used in these strings: %t 12-hour time %u 24-hour time %T O for overtype mode, I for insert mode %W W if wordwrap is enabled %I A if autoindent is enabled %X rectangle mode indicator %n file name %m '(Modified)' if file has been changed %* '*' if file has been changed %R read-only indicator %r row (line) number %c column number %o byte offset into file (decimal) %O byte offset into file in hex %a ASCII value of character under cursor (decimal) %A ASCII value of character under cursor in hex %p percent of file cursor is at %l number of lines in file %k entered prefix keys %S '*SHELL*' if there is a shell running in window %M macro recording message %y syntax %x context (first non-indented line going backwards) These formatting escape sequences may also be given: \i Inverse \u Underline \b Bold \d Dim \f Blink -lmsg \i%k%T%W%I%X %n %m%y%R %M %x -rmsg %S Row %r Col %c %t Ctrl-K H for help -hmsg \i\f\bHelp: ^KH\b\f SECOND SECTION: filename-dependent local option settings: Each line with '*' in the first column indicates the modes which should be set for files whose name matches the regular expression. If more than one regular expression matches the file name, then the last matching one is chosen. A file contents regular expression may also be specified on a separate line with '+regex'. If this regular expresssion is given, then both the file name regex and the file contents regex must match for the options to apply. Here is a list of modes which can be set: -keymap name Keymap to use if not 'main' -square Rectangular block mode -overwrite Overtype mode -picture Picture mode (cursor right can go past end of line) -linums Show line numbers in front of each line -rdonly File is read-only -crlf File uses CR-LF at end of lines -encoding utf8 File is UTF-8 encoded -syntax name Specify syntax (syntax file called 'name.jsf' will be loaded) -highlight Enable syntax highlighting -french One space after '.', '?' and '!' for wordwrap and paragraph reformat instead of two. JOE does not change the spacing you give, but sometimes it must put spacing in itself. This selects how much is inserted in those cases. -purify Fixup indentation if necessary for rindent, lindent and backs (for example if indentation uses a mix of tabs and spaces, and indentc is space, indentation will be converted to all spaces) -lmargin nnn Left margin -rmargin nnn Right margin -tab nnn Tab width -indentc nnn Indentation character (32 = space, 9 = tab) -istep nnn Amount of 'indentc's per indentation level -spaces Tab key inserts spaces instead of tabs -wordwrap Wordwrap -autoindent Auto indent -smartbacks Backspace key deletes 'istep' number of 'indentc's if cursor is at first non-space character -smarthome Home key first moves cursor to beginning of line, then if hit again, to first non-blank character -indentfirst Smart home goes to first non-blank character first, instead of to the beginning of the line first -lmsg Status line definition strings; -rmsg see previous section for more info -mnew macro Macro to execute when new files are loaded -mold macro Macro to execute when existing files are loaded -msnew macro Macro to execute when new files are saved -msold macro Macro to execute when existing files are saved Macros for the above options are in the same format as in the key binding section below but without the key name strings. Default local options: -highlight -french -indentc 9 -istep 1 -purify -smartbacks -tab 8 --wordwrap #HOOK#1 global/default flags === Generic files No '.' in filename? * Assume it's a text file and, except in jupp, we want wordwrap on. -wordwrap Filename with '.' is probably not a text file. *.* Binary file *.bin --crlf --guess_crlf -encoding ascii -hex === Patterns with multiple wildcards Order is latest match wins, so... */patch-* -highlight -syntax diff * +Only in[ ] -highlight -syntax diff * +Nur in[ ] -highlight -syntax diff * +\[1-9]\+\[0-9]\[cda] -highlight -syntax diff *.sh* -syntax sh *.ksh* -syntax sh *.mksh* -syntax sh *.bash* -syntax sh *tmp/mutt-* -wordwrap -syntax mail *tmp/pico.* -wordwrap -syntax mail */mail/* -syntax mail */patches/* -highlight -syntax diff === Assembly *.asm -syntax asm *.S -syntax asm *.s -syntax asm === C, C++, Objective-C *.C -syntax c *.c -syntax c *.cc -syntax c *.cpp -syntax c *.cxx -syntax c *.c++ -syntax c *.h -syntax c *.hh -syntax c *.hpp -syntax c *.h++ -syntax c *.m -syntax c *.nxc -syntax c === C Shell *.csh -syntax csh *.login -syntax csh *.logout -syntax csh *.tcsh -syntax csh *.tcshrc -syntax csh * +#!\+\[ ]\+\[/a-z0-9._-]/\+tcsh\> -syntax csh * +#!\+\[ ]\+\[/a-z0-9._-]/env\[ ]\+\[ ]\+tcsh\> -syntax csh === Diff *.diff -highlight -syntax diff *.patch -highlight -syntax diff *.rej -highlight -syntax diff *.debdiff -highlight -syntax diff * +---\[ ] -highlight -syntax diff * +***\[ ] -highlight -syntax diff * +Index: \*\n====================================================== -highlight -syntax diff * +Index: \*\ndiff\*\n--- \*\n+++\[ ] -highlight -syntax diff * +\[=?]\*\n--- \*\n+++\[ ] -highlight -syntax diff * +diff\*\n--- \*\n+++\[ ] -highlight -syntax diff * +diff --git\*\nindex\*\n--- \*\n+++\[ ] -highlight -syntax diff === eMail *.eml -syntax mail Not quite eMail but still RFC822 *.mht -syntax mail === FORTRAN *.f -syntax fortran *.for -syntax fortran *.FOR -syntax fortran *.f77 -syntax fortran *.F77 -syntax fortran *.f90 -syntax fortran *.F90 -syntax fortran === GNU autoconf *.ac -syntax conf *.am -syntax conf === HTML *.htm -encoding utf8 -syntax html *.html -encoding utf8 -syntax html * +<\[Hh]\[Tt]\[Mm]\[Ll]\> -encoding utf8 -syntax html * + -encoding utf8 -syntax html === Java *.java -encoding utf8 -syntax java === JOE Syntax File *.jsf -syntax conf === LISP *.lisp -syntax lisp *.lsp -syntax lisp *.el -syntax lisp === Make *akefile -syntax conf *AKEFILE -syntax conf === Mason *.mas -syntax mason === Pascal *.p -syntax pascal *.pas -syntax pascal === Perl *.pl -syntax perl *.pm -syntax perl * +#!\+\[ ]\+\[/a-z0-9._-]/perl -syntax perl * +#!\+\[ ]\+\[/a-z0-9._-]/env\[ ]\+\[ ]perl -syntax perl === PHP *.php -syntax php === Python *.py -encoding utf8 -syntax python -tab 4 -indentc 32 -istep 4 -spaces * +#!\+\[ ]\+\[/a-z0-9._-]/python -encoding utf8 -syntax python -tab 4 -indentc 32 -istep 4 -spaces * +#!\+\[ ]\+\[/a-z0-9._-]/env\[ ]\+\[ ]python -encoding utf8 -syntax python -tab 4 -indentc 32 -istep 4 -spaces === Bourne, Korn, POSIX Shell *profile -syntax sh * +:\[ \n] -syntax sh * +#!\+\[ ]\+\[/a-z0-9._-]/\+\[bda]sh\> -syntax sh * +#!\+\[ ]\+\[/a-z0-9._-]/env\[ ]\+\[ ]\+\[bda]sh\> -syntax sh * +#!\+\[ ]\+\[/a-z0-9._-]/\+\[a-z]ksh\+\[0-9._-]\> -syntax sh * +#!\+\[ ]\+\[/a-z0-9._-]/env\[ ]\+\[ ]\+\[a-z]ksh\+\[0-9._-]\> -syntax sh === TCL *.tcl -syntax tcl === TeX *.cls -syntax tex *.def -syntax tex *.dtx -syntax tex *.lco -syntax tex *.sty -syntax tex *.tex -syntax tex === Verilog *.v -syntax verilog -istep 2 *.vh -syntax verilog -istep 2 === VHDL *.vhd -syntax vhdl -istep 2 === XML *.xml -encoding utf8 -syntax xml *.xsl -encoding utf8 -syntax xml * +]?>\+\[ \n] -encoding utf8 -syntax html === Text (except in jupp) *.asc -wordwrap *.doc -wordwrap *.txt -wordwrap #HOOK#2 filename matching THIRD SECTION: Named help screens: Use \| to insert a spring: all springs in a given line are set to the same width such that the entire line exactly fits in the width of the screen (if it's not an exact multiple so that there are N spaces remaining, the rightmost N springs each get one extra space). Hint: if you want vertical alignment, each line should have the same number of springs. {Basic \i Help Screen \|turn off with ^KH more help with ESC . (^[.) \i \i \i\|\uCURSOR\u \|\uGO TO\u \|\uBLOCK\u \|\uDELETE\u \|\uMISC\u \|\uEXIT\u \|\i \i \i \i\|^B left ^F right \|^U prev. screen \|^KB begin \|^D char. \|^KJ reformat \|^KX save \|\i \i \i \i\|^P up ^N down \|^V next screen \|^KK end \|^Y line \|^T options \|^C abort \|\i \i \i \i\|^Z previous word \|^A beg. of line \|^KM move \|^W >word \|^R refresh \|^KZ shell \|\i \i \i \i\|^X next word \|^E end of line \|^KC copy \|^O word< \|^@ insert \|\uFILE\u \|\i \i \i \i\|\uSEARCH\u \|^KU top of file \|^KW file \|^J >line \|\uSPELL\u \|^KE edit \|\i \i \i \i\|^KF find text \|^KV end of file \|^KY delete \|^_ undo \|^[N word \|^KR insert\|\i \i \i \i\|^L find next \|^KL to line No. \|^K/ filter \|^^ redo \|^[L file \|^KD save \|\i \i } {Windows \i Help Screen \|turn off with ^KH prev. screen ^[, next screen ^[. \i \i \i\|^KO Split the window in half \|^KE Load file into window \|\i \i \i \i\|^KG Make current window bigger \|^KT Make current window smaller \|\i \i \i \i\|^KN Go to the window below \|^KP Go to the window above \|\i \i \i \i\|^C Eliminate the current window \|^KI Show all windows / Show one window\|\i \i } {Advanced \i Help Screen \|turn off with ^KH prev. screen ^[, next screen ^[. \i \i \i\|\uMACROS\u \|\uMISC\u \|\uSCROLL\u \|\uSHELL\u \|\uGOTO\u \|\uI-SEARCH\u \|\i \i \i \i\|^K[ 0-9 Record \|^K SPACE status \|^[W Up \|^K' Window \|^[B To ^KB \|^[R Backwards\|\i \i \i \i\|^K] Stop \|^K\\ Repeat \|^[Z Down \|^[! Command \|^[K To ^KK \|^[S Forwards \|\i \i \i \i\|^K 0-9 Play \|^[M Math \|^K< Left \|\uQUOTE\u \|\uDELETE\u \|\uBOOKMARKS\u \|\i \i \i \i\|^K? Query \|^KA Center line \|^K> Right \|` Ctrl- \|^[Y yank \|^[ 0-9 Goto \|\i \i \i \i\|^[D Dump \|^[H Message \| \|^\\ Meta- \|^[O line< \|^[^[ Set \|\i \i } {Programs \i Help Screen \|turn off with ^KH prev. screen ^[, next screen ^[. \i \i \i\|\uGOTO\u \|\uINDENT\u \|\uCOMPILING\u \|\i \i \i \i\|^G Matching ( [ { \|^K, less \|^[C Compile and parse errors \|\i \i \i \i\|^K- Previous place \|^K. more \|^[E Parse errors \|\i \i \i \i\|^K= Next place \| \|^[= To next error \|\i \i \i \i\|^K; Tags file search \| \|^[- To prev. error \|\i \i } {Search \i Help Screen \|turn off with ^KH prev. screen ^[, next screen ^[. \i \i \iSpecial search sequences: \|\i \i \i \i \\^ \\$ matches beg./end of line \\? match any single char \|\i \i \i \i \\< \\> matches beg./end of word \\* match 0 or more chars \|\i \i \i \i \\c matches balanced C expression \\\\ matches a \\ \|\i \i \i \i \\[..] matches one of a set \\n matches a newline \|\i \i \i \i \\+ matches 0 or more of the character which follows the \\+ \|\i \i \i \iSpecial replace sequences: \|\i \i \i \i \\& replaced with text which matched search string \|\i \i \i \i \\0 - 9 replaced with text which matched Nth \\*, \\?, \\c, \\+, or \\[..] \|\i \i \i \i \\\\ replaced with \\ \\n replaced with newline \|\i \i } {Names \i Help Screen \|turn off with ^KH prev. screen ^[, next screen ^[. \i \i \i Hit TAB at file name prompts to generate menu of file names \|\i \i \i \i Or use up/down keys to access history of previously entered names \|\i \i \i \i Special file names: \|\i \i \i \i !command Pipe in/out of a shell command \|\i \i \i \i >>filename Append to a file \|\i \i \i \i - Read/Write to/from standard I/O \|\i \i \i \i filename,START,SIZE Read/Write a part of a file/device \|\i \i \i \i Give START/SIZE in decimal (255), octal (0377) or hex (0xFF) \|\i \i } {Joe \i Help Screen \|turn off with ^KH prev. screen ^[, \i \i \i For bug reports and other information, refer to: \uhttp://mirbsd.de/jupp\u \|\i \i } #HOOK#3 additional help screens {CharTable \i Help Screen turn off with ^J prev. screen ^[, \uCharacter Map\u \i \i \i Dec Hex \u 0123 4567 89AB CDEF 0123 4567 89AB CDEF \u Hex Dec \i \i \i \i | | \i \i \i \i 0 00 | \u@ABC\u \uDEFG\u \uHIJK\u \uLMNO\u €‚ „…†‡ ‰Š‹ ŚŤŽŹ | 80 128 \i \i \i \i 16 10 | \uPQRS\u \uTUVW\u \uXYZ[\u \u\\]^_\u ‘’“ ”•–— ™š› śťžź | 90 144 \i \i \i \i 32 20 | !"# $%&' ()*+ ,-./  ˇ˘Ł ¤Ą¦§ ¨©Ş« ¬­®Ż | A0 160 \i \i \i \i 48 30 | 0123 4567 89:; <=>? °±˛ł ´µ¶· ¸ąş» Ľ˝ľż | B0 176 \i \i \i \i 64 40 | @ABC DEFG HIJK LMNO ŔÁÂĂ ÄĹĆÇ ČÉĘË ĚÍÎĎ | C0 192 \i \i \i \i 80 50 | PQRS TUVW XYZ[ \\]^_ ĐŃŇÓ ÔŐÖ× ŘŮÚŰ ÜÝŢß | D0 208 \i \i \i \i 96 60 | `abc defg hijk lmno ŕáâă äĺćç čéęë ěíîď | E0 224 \i \i \i \i 112 70 | pqrs tuvw xyz{ |}~ đńňó ôőö÷ řůúű üýţ˙ | F0 240 \i \i } {Paste \i \i \i \i \u\bPaste Mode\b\u turn off with \b^D\b or \b^[[201~\b \i \i } FOURTH SECTION: Key bindings: Section names you must provide: :main editing window :prompt prompt lines :query single-character query lines :querya singe-character query for quote :querysr search-and-replace single-character query Other sections may be given as well for organisation purposes or for use with the '-keymap' option. Use: :inherit name To copy the named section into the current one :delete key To delete a key sequence from the current section Keys: Use ^@ through ^_ and ^? for C0 control characters and DEL Use SP for space Use a TO b to generate a range of characters You can also use termcap string capability names. For example: .ku Up .kd Down .kl Left .kr Right .kh Home .kH End .kI Insert .kD Delete .kP PgUp .kN PgDn .k1 - .k9 F1 - F9 .k0 F0 or F10 .k; F10 Macros: Simple macros can be made by comma seperating two or more command names. For example: eof,bol ^T Z Goto beginning of last line Also quoted matter is typed in literally (backslashes escape): bol,">",dnarw .k1 Quote news article line Macros may cross lines if they end with a comma. Commands or named macros may be created with :def. For example, you can use... :def foo eof,bol ... to define a command foo which will go to the beginning of the last line. :windows Bindings common to all windows #HOOK#4 common keybindings type ^@ TO ˙ abort ^C Abort window abort ^K Q abort ^K ^Q abort ^K q arg ^K \ Repeat next command explode ^K I Show all windows or show only one window explode ^K ^I explode ^K i help .k1 help ^K H Help menu help ^K ^H help ^K h help ^[ [ 1 1 ~ hnext ^[ . Next help window hprev ^[ , Previous help window math ^[ m Calculator math ^[ M Calculator math ^[ ^M Calculator msg ^[ h Display a message msg ^[ H Display a message msg ^[ ^H Display a message nextw ^K N Goto next window nextw ^K ^N nextw ^K n pgdn .kN Screen down pgdn ^V pgdn ^[ [ 6 ~ pgdn ^[ [ G SCO pgup .kP Screen up pgup ^U pgup ^[ [ 5 ~ pgup ^[ [ I SCO play ^K 0 TO 9 Execute macro prevw ^K P Goto previous window prevw ^K ^P prevw ^K p query ^K ? Macro query insert record ^K [ Record a macro retype ^R Refresh screen rtn ^M Return shell ^K Z Shell escape shell ^K ^Z shell ^K z stop ^K ] Stop recording :Paste type ^@ TO ˙ rtn ^M msg,"Entered bracketed paste mode",rtn ^[ [ 2 0 0 ~ helpcard,rtn,keymap,"main",rtn,msg,rtn ^[ [ 2 0 1 ~ helpcard,rtn,keymap,"main",rtn ^D :Pastecua type ^@ TO ˙ rtn ^M msg,"Entered bracketed paste mode",rtn ^[ [ 2 0 0 ~ helpcard,rtn,keymap,"cua",rtn,msg,rtn ^[ [ 2 0 1 ~ helpcard,rtn,keymap,"cua",rtn ^D :Pasteprompt type ^@ TO ˙ nop ^L keymap,"prompt",rtn,msg,rtn,rtn ^M msg,"Entered bracketed paste mode",rtn ^[ [ 2 0 0 ~ keymap,"prompt",rtn,msg,rtn ^[ [ 2 0 1 ~ keymap,"prompt",rtn ^D :main Text editing window :inherit windows compile :def compile switch,"*Build-Log*",rtn,markb,eof," ",markk,blkdel,filt,query,parserr :def compile querysave,query,scratch,"* Build Log *",rtn,bof,markb,eof," ",markk,blkdel,build spell check :def aspellfile filt,"SPLTMP=ispell.tmp;cat >$SPLTMP;aspell -x -c $SPLTMP /dev/tty;cat $SPLTMP;/bin/rm $SPLTMP",rtn,retype :def aspellword psh,nextword,markk,prevword,markb,filt,"SPLTMP=ispell.tmp;cat >$SPLTMP;aspell -x -c $SPLTMP /dev/tty;tr -d <$SPLTMP '\\012';/bin/rm $SPLTMP",rtn,retype,nextword :def ispellfile filt,"cat >ispell.tmp;ispell ispell.tmp /dev/tty;cat ispell.tmp;/bin/rm ispell.tmp",rtn,retype :def ispellword psh,nextword,markk,prevword,markb,filt,"cat >ispell.tmp;ispell ispell.tmp /dev/tty;tr -d Pop ^KB ^KK psh ^[ < Push ^KB ^KK swap ^[ x Swap ^KB and cursor tomarkbk ^[ g Switch between beginning and end of marked tos ^[ e Top of screen tw0 ^[ 0 Kill current window (orphans buffer) tw1 ^[ 1 Kill all other windows (orphans buffers) uarg ^[ u Universal argument yank ^[ ^Y Undelete previous text yapp ^[ w Append next delete to previous yank Standard Joe user interface quote8 ^\ Enter Meta chars quote ` Enter Ctrl chars backs ^? Backspace backs ^H backw ^O Backspace word bknd ^K ' Shell window blkcpy ^K C Copy marked block blkcpy ^K ^C blkcpy ^K c blkdel ^K Y Delete marked block blkdel ^K ^Y blkdel ^K y blkmove ^K M Move marked block blkmove ^K ^M blkmove ^K m blksave ^K W Save marked block blksave ^K ^W blksave ^K w bof ^K U Goto beginning of file bof ^K ^U bof ^K u bof ^[ [ 1 ; 5 H home ^A Goto beginning of line home .kh home ^[ [ 1 ~ home ^[ [ 7 ~ home ^[ [ H center ^K A Center line center ^K ^A center ^K a crawll ^K < Pan left crawlr ^K > Pan right delch .kD Delete character delch ^D delch ^[ [ 3 ~ deleol ^J Delete to end of line dellin ^Y Delete entire line delw ^W Delete word to right dnarw .kd Go down dnarw ^N dnarw ^[ O B dnarw ^[ [ B edit ^K E Edit a file edit ^K ^E edit ^K e eof ^K V Go to end of file eof ^K ^V eof ^K v eof ^[ [ 1 ; 5 F eol .@7 eol .kH Go to end of line eol ^E eol ^[ [ 4 ~ eol ^[ [ 8 ~ eol ^[ [ F exsave ^K X Save and exit exsave ^K ^X exsave ^K x ffirst ^K F Find first ffirst ^K ^F ffirst ^K f filt ^K / Filter block finish ^K ^M Complete text under cursor fnext ^L Find next fnext .k3 fnext ^[ [ 1 3 ~ fmtblk ^K J Format paragraphs in block fmtblk ^K ^J fmtblk ^K j gomark ^[ 0 TO 9 Goto bookmark groww ^K G Grow window groww ^K ^G groww ^K g insc .kI Insert a space insc ^[ [ 2 ~ insc ^[ [ L SCO insf ^K R Insert a file insf ^K ^R insf ^K r lindent ^K , Indent to left line ^K L Goto line number line ^K ^L line ^K l ltarw .kl Go left ltarw ^B ltarw ^[ O D ltarw ^[ [ D macros ^[ d Dump keyboard macros macros ^[ ^D markb ^K B Set beginning of marked block markb ^K ^B markb ^K b markk ^K K Set end of marked block markk ^K ^K markk ^K k mode ^T Options menu nextpos ^K = Goto next position in position history nextword ^X Goto next word nextword ^[ [ 1 ; 5 C open ^] Split line prevpos ^K - Previous position in history prevword ^Z Previous word prevword ^[ [ 1 ; 5 D redo ^^ Redo changes rindent ^K . Indent to right rtarw .kr Go right rtarw ^F rtarw ^[ O C rtarw ^[ [ C run ^K ! Run a shell command save ^K D Save file save ^K S save ^K ^D save ^K ^S save ^K d save ^K s setmark ^[ ^[ Set bookmark shrinkw ^K T Shrink window shrinkw ^K ^T shrinkw ^K t splitw ^K O Split window splitw ^K ^O splitw ^K o stat ^K SP Show status tag ^K ; Tags file search tomatch ^G Goto matching parenthasis undo ^_ Undo changes uparw .ku Go up uparw ^P uparw ^[ O A uparw ^[ [ A :prompt Prompt windows :inherit main complete ^I nop ^L keymap,"Pasteprompt",rtn,msg,"Entered bracketed paste mode",rtn ^[ P keymap,"Pasteprompt",rtn,msg,"Entered bracketed paste mode",rtn ^[ p keymap,"Pasteprompt",rtn,msg,"Entered bracketed paste mode",rtn ^[ [ 2 0 0 ~ :menu Selection menus :inherit windows abort ^[ ^[ backsmenu ^? backsmenu ^H bofmenu ^K U bofmenu ^K ^U bofmenu ^K u bofmenu ^[ [ 1 ; 5 H bolmenu ^A bolmenu .kh bolmenu ^[ [ 1 ~ bolmenu ^[ [ 7 ~ bolmenu ^[ [ H dnarwmenu .kd dnarwmenu ^N dnarwmenu ^[ [ B dnarwmenu ^[ O B eofmenu ^K V eofmenu ^K ^V eofmenu ^K v eofmenu ^[ [ 1 ; 5 F eolmenu .@7 eolmenu .kH eolmenu ^E eolmenu ^[ [ 4 ~ eolmenu ^[ [ 8 ~ eolmenu ^[ [ F ltarwmenu .kl ltarwmenu ^B ltarwmenu ^[ [ D ltarwmenu ^[ O D pgdnmenu .kN pgdnmenu ^V pgdnmenu ^[ [ 6 ~ pgdnmenu ^[ [ G pgupmenu .kP pgupmenu ^U pgupmenu ^[ [ 5 ~ pgupmenu ^[ [ I rtarwmenu .kr rtarwmenu ^F rtarwmenu ^[ [ C rtarwmenu ^[ O C rtn SP rtn ^I rtn ^K H rtn ^K h rtn ^K ^H tabmenu ^I uparwmenu .ku uparwmenu ^P uparwmenu ^[ [ A uparwmenu ^[ O A :query Single-key query window :inherit windows :querya Single-key query window for quoting type ^@ TO ˙ :querysr Search & replace query window type ^@ TO ˙ :cua Undo/Cut/Copy/Paste, CUA style :inherit main #HOOK#6 extra keybindings in CUA mode :def pastecua helpcard,"Paste",rtn,keymap,"Pastecua",rtn undo ^Z blkdel,nmark ^X copy ^C yank ^V pastecua ^[ P pastecua ^[ p pastecua ^[ [ 2 0 0 ~ jupp/jpicorc.in010064400000000000000000000571651361505650400107670ustar00 $MirOS: contrib/code/jupp/jpicorc.in,v 1.37 2020/01/31 17:00:25 tg Exp $ Initialisation file for JOE Super Pico This file must be written in the 8-bit encoding, not UTF-8. JOE looks for this file in: 1 - $HOME/.jpicorc 2 - @jrcbefore@jpicorc@jrcafter@ This file can include other files by placing the following include command in the first column (comment lines start with space or tab): :include filename FIRST SECTION: Default global options (these options can also be specified on the command line. Also, the NOXON, LINES, COLUMNS, DOPADDING and BAUD options can be specified in environment variables): Put each option you want set in the first column: -option Sets the option --option Clears the option -mid Cursor is recentred when scrolling is necessary -marking Text between ^KB and cursor is highlighted; use with: -lightoff Turn off highlighting after block copy or move -autoswap Swap markb with markk when necessary -asis Characters 128 - 255 shown as-is -hex Hex editing mode -nobackups If you don't want backup files to be created -backpath path Where to store backup files (do not quote, no comment after) -force Force final newline when files are saved -exask ^KX always confirms file name -beep Beep on errors and when cursor goes past extremes -nosta Disable top-most status line -keepup %k and %c status line escape sequences updated frequently -pg nnn No. lines to keep for PgUp/PgDn -csmode ^KF after a pervious search does a ^L instead -nonotice Disable copyright notice -noxon Attempt to turn off ^S/^Q processing -orphan Put extra files given on command line in orphaned buffers instead of in windows -dopadding Output pad characters (for when there is no tty handshaking) -lines nnn Set no. screen lines -baud nnn Set baud rate for terminal optimisations -columns nnn Set no. screen columns -help Start with help on -skiptop nnn Don't use top nnn lines of the screen -notite Don't send terminal initialisation and termination strings: prevents restoration of screen on exit -pastetite Enter bracketed paste mode automatically for TERM=xterm-xfree86 -usetabs Use tabs to help optimise screen update -assume_color Assume terminal has ANSI colour support even if its termcap or terminfo entry says that it doesn't. This only applies if the terminal otherwise looks like an ANSI terminal (supports bold and capability starts with ESC [). -guess_crlf Automatically detect MS-DOS files and set -crlf appropriately -guess_indent Guess indent character (tab or space) -menu_explorer Stay in menu system when a directory is selected (otherwise directory is added to path and menu is closed) -icase Search is case-insensitive by default -wrap Search wraps Status line definition strings. -lmsg defines the left-justified string, and -rmsg defines the right-justified string. The first character of -rmsg is the background fill character. -hmsg (3.1jupp15) defines the help hint (only about a dozen chars) displayed next to the copyright notice in the initial status line (inverted by default, unless starting with exactly \i). The following escape sequences can be used in these strings: %t 12-hour time %u 24-hour time %T O for overtype mode, I for insert mode %W W if wordwrap is enabled %I A if autoindent is enabled %X rectangle mode indicator %n file name %m '(Modified)' if file has been changed %* '*' if file has been changed %R read-only indicator %r row (line) number %c column number %o byte offset into file (decimal) %O byte offset into file in hex %a ASCII value of character under cursor (decimal) %A ASCII value of character under cursor in hex %p percent of file cursor is at %l number of lines in file %k entered prefix keys %S '*SHELL*' if there is a shell running in window %M macro recording message %y syntax %x context (first non-indented line going backwards) These formatting escape sequences may also be given: \i Inverse \u Underline \b Bold \d Dim \f Blink -lmsg \i%k%T%W%I%X %n %m%y%R %M -rmsg %S Row %r Col %c %t Ctrl-G for help -hmsg \i\f\bHelp: ^G\b\f SECOND SECTION: filename-dependent local option settings: Each line with '*' in the first column indicates the modes which should be set for files whose name matches the regular expression. If more than one regular expression matches the file name, then the last matching one is chosen. A file contents regular expression may also be specified on a separate line with '+regex'. If this regular expresssion is given, then both the file name regex and the file contents regex must match for the options to apply. Here is a list of modes which can be set: -keymap name Keymap to use if not 'main' -square Rectangular block mode -overwrite Overtype mode -picture Picture mode (cursor right can go past end of line) -linums Show line numbers in front of each line -rdonly File is read-only -crlf File uses CR-LF at end of lines -encoding utf8 File is UTF-8 encoded -syntax name Specify syntax (syntax file called 'name.jsf' will be loaded) -highlight Enable syntax highlighting -french One space after '.', '?' and '!' for wordwrap and paragraph reformat instead of two. JOE does not change the spacing you give, but sometimes it must put spacing in itself. This selects how much is inserted in those cases. -purify Fixup indentation if necessary for rindent, lindent and backs (for example if indentation uses a mix of tabs and spaces, and indentc is space, indentation will be converted to all spaces) -lmargin nnn Left margin -rmargin nnn Right margin -tab nnn Tab width -indentc nnn Indentation character (32 = space, 9 = tab) -istep nnn Amount of 'indentc's per indentation level -spaces Tab key inserts spaces instead of tabs -wordwrap Wordwrap -autoindent Auto indent -smartbacks Backspace key deletes 'istep' number of 'indentc's if cursor is at first non-space character -smarthome Home key first moves cursor to beginning of line, then if hit again, to first non-blank character -indentfirst Smart home goes to first non-blank character first, instead of to the beginning of the line first -lmsg Status line definition strings; -rmsg see previous section for more info -mnew macro Macro to execute when new files are loaded -mold macro Macro to execute when existing files are loaded -msnew macro Macro to execute when new files are saved -msold macro Macro to execute when existing files are saved Macros for the above options are in the same format as in the key binding section below but without the key name strings. Default local options: -highlight -french -indentc 9 -istep 1 -purify -smartbacks -tab 8 --wordwrap #HOOK#1 global/default flags === Generic files No '.' in filename? * Assume it's a text file and, except in jupp, we want wordwrap on. -wordwrap Filename with '.' is probably not a text file. *.* Binary file *.bin --crlf --guess_crlf -encoding ascii -hex === Patterns with multiple wildcards Order is latest match wins, so... */patch-* -highlight -syntax diff * +Only in[ ] -highlight -syntax diff * +Nur in[ ] -highlight -syntax diff * +\[1-9]\+\[0-9]\[cda] -highlight -syntax diff *.sh* -syntax sh *.ksh* -syntax sh *.mksh* -syntax sh *.bash* -syntax sh *tmp/mutt-* -wordwrap -syntax mail *tmp/pico.* -wordwrap -syntax mail */mail/* -syntax mail */patches/* -highlight -syntax diff === Assembly *.asm -syntax asm *.S -syntax asm *.s -syntax asm === C, C++, Objective-C *.C -syntax c *.c -syntax c *.cc -syntax c *.cpp -syntax c *.cxx -syntax c *.c++ -syntax c *.h -syntax c *.hh -syntax c *.hpp -syntax c *.h++ -syntax c *.m -syntax c *.nxc -syntax c === C Shell *.csh -syntax csh *.login -syntax csh *.logout -syntax csh *.tcsh -syntax csh *.tcshrc -syntax csh * +#!\+\[ ]\+\[/a-z0-9._-]/\+tcsh\> -syntax csh * +#!\+\[ ]\+\[/a-z0-9._-]/env\[ ]\+\[ ]\+tcsh\> -syntax csh === Diff *.diff -highlight -syntax diff *.patch -highlight -syntax diff *.rej -highlight -syntax diff *.debdiff -highlight -syntax diff * +---\[ ] -highlight -syntax diff * +***\[ ] -highlight -syntax diff * +Index: \*\n====================================================== -highlight -syntax diff * +Index: \*\ndiff\*\n--- \*\n+++\[ ] -highlight -syntax diff * +\[=?]\*\n--- \*\n+++\[ ] -highlight -syntax diff * +diff\*\n--- \*\n+++\[ ] -highlight -syntax diff * +diff --git\*\nindex\*\n--- \*\n+++\[ ] -highlight -syntax diff === eMail *.eml -syntax mail Not quite eMail but still RFC822 *.mht -syntax mail === FORTRAN *.f -syntax fortran *.for -syntax fortran *.FOR -syntax fortran *.f77 -syntax fortran *.F77 -syntax fortran *.f90 -syntax fortran *.F90 -syntax fortran === GNU autoconf *.ac -syntax conf *.am -syntax conf === HTML *.htm -encoding utf8 -syntax html *.html -encoding utf8 -syntax html * +<\[Hh]\[Tt]\[Mm]\[Ll]\> -encoding utf8 -syntax html * + -encoding utf8 -syntax html === Java *.java -encoding utf8 -syntax java === JOE Syntax File *.jsf -syntax conf === LISP *.lisp -syntax lisp *.lsp -syntax lisp *.el -syntax lisp === Make *akefile -syntax conf *AKEFILE -syntax conf === Mason *.mas -syntax mason === Pascal *.p -syntax pascal *.pas -syntax pascal === Perl *.pl -syntax perl *.pm -syntax perl * +#!\+\[ ]\+\[/a-z0-9._-]/perl -syntax perl * +#!\+\[ ]\+\[/a-z0-9._-]/env\[ ]\+\[ ]perl -syntax perl === PHP *.php -syntax php === Python *.py -encoding utf8 -syntax python -tab 4 -indentc 32 -istep 4 -spaces * +#!\+\[ ]\+\[/a-z0-9._-]/python -encoding utf8 -syntax python -tab 4 -indentc 32 -istep 4 -spaces * +#!\+\[ ]\+\[/a-z0-9._-]/env\[ ]\+\[ ]python -encoding utf8 -syntax python -tab 4 -indentc 32 -istep 4 -spaces === Bourne, Korn, POSIX Shell *profile -syntax sh * +:\[ \n] -syntax sh * +#!\+\[ ]\+\[/a-z0-9._-]/\+\[bda]sh\> -syntax sh * +#!\+\[ ]\+\[/a-z0-9._-]/env\[ ]\+\[ ]\+\[bda]sh\> -syntax sh * +#!\+\[ ]\+\[/a-z0-9._-]/\+\[a-z]ksh\+\[0-9._-]\> -syntax sh * +#!\+\[ ]\+\[/a-z0-9._-]/env\[ ]\+\[ ]\+\[a-z]ksh\+\[0-9._-]\> -syntax sh === TCL *.tcl -syntax tcl === TeX *.cls -syntax tex *.def -syntax tex *.dtx -syntax tex *.lco -syntax tex *.sty -syntax tex *.tex -syntax tex === Verilog *.v -syntax verilog -istep 2 *.vh -syntax verilog -istep 2 === VHDL *.vhd -syntax vhdl -istep 2 === XML *.xml -encoding utf8 -syntax xml *.xsl -encoding utf8 -syntax xml * +]?>\+\[ \n] -encoding utf8 -syntax html === Text (except in jupp) *.asc -wordwrap *.doc -wordwrap *.txt -wordwrap #HOOK#2 filename matching THIRD SECTION: Named help screens: Use \| to insert a spring: all springs in a given line are set to the same width such that the entire line exactly fits in the width of the screen (if it's not an exact multiple so that there are N spaces remaining, the rightmost N springs each get one extra space). Hint: if you want vertical alignment, each line should have the same number of springs. {Basic \|\b^K\b cut line \| \b^W\b find first \|\b^J\b justify \| \b^X\b save or discard, exit \| \|\b^U\b paste \|\bEsc W\b find next \|\b^T\b spell \|\bEsc .\b for more help \| } {Basic1 \i Help Screen \|turn off with ^G prev. screen ^[, next screen ^[. \i \i \i\|\uCURSOR\u \|\uGO TO\u \|\uBLOCK\u \|\uDELETE\u \|\uMISC\u \|\uEXIT\u \|\i \i \i \i\|^B left ^F right \|^W^Y top of file \|^^ mark \|^D char \|^J format \|^X save \|\i \i \i \i\|^P up ^N down \|^W^V end of file \|^K cut \|^K line \|^T spell \|^C status\|\i \i \i \i\|^Y prev. screen \|^A beg. of line \|^U paste \|^[K >line \|^[T file \|^[Z shell\|\i \i \i \i\|^V next screen \|^E end of line \|^O save \|^[H word< \|^L refresh \|\uFILE\u \|\i \i \i \i\|^Z prev. word \|^W^T line No. \|^[/ filter \|^[D >word \|^[^[ options \|^O save \|\i \i \i \i\|^SPACE next word \|^W find ^[W next \| \|^[- undo \|^[= redo \|^R insert\|\i \i } {Advanced \i Help Screen \|turn off with ^G prev. screen ^[, next screen ^[. \i \i \i\|\uMACROS\u \|\uWINDOW\u \|\uWINDOW\u \|\uSHELL\u \|\uMISC\u \|\i \i \i \i\|^[( 0-9 Record \|^[O Split \|^[G Grow \|^[! Command \|^[X Execute command \|\i \i \i \i\|^[) Stop \|^[E Edit file \|^[J Shrink \|^[' Window \|^[M Math \|\i \i \i \i\|^[ 0-9 Play \|^[P Goto prev. \|\uQUOTE\u \|\uI-SEARCH\u \|^[C Center line \|\i \i \i \i\|^[? Query \|^[N Goto next \|` Ctrl- \|^[R Backwards \|^[] to matching ( [ {\|\i \i \i \i\|^[\\ Repeat \|^[I Zoom in/out \|^\\ Meta- \|^[S Forwards \|^[< ^[> pan left/rght\|\i \i } {Search \i Help Screen \|turn off with ^G prev. screen ^[, next screen ^[. \i \i \iSpecial search sequences: \|\i \i \i \i \\^ \\$ matches beg./end of line \\? match any single char \|\i \i \i \i \\< \\> matches beg./end of word \\* match 0 or more chars \|\i \i \i \i \\c matches balanced C expression \\\\ matches a \\ \|\i \i \i \i \\[..] matches one of a set \\n matches a newline \|\i \i \i \i \\+ matches 0 or more of the character which follows the \\+ \|\i \i \i \iSpecial replace sequences: \|\i \i \i \i \\& replaced with text which matched search string \|\i \i \i \i \\0 - 9 replaced with text which matched Nth \\*, \\?, \\c, \\+, or \\[..] \|\i \i \i \i \\\\ replaced with \\ \\n replaced with newline \|\i \i } {Names \i Help Screen \|turn off with ^G prev. screen ^[, next screen ^[. \i \i \i Hit TAB at file name prompts to generate menu of file names \|\i \i \i \i Or use up/down keys to access history of previously entered names \|\i \i \i \i Special file names: \|\i \i \i \i !command Pipe in/out of a shell command \|\i \i \i \i >>filename Append to a file \|\i \i \i \i - Read/Write to/from standard I/O \|\i \i \i \i filename,START,SIZE Read/Write a part of a file/device \|\i \i \i \i Give START/SIZE in decimal (255), octal (0377) or hex (0xFF) \|\i \i } {Joe \i Help Screen \|turn off with ^G prev. screen ^[, \i \i \i For bug reports and other information, refer to: \uhttp://mirbsd.de/jupp\u \|\i \i } #HOOK#3 additional help screens {CharTable \i Help Screen turn off with ^J prev. screen ^[, \uCharacter Map\u \i \i \i Dec Hex \u 0123 4567 89AB CDEF 0123 4567 89AB CDEF \u Hex Dec \i \i \i \i | | \i \i \i \i 0 00 | \u@ABC\u \uDEFG\u \uHIJK\u \uLMNO\u €‚ „…†‡ ‰Š‹ ŚŤŽŹ | 80 128 \i \i \i \i 16 10 | \uPQRS\u \uTUVW\u \uXYZ[\u \u\\]^_\u ‘’“ ”•–— ™š› śťžź | 90 144 \i \i \i \i 32 20 | !"# $%&' ()*+ ,-./  ˇ˘Ł ¤Ą¦§ ¨©Ş« ¬­®Ż | A0 160 \i \i \i \i 48 30 | 0123 4567 89:; <=>? °±˛ł ´µ¶· ¸ąş» Ľ˝ľż | B0 176 \i \i \i \i 64 40 | @ABC DEFG HIJK LMNO ŔÁÂĂ ÄĹĆÇ ČÉĘË ĚÍÎĎ | C0 192 \i \i \i \i 80 50 | PQRS TUVW XYZ[ \\]^_ ĐŃŇÓ ÔŐÖ× ŘŮÚŰ ÜÝŢß | D0 208 \i \i \i \i 96 60 | `abc defg hijk lmno ŕáâă äĺćç čéęë ěíîď | E0 224 \i \i \i \i 112 70 | pqrs tuvw xyz{ |}~ đńňó ôőö÷ řůúű üýţ˙ | F0 240 \i \i } {Paste \i \i \i \i \u\bPaste Mode\b\u turn off with \b^D\b or \b^[[201~\b \i \i } FOURTH SECTION: Key bindings: Section names you must provide: :main editing window :prompt prompt lines :query single-character query lines :querya singe-character query for quote :querysr search-and-replace single-character query Other sections may be given as well for organisation purposes or for use with the '-keymap' option. Use: :inherit name To copy the named section into the current one :delete key To delete a key sequence from the current section Keys: Use ^@ through ^_ and ^? for C0 control characters and DEL Use SP for space Use a TO b to generate a range of characters You can also use termcap string capability names. For example: .ku Up .kd Down .kl Left .kr Right .kh Home .kH End .kI Insert .kD Delete .kP PgUp .kN PgDn .k1 - .k9 F1 - F9 .k0 F0 or F10 .k; F10 Macros: Simple macros can be made by comma seperating two or more command names. For example: eof,bol ^T Z Goto beginning of last line Also quoted matter is typed in literally (backslashes escape): bol,">",dnarw .k1 Quote news article line Macros may cross lines if they end with a comma. Commands or named macros may be created with :def. For example, you can use... :def foo eof,bol ... to define a command foo which will go to the beginning of the last line. :windows Bindings common to all windows #HOOK#4 common keybindings type ^@ TO ˙ abort ^C Abort window arg ^[ \ Repeat next command explode ^[ I Show all windows or show only one window explode ^[ ^I explode ^[ i help .k1 help ^G Help menu help ^[ [ 1 1 ~ hnext ^[ . Next help window hprev ^[ , Previous help window math ^[ m Calculator math ^[ M Calculator math ^[ ^M Calculator nextw ^[ N Goto next window nextw ^[ ^N nextw ^[ n pgdn .kN Screen down pgdn ^V pgdn ^[ [ 6 ~ pgdn ^[ [ G SCO pgup .kP Screen up pgup ^Y pgup ^[ [ 5 ~ pgup ^[ [ I SCO play ^[ 0 TO 9 Execute macro prevw ^[ P Goto previous window prevw ^[ ^P prevw ^[ p query ^[ ? Macro query insert record ^[ ( Record a macro retype ^L Refresh screen rtn ^M Return shell ^[ z shell ^[ Z shell ^[ ^Z stop ^[ ) Stop recording :Paste type ^@ TO ˙ rtn ^M msg,"Entered bracketed paste mode",rtn ^[ [ 2 0 0 ~ helpcard,rtn,keymap,"main",rtn,msg,rtn ^[ [ 2 0 1 ~ helpcard,rtn,keymap,"main",rtn ^D :Pasteprompt type ^@ TO ˙ nop ^L keymap,"prompt",rtn,msg,rtn,rtn ^M msg,"Entered bracketed paste mode",rtn ^[ [ 2 0 0 ~ keymap,"prompt",rtn,msg,rtn ^[ [ 2 0 1 ~ keymap,"prompt",rtn ^D :main Text editing window :inherit windows compile :def compile switch,"*Build-Log*",rtn,markb,eof," ",markk,blkdel,filt,query,parserr :def compile querysave,query,scratch,"* Build Log *",rtn,bof,markb,eof," ",markk,blkdel,build spell check :def aspellfile filt,"SPLTMP=ispell.tmp;cat >$SPLTMP;aspell -x -c $SPLTMP /dev/tty;cat $SPLTMP;/bin/rm $SPLTMP",rtn,retype :def aspellword psh,nextword,markk,prevword,markb,filt,"SPLTMP=ispell.tmp;cat >$SPLTMP;aspell -x -c $SPLTMP /dev/tty;tr -d <$SPLTMP '\\012';/bin/rm $SPLTMP",rtn,retype,nextword :def ispellfile filt,"cat >ispell.tmp;ispell ispell.tmp /dev/tty;cat ispell.tmp;/bin/rm ispell.tmp",rtn,retype :def ispellword psh,nextword,markk,prevword,markb,filt,"cat >ispell.tmp;ispell ispell.tmp /dev/tty;tr -d Pan right shrinkw ^[ J Shrink window shrinkw ^[ ^J shrinkw ^[ j splitw ^[ ^O Split window splitw ^[ o tag ^[ ; Tags file search tomatch ^[ ] To matching delimiter undo ^[ - Undo changes uparw .ku Go up uparw ^P uparw ^[ O A uparw ^[ [ A yank ^U Paste yankpop ^[ U Select yanked text yankpop ^[ ^U yankpop ^[ u :prompt Prompt windows :inherit main abort ^C complete ^I cancel,bof ^Y cancel,eof ^V cancel,line ^T cancel,bop ^W cancel,eop ^O nop ^L keymap,"Pasteprompt",rtn,msg,"Entered bracketed paste mode",rtn ^[ P keymap,"Pasteprompt",rtn,msg,"Entered bracketed paste mode",rtn ^[ p keymap,"Pasteprompt",rtn,msg,"Entered bracketed paste mode",rtn ^[ [ 2 0 0 ~ :menu Selection menus :inherit windows abort ^[ ^[ backsmenu ^? backsmenu ^H bofmenu ^K U bofmenu ^K ^U bofmenu ^K u bofmenu ^[ [ 1 ; 5 H bolmenu ^A bolmenu .kh bolmenu ^[ [ 1 ~ bolmenu ^[ [ 7 ~ bolmenu ^[ [ H dnarwmenu .kd dnarwmenu ^N dnarwmenu ^[ [ B dnarwmenu ^[ O B eofmenu ^K V eofmenu ^K ^V eofmenu ^K v eofmenu ^[ [ 1 ; 5 F eolmenu .@7 eolmenu .kH eolmenu ^E eolmenu ^[ [ 4 ~ eolmenu ^[ [ 8 ~ eolmenu ^[ [ F ltarwmenu .kl ltarwmenu ^B ltarwmenu ^[ [ D ltarwmenu ^[ O D pgdnmenu .kN pgdnmenu ^V pgdnmenu ^[ [ 6 ~ pgdnmenu ^[ [ G pgupmenu .kP pgupmenu ^Y pgupmenu ^[ [ 5 ~ pgupmenu ^[ [ I rtarwmenu .kr rtarwmenu ^F rtarwmenu ^[ [ C rtarwmenu ^[ O C rtn SP rtn ^I rtn ^K H rtn ^K h rtn ^K ^H tabmenu ^I uparwmenu .ku uparwmenu ^P uparwmenu ^[ [ A uparwmenu ^[ O A :query Single-key query window :inherit windows :querya Single-key query window for quoting type ^@ TO ˙ :querysr Search & replace query window type ^@ TO ˙ jupp/jstarrc.in010064400000000000000000000646471361505650500110120ustar00 $MirOS: contrib/code/jupp/jstarrc.in,v 1.37 2020/01/31 17:00:26 tg Exp $ Initialisation file for JOE WordStar / Turbo-C Joe This file must be written in the 8-bit encoding, not UTF-8. JOE looks for this file in: 1 - $HOME/.jstarrc 2 - @jrcbefore@jstarrc@jrcafter@ This file can include other files by placing the following include command in the first column (comment lines start with space or tab): :include filename FIRST SECTION: Default global options (these options can also be specified on the command line. Also, the NOXON, LINES, COLUMNS, DOPADDING and BAUD options can be specified in environment variables): Put each option you want set in the first column: -option Sets the option --option Clears the option -mid Cursor is recentred when scrolling is necessary -marking Text between ^KB and cursor is highlighted; use with: -lightoff Turn off highlighting after block copy or move -autoswap Swap markb with markk when necessary -asis Characters 128 - 255 shown as-is -hex Hex editing mode -nobackups If you don't want backup files to be created -backpath path Where to store backup files (do not quote, no comment after) -force Force final newline when files are saved -exask ^KX always confirms file name -beep Beep on errors and when cursor goes past extremes -nosta Disable top-most status line -keepup %k and %c status line escape sequences updated frequently -pg nnn No. lines to keep for PgUp/PgDn -csmode ^KF after a pervious search does a ^L instead -nonotice Disable copyright notice -noxon Attempt to turn off ^S/^Q processing -orphan Put extra files given on command line in orphaned buffers instead of in windows -dopadding Output pad characters (for when there is no tty handshaking) -lines nnn Set no. screen lines -baud nnn Set baud rate for terminal optimisations -columns nnn Set no. screen columns -help Start with help on -skiptop nnn Don't use top nnn lines of the screen -notite Don't send terminal initialisation and termination strings: prevents restoration of screen on exit -pastetite Enter bracketed paste mode automatically for TERM=xterm-xfree86 -usetabs Use tabs to help optimise screen update -assume_color Assume terminal has ANSI colour support even if its termcap or terminfo entry says that it doesn't. This only applies if the terminal otherwise looks like an ANSI terminal (supports bold and capability starts with ESC [). -guess_crlf Automatically detect MS-DOS files and set -crlf appropriately -guess_indent Guess indent character (tab or space) -menu_explorer Stay in menu system when a directory is selected (otherwise directory is added to path and menu is closed) -icase Search is case-insensitive by default -wrap Search wraps Status line definition strings. -lmsg defines the left-justified string, and -rmsg defines the right-justified string. The first character of -rmsg is the background fill character. -hmsg (3.1jupp15) defines the help hint (only about a dozen chars) displayed next to the copyright notice in the initial status line (inverted by default, unless starting with exactly \i). The following escape sequences can be used in these strings: %t 12-hour time %u 24-hour time %T O for overtype mode, I for insert mode %W W if wordwrap is enabled %I A if autoindent is enabled %X rectangle mode indicator %n file name %m '(Modified)' if file has been changed %* '*' if file has been changed %R read-only indicator %r row (line) number %c column number %o byte offset into file (decimal) %O byte offset into file in hex %a ASCII value of character under cursor (decimal) %A ASCII value of character under cursor in hex %p percent of file cursor is at %l number of lines in file %k entered prefix keys %S '*SHELL*' if there is a shell running in window %M macro recording message %y syntax %x context (first non-indented line going backwards) These formatting escape sequences may also be given: \i Inverse \u Underline \b Bold \d Dim \f Blink -lmsg \i%k%T%W%I%X %n %m%y%R %M -rmsg %S Row %r Col %c %t Ctrl-J for help -hmsg \i\f\bHelp: ^J\b\f SECOND SECTION: filename-dependent local option settings: Each line with '*' in the first column indicates the modes which should be set for files whose name matches the regular expression. If more than one regular expression matches the file name, then the last matching one is chosen. A file contents regular expression may also be specified on a separate line with '+regex'. If this regular expresssion is given, then both the file name regex and the file contents regex must match for the options to apply. Here is a list of modes which can be set: -keymap name Keymap to use if not 'main' -square Rectangular block mode -overwrite Overtype mode -picture Picture mode (cursor right can go past end of line) -linums Show line numbers in front of each line -rdonly File is read-only -crlf File uses CR-LF at end of lines -encoding utf8 File is UTF-8 encoded -syntax name Specify syntax (syntax file called 'name.jsf' will be loaded) -highlight Enable syntax highlighting -french One space after '.', '?' and '!' for wordwrap and paragraph reformat instead of two. JOE does not change the spacing you give, but sometimes it must put spacing in itself. This selects how much is inserted in those cases. -purify Fixup indentation if necessary for rindent, lindent and backs (for example if indentation uses a mix of tabs and spaces, and indentc is space, indentation will be converted to all spaces) -lmargin nnn Left margin -rmargin nnn Right margin -tab nnn Tab width -indentc nnn Indentation character (32 = space, 9 = tab) -istep nnn Amount of 'indentc's per indentation level -spaces Tab key inserts spaces instead of tabs -wordwrap Wordwrap -autoindent Auto indent -smartbacks Backspace key deletes 'istep' number of 'indentc's if cursor is at first non-space character -smarthome Home key first moves cursor to beginning of line, then if hit again, to first non-blank character -indentfirst Smart home goes to first non-blank character first, instead of to the beginning of the line first -lmsg Status line definition strings; -rmsg see previous section for more info -mnew macro Macro to execute when new files are loaded -mold macro Macro to execute when existing files are loaded -msnew macro Macro to execute when new files are saved -msold macro Macro to execute when existing files are saved Macros for the above options are in the same format as in the key binding section below but without the key name strings. Default local options: -highlight -french -indentc 9 -istep 1 -purify -smartbacks -tab 8 --wordwrap #HOOK#1 global/default flags === Generic files No '.' in filename? * Assume it's a text file and, except in jupp, we want wordwrap on. -wordwrap Filename with '.' is probably not a text file. *.* Binary file *.bin --crlf --guess_crlf -encoding ascii -hex === Patterns with multiple wildcards Order is latest match wins, so... */patch-* -highlight -syntax diff * +Only in[ ] -highlight -syntax diff * +Nur in[ ] -highlight -syntax diff * +\[1-9]\+\[0-9]\[cda] -highlight -syntax diff *.sh* -syntax sh *.ksh* -syntax sh *.mksh* -syntax sh *.bash* -syntax sh *tmp/mutt-* -wordwrap -syntax mail *tmp/pico.* -wordwrap -syntax mail */mail/* -syntax mail */patches/* -highlight -syntax diff === Assembly *.asm -syntax asm *.S -syntax asm *.s -syntax asm === C, C++, Objective-C *.C -syntax c *.c -syntax c *.cc -syntax c *.cpp -syntax c *.cxx -syntax c *.c++ -syntax c *.h -syntax c *.hh -syntax c *.hpp -syntax c *.h++ -syntax c *.m -syntax c *.nxc -syntax c === C Shell *.csh -syntax csh *.login -syntax csh *.logout -syntax csh *.tcsh -syntax csh *.tcshrc -syntax csh * +#!\+\[ ]\+\[/a-z0-9._-]/\+tcsh\> -syntax csh * +#!\+\[ ]\+\[/a-z0-9._-]/env\[ ]\+\[ ]\+tcsh\> -syntax csh === Diff *.diff -highlight -syntax diff *.patch -highlight -syntax diff *.rej -highlight -syntax diff *.debdiff -highlight -syntax diff * +---\[ ] -highlight -syntax diff * +***\[ ] -highlight -syntax diff * +Index: \*\n====================================================== -highlight -syntax diff * +Index: \*\ndiff\*\n--- \*\n+++\[ ] -highlight -syntax diff * +\[=?]\*\n--- \*\n+++\[ ] -highlight -syntax diff * +diff\*\n--- \*\n+++\[ ] -highlight -syntax diff * +diff --git\*\nindex\*\n--- \*\n+++\[ ] -highlight -syntax diff === eMail *.eml -syntax mail Not quite eMail but still RFC822 *.mht -syntax mail === FORTRAN *.f -syntax fortran *.for -syntax fortran *.FOR -syntax fortran *.f77 -syntax fortran *.F77 -syntax fortran *.f90 -syntax fortran *.F90 -syntax fortran === GNU autoconf *.ac -syntax conf *.am -syntax conf === HTML *.htm -encoding utf8 -syntax html *.html -encoding utf8 -syntax html * +<\[Hh]\[Tt]\[Mm]\[Ll]\> -encoding utf8 -syntax html * + -encoding utf8 -syntax html === Java *.java -encoding utf8 -syntax java === JOE Syntax File *.jsf -syntax conf === LISP *.lisp -syntax lisp *.lsp -syntax lisp *.el -syntax lisp === Make *akefile -syntax conf *AKEFILE -syntax conf === Mason *.mas -syntax mason === Pascal *.p -syntax pascal *.pas -syntax pascal === Perl *.pl -syntax perl *.pm -syntax perl * +#!\+\[ ]\+\[/a-z0-9._-]/perl -syntax perl * +#!\+\[ ]\+\[/a-z0-9._-]/env\[ ]\+\[ ]perl -syntax perl === PHP *.php -syntax php === Python *.py -encoding utf8 -syntax python -tab 4 -indentc 32 -istep 4 -spaces * +#!\+\[ ]\+\[/a-z0-9._-]/python -encoding utf8 -syntax python -tab 4 -indentc 32 -istep 4 -spaces * +#!\+\[ ]\+\[/a-z0-9._-]/env\[ ]\+\[ ]python -encoding utf8 -syntax python -tab 4 -indentc 32 -istep 4 -spaces === Bourne, Korn, POSIX Shell *profile -syntax sh * +:\[ \n] -syntax sh * +#!\+\[ ]\+\[/a-z0-9._-]/\+\[bda]sh\> -syntax sh * +#!\+\[ ]\+\[/a-z0-9._-]/env\[ ]\+\[ ]\+\[bda]sh\> -syntax sh * +#!\+\[ ]\+\[/a-z0-9._-]/\+\[a-z]ksh\+\[0-9._-]\> -syntax sh * +#!\+\[ ]\+\[/a-z0-9._-]/env\[ ]\+\[ ]\+\[a-z]ksh\+\[0-9._-]\> -syntax sh === TCL *.tcl -syntax tcl === TeX *.cls -syntax tex *.def -syntax tex *.dtx -syntax tex *.lco -syntax tex *.sty -syntax tex *.tex -syntax tex === Verilog *.v -syntax verilog -istep 2 *.vh -syntax verilog -istep 2 === VHDL *.vhd -syntax vhdl -istep 2 === XML *.xml -encoding utf8 -syntax xml *.xsl -encoding utf8 -syntax xml * +]?>\+\[ \n] -encoding utf8 -syntax html === Text (except in jupp) *.asc -wordwrap *.doc -wordwrap *.txt -wordwrap #HOOK#2 filename matching THIRD SECTION: Named help screens: Use \| to insert a spring: all springs in a given line are set to the same width such that the entire line exactly fits in the width of the screen (if it's not an exact multiple so that there are N spaces remaining, the rightmost N springs each get one extra space). Hint: if you want vertical alignment, each line should have the same number of springs. {Basic \i Help Screen \|turn off with ^J more help with ESC . (^[.) \i \i \i\|\uCURSOR\u \|\uGO TO\u \|\uBLOCK\u \|\uDELETE\u \|\uMISC\u \|\uEXIT\u \|\i \i \i \i\|^S left ^D right \|^R prev. screen \|^KB begin \|^G char \|^B reformat \|^KX save \|\i \i \i \i\|^E up ^X down \|^C next screen \|^KK end \|^Y line \|^V overtype \|^KQ abort \|\i \i \i \i\|^A previous word \|^QS beg. of line \|^KV move \|^T >word \|^] refresh \|^KZ shell \|\i \i \i \i\|^F next word \|^QD end of line \|^KC copy \|^QY >line \|^O options \|\uFILE\u \|\i \i \i \i\|\uSEARCH\u \|^QR top of file \|^KW file \|^U undo \|\uSPELL\u \|^KE new \|\i \i \i \i\|^QF find text \|^QC end of file \|^KY delete \|^^ redo \|^QN word \|^KR insert\|\i \i \i \i\|^L find next \|^QI to line No. \|^K/ filter \| \|^QL file \|^KD save \|\i \i } {Windows \i Help Screen \|turn off with ^J prev. screen ^[, next screen ^[. \i \i \i\|^KO Split the window in half \|^KE Load file into window \|\i \i \i \i\|^KG Make current window bigger \|^KT Make current window smaller \|\i \i \i \i\|^KN Go to the window below \|^KP Go to the window above \|\i \i \i \i\|^KQ Eliminate the current window \|^KI Show all windows / Show one window\|\i \i } {Advanced \i Help Screen \|turn off with ^J prev. screen ^[, next screen ^[. \i \i \i\|\uMACROS\u \|\uMISC\u \|\uSCROLL\u \|\uSHELL\u \|\uGOTO\u \|\uI-SEARCH\u \|\i \i \i \i\|^[( Record \|^Q? status \|^Q. Right \|^K' Window \|^QB to ^KB \|^[R Backwards \|\i \i \i \i\|^[) Stop \|^QQ repeat \|^Q, Left \|^[! Command \|^QK to ^KK \|^[S Forwards \|\i \i \i \i\|^[ 0-9 Play \|^QM Math \| \|\uQUOTE\u \|\uDELETE\u \|\uBOOKMARKS\u \|\i \i \i \i\|^[? Query \|^KA Center line \| \|^P Ctrl- \|^[Y yank \|^K 0-9 Set \|\i \i \i \i\|^[D Dump \|^[H Message \| \|^\\ Meta- \|^[O word< \|^Q 0-9 Goto \|\i \i } {Programs \i Help Screen \|turn off with ^J prev. screen ^[, next screen ^[. \i \i \i\|\uGOTO\u \|\uINDENT\u \|\uCOMPILING\u \| \|\i \i \i \i\|^Q[ Matching ( [ { \|^K. more \|^[C Compile and parse errors \| \|\i \i \i \i\|^QP Previous place \|^K, less \|^[E Parse errors \| \|\i \i \i \i\|^K= Next place \| \|^[= Goto next error \| \|\i \i \i \i\|^K; Tags file srch \| \|^[- Goto previous error \| \|\i \i } {Search \i Help Screen \|turn off with ^J prev. screen ^[, next screen ^[. \i \i \iSpecial search sequences: \|\i \i \i \i \\^ \\$ matches beg./end of line \\? match any single char \|\i \i \i \i \\< \\> matches beg./end of word \\* match 0 or more chars \|\i \i \i \i \\c matches balanced C expression \\\\ matches a \\ \|\i \i \i \i \\[..] matches one of a set \\n matches a newline \|\i \i \i \i \\+ matches 0 or more of the character which follows the \\+ \|\i \i \i \iSpecial replace sequences: \|\i \i \i \i \\& replaced with text which matched search string \|\i \i \i \i \\0 - 9 replaced with text which matched Nth \\*, \\?, \\c, \\+, or \\[..] \|\i \i \i \i \\\\ replaced with \\ \\n replaced with newline \|\i \i } {Names \i Help Screen \|turn off with ^J prev. screen ^[, next screen ^[. \i \i \i Hit TAB at file name prompts to generate menu of file names \|\i \i \i \i Or use up/down keys to access history of previously entered names \|\i \i \i \i Special file names: \|\i \i \i \i !command Pipe in/out of a shell command \|\i \i \i \i >>filename Append to a file \|\i \i \i \i - Read/Write to/from standard I/O \|\i \i \i \i filename,START,SIZE Read/Write a part of a file/device \|\i \i \i \i Give START/SIZE in decimal (255), octal (0377) or hex (0xFF) \|\i \i } {Joe \i Help Screen \|turn off with ^J prev. screen ^[, \i \i \i For bug reports and other information, refer to: \uhttp://mirbsd.de/jupp\u \|\i \i } #HOOK#3 additional help screens {CharTable \i Help Screen turn off with ^J prev. screen ^[, \uCharacter Map\u \i \i \i Dec Hex \u 0123 4567 89AB CDEF 0123 4567 89AB CDEF \u Hex Dec \i \i \i \i | | \i \i \i \i 0 00 | \u@ABC\u \uDEFG\u \uHIJK\u \uLMNO\u €‚ „…†‡ ‰Š‹ ŚŤŽŹ | 80 128 \i \i \i \i 16 10 | \uPQRS\u \uTUVW\u \uXYZ[\u \u\\]^_\u ‘’“ ”•–— ™š› śťžź | 90 144 \i \i \i \i 32 20 | !"# $%&' ()*+ ,-./  ˇ˘Ł ¤Ą¦§ ¨©Ş« ¬­®Ż | A0 160 \i \i \i \i 48 30 | 0123 4567 89:; <=>? °±˛ł ´µ¶· ¸ąş» Ľ˝ľż | B0 176 \i \i \i \i 64 40 | @ABC DEFG HIJK LMNO ŔÁÂĂ ÄĹĆÇ ČÉĘË ĚÍÎĎ | C0 192 \i \i \i \i 80 50 | PQRS TUVW XYZ[ \\]^_ ĐŃŇÓ ÔŐÖ× ŘŮÚŰ ÜÝŢß | D0 208 \i \i \i \i 96 60 | `abc defg hijk lmno ŕáâă äĺćç čéęë ěíîď | E0 224 \i \i \i \i 112 70 | pqrs tuvw xyz{ |}~ đńňó ôőö÷ řůúű üýţ˙ | F0 240 \i \i } {Paste \i \i \i \i \u\bPaste Mode\b\u turn off with \b^D\b or \b^[[201~\b \i \i } FOURTH SECTION: Key bindings: Section names you must provide: :main editing window :prompt prompt lines :query single-character query lines :querya singe-character query for quote :querysr search-and-replace single-character query Other sections may be given as well for organisation purposes or for use with the '-keymap' option. Use: :inherit name To copy the named section into the current one :delete key To delete a key sequence from the current section Keys: Use ^@ through ^_ and ^? for C0 control characters and DEL Use SP for space Use a TO b to generate a range of characters You can also use termcap string capability names. For example: .ku Up .kd Down .kl Left .kr Right .kh Home .kH End .kI Insert .kD Delete .kP PgUp .kN PgDn .k1 - .k9 F1 - F9 .k0 F0 or F10 .k; F10 Macros: Simple macros can be made by comma seperating two or more command names. For example: eof,bol ^T Z Goto beginning of last line Also quoted matter is typed in literally (backslashes escape): bol,">",dnarw .k1 Quote news article line Macros may cross lines if they end with a comma. Commands or named macros may be created with :def. For example, you can use... :def foo eof,bol ... to define a command foo which will go to the beginning of the last line. :windows Bindings common to all windows #HOOK#4 common keybindings type ^@ TO ˙ abort ^K Q abort ^K ^Q abort ^K q abort ^C arg ^Q Q arg ^Q ^Q arg ^Q q explode ^K I explode ^K ^I explode ^K i help .k1 help ^J help ^[ [ 1 1 ~ nmark ^K H nmark ^K ^H nmark ^K h hnext ^[ . hprev ^[ , math ^Q M math ^Q ^M math ^Q m msg ^[ H msg ^[ ^H msg ^[ h nextw ^K N nextw ^K ^N nextw ^K n pgdn .kN Screen down pgdn ^[ [ 6 ~ pgdn ^[ [ G SCO pgup .kP Screen up pgup ^[ [ 5 ~ pgup ^[ [ I SCO play ^[ 0 TO 9 prevw ^K P prevw ^K ^P prevw ^K p query ^[ ? record ^[ ( retype ^] rtn ^M shell ^K Z shell ^K ^Z shell ^K z stop ^[ ) :Paste type ^@ TO ˙ rtn ^M msg,"Entered bracketed paste mode",rtn ^[ [ 2 0 0 ~ helpcard,rtn,keymap,"main",rtn,msg,rtn ^[ [ 2 0 1 ~ helpcard,rtn,keymap,"main",rtn ^D :Pastecua type ^@ TO ˙ rtn ^M msg,"Entered bracketed paste mode",rtn ^[ [ 2 0 0 ~ helpcard,rtn,keymap,"cua",rtn,msg,rtn ^[ [ 2 0 1 ~ helpcard,rtn,keymap,"cua",rtn ^D :Pasteprompt type ^@ TO ˙ nop ^L keymap,"prompt",rtn,msg,rtn,rtn ^M msg,"Entered bracketed paste mode",rtn ^[ [ 2 0 0 ~ keymap,"prompt",rtn,msg,rtn ^[ [ 2 0 1 ~ keymap,"prompt",rtn ^D :main Text editing window :inherit windows compile :def compile switch,"*Build-Log*",rtn,markb,eof," ",markk,blkdel,filt,query,parserr :def compile querysave,query,scratch,"* Build Log *",rtn,bof,markb,eof," ",markk,blkdel,build spell check :def aspellfile filt,"SPLTMP=ispell.tmp;cat >$SPLTMP;aspell -x -c $SPLTMP /dev/tty;cat $SPLTMP;/bin/rm $SPLTMP",rtn,retype :def aspellword psh,nextword,markk,prevword,markb,filt,"SPLTMP=ispell.tmp;cat >$SPLTMP;aspell -x -c $SPLTMP /dev/tty;tr -d <$SPLTMP '\\012';/bin/rm $SPLTMP",rtn,retype,nextword :def ispellfile filt,"cat >ispell.tmp;ispell ispell.tmp /dev/tty;cat ispell.tmp;/bin/rm ispell.tmp",rtn,retype :def ispellword psh,nextword,markk,prevword,markb,filt,"cat >ispell.tmp;ispell ispell.tmp /dev/tty;tr -d -syntax csh * +#!\+\[ ]\+\[/a-z0-9._-]/env\[ ]\+\[ ]\+tcsh\> -syntax csh === Diff *.diff -highlight -syntax diff *.patch -highlight -syntax diff *.rej -highlight -syntax diff *.debdiff -highlight -syntax diff * +---\[ ] -highlight -syntax diff * +***\[ ] -highlight -syntax diff * +Index: \*\n====================================================== -highlight -syntax diff * +Index: \*\ndiff\*\n--- \*\n+++\[ ] -highlight -syntax diff * +\[=?]\*\n--- \*\n+++\[ ] -highlight -syntax diff * +diff\*\n--- \*\n+++\[ ] -highlight -syntax diff * +diff --git\*\nindex\*\n--- \*\n+++\[ ] -highlight -syntax diff === eMail *.eml -syntax mail Not quite eMail but still RFC822 *.mht -syntax mail === FORTRAN *.f -syntax fortran *.for -syntax fortran *.FOR -syntax fortran *.f77 -syntax fortran *.F77 -syntax fortran *.f90 -syntax fortran *.F90 -syntax fortran === GNU autoconf *.ac -syntax conf *.am -syntax conf === HTML *.htm -encoding utf8 -syntax html *.html -encoding utf8 -syntax html * +<\[Hh]\[Tt]\[Mm]\[Ll]\> -encoding utf8 -syntax html * + -encoding utf8 -syntax html === Java *.java -encoding utf8 -syntax java === JOE Syntax File *.jsf -syntax conf === LISP *.lisp -syntax lisp *.lsp -syntax lisp *.el -syntax lisp === Make *akefile -syntax conf *AKEFILE -syntax conf === Mason *.mas -syntax mason === Pascal *.p -syntax pascal *.pas -syntax pascal === Perl *.pl -syntax perl *.pm -syntax perl * +#!\+\[ ]\+\[/a-z0-9._-]/perl -syntax perl * +#!\+\[ ]\+\[/a-z0-9._-]/env\[ ]\+\[ ]perl -syntax perl === PHP *.php -syntax php === Python *.py -encoding utf8 -syntax python -tab 4 -indentc 32 -istep 4 -spaces * +#!\+\[ ]\+\[/a-z0-9._-]/python -encoding utf8 -syntax python -tab 4 -indentc 32 -istep 4 -spaces * +#!\+\[ ]\+\[/a-z0-9._-]/env\[ ]\+\[ ]python -encoding utf8 -syntax python -tab 4 -indentc 32 -istep 4 -spaces === Bourne, Korn, POSIX Shell *profile -syntax sh * +:\[ \n] -syntax sh * +#!\+\[ ]\+\[/a-z0-9._-]/\+\[bda]sh\> -syntax sh * +#!\+\[ ]\+\[/a-z0-9._-]/env\[ ]\+\[ ]\+\[bda]sh\> -syntax sh * +#!\+\[ ]\+\[/a-z0-9._-]/\+\[a-z]ksh\+\[0-9._-]\> -syntax sh * +#!\+\[ ]\+\[/a-z0-9._-]/env\[ ]\+\[ ]\+\[a-z]ksh\+\[0-9._-]\> -syntax sh === TCL *.tcl -syntax tcl === TeX *.cls -syntax tex *.def -syntax tex *.dtx -syntax tex *.lco -syntax tex *.sty -syntax tex *.tex -syntax tex === Verilog *.v -syntax verilog -istep 2 *.vh -syntax verilog -istep 2 === VHDL *.vhd -syntax vhdl -istep 2 === XML *.xml -encoding utf8 -syntax xml *.xsl -encoding utf8 -syntax xml * +]?>\+\[ \n] -encoding utf8 -syntax html #HOOK#2 filename matching {General \i Help Screen turn off with ^J more help with Esc+. (^[.) \i \i \i \u\bEXIT\b\u \u\bBLOCK DEF\b\u \u\bBLOCK OP\b\u \u\bSEARCH\b\u \u\bDELETE:\b\u \b^H\b char \b^QT\b line \i \i \i \i \u\bMISC\b\u \b^KL\b line \b^KY\b kill \b^QA\b find and replace \b^T\b >word \b^[Y\b yank \i \i \i \i \b^QM\b math \b^KH\b hide \b^K/\b pipe \b^QG\b byte backwards \u\bSHELL\b\u \u\bFILE\b\u \i \i \i \i \b^O\b options \u\bQUOTE\b\u \u\bBUFFER\b\u \b^QH\b byte forwards \b^KZ\b suspend \b^KS\b save\das\d \i \i \i \i \b^[P\b pastemode \b`\b Ctrl \b^U\b undo \b^[R\b incremental b. \b^K'\b window \b^KR\b import \i \i \i \i \b^[-\b cmdprompt \b^P\b Meta \b^^\b redo \b^[T\b incr. forwards \b^['\b command \b^KW\b export \i \i } {Movement \i Help Screen turn off with ^J prev. screen ^[, next screen ^[. \i \i \i \u\bMovement in jupp:\b\u screen(top) \i \i \i \i upslide \b^QE\b page(top) file(beginning) \i \i \i \i \b^W\b (char)up \b^R\b \b^QR\b \i \i \i \i (beginning)line (prev)word left \b^E\b right (next)word line(end) \i \i \i \i \b^QS\b \b^A\b \b^S\b \d<+>\d \b^D\b \b^F\b \b^QD\b \i \i \i \i downslide (char)down page(bottom) file(end) \i \i \i \i \b^Z\b \b^X\b \b^C\b \b^QC\b \i \i \i \uWordStar diamond\u \i \b^QX\b \d<-\d screen(bottom) \i \i } {Windows \i Help Screen turn off with ^J prev. screen ^[, next screen ^[. \i \i \i \b^KG\b make current window bigger \b^KI\b show all windows / show one window \i \i \i \i \b^KT\b make current window smaller \b^KO\b split the current window in half \i \i \i \i \b^KP\b go to the window above \b^K-\b edit scratch buffer in new window \i \i \i \i \b^KN\b go to the window below \b^KQ\b eliminate the current window \i \i \i \i \b^KE\b load file into new window \b^K;\b run a ctags search \i \i \i \i Note: some commands (\b^KE\b \b^K;\b \b^K-\b) hide the current window; use \b^KI\b/\b^KN\b then \i \i \i \i \u\bSpecial help for XON/XOFF aware terminals:\b\u \i \i \i \i You can type \b^[q\b instead of \b^Q\b and \b^[s\b instead of \b^S\b for all commands. \i \i } {Orientation \i Help Screen turn off with ^J prev. screen ^[, next screen ^[. \i \i \i \u\bGOTO\b\u \u\bMISC\b\u \u\bINSERT MATH OR CURRENT\b\u \i \i \i \i \b^Q=\b merge conflict marker \b^K\b \u0-9\u define bookmark \b^[#\b equation \b^[@\b date \i \i \i \i \b^QV\b start of last search \b^V\b overtype mode \b^[=\b result \b^[!\b time \i \i \i \i \b^Q]\b next matching brace \u\bGOTO\b\u \u\bREFORMAT\b\u \u\bINDENT LINE\b\u \i \i \i \i \b^Q[\b previous " " \b^Q-\b column number \b^B\b line \b^K.\b more \i \i \i \i \b^QP\b previous place \b^QI\b line number \b^KD\b block \b^K,\b less \i \i \i \i \b^K=\b next place \b^QO\b byte offset \b^]\b split line \b^KA\b centre \i \i \i \i \b^QB\b to ^KB \b^QK\b to ^KK \b^Q\b \u0-9\u bookmark #0-9 \b^K]\b fix whitespace at EOL/EOF \i \i } {Advanced \i Help Screen turn off with ^J prev. screen ^[, next screen ^[. \i \i \i \u\bCOMPILING\b\u \u\bMISC\b\u \i \i \i \i \b^[C\b compile \uand\u \b^[E\b parse errors \b^Q.\b scroll right \i \i \i \i \b^[M\b goto next... \b^[N\b previous error \b^Q,\b scroll left \i \i \i \i \b^KF\b save, compile & upload to NXT brick \b^QL\b refresh \i \i \i \i \u\bMACROS\b\u \b^QQ\b repeat \i \i \i \i \b^[(\b record \b^[/\b query \b^[?\b list defined \b^Q?\b status \i \i \i \i \b^[)\b stop \b^N\b play #0 \b^[\b \u0-9\u play #0-9 \b^[H\b message \i \i \i \i \u\bMATH\b\u (hex or double float) variables: \ubyte\u \ucol\u \uheight\u \uline\u \ulines\u \utop\u \uwidth\u \i \i } {Search \i Help Screen turn off with ^J prev. screen ^[, next screen ^[. \i \i \i \u\bSpecial search sequences:\b\u \i \i \i \i \b\\^\b \b\\$\b matches beg./end of line \b\\?\b match any single char \i \i \i \i \b\\<\b \b\\>\b matches beg./end of word \b\\*\b match 0 or more chars \i \i \i \i \b\\c\b matches balanced C expression \b\\\\\b matches a backslash (\\) \i \i \i \i \b\\[a-z]\b matches one of a set, ^ inverts \b\\n\b matches a newline \i \i \i \i \b\\+\b matches 0 or more of the character which follows the \\+ \i \i \i \i \u\bSpecial replace sequences:\b\u \i \i \i \i \b\\\\\b replaced with a backslash (\\) \b\\n\b replaced with a newline \i \i \i \i \b\\&\b replaced with the text which matched the search string \i \i \i \i \b\\\b\u0\u - \u9\u replaced with text which matched \uN+1\uth \\?, \\*, \\c, \\[a-z] or \\+ \i \i } {Names \i Help Screen turn off with ^J prev. screen ^[, next screen ^[. \i \i \i At file name prompts use the cursor up/down keys to access a history of \i \i \i \i recently used files or the tab key to complete them. \u\bSpecial file names:\b\u \i \i \i \i \b!\b\ucommand\u Pipe in/out of a shell command \i \i \i \i \b>>\b\ufilename\u Append to a file \i \i \i \i \b-\b Read/Write to/from standard I/O \i \i \i \i \ufilename\u\b,\b\uSTART\u\b,\b\uSIZE\u Read/Write a part of a file/device \i \i \i \i Give START/SIZE in decimal (255), octal (0377) or hex (0xFF) \i \i \i \i \u\bPresentation mode:\b\u \bF6\b=fullscreen; \bF7\b=previous, \bF8\b=next win; \bF9\b=filter/again \i \i } {Joe \i Help Screen turn off with ^J prev. screen ^[, next screen ^[. \i \i \i \bJUPP\b is based upon JOE (Joe's Own Editor) 2.8/3.x \d(GPL v1)\d by Joe H. Allen; \i \i \i \i go to \uhttp://sf.net/projects/joe-editor/\u for upstream bug reports. JUPP 2.8 \i \i \i \i for DOS compiled by A. Totlis, packed with LHarc 2.13; JUPP 3.x for UNIX\d(R)\d \i \i \i \i at \uhttp://mirbsd.de/jupp\u and by \bThorsten "\dmirabilos\d" Glaser <\utg@mirbsd.org\u>\b \i \i \i \i @(#) jupprc 2022-03-12; 3.1; autoCR-LF; UTF-8 via locale; per-file encoding \i \i } #HOOK#3 additional help screens {CharTable \i Help Screen turn off with ^J prev. screen ^[, \uCharacter Map\u \i \i \i Dec Hex \u 0123 4567 89AB CDEF 0123 4567 89AB CDEF \u Hex Dec \i \i \i \i | | \i \i \i \i 0 00 | \u@ABC\u \uDEFG\u \uHIJK\u \uLMNO\u €‚ „…†‡ ‰Š‹ ŚŤŽŹ | 80 128 \i \i \i \i 16 10 | \uPQRS\u \uTUVW\u \uXYZ[\u \u\\]^_\u ‘’“ ”•–— ™š› śťžź | 90 144 \i \i \i \i 32 20 | !"# $%&' ()*+ ,-./  ˇ˘Ł ¤Ą¦§ ¨©Ş« ¬­®Ż | A0 160 \i \i \i \i 48 30 | 0123 4567 89:; <=>? °±˛ł ´µ¶· ¸ąş» Ľ˝ľż | B0 176 \i \i \i \i 64 40 | @ABC DEFG HIJK LMNO ŔÁÂĂ ÄĹĆÇ ČÉĘË ĚÍÎĎ | C0 192 \i \i \i \i 80 50 | PQRS TUVW XYZ[ \\]^_ ĐŃŇÓ ÔŐÖ× ŘŮÚŰ ÜÝŢß | D0 208 \i \i \i \i 96 60 | `abc defg hijk lmno ŕáâă äĺćç čéęë ěíîď | E0 224 \i \i \i \i 112 70 | pqrs tuvw xyz{ |}~ đńňó ôőö÷ řůúű üýţ˙ | F0 240 \i \i } {Paste \i \i \i \i \u\bPaste Mode\b\u turn off with \b^D\b or \b^[[201~\b \i \i } :windows #HOOK#4 common keybindings type ^@ TO ˙ abort ^K Q abort ^K ^Q abort ^K q arg ^Q Q arg ^Q ^Q arg ^Q q arg ^[ q q explode .k6 explode ^K I explode ^K ^I explode ^K i explode ^[ [ 1 7 ~ help .k1 help ^J help ^[ [ 1 1 ~ hnext ^[ . hprev ^[ , math ^Q M math ^Q ^M math ^Q m math ^[ q m mathins ^[ # mathres ^[ = msg ^[ H msg ^[ h nextw .k8 nextw ^K N nextw ^K ^N nextw ^K n nextw ^[ [ 1 9 ~ play ^[ 0 TO 9 prevw .k7 prevw ^K P prevw ^K ^P prevw ^K p prevw ^[ [ 1 8 ~ query ^[ / quote ` quote8 ^P record ^[ ( retype ^Q L retype ^Q ^L retype ^Q l retype ^[ q l rtn ^M shell ^K Z shell ^K ^Z shell ^K z stop ^[ ) :Paste type ^@ TO ˙ rtn ^M msg,"Entered bracketed paste mode",rtn ^[ [ 2 0 0 ~ helpcard,rtn,keymap,"main",rtn,msg,rtn ^[ [ 2 0 1 ~ helpcard,rtn,keymap,"main",rtn ^D :Pastecua type ^@ TO ˙ rtn ^M msg,"Entered bracketed paste mode",rtn ^[ [ 2 0 0 ~ helpcard,rtn,keymap,"cua",rtn,msg,rtn ^[ [ 2 0 1 ~ helpcard,rtn,keymap,"cua",rtn ^D :Pasteprompt type ^@ TO ˙ nop ^L keymap,"prompt",rtn,msg,rtn,rtn ^M msg,"Entered bracketed paste mode",rtn ^[ [ 2 0 0 ~ keymap,"prompt",rtn,msg,rtn ^[ [ 2 0 1 ~ keymap,"prompt",rtn ^D :main :inherit windows :def dosrch setmark,":",ffirst :def dorepl setmark,":",qrepl :def pastemain helpcard,"Paste",rtn,keymap,"Paste",rtn :def conflictmarker dosrch,"\\^\\[<>=]\\[<>=]\\[<>=]\\[<>=]\\[<>=]\\[<>=]\\[<>=]\\[ \\n]",rtn,rtn,ltarw :def fixwhitespace psh,setmark,":",eof," ",bof,"a",qrepl,"\\[",quote,"i",quote,"k",quote,"l",quote,"m ]\\+\\[",quote,"i",quote,"k",quote,"l",quote,"m ]\\$",rtn,rtn,rtn,"r",eof,rtn,ffirst,"\\^\\[^\\n]",rtn,"b",rtn,eol,markb,bof,delch,eof,markk,blkdel,ffirst,"\\?",rtn,"b",rtn,eol,rtn,gomark,":",eof :def freedroidz psh,splitw,prevw,scratch,"nbc-Output",rtn,nextw,save,markk,bol,markb,prevw,prevw,blkcpy,nextw,nextw,rtn,prevw,eol,"'",bol,qrepl,"'",rtn,rtn,"'\\\\''",rtn,"r",backs,backs,backs,bol,"LC_ALL=C; export LC_ALL; fn='",eol,"; p=--posix; sed $p -e q /dev/null 2>&1 || p=; r=$(sed $p -e 's[^^][&]g; s\\^\\\\^g' < Error: filename not *.nxc'; exit ;; esac; echo \"Compiling $fn\"; nbc -sm- -d \"$fn\" 2>&1; x=$?; if test $x = 0; then echo '==> OK'; else echo '==> Error code:' $x; fi) | tr '\\n' '' | sed $p -e 's!# *\\([^]*\\)File \"[^\"]*/\\('\"$r\"'\\)\" ; line \\([0-9]*\\)!\\2:\\3: \\1!g' -e 's!#\\([^]*\\)File \"\\([^\"]*\\)\" ; line \\([0-9]*\\)!\\2:\\3: \\1!g' | tr '' '\\n'",rtn,nmark,filt,"sh",rtn,rtn,"Press ^KQ to close this window!",rtn,parserr :def docompile edit,rtn,filt,query,parserr :def filtall nmark,filt,uparw :def pvsrch prevpos,gomark,":" :def inscurdate insf,"!date '+%Y-%m-%d'",rtn,eol,delch :def inscurtime insf,"!date '+%H:%M:%S'",rtn,eol,delch #HOOK#5 main keybindings setmark,":",uparw,gomark,":",begin_marking,uparw,toggle_marking ^[ [ 1 ; 2 A setmark,":",dnarw,gomark,":",begin_marking,dnarw,toggle_marking ^[ [ 1 ; 2 B setmark,":",rtarw,gomark,":",begin_marking,rtarw,toggle_marking ^[ [ 1 ; 2 C setmark,":",ltarw,gomark,":",begin_marking,ltarw,toggle_marking ^[ [ 1 ; 2 D setmark,":",bol,gomark,":",begin_marking,bol,toggle_marking ^[ [ 1 ; 2 H setmark,":",eol,gomark,":",begin_marking,eol,toggle_marking ^[ [ 1 ; 2 F setmark,":",bof,gomark,":",begin_marking,bof,toggle_marking ^[ [ 1 ; 6 H setmark,":",eof,gomark,":",begin_marking,eof,toggle_marking ^[ [ 1 ; 6 F pastemain ^[ P pastemain ^[ p pastemain ^[ [ 2 0 0 ~ nop ^[ [ 2 0 1 ~ backs ^? backs ^H backw ^[ o bknd ^K ' bkwdc ^Q G ^@ TO ˙ bkwdc ^Q ^G ^@ TO ˙ bkwdc ^Q g ^@ TO ˙ bkwdc ^[ q g ^@ TO ˙ blkcpy ^K C blkcpy ^K ^C blkcpy ^K c blkdel ^K Y blkdel ^K ^Y blkdel ^K y blkmove ^K V blkmove ^K ^V blkmove ^K v blksave ^K W blksave ^K ^W blksave ^K w bof ^Q R bof ^Q ^R bof ^Q r bof ^[ [ 1 ; 5 H bof ^[ q r home .kh home ^Q S home ^Q ^S home ^Q s home ^[ [ 1 ~ home ^[ [ 7 ~ home ^[ [ H home ^[ q s bos ^Q X bos ^Q ^X bos ^Q x bos ^[ q x byte ^Q O byte ^Q ^O byte ^Q o byte ^[ q o center ^K A center ^K ^A center ^K a col ^Q - col ^[ q - conflictmarker ^Q = conflictmarker ^[ q = crawll ^Q , crawll ^[ q , crawlr ^Q . crawlr ^[ q . delbol ^Q T delbol ^Q ^? delbol ^Q ^T delbol ^Q t delbol ^[ q ^? delbol ^[ q t delch .kD delch ^G delch ^[ [ 3 ~ deleol ^Q Y deleol ^Q ^Y deleol ^Q y deleol ^[ q y dellin ^Y delw ^T dnarw .kd dnarw ^X dnarw ^[ O B dnarw ^[ [ B dnslide ^Z edit ^K E edit ^K ^E edit ^K e eof ^Q C eof ^Q ^C eof ^Q c eof ^[ [ 1 ; 5 F eof ^[ q c eol .@7 eol .kH eol ^Q D eol ^Q ^D eol ^Q d eol ^[ [ 4 ~ eol ^[ [ 8 ~ eol ^[ [ F eol ^[ q d execmd ^[ - exsave ^K X exsave ^K ^X exsave ^K x dosrch ^Q F dosrch ^Q ^F dosrch ^Q f dosrch ^[ q f filt ^K / filtall .k9 filtall ^[ [ 2 0 ~ fixwhitespace ^K ] fmtblk ^K D fmtblk ^K ^D fmtblk ^K d format ^B fnext .k3 fnext ^L fnext ^[ [ 1 3 ~ freedroidz ^K F freedroidz ^K ^F freedroidz ^K f fwrdc ^Q H ^@ TO ˙ fwrdc ^Q ^H ^@ TO ˙ fwrdc ^Q h ^@ TO ˙ fwrdc ^[ q h ^@ TO ˙ gomark ^Q 0 TO 9 gomark ^[ q 0 TO 9 groww ^K G groww ^K ^G groww ^K g inscurdate ^[ @ inscurtime ^[ ! insf ^K R insf ^K ^R insf ^K r isrch ^[ T isrch ^[ t lindent ^K , line ^Q I line ^Q ^I line ^Q i line ^[ q i ltarw .kl ltarw ^S ltarw ^[ O D ltarw ^[ [ D ltarw ^[ s macros ^[ ? markb ^K B markb ^K ^B markb ^K b markk ^K K markk ^K ^K markk ^K k markl ^K L markl ^K ^L markl ^K l mode ^O mode,"T" .kI mode,"T" ^V mode,"T" ^[ [ 2 ~ mode,"T" ^[ [ L nextpos ^K = nextword ^F nextword ^[ [ 1 ; 5 C nmark ^K H nmark ^K ^H nmark ^K h nxterr ^[ M nxterr ^[ m open ^] docompile ^[ C docompile ^[ c parserr ^[ E parserr ^[ e pgdn .kN pgdn ^C pgdn ^[ [ 6 ~ pgdn ^[ [ G pgup .kP pgup ^R pgup ^[ [ 5 ~ pgup ^[ [ I play,"0" ^N prevpos ^Q P prevpos ^Q ^P prevpos ^Q p prevpos ^[ q p prevword ^A prevword ^[ [ 1 ; 5 D prverr ^[ N prverr ^[ n pvsrch ^Q V pvsrch ^Q ^V pvsrch ^Q v pvsrch ^[ q v dorepl ^Q A dorepl ^Q ^A dorepl ^Q a dorepl ^[ q a redo ^^ rindent ^K . rsrch ^[ R rsrch ^[ r rtarw .kr rtarw ^D rtarw ^[ O C rtarw ^[ [ C run ^[ ' save ^K S save ^K ^S save ^K s scratch,"(S) " ^K - setmark ^K 0 TO 9 shrinkw ^K T shrinkw ^K ^T shrinkw ^K t splitw ^K O splitw ^K ^O splitw ^K o stat ^Q ? stat ^[ q ? tag ^K ; tomarkb ^Q B tomarkb ^Q ^B tomarkb ^Q b tomarkb ^[ q b tomarkk ^Q K tomarkk ^Q ^K tomarkk ^Q k tomarkk ^[ q k rvmatch ^Q [ tomatch ^Q ] rvmatch ^Q ^[ tomatch ^Q ^] rvmatch ^[ q [ tomatch ^[ q ] tos ^Q E tos ^Q ^E tos ^Q e tos ^[ q e undo ^U undo ^_ uparw .ku uparw ^E uparw ^[ O A uparw ^[ [ A upslide ^W yankpop ^[ Y yankpop ^[ y :prompt :inherit main :def pasteprompt keymap,"Pasteprompt",rtn,msg,"Entered bracketed paste mode",rtn abort ^C abort ^U complete ^I nop ^L pasteprompt ^[ P pasteprompt ^[ p pasteprompt ^[ [ 2 0 0 ~ :menu :inherit windows abort ^U abort ^[ ^[ backsmenu ^? backsmenu ^H bofmenu ^Q R bofmenu ^Q ^R bofmenu ^Q r bofmenu ^[ [ 1 ; 5 H bofmenu ^[ q r bolmenu .kh bolmenu ^Q S bolmenu ^Q ^S bolmenu ^Q s bolmenu ^[ [ 1 ~ bolmenu ^[ [ 7 ~ bolmenu ^[ [ H bolmenu ^[ q s dnarwmenu .kd dnarwmenu ^X dnarwmenu ^[ O B dnarwmenu ^[ [ B eofmenu ^Q C eofmenu ^Q ^C eofmenu ^Q c eofmenu ^[ [ 1 ; 5 F eofmenu ^[ q c eolmenu .@7 eolmenu .kH eolmenu ^Q D eolmenu ^Q ^D eolmenu ^Q d eolmenu ^[ [ 4 ~ eolmenu ^[ [ 8 ~ eolmenu ^[ [ F eolmenu ^[ q d ltarwmenu .kl ltarwmenu ^S ltarwmenu ^[ O D ltarwmenu ^[ [ D ltarwmenu ^[ s pgdnmenu .kN pgdnmenu ^C pgdnmenu ^[ [ 6 ~ pgdnmenu ^[ [ G pgupmenu .kP pgupmenu ^R pgupmenu ^[ [ 5 ~ pgupmenu ^[ [ I rtarwmenu .kr rtarwmenu ^D rtarwmenu ^[ O C rtarwmenu ^[ [ C rtn SP rtn ^J tabmenu ^I uparwmenu .ku uparwmenu ^E uparwmenu ^[ O A uparwmenu ^[ [ A :query :inherit windows :querya type ^@ TO ˙ :querysr type ^@ TO ˙ :cua :inherit main #HOOK#6 extra keybindings in CUA mode :def pastecua helpcard,"Paste",rtn,keymap,"Pastecua",rtn undo ^Z blkdel,nmark ^X copy ^C yank ^V pastecua ^[ P pastecua ^[ p pastecua ^[ [ 2 0 0 ~ jupp/kbd.c010064400000000000000000000125751363731415000077040ustar00/* * Key-map handler * Copyright * (C) 1992 Joseph H. Allen * * This file is part of JOE (Joe's Own Editor) */ #include "config.h" #include "types.h" __RCSID("$MirOS: contrib/code/jupp/kbd.c,v 1.15 2020/03/27 06:08:13 tg Exp $"); #include #include #include "kbd.h" #include "macro.h" #include "termcap.h" #include "utils.h" #include "vs.h" /* Create a KBD */ KBD *mkkbd(KMAP *kmap) { KBD *kbd = malloc(sizeof(KBD)); kbd->topmap = kmap; kbd->curmap = kmap; kbd->x = 0; return kbd; } /* Eliminate a KBD */ void rmkbd(KBD *k) { free(k); } /* Process next key for KBD */ void *dokey(KBD *kbd, int n) { void *bind = NULL; /* If we were passed a negative character */ if (n < 0) n += 256; if ((size_t)n >= (size_t)256) return (NULL); /* If we're starting from scratch, clear the keymap sequence buffer */ if (kbd->curmap == kbd->topmap) kbd->x = 0; if (kbd->curmap->keys[n].k == 1) { /* A prefix key was found */ kbd->seq[kbd->x++] = n; kbd->curmap = kbd->curmap->keys[n].value.submap; } else { /* A complete key sequence was entered or an unbound key was found */ bind = kbd->curmap->keys[n].value.bind; /* kbd->seq[kbd->x++]=n; */ kbd->x = 0; kbd->curmap = kbd->topmap; } return bind; } /* Return key code (0‥255) for key name or -1 for syntax error */ /* coverity[ -tainted_data_return ] */ static int keyval(unsigned char *s) { if (s[0] == '^' && s[1] && !s[2]) if (s[1] == '?') return 127; else return s[1] & 0x1F; else if (((s[0] | 0x20) == 's') && ((s[1] | 0x20) == 'p') && !s[2]) return ' '; else if (s[1] || !s[0]) return -1; else return (unsigned char) s[0]; } /* Create an empty keymap */ KMAP *mkkmap(void) { KMAP *kmap = calloc(1, sizeof(KMAP)); return kmap; } /* Eliminate a keymap */ void rmkmap(KMAP *kmap) { int x; if (!kmap) return; for (x = 0; x != 256; ++x) if (kmap->keys[x].k == 1) rmkmap(kmap->keys[x].value.submap); free(kmap); } /* Parse a range */ static unsigned char *range(unsigned char *seq, int *vv, int *ww) { unsigned char c; int x, v, w; for (x = 0; seq[x] && seq[x] != ' '; ++x) ; /* Skip to a space */ c = seq[x]; seq[x] = 0; /* Zero terminate the string */ v = keyval(seq); /* Get key */ w = v; seq[x] = c; /* Restore the space or NUL */ if (w < 0) return NULL; for (seq += x; *seq == ' '; ++seq) ; /* Skip over spaces */ /* Check for 'TO ' */ if ((seq[0] | 0x20) == 't' && (seq[1] | 0x20) == 'o' && seq[2] == ' ') { for (seq += 2; *seq == ' '; ++seq) ; /* Skip over spaces */ for (x = 0; seq[x] && seq[x] != ' '; ++x) ; /* Skip to space */ c = seq[x]; seq[x] = 0; /* Zero terminate the string */ w = keyval(seq); /* Get key */ seq[x] = c; /* Restore the space or NUL */ if (w < 0) return NULL; for (seq += x; *seq == ' '; ++seq) ; /* Skip over spaces */ } if (v > w) return NULL; *vv = v; *ww = w; return seq; } /* Add a binding to a keymap */ static KMAP * kbuild(CAP *cap, KMAP *kmap, unsigned char *seq, void *bind, int *err, const unsigned char *capseq, int seql) { int v, w; if (!seql && seq[0] == '.' && seq[1]) { int x, c; const unsigned char *cs; unsigned char *s; for (x = 0; seq[x] && seq[x] != ' '; ++x) ; c = seq[x]; seq[x] = 0; cs = jgetstr(cap, seq + 1); seq[x] = c; if (cs && (s = tcompile(cap, cs, 0, 0, 0, 0)) && (sLEN(s) > 1 || (signed char)s[0] < 0)) { capseq = s; seql = sLEN(s); for (seq += x; *seq == ' '; ++seq) ; } else { *err = -2; return kmap; } } if (seql) { v = w = (unsigned char) *capseq++; --seql; } else { seq = range(seq, &v, &w); if (!seq) { *err = -1; return kmap; } } if (!kmap) kmap = mkkmap(); /* Create new keymap if 'kmap' was NULL */ /* Make bindings between v and w */ while (v <= w) { if (*seq || seql) { if (kmap->keys[v].k == 0) kmap->keys[v].value.submap = NULL; kmap->keys[v].k = 1; kmap->keys[v].value.submap = kbuild(cap, kmap->keys[v].value.bind, seq, bind, err, capseq, seql); } else { if (kmap->keys[v].k == 1) rmkmap(kmap->keys[v].value.submap); kmap->keys[v].k = 0; kmap->keys[v].value.bind = /* This bit of code sticks the key value in the macro */ (v == w ? macstk(bind, v) : dupmacro(macstk(bind, v))); } ++v; } return kmap; } int kadd(CAP *cap, KMAP *kmap, unsigned char *seq, void *bind) { int err = 0; kbuild(cap, kmap, seq, bind, &err, NULL, 0); return err; } void kcpy(KMAP *dest, KMAP *src) { int x; for (x = 0; x != 256; ++x) if (src->keys[x].k == 1) { if (dest->keys[x].k != 1) { dest->keys[x].k = 1; dest->keys[x].value.submap = mkkmap(); } kcpy(dest->keys[x].value.submap, src->keys[x].value.submap); } else if (src->keys[x].k == 0 && src->keys[x].value.bind) { if (dest->keys[x].k == 1) rmkmap(dest->keys[x].value.submap); dest->keys[x].value.bind = src->keys[x].value.bind; dest->keys[x].k = 0; } } /* Remove a binding from a keymap */ int kdel(KMAP *kmap, unsigned char *seq) { int err = 1; int v, w; seq = range(seq, &v, &w); if (!seq) return -1; /* Clear bindings between v and w */ while (v <= w) { if (*seq) { if (kmap->keys[v].k == 1) { int r = kdel(kmap->keys[v].value.submap, seq); if (err != -1) err = r; } } else { if (kmap->keys[v].k == 1) rmkmap(kmap->keys[v].value.submap); kmap->keys[v].k = 0; kmap->keys[v].value.bind = NULL; if (err != -1) err = 0; } ++v; } return err; } jupp/kbd.h010064400000000000000000000040641363731763300077140ustar00/* * Key-map handler * Copyright * (C) 1992 Joseph H. Allen * * This file is part of JOE (Joe's Own Editor) */ #ifndef JUPP_KBD_H #define JUPP_KBD_H #ifdef EXTERN __IDSTRING(rcsid_kbd_h, "$MirOS: contrib/code/jupp/kbd.h,v 1.7 2020/03/27 06:38:56 tg Exp $"); #endif /* KMAP *mkkmap(void); * Create an empty keymap */ KMAP *mkkmap(void); /* void rmkmap(KMAP *kmap); * Free a key map */ void rmkmap(KMAP *kmap); /* int kadd(KMAP *kmap,char *seq,void *bind); * Add a key sequence binding to a key map * * Returns 0 for success * -1 for for invalid key sequence * * A valid key sequence is one or more keys seperated with spaces. A key * is a single character or one of the following strings: * * ^? 127 (DEL) * * ^@ - ^_ Control characters * * SP 32 (space character) * * UP, DOWN, LEFT, RIGHT, * F0 - F10, DEL, INS, HOME, * END, PGUP, PGDN termcap special characters * * In addition, the last key of a key sequence may be replaced with * a range-fill of the form: TO * * So for example, if the sequence: ^K A TO Z * is specified, then the key sequences * ^K A, ^K B, ^K C, ... ^K Z are all bound. */ int kadd(CAP *cap, KMAP *kmap, unsigned char *seq, void *bind); /* void kcpy(KMAP *dest,KMAP *src); * Copy all of the entries in the 'src' keymap into the 'dest' keymap */ void kcpy(KMAP *dest, KMAP *src); /* int kdel(KMAP *kmap,char *seq); * Delete a binding from a keymap * * Returns 0 for success * -1 if the given key sequence was invalid * 1 if the given key sequence did not exist */ int kdel(KMAP *kmap, unsigned char *seq); /* KBD *mkkbd(KMAP *kmap); Create a keyboard handler which uses the given keymap */ KBD *mkkbd(KMAP *kmap); /* void rmkbd(KBD *); * * Eliminate a keyboard handler */ void rmkbd(KBD *k); /* void *dokey(KBD *kbd,int k); Handle a key for a KBD: Returns 0 for invalid or prefix keys Returns binding for a completed key sequence */ void *dokey(KBD *kbd, int n); #endif jupp/macro.c010064400000000000000000000257301363731415000102420ustar00/* * Keyboard macros * Copyright * (C) 1992 Joseph H. Allen * * This file is part of JOE (Joe's Own Editor) */ #include "config.h" #include "types.h" __RCSID("$MirOS: contrib/code/jupp/macro.c,v 1.21 2020/03/27 06:08:13 tg Exp $"); #include #include #include "b.h" #include "cmd.h" #include "macro.h" #include "main.h" #include "pw.h" #include "qw.h" #include "tty.h" #include "ublock.h" #include "uedit.h" #include "umath.h" #include "undo.h" #include "utils.h" #include "vs.h" #include "charmap.h" #include "w.h" MACRO *freemacros = NULL; /* Create a macro */ MACRO *mkmacro(int k, int arg, int n, CMD *cmd) { MACRO *macro; if (!freemacros) { int x; /* FIXME: why limit to 64? */ macro = ralloc(64, sizeof(MACRO)); for (x = 0; x != 64; ++x) { macro[x].steps = (MACRO **) freemacros; freemacros = macro + x; } } macro = freemacros; freemacros = (MACRO *) macro->steps; macro->steps = NULL; macro->size = 0; macro->arg = arg; macro->n = n; macro->cmd = cmd; macro->k = k; return macro; } /* Eliminate a macro */ void rmmacro(MACRO *macro) { if (macro) { if (macro->steps) { int x; for (x = 0; x != macro->n; ++x) rmmacro(macro->steps[x]); free(macro->steps); } macro->steps = (MACRO **) freemacros; freemacros = macro; } } /* Add a step to block macro */ void addmacro(MACRO *macro, MACRO *m) { if (macro->n == macro->size) { if (macro->steps) macro->steps = realloc(macro->steps, (macro->size += 8) * sizeof(MACRO *)); else macro->steps = ralloc((size_t)(macro->size = 8), sizeof(MACRO *)); } macro->steps[macro->n++] = m; } /* Duplicate a macro */ MACRO *dupmacro(MACRO *mac) { MACRO *m = mkmacro(mac->k, mac->arg, mac->n, mac->cmd); if (mac->steps) { int x; m->steps = ralloc((size_t)(m->size = mac->n), sizeof(MACRO *)); for (x = 0; x != m->n; ++x) m->steps[x] = dupmacro(mac->steps[x]); } return m; } /* Set key part of macro */ MACRO *macstk(MACRO *m, int k) { m->k = k; return m; } /* Set arg part of macro */ MACRO *macsta(MACRO *m, int a) { m->arg = a; return m; } /* Parse text into a macro * sta is set to: ending position in buffer for no error. * -1 for syntax error * -2 for need more input */ MACRO *mparse(MACRO *m, unsigned char *buf, int *sta) { int y, c, x = 0; macroloop: /* Skip whitespace */ while (joe_isblank(buf[x])) ++x; /* If the buffer is only whitespace then treat as unknown command */ if (!buf[x]) { *sta = -1; return NULL; } /* Do we have a string? */ if (buf[x] == '\"') { ++x; while (buf[x] && buf[x] != '\"') { if (buf[x] == '\\' && buf[x + 1]) { ++x; switch (buf[x]) { case 'n': buf[x] = 10; break; case 'r': buf[x] = 13; break; case 'b': buf[x] = 8; break; case 'f': buf[x] = 12; break; case 'a': buf[x] = 7; break; case 't': buf[x] = 9; break; case 'x': x += 1 + ustoc_hex(buf + x + 1, &c, USTOC_MAX); break; case '0': case '1': case '2': case '3': case '4': case '5': case '6': case '7': case '8': case '9': x += ustoc_oct(buf + x, &c, USTOC_MAX); break; } } if (m) { if (!m->steps) { MACRO *macro = m; m = mkmacro(-1, 1, 0, NULL); addmacro(m, macro); } } else m = mkmacro(-1, 1, 0, NULL); addmacro(m, mkmacro(buf[x], 1, 0, findcmd(UC "type"))); ++x; } if (buf[x] == '\"') ++x; } /* Do we have a command? */ else { for (y = x; buf[y] && buf[y] != ',' && buf[y] != ' ' && buf[y] != '\t' && buf[y] != '\n' && buf[x] != '\r'; ++y) ; if (y != x) { CMD *cmd; c = buf[y]; buf[y] = 0; cmd = findcmd(buf + x); if (!cmd) { *sta = -1; return NULL; } else if (m) { if (!m->steps) { MACRO *macro = m; m = mkmacro(-1, 1, 0, NULL); addmacro(m, macro); } addmacro(m, mkmacro(-1, 1, 0, cmd)); } else m = mkmacro(-1, 1, 0, cmd); buf[x = y] = c; } } /* Skip whitespace */ while (joe_isblank(buf[x])) ++x; /* Do we have a comma? */ if (buf[x] == ',') { ++x; while (joe_isblank(buf[x])) ++x; if (buf[x] && buf[x] != '\r' && buf[x] != '\n') goto macroloop; *sta = -2; return m; } /* Done */ *sta = x; return m; } /* Convert macro to text */ static unsigned char *ptr; static int first; static int instr; static unsigned char *unescape(unsigned char *uptr, int c) { if (c == '"') { *uptr++ = '\\'; *uptr++ = '"'; } else if (c == '\\') { *uptr++ = '\\'; *uptr++ = '\\'; } else if (c == '\'') { *uptr++ = '\\'; *uptr++ = '\''; } else if (c < 32 || c > 126) { /* FIXME: what if c > 256 or c < 0 ? */ *uptr++ = '\\'; *uptr++ = 'x'; *uptr++ = "0123456789ABCDEF"[c >> 4]; *uptr++ = "0123456789ABCDEF"[c & 15]; } else *uptr++ = c; return uptr; } static void domtext(MACRO *m) { int x; if (!m) return; if (m->steps) for (x = 0; x != m->n; ++x) domtext(m->steps[x]); else { if (instr && strcmp(m->cmd->name, "type")) { *ptr++ = '\"'; instr = 0; } if (first) first = 0; else if (!instr) *ptr++ = ','; if (!strcmp(m->cmd->name, "type")) { if (!instr) { *ptr++ = '\"'; instr = 1; } ptr = unescape(ptr, m->k); } else { for (x = 0; m->cmd->name[x]; ++x) *ptr++ = m->cmd->name[x]; if (!strcmp(m->cmd->name, "play") || !strcmp(m->cmd->name, "gomark") || !strcmp(m->cmd->name, "setmark") || !strcmp(m->cmd->name, "record") || !strcmp(m->cmd->name, "uarg")) { *ptr++ = ','; *ptr++ = '"'; ptr = unescape(ptr, m->k); *ptr++ = '"'; } } } } unsigned char *mtext(unsigned char *s, MACRO *m) { ptr = s; first = 1; instr = 0; domtext(m); if (instr) *ptr++ = '\"'; *ptr = 0; return s; } /* Keyboard macro recorder */ static MACRO *kbdmacro[10]; static int playmode[10]; struct recmac *recmac = NULL; static void unmac(void) { if (recmac) rmmacro(recmac->m->steps[--recmac->m->n]); } void chmac(void) { if (recmac && recmac->m->n) recmac->m->steps[recmac->m->n - 1]->k = 3; } static void record(MACRO *m) { if (recmac) addmacro(recmac->m, dupmacro(m)); } /* Query for user input */ int uquery(BW *bw) { int ret; struct recmac *tmp = recmac; recmac = NULL; ret = edloop(1); recmac = tmp; return ret; } /* Macro execution */ MACRO *curmacro = NULL; /* Set if we're in a macro */ static int macroptr; static int arg = 0; /* Repeat argument */ static int argset = 0; /* Set if 'arg' is set */ int exmacro(MACRO *m, int u) { int larg; /*XXX why is this local here and global below? */ int negarg = 0; int flg = 0; CMD *cmd = NULL; int ret = 0; if (argset) { larg = arg; arg = 0; argset = 0; if (larg < 0) { negarg = 1; larg = -larg; } if (m->steps) { ; /* dead store: negarg = 0; */ } else { cmd = m->cmd; if (!cmd->arg) larg = 0; else if (negarg) { if (cmd->negarg) cmd = findcmd(cmd->negarg); else larg = 0; } } } else { cmd = m->cmd; larg = 1; } if (m->steps || larg != 1 || !(cmd->flag & EMINOR) || maint->curwin->watom->what == TYPEQW /* Undo work right for s & r */ ) flg = 1; if (flg && u) umclear(); while (larg-- && !leave && !ret) if (m->steps) { MACRO *tmpmac = curmacro; int tmpptr = macroptr; int x = 0; int stk = nstack; while (m && x != m->n && !leave && !ret) { MACRO *d; d = m->steps[x++]; curmacro = m; macroptr = x; ret = exmacro(d, 0); m = curmacro; x = macroptr; } curmacro = tmpmac; macroptr = tmpptr; while (nstack > stk) upop(NULL); } else ret = execmd(cmd, m->k); if (leave) return ret; if (flg && u) umclear(); if (u) undomark(); return ret; } /* Execute a macro */ int exemac(MACRO *m) { record(m); return exmacro(m, 1); } /* Keyboard macro user routines */ static int dorecord(BW *bw, int c, void *object, int *notify) { int n; struct recmac *r; if (notify) *notify = 1; if (c > '9' || c < '0') { nungetc(c); return -1; } for (n = 0; n != 10; ++n) if (playmode[n]) return -1; r = malloc(sizeof(struct recmac)); r->m = mkmacro(0, 1, 0, NULL); r->next = recmac; r->n = c - '0'; recmac = r; return 0; } int urecord(BW *bw, int c) { if (c >= '0' && c <= '9') return dorecord(bw, c, NULL, NULL); else if (mkqw(bw->parent, sc("Macro to record (0-9 or ^C to abort): "), dorecord, NULL, NULL, NULL)) return 0; else return -1; } extern volatile int dostaupd; int ustop(void) { unmac(); if (recmac) { struct recmac *r = recmac; MACRO *m; dostaupd = 1; recmac = r->next; if (kbdmacro[r->n]) rmmacro(kbdmacro[r->n]); kbdmacro[r->n] = r->m; if (recmac) record(m = mkmacro(r->n + '0', 1, 0, findcmd(UC "play"))), rmmacro(m); free(r); } return 0; } static int doplay(BW *bw, int c, void *object, int *notify) { if (notify) *notify = 1; if (c >= '0' && c <= '9') { int ret; c -= '0'; if (playmode[c] || !kbdmacro[c]) return -1; playmode[c] = 1; ret = exmacro(kbdmacro[c], 0); playmode[c] = 0; return ret; } else { nungetc(c); return -1; } } int umacros(BW *bw) { int x; unsigned char buf[1024]; p_goto_eol(bw->cursor); for (x = 0; x != 10; ++x) if (kbdmacro[x]) { mtext(buf, kbdmacro[x]); binss(bw->cursor, buf); p_goto_eol(bw->cursor); joe_snprintf_2((char *)buf, JOE_MSGBUFSIZE, "\t^K %c\tMacro %d", x + '0', x); binss(bw->cursor, buf); p_goto_eol(bw->cursor); binsc(bw->cursor, '\n'); pgetc(bw->cursor); } return 0; } int uplay(BW *bw, int c) { if (c >= '0' && c <= '9') return doplay(bw, c, NULL, NULL); else if (mkqwna(bw->parent, sc("Play-"), doplay, NULL, NULL, NULL)) return 0; else return -1; } /* Repeat-count setting */ static int doarg(BW *bw, unsigned char *s, void *object, int *notify) { long num; if (notify) *notify = 1; num = calcl(bw, s); if (merrf) { vsrm(s); msgnw(bw->parent, merrt); return -1; } arg = num; argset = 1; vsrm(s); return 0; } int uarg(BW *bw) { if (wmkpw(bw->parent, UC "No. times to repeat next command (^C to abort): ", NULL, doarg, NULL, NULL, utypebw, NULL, NULL, locale_map)) return 0; else return -1; } int unaarg; int negarg; static int douarg(BW *bw, int c, void *object, int *notify) { if (c == '-') negarg = !negarg; else if (c >= '0' && c <= '9') unaarg = unaarg * 10 + c - '0'; else if (c == 'U' - '@') if (unaarg) unaarg *= 4; else unaarg = 16; else if (c == 7 || c == 3 || c == 32) { if (notify) *notify = 1; return -1; } else { nungetc(c); if (unaarg) arg = unaarg; else if (negarg) arg = 1; else arg = 4; if (negarg) arg = -arg; argset = 1; if (notify) *notify = 1; return 0; } joe_snprintf_2((char *)msgbuf, JOE_MSGBUFSIZE, "Repeat %s%d", negarg ? "-" : "", unaarg); if (mkqwna(bw->parent, sz(msgbuf), douarg, NULL, NULL, notify)) return 0; else return -1; } int uuarg(BW *bw, int c) { unaarg = 0; negarg = 0; if ((c >= '0' && c <= '9') || c == '-') return douarg(bw, c, NULL, NULL); else if (mkqwna(bw->parent, sc("Repeat"), douarg, NULL, NULL, NULL)) return 0; else return -1; } jupp/macro.h010064400000000000000000000021201363731763400102450ustar00/* * Keyboard macros * Copyright * (C) 1992 Joseph H. Allen * * This file is part of JOE (Joe's Own Editor) */ #ifndef JUPP_MACRO_H #define JUPP_MACRO_H #ifdef EXTERN __IDSTRING(rcsid_macro_h, "$MirOS: contrib/code/jupp/macro.h,v 1.6 2020/03/27 06:38:57 tg Exp $"); #endif /* Set when macro is recording: for status line */ extern struct recmac *recmac; /* Macro construction functions */ MACRO *mkmacro(int k, int arg, int n, CMD *cmd); void addmacro(MACRO *macro, MACRO *m); MACRO *dupmacro(MACRO *mac); void rmmacro(MACRO *macro); MACRO *macstk(MACRO *m, int k); MACRO *macsta(MACRO *m, int a); void chmac(void); /* Text to macro / Macro to text */ MACRO *mparse(MACRO *m, unsigned char *buf, int *sta); unsigned char *mtext(unsigned char *s, MACRO *m); /* Execute a macro */ extern MACRO *curmacro; int exemac(MACRO *m); int exmacro(MACRO *m, int u); /* Keyboard macros user interface */ int uplay(BW *bw, int c); int ustop(void); int urecord(BW *bw, int c); int uquery(BW *bw); int umacros(BW *bw); /* Repeat prefix user command */ int uarg(BW *bw); int uuarg(BW *bw, int c); #endif jupp/main.c010064400000000000000000000247071426611552300100720ustar00#define JUPP_IS_COPYRIGHT_C_BY "2022 mirabilos" /*- * Copyright (c) 2004ff. Thorsten Glaser * Copyright (C) 1992 Joseph H. Allen * * This file is part of "jupp", a variant of Joe's Own Editor "JOE". * * jupp is free software; you can redistribute and/or modify it, deal * in the work, etc. under the terms of the GNU General Public Licen- * se, version 1 (of February 1989) as published by the Free Software * Foundation, reproduced in the file COPYING in the jupp source code * distribution. If jupp is combined with other independent work, for * example libraries or when using crunchgen, into a combined binary, * that may be conveyed under any version of the GPL, as published by * the Free Software Foundation, and any compatible licence permitted * by any version of the GPL, as above. * * This work is provided "AS IS" and WITHOUT WARRANTY of any kind, to * the utmost extent permitted by applicable law, neither express nor * implied; without malicious intent or gross negligence. In no event * may a licensor, author or contributor be held liable for indirect, * direct, other damage, loss, or other issues arising in any way out * of dealing in the work, even if advised of the possibility of such * damage or existence of a defect, except proven that it results out * of said person's immediate fault when using the work as intended. *- * Editor startup and main edit loop */ #define EXTERN #include "config.h" #include "types.h" __RCSID("$MirOS: contrib/code/jupp/main.c,v 1.49 2022/07/21 00:18:00 tg Exp $"); #include #include #include #include #include "b.h" #include "help.h" #include "kbd.h" #include "macro.h" #include "main.h" #include "path.h" #include "rc.h" #include "scrn.h" #include "termcap.h" #include "tw.h" #include "vfile.h" #include "vs.h" #include "w.h" #include "charmap.h" #include "syntax.h" #include "utils.h" extern int mid, dspasis, pgamnt, nobackups, lightoff, exask, lines, columns, dopadding, marking, dobeep; extern int idleout; /* Clear to use /dev/tty for screen */ extern unsigned char *joeterm; int help = 0; /* Set to have help on when starting */ int nonotice = 0; /* Set to prevent copyright notice */ int orphan = 0; int main_rv = 0; extern unsigned char closedall; unsigned char *exmsg = NULL; /* Message to display when exiting the editor */ SCREEN *maint; /* Main edit screen */ const char null[] = ""; #ifdef __CYGWIN__ extern unsigned char *cygwin32_cmdline(void); #endif #define is_ofsopt(ap) (0[ap] == '+' && 1[ap] >= '0' && 1[ap] <= '9') /* Make windows follow cursor */ void dofollows(void) { W *w = maint->curwin; do { if (w->y != -1 && w->watom->follow && w->object.base) w->watom->follow(w->object); w = (W *) (w->link.next); } while (w != maint->curwin); } /* Update screen */ int dostaupd = 1; extern unsigned char staupd; void edupd(int flg) { W *w; int wid, hei; if (dostaupd) { staupd = 1; dostaupd = 0; } ttgtsz(&wid, &hei); if ((wid >= 2 && wid != maint->w) || (hei >= 1 && hei != maint->h)) { nresize(maint->t, wid, hei); sresize(maint); } dofollows(); ttflsh(); nscroll(maint->t); help_display(maint); w = maint->curwin; do { if (w->y != -1) { if (w->object.base && w->watom->disp) w->watom->disp(w->object, flg); msgout(w); } w = (W *) (w->link.next); } while (w != maint->curwin); cpos(maint->t, maint->curwin->x + maint->curwin->curx, maint->curwin->y + maint->curwin->cury); staupd = 0; } static unsigned char ahead = 0; static unsigned char ungot = 0; static int ungotc = 0; void nungetc(int c) { if (c != 'C' - '@' && c != 'M' - '@') { chmac(); ungot = 1; ungotc = c; } } int edloop(int flg) { int term = 0; int ret = 0; if (flg) { if (maint->curwin->watom->what == TYPETW) return 0; else maint->curwin->notify = &term; } while (!leave && (!flg || !term)) { MACRO *m; int c; if (exmsg && !flg) { vsrm(exmsg); exmsg = NULL; } edupd(1); if (!ahead && !have) ahead = 1; if (ungot) { c = ungotc; ungot = 0; } else c = ttgetc(); if (!ahead && c == 10) c = 13; m = dokey(maint->curwin->kbd, c); if (maint->curwin->main && maint->curwin->main != maint->curwin) { int x = maint->curwin->kbd->x; maint->curwin->main->kbd->x = x; if (x) maint->curwin->main->kbd->seq[x - 1] = maint->curwin->kbd->seq[x - 1]; } if (m) ret = exemac(m); } if (term == -1) return -1; else return ret; } unsigned char **mainenv; static void genjuppverstr(void) { int uninvert = fdefault.hmsg && fdefault.hmsg[0] == '\\' && fdefault.hmsg[1] == 'i'; joe_snprintf_5((char *)msgbuf, JOE_MSGBUFSIZE, "\\i[ Joe's Own Editor v" VERSION " | %s | %s " JUPP_IS_COPYRIGHT_C_BY " ]%s%s%s", joe_mapname(locale_map), joe_maputf(locale_map) ? "©" : "(c)", uninvert ? "\\i " : fdefault.hmsg ? " " : "", uninvert ? fdefault.hmsg + 2 : fdefault.hmsg ? fdefault.hmsg : "", uninvert ? "" : "\\i"); } static int main_init(char **argv, char **envp, SCRN **np) { CAP *cap; unsigned char *s; unsigned char *run; SCRN *n; W *opened = NULL; int omid; int backopt; int c; jalloc_init(); init_JOERC(); joe_locale(); mainenv = (unsigned char **)envp; run = namprt(argv[0]); if ((s = (unsigned char *)getenv("LINES")) != NULL) lines = ustol(s, NULL, USTOL_DEC | USTOL_EOS); if ((s = (unsigned char *)getenv("COLUMNS")) != NULL) columns = ustol(s, NULL, USTOL_DEC | USTOL_EOS); if ((s = (unsigned char *)getenv("BAUD")) != NULL) Baud = ustol(s, NULL, USTOL_DEC | USTOL_EOS); if (getenv("DOPADDING")) dopadding = 1; if (getenv("NOXON")) noxon = 1; if ((s = (unsigned char *)getenv("JOETERM")) != NULL) joeterm = s; if (!(cap = getcap(NULL, 9600, NULL))) { fprintf(stderr, "Couldn't load termcap/terminfo entry\n"); return 1; } s = (unsigned char *)getenv("HOME"); if (s) { s = vsncpy(NULL, 0, sz(s)); s = vsncpy(sv(s), sc("/.")); s = vsncpy(sv(s), sv(run)); s = vsncpy(sv(s), sc("rc")); c = procrc(cap, s); if (c == 0) goto donerc; if (c == 1) { unsigned char buf[8]; fprintf(stderr, "There were errors in '%s'. Use anyway (y,n)? ", s); fflush(stderr); if (fgets((char *)buf, 8, stdin) != NULL && (buf[0] | 0x20) == 'y') goto donerc; } } if (has_JOERC) { vsrm(s); s = vsncpy(NULL, 0, sz(get_JOERC)); s = vsncpy(sv(s), sv(run)); s = vsncpy(sv(s), sc("rc")); c = procrc(cap, s); if (c == 0) goto donerc; if (c == 1) { unsigned char buf[8]; fprintf(stderr, "There were errors in '%s'. Use anyway (y,n)? ", s); fflush(stderr); if (fgets((char *)buf, 8, stdin) != NULL && (buf[0] | 0x20) == 'y') goto donerc; } } /* Try built-in joerc */ vsrm(s); s = vsncpy(NULL, 0, sc("*")); s = vsncpy(sv(s), sv(run)); s = vsncpy(sv(s), sc("rc")); c = procrc(cap, s); if (c == 0) goto donerc; if (c == 1) { unsigned char buf[8]; fprintf(stderr, "There were errors in '%s'. Use anyway (y,n)? ", s); fflush(stderr); if (fgets((char *)buf, 8, stdin) != NULL && (buf[0] | 0x20) == 'y') goto donerc; } fprintf(stderr, "Couldn't open '%s'\n", s); return 1; donerc: help_init(s); for (c = 1; argv[c]; ++c) { if (argv[c][0] == '-') { #ifdef __CYGWIN__ if (!strcmp(argv[c], "-CYGhack")) { s = cygwin32_cmdline(); s = strstr(s, "-CYGhack"); if (s) { s += /* strlen("-CYGhack") */ 8; while (*s == ' ' || *s == '\t') ++s; argv[c] = s; argv[c + 1] = NULL; break; } } #endif if (argv[c][1]) switch (glopt(argv[c] + 1, argv[c + 1], NULL, 1)) { case 0: fprintf(stderr, "Unknown option '%s'\n", argv[c]); break; case 1: break; case 2: ++c; break; } else idleout = 0; } } #if HAVE_ISATTY if (idleout && (!isatty(0) || !isatty(1))) idleout = 0; #endif if (!(n = nopen(cap))) return 1; maint = screate(n); vmem = vtmp(); for (c = 1, backopt = 0; argv[c]; ++c) if (is_ofsopt(argv[c])) { if (!backopt) backopt = c; } else if (argv[c][0] == '-' && argv[c][1]) { if (!backopt) backopt = c; if (glopt(argv[c] + 1, argv[c + 1], NULL, 0) == 2) ++c; } else { B *b = bfind(argv[c]); BW *bw = NULL; int er = error; if (!orphan || !opened) { bw = wmktw(maint, b); if (!bw) goto wmktw_failed; if (er) msgnwt(bw->parent, msgs[-er]); } else b->orphan = 1; if (bw) { long lnum = 0; bw->o.readonly = bw->b->rdonly; if (backopt) { unsigned char *old_context; old_context = bw->o.context; while (backopt != c) { if (is_ofsopt(argv[backopt])) { lnum = ustol(argv[backopt] + 1, NULL, USTOL_TRIM | USTOL_EOS); ++backopt; } else { if (glopt(argv[backopt] + 1, argv[backopt + 1], &bw->o, 0) == 2) backopt += 2; else backopt += 1; lazy_opts(&bw->o); } } if (old_context != bw->o.context) { /* update keymap */ rmkbd(bw->parent->kbd); bw->parent->kbd = mkkbd(kmap_getcontext(bw->o.context, 1)); } } bw->b->o = bw->o; bw->b->rdonly = bw->o.readonly; if (!opened || opened == (void *)&opened) opened = bw->parent; maint->curwin = bw->parent; closedall = 0; if (er == -1 && bw->o.mnew) exemac(bw->o.mnew); if (er == 0 && bw->o.mold) exemac(bw->o.mold); if (closedall || leave) { genjuppverstr(); /* blink substitution if possible */ if (n->mb) n->mb = n->md ? n->md : n->us ? n->us : n->mb; mdisp(n, n->li - 1, msgbuf); nclose(n); if (exmsg) fprintf(stderr, "\n%s\n", exmsg); else putc('\n', stderr); exit(main_rv); } maint->curwin = opened; if (lnum > 0) pline(bw->cursor, lnum - 1); } if (!opened) opened = (void *)&opened; backopt = 0; } maint->curwin = opened == (void *)&opened ? NULL : opened; if (opened) { wshowall(maint); omid = mid; mid = 1; dofollows(); mid = omid; } else { BW *bw = wmktw(maint, bfind(UC "")); if (!bw) { wmktw_failed: fprintf(stderr, "maint->h < 1, cannot happen\n"); return (1); } if (bw->o.mnew) exemac(bw->o.mnew); } maint->curwin = maint->topwin; if (help) { help_on(maint); } if (!nonotice) { genjuppverstr(); msgnw(lastw(maint)->object.base->parent, msgbuf); } *np = n; return 0; } int main(int argc, char **argv, char **envp) { SCRN *n; if ((main_rv = main_init(argv, envp, &n))) return (main_rv); edloop(0); vclose(vmem); nclose(n); if (exmsg) fprintf(stderr, "\n%s\n", exmsg); return (main_rv); } jupp/main.h010064400000000000000000000010551363731763400100760ustar00/* * Editor startup and edit loop * Copyright * (C) 1992 Joseph H. Allen * * This file is part of JOE (Joe's Own Editor) */ #ifndef JUPP_MAIN_H #define JUPP_MAIN_H #ifdef EXTERN_B_C __IDSTRING(rcsid_main_h, "$MirOS: contrib/code/jupp/main.h,v 1.7 2020/03/27 06:38:57 tg Exp $"); #endif extern const char null[]; extern unsigned char *exmsg; /* Exit message */ extern int help; /* Set to start with help on */ extern SCREEN *maint; /* Primary screen */ void nungetc(int c); void dofollows(void); int edloop(int flg); void edupd(int flg); #endif jupp/menu.c010064400000000000000000000204451322401411200100660ustar00/* * Menu selection window * Copyright * (C) 1992 Joseph H. Allen * * This file is part of JOE (Joe's Own Editor) */ #include "config.h" #include "types.h" __RCSID("$MirOS: contrib/code/jupp/menu.c,v 1.16 2018/01/06 00:28:31 tg Exp $"); #include #include #include "menu.h" #include "scrn.h" #include "utils.h" #include "va.h" #include "vs.h" #include "utf8.h" #include "w.h" extern int dostaupd; static void mconfig(MENU *); static void menufllw(jobject jO) { MENU *m = jO.menu; if (m->cursor < m->top) m->top = m->cursor - m->cursor % m->perline; else if (m->cursor >= m->top+m->perline*m->h) m->top = m->cursor - m->cursor % m->perline - m->perline*(m->h-1); } static void menudisp(jobject jO, int flg __attribute__((__unused__))) { MENU *m = jO.menu; int col; int x; int y; int *s = m->t->t->scrn + m->x + m->y * m->t->t->co; int *a = m->t->t->attr + m->x + m->y * m->t->t->co; struct utf8_sm sm; utf8_init(&sm); if (m->t->t->co != m->saved_co) mconfig(m); for (y = 0; y != m->h; ++y) { col = 0; for (x = 0; x != m->perline && y*m->perline+x+m->topnitems; ++x) { int atr; if (x + y*m->perline + m->top == m->cursor) atr = INVERSE; else atr = 0; if (col == m->w) break; /* Generate field */ genfield(m->t->t, s + col, a + col, m->x + col, m->y + y, 0, m->list[x + y*m->perline + m->top], strlen((char *)m->list[x + y*m->perline + m->top]), atr, m->width, 0, NULL); col += m->width; /* Space between columns */ if (col != m->w) { outatr(locale_map, m->t->t, s + col, a + col, m->x + col, m->y+y, ' ', 0); ++col; } } /* Clear to end of line */ if (col != m->w) eraeol(m->t->t, m->x + col, m->y + y); s += m->t->t->co; a += m->t->t->co; } m->parent->cury = (m->cursor - m->top) / (m->perline ? m->perline : 1); col = txtwidth(m->list[m->cursor],strlen((char *)m->list[m->cursor])); m->parent->curx = ((m->cursor - m->top) % (m->perline ? m->perline : 1)) * (m->width + 1) + (col < m->width ? col : m->width); } static void menumove(jobject jO, int x, int y) { MENU *m = jO.menu; m->x = x; m->y = y; } static void menuresz(jobject jO, int wi, int he) { MENU *m = jO.menu; m->w = wi; m->h = he; } static int mlines(unsigned char **s, int w) { int x; int lines; int width; int nitems; int perline; for (x = 0, width = 0; s[x]; ++x) { int d = txtwidth(s[x],strlen((char *)(s[x]))); if (d > width) width = d; } nitems = x; if (width > w) width = w - 1; perline = w / (width + 1); lines = (nitems + perline - 1) / perline; return lines; } static void mconfig(MENU *m) { /* Configure menu display parameters */ if (m->list) { int x; /* int lines; */ m->top = 0; for (x = 0, m->width = 0; m->list[x]; ++x) { int d = txtwidth(m->list[x],strlen((char *)(m->list[x]))); if (d > m->width) m->width = d; } m->nitems = x; if (m->width > m->w) m->width = m->w - 1; m->perline = m->w / (m->width + 1); /* lines = (m->nitems + m->perline - 1) / m->perline; */ m->saved_co = m->t->t->co; } } int umbol(MENU *m) { m->cursor -= m->cursor % m->perline; return 0; } int umbof(MENU *m) { m->cursor = 0; return 0; } int umeof(MENU *m) { if (m->nitems) m->cursor = m->nitems - 1; return 0; } int umeol(MENU *m) { m->cursor -= m->cursor % m->perline; if (m->cursor+m->perline-1 >= m->nitems) m->cursor = m->nitems - 1; else m->cursor += m->perline - 1; return 0; } int umrtarw(MENU *m) { if (m->cursor + 1 < m->nitems) { ++m->cursor; return 0; } else return -1; } int umtab(MENU *m) { if (m->cursor + 1 >= m->nitems) m->cursor = 0; else ++ m->cursor; return 0; } int umltarw(MENU *m) { if (m->cursor) { --m->cursor; return 0; } else return -1; } int umuparw(MENU *m) { if (m->cursor >= m->perline) { m->cursor -= m->perline; return 0; } else return -1; } int umdnarw(MENU *m) { int col = m->cursor % m->perline; m->cursor -= col; if (m->cursor + m->perline < m->nitems) { m->cursor += m->perline; if (m->cursor + col >= m->nitems) if (m->nitems) m->cursor = m->nitems - 1; else m->cursor = 0; else m->cursor += col; return 0; } else { m->cursor += col; return -1; } } int umpgup(MENU *m) { int amnt = (m->h+1)/2; if (m->top >= amnt*m->perline) { m->top -= amnt*m->perline; m->cursor -= amnt*m->perline; return 0; } else if (m->top) { m->cursor -= m->top; m->top = 0; return 0; } else if (m->cursor >= m->perline) { m->cursor = m->cursor % m->perline; return 0; } else return -1; } int umpgdn(MENU *m) { int amnt = (m->h+1)/2; int col = m->cursor % m->perline; int y = m->cursor / m->perline; int h = (m->nitems + m->perline - 1) / m->perline; int t = m->top / m->perline; m->cursor -= col; if (t + m->h + amnt <= h) { m->top += amnt*m->perline; m->cursor += amnt*m->perline; if (m->cursor + col >= m->nitems) if (m->nitems) m->cursor = m->nitems - 1; else m->cursor = 0; else m->cursor += col; return 0; } else if (t + m->h < h) { amnt = h - (t + m->h); m->top += amnt*m->perline; m->cursor += amnt*m->perline; if (m->cursor + col >= m->nitems) if (m->nitems) m->cursor = m->nitems - 1; else m->cursor = 0; else m->cursor += col; return 0; } else if (y+1!=h) { m->cursor = (h-1)*m->perline; if (m->cursor + col >= m->nitems) if (m->nitems) m->cursor = m->nitems - 1; else m->cursor = 0; else m->cursor += col; return 0; } else { m->cursor += col; return -1; } } static int umrtn(jobject jO) { MENU *m = jO.menu; dostaupd = 1; if (m->func) return m->func(m, m->cursor, m->object, 0); else return -1; } int umbacks(MENU *m) { if (m->backs) return m->backs(m, m->cursor, m->object); else return -1; } static int umkey(jobject jO, int c) { MENU *m = jO.menu; int x; int n = 0; if (c == '0') { if (m->func) return m->func(m, m->cursor, m->object, -1); else return -1; } if (c == '1') { if (m->func) return m->func(m, m->cursor, m->object, 1); else return -1; } c |= 0x20; if (c < 'a' || c > 'z') return -1; c &= 0x1F; for (x = 0; x != m->nitems; ++x) if ((m->list[x][0] & 0x1F) == c) ++n; if (!n) return -1; if (n == 1) for (x = 0; x != m->nitems; ++x) if ((m->list[x][0] & 0x1F) == c) { m->cursor = x; return umrtn(jO); } do { ++m->cursor; if (m->cursor == m->nitems) m->cursor = 0; } while ((m->list[m->cursor][0] & 0x1F) != c); return -1; } static int menuabort(jobject jO) { MENU *m = jO.menu; W *w = m->parent; jpoly_int *func = m->abrt; void *object = m->object; int x = m->cursor; W *win = w->win; free(m); if (func) return func(win->object, x, object); else return -1; } WATOM watommenu = { UC "menu", menudisp, menufllw, menuabort, umrtn, umkey, menuresz, menumove, NULL, NULL, TYPEMENU }; void ldmenu(MENU *m, unsigned char **s, int cursor) { m->list = s; m->cursor = cursor; mconfig(m); } MENU *mkmenu(W *w, unsigned char **s, jpoly_int *func, jpoly_int *abrt, jpoly_int *backs, int cursor, void *object, int *notify) { W *new; MENU *m; int lines; int h = (w->main->h*40) / 100; /* 40% of window size */ if (!h) h = 1; if (s) { lines = mlines(s,w->t->w-1); if (lines < h) h = lines; } new = wcreate(w->t, &watommenu, w, w, w->main, h, NULL, notify); if (!new) { if (notify) *notify = 1; return NULL; } wfit(new->t); new->object.menu = m = malloc(sizeof(MENU)); m->parent = new; m->func = func; m->abrt = abrt; m->backs = backs; m->object = object; m->t = w->t; m->h = new->h; m->w = new->w; m->x = new->x; m->y = new->y; m->top = 0; m->saved_co = 0; ldmenu(m, s, cursor); w->t->curwin = new; return m; } static unsigned char *cull(unsigned char *a, unsigned char *b) { int x; for (x = 0; a[x] && b[x] && a[x] == b[x]; ++x) ; return vstrunc(a, x); } unsigned char *find_longest(unsigned char **lst) { unsigned char *com; int x; if (!lst || !aLEN(lst)) return vstrunc(NULL, 0); com = vsncpy(NULL, 0, sv(lst[0])); for (x = 1; x != aLEN(lst); ++x) com = cull(com, lst[x]); return com; } unsigned char *mcomplete(MENU *m) { unsigned char *com; int x; if (!m->nitems) return vstrunc(NULL, 0); com = vsncpy(NULL, 0, sz(m->list[0])); for (x = 1; x != m->nitems; ++x) com = cull(com, m->list[x]); return com; } jupp/menu.h010064400000000000000000000015441363731763400101210ustar00/* * Menu selection window * Copyright * (C) 1992 Joseph H. Allen * * This file is part of JOE (Joe's Own Editor) */ #ifndef JUPP_MENU_H #define JUPP_MENU_H #ifdef EXTERN_CMD_C __IDSTRING(rcsid_menu_h, "$MirOS: contrib/code/jupp/menu.h,v 1.7 2020/03/27 06:38:57 tg Exp $"); #endif /* Create a menu */ MENU *mkmenu(W *w, unsigned char **s, jpoly_int *func, jpoly_int *abrt, jpoly_int *backs, int cursor, void *object, int *notify); /* Menu user functions */ int umuparw(MENU *m); int umdnarw(MENU *m); int umpgup(MENU *m); int umpgdn(MENU *m); int umltarw(MENU *m); int umrtarw(MENU *m); int umtab(MENU *m); int umbof(MENU *m); int umeof(MENU *m); int umbol(MENU *m); int umeol(MENU *m); int umbacks(MENU *m); void ldmenu(MENU *m, unsigned char **s, int cursor); unsigned char *mcomplete(MENU *m); unsigned char *find_longest(unsigned char **lst); #endif jupp/missing010064400000000000000000000260271101233711200103550ustar00#! /bin/sh # $MirOS: contrib/code/jupp/missing,v 1.6 2008/05/13 16:13:39 tg Exp $ # $miros: contrib/gnu/automake/lib/missing,v 1.4 2008/05/02 23:31:53 tg Exp $ #- # Common stub for a few missing GNU programs while installing. scriptversion=2006-05-10.23 # Copyright (C) 1996, 1997, 1999, 2000, 2002, 2003, 2004, 2005, 2006 # Free Software Foundation, Inc. # Originally by Fran,cois Pinard , 1996. # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation; either version 2, or (at your option) # any later version. # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU General Public License for more details. # You should have received a copy of the GNU General Public License # along with this program; if not, write to the Free Software # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA # 02110-1301, USA. # As a special exception to the GNU General Public License, if you # distribute this file as part of a program that contains a # configuration script generated by Autoconf, you may include it under # the same distribution terms that you use for the rest of that program. if test $# -eq 0; then echo 1>&2 "Try \`$0 --help' for more information" exit 1 fi run=: sed_output='s/.* --output[ =]\([^ ]*\).*/\1/p' sed_minuso='s/.* -o \([^ ]*\).*/\1/p' # In the cases where this matters, `missing' is being run in the # srcdir already. if test -f configure.ac; then configure_ac=configure.ac else configure_ac=configure.in fi msg="missing on your system" case $1 in --run) # Try to run requested program, and just exit if it succeeds. run= shift "$@" && exit 0 # Exit code 63 means version mismatch. This often happens # when the user try to use an ancient version of a tool on # a file that requires a minimum version. In this case we # we should proceed has if the program had been absent, or # if --run hadn't been passed. if test $? = 63; then run=: msg="probably too old" fi ;; -h|--h|--he|--hel|--help) echo "\ $0 [OPTION]... PROGRAM [ARGUMENT]... Handle \`PROGRAM [ARGUMENT]...' for when PROGRAM is missing, or return an error status if there is no known handling for PROGRAM. Options: -h, --help display this help and exit -v, --version output version information and exit --run try to run the given command, and emulate it if it fails Supported PROGRAM values: aclocal touch file \`aclocal.m4' autoconf touch file \`configure' autoheader touch file \`config.h.in' autom4te touch the output file, or create a stub one automake touch all \`Makefile.in' files bison create \`y.tab.[ch]', if possible, from existing .[ch] flex create \`lex.yy.c', if possible, from existing .c help2man touch the output file lex create \`lex.yy.c', if possible, from existing .c makeinfo touch the output file tar try tar, gnutar, gtar, then tar without non-portable flags yacc create \`y.tab.[ch]', if possible, from existing .[ch] Send bug reports to ." exit $? ;; -v|--v|--ve|--ver|--vers|--versi|--versio|--version) echo "missing $scriptversion (GNU Automake)" exit $? ;; -*) echo 1>&2 "$0: Unknown \`$1' option" echo 1>&2 "Try \`$0 --help' for more information" exit 1 ;; esac # Now exit if we have it, but it failed. Also exit now if we # don't have it and --version was passed (most likely to detect # the program). case $1 in lex|yacc) # Not GNU programs, they don't have --version. ;; tar) if test -n "$run"; then echo 1>&2 "ERROR: \`tar' requires --run" exit 1 elif test "x$2" = "x--version" || test "x$2" = "x--help"; then exit 1 fi ;; *) if test -z "$run" && ($1 --version) > /dev/null 2>&1; then # We have it, but it failed. exit 1 elif test "x$2" = "x--version" || test "x$2" = "x--help"; then # Could not run --version or --help. This is probably someone # running `$TOOL --version' or `$TOOL --help' to check whether # $TOOL exists and not knowing $TOOL uses missing. exit 1 fi ;; esac # If it does not exist, or fails to run (possibly an outdated version), # try to emulate it. case $1 in aclocal*) echo 1>&2 "\ WARNING: \`$1' is $msg. You should only need it if you modified \`acinclude.m4' or \`${configure_ac}'. You might want to install the \`Automake' and \`Perl' packages. Grab them from any GNU archive site." touch aclocal.m4 ;; autoconf) echo 1>&2 "\ WARNING: \`$1' is $msg. You should only need it if you modified \`${configure_ac}'. You might want to install the \`Autoconf' and \`GNU m4' packages. Grab them from any GNU archive site." touch configure ;; autoheader) echo 1>&2 "\ WARNING: \`$1' is $msg. You should only need it if you modified \`acconfig.h' or \`${configure_ac}'. You might want to install the \`Autoconf' and \`GNU m4' packages. Grab them from any GNU archive site." files=`sed -n 's/^[ ]*A[CM]_CONFIG_HEADER(\([^)]*\)).*/\1/p' ${configure_ac}` test -z "$files" && files="config.h" touch_files= for f in $files; do case $f in *:*) touch_files="$touch_files "`echo "$f" | sed -e 's/^[^:]*://' -e 's/:.*//'`;; *) touch_files="$touch_files $f.in";; esac done touch $touch_files ;; automake*) echo 1>&2 "\ WARNING: \`$1' is $msg. You should only need it if you modified \`Makefile.am', \`acinclude.m4' or \`${configure_ac}'. You might want to install the \`Automake' and \`Perl' packages. Grab them from any GNU archive site." find . -type f -name Makefile.am -print | sed 's/\.am$/.in/' | while read f; do touch "$f"; done ;; autom4te) echo 1>&2 "\ WARNING: \`$1' is needed, but is $msg. You might have modified some files without having the proper tools for further handling them. You can get \`$1' as part of \`Autoconf' from any GNU archive site." file=`echo "$*" | sed -n "$sed_output"` test -z "$file" && file=`echo "$*" | sed -n "$sed_minuso"` if test -f "$file"; then touch $file else test -z "$file" || exec >$file echo "#! /bin/sh" echo "# Created by GNU Automake missing as a replacement of" echo "# $ $@" echo "exit 0" chmod +x $file exit 1 fi ;; bison|yacc) echo 1>&2 "\ WARNING: \`$1' $msg. You should only need it if you modified a \`.y' file. You may need the \`Bison' package in order for those modifications to take effect. You can get \`Bison' from any GNU archive site." rm -f y.tab.c y.tab.h if test $# -ne 1; then eval LASTARG="\${$#}" case $LASTARG in *.y) SRCFILE=`echo "$LASTARG" | sed 's/y$/c/'` if test -f "$SRCFILE"; then cp "$SRCFILE" y.tab.c fi SRCFILE=`echo "$LASTARG" | sed 's/y$/h/'` if test -f "$SRCFILE"; then cp "$SRCFILE" y.tab.h fi ;; esac fi if test ! -f y.tab.h; then echo >y.tab.h fi if test ! -f y.tab.c; then echo 'main() { return 0; }' >y.tab.c fi ;; lex|flex) echo 1>&2 "\ WARNING: \`$1' is $msg. You should only need it if you modified a \`.l' file. You may need the \`Flex' package in order for those modifications to take effect. You can get \`Flex' from any GNU archive site." rm -f lex.yy.c if test $# -ne 1; then eval LASTARG="\${$#}" case $LASTARG in *.l) SRCFILE=`echo "$LASTARG" | sed 's/l$/c/'` if test -f "$SRCFILE"; then cp "$SRCFILE" lex.yy.c fi ;; esac fi if test ! -f lex.yy.c; then echo 'main() { return 0; }' >lex.yy.c fi ;; help2man) echo 1>&2 "\ WARNING: \`$1' is $msg. You should only need it if you modified a dependency of a manual page. You may need the \`Help2man' package in order for those modifications to take effect. You can get \`Help2man' from any GNU archive site." file=`echo "$*" | sed -n "$sed_output"` test -z "$file" && file=`echo "$*" | sed -n "$sed_minuso"` if test -f "$file"; then touch $file else test -z "$file" || exec >$file echo ".ab help2man is required to generate this page" exit 1 fi ;; makeinfo) echo 1>&2 "\ WARNING: \`$1' is $msg. You should only need it if you modified a \`.texi' or \`.texinfo' file, or any other file indirectly affecting the aspect of the manual. The spurious call might also be the consequence of using a buggy \`make' (AIX, DU, IRIX). You might want to install the \`Texinfo' package or the \`GNU make' package. Grab either from any GNU archive site." # The file to touch is that specified with -o ... file=`echo "$*" | sed -n "$sed_output"` test -z "$file" && file=`echo "$*" | sed -n "$sed_minuso"` if test -z "$file"; then # ... or it is the one specified with @setfilename ... infile=`echo "$*" | sed 's/.* \([^ ]*\) *$/\1/'` file=`sed -n ' /^@setfilename/{ s/.* \([^ ]*\) *$/\1/ p q }' $infile` # ... or it is derived from the source name (dir/f.texi becomes f.info) test -z "$file" && file=`echo "$infile" | sed 's,.*/,,;s,.[^.]*$,,'`.info fi # If the file does not exist, the user really needs makeinfo; # let's fail without touching anything. test -f $file || exit 1 touch $file ;; tar) shift # We have already tried tar in the generic part. # Look for gnutar/gtar before invocation to avoid ugly error # messages. if (gnutar --version > /dev/null 2>&1); then gnutar "$@" && exit 0 fi if (gtar --version > /dev/null 2>&1); then gtar "$@" && exit 0 fi firstarg="$1" if shift; then case $firstarg in *o*) firstarg=`echo "$firstarg" | sed s/o//` tar "$firstarg" "$@" && exit 0 ;; esac case $firstarg in *h*) firstarg=`echo "$firstarg" | sed s/h//` tar "$firstarg" "$@" && exit 0 ;; esac fi echo 1>&2 "\ WARNING: I can't seem to be able to run \`tar' with the given arguments. You may want to install GNU tar or Free paxutils, or check the command line arguments." exit 1 ;; *) echo 1>&2 "\ WARNING: \`$1' is needed, and is $msg. You might have modified some files without having the proper tools for further handling them. Check the \`README' file, it often tells you about the needed prerequisites for installing this package. You may also peek at any GNU archive site, in case some other package would contain this missing \`$1' program." exit 1 ;; esac exit 0 # Local variables: # eval: (add-hook 'write-file-hooks 'time-stamp) # time-stamp-start: "scriptversion=" # time-stamp-format: "%:y-%02m-%02d.%02H" # time-stamp-end: "$" # End: jupp/mkinstalldirs010064400000000000000000000071021101233711200115550ustar00#! /bin/sh # $MirOS: contrib/code/jupp/mkinstalldirs,v 1.8 2008/05/13 16:13:39 tg Exp $ # $miros: contrib/gnu/aux/mkinstalldirs,v 1.9 2008/05/02 23:01:38 tg Exp $ #- # mkinstalldirs --- make directory hierarchy scriptversion=2006-05-11.19 # Original author: Noah Friedman # Created: 1993-05-16 # Public domain. # # This file is maintained in Automake, please report # bugs to or send patches to # . nl=' ' IFS=" "" $nl" errstatus=0 dirmode= usage="\ Usage: mkinstalldirs [-h] [--help] [--version] [-m MODE] DIR ... Create each directory DIR (with mode MODE, if specified), including all leading file name components. Report bugs to ." # process command line arguments while test $# -gt 0 ; do case $1 in -h | --help | --h*) # -h for help echo "$usage" exit $? ;; -m) # -m PERM arg shift test $# -eq 0 && { echo "$usage" 1>&2; exit 1; } dirmode=$1 shift ;; --version) echo "$0 $scriptversion" exit $? ;; --) # stop option processing shift break ;; -*) # unknown option echo "$usage" 1>&2 exit 1 ;; *) # first non-opt arg break ;; esac done for file do if test -d "$file"; then shift else break fi done case $# in 0) exit 0 ;; esac # Solaris 8's mkdir -p isn't thread-safe. If you mkdir -p a/b and # mkdir -p a/c at the same time, both will detect that a is missing, # one will create a, then the other will try to create a and die with # a "File exists" error. This is a problem when calling mkinstalldirs # from a parallel make. We use --version in the probe to restrict # ourselves to GNU mkdir, which is thread-safe. case $dirmode in '') if mkdir -p --version . >/dev/null 2>&1 && test ! -d ./--version; then echo "mkdir -p -- $*" exec mkdir -p -- "$@" else # On NextStep and OpenStep, the `mkdir' command does not # recognize any option. It will interpret all options as # directories to create, and then abort because `.' already # exists. test -d ./-p && rmdir ./-p test -d ./--version && rmdir ./--version fi ;; *) if mkdir -m "$dirmode" -p --version . >/dev/null 2>&1 && test ! -d ./--version; then echo "mkdir -m $dirmode -p -- $*" exec mkdir -m "$dirmode" -p -- "$@" else # Clean up after NextStep and OpenStep mkdir. for d in ./-m ./-p ./--version "./$dirmode"; do test -d $d && rmdir $d done fi ;; esac for file do case $file in /*) pathcomp=/ ;; *) pathcomp= ;; esac oIFS=$IFS IFS=/ set fnord $file shift IFS=$oIFS for d do test "x$d" = x && continue pathcomp=$pathcomp$d case $pathcomp in -*) pathcomp=./$pathcomp ;; esac if test ! -d "$pathcomp"; then echo "mkdir $pathcomp" mkdir "$pathcomp" || lasterr=$? if test ! -d "$pathcomp"; then errstatus=$lasterr else if test ! -z "$dirmode"; then echo "chmod $dirmode $pathcomp" lasterr= chmod "$dirmode" "$pathcomp" || lasterr=$? if test ! -z "$lasterr"; then errstatus=$lasterr fi fi fi fi pathcomp=$pathcomp/ done done exit $errstatus # Local Variables: # mode: shell-script # sh-indentation: 2 # eval: (add-hook 'write-file-hooks 'time-stamp) # time-stamp-start: "scriptversion=" # time-stamp-format: "%:y-%02m-%02d.%02H" # time-stamp-end: "$" # End: jupp/path.c010064400000000000000000000216401430552056300100710ustar00/* * Directory and path functions * Copyright * (C) 1992 Joseph H. Allen * * This file is part of JOE (Joe's Own Editor) */ #include "config.h" #include "types.h" __RCSID("$MirOS: contrib/code/jupp/path.c,v 1.26 2022/09/06 01:24:40 tg Exp $"); #include #include #include #include #ifdef HAVE_PATHS_H # include /* for _PATH_TMP */ #endif #include #ifdef HAVE_BSD_STRING_H #include #endif #include "path.h" #include "vs.h" #include "va.h" #ifdef TIME_WITH_SYS_TIME # include # include #else # ifdef HAVE_SYS_TIME_H # include # else # include # endif #endif #ifdef HAVE_DIRENT_H # include # define NAMLEN(dirent) strlen((dirent)->d_name) #else # ifdef HAVE_SYS_DIRENT_H # include # define NAMLEN(dirent) strlen((dirent)->d_name) # else # define direct dirent # define NAMLEN(dirent) (dirent)->d_namlen # ifdef HAVE_SYS_NDIR_H # include # else # ifdef HAVE_SYS_DIR_H # include # else # ifdef HAVE_NDIR_H # include # else # ifndef __MSDOS__ # include "dir.c" # endif # endif # endif # endif # endif #endif #if HAVE_DRIVE_LETTERS #define do_if_drive_letter(path,command) do { \ if ((path)[1] == ':') { \ drvltrhlprv = (path)[0] | 0x20; \ if (drvltrhlprv >= 'a' && \ drvltrhlprv <= 'z') \ command; \ } \ } while (/* CONSTCOND */ 0) #define drvltrhlpr unsigned char drvltrhlprv #else #define do_if_drive_letter(path,command) do { } while (/* CONSTCOND */ 0) #define drvltrhlpr /* nothing */ #endif #define skip_drive_letter(path) do_if_drive_letter((path), (path) += 2) #ifndef _PATH_TMP #define _PATH_TMP "/tmp/" #endif #if !defined(PATH_MAX) && !defined(HAVE_GET_CURRENT_DIR_NAME) #ifndef NO_ZAHLZEICHEN_WARNING /* HP-UX 9 c89(1) fails */ # warning What should we include to have PATH_MAX defined? #endif #define PATH_MAX 4096 #endif /********************************************************************/ #if HAVE_BACKSLASH_PATHS unsigned char *joesep(unsigned char *path) { int x; for (x = 0; path[x]; ++x) if (path[x] == '\\') path[x] = '/'; return path; } #endif /********************************************************************/ unsigned char *namprt(unsigned char *path) { unsigned char *z; drvltrhlpr; skip_drive_letter(path); z = path + slen(path); while ((z != path) && (z[-1] != '/')) --z; return vsncpy(NULL, 0, sz(z)); } /********************************************************************/ unsigned char *namepart(unsigned char *tmp, unsigned char *path) { unsigned char *z; drvltrhlpr; skip_drive_letter(path); z = path + strlen((char *)path); while ((z != path) && (z[-1] != '/')) --z; strlcpy((char *)tmp, (char *)z, 1024); return (tmp); } /********************************************************************/ unsigned char *dirprt_ptr(unsigned char *path) { unsigned char *b = path; unsigned char *z = path + slen(path); drvltrhlpr; skip_drive_letter(b); while ((z != b) && (z[-1] != '/')) --z; return (z); } unsigned char *dirprt(unsigned char *path) { return vsncpy(NULL, 0, path, dirprt_ptr(path) - path); } /********************************************************************/ unsigned char *begprt(unsigned char *path) { unsigned char *z = path + slen(path); int drv = 0; drvltrhlpr; do_if_drive_letter(path, drv = 2); while ((z != path + drv) && (z[-1] == '/')) --z; if (z == path + drv) return vsncpy(NULL, 0, sz(path)); else { while ((z != path + drv) && (z[-1] != '/')) --z; return vsncpy(NULL, 0, path, z - path); } } /********************************************************************/ unsigned char *endprt(unsigned char *path) { unsigned char *z = path + slen(path); int drv = 0; drvltrhlpr; do_if_drive_letter(path, drv = 2); while ((z != path + drv) && (z[-1] == '/')) --z; if (z == path + drv) return vsncpy(NULL, 0, sc("")); else { while (z != path + drv && z[-1] != '/') --z; return vsncpy(NULL, 0, sz(z)); } } /********************************************************************/ int mkpath(unsigned char *path) { unsigned char *s; if (path[0] == '/') { if (chddir("/")) return 1; s = path; goto in; } while (path[0]) { int c; for (s = path; (*s) && (*s != '/'); s++) ; c = *s; *s = 0; if (chddir((char *)path)) { if (mkdir((char *)path, 0777)) return 1; if (chddir((char *)path)) return 1; } *s = c; in: while (*s == '/') ++s; path = s; } return 0; } /********************************************************************/ /* Create a temporary file */ /********************************************************************/ unsigned char *mktmp(const unsigned char *where, int *fdp) { #ifndef HAVE_MKSTEMP static unsigned seq = 0; #endif unsigned char *name; int fd; unsigned namesize; if (!where) where = (unsigned char *)getenv("TMPDIR"); if (!where) where = (unsigned char *)getenv("TEMP"); if (!where) where = UC _PATH_TMP; namesize = strlen((const char *)where) + 20; name = vsmk(namesize); /* [G.Ghibo'] we need to use vsmk() and not malloc() as area returned by mktmp() is destroyed later with vsrm(); */ #ifdef HAVE_MKSTEMP joe_snprintf_1((char *)name, namesize, "%s/joe.tmp.XXXXXXXXXX", where); if ((fd = mkstemp((char *)name)) == -1) { vsrm(name); /* * FIXME: vflsh() and vflshf() * expect mktmp() always succeed! */ return (NULL); } /* * Linux glibc 2.0 mkstemp() creates it with 0666 mode, ergo we * change it to 0600, so nobody else sees content of temporary file */ fchmod(fd, 0600); #else #warning "Waah, this is insane! Consider getting mkstemp!" loop: seq = (seq + 1) % 10000; joe_snprintf_3(name, namesize, "%s/joe.tmp.%04u%05u", where, seq, (unsigned)(time(NULL) % 100000)); if ((fd = open(name, O_RDONLY)) != -1) { close(fd); goto loop; /* FIXME: possible endless loop --> DoS attack */ } if ((fd = open(name, O_RDWR | O_CREAT | O_EXCL, 0600)) == -1) { vsrm(name); /* FIXME: see above */ return (NULL); } #endif if (fdp) *fdp = fd; else close(fd); return (name); } /********************************************************************/ int rmatch(const unsigned char *a, const unsigned char *b) { int flag, inv, c; for (;;) switch (*a) { case '*': ++a; do { if (rmatch(a, b)) return 1; } while (*b++); return 0; case '[': ++a; flag = 0; if (*a == '^') { ++a; inv = 1; } else inv = 0; if (*a == ']') if (*b == *a++) flag = 1; while (*a && (c = *a++) != ']') if ((c == '-') && (a[-2] != '[') && (*a)) { if ((*b >= a[-2]) && (*b <= *a)) flag = 1; } else if (*b == c) flag = 1; if ((!flag && !inv) || (flag && inv) || (!*b)) return 0; ++b; break; case '?': ++a; if (!*b) return 0; ++b; break; case 0: if (!*b) return 1; else return 0; default: if (*a++ != *b++) return 0; } } /********************************************************************/ int isreg(unsigned char *s) { int x; for (x = 0; s[x]; ++x) if ((s[x] == '*') || (s[x] == '?') || (s[x] == '[')) return 1; return 0; } /********************************************************************/ unsigned char **rexpnd(const unsigned char *word) { void *dir; unsigned char **lst = NULL; struct dirent *de; dir = opendir("."); if (dir) { while ((de = readdir(dir)) != NULL) if (strcmp(".", de->d_name)) if (rmatch(word, (unsigned char *)de->d_name)) lst = vaadd(lst, vsncpy(NULL, 0, sz((unsigned char *)de->d_name))); closedir(dir); } return lst; } /********************************************************************/ int chJpwd(const unsigned char *path) { unsigned char *fullpath; int rv; if (!has_JOERC) return (-1); fullpath = vsncpy(NULL, 0, sz(get_JOERC)); fullpath = vsncpy(sv(fullpath), sz(path)); rv = chpwd(fullpath); vsrm(fullpath); return (rv); } int chpwd(const unsigned char *path) { if ((!path) || (!path[0])) return 0; return chdir((const char *)path); } /* The pwd function */ unsigned char *pwd(void) { #if defined(PATH_MAX) || !defined(HAVE_GET_CURRENT_DIR_NAME) static unsigned char buf[PATH_MAX]; unsigned char *ret; #ifdef HAVE_GETCWD ret = (unsigned char *)getcwd((char *)buf, PATH_MAX - 1); #else ret = (unsigned char *)getwd((char *)buf); #endif buf[PATH_MAX - 1] = '\0'; return ret; #else /* Hurd */ static char *wd = NULL; free(wd); wd = get_current_dir_name(); return ((void *)wd); #endif } #if JUPP_WIN32RELOC unsigned char has_JOERC = 0; unsigned char *get_JOERC = NULL; extern char *cygwin32_argv0(void); void init_JOERC(void) { struct stat sb; char *sep; if ((get_JOERC = (unsigned char *)cygwin32_argv0()) == NULL) return; joesep(get_JOERC); if ((sep = strrchr((char *)get_JOERC, '/')) == NULL) return; if (stat(get_JOERC, &sb)) return; sep[1] = '\0'; has_JOERC = 1; } #endif jupp/path.h010064400000000000000000000076601364306522400101060ustar00/* * Directory and path functions * Copyright * (C) 1992 Joseph H. Allen * * This file is part of JOE (Joe's Own Editor) */ #ifndef JUPP_PATH_H #define JUPP_PATH_H #ifdef EXTERN __IDSTRING(rcsid_path_h, "$MirOS: contrib/code/jupp/path.h,v 1.20 2020/04/07 11:56:41 tg Exp $"); #endif #if defined(__MSDOS__) || defined(__DJGPP__) || defined(__EMX__) || \ defined(__CYGWIN__) || defined(_WIN32) /*XXX check this for all platforms */ #define HAVE_BACKSLASH_PATHS 1 #define HAVE_DRIVE_LETTERS 1 #else #define HAVE_BACKSLASH_PATHS 0 #define HAVE_DRIVE_LETTERS 0 #endif #if HAVE_BACKSLASH_PATHS unsigned char *joesep(unsigned char *path); #else #define joesep(path) (path) #endif #if JUPP_WIN32RELOC #undef JOERC extern unsigned char has_JOERC, *get_JOERC; void init_JOERC(void); #else #define has_JOERC 1 #define get_JOERC JOERC #define init_JOERC() /* nothing */ #endif /* char *namprt(char *path); * Return name part of a path. There is no name if the last character * in the path is '/'. * * The name part of "/hello/there" is "there" * The name part of "/hello/" is "" * The name part if "/" is "" */ unsigned char *namprt(unsigned char *path); unsigned char *namepart(unsigned char *tmp, unsigned char *path) ATTR_BOUNDED((__minbytes__,1,1024)); /* char *dirprt(char *path); * Return directory and drive part of a path. I.E., everything to the * left of the name part. * * The directory part of "/hello/there" is "/hello/" * The directory part of "/hello/" is "/hello/" * The directory part of "/" is "/" * * dirprt_ptr points to just beyond what dirprt returns. */ unsigned char *dirprt(unsigned char *path); unsigned char *dirprt_ptr(unsigned char *path); /* char *begprt(char *path); * Return the beginning part of a path. * * The beginning part of "/hello/there" is "/hello/" * The beginning part of "/hello/" is "/" * The beginning part of "/" is "/" */ unsigned char *begprt(unsigned char *path); /* char *endprt(char *path); * Return the ending part of a path. * * The ending part of "/hello/there" is "there" * The ending part of "/hello/" is "hello/" * The ending part of "/" is "" */ unsigned char *endprt(unsigned char *path); /* int mkpath(char *path); * Make sure path exists. If it doesn't, try to create it * * Returns 1 for error or 0 for success. The current directory * and drive will be at the given path if successful, otherwise * the drive and path will be elsewhere (not necessarily where they * were before mkpath was called). */ int mkpath(unsigned char *path); /* char *mktmp(char *, int *); * Create an empty temporary file. The file name created is the string passed * to this function postfixed with /joe.tmp.XXXXXX, where XXXXXX is some * string six chars long which makes this file unique. * If second argument is not NULL, fd is kept open and stored there. */ unsigned char *mktmp(const unsigned char *where, int *fdp); /* Change drive and directory */ #define chddir chdir /* int rmatch(char *pattern,char *string); * Return true if string matches pattern * * Pattern is: * * matches 0 or more charcters * ? matches any 1 character * [...] matches 1 character in set * [^...] matches 1 character not in set * [[] matches [ * [*] matches * * [?] matches ? * any other matches self * * Ranges of characters may be specified in sets with 'A-B' * '-' may be specified in sets by placing it at the ends * '[' may be specified in sets by placing it first */ int rmatch(const unsigned char *a, const unsigned char *b); int isreg(unsigned char *s); /* char **rexpnd(char *path,char *pattern); * Generate array (see va.h) of file names from directory in 'path' * which match the pattern 'pattern' */ unsigned char **rexpnd(const unsigned char *word); int chJpwd(const unsigned char *path); int chpwd(const unsigned char *path); unsigned char *pwd(void); #endif jupp/popen.inc010064400000000000000000000117331415523117200106050ustar00/* $OpenBSD: popen.c,v 1.17 2005/08/08 08:05:34 espie Exp $ */ /* * Copyright (c) 1988, 1993 * The Regents of the University of California. All rights reserved. * * This code is derived from software written by Ken Arnold and * published in UNIX Review, Vol. 6, No. 8. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions * are met: * 1. Redistributions of source code must retain the above copyright * notice, this list of conditions and the following disclaimer. * 2. Redistributions in binary form must reproduce the above copyright * notice, this list of conditions and the following disclaimer in the * documentation and/or other materials provided with the distribution. * 3. Neither the name of the University nor the names of its contributors * may be used to endorse or promote products derived from this software * without specific prior written permission. * * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF * SUCH DAMAGE. */ #include #include #include #include #include #include #include #include #include __RCSID("$MirOS: contrib/code/jupp/popen.inc,v 1.5 2021/12/11 23:21:03 tg Exp $"); static struct pid { struct pid *next; FILE *fp; pid_t pid; } *pidlist; #if defined(__MirBSD__) #define POPEN_SH_USE_DBLDASH #endif /* separate function due to GCC vfork warnings */ static pid_t popen_spwn(int pfd[2], const char *program, int isread) { pid_t pid; struct pid *pcur; if ((pid = vfork())) return (pid); /* child */ /* all this, strictly speaking, is not allowed */ /* * because vfork() instead of fork(), must leak FILE *, * but luckily we are terminally headed for an execl() */ for (pcur = pidlist; pcur; pcur = pcur->next) close(fileno(pcur->fp)); if (isread) { close(pfd[0]); if (pfd[1] != STDOUT_FILENO) { dup2(pfd[1], STDOUT_FILENO); close(pfd[1]); } } else { close(pfd[1]); if (pfd[0] != STDIN_FILENO) { dup2(pfd[0], STDIN_FILENO); close(pfd[0]); } } #ifndef POPEN_SH_USE_DBLDASH execl(_PATH_BSHELL, "sh", "-c", program, (char *)NULL); #else execl(_PATH_BSHELL, "sh", "-c", "--", program, (char *)NULL); #endif _exit(127); /* NOTREACHED */ } FILE * popen(const char *program, const char *type) { struct pid *cur; FILE *iop; int pdes[2]; pid_t pid; #ifndef POPEN_SH_USE_DBLDASH char *ap = NULL; #endif int ec; if ((*type != 'r' && *type != 'w') || type[1] != '\0') { errno = EINVAL; return (NULL); } if ((cur = malloc(sizeof(struct pid))) == NULL) return (NULL); #ifndef POPEN_SH_USE_DBLDASH if (*program == '-' || *program == '+') { size_t n; n = strlen(program) + 1; if ((ap = malloc(n + 1)) == NULL) { ec = errno; free(cur); errno = ec; return (NULL); } *ap = ' '; memcpy(ap + 1, program, n); program = ap; } #endif if (pipe(pdes) < 0) { ec = errno; #ifndef POPEN_SH_USE_DBLDASH free(ap); #endif free(cur); errno = ec; return (NULL); } if ((pid = popen_spwn(pdes, program, *type == 'r')) == (pid_t)-1) { ec = errno; (void)close(pdes[0]); (void)close(pdes[1]); #ifndef POPEN_SH_USE_DBLDASH free(ap); #endif free(cur); errno = ec; return (NULL); } /* Parent; assume fdopen can't fail. */ if (*type == 'r') { iop = fdopen(pdes[0], type); (void)close(pdes[1]); } else { iop = fdopen(pdes[1], type); (void)close(pdes[0]); } /* Link into list of file descriptors. */ cur->fp = iop; cur->pid = pid; cur->next = pidlist; pidlist = cur; #ifndef POPEN_SH_USE_DBLDASH free(ap); #endif return (iop); } /* * pclose -- * Pclose returns -1 if stream is not associated with a `popened' command, * if already `pclosed', or waitpid returns an error. */ int pclose(FILE *iop) { struct pid *cur, *last; int pstat; pid_t pid; /* Find the appropriate file pointer. */ for (last = NULL, cur = pidlist; cur; last = cur, cur = cur->next) if (cur->fp == iop) break; if (cur == NULL) return (-1); (void)fclose(iop); do { pid = waitpid(cur->pid, &pstat, 0); } while (pid == -1 && errno == EINTR); /* Remove the entry from the linked list. */ if (last == NULL) pidlist = cur->next; else last->next = cur->next; free(cur); return (pid == -1 ? -1 : pstat); } jupp/poshist.c010064400000000000000000000045541321237432000106250ustar00/* * Position history * Copyright * (C) 1992 Joseph H. Allen * * This file is part of JOE (Joe's Own Editor) */ #include "config.h" #include "types.h" __RCSID("$MirOS: contrib/code/jupp/poshist.c,v 1.8 2017/12/08 02:28:05 tg Exp $"); #include #include "b.h" #include "poshist.h" #include "queue.h" #include "w.h" typedef struct pos POS; struct pos { LINK(POS) link; P *p; W *w; }; POS pos = { {&pos, &pos}, NULL, NULL }; POS frpos = { {&frpos, &frpos}, NULL, NULL }; POS *curpos = &pos; int npos = 0; static void markpos(W *w, P *p) { POS *new = alitem(&frpos, sizeof(POS)); new->p = NULL; pdupown(p, &new->p); poffline(new->p); new->w = w; enqueb(POS, link, &pos, new); if (npos == 20) { new = pos.link.next; prm(new->p); demote(POS, link, &frpos, new); } else { ++npos; } } void afterpos(void) { if (curpos != &pos) { demote(POS, link, &pos, curpos); curpos = &pos; } } void aftermove(W *w, P *p) { if (pos.link.prev != &pos && pos.link.prev->w == w && pos.link.prev->p && labs(pos.link.prev->p->line - p->line) < 3) { poffline(pset(pos.link.prev->p, p)); } else { markpos(w, p); } } void windie(W *w) { POS *n; for (n = pos.link.prev; n != &pos; n = n->link.prev) { if (n->w == w) { n->w = NULL; } } } int unextpos(BW *bw) { W *w = bw->parent; lp: if (curpos->link.next != &pos && curpos != &pos) { curpos = curpos->link.next; if (!curpos->p || !curpos->w) { goto lp; } if (w->t->curwin == curpos->w && curpos->p->byte == w->t->curwin->object.bw->cursor->byte) { goto lp; } if (w->t->curwin != curpos->w) { w->t->curwin = curpos->w; if (w->t->curwin->y == -1) { wfit(w->t); } } w = w->t->curwin; bw = w->object.bw; if (bw->cursor->byte != curpos->p->byte) { pset(bw->cursor, curpos->p); } return 0; } else { return -1; } } int uprevpos(BW *bw) { W *w = bw->parent; lp: if (curpos->link.prev != &pos) { curpos = curpos->link.prev; if (!curpos->p || !curpos->w) { goto lp; } if (w->t->curwin == curpos->w && curpos->p->byte == w->t->curwin->object.bw->cursor->byte) { goto lp; } if (w->t->curwin != curpos->w) { w->t->curwin = curpos->w; if (w->t->curwin->y == -1) { wfit(w->t); } } w = w->t->curwin; bw = w->object.bw; if (bw->cursor->byte != curpos->p->byte) { pset(bw->cursor, curpos->p); } return 0; } else { return -1; } } jupp/poshist.h010064400000000000000000000006411363731763400106430ustar00/* * Position history * Copyright * (C) 1992 Joseph H. Allen * * This file is part of JOE (Joe's Own Editor) */ #ifndef JUPP_POSHIST_H #define JUPP_POSHIST_H #ifdef EXTERN_CMD_C __IDSTRING(rcsid_poshist_h, "$MirOS: contrib/code/jupp/poshist.h,v 1.6 2020/03/27 06:38:57 tg Exp $"); #endif void afterpos(void); void aftermove(W *w, P *p); void windie(W *w); int uprevpos(BW *bw); int unextpos(BW *bw); #endif jupp/pw.c010064400000000000000000000146371363731415100075740ustar00/* * Prompt windows * Copyright * (C) 1992 Joseph H. Allen * * This file is part of JOE (Joe's Own Editor) */ #include "config.h" #include "types.h" __RCSID("$MirOS: contrib/code/jupp/pw.c,v 1.16 2020/03/27 06:08:14 tg Exp $"); #include #include #include "b.h" #include "bw.h" #include "help.h" #include "kbd.h" #include "path.h" #include "pw.h" #include "scrn.h" #include "tab.h" #include "termcap.h" #include "tw.h" #include "uedit.h" #include "undo.h" #include "utils.h" #include "vfile.h" #include "menu.h" #include "va.h" #include "w.h" extern int smode; extern int dobeep; static void disppw(jobject jO, int flg) { BW *bw = jO.bw; W *w = bw->parent; PW *pw = (PW *) bw->object; if (!flg) { return; } /* Scroll buffer and position prompt */ if (pw->promptlen > w->w / 2 + w->w / 4) { pw->promptofst = pw->promptlen - w->w / 2; if (piscol(bw->cursor) < w->w - (pw->promptlen - pw->promptofst)) { bw->offset = 0; } else { bw->offset = piscol(bw->cursor) - (w->w - (pw->promptlen - pw->promptofst) - 1); } } else { if (piscol(bw->cursor) < w->w - pw->promptlen) { pw->promptofst = 0; bw->offset = 0; } else if (piscol(bw->cursor) >= w->w) { pw->promptofst = pw->promptlen; bw->offset = piscol(bw->cursor) - (w->w - 1); } else { pw->promptofst = pw->promptlen - (w->w - piscol(bw->cursor) - 1); bw->offset = piscol(bw->cursor) - (w->w - (pw->promptlen - pw->promptofst) - 1); } } /* Set cursor position */ w->curx = piscol(bw->cursor) - bw->offset + pw->promptlen - pw->promptofst; w->cury = 0; /* Generate prompt */ w->t->t->updtab[w->y] = 1; genfmt(w->t->t, w->x, w->y, pw->promptofst, pw->prompt, 0); /* Position and size buffer */ bwmove(bw, w->x + pw->promptlen - pw->promptofst, w->y); bwresz(bw, w->w - (pw->promptlen - pw->promptofst), 1); /* Generate buffer */ bwgen(bw, 0); } /* When user hits return in a prompt window */ extern volatile int dostaupd; static int rtnpw(jobject jO) { BW *bw = jO.bw; W *w = bw->parent; PW *pw = (PW *) bw->object; unsigned char *s; W *win; int *notify; jpoly_int *pfunc; void *object; long byte; p_goto_eol(bw->cursor); byte = bw->cursor->byte; p_goto_bol(bw->cursor); s = brvs(bw->cursor, (int)(byte - bw->cursor->byte)); if (pw->hist) { if (bw->b->changed) { P *q = pdup(pw->hist->eof); P *r = pdup(q); unsigned char *s2; long byte2; pprevl(r); byte2 = r->byte; p_goto_bol(r); s2 = brs(r, (int)(byte2 - r->byte)); prm(r); byte2 = strcmp(s, s2); free(s2); if (byte2) { binsm(q, s, (int)(byte - bw->cursor->byte)); p_goto_eof(q); binsc(q, '\n'); } prm(q); } else { P *q = pdup(pw->hist->bof); P *r; P *t; pline(q, bw->cursor->line); r = pdup(q); pnextl(r); t = pdup(pw->hist->eof); binsb(t, bcpy(q, r)); bdel(q, r); prm(q); prm(r); prm(t); } } win = w->win; pfunc = pw->pfunc; object = pw->object; bwrm(bw); free(pw->prompt); free(pw); w->object.base = NULL; notify = w->notify; w->notify = 0; wabort(w); dostaupd = 1; if (pfunc) { return pfunc(win->object, s, object, notify); } else { return -1; } } int ucmplt(BW *bw, int k) { PW *pw = (PW *) bw->object; if (pw->tab) { return pw->tab(bw, k); } else { return -1; } } static void inspw(BW *bw, B *b, long l, long n, int flg) { if (b == bw->b) { bwins(bw, l, n, flg); } } static void delpw(BW *bw, B *b, long l, long n, int flg) { if (b == bw->b) { bwdel(bw, l, n, flg); } } static int abortpw(jobject jO) { BW *b = jO.bw; PW *pw = b->object; void *object = pw->object; jpoly_int *abrt = pw->abrt; W *win = b->parent->win; bwrm(b); free(pw->prompt); free(pw); if (abrt) { return abrt(win->object, object); } else { return -1; } } WATOM watompw = { UC "prompt", disppw, bwfllw, abortpw, rtnpw, utypebw, NULL, NULL, inspw, delpw, TYPEPW }; /* Create a prompt window */ BW * wmkpw(W *w, const unsigned char *prompt, B **history, jpoly_int *func, const unsigned char *huh, jpoly_int *abrt, jpoly_int *tab, void *object, int *notify, union charmap *map) { W *new; PW *pw; BW *bw; new = wcreate(w->t, &watompw, w, w, w->main, 1, huh, notify); if (!new) { if (notify) { *notify = 1; } return NULL; } wfit(new->t); new->object.bw = bw = bwmk(new, bmk(NULL), 1); bw->b->o.charmap = map; bw->object = pw = malloc(sizeof(PW)); pw->abrt = abrt; pw->tab = tab; pw->object = object; pw->prompt = (unsigned char *)strdup((const char *)prompt); pw->promptlen = fmtlen(prompt); pw->promptofst = 0; pw->pfunc = func; if (history) { if (!*history) { *history = bmk(NULL); } pw->hist = *history; binsb(bw->cursor, bcpy(pw->hist->bof, pw->hist->eof)); bw->b->changed = 0; p_goto_eof(bw->cursor); p_goto_eof(bw->top); p_goto_bol(bw->top); } else { pw->hist = NULL; } w->t->curwin = new; return bw; } /* Tab completion functions */ unsigned char **regsub(unsigned char **z, int len, unsigned char *s) { unsigned char **lst = NULL; int x = -1; while (++x < len) if (rmatch(s, z[x])) lst = vaadd(lst, vsncpy(NULL, 0, sz(z[x]))); return lst; } void cmplt_ins(BW *bw, unsigned char *line) { P *p = pdup(bw->cursor); p_goto_bol(p); p_goto_eol(bw->cursor); bdel(p, bw->cursor); binsm(bw->cursor, sv(line)); p_goto_eol(bw->cursor); prm(p); bw->cursor->xcol = piscol(bw->cursor); } int cmplt_abrt(BW *bw, int x, unsigned char *line) { if (line) { cmplt_ins(bw, line); vsrm(line); } return -1; } int cmplt_rtn(MENU *m, int x, unsigned char *line) { cmplt_ins(m->parent->win->object.bw, m->list[x]); vsrm(line); m->object = NULL; wabort(m->parent); return 0; } int simple_cmplt(BW *bw,unsigned char **list) { MENU *m; P *p, *q; unsigned char *line; unsigned char *line1; unsigned char **lst; p = pdup(bw->cursor); p_goto_bol(p); q = pdup(bw->cursor); p_goto_eol(q); line = brvs(p, (int) (q->byte - p->byte)); /* Assumes short lines :-) */ prm(p); prm(q); line1 = vsncpy(NULL, 0, sv(line)); line1 = vsadd(line1, '*'); lst = regsub(list, aLEN(list), line1); vsrm(line1); if (!lst) { ttputc(7); vsrm(line); return -1; } m = mkmenu(bw->parent, lst, cmplt_rtn, cmplt_abrt, NULL, 0, line, NULL); if (!m) { varm(lst); vsrm(line); return -1; } if (aLEN(lst) == 1) return cmplt_rtn(m, 0, line); else if (smode || isreg(line)) return 0; else { unsigned char *com = mcomplete(m); vsrm(m->object); m->object = com; wabort(m->parent); smode = 2; ttputc(7); return 0; } } jupp/pw.h010064400000000000000000000017341363731763400076040ustar00/* * Prompt windows * Copyright * (C) 1992 Joseph H. Allen * * This file is part of JOE (Joe's Own Editor) */ #ifndef JUPP_PW_H #define JUPP_PW_H #ifdef EXTERN_CMD_C __IDSTRING(rcsid_pw_h, "$MirOS: contrib/code/jupp/pw.h,v 1.12 2020/03/27 06:38:57 tg Exp $"); #endif /* BW *wmkpw(BW *bw,char *prompt,int (*func)(),char *huh,int (*abrt)(), int (*tab)(),void *object,int *notify); * Create a prompt window for the given window */ BW *wmkpw(W *w, const unsigned char *prompt, B **history, jpoly_int *func, const unsigned char *huh, jpoly_int *abrt, jpoly_int *tab, void *object, int *notify, union charmap *map); int ucmplt(BW *bw, int k); /* Function for TAB completion */ unsigned char **regsub(unsigned char **z, int len, unsigned char *s); void cmplt_ins(BW *bw,unsigned char *line); int cmplt_abrt(BW *bw,int x, unsigned char *line); int cmplt_rtn(MENU *m,int x,unsigned char *line); int simple_cmplt(BW *bw,unsigned char **list); extern WATOM watompw; #endif jupp/queue.c010064400000000000000000000016221411643516500102620ustar00/* * Doubly linked list primitives * Copyright * (C) 1992 Joseph H. Allen * * This file is part of JOE (Joe's Own Editor) */ #include "config.h" #include "types.h" __RCSID("$MirOS: contrib/code/jupp/queue.c,v 1.7 2021/09/09 16:46:18 tg Exp $"); #include #include "queue.h" #include "utils.h" void *QUEUE; void *ITEM; void *LAST; void * alitem(void *list, size_t itemsize) { STDITEM *freelist = (STDITEM *)list; if (qempty(STDITEM, link, freelist)) { size_t num = 16; unsigned char *i = calloc(num, itemsize); while (num--) { enquef(STDITEM, link, freelist, i); i += itemsize; } } return (void *)deque_f(STDITEM, link, freelist->link.prev); } void frchn(void *list, void *ch) { STDITEM *freelist = (STDITEM *)list; STDITEM *chn = (STDITEM *)ch; STDITEM *i; if ((i = chn->link.prev) != chn) { deque(STDITEM, link, chn); splicef(STDITEM, link, freelist, i); } } jupp/queue.h010064400000000000000000000076601374670214400103010ustar00/* * Doubly linked list primitives * Copyright * (C) 1992 Joseph H. Allen * * This file is part of JOE (Joe's Own Editor) */ #ifndef JUPP_QUEUE_H #define JUPP_QUEUE_H #ifdef EXTERN_B_C __IDSTRING(rcsid_queue_h, "$MirOS: contrib/code/jupp/queue.h,v 1.9 2020/10/30 03:11:05 tg Exp $"); #endif extern void *ITEM; extern void *QUEUE; extern void *LAST; #define izque(type,member,item) do { \ QUEUE = (void *)(item); \ ((type *)QUEUE)->member.prev = (type *)QUEUE; \ ((type *)QUEUE)->member.next = (type *)QUEUE; \ } while(0) #define deque(type,member,item) do { \ ITEM = (void *)(item); \ ((type *)ITEM)->member.prev->member.next = ((type *)ITEM)->member.next; \ ((type *)ITEM)->member.next->member.prev = ((type *)ITEM)->member.prev; \ } while(0) #define deque_f(type,member,item) \ ( \ ITEM=(void *)(item), \ ((type *)ITEM)->member.prev->member.next=((type *)ITEM)->member.next, \ ((type *)ITEM)->member.next->member.prev=((type *)ITEM)->member.prev, \ (type *)ITEM \ ) #define qempty(type,member,item) \ ( \ QUEUE=(void *)(item), \ (type *)QUEUE==((type *)QUEUE)->member.next \ ) #define enquef(type,member,queue,item) do { \ ITEM = (void *)(item); \ QUEUE = (void *)(queue); \ ((type *)ITEM)->member.next = ((type *)QUEUE)->member.next; \ ((type *)ITEM)->member.prev = (type *)QUEUE; \ ((type *)QUEUE)->member.next->member.prev = (type *)ITEM; \ ((type *)QUEUE)->member.next = (type *)ITEM; \ } while(0) #define enqueb(type,member,queue,item) do { \ ITEM = (void *)(item); \ QUEUE = (void *)(queue); \ ((type *)ITEM)->member.next = (type *)QUEUE; \ ((type *)ITEM)->member.prev = ((type *)QUEUE)->member.prev; \ ((type *)QUEUE)->member.prev->member.next = (type *)ITEM; \ ((type *)QUEUE)->member.prev = (type *)ITEM; \ } while(0) #define enqueb_f(type,member,queue,item) \ ( \ ITEM=(void *)(item), \ QUEUE=(void *)(queue), \ ((type *)ITEM)->member.next=(type *)QUEUE, \ ((type *)ITEM)->member.prev=((type *)QUEUE)->member.prev, \ ((type *)QUEUE)->member.prev->member.next=(type *)ITEM, \ ((type *)QUEUE)->member.prev=(type *)ITEM, \ (type *)ITEM \ ) #define promote(type,member,queue,item) do { \ LAST = (void *)deque_f(type, member, (item)); \ enquef(type, member, (queue), LAST); \ } while (/* CONSTCOND */ 0) #define demote(type,member,queue,item) do { \ LAST = (void *)deque_f(type, member, (item)); \ enqueb(type, member, (queue), LAST); \ } while (/* CONSTCOND */ 0) #define splicef(type,member,queue,chain) do { \ ITEM = (void *)(chain); \ LAST = (void *)((type *)ITEM)->member.prev; \ QUEUE = (void *)(queue); \ ((type *)LAST)->member.next = ((type *)QUEUE)->member.next; \ ((type *)ITEM)->member.prev = (type *)QUEUE; \ ((type *)QUEUE)->member.next->member.prev = (type *)LAST; \ ((type *)QUEUE)->member.next = (type *)ITEM; \ } while(0) #define spliceb(type,member,queue,chain) do { \ ITEM = (void *)(chain); \ LAST = (void *)((type *)ITEM)->member.prev; \ QUEUE = (void *)(queue); \ ((type *)LAST)->member.next = (type *)QUEUE; \ ((type *)ITEM)->member.prev = ((type *)QUEUE)->member.prev; \ ((type *)QUEUE)->member.prev->member.next = (type *)ITEM; \ ((type *)QUEUE)->member.prev = (type *)LAST; \ } while(0) #define spliceb_f(type,member,queue,chain) \ ( \ ITEM=(void *)(chain), \ LAST=(void *)((type *)ITEM)->member.prev, \ QUEUE=(void *)(queue), \ ((type *)LAST)->member.next=(type *)QUEUE, \ ((type *)ITEM)->member.prev=((type *)QUEUE)->member.prev, \ ((type *)QUEUE)->member.prev->member.next=(type *)ITEM, \ ((type *)QUEUE)->member.prev=(type *)LAST, \ (type *)ITEM \ ) #define snip(type,member,first,last) \ ( \ ITEM=(void *)(first), \ LAST=(void *)(last), \ ((type *)LAST)->member.next->member.prev=((type *)ITEM)->member.prev, \ ((type *)ITEM)->member.prev->member.next=((type *)LAST)->member.next, \ ((type *)ITEM)->member.prev=(type *)LAST, \ ((type *)LAST)->member.next=(type *)ITEM, \ (type *)ITEM \ ) void *alitem(void *list, size_t itemsize); void frchn(void *list, void *ch); #endif jupp/qw.c010064400000000000000000000112151363731415100075620ustar00/* * Query windows * Copyright * (C) 1992 Joseph H. Allen * * This file is part of JOE (Joe's Own Editor) */ #include "config.h" #include "types.h" __RCSID("$MirOS: contrib/code/jupp/qw.c,v 1.13 2020/03/27 06:08:14 tg Exp $"); #include #include "utils.h" #include "vs.h" #include "charmap.h" #include "qw.h" #include "scrn.h" #include "w.h" static void dispqw(jobject jO, int flg __attribute__((__unused__))) { QW *qw = jO.qw; W *w = qw->parent; /* Scroll buffer and position prompt */ if (qw->promptlen > w->w / 2 + w->w / 4) qw->promptofst = qw->promptlen - w->w / 2; else qw->promptofst = 0; /* Set cursor position */ w->curx = qw->promptlen - qw->promptofst; w->cury = 0; /* Generate prompt */ w->t->t->updtab[w->y] = 1; genfield(w->t->t, w->t->t->scrn + w->y * w->t->t->co + w->x, w->t->t->attr + w->y * w->t->t->co + w->x, w->x, w->y, qw->promptofst, qw->prompt, qw->promptlen, 0, w->w - w->x, 1, NULL); } static void dispqwn(jobject jO, int flg __attribute__((__unused__))) { QW *qw = jO.qw; W *w = qw->parent; /* Scroll buffer and position prompt */ if (qw->promptlen > w->w / 2 + w->w / 4) qw->promptofst = qw->promptlen - w->w / 2; else qw->promptofst = 0; /* Set cursor position */ if (w->win->watom->follow && w->win->object.base) w->win->watom->follow(w->win->object); if (w->win->watom->disp && w->win->object.base) w->win->watom->disp(w->win->object, 1); w->curx = w->win->curx; w->cury = w->win->cury + w->win->y - w->y; /* Generate prompt */ w->t->t->updtab[w->y] = 1; genfield(w->t->t, w->t->t->scrn + w->y * w->t->t->co + w->x, w->t->t->attr + w->y * w->t->t->co + w->x, w->x, w->y, qw->promptofst, qw->prompt, qw->promptlen, 0, w->w - w->x, 1, NULL); } /* When user hits a key in a query window */ struct utf8_sm qw_sm; static int utypeqw(jobject jO, int c) { QW *qw = jO.qw; W *win; W *w = qw->parent; int *notify = w->notify; jpoly_int *func; void *object = qw->object; if (joe_maputf(locale_map)) { c = utf8_decode(&qw_sm, c); if (c<0) return 0; } win = qw->parent->win; func = qw->func; vsrm(qw->prompt); free(qw); w->object.base = NULL; w->notify = NULL; wabort(w); if (func) return func(win->object, c, object, notify); return -1; } static int abortqw(jobject jO) { QW *qw = jO.qw; W *win = qw->parent->win; void *object = qw->object; jpoly_int *abrt = qw->abrt; vsrm(qw->prompt); free(qw); if (abrt) return abrt(win->object, object); else return -1; } static WATOM watomqw = { UC "query", dispqw, NULL, abortqw, NULL, utypeqw, NULL, NULL, NULL, NULL, TYPEQW }; static WATOM watqwn = { UC "querya", dispqwn, NULL, abortqw, NULL, utypeqw, NULL, NULL, NULL, NULL, TYPEQW }; static WATOM watqwsr = { UC "querysr", dispqwn, NULL, abortqw, NULL, utypeqw, NULL, NULL, NULL, NULL, TYPEQW }; /* Create a query window */ QW * mkqw(W *w, const unsigned char *prompt, int len, jpoly_int *func, jpoly_int *abrt, void *object, int *notify) { W *new; QW *qw; new = wcreate(w->t, &watomqw, w, w, w->main, 1, NULL, notify); if (!new) { if (notify) *notify = 1; return NULL; } wfit(new->t); new->object.qw = qw = malloc(sizeof(QW)); qw->parent = new; qw->prompt = vsncpy(NULL, 0, prompt, len); qw->promptlen = len; qw->promptofst = 0; qw->func = func; qw->abrt = abrt; qw->object = object; w->t->curwin = new; return qw; } /* Same as above, but cursor is left in original window */ /* For Ctrl-Meta thing */ QW * mkqwna(W *w, const unsigned char *prompt, int len, jpoly_int *func, jpoly_int *abrt, void *object, int *notify) { W *new; QW *qw; new = wcreate(w->t, &watqwn, w, w, w->main, 1, NULL, notify); if (!new) { if (notify) *notify = 1; return NULL; } wfit(new->t); new->object.qw = qw = malloc(sizeof(QW)); qw->parent = new; qw->prompt = vsncpy(NULL, 0, prompt, len); qw->promptlen = len; qw->promptofst = 0; qw->func = func; qw->abrt = abrt; qw->object = object; w->t->curwin = new; return qw; } /* Same as above, but cursor is left in original window */ /* For search and replace thing */ QW * mkqwnsr(W *w, const unsigned char *prompt, int len, jpoly_int *func, jpoly_int *abrt, void *object, int *notify) { W *new; QW *qw; new = wcreate(w->t, &watqwsr, w, w, w->main, 1, NULL, notify); if (!new) { if (notify) *notify = 1; return NULL; } wfit(new->t); new->object.qw = qw = malloc(sizeof(QW)); qw->parent = new; qw->prompt = vsncpy(NULL, 0, prompt, len); qw->promptlen = len; qw->promptofst = 0; qw->func = func; qw->abrt = abrt; qw->object = object; w->t->curwin = new; return qw; } jupp/qw.h010064400000000000000000000014331363731763400076010ustar00/* * Single-key query windows * Copyright * (C) 1992 Joseph H. Allen * * This file is part of JOE (Joe's Own Editor) */ #ifndef JUPP_QW_H #define JUPP_QW_H #ifdef EXTERN_UFILE_C __IDSTRING(rcsid_qw_h, "$MirOS: contrib/code/jupp/qw.h,v 1.8 2020/03/27 06:38:57 tg Exp $"); #endif /* QW *mkqw(W *w, char *prompt, int (*func)(), int (*abrt)(), void *object); * Create a query window for the given window */ /* FIXME: ??? ----> */ QW *mkqw(W *w, const unsigned char *prompt, int len, jpoly_int *func, jpoly_int *abrt, void *object, int *notify); QW *mkqwna(W *w, const unsigned char *prompt, int len, jpoly_int *func, jpoly_int *abrt, void *object, int *notify); QW *mkqwnsr(W *w, const unsigned char *prompt, int len, jpoly_int *func, jpoly_int *abrt, void *object, int *notify); #endif jupp/rc.c010064400000000000000000000744131426610340600075460ustar00/* * *rc file parser * Copyright * (C) 1992 Joseph H. Allen * Copyright © 2005, 2006, 2009, 2010, 2011, 2012, 2017, 2018, 2020 * mirabilos * * This file is part of JOE (Joe's Own Editor) */ #define EXTERN_RC_C #include "config.h" #include "types.h" __RCSID("$MirOS: contrib/code/jupp/rc.c,v 1.53 2022/07/20 22:51:23 tg Exp $"); #include #include #ifdef HAVE_BSD_STRING_H #include #endif #include "builtin.h" #include "cmd.h" #include "kbd.h" #include "macro.h" #include "menu.h" #include "path.h" #include "pw.h" #include "rc.h" #include "regex.h" #include "tw.h" #include "uedit.h" #include "umath.h" #include "utils.h" #include "vs.h" #include "b.h" #include "syntax.h" #include "va.h" #include "charmap.h" #include "w.h" #define OPT_BUF_SIZE 60 /* List of named contexts */ static struct context { struct context *next; unsigned char *name; KMAP *kmap; } *contexts = NULL; /* * Find a context of a given name; if not found, * one with an empty kmap is created. */ KMAP * kmap_getcontext(const unsigned char *name, int docreate) { struct context *c; for (c = contexts; c; c = c->next) if (!strcmp(c->name, name)) return c->kmap; if (!docreate) return (NULL); c = malloc(sizeof(struct context)); c->next = contexts; c->name = (unsigned char *)strdup((const char *)name); contexts = c; return c->kmap = mkkmap(); } OPTIONS *options = NULL; /* Global variable options */ extern int mid, dspasis, dspctrl, help, square, csmode, nobackups, lightoff, exask, skiptop; extern int noxon, lines, columns, Baud, dopadding, orphan, marking, keepup, nonotice; extern int notite, pastetite, usetabs, assume_color, guesscrlf, guessindent, menu_explorer, icase, wrap, autoswap; extern unsigned char *backpath; /* Default options for prompt windows */ OPTIONS pdefault = { NULL, /* *next */ NULL, /* *name_regex */ NULL, /* *contents_regex */ 0, /* overtype */ 0, /* lmargin */ 76, /* rmargin */ 0, /* autoindent */ 0, /* wordwrap */ 8, /* tab */ ' ', /* indent char */ 1, /* indent step */ NULL, /* *context */ NULL, /* *lmsg */ NULL, /* *rmsg */ NULL, /* *hmsg */ 0, /* line numbers */ 0, /* read only */ 0, /* french spacing */ 0, /* spaces */ 0, /* crlf */ 0, /* Highlight */ NULL, /* Syntax name */ NULL, /* Syntax */ NULL, /* Name of character set */ NULL, /* Character set */ 0, /* Smart home key */ 0, /* Goto indent first */ 0, /* Smart backspace key */ 0, /* Purify indentation */ 0, /* Picture mode */ NULL, /* macro to execute for new files */ NULL, /* macro to execute for existing files */ NULL, /* macro to execute before saving new files */ NULL, /* macro to execute before saving existing files */ 0, /* visible spaces */ 0 /* hex */ }; /* Default options for file windows */ char main_context[] = "main"; OPTIONS fdefault = { NULL, /* *next */ NULL, /* *name_regex */ NULL, /* *contents_regex */ 0, /* overtype */ 0, /* lmargin */ 76, /* rmargin */ 0, /* autoindent */ 0, /* wordwrap */ 8, /* tab */ ' ', /* indent char */ 1, /* indent step */ US main_context, /* *context */ UC "\\i%n %m %M", /* *lmsg */ UC " %S Ctrl-K H for help", /* *rmsg */ NULL, /* *hmsg */ 0, /* line numbers */ 0, /* read only */ 0, /* french spacing */ 0, /* spaces */ 0, /* crlf */ 0, /* Highlight */ NULL, /* Syntax name */ NULL, /* Syntax */ NULL, /* Name of character set */ NULL, /* Character set */ 0, /* Smart home key */ 0, /* Goto indent first */ 0, /* Smart backspace key */ 0, /* Purity indentation */ 0, /* Picture mode */ NULL, NULL, NULL, NULL, /* macros (see above) */ 0, /* visible spaces */ 0 /* hex */ }; /* Update options */ void lazy_opts(OPTIONS *o) { o->syntax = load_dfa(o->syntax_name); o->charmap = find_charmap(o->map_name); if (!o->charmap) o->charmap = fdefault.charmap; /* Hex not allowed with UTF-8 */ if (o->hex && joe_maputf(o->charmap)) { o->charmap = find_charmap(UC "c"); } } /* Set local options depending on file name and contents */ void setopt(B *b, const unsigned char *parsed_name) { OPTIONS *o; int x; unsigned char *pieces[26]; P *p; for (x = 0; x != 26; ++x) pieces[x] = NULL; for (o = options; o; o = o->next) if (rmatch(o->name_regex, parsed_name)) { if (!o->contents_regex) goto done; p = pdup(b->bof); x = pmatch(pieces, o->contents_regex, strlen((char *)o->contents_regex), p, 0, 0); prm(p); if (x) goto done; } b->o = fdefault; if (0) { done: b->o = *o; } lazy_opts(&b->o); for (x = 0; x != 26; ++x) vsrm(pieces[x]); } /* Table of options and how to set them */ /* * local means it's in an OPTION structure, * global means it's in a global variable */ #define F(x) NULL, &fdefault.x #define G(type,name,setiaddr,yes,no,menu,low,high) \ X(type,name,setiaddr,yes,no,menu,low,high) #define X(type,name,seti,addr,yes,no,menu,low,high) \ { UC name, { seti }, US addr, UC yes, UC no, UC menu, 0, type, low, high } #define L(x) &x, NULL static struct glopts { const unsigned char *name; /* Option name */ union { int *i; unsigned char **us; } set; /* Address of global option */ unsigned char *addr; /* Local options structure member address */ const unsigned char *yes; /* Message if option was turned on, or prompt string */ const unsigned char *no; /* Message if option was turned off */ const unsigned char *menu; /* Menu string */ size_t ofst; /* Local options structure member offset */ int type; /* 0 for global option flag 1 for global option numeric 2 for global option string 4 for local option flag 5 for local option numeric 6 for local option string 7 for local option numeric+1, with range checking 8 for ...? 9 for syntax 13 for encoding */ int low; /* Low limit for numeric options */ int high; /* High limit for numeric options */ } glopts[] = { G( 0, "noxon", L(noxon), "XON/XOFF processing disabled", "XON/XOFF processing enabled", " XON/XOFF usable ", 0, 0), G( 0, "keepup", L(keepup), "Status line updated constantly", "Status line updated once/sec", " Fast status line ", 0, 0), G( 1, "baud", L(Baud), "Terminal baud rate (%d): ", NULL, " Baud rate ", 0, 38400), G( 4, "overwrite", F(overtype), "Overtype mode", "Insert mode", "T Overtype ", 0, 0), G( 4, "autoindent", F(autoindent), "Autoindent enabled", "Autoindent disabled", "I Autoindent ", 0, 0), G( 4, "wordwrap", F(wordwrap), "Wordwrap enabled", "Wordwrap disabled", "Word wrap ", 0, 0), G( 5, "tab", F(tab), "Tab width (%d): ", NULL, "D Tab width ", 1, 64), G( 7, "lmargin", F(lmargin), "Left margin (%d): ", NULL, "Left margin ", 0, 63), G( 7, "rmargin", F(rmargin), "Right margin (%d): ", NULL, "Right margin ", 7, 255), G( 0, "square", L(square), "Rectangle mode", "Text-stream mode", "X Rectangle mode ", 0, 0), G( 0, "icase", L(icase), "Ignore case by default", "Case sensitive by default", " Case insensitive ", 0, 0), G( 0, "wrap", L(wrap), "Search wraps", "Search doesn't wrap", " Search wraps ", 0, 0), G( 0, "menu_explorer", L(menu_explorer), "Menu explorer mode", " Simple completion", " Menu explorer ", 0, 0), G( 0, "autoswap", L(autoswap), "Autoswap ^KB and ^KK", " Autoswap off ", " Autoswap mode ", 0, 0), G( 5, "indentc", F(indentc), "Indent char %d (SPACE=32, TAB=9, ^C to abort): ", NULL, " Indent char ", 0, 255), G( 5, "istep", F(istep), "Indent step %d (^C to abort): ", NULL, " Indent step ", 1, 64), G( 4, "french", F(french), "One space after periods for paragraph reformat", "Two spaces after periods for paragraph reformat", " French spacing ", 0, 0), G( 4, "highlight", F(highlight), "Highlighting enabled", "Highlighting disabled", "Highlighting ", 0, 0), G( 4, "spaces", F(spaces), "Inserting spaces when tab key is hit", "Inserting tabs when tab key is hit", " Disable tabs ", 0, 0), G( 0, "mid", L(mid), "Cursor will be recentered on scrolls", "Cursor will not be recentered on scroll", "Center on scroll ", 0, 0), G( 0, "guess_crlf", L(guesscrlf), "Automatically detect MS-DOS files", "Do not automatically detect MS-DOS files", " Auto detect CR-LF ", 0, 0), G( 0, "guess_indent", L(guessindent), "Automatically detect indentation", "Do not automatically detect indentation", " Guess indent ", 0, 0), G( 4, "crlf", F(crlf), "CR-LF is line terminator", "LF is line terminator", "Z CR-LF (MS-DOS) ", 0, 0), G( 4, "linums", F(linums), "Line numbers enabled", "Line numbers disabled", "N Line numbers ", 0, 0), G( 0, "marking", L(marking), "Anchored block marking on", "Anchored block marking off", "Marking ", 0, 0), G( 0, "asis", L(dspasis), "Characters above 127 shown as-is", "Characters above 127 shown in inverse", " Meta chars as-is ", 0, 0), G( 0, "force", L(force), "Last line forced to have NL when file saved", "Last line not forced to have NL", "Force last NL ", 0, 0), G( 0, "nobackups", L(nobackups), "Backup files will not be made", "Backup files will be made", " Disable backups ", 0, 0), G( 0, "lightoff", L(lightoff), "Highlighting turned off after block operations", "Highlighting not turned off after block operations", "Auto unmark ", 0, 0), G( 0, "exask", L(exask), "Prompt for filename in save & exit command", "Don't prompt for filename in save & exit command", " Exit ask ", 0, 0), G( 0, "beep", L(dobeep), "Warning bell enabled", "Warning bell disabled", "Beeps ", 0, 0), G( 0, "nosta", L(staen), "Top-most status line disabled", "Top-most status line enabled", " Disable status ", 0, 0), G( 1, "pg", L(pgamnt), "Lines to keep for PgUp/PgDn or -1 for 1/2 window (%d): ", NULL, " # PgUp/PgDn lines ", -1, 64), G( 0, "csmode", L(csmode), "Start search after a search repeats previous search", "Start search always starts a new search", "Continued search ", 0, 0), G( 4, "rdonly", F(readonly), "Read only", "Full editing", "O Read only ", 0, 0), G( 4, "smarthome", F(smarthome), "Smart home key enabled", "Smart home key disabled", " Smart home key ", 0, 0), G( 4, "indentfirst", F(indentfirst), "Smart home goes to indent first", "Smart home goes home first", " To indent first ", 0, 0), G( 4, "smartbacks", F(smartbacks), "Smart backspace key enabled", "Smart backspace key disabled", " Smart backspace ", 0, 0), G( 4, "purify", F(purify), "Indentation clean up enabled", "Indentation clean up disabled", " Clean up indents ", 0, 0), G( 4, "picture", F(picture), "Picture drawing mode enabled", "Picture drawing mode disabled", "Picture mode ", 0, 0), X( 2, "backpath", NULL, NULL, "Backup files stored in (%s): ", NULL, " Backup file path ", 0, 0), G( 4, "vispace", F(vispace), "Spaces visible", "Spaces invisible", "Visible spaces ", 0, 0), G( 4, "hex", F(hex), "Hex edit mode", "Text edit mode", "G Hexedit mode ", 0, 0), X( 9, "syntax", NULL, NULL, "Select syntax (%s; ^C to abort): ", NULL, "Y Syntax", 0, 0), X(13, "encoding", NULL, NULL, "Select file character set (%s; ^C to abort): ", NULL, "Encoding ", 0, 0), G( 0, "nonotice", L(nonotice), NULL, NULL, NULL, 0, 0), G( 0, "orphan", L(orphan), NULL, NULL, NULL, 0, 0), G( 0, "help", L(help), NULL, NULL, NULL, 0, 0), G( 0, "dopadding", L(dopadding), NULL, NULL, NULL, 0, 0), G( 1, "lines", L(lines), NULL, NULL, NULL, 2, 1024), G( 1, "columns", L(columns), NULL, NULL, NULL, 2, 1024), G( 1, "skiptop", L(skiptop), NULL, NULL, NULL, 0, 64), G( 0, "notite", L(notite), NULL, NULL, NULL, 0, 0), G( 0, "pastetite", L(pastetite), NULL, NULL, NULL, 0, 0), G( 0, "usetabs", L(usetabs), NULL, NULL, NULL, 0, 0), G( 0, "assume_color", L(assume_color), NULL, NULL, NULL, 0, 0), X( 0, NULL, NULL, NULL, NULL, NULL, NULL, 0, 0) }; #undef F #undef G #undef L #undef X /* Initialize .ofsts above. Is this really necessary? */ int isiz = 0; static void izopts(void) { int x; for (x = 0; glopts[x].name; ++x) switch (glopts[x].type) { case 2: if (!strcmp((const char *)glopts[x].name, "backpath")) glopts[x].set.us = &backpath; break; case 4: case 5: case 6: case 7: case 8: glopts[x].ofst = glopts[x].addr - (unsigned char *) &fdefault; } isiz = 1; } #define RELOPT(lopts,opt) (*((int *)(((unsigned char *)(lopts)) + glopts[opt].ofst))) /*- * Set a global or local option: * 's' is option name * 'arg' is a possible argument string (taken only if option has an arg) * 'options' points to options structure to modify (can be NULL). * 'set'==0: set only in 'options' if it's given. * 'set'!=0: set global variable option. * return value: no. of fields taken (1 or 2), or 0 if option not found. * * So this function is used both to set options, and to parse over options * without setting them. * * These combinations are used: * * glopt(name,arg,NULL,1): set global variable option * glopt(name,arg,NULL,0): parse over option * glopt(name,arg,options,0): set file local option * glopt(name,arg,&fdefault,1): set default file options * glopt(name,arg,options,1): set file local option */ int glopt(const unsigned char *s, unsigned char *arg, OPTIONS *opts, int set) { int val; int ret = 0; int st = 1; /* 1 to set option, 0 to clear it */ int x; void *vp; /* Initialize offsets */ if (!isiz) izopts(); /* Clear instead of set? */ if (s[0] == '-') { st = 0; ++s; } for (x = 0; glopts[x].name; ++x) if (!strcmp(glopts[x].name, s)) { switch (glopts[x].type) { case 0: /* Global variable flag option */ if (set) *glopts[x].set.i = st; break; case 1: /* Global variable integer option */ if (set && arg) { val = ustolb(arg, &vp, glopts[x].low, glopts[x].high, USTOL_TRIM | USTOL_EOS); if (vp) *glopts[x].set.i = val; } break; case 2: /* Global variable string option */ if (set) *glopts[x].set.us = arg ? (unsigned char *)strdup((char *)arg) : NULL; break; case 4: /* Local option flag */ if (opts) RELOPT(opts, x) = st; break; case 5: /* Local option integer */ if (arg && opts) { val = ustolb(arg, &vp, glopts[x].low, glopts[x].high, USTOL_TRIM | USTOL_EOS); if (vp) RELOPT(opts, x) = val; } break; case 7: /* Local option numeric + 1, with range checking */ if (arg) { val = ustolb(arg, &vp, glopts[x].low, glopts[x].high, USTOL_TRIM | USTOL_EOS); if (vp && opts) RELOPT(opts, x) = val - 1; } break; case 9: /* Set syntax */ if (arg && opts) opts->syntax_name = (unsigned char *)strdup((char *)arg); break; case 13: /* Set byte mode encoding */ if (arg && opts) opts->map_name = (unsigned char *)strdup((char *)arg); break; } /* This is a stupid hack... */ if ((glopts[x].type & 3) == 0 || !arg) return 1; else return 2; } /* Why no case 6, string option? */ /* Keymap, mold, mnew, etc. are not strings */ /* These options do not show up in ^T */ if (!strcmp(s, "lmsg")) { if (arg) { if (opts) opts->lmsg = (unsigned char *)strdup((char *)arg); ret = 2; } else ret = 1; } else if (!strcmp(s, "rmsg")) { if (arg) { if (opts) opts->rmsg = (unsigned char *)strdup((char *)arg); ret = 2; } else ret = 1; } else if (!strcmp(s, "hmsg")) { if (arg) { if (opts) opts->hmsg = strdup((char *)arg); ret = 2; } else ret = 1; } else if (!strcmp(s, "keymap")) { if (arg) { if (opts) opts->context = (unsigned char *)strdup((char *)arg); ret = 2; } else ret = 1; } else if (!strcmp(s, "mnew")) { if (arg) { int sta; if (opts) opts->mnew = mparse(NULL, arg, &sta); ret = 2; } else ret = 1; } else if (!strcmp(s, "mold")) { if (arg) { int sta; if (opts) opts->mold = mparse(NULL, arg, &sta); ret = 2; } else ret = 1; } else if (!strcmp(s, "msnew")) { if (arg) { int sta; if (opts) opts->msnew = mparse(NULL, arg, &sta); ret = 2; } else ret = 1; } else if (!strcmp(s, "msold")) { if (arg) { int sta; if (opts) opts->msold = mparse(NULL, arg, &sta); ret = 2; } else ret = 1; } return ret; } /* Option setting user interface (^T command) */ /* Menu cursor position: remember it for next time */ static int optx = 0; static int doabrt1(BW *bw, int *xx) { free(xx); return -1; } static int doopt1(BW *bw, unsigned char *s, int *xx, int *notify) { int ret = 0; int x = *xx; long v; free(xx); switch (glopts[x].type) { case 1: if (!*s) { ret = -1; break; } v = calcl(bw, s); if (merrf) { msgnw(bw->parent, merrt); ret = -1; } else if (v >= glopts[x].low && v <= glopts[x].high) *glopts[x].set.i = v; else { msgnw(bw->parent, UC "Value out of range"); ret = -1; } break; case 2: if (s[0]) *glopts[x].set.us = (unsigned char *)strdup((char *)s); break; case 5: if (!*s) { ret = -1; break; } v = calcl(bw, s); if (merrf) { msgnw(bw->parent, merrt); ret = -1; } else if (v >= glopts[x].low && v <= glopts[x].high) RELOPT(&bw->o, x) = v; else { msgnw(bw->parent, UC "Value out of range"); ret = -1; } break; case 7: if (!*s) { ret = -1; break; } v = calcl(bw, s) - 1L; if (merrf) { msgnw(bw->parent, merrt); ret = -1; } else if (v >= glopts[x].low && v <= glopts[x].high) RELOPT(&bw->o, x) = v; else { msgnw(bw->parent, UC "Value out of range"); ret = -1; } break; } vsrm(s); bw->b->o = bw->o; wfit(bw->parent->t); updall(); if (notify) *notify = 1; return ret; } static int dosyntax(BW *bw, unsigned char *s, int *xx, int *notify) { int ret = 0; struct high_syntax *syn; if (*s) { if ((syn = load_dfa(s))) bw->o.syntax = syn; else msgnw(bw->parent, UC "Syntax definition file not found"); } else bw->o.syntax = NULL; vsrm(s); bw->b->o = bw->o; updall(); if (notify) *notify = 1; return ret; } /* Array of available syntacÄ“s */ unsigned char **syntaxes = NULL; static int syntaxcmplt(BW *bw) { if (!syntaxes) { unsigned char *oldpwd = pwd(); unsigned char **t; unsigned char *p; int x, y; if (chJpwd(UC "syntax")) return -1; t = rexpnd(UC "*.jsf"); if (!t) { chpwd(oldpwd); return -1; } if (!aLEN(t)) { varm(t); chpwd(oldpwd); return -1; } for (x = 0; x != aLEN(t); ++x) { unsigned char *r = vsncpy(NULL,0,t[x],(unsigned char *)strrchr((char *)(t[x]),'.')-t[x]); syntaxes = vaadd(syntaxes,r); } varm(t); p = (unsigned char *)getenv("HOME"); if (p) { unsigned char buf[1024]; joe_snprintf_1((char *)buf,sizeof(buf),"%s/.jupp/syntax",p); if (!chpwd(buf) && (t = rexpnd(UC "*.jsf"))) { for (x = 0; x != aLEN(t); ++x) *strrchr((char *)t[x],'.') = 0; for (x = 0; x != aLEN(t); ++x) { for (y = 0; y != aLEN(syntaxes); ++y) if (!strcmp(t[x],syntaxes[y])) break; if (y == aLEN(syntaxes)) { unsigned char *r = vsncpy(NULL,0,sv(t[x])); syntaxes = vaadd(syntaxes,r); } } varm(t); } } vasort(av(syntaxes)); chpwd(oldpwd); } return simple_cmplt(bw,syntaxes); } static int check_for_hex(BW *bw) { W *w; if (bw->o.hex) return 1; for (w = bw->parent->link.next; w != bw->parent; w = w->link.next) if ((w->watom == &watomtw || w->watom == &watompw) && w->object.bw->b == bw->b && w->object.bw->o.hex) return 1; return 0; } static int doencoding(BW *bw, unsigned char *s, int *xx, int *notify) { int ret = 0; union charmap *map; if (*s) map = find_charmap(s); else map = fdefault.charmap; if (map && joe_maputf(map) && check_for_hex(bw)) { vsrm(s); msgnw(bw->parent, UC "UTF-8 encoding not allowed with hex-edit windows"); if (notify) *notify = 1; return -1; } if (map) { bw->o.charmap = map; joe_snprintf_1((char *)msgbuf, JOE_MSGBUFSIZE, "%s encoding assumed for this file", joe_mapname(map)); msgnw(bw->parent, msgbuf); } else msgnw(bw->parent, UC "Character set not found"); vsrm(s); bw->b->o = bw->o; updall(); if (notify) *notify = 1; return ret; } /* Array of available encodinges */ unsigned char **encodings = NULL; static int encodingcmplt(BW *bw) { if (!encodings) { encodings = get_encodings(); vasort(av(encodings)); } return simple_cmplt(bw,encodings); } static int doopt(MENU *m, int x, void *object, int flg) { BW *bw = m->parent->win->object.bw; int *xx; unsigned char buf[OPT_BUF_SIZE]; int *notify = m->parent->notify; switch (glopts[x].type) { case 0: if (!flg) *glopts[x].set.i = !*glopts[x].set.i; else if (flg == 1) *glopts[x].set.i = 1; else *glopts[x].set.i = 0; wabort(m->parent); msgnw(bw->parent, *glopts[x].set.i ? glopts[x].yes : glopts[x].no); if (glopts[x].set.i == &noxon) tty_xonoffbaudrst(); break; case 4: if (!flg) RELOPT(&bw->o, x) = !RELOPT(&bw->o, x); else if (flg == 1) RELOPT(&bw->o, x) = 1; else RELOPT(&bw->o, x) = 0; wabort(m->parent); msgnw(bw->parent, RELOPT(&bw->o, x) ? glopts[x].yes : glopts[x].no); /*XXX use offsetof, also in izopts or better statically */ if (glopts[x].ofst == (unsigned char *) &fdefault.readonly - (unsigned char *) &fdefault) bw->b->rdonly = bw->o.readonly; /* Kill UTF-8 and CR-LF mode if we switch to hex display */ if (glopts[x].ofst == (unsigned char *)&fdefault.hex - (unsigned char *)&fdefault && bw->o.hex) { if (joe_maputf(bw->b->o.charmap)) { doencoding(bw, vsncpy(NULL, 0, sc("c")), NULL, NULL); } bw->o.crlf = 0; } break; case 1: joe_snprintf_1((char *)buf, OPT_BUF_SIZE, (const char *)glopts[x].yes, *glopts[x].set.i); xx = malloc(sizeof(int)); *xx = x; m->parent->notify = 0; wabort(m->parent); if (wmkpw(bw->parent, buf, NULL, doopt1, NULL, doabrt1, utypebw, xx, notify, locale_map)) { if (glopts[x].set.i == &Baud) tty_xonoffbaudrst(); return 0; } else return -1; case 2: if (*glopts[x].set.us) joe_snprintf_1((char *)buf, OPT_BUF_SIZE, (const char *)glopts[x].yes, *glopts[x].set.us); else joe_snprintf_1((char *)buf, OPT_BUF_SIZE, (const char *)glopts[x].yes, ""); xx = malloc(sizeof(int)); *xx = x; m->parent->notify = 0; wabort(m->parent); if (wmkpw(bw->parent, buf, NULL, doopt1, NULL, doabrt1, utypebw, xx, notify, locale_map)) return 0; else return -1; case 5: joe_snprintf_1((char *)buf, OPT_BUF_SIZE, (const char *)glopts[x].yes, RELOPT(&bw->o, x)); goto in; case 7: joe_snprintf_1((char *)buf, OPT_BUF_SIZE, (const char *)glopts[x].yes, RELOPT(&bw->o, x) + 1); in: xx = malloc(sizeof(int)); *xx = x; m->parent->notify = 0; wabort(m->parent); if (wmkpw(bw->parent, buf, NULL, doopt1, NULL, doabrt1, utypebw, xx, notify, locale_map)) return 0; else return -1; case 9: joe_snprintf_1((char *)buf, OPT_BUF_SIZE, (const char *)glopts[x].yes, bw->b->o.syntax ? bw->b->o.syntax->name : UC "(unset)"); m->parent->notify = 0; wabort(m->parent); if (wmkpw(bw->parent, buf, NULL, dosyntax, NULL, NULL, syntaxcmplt, NULL, notify, locale_map)) return 0; else return -1; case 13: joe_snprintf_1((char *)buf, OPT_BUF_SIZE, (const char *)glopts[x].yes, bw->b->o.charmap ? joe_mapname(bw->b->o.charmap) : UC "(unset)"); m->parent->notify = 0; wabort(m->parent); if (wmkpw(bw->parent, buf, NULL, doencoding, NULL, NULL, encodingcmplt, NULL, notify, locale_map)) return 0; else return -1; } if (notify) *notify = 1; bw->b->o = bw->o; wfit(bw->parent->t); updall(); return 0; } static int doabrt(MENU *m, int x, unsigned char **s) { optx = x; for (x = 0; s[x]; ++x) free(s[x]); free(s); return -1; } int umode(BW *bw) { size_t size = 0, x, len; unsigned char **s; bw->b->o.readonly = bw->o.readonly = bw->b->rdonly; while (glopts[size].menu) ++size; s = ralloc(size + 1, sizeof(unsigned char *)); len = 0; for (x = 0; x < size; ++x) { s[x] = malloc(OPT_BUF_SIZE); if (glopts[x].menu[0] == ' ' || glopts[x].menu[1] == ' ') strlcpy(s[x], glopts[x].menu, OPT_BUF_SIZE); else { strlcpy(s[x] + 2, glopts[x].menu, OPT_BUF_SIZE - 2); s[x][0] = s[x][2]; s[x][1] = ' '; } if (strlen(s[x]) > len) len = strlen(s[x]); } for (x = 0; x < size; ++x) { size_t n = strlen(s[x]); while (len - n) s[x][n++] = ' '; switch (glopts[x].type) { case 0: joe_snprintf_1(s[x] + n, OPT_BUF_SIZE - n, "%s", *glopts[x].set.i ? "ON" : "OFF"); break; case 1: joe_snprintf_1(s[x] + n, OPT_BUF_SIZE - n, "%d", *glopts[x].set.i); break; case 2: strlcpy(s[x] + n, "...", OPT_BUF_SIZE - n); break; case 4: joe_snprintf_1(s[x] + n, OPT_BUF_SIZE - n, "%s", RELOPT(&bw->o, x) ? "ON" : "OFF"); break; case 5: joe_snprintf_1(s[x] + n, OPT_BUF_SIZE - n, "%d", RELOPT(&bw->o, x)); break; case 7: joe_snprintf_1(s[x] + n, OPT_BUF_SIZE - n, "%d", RELOPT(&bw->o, x) + 1); break; case 9: /* XXX aligns differently so it doesn't get too large */ joe_snprintf_2(s[x] + 12, OPT_BUF_SIZE - 12, "%*s", (int)n - 9, bw->b->o.syntax ? bw->b->o.syntax->name : UC "(unset)"); break; case 13: /* XXX aligns differently so it doesn't get too large */ joe_snprintf_2(s[x] + 12, OPT_BUF_SIZE - 12, "%*s", (int)n - 9, bw->b->o.charmap ? joe_mapname(bw->b->o.charmap) : UC "(unset)"); break; default: s[x][n] = '\0'; } } s[x] = NULL; if (mkmenu(bw->parent, s, doopt, doabrt, NULL, optx, s, NULL)) return 0; else return -1; } /*- * Process rc file * Returns 0 if the rc file was succefully processed * -1 if the rc file couldn't be opened * 1 if there was a syntax error in the file */ int procrc(CAP *cap, const unsigned char *name) { OPTIONS *o = &fdefault; /* Current options */ KMAP *context = NULL; /* Current context */ unsigned char buf[1024];/* Input buffer */ JFILE *fd; /* rc file */ int line = 0; /* Line number */ int err = 0; /* Set to 1 if there was a syntax error */ int x, c, y, sta; unsigned char *opt, *arg; MACRO *m; if (!(fd = jfopen(name, "r"))) /* return if we couldn't open the rc file */ return (-1); fprintf(stderr, "Processing '%s'...", name); fflush(stderr); while (jfgets(buf, sizeof(buf), fd)) { line++; switch (buf[0]) { case ' ': case '\t': case '\n': case '\f': case 0: /* skip comment lines */ break; case '*': /* select file types for file type-dependent options */ o = malloc(sizeof(OPTIONS)); *o = fdefault; x = 0; while (buf[x] && buf[x] != '\n' && buf[x] != ' ' && buf[x] != '\t') ++x; buf[x] = 0; o->next = options; options = o; o->name_regex = (unsigned char *)strdup((char *)buf); break; case '+': /* Set file contents match regex */ x = 0; while (buf[x] && buf[x] != '\n' && buf[x] != '\r') ++x; buf[x] = 0; if (o) o->contents_regex = (unsigned char *)strdup((char *)(buf+1)); break; case '-': /* Set an option */ opt = buf + 1; arg = NULL; x = 0; while (buf[x] && buf[x] != '\n' && buf[x] != ' ' && buf[x] != '\t') ++x; if (buf[x] && buf[x] != '\n') { buf[x] = 0; arg = buf + ++x; while (buf[x] && buf[x] != '\n') ++x; } buf[x] = 0; if (!glopt(opt, arg, o, 2)) { err = 1; fprintf(stderr, "\n%s:%d: Unknown option '%s'", name, line, opt); } break; case '{': /* Ignore help text */ while (jfgets(buf, sizeof(buf), fd) && buf[0] != /*{*/'}') /* do nothing */; if (buf[0] != '}') { err = 1; fprintf(stderr, "\n%s:%d: End of rc file occurred before end of help text", name, line); break; } break; case ':': /* Select context */ x = 1; while (!joe_isspace_eof(locale_map,buf[x])) ++x; c = buf[x]; buf[x] = 0; if (x != 1) if (!strcmp(buf + 1, "def")) { for (buf[x] = c; joe_isblank(buf[x]); ++x) ; for (y = x; !joe_isspace_eof(locale_map,buf[y]); ++y) ; c = buf[y]; buf[y] = 0; if (y == x) { err = 1; fprintf(stderr, "\n%s:%d: command name missing from :def", name, line); } else if (joe_isblank(c) && (m = mparse(NULL, buf + y + 1, &sta))) addcmd(buf + x, m); else { err = 1; fprintf(stderr, "\n%s:%d: macro missing from :def", name, line); } } else if (!strcmp(buf + 1, "inherit")) if (context) { for (buf[x] = c; joe_isblank(buf[x]); ++x) ; for (c = x; !joe_isspace_eof(locale_map,buf[c]); ++c) ; buf[c] = 0; if (c != x) kcpy(context, kmap_getcontext(buf + x, 1)); else { err = 1; fprintf(stderr, "\n%s:%d: context name missing from :inherit", name, line); } } else { err = 1; fprintf(stderr, "\n%s:%d: No context selected for :inherit", name, line); } else if (!strcmp(buf + 1, "include")) { for (buf[x] = c; joe_isblank(buf[x]); ++x) ; for (c = x; !joe_isspace_eof(locale_map,buf[c]); ++c) ; buf[c] = 0; if (c != x) { switch (procrc(cap, buf + x)) { case 1: err = 1; break; case -1: fprintf(stderr, "\n%s:%d: Couldn't open %s", name, line, buf + x); err = 1; break; } context = 0; o = &fdefault; } else { err = 1; fprintf(stderr, "\n%s:%d: :include missing file name", name, line); } } else if (!strcmp(buf + 1, "delete")) if (context) { for (buf[x] = c; joe_isblank(buf[x]); ++x) ; for (y = x; buf[y] != 0 && buf[y] != '\t' && buf[y] != '\n' && (buf[y] != ' ' || buf[y + 1] != ' '); ++y) ; buf[y] = 0; kdel(context, buf + x); } else { err = 1; fprintf(stderr, "\n%s:%d: No context selected for :delete", name, line); } else context = kmap_getcontext(buf + 1, 1); else { err = 1; fprintf(stderr, "\n%s:%d: Invalid context name", name, line); } break; default: /* Get key-sequence to macro binding */ if (!context) { err = 1; fprintf(stderr, "\n%s:%d: No context selected for macro to key-sequence binding", name, line); break; } m = NULL; macroloop: m = mparse(m, buf, &x); if (x == -1) { err = 1; fprintf(stderr, "\n%s:%d: Unknown command in macro", name, line); break; } else if (x == -2) { jfgets(buf, sizeof(buf), fd); goto macroloop; } if (!m) break; /* Skip to end of key sequence */ for (y = x; buf[y] != 0 && buf[y] != '\t' && buf[y] != '\n' && (buf[y] != ' ' || buf[y + 1] != ' '); ++y) ; buf[y] = 0; /* Add binding to context */ if (kadd(cap, context, buf + x, m) == -1) { fprintf(stderr, "\n%s:%d: Bad key sequence '%s'", name, line, buf + x); err = 1; } break; } } /* close rc file */ jfclose(fd); /* Print proper ending string */ fprintf(stderr, "%cdone\n", err ? '\n' : ' '); /* 0 for success, 1 for syntax error */ return (err); } jupp/rc.h010064400000000000000000000017101363732051100075400ustar00/* * *rc file parser * Copyright * (C) 1992 Joseph H. Allen; * * This file is part of JOE (Joe's Own Editor) */ #ifndef JUPP_RC_H #define JUPP_RC_H #ifdef EXTERN __IDSTRING(rcsid_rc_h, "$MirOS: contrib/code/jupp/rc.h,v 1.14 2020/03/27 06:46:06 tg Exp $"); #endif extern OPTIONS pdefault; extern OPTIONS fdefault; void setopt(B *b, const unsigned char *name); /* KMAP *kmap_getcontext(char *name); * Find and return the KMAP for a given context name. If none is found, an * empty kmap is created, bound to the context name, and returned. */ KMAP *kmap_getcontext(const unsigned char *name, int docreate); /* int procrc(CAP *cap, char *name); Process an rc file Returns 0 for success -1 for file not found 1 for syntax error (errors written to stderr) */ int procrc(CAP *cap, const unsigned char *name); int glopt(const unsigned char *s, unsigned char *arg, OPTIONS *options, int set); int umode(BW *bw); void lazy_opts(OPTIONS *o); #endif jupp/regex.c010064400000000000000000000174161363731415200102570ustar00/* * Regular expression subroutines * Copyright * (C) 1992 Joseph H. Allen * * This file is part of JOE (Joe's Own Editor) */ #include "config.h" #include "types.h" __RCSID("$MirOS: contrib/code/jupp/regex.c,v 1.11 2020/03/27 06:08:15 tg Exp $"); #include "b.h" #include "charmap.h" #include "regex.h" #include "utils.h" #include "vs.h" int escape(int isutf8, unsigned char **a, int *b) { int c; unsigned char *s = *a; int l = *b, z; if (*s == '\\' && l >= 2) { ++s; --l; switch (*s) { case 'n': c = 10; ++s; --l; break; case 't': c = 9; ++s; --l; break; case 'a': c = 7; ++s; --l; break; case 'b': c = 8; ++s; --l; break; case 'f': c = 12; ++s; --l; break; case 'e': c = 27; ++s; --l; break; case 'r': c = 13; ++s; --l; break; case '8': c = 8; ++s; --l; break; case '9': c = 9; ++s; --l; break; case '0': case '1': case '2': case '3': case '4': case '5': case '6': case '7': z = ustoc_oct(s, &c, l); s += z; l -= z; break; case 'x': case 'X': z = ustoc_hex(s, &c, l); s += z; l -= z; break; default: if (isutf8) c = utf8_decode_fwrd(&s, &l); else { c = *s++; --l; } break; } } else if (isutf8) { c = utf8_decode_fwrd(&s,&l); } else { c = *s++; --l; } *a = s; *b = l; return c; } static int brack(int isutf8,unsigned char **a, int *la, int c) { int inverse = 0; int flag = 0; unsigned char *s = *a; int l = *la; if (!l) return 0; if (*s == '^' || *s == '*') { inverse = 1; ++s; --l; } if (l && *s == ']') { ++s; --l; if (c == ']') flag = 1; } while (l) if (*s == ']') { ++s; --l; break; } else { int cl, cr; cl = escape(isutf8, &s, &l); if (l >= 2 && s[0] == '-' && s[1] != ']') { --l; ++s; cr = escape(isutf8, &s, &l); if (c >= cl && c <= cr) flag = 1; } else if (c == cl) flag = 1; } *a = s; *la = l; if (inverse) return !flag; else return flag; } static void savec(int isutf8,unsigned char **pieces, int n, int c) { unsigned char buf[16]; int len; unsigned char *s = NULL; if (isutf8) len = utf8_encode(buf,c); else { buf[0] = c; len = 1; } if (pieces[n]) vsrm(pieces[n]); s = vsncpy(s, 0, buf, len); pieces[n] = s; } #define MAX_REGEX_SAVED 16384 /* Largest regex string we will save */ static void saves(unsigned char **pieces, int n, P *p, long int szz) { if (szz > MAX_REGEX_SAVED) pieces[n] = vstrunc(pieces[n], 0); else { pieces[n] = vstrunc(pieces[n], (int) szz); brmem(p, pieces[n], (int) szz); } } /* Returns -1 (NO_MORE_DATA) for end of file. * Returns -2 if we skipped a special sequence and didn't take the character * after it (this happens for "strings"). * Otherwise returns character after sequence (character will be >=0). */ static int skip_special(P *p) { int to, s; switch (s = pgetc(p)) { case '"': do { if ((s = pgetc(p)) == '\\') { pgetc(p); s = pgetc(p); } } while (s != NO_MORE_DATA && s != '"'); if (s == '"') return -2; break; case '\'': if ((s = pgetc(p)) == '\\') { pgetc(p); s = pgetc(p); } if (s == '\'') return -2; if ((s = pgetc(p)) == '\'') return -2; if ((s = pgetc(p)) == '\'') return -2; break; case '[': to = ']'; goto skip; case '(': to = ')'; goto skip; case '{': to = '}'; skip: do { s = skip_special(p); } while (s != to && s != NO_MORE_DATA); if (s == to) return -2; break; case '/': s = pgetc(p); if (s == '*') do { s = pgetc(p); while (s == '*') if ((s = pgetc(p)) == '/') return -2; } while (s != NO_MORE_DATA); else if (s != NO_MORE_DATA) s = prgetc(p); else s = '/'; break; } return s; } int pmatch(unsigned char **pieces, unsigned char *regex, int len, P *p, int n, int icase) { int c, d; P *q = pdup(p); P *o = NULL; unsigned char isutf8 = joe_maputf(p->b->o.charmap); union charmap *map = p->b->o.charmap; struct utf8_sm sm; utf8_init(&sm); while (len) { if (isutf8) { do { c = utf8_decode(&sm,*regex++); --len; } while (len && c<0); if (c<0) return 0; } else { c = *regex++; --len; } switch (c) { case '\\': if (!len--) goto fail; switch (c = *regex++) { case '?': d = pgetc(p); if (d == NO_MORE_DATA) goto fail; savec(isutf8, pieces, n++, d); break; case 'n': case 'r': case 'a': case 'f': case 'b': case 't': case 'e': case 'x': case 'X': case '0': case '1': case '2': case '3': case '4': case '5': case '6': case '7': case '8': case '9': regex -= 2; len += 2; if (pgetc(p) != escape(isutf8, ®ex, &len)) goto fail; break; case '*': /* Find shortest matching sequence */ o = pdup(p); do { long pb = p->byte; if (pmatch(pieces, regex, len, p, n + 1, icase)) { saves(pieces, n, o, pb - o->byte); goto succeed; } c = pgetc(p); } while (c != NO_MORE_DATA && c != '\n'); goto fail; case 'c': o = pdup(p); do { long pb = p->byte; if (pmatch(pieces, regex, len, p, n + 1, icase)) { saves(pieces, n, o, pb - o->byte); goto succeed; } } while (skip_special(p) != NO_MORE_DATA); goto fail; case '[': d = pgetc(p); if (d == NO_MORE_DATA) goto fail; if (!brack(isutf8, ®ex, &len, d)) goto fail; savec(isutf8, pieces, n++, d); break; case '+': { unsigned char *oregex = regex; /* Point to character to skip */ int olen = len; unsigned char *tregex; int tlen; int match; P *r = NULL; d = 0; o = pdup(p); /* Advance over character to skip. Save character in d unless we're skipping over a \[..] */ if (len >= 2 && regex[0] == '\\') { if (regex[1] == '[') { regex += 2; len -= 2; brack(isutf8, ®ex, &len, 0); } else { d = escape(isutf8, ®ex, &len); if (icase) d = joe_tolower(map,d); } } else if (isutf8) { if ((d = utf8_decode_fwrd(®ex, &len)) < 0) goto done; else if (icase) d = joe_tolower(map,d); } else { if (len >= 1) { --len; d = *regex++; if (icase) d = joe_tolower(map,d); } else goto done; } /* Now oregex/olen point to character to skip over and regex/len point to sequence which follows */ do { P *z = pdup(p); if (pmatch(pieces, regex, len, p, n + 1, icase)) { saves(pieces, n, o, z->byte - o->byte); if (r) prm(r); r = pdup(p); } pset(p, z); prm(z); c = pgetc(p); tregex = oregex; tlen = olen; if (*oregex == '\\') { if (oregex[1] == '[') { tregex += 2; tlen -= 2; match = brack(isutf8, &tregex, &tlen, c); } else match = (d == c); } else { if(icase) match = (joe_tolower(map,c) == d); else match = (c == d); } } while (c != NO_MORE_DATA && match); done: if (r) { pset(p, r); prm(r); } if (r) goto succeed; else goto fail; } case '^': if (!pisbol(p)) goto fail; break; case '$': if (!piseol(p)) goto fail; break; case '<': if (!pisbow(p)) goto fail; break; case '>': if (!piseow(p)) goto fail; break; case '\\': d = pgetc(p); if (d != c) goto fail; break; default: goto fail; } break; default: d = pgetc(p); if (icase) { if (joe_tolower(map,d) != joe_tolower(map,c)) goto fail; } else { if (d != c) goto fail; } } } succeed: if (o) prm(o); prm(q); return 1; fail: if (o) prm(o); pset(p, q); prm(q); return 0; } jupp/regex.h010064400000000000000000000006731363731763500102720ustar00/* * Regular expression subroutines * Copyright * (C) 1992 Joseph H. Allen * * This file is part of JOE (Joe's Own Editor) */ #ifndef JUPP_REGEX_H #define JUPP_REGEX_H #ifdef EXTERN_RC_C __IDSTRING(rcsid_regex_h, "$MirOS: contrib/code/jupp/regex.h,v 1.7 2020/03/27 06:38:58 tg Exp $"); #endif int escape(int, unsigned char **, int *); int pmatch(unsigned char **pieces, unsigned char *regex, int len, P *p, int n, int icase); #endif jupp/rjoerc.in010064400000000000000000000664221361505650600106200ustar00 $MirOS: contrib/code/jupp/rjoerc.in,v 1.37 2020/01/31 17:00:27 tg Exp $ Initialisation file for JOE restricted access Joe This file must be written in the 8-bit encoding, not UTF-8. JOE looks for this file in: 1 - $HOME/.joerc 2 - @jrcbefore@joerc@jrcafter@ This file can include other files by placing the following include command in the first column (comment lines start with space or tab): :include filename FIRST SECTION: Default global options (these options can also be specified on the command line. Also, the NOXON, LINES, COLUMNS, DOPADDING and BAUD options can be specified in environment variables): Put each option you want set in the first column: -option Sets the option --option Clears the option -mid Cursor is recentred when scrolling is necessary -marking Text between ^KB and cursor is highlighted; use with: -lightoff Turn off highlighting after block copy or move -autoswap Swap markb with markk when necessary -asis Characters 128 - 255 shown as-is -hex Hex editing mode -nobackups If you don't want backup files to be created -backpath path Where to store backup files (do not quote, no comment after) -force Force final newline when files are saved -exask ^KX always confirms file name -beep Beep on errors and when cursor goes past extremes -nosta Disable top-most status line -keepup %k and %c status line escape sequences updated frequently -pg nnn No. lines to keep for PgUp/PgDn -csmode ^KF after a pervious search does a ^L instead -nonotice Disable copyright notice -noxon Attempt to turn off ^S/^Q processing -orphan Put extra files given on command line in orphaned buffers instead of in windows -dopadding Output pad characters (for when there is no tty handshaking) -lines nnn Set no. screen lines -baud nnn Set baud rate for terminal optimisations -columns nnn Set no. screen columns -help Start with help on -skiptop nnn Don't use top nnn lines of the screen -notite Don't send terminal initialisation and termination strings: prevents restoration of screen on exit -pastetite Enter bracketed paste mode automatically for TERM=xterm-xfree86 -usetabs Use tabs to help optimise screen update -assume_color Assume terminal has ANSI colour support even if its termcap or terminfo entry says that it doesn't. This only applies if the terminal otherwise looks like an ANSI terminal (supports bold and capability starts with ESC [). -guess_crlf Automatically detect MS-DOS files and set -crlf appropriately -guess_indent Guess indent character (tab or space) -menu_explorer Stay in menu system when a directory is selected (otherwise directory is added to path and menu is closed) -icase Search is case-insensitive by default -wrap Search wraps Status line definition strings. -lmsg defines the left-justified string, and -rmsg defines the right-justified string. The first character of -rmsg is the background fill character. -hmsg (3.1jupp15) defines the help hint (only about a dozen chars) displayed next to the copyright notice in the initial status line (inverted by default, unless starting with exactly \i). The following escape sequences can be used in these strings: %t 12-hour time %u 24-hour time %T O for overtype mode, I for insert mode %W W if wordwrap is enabled %I A if autoindent is enabled %X rectangle mode indicator %n file name %m '(Modified)' if file has been changed %* '*' if file has been changed %R read-only indicator %r row (line) number %c column number %o byte offset into file (decimal) %O byte offset into file in hex %a ASCII value of character under cursor (decimal) %A ASCII value of character under cursor in hex %p percent of file cursor is at %l number of lines in file %k entered prefix keys %S '*SHELL*' if there is a shell running in window %M macro recording message %y syntax %x context (first non-indented line going backwards) These formatting escape sequences may also be given: \i Inverse \u Underline \b Bold \d Dim \f Blink -lmsg \i%k%T%W%I%X %n %m%y%R %M %x -rmsg %S Row %r Col %c %t Ctrl-K H for help -hmsg \i\f\bHelp: ^KH\b\f SECOND SECTION: filename-dependent local option settings: Each line with '*' in the first column indicates the modes which should be set for files whose name matches the regular expression. If more than one regular expression matches the file name, then the last matching one is chosen. A file contents regular expression may also be specified on a separate line with '+regex'. If this regular expresssion is given, then both the file name regex and the file contents regex must match for the options to apply. Here is a list of modes which can be set: -keymap name Keymap to use if not 'main' -square Rectangular block mode -overwrite Overtype mode -picture Picture mode (cursor right can go past end of line) -linums Show line numbers in front of each line -rdonly File is read-only -crlf File uses CR-LF at end of lines -encoding utf8 File is UTF-8 encoded -syntax name Specify syntax (syntax file called 'name.jsf' will be loaded) -highlight Enable syntax highlighting -french One space after '.', '?' and '!' for wordwrap and paragraph reformat instead of two. JOE does not change the spacing you give, but sometimes it must put spacing in itself. This selects how much is inserted in those cases. -purify Fixup indentation if necessary for rindent, lindent and backs (for example if indentation uses a mix of tabs and spaces, and indentc is space, indentation will be converted to all spaces) -lmargin nnn Left margin -rmargin nnn Right margin -tab nnn Tab width -indentc nnn Indentation character (32 = space, 9 = tab) -istep nnn Amount of 'indentc's per indentation level -spaces Tab key inserts spaces instead of tabs -wordwrap Wordwrap -autoindent Auto indent -smartbacks Backspace key deletes 'istep' number of 'indentc's if cursor is at first non-space character -smarthome Home key first moves cursor to beginning of line, then if hit again, to first non-blank character -indentfirst Smart home goes to first non-blank character first, instead of to the beginning of the line first -lmsg Status line definition strings; -rmsg see previous section for more info -mnew macro Macro to execute when new files are loaded -mold macro Macro to execute when existing files are loaded -msnew macro Macro to execute when new files are saved -msold macro Macro to execute when existing files are saved Macros for the above options are in the same format as in the key binding section below but without the key name strings. Default local options: -highlight -french -indentc 9 -istep 1 -purify -smartbacks -tab 8 --wordwrap #HOOK#1 global/default flags === Generic files No '.' in filename? * Assume it's a text file and, except in jupp, we want wordwrap on. -wordwrap Filename with '.' is probably not a text file. *.* Binary file *.bin --crlf --guess_crlf -encoding ascii -hex === Patterns with multiple wildcards Order is latest match wins, so... */patch-* -highlight -syntax diff * +Only in[ ] -highlight -syntax diff * +Nur in[ ] -highlight -syntax diff * +\[1-9]\+\[0-9]\[cda] -highlight -syntax diff *.sh* -syntax sh *.ksh* -syntax sh *.mksh* -syntax sh *.bash* -syntax sh *tmp/mutt-* -wordwrap -syntax mail *tmp/pico.* -wordwrap -syntax mail */mail/* -syntax mail */patches/* -highlight -syntax diff === Assembly *.asm -syntax asm *.S -syntax asm *.s -syntax asm === C, C++, Objective-C *.C -syntax c *.c -syntax c *.cc -syntax c *.cpp -syntax c *.cxx -syntax c *.c++ -syntax c *.h -syntax c *.hh -syntax c *.hpp -syntax c *.h++ -syntax c *.m -syntax c *.nxc -syntax c === C Shell *.csh -syntax csh *.login -syntax csh *.logout -syntax csh *.tcsh -syntax csh *.tcshrc -syntax csh * +#!\+\[ ]\+\[/a-z0-9._-]/\+tcsh\> -syntax csh * +#!\+\[ ]\+\[/a-z0-9._-]/env\[ ]\+\[ ]\+tcsh\> -syntax csh === Diff *.diff -highlight -syntax diff *.patch -highlight -syntax diff *.rej -highlight -syntax diff *.debdiff -highlight -syntax diff * +---\[ ] -highlight -syntax diff * +***\[ ] -highlight -syntax diff * +Index: \*\n====================================================== -highlight -syntax diff * +Index: \*\ndiff\*\n--- \*\n+++\[ ] -highlight -syntax diff * +\[=?]\*\n--- \*\n+++\[ ] -highlight -syntax diff * +diff\*\n--- \*\n+++\[ ] -highlight -syntax diff * +diff --git\*\nindex\*\n--- \*\n+++\[ ] -highlight -syntax diff === eMail *.eml -syntax mail Not quite eMail but still RFC822 *.mht -syntax mail === FORTRAN *.f -syntax fortran *.for -syntax fortran *.FOR -syntax fortran *.f77 -syntax fortran *.F77 -syntax fortran *.f90 -syntax fortran *.F90 -syntax fortran === GNU autoconf *.ac -syntax conf *.am -syntax conf === HTML *.htm -encoding utf8 -syntax html *.html -encoding utf8 -syntax html * +<\[Hh]\[Tt]\[Mm]\[Ll]\> -encoding utf8 -syntax html * + -encoding utf8 -syntax html === Java *.java -encoding utf8 -syntax java === JOE Syntax File *.jsf -syntax conf === LISP *.lisp -syntax lisp *.lsp -syntax lisp *.el -syntax lisp === Make *akefile -syntax conf *AKEFILE -syntax conf === Mason *.mas -syntax mason === Pascal *.p -syntax pascal *.pas -syntax pascal === Perl *.pl -syntax perl *.pm -syntax perl * +#!\+\[ ]\+\[/a-z0-9._-]/perl -syntax perl * +#!\+\[ ]\+\[/a-z0-9._-]/env\[ ]\+\[ ]perl -syntax perl === PHP *.php -syntax php === Python *.py -encoding utf8 -syntax python -tab 4 -indentc 32 -istep 4 -spaces * +#!\+\[ ]\+\[/a-z0-9._-]/python -encoding utf8 -syntax python -tab 4 -indentc 32 -istep 4 -spaces * +#!\+\[ ]\+\[/a-z0-9._-]/env\[ ]\+\[ ]python -encoding utf8 -syntax python -tab 4 -indentc 32 -istep 4 -spaces === Bourne, Korn, POSIX Shell *profile -syntax sh * +:\[ \n] -syntax sh * +#!\+\[ ]\+\[/a-z0-9._-]/\+\[bda]sh\> -syntax sh * +#!\+\[ ]\+\[/a-z0-9._-]/env\[ ]\+\[ ]\+\[bda]sh\> -syntax sh * +#!\+\[ ]\+\[/a-z0-9._-]/\+\[a-z]ksh\+\[0-9._-]\> -syntax sh * +#!\+\[ ]\+\[/a-z0-9._-]/env\[ ]\+\[ ]\+\[a-z]ksh\+\[0-9._-]\> -syntax sh === TCL *.tcl -syntax tcl === TeX *.cls -syntax tex *.def -syntax tex *.dtx -syntax tex *.lco -syntax tex *.sty -syntax tex *.tex -syntax tex === Verilog *.v -syntax verilog -istep 2 *.vh -syntax verilog -istep 2 === VHDL *.vhd -syntax vhdl -istep 2 === XML *.xml -encoding utf8 -syntax xml *.xsl -encoding utf8 -syntax xml * +]?>\+\[ \n] -encoding utf8 -syntax html === Text (except in jupp) *.asc -wordwrap *.doc -wordwrap *.txt -wordwrap #HOOK#2 filename matching THIRD SECTION: Named help screens: Use \| to insert a spring: all springs in a given line are set to the same width such that the entire line exactly fits in the width of the screen (if it's not an exact multiple so that there are N spaces remaining, the rightmost N springs each get one extra space). Hint: if you want vertical alignment, each line should have the same number of springs. {Basic \i Help Screen \|turn off with ^KH more help with ESC . (^[.) \i \i \i\|\uCURSOR\u \|\uGO TO\u \|\uBLOCK\u \|\uDELETE\u \|\uMISC\u \|\uEXIT\u \|\i \i \i \i\|^B left ^F right \|^U prev. screen \|^KB begin \|^D char. \|^KJ reformat \|^KX save \|\i \i \i \i\|^P up ^N down \|^V next screen \|^KK end \|^Y line \|^T options \|^C abort \|\i \i \i \i\|^Z previous word \|^A beg. of line \|^KM move \|^W >word \|^R refresh \| \|\i \i \i \i\|^X next word \|^E end of line \|^KC copy \|^O word< \|^@ insert \|\uFILE\u \|\i \i \i \i\|\uSEARCH\u \|^KU top of file \|^KY delete \|^J >line \|\uSPELL\u \|^KD save \|\i \i \i \i\|^KF find text \|^KV end of file \| \|^_ undo \|^[N word \| \|\i \i \i \i\|^L find next \|^KL to line No. \| \|^^ redo \|^[L file \| \|\i \i } {Windows \i Help Screen \|turn off with ^KH prev. screen ^[, next screen ^[. \i \i \i\|^KO Split the window in half \| \|\i \i \i \i\|^KG Make current window bigger \|^KT Make current window smaller \|\i \i \i \i\|^KN Go to the window below \|^KP Go to the window above \|\i \i \i \i\|^C Eliminate the current window \|^KI Show all windows / Show one window\|\i \i } {Advanced \i Help Screen \|turn off with ^KH prev. screen ^[, next screen ^[. \i \i \i\|\uMACROS\u \|\uMISC\u \|\uSCROLL\u \| \|\uGOTO\u \|\uI-SEARCH\u \|\i \i \i \i\|^K[ 0-9 Record \|^K SPACE status \|^[W Up \| \|^[B To ^KB \|^[R Backwards\|\i \i \i \i\|^K] Stop \|^K\\ Repeat \|^[Z Down \| \|^[K To ^KK \|^[S Forwards \|\i \i \i \i\|^K 0-9 Play \|^[M Math \|^K< Left \|\uQUOTE\u \|\uDELETE\u \|\uBOOKMARKS\u \|\i \i \i \i\|^K? Query \|^KA Center line \|^K> Right \|` Ctrl- \|^[Y yank \|^[ 0-9 Goto \|\i \i \i \i\|^[D Dump \|^[H Message \| \|^\\ Meta- \|^[O line< \|^[^[ Set \|\i \i } {Programs \i Help Screen \|turn off with ^KH prev. screen ^[, next screen ^[. \i \i \i\|\uGOTO\u \|\uINDENT\u \|\i \i \i \i\|^G Matching ( [ { \|^K, less \|\i \i \i \i\|^K- Previous place \|^K. more \|\i \i \i \i\|^K= Next place \| \|\i \i } {Search \i Help Screen \|turn off with ^KH prev. screen ^[, next screen ^[. \i \i \iSpecial search sequences: \|\i \i \i \i \\^ \\$ matches beg./end of line \\? match any single char \|\i \i \i \i \\< \\> matches beg./end of word \\* match 0 or more chars \|\i \i \i \i \\c matches balanced C expression \\\\ matches a \\ \|\i \i \i \i \\[..] matches one of a set \\n matches a newline \|\i \i \i \i \\+ matches 0 or more of the character which follows the \\+ \|\i \i \i \iSpecial replace sequences: \|\i \i \i \i \\& replaced with text which matched search string \|\i \i \i \i \\0 - 9 replaced with text which matched Nth \\*, \\?, \\c, \\+, or \\[..] \|\i \i \i \i \\\\ replaced with \\ \\n replaced with newline \|\i \i } {Joe \i Help Screen \|turn off with ^KH prev. screen ^[, \i \i \i For bug reports and other information, refer to: \uhttp://mirbsd.de/jupp\u \|\i \i } #HOOK#3 additional help screens {CharTable \i Help Screen turn off with ^J prev. screen ^[, \uCharacter Map\u \i \i \i Dec Hex \u 0123 4567 89AB CDEF 0123 4567 89AB CDEF \u Hex Dec \i \i \i \i | | \i \i \i \i 0 00 | \u@ABC\u \uDEFG\u \uHIJK\u \uLMNO\u €‚ „…†‡ ‰Š‹ ŚŤŽŹ | 80 128 \i \i \i \i 16 10 | \uPQRS\u \uTUVW\u \uXYZ[\u \u\\]^_\u ‘’“ ”•–— ™š› śťžź | 90 144 \i \i \i \i 32 20 | !"# $%&' ()*+ ,-./  ˇ˘Ł ¤Ą¦§ ¨©Ş« ¬­®Ż | A0 160 \i \i \i \i 48 30 | 0123 4567 89:; <=>? °±˛ł ´µ¶· ¸ąş» Ľ˝ľż | B0 176 \i \i \i \i 64 40 | @ABC DEFG HIJK LMNO ŔÁÂĂ ÄĹĆÇ ČÉĘË ĚÍÎĎ | C0 192 \i \i \i \i 80 50 | PQRS TUVW XYZ[ \\]^_ ĐŃŇÓ ÔŐÖ× ŘŮÚŰ ÜÝŢß | D0 208 \i \i \i \i 96 60 | `abc defg hijk lmno ŕáâă äĺćç čéęë ěíîď | E0 224 \i \i \i \i 112 70 | pqrs tuvw xyz{ |}~ đńňó ôőö÷ řůúű üýţ˙ | F0 240 \i \i } {Paste \i \i \i \i \u\bPaste Mode\b\u turn off with \b^D\b or \b^[[201~\b \i \i } FOURTH SECTION: Key bindings: Section names you must provide: :main editing window :prompt prompt lines :query single-character query lines :querya singe-character query for quote :querysr search-and-replace single-character query Other sections may be given as well for organisation purposes or for use with the '-keymap' option. Use: :inherit name To copy the named section into the current one :delete key To delete a key sequence from the current section Keys: Use ^@ through ^_ and ^? for C0 control characters and DEL Use SP for space Use a TO b to generate a range of characters You can also use termcap string capability names. For example: .ku Up .kd Down .kl Left .kr Right .kh Home .kH End .kI Insert .kD Delete .kP PgUp .kN PgDn .k1 - .k9 F1 - F9 .k0 F0 or F10 .k; F10 Macros: Simple macros can be made by comma seperating two or more command names. For example: eof,bol ^T Z Goto beginning of last line Also quoted matter is typed in literally (backslashes escape): bol,">",dnarw .k1 Quote news article line Macros may cross lines if they end with a comma. Commands or named macros may be created with :def. For example, you can use... :def foo eof,bol ... to define a command foo which will go to the beginning of the last line. :windows Bindings common to all windows #HOOK#4 common keybindings type ^@ TO ˙ abort ^C Abort window abort ^K Q abort ^K ^Q abort ^K q arg ^K \ Repeat next command explode ^K I Show all windows or show only one window explode ^K ^I explode ^K i help .k1 help ^K H Help menu help ^K ^H help ^K h help ^[ [ 1 1 ~ hnext ^[ . Next help window hprev ^[ , Previous help window math ^[ m Calculator math ^[ M Calculator math ^[ ^M Calculator msg ^[ h Display a message msg ^[ H Display a message msg ^[ ^H Display a message nextw ^K N Goto next window nextw ^K ^N nextw ^K n pgdn .kN Screen down pgdn ^V pgdn ^[ [ 6 ~ pgdn ^[ [ G SCO pgup .kP Screen up pgup ^U pgup ^[ [ 5 ~ pgup ^[ [ I SCO play ^K 0 TO 9 Execute macro prevw ^K P Goto previous window prevw ^K ^P prevw ^K p query ^K ? Macro query insert record ^K [ Record a macro retype ^R Refresh screen rtn ^M Return shell ^K Z Shell escape shell ^K ^Z shell ^K z stop ^K ] Stop recording :Paste type ^@ TO ˙ rtn ^M msg,"Entered bracketed paste mode",rtn ^[ [ 2 0 0 ~ helpcard,rtn,keymap,"main",rtn,msg,rtn ^[ [ 2 0 1 ~ helpcard,rtn,keymap,"main",rtn ^D :Pastecua type ^@ TO ˙ rtn ^M msg,"Entered bracketed paste mode",rtn ^[ [ 2 0 0 ~ helpcard,rtn,keymap,"cua",rtn,msg,rtn ^[ [ 2 0 1 ~ helpcard,rtn,keymap,"cua",rtn ^D :Pasteprompt type ^@ TO ˙ nop ^L keymap,"prompt",rtn,msg,rtn,rtn ^M msg,"Entered bracketed paste mode",rtn ^[ [ 2 0 0 ~ keymap,"prompt",rtn,msg,rtn ^[ [ 2 0 1 ~ keymap,"prompt",rtn ^D :main Text editing window :inherit windows compile :def compile switch,"*Build-Log*",rtn,markb,eof," ",markk,blkdel,filt,query,parserr :def compile querysave,query,scratch,"* Build Log *",rtn,bof,markb,eof," ",markk,blkdel,build spell check :def aspellfile filt,"SPLTMP=ispell.tmp;cat >$SPLTMP;aspell -x -c $SPLTMP /dev/tty;cat $SPLTMP;/bin/rm $SPLTMP",rtn,retype :def aspellword psh,nextword,markk,prevword,markb,filt,"SPLTMP=ispell.tmp;cat >$SPLTMP;aspell -x -c $SPLTMP /dev/tty;tr -d <$SPLTMP '\\012';/bin/rm $SPLTMP",rtn,retype,nextword :def ispellfile filt,"cat >ispell.tmp;ispell ispell.tmp /dev/tty;cat ispell.tmp;/bin/rm ispell.tmp",rtn,retype :def ispellword psh,nextword,markk,prevword,markb,filt,"cat >ispell.tmp;ispell ispell.tmp /dev/tty;tr -d Pop ^KB ^KK psh ^[ < Push ^KB ^KK swap ^[ x Swap ^KB and cursor tomarkbk ^[ g Switch between beginning and end of marked tos ^[ e Top of screen tw0 ^[ 0 Kill current window (orphans buffer) tw1 ^[ 1 Kill all other windows (orphans buffers) uarg ^[ u Universal argument yank ^[ ^Y Undelete previous text yapp ^[ w Append next delete to previous yank Standard Joe user interface quote8 ^\ Enter Meta chars quote ` Enter Ctrl chars backs ^? Backspace backs ^H backw ^O Backspace word bknd ^K ' Shell window blkcpy ^K C Copy marked block blkcpy ^K ^C blkcpy ^K c blkdel ^K Y Delete marked block blkdel ^K ^Y blkdel ^K y blkmove ^K M Move marked block blkmove ^K ^M blkmove ^K m blksave ^K W Save marked block blksave ^K ^W blksave ^K w bof ^K U Goto beginning of file bof ^K ^U bof ^K u bof ^[ [ 1 ; 5 H home ^A Goto beginning of line home .kh home ^[ [ 1 ~ home ^[ [ 7 ~ home ^[ [ H center ^K A Center line center ^K ^A center ^K a crawll ^K < Pan left crawlr ^K > Pan right delch .kD Delete character delch ^D delch ^[ [ 3 ~ deleol ^J Delete to end of line dellin ^Y Delete entire line delw ^W Delete word to right dnarw .kd Go down dnarw ^N dnarw ^[ O B dnarw ^[ [ B edit ^K E Edit a file edit ^K ^E edit ^K e eof ^K V Go to end of file eof ^K ^V eof ^K v eof ^[ [ 1 ; 5 F eol .@7 eol .kH Go to end of line eol ^E eol ^[ [ 4 ~ eol ^[ [ 8 ~ eol ^[ [ F exsave ^K X Save and exit exsave ^K ^X exsave ^K x ffirst ^K F Find first ffirst ^K ^F ffirst ^K f filt ^K / Filter block finish ^K ^M Complete text under cursor fnext ^L Find next fnext .k3 fnext ^[ [ 1 3 ~ fmtblk ^K J Format paragraphs in block fmtblk ^K ^J fmtblk ^K j gomark ^[ 0 TO 9 Goto bookmark groww ^K G Grow window groww ^K ^G groww ^K g insc .kI Insert a space insc ^[ [ 2 ~ insc ^[ [ L SCO insf ^K R Insert a file insf ^K ^R insf ^K r lindent ^K , Indent to left line ^K L Goto line number line ^K ^L line ^K l ltarw .kl Go left ltarw ^B ltarw ^[ O D ltarw ^[ [ D macros ^[ d Dump keyboard macros macros ^[ ^D markb ^K B Set beginning of marked block markb ^K ^B markb ^K b markk ^K K Set end of marked block markk ^K ^K markk ^K k mode ^T Options menu nextpos ^K = Goto next position in position history nextword ^X Goto next word nextword ^[ [ 1 ; 5 C open ^] Split line prevpos ^K - Previous position in history prevword ^Z Previous word prevword ^[ [ 1 ; 5 D redo ^^ Redo changes rindent ^K . Indent to right rtarw .kr Go right rtarw ^F rtarw ^[ O C rtarw ^[ [ C run ^K ! Run a shell command ask ^K D Save file, no prompt ask ^K S ask ^K ^D ask ^K ^S ask ^K d ask ^K s setmark ^[ ^[ Set bookmark shrinkw ^K T Shrink window shrinkw ^K ^T shrinkw ^K t splitw ^K O Split window splitw ^K ^O splitw ^K o stat ^K SP Show status tag ^K ; Tags file search tomatch ^G Goto matching parenthasis undo ^_ Undo changes uparw .ku Go up uparw ^P uparw ^[ O A uparw ^[ [ A :prompt Prompt windows :inherit main complete ^I nop ^L keymap,"Pasteprompt",rtn,msg,"Entered bracketed paste mode",rtn ^[ P keymap,"Pasteprompt",rtn,msg,"Entered bracketed paste mode",rtn ^[ p keymap,"Pasteprompt",rtn,msg,"Entered bracketed paste mode",rtn ^[ [ 2 0 0 ~ :menu Selection menus :inherit windows abort ^[ ^[ backsmenu ^? backsmenu ^H bofmenu ^K U bofmenu ^K ^U bofmenu ^K u bofmenu ^[ [ 1 ; 5 H bolmenu ^A bolmenu .kh bolmenu ^[ [ 1 ~ bolmenu ^[ [ 7 ~ bolmenu ^[ [ H dnarwmenu .kd dnarwmenu ^N dnarwmenu ^[ [ B dnarwmenu ^[ O B eofmenu ^K V eofmenu ^K ^V eofmenu ^K v eofmenu ^[ [ 1 ; 5 F eolmenu .@7 eolmenu .kH eolmenu ^E eolmenu ^[ [ 4 ~ eolmenu ^[ [ 8 ~ eolmenu ^[ [ F ltarwmenu .kl ltarwmenu ^B ltarwmenu ^[ [ D ltarwmenu ^[ O D pgdnmenu .kN pgdnmenu ^V pgdnmenu ^[ [ 6 ~ pgdnmenu ^[ [ G pgupmenu .kP pgupmenu ^U pgupmenu ^[ [ 5 ~ pgupmenu ^[ [ I rtarwmenu .kr rtarwmenu ^F rtarwmenu ^[ [ C rtarwmenu ^[ O C rtn SP rtn ^I rtn ^K H rtn ^K h rtn ^K ^H tabmenu ^I uparwmenu .ku uparwmenu ^P uparwmenu ^[ [ A uparwmenu ^[ O A :query Single-key query window :inherit windows :querya Single-key query window for quoting type ^@ TO ˙ :querysr Search & replace query window type ^@ TO ˙ :cua Undo/Cut/Copy/Paste, CUA style :inherit main #HOOK#6 extra keybindings in CUA mode :def pastecua helpcard,"Paste",rtn,keymap,"Pastecua",rtn undo ^Z blkdel,nmark ^X copy ^C yank ^V pastecua ^[ P pastecua ^[ p pastecua ^[ [ 2 0 0 ~ jupp/scrn.c010064400000000000000000001240231363731662300101100ustar00/* * device-independent TTY interface for JOE * Copyright * (C) 1992 Joseph H. Allen * * This file is part of JOE (Joe's Own Editor) */ #include "config.h" #include "types.h" __RCSID("$MirOS: contrib/code/jupp/scrn.c,v 1.47 2020/03/27 06:30:16 tg Exp $"); #include #include #include "bw.h" #include "blocks.h" #include "scrn.h" #include "termcap.h" #include "charmap.h" #include "utils.h" int skiptop = 0; int lines = 0; int columns = 0; int notite = 0; int pastetite = 0; int usetabs = 0; int assume_color = 0; static int xlat(int chkasis, int c, int *ap, union charmap *map) { if (joe_isprint(map, c)) return (c); if (chkasis && dspasis && c >= 128) return (c); if (c & 0x80) { c &= 0x7F; *ap ^= INVERSE; } if (c < 0x20 || c == 0x7F) { c ^= 0x40; *ap ^= UNDERLINE; } return (c); } /* Set attributes */ int set_attr(SCRN *t, int c) { int e; c &= ~255; /* Attributes which have gone off */ e = ((AT_MASK|FG_NOT_DEFAULT|BG_NOT_DEFAULT)&t->attrib & ~c); if (e) { /* If any attribute go off, switch them all off: fixes bug on PCs */ if (t->me) texec(t->cap, t->me, 1, 0, 0, 0, 0); else { if (t->ue) texec(t->cap, t->ue, 1, 0, 0, 0, 0); if (t->se) texec(t->cap, t->se, 1, 0, 0, 0, 0); } t->attrib = 0; } /* Attributes which have turned on */ e = (c & ~t->attrib); if (e & INVERSE) { if (t->mr) texec(t->cap, t->mr, 1, 0, 0, 0, 0); else if (t->so) texec(t->cap, t->so, 1, 0, 0, 0, 0); } if (e & UNDERLINE) if (t->us) texec(t->cap, t->us, 1, 0, 0, 0, 0); if (e & BLINK) if (t->mb) texec(t->cap, t->mb, 1, 0, 0, 0, 0); if (e & BOLD) if (t->md) texec(t->cap, t->md, 1, 0, 0, 0, 0); if (e & DIM) if (t->mh) texec(t->cap, t->mh, 1, 0, 0, 0, 0); if ((t->attrib&FG_MASK)!=(c&FG_MASK)) if (t->Sf) texec(t->cap,t->Sf,1,7-(((c&FG_VALUE)>>FG_SHIFT)),0,0,0); if ((t->attrib&BG_MASK)!=(c&BG_MASK)) if (t->Sb) texec(t->cap,t->Sb,1,((c&BG_VALUE)>>BG_SHIFT),0,0,0); t->attrib = c; return 0; } /* Output character with attributes */ void outatr_help(SCRN *t, int *scrn, int *attrf, int xx, int yy, int c, int a) { /* kludge for help_display() only */ if (joe_maputf(locale_map)) c = xlat(0, c, &a, locale_map); outatr(locale_map, t, scrn, attrf, xx, yy, c, a); } void outatr(union charmap *map, SCRN *t, int *scrn, int *attrf, int xx, int yy, int c, int a) { int wid = 1; if (joe_maputf(locale_map)) { /* to UTF-8 terminal */ if (joe_maputf(map)) { /* from UTF-8 file */ switch ((wid = unictrl(c))) { case 0: /* not a control character */ wid = joe_wcwidth(c); break; case 1: c ^= 0x40; /* FALLTHROUGH */ default: a ^= UNDERLINE; break; } } else { /* from SBCS file */ c = joe_to_uni(map, xlat(1, c, &a, map)); if (c < 32 || (c >= 0x7F && c < 0xA0)) { c = 0xFFFD; a = (a | UNDERLINE) ^ INVERSE; } } } else { /* to SBCS terminal */ if (joe_maputf(map)) { /* from UTF-8 file */ /* don't convert control chars below 256 */ if ((c >= 0x20 && c < 0x7F) || c >= 0xA0) { if (unictrl(c)) a ^= UNDERLINE; if ((c = joe_from_uni(locale_map, c)) == -1) { c = '!'; a |= UNDERLINE; } } } c = xlat(1, c, &a, locale_map); } if (*scrn == c && *attrf == a) return; *scrn = c; *attrf = a; if (t->ins) clrins(t); if (t->x != xx || t->y != yy) cpos(t, xx, yy); if (t->attrib != a) set_attr(t, a); if (!joe_maputf(locale_map)) { /* SBCS terminal */ ttputc(c); } else if (joe_maputf(map) && *unictrlbuf) { /* UTF-8 control char, masked */ ttputs(unictrlbuf); } else { unsigned char buf[7]; utf8_encode(buf, c); ttputs(buf); if (wid == 0 && xx > 0) attrf[-1] |= HAS_COMBINING; } t->x += wid; while (wid-- > 1) { *++scrn = -1; *++attrf = 0; } } /* Set scrolling region */ static void setregn(SCRN *t, int top, int bot) { if (!t->cs) { t->top = top; t->bot = bot; return; } if (t->top != top || t->bot != bot) { t->top = top; t->bot = bot; texec(t->cap, t->cs, 1, top, bot - 1, 0, 0); t->x = -1; t->y = -1; } } /* Enter insert mode */ #ifdef notyet static void setins(SCRN *t, int x) { if (t->ins != 1 && t->im) { t->ins = 1; texec(t->cap, t->im, 1, x, 0, 0, 0); } } #endif /* Exit insert mode */ int clrins(SCRN *t) { if (t->ins != 0) { texec(t->cap, t->ei, 1, 0, 0, 0, 0); t->ins = 0; } return 0; } /* Erase from given screen coordinate to end of line */ int eraeol(SCRN *t, int x, int y) { int *s, *ss, *a, *aa; int w = t->co - x - 1; /* Don't worry about last column */ if (w <= 0) return 0; s = t->scrn + y * t->co + x; a = t->attr + y * t->co + x; ss = s + w; aa = a + w; do { if (*--ss != ' ') { ++ss; break; } else if (*--aa != 0) { ++ss; ++aa; break; } } while (ss != s); if ((ss - s > 3 || s[w] != ' ' || a[w] != 0) && t->ce) { cpos(t, x, y); set_attr(t, 0); texec(t->cap, t->ce, 1, 0, 0, 0, 0); msetI(s, ' ', w); msetI(a, 0, w); } else if (s != ss) { if (t->ins) clrins(t); if (t->x != x || t->y != y) cpos(t, x, y); if (t->attrib) set_attr(t, 0); while (s != ss) { *s = ' '; *a = 0; ttputc(' '); ++t->x; ++s; ++a; } } return 0; } static int out(int c) { ttputc(c); return (c); } SCRN *nopen(CAP *cap) { SCRN *t = calloc(1, sizeof(SCRN)); int x, y; ttopen(); t->cap = cap; setcap(cap, baud, out); t->li = getnum(t->cap, UC "li"); if (t->li < 1) t->li = 24; t->co = getnum(t->cap, UC "co"); if (t->co < 2) t->co = 80; x = y = 0; ttgtsz(&x, &y); if (x > 7 && y > 3) { t->li = y; t->co = x; } t->haz = getflag(t->cap, UC "hz"); t->os = getflag(t->cap, UC "os"); t->eo = getflag(t->cap, UC "eo"); if (getflag(t->cap, UC "hc")) t->os = 1; if (t->os || getflag(t->cap, UC "ul")) t->ul = 1; t->xn = getflag(t->cap, UC "xn"); t->am = getflag(t->cap, UC "am"); t->cl = jgetstr(t->cap, UC "cl"); t->cd = jgetstr(t->cap, UC "cd"); if (!notite) { t->ti = jgetstr(t->cap, UC "ti"); t->te = jgetstr(t->cap, UC "te"); } if (pastetite && t->cap->paste_on && t->cap->paste_off) { if (notite) { t->ti = t->cap->paste_on; t->te = t->cap->paste_off; } else { size_t n1, n2; char *cp; n1 = t->ti ? strlen(t->ti) : 0; n2 = strlen(t->cap->paste_on); cp = malloc(n1 + n2 + 1); if (t->ti) memcpy(cp, t->ti, n1); memcpy(cp + n1, t->cap->paste_on, n2 + 1); t->ti = cp; n1 = t->te ? strlen(t->te) : 0; n2 = strlen(t->cap->paste_off); cp = malloc(n1 + n2 + 1); memcpy(cp, t->cap->paste_off, n2 + 1); if (t->te) memcpy(cp + n2, t->te, n1 + 1); t->te = cp; } } t->ut = getflag(t->cap, UC "ut"); t->Sb = jgetstr(t->cap, UC "AB"); if (!t->Sb) t->Sb = jgetstr(t->cap, UC "Sb"); t->Sf = jgetstr(t->cap, UC "AF"); if (!t->Sf) t->Sf = jgetstr(t->cap, UC "Sf"); if (!(t->me = jgetstr(t->cap, UC "me"))) goto oops; if ((t->mb = jgetstr(t->cap, UC "mb"))) t->avattr |= BLINK; if ((t->md = jgetstr(t->cap, UC "md"))) t->avattr |= BOLD; if ((t->mh = jgetstr(t->cap, UC "mh"))) t->avattr |= DIM; if ((t->mr = jgetstr(t->cap, UC "mr"))) t->avattr |= INVERSE; oops: if (assume_color && !t->Sf && t->md) { /* * Install colour support if this looks like an ANSI * terminal — that is, it’s got bold with ESC â€[’… */ if (t->md[0] == '\\' && t->md[1] == 'E' && t->md[2] == '[') { t->ut = 1; t->Sf = UC "\\E[3%dm"; t->Sb = UC "\\E[4%dm"; } else if (t->md[0] == '\033' && t->md[1] == '[') { t->ut = 1; t->Sf = UC "\033[3%p1%dm"; t->Sb = UC "\033[4%p1%dm"; } } if (getnum(t->cap, UC "sg") <= 0 && !t->mr && jgetstr(t->cap, UC "se")) { if ((t->so = jgetstr(t->cap, UC "so")) != NULL) t->avattr |= INVERSE; t->se = jgetstr(t->cap, UC "se"); } if (getflag(t->cap, UC "xs") || getflag(t->cap, UC "xt")) t->so = NULL; if (getnum(t->cap, UC "ug") <= 0 && jgetstr(t->cap, UC "ue")) { if ((t->us = jgetstr(t->cap, UC "us")) != NULL) t->avattr |= UNDERLINE; t->ue = jgetstr(t->cap, UC "ue"); } if (!(t->uc = jgetstr(t->cap, UC "uc"))) if (t->ul) t->uc = UC "_"; if (t->uc) t->avattr |= UNDERLINE; t->ms = getflag(t->cap, UC "ms"); t->da = getflag(t->cap, UC "da"); t->db = getflag(t->cap, UC "db"); t->cs = jgetstr(t->cap, UC "cs"); t->rr = getflag(t->cap, UC "rr"); t->sf = jgetstr(t->cap, UC "sf"); t->sr = jgetstr(t->cap, UC "sr"); t->SF = jgetstr(t->cap, UC "SF"); t->SR = jgetstr(t->cap, UC "SR"); t->al = jgetstr(t->cap, UC "al"); t->dl = jgetstr(t->cap, UC "dl"); t->AL = jgetstr(t->cap, UC "AL"); t->DL = jgetstr(t->cap, UC "DL"); if (!getflag(t->cap, UC "ns") && !t->sf) t->sf = UC "\12"; if (!getflag(t->cap, UC "in") && baud < 38400) { t->dc = jgetstr(t->cap, UC "dc"); t->DC = jgetstr(t->cap, UC "DC"); t->dm = jgetstr(t->cap, UC "dm"); t->ed = jgetstr(t->cap, UC "ed"); t->im = jgetstr(t->cap, UC "im"); t->ei = jgetstr(t->cap, UC "ei"); t->ic = jgetstr(t->cap, UC "ic"); t->IC = jgetstr(t->cap, UC "IC"); t->ip = jgetstr(t->cap, UC "ip"); t->mi = getflag(t->cap, UC "mi"); } if (jgetstr(t->cap, UC "bc")) t->bs = jgetstr(t->cap, UC "bc"); else if (jgetstr(t->cap, UC "le")) t->bs = jgetstr(t->cap, UC "le"); if (getflag(t->cap, UC "bs")) t->bs = UC "\10"; t->cbs = tcost(t->cap, t->bs, 1, 2, 2, 0, 0); t->lf = UC "\12"; if (jgetstr(t->cap, UC "do")) t->lf = jgetstr(t->cap, UC "do"); t->clf = tcost(t->cap, t->lf, 1, 2, 2, 0, 0); t->up = jgetstr(t->cap, UC "up"); t->cup = tcost(t->cap, t->up, 1, 2, 2, 0, 0); t->nd = jgetstr(t->cap, UC "nd"); t->tw = 8; if (getnum(t->cap, UC "it") > 0) t->tw = getnum(t->cap, UC "it"); else if (getnum(t->cap, UC "tw") > 0) t->tw = getnum(t->cap, UC "tw"); if (!(t->ta = jgetstr(t->cap, UC "ta"))) if (getflag(t->cap, UC "pt")) t->ta = UC "\11"; t->bt = jgetstr(t->cap, UC "bt"); if (getflag(t->cap, UC "xt") || !usetabs) { t->ta = NULL; t->bt = NULL; } t->cta = tcost(t->cap, t->ta, 1, 2, 2, 0, 0); t->cbt = tcost(t->cap, t->bt, 1, 2, 2, 0, 0); t->ho = jgetstr(t->cap, UC "ho"); t->cho = tcost(t->cap, t->ho, 1, 2, 2, 0, 0); t->ll = jgetstr(t->cap, UC "ll"); t->cll = tcost(t->cap, t->ll, 1, 2, 2, 0, 0); t->cr = UC "\15"; if (jgetstr(t->cap, UC "cr")) t->cr = jgetstr(t->cap, UC "cr"); if (getflag(t->cap, UC "nc") || getflag(t->cap, UC "xr")) t->cr = NULL; t->ccr = tcost(t->cap, t->cr, 1, 2, 2, 0, 0); t->cRI = tcost(t->cap, t->RI = jgetstr(t->cap, UC "RI"), 1, 2, 2, 0, 0); t->cLE = tcost(t->cap, t->LE = jgetstr(t->cap, UC "LE"), 1, 2, 2, 0, 0); t->cUP = tcost(t->cap, t->UP = jgetstr(t->cap, UC "UP"), 1, 2, 2, 0, 0); t->cDO = tcost(t->cap, t->DO = jgetstr(t->cap, UC "DO"), 1, 2, 2, 0, 0); t->cch = tcost(t->cap, t->ch = jgetstr(t->cap, UC "ch"), 1, 2, 2, 0, 0); t->ccv = tcost(t->cap, t->cv = jgetstr(t->cap, UC "cv"), 1, 2, 2, 0, 0); t->ccV = tcost(t->cap, t->cV = jgetstr(t->cap, UC "cV"), 1, 2, 2, 0, 0); t->ccm = tcost(t->cap, t->cm = jgetstr(t->cap, UC "cm"), 1, 2, 2, 0, 0); t->cce = tcost(t->cap, t->ce = jgetstr(t->cap, UC "ce"), 1, 2, 2, 0, 0); /* Make sure terminal can do absolute positioning */ if (t->cm) goto ok; if (t->ch && t->cv) goto ok; if (t->ho && (t->lf || t->DO || t->cv)) goto ok; if (t->ll && (t->up || t->UP || t->cv)) goto ok; if (t->cr && t->cv) goto ok; leave = 1; ttclose(); signrm(0); free(t); fprintf(stderr,"Sorry, your terminal can't do absolute cursor positioning.\nIt's broken\n"); return NULL; ok: /* Determine if we can scroll */ if (((t->sr || t->SR) && (t->sf || t->SF) && t->cs) || ((t->al || t->AL) && (t->dl || t->DL))) t->scroll = 1; else if (baud < 38400) mid = 1; /* Determine if we can ins/del within lines */ if ((t->im || t->ic || t->IC) && (t->dc || t->DC)) t->insdel = 1; /* Adjust for high baud rates */ if (baud >= 38400) { t->scroll = 0; t->insdel = 0; } /* Send out terminal initialisation string */ if (t->ti) texec(t->cap, t->ti, 1, 0, 0, 0, 0); if (!skiptop && t->cl) texec(t->cap, t->cl, 1, 0, 0, 0, 0); /* Initialise variable screen size-dependent vars */ t->htab = ralloc(256, sizeof(struct s_hentry)); nresize(t, t->co, t->li); return t; } /* Change size of screen */ void nresize(SCRN *t, int w, int h) { if (h < 4) h = 4; if (w < 8) w = 8; t->li = h; t->co = w; if (notoktomul((size_t)t->li, (size_t)t->co)) { /* who has THAT large screens? */ ttabrt(0, "screen too large"); exit(255); } if (t->sary) free(t->sary); if (t->updtab) free(t->updtab); if (t->syntab) free(t->syntab); if (t->scrn) free(t->scrn); if (t->attr) free(t->attr); if (t->compose) free(t->compose); if (t->ofst) free(t->ofst); if (t->ary) free(t->ary); t->scrn = ralloc((size_t)t->li * (size_t)t->co, sizeof(int)); t->attr = ralloc((size_t)t->li * (size_t)t->co, sizeof(int)); t->sary = calloc(t->li, sizeof(int)); t->updtab = ralloc((size_t)t->li, sizeof(int)); t->syntab = ralloc((size_t)t->li, sizeof(int)); t->compose = ralloc((size_t)t->co, sizeof(int)); t->ofst = ralloc((size_t)t->co, sizeof(int)); t->ary = ralloc((size_t)t->co, sizeof(struct s_hentry)); if (!t->htab || !t->scrn || !t->attr || !t->sary || !t->updtab || !t->syntab || !t->compose || !t->ofst || !t->ary) { ttabrt(0, "screen allocation failed"); exit(255); } nredraw(t); } /* * Calculate cost of positioning the cursor using only relative cursor * positioning functions: t->(lf, DO, up, UP, bs, LE, RI, ta, bt) and * rewriting characters (to move right) * * This doesn't use the am and bw capabilities although it probably could. */ static int relcost(register SCRN *t, register int x, register int y, register int ox, register int oy) { int cost = 0; /* If we don't know the cursor position, force use of absolute positioning */ if (oy == -1 || ox == -1) return 10000; /* First adjust row */ if (y > oy) { int dist = y - oy; /* Have to go down */ if (t->lf) { int mult = dist * t->clf; if (dist < 10 && t->cDO < mult) cost += t->cDO; else if (dist >= 10 && t->cDO + 1 < mult) cost += t->cDO + 1; else cost += mult; } else if (t->DO) if (dist < 10) cost += t->cDO; else cost += t->cDO + 1; else return 10000; } else if (y < oy) { int dist = oy - y; /* Have to go up */ if (t->up) { int mult = dist * t->cup; if (dist < 10 && t->cUP < mult) cost += t->cUP; else if (dist >= 10 && t->cUP < mult) cost += t->cUP + 1; else cost += mult; } else if (t->UP) if (dist < 10) cost += t->cUP; else cost += t->cUP + 1; else return 10000; } /* Now adjust column */ /* Use tabs */ if (x > ox && t->ta) { int dist = x - ox; int ntabs = (dist + ox % t->tw) / t->tw; int cstunder = x % t->tw + t->cta * ntabs; int cstover; if (x + t->tw < t->co && t->bs) cstover = t->cbs * (t->tw - x % t->tw) + t->cta * (ntabs + 1); else cstover = 10000; if (dist < 10 && cstunder < t->cRI && cstunder < x - ox && cstover > cstunder) return cost + cstunder; else if (cstunder < t->cRI + 1 && cstunder < x - ox && cstover > cstunder) return cost + cstunder; else if (dist < 10 && cstover < t->cRI && cstover < x - ox) return cost + cstover; else if (cstover < t->cRI + 1 && cstover < x - ox) return cost + cstover; } else if (x < ox && t->bt) { int dist = ox - x; int ntabs = (dist + t->tw - ox % t->tw) / t->tw; int cstunder, cstover; if (t->bs) cstunder = t->cbt * ntabs + t->cbs * (t->tw - x % t->tw); else cstunder = 10000; if (x - t->tw >= 0) cstover = t->cbt * (ntabs + 1) + x % t->tw; else cstover = 10000; if (dist < 10 && cstunder < t->cLE && (t->bs ? cstunder < (ox - x) * t->cbs : 1) && cstover > cstunder) return cost + cstunder; if (cstunder < t->cLE + 1 && (t->bs ? cstunder < (ox - x) * t->cbs : 1) && cstover > cstunder) return cost + cstunder; else if (dist < 10 && cstover < t->cRI && (t->bs ? cstover < (ox - x) * t->cbs : 1)) return cost + cstover; else if (cstover < t->cRI + 1 && (t->bs ? cstover < (ox - x) * t->cbs : 1)) return cost + cstover; } /* Use simple motions */ if (x < ox) { int dist = ox - x; /* Have to go left */ if (t->bs) { int mult = dist * t->cbs; if (t->cLE < mult && dist < 10) cost += t->cLE; else if (t->cLE + 1 < mult) cost += t->cLE + 1; else cost += mult; } else if (t->LE) cost += t->cLE; else return 10000; } else if (x > ox) { int dist = x - ox; /* Have to go right */ /* Hmm.. this should take into account possible attribute changes */ if (t->cRI < dist && dist < 10) cost += t->cRI; else if (t->cRI + 1 < dist) cost += t->cRI + 1; else cost += dist; } return cost; } /* Find optimal set of cursor positioning commands to move from the current * cursor row and column (either or both of which might be unknown) to the * given new row and column and execute them. */ static void cposs(register SCRN *t, register int x, register int y) { register int bestcost, cost; int bestway; int hy; int hl; /* * Home y position is usually 0, but it is 'top' if we have * scrolling region relative addressing */ if (t->rr) { hy = t->top; hl = t->bot - 1; } else { hy = 0; hl = t->li - 1; } /* Assume best way is with only using relative cursor positioning */ bestcost = relcost(t, x, y, t->x, t->y); bestway = 0; /* * Now check if combinations of absolute cursor positioning * functions are better (or necessary in case one or both cursor * positions are unknown) */ if (t->ccm < bestcost) { cost = tcost(t->cap, t->cm, 1, y, x, 0, 0); if (cost < bestcost) { bestcost = cost; bestway = 6; } } if (t->ccr < bestcost) { cost = relcost(t, x, y, 0, t->y) + t->ccr; if (cost < bestcost) { bestcost = cost; bestway = 1; } } if (t->cho < bestcost) { cost = relcost(t, x, y, 0, hy) + t->cho; if (cost < bestcost) { bestcost = cost; bestway = 2; } } if (t->cll < bestcost) { cost = relcost(t, x, y, 0, hl) + t->cll; if (cost < bestcost) { bestcost = cost; bestway = 3; } } if (t->cch < bestcost && x != t->x) { cost = relcost(t, x, y, x, t->y) + tcost(t->cap, t->ch, 1, x, 0, 0, 0); if (cost < bestcost) { bestcost = cost; bestway = 4; } } if (t->ccv < bestcost && y != t->y) { cost = relcost(t, x, y, t->x, y) + tcost(t->cap, t->cv, 1, y, 0, 0, 0); if (cost < bestcost) { bestcost = cost; bestway = 5; } } if (t->ccV < bestcost) { cost = relcost(t, x, y, 0, y) + tcost(t->cap, t->cV, 1, y, 0, 0, 0); if (cost < bestcost) { bestcost = cost; bestway = 13; } } if (t->cch + t->ccv < bestcost && x != t->x && y != t->y) { cost = tcost(t->cap, t->cv, 1, y - hy, 0, 0, 0) + tcost(t->cap, t->ch, 1, x, 0, 0, 0); if (cost < bestcost) { bestcost = cost; bestway = 7; } } if (t->ccv + t->ccr < bestcost && y != t->y) { cost = tcost(t->cap, t->cv, 1, y, 0, 0, 0) + tcost(t->cap, t->cr, 1, 0, 0, 0, 0) + relcost(t, x, y, 0, y); if (cost < bestcost) { bestcost = cost; bestway = 8; } } if (t->cll + t->cch < bestcost) { cost = tcost(t->cap, t->ll, 1, 0, 0, 0, 0) + tcost(t->cap, t->ch, 1, x, 0, 0, 0) + relcost(t, x, y, x, hl); if (cost < bestcost) { bestcost = cost; bestway = 9; } } if (t->cll + t->ccv < bestcost) { cost = tcost(t->cap, t->ll, 1, 0, 0, 0, 0) + tcost(t->cap, t->cv, 1, y, 0, 0, 0) + relcost(t, x, y, 0, y); if (cost < bestcost) { bestcost = cost; bestway = 10; } } if (t->cho + t->cch < bestcost) { cost = tcost(t->cap, t->ho, 1, 0, 0, 0, 0) + tcost(t->cap, t->ch, 1, x, 0, 0, 0) + relcost(t, x, y, x, hy); if (cost < bestcost) { bestcost = cost; bestway = 11; } } if (t->cho + t->ccv < bestcost) { cost = tcost(t->cap, t->ho, 1, 0, 0, 0, 0) + tcost(t->cap, t->cv, 1, y, 0, 0, 0) + relcost(t, x, y, 0, y); if (cost < bestcost) { /* dead store: bestcost = cost; */ bestway = 12; } } /* * Do absolute cursor positioning if we don't know the cursor * position or if it is faster than doing only relative cursor * positioning */ switch (bestway) { case 1: texec(t->cap, t->cr, 1, 0, 0, 0, 0); t->x = 0; break; case 2: texec(t->cap, t->ho, 1, 0, 0, 0, 0); t->x = 0; t->y = hy; break; case 3: texec(t->cap, t->ll, 1, 0, 0, 0, 0); t->x = 0; t->y = hl; break; case 9: texec(t->cap, t->ll, 1, 0, 0, 0, 0); t->x = 0; t->y = hl; goto doch; case 11: texec(t->cap, t->ho, 1, 0, 0, 0, 0); t->x = 0; t->y = hy; /* FALLTHROUGH */ doch: /* FALLTHROUGH */ case 4: texec(t->cap, t->ch, 1, x, 0, 0, 0); t->x = x; break; case 10: texec(t->cap, t->ll, 1, 0, 0, 0, 0); t->x = 0; t->y = hl; goto docv; case 12: texec(t->cap, t->ho, 1, 0, 0, 0, 0); t->x = 0; t->y = hy; goto docv; case 8: texec(t->cap, t->cr, 1, 0, 0, 0, 0); t->x = 0; /* FALLTHROUGH */ docv: /* FALLTHROUGH */ case 5: texec(t->cap, t->cv, 1, y, 0, 0, 0); t->y = y; break; case 6: texec(t->cap, t->cm, 1, y, x, 0, 0); t->y = y; t->x = x; break; case 7: texec(t->cap, t->cv, 1, y, 0, 0, 0); t->y = y; texec(t->cap, t->ch, 1, x, 0, 0, 0); t->x = x; break; case 13: texec(t->cap, t->cV, 1, y, 0, 0, 0); t->y = y; t->x = 0; break; } /* Use relative cursor position functions if we're not there yet */ /* First adjust row */ if (y > t->y) { /* Have to go down */ if (!t->lf || t->cDO < (y - t->y) * t->clf) { texec(t->cap, t->DO, 1, y - t->y, 0, 0, 0); t->y = y; } else while (y > t->y) { texec(t->cap, t->lf, 1, 0, 0, 0, 0); ++t->y; } } else if (y < t->y) { /* Have to go up */ if (!t->up || t->cUP < (t->y - y) * t->cup) { texec(t->cap, t->UP, 1, t->y - y, 0, 0, 0); t->y = y; } else while (y < t->y) { texec(t->cap, t->up, 1, 0, 0, 0, 0); --t->y; } } /* Use tabs */ if (x > t->x && t->ta) { int ntabs = (x - t->x + t->x % t->tw) / t->tw; int cstunder = x % t->tw + t->cta * ntabs; int cstover; if (x + t->tw < t->co && t->bs) cstover = t->cbs * (t->tw - x % t->tw) + t->cta * (ntabs + 1); else cstover = 10000; if (cstunder < t->cRI && cstunder < x - t->x && cstover > cstunder) { if (ntabs) { t->x = x - x % t->tw; do { texec(t->cap, t->ta, 1, 0, 0, 0, 0); } while (--ntabs); } } else if (cstover < t->cRI && cstover < x - t->x) { t->x = t->tw + x - x % t->tw; ++ntabs; do { texec(t->cap, t->ta, 1, 0, 0, 0, 0); } while (--ntabs); } } else if (x < t->x && t->bt) { int ntabs = ((t->x + t->tw - 1) - (t->x + t->tw - 1) % t->tw - ((x + t->tw - 1) - (x + t->tw - 1) % t->tw)) / t->tw; int cstunder, cstover; if (t->bs) cstunder = t->cbt * ntabs + t->cbs * (t->tw - x % t->tw); else cstunder = 10000; if (x - t->tw >= 0) cstover = t->cbt * (ntabs + 1) + x % t->tw; else cstover = 10000; if (cstunder < t->cLE && (t->bs ? cstunder < (t->x - x) * t->cbs : 1) && cstover > cstunder) { if (ntabs) { do { texec(t->cap, t->bt, 1, 0, 0, 0, 0); } while (--ntabs); t->x = x + t->tw - x % t->tw; } } else if (cstover < t->cRI && (t->bs ? cstover < (t->x - x) * t->cbs : 1)) { t->x = x - x % t->tw; ++ntabs; do { texec(t->cap, t->bt, 1, 0, 0, 0, 0); } while (--ntabs); } } /* Now adjust column */ if (x < t->x) { /* Have to go left */ if (!t->bs || t->cLE < (t->x - x) * t->cbs) { texec(t->cap, t->LE, 1, t->x - x, 0, 0, 0); t->x = x; } else while (x < t->x) { texec(t->cap, t->bs, 1, 0, 0, 0, 0); --t->x; } } else if (x > t->x) { /* Have to go right */ /* Hmm.. this should take into account possible attribute changes */ if (x-t->x>1 && t->RI) { texec(t->cap, t->RI, 1, x - t->x, 0, 0, 0); t->x = x; } else { while(x>t->x) { texec(t->cap, t->nd, 1, 0, 0, 0, 0); ++t->x; } } } } int cpos(register SCRN *t, register int x, register int y) { /* Move cursor quickly if we can */ if (y == t->y) { if (x > t->x && x - t->x < 4 && !t->ins) { int *cs = t->scrn + t->x + t->co * t->y; int *as = t->attr + t->x + t->co * t->y; do { /* We used to space over unknown chars, but they now could be the right half of a UTF-8 two column character, so we can't. Also do not try to emit utf-8 sequences here. */ if(*cs<32 || *cs>=127) break; /* has a combining character attached? */ if (*as & HAS_COMBINING) break; if (*as != t->attrib) set_attr(t, *as); ttputc(*cs); ++cs; ++as; ++t->x; } while (x != t->x); } if (x == t->x) return 0; } if ((!t->ms && t->attrib & (INVERSE | UNDERLINE | BG_NOT_DEFAULT)) || (t->ut && (t->attrib & BG_NOT_DEFAULT))) set_attr(t, t->attrib & ~(INVERSE | UNDERLINE | BG_MASK)); /* Should be in cposs */ if (y < t->top || y >= t->bot) setregn(t, 0, t->li); cposs(t, x, y); return 0; } #ifdef notyet static void doinschr(SCRN *t, int x, int y, int *s, int *as, int n) { int a; if (x < 0) { s -= x; as -= x; x = 0; } if (x >= t->co - 1 || n <= 0) return; if (t->im || t->ic || t->IC) { cpos(t, x, y); if ((n == 1 && t->ic) || !t->IC) { if (!t->ic) setins(t, x); for (a = 0; a != n; ++a) { texec(t->cap, t->ic, 1, x, 0, 0, 0); texec(t->cap, t->ip, 1, x, 0, 0, 0); } if (!t->mi) clrins(t); } else { texec(t->cap, t->IC, 1, n, 0, 0, 0); } } mmove(t->scrn + x + t->co * y + n, t->scrn + x + t->co * y, (t->co - (x + n)) * sizeof(int)); mmove(t->attr + x + t->co * y + n, t->attr + x + t->co * y, (t->co - (x + n)) * sizeof(int)); mmove(t->scrn + x + t->co * y, s, n * sizeof(int)); mmove(t->attr + x + t->co * y, s, n * sizeof(int)); } static void dodelchr(SCRN *t, int x, int y, int n) { int a; if (x < 0) x = 0; if (!n || x >= t->co - 1) return; if (t->dc || t->DC) { cpos(t, x, y); texec(t->cap, t->dm, 1, x, 0, 0, 0); /* Enter delete mode */ if ((n == 1 && t->dc) || !t->DC) for (a = n; a; --a) texec(t->cap, t->dc, 1, x, 0, 0, 0); else texec(t->cap, t->DC, 1, n, 0, 0, 0); texec(t->cap, t->ed, 1, x, 0, 0, 0); /* Exit delete mode */ } mmove(t->scrn + t->co * y + x, t->scrn + t->co * y + x + n, (t->co - (x + n)) * sizeof(int)); mmove(t->attr + t->co * y + x, t->attr + t->co * y + x + n, (t->co - (x + n)) * sizeof(int)); msetI(t->scrn + t->co * y + t->co - n, ' ', n); msetI(t->attr + t->co * y + t->co - n, 0, n); } /* Insert/Delete within line */ /* FIXME: doesn't know about attr */ void magic(SCRN *t, int y, int *cs, int *s, int *a, int placex) { struct s_hentry *htab = t->htab; int *ofst = t->ofst; int aryx = 1; int x; if (!(t->im || t->ic || t->IC) || !(t->dc || t->DC)) return; mset(htab, 0, 256 * sizeof(struct s_hentry)); msetI(ofst, 0, t->co); /* Build hash table */ for (x = 0; x != t->co - 1; ++x) { t->ary[aryx].next = htab[cs[x] & 255].next; t->ary[aryx].loc = x; ++htab[cs[x] & 255].loc; htab[cs[x] & 255].next = aryx++; } /* Build offset table */ for (x = 0; x < t->co - 1;) if (htab[s[x] & 255].loc >= 15) ofst[x++] = t->co - 1; else { int aryy; int maxaryy = 0; int maxlen = 0; int best = 0; int bestback = 0; int z; for (aryy = htab[s[x] & 255].next; aryy; aryy = t->ary[aryy].next) { int amnt, back; int tsfo = t->ary[aryy].loc - x; int cst = -abs(tsfo); int pre = 32; for (amnt = 0; x + amnt < t->co - 1 && x + tsfo + amnt < t->co - 1; ++amnt) { if (cs[x + tsfo + amnt] != s[x + amnt]) break; else if ((s[x + amnt] & 255) != 32 || pre != 32) ++cst; pre = s[x + amnt] & 255; } pre = 32; for (back = 0; back + x > 0 && back + tsfo + x > 0; --back) { if (cs[x + tsfo + back - 1] != s[x + back - 1]) break; else if ((s[x + back - 1] & 255) != 32 || pre != 32) ++cst; pre = s[x + back - 1] & 255; } if (cst > best) { maxaryy = aryy; maxlen = amnt; best = cst; bestback = back; } } if (!maxlen) { ofst[x] = t->co - 1; maxlen = 1; } else if (best < 2) for (z = 0; z != maxlen; ++z) ofst[x + z] = t->co - 1; else for (z = 0; z != maxlen - bestback; ++z) ofst[x + z + bestback] = t->ary[maxaryy].loc - x; x += maxlen; } /* Apply scrolling commands */ for (x = 0; x != t->co - 1; ++x) { int q = ofst[x]; if (q && q != t->co - 1) { if (q > 0) { int z, fu; for (z = x; z != t->co - 1 && ofst[z] == q; ++z) ; while (s[x] == cs[x] && x < placex) ++x; dodelchr(t, x, y, q); for (fu = x; fu != t->co - 1; ++fu) if (ofst[fu] != t->co - 1) ofst[fu] -= q; x = z - 1; } else { int z, fu; for (z = x; z != t->co - 1 && ofst[z] == q; ++z) ; while (s[x + q] == cs[x + q] && x - q < placex) ++x; doinschr(t, x + q, y, s + x + q, a + x + q, -q); for (fu = x; fu != t->co - 1; ++fu) if (ofst[fu] != t->co - 1) ofst[fu] -= q; x = z - 1; } } } } #endif static void doupscrl(SCRN *t, int top, int bot, int amnt) { int a = amnt; if (!amnt) return; set_attr(t, 0); if (top == 0 && bot == t->li && (t->sf || t->SF)) { setregn(t, 0, t->li); cpos(t, 0, t->li - 1); if ((amnt == 1 && t->sf) || !t->SF) while (a--) texec(t->cap, t->sf, 1, t->li - 1, 0, 0, 0); else texec(t->cap, t->SF, a, a, 0, 0, 0); goto done; } if (bot == t->li && (t->dl || t->DL)) { setregn(t, 0, t->li); cpos(t, 0, top); if ((amnt == 1 && t->dl) || !t->DL) while (a--) texec(t->cap, t->dl, 1, top, 0, 0, 0); else texec(t->cap, t->DL, a, a, 0, 0, 0); goto done; } if (t->cs && (t->sf || t->SF)) { setregn(t, top, bot); cpos(t, 0, bot - 1); if ((amnt == 1 && t->sf) || !t->SF) while (a--) texec(t->cap, t->sf, 1, bot - 1, 0, 0, 0); else texec(t->cap, t->SF, a, a, 0, 0, 0); goto done; } if ((t->dl || t->DL) && (t->al || t->AL)) { cpos(t, 0, top); if ((amnt == 1 && t->dl) || !t->DL) while (a--) texec(t->cap, t->dl, 1, top, 0, 0, 0); else texec(t->cap, t->DL, a, a, 0, 0, 0); a = amnt; cpos(t, 0, bot - amnt); if ((amnt == 1 && t->al) || !t->AL) while (a--) texec(t->cap, t->al, 1, bot - amnt, 0, 0, 0); else texec(t->cap, t->AL, a, a, 0, 0, 0); goto done; } msetI(t->updtab + top, 1, bot - top); msetI(t->syntab + top, -1, bot - top); return; done: mmove(t->scrn + top * t->co, t->scrn + (top + amnt) * t->co, (bot - top - amnt) * t->co * sizeof(int)); mmove(t->attr + top * t->co, t->attr + (top + amnt) * t->co, (bot - top - amnt) * t->co * sizeof(int)); if (bot == t->li && t->db) { msetI(t->scrn + (t->li - amnt) * t->co, -1, amnt * t->co); msetI(t->attr + (t->li - amnt) * t->co, 0, amnt * t->co); msetI(t->updtab + t->li - amnt, 1, amnt); msetI(t->syntab + t->li - amnt, -1, amnt); } else { msetI(t->scrn + (bot - amnt) * t->co, ' ', amnt * t->co); msetI(t->attr + (bot - amnt) * t->co, 0, amnt * t->co); } } static void dodnscrl(SCRN *t, int top, int bot, int amnt) { int a = amnt; if (!amnt) return; set_attr(t, 0); if (top == 0 && bot == t->li && (t->sr || t->SR)) { setregn(t, 0, t->li); cpos(t, 0, 0); if ((amnt == 1 && t->sr) || !t->SR) while (a--) texec(t->cap, t->sr, 1, 0, 0, 0, 0); else texec(t->cap, t->SR, a, a, 0, 0, 0); goto done; } if (bot == t->li && (t->al || t->AL)) { setregn(t, 0, t->li); cpos(t, 0, top); if ((amnt == 1 && t->al) || !t->AL) while (a--) texec(t->cap, t->al, 1, top, 0, 0, 0); else texec(t->cap, t->AL, a, a, 0, 0, 0); goto done; } if (t->cs && (t->sr || t->SR)) { setregn(t, top, bot); cpos(t, 0, top); if ((amnt == 1 && t->sr) || !t->SR) while (a--) texec(t->cap, t->sr, 1, top, 0, 0, 0); else texec(t->cap, t->SR, a, a, 0, 0, 0); goto done; } if ((t->dl || t->DL) && (t->al || t->AL)) { cpos(t, 0, bot - amnt); if ((amnt == 1 && t->dl) || !t->DL) while (a--) texec(t->cap, t->dl, 1, bot - amnt, 0, 0, 0); else texec(t->cap, t->DL, a, a, 0, 0, 0); a = amnt; cpos(t, 0, top); if ((amnt == 1 && t->al) || !t->AL) while (a--) texec(t->cap, t->al, 1, top, 0, 0, 0); else texec(t->cap, t->AL, a, a, 0, 0, 0); goto done; } msetI(t->updtab + top, 1, bot - top); msetI(t->syntab + top, -1, bot - top); return; done: mmove(t->scrn + (top + amnt) * t->co, t->scrn + top * t->co, (bot - top - amnt) * t->co * sizeof(int)); mmove(t->attr + (top + amnt) * t->co, t->attr + top * t->co, (bot - top - amnt) * t->co * sizeof(int)); if (!top && t->da) { msetI(t->scrn, -1, amnt * t->co); msetI(t->attr, 0, amnt * t->co); msetI(t->updtab, 1, amnt); msetI(t->syntab, -1, amnt); } else { msetI(t->scrn + t->co * top, ' ', amnt * t->co); msetI(t->attr + t->co * top, 0, amnt * t->co); } } void nscroll(SCRN *t) { int y, z, q, r, p; for (y = 0; y != t->li; ++y) { q = t->sary[y]; if (have) return; if (q && q != t->li) { if (q > 0) { for (z = y; z != t->li && t->sary[z] == q; ++z) t->sary[z] = 0; doupscrl(t, y, z + q, q); y = z - 1; } else { for (r = y; r != t->li && (t->sary[r] < 0 || t->sary[r] == t->li); ++r) ; p = r - 1; do { q = t->sary[p]; if (q && q != t->li) { for (z = p; t->sary[z] = 0, (z && t->sary[z - 1] == q); --z) ; dodnscrl(t, z + q, p + 1, -q); p = z + 1; } } while (p-- != y); y = r - 1; } } } msetI(t->sary, 0, t->li); } void npartial(SCRN *t) { set_attr(t, 0); clrins(t); setregn(t, 0, t->li); } void nescape(SCRN *t) { npartial(t); cpos(t, 0, t->li - 1); eraeol(t, 0, t->li - 1); if (t->te) texec(t->cap, t->te, 1, 0, 0, 0, 0); } void nreturn(SCRN *t) { if (t->ti) texec(t->cap, t->ti, 1, 0, 0, 0, 0); if (!skiptop && t->cl) texec(t->cap, t->cl, 1, 0, 0, 0, 0); nredraw(t); } void nclose(SCRN *t) { leave = 1; set_attr(t, 0); clrins(t); setregn(t, 0, t->li); cpos(t, 0, t->li - 1); if (t->te) texec(t->cap, t->te, 1, 0, 0, 0, 0); ttclose(); rmcap(t->cap); free(t->scrn); free(t->attr); free(t->sary); free(t->ofst); free(t->htab); free(t->ary); free(t); } void nscrldn(SCRN *t, int top, int bot, int amnt) { int x; if (!amnt || top >= bot || bot > t->li) return; if ((amnt < bot - top && bot - top - amnt < amnt / 2) || !t->scroll) amnt = bot - top; if (amnt < bot - top) { for (x = bot; x != top + amnt; --x) { t->sary[x - 1] = (t->sary[x - amnt - 1] == t->li ? t->li : t->sary[x - amnt - 1] - amnt); t->updtab[x - 1] = t->updtab[x - amnt - 1]; t->syntab[x - 1] = t->syntab[x - amnt - 1]; } for (x = top; x != top + amnt; ++x) { t->updtab[x] = 1; t->syntab[x] = -1; } } if (amnt > bot - top) amnt = bot - top; msetI(t->sary + top, t->li, amnt); if (amnt == bot - top) { msetI(t->updtab + top, 1, amnt); msetI(t->syntab + top, -1, amnt); } } void nscrlup(SCRN *t, int top, int bot, int amnt) { int x; if (!amnt || top >= bot || bot > t->li) return; if ((amnt < bot - top && bot - top - amnt < amnt / 2) || !t->scroll) amnt = bot - top; if (amnt < bot - top) { for (x = top + amnt; x != bot; ++x) { t->sary[x - amnt] = (t->sary[x] == t->li ? t->li : t->sary[x] + amnt); t->updtab[x - amnt] = t->updtab[x]; t->syntab[x - amnt] = t->syntab[x]; } for (x = bot - amnt; x != bot; ++x) { t->updtab[x] = 1; t->syntab[x] = -1; } } if (amnt > bot - top) amnt = bot - top; msetI(t->sary + bot - amnt, t->li, amnt); if (amnt == bot - top) { msetI(t->updtab + bot - amnt, 1, amnt); msetI(t->syntab + bot - amnt, -1, amnt); } } extern volatile int dostaupd; void nredraw(SCRN *t) { dostaupd = 1; msetI(t->scrn, ' ', t->co * skiptop); msetI(t->attr, 0, t->co * skiptop); msetI(t->scrn + skiptop * t->co, -1, (t->li - skiptop) * t->co); msetI(t->attr + skiptop * t->co, 0, (t->li - skiptop) * t->co); msetI(t->sary, 0, t->li); msetI(t->updtab + skiptop, -1, t->li - skiptop); msetI(t->syntab + skiptop, -1, t->li - skiptop); t->x = -1; t->y = -1; t->top = t->li; t->bot = 0; t->attrib = -1; t->ins = -1; set_attr(t, 0); clrins(t); setregn(t, 0, t->li); if (!skiptop) { if (t->cl) { texec(t->cap, t->cl, 1, 0, 0, 0, 0); t->x = 0; t->y = 0; msetI(t->scrn, ' ', t->li * t->co); msetI(t->attr, 0, t->li * t->co); } else if (t->cd) { cpos(t, 0, 0); texec(t->cap, t->cd, 1, 0, 0, 0, 0); msetI(t->scrn, ' ', t->li * t->co); msetI(t->attr, 0, t->li * t->co); } } } /* Convert color/attribute name into internal code */ int meta_color(unsigned char *s) { if(!strcmp((char *)s,"inverse")) return INVERSE; else if(!strcmp((char *)s,"underline")) return UNDERLINE; else if(!strcmp((char *)s,"bold")) return BOLD; else if(!strcmp((char *)s,"blink")) return BLINK; else if(!strcmp((char *)s,"dim")) return DIM; else if(!strcmp((char *)s,"white")) return FG_WHITE; else if(!strcmp((char *)s,"cyan")) return FG_CYAN; else if(!strcmp((char *)s,"magenta")) return FG_MAGENTA; else if(!strcmp((char *)s,"blue")) return FG_BLUE; else if(!strcmp((char *)s,"yellow")) return FG_YELLOW; else if(!strcmp((char *)s,"green")) return FG_GREEN; else if(!strcmp((char *)s,"red")) return FG_RED; else if(!strcmp((char *)s,"black")) return FG_BLACK; else if(!strcmp((char *)s,"bg_white")) return BG_WHITE; else if(!strcmp((char *)s,"bg_cyan")) return BG_CYAN; else if(!strcmp((char *)s,"bg_magenta")) return BG_MAGENTA; else if(!strcmp((char *)s,"bg_blue")) return BG_BLUE; else if(!strcmp((char *)s,"bg_yellow")) return BG_YELLOW; else if(!strcmp((char *)s,"bg_green")) return BG_GREEN; else if(!strcmp((char *)s,"bg_red")) return BG_RED; else if(!strcmp((char *)s,"bg_black")) return BG_BLACK; else return 0; } /* Generate a field * * 't' is SCRN to write to. * 'scrn' is address of field in character buffer * 'attr' is address of field in attribute buffer * 'x', 'y' are starting column and line numbers of field * 'ofst' is first column within string to display * 's', 'len' is string to generate in field * 'atr' is screeen attributes (and color) which should be used * 'width' is column width of field * 'flg' if set, erases to end of line */ void genfield(SCRN *t,int *scrn,int *attr,int x,int y,int ofst,unsigned char *s,int len,int atr,int width,int flg,int *fmt) { int col; struct utf8_sm sm; int last_col = x + width; utf8_init(&sm); for (col = 0;len != 0 && x < last_col; len--) { int c = *s++; int wid = -1; int my_atr = atr; if (fmt) my_atr |= *fmt++; if (joe_maputf(locale_map)) { /* UTF-8 mode: decode character and determine its width */ c = utf8_decode(&sm,c); if (c >= 0) wid = joe_wcwidth(c); } else { /* Byte mode: character is one column wide */ wid = 1; } if (wid >= 0) { if (col >= ofst) { if (x + wid > last_col) { /* Character crosses end of field, so fill balance of field with '>' characters instead */ while (x < last_col) { outatr(utf8_map, t, scrn, attr, x, y, '>', my_atr); ++scrn; ++attr; ++x; } } else /* if (wid >(=) 0) */ { /* Emit character */ outatr(locale_map, t, scrn, attr, x, y, c, my_atr); x += wid; scrn += wid; attr += wid; } } else if ((col + wid) > ofst) { /* Wide character crosses left side of field */ wid -= ofst - col; col = ofst; while (wid) { outatr(utf8_map, t, scrn, attr, x, y, '<', my_atr); ++scrn; ++attr; ++x; ++col; --wid; } } else col += wid; } } /* Fill balance of field with spaces */ while (x < last_col) { outatr(utf8_map, t, scrn, attr, x, y, ' ', 0); ++x; ++scrn; ++attr; } /* Erase to end of line */ if (flg) eraeol(t, x, y); } /* Width function for above */ int txtwidth(unsigned char *s,int len) { if (joe_maputf(locale_map)) { int col=0; struct utf8_sm sm; utf8_init(&sm); while(len--) { int d = utf8_decode(&sm,*s++); if (d >= 0) col += joe_wcwidth(d); } return col; } else return len; } /* Generate text with formatting escape sequences */ void genfmt(SCRN *t, int x, int y, int ofst, const unsigned char *s, int flg) { int *scrn = t->scrn + y * t->co + x; int *attr = t->attr + y * t->co + x; int atr = 0; int col = 0; int c; struct utf8_sm sm; utf8_init(&sm); while ((c = *s++) != '\0') if (c == '\\') { switch ((c = *s++) | 0x20) { case 'u': atr ^= UNDERLINE; break; case 'i': atr ^= INVERSE; break; case 'b': atr ^= BOLD; break; case 'd': atr ^= DIM; break; case 'f': atr ^= BLINK; break; default: { if (!c) --s; else if (col++ >= ofst) { outatr(locale_map, t, scrn, attr, x, y, (c&0x7F), atr); ++scrn; ++attr; ++x; } break; } } } else { int wid = -1; if (joe_maputf(locale_map)) { /* UTF-8 mode: decode character and determine its width */ c = utf8_decode(&sm,c); if (c >= 0) { wid = joe_wcwidth(c); } } else { /* Byte mode: character is one column wide */ wid = 1; } if (wid >= 0) { if (col >= ofst) { outatr(locale_map, t, scrn, attr, x, y, c, atr); scrn += wid; attr += wid; x += wid; col += wid; } else if (col+wid>ofst) { while (col=0) wid = joe_wcwidth(c); } else { wid = 1; } col += wid; } } return col; } /* Return offset within format string which corresponds to a particular column */ /* FIXME: this is not valid if we land in the middle of a double-wide character */ int fmtpos(unsigned char *s, int goal) { unsigned char *org = s; int col = 0; int c; struct utf8_sm sm; utf8_init(&sm); while ((c= *s) && col=0) wid = joe_wcwidth(c); } else { wid = 1; } col += wid; } } return s - org + goal - col; } jupp/scrn.h010064400000000000000000000103671363731763500101260ustar00/* * device-independent TTY interface for JOE * Copyright * (C) 1992 Joseph H. Allen * * This file is part of JOE (Joe's Own Editor) */ #ifndef JUPP_SCRN_H #define JUPP_SCRN_H #ifdef EXTERN __IDSTRING(rcsid_scrn_h, "$MirOS: contrib/code/jupp/scrn.h,v 1.14 2020/03/27 06:38:58 tg Exp $"); #endif #include "tty.h" /* ttputc() */ extern int skiptop; /* SCRN *nopen(void); * * Open the screen (sets TTY mode so that screen may be used immediatly after * the 'nopen'). */ SCRN *nopen(CAP *cap); /* void nresize(SCRN *t,int w,int h); * * Change size of screen. For example, call this when you find out that * the Xterm changed size. */ void nresize(SCRN *t, int w, int h); /* void nredraw(SCRN *t); * * Invalidate all state variables for the terminal. This way, everything gets * redrawn. */ void nredraw(SCRN *t); void npartial(SCRN *t); void nescape(SCRN *t); void nreturn(SCRN *t); /* void nclose(SCRN *t); * * Close the screen and restore TTY to initial state. * * if 'flg' is set, tclose doesn't mess with the signals. */ void nclose(SCRN *t); /* int cpos(SCRN *t,int x,int y); * * Set cursor position */ int cpos(register SCRN *t, register int x, register int y); /* int attr(SCRN *t,int a); * * Set attributes */ int set_attr(SCRN *t, int c); /* Encode character as utf8 */ void utf8_putc(int c); /* void outatr(SCRN *t,int *scrn,int *attr,int x,int y,int c,int a); * * Output a character at the given screen cooridinate. The cursor position * after this function is executed is indeterminate. */ /* Character attribute bits */ #define INVERSE 256 #define UNDERLINE 512 #define BOLD 1024 #define BLINK 2048 #define DIM 4096 #define AT_MASK (INVERSE+UNDERLINE+BOLD+BLINK+DIM) #define BG_SHIFT 13 #define BG_VALUE (7< static int selinux_enabled = -1; #include #include #include #endif int copy_security_context(const char *from_file, const char *to_file) { int status = 0; #ifdef WITH_SELINUX char *from_context; char *to_context; if (selinux_enabled == -1) selinux_enabled = (is_selinux_enabled() > 0); if (!selinux_enabled) return 0; if (getfilecon(from_file, &from_context) < 0) { /* * If the filesystem doesn't support extended * attributes, the original had no special security * context and the target cannot have one either. */ if (errno == EOPNOTSUPP) return 0; warn("Could not get security context for %s", from_file); return 1; } if (getfilecon(to_file, &to_context) < 0) { warn("Could not get security context for %s", to_file); freecon(from_context); return 1; } if (strcmp(from_context, to_context) != 0) { if (setfilecon(to_file, from_context) < 0) { warn( "Could not set security context for %s", to_file); status = 1; } } freecon(to_context); freecon(from_context); #endif return status; } jupp/setup.inf010064400000000000000000000034531360301225300106210ustar00; Right-Click this and choose "_I_nstall" to install jupp! ; © 2006, 2009, 2010, 2011, 2012, 2016, 2017, 2019 ; by mirabilos ; see copying.txt and jupprc for legal [Version] Signature="$CHICAGO$" DriverVer=@ts@,3.1.@jwin@ [Strings] ; 24,%PROGRAMF% is likely the same as 16422, but it is not documented ; which versions this works on (just hope for the best); some systems ; have a wrong drive letter; Win95 does not support using LFNs here. PROGRAMF="PROGRA~1" [SourceDisksNames] 1="joe 3.1jupp@jwin@ Win32 installation floppy",, [SourceDisksFiles] @files@ [DefaultInstall] CopyFiles=jupp.Copy,jrc.Copy,jcm.Copy,jsy.Copy AddReg=jupp.AddReg,fopenas.AddReg MediaType=SOFTWARE [jupp.Copy] jupp32.exe jupp32.txt ; copies of jupp32.exe so the other *rc files are usable jmacs.exe,jupp32.exe joe.exe,jupp32.exe jpico.exe,jupp32.exe jstar.exe,jupp32.exe ; sources at: http://www.mirbsd.org/MirOS/dist/gnu/cygwin32/ cygwin1.dll [jrc.Copy] copying.txt jmacsrc joerc jpicorc jstarrc jupp32rc [jcm.Copy] klingon [jsy.Copy] asm.jsf c.jsf conf.jsf csh.jsf diff.jsf fortran.jsf html.jsf java.jsf lisp.jsf mail.jsf mason.jsf pascal.jsf perl.jsf php.jsf python.jsf sh.jsf tcl.jsf tex.jsf verilog.jsf vhdl.jsf xml.jsf [jupp.AddReg] HKCR,"*\shell\jupp","",,"&jupp" HKCR,"*\shell\jupp","Version",,"jupp 3.1.@jwin@ (i486)" HKCR,"*\shell\jupp\command","",,"%24%\%PROGRAMF%\jupp32\jupp32.exe -CYGhack %L" [fopenas.AddReg] HKCR,"*\shell\fopenas","",,"&Load with..." HKCR,"*\shell\fopenas\command","",,"rundll32 shell32,OpenAs_RunDLL %1" [DestinationDirs] DefaultDestDir=24,%PROGRAMF%\jupp32 jcm.Copy=24,%PROGRAMF%\jupp32\charmaps jsy.Copy=24,%PROGRAMF%\jupp32\syntax ; $MirOS: contrib/code/jupp/setup.inf,v 1.9 2020/01/01 03:40:00 tg Exp $ jupp/strlfun.inc010064400000000000000000000126441372504413500111660ustar00#if 0 /* comment in gmake; next line ignored by gcc */ ifeq (0,gmake ignores from here) #endif /*- * Copyright (c) 2006, 2008, 2011 * mirabilos * * Provided that these terms and disclaimer and all copyright notices * are retained or reproduced in an accompanying document, permission * is granted to deal in this work without restriction, including un- * limited rights to use, publicly perform, distribute, sell, modify, * merge, give away, or sublicence. * * This work is provided "AS IS" and WITHOUT WARRANTY of any kind, to * the utmost extent permitted by applicable law, neither express nor * implied; without malicious intent or gross negligence. In no event * may a licensor, author or contributor be held liable for indirect, * direct, other damage, loss, or other issues arising in any way out * of dealing in the work, even if advised of the possibility of such * damage or existence of a defect, except proven that it results out * of said person's immediate fault when using the work as intended. *- * The original implementations of strlcpy(3) and strlcat(3) are from * Todd C. Miller; its licence is reproduced in the L_strlcpy part as * it applies to only that now; mirabilos rewrote strlcat from specs, * optimised both from suggestions by Bodo Eggert, aliased strlcpy as * just-copying strxfrm(3) and introduced wcslcat(3), wcslcpy(3) and, * symmetrically, wcsxfrm(3) as wide character variants. */ #include #if defined(MBSDPORT_H) #include MBSDPORT_H #elif !defined(OUTSIDE_OF_LIBKERN) #include #endif #ifndef __RCSID #define __RCSID(x) /* fallback */ static const char __rcsid[] = x #endif __RCSID("$MirOS: contrib/code/jupp/strlfun.inc,v 1.9 2020/09/06 02:24:02 tg Exp $"); #ifdef WIDEC #if defined(MBSDPORT_H) || defined(OUTSIDE_OF_LIBKERN) #ifdef __WCHAR_TYPE__ typedef __WCHAR_TYPE__ wchar_t; #else #include #endif #endif /* wide character string functions */ #define NUL L'\0' #define char_t wchar_t #define fn_len wcslen #define fn_cat wcslcat #define fn_cpy wcslcpy #else /* (multibyte) string functions */ #define NUL '\0' #define char_t char #define fn_len strlen #define fn_cat strlcat #define fn_cpy strlcpy #endif #ifdef L_strxfrm #define strlcpy strxfrm #define wcslcpy wcsxfrm #define L_strlcpy #endif #if defined(MBSDPORT_H) || defined(OUTSIDE_OF_LIBKERN) extern size_t fn_len(const char_t *); #ifdef NEED_STRLFUN_PROTOS size_t fn_cat(char_t *, const char_t *, size_t); size_t fn_cpy(char_t *, const char_t *, size_t); #endif #endif #ifndef __predict_true #define __predict_true(exp) (exp) #define __predict_false(exp) (exp) #endif #ifdef L_strlcat /* * Appends src to string dst of size dlen (unlike strncat, dlen is the * full size of dst, not space left). At most dlen-1 characters * will be copied. Always NUL terminates (unless dlen <= strlen(dst)). * Returns strlen(src) + MIN(dlen, strlen(initial dst)), without the * trailing NUL byte counted. If retval >= dlen, truncation occurred. */ size_t fn_cat(char_t *dst, const char_t *src, size_t dlen) { size_t n = 0, slen; slen = fn_len(src); while (__predict_true(n + 1 < dlen && dst[n] != NUL)) ++n; if (__predict_false(dlen == 0 || dst[n] != NUL)) return (dlen + slen); while (__predict_true((slen > 0) && (n < (dlen - 1)))) { dst[n++] = *src++; --slen; } dst[n] = NUL; return (n + slen); } #endif #ifdef L_strlcpy /* $OpenBSD: strlcpy.c,v 1.11 2006/05/05 15:27:38 millert Exp $ */ /*- * Copyright (c) 1998 Todd C. Miller * * Permission to use, copy, modify, and distribute this software for any * purpose with or without fee is hereby granted, provided that the above * copyright notice and this permission notice appear in all copies. * * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. */ /* * Copy src to string dst of size siz. At most siz-1 characters * will be copied. Always NUL terminates (unless siz == 0). * Returns strlen(src); if retval >= siz, truncation occurred. */ size_t fn_cpy(char_t *dst, const char_t *src, size_t siz) { const char_t *s = src; if (__predict_false(siz == 0)) goto traverse_src; /* copy as many chars as will fit */ while (--siz && (*dst++ = *s++)) ; /* not enough room in dst */ if (__predict_false(siz == 0)) { /* safe to NUL-terminate dst since we copied <= siz-1 chars */ *dst = NUL; traverse_src: /* traverse rest of src */ while (*s++) ; } /* count does not include NUL */ return (s - src - 1); } #endif #if 0 /* gcc ignored from here; gmake stops ignoring */ endif USE_WIDEC?= 1 LIB= libstrlfun.a OBJS= strlcpy.o strlcat.o ifeq (1,$(strip $(USE_WIDEC))) OBJS+= wcslcpy.o wcslcat.o endif DEFS= -DOUTSIDE_OF_LIBKERN DEFS_strlcpy.o= -DL_strlcpy DEFS_strlcat.o= -DL_strlcat DEFS_wcslcpy.o= -DL_strlcpy -DWIDEC DEFS_wcslcat.o= -DL_strlcat -DWIDEC all: $(LIB) $(LIB): $(OBJS) ar rc $(LIB) $(OBJS) -ranlib $(LIB) $(OBJS): strlfun.c $(CC) $(CFLAGS) $(CPPFLAGS) $(DEFS) $(DEFS_$@) -c -o $@ strlfun.c #endif /* EOF for gmake and gcc */ jupp/syntax.c010064400000000000000000000306511363731415300104700ustar00/* * Syntax highlighting DFA interpreter * Copyright * (C) 2004 Joseph H. Allen * * This file is part of JOE (Joe's Own Editor) */ #include "config.h" #include "types.h" __RCSID("$MirOS: contrib/code/jupp/syntax.c,v 1.26 2020/03/27 06:08:16 tg Exp $"); #include #include #include "b.h" #include "scrn.h" #include "utils.h" #include "hash.h" #include "path.h" #include "charmap.h" #include "syntax.h" static struct { unsigned char buf[7]; unsigned char start; unsigned char limit; unsigned eaten : 1; unsigned ebbed : 1; unsigned unget : 1; unsigned first : 1; } utfstate; static int utfoctet(P *p) { int c; utfstate.first = 0; if (utfstate.eaten) { ate: if (utfstate.start < utfstate.limit) return (utfstate.buf[utfstate.start++]); if (utfstate.ebbed) return (NO_MORE_DATA); utfstate.eaten = utfstate.limit = 0; } if (!utfstate.limit) { utfstate.first = 1; if (utfstate.unget) { c = utfstate.buf[utfstate.start]; utfstate.unget = 0; } else c = pgetb(p); if ((c == NO_MORE_DATA) || (c < 0x80)) return (c); if ((c < 0xC2) || (c >= 0xFE)) return (0xFF); utfstate.start = 0; utfstate.buf[utfstate.start++] = (unsigned char)c; utfstate.limit = (c < 0xE0) ? 2 : (c < 0xF0) ? 3 : (c < 0xF8) ? 4 : (c < 0xFC) ? 5 : 6; } while (utfstate.start < utfstate.limit) { if (((c = pgetb(p)) == NO_MORE_DATA) || ((c ^ 0x80) > 0x3F)) { /* invalid follow byte, invalidate all previous ones */ utfstate.limit = 0; while (utfstate.limit < utfstate.start) utfstate.buf[utfstate.limit++] = 0xFF; /* append this as ungetch unless the well is dry */ if (c == NO_MORE_DATA) utfstate.ebbed = 1; else { utfstate.buf[utfstate.limit] = (unsigned char)c; utfstate.unget = 1; } /* now return those bytes */ break; } utfstate.buf[utfstate.start++] = (unsigned char)c; } utfstate.start = 0; utfstate.eaten = 1; goto ate; } static int octetutf(P *p) { int c; utfstate.first = 0; if (!(utfstate.start < utfstate.limit)) { if ((c = pgetb(p)) == NO_MORE_DATA) return (NO_MORE_DATA); utfstate.limit = utf8_encode(utfstate.buf, joe_to_uni(p->b->o.charmap, c)); utfstate.start = 0; utfstate.first = 1; } return (utfstate.buf[utfstate.start++]); } /* Parse one line. Returns new state. 'syntax' is the loaded syntax definition for this buffer. 'line' is advanced to start of next line. Global array 'attr_buf' end up with coloring for each character of line. 'state' is initial parser state for the line (0 is initial state). */ int *attr_buf = 0; int attr_size = 0; int parse(struct high_syntax *syntax, P *line, int state) { struct high_state *h = syntax->states[state]; /* Current state */ unsigned char buf[20]; /* Name buffer (trunc after 19 characters) */ int buf_idx = 0; /* Index into buffer */ int buf_len = 0; /* counts only starting characters */ int buf_en = 0; /* Set for name buffering */ int *attr_end = attr_buf+attr_size; int *attr = attr_buf; int c; /* Current character */ int ofst = 0; /* record length after we've stopped buffering */ int (*getoctet)(P *) = joe_maputf(line->b->o.charmap) ? utfoctet : octetutf; memset(&utfstate, 0, sizeof(utfstate)); buf[0] = 0; /* Get next character */ while((c = getoctet(line)) != NO_MORE_DATA) { struct high_cmd *cmd, *kw_cmd; int x; /* Expand attribute array if necessary */ if(attr==attr_end) { attr_buf = realloc(attr_buf, sizeof(int) * (attr_size * 2)); attr = attr_buf + attr_size; attr_size *= 2; attr_end = attr_buf + attr_size; } /* Advance to next attribute position (note attr[-1] below) */ if (utfstate.first) attr++; /* Loop while noeat */ do { /* Color with current state */ attr[-1] = h->color; /* Get command for this character */ cmd = h->cmd[c]; /* Determine new state */ if (cmd->keywords && (cmd->ignore ? (kw_cmd = htfind(cmd->keywords, joe_strtolower(buf))) : (kw_cmd = htfind(cmd->keywords, buf)))) { cmd = kw_cmd; h = cmd->new_state; /* Recolor keyword */ for (x = -(buf_len + 1); x < -1; ++x) attr[x - ofst] = h->color; } else { h = cmd->new_state; } /* Recolor if necessary */ x = cmd->recolor; while (&attr[x] < attr_buf) ++x; while (x < 0) attr[x++] = h->color; /* Start buffering? */ if (cmd->start_buffering) { buf_idx = 0; buf_len = 0; buf_en = 1; ofst = 0; } /* Stop buffering? */ if (cmd->stop_buffering) buf_en = 0; } while(cmd->noeat); /* Save character in buffer */ if (!buf_en) ofst += utfstate.first; else if (buf_idx < 19) { buf[buf_idx++] = c; buf[buf_idx] = 0; buf_len += utfstate.first; } if (c == '\n') break; } /* Return new state number */ return h->no; } /* Subroutines for load_dfa() */ static struct high_state *find_state(struct high_syntax *syntax, const unsigned char *name) { int x; struct high_state *state; /* Find state */ for(x=0;x!=syntax->nstates;++x) if(!strcmp(syntax->states[x]->name,name)) break; /* It doesn't exist, so create it */ if(x==syntax->nstates) { int y; state = malloc(sizeof(struct high_state)); state->name=(const unsigned char *)strdup((const char *)name); state->no=syntax->nstates; state->color=FG_WHITE; if(!syntax->nstates) /* We're the first state */ syntax->default_cmd.new_state = state; if(syntax->nstates==syntax->szstates) syntax->states = realloc(syntax->states, sizeof(struct high_state *) * (syntax->szstates *= 2)); syntax->states[syntax->nstates++]=state; for(y=0; y!=256; ++y) state->cmd[y] = &syntax->default_cmd; } else state = syntax->states[x]; return state; } /* Load syntax file */ struct high_syntax *syntax_list; struct high_syntax *load_dfa(const unsigned char *name) { unsigned char buf[1024]; unsigned char bf[256]; unsigned char bf1[256]; int clist[256]; unsigned char *p; int c; FILE *f = NULL; struct high_state *state=0; /* Current state */ struct high_syntax *syntax; /* New syntax table */ int line = 0; void *np; if (!name) return NULL; if (!attr_buf) attr_buf = ralloc((size_t)(attr_size = 1024), sizeof(int)); /* Find syntax table */ /* Already loaded? */ for(syntax=syntax_list;syntax;syntax=syntax->next) if(!strcmp(syntax->name,name)) return syntax; /* Load it */ p = (unsigned char *)getenv("HOME"); if (p) { joe_snprintf_2((char *)buf,sizeof(buf),"%s/.jupp/syntax/%s.jsf",p,name); f = fopen((char *)buf,"r"); } if (!f && has_JOERC) { joe_snprintf_2((char *)buf,sizeof(buf),"%ssyntax/%s.jsf",get_JOERC,name); f = fopen((char *)buf,"r"); } if(!f) return 0; /* Create new one */ syntax = calloc(1, sizeof(struct high_syntax)); syntax->name = (const unsigned char *)strdup((const char *)name); syntax->next = syntax_list; syntax_list = syntax; syntax->states = ralloc((size_t)(syntax->szstates = 64), sizeof(struct high_state *)); syntax->sync_lines = 120; memset(clist, 0, sizeof(clist)); /* Parse file */ while(fgets((char *)buf,1023,f)) { ++line; p = buf; parse_ws(&p,'#'); if(!parse_char(&p, ':')) { if(!parse_ident(&p, bf, 255)) { state = find_state(syntax,bf); parse_ws(&p,'#'); if(!parse_ident(&p,bf,255)) { struct high_color *color; for(color=syntax->color;color;color=color->next) if(!strcmp(color->name,bf)) break; if(color) state->color=color->color; else { state->color=0; fprintf(stderr,"%s:%d: Unknown class '%s'\n", name, line, bf); } } else fprintf(stderr,"%s:%d: Missing color for state definition\n", name, line); } else fprintf(stderr,"%s:%d: Missing state name\n", name, line); } else if(!parse_char(&p, '=')) { if(!parse_ident(&p, bf, 255)) { struct high_color *color; /* Find color */ for(color=syntax->color;color;color=color->next) if(!strcmp(color->name,bf)) break; /* If it doesn't exist, create it */ if(!color) { color = calloc(1, sizeof(struct high_color)); color->name = (unsigned char *)strdup((char *)bf); color->next = syntax->color; syntax->color = color; } else { fprintf(stderr,"%s:%d: Class '%s' already defined\n", name, line, bf); } /* Parse color definition */ while(parse_ws(&p,'#'), !parse_ident(&p,bf,255)) { color->color |= meta_color(bf); } } } else if(!parse_char(&p, '-')) { /* No. sync lines */ syntax->sync_lines = (int)ustolb(p, &np, INT_MIN, INT_MAX, USTOL_TRIM); if (!np) syntax->sync_lines = -1; else p = np; } else { c = parse_ws(&p,'#'); if (!c) { } else if (c=='"' || c=='*') { if (state) { if (!parse_field(&p, UC "*")) { int z; for(z=0;z!=256;++z) clist[z] = 1; } else { c = parse_string(&p, bf, 255); if(c) fprintf(stderr,"%s:%d: Bad string\n", name, line); else { int z; int first, second; unsigned char *t = bf; for(z=0;z!=256;++z) clist[z] = 0; while(!parse_range(&t, &first, &second)) { if(first>second) second = first; while(first<=second) clist[first++] = 1; } } } /* Create command */ parse_ws(&p,'#'); if(!parse_ident(&p,bf,255)) { struct high_cmd *cmd = calloc(1, sizeof(struct high_cmd)); int z; cmd->new_state = find_state(syntax,bf); /* Parse options */ while (parse_ws(&p,'#'), !parse_ident(&p,bf,255)) if(!strcmp(bf,"buffer")) { cmd->start_buffering = 1; } else if(!strcmp(bf,"hold")) { cmd->stop_buffering = 1; } else if(!strcmp(bf,"recolor")) { parse_ws(&p,'#'); if(!parse_char(&p,'=')) { parse_ws(&p,'#'); cmd->recolor = (int)ustolb(p, &np, INT_MIN, INT_MAX, USTOL_TRIM); if (!np) fprintf(stderr,"%s:%d: Missing value for option %s\n", name, line, bf); else p = np; } else fprintf(stderr,"%s:%d: Missing value for option %s\n", name, line, bf); } else if(!strcmp(bf,"strings") || !strcmp(bf,"istrings")) { if (bf[0]=='i') cmd->ignore = 1; while(fgets((char *)buf,1023,f)) { ++line; p = buf; parse_ws(&p,'#'); if (*p) { if (!parse_field(&p, UC "done")) break; if(!parse_string(&p,bf,255)) { parse_ws(&p,'#'); if (cmd->ignore) joe_strtolower(bf); if(!parse_ident(&p,bf1,255)) { struct high_cmd *kw_cmd = calloc(1, sizeof(struct high_cmd)); kw_cmd->noeat=1; kw_cmd->new_state = find_state(syntax,bf1); if(!cmd->keywords) cmd->keywords = htmk(64); htadd(cmd->keywords,(unsigned char *)strdup((char *)bf),kw_cmd); while (parse_ws(&p,'#'), !parse_ident(&p,bf,255)) if(!strcmp(bf,"buffer")) { kw_cmd->start_buffering = 1; } else if(!strcmp(bf,"hold")) { kw_cmd->stop_buffering = 1; } else if(!strcmp(bf,"recolor")) { parse_ws(&p,'#'); if(!parse_char(&p,'=')) { parse_ws(&p,'#'); kw_cmd->recolor = (int)ustolb(p, &np, INT_MIN, INT_MAX, USTOL_TRIM); if (!np) fprintf(stderr,"%s:%d: Missing value for option %s\n", name, line, bf); else p = np; } else fprintf(stderr,"%s:%d: Missing value for option %s\n", name, line, bf); } else fprintf(stderr,"%s:%d: Unknown option '%s'\n", name, line, bf); } else fprintf(stderr,"%s:%d: Missing state name\n", name, line); } else fprintf(stderr,"%s:%d: Missing string\n", name, line); } } } else if(!strcmp(bf,"noeat")) { cmd->noeat = 1; } else if(!strcmp(bf,"mark")) { /* not implemented yet */ ; } else if(!strcmp(bf,"markend")) { /* not implemented yet */ ; } else if(!strcmp(bf,"recolormark")) { /* not implemented yet */ ; } else fprintf(stderr,"%s:%d: Unknown option '%s'\n", name, line, bf); /* Install command */ for(z=0;z!=256;++z) if(clist[z]) state->cmd[z]=cmd; } else fprintf(stderr,"%s:%d: Missing jump\n", name, line); } else fprintf(stderr,"%s:%d: No state\n", name, line); } else fprintf(stderr,"%s:%d: Unknown character\n", name, line); } } fclose(f); return syntax; } jupp/syntax.h010064400000000000000000000036731363731763500105110ustar00/* * Syntax highlighting DFA interpreter * Copyright * (C) 2004 Joseph H. Allen * * This file is part of JOE (Joe's Own Editor) */ #ifndef JUPP_SYNTAX_H #define JUPP_SYNTAX_H #ifdef EXTERN __IDSTRING(rcsid_syntax_h, "$MirOS: contrib/code/jupp/syntax.h,v 1.6 2020/03/27 06:38:58 tg Exp $"); #endif #include "hash.h" /* Color definition */ struct high_color { struct high_color *next; const unsigned char *name; /* Symbolic name of color */ int color; /* Color value */ }; /* State */ struct high_state { int no; /* State number */ const unsigned char *name; /* Highlight state name */ int color; /* Color for this state */ struct high_cmd *cmd[256]; /* Character table */ }; /* Command (transition) */ struct high_cmd { struct high_state *new_state; /* The new state */ HASH *keywords; /* Hash table of keywords */ int recolor; /* No. chars to recolor if <0. */ unsigned noeat : 1; /* Set to give this character to next state */ unsigned start_buffering : 1; /* Set if we should start buffering */ unsigned stop_buffering : 1; /* Set if we should stop buffering */ unsigned ignore : 1; /* Set to ignore case */ }; /* Loaded form of syntax file */ struct high_syntax { struct high_syntax *next; /* Linked list of loaded syntaxes */ const unsigned char *name; /* Name of this syntax */ struct high_state **states; /* The states of this syntax. states[0] is idle state */ int nstates; /* No. states */ int szstates; /* Malloc size of states array */ struct high_color *color; /* Linked list of color definitions */ int sync_lines; /* No. lines back to start parsing when we lose sync. -1 means start at beginning */ struct high_cmd default_cmd; /* Default transition for new states */ }; /* Find a syntax. Load it if necessary. */ struct high_syntax *load_dfa(const unsigned char *name); /* Parse a lines. Returns new state. */ extern int *attr_buf; int parse(struct high_syntax *syntax, P *line, int state); #endif jupp/tab.c010064400000000000000000000210041337207074500077020ustar00/* * File selection menu * Copyright * (C) 1992 Joseph H. Allen * * This file is part of JOE (Joe's Own Editor) */ #include "config.h" #include "types.h" __RCSID("$MirOS: contrib/code/jupp/tab.c,v 1.14 2018/11/11 18:15:38 tg Exp $"); #include #include #include "b.h" #include "blocks.h" #include "menu.h" #include "path.h" #include "tab.h" #include "tty.h" #include "utils.h" #include "va.h" #include "w.h" typedef struct tab TAB; extern int smode; /* ??? */ extern int dobeep; int menu_explorer = 0; /* Stay in menu system when directory selected */ struct tab { int first_len; /* Original size of path */ int ofst; /* Starting offset to path */ unsigned char *path; /* current directory */ unsigned char *pattern; /* search pattern */ int len; /* no. entries in files */ unsigned char **files; /* array of file names */ unsigned char **list; unsigned char *type; /* file type array */ int prv; unsigned char *orgpath; unsigned char *orgnam; }; #define F_DIR 1 /* type codes for file type array */ #define F_NORMAL 2 #define F_EXEC 4 /* Read matching files from a directory * Directory is given in tab.path * Pattern is given in tab.pattern * * Returns with -1 if there was an error * Otherwise returns index to file with inode given in prv * len and files are set with the file names * type is set with the file types */ static int get_entries(TAB *tab, int prv) { int a; int which = 0; unsigned char *oldpwd = pwd(); unsigned char **files; if (chpwd(tab->path)) return -1; files = rexpnd(tab->pattern); if (!files) { chpwd(oldpwd); return -1; } tab->len = aLEN(files); varm(tab->files); tab->files = files; vasort(files, tab->len); if (tab->type) free(tab->type); tab->type = malloc(tab->len); for (a = 0; a != tab->len; a++) { struct stat buf; if (stat((char *)(files[a]), &buf)) { tab->type[a] = 0; continue; } if ((int)buf.st_ino == prv) which = a; if ((buf.st_mode & S_IFMT) == S_IFDIR) tab->type[a] = F_DIR; else if (buf.st_mode & (0100 | 0010 | 0001)) tab->type[a] = F_EXEC; else tab->type[a] = F_NORMAL; } chpwd(oldpwd); return which; } static void insnam(BW *bw, unsigned char *path, unsigned char *nam, int dir, int ofst) { P *p = pdup(bw->cursor); pgoto(p, ofst); p_goto_eol(bw->cursor); bdel(p, bw->cursor); if (sLEN(path)) { binsm(bw->cursor, sv(path)); p_goto_eol(bw->cursor); if (path[sLEN(path) - 1] != '/') { binsm(bw->cursor, sc("/")); p_goto_eol(bw->cursor); } } binsm(bw->cursor, sv(nam)); p_goto_eol(bw->cursor); if (dir) { binsm(bw->cursor, sc("/")); p_goto_eol(bw->cursor); } prm(p); bw->cursor->xcol = piscol(bw->cursor); } /* Given a menu structure with a tab structure as its object, * a pattern and path set in the tab structure: * * Load the menu with a list of file names and set the file name in * the prompt window to the directory the menu was read in from. * If flg is set, treload attempts to position to the previous directory * which was visited. * * Returns with -1 if there was an error * Returns with 0 for success */ static unsigned char **treload(TAB *tab,MENU *m, BW *bw, int flg,int *defer) { int x; int which; struct stat buf; if ((which = get_entries(tab, tab->prv)) < 0) return 0; tab->prv = stat((tab->path && tab->path[0]) ? (char *)tab->path : ".", &buf) ? 0 : buf.st_ino; if (!flg) which = 0; tab->list = vatrunc(tab->list, aLEN(tab->files)); for (x = 0; tab->files[x]; ++x) { unsigned char *s = vsncpy(NULL, 0, sv(tab->files[x])); tab->list = vaset(tab->list, x, s); if (tab->type[x] == F_DIR) tab->list[x] = vsadd(tab->list[x], '/'); else if (tab->type[x] == F_EXEC) tab->list[x] = vsadd(tab->list[x], '*'); } if (defer) { *defer = which; insnam(bw, tab->path, tab->pattern, 0, tab->ofst); return tab->list; } else { ldmenu(m, tab->list, which); insnam(bw, tab->path, tab->pattern, 0, tab->ofst); return tab->list; } } static void rmtab(TAB *tab) { vsrm(tab->orgpath); vsrm(tab->orgnam); varm(tab->list); vsrm(tab->path); vsrm(tab->pattern); varm(tab->files); if (tab->type) free(tab->type); free(tab); } /*****************************************************************************/ /****************** The user hit return **************************************/ /*****************************************************************************/ static int tabrtn(MENU *m, int cursor, TAB *tab) { if (menu_explorer && tab->type[cursor] == F_DIR) { /* Switch directories */ unsigned char *orgpath = tab->path; unsigned char *orgpattern = tab->pattern; unsigned char *e = endprt(tab->path); /* if (!strcmp(tab->files[cursor], "..") && sLEN(e) && !(e[0] == '.' && e[1] == '.' && (!e[2] || e[2] == '/'))) tab->path = begprt(tab->path); else */ { tab->path = vsncpy(NULL, 0, sv(tab->path)); tab->path = vsncpy(sv(tab->path), sv(m->list[cursor])); } vsrm(e); tab->pattern = vsncpy(NULL, 0, sc("*")); if (!treload(m->object, m, m->parent->win->object.bw, 0, NULL)) { msgnw(m->parent, UC "Couldn't read directory "); vsrm(tab->pattern); tab->pattern = orgpattern; vsrm(tab->path); tab->path = orgpath; return -1; } else { vsrm(orgpattern); vsrm(orgpath); return 0; } } else { /* Select name */ BW *bw = m->parent->win->object.bw; insnam(bw, tab->path, tab->files[cursor], (tab->type[cursor]==F_DIR), tab->ofst); rmtab(tab); m->object = NULL; m->abrt = NULL; wabort(m->parent); return 0; } } /* Like above, but treats directories as files (adds them to path instead of * traverse hierarchy) */ static int tabrtn1(MENU *m, int cursor, TAB *tab) { /* New way: just add directory to path */ BW *bw = m->parent->win->object.bw; insnam(bw, tab->path, tab->files[cursor], (tab->type[cursor]==F_DIR ? 1 : 0), tab->ofst); rmtab(tab); m->object = NULL; m->abrt = NULL; wabort(m->parent); return 0; } /*****************************************************************************/ /****************** The user hit backspace ***********************************/ /*****************************************************************************/ static int tabbacks(MENU *m, int cursor, TAB *tab) { unsigned char *orgpath = tab->path; unsigned char *orgpattern = tab->pattern; unsigned char *e = endprt(tab->path); if (sLEN(e) && sLEN(tab->path)!=tab->first_len) tab->path = begprt(tab->path); else { wabort(m->parent); return 0; } vsrm(e); tab->pattern = vsncpy(NULL, 0, sc("*")); if (!treload(m->object, m, m->parent->win->object.bw, 1, NULL)) { msgnw(m->parent, UC "Couldn't read directory "); vsrm(tab->pattern); tab->pattern = orgpattern; vsrm(tab->path); tab->path = orgpath; return -1; } else { vsrm(orgpattern); vsrm(orgpath); return 0; } } /*****************************************************************************/ static int tababrt(BW *bw, int cursor, TAB *tab) { insnam(bw, tab->orgpath, tab->orgnam, 0, tab->ofst); rmtab(tab); return -1; } static void p_goto_start_of_path(P *p) { while (/* CONSTCOND */ 1) switch (prgetc(p)) { case '\n': pgetc(p); /* FALLTHROUGH */ case NO_MORE_DATA: return; } } /*****************************************************************************/ /****************** Create a tab window **************************************/ /*****************************************************************************/ int cmplt(BW *bw) { MENU *new; TAB *tab; P *p, *q; unsigned char *cline, *tmp; long a, b; int which; unsigned char **l; int ofst; tab = malloc(sizeof(TAB)); tab->files = NULL; tab->type = NULL; tab->list = NULL; tab->prv = 0; tab->len = 0; q = pdup(bw->cursor); p_goto_eol(q); p = pdup(q); p_goto_start_of_path(p); ofst = p->byte; tmp = brvs(p, (int) (q->byte - p->byte)); cline = parsens(tmp, &a, &b); vsrm(tmp); prm(p); prm(q); tab->ofst = ofst; tab->pattern = namprt(cline); tab->path = dirprt(cline); tab->first_len = sLEN(tab->path); tab->orgnam = vsncpy(NULL, 0, sv(tab->pattern)); tab->orgpath = vsncpy(NULL, 0, sv(tab->path)); tab->pattern = vsadd(tab->pattern, '*'); vsrm(cline); l = treload(tab, 0, bw, 0, &which); if (l && (new = mkmenu(bw->parent, l, tabrtn, tababrt, tabbacks, which, tab, NULL))) { if (sLEN(tab->files) == 1) return tabrtn1(new, 0, tab); else if (smode || isreg(tab->orgnam)) return 0; else { unsigned char *com = mcomplete(new); vsrm(tab->orgnam); tab->orgnam = com; wabort(new->parent); smode = 2; /* if(dobeep) */ ttputc(7); return 0; } } else { /* if(dobeep) */ ttputc(7); rmtab(tab); return -1; } } jupp/tab.h010064400000000000000000000004711363731763500077220ustar00/* * File selection menu * Copyright * (C) 1992 Joseph H. Allen * * This file is part of JOE (Joe's Own Editor) */ #ifndef JUPP_TAB_H #define JUPP_TAB_H #ifdef EXTERN_UFILE_C __IDSTRING(rcsid_tab_h, "$MirOS: contrib/code/jupp/tab.h,v 1.6 2020/03/27 06:38:58 tg Exp $"); #endif int cmplt(BW *bw); #endif jupp/termcap.c010064400000000000000000000324001426610112100105530ustar00/* * TERMCAP/TERMINFO database interface * Copyright * (C) 1992 Joseph H. Allen * * This file is part of JOE (Joe's Own Editor) */ #include "config.h" #include "types.h" __RCSID("$MirOS: contrib/code/jupp/termcap.c,v 1.29 2022/07/20 22:31:18 tg Exp $"); #include #include #include "blocks.h" #include "path.h" #include "termcap.h" #include "utils.h" #include "va.h" #include "vs.h" int dopadding = 0; unsigned char *joeterm = NULL; /* Default termcap entry */ static const unsigned char defentry[] = "\ :co#80:li#25:am:\ :ho=\\E[H:cm=\\E[%i%d;%dH:cV=\\E[%i%dH:\ :up=\\E[A:UP=\\E[%dA:DO=\\E[%dB:nd=\\E[C:RI=\\E[%dC:LE=\\E[%dD:\ :cd=\\E[J:ce=\\E[K:cl=\\E[H\\E[J:\ :so=\\E[7m:se=\\E[m:us=\\E[4m:ue=\\E[m:\ :mb=\\E[5m:md=\\E[1m:mh=\\E[2m:me=\\E[m:\ :ku=\\E[A:kd=\\E[B:kl=\\E[D:kr=\\E[C:\ :al=\\E[L:AL=\\E[%dL:dl=\\E[M:DL=\\E[%dM:\ :ic=\\E[@:IC=\\E[%d@:dc=\\E[P:DC=\\E[%dP:\ "; /* Return true if termcap line matches name */ static int match(const unsigned char *s, const unsigned char *name) { if (s[0] == 0 || s[0] == '#') return 0; do { int x; for (x = 0; s[x] == name[x] && name[x] && s[x]; ++x) ; if (name[x] == 0 && (s[x] == ':' || s[x] == '|')) return 1; while (s[x] != ':' && s[x] != '|' && s[x]) ++x; s += x + 1; } while (s[-1] == '|'); return 0; } /* Find termcap entry in a file */ static unsigned char * lfind(unsigned char *s, int pos, FILE *fd, const unsigned char *name) { int c, x; if (!s) s = vsmk(1024); loop: while (c = getc(fd), c == ' ' || c == '\t' || c == '#') do { c = getc(fd); } while (c != -1 && c != '\n'); if (c == -1) return s = vstrunc(s, pos); ungetc(c, fd); s = vstrunc(s, x = pos); while (1) { c = getc(fd); if (c == -1 || c == '\n') if (x != pos && s[x - 1] == '\\') { --x; if (!match(s + pos, name)) goto loop; else break; } else if (!match(s + pos, name)) goto loop; else return vstrunc(s, x); else if (c == '\r') /* nothing */; else { s = vsset(s, x, c); ++x; } } while (c = getc(fd), c != -1) if (c == '\n') if (s[x - 1] == '\\') --x; else break; else if (c == '\r') /* nothing */; else { s = vsset(s, x, c); ++x; } s = vstrunc(s, x); return s; } /* Lookup termcap entry in index */ static off_t findidx(FILE *file, const unsigned char *name) { unsigned char buf[80]; off_t addr = 0; while (fgets((char *)buf, 80, file)) { int x = 0, flg = 0, c, y; do { for (y = x; buf[y] && buf[y] != ' ' && buf[y] != '\n'; ++y) ; c = buf[y]; buf[y] = 0; if (c == '\n' || !c) addr += ustol(buf + x, NULL, USTOL_HEX); else if (!strcmp(buf + x, name)) flg = 1; x = y + 1; } while (c && c != '\n'); if (flg) return addr; } return 0; } /* Load termcap entry */ CAP * getcap(unsigned char *name, unsigned int baud, int (*out)(int)) { CAP *cap; FILE *f, *f1; off_t idx; int x, y, c, z, ti; unsigned char *tp, *pp, *qq, *namebuf, **npbuf, *idxname; int sortsiz; if (!name && !(name = joeterm) && !(name = (unsigned char *)getenv("TERM"))) return NULL; cap = malloc(sizeof(CAP)); cap->tbuf = vsmk(4096); cap->abuf = NULL; cap->sort = NULL; cap->paste_on = NULL; cap->paste_off = NULL; if (!strcmp(name, "xterm-xfree86")) { cap->paste_on = "\033[?2004h"; cap->paste_off = "\033[?2004l"; } #ifdef TERMINFO cap->abuf = malloc(4096); cap->abufp = cap->abuf; if (tgetent((char *)cap->tbuf, (char *)name) == 1) return setcap(cap, baud, out); else { free(cap->abuf); cap->abuf = NULL; } #endif name = vsncpy(NULL, 0, sz(name)); cap->sort = malloc(sizeof(struct sortentry) * (sortsiz = 64)); cap->sortlen = 0; tp = (unsigned char *)getenv("TERMCAP"); if (tp && tp[0] == '/') namebuf = vsncpy(NULL, 0, sz(tp)); else { if (tp) cap->tbuf = vsncpy(sv(cap->tbuf), sz(tp)); if ((tp = (unsigned char *)getenv("TERMPATH"))) namebuf = vsncpy(NULL, 0, sz(tp)); else { if ((tp = (unsigned char *)getenv("HOME"))) { namebuf = vsncpy(NULL, 0, sz(tp)); namebuf = vsadd(namebuf, '/'); } else namebuf = NULL; namebuf = vsncpy(sv(namebuf), sc(".termcap ")); if (has_JOERC && vsscan(sz(get_JOERC), sc("\t :")) == ~0) { namebuf = vsncpy(sv(namebuf), sz(get_JOERC)); namebuf = vsncpy(sv(namebuf), sc("termcap ")); } namebuf = vsncpy(sv(namebuf), sc("/etc/termcap")); } } npbuf = vawords(NULL, sv(namebuf), sc("\t :")); vsrm(namebuf); y = 0; ti = 0; if (match(cap->tbuf, name)) goto checktc; cap->tbuf = vstrunc(cap->tbuf, 0); nextfile: if (!npbuf[y]) { fprintf(stderr, "Couldn't load termcap entry; using ansi default\n"); ti = 0; cap->tbuf = vsncpy(cap->tbuf, 0, sc(defentry)); goto checktc; } idx = 0; idxname = vsncpy(NULL, 0, sz(npbuf[y])); idxname = vsncpy(idxname, sLEN(idxname), sc(".idx")); f1 = fopen((char *)(npbuf[y]), "r"); ++y; if (!f1) goto nextfile; f = fopen((char *)idxname, "r"); if (f) { struct stat buf, buf1; if (fstat(fileno(f), &buf) || fstat(fileno(f1), &buf1)) fprintf(stderr, "cannot stat termcap index\n"); else if (buf.st_mtime > buf1.st_mtime) idx = findidx(f, name); else fprintf(stderr, "%s is out of date\n", idxname); fclose(f); } vsrm(idxname); #ifdef HAVE_FSEEKO fseeko(f1, idx, 0); #else /* ugh. SOL! */ fseek(f1, (long)idx, 0); #endif cap->tbuf = lfind(cap->tbuf, ti, f1, name); fclose(f1); if (sLEN(cap->tbuf) == ti) goto nextfile; checktc: x = sLEN(cap->tbuf); do { cap->tbuf[x] = 0; while (x && cap->tbuf[--x] != ':') /* nothing */; } while (x && (!cap->tbuf[x + 1] || cap->tbuf[x + 1] == ':')); if (cap->tbuf[x + 1] == 't' && cap->tbuf[x + 2] == 'c' && cap->tbuf[x + 3] == '=') { name = vsncpy(NULL, 0, sz(cap->tbuf + x + 4)); cap->tbuf[x] = 0; cap->tbuf[x + 1] = 0; ti = x + 1; sLen(cap->tbuf) = x + 1; if (y) --y; goto nextfile; } doline: pp = cap->tbuf + ti; /* Process line at pp */ loop: while (*pp && *pp != ':') ++pp; if (*pp) { int q; *pp++ = 0; loop1: if (pp[0] == ' ' || pp[0] == '\t') goto loop; for (q = 0; pp[q] && pp[q] != '#' && pp[q] != '=' && pp[q] != '@' && pp[q] != ':'; ++q) ; qq = pp; c = pp[q]; pp[q] = 0; if (c) pp += q + 1; else pp += q; x = 0; y = cap->sortlen; z = -1; if (!y) goto in; while (z != (x + y) / 2) { int found; z = (x + y) / 2; found = strcmp(qq, cap->sort[z].name); if(found > 0) { x = z; } else if(found < 0) { y = z; } else { if (c == '@') mmove(cap->sort + z, cap->sort + z + 1, (cap->sortlen-- - (z + 1)) * sizeof(struct sortentry)); else if (c && c != ':') cap->sort[z].value = qq + q + 1; else cap->sort[z].value = NULL; if (c == ':') goto loop1; else goto loop; } } in: if (cap->sortlen == sortsiz) cap->sort = realloc(cap->sort, (sortsiz += 32) * sizeof(struct sortentry)); mmove(cap->sort + y + 1, cap->sort + y, (cap->sortlen++ - y) * sizeof(struct sortentry)); cap->sort[y].name = qq; if (c && c != ':') cap->sort[y].value = qq + q + 1; else cap->sort[y].value = NULL; if (c == ':') goto loop1; else goto loop; } if (ti) { for (--ti; ti; --ti) if (!cap->tbuf[ti - 1]) break; goto doline; } varm(npbuf); vsrm(name); cap->pad = jgetstr(cap, UC "pc"); if (dopadding) cap->dopadding = 1; else cap->dopadding = 0; /* show sorted entries for(x=0;x!=cap->sortlen;++x) printf("%s = %s\n",cap->sort[x].name,cap->sort[x].value); */ return setcap(cap, baud, out); } static struct sortentry * findcap(CAP *cap, const unsigned char *name) { int x, y, z; int found; x = 0; y = cap->sortlen; z = -1; while (z != (x + y) / 2) { z = (x + y) / 2; found = strcmp(name, cap->sort[z].name); if (found > 0) x = z; else if (found < 0) y = z; else return cap->sort + z; } return NULL; } CAP * setcap(CAP *cap, unsigned int baud, int (*out)(int)) { cap->baud = baud; cap->div = 100000 / baud; cap->out = out; return cap; } #ifdef TERMINFO /* const-dirty curses interface to the terminfo capability database */ union compat_hack { char *rw; const unsigned char *ro; }; #endif int getflag(CAP *cap, const unsigned char *name) { #ifdef TERMINFO if (cap->abuf) { union compat_hack hack; hack.ro = name; return tgetflag(hack.rw); } #endif return findcap(cap, name) != NULL; } const unsigned char * jgetstr(CAP *cap, const unsigned char *name) { struct sortentry *s; #ifdef TERMINFO if (cap->abuf) { union compat_hack hack; hack.ro = name; return (const unsigned char *)tgetstr(hack.rw, (char **)&cap->abufp); } #endif s = findcap(cap, name); if (s) return s->value; else return NULL; } int getnum(CAP *cap, const unsigned char *name) { struct sortentry *s; #ifdef TERMINFO if (cap->abuf) { union compat_hack hack; hack.ro = name; return tgetnum(hack.rw); } #endif s = findcap(cap, name); if (s && s->value) return atoi((const char *)(s->value)); return -1; } void rmcap(CAP *cap) { vsrm(cap->tbuf); if (cap->abuf) free(cap->abuf); if (cap->sort) free(cap->sort); free(cap); } static unsigned char escape(const unsigned char **s) { unsigned char c = *(*s)++; int i; if (c == '^' && **s) if (**s != '?') return 037 & *(*s)++; else { (*s)++; return 127; } else if (c == '\\' && **s) switch (c = *((*s)++)) { case '0': case '1': case '2': case '3': case '4': case '5': case '6': case '7': (*s)--; *s += ustoc_oct(*s, &i, USTOC_MAX); return i; case 'e': case 'E': return 27; case 'n': case 'l': return 10; case 'r': return 13; case 't': return 9; case 'b': return 8; case 'f': return 12; case 's': return 32; default: return c; } else return c; } void texec(CAP *cap, const unsigned char *s, int l, int a0, int a1, int a2, int a3) { int c, tenth = 0, x; int args[4]; int *a = args; int *vars = NULL; /* Do nothing if there is no string */ if (!s) return; #ifdef TERMINFO if (cap->abuf) { unsigned char *aa; aa = (unsigned char *)tgoto((const char *)s, a1, a0); tputs((char *)aa, l, cap->out); return; } #endif /* Copy args into array (yuk) */ args[0] = a0; args[1] = a1; args[2] = a2; args[3] = a3; /* Get tenths of MS of padding needed */ while (*s >= '0' && *s <= '9') tenth = tenth * 10 + *s++ - '0'; tenth *= 10; if (*s == '.') { ++s; tenth += *s++ - '0'; } /* Check if we have to multiply by number of lines */ if (*s == '*') { ++s; tenth *= l; } /* Output string */ while ((c = *s++) != '\0') if (c == '%' && *s) { switch (x = a[0], c = escape(&s)) { case 'C': if (x >= 96) { cap->out((unsigned char)(x / 96)); x %= 96; } /* FALLTHROUGH */ case '+': if (*s) x += escape(&s); /* FALLTHROUGH */ case '.': cap->out((unsigned char)x); ++a; break; case 'd': if (x < 10) goto one; /* FALLTHROUGH */ case '2': if (x < 100) goto two; /* FALLTHROUGH */ case '3': c = '0'; while (x >= 100) { ++c; x -= 100; } cap->out((unsigned char)c); two: c = '0'; while (x >= 10) { ++c; x -= 10; } cap->out((unsigned char)c); one: cap->out((unsigned char)('0' + x)); ++a; break; case 'r': a[0] = a[1]; a[1] = x; break; case 'i': ++a[0]; ++a[1]; break; case 'n': a[0] ^= 0140; a[1] ^= 0140; break; case 'm': a[0] ^= 0177; a[1] ^= 0177; break; case 'f': ++a; break; case 'b': --a; break; case 'a': x = s[2]; if (s[1] == 'p') x = a[x - 0100]; switch (*s) { case '+': a[0] += x; break; case '-': a[0] -= x; break; case '*': a[0] *= x; break; case '/': a[0] /= x; break; case '%': a[0] %= x; break; case 'l': if (vars) a[0] = vars[x]; break; case 's': if (!vars) vars = calloc(256, sizeof(int)); if (vars) vars[x] = a[0]; break; default: a[0] = x; } s += 3; break; case 'D': a[0] = a[0] - 2 * (a[0] & 15); break; case 'B': a[0] = 16 * (a[0] / 10) + a[0] % 10; break; case '>': if (a[0] > escape(&s)) a[0] += escape(&s); else escape(&s); /* FALLTHROUGH */ default: cap->out((unsigned char)'%'); cap->out((unsigned char)c); } } else { --s; cap->out((unsigned char)escape(&s)); } /* Output padding characters */ if (cap->dopadding) { if (cap->pad) while (tenth >= cap->div) for (s = cap->pad; *s; ++s) { cap->out((unsigned char)(*s)); tenth -= cap->div; } else while (tenth >= cap->div) { cap->out(0); tenth -= cap->div; } } free(vars); } static int total; static int cst(int c) { ++total; return (c); } int tcost(CAP *cap, const unsigned char *s, int l, int a0, int a1, int a2, int a3) { int (*out)(int) = cap->out; if (!s) return 10000; total = 0; cap->out = cst; texec(cap, s, l, a0, a1, a2, a3); cap->out = out; return total; } static unsigned char *ssp; static int cpl(int c) { ssp = vsadd(ssp, (unsigned char)c); return (c); } unsigned char * tcompile(CAP *cap, const unsigned char *s, int a0, int a1, int a2, int a3) { int (*out)(int) = cap->out; int divider = cap->div; if (!s) return NULL; cap->out = cpl; cap->div = 10000; ssp = vsmk(10); texec(cap, s, 0, a0, a1, a2, a3); cap->out = out; cap->div = divider; return ssp; } jupp/termcap.h010064400000000000000000000123151363731763500106070ustar00/* * TERMCAP/TERMINFO header file * Copyright * (C) 1992 Joseph H. Allen * * This file is part of JOE (Joe's Own Editor) */ #ifndef JUPP_TERMCAP_H #define JUPP_TERMCAP_H #ifdef EXTERN __IDSTRING(rcsid_termcap_h, "$MirOS: contrib/code/jupp/termcap.h,v 1.11 2020/03/27 06:38:58 tg Exp $"); #endif /* CAP *getcap(char *s, int baud, int (*out)(char c)); * * Get CAP entry for terminal named in 's'. If 's' is zero, the name in * the environment variable 'TERM' is used instead. Space for the returned * CAP is allocated from the heap using malloc. * * 'baud' is the baud rate used for 'texec' to calculate number of pad chars * 'out' is the function 'texec' uses to output characters, expected to * both output as well as return its (sole) argument * * This is how 'getcap' finds the entry: First a list of file names is * built. If the environment variable 'TERMCAP' begins with a '/', it * is used as the list of file names. Otherwise, if the environment * variable 'TERMPATH' is set, it is used as the list of file names. If * that isn't set, then the string TERMPATH defined above is appended * to value of the 'HOME' environment variable, and that is used as the * list of names (a '/' is placed between the value of the environment * variable and the string). If HOME isn't set, then TERMPATH alone is * used as the list of file names (without prepending a '/'). * * Now the contents of the environment variable 'TERMCAP' (if it's defined and * if it doesn't begin with a '/') and the files from the above list are * scanned for the terminal name. The contents of the environment variable * are scanned first, then the files are scanned in the order they appear in * the named list. * * If the last part of a matching termcap entry is a 'tc=filename', then * the current file is rewound and rescanned for the matching entry (and if * it's not found, the next entry in the file name list is searched). If * a matching termcap entry in the TERMCAP environment variable ends with * a 'tc=filename', then all of the files in the name list are searched. * * There is no limit on the size of the termcap entries. No checking is * done for self-refering 'tc=filename' links (so all of core will be * allocated if there are any). */ CAP *getcap(unsigned char *name, unsigned int baudrate, int (*out)(int)); /* CAP *setcap(CAP *cap, int baud, void (*out)(char c)); * * Reset baud and out for a CAP */ CAP *setcap(CAP *cap, unsigned int baudrate, int (*out)(int)); /* char *jgetstr(CAP *cap,char *name); * * Get value of string capability or return NULL if it's not found. A fast * binary search is used to find the capability. The char * returned points into * the buffer used to load the termcap entry. It should not be modified or * freed. */ const unsigned char *jgetstr(CAP *cap, const unsigned char *name); /* int getflag(CAP *cap,char *name); * * Return true if the named capability is found in 'cap'. A fast binary * search is used to lookup the capability. */ int getflag(CAP *cap, const unsigned char *name); /* int getnum(CAP *cap,char *name); * * Return value of numeric capability or return -1 if it's not found. A fast * binary search is used to lookup the capability. */ int getnum(CAP *cap, const unsigned char *name); /* void rmcap(CAP *cap); * * Eliminate a CAP entry. */ void rmcap(CAP *cap); /* void texec(CAP *cap,char *str,int l,int a0,int a1,int a2,int a3); Execute and output a termcap string capability. 'cap' is the CAP returned by getcap which contains the baud rate and output function. 'str' is the string to execute. If 'str'==NULL, nothing happens. 'l' is the number of lines effected by this string. For example, if you use the clear to end of screen capability, the number of lines between the current cursor position and the end of the screen should be given here. 'a0' - 'a1' are the arguments for the string */ void texec(CAP *cap, const unsigned char *s, int l, int a0, int a1, int a2, int a3); /* int tcost(CAP *cap,char *str, int l, int a0, int a1, int a2, int a3); Return cost in number of characters which need to be sent to execute a termcap string capability. 'cap' is the CAP returned by getcap which contains the baud rate and output functions. 'str' is the string to execute. If 'str'==NULL, tcost return 10000. 'l' is the number of lines effected by this string. Ex: if you use the clear to end of screen capability, the number of lines between the current cursor position and the end of the screen should be given here. 'a0' - 'a3' are arguements passed to the string */ int tcost(CAP *cap, const unsigned char *s, int l, int a0, int a1, int a2, int a3); /* char *tcompile(CAP *cap,char *str,int a0,int a1,int a2,int a3); Compile a string capability. Returns a pointer to a variable length string (see vs.h) containing the compiled string capability. Pad characters are not placed in the string. */ unsigned char *tcompile(CAP *cap, const unsigned char *s, int a0, int a1, int a2, int a3); int tgetent(char *, const char *); int tgetflag(char *); int tgetnum(char *); int tputs(const char *, int, int (*)(int)); char *tgetstr(char *, char **); char *tgoto(const char *, int, int); #endif jupp/termidx.c010064400000000000000000000027171363731415300106200ustar00/* * Program to generate termcap index file * Copyright * (C) 1992 Joseph H. Allen * * This file is part of JOE (Joe's Own Editor) */ #define EXTERN #include "config.h" #include "types.h" __RCSID("$MirOS: contrib/code/jupp/termidx.c,v 1.8 2020/03/27 06:08:16 tg Exp $"); #include static void gen(unsigned char *s, FILE *fd) { int c, x; off_t addr = 0, oaddr; loop: while (c = getc(fd), c == ' ' || c == '\t' || c == '#') do { c = getc(fd); } while (!(c == -1 || c == '\n')); if (c == -1) return; if (c == '\n') goto loop; oaddr = addr; #ifdef HAVE_FSEEKO addr = ftello(fd) - 1; #else /* well, SOL */ addr = ftell(fd) - 1; #endif ungetc(c, fd); s[x = 0] = 0; while (1) { c = getc(fd); if (c == -1 || c == '\n') { if (x != 0 && s[x - 1] == '\\') --x; if (x) { int y, z, flg; s[x] = 0; z = 0; flg = 0; do { for (y = z; s[y] && s[y] != '|' && s[y] != ':'; ++y) ; c = s[y]; s[y] = 0; if (strlen((char *)(s + z)) > 2 && !strchr((char *)(s + z), ' ') && !strchr((char *)(s + z), '\t')) { if(flg) putchar(' '); fputs((char *)(s + z), stdout); flg = 1; } s[y] = c; z = y + 1; } while (c && c != ':'); if (flg) printf(" %lX\n", (unsigned long)(addr - oaddr)); } goto loop; } else if (c == '\r') /* do nothing */ ; else s[x++] = c; } } int main(void) { unsigned char array[65536]; gen(array, stdin); return(0); } jupp/tty.c010064400000000000000000000632421426610112200077510ustar00/* * UNIX Tty and Process interface * Copyright * (C) 1992 Joseph H. Allen * * This file is part of JOE (Joe's Own Editor) */ #include "config.h" #include "types.h" __RCSID("$MirOS: contrib/code/jupp/tty.c,v 1.39 2022/07/20 22:31:19 tg Exp $"); #ifdef HAVE_SYS_PARAM_H #include #endif #include #include #include #include #include #include #include #include #if HAVE_UTMP_H #include #endif int idleout = 1; /* We use the defines in sys/ioctl to determine what type * tty interface the system uses and what type of system * we actually have. */ #if defined(HAVE_POSIX_TERMIOS) #include #elif defined(HAVE_SYSV_TERMIO) #include #include #elif defined(HAVE_SGTTY_H) #include #endif #ifdef HAVE_OPENPTY #ifdef HAVE_PTY_H #include #endif #ifdef HAVE_UTIL_H #include #endif #endif /* Straight from the GNU autoconf texinfo documentation */ #ifdef TIME_WITH_SYS_TIME # include # include #else # ifdef HAVE_SYS_TIME_H # include # else # include # endif #endif /* I'm not sure if SCO_UNIX and ISC have __svr4__ defined, but I think they might */ #ifdef M_SYS5 #ifndef M_XENIX #include #include #ifndef __svr4__ #define __svr4__ 1 #endif #endif #endif #ifdef ISC #ifndef __svr4__ #define __svr4__ 1 #endif #endif #ifdef __svr4__ #include #endif /* JOE include files */ #include "main.h" #include "path.h" #include "scrn.h" #include "tty.h" #include "utils.h" #include "ushell.h" /** Aliased defines **/ /* O_NDELAY, O_NONBLOCK, and FNDELAY are all synonyms for placing a descriptor * in non-blocking mode; we make whichever one we have look like O_NDELAY */ #ifndef O_NDELAY #ifdef O_NONBLOCK #define O_NDELAY O_NONBLOCK #endif #ifdef FNDELAY #define O_NDELAY FNDELAY #endif #endif /* Some systems define this, some don't */ #ifndef sigmask #define sigmask(x) (1<<((x)-1)) #endif /* Some BSDs don't have TILDE */ #ifndef TILDE #define TILDE 0 #endif /* Global configuration variables */ int noxon = 0; /* Set if ^S/^Q processing should be disabled */ int Baud = 0; /* Baud rate from joerc, cmd line or environment */ /* The terminal */ FILE *termin = NULL; FILE *termout = NULL; /* Original state of tty */ #ifdef HAVE_POSIX_TERMIOS struct termios oldterm; #else /* HAVE_POSIX_TERMIOS */ #ifdef HAVE_SYSV_TERMIO static struct termio oldterm; #else /* HAVE_SYSV_TERMIO */ static struct sgttyb oarg; static struct tchars otarg; static struct ltchars oltarg; #endif /* HAVE_SYSV_TERMIO */ #endif /* HAVE_POSIX_TERMIOS */ /* Output buffer, index and size */ unsigned char *obuf = NULL; int obufp = 0; int obufsiz; /* The baud rate */ unsigned baud; /* Bits per second */ unsigned long upc; /* Microseconds per character */ /* TTY Speed code to baud-rate conversion table (this is dumb- is it really * too much to ask for them to just use an integer for the baud-rate?) */ static int speeds[] = { B50, 50, B75, 75, B110, 110, B134, 134, B150, 150, B200, 200, B300, 300, B600, 600, B1200, 1200, B1800, 1800, B2400, 2400, B4800, 4800, B9600, 9600 #ifdef EXTA , EXTA, 19200 #endif #ifdef EXTB , EXTB, 38400 #endif #ifdef B19200 , B19200, 19200 #endif #ifdef B38400 , B38400, 38400 #endif }; /* Input buffer */ int have = 0; /* Set if we have pending input */ static unsigned char havec; /* Character read in during pending input check */ int leave = 0; /* When set, typeahead checking is disabled */ /* TTY mode flag. 1 for open, 0 for closed */ static int ttymode = 0; /* Signal state flag. 1 for joe, 0 for normal */ static int ttysig = 0; #if WANT_FORK /* Stuff for shell windows */ static pid_t kbdpid; /* PID of kbd client */ static int ackkbd = -1; /* Editor acks keyboard client to this */ static int mpxfd; /* Editor reads packets from this fd */ static int mpxsfd; /* Clients send packets to this fd */ static int nmpx = 0; static int tty_accept = NO_MORE_DATA; /* =-1 if we have last packet */ struct packet { MPX *who; int size; int ch; unsigned char data[1024]; } pack; MPX asyncs[NPROC]; #endif /* Set signals for JOE */ void sigjoe(void) { if (ttysig) return; ttysig = 1; joe_set_signal(SIGHUP, ttsig); joe_set_signal(SIGTERM, ttsig); joe_set_signal(SIGINT, SIG_IGN); joe_set_signal(SIGPIPE, SIG_IGN); } /* Restore signals for exiting */ void signrm(int inchild) { if (!ttysig) return; if (!inchild) ttysig = 0; joe_set_signal(SIGHUP, SIG_DFL); joe_set_signal(SIGTERM, SIG_DFL); joe_set_signal(SIGINT, SIG_DFL); joe_set_signal(SIGPIPE, SIG_DFL); } /* Open terminal and set signals */ void ttopen(void) { sigjoe(); ttopnn(); } /* Close terminal and restore signals */ void ttclose(void) { ttclsn(); signrm(0); } static volatile sig_atomic_t winched = 0; #ifdef SIGWINCH /* Window size interrupt handler */ static RETSIGTYPE winchd(int unused) { winched = 1; REINSTALL_SIGHANDLER(SIGWINCH, winchd); } #endif /* Second ticker */ static volatile sig_atomic_t ticked = 0; extern int dostaupd; static RETSIGTYPE dotick(int unused) { ticked = 1; } void tickoff(void) { alarm(0); } void tickon(void) { ticked = 0; joe_set_signal(SIGALRM, dotick); alarm(1); } /* Open terminal */ static void baud_reset(int); void ttopnn(void) { int bbaud; #ifdef HAVE_POSIX_TERMIOS struct termios newterm; #else #ifdef HAVE_SYSV_TERMIO struct termio newterm; #else struct sgttyb arg; struct tchars targ; struct ltchars ltarg; #endif #endif if (!termin) { if (idleout ? (!(termin = stdin) || !(termout = stdout)) : (!(termin = fopen("/dev/tty", "r")) || !(termout = fopen("/dev/tty", "w")))) { fprintf(stderr, "Couldn\'t open /dev/tty\n"); exit(1); } else { #ifdef SIGWINCH joe_set_signal(SIGWINCH, winchd); #endif } } if (ttymode) return; ttymode = 1; fflush(termout); #ifdef HAVE_POSIX_TERMIOS tcgetattr(fileno(termin), &oldterm); newterm = oldterm; newterm.c_lflag = 0; if (noxon) newterm.c_iflag &= ~(ICRNL | IGNCR | INLCR | IXON | IXOFF); else newterm.c_iflag &= ~(ICRNL | IGNCR | INLCR); newterm.c_oflag = 0; newterm.c_cc[VMIN] = 1; newterm.c_cc[VTIME] = 0; tcsetattr(fileno(termin), TCSADRAIN, &newterm); bbaud = cfgetospeed(&newterm); #else #ifdef HAVE_SYSV_TERMIO ioctl(fileno(termin), TCGETA, &oldterm); newterm = oldterm; newterm.c_lflag = 0; if (noxon) newterm.c_iflag &= ~(ICRNL | IGNCR | INLCR | IXON | IXOFF); else newterm.c_iflag &= ~(ICRNL | IGNCR | INLCR); newterm.c_oflag = 0; newterm.c_cc[VMIN] = 1; newterm.c_cc[VTIME] = 0; ioctl(fileno(termin), TCSETAW, &newterm); bbaud = (newterm.c_cflag & CBAUD); #else ioctl(fileno(termin), TIOCGETP, &arg); ioctl(fileno(termin), TIOCGETC, &targ); ioctl(fileno(termin), TIOCGLTC, <arg); oarg = arg; otarg = targ; oltarg = ltarg; arg.sg_flags = ((arg.sg_flags & ~(ECHO | CRMOD | XTABS | ALLDELAY | TILDE)) | CBREAK); if (noxon) { targ.t_startc = -1; targ.t_stopc = -1; } targ.t_intrc = -1; targ.t_quitc = -1; targ.t_eofc = -1; targ.t_brkc = -1; ltarg.t_suspc = -1; ltarg.t_dsuspc = -1; ltarg.t_rprntc = -1; ltarg.t_flushc = -1; ltarg.t_werasc = -1; ltarg.t_lnextc = -1; ioctl(fileno(termin), TIOCSETN, &arg); ioctl(fileno(termin), TIOCSETC, &targ); ioctl(fileno(termin), TIOCSLTC, <arg); bbaud = arg.sg_ospeed; #endif #endif baud_reset(bbaud); } static void baud_reset(int bbaud) { size_t x = 0; baud = 9600; upc = 0; while (x < NELEM(speeds)) if (bbaud == speeds[x]) { baud = speeds[x + 1]; break; } else x += 2; if (Baud >= 50) baud = Baud; else Baud = baud; upc = DIVIDEND / baud; if (obuf) free(obuf); if ((TIMES * upc) == 0) obufsiz = 4096; else { obufsiz = 1000000 / (TIMES * upc); if (obufsiz > 4096) obufsiz = 4096; } if (!obufsiz) obufsiz = 1; obuf = malloc(obufsiz); } /* Close terminal */ void ttclsn(void) { int oleave; if (ttymode) ttymode = 0; else return; oleave = leave; leave = 1; ttflsh(); #ifdef HAVE_POSIX_TERMIOS tcsetattr(fileno(termin), TCSADRAIN, &oldterm); #else #ifdef HAVE_SYSV_TERMIO ioctl(fileno(termin), TCSETAW, &oldterm); #else ioctl(fileno(termin), TIOCSETN, &oarg); ioctl(fileno(termin), TIOCSETC, &otarg); ioctl(fileno(termin), TIOCSLTC, &oltarg); #endif #endif leave = oleave; } /* Timer interrupt handler */ static volatile sig_atomic_t yep; static RETSIGTYPE dosig(int unused) { yep = 1; } /* FLush output and check for typeahead */ #ifdef HAVE_SETITIMER #ifdef SIG_SETMASK static void maskit(void) { sigset_t set; sigemptyset(&set); sigaddset(&set, SIGALRM); sigprocmask(SIG_SETMASK, &set, NULL); } static void unmaskit(void) { sigset_t set; sigemptyset(&set); sigprocmask(SIG_SETMASK, &set, NULL); } static void pauseit(void) { sigset_t set; sigemptyset(&set); sigsuspend(&set); } #else static void maskit(void) { sigsetmask(sigmask(SIGALRM)); } static void unmaskit(void) { sigsetmask(0); } static void pauseit(void) { sigpause(0); } #endif #endif int ttflsh(void) { /* Flush output */ if (obufp) { unsigned long usec = obufp * upc; /* No. usecs this write should take */ #ifdef HAVE_SETITIMER if (usec >= 50000 && baud < 9600) { struct itimerval a, b; a.it_value.tv_sec = usec / 1000000; a.it_value.tv_usec = usec % 1000000; a.it_interval.tv_usec = 0; a.it_interval.tv_sec = 0; alarm(0); joe_set_signal(SIGALRM, dosig); yep = 0; maskit(); setitimer(ITIMER_REAL, &a, &b); joe_write(fileno(termout), obuf, obufp); while (!yep) pauseit(); unmaskit(); } else joe_write(fileno(termout), obuf, obufp); #else joe_write(fileno(termout), obuf, obufp); #ifdef FIORDCHK if (baud < 9600 && usec / 1000) nap(usec / 1000); #endif #endif obufp = 0; } #if WANT_FORK /* Ack previous packet */ if (ackkbd != -1 && tty_accept != NO_MORE_DATA && !have) { unsigned char c = 0; if (pack.who && pack.who->func) joe_write(pack.who->ackfd, &c, 1); else joe_write(ackkbd, &c, 1); tty_accept = NO_MORE_DATA; } #endif /* Check for typeahead or next packet */ if (!have && !leave) { #if WANT_FORK if (ackkbd != -1) { ssize_t r; fcntl(mpxfd, F_SETFL, O_NDELAY); r = read(mpxfd, &pack, 1); fcntl(mpxfd, F_SETFL, 0); if (r == 1) { r = sizeof(struct packet) - 1024 - 1; if (joe_readex(mpxfd, (US &pack) + 1, r) == r && pack.size >= 0 && pack.size <= 1024 && joe_readex(mpxfd, pack.data, pack.size) == pack.size) { have = 1; tty_accept = pack.ch; } } } else #endif { /* Set terminal input to non-blocking */ fcntl(fileno(termin), F_SETFL, O_NDELAY); /* Try to read */ if (read(fileno(termin), &havec, 1) == 1) have = 1; /* Set terminal back to blocking */ fcntl(fileno(termin), F_SETFL, 0); } } return 0; } /* Read next character from input */ #if WANT_FORK static void mpxdied(MPX *m); #endif static time_t last_time; int ttgetc(void) { time_t new_time; tickon(); loop: new_time = time(NULL); if (new_time != last_time) { last_time = new_time; dostaupd = 1; ticked = 1; } ttflsh(); while (winched) { winched = 0; edupd(1); ttflsh(); } if (ticked) { edupd(0); ttflsh(); tickon(); } #if WANT_FORK if (ackkbd != -1) { ssize_t r; if (!have) { /* wait for input */ r = sizeof(struct packet) - 1024; if (joe_readex(mpxfd, &pack, r) != r || pack.size < 0 || pack.size > 1024 || joe_readex(mpxfd, pack.data, pack.size) != pack.size) { if (winched || ticked) goto loop; ttsig(0); } tty_accept = pack.ch; } have = 0; if (pack.who) { /* got background input */ if (tty_accept != NO_MORE_DATA) { if (pack.who->func) { pack.who->func(pack.who->object, pack.data, pack.size); edupd(1); } } else mpxdied(pack.who); goto loop; } else if (tty_accept != NO_MORE_DATA) { tickoff(); return tty_accept; } else { tickoff(); ttsig(0); return 0; } } #endif if (have) { have = 0; } else if (read(fileno(termin), &havec, 1) < 1) { if (winched || ticked) goto loop; ttsig(0); } tickoff(); return havec; } /* Write string to output */ void ttputs(unsigned char *s) { while (*s) { obuf[obufp++] = *s++; if (obufp == obufsiz) ttflsh(); } } /* Get window size */ void ttgtsz(int *x, int *y) { #ifdef TIOCGSIZE struct ttysize getit; #else #ifdef TIOCGWINSZ struct winsize getit; #endif #endif *x = 0; *y = 0; #ifdef TIOCGSIZE if (ioctl(fileno(termout), TIOCGSIZE, &getit) != -1) { *x = getit.ts_cols; *y = getit.ts_lines; } #else #ifdef TIOCGWINSZ if (ioctl(fileno(termout), TIOCGWINSZ, &getit) != -1) { *x = getit.ws_col; *y = getit.ws_row; } #endif #endif } #ifndef SIGTSTP /* void ttshell(char *s); Run a shell command or if 's' is zero, run a * sub-shell */ static void ttshell(unsigned char *cmd); static const char shmsg[] = "You are at the command shell. Type 'exit' to return.\n"; #if WANT_FORK #define v_or_fork() fork() #else #define v_or_fork() vfork() #endif static void ttshell(unsigned char *cmd) { int x, omode = ttymode; const char *sh; sh = getushell(); ttclsn(); if (!(x = v_or_fork())) { signrm(1); if (cmd) execl(sh, sh, "-c", cmd, NULL); else { write(2, shmsg, sizeof(shmsg) - 1); execl(sh, sh, NULL); } _exit(0); } if (x != -1) wait(NULL); if (omode) ttopnn(); } #endif #if WANT_FORK /* Create keyboard task */ static int mpxresume(void) { int fds[2]; if (pipe(fds)) { ackkbd = -1; return (1); } tty_accept = NO_MORE_DATA; have = 0; if (!(kbdpid = fork())) { close(fds[1]); do { unsigned char c; int sta; pack.who = 0; sta = joe_read(fileno(termin), &c, 1); if (sta == 0) pack.ch = NO_MORE_DATA; else pack.ch = c; pack.size = 0; joe_write(mpxsfd, &pack, sizeof(struct packet) - 1024); } while (joe_read(fds[0], &pack, 1) == 1); _exit(0); } close(fds[0]); ackkbd = fds[1]; return (0); } /* Kill keyboard task */ static void mpxsusp(void) { if (ackkbd!=-1) { kill(kbdpid, 9); while (wait(NULL) < 0 && errno == EINTR) /* do nothing */; close(ackkbd); } } #endif /* We used to leave the keyboard copy task around during suspend, but Cygwin gets confused when two processes are waiting for input and you change the tty from raw to cooked (on the call to ttopnn()): the keyboard process was stuck in cooked until he got a carriage return- then he switched back to raw (he's supposed to switch to raw without waiting for the end of line). Probably this should be done for ttshell() as well. */ void ttsusp(void) { int omode; #ifdef SIGTSTP omode = ttymode; #if WANT_FORK mpxsusp(); #endif ttclsn(); fprintf(stderr, "You have suspended the program. Type 'fg' to return.\n"); kill(0, SIGTSTP); if (omode) ttopnn(); #if WANT_FORK if (ackkbd!= -1) mpxresume(); #endif #else ttshell(NULL); #endif } #if WANT_FORK /* Stuff for asynchronous I/O multiplexing. We do not use streams or select() because joe needs to work on versions of UNIX which predate these calls. Instead, when there is multiple async sources, we use helper processes which packetize data from the sources. A header on each packet indicates the source. There is no guarentee that packets getting written to the same pipe don't get interleaved, but you can reasonable rely on it with small packets. */ /* This code will explode if pipe, fork, etc. fail. --mirabilos */ static int mpxstart(void) { int fds[2]; if (pipe(fds)) { mpxfd = -1; mpxsfd = -1; return (1); } mpxfd = fds[0]; mpxsfd = fds[1]; return (mpxresume()); } static void mpxend(void) { mpxsusp(); ackkbd = -1; close(mpxfd); close(mpxsfd); if (have) havec = pack.ch; } /* Get a pty/tty pair. Returns open pty in 'ptyfd' and returns tty name * string in static buffer or NULL if couldn't get a pair. */ #ifdef __svr4__ #define USEPTMX 1 #else #ifdef __CYGWIN__ #define USEPTMX 1 #endif #endif #ifdef sgi /* Newer sgi machines can do it the __svr4__ way, but old ones can't */ extern char *_getpty(int *fildes, int oflag, mode_t mode, int nofork); static unsigned char *getpty(int *ptyfd) { return (unsigned char *)_getpty(ptyfd, O_RDWR, 0600, 0); } #else #ifdef USEPTMX /* Strange streams way */ extern char *ptsname(int); static unsigned char *getpty(int *ptyfd) { int fdm; *ptyfd = fdm = open("/dev/ptmx", O_RDWR); grantpt(fdm); unlockpt(fdm); return (unsigned char *)ptsname(fdm); } #else #ifdef HAVE_OPENPTY /* BSD function, present in libc5 and glibc2 and (duh) the BSDs */ static unsigned char *getpty(int *ptyfd) { static unsigned char name[32]; int ttyfd; if (openpty(ptyfd, &ttyfd, name, NULL, NULL) == 0) return(name); else return (NULL); } #else /* The normal way: for each possible pty/tty pair, try to open the pty and * then the corresponding tty. If both could be opened, close them both and * then re-open the pty. If that succeeded, return with the opened pty and the * name of the tty. * * Logically you should only have to succeed in opening the pty- but the * permissions may be set wrong on the tty, so we have to try that too. * We close them both and re-open the pty because we want the forked process * to open the tty- that way it gets to be the controlling tty for that * process and the process gets to be the session leader. */ static unsigned char *getpty(int *ptyfd) { int x, fd; unsigned char *orgpwd = pwd(); static unsigned char **ptys = NULL; static const unsigned char *ttydir; static const unsigned char *ptydir; static unsigned char ttyname[32]; if (!ptys) { /* HPUX systems */ ttydir = UC "/dev/pty/"; ptydir = UC "/dev/ptym/"; if (chpwd(ptydir) || !(ptys = rexpnd(UC "pty*"))) if (!ptys) { /* Everyone else */ ttydir = ptydir = UC "/dev/"; if (!chpwd(ptydir)) ptys = rexpnd(UC "pty*"); } } chpwd(orgpwd); if (ptys) for (fd = 0; ptys[fd]; ++fd) { strlcpy((char *)ttyname, (char *)ptydir, 32); strlcat((char *)ttyname, (char *)(ptys[fd]), 32); if ((*ptyfd = open((char *)ttyname, O_RDWR)) >= 0) { ptys[fd][0] = 't'; strlcpy((char *)ttyname, (char *)ttydir, 32); strlcat((char *)ttyname, (char *)(ptys[fd]), 32); ptys[fd][0] = 'p'; x = open((char *)ttyname, O_RDWR); if (x >= 0) { close(x); close(*ptyfd); strlcpy((char *)ttyname, (char *)ptydir, 32); strlcat((char *)ttyname, (char *)(ptys[fd]), 32); *ptyfd = open((char *)ttyname, O_RDWR); ptys[fd][0] = 't'; strlcpy((char *)ttyname, (char *)ttydir, 32); strlcat((char *)ttyname, (char *)(ptys[fd]), 32); ptys[fd][0] = 'p'; return ttyname; } else close(*ptyfd); } } return NULL; } #endif #endif #endif /* Shell dies signal handler. Puts pty in non-block mode so * that read returns with <1 when all data from process has * been read. */ static volatile sig_atomic_t dead = 0; int death_fd; static RETSIGTYPE death(int unused) { fcntl(death_fd,F_SETFL,O_NDELAY); wait(NULL); dead = 1; } #ifndef SIGCHLD #define SIGCHLD SIGCLD #endif /* Build a new environment, but replace one variable */ extern unsigned char **mainenv; static unsigned char ** newenv(unsigned char **old, const unsigned char *s) { unsigned char **new; int x, y, z; for (x = 0; old[x]; ++x) /* nothing */; new = malloc((x + 2) * sizeof(unsigned char *)); for (x = 0, y = 0; old[x]; ++x) { for (z = 0; s[z] != '='; ++z) if (s[z] != old[x][z]) break; if (s[z] == '=') { if (s[z + 1]) new[y++] = (void *)strdup((const char *)s); } else new[y++] = old[x]; } if (x == y) new[y++] = (void *)strdup((const char *)s); new[y] = 0; return new; } /* Create a shell process */ MPX * mpxmk(int *ptyfd, const unsigned char *cmd, unsigned char **args, void (*func)(B*, unsigned char *, int), void *object, void (*die)(B*), void *dieobj) { unsigned char buf[80]; int fds[2]; int comm[2]; pid_t pid; int x; MPX *m = NULL; unsigned char *name; /* Get pty/tty pair */ if (!(name = getpty(ptyfd))) return NULL; /* Find free slot */ for (x = 0; x != NPROC; ++x) if (!asyncs[x].func) { m = asyncs + x; break; } if (x==NPROC) return NULL; /* PID number pipe */ if (pipe(comm)) return (NULL); /* Acknowledgement pipe */ if (pipe(fds)) { /* don't leak in error case */ pipout: close(comm[0]); close(comm[1]); return (NULL); } m->ackfd = fds[1]; /* * Fixes cygwin console bug: if you fork() with inverse video * it assumes you want ESC [ 0 m to keep it in inverse video * from then on. */ set_attr(maint->t,0); /* Flush output */ ttflsh(); /* Bump no. current async inputs to joe */ ++nmpx; /* Start input multiplexer */ if (ackkbd == -1) if (mpxstart()) { close(fds[0]); close(fds[1]); m->ackfd = -1; --nmpx; goto pipout; } /* Remember callback function */ m->func = func; m->object = object; m->die = die; m->dieobj = dieobj; /* Create processes... */ if (!(m->kpid = fork())) { /* * This process copies data from shell to joe. * After each packet it sends to joe it waits for * an acknowledgement from joe so that it can not get * too far ahead with buffering. */ /* Close joe side of pipes */ close(fds[1]); close(comm[0]); /* Flag which indicates child died */ dead = 0; death_fd = *ptyfd; joe_set_signal(SIGCHLD, death); if (!(pid = fork())) { /* This process becomes the shell */ unsigned char **env; signrm(0); /* Close pty (we only need tty) */ close(*ptyfd); /* * All of this stuff is for dissociating ourself from * the controlling tty (session leader) and starting a * new session. This is the most non-portable part of * UNIX — second only to pty/tty pair creation. */ #ifndef HAVE_LOGIN_TTY #ifdef TIOCNOTTY x = open("/dev/tty", O_RDWR); ioctl(x, TIOCNOTTY, 0); #endif /* I think you do setprgp(0,0) on systems with no setsid() */ setsid(); #ifndef _MINIX /* http://mail-index.netbsd.org/pkgsrc-bugs/2011/06/13/msg043281.html */ #ifndef SETPGRP_VOID setpgrp(0, 0); #else setpgrp(); #endif #endif #endif /* Close all fds */ for (x = 0; x != 32; ++x) { /* Yes, this is quite a kludge... */ /* All in the name of portability */ close(x); } /* Open the TTY as standard input */ if ((x = open((char *)name, O_RDWR)) != -1) { env = newenv(mainenv, UC "TERM="); #ifdef HAVE_LOGIN_TTY login_tty(x); #else /* This tells the fd that it's a tty (I think) */ #ifdef __svr4__ ioctl(x, I_PUSH, "ptem"); ioctl(x, I_PUSH, "ldterm"); #endif /* Open stdout, stderr */ if (dup(x)) {} /* standard output */ if (dup(x)) {} /* standard error */ /* * yes, stdin, stdout, and stderr must * all be open for reading and writing. * On some systems the shell assumes this. */ #endif /* * We could probably have a special TTY * setup for JOE, but for now we'll just * use the TTY setup for the TTY was was * run on. */ #ifdef HAVE_POSIX_TERMIOS tcsetattr(0, TCSADRAIN, &oldterm); #else #ifdef HAVE_SYSV_TERMIO ioctl(0, TCSETAW, &oldterm); #else ioctl(0, TIOCSETN, &oarg); ioctl(0, TIOCSETC, &otarg); ioctl(0, TIOCSLTC, &oltarg); #endif #endif /* Execute the shell */ execve((const char *)cmd, (char **)args, (char **)env); /* If shell didn't execute */ joe_snprintf_1((char *)buf,sizeof(buf),"Couldn't execute shell '%s'\n",cmd); if (write(0,(char *)buf,strlen((char *)buf))) {} sleep(1); } _exit(0); } /* Tell JOE PID of shell */ joe_write(comm[1], &pid, sizeof(pid)); /* sigpipe should be ignored here. */ /* This process copies data from shell to JOE until EOF. It creates a packet for each data */ /* We don't really get EOF from a pty- it would just wait forever until someone else writes to the tty. So: when the shell dies, the child died signal handler death() puts pty in non-block mode. This allows us to read any remaining data- then read returns 0 and we know we're done. */ loop: pack.who = m; pack.ch = 0; /* Read data from process */ pack.size = joe_read(*ptyfd, pack.data, 1024); /* On SUNOS 5.8, the very first read from the pty returns 0 for some reason */ if (!pack.size) pack.size = joe_read(*ptyfd, pack.data, 1024); if (pack.size > 0) { /* Send data to JOE, wait for ack */ joe_write(mpxsfd, &pack, sizeof(struct packet) - 1024 + pack.size); joe_read(fds[0], &pack, 1); goto loop; } else { /* Shell died: return */ pack.ch = NO_MORE_DATA; pack.size = 0; joe_write(mpxsfd, &pack, sizeof(struct packet) - 1024); _exit(0); } } joe_read(comm[0], &m->pid, sizeof(m->pid)); /* We only need comm once */ close(comm[0]); close(comm[1]); /* Close other side of copy process pipe */ close(fds[0]); return m; } static void mpxdied(MPX *m) { if (!--nmpx) mpxend(); while (wait(NULL) < 0 && errno == EINTR) /* do nothing */; if (m->die) m->die(m->dieobj); m->func = NULL; edupd(1); } #endif void tty_xonoffbaudrst(void) { #ifdef HAVE_POSIX_TERMIOS struct termios newterm; #else #ifdef HAVE_SYSV_TERMIO struct termio newterm; #else struct sgttyb arg; struct tchars targ; #endif #endif #ifdef HAVE_POSIX_TERMIOS tcgetattr(fileno(termin), &newterm); if (noxon) newterm.c_iflag &= ~(IXON | IXOFF); else newterm.c_iflag |= (IXON | IXOFF); tcsetattr(fileno(termin), TCSADRAIN, &newterm); baud_reset(cfgetospeed(&newterm)); #else #ifdef HAVE_SYSV_TERMIO ioctl(fileno(termin), TCGETA, &newterm); if (noxon) newterm.c_iflag &= ~(IXON | IXOFF); else newterm.c_iflag |= (IXON | IXOFF); ioctl(fileno(termin), TCSETAW, &newterm); baud_reset(newterm.c_cflag & CBAUD); #else ioctl(fileno(termin), TIOCGETP, &arg); ioctl(fileno(termin), TIOCGETC, &targ); if (noxon) { targ.t_startc = -1; targ.t_stopc = -1; } else { targ.t_startc = otarg.t_startc; targ.t_stopc = otarg.t_stopc; } ioctl(fileno(termin), TIOCSETC, &targ); baud_reset(arg.sg_ospeed); #endif #endif } jupp/tty.h010064400000000000000000000145121363731763500077750ustar00/* * TTY interface header file * Copyright * (C) 1992 Joseph H. Allen * * This file is part of JOE (Joe's Own Editor) */ #ifndef JUPP_TTY_H #define JUPP_TTY_H #ifdef EXTERN_CMD_C __IDSTRING(rcsid_tty_h, "$MirOS: contrib/code/jupp/tty.h,v 1.16 2020/03/27 06:38:58 tg Exp $"); #endif /* void ttopen(void); Open the tty (attached to stdin) for use inside of JOE * * (0) Call sigjoe() * There is also 'void ttopnn(void)' which does not do this step. * * (1) fflush(stdout) * * (2) Save the current state of the tty * * (3) Disable CR/LF/NL input translations, * Disable all output processing, * Disable echo and line editing, and * Place tty in character at a time mode. * (basically, disable all processing except for XON/XOFF if it's set) * * (4) Set this new tty state without loosing any typeahead (by using the * proper ioctl). * * (5) Store the baud rate in the global variable 'baud' * * (6) Divide the baud rate into the constant DIVIDEND and store the result * in the global variable 'upc'. This should come out to the number * of microseconds needed to send each character. The constant 'DIVIDEND' * should be chosen so that 'upc' reflects the real throughput of the * tty, not the theoretical best throughput. * * (7) Create an output buffer of a size which depends on 'upc' and the * constant 'TIMES'. 'TIMES' is the number of times per second JOE * should check for typeahead. Since we only check for typehead after * the output buffer is flushed, 'upc' and the size of the output buffer * determine how often this occurs. So for example if 'upc'==1000 (~9600 * baud) and 'TIMES'==3, the output buffer size is set to 333 characters. * Each time this buffer is completely flushed, 1/3 of a second will go by. */ void ttopen(void); void ttopnn(void); extern unsigned long upc; extern unsigned baud; #define TIMES 3 #define DIVIDEND 10000000 /* void ttclose(void); Restore the tty back to its original mode. * * (1) ttyflsh() * * (2) Restore the original tty mode which aopen() had saved. Do this without * loosing any typeahead. * * (3) Call signrm(). There is also 'void ttyclsn(void)' which does not do * the this step. */ void ttclose(void); void ttclsn(void); /* int ttgetc(void); Flush the output and get the next character from the tty * * (1) ttflsh() * * (2) Read the next input character * If the input closed, call 'ttsig' with 0 as its argument. * * (3) Clear 'have' */ int ttgetc(void); /* void ttputc(char c); Write a character to the output buffer. If it becomes * full, call ttflsh() */ extern int obufp; extern int obufsiz; extern unsigned char *obuf; #define ttputc(c) do { \ obuf[obufp++] = (c); \ if (obufp == obufsiz) \ ttflsh(); \ } while (/* CONSTCOND */ 0) /* void ttputs(char *s); Write a string to the output buffer. Any time the * output buffer gets full, call ttflsh() */ void ttputs(unsigned char *s); /* void ttsusp(void); Suspend the process, or if the UNIX can't do it, call * ttshell(NULL) */ void ttsusp(void); /* int ttflsh(void); Flush the output buffer and check for typeahead. * * (1) write() any characters in the output buffer to the tty and then sleep * for the amount of time it should take for the written characters to get * to the tty. This is so that any buffering between the editor and the * tty is defeated. If this is not done, the screen update will not be * able to defer for typeahead. * * The best way to do the sleep (possible only on systems with the * setitimer call) is to set a timer for the necessary amount, write the * characters to the tty, and then sleep until the timer expires. * * If this can't be done, it's usually ok to 'write' and then to sleep for * the necessary amount of time. However, you will notice delays in the * screen update if the 'write' actually takes any significant amount of * time to execute (it usually takes none since all it usually does is * write to an operating system output buffer). * * (2) The way we check for typeahead is to put the TTY in nonblocking mode * and attempt to read a character. If one could be read, the global * variable 'have' is set to indicate that there is typeahead pending and * the character is stored in a single character buffer until ttgetc * is called. If the global variable 'leave' is set, the check for * typeahead is disabled. This is so that once the program knows that it's * about to exit, it doesn't eat the first character of your typeahead if * ttflsh gets called. 'leave' should also be set before shell escapes and * suspends. */ int ttflsh(void); extern int have; extern int leave; /* void ttsig(int n); Signal handler you provide. This is called if the * editor gets a hangup signal, termination signal or if the input closes. * It is called with 'n' set to the number of the caught signal or 0 if the * input closed. */ RETSIGTYPE ttsig(int sig) __attribute__((__noreturn__)); void ttabrt(int, const char *); /* void ttgtsz(int *x,int *y); Get size of screen from ttsize/winsize * structure */ void ttgtsz(int *x, int *y); /* You don't have to call these: ttopen/ttclose does it for you. These * may be needed to make your own shell escape sequences. */ /* void sigjoe(void); Set the signal handling for joe. I.E., ignore all * signals the user can generate from the keyboard (SIGINT, SIGPIPE) * and trap the software terminate and hangup signals (SIGTERM, SIGHUP) so * that 'ttsig' gets called. */ void sigjoe(void); /* void signrm(int inchild); Set above signals back to their default values. */ void signrm(int); /* MPX *mpxmk(int fd,int pid, * void (*func)(),void *object, * void (*die)(),void *dieobj, * ); * * Create an asynchronous input source handler for a process * Child process id in 'pid' * File descriptor to get input from in 'fd' * Function to call with received characters in 'func' * Function to call when process dies in 'die' * The first arg passed to func and die is object and dieobj */ MPX *mpxmk(int *ptyfd, const unsigned char *cmd, unsigned char **args, void (*func)(B *, unsigned char *, int), void *object, void (*die)(B *), void *dieobj); extern int noxon; extern int Baud; void tickoff(void); void tickon(void); #endif jupp/tw.c010064400000000000000000000412221426611552400075700ustar00/* * Text editing windows * Copyright * (C) 1992 Joseph H. Allen * Copyright © 2004, 2007, 2010, 2016, 2017, 2018, 2022 * mirabilos * * This file is part of JOE (Joe's Own Editor) */ #include "config.h" #include "types.h" __RCSID("$MirOS: contrib/code/jupp/tw.c,v 1.26 2022/07/21 00:18:01 tg Exp $"); #include #include #ifdef HAVE_TIME_H #include #endif #ifdef HAVE_BSD_STRING_H #include #endif #include "b.h" #include "bw.h" #include "macro.h" #include "main.h" #include "qw.h" #include "scrn.h" #include "uedit.h" #include "ufile.h" #include "ushell.h" #include "utils.h" #include "vs.h" #include "syntax.h" #include "charmap.h" #include "tw.h" #include "w.h" #if !HAVE_DECL_CTIME char *ctime(const time_t *); #endif extern int square; int staen = 0; unsigned char staupd = 0; int keepup = 0; unsigned char closedall = 0; /* Move text window */ static void movetw(jobject jO, int x, int y) { BW *bw = jO.bw; TW *tw = (TW *) bw->object; if (y || !staen) { if (!tw->staon) { /* Scroll down and shrink */ nscrldn(bw->parent->t->t, y, bw->parent->nh + y, 1); } bwmove(bw, x + (bw->o.linums ? LINCOLS : 0), y + 1); tw->staon = 1; } else { if (tw->staon) { /* Scroll up and grow */ nscrlup(bw->parent->t->t, y, bw->parent->nh + y, 1); } bwmove(bw, x + (bw->o.linums ? LINCOLS : 0), y); tw->staon = 0; } } /* Resize text window */ static void resizetw(jobject jO, int wi, int he) { BW *bw = jO.bw; if (bw->parent->ny || !staen) bwresz(bw, wi - (bw->o.linums ? LINCOLS : 0), he - 1); else bwresz(bw, wi - (bw->o.linums ? LINCOLS : 0), he); } /* Get current context */ /* Find first line (going backwards) which has 0 indentation level * and is not a comment, blank, or block structuring line. This is * likely to be the line with the function name. * * There are actually two possibilities: * * We want the first line- * * int * foo(int x,int y) { * * } * * We want the last line- * * program foo(input,output); * var a, b, c : real; * begin * */ static unsigned char * get_context(BW *bw) { P *p = pdup(bw->cursor); static unsigned char buf1[stdsiz]; buf1[0] = 0; /* Find first line with 0 indentation which is not a comment line */ do { p_goto_bol(p); if (!pisindent(p) && !pisblank(p)) { /* Uncomment to get the last line instead of the first line (see above) next: */ brzs(p,stdbuf,stdsiz-1); /* Ignore comment and block structuring lines */ if (!(stdbuf[0]=='{' || (stdbuf[0]=='/' && stdbuf[1]=='*') || (stdbuf[0]=='\f') || (stdbuf[0]=='/' && stdbuf[1]=='/') || (stdbuf[0]=='#') || ((stdbuf[0] | 0x20) == 'b' && (stdbuf[1] | 0x20) == 'e' && (stdbuf[2] | 0x20) == 'g' && (stdbuf[3] | 0x20) == 'i' && (stdbuf[4] | 0x20) == 'n') || (stdbuf[0]=='-' && stdbuf[1]=='-') || stdbuf[0]==';')) { strlcpy(buf1,stdbuf,stdsiz); /* Uncomment to get the last line instead of the first line (see above) if (pprevl(p)) { p_goto_bol(p); if (!pisindent(p) && !pisblank(p)) goto next; } */ break; } } } while (!buf1[0] && pprevl(p)); prm(p); return buf1; } static unsigned char * stagen(unsigned char *stalin, BW *bw, const unsigned char *s, int fill) { const unsigned char *ccp; unsigned char *cp, uc; unsigned char buf[80]; int x; W *w = bw->parent; time_t tt; int special_aA = 0; ccp = s; while ((cp = strstr(ccp, "%a")) != NULL) { cp += /* %a */ 2; if (cp[1] == '%') ++cp; if (cp[0] == '%' && cp[1] == 'A') { special_aA = 1; break; } } if (!special_aA) while ((cp = strstr(ccp, "%A")) != NULL) { cp += /* %A */ 2; if (cp[1] == '%') ++cp; if (cp[0] == '%' && cp[1] == 'a') { special_aA = 1; break; } } stalin = vstrunc(stalin, 0); while (*s) { if (*s == '%' && s[1]) { switch (*++s) { case 'x': /* Context (but only if autoindent is enabled) */ if (bw->o.autoindent) { ccp = get_context(bw); stalin = vsncpy(sv(stalin), sz(ccp)); } break; case 'y': if (bw->o.syntax) { joe_snprintf_1((char *)buf, sizeof(buf), "(%s)", bw->o.syntax->name); stalin = vsncpy(sv(stalin), sz(buf)); } break; case 't': tt = time(NULL); ccp = (unsigned char *)ctime(&tt); x = (ccp[11] - '0') * 10 + ccp[12] - '0'; if (x > 12) x -= 12; joe_snprintf_1((char *)buf, sizeof(buf), "%2.2d", x); if (buf[0] == '0') buf[0] = fill; stalin = vsncpy(sv(stalin), buf, 2); stalin = vsncpy(sv(stalin), ccp + 13, 3); break; case 'u': tt = time(NULL); ccp = (unsigned char *)ctime(&tt); stalin = vsncpy(sv(stalin), ccp + 11, 5); break; case 'T': if (bw->o.overtype) stalin = vsadd(stalin, 'O'); else stalin = vsadd(stalin, 'I'); break; case 'W': if (bw->o.wordwrap) stalin = vsadd(stalin, 'W'); else stalin = vsadd(stalin, fill); break; case 'I': if (bw->o.autoindent) stalin = vsadd(stalin, 'A'); else stalin = vsadd(stalin, fill); break; case 'X': if (square) stalin = vsadd(stalin, 'X'); else stalin = vsadd(stalin, fill); break; case 'n': if (!bw->b->name) { stalin = vsncpy(sv(stalin), sc("Unnamed")); break; } ccp = bw->b->name; escape_loop: switch ((uc = *ccp++)) { case '\\': stalin = vsadd(stalin, uc); /* FALLTHROUGH */ default: stalin = vsadd(stalin, uc); goto escape_loop; case '\0': break; } break; case 'm': if (bw->b->changed) stalin = vsncpy(sv(stalin), sc("(Modified)")); break; case 'R': if (bw->b->rdonly) stalin = vsncpy(sv(stalin), sc("(Read only)")); break; case '*': if (bw->b->changed) stalin = vsadd(stalin, '*'); else stalin = vsadd(stalin, fill); break; case 'r': joe_snprintf_1((char *)buf, sizeof(buf), "%-4ld", bw->cursor->line + 1); for (x = 0; buf[x]; ++x) if (buf[x] == ' ') buf[x] = fill; stalin = vsncpy(sv(stalin), sz(buf)); break; case 'o': joe_snprintf_1((char *)buf, sizeof(buf), "%-4ld", bw->cursor->byte); for (x = 0; buf[x]; ++x) if (buf[x] == ' ') buf[x] = fill; stalin = vsncpy(sv(stalin), sz(buf)); break; case 'O': joe_snprintf_1((char *)buf, sizeof(buf), "%-4lX", bw->cursor->byte); for (x = 0; buf[x]; ++x) if (buf[x] == ' ') buf[x] = fill; stalin = vsncpy(sv(stalin), sz(buf)); break; case 'a': if (joe_maputf(bw->b->o.charmap) && !(special_aA && (brch(bw->cursor) & 0x80000000))) { /* UTF-8: don't display decimal value */ buf[0] = 'u'; buf[1] = 0; } else { if (!piseof(bw->cursor)) joe_snprintf_1((char *)buf, sizeof(buf), "%3d", 255 & brc(bw->cursor)); else joe_snprintf_0((char *)buf, sizeof(buf), " "); for (x = 0; buf[x]; ++x) if (buf[x] == ' ') buf[x] = fill; } stalin = vsncpy(sv(stalin), sz(buf)); break; case 'A': if (joe_maputf(bw->b->o.charmap)) { /* UTF-8, display UCS-2 value */ if (!piseof(bw->cursor)) { int uch = brch(bw->cursor); if (uch & 0x80000000) joe_snprintf_1((char *)buf, sizeof(buf), special_aA ? "%02X" : " %02X", uch & 0xFF); else joe_snprintf_1((char *)buf, sizeof(buf), "%04X", uch); } else joe_snprintf_0((char *)buf, sizeof(buf), " "); } else { if (!piseof(bw->cursor)) joe_snprintf_1((char *)buf, sizeof(buf), "%2.2X", 255 & brc(bw->cursor)); else joe_snprintf_0((char *)buf, sizeof(buf), " "); } for (x = 0; buf[x]; ++x) if (buf[x] == ' ') buf[x] = fill; stalin = vsncpy(sv(stalin), sz(buf)); break; case 'c': joe_snprintf_1((char *)buf, sizeof(buf), "%-3ld", piscol(bw->cursor) + 1); for (x = 0; buf[x]; ++x) if (buf[x] == ' ') buf[x] = fill; stalin = vsncpy(sv(stalin), sz(buf)); break; case 'p': if (bw->b->eof->byte) joe_snprintf_1((char *)buf, sizeof(buf), "%3ld", bw->cursor->byte * 100 / bw->b->eof->byte); else joe_snprintf_0((char *)buf, sizeof(buf), "100"); for (x = 0; buf[x]; ++x) if (buf[x] == ' ') buf[x] = fill; stalin = vsncpy(sv(stalin), sz(buf)); break; case 'l': joe_snprintf_1((char *)buf, sizeof(buf), "%-4ld", bw->b->eof->line + 1); for (x = 0; buf[x]; ++x) if (buf[x] == ' ') buf[x] = fill; stalin = vsncpy(sv(stalin), sz(buf)); break; case 'k': cp = buf; buf[0] = 0; if (w->kbd->x && w->kbd->seq[0]) for (x = 0; x != w->kbd->x; ++x) { uc = w->kbd->seq[x] & 127; if (uc < 32) { cp[0] = '^'; cp[1] = uc + '@'; cp += 2; } else if (uc == 127) { cp[0] = '^'; cp[1] = '?'; cp += 2; } else { cp[0] = uc; cp += 1; } } *cp++ = fill; while (cp - buf < 4) *cp++ = fill; stalin = vsncpy(sv(stalin), buf, cp - buf); break; case 'S': if (bw->b->pid) stalin = vsncpy(sv(stalin), sc("*SHELL*")); break; case 'M': if (recmac) { joe_snprintf_1((char *)buf, sizeof(buf), "(Macro %d recording...)", recmac->n); stalin = vsncpy(sv(stalin), sz(buf)); } break; default: stalin = vsadd(stalin, *s); } } else stalin = vsadd(stalin, *s); ++s; } return stalin; } static void disptw(jobject jO, int flg) { BW *bw = jO.bw; W *w = bw->parent; TW *tw = (TW *) bw->object; if (bw->o.linums != bw->linums) { bw->linums = bw->o.linums; resizetw(jO, w->w, w->h); movetw(jO, w->x, w->y); bwfllw(jO); } if (bw->o.hex) { w->cury = (bw->cursor->byte-bw->top->byte)/16 + bw->y - w->y; w->curx = (bw->cursor->byte-bw->top->byte)%16 + 60 - bw->offset; } else { w->cury = bw->cursor->line - bw->top->line + bw->y - w->y; w->curx = bw->cursor->xcol - bw->offset + (bw->o.linums ? LINCOLS : 0); } if ((staupd || keepup || bw->cursor->line != tw->prevline || bw->b->changed != tw->changed || bw->b != tw->prev_b) && (w->y || !staen)) { int fill; tw->prevline = bw->cursor->line; tw->changed = bw->b->changed; tw->prev_b = bw->b; if (bw->o.rmsg[0]) fill = bw->o.rmsg[0]; else fill = ' '; tw->stalin = stagen(tw->stalin, bw, bw->o.lmsg, fill); tw->staright = stagen(tw->staright, bw, bw->o.rmsg, fill); if (fmtlen(tw->staright) < w->w) { int x = fmtpos(tw->stalin, w->w - fmtlen(tw->staright)); if (x > sLEN(tw->stalin)) tw->stalin = vsfill(sv(tw->stalin), fill, x - sLEN(tw->stalin)); tw->stalin = vsncpy(tw->stalin, fmtpos(tw->stalin, w->w - fmtlen(tw->staright)), sv(tw->staright)); } tw->stalin = vstrunc(tw->stalin, fmtpos(tw->stalin, w->w)); genfmt(w->t->t, w->x, w->y, 0, tw->stalin, 0); w->t->t->updtab[w->y] = 0; } if (flg) { if (bw->o.hex) bwgenh(bw); else bwgen(bw, bw->o.linums); } } /* Split current window */ static void iztw(TW *tw, int y) { tw->stalin = NULL; tw->staright = NULL; tw->changed = -1; tw->prevline = -1; tw->staon = (!staen || y); tw->prev_b = 0; } extern int dostaupd; int usplitw(BW *bw) { W *w = bw->parent; int newh = getgrouph(w); W *new; TW *newtw; BW *newbw; dostaupd = 1; if (newh / 2 < FITHEIGHT) return -1; new = wcreate(w->t, w->watom, findbotw(w), NULL, w, newh / 2 + (newh & 1), NULL, NULL); if (!new) return -1; wfit(new->t); new->object.bw = newbw = bwmk(new, bw->b, 0); ++bw->b->count; newbw->offset = bw->offset; newbw->object = newtw = malloc(sizeof(TW)); iztw(newtw, new->y); pset(newbw->top, bw->top); pset(newbw->cursor, bw->cursor); newbw->cursor->xcol = bw->cursor->xcol; new->t->curwin = new; return 0; } int uduptw(BW *bw) { W *w = bw->parent; int newh = getgrouph(w); W *new; TW *newtw; BW *newbw; dostaupd = 1; new = wcreate(w->t, w->watom, findbotw(w), NULL, NULL, newh, NULL, NULL); if (!new) return -1; if (demotegroup(w)) new->t->topwin = new; new->object.bw = newbw = bwmk(new, bw->b, 0); ++bw->b->count; newbw->offset = bw->offset; newbw->object = newtw = malloc(sizeof(TW)); iztw(newtw, new->y); pset(newbw->top, bw->top); pset(newbw->cursor, bw->cursor); newbw->cursor->xcol = bw->cursor->xcol; new->t->curwin = new; wfit(w->t); return 0; } static void instw(BW *bw, B *b, long int l, long int n, int flg) { if (b == bw->b) bwins(bw, l, n, flg); } static void deltw(BW *bw, B *b, long int l, long int n, int flg) { if (b == bw->b) bwdel(bw, l, n, flg); } WATOM watomtw = { UC "main", disptw, bwfllw, NULL, rtntw, utypebw, resizetw, movetw, instw, deltw, TYPETW }; int abortit(BW *bw) { W *w; TW *tw; B *b; if (bw->parent->watom != &watomtw) return wabort(bw->parent); if (bw->b->pid && bw->b->count==1) return ukillpid(bw); w = bw->parent; tw = (TW *) bw->object; /* If only one main window on the screen... */ if (countmain(w->t) == 1) { /* Replace it with an orphaned buffer if there are any */ if ((b = borphan()) != NULL) { void *object = bw->object; /* FIXME: Shouldn't we wabort() and wcreate here to kill any prompt windows? */ bwrm(bw); w->object.bw = bw = bwmk(w, b, 0); wredraw(bw->parent); bw->object = object; return 0; } closedall = 1; } bwrm(bw); vsrm(tw->stalin); free(tw); w->object.base = NULL; wabort(w); /* Eliminate this window and it's children */ return 0; } /* User routine for aborting a text window */ static int naborttw(BW *bw, int k, void *object, int *notify) { if (notify) *notify = 1; if ((k | 0x20) != 'y') return -1; genexmsg(bw, 0, NULL); return abortit(bw); } static int naborttw1(BW *bw, int k, void *object, int *notify) { if (notify) *notify = 1; if ((k | 0x20) != 'y') return -1; if (!exmsg) genexmsg(bw, 0, NULL); return abortit(bw); } /* k is last character types which lead to uabort. If k is -1, it means uabort was called internally, and not by the user: which means uabort will not send Ctrl-C to process */ int uabort(BW *bw, int k) { if (bw->parent->watom != &watomtw) return wabort(bw->parent); if (bw->b->pid && bw->b->count==1) return ukillpid(bw); if (bw->b->changed && bw->b->count == 1 && !bw->b->scratch) if (mkqw(bw->parent, sc("Lose changes to this file (y,n,^C)? "), naborttw, NULL, NULL, NULL)) return 0; else return -1; else return naborttw(bw, 'y', NULL, NULL); } int ucancel(BW *bw, int k) { if (bw->parent->watom != &watomtw) { wabort(bw->parent); return 0; } else return uabort(bw,k); } /* Same as above, but only calls genexmsg if nobody else has */ int uabort1(BW *bw, int k) { if (bw->parent->watom != &watomtw) return wabort(bw->parent); if (bw->b->pid && bw->b->count==1) return ukillpid(bw); if (bw->b->changed && bw->b->count == 1 && !bw->b->scratch) if (mkqw(bw->parent, sc("Lose changes to this file (y,n,^C)? "), naborttw1, NULL, NULL, NULL)) return 0; else return -1; else return naborttw1(bw, 'y', NULL, NULL); } /* Abort buffer without prompting: just fail if this is last window on buffer */ int uabortbuf(BW *bw) { W *w = bw->parent; B *b; if (bw->b->pid && bw->b->count==1) return ukillpid(bw); if (okrepl(bw)) return -1; if ((b = borphan()) != NULL) { void *object = bw->object; bwrm(bw); w->object.bw = bw = bwmk(w, b, 0); wredraw(bw->parent); bw->object = object; return 0; } return naborttw(bw, 'y', NULL, NULL); } /* Kill current window (orphans buffer) */ int utw0(BASE *b) { BW *bw = b->parent->main->object.bw; if (countmain(b->parent->t) == 1) return -1; if (bw->b->count == 1) orphit(bw); return uabort(bw, -1); } /* Kill all other windows (orphans buffers) */ int utw1(BASE *b) { W *starting = b->parent; W *mainw = starting->main; SCREEN *t = mainw->t; int yn; do { yn = 0; loop: do { wnext(t); } while (t->curwin->main == mainw && t->curwin != starting); if (t->curwin->main != mainw) { BW *bw = t->curwin->main->object.bw; utw0((BASE *)bw); yn = 1; goto loop; } } while (yn); return 0; } void setline(B *b, long int line) { W *w = maint->curwin; do { if (w->watom->what == TYPETW) { BW *bw = w->object.bw; if (bw->b == b) { long oline = bw->top->line; pline(bw->top, line); pline(bw->cursor, line); if (w->y >= 0 && bw->top->line > oline && bw->top->line - oline < bw->h) nscrlup(w->t->t, bw->y, bw->y + bw->h, (int) (bw->top->line - oline)); else if (w->y >= 0 && bw->top->line < oline && oline - bw->top->line < bw->h) nscrldn(w->t->t, bw->y, bw->y + bw->h, (int) (oline - bw->top->line)); } } } while ((w = w->link.next) != maint->curwin); } /* Create a text window. It becomes the last window on the screen */ BW *wmktw(SCREEN *t, B *b) { W *w; BW *bw; TW *tw; w = wcreate(t, &watomtw, NULL, NULL, NULL, t->h, NULL, NULL); if (!w) return (NULL); wfit(w->t); w->object.bw = bw = bwmk(w, b, 0); bw->object = tw = malloc(sizeof(TW)); iztw(tw, w->y); return bw; } jupp/tw.h010064400000000000000000000011221363731763500076000ustar00/* * Text editing windows * Copyright * (C) 1992 Joseph H. Allen * * This file is part of JOE (Joe's Own Editor) */ #ifndef JUPP_TW_H #define JUPP_TW_H #ifdef EXTERN __IDSTRING(rcsid_tw_h, "$MirOS: contrib/code/jupp/tw.h,v 1.7 2020/03/27 06:38:58 tg Exp $"); #endif BW *wmktw(SCREEN *t, B *b); int usplitw(BW *bw); int uduptw(BW *bw); int utw0(BASE *b); int utw1(BASE *b); int uabortbuf(BW *bw); int ucancel(BW *bw, int k); int uabort(BW *bw, int k); int uabort1(BW *bw, int k); void setline(B *b, long int line); int abortit(BW *bw); extern int staen; extern WATOM watomtw; #endif jupp/types.h010064400000000000000000000477121364306522400103200ustar00#ifndef JUPP_TYPES_H #define JUPP_TYPES_H #ifdef EXTERN __IDSTRING(rcsid_types_h, "$MirOS: contrib/code/jupp/types.h,v 1.39 2020/04/07 11:56:41 tg Exp $"); #endif /*- * Copyright © 2004, 2005, 2006, 2007, 2008, 2011, 2012, 2013, * 2014, 2016, 2017, 2018, 2020 * Thorsten “mirabilos” Glaser * * Provided that these terms and disclaimer and all copyright notices * are retained or reproduced in an accompanying document, permission * is granted to deal in this work without restriction, including un†* limited rights to use, publicly perform, distribute, sell, modify, * merge, give away, or sublicence. * * This work is provided “AS IS” and WITHOUT WARRANTY of any kind, to * the utmost extent permitted by applicable law, neither express nor * implied; without malicious intent or gross negligence. In no event * may a licensor, author or contributor be held liable for indirect, * direct, other damage, loss, or other issues arising in any way out * of dealing in the work, even if advised of the possibility of such * damage or existence of a defect, except proven that it results out * of said person’s immediate fault when using the work as intended. */ /* Prefix to make string constants unsigned */ #define UC (const unsigned char *) #define US (unsigned char *) #define LINK(type) struct { type *next; type *prev; } #ifdef SMALL #define stdsiz 4096 #else #define stdsiz 8192 #endif #define FITHEIGHT 4 /* Minimum text window height */ #define LINCOLS 6 #define NPROC 8 /* Number of processes we keep track of */ #define UNDOKEEP 100 #define INC 16 /* Pages to allocate each time */ #define TYPETW 0x0100 #define TYPEPW 0x0200 #define TYPEMENU 0x0800 #define TYPEQW 0x1000 /* polymorph function pointers, which do not use compiler type checking */ #ifndef GCC_Wstrict_prototypes typedef int jpoly_int(); typedef void jpoly_void(); #else /* same content as above, but system header */ #include #endif struct jalloc_common { /*XXX these must be size_t not int */ /* * size part: number of elements that can be fit, * not counting the terminator or space needed for the header */ int esiz; /* * length part: number of elements currently in the array, * not counting the terminator */ int elen; }; #ifdef MKSH_ALLOC_CATCH_UNDERRUNS struct jalloc_item { struct jalloc_common enfo; size_t len; char dummy[8192 - sizeof(struct jalloc_common) - sizeof(size_t)]; }; #define ALLOC_INFO(f) enfo.f #define ALLOC_ITEM struct jalloc_item #else #define ALLOC_INFO(f) f #define ALLOC_ITEM struct jalloc_common #endif #define jalloc_krnl(i) ((ALLOC_ITEM *)((char *)(i) - sizeof(ALLOC_ITEM))) #define jalloc_user(i) ((void *)((char *)(i) + sizeof(ALLOC_ITEM))) #define jalloc_siz(i) (jalloc_krnl(i)->ALLOC_INFO(esiz)) #define jalloc_len(i) (jalloc_krnl(i)->ALLOC_INFO(elen)) #ifdef HAVE_LIMITS_H #include #endif #ifdef HAVE_STDINT_H #include #endif #ifndef SIZE_MAX #ifdef SIZE_T_MAX #define SIZE_MAX SIZE_T_MAX #else #define SIZE_MAX ((size_t)-1) #endif #endif #define notok2mul(max,val,c) (((val) != 0) && ((c) != 0) && \ (((max) / (c)) < (val))) #define notok2add(max,val,c) ((val) > ((max) - (c))) #define notoktomul(val,cnst) notok2mul(SIZE_MAX, (val), (cnst)) #define notoktoadd(val,cnst) notok2add(SIZE_MAX, (val), (cnst)) void jalloc_init(void); void *jalloc(void *, size_t, size_t); void jfree(void *); #define ralloc(nmemb,size) (notoktomul(nmemb, size) ? NULL : \ malloc((nmemb) * (size))) typedef struct header H; typedef struct buffer B; typedef struct point P; typedef struct options OPTIONS; typedef struct macro MACRO; typedef struct cmd CMD; typedef struct hentry HENTRY; typedef struct hash HASH; typedef struct kmap KMAP; typedef struct kbd KBD; typedef struct key KEY; typedef struct watom WATOM; typedef struct screen SCREEN; typedef struct window W; typedef struct base BASE; typedef struct bw BW; typedef struct menu MENU; typedef struct scrn SCRN; typedef struct cap CAP; typedef struct pw PW; typedef struct stditem STDITEM; typedef struct query QW; typedef struct tw TW; typedef struct irec IREC; typedef struct undo UNDO; typedef struct undorec UNDOREC; typedef struct search SRCH; typedef struct srchrec SRCHREC; typedef struct vpage VPAGE; typedef struct vfile VFILE; /* window.object* */ typedef union { BASE *base; MENU *menu; BW *bw; QW *qw; } jobject; struct header { LINK(H) link; /* LINK ??? */ long seg; /* ??? */ int hole; /* ??? */ int ehole; /* ??? */ int nlines; /* ??? */ }; struct point { LINK(P) link; /* ?LINK ??? */ B *b; /* ?B ??? */ int ofst; /* ??? */ unsigned char *ptr; /* ??? */ H *hdr; /* ?H ??? */ long byte; /* ??? */ long line; /* ??? */ long col; /* current column */ long xcol; /* ??? */ int valcol; /* bool: is col valid? */ int end; /* ??? */ P **owner; /* ??? */ }; struct options { OPTIONS *next; unsigned char *name_regex; unsigned char *contents_regex; int overtype; int lmargin; int rmargin; int autoindent; int wordwrap; int tab; int indentc; int istep; unsigned char *context; const unsigned char *lmsg; const unsigned char *rmsg; char *hmsg; int linums; int readonly; int french; int spaces; int crlf; int highlight; /* Set to enable highlighting */ unsigned char *syntax_name; /* Name of syntax to use */ struct high_syntax *syntax; /* Syntax for highlighting (load_dfa() from syntax_name happens in setopt()) */ unsigned char *map_name; /* Name of character set */ union charmap *charmap; /* Character set */ int smarthome; /* Set for smart home key */ int indentfirst; /* Smart home goes to indentation point first */ int smartbacks; /* Set for smart backspace key */ int purify; /* Purify indentation */ int picture; /* Picture mode */ MACRO *mnew; /* Macro to execute for new files */ MACRO *mold; /* Macro to execute for existing files */ MACRO *msnew; /* Macro to execute before saving new files */ MACRO *msold; /* Macro to execute before saving existing files */ int vispace; /* Set to make spaces visible */ int hex; /* Hex edit mode */ }; struct macro { int k; /* Keycode */ int arg; /* Repeat argument */ CMD *cmd; /* Command address */ int n; /* Number of steps */ int size; /* Malloc size of steps */ MACRO **steps; /* Block */ }; struct recmac { struct recmac *next; int n; MACRO *m; }; /* Command entry */ struct cmd { const unsigned char *name; /* Command name */ const unsigned char *negarg; /* Command to use if arg was negative */ jpoly_int *func; /* Function bound to name */ MACRO *m; /* Macro bound to name */ unsigned int flag; /* Execution flags */ int arg; /* 0= arg is meaningless, 1= ok */ }; struct buffer { LINK(B) link; P *bof; P *eof; unsigned char *name; long mod_time; /* Last modification time for file */ int orphan; int count; int changed; int backup; void *undo; P *marks[11]; /* Bookmarks */ OPTIONS o; /* Options */ P *oldcur; /* Last cursor position before orphaning */ P *oldtop; /* Last top screen position before orphaning */ int rdonly; /* Set for read-only */ int internal; /* Set for internal buffers */ int scratch; /* Set for scratch buffers */ int er; /* Error code when file was loaded */ pid_t pid; /* Process id */ int out; /* fd to write to process */ }; struct hentry { const unsigned char *name; HENTRY *next; void *val; }; struct hash { int len; HENTRY **tab; }; struct help { struct help *prev; /* previous help screen */ struct help *next; /* nex help screen */ unsigned char *name; /* context name for context sensitive help */ unsigned char *text; /* help text with attributes */ unsigned int lines; /* number of lines */ }; /* A key binding */ struct key { int k; /* Flag: 0=binding, 1=submap */ union { void *bind; /* What key is bound to */ KMAP *submap; /* Sub KMAP address (for prefix keys) */ } value; }; /* A map of keycode (octet) to command/sub-map bindings */ struct kmap { KEY keys[256]; /* KEYs */ }; /** A keyboard handler **/ struct kbd { KMAP *curmap; /* Current keymap */ KMAP *topmap; /* Top-level keymap */ int seq[16]; /* Current sequence of keys */ int x; /* What we're up to */ }; struct watom { const unsigned char *context; /* Context name */ void (*disp)(jobject, int); /* Display window */ void (*follow)(jobject); /* Display window */ int (*abort)(jobject); /* Common user functions */ int (*rtn)(jobject); int (*type)(jobject, int); /* Called when… */ void (*resize)(jobject, int, int); /* window changed size */ void (*move)(jobject, int, int); /* window moved */ void (*ins)(BW *, B *, long, long, int); /* on line insertions */ void (*del)(BW *, B *, long, long, int); /* on line deletions */ int what; /* Type of this thing */ }; struct screen { SCRN *t; /* Screen data on this screen is output to */ int wind; /* Number of help lines on this screen */ W *topwin; /* Top-most window showing on screen */ W *curwin; /* Window cursor is in */ int w, h; /* Width and height of this screen */ }; struct window { LINK(W) link; /* Linked list of windows in order they appear on the screen */ SCREEN *t; /* Screen this thing is on */ int x, y, w, h; /* Position and size of window */ /* Currently, x = 0, w = width of screen. */ /* y == -1 if window is not on screen */ int ny, nh; /* Temporary values for wfit */ int reqh; /* Requested new height or 0 for same */ /* This is an argument for wfit */ int fixed; /* If this is zero, use 'hh'. If not, this is a fixed size window and this variable gives its height */ int hh; /* Height window would be on a screen with 1000 lines. When the screen size changes this is used to calculate the window's real height */ W *win; /* Window this one operates on */ W *main; /* Main window of this family */ W *orgwin; /* Window where space from this window came */ int curx, cury; /* Cursor position within window */ KBD *kbd; /* Keyboard handler for this window */ WATOM *watom; /* The type of this window */ jobject object; /* Object which inherits this */ const unsigned char *msgt; /* Message at top of window */ const unsigned char *msgb; /* Message at bottom of window */ const unsigned char *huh; /* Name of window for context sensitive hlp */ int *notify; /* Address of kill notification flag */ }; /* Anything which goes in window.object must start like this: */ struct base { W *parent; }; struct bw { W *parent; B *b; P *top; P *cursor; long offset; SCREEN *t; int h, w, x, y; OPTIONS o; void *object; int linums; int top_changed; /* Top changed */ }; struct menu { W *parent; /* Window we're in */ unsigned char **list; /* List of items */ int top; /* First item on screen */ int cursor; /* Item cursor is on */ int width; /* Width of widest item, up to 'w' max */ int perline; /* Number of items on each line */ int nitems; /* No. items in list */ int saved_co; /* Saved #columns of screen */ SCREEN *t; /* Screen we're on */ int h, w, x, y; jpoly_int *abrt; /* Abort callback function */ jpoly_int *func; /* Return callback function */ jpoly_int *backs; /* Backspace callback function */ void *object; }; struct s_hentry { int next; int loc; }; /* Each terminal has one of these */ struct scrn { CAP *cap; /* Termcap/Terminfo data */ int li; /* Screen height */ int co; /* Screen width */ const unsigned char *ti; /* Initialisation string */ const unsigned char *cl; /* Home and clear screen... really an init. string */ const unsigned char *cd; /* Clear to end of screen */ const unsigned char *te; /* Restoration string */ int haz; /* Terminal can't print ~s */ int os; /* Terminal overstrikes */ int eo; /* Can use blank to erase even if os */ int ul; /* _ overstrikes */ int am; /* Terminal has autowrap, but not magicwrap */ int xn; /* Terminal has magicwrap */ const unsigned char *so; /* Enter standout (inverse) mode */ const unsigned char *se; /* Exit standout mode */ const unsigned char *us; /* Enter underline mode */ const unsigned char *ue; /* Exit underline mode */ const unsigned char *uc; /* Single time underline character */ int ms; /* Ok to move when in standout/underline mode */ const unsigned char *mb; /* Enter blinking mode */ const unsigned char *md; /* Enter bold mode */ const unsigned char *mh; /* Enter dim mode */ const unsigned char *mr; /* Enter inverse mode */ const unsigned char *me; /* Exit above modes */ const unsigned char *Sb; /* Set background color */ const unsigned char *Sf; /* Set foregrond color */ int ut; /* Screen erases with background color */ int da, db; /* Extra lines exist above, below */ const unsigned char *al, *dl, *AL, *DL; /* Insert/delete lines */ const unsigned char *cs; /* Set scrolling region */ int rr; /* Set for scrolling region relative addressing */ const unsigned char *sf, *SF, *sr, *SR; /* Scroll */ const unsigned char *dm, *dc, *DC, *ed; /* Delete characters */ const unsigned char *im, *ic, *IC, *ip, *ei; /* Insert characters */ int mi; /* Set if ok to move while in insert mode */ const unsigned char *bs; /* Move cursor left 1 */ int cbs; const unsigned char *lf; /* Move cursor down 1 */ int clf; const unsigned char *up; /* Move cursor up 1 */ int cup; const unsigned char *nd; /* Move cursor right 1 */ const unsigned char *ta; /* Move cursor to next tab stop */ int cta; const unsigned char *bt; /* Move cursor to previous tab stop */ int cbt; int tw; /* Tab width */ const unsigned char *ho; /* Home cursor to upper left */ int cho; const unsigned char *ll; /* Home cursor to lower left */ int cll; const unsigned char *cr; /* Move cursor to left edge */ int ccr; const unsigned char *RI; /* Move cursor right n */ int cRI; const unsigned char *LE; /* Move cursor left n */ int cLE; const unsigned char *UP; /* Move cursor up n */ int cUP; const unsigned char *DO; /* Move cursor down n */ int cDO; const unsigned char *ch; /* Set cursor column */ int cch; const unsigned char *cv; /* Set cursor row */ int ccv; const unsigned char *cV; /* Goto beginning of specified line */ int ccV; const unsigned char *cm; /* Set cursor row and column */ int ccm; const unsigned char *ce; /* Clear to end of line */ int cce; /* Basic abilities */ int scroll; /* Set to use scrolling */ int insdel; /* Set to use insert/delete within line */ /* Current state of terminal */ int *scrn; /* Characters on screen */ int *attr; /* Attributes on screen */ int x, y; /* Current cursor position (-1 for unknown) */ int top, bot; /* Current scrolling region */ int attrib; /* Current character attributes */ int ins; /* Set if we're in insert mode */ int *updtab; /* Dirty lines table */ int *syntab; int avattr; /* Bits set for available attributes */ int *sary; /* Scroll buffer array */ int *compose; /* Line compose buffer */ int *ofst; /* stuff for magic */ struct s_hentry *htab; struct s_hentry *ary; }; struct sortentry { unsigned char *name; unsigned char *value; }; struct cap { unsigned char *tbuf; /* Termcap entry loaded here */ struct sortentry *sort; /* Pointers to each capability stored in here */ int sortlen; /* Number of capabilities */ unsigned char *abuf; /* For terminfo compatible version */ unsigned char *abufp; int div; /* tenths of MS per char */ int baud; /* Baud rate */ const unsigned char *pad; /* Padding string or NULL to use NUL */ int (*out)(int); /* character output routine */ int dopadding; /* Set if pad characters should be used */ const char *paste_on; /* Enable bracketed paste mode */ const char *paste_off; /* Disable bracketed paste mode */ }; struct pw { jpoly_int *pfunc; /* Func which gets called when RTN is hit */ jpoly_int *abrt; /* Func which gets called when window is aborted */ jpoly_int *tab; /* Func which gets called when TAB is hit */ unsigned char *prompt; /* Prompt string */ int promptlen; /* Width of prompt string */ int promptofst; /* Prompt scroll offset */ B *hist; /* History buffer */ void *object; /* Object */ }; struct stditem { LINK(STDITEM) link; }; struct query { W *parent; /* Window we're in */ jpoly_int *func; /* Func. which gets called when key is hit */ jpoly_int *abrt; void *object; unsigned char *prompt; /* Prompt string */ int promptlen; /* Width of prompt string */ int promptofst; /* Prompt scroll offset */ }; typedef struct mpx MPX; struct mpx { int ackfd; /* Packetizer response descriptor */ int kpid; /* Packetizer process id */ int pid; /* Client process id */ jpoly_void *func; /* Function to call when read occures */ void *object; /* First arg to pass to function */ jpoly_void *die; /* Function: call when client dies or closes */ void *dieobj; }; struct tw { unsigned char *stalin; /* Status line info */ unsigned char *staright; int staon; /* Set if status line was on */ long prevline; /* Previous cursor line number */ int changed; /* Previous changed value */ B *prev_b; /* Previous buffer (we need to update status line on nbuf/pbuf) */ }; struct irec { LINK(IREC) link; int what; /* 0 repeat, >0 append n chars */ long start; /* Cursor search position */ long disp; /* Original cursor position */ int wrap_flag; /* Wrap flag */ }; struct isrch { IREC irecs; /* Linked list of positions */ unsigned char *pattern; /* Search pattern string */ unsigned char *prompt; /* Prompt (usually same as pattern unless utf-8/byte conversion) */ int ofst; /* Offset in pattern past prompt */ int dir; /* 0=fwrd, 1=bkwd */ int quote; /* Set to quote next char */ }; struct undorec { LINK(UNDOREC) link; UNDOREC *unit; int min; int changed; /* Status of modified flag before this record */ long where; /* Buffer address of this record */ long len; /* Length of insert or delete */ int del; /* Set if this is a delete */ B *big; /* Set to buffer containing a large amount of deleted data */ unsigned char *small; /* Set to malloc block containg a small amount of deleted data */ }; struct undo { LINK(UNDO) link; B *b; int nrecs; UNDOREC recs; UNDOREC *ptr; UNDOREC *first; UNDOREC *last; }; struct srchrec { LINK(SRCHREC) link; /* Linked list of search & replace locations */ int yn; /* Did we replace? */ int wrap_flag; /* Did we wrap? */ long addr; /* Where we were */ }; struct search { unsigned char *pattern; /* Search pattern */ unsigned char *replacement; /* Replacement string */ int backwards; /* Set if search should go backwards */ int ignore; /* Set if we should ignore case */ int repeat; /* Set with repeat count (or -1 for no repeat count) */ int replace; /* Set if this is search & replace */ int rest; /* Set to do remainder of search & replace w/o query */ unsigned char *entire; /* Entire matched string */ unsigned char *pieces[26]; /* Pieces of the matched string */ int flg; /* Set after prompted for first replace */ SRCHREC recs; /* Search & replace position history */ P *markb, *markk; /* Original marks */ P *wrap_p; /* Wrap point */ int wrap_flag; /* Set if we've wrapped */ int valid; /* Set if original marks are a valid block */ long addr; /* Addr of last replacement or -1 for none */ int block_restrict; /* Search restricted to marked block */ }; /* Page header */ struct vpage { VPAGE *next; /* Next page with same hash value */ VFILE *vfile; /* Owner vfile */ long addr; /* Address of this page */ int count; /* Reference count */ int dirty; /* Set if page changed */ unsigned char *data; /* The data in the page */ }; /* File structure */ struct vfile { LINK(VFILE) link; /* Doubly linked list of vfiles */ long size; /* Number of bytes in physical file */ long alloc; /* Number of bytes allocated to file */ int fd; /* Physical file */ int writeable; /* Set if we can write */ unsigned char *name; /* File name. 0 if unnamed */ int flags; /* Set if this is only a temporary file */ /* For array I/O */ unsigned char *vpage1; /* Page address */ long addr; /* File address of above page */ /* For stream I/O */ unsigned char *bufp; /* Buffer pointer */ unsigned char *vpage; /* Buffer pointer points in here */ int left; /* Space left in bufp */ int lv; /* Amount of append space at end of buffer */ }; #endif jupp/ublock.c010064400000000000000000000570641363731415400104310ustar00/* * Highlighted block functions * Copyright * (C) 1992 Joseph H. Allen * * This file is part of JOE (Joe's Own Editor) */ #include "config.h" #include "types.h" __RCSID("$MirOS: contrib/code/jupp/ublock.c,v 1.33 2020/03/27 06:08:17 tg Exp $"); #include #include #include #include "b.h" #include "pw.h" #include "queue.h" #include "scrn.h" #include "tty.h" #include "ublock.h" #include "uedit.h" #include "utils.h" #include "vs.h" #include "path.h" #include "poshist.h" #include "ushell.h" #include "charmap.h" #include "w.h" /* Global options */ int square = 0; /* Set for rectangle mode */ int lightoff = 0; /* Set if highlighting should turn off after block operations */ extern int marking; /* Global variables */ P *markb = NULL; /* Beginning and end of block */ P *markk = NULL; /* Push markb & markk */ typedef struct marksav MARKSAV; struct marksav { LINK(MARKSAV) link; P *markb, *markk; } markstack = { { &markstack, &markstack}, NULL, NULL }; MARKSAV markfree = { {&markfree, &markfree}, NULL, NULL }; int nstack = 0; int upsh(BW *bw) { MARKSAV *m = alitem(&markfree, sizeof(MARKSAV)); m->markb = 0; m->markk = 0; if (markk) pdupown(markk, &m->markk); if (markb) pdupown(markb, &m->markb); enqueb(MARKSAV, link, &markstack, m); ++nstack; return 0; } int upop(BW *bw) { MARKSAV *m = markstack.link.prev; if (m != &markstack) { --nstack; prm(markk); prm(markb); markk = m->markk; if (markk) markk->owner = &markk; markb = m->markb; if (markb) markb->owner = &markb; demote(MARKSAV, link, &markfree, m); if (lightoff) unmark(bw); updall(); return 0; } else return -1; } /* Return true if markb/markk are valid */ /* If r is set, swap markb with markk if necessary */ int autoswap; int markv(int r) { if (markb && markk && markb->b == markk->b && markk->byte > markb->byte && (!square || markk->xcol > markb->xcol)) { return 1; } else if(autoswap && r && markb && markk && markb->b == markk->b && markb->byte > markk->byte && (!square || markk->xcol < markb->xcol)) { P *p = pdup(markb); prm(markb); markb=0; pdupown(markk, &markb); prm(markk); markk=0; pdupown(p, &markk); prm(p); return 1; } else return 0; } /* Rectangle-mode subroutines */ /* B *pextrect(P *org,long height,long left,long right); * Copy a rectangle into a new buffer * * org points to top-left corner of rectangle. * height is number of lines in rectangle. * right is rightmost column of rectangle + 1 */ B *pextrect(P *org, long int height, long int right) { P *p = pdup(org); /* Left part of text to extract */ P *q = pdup(p); /* After right part of text to extract */ B *tmp = bmk(NULL); /* Buffer to extract to */ P *z = pdup(tmp->eof); /* Buffer pointer */ while (height--) { pcol(p, org->xcol); pset(q, p); pcolwse(q, right); p_goto_eof(z); binsb(z, bcpy(p, q)); p_goto_eof(z); binsc(z, '\n'); pnextl(p); } prm(p); prm(q); prm(z); return tmp; } /* void pdelrect(P *org,long height,long right); * Delete a rectangle. */ void pdelrect(P *org, long int height, long int right) { P *p = pdup(org); P *q = pdup(p); while (height--) { pcol(p, org->xcol); pset(q, p); pcol(q, right); bdel(p, q); pnextl(p); } prm(p); prm(q); } /* void pclrrect(P *org,long height,long right,int usetabs); * Blank-out a rectangle. */ void pclrrect(P *org, long int height, long int right, int usetabs) { P *p = pdup(org); P *q = pdup(p); while (height--) { long pos; pcol(p, org->xcol); pset(q, p); pcoli(q, right); pos = q->col; bdel(p, q); pfill(p, pos, usetabs); pnextl(p); } prm(p); prm(q); } /* int ptabrect(P *org,long height,long right) * Check if there are any TABs in a rectangle */ int ptabrect(P *org, long int height, long int right) { P *p = pdup(org); while (height--) { int c; pcol(p, org->xcol); while ((c = pgetc(p)) != NO_MORE_DATA && c != '\n') { if (c == '\t') { prm(p); return '\t'; } else if (piscol(p) > right) break; } if (c != '\n') pnextl(p); } prm(p); return ' '; } /* Insert rectangle */ void pinsrect(P *cur, B *tmp, long int width, int usetabs) { P *p = pdup(cur); /* We insert at & move this pointer */ P *q = pdup(tmp->bof); /* These are for scanning through 'tmp' */ P *r = pdup(q); if (width) while (pset(r, q), p_goto_eol(q), (q->line != tmp->eof->line || piscol(q))) { pcol(p, cur->xcol); if (piscol(p) < cur->xcol) pfill(p, cur->xcol, usetabs); binsb(p, bcpy(r, q)); pfwrd(p, q->byte - r->byte); if (piscol(p) < cur->xcol + width) pfill(p, cur->xcol + width, usetabs); if (piseol(p)) pbackws(p); if (!pnextl(p)) { binsc(p, '\n'); pgetc(p); } if (pgetc(q) == NO_MORE_DATA) break; } prm(p); prm(q); prm(r); } /* Block functions */ /* Set beginning */ int umarkb(BW *bw) { pdupown(bw->cursor, &markb); markb->xcol = bw->cursor->xcol; updall(); return 0; } int udrop(BW *bw) { prm(markk); if (marking && markb) prm(markb); else umarkb(bw); return 0; } int ubegin_marking(BW *bw) { if (marking) /* We're marking now... don't stop */ return 0; else if (markv(0) && bw->cursor->b==markb->b) { /* Try to extend current block */ if (bw->cursor->byte==markb->byte) { pset(markb,markk); prm(markk); markk=0; marking = 1; return 0; } else if(bw->cursor->byte==markk->byte) { prm(markk); markk=0; marking = 1; return 0; } } /* Start marking - no message */ prm(markb); markb=0; prm(markk); markk=0; updall(); marking = 1; return umarkb(bw); } int utoggle_marking(BW *bw) { if (markv(0) && bw->cursor->b==markb->b && bw->cursor->byte>=markb->byte && bw->cursor->byte<=markk->byte) { /* Just clear selection */ prm(markb); markb=0; prm(markk); markk=0; updall(); marking = 0; msgnw(bw->parent, UC "Selection cleared."); return 0; } else if (markk) { /* Clear selection and start new one */ prm(markb); markb=0; prm(markk); markk=0; updall(); marking = 1; msgnw(bw->parent, UC "Selection started."); return umarkb(bw); } else if (markb && markb->b==bw->cursor->b) { marking = 0; if (bw->cursor->bytebyte) { pdupown(markb, &markk); prm(markb); markb=0; pdupown(bw->cursor, &markb); markb->xcol = bw->cursor->xcol; } else { pdupown(bw->cursor, &markk); markk->xcol = bw->cursor->xcol; } updall(); /* Because other windows could be changed */ return 0; } else { marking = 1; msgnw(bw->parent, UC "Selection started."); return umarkb(bw); } } int uselect(BW *bw) { if (!markb) umarkb(bw); return 0; } /* Set end */ int umarkk(BW *bw) { pdupown(bw->cursor, &markk); markk->xcol = bw->cursor->xcol; updall(); return 0; } /* Unset marks */ int unmark(BW *bw) { prm(markb); prm(markk); updall(); return 0; } /* Mark line */ int umarkl(BW *bw) { p_goto_bol(bw->cursor); umarkb(bw); pnextl(bw->cursor); umarkk(bw); utomarkb(bw); pcol(bw->cursor, bw->cursor->xcol); return 0; } int utomarkb(BW *bw) { if (markb && markb->b == bw->b) { pset(bw->cursor, markb); return 0; } else return -1; } int utomarkk(BW *bw) { if (markk && markk->b == bw->b) { pset(bw->cursor, markk); return 0; } else return -1; } int uswap(BW *bw) { if (markb && markb->b == bw->b) { P *q = pdup(markb); umarkb(bw); pset(bw->cursor, q); prm(q); return 0; } else return -1; } int utomarkbk(BW *bw) { if (markb && markb->b == bw->b && bw->cursor->byte != markb->byte) { pset(bw->cursor, markb); return 0; } else if (markk && markk->b == bw->b && bw->cursor->byte != markk->byte) { pset(bw->cursor, markk); return 0; } else return -1; } /* Delete block */ int ublkdel(BW *bw) { if (markv(1)) { if (square) if (bw->o.overtype) { long ocol = markk->xcol; pclrrect(markb, markk->line - markb->line + 1, markk->xcol, ptabrect(markb, markk->line - markb->line + 1, markk->xcol)); pcol(markk, ocol); markk->xcol = ocol; } else pdelrect(markb, markk->line - markb->line + 1, markk->xcol); else bdel(markb, markk); if (lightoff) unmark(bw); } else { msgnw(bw->parent, UC "No block"); return -1; } return 0; } /* Special delete block function for PICO */ int upicokill(BW *bw) { upsh(bw); umarkk(bw); if (markv(1)) { if (square) if (bw->o.overtype) { long ocol = markk->xcol; pclrrect(markb, markk->line - markb->line + 1, markk->xcol, ptabrect(markb, markk->line - markb->line + 1, markk->xcol)); pcol(markk, ocol); markk->xcol = ocol; } else pdelrect(markb, markk->line - markb->line + 1, markk->xcol); else bdel(markb, markk); if (lightoff) unmark(bw); } else udelln(bw); return 0; } /* Move highlighted block */ int ublkmove(BW *bw) { if (markv(1)) { if (markb->b->rdonly) { msgnw(bw->parent, UC "Read only"); return -1; } if (square) { long height = markk->line - markb->line + 1; long width = markk->xcol - markb->xcol; int usetabs = ptabrect(markb, height, markk->xcol); long ocol = piscol(bw->cursor); B *tmp = pextrect(markb, height, markk->xcol); int update_xcol = (bw->cursor->xcol >= markk->xcol && bw->cursor->line >= markb->line && bw->cursor->line <= markk->line); ublkdel(bw); /* now we can't use markb and markk until we set them again */ /* ublkdel() frees them */ if (bw->o.overtype) { /* If cursor was in block, blkdel moves it to left edge of block, so fix it * back to its original place here */ pcol(bw->cursor, ocol); pfill(bw->cursor, ocol, ' '); pdelrect(bw->cursor, height, piscol(bw->cursor) + width); } else if (update_xcol) /* If cursor was to right of block, xcol was not properly updated */ bw->cursor->xcol -= width; pinsrect(bw->cursor, tmp, width, usetabs); brm(tmp); if (lightoff) unmark(bw); else { umarkb(bw); umarkk(bw); pline(markk, markk->line + height - 1); pcol(markk, markb->xcol + width); markk->xcol = markb->xcol + width; } return 0; } else if (bw->cursor->b != markk->b || bw->cursor->byte > markk->byte || bw->cursor->byte < markb->byte) { long size = markk->byte - markb->byte; binsb(bw->cursor, bcpy(markb, markk)); bdel(markb, markk); if (lightoff) unmark(bw); else { umarkb(bw); umarkk(bw); pfwrd(markk, size); } updall(); return 0; } } msgnw(bw->parent, UC "No block"); return -1; } /* Duplicate highlighted block */ int ublkcpy(BW *bw) { if (markv(1)) { if (square) { long height = markk->line - markb->line + 1; long width = markk->xcol - markb->xcol; int usetabs = ptabrect(markb, height, markk->xcol); B *tmp = pextrect(markb, height, markk->xcol); if (bw->o.overtype) pdelrect(bw->cursor, height, piscol(bw->cursor) + width); pinsrect(bw->cursor, tmp, width, usetabs); brm(tmp); if (lightoff) unmark(bw); else { umarkb(bw); umarkk(bw); pline(markk, markk->line + height - 1); pcol(markk, markb->xcol + width); markk->xcol = markb->xcol + width; } return 0; } else { long size = markk->byte - markb->byte; B *tmp = bcpy(markb, markk); /* Simple overtype for hex mode */ if (bw->o.hex && bw->o.overtype) { P *q = pdup(bw->cursor); if (q->byte + size >= q->b->eof->byte) pset(q, q->b->eof); else pfwrd(q, size); bdel(bw->cursor, q); prm(q); } binsb(bw->cursor, tmp); if (lightoff) unmark(bw); else { umarkb(bw); umarkk(bw); pfwrd(markk, size); } updall(); return 0; } } else { msgnw(bw->parent, UC "No block"); return -1; } } /* Write highlighted block to a file */ /* This is called by ublksave in ufile.c */ int dowrite(BW *bw, unsigned char *s, void *object, int *notify) { int fl; int ret = 0; if (notify) *notify = 1; if (!markv(1)) { vsrm(s); msgnw(bw->parent, UC "No block"); return (-1); } if (square) { B *tmp = pextrect(markb, markk->line - markb->line + 1, markk->xcol); fl = bsave(tmp->bof, s, tmp->eof->byte, 0); brm(tmp); } else { fl = bsave(markb, s, markk->byte - markb->byte, 0); } if (fl != 0) { msgnw(bw->parent, msgs[-fl]); ret = -1; } if (lightoff) unmark(bw); vsrm(s); return (ret); } /* Set highlighted block on a program block */ void setindent(BW *bw) { P *p, *q; long indent; if (pisblank(bw->cursor)) return; p = pdup(bw->cursor); q = pdup(p); indent = pisindent(p); do { if (!pprevl(p)) goto done; else p_goto_bol(p); } while (pisindent(p) >= indent || pisblank(p)); pnextl(p); /* Maybe skip blank lines at beginning */ done: p_goto_bol(p); p->xcol = piscol(p); if (markb) prm(markb); markb = p; p->owner = &markb; do { if (!pnextl(q)) break; } while (pisindent(q) >= indent || pisblank(q)); /* Maybe skip blank lines at end */ if (markk) prm(markk); q->xcol = piscol(q); markk = q; q->owner = &markk; updall(); } /* Purity check */ /* Verifies that at least n indentation characters (for non-blank lines) match c */ /* If n is 0 (for urindent), this fails if c is space but indentation begins with tab */ static int purity_check(int c, int n) { P *p = pdup(markb); while (p->byte < markk->byte) { int x; p_goto_bol(p); if (!n && c==' ' && brc(p)=='\t') { prm(p); return 0; } else if (!piseol(p)) for (x=0; x!=n; ++x) if (pgetc(p)!=c) { prm(p); return 0; } pnextl(p); } prm(p); return 1; } /* Left indent check */ /* Verify that there is enough whitespace to do the left indent */ static int lindent_check(int c, int n) { P *p = pdup(markb); int indwid; if (c=='\t') indwid = n * p->b->o.tab; else indwid = n; while (p->byte < markk->byte) { p_goto_bol(p); if (!piseol(p) && pisindent(p)b == markk->b && markb->byte <= markk->byte && markb->xcol <= markk->xcol) { P *p = pdup(markb); do { pcol(p, markb->xcol); pfill(p, markb->xcol + bw->o.istep, bw->o.indentc); } while (pnextl(p) && p->line <= markk->line); prm(p); } } else { if (!markb || !markk || markb->b != markk->b || bw->cursor->byte < markb->byte || bw->cursor->byte > markk->byte || markb->byte == markk->byte) { setindent(bw); } else if ( 1 /* bw->o.purify */) { P *p = pdup(markb); P *q = pdup(markb); int indwid; if (bw->o.indentc=='\t') indwid = bw->o.tab * bw->o.istep; else indwid = bw->o.istep; while (p->byte < markk->byte) { p_goto_bol(p); if (!piseol(p)) { int col; pset(q, p); p_goto_indent(q, bw->o.indentc); col = piscol(q); bdel(p,q); pfill(p,col+indwid,bw->o.indentc); } pnextl(p); } prm(p); prm(q); } else if (purity_check(bw->o.indentc,0)) { P *p = pdup(markb); while (p->byte < markk->byte) { p_goto_bol(p); if (!piseol(p)) while (piscol(p) < bw->o.istep) { binsc(p, bw->o.indentc); pgetc(p); } pnextl(p); } prm(p); } else { /* Purity failure */ msgnw(bw->parent,UC "Selected lines not properly indented"); return 1; } } return 0; } /* Indent less */ int ulindent(BW *bw) { if (square) { if (markb && markk && markb->b == markk->b && markb->byte <= markk->byte && markb->xcol <= markk->xcol) { P *p = pdup(markb); P *q = pdup(p); do { pcol(p, markb->xcol); while (piscol(p) < markb->xcol + bw->o.istep) { int c = pgetc(p); if (c != ' ' && c != '\t' && c != bw->o.indentc) { prm(p); prm(q); return -1; } } } while (pnextl(p) && p->line <= markk->line); pset(p, markb); do { pcol(p, markb->xcol); pset(q, p); pcol(q, markb->xcol + bw->o.istep); bdel(p, q); } while (pnextl(p) && p->line <= markk->line); prm(p); prm(q); } } else { if (!markb || !markk || markb->b != markk->b || bw->cursor->byte < markb->byte || bw->cursor->byte > markk->byte || markb->byte == markk->byte) { setindent(bw); } else if (1 /* bw->o.purify */ && lindent_check(bw->o.indentc,bw->o.istep)) { P *p = pdup(markb); P *q = pdup(markb); int indwid; if (bw->o.indentc=='\t') indwid = bw->o.tab * bw->o.istep; else indwid = bw->o.istep; while (p->byte < markk->byte) { p_goto_bol(p); if (!piseol(p)) { int col; pset(q, p); p_goto_indent(q, bw->o.indentc); col = piscol(q); bdel(p,q); pfill(p,col-indwid,bw->o.indentc); } pnextl(p); } prm(p); prm(q); } else if (purity_check(bw->o.indentc,bw->o.istep)) { P *p = pdup(markb); P *q = pdup(p); p_goto_bol(p); while (p->byte < markk->byte) { if (!piseol(p)) { pset(q, p); while (piscol(q) < bw->o.istep) pgetc(q); bdel(p, q); } pnextl(p); } prm(p); prm(q); } else { /* Purity failure */ msgnw(bw->parent, UC "Selected lines not properly indented"); return 1; } } return 0; } /* Insert a file */ int doinsf(BW *bw, unsigned char *s, void *object, int *notify) { if (notify) *notify = 1; if (square) { if (markv(1)) { B *tmp; long width = markk->xcol - markb->xcol; long height; int usetabs = ptabrect(markb, markk->line - markb->line + 1, markk->xcol); tmp = bload(s); if (error) { msgnw(bw->parent, msgs[-error]); brm(tmp); vsrm(s); return -1; } if (piscol(tmp->eof)) height = tmp->eof->line + 1; else height = tmp->eof->line; if (bw->o.overtype) { pclrrect(markb, long_max(markk->line - markb->line + 1, height), markk->xcol, usetabs); pdelrect(markb, height, width + markb->xcol); } pinsrect(markb, tmp, width, usetabs); pdupown(markb, &markk); markk->xcol = markb->xcol; if (height) { pline(markk, markk->line + height - 1); pcol(markk, markb->xcol + width); markk->xcol = markb->xcol + width; } brm(tmp); updall(); vsrm(s); return 0; } else { vsrm(s); msgnw(bw->parent, UC "No block"); return -1; } } else { int ret = 0; B *tmp = bload(s); if (error) { msgnw(bw->parent, msgs[-error]), brm(tmp); ret = -1; } else { P *pafter; pafter = pdup(bw->cursor); pgetc(pafter); binsb(bw->cursor, tmp); prgetc(pafter); aftermove(bw->parent, pafter); } vsrm(s); bw->cursor->xcol = piscol(bw->cursor); return ret; } } /* Filter highlighted block through a UNIX command */ static int filtflg = 0; #if WANT_FORK #define v_or_fork() fork() #else #define v_or_fork() vfork() #endif /* * This isn't optimal, but until the home-brewn VM system is removed * it is the best we can do: we cannot use bsavefd() in a concurrent * child because it uses JOE's VM subsystem which then copies around * content in file-backed memory that's not unshared, leading to da- * ta corruption if the content is big enough. * * TBH, I'd rather love to see that VM system gone and revert to the * JOE original code for dofilt... --mirabilos */ static int dofilt(BW *bw, unsigned char *s, void *object, int *notify) { int fr[2]; int fw; volatile int flg = 0; unsigned char *tf; const char *sh; #if defined(HAVE_PUTENV) && (WANT_FORK || defined(HAVE_UNSETENV)) unsigned char *fname; #endif if (notify) *notify = 1; if (markb && markk && !square && markb->b == bw->b && markk->b == bw->b && markb->byte == markk->byte) { flg = 1; goto ok; } if (!markv(1)) { vsrm(s); msgnw(bw->parent, UC "No block"); return -1; } ok: if (pipe(fr)) { vsrm(s); msgnw(bw->parent, UC "Pipe error"); return (-1); } if ((tf = mktmp(NULL, &fw)) == NULL) { msgnw(bw->parent, UC "Cannot create temporary file"); lseekoops: close(fr[0]); close(fr[1]); vsrm(s); return (-1); } unlink((char *)tf); vsrm(tf); npartial(bw->parent->t->t); ttclsn(); if (square) { B *tmp = pextrect(markb, markk->line - markb->line + 1, markk->xcol); bsavefd(tmp->bof, fw, tmp->eof->byte); } else bsavefd(markb, fw, markk->byte - markb->byte); if (lseek(fw, (off_t)0, SEEK_SET) < 0) { msgnw(bw->parent, UC "lseek failed"); close(fw); goto lseekoops; } #if defined(HAVE_PUTENV) && (WANT_FORK || defined(HAVE_UNSETENV)) fname = vsncpy(NULL, 0, sc("JOE_FILENAME=")); sh = bw->b->name ? (const char *)bw->b->name : "Unnamed"; fname = vsncpy(sv(fname), sz(sh)); #if !WANT_FORK putenv((char *)fname); #endif #endif sh = getushell(); if (!v_or_fork()) { #if defined(HAVE_PUTENV) && WANT_FORK putenv((char *)fname); #endif signrm(1); close(0); close(1); close(2); /* these dups will not fail */ if (dup(fw)) {} if (dup(fr[1])) {} if (dup(fr[1])) {} close(fw); close(fr[1]); close(fr[0]); execl(sh, sh, "-c", s, NULL); _exit(0); } close(fr[1]); close(fw); #if defined(HAVE_PUTENV) && (WANT_FORK || defined(HAVE_UNSETENV)) #if !WANT_FORK unsetenv("JOE_FILENAME"); #endif vsrm(fname); #endif if (square) { B *tmp; long width = markk->xcol - markb->xcol; long height; int usetabs = ptabrect(markb, markk->line - markb->line + 1, markk->xcol); tmp = bread(fr[0], LONG_MAX); if (piscol(tmp->eof)) height = tmp->eof->line + 1; else height = tmp->eof->line; if (bw->o.overtype) { pclrrect(markb, markk->line - markb->line + 1, markk->xcol, usetabs); pdelrect(markb, long_max(height, markk->line - markb->line + 1), width + markb->xcol); } else pdelrect(markb, markk->line - markb->line + 1, markk->xcol); pinsrect(markb, tmp, width, usetabs); pdupown(markb, &markk); markk->xcol = markb->xcol; if (height) { pline(markk, markk->line + height - 1); pcol(markk, markb->xcol + width); markk->xcol = markb->xcol + width; } if (lightoff) unmark(bw); brm(tmp); updall(); } else { P *p = pdup(markk); if (!flg) prgetc(p); bdel(markb, p); binsb(p, bread(fr[0], LONG_MAX)); if (!flg) { pset(p,markk); prgetc(p); bdel(p,markk); } prm(p); if (lightoff) unmark(bw); } close(fr[0]); wait(NULL); vsrm(s); ttopnn(); if (filtflg) unmark(bw); bw->cursor->xcol = piscol(bw->cursor); return 0; } static B *filthist = NULL; static void markall(BW *bw) { pdupown(bw->cursor->b->bof, &markb); markb->xcol = 0; pdupown(bw->cursor->b->eof, &markk); markk->xcol = piscol(markk); updall(); } static int checkmark(BW *bw) { if (!markv(1)) if (square) return 2; else { markall(bw); filtflg = 1; return 1; } else { filtflg = 0; return 0; } } int ufilt(BW *bw) { switch (checkmark(bw)) { case 0: if (wmkpw(bw->parent, UC "Command to filter block through (^C to abort): ", &filthist, dofilt, NULL, NULL, utypebw, NULL, NULL, locale_map)) return 0; else return -1; case 1: if (wmkpw(bw->parent, UC "Command to filter file through (^C to abort): ", &filthist, dofilt, NULL, NULL, utypebw, NULL, NULL, locale_map)) return 0; else return -1; case 2: default: msgnw(bw->parent, UC "No block"); return -1; } } /* Force region to lower case */ int ulower(BW *bw) { if (markv(1)) { P *q; P *p; int c; B *b = bcpy(markb,markk); /* Leave one character in buffer to keep pointers set properly... */ q = pdup(markk); prgetc(q); bdel(markb,q); b->o.charmap = markb->b->o.charmap; p=pdup(b->bof); while ((c=pgetc(p))!=NO_MORE_DATA) { c = joe_tolower(b->o.charmap,c); binsc(q,c); pgetc(q); } prm(p); bdel(q,markk); prm(q); brm(b); bw->cursor->xcol = piscol(bw->cursor); return 0; } else return -1; } /* Force region to upper case */ int uupper(BW *bw) { if (markv(1)) { P *q; P *p; int c; B *b = bcpy(markb,markk); q = pdup(markk); prgetc(q); bdel(markb,q); b->o.charmap = markb->b->o.charmap; p=pdup(b->bof); while ((c=pgetc(p))!=NO_MORE_DATA) { c = joe_toupper(b->o.charmap,c); binsc(q,c); pgetc(q); } prm(p); bdel(q,markk); prm(q); brm(b); bw->cursor->xcol = piscol(bw->cursor); return 0; } else return -1; } jupp/ublock.h010064400000000000000000000025121363731763600104320ustar00/* * Highlighted block functions * Copyright * (C) 1992 Joseph H. Allen * * This file is part of JOE (Joe's Own Editor) */ #ifndef JUPP_UBLOCK_H #define JUPP_UBLOCK_H #ifdef EXTERN_CMD_C __IDSTRING(rcsid_ublock_h, "$MirOS: contrib/code/jupp/ublock.h,v 1.6 2020/03/27 06:38:59 tg Exp $"); #endif extern int square; extern int lightoff; extern P *markb, *markk; void pinsrect(P *cur, B *tmp, long int width, int usetabs); int ptabrect(P *org, long int height, long int right); void pclrrect(P *org, long int height, long int right, int usetabs); void pdelrect(P *org, long int height, long int right); B *pextrect(P *org, long int height, long int right); int markv(int r); int umarkb(BW *bw); int umarkk(BW *bw); int uswap(BW *bw); int umarkl(BW *bw); int utomarkb(BW *bw); int utomarkk(BW *bw); int utomarkbk(BW *bw); int ublkdel(BW *bw); int upicokill(BW *bw); int ublkmove(BW *bw); int ublkcpy(BW *bw); int dowrite(BW *bw, unsigned char *s, void *object, int *notify); int doinsf(BW *bw, unsigned char *s, void *object, int *notify); void setindent(BW *bw); int urindent(BW *bw); int ulindent(BW *bw); int ufilt(BW *bw); int unmark(BW *bw); int udrop(BW *bw); int utoggle_marking(BW *bw); int ubegin_marking(BW *bw); int uselect(BW *bw); int upsh(BW *bw); int upop(BW *bw); int ulower(BW *bw); int uupper(BW *bw); extern int nstack; #endif jupp/uedit.c010064400000000000000000001022511363731415400102510ustar00/* * Basic user edit functions * Copyright * (C) 1992 Joseph H. Allen * * This file is part of JOE (Joe's Own Editor) */ #include "config.h" #include "types.h" __RCSID("$MirOS: contrib/code/jupp/uedit.c,v 1.37 2020/03/27 06:08:17 tg Exp $"); #include #ifdef HAVE_BSD_STRING_H #include #endif #include "b.h" #include "bw.h" #include "macro.h" #include "main.h" #include "pw.h" #include "qw.h" #include "scrn.h" #include "ublock.h" #include "uedit.h" #include "uformat.h" #include "umath.h" #include "utils.h" #include "vs.h" #include "charmap.h" #include "w.h" /***************/ /* Global options */ int pgamnt = -1; /* No. of PgUp/PgDn lines to keep */ /******** i don't like global var ******/ /* * Move cursor to beginning of line */ int u_goto_bol(BW *bw) { if (bw->o.hex) { pbkwd(bw->cursor,bw->cursor->byte%16); } else { p_goto_bol(bw->cursor); } return 0; } /* * Move cursor to first non-whitespace character, unless it is * already there, in which case move it to beginning of line */ int uhome(BW *bw) { P *p; if (bw->o.hex) { return u_goto_bol(bw); } p = pdup(bw->cursor); if (bw->o.indentfirst) { if ((bw->o.smarthome) && (piscol(p) > pisindent(p))) { p_goto_bol(p); while (joe_isblank(brc(p))) pgetc(p); } else p_goto_bol(p); } else { if (bw->o.smarthome && piscol(p)==0 && pisindent(p)) { while (joe_isblank(brc(p))) pgetc(p); } else p_goto_bol(p); } pset(bw->cursor, p); prm(p); return 0; } /* * Move cursor to end of line */ int u_goto_eol(BW *bw) { if (bw->o.hex) { if (bw->cursor->byte + 15 - bw->cursor->byte%16 > bw->b->eof->byte) pset(bw->cursor,bw->b->eof); else pfwrd(bw->cursor, 15 - bw->cursor->byte%16); } else p_goto_eol(bw->cursor); return 0; } /* * Move cursor to beginning of file */ int u_goto_bof(BW *bw) { p_goto_bof(bw->cursor); return 0; } /* * Move cursor to end of file */ int u_goto_eof(BW *bw) { p_goto_eof(bw->cursor); return 0; } /* * Move cursor left */ int u_goto_left(BW *bw) { if (bw->o.hex) { if (prgetb(bw->cursor) != NO_MORE_DATA) { return 0; } else { return -1; } } if (bw->o.picture) { if (bw->cursor->xcol) { --bw->cursor->xcol; pcol(bw->cursor,bw->cursor->xcol); return 0; } } else { /* Have to do ECHKXCOL here because of picture mode */ if (bw->cursor->xcol != piscol(bw->cursor)) { bw->cursor->xcol = piscol(bw->cursor); return 0; } else if (prgetc(bw->cursor) != NO_MORE_DATA) { bw->cursor->xcol = piscol(bw->cursor); return 0; } } return -1; } /* * Move cursor right */ int u_goto_right(BW *bw) { if (bw->o.hex) { if (pgetb(bw->cursor) != NO_MORE_DATA) { return 0; } else { return -1; } } if (bw->o.picture) { ++bw->cursor->xcol; pcol(bw->cursor,bw->cursor->xcol); return 0; } else { int rtn; if (pgetc(bw->cursor) != NO_MORE_DATA) { bw->cursor->xcol = piscol(bw->cursor); rtn = 0; } else { rtn = -1; } /* Have to do EFIXXCOL here because of picture mode */ if (bw->cursor->xcol != piscol(bw->cursor)) bw->cursor->xcol = piscol(bw->cursor); return rtn; } } /* * Move cursor to beginning of previous word or if there isn't * previous word then go to beginning of the file * * WORD is a sequence non-white-space characters */ int u_goto_prev(BW *bw) { P *p = pdup(bw->cursor); union charmap *map = bw->b->o.charmap; int c = prgetc(p); if (joe_isalnux(map,c)) { while (joe_isalnux(map,(c=prgetc(p)))) /* Do nothing */; if (c != NO_MORE_DATA) pgetc(p); } else if (joe_isspace(map,c) || joe_ispunct(map,c)) { while ((c=prgetc(p)), (joe_isspace(map,c) || joe_ispunct(map,c))) /* Do nothing */; while(joe_isalnux(map,(c=prgetc(p)))) /* Do nothing */; if (c != NO_MORE_DATA) pgetc(p); } /* if (p->byte == bw->cursor->byte) { prm(p); return -1; } */ pset(bw->cursor, p); prm(p); return 0; } /* * Move cursor to end of next word or if there isn't * next word then go to end of the file * * WORD is a sequence non-white-space characters */ int u_goto_next(BW *bw) { P *p = pdup(bw->cursor); union charmap *map = bw->b->o.charmap; int c = brch(p); int rtn = -1; if (joe_isalnux(map,c)) { rtn = 0; while (joe_isalnux(map,(c = brch(p)))) pgetc(p); } else if (joe_isspace(map,c) || joe_ispunct(map,c)) { while (joe_isspace(map, (c = brch(p))) || joe_ispunct(map,c)) pgetc(p); while (joe_isalnux(map,(c = brch(p)))) { rtn = 0; pgetc(p); } } else pgetc(p); pset(bw->cursor, p); prm(p); return rtn; } static P *pboi(P *p) { p_goto_bol(p); while (joe_isblank(brch(p))) pgetc(p); return p; } static int pisedge(P *p) { P *q; int c; if (pisbol(p)) return -1; if (piseol(p)) return 1; q = pdup(p); pboi(q); if (q->byte == p->byte) goto left; if (joe_isblank((c = brch(p)))) { pset(q, p); if (joe_isblank(prgetc(q))) goto no; if (c == '\t') goto right; pset(q, p); pgetc(q); if (pgetc(q) == ' ') goto right; goto no; } else { pset(q, p); c = prgetc(q); if (c == '\t') goto left; if (c != ' ') goto no; if (prgetc(q) == ' ') goto left; goto no; } right:prm(q); return 1; left:prm(q); return -1; no:prm(q); return 0; } int upedge(BW *bw) { if (prgetc(bw->cursor) == NO_MORE_DATA) return -1; while (pisedge(bw->cursor) != -1) prgetc(bw->cursor); return 0; } int unedge(BW *bw) { if (pgetc(bw->cursor) == NO_MORE_DATA) return -1; while (pisedge(bw->cursor) != 1) pgetc(bw->cursor); return 0; } /* Move cursor to matching delimiter */ static int utomatch_i(BW *bw, int dir) { int d; int c; /* character under cursor */ int f; /* character to find */ P *p; int cnt = 0; /* delimiter depth */ switch (f = c = brch(bw->cursor)) { case '(': f = ')'; dir = 1; break; case '[': f = ']'; dir = 1; break; case '{': f = '}'; dir = 1; break; case '<': f = '>'; dir = 1; break; case ')': f = '('; dir = -1; break; case ']': f = '['; dir = -1; break; case '}': f = '{'; dir = -1; break; case '>': f = '<'; dir = -1; break; } p = pdup(bw->cursor); if (dir == 1) { while ((d = pgetc(p)) != NO_MORE_DATA) { if (d == f && f != c && !--cnt) { prgetc(p); goto match_found; } else if (d == c) { ++cnt; if (f == c) c = NO_MORE_DATA; } } } else { while ((d = prgetc(p)) != NO_MORE_DATA) { if (d == f && !cnt--) goto match_found; else if (d == c) ++cnt; } } if (/* CONSTCOND */ 0) { match_found: pset(bw->cursor, p); } prm(p); return ((d == NO_MORE_DATA) ? -1 : 0); } int utomatch(BW *bw) { return (utomatch_i(bw, 1)); } int urvmatch(BW *bw) { return (utomatch_i(bw, -1)); } /* Move cursor up */ int uuparw(BW *bw) { if (bw->o.hex) { if (bw->cursor->byte<16) return -1; else { pbkwd(bw->cursor, 16); return 0; } } if (bw->cursor->line) { pprevl(bw->cursor); pcol(bw->cursor, bw->cursor->xcol); return 0; } else return -1; } /* Move cursor down */ int udnarw(BW *bw) { if (bw->o.hex) { if (bw->cursor->byte+16 <= bw->b->eof->byte) { pfwrd(bw->cursor, 16); return 0; } else if (bw->cursor->byte != bw->b->eof->byte) { pset(bw->cursor, bw->b->eof); return 0; } else { return -1; } } if (bw->cursor->line != bw->b->eof->line) { pnextl(bw->cursor); pcol(bw->cursor, bw->cursor->xcol); return 0; } else if(bw->o.picture) { p_goto_eol(bw->cursor); binsc(bw->cursor,'\n'); pgetc(bw->cursor); pcol(bw->cursor, bw->cursor->xcol); return 0; } else return -1; } /* Move cursor to top of window */ int utos(BW *bw) { long col = bw->cursor->xcol; pset(bw->cursor, bw->top); pcol(bw->cursor, col); bw->cursor->xcol = col; return 0; } /* Move cursor to bottom of window */ int ubos(BW *bw) { long col = bw->cursor->xcol; pline(bw->cursor, bw->top->line + bw->h - 1); pcol(bw->cursor, col); bw->cursor->xcol = col; return 0; } /* Scroll buffer window up n lines * If beginning of file is close, scrolls as much as it can * If beginning of file is on-screen, cursor jumps to beginning of file * * If flg is set: cursor stays fixed relative to screen edge * If flg is clr: cursor stays fixed on the buffer line */ void scrup(BW *bw, int n, int flg) { int scrollamnt = 0; int cursoramnt = 0; int x; /* Decide number of lines we're really going to scroll */ if (bw->o.hex) { if (bw->top->byte/16 >= n) scrollamnt = cursoramnt = n; else if (bw->top->byte/16) scrollamnt = cursoramnt = bw->top->byte/16; else if (flg) cursoramnt = bw->cursor->byte/16; else if (bw->cursor->byte/16 >= n) cursoramnt = n; } else { if (bw->top->line >= n) scrollamnt = cursoramnt = n; else if (bw->top->line) scrollamnt = cursoramnt = bw->top->line; else if (flg) cursoramnt = bw->cursor->line; else if (bw->cursor->line >= n) cursoramnt = n; } if (bw->o.hex) { /* Move top-of-window pointer */ pbkwd(bw->top,scrollamnt*16); /* Move cursor */ pbkwd(bw->cursor,cursoramnt*16); /* If window is on the screen, give (buffered) scrolling command */ if (bw->parent->y != -1) nscrldn(bw->parent->t->t, bw->y, bw->y + bw->h, scrollamnt); } else { /* Move top-of-window pointer */ for (x = 0; x != scrollamnt; ++x) pprevl(bw->top); p_goto_bol(bw->top); /* Move cursor */ for (x = 0; x != cursoramnt; ++x) pprevl(bw->cursor); p_goto_bol(bw->cursor); pcol(bw->cursor, bw->cursor->xcol); /* If window is on the screen, give (buffered) scrolling command */ if (bw->parent->y != -1) nscrldn(bw->parent->t->t, bw->y, bw->y + bw->h, scrollamnt); } } /* Scroll buffer window down n lines * If end of file is close, scrolls as much as possible * If end of file is on-screen, cursor jumps to end of file * * If flg is set: cursor stays fixed relative to screen edge * If flg is clr: cursor stays fixed on the buffer line */ void scrdn(BW *bw, int n, int flg) { int scrollamnt = 0; int cursoramnt = 0; int x; /* How much we're really going to scroll... */ if (bw->o.hex) { if (bw->top->b->eof->byte/16 < bw->top->byte/16 + bw->h) { cursoramnt = bw->top->b->eof->byte/16 - bw->cursor->byte/16; if (!flg && cursoramnt > n) cursoramnt = n; } else if (bw->top->b->eof->byte/16 - (bw->top->byte/16 + bw->h) >= n) cursoramnt = scrollamnt = n; else cursoramnt = scrollamnt = bw->top->b->eof->byte/16 - (bw->top->byte/16 + bw->h) + 1; } else { if (bw->top->b->eof->line < bw->top->line + bw->h) { cursoramnt = bw->top->b->eof->line - bw->cursor->line; if (!flg && cursoramnt > n) cursoramnt = n; } else if (bw->top->b->eof->line - (bw->top->line + bw->h) >= n) cursoramnt = scrollamnt = n; else cursoramnt = scrollamnt = bw->top->b->eof->line - (bw->top->line + bw->h) + 1; } if (bw->o.hex) { /* Move top-of-window pointer */ pfwrd(bw->top,16*scrollamnt); /* Move cursor */ pfwrd(bw->cursor,16*cursoramnt); /* If window is on screen, give (buffered) scrolling command to terminal */ if (bw->parent->y != -1) nscrlup(bw->parent->t->t, bw->y, bw->y + bw->h, scrollamnt); } else { /* Move top-of-window pointer */ for (x = 0; x != scrollamnt; ++x) pnextl(bw->top); /* Move cursor */ for (x = 0; x != cursoramnt; ++x) pnextl(bw->cursor); pcol(bw->cursor, bw->cursor->xcol); /* If window is on screen, give (buffered) scrolling command to terminal */ if (bw->parent->y != -1) nscrlup(bw->parent->t->t, bw->y, bw->y + bw->h, scrollamnt); } } /* Page up */ int upgup(BW *bw) { bw = bw->parent->main->object.bw; if (bw->o.hex ? bw->cursor->byte < 16 : !bw->cursor->line) return -1; if (pgamnt < 0) scrup(bw, bw->h / 2 + bw->h % 2, 1); else if (pgamnt < bw->h) scrup(bw, bw->h - pgamnt, 1); else scrup(bw, 1, 1); return 0; } /* Page down */ int upgdn(BW *bw) { bw = bw->parent->main->object.bw; if (bw->o.hex ? bw->cursor->byte/16 == bw->b->eof->byte/16 : bw->cursor->line == bw->b->eof->line) return -1; if (pgamnt < 0) scrdn(bw, bw->h / 2 + bw->h % 2, 1); else if (pgamnt < bw->h) scrdn(bw, bw->h - pgamnt, 1); else scrdn(bw, 1, 1); return 0; } /* Scroll by a single line. The cursor moves with the scroll */ int uupslide(BW *bw) { bw = bw->parent->main->object.bw; if (bw->o.hex ? bw->top->byte/16 : bw->top->line) { if (bw->o.hex ? bw->top->byte/16 + bw->h -1 != bw->cursor->byte/16 : bw->top->line + bw->h - 1 != bw->cursor->line) udnarw(bw); scrup(bw, 1, 0); return 0; } else return -1; } int udnslide(BW *bw) { bw = bw->parent->main->object.bw; if (bw->o.hex ? bw->top->line/16 + bw->h <= bw->top->b->eof->byte/16 : bw->top->line + bw->h <= bw->top->b->eof->line) { if (bw->o.hex ? bw->top->byte/16 != bw->cursor->byte/16 : bw->top->line != bw->cursor->line) uuparw(bw); scrdn(bw, 1, 0); return 0; } else return -1; } /* Move cursor to specified line number */ static B *linehist = NULL; /* History of previously entered line numbers */ static int doline(BW *bw, unsigned char *s, void *object, int *notify) { long num = calcl(bw, s); if (notify) *notify = 1; vsrm(s); if (num >= 1 && !merrf) { int tmp = mid; if (num > bw->b->eof->line) num = bw->b->eof->line + 1; pline(bw->cursor, num - 1), bw->cursor->xcol = piscol(bw->cursor); mid = 1; dofollows(); mid = tmp; return 0; } else { if (merrf) msgnw(bw->parent, merrt); else msgnw(bw->parent, UC "Invalid line number"); return -1; } } int uline(BW *bw) { if (wmkpw(bw->parent, UC "Go to line (^C to abort): ", &linehist, doline, NULL, NULL, NULL, NULL, NULL, locale_map)) return 0; else return -1; } /* Move cursor to specified column number */ static B *colhist = NULL; /* History of previously entered column numbers */ static int docol(BW *bw, unsigned char *s, void *object, int *notify) { long num = calcl(bw, s); if (notify) *notify = 1; vsrm(s); if (num >= 1 && !merrf) { int tmp = mid; pcol(bw->cursor, num - 1), bw->cursor->xcol = piscol(bw->cursor); mid = 1; dofollows(); mid = tmp; return 0; } else { if (merrf) msgnw(bw->parent, merrt); else msgnw(bw->parent, UC "Invalid column number"); return -1; } } int ucol(BW *bw) { if (wmkpw(bw->parent, UC "Go to column (^C to abort): ", &colhist, docol, NULL, NULL, NULL, NULL, NULL, locale_map)) return 0; else return -1; } /* Move cursor to specified byte number */ static B *bytehist = NULL; /* History of previously entered byte numbers */ static int dobyte(BW *bw, unsigned char *s, void *object, int *notify) { long num = calcl(bw, s); if (notify) *notify = 1; vsrm(s); if (num >= 0 && !merrf) { int tmp = mid; pgoto(bw->cursor, num), bw->cursor->xcol = piscol(bw->cursor); mid = 1; dofollows(); mid = tmp; return 0; } else { if (merrf) msgnw(bw->parent, merrt); else msgnw(bw->parent, UC "Invalid byte number"); return -1; } } int ubyte(BW *bw) { if (wmkpw(bw->parent, UC "Go to byte (^C to abort): ", &bytehist, dobyte, NULL, NULL, NULL, NULL, NULL, locale_map)) return 0; else return -1; } /* Delete character under cursor * or write ^D to process if we're at end of file in a shell window */ int udelch(BW *bw) { P *p; if (piseof(bw->cursor)) return -1; pgetc(p = pdup(bw->cursor)); bdel(bw->cursor, p); prm(p); return 0; } /* Backspace */ int ubacks(BW *bw, int k) { /* Don't backspace when at beginning of line in prompt windows */ if (bw->parent->watom->what == TYPETW || !pisbol(bw->cursor)) { int c; int indent; int col; int indwid; int wid; if (pisbof(bw->cursor)) return -1; /* Indentation point of this line */ indent = pisindent(bw->cursor); /* Column position of cursor */ col = piscol(bw->cursor); /* Indentation step in columns */ if (bw->o.indentc=='\t') wid = bw->o.tab; else wid = 1; indwid = (bw->o.istep*wid); /* Smart backspace when: cursor is at indentation point, indentation point is a multiple of indentation width, we're not at beginning of line, 'smarthome' option is enabled, and indentation is purely made out of indent characters (or purify indents is enabled). */ /* Ignore purify for backspace */ if (col == indent && (col%indwid)==0 && col!=0 && bw->o.smartbacks) { P *p; /* Delete all indentation */ p = pdup(bw->cursor); p_goto_bol(p); bdel(p,bw->cursor); prm(p); /* Indent to new position */ pfill(bw->cursor,col-indwid,bw->o.indentc); } else if (colcursor) && bw->o.smartbacks) { /* We're before indent point: delete indwid worth of space but do not cross line boundary. We could probably replace the above with this. */ int cw=0; P *p = pdup(bw->cursor); do { c = prgetc(bw->cursor); if(c=='\t') cw += bw->o.tab; else cw += 1; bdel(bw->cursor, p); } while(!pisbol(bw->cursor) && cwcursor); if ((c = prgetc(bw->cursor)) != NO_MORE_DATA) if (!bw->o.overtype || c == '\t' || pisbol(p) || piseol(p)) bdel(bw->cursor, p); prm(p); } return 0; } else return -1; } /* * Delete sequence of characters (alphabetic, numeric) or (white-space) * if cursor is on the white-space it will delete all white-spaces * until alphanumeric character * if cursor is on the alphanumeric it will delete all alphanumeric * characters until character that is not alphanumeric */ int u_word_delete(BW *bw) { P *p = pdup(bw->cursor); union charmap *map = bw->b->o.charmap; int c = brch(p); if (joe_isalnux(map,c)) while (joe_isalnux(map,(c = brch(p)))) pgetc(p); else if (joe_isspace(map,c)) while (joe_isspace(map,(c = brch(p)))) pgetc(p); else pgetc(p); if (p->byte == bw->cursor->byte) { prm(p); return -1; } bdel(bw->cursor, p); prm(p); return 0; } /* Delete from cursor to beginning of word it's in or immediately after, * to start of whitespace, or a single character */ int ubackw(BW *bw) { P *p = pdup(bw->cursor); int c = prgetc(bw->cursor); union charmap *map = bw->b->o.charmap; if (joe_isalnux(map,c)) { while (joe_isalnux(map,(c = prgetc(bw->cursor)))) /* do nothing */; if (c != NO_MORE_DATA) pgetc(bw->cursor); } else if (joe_isspace(map,c)) { while (joe_isspace(map,(c = prgetc(bw->cursor)))) /* do nothing */; if (c != NO_MORE_DATA) pgetc(bw->cursor); } if (bw->cursor->byte == p->byte) { prm(p); return -1; } bdel(bw->cursor, p); prm(p); return 0; } /* Delete from cursor to end of line, or if there's nothing to delete, * delete the line-break */ int udelel(BW *bw) { P *p = p_goto_eol(pdup(bw->cursor)); if (bw->cursor->byte == p->byte) { prm(p); return udelch(bw); } else bdel(bw->cursor, p); prm(p); return 0; } /* Delete to beginning of line, or if there's nothing to delete, * delete the line-break */ int udelbl(BW *bw) { P *p = p_goto_bol(pdup(bw->cursor)); if (p->byte == bw->cursor->byte) { prm(p); return ubacks(bw, 8); /* The 8 goes to the process if we're at EOF of shell window */ } else bdel(p, bw->cursor); prm(p); return 0; } /* Delete entire line */ int udelln(BW *bw) { P *p = pdup(bw->cursor); p_goto_bol(bw->cursor); pnextl(p); if (bw->cursor->byte == p->byte) { prm(p); return -1; } bdel(bw->cursor, p); prm(p); return 0; } /* Insert a space */ int uinsc(BW *bw) { binsc(bw->cursor, ' '); return 0; } /* Move p backwards to first non-blank line and return its indentation */ static int find_indent(P *p) { int x; for (x=0; x != 10; ++x) { if (!pprevl(p)) return -1; p_goto_bol(p); if (!pisblank(p)) break; } if (x==10) return -1; else return pisindent(p); } /* Type a character into the buffer (deal with left margin, overtype mode and * word-wrap), if cursor is at end of shell window buffer, just send character * to process. */ struct utf8_sm utype_utf8_sm; int utypebw_raw(BW *bw, int k, int no_decode) { union charmap *map = bw->b->o.charmap; /* Hex mode overtype is real simple */ if (bw->o.hex && bw->o.overtype) { P *p; unsigned char c = k; binsm(bw->cursor, &c, 1); pgetb(bw->cursor); if (piseof(bw->cursor)) return 0; pgetb(p = pdup(bw->cursor)); bdel(bw->cursor, p); prm(p); return 0; } if (k == '\t' && bw->o.overtype && !piseol(bw->cursor)) { /* TAB in overtype mode is supposed to be just cursor motion */ int col = bw->cursor->xcol; /* Current cursor column */ col = col + bw->o.tab - (col%bw->o.tab);/* Move to next tab stop */ pcol(bw->cursor,col); /* Try to position cursor there */ if (!bw->o.picture && piseol(bw->cursor) && piscol(bw->cursor)o.spaces) pfill(bw->cursor,col,' '); else pfill(bw->cursor,col,'\t'); } bw->cursor->xcol = col; /* Put cursor there even if we can't really go there */ } else if (k == '\t' && bw->o.smartbacks && bw->o.autoindent && pisindent(bw->cursor)>=piscol(bw->cursor)) { P *p = pdup(bw->cursor); int n = find_indent(p); if (n != -1 && pisindent(bw->cursor)==piscol(bw->cursor) && n > pisindent(bw->cursor)) { if (!pisbol(bw->cursor)) udelbl(bw); while (joe_isspace(map,(k = pgetc(p))) && k != '\n') { binsc(bw->cursor, k); pgetc(bw->cursor); } } else { int x; for (x=0;xo.istep;++x) { binsc(bw->cursor,bw->o.indentc); pgetc(bw->cursor); } } bw->cursor->xcol = piscol(bw->cursor); prm (p); } else if (k == '\t' && bw->o.spaces) { long n; if (bw->o.picture) n = bw->cursor->xcol; else n = piscol(bw->cursor); utype_utf8_sm.state = 0; utype_utf8_sm.ptr = 0; n = bw->o.tab - n % bw->o.tab; while (n--) utypebw_raw(bw, ' ', 0); } else { int simple; int x; /* Picture mode */ if (bw->o.picture && bw->cursor->xcol!=piscol(bw->cursor)) pfill(bw->cursor,bw->cursor->xcol,' '); /* Why no tabs? */ /* UTF8 decoder */ if (joe_maputf(locale_map) && !no_decode) { int utf8_char = utf8_decode(&utype_utf8_sm,k); if(utf8_char >= 0) k = utf8_char; else return 0; } simple = 1; if (pisblank(bw->cursor)) while (piscol(bw->cursor) < bw->o.lmargin) { binsc(bw->cursor, ' '); pgetc(bw->cursor); } if (no_decode == 2) { unsigned char ch = k; binsm(bw->cursor, &ch, 1); if (!joe_maputf(bw->b->o.charmap)) no_decode = 1; } else { if (!no_decode) { unsigned char buf[10]; if (joe_maputf(locale_map) && !joe_maputf(bw->b->o.charmap)) { utf8_encode(buf,k); k = from_utf8(bw->b->o.charmap,buf); } else if (!joe_maputf(locale_map) && joe_maputf(bw->b->o.charmap)) { to_utf8(locale_map,buf,k); k = utf8_decode_string(buf); } } binsc(bw->cursor, k); } /* We need x position before we move cursor */ x = piscol(bw->cursor) - bw->offset; pgetc(bw->cursor); /* Tabs are weird here... */ if (bw->o.overtype && !piseol(bw->cursor) && k != '\t') udelch(bw); /* Not sure if we're in right position for wordwrap when we're in overtype mode */ if (bw->o.wordwrap && piscol(bw->cursor) > bw->o.rmargin && !joe_isblank(k)) { wrapword(bw->cursor, (long) bw->o.lmargin, bw->o.french, NULL); simple = 0; } bw->cursor->xcol = piscol(bw->cursor); if (x < 0 || x >= bw->w) simple = 0; if (bw->cursor->line < bw->top->line || bw->cursor->line >= bw->top->line + bw->h) simple = 0; if (simple && bw->parent->t->t->sary[bw->y + bw->cursor->line - bw->top->line]) simple = 0; else if (simple) switch (k) { case ' ': if (bw->o.vispace) /* FALLTHROUGH */ case '\t': case '\n': simple = 0; break; } if (simple && !curmacro) { int atr = 0; SCRN *t = bw->parent->t->t; int y = bw->y + bw->cursor->line - bw->top->line; int *screen = t->scrn + y * t->co; int *attr = t->attr + y * t->co; x += bw->x; if (!bw->parent->t->t->updtab[bw->y + bw->cursor->line - bw->top->line] && piseol(bw->cursor) && !bw->o.highlight) t->updtab[y] = 0; if (markb && markk && markb->b == bw->b && markk->b == bw->b && ((!square && bw->cursor->byte >= markb->byte && bw->cursor->byte < markk->byte) || ( square && bw->cursor->line >= markb->line && bw->cursor->line <= markk->line && piscol(bw->cursor) >= markb->xcol && piscol(bw->cursor) < markk->xcol))) atr = INVERSE; outatr(bw->b->o.charmap, t, screen + x, attr + x, x, y, no_decode == 2 ? 0xFFFD : k, atr); } } return 0; } int utypebw(jobject jO, int k) { return utypebw_raw(jO.bw, k, 0); } /* Quoting */ static B *unicodehist = NULL; /* History of previously entered UCS characters */ static int dounicode(BW *bw, unsigned char *s, void *object, int *notify) { int num; num = ustolb(s, NULL, 0, 0x10FFFF, USTOL_HEX | USTOL_TRIM | USTOL_EOS); if (notify) *notify = 1; vsrm(s); if (joe_maputf(bw->b->o.charmap)) utypebw_raw(bw, num, 1); else { unsigned char buf[8]; int x; utf8_encode(buf,num); for(x=0;buf[x];++x) utypebw_raw(bw, buf[x], 1); } bw->cursor->xcol = piscol(bw->cursor); return 0; } static void doquote0(BW *bw, int c, int meta) { if (c == '?') c = 127; else if ((c >= 0x40 && c <= 0x5F) || (c >= 'a' && c <= 'z')) c &= 0x1F; c |= meta; utypebw_raw(bw, c, 1); bw->cursor->xcol = piscol(bw->cursor); } int quotestate; int quoteval; static int doquote(BW *bw, int c, void *object, int *notify) { unsigned char buf[40]; if (c < 0 || c >= 256) { nungetc(c); return -1; } switch (quotestate) { case 0: if (c >= '0' && c <= '9') { quoteval = c - '0'; quotestate = 1; joe_snprintf_1((char *)buf, sizeof(buf), "ASCII %c--", c); if (!mkqwna(bw->parent, sz(buf), doquote, NULL, NULL, notify)) return -1; else return 0; } else if ((c | 0x20) == 'u') { if (joe_maputf(bw->b->o.charmap)) goto unopoo; uhex_uni: if (!wmkpw(bw->parent, UC "UCS (ISO-10646) character in hex (^C to abort): ", &unicodehist, dounicode, NULL, NULL, NULL, NULL, NULL, locale_map)) return 0; else return -1; } else if ((c | 0x20) == 'r') { if (!joe_maputf(bw->b->o.charmap)) goto unopoo; uhex_raw: quotestate = 3; if (!mkqwna(bw->parent, sc("ASCII 0x--"), doquote, NULL, NULL, notify)) return -1; else return 0; } else if ((c | 0x20) == 'x') { if (joe_maputf(bw->b->o.charmap)) goto uhex_uni; else goto uhex_raw; } else if ((c | 0x20) == 'o') { quotestate = 5; if (!mkqwna(bw->parent, sc("ASCII 0---"), doquote, NULL, NULL, notify)) return -1; else return 0; } else { unopoo: doquote0(bw, c, 0); } break; case 1: if (c >= '0' && c <= '9') { joe_snprintf_2((char *)buf, sizeof(buf), "ASCII %c%c-", quoteval + '0', c); quoteval = quoteval * 10 + c - '0'; quotestate = 2; if (!mkqwna(bw->parent, sz(buf), doquote, NULL, NULL, notify)) return -1; else return 0; } break; case 2: if (c >= '0' && c <= '9') { quoteval = quoteval * 10 + c - '0'; utypebw_raw(bw, quoteval, 1); bw->cursor->xcol = piscol(bw->cursor); } break; case 3: if (c >= '0' && c <= '9') { quoteval = c - '0'; uhex_3: joe_snprintf_1((char *)buf, sizeof(buf), "ASCII 0x%c-", c); quotestate = 4; if (!mkqwna(bw->parent, sz(buf), doquote, NULL, NULL, notify)) return -1; else return 0; } c &= ~0x20; if (c >= 'A' && c <= 'F') { quoteval = c - 'A' + 10; goto uhex_3; } break; case 4: if (c >= '0' && c <= '9') { quoteval = quoteval * 16 + c - '0'; u4out: utypebw_raw(bw, quoteval, 2); bw->cursor->xcol = piscol(bw->cursor); } else if (c >= 'a' && c <= 'f') { quoteval = quoteval * 16 + c - 'a' + 10; goto u4out; } else if (c >= 'A' && c <= 'F') { quoteval = quoteval * 16 + c - 'A' + 10; goto u4out; } break; case 5: if (c >= '0' && c <= '7') { joe_snprintf_1((char *)buf, sizeof(buf), "ASCII 0%c--", c); quoteval = c - '0'; quotestate = 6; if (!mkqwna(bw->parent, sz(buf), doquote, NULL, NULL, notify)) return -1; else return 0; } break; case 6: if (c >= '0' && c <= '7') { joe_snprintf_2((char *)buf, sizeof(buf), "ASCII 0%c%c-", quoteval + '0', c); quoteval = quoteval * 8 + c - '0'; quotestate = 7; if (!mkqwna(bw->parent, sz(buf), doquote, NULL, NULL, notify)) return -1; else return 0; } break; case 7: if (c >= '0' && c <= '7') { quoteval = quoteval * 8 + c - '0'; utypebw_raw(bw, quoteval, 1); bw->cursor->xcol = piscol(bw->cursor); } break; } if (notify) *notify = 1; return 0; } static char uquote_txt[] = "Ctrl- (or 0-9 for dec. o for octal, x hex, u UCS)"; int uquote(BW *bw) { quotestate = 0; if (joe_maputf(bw->b->o.charmap)) { uquote_txt[36] = 'r'; uquote_txt[43] = 'x'; } else { uquote_txt[36] = 'x'; uquote_txt[43] = 'u'; } return (mkqwna(bw->parent, sc(uquote_txt), doquote, NULL, NULL, NULL) ? 0 : -1); } static int doquote9(BW *bw, int c, void *object, int *notify) { if (notify) *notify = 1; doquote0(bw, c, 128); return 0; } static int doquote8(BW *bw, int c, void *object, int *notify) { if (c == '`') { if (mkqwna(bw->parent, sc("Meta-Ctrl-"), doquote9, NULL, NULL, notify)) return 0; else return -1; } if (notify) *notify = 1; c |= 128; utypebw_raw(bw, c, 1); bw->cursor->xcol = piscol(bw->cursor); return 0; } int uquote8(BW *bw) { if (mkqwna(bw->parent, sc("Meta-"), doquote8, NULL, NULL, NULL)) return 0; else return -1; } extern const unsigned char srchstr[]; static int doctrl(BW *bw, int c, void *object, int *notify) { int org = bw->o.overtype; if (notify) *notify = 1; bw->o.overtype = 0; if (bw->parent->huh == srchstr && c == '\n') { utypebw_raw(bw, '\\', 0); utypebw_raw(bw, 'n', 0); } else utypebw_raw(bw, c, 1); bw->o.overtype = org; bw->cursor->xcol = piscol(bw->cursor); return 0; } int uctrl(BW *bw) { if (mkqwna(bw->parent, sc("Quote"), doctrl, NULL, NULL, NULL)) return 0; else return -1; } /* User hit Return. Deal with autoindent. */ int rtntw(jobject jO) { BW *bw = jO.bw; if (bw->o.overtype) { p_goto_eol(bw->cursor); if (piseof(bw->cursor)) binsc(bw->cursor, '\n'); pgetc(bw->cursor); bw->cursor->xcol = piscol(bw->cursor); } else { P *p = pdup(bw->cursor); unsigned char c; binsc(bw->cursor, '\n'), pgetc(bw->cursor); /* Suppress autoindent if we're on a space or tab... */ if (bw->o.autoindent && (brch(bw->cursor)!=' ' && brch(bw->cursor)!='\t')) { p_goto_bol(p); while (joe_isspace(bw->b->o.charmap,(c = pgetc(p))) && c != '\n') { binsc(bw->cursor, c); pgetc(bw->cursor); } } prm(p); bw->cursor->xcol = piscol(bw->cursor); } return 0; } /* Open a line */ int uopen(BW *bw) { binsc(bw->cursor,'\n'); return 0; } /* Set book-mark */ static int dosetmark(BW *bw, int c, void *object, int *notify) { if (notify) *notify = 1; if (c >= '0' && c <= ':') { pdupown(bw->cursor, bw->b->marks + c - '0'); poffline(bw->b->marks[c - '0']); if (c!=':') { joe_snprintf_1((char *)msgbuf, JOE_MSGBUFSIZE, "Mark %d set", c - '0'); msgnw(bw->parent, msgbuf); } return 0; } else { nungetc(c); return -1; } } int usetmark(BW *bw, int c) { if (c >= '0' && c <= ':') return dosetmark(bw, c, NULL, NULL); else if (mkqwna(bw->parent, sc("Set mark (0-9):"), dosetmark, NULL, NULL, NULL)) return 0; else return -1; } /* Goto book-mark */ static int dogomark(BW *bw, int c, void *object, int *notify) { if (notify) *notify = 1; if (c >= '0' && c <= ':') if (bw->b->marks[c - '0']) { pset(bw->cursor, bw->b->marks[c - '0']); bw->cursor->xcol = piscol(bw->cursor); return 0; } else { joe_snprintf_1((char *)msgbuf, JOE_MSGBUFSIZE, "Mark %d not set", c - '0'); msgnw(bw->parent, msgbuf); return -1; } else { nungetc(c); return -1; } } int ugomark(BW *bw, int c) { if (c >= '0' && c <= '9') return dogomark(bw, c, NULL, NULL); else if (mkqwna(bw->parent, sc("Goto bookmark (0-9):"), dogomark, NULL, NULL, NULL)) return 0; else return -1; } /* Goto next instance of character */ static int dobkwdc; static int dofwrdc(BW *bw, int k, void *object, int *notify) { int c; P *q; if (notify) *notify = 1; if (k < 0 || k >= 256) { nungetc(k); return -1; } q = pdup(bw->cursor); if (dobkwdc) { while ((c = prgetc(q)) != NO_MORE_DATA) if (c == k) break; } else { while ((c = pgetc(q)) != NO_MORE_DATA) if (c == k) break; } if (c == NO_MORE_DATA) { msgnw(bw->parent, UC "Not found"); prm(q); return -1; } else { pset(bw->cursor, q); bw->cursor->xcol = piscol(bw->cursor); prm(q); return 0; } } int ufwrdc(BW *bw, int k) { dobkwdc = 0; if (k >= 0 && k < 256) return dofwrdc(bw, k, NULL, NULL); else if (mkqw(bw->parent, sc("Fwrd to char: "), dofwrdc, NULL, NULL, NULL)) return 0; else return -1; } int ubkwdc(BW *bw, int k) { dobkwdc = 1; if (k >= 0 && k < 256) return dofwrdc(bw, k, NULL, NULL); else if (mkqw(bw->parent, sc("Bkwd to char: "), dofwrdc, NULL, NULL, NULL)) return 0; else return -1; } /* Display a message */ static int domsg(BASE *b, unsigned char *s, void *object, int *notify) { if (notify) *notify = 1; strlcpy((char *)msgbuf, (char *)s, JOE_MSGBUFSIZE); vsrm(s); msgnw(b->parent, *msgbuf ? msgbuf : NULL); return 0; } int umsg(BASE *b) { if (wmkpw(b->parent, UC "Msg (^C to abort): ", NULL, domsg, NULL, NULL, NULL, NULL, NULL, locale_map)) return 0; else return -1; } /* Insert text */ static int dotxt(BW *bw, unsigned char *s, void *object, int *notify) { int x; if (notify) *notify = 1; for (x = 0; x != sLEN(s); ++x) utypebw_raw(bw, s[x], 0); vsrm(s); return 0; } int utxt(BW *bw) { if (wmkpw(bw->parent, UC "Insert (^C to abort): ", NULL, dotxt, NULL, NULL, utypebw, NULL, NULL, bw->b->o.charmap)) return 0; else return -1; } jupp/uedit.h010064400000000000000000000034671363731763600102770ustar00/* * Basic user edit functions * Copyright * (C) 1992 Joseph H. Allen * * This file is part of JOE (Joe's Own Editor) */ #ifndef JUPP_UEDIT_H #define JUPP_UEDIT_H #ifdef EXTERN_CMD_C __IDSTRING(rcsid_uedit_h, "$MirOS: contrib/code/jupp/uedit.h,v 1.10 2020/03/27 06:38:59 tg Exp $"); #endif extern int pgamnt; /* * Movable functions * return 0 if action was done * return -1 otherwise */ int u_goto_bol(BW *bw); /* move cursor to beginning of line */ int u_goto_eol(BW *bw); /* move cursor to end of line */ int u_goto_bof(BW *bw); /* move cursor to beginning of file */ int u_goto_eof(BW *bw); /* move cursor to end of file */ int u_goto_left(BW *bw); /* move cursor to left (left arrow) */ int u_goto_right(BW *bw); /* move cursor to right (right arrow) */ int u_goto_prev(BW *bw); /* move cursor to prev. word, edge, or beginning of line */ int u_goto_next(BW *bw); /* move cursor to next word, edge, or end of line */ int utomatch(BW *bw); int urvmatch(BW *bw); int uuparw(BW *bw); int udnarw(BW *bw); int utos(BW *bw); int ubos(BW *bw); void scrup(BW *bw, int n, int flg); void scrdn(BW *bw, int n, int flg); int upgup(BW *bw); int upgdn(BW *bw); int uupslide(BW *bw); int udnslide(BW *bw); int uline(BW *bw); int udelch(BW *bw); int ubacks(BW *bw, int k); int u_word_delete(BW *bw); int ubackw(BW *bw); int udelel(BW *bw); int udelbl(BW *bw); int udelln(BW *bw); int uinsc(BW *bw); int utypebw(jobject, int k); int utypebw_raw(BW *bw, int k, int no_decode); int uquote(BW *bw); int uquote8(BW *bw); int rtntw(jobject); int uopen(BW *bw); int usetmark(BW *bw, int c); int ugomark(BW *bw, int c); int ufwrdc(BW *bw, int k); int ubkwdc(BW *bw, int k); int umsg(BASE *b); int uctrl(BW *bw); int unedge(BW *bw); int upedge(BW *bw); int ubyte(BW *bw); int ucol(BW *bw); int utxt(BW *bw); int uhome(BW *bw); #endif jupp/uerror.c010064400000000000000000000144171363731415400104630ustar00/* * Compiler error handler * Copyright * (C) 1992 Joseph H. Allen * * This file is part of JOE (Joe's Own Editor) */ #include "config.h" #include "types.h" __RCSID("$MirOS: contrib/code/jupp/uerror.c,v 1.12 2020/03/27 06:08:17 tg Exp $"); #include "b.h" #include "bw.h" #include "main.h" #include "queue.h" #include "tw.h" #include "uerror.h" #include "ufile.h" #include "utils.h" #include "vs.h" #include "charmap.h" #include "w.h" /* Error database */ typedef struct error ERROR; struct error { LINK(ERROR) link; /* Linked list of errors */ long line; /* Target line number */ long org; /* Original target line number */ unsigned char *file; /* Target file name */ long src; /* Error-file line number */ unsigned char *msg; /* The message */ } errors = { { &errors, &errors}, 0, 0, NULL, 0, NULL }; ERROR *errptr = &errors; /* Current error row */ B *errbuf = NULL; /* Buffer with error messages */ /* Insert and delete notices */ void inserr(unsigned char *name, long int where, long int n, int bol) { ERROR *e; if (name) { for (e = errors.link.next; e != &errors; e = e->link.next) { if (!strcmp(e->file, name)) { if (e->line > where) e->line += n; else if (e->line == where && bol) e->line += n; } } } } void delerr(unsigned char *name, long int where, long int n) { ERROR *e; if (name) { for (e = errors.link.next; e != &errors; e = e->link.next) { if (!strcmp(e->file, name)) { if (e->line > where + n) e->line -= n; else if (e->line > where) e->line = where; } } } } /* Abort notice */ void abrerr(unsigned char *name) { ERROR *e; if (name) for (e = errors.link.next; e != &errors; e = e->link.next) if (!strcmp(e->file, name)) e->line = e->org; } /* Save notice */ void saverr(unsigned char *name) { ERROR *e; if (name) for (e = errors.link.next; e != &errors; e = e->link.next) if (!strcmp(e->file, name)) e->org = e->line; } /* Pool of free error nodes */ ERROR errnodes = { {&errnodes, &errnodes}, 0, 0, NULL, 0, NULL }; /* Free an error node */ static void freeerr(ERROR *n) { vsrm(n->file); vsrm(n->msg); enquef(ERROR, link, &errnodes, n); } /* Free all errors */ static void freeall(void) { while (!qempty(ERROR, link, &errors)) freeerr(deque_f(ERROR, link, errors.link.next)); errptr = &errors; } /* Parse error messages into database */ /* From joe's joe 2.9 */ /* First word on line with a '.' in it. This is the file name. The next number after that is the line number. */ static int parseit(union charmap *map, unsigned char *s, long int row) { int x, y, flg; unsigned char *name = NULL; long line = -1; ERROR *err; y=0; flg=0; do { /* Skip to first word */ for (x = y; s[x] && !(joe_isalnux(map, s[x]) || s[x] == '.' || s[x] == '/'); ++x) /* nothing */; /* Skip to end of first word */ for (y = x; joe_isalnux(map, s[y]) || s[y] == '.' || s[y] == '/'; ++y) if (s[y] == '.') flg = 1; } while (!flg && x!=y); /* Save file name */ if (x != y) name = vsncpy(NULL, 0, s + x, y - x); /* Skip to first number */ for (x = y; s[x] && (s[x] < '0' || s[x] > '9'); ++x) ; /* Skip to end of first number */ for (y = x; s[y] >= '0' && s[y] <= '9'; ++y) ; /* Save line number */ if (x != y) { void *vp; line = ustol(s + x, &vp, USTOL_DEC); if (!vp) line = -1; else --line; } /* Look for ':' */ flg = 0; while (s[y]) { if (s[y]==':') { flg = 1; break; } ++y; } if (name) { if (line != -1 && flg) { /* We have an error */ err = (ERROR *) alitem(&errnodes, sizeof(ERROR)); err->file = name; err->org = err->line = line; err->src = row; err->msg = vsncpy(NULL, 0, sc("\\i")); err->msg = vsncpy(sv(err->msg), sv(s)); enqueb(ERROR, link, &errors, err); return 1; } else vsrm(name); } return 0; } /* Parse the error output contained in a buffer */ static long parserr(B *b) { P *p = pdup(b->bof); P *q = pdup(p); long nerrs = 0; freeall(); do { unsigned char *s; pset(q, p); p_goto_eol(p); s = brvs(q, (int) (p->byte - q->byte)); if (s) { nerrs += parseit(b->o.charmap, s, q->line); vsrm(s); } } while (pgetc(p) != NO_MORE_DATA); prm(p); prm(q); return nerrs; } static BW * find_a_good_bw(B *b) { W *w; BW *bw = 0; /* Find lowest window with buffer */ if ((w = maint->topwin) != NULL) { do { if ((w->watom->what & TYPETW) && w->object.bw->b == b && w->y >= 0) bw = w->object.bw; w = w->link.next; } while (w != maint->topwin); } if (bw) return bw; /* Otherwise just find lowest window */ if ((w = maint->topwin) != NULL) { do { if ((w->watom->what&TYPETW) && w->y>=0) bw = w->object.bw; w = w->link.next; } while (w != maint->topwin); } return bw; } int parserrb(B *b) { BW *bw; long n; errbuf = b; freeall(); n = parserr(b); bw = find_a_good_bw(b); if (n) joe_snprintf_1((char *)msgbuf, JOE_MSGBUFSIZE, "%ld messages found", n); else joe_snprintf_0((char *)msgbuf, JOE_MSGBUFSIZE, "No messages found"); msgnw(bw->parent, msgbuf); return 0; } int uparserr(BW *bw) { long n; errbuf = bw->b; freeall(); n = parserr(bw->b); if (n) joe_snprintf_1((char *)msgbuf, JOE_MSGBUFSIZE, "%ld messages found", n); else joe_snprintf_0((char *)msgbuf, JOE_MSGBUFSIZE, "No messages found"); msgnw(bw->parent, msgbuf); return 0; } int unxterr(BW *bw) { int omid; if (errptr->link.next == &errors) { msgnw(bw->parent, UC "No more errors"); return -1; } errptr = errptr->link.next; if (!bw->b->name || strcmp(errptr->file, bw->b->name)) { if (doswitch(bw, vsdup(errptr->file), NULL, NULL)) return -1; bw = maint->curwin->object.bw; } omid = mid; mid = 1; pline(bw->cursor, errptr->line); setline(errbuf, errptr->src); dofollows(); mid = omid; bw->cursor->xcol = piscol(bw->cursor); msgnw(bw->parent, errptr->msg); return 0; } int uprverr(BW *bw) { int omid; if (errptr->link.prev == &errors) { msgnw(bw->parent, UC "No more errors"); return -1; } errptr = errptr->link.prev; if (!bw->b->name || strcmp(errptr->file, bw->b->name)) { if (doswitch(bw, vsdup(errptr->file), NULL, NULL)) return -1; bw = maint->curwin->object.bw; } omid = mid; mid = 1; pline(bw->cursor, errptr->line); setline(errbuf, errptr->src); dofollows(); mid = omid; bw->cursor->xcol = piscol(bw->cursor); msgnw(bw->parent, errptr->msg); return 0; } jupp/uerror.h010064400000000000000000000011161363731763600104700ustar00/* * Compiler error handler * Copyright * (C) 1992 Joseph H. Allen * * This file is part of JOE (Joe's Own Editor) */ #ifndef JUPP_UERROR_H #define JUPP_UERROR_H #ifdef EXTERN_B_C __IDSTRING(rcsid_uerror_h, "$MirOS: contrib/code/jupp/uerror.h,v 1.6 2020/03/27 06:38:59 tg Exp $"); #endif int unxterr(BW *bw); int uprverr(BW *bw); int parserrb(B *b); int uparserr(BW *bw); void inserr(unsigned char *name, long int where, long int n, int bol); void delerr(unsigned char *name, long int where, long int n); void abrerr(unsigned char *name); void saverr(unsigned char *name); #endif jupp/ufile.c010064400000000000000000000521731426610112200102360ustar00/* * User file operations * Copyright * (C) 1992 Joseph H. Allen * * This file is part of JOE (Joe's Own Editor) */ #define EXTERN_UFILE_C #include "config.h" #include "types.h" __RCSID("$MirOS: contrib/code/jupp/ufile.c,v 1.32 2022/07/20 22:31:19 tg Exp $"); #include #include #include #include #ifdef UTIME #include #define HAVEUTIME 1 #else #ifdef SYSUTIME #include #define HAVEUTIME 1 #endif #endif #include "b.h" #include "bw.h" #include "macro.h" #include "main.h" #include "menu.h" #include "path.h" #include "pw.h" #include "qw.h" #include "scrn.h" #include "tab.h" #include "tty.h" #include "tw.h" #include "ublock.h" #include "uerror.h" #include "ufile.h" #include "ushell.h" #include "utils.h" #include "va.h" #include "vs.h" #include "charmap.h" #include "w.h" extern int orphan; unsigned char *backpath = NULL; /* Place to store backup files */ static B *filehist = NULL; /* History of file names */ int nobackups = 0; int exask = 0; /* Ending message generator */ /**** message which is shown after closing joe (CTRL+x; CTRL+k) *****/ void genexmsg(BW *bw, int saved, unsigned char *name) { const unsigned char *s; if (bw->b->name && bw->b->name[0]) { s = bw->b->name; } else { s = UC "(Unnamed)"; } if (name) { if (saved) { joe_snprintf_1((char *)msgbuf, JOE_MSGBUFSIZE, "File %s saved", name); } else { joe_snprintf_1((char *)msgbuf, JOE_MSGBUFSIZE, "File %s not saved", name); } } else if (bw->b->changed && bw->b->count == 1) { joe_snprintf_1((char *)msgbuf, JOE_MSGBUFSIZE, "File %s not saved", s); } else if (saved) { joe_snprintf_1((char *)msgbuf, JOE_MSGBUFSIZE, "File %s saved", s); } else { joe_snprintf_1((char *)msgbuf, JOE_MSGBUFSIZE, "File %s not changed so no update needed", s); } msgnw(bw->parent, msgbuf); if (exmsg) vsrm(exmsg); if (bw->b->changed && bw->b->count == 1) { exmsg = vsncpy(NULL, 0, sc("File ")); exmsg = vsncpy(sv(exmsg), sz(s)); exmsg = vsncpy(sv(exmsg), sc(" not saved.")); } else if (saved) { exmsg = vsncpy(NULL, 0, sc("File ")); exmsg = vsncpy(sv(exmsg), sz(s)); exmsg = vsncpy(sv(exmsg), sc(" saved.")); } else { exmsg = vsncpy(NULL, 0, sc("File ")); exmsg = vsncpy(sv(exmsg), sz(s)); exmsg = vsncpy(sv(exmsg), sc(" not changed so no update needed.")); } } /* For ^X ^C */ static void genexmsgmulti(BW *bw, int saved, int skipped) { if (saved) if (skipped) joe_snprintf_0((char *)msgbuf, JOE_MSGBUFSIZE, "Some files have not been saved."); else joe_snprintf_0((char *)msgbuf, JOE_MSGBUFSIZE, "All modified files have been saved."); else joe_snprintf_0((char *)msgbuf, JOE_MSGBUFSIZE, "No modified files, so no updates needed."); msgnw(bw->parent, msgbuf); exmsg = vsncpy(NULL,0,sz(msgbuf)); } /* Write highlighted block to a file */ int ublksave(BW *bw) { if (markb && markk && markb->b == markk->b && (markk->byte - markb->byte) > 0 && (!square || piscol(markk) > piscol(markb))) { if (wmkpw(bw->parent, UC "Name of file to write (^C to abort): ", &filehist, dowrite, UC "Names", NULL, cmplt, NULL, NULL, locale_map)) { return 0; } else { return -1; } } else { return usave(bw); } } /* Shell escape */ int ushell(BW *bw) { nescape(bw->parent->t->t); ttsusp(); nreturn(bw->parent->t->t); return 0; } /* Copy a file */ static int cp(const unsigned char *from, int g, const unsigned char *tmpfn, const unsigned char *to) { int f, amnt; struct stat sbuf; #ifdef HAVEUTIME #ifdef NeXT time_t utbuf[2]; #else struct utimbuf utbuf; #endif #endif f = open((const char *)from, O_RDONLY); if (f < 0) { return -1; } if (fstat(f, &sbuf) < 0) { close(f); return -1; } if (fchmod(g, sbuf.st_mode & 0777)) { close(f); return (-1); } while ((amnt = read(f, stdbuf, stdsiz)) > 0) { if (amnt != joe_write(g, stdbuf, amnt)) { break; } } close(f); if (amnt) { return -1; } #ifdef HAVE_FSYNC if (fsync(g)) return (-1); #endif if (close(g)) return (-1); if (tmpfn && rename(tmpfn, to)) { return (-1); } /* * Do not return !0 from here on. * Below are only operations that run when the copy * process finished successfully. */ #ifdef HAVEUTIME #ifdef NeXT utbuf[0] = (time_t) sbuf.st_atime; utbuf[1] = (time_t) sbuf.st_mtime; #else utbuf.actime = sbuf.st_atime; utbuf.modtime = sbuf.st_mtime; #endif utime(to, &utbuf); #endif copy_security_context(from, to); return 0; } /* Make backup file if it needs to be made * Returns 0 if backup file was made or didn't need to be made * Returns 1 for error */ static int backup(BW *bw) { unsigned char tmp[1024 + 12]; unsigned char name[1024]; const unsigned char *simple_backup_suffix; unsigned char *tmpfn; int fd; int rv; if (bw->b->backup || nobackups || !(bw->b->name) || !(bw->b->name[0])) return (0); /* Create backup file name */ simple_backup_suffix = (unsigned char *)getenv("SIMPLE_BACKUP_SUFFIX"); if (simple_backup_suffix == NULL) { simple_backup_suffix = UC "~"; } if (backpath) { joe_snprintf_3((char *)name, sizeof(name), "%s/%s%s", backpath, namepart(tmp, bw->b->name), simple_backup_suffix); } else { joe_snprintf_2((char *)name, sizeof(name), "%s%s", bw->b->name, simple_backup_suffix); } /* Securely generate a backup file temporary file */ *tmp = '\0'; if (*name != '/') { /* relative pathname */ if (!getcwd((char *)tmp, sizeof(tmp)) || strlcat((char *)tmp, "/", sizeof(tmp)) >= sizeof(tmp)) return (1); } if (strlcat((char *)tmp, (char *)name, sizeof(tmp)) >= sizeof(tmp)) return (1); *(dirprt_ptr(tmp)) = '\0'; if ((tmpfn = mktmp(tmp, &fd)) == NULL) return (1); /* Attempt to delete backup file first */ unlink((char *)name); /* Copy original file to backup file securely */ if (cp(bw->b->name, fd, tmpfn, name)) { close(fd); unlink((char *)tmpfn); rv = 1; } else { bw->b->backup = 1; rv = 0; } vsrm(tmpfn); return (rv); } /* Write file */ /* Continuation structure */ struct savereq { int (*callback)(BW *, struct savereq *, int, int *); unsigned char *name; B *first; int not_saved; /* Set if a modified file was not saved */ int rename; /* Set if we're renaming the file during save */ }; static struct savereq * mksavereq(int (*callback)(BW *, struct savereq *, int, int *), unsigned char *name, B *first, int dorename) { struct savereq *req = malloc(sizeof(struct savereq)); req->callback = callback; req->name = name; req->first = first; req->not_saved = 0; req->rename = dorename; return req; } static void rmsavereq(struct savereq *req) { vsrm(req->name); free(req); } static int saver(BW *bw, int c, struct savereq *req, int *notify) { int fl; if ((c | 0x20) == 'n') { msgnw(bw->parent, UC "Couldn't make backup file... file not saved"); if (req->callback) { return req->callback(bw, req, -1, notify); } else { if (notify) { *notify = 1; } rmsavereq(req); return -1; } } if ((c | 0x20) != 'y') { if (mkqw(bw->parent, sc("Could not make backup file. Save anyway (y,n,^C)? "), saver, NULL, req, notify)) { return 0; } else { rmsavereq(req); if (notify) *notify = 1; return -1; } } if (bw->b->er == -1 && bw->o.msnew) { exemac(bw->o.msnew); bw->b->er = -3; } if (bw->b->er == 0 && bw->o.msold) { exemac(bw->o.msold); } if ((fl = bsave(bw->b->bof, req->name, bw->b->eof->byte, 1)) != 0) { msgnw(bw->parent, msgs[-fl]); if (req->callback) { return req->callback(bw, req, -1, notify); } else { rmsavereq(req); if (notify) { *notify = 1; } return -1; } } else { if (req->rename) { free(bw->b->name); bw->b->name = 0; } if (!bw->b->name) bw->b->name = joesep((unsigned char *)strdup((char *)req->name)); if (!strcmp(bw->b->name, req->name)) { bw->b->changed = 0; saverr(bw->b->name); } { /* Last UNDOREC which wasn't modified will be changed * to modified. And because this block is * executed after each 'save', there can't be more * than one record which is not modified * 24 Apr 2001, Marx */ UNDO *u = bw->b->undo; UNDOREC *rec, *rec_start; rec = rec_start = &u->recs; do { rec = rec->link.prev; } while (rec != rec_start && rec->changed); if(rec->changed == 0) rec->changed = 1; } genexmsg(bw, 1, req->name); if (req->callback) { return req->callback(bw, req, 0, notify); } else { rmsavereq(req); return 0; } } } static int dosave(BW *bw, struct savereq *req, int *notify) { return (saver(bw, backup(bw) ? 0 : 'y', req, notify)); } static int dosave2(BW *bw, int c, struct savereq *req, int *notify) { if ((c | 0x20) == 'y') { return dosave(bw, req, notify); } else if ((c | 0x20) == 'n') { if (notify) { *notify = 1; } genexmsg(bw, 0, req->name); rmsavereq(req); return -1; } else if (mkqw(bw->parent, sc("File exists. Overwrite (y,n,^C)? "), dosave2, NULL, req, notify)) { return 0; } else { /* Should be in abort function */ rmsavereq(req); return -1; } } static int dosave2a(BW *bw, int c, struct savereq *req, int *notify) { if ((c | 0x20) == 'y') { return dosave(bw, req, notify); } else if ((c | 0x20) == 'n') { if (notify) { *notify = 1; } genexmsg(bw, 0, req->name); rmsavereq(req); return -1; } else if (mkqw(bw->parent, sc("File on disk is newer. Overwrite (y,n,^C)? "), dosave2a, NULL, req, notify)) { return 0; } else { rmsavereq(req); return -1; } } /* Checks if file exists. */ static int dosave1(BW *bw, unsigned char *s, struct savereq *req, int *notify) { int f; if (req->name) vsrm(req->name); req->name = s; if (s[0] != '!' && !(s[0] == '>' && s[1] == '>')) { /* It's a normal file: not a pipe or append */ if (!bw->b->name || strcmp(s, bw->b->name)) { /* Newly named file or name is different than buffer */ f = open((char *)s, O_RDONLY); if (f != -1) { close(f); return dosave2(bw, 0, req, notify); } } else { /* We're saving a newer version of the same file */ struct stat sbuf; if (!stat((char *)s,&sbuf)) { if (sbuf.st_mtime>bw->b->mod_time) { return dosave2a(bw, 0, req, notify); } } } } return dosave(bw, req, notify); } /* User command: ^K D */ int usave(BW *bw) { BW *pbw; pbw = wmkpw(bw->parent, UC "Name of file to save (^C to abort): ", &filehist, dosave1, UC "Names", NULL, cmplt, mksavereq(NULL,NULL,NULL,0), NULL, locale_map); if (pbw && bw->b->name) { binss(pbw->cursor, bw->b->name); pset(pbw->cursor, pbw->b->eof); pbw->cursor->xcol = piscol(pbw->cursor); } if (pbw) { return 0; } else { return -1; } } /* Load file to edit */ static int doedit1(BW *bw, int c, unsigned char *s, int *notify) { int ret = 0; int er; void *object; W *w; B *b; switch (c | 0x20) { case 'y': /* Reload from file */ c = 1; break; case 'n': /* Edit already loaded buffer */ c = 0; break; default: /* Ask what todo */ /* FIXME: need abort handler to prevent leak */ if (mkqw(bw->parent, sc("Load original file from disk (y,n,^C)? "), doedit1, NULL, s, notify)) return (0); vsrm(s); return (-1); } if (notify) *notify = 1; b = c ? bfind_reload(s) : bfind(s); er = error; c = c ? (bw->b->count >= 1) : (bw->b->count == 1); if (c && (bw->b->changed || bw->b->name)) { if (orphan) { orphit(bw); } else { if (uduptw(bw)) { brm(b); vsrm(s); return (-1); } bw = maint->curwin->object.bw; } } if (er) { msgnwt(bw->parent, msgs[-er]); if (er != -1) ret = -1; } object = bw->object; w = bw->parent; bwrm(bw); w->object.bw = bw = bwmk(w, b, 0); wredraw(bw->parent); bw->object = object; vsrm(s); if (er == -1 && bw->o.mnew) exemac(bw->o.mnew); if (er == 0 && bw->o.mold) exemac(bw->o.mold); return (ret); } static int doedit(BW *bw, unsigned char *s, void *obj, int *notify) { B *b; b = bcheck_loaded(s); if (b) { if (b->changed) /* Modified buffer exists, so ask */ return doedit1(bw, 0, s, notify); else /* Buffer not modified- just use it as is */ return doedit1(bw, 'n', s, notify); } else /* File not in buffer: don't ask */ return doedit1(bw, 'y', s, notify); } int okrepl(BW *bw) { if (bw->b->count == 1 && bw->b->changed) { msgnw(bw->parent, UC "Can't replace modified file"); return -1; } else { return 0; } } int uedit(BW *bw) { if (wmkpw(bw->parent, UC "Name of file to edit (^C to abort): ", &filehist, doedit, UC "Names", NULL, cmplt, NULL, NULL, locale_map)) { return 0; } else { return -1; } } int doswitch(BW *bw, unsigned char *s, void *obj, int *notify) { /* Try buffer, then file */ return doedit1(bw, 'n', s, notify); } int uswitch(BW *bw) { if (wmkpw(bw->parent, UC "Name of buffer to edit (^C to abort): ", &filehist, doswitch, UC "Names", NULL, cmplt, NULL, NULL, locale_map)) { return 0; } else { return -1; } } static int doscratch(BW *bw, unsigned char *s, void *obj, int *notify) { int ret = 0; int er; void *object; W *w; B *b; if (notify) { *notify = 1; } b = bfind_scratch(s); er = error; vsrm(s); if (bw->b->count == 1 && (bw->b->changed || bw->b->name)) { if (orphan) { orphit(bw); } else { if (uduptw(bw)) { brm(b); return -1; } bw = maint->curwin->object.bw; } } if (er && er != -1) { msgnwt(bw->parent, msgs[-er]); ret = -1; } object = bw->object; w = bw->parent; bwrm(bw); w->object.bw = bw = bwmk(w, b, 0); wredraw(bw->parent); bw->object = object; if (er == -1 && bw->o.mnew) { exemac(bw->o.mnew); } if (er == 0 && bw->o.mold) { exemac(bw->o.mold); } return ret; } int uscratch(BW *bw) { if (wmkpw(bw->parent, UC "Name of scratch buffer to edit (^C to abort): ", &filehist, doscratch, UC "Names", NULL, cmplt, NULL, NULL, locale_map)) { return 0; } else { return -1; } } /* Load file into buffer: can result in an orphaned buffer */ static int dorepl(BW *bw, unsigned char *s, void *obj, int *notify) { void *object = bw->object; int ret = 0; int er; W *w = bw->parent; B *b; if (notify) { *notify = 1; } b = bfind(s); er = error; if (error) { msgnwt(bw->parent, msgs[-error]); if (error != -1) { ret = -1; } } if (bw->b->count == 1 && (bw->b->changed || bw->b->name)) { orphit(bw); } bwrm(bw); w->object.bw = bw = bwmk(w, b, 0); wredraw(bw->parent); bw->object = object; vsrm(s); if (er == -1 && bw->o.mnew) { exemac(bw->o.mnew); } if (er == 0 && bw->o.mold) { exemac(bw->o.mold); } return ret; } /* Switch to next buffer in window */ int unbuf(BW *bw) { void *object = bw->object; W *w = bw->parent; B *b; b = bnext(); if (b == bw->b) { b = bnext(); } if (b == bw->b) { return 0; /* return -1; this helps with querysave (no error when only one buffer) */ } if (!b->orphan) { ++b->count; } else { b->orphan = 0; } if (bw->b->count == 1) { orphit(bw); } bwrm(bw); w->object.bw = bw = bwmk(w, b, 0); wredraw(bw->parent); bw->object = object; return 0; } int upbuf(BW *bw) { void *object = bw->object; W *w = bw->parent; B *b; b = bprev(); if (b == bw->b) { b = bprev(); } if (b == bw->b) { return 0; /* return -1; */ } if (!b->orphan) { ++b->count; } else { b->orphan = 0; } if (bw->b->count == 1) { orphit(bw); } bwrm(bw); w->object.bw = bw = bwmk(w, b, 0); wredraw(bw->parent); bw->object = object; return 0; } int uinsf(BW *bw) { if (wmkpw(bw->parent, UC "Name of file to insert (^C to abort): ", &filehist, doinsf, UC "Names", NULL, cmplt, NULL, NULL, locale_map)) { return 0; } else { return -1; } } /* Save and exit */ static int exdone(BW *bw, struct savereq *req,int flg,int *notify) { if (notify) *notify = 1; rmsavereq(req); if (flg) { return -1; } else { bw->b->changed = 0; saverr(bw->b->name); return uabort1(bw, -1); } } int uexsve(BW *bw) { if (!bw->b->changed || bw->b->scratch) { /* It didn't change or it's just a scratch buffer: don't save */ uabort(bw, -1); return 0; } else if (bw->b->name && !exask) { /* It changed, it's not a scratch buffer and it's named */ return dosave1(bw, vsncpy(NULL, 0, sz(bw->b->name)), mksavereq(exdone,NULL,NULL,0), NULL); } else { BW *pbw = wmkpw(bw->parent, UC "Name of file to save (^C to abort): ", &filehist, dosave1, UC "Names", NULL, cmplt, mksavereq(exdone,NULL,NULL,1), NULL, locale_map); if (pbw && bw->b->name) { binss(pbw->cursor, bw->b->name); pset(pbw->cursor, pbw->b->eof); pbw->cursor->xcol = piscol(pbw->cursor); } if (pbw) { return 0; } else { return -1; } } } /* If buffer is modified, prompt for saving: if user types 'n', uabort(), otherwise just return. */ /* If buffer is not modified, just return. */ static int nask(BW *bw, int c, void *object, int *notify) { if ((c | 0x20) == 'y') { /* uexsve macro should be here... */ if(notify) *notify = 1; return 0; } else if ((c | 0x20) == 'n') { if(notify) *notify = -1; genexmsg(bw, 0, NULL); abortit(bw); return -1; } else if (bw->b->count == 1 && bw->b->changed && !bw->b->scratch) { if (mkqw(bw->parent, sc("Save changes to this file (y,n,^C)? "), nask, NULL, object, notify)) { return 0; } else { return -1; } } else { if (notify) { *notify = 1; } return 0; } } int uask(BW *bw) { return nask(bw, 0, NULL, NULL); } /* Kill a buffer: any windows which have it get their buffer replaced with a * a scratch buffer */ static int dolose(BW *bw, int c, void *object, int *notify) { W *w; B *b, *new_b; int cnt; if (notify) { *notify = 1; } if ((c | 0x20) != 'y') { return -1; } b=bw->b; cnt = b->count; b->count = 1; genexmsg(bw, 0, NULL); b->count = cnt; if ((w = maint->topwin) != NULL) { do { if ((w->watom->what & TYPETW) && w->object.bw->b == b) { if ((new_b = borphan()) != NULL) { BW *bw2 = w->object.bw; void *object_ = bw2->object; /* FIXME: Shouldn't we wabort() and wcreate here to kill any prompt windows? */ bwrm(bw2); w->object.bw = bw2 = bwmk(w, new_b, 0); wredraw(w); bw2->object = object_; } else { BW *bw2 = w->object.bw; object = bw2->object; bwrm(bw2); w->object.bw = bw2 = bwmk(w, bfind(UC ""), 0); wredraw(w); bw2->object = object; if (bw2->o.mnew) exemac(bw2->o.mnew); } } w = w->link.next; } while (w != maint->topwin); } return 0; } int ulose(BW *bw) { msgnw(bw->parent, NULL); if (bw->b->count==1 && bw->b->pid) { return ukillpid(bw); } if (bw->b->changed && !bw->b->scratch) { if (mkqw(bw->parent, sc("Lose changes to this file (y,n,^C)? "), dolose, NULL, NULL, NULL)) { return 0; } else { return -1; } } else { return dolose(bw, 'y', NULL, NULL); } } /* Buffer list */ static int dobuf(MENU *m, int x, unsigned char **s) { unsigned char *name; BW *bw = m->parent->win->object.bw; int *notify = m->parent->notify; m->parent->notify = 0; name = vsdup(s[x]); wabort(m->parent); return dorepl(bw, name, NULL, notify); } static int abrtb(MENU *m, int x, unsigned char **s) { varm(s); return -1; } int ubufed(BW *bw) { unsigned char **s = getbufs(); vasort(av(s)); if (mkmenu(bw->parent, s, dobuf, abrtb, NULL, 0, s, NULL)) return 0; else { varm(s); return -1; } } /* Query save loop */ static int doquerysave(BW *bw,int c,struct savereq *req,int *notify) { W *w = bw->parent; if ((c | 0x20) == 'y') { if (bw->b->name && bw->b->name[0]) return dosave1(bw, vsncpy(NULL,0,sz(bw->b->name)), req, notify); else { BW *pbw; pbw = wmkpw(bw->parent, UC "Name of file to save (^C to abort): ", &filehist, dosave1, UC "Names", NULL, cmplt, req, notify, locale_map); if (pbw) { return 0; } else { free(req); return -1; } } } else if ((c | 0x20) == 'n') { /* Find next buffer to save */ if (bw->b->changed) req->not_saved = 1; next: if (unbuf(bw)) { if (notify) *notify = 1; rmsavereq(req); return -1; } bw = w->object.bw; if (bw->b==req->first) { int cached_not_saved = req->not_saved; if (notify) *notify = 1; rmsavereq(req); genexmsgmulti(bw,1,cached_not_saved); return 0; } if (!bw->b->changed || bw->b->scratch) goto next; return doquerysave(bw,0,req,notify); } else { unsigned char buf[1024]; joe_snprintf_1(buf, 1024, "File '%s' has been modified. Save it (y,n,^C)? ", bw->b->name ? bw->b->name : UC "(Unnamed)" ); if (mkqw(bw->parent, sz(buf), doquerysave, NULL, req, notify)) { return 0; } else { /* Should be in abort function */ rmsavereq(req); return -1; } } } static int query_next(BW *bw, struct savereq *req,int flg,int *notify) { if (flg) { if (notify) *notify = 1; rmsavereq(req); return -1; } else return doquerysave(bw,'N',req,notify); } int uquerysave(BW *bw) { W *w = bw->parent; B *first = bw->b; /* Find a modified buffer */ do { if (bw->b->changed && !bw->b->scratch) return doquerysave(bw,0,mksavereq(query_next,NULL,first,0),NULL); else if (unbuf(bw)) return -1; bw = w->object.bw; } while(bw->b!=first); genexmsgmulti(bw,0,0); return 0; } int ukilljoe(BW *bw) { leave = 1; return 0; } extern int main_rv; int uabendjoe(BW *bw) { main_rv = 1; return (ukilljoe(bw)); } int usync(BW *bw) { #ifdef HAVE_SYNC msgnwt(bw->parent, UC "\\i>\\i \\fSynchronising, please wait...\\f \\i<\\i"); msgout(bw->parent); edupd(1); sync(); sleep(1); sync(); msgnwt(bw->parent, UC "\\i>\\i \\bSynchronised buffers to disc.\\b \\i<\\i"); return (0); #else msgnw(bw->parent, UC "Sorry, compiled without sync(2)"); return (-1); #endif } jupp/ufile.h010064400000000000000000000014451363731763600102630ustar00/* * User file operations * Copyright * (C) 1992 Joseph H. Allen * * This file is part of JOE (Joe's Own Editor) */ #ifndef JUPP_UFILE_H #define JUPP_UFILE_H #ifdef EXTERN_CMD_C __IDSTRING(rcsid_ufile_h, "$MirOS: contrib/code/jupp/ufile.h,v 1.9 2020/03/27 06:38:59 tg Exp $"); #endif extern int exask; void genexmsg(BW *bw, int saved, unsigned char *name); int ublksave(BW *bw); int ushell(BW *bw); int usave(BW *bw); int uedit(BW *bw); int uswitch(BW *bw); int uscratch(BW *bw); int uinsf(BW *bw); int uexsve(BW *bw); int unbuf(BW *bw); int upbuf(BW *bw); int uask(BW *bw); int ubufed(BW *bw); int ulose(BW *bw); int okrepl(BW *bw); int doswitch(BW *bw, unsigned char *s, void *obj, int *notify); int uquerysave(BW *bw); int ukilljoe(BW *bw); int uabendjoe(BW *bw); int usync(BW *bw); #endif jupp/uformat.c010064400000000000000000000242151373547060500106220ustar00/* * User text formatting functions * Copyright * (C) 1992 Joseph H. Allen * * This file is part of JOE (Joe's Own Editor) */ #include "config.h" #include "types.h" __RCSID("$MirOS: contrib/code/jupp/uformat.c,v 1.16 2020/10/02 00:16:42 tg Exp $"); #include #include #include "b.h" #include "ublock.h" #include "uformat.h" #include "charmap.h" #include "utils.h" /* Center line cursor is on and move cursor to beginning of next line */ int ucenter(BW *bw) { P *p = bw->cursor, *q; long endcol, begcol, x; int c; p_goto_eol(p); while (joe_isblank((c = prgetc(p)))) /* do nothing */; if (c == '\n') { pgetc(p); goto done; } if (c == NO_MORE_DATA) goto done; pgetc(p); endcol = piscol(p); p_goto_bol(p); while (joe_isblank((c = pgetc(p)))) /* do nothing */; if (c == '\n') { prgetc(p); goto done; } if (c == NO_MORE_DATA) goto done; prgetc(p); begcol = piscol(p); if (endcol - begcol > bw->o.rmargin + bw->o.lmargin) goto done; q = pdup(p); p_goto_bol(q); bdel(q, p); prm(q); for (x = 0; x != (bw->o.lmargin + bw->o.rmargin) / 2 - (endcol - begcol) / 2; ++x) binsc(p, ' '); done: if (!pnextl(p)) { binsc(p, '\n'); pgetc(p); return -1; } else return 0; } /* Return true if c is a character which can indent a paragraph */ static int cpara(int c) { if (c < '0') return (c != '"' && c != '\'' && c != '('/*)*/ && (c >= ' ' || c == '\t')); if (c < ':') return (0); if (c < 'A') return (c != '<'); if (c < '`') return (c > /*[*/']'); return (c > '{'/*}*/ && c <= '~'); } /* Return true if line is definitly not a paragraph line. * Lines which aren't paragraph lines: * 1) Blank lines * 2) Lines which begin with '.' */ static int pisnpara(P *p) { P *q; int c; q = pdup(p); p_goto_bol(q); while (cpara(c = pgetc(q))) /* do nothing */; prm(q); if (c == '.' || c == '\r' || c == '\n') return 1; else return 0; } /* Determine amount of indentation on current line */ static long nindent(P *p) { P *q = pdup(p); long col; p_goto_bol(q); do { col = q->col; } while (cpara(pgetc(q))); prm(q); return col; } /* Get indentation prefix column */ static long prefix(P *p) { long len; P *q = pdup(p); p_goto_bol(q); while (cpara(brch(q))) pgetc(q); while (!pisbol(q)) if (!joe_isblank(prgetc(q))) { pgetc(q); break; } len = q->col; prm(q); return len; } /* Move pointer to beginning of paragraph * * This function simply moves backwards until it sees: * 0) The beginning of the file * 1) A blank line * 2) A line with a different indentation prefix * 3) A line with indentation greater than that of the line we started with * 4) A line with indentation less than that of the starting line, but with * a blank line (or beginning of file) preceeding it. */ static char within = 0; P * pbop(P *p) { long indent; long prelen; p_goto_bol(p); indent = nindent(p); prelen = prefix(p); while (!pisbof(p) && (!within || !markb || p->byte > markb->byte)) { long ind; long len; pprevl(p); p_goto_bol(p); ind = nindent(p); len = prefix(p); if (pisnpara(p) || len != prelen) { pnextl(p); break; } if (ind > indent) break; if (ind < indent) { if (pisbof(p)) break; pprevl(p); p_goto_bol(p); if (pisnpara(p)) { pnextl(p); break; } else { pnextl(p); pnextl(p); break; } } } return p; } /* Move pointer to end of paragraph. Pointer must already be on first * line of paragraph for this to work correctly. * * This function moves forwards until it sees: * 0) The end of the file. * 1) A blank line * 2) A line with indentation different from the second line of the paragraph * 3) A line with prefix column different from first line */ P * peop(P *p) { long indent; long prelen; if (!pnextl(p) || pisnpara(p) || (within && markk && p->byte >= markk->byte)) return p; indent = nindent(p); prelen = prefix(p); while (pnextl(p) && (!within || !markk || p->byte < markk->byte)) { long ind = nindent(p); long len = prefix(p); if (ind != indent || len != prelen || pisnpara(p)) break; } return p; } /* Motion commands */ int ubop(BW *bw) { P *q = pdup(bw->cursor); up: while (pisnpara(q) && !pisbof(q) && (!within || !markb || q->byte > markb->byte)) pprevl(q); pbop(q); if (q->byte != bw->cursor->byte) { pset(bw->cursor, q); prm(q); return 0; } else if (!pisbof(q)) { prgetc(q); goto up; } else { prm(q); return -1; } } int ueop(BW *bw) { P *q = pdup(bw->cursor); up: while (pisnpara(q) && !piseof(q)) pnextl(q); pbop(q); peop(q); if (q->byte != bw->cursor->byte) { pset(bw->cursor, q); prm(q); return 0; } else if (!piseof(q)) { pnextl(q); goto up; } else { prm(q); return -1; } } /* Wrap word. If 'french' is set, only one space will be placed * after . ? or ! */ void wrapword(P *p, long int indent, int french, unsigned char *indents) { P *q; int c; long to = p->byte; /* Get to beginning of word */ while (!pisbol(p) && piscol(p) > indent && !joe_isblank(prgetc(p))) /* do nothing */; /* If we found the beginning of a word... */ if (!pisbol(p) && piscol(p) > indent) { /* Move q to two (or one if 'french' is set) spaces after end of previous word */ q = pdup(p); while (!pisbol(q)) if (!joe_isblank((c = prgetc(q)))) { pgetc(q); if ((c == '.' || c == '?' || c == '!') && q->byte != p->byte && !french) pgetc(q); break; } pgetc(p); /* Delete space between start of word and end of previous word */ to -= p->byte - q->byte; bdel(q, p); prm(q); /* Move word to beginning of next line */ binsc(p, '\n'); ++to; if (p->b->o.crlf) ++to; pgetc(p); /* Indent to left margin */ if (indents) { binss(p, indents); to += strlen((char *)indents); } else while (indent--) { binsc(p, ' '); ++to; } } /* Move cursor back to original position */ pfwrd(p, to - p->byte); } /* Reformat paragraph */ int uformat(BW *bw) { long indent; unsigned char *indents; B *buf; P *b; long curoff; int c; P *p, *q; p = pdup(bw->cursor); p_goto_bol(p); /* Do nothing if we're not on a paragraph line */ if (pisnpara(p)) { prm(p); return 0; } /* Move p to beginning of paragraph, bw->cursor to end of paragraph and * set curoff to original cursor offset within the paragraph */ pbop(p); curoff = bw->cursor->byte - p->byte; pset(bw->cursor, p); peop(bw->cursor); /* Ensure that paragraph ends on a beginning of a line */ if (!pisbol(bw->cursor)) binsc(bw->cursor, '\n'), pgetc(bw->cursor); /* Record indentation of second line of paragraph, of first line if there * is only one line */ q = pdup(p); pnextl(q); if (q->line != bw->cursor->line) { P *r = pdup(q); indent = nindent(q); pcol(r, indent); indents = brs(q, r->byte - q->byte); prm(r); } else { P *r = pdup(p); indent = nindent(p); pcol(r, indent); indents = brs(p, r->byte - p->byte); prm(r); } prm(q); /* But if the left margin is greater, we use that instead */ if (bw->o.lmargin > indent) indent = bw->o.lmargin; /* Cut paragraph into new buffer */ /* New buffer needs to inherit UTF-8 and CR-LF options */ buf = bcpy(p, bw->cursor); buf->o.crlf = p->b->o.crlf; buf->o.charmap = p->b->o.charmap; bdel(p, bw->cursor); /* text is in buffer. insert it at cursor */ /* Do first line */ b = pdup(buf->bof); while (!piseof(b)) { /* Set cursor position if we're at original offset */ if (b->byte == curoff) pset(bw->cursor, p); /* Get character from buffer */ c = pgetc(b); /* Stop if we found end of line */ if (c == '\n') { prgetc(b); break; } /* Stop if we found white-space followed by end of line */ if (joe_isblank(c) && piseolblank(b)) break; /* Insert character, advance pointer */ binsc(p, c); pgetc(p); /* Do word wrap if we reach right margin */ if (piscol(p) > bw->o.rmargin && !joe_isblank(c)) { wrapword(p, indent, bw->o.french, indents); break; } } /* Do rest */ while (!piseof(b)) { c = brch(b); if (joe_isblank(c) || c == '\n') { int f = 0; P *d; int g; /* Set f if there are two spaces after . ? or ! instead of one */ /* (What is c was '\n'?) */ d=pdup(b); g=prgetc(d); if (g=='.' || g=='?' || g=='!') { pset(d,b); pgetc(d); if (joe_isspace(bw->b->o.charmap,brch(d))) f = 1; } prm(d); /* Skip past the whitespace. Skip over indentations */ loop: c = brch(b); if (c == '\n') { if (b->byte == curoff) pset(bw->cursor, p); pgetc(b); while (cpara(c=brch(b))) { if (b->byte == curoff) pset(bw->cursor, p); pgetc(b); } } if (joe_isblank(c)) { if(b->byte == curoff) pset(bw->cursor, p); pgetc(b); goto loop; } /* Insert proper amount of whitespace */ if (!piseof(b)) { if (f && !bw->o.french) binsc(p, ' '), pgetc(p); binsc(p, ' '); pgetc(p); } } else { /* Insert characters of word and wrap if necessary */ if (b->byte == curoff) pset(bw->cursor, p); binsc(p, pgetc(b)); pgetc(p); if (piscol(p) > bw->o.rmargin) wrapword(p, indent, bw->o.french, indents); } } binsc(p, '\n'); prm(p); brm(buf); free(indents); return 0; } /* Format entire block */ int ufmtblk(BW *bw) { P *p; long blkend; char hasp; /* within a selection? */ if (!(markv(1) && bw->cursor->byte >= markb->byte && bw->cursor->byte <= markk->byte)) /* no */ return (uformat(bw)); /* save current cursor position */ p = pdup(bw->cursor); hasp = 0; /* reformat from bottom to top */ markk->end = 1; utomarkk(bw); within = 1; do { /* span current paragraph between bw->cursor->byte and blkend */ blkend = bw->cursor->byte; ubop(bw); /* original cursor in betwixt those? */ if (p->byte > bw->cursor->byte && p->byte < blkend) { /* reformat while cursor is in original place */ pset(bw->cursor, p); uformat(bw); /* save, to return to it later */ pset(p, bw->cursor); hasp = 1; /* but jump back to beginning of paragraph */ ubop(bw); } else uformat(bw); } while (bw->cursor->byte > markb->byte); within = 0; markk->end = 0; if (lightoff) unmark(bw); /* restore saved cursor position */ if (hasp) pset(bw->cursor, p); prm(p); return (0); } jupp/uformat.h010064400000000000000000000010141363731763600106240ustar00/* * User text formatting functions * Copyright * (C) 1992 Joseph H. Allen * * This file is part of JOE (Joe's Own Editor) */ #ifndef JUPP_UFORMAT_H #define JUPP_UFORMAT_H #ifdef EXTERN_CMD_C __IDSTRING(rcsid_uformat_h, "$MirOS: contrib/code/jupp/uformat.h,v 1.7 2020/03/27 06:38:59 tg Exp $"); #endif int ucenter(BW *bw); P *pbop(P *p); P *peop(P *p); int ubop(BW *bw); int ueop(BW *bw); void wrapword(P *p, long int indent, int french, unsigned char *indents); int uformat(BW *bw); int ufmtblk(BW *bw); #endif jupp/uisrch.c010064400000000000000000000157331363731415400104440ustar00/* * Incremental search * Copyright * (C) 1992 Joseph H. Allen * * This file is part of JOE (Joe's Own Editor) */ #include "config.h" #include "types.h" __RCSID("$MirOS: contrib/code/jupp/uisrch.c,v 1.16 2020/03/27 06:08:17 tg Exp $"); #include #include "b.h" #include "bw.h" #include "main.h" #include "queue.h" #include "qw.h" #include "tty.h" #include "uisrch.h" #include "usearch.h" #include "utils.h" #include "charmap.h" #include "vs.h" extern int smode; extern int dobeep; extern int icase; struct isrch *lastisrch = NULL; /* Previous search */ unsigned char *lastpat = NULL; /* Previous pattern */ extern SRCH *globalsrch; /* Existing SRCH structure */ IREC fri = { {&fri, &fri}, 0, 0, 0, 0 }; /* Free-list of irecs */ static IREC *alirec(void) { /* Allocate an IREC */ return alitem(&fri, sizeof(IREC)); } static void frirec(IREC *i) { /* Free an IREC */ enquef(IREC, link, &fri, i); } static void rmisrch(struct isrch *isrch) { /* Eliminate a struct isrch */ if (isrch) { vsrm(isrch->pattern); vsrm(isrch->prompt); frchn(&fri, &isrch->irecs); free(isrch); } } static int iabrt(BW *bw, struct isrch *isrch) { /* User hit ^C */ rmisrch(isrch); return -1; } static void iappend(BW *bw, struct isrch *isrch, unsigned char *s, int len) { /* Append text and search */ /* Append char and search */ IREC *i = alirec(); SRCH *srch; i->what = len; i->disp = bw->cursor->byte; isrch->pattern = vsncpy(sv(isrch->pattern), s, len); if (!qempty(IREC, link, &isrch->irecs)) { pgoto(bw->cursor, isrch->irecs.link.prev->start); } i->start = bw->cursor->byte; if (!globalsrch) srch = mksrch(NULL,NULL,icase,isrch->dir,-1,0,0); else { srch = globalsrch; globalsrch = 0; } srch->addr = bw->cursor->byte; if (!srch->wrap_p || srch->wrap_p->b!=bw->b) { prm(srch->wrap_p); srch->wrap_p = pdup(bw->cursor); srch->wrap_p->owner = &srch->wrap_p; srch->wrap_flag = 0; } i->wrap_flag = srch->wrap_flag; vsrm(srch->pattern); srch->pattern = vsncpy(NULL, 0, isrch->pattern, sLen(isrch->pattern)); srch->backwards = isrch->dir; if (dopfnext(bw, srch, NULL)) { if(dobeep) ttputc(7); } enqueb(IREC, link, &isrch->irecs, i); } /* Main user interface */ /* When called with c==-1, it just creates the prompt */ static int itype(BW *bw, int c, struct isrch *isrch, int *notify) { IREC *i; int omid; int tc; if (isrch->quote) { goto in; } if (c == 8 || c == 127) { /* Backup */ if ((i = isrch->irecs.link.prev) != &isrch->irecs) { pgoto(bw->cursor, i->disp); if (globalsrch) globalsrch->wrap_flag = i->wrap_flag; omid = mid; mid = 1; dofollows(); mid = omid; isrch->pattern = vstrunc(isrch->pattern, sLEN(isrch->pattern) - i->what); frirec(deque_f(IREC, link, i)); } else { if(dobeep) ttputc(7); } } else if (c == 'Q' - '@' || c == '`') { isrch->quote = 1; } else if (c == 'S' - '@' || c == '\\' - '@' || c == 'L' - '@' || c == 'R' - '@') { /* Repeat */ if (c == 'R' - '@') { isrch->dir = 1; } else { isrch->dir = 0; } if (qempty(IREC, link, &isrch->irecs)) { if (lastpat && lastpat[0]) { iappend(bw, isrch, sv(lastpat)); } } else { SRCH *srch; i = alirec(); i->disp = i->start = bw->cursor->byte; i->what = 0; if (!globalsrch) srch = mksrch(NULL,NULL,icase,isrch->dir,-1,0,0); else { srch = globalsrch; globalsrch = 0; } srch->addr = bw->cursor->byte; if (!srch->wrap_p || srch->wrap_p->b!=bw->b) { prm(srch->wrap_p); srch->wrap_p = pdup(bw->cursor); srch->wrap_p->owner = &srch->wrap_p; srch->wrap_flag = 0; } i->wrap_flag = srch->wrap_flag; vsrm(srch->pattern); srch->pattern = vsncpy(NULL, 0, isrch->pattern, sLen(isrch->pattern)); srch->backwards = isrch->dir; if (dopfnext(bw, srch, NULL)) { if(dobeep) ttputc(7); frirec(i); } else { enqueb(IREC, link, &isrch->irecs, i); } } } else if (c >= 0 && c < 32) { /* Done when a control character is received */ nungetc(c); if (notify) { *notify = 1; } smode = 2; if (lastisrch) { lastpat = vstrunc(lastpat, 0); lastpat = vsncpy(lastpat, 0, lastisrch->pattern, sLen(lastisrch->pattern)); rmisrch(lastisrch); } lastisrch = isrch; return 0; } else if (c != -1) { unsigned char buf[16]; int buf_len; /* Search */ in: /* Convert to/from utf-8 */ if (joe_maputf(locale_map) && !joe_maputf(bw->b->o.charmap)) { utf8_encode(buf,c); c = from_utf8(bw->b->o.charmap,buf); } else if (!joe_maputf(locale_map) && joe_maputf(bw->b->o.charmap)) { to_utf8(locale_map,buf,c); c = utf8_decode_string(buf); } if (joe_maputf(bw->b->o.charmap)) { buf_len = utf8_encode(buf,c); } else { buf[0] = c; buf_len = 1; } isrch->quote = 0; iappend(bw, isrch, buf, buf_len); } omid = mid; mid = 1; bw->cursor->xcol = piscol(bw->cursor); dofollows(); mid = omid; isrch->prompt = vstrunc(isrch->prompt, isrch->ofst); if (joe_maputf(locale_map) && !joe_maputf(bw->b->o.charmap)) { /* Translate bytes to utf-8 */ unsigned char buf[16]; int x; for (x = 0; x != sLEN(isrch->pattern); ++x) { tc = joe_to_uni(bw->b->o.charmap, isrch->pattern[x]); utf8_encode(buf, tc); isrch->prompt = vsncpy(sv(isrch->prompt), sz(buf)); } } else if (!joe_maputf(locale_map) && joe_maputf(bw->b->o.charmap)) { /* Translate utf-8 to bytes */ unsigned char *p = isrch->pattern; int len = sLEN(isrch->pattern); while (len) { if ((tc = utf8_decode_fwrd(&p, &len)) >= 0) { tc = joe_from_uni(locale_map, tc); isrch->prompt = vsadd(isrch->prompt, tc); } } } else { /* FIXME: translate when charmaps do not match */ isrch->prompt = vsncpy(sv(isrch->prompt),sv(isrch->pattern)); } if (mkqwnsr(bw->parent, sv(isrch->prompt), itype, iabrt, isrch, notify)) { return 0; } else { rmisrch(isrch); return -1; } } /* Create a struct isrch */ static int doisrch(BW *bw, int dir) { struct isrch *isrch = malloc(sizeof(struct isrch)); izque(IREC, link, &isrch->irecs); isrch->pattern = vsncpy(NULL, 0, NULL, 0); isrch->dir = dir; isrch->quote = 0; isrch->prompt = vsncpy(NULL, 0, sc("I-find: ")); isrch->ofst = sLen(isrch->prompt); return itype(bw, -1, isrch, NULL); } int uisrch(BW *bw) { if (smode && lastisrch) { struct isrch *isrch = lastisrch; lastisrch = 0; return itype(bw, 'S' - '@', isrch, NULL); } else { if (globalsrch) { rmsrch(globalsrch); globalsrch = 0; } if (lastisrch) { lastpat = vstrunc(lastpat, 0); lastpat = vsncpy(lastpat, 0, lastisrch->pattern, sLen(lastisrch->pattern)); rmisrch(lastisrch); lastisrch = 0; } return doisrch(bw, 0); } } int ursrch(BW *bw) { if (smode && lastisrch) { struct isrch *isrch = lastisrch; lastisrch = 0; return itype(bw, 'R' - '@', isrch, NULL); } else { if (globalsrch) { rmsrch(globalsrch); globalsrch = 0; } if (lastisrch) { lastpat = vstrunc(lastpat, 0); lastpat = vsncpy(lastpat, 0, lastisrch->pattern, sLen(lastisrch->pattern)); rmisrch(lastisrch); lastisrch = 0; } return doisrch(bw, 1); } } jupp/uisrch.h010064400000000000000000000005271363731763600104540ustar00/* * Incremental search * Copyright * (C) 1992 Joseph H. Allen * * This file is part of JOE (Joe's Own Editor) */ #ifndef JUPP_UISRCH_H #define JUPP_UISRCH_H #ifdef EXTERN_CMD_C __IDSTRING(rcsid_uisrch_h, "$MirOS: contrib/code/jupp/uisrch.h,v 1.6 2020/03/27 06:38:59 tg Exp $"); #endif int uisrch(BW *bw); int ursrch(BW *bw); #endif jupp/umath.c010064400000000000000000000126711363731415500102640ustar00/* * Math * Copyright * (C) 1992 Joseph H. Allen * * This file is part of JOE (Joe's Own Editor) */ #include "config.h" #include "types.h" __RCSID("$MirOS: contrib/code/jupp/umath.c,v 1.27 2020/03/27 06:08:18 tg Exp $"); #include #include #include "b.h" #include "pw.h" #include "umath.h" #include "utils.h" #include "vs.h" #include "charmap.h" #include "w.h" volatile sig_atomic_t merrf; const unsigned char *merrt; #if WANT_MATH static char math_res[JOE_MSGBUFSIZE]; static char *math_exp; static double calc(BW *bw, unsigned char *s); static RETSIGTYPE fperr(int unused) { if (!merrf) merrf = 2; REINSTALL_SIGHANDLER(SIGFPE, fperr); } struct var { struct var *next; unsigned char *name; double val; int set; } *vars = NULL; static struct var * get(const unsigned char *str) { struct var *v; for (v = vars; v; v = v->next) { if (!strcmp(v->name, str)) { return v; } } v = malloc(sizeof(struct var)); v->set = 0; v->next = vars; vars = v; v->name = (unsigned char *)strdup((const char *)str); return v; } unsigned char *ptr; struct var *dumb; static double expr(int prec, struct var **rtv) { unsigned char c; double x = 0.0; struct var *v = NULL; while (*ptr == ' ' || *ptr == '\t') { ++ptr; } c = *ptr | 0x20; if ((c >= 'a' && c <= 'z') || *ptr == '_') { unsigned char *s = ptr; while (((c = *ptr | 0x20) >= 'a' && c <= 'z') || *ptr == '_' || (*ptr >= '0' && *ptr <= '9')) ++ptr; c = *ptr; *ptr = 0; v = get(s); x = v->val; *ptr = c; } else if (ptr[0] == '0' && (ptr[1] | 0x20) == 'x') { unsigned long xi; void *dp; xi = ustol(ptr, &dp, USTOL_AUTO); x = (double)xi; ptr = dp; } else if ((*ptr >= '0' && *ptr <= '9') || *ptr == '.') { char *eptr; x = strtod(ptr, &eptr); ptr = (unsigned char *)eptr; } else if (*ptr == '(') { ++ptr; x = expr(0, &v); if (*ptr == ')') ++ptr; else if (!merrf) { merrf = 1; merrt = UC "Missing )"; } } else if (*ptr == '-') { ++ptr; x = -expr(10, &dumb); } loop: while (*ptr == ' ' || *ptr == '\t') ++ptr; if (*ptr == '*' && 5 > prec) { ++ptr; x *= expr(5, &dumb); goto loop; } else if (*ptr == '/' && 5 > prec) { ++ptr; x /= expr(5, &dumb); goto loop; } else if (*ptr == '+' && 4 > prec) { ++ptr; x += expr(4, &dumb); goto loop; } else if (*ptr == '-' && 4 > prec) { ++ptr; x -= expr(4, &dumb); goto loop; } else if (*ptr == '=' && 2 >= prec) { ++ptr; x = expr(2, &dumb); if (v) { v->val = x; v->set = 1; } else if (!merrf) { merrf = 1; merrt = UC "Left side of = is not an l-value"; } goto loop; } *rtv = v; return x; } #if defined(SIZEOF_LONG_LONG) && (SIZEOF_LONG_LONG > 0) typedef long long joe_imaxt; #define JOE_IMAXT "ll" #else typedef long joe_imaxt; #define JOE_IMAXT "l" #endif static double calc(BW *bw, unsigned char *s) { double result; struct var *v; BW *tbw = bw->parent->main->object.bw; if (math_exp) { free(math_exp); } math_exp = strdup((void *)s); v = get(UC "top"); v->val = tbw->top->line + 1; v->set = 1; v = get(UC "lines"); v->val = tbw->b->eof->line + 1; v->set = 1; v = get(UC "line"); v->val = tbw->cursor->line + 1; v->set = 1; v = get(UC "col"); v->val = tbw->cursor->col + 1; v->set = 1; v = get(UC "byte"); v->val = tbw->cursor->byte + 1; v->set = 1; v = get(UC "height"); v->val = tbw->h; v->set = 1; v = get(UC "width"); v->val = tbw->w; v->set = 1; ptr = s; merrf = 0; up: result = expr(0, &dumb); if (!merrf) { while (*ptr == ' ' || *ptr == '\t') { ++ptr; } if (*ptr == ';') { ++ptr; while (*ptr == ' ' || *ptr == '\t') { ++ptr; } if (*ptr) { goto up; } } else if (*ptr && !merrf) { merrf = 1; merrt = UC "Extra junk after end of expr"; } } if (merrf) { if (merrf == 2) merrt = UC "Float point exception"; joe_snprintf_1(math_res, JOE_MSGBUFSIZE, "math_error{%s}", merrt); } else { joe_imaxt ires = (joe_imaxt)result; if ((double)ires == result) { /* representable as integer value */ joe_snprintf_1(math_res, JOE_MSGBUFSIZE, "%" JOE_IMAXT "d", ires); } else { /* use float with large precision */ joe_snprintf_1(math_res, JOE_MSGBUFSIZE, "%.60G", result); } } return result; } /* Main user interface */ static int domath(BW *bw, unsigned char *s, void *object, int *notify) { calc(bw, s); vsrm(s); if (notify) { *notify = 1; } if (merrf) { msgnw(bw->parent, merrt); return -1; } memcpy(msgbuf, math_res, JOE_MSGBUFSIZE); if (bw->parent->watom->what != TYPETW) { binsm(bw->cursor, sz(msgbuf)); pfwrd(bw->cursor, strlen((char *)msgbuf)); bw->cursor->xcol = piscol(bw->cursor); } else { msgnw(bw->parent, msgbuf); } return 0; } B *mathhist = NULL; int umath(BW *bw) { joe_set_signal(SIGFPE, fperr); if (wmkpw(bw->parent, UC "=", &mathhist, domath, UC "Math", NULL, NULL, NULL, NULL, locale_map)) { return 0; } else { return -1; } } int umathins(BW *bw) { if (math_exp) { binss(bw->cursor, (void *)math_exp); } return 0; } int umathres(BW *bw) { binss(bw->cursor, (void *)math_res); return 0; } long calcl(BW *bw, unsigned char *s) { double rv; rv = calc(bw, s); return ((long)rv); } #else long calcl(BW *bw, unsigned char *s) { long rv; void *cp = NULL; rv = ustol(s, &cp, USTOL_TRIM | USTOL_EOS); if (!cp) { rv = 0; merrt = UC "Invalid or out-of-range number"; merrf = 1; } return (rv); } int unomath(BW *bw) { msgnw(bw->parent, UC "Sorry, compiled without Math"); return (-1); } #endif jupp/umath.h010064400000000000000000000011331363731763600102670ustar00/* * Math * Copyright * (C) 1992 Joseph H. Allen * * This file is part of JOE (Joe's Own Editor) */ #ifndef JUPP_UMATH_H #define JUPP_UMATH_H #ifdef EXTERN_CMD_C __IDSTRING(rcsid_umath_h, "$MirOS: contrib/code/jupp/umath.h,v 1.12 2020/03/27 06:38:59 tg Exp $"); #endif #include extern volatile sig_atomic_t merrf; extern const unsigned char *merrt; long calcl(BW *bw, unsigned char *s); #if WANT_MATH int umath(BW *bw); int umathins(BW *bw); int umathres(BW *bw); #else int unomath(BW *bw); #define umath unomath #define umathins unomath #define umathres unomath #endif #endif jupp/undo.c010064400000000000000000000225561321535735200101140ustar00/* * UNDO system * Copyright * (C) 1992 Joseph H. Allen * * This file is part of JOE (Joe's Own Editor) */ #include "config.h" #include "types.h" __RCSID("$MirOS: contrib/code/jupp/undo.c,v 1.11 2017/12/17 03:04:47 tg Exp $"); #include #include "b.h" #include "blocks.h" #include "queue.h" #include "ublock.h" #include "undo.h" #include "utils.h" #include "w.h" #define SMALL_UNDOREC 1024 static UNDO undos = { {&undos, &undos}, NULL, 0, { {NULL, NULL}, NULL, 0, 0, 0, 0, 0, NULL, NULL }, NULL, NULL, NULL }; static UNDO frdos = { {&frdos, &frdos}, NULL, 0, { {NULL, NULL}, NULL, 0, 0, 0, 0, 0, NULL, NULL }, NULL, NULL, NULL }; int inundo = 0; int inredo = 0; extern int dostaupd; UNDOREC yanked = { {&yanked, &yanked}, NULL, 0, 0, 0, 0, 0, NULL, NULL }; int nyanked = 0; int inyank = 0; int justkilled = 0; UNDOREC frrecs = { {&frrecs, &frrecs}, NULL, 0, 0, 0, 0, 0, NULL, NULL }; static UNDOREC *alrec(void) { UNDOREC *rec = (UNDOREC *) alitem(&frrecs, sizeof(UNDOREC)); return rec; } static void frrec(UNDOREC *rec) { if (rec->del) { if (rec->len < SMALL_UNDOREC) free(rec->small); else { B *b = rec->big; bonline(b); brm(b); } } enquef(UNDOREC, link, &frrecs, rec); } UNDO *undomk(B *b) { UNDO *undo = (UNDO *) alitem(&frdos, sizeof(UNDO)); undo->nrecs = 0; undo->ptr = NULL; undo->last = NULL; undo->first = NULL; undo->b = b; izque(UNDOREC, link, &undo->recs); enquef(UNDO, link, &undos, undo); return undo; } void undorm(UNDO *undo) { frchn(&frrecs, &undo->recs); demote(UNDO, link, &frdos, undo); } static void doundo(BW *bw, UNDOREC *ptr) { dostaupd = 1; if (ptr->del) { if (ptr->len < SMALL_UNDOREC) binsm(bw->cursor, ptr->small, (int) ptr->len); else { B *b = ptr->big; bonline(b); binsb(bw->cursor, bcpy(b->bof, b->eof)); boffline(b); } } else { P *q = pdup(bw->cursor); pfwrd(q, ptr->len); bdel(bw->cursor, q); prm(q); } bw->b->changed = ptr->changed; } int uundo(BW *bw) { UNDOREC *upto; UNDO *undo = bw->b->undo; if (!undo) return -1; if (!undo->nrecs) return -1; if (!undo->ptr) { pgoto(bw->cursor, undo->recs.link.prev->where); undo->ptr = &undo->recs; /* If this return is uncommented, then uundo will jump to where the undo is about to occur before actually undoing anything */ /* return 0; */ } if (undo->ptr->link.prev == &undo->recs) return -1; upto = undo->ptr->link.prev->unit; loop: undo->ptr = undo->ptr->link.prev; pgoto(bw->cursor, undo->ptr->where); inundo = 1; doundo(bw, undo->ptr); inundo = 0; if (upto && upto != undo->ptr) goto loop; return 0; } int uredo(BW *bw) { UNDOREC *upto; UNDOREC *ptr; UNDO *undo = bw->b->undo; if (!undo) return -1; if (!undo->ptr) return -1; if (undo->ptr == &undo->recs) return -1; upto = undo->recs.link.prev->unit; do { ptr = undo->recs.link.prev; pgoto(bw->cursor, ptr->where); inredo = 1; doundo(bw, ptr); inredo = 0; frrec(deque_f(UNDOREC, link, ptr)); undo->ptr = undo->ptr->link.next; } while (upto && upto != ptr); return 0; } void umclear(void) { UNDO *undo; for (undo = undos.link.next; undo != &undos; undo = undo->link.next) { UNDOREC *rec; for (rec = undo->recs.link.next; rec != &undo->recs; rec = rec->link.next) rec->min = 0; } } /* Eliminate excess undo records */ static void undogc(UNDO *undo) { UNDOREC *unit = undo->recs.link.next->unit; int flg = 0; if (undo->ptr && undo->ptr->link.prev == &undo->recs) flg = 1; if (unit) while (unit != undo->recs.link.next) frrec(deque_f(UNDOREC, link, undo->recs.link.next)); frrec(deque_f(UNDOREC, link, undo->recs.link.next)); --undo->nrecs; if (flg) undo->ptr = undo->recs.link.next; } void undomark(void) { UNDO *undo; for (undo = undos.link.next; undo != &undos; undo = undo->link.next) if (undo->first) { undo->first->unit = undo->last; undo->last->unit = undo->first; undo->first = undo->last = 0; if (++undo->nrecs == UNDOKEEP) undogc(undo); } } /* Delete the alternate time-line after the user has resumed editing after * undoing some number of changes */ static void undoover(UNDO *undo) { undo->ptr = NULL; } void undoins(UNDO *undo, P *p, long size) { UNDOREC *rec; if (inredo) return; if (!inundo) if (undo->ptr && undo->ptr != &undo->recs) undoover(undo); rec = undo->recs.link.prev; if (rec != &undo->recs && rec->min && !rec->del && (p->byte == rec->where + rec->len || p->byte == rec->where)) rec->len += size; else { rec = alrec(); rec->del = 0; if (!undo->first) undo->first = rec; undo->last = rec; rec->where = p->byte; rec->min = 1; rec->unit = NULL; rec->len = size; rec->changed = undo->b->changed; enqueb(UNDOREC, link, &undo->recs, rec); } } int uyapp(BW *bw) { UNDOREC *rec = yanked.link.prev; if (rec != &yanked) rec->where = bw->cursor->byte; return 0; } static void yankdel(long where, B *b) { UNDOREC *rec; long size = b->eof->byte; /* Store in yank buffer */ rec = yanked.link.prev; if (!inyank) { if (rec != &yanked && where == rec->where && justkilled) { if (rec->len + size >= SMALL_UNDOREC) { if (rec->len < SMALL_UNDOREC) { rec->big = bmk(NULL); binsm(rec->big->bof, rec->small, (int) rec->len); boffline(rec->big); free(rec->small); } bonline(rec->big); binsb(rec->big->eof, bcpy(b->bof, b->eof)); boffline(rec->big); } else { rec->small = realloc(rec->small, rec->len + size); brmem(b->bof, rec->small + rec->len, (int) size); } rec->len += size; } else if (rec != &yanked && where + size == rec->where && justkilled) { if (rec->len + size >= SMALL_UNDOREC) { if (rec->len < SMALL_UNDOREC) { rec->big = bmk(NULL); binsm(rec->big->bof, rec->small, (int) rec->len); boffline(rec->big); free(rec->small); } bonline(rec->big); binsb(rec->big->bof, bcpy(b->bof, b->eof)); boffline(rec->big); } else { rec->small = realloc(rec->small, rec->len + size); mmove(rec->small + size, rec->small, (int) rec->len); brmem(b->bof, rec->small, (int) size); } rec->len += size; rec->where = where; } else { if (++nyanked == 100) { frrec(deque_f(UNDOREC, link, yanked.link.next)); --nyanked; } rec = alrec(); if (size < SMALL_UNDOREC) { rec->small = malloc(size); brmem(b->bof, rec->small, (int)b->eof->byte); } else { rec->big = bcpy(b->bof, b->eof); boffline(rec->big); } rec->where = where; rec->len = size; rec->del = 1; enqueb(UNDOREC, link, &yanked, rec); } } } void undodel(UNDO *undo, long where, B *b) { UNDOREC *rec; long size = b->eof->byte; if (inredo) { brm(b); return; } if (!inundo) if (undo->ptr && undo->ptr != &undo->recs) undoover(undo); yankdel(where, b); /* Store in undo buffer */ rec = undo->recs.link.prev; if (rec != &undo->recs && rec->min && rec->del && where == rec->where) { if (rec->len + size >= SMALL_UNDOREC) { if (rec->len < SMALL_UNDOREC) { rec->big = bmk(NULL); binsm(rec->big->bof, rec->small, (int) rec->len); boffline(rec->big); free(rec->small); } bonline(rec->big); binsb(rec->big->eof, b); boffline(rec->big); } else { rec->small = realloc(rec->small, rec->len + size); brmem(b->bof, rec->small + rec->len, (int) size); brm(b); } rec->len += size; } else if (rec != &undo->recs && rec->min && rec->del && where + size == rec->where) { if (rec->len + size >= SMALL_UNDOREC) { if (rec->len < SMALL_UNDOREC) { rec->big = bmk(NULL); binsm(rec->big->bof, rec->small, (int) rec->len); boffline(rec->big); free(rec->small); } bonline(rec->big); binsb(rec->big->bof, b); boffline(rec->big); } else { rec->small = realloc(rec->small, rec->len + size); mmove(rec->small + size, rec->small, (int) rec->len); brmem(b->bof, rec->small, (int) size); brm(b); } rec->len += size; rec->where = where; } else { rec = alrec(); if (size < SMALL_UNDOREC) { rec->small = malloc(size); brmem(b->bof, rec->small, (int) b->eof->byte); brm(b); } else { rec->big = b; boffline(b); } if (!undo->first) undo->first = rec; undo->last = rec; rec->where = where; rec->min = 1; rec->unit = NULL; rec->len = size; rec->del = 1; rec->changed = undo->b->changed; enqueb(UNDOREC, link, &undo->recs, rec); } } B *yankbuf = NULL; long yankwhere = -1; int uyank(BW *bw) { UNDOREC *ptr = yanked.link.prev; if (ptr != &yanked) { if (ptr->len < SMALL_UNDOREC) binsm(bw->cursor, ptr->small, (int) ptr->len); else { B *b = ptr->big; bonline(b); binsb(bw->cursor, bcpy(b->bof, b->eof)); boffline(b); } pfwrd(bw->cursor, ptr->len); yankbuf = bw->b; yankwhere = bw->cursor->byte; return 0; } else return -1; } int uyankpop(BW *bw) { if (bw->b == yankbuf && bw->cursor->byte == yankwhere) { P *q; UNDOREC *ptr = yanked.link.prev; deque(UNDOREC, link, &yanked); enqueb(UNDOREC, link, ptr, &yanked); q = pdup(bw->cursor); pbkwd(q, ptr->len); inyank = 1; bdel(q, bw->cursor); inyank = 0; prm(q); return uyank(bw); } else return uyank(bw); } /* Clear changed-flag: make buffer look unmodified */ int unotmod(BW *bw) { bw->b->changed = 0; msgnw(bw->parent, UC "Modified flag cleared"); return 0; } int ucopy(BW *bw) { if (markv(1) && !square) { B *b = bcpy(markb, markk); yankdel(markb->byte, b); brm(b); if (lightoff) unmark(bw); return 0; } else { msgnw(bw->parent, UC "No block"); return -1; } } jupp/undo.h010064400000000000000000000012101363731763600101120ustar00/* * UNDO system * Copyright * (C) 1992 Joseph H. Allen * * This file is part of JOE (Joe's Own Editor) */ #ifndef JUPP_UNDO_H #define JUPP_UNDO_H #ifdef EXTERN_B_C __IDSTRING(rcsid_undo_h, "$MirOS: contrib/code/jupp/undo.h,v 1.6 2020/03/27 06:38:59 tg Exp $"); #endif extern int inundo; extern int justkilled; UNDO *undomk(B *b); void undorm(UNDO *undo); int uundo(BW *bw); int uredo(BW *bw); void umclear(void); void undomark(void); void undoins(UNDO *undo, P *p, long int size); void undodel(UNDO *undo, long int where, B *b); int uyank(BW *bw); int uyankpop(BW *bw); int uyapp(BW *bw); int unotmod(BW *bw); int ucopy(BW *bw); #endif jupp/usearch.c010064400000000000000000000473251363731415500106040ustar00/* * Search & Replace system * Copyright * (C) 1992 Joseph H. Allen * * This file is part of JOE (Joe's Own Editor) */ #include "config.h" #include "types.h" __RCSID("$MirOS: contrib/code/jupp/usearch.c,v 1.23 2020/03/27 06:08:18 tg Exp $"); #include #include "b.h" #include "bw.h" #include "main.h" #include "pw.h" #include "queue.h" #include "qw.h" #include "regex.h" #include "ublock.h" #include "uedit.h" #include "undo.h" #include "usearch.h" #include "utils.h" #include "vs.h" #include "charmap.h" #include "w.h" #include "va.h" #include "tty.h" #include "menu.h" #include "hash.h" int wrap = 0; /* Allow wrap */ int smode = 0; /* Decremented to zero by execmd */ int csmode = 0; /* Set for continued search mode */ int icase = 0; /* Set to force case insensitive search */ B *findhist = NULL; /* Search string history */ B *replhist = NULL; /* Replacement string history */ SRCH *globalsrch = NULL; /* Most recent completed search data */ SRCHREC fsr = { {&fsr, &fsr}, 0, 0, 0 }; /* Completion stuff: should go somewhere else */ unsigned char **word_list; #define MAX_WORD_SIZE 64 static unsigned char ** get_word_list(B *b, int ignore) { unsigned char buf[MAX_WORD_SIZE]; unsigned char *s; unsigned char **list = 0; HASH *h; HENTRY *t; P *p; int c; int idx; int start = 0; h = htmk(1024); p = pdup(b->bof); idx = 0; while ((c=pgetc(p))!=NO_MORE_DATA) if (idx) { if (joe_isalnux(b->o.charmap, c)) { if (idx!=MAX_WORD_SIZE) buf[idx++] = c; } else { if (idx!=MAX_WORD_SIZE && start!=ignore) { buf[idx] = 0; if (!htfind(h,buf)) { s = vsncpy(NULL,0,buf,idx); htadd(h, s, s); } } idx = 0; } } else { start=p->byte-1; if (joe_isalphx(b->o.charmap, c)) buf[idx++] = c; } prm(p); for (idx = 0; idx != h->len; ++idx) for (t = h->tab[idx]; t; t = t->next) { union { const unsigned char *ro; unsigned char *rw; } checked_name; checked_name.ro = t->name; list = vaadd(list, checked_name.rw); } if (list) vasort(list, sLEN(list)); htrm(h); return list; } static void fcmplt_ins(BW *bw, unsigned char *line) { P *p; int c; if (!piseol(bw->cursor)) { c = brch(bw->cursor); if (joe_isalnux(bw->b->o.charmap,c)) return; } /* Move p to beginning of word */ p = pdup(bw->cursor); do c = prgetc(p); while (joe_isalnux(bw->b->o.charmap,c)); if (c!=NO_MORE_DATA) pgetc(p); if (bw->cursor->byte!=p->byte && bw->cursor->byte-p->byte<64) { /* Insert single match */ bdel(p,bw->cursor); binsm(bw->cursor,sv(line)); pfwrd(bw->cursor,sLEN(line)); bw->cursor->xcol = piscol(bw->cursor); prm(p); } else { prm(p); } } static int fcmplt_abrt(BW *bw, int x, unsigned char *line) { if (line) { fcmplt_ins(bw, line); vsrm(line); } return -1; } static int fcmplt_rtn(MENU *m, int x, unsigned char *line) { fcmplt_ins(m->parent->win->object.bw, m->list[x]); vsrm(line); m->object = NULL; wabort(m->parent); return 0; } int ufinish(BW *bw) { unsigned char *line; unsigned char *line1; unsigned char **lst; P *p; int c; MENU *m; /* Make sure we're not in a word */ if (!piseol(bw->cursor)) { c = brch(bw->cursor); if (joe_isalnux(bw->b->o.charmap,c)) return -1; } /* Move p to beginning of word */ p = pdup(bw->cursor); do c = prgetc(p); while (joe_isalnux(bw->b->o.charmap,c)); if (c!=NO_MORE_DATA) pgetc(p); if (bw->cursor->byte!=p->byte && bw->cursor->byte-p->byte<64) { line = brvs(p, bw->cursor->byte-p->byte); /* We have a word */ /* Get word list */ if (word_list) varm(word_list); word_list = get_word_list(bw->b, p->byte); if (!word_list) { vsrm(line); prm(p); return -1; } line1 = vsncpy(NULL,0,sv(line)); line1 = vsadd(line1,'*'); lst = regsub(word_list, aLEN(word_list), line1); vsrm(line1); if (!lst) { ttputc(7); vsrm(line); return -1; } m = mkmenu(bw->parent, lst, fcmplt_rtn, fcmplt_abrt, NULL, 0, line, NULL); if (!m) { varm(lst); vsrm(line); return -1; } /* Possible match list is now in lst */ if (aLEN(lst) == 1) return fcmplt_rtn(m, 0, line); else if (smode) return 0; else { unsigned char *com = mcomplete(m); vsrm(m->object); m->object = com; wabort(m->parent); smode = 2; ttputc(7); return 0; } } else { prm(p); return -1; } } static int srch_cmplt(BW *bw) { jobject jO; jO.bw = bw; utypebw(jO, 9); return 0; } /* Search forward. bw, pattern and ignore must be set The first possible string we can find is the one beginning under p Returns p if we found a string: The found string is placed in entire/pieces p is placed right after the found string Return 0 if we did not find the string: p is left in its orignal spot */ static P *searchf(BW *bw,SRCH *srch, P *p) { unsigned char *pattern = srch->pattern; P *start; P *end; int x; start = pdup(p); end = pdup(p); for (x = 0; x != sLEN(pattern) && pattern[x] != '\\' && (pattern[x] < 128 || !joe_maputf(p->b->o.charmap)); ++x) if (srch->ignore) pattern[x] = joe_tolower(p->b->o.charmap,pattern[x]); wrapped: while (srch->ignore ? pifind(start, pattern, x) : pfind(start, pattern, x)) { pset(end, start); pfwrd(end, (long) x); if (srch->wrap_flag && start->byte>=srch->wrap_p->byte) break; if (pmatch(srch->pieces, pattern + x, sLEN(pattern) - x, end, 0, srch->ignore)) { srch->entire = vstrunc(srch->entire, (int) (end->byte - start->byte)); brmem(start, srch->entire, (int) (end->byte - start->byte)); pset(p, end); prm(start); prm(end); return p; } if (pgetc(start) == NO_MORE_DATA) break; } if (wrap && !srch->wrap_flag && srch->wrap_p) { msgnw(bw->parent, UC "Wrapped"); srch->wrap_flag = 1; p_goto_bof(start); goto wrapped; } prm(start); prm(end); return NULL; } /* Search backwards. bw, pattern and ignore must be set The first possible string we can find is the one beginning one position to the left of p. Returns 1 if we found a string: The found string is placed in entire p is placed at the beginning of the string Return 0 if we did not find the string: p is left in its orignal spot */ static P *searchb(BW *bw,SRCH *srch, P *p) { unsigned char *pattern = srch->pattern; P *start; P *end; int x; start = pdup(p); end = pdup(p); for (x = 0; x != sLEN(pattern) && pattern[x] != '\\' && (pattern[x] < 128 || !joe_maputf(p->b->o.charmap)); ++x) if (srch->ignore) pattern[x] = joe_tolower(p->b->o.charmap,pattern[x]); wrapped: while (pbkwd(start, 1L) && (srch->ignore ? prifind(start, pattern, x) : prfind(start, pattern, x))) { pset(end, start); pfwrd(end, (long) x); if (srch->wrap_flag && start->bytewrap_p->byte) break; if (pmatch(srch->pieces, pattern + x, sLEN(pattern) - x, end, 0, srch->ignore)) { srch->entire = vstrunc(srch->entire, (int) (end->byte - start->byte)); brmem(start, srch->entire, (int) (end->byte - start->byte)); pset(p, start); prm(start); prm(end); return p; } } if (wrap && !srch->wrap_flag && srch->wrap_p) { msgnw(bw->parent, UC "Wrapped"); srch->wrap_flag = 1; p_goto_eof(start); goto wrapped; } prm(start); prm(end); return NULL; } /* Make a search stucture */ static SRCH *setmark(SRCH *srch) { if (markv(0)) srch->valid = 1; srch->markb = markb; if (srch->markb) srch->markb->owner = &srch->markb; markb = NULL; srch->markk = markk; if (srch->markk) srch->markk->owner = &srch->markk; markk = NULL; return srch; } SRCH *mksrch(unsigned char *pattern, unsigned char *replacement, int ignore, int backwards, int repeat, int replace, int rest) { SRCH *srch = malloc(sizeof(SRCH)); int x; srch->pattern = pattern; srch->replacement = replacement; srch->ignore = ignore; srch->backwards = backwards; srch->repeat = repeat; srch->replace = replace; srch->rest = rest; srch->entire = NULL; srch->flg = 0; srch->addr = -1; srch->markb = NULL; srch->markk = NULL; srch->wrap_p = NULL; srch->wrap_flag = 0; srch->valid = 0; srch->block_restrict = 0; izque(SRCHREC, link, &srch->recs); for (x = 0; x != 26; ++x) srch->pieces[x] = NULL; return srch; } /* Eliminate a search structure */ void rmsrch(SRCH *srch) { int x; prm(markb); prm(markk); prm(srch->wrap_p); if (srch->markb) { markb = srch->markb; markb->owner = &markb; markb->xcol = piscol(markb); } if (srch->markk) { markk = srch->markk; markk->owner = &markk; markk->xcol = piscol(markk); } for (x = 0; x != 26; ++x) vsrm(srch->pieces[x]); frchn(&fsr, &srch->recs); vsrm(srch->pattern); vsrm(srch->replacement); vsrm(srch->entire); free(srch); updall(); } /* Insert a replacement string * p is advanced past the inserted text */ static P *insert(SRCH *srch, P *p, unsigned char *s, int len) { int x; while (len) { for (x = 0; x != len && s[x] != '\\'; ++x) ; if (x) { binsm(p, s, x); pfwrd(p, (long) x); len -= x; s += x; } else if (len >= 2) { if (((s[1] | 0x20) >= 'a' && (s[1] | 0x20) <= 'z') && srch->pieces[(s[1] & 0x1f) - 1]) { binsm(p, sv(srch->pieces[(s[1] & 0x1f) - 1])); pfwrd(p, (long) sLEN(srch->pieces[(s[1] & 0x1f) - 1])); s += 2; len -= 2; } else if (s[1] >= '0' && s[1] <= '9' && srch->pieces[s[1] - '0']) { binsm(p, sv(srch->pieces[s[1] - '0'])); pfwrd(p, (long) sLEN(srch->pieces[s[1] - '0'])); s += 2; len -= 2; } else if (s[1] == '&' && srch->entire) { binsm(p, sv(srch->entire)); pfwrd(p, (long) sLEN(srch->entire)); s += 2; len -= 2; } else { unsigned char *a=(unsigned char *)s+x; int l=len-x; binsc(p, escape(joe_maputf(p->b->o.charmap), &a, &l)); pgetc(p); len -= a - (unsigned char *)s; s = a; } } else len = 0; } return p; } /* Search system user interface */ /* Query for search string, search options, possible replacement string, * and execute first search */ /* Context sensitive help identifier */ const unsigned char srchstr[] = "Search"; static int pfabort(BW *bw, SRCH *srch) { if (srch) rmsrch(srch); return -1; } /* always returns -1 */ static int pfsave(BW *bw, SRCH *srch) { if (srch) { if (globalsrch) rmsrch(globalsrch); globalsrch = srch; srch->rest = 0; srch->repeat = -1; srch->flg = 0; prm(markb); prm(markk); if (srch->markb) { markb = srch->markb; markb->owner = &markb; markb->xcol = piscol(markb); } if (srch->markk) { markk = srch->markk; markk->owner = &markk; markk->xcol = piscol(markk); } srch->markb = NULL; srch->markk = NULL; updall(); } return -1; } static int set_replace(BW *bw, unsigned char *s, SRCH *srch, int *notify) { srch->replacement = s; return dopfnext(bw, srch, notify); } static int set_options(BW *bw, unsigned char *s, SRCH *srch, int *notify) { int x; srch->ignore = icase; for (x = 0; s[x]; ++x) { switch (s[x] | 0x20) { case 'r': srch->replace = 1; break; case 'b': srch->backwards = 1; break; case 'i': srch->ignore = 1; break; case 's': srch->ignore = 0; break; case 'k': srch->block_restrict = 1; break; case '0': case '1': case '2': case '3': case '4': case '5': case '6': case '7': case '8': case '9': if (srch->repeat == -1) srch->repeat = 0; srch->repeat = srch->repeat * 10 + s[x] - '0'; break; } } vsrm(s); if (srch->replace) { if (wmkpw(bw->parent, UC "Replace with (^C to abort): ", &replhist, set_replace, srchstr, pfabort, srch_cmplt, srch, notify, bw->b->o.charmap)) return 0; else return -1; } else return dopfnext(bw, srch, notify); } static int set_pattern(BW *bw, unsigned char *s, SRCH *srch, int *notify) { BW *pbw; const unsigned char *p; if (icase) p = UC "case (S)ensitive (R)eplace (B)ackwards Bloc(K) NNN (^C to abort): "; else p = UC "(I)gnore (R)eplace (B)ackwards Bloc(K) NNN (^C to abort): "; vsrm(srch->pattern); srch->pattern = s; if ((pbw = wmkpw(bw->parent, p, NULL, set_options, srchstr, pfabort, utypebw, srch, notify, bw->b->o.charmap)) != NULL) { unsigned char buf[12]; if (srch->ignore) binsc(pbw->cursor, 'i'); if (srch->replace) binsc(pbw->cursor, 'r'); if (srch->backwards) binsc(pbw->cursor, 'b'); if (srch->repeat >= 0) { joe_snprintf_1((char *)buf, sizeof(buf), "%d", srch->repeat); binss(pbw->cursor, buf); } pset(pbw->cursor, pbw->b->eof); pbw->cursor->xcol = piscol(pbw->cursor); srch->ignore = 0; srch->replace = 0; srch->backwards = 0; srch->repeat = -1; return 0; } else { rmsrch(srch); return -1; } } static int dofirst(BW *bw, int back, int repl) { SRCH *srch; if (smode && globalsrch) { globalsrch->backwards = back; globalsrch->replace = repl; return pfnext(bw); } if (bw->parent->huh == srchstr) { long byte; jobject jO; p_goto_eol(bw->cursor); byte = bw->cursor->byte; p_goto_bol(bw->cursor); if (byte == bw->cursor->byte) prgetc(bw->cursor); jO.bw = bw; return (urtn(jO)); } srch = setmark(mksrch(NULL, NULL, 0, back, -1, repl, 0)); srch->addr = bw->cursor->byte; srch->wrap_p = pdup(bw->cursor); srch->wrap_p->owner = &srch->wrap_p; if (wmkpw(bw->parent, UC "Find (^C to abort): ", &findhist, set_pattern, srchstr, pfabort, srch_cmplt, srch, NULL, bw->b->o.charmap)) return 0; else { rmsrch(srch); return -1; } } int pffirst(BW *bw) { return dofirst(bw, 0, 0); } int prfirst(BW *bw) { return dofirst(bw, 1, 0); } int pqrepl(BW *bw) { return dofirst(bw, 0, 1); } /* Execute next search */ static int doreplace(BW *bw, SRCH *srch) { P *q; if (bw->b->rdonly) { msgnw(bw->parent, UC "Read only"); return -1; } if (markk) markk->end = 1; if (srch->markk) srch->markk->end = 1; q = pdup(bw->cursor); if (srch->backwards) { q = pfwrd(q, (long) sLEN(srch->entire)); bdel(bw->cursor, q); prm(q); } else { q = pbkwd(q, (long) sLEN(srch->entire)); bdel(q, bw->cursor); prm(q); } insert(srch, bw->cursor, sv(srch->replacement)); srch->addr = bw->cursor->byte; if (markk) markk->end = 0; if (srch->markk) srch->markk->end = 0; return 0; } static void visit(SRCH *srch, BW *bw, int yn) { SRCHREC *r = (SRCHREC *) alitem(&fsr, sizeof(SRCHREC)); r->addr = bw->cursor->byte; r->yn = yn; r->wrap_flag = srch->wrap_flag; enqueb(SRCHREC, link, &srch->recs, r); } static void goback(SRCH *srch, BW *bw) { SRCHREC *r = srch->recs.link.prev; if (r != &srch->recs) { if (r->yn) uundo(bw); if (bw->cursor->byte != r->addr) pgoto(bw->cursor, r->addr); srch->wrap_flag = r->wrap_flag; demote(SRCHREC, link, &fsr, r); } } static int dopfrepl(BW *bw, int c, SRCH *srch, int *notify) { srch->addr = bw->cursor->byte; if ((c | 0x20) == 'n') return dopfnext(bw, srch, notify); else if ((c | 0x20) == 'y' || (c | 0x20) == 'l' || c == ' ') { srch->recs.link.prev->yn = 1; /* why do I return -1 on 'L' here? */ return ((doreplace(bw, srch) || (c | 0x20) == 'l') ? pfsave(bw, srch) : dopfnext(bw, srch, notify)); } else if ((c | 0x20) == 'r') { if (doreplace(bw, srch)) return -1; srch->rest = 1; return dopfnext(bw, srch, notify); } else if (c == 8 || c == 127 || (c | 0x20) == 'b') { goback(srch, bw); goback(srch, bw); return dopfnext(bw, srch, notify); } else if (c != -1) { if (notify) *notify = 1; pfsave(bw, srch); nungetc(c); return 0; } if (mkqwnsr(bw->parent, sc("Replace (Y)es (N)o (L)ast (R)est (B)ackup (^C to abort)?"), dopfrepl, pfsave, srch, notify)) return 0; else return pfsave(bw, srch); } /* Test if found text is within region * return 0 if it is, * -1 if we should keep searching * 1 if we're done */ static int restrict_to_block(BW *bw, SRCH *srch) { if (!srch->block_restrict) return 0; bw->cursor->xcol = piscol(bw->cursor); if (srch->backwards) if (!square) { if (bw->cursor->byte < srch->markb->byte) return 1; else if (bw->cursor->byte + sLEN(srch->entire) > srch->markk->byte) return -1; } else { if (bw->cursor->line < srch->markb->line) return 1; else if (bw->cursor->line > srch->markk->line) return -1; else if (piscol(bw->cursor) + sLEN(srch->entire) > srch->markk->xcol || piscol(bw->cursor) < srch->markb->xcol) return -1; } else if (!square) { if (bw->cursor->byte > srch->markk->byte) return 1; else if (bw->cursor->byte - sLEN(srch->entire) < srch->markb->byte) return -1; } else { if (bw->cursor->line > srch->markk->line) return 1; if (bw->cursor->line < srch->markb->line) return -1; if (piscol(bw->cursor) > srch->markk->xcol || piscol(bw->cursor) - sLEN(srch->entire) < srch->markb->xcol) return -1; } return 0; } /* Possible results: * 0) Search or search & replace is finished. * 1) Search string was not found. * 2) Search string was found. */ static int fnext(BW *bw, SRCH *srch) { P *sta; next: if (srch->repeat != -1) { if (!srch->repeat) return 0; else --srch->repeat; } again: if (srch->backwards) sta = searchb(bw, srch, bw->cursor); else sta = searchf(bw, srch, bw->cursor); if (!sta) { srch->repeat = -1; return 1; } else if (srch->rest || (srch->repeat != -1 && srch->replace)) { if (srch->valid) switch (restrict_to_block(bw, srch)) { case -1: goto again; case 1: if (srch->addr >= 0) pgoto(bw->cursor, srch->addr); return !srch->rest; } if (doreplace(bw, srch)) return 0; goto next; } else if (srch->repeat != -1) { if (srch->valid) switch (restrict_to_block(bw, srch)) { case -1: goto again; case 1: if (srch->addr >= 0) pgoto(bw->cursor, srch->addr); return 1; } srch->addr = bw->cursor->byte; goto next; } else return 2; } int dopfnext(BW *bw, SRCH *srch, int *notify) { int orgmid = mid; /* Original mid status */ int ret = 0; mid = 1; /* Screen recenters mode during search */ if (csmode) smode = 2; /* We have started a search mode */ if (srch->replace) visit(srch, bw, 0); again: switch (fnext(bw, srch)) { case 0: break; case 1: bye: if (!srch->flg && !srch->rest) { if (srch->valid && srch->block_restrict) msgnw(bw->parent, UC "Not found (search restricted to marked block)"); else msgnw(bw->parent, UC "Not found"); ret = -1; } break; case 2: if (srch->valid) switch (restrict_to_block(bw, srch)) { case -1: goto again; case 1: if (srch->addr >= 0) pgoto(bw->cursor, srch->addr); goto bye; } srch->addr = bw->cursor->byte; /* Make sure found text is fully on screen */ if(srch->backwards) { bw->offset=0; pfwrd(bw->cursor,sLEN(srch->entire)); bw->cursor->xcol = piscol(bw->cursor); dofollows(); pbkwd(bw->cursor,sLEN(srch->entire)); } else { bw->offset=0; pbkwd(bw->cursor,sLEN(srch->entire)); bw->cursor->xcol = piscol(bw->cursor); dofollows(); pfwrd(bw->cursor,sLEN(srch->entire)); } if (srch->replace) { if (square) bw->cursor->xcol = piscol(bw->cursor); if (srch->backwards) { pdupown(bw->cursor, &markb); markb->xcol = piscol(markb); pdupown(markb, &markk); pfwrd(markk, (long) sLEN(srch->entire)); markk->xcol = piscol(markk); } else { pdupown(bw->cursor, &markk); markk->xcol = piscol(markk); pdupown(bw->cursor, &markb); pbkwd(markb, (long) sLEN(srch->entire)); markb->xcol = piscol(markb); } srch->flg = 1; if (dopfrepl(bw, -1, srch, notify)) ret = -1; notify = 0; srch = 0; } break; } bw->cursor->xcol = piscol(bw->cursor); dofollows(); mid = orgmid; if (notify) *notify = 1; if (srch) pfsave(bw, srch); else updall(); return ret; } int pfnext(BW *bw) { SRCH *srch; if (!globalsrch) { /* Query for search string if there isn't any */ return pffirst(bw); } srch = globalsrch; globalsrch = NULL; srch->addr = bw->cursor->byte; if (!srch->wrap_p || srch->wrap_p->b!=bw->b) { prm(srch->wrap_p); srch->wrap_p = pdup(bw->cursor); srch->wrap_p->owner = &srch->wrap_p; srch->wrap_flag = 0; } srch->valid = 0; return dopfnext(bw, setmark(srch), NULL); } jupp/usearch.h010064400000000000000000000011531363731763700106060ustar00/* * Search & Replace system * Copyright * (C) 1992 Joseph H. Allen * * This file is part of JOE (Joe's Own Editor) */ #ifndef JUPP_USEARCH_H #define JUPP_USEARCH_H #ifdef EXTERN_CMD_C __IDSTRING(rcsid_usearch_h, "$MirOS: contrib/code/jupp/usearch.h,v 1.6 2020/03/27 06:39:00 tg Exp $"); #endif SRCH *mksrch(unsigned char *pattern, unsigned char *replacement, int ignore, int backwards, int repeat, int replace, int rest); void rmsrch(SRCH *srch); int dopfnext(BW *bw, SRCH *srch, int *notify); int pffirst(BW *bw); int pfnext(BW *bw); int pqrepl(BW *bw); int prfirst(BW *bw); int ufinish(BW *bw); #endif jupp/ushell.c010064400000000000000000000110111426610112300104110ustar00/* * Shell-window functions * Copyright * (C) 1992 Joseph H. Allen * * This file is part of JOE (Joe's Own Editor) */ #include "config.h" #include "types.h" __RCSID("$MirOS: contrib/code/jupp/ushell.c,v 1.16 2022/07/20 22:31:20 tg Exp $"); #include #include #include #include #include "b.h" #include "main.h" #include "pw.h" #include "qw.h" #include "tty.h" #include "uedit.h" #include "uerror.h" #include "ufile.h" #include "va.h" #include "vs.h" #include "ushell.h" #include "utf8.h" #include "w.h" extern int orphan; #if WANT_FORK /* Executed when shell process terminates */ static void cdone(B *b) { b->pid = 0; close(b->out); b->out = -1; } static void cdone_parse(B *b) { b->pid = 0; close(b->out); b->out = -1; parserrb(b); } /* Executed for each chunk of data we get from the shell */ static void cfollow(B *b,long byte) { W *w; if ((w = maint->topwin) != NULL) { do { if ((w->watom->what & TYPETW) && w->object.bw->b == b && w->object.bw->cursor->byte == byte) { BW *bw = w->object.bw; p_goto_eof(bw->cursor); bw->cursor->xcol = piscol(bw->cursor); } w = w->link.next; } while (w != maint->topwin); } } static void cdata(B *b, unsigned char *dat, int siz) { P *q = pdup(b->eof); P *r = pdup(b->eof); long byte = q->byte; unsigned char bf[1024]; int x, y; for (x = y = 0; x != siz; ++x) { if (dat[x] == 13 || dat[x] == 0) { ; } else if (dat[x] == 8 || dat[x] == 127) { if (y) { --y; } else { pset(q, r); prgetc(q); bdel(q, r); --byte; } } else if (dat[x] == 7) { ttputc(7); } else { bf[y++] = dat[x]; } } if (y) { binsm(r, bf, y); } prm(r); prm(q); cfollow(b,byte); } static int doushell(BW *bw, unsigned char *cmd, int *notify, int build) { MPX *m; unsigned char **s; unsigned char *u; const unsigned char *name; name = getushell(); s = vamk(10); u = vsncpy(NULL, 0, sz(name)); s = vaadd(s, u); if (cmd) { u = vsncpy(NULL, 0, sc("-c")); s = vaadd(s, u); s = vaadd(s, cmd); } else { u = vsncpy(NULL, 0, sc("-i")); s = vaadd(s, u); } if (notify) { *notify = 1; } if (bw->b->pid) { msgnw(bw->parent, UC "Program already running in this window"); varm(s); vsrm(cmd); return -1; } p_goto_eof(bw->cursor); if (!(m = mpxmk(&bw->b->out, name, s, cdata, bw->b, build ? cdone_parse : cdone, bw->b))) { varm(s); vsrm(cmd); msgnw(bw->parent, UC "No ptys available"); return -1; } else { bw->b->pid = m->pid; } varm(s); vsrm(cmd); return 0; } int ubknd(BW *bw) { if (!getenv("SHELL")) { msgnw(bw->parent, UC "\"SHELL\" environment variable not defined or exported"); } return doushell(bw, NULL, NULL, 0); } /* Run a program in a window */ static int dorun(BW *bw, unsigned char *s, void *object, int *notify) { return doushell(bw, s, notify, 0); } B *runhist = NULL; int urun(BW *bw) { if (wmkpw(bw->parent, UC "Program to run: ", &runhist, dorun, UC "Run", NULL, NULL, NULL, NULL, locale_map)) { return 0; } else { return -1; } } static int dobuild(BW *bw, unsigned char *s, void *object, int *notify) { return doushell(bw, s, notify, 1); } B *buildhist = NULL; int ubuild(BW *bw) { if (buildhist) { if ((bw=wmkpw(bw->parent, UC "Build command: ", &buildhist, dobuild, UC "Run", NULL, NULL, NULL, NULL, locale_map))) { uuparw(bw); u_goto_eol(bw); bw->cursor->xcol = piscol(bw->cursor); return 0; } } else if (wmkpw(bw->parent, UC "Enter build command (for example, 'make'): ", &buildhist, dobuild, UC "Run", NULL, NULL, NULL, NULL, locale_map)) return 0; return -1; } #endif /* Kill program */ static int pidabort(BW *bw, int c, void *object, int *notify) { if (notify) { *notify = 1; } if ((c | 0x20) != 'y') { return -1; } if (bw->b->pid) { kill(bw->b->pid, 1); return -1; } else { return -1; } } int ukillpid(BW *bw) { if (bw->b->pid) { if (mkqw(bw->parent, sc("Kill program (y,n,^C)? "), pidabort, NULL, NULL, NULL)) { return 0; } else { return -1; } } else { return 0; } } static const char * const getushell_envs[] = { "SHELL", "EXECSHELL", }; const void *getushell(void) { static char *rshell; if (!rshell) { char *eshell; struct stat sbuf; int i = 0; while (i < 2) { eshell = getenv(getushell_envs[i++]); if (eshell && *eshell && !stat(eshell, &sbuf) && S_ISREG(sbuf.st_mode) && (sbuf.st_mode & 0111) && /* LINTED use of access */ !access(eshell, X_OK)) { rshell = eshell; break; } } } return (rshell ? rshell : "/bin/sh"); } jupp/ushell.h010064400000000000000000000006351363731763700104540ustar00/* * Shell-window functions * Copyright (C) 1992 Joseph H. Allen * * This file is part of JOE (Joe's Own Editor) */ #ifndef JUPP_USHELL_H #define JUPP_USHELL_H #ifdef EXTERN_CMD_C __IDSTRING(rcsid_ushell_h, "$MirOS: contrib/code/jupp/ushell.h,v 1.7 2020/03/27 06:39:00 tg Exp $"); #endif int ubknd(BW *bw); int ukillpid(BW *bw); int urun(BW *bw); int ubuild(BW *bw); const void *getushell(void); #endif jupp/utag.c010064400000000000000000000065511321212144600100720ustar00/* * tags file symbol lookup * Copyright * (C) 1992 Joseph H. Allen * * This file is part of JOE (Joe's Own Editor) */ #include "config.h" #include "types.h" __RCSID("$MirOS: contrib/code/jupp/utag.c,v 1.11 2017/12/07 02:10:19 tg Exp $"); #include "b.h" #include "bw.h" #include "main.h" #include "pw.h" #include "tab.h" #include "ufile.h" #include "usearch.h" #include "utag.h" #include "utils.h" #include "vs.h" #include "charmap.h" #include "w.h" static int dotag(BW *bw, unsigned char *s, void *obj, int *notify) { unsigned char buf[512]; FILE *f; unsigned char *t = NULL; if (notify) { *notify = 1; } if (bw->b->name) { t = vsncpy(t, 0, sz(bw->b->name)); t = vsncpy(sv(t), sc(":")); t = vsncpy(sv(t), sv(s)); } f = fopen("tags", "r"); if (!f) { msgnw(bw->parent, UC "Couldn't open tags file"); vsrm(s); vsrm(t); return -1; } while (fgets((char *)buf, 512, f)) { int x, y, c; for (x = 0; buf[x] && buf[x] != ' ' && buf[x] != '\t'; ++x) ; c = buf[x]; buf[x] = 0; if (!strcmp(s, buf) || (t && !strcmp(t, buf))) { buf[x] = c; while (buf[x] == ' ' || buf[x] == '\t') { ++x; } for (y = x; buf[y] && buf[y] != ' ' && buf[y] != '\t' && buf[y] != '\n'; ++y) ; if (x != y) { c = buf[y]; buf[y] = 0; if (doswitch(bw, vsncpy(NULL, 0, sz(buf + x)), NULL, NULL)) { vsrm(s); vsrm(t); fclose(f); return -1; } bw = maint->curwin->object.bw; buf[y] = c; while (buf[y] == ' ' || buf[y] == '\t') { ++y; } for (x = y; buf[x] && buf[x] != '\n'; ++x) ; buf[x] = 0; if (x != y) { long line = 0; if (buf[y] >= '0' && buf[y] <= '9') { line = ustol(buf + y, NULL, USTOL_AUTO); if (line >= 1) { int omid = mid; mid = 1; pline(bw->cursor, line - 1), bw->cursor->xcol = piscol(bw->cursor); dofollows(); mid = omid; } else { msgnw(bw->parent, UC "Invalid line number"); } } else { if (buf[y] == '/' || buf[y] == '?') { ++y; if (buf[y] == '^') buf[--y] = '\\'; for (x = y+1; buf[x] && buf[x] != '\n' && buf[x-1] != '/'; ++x); } if (buf[x - 1] == '/' || buf[x - 1] == '?') { --x; buf[x] = 0; if (buf[x - 1] == '$') { buf[x - 1] = '\\'; buf[x] = '$'; ++x; buf[x] = 0; } } if (x != y) { vsrm(s); vsrm(t); fclose(f); return dopfnext(bw, mksrch(vsncpy(NULL, 0, sz(buf + y)), NULL, 0, 0, -1, 0, 0), NULL); } } } vsrm(s); vsrm(t); fclose(f); return 0; } } } msgnw(bw->parent, UC "Not found"); vsrm(s); vsrm(t); fclose(f); return -1; } static B *taghist = NULL; int utag(BW *bw) { BW *pbw; pbw = wmkpw(bw->parent, UC "Tag search: ", &taghist, dotag, NULL, NULL, cmplt, NULL, NULL, locale_map); if (pbw && joe_isalnux(bw->b->o.charmap,brch(bw->cursor))) { P *p = pdup(bw->cursor); P *q = pdup(p); int c; while (joe_isalnux(bw->b->o.charmap,(c = prgetc(p)))) /* do nothing */; if (c != NO_MORE_DATA) { pgetc(p); } pset(q, p); while (joe_isalnux(bw->b->o.charmap,(c = pgetc(q)))) /* do nothing */; if (c != NO_MORE_DATA) { prgetc(q); } binsb(pbw->cursor, bcpy(p, q)); pset(pbw->cursor, pbw->b->eof); pbw->cursor->xcol = piscol(pbw->cursor); prm(p); prm(q); } if (pbw) { return 0; } else { return -1; } } jupp/utag.h010064400000000000000000000004761363731763700101230ustar00/* * tags file symbol lookup * Copyright * (C) 1992 Joseph H. Allen * * This file is part of JOE (Joe's Own Editor) */ #ifndef JUPP_UTAG_H #define JUPP_UTAG_H #ifdef EXTERN_CMD_C __IDSTRING(rcsid_utag_h, "$MirOS: contrib/code/jupp/utag.h,v 1.7 2020/03/27 06:39:00 tg Exp $"); #endif int utag(BW *bw); #endif jupp/utf8.c010064400000000000000000000137771363731415500100440ustar00/* * UTF-8 Utilities * Copyright * (C) 2004 Joseph H. Allen * (c) 2004, 2006, 2011, 2013, 2014, 2017, 2018, 2020 mirabilos * * This file is part of JOE (Joe's Own Editor) */ #include "config.h" #include "types.h" __RCSID("$MirOS: contrib/code/jupp/utf8.c,v 1.26 2020/03/27 06:08:18 tg Exp $"); #include #include #ifdef __CYGWIN__ #include #endif #ifdef __MirBSD__ #include #endif #undef USE_CODEPAGE #undef USE_LOCALE #if defined(HAVE_SETLOCALE) && defined(HAVE_NL_LANGINFO) #define USE_LOCALE #endif /* Cygwin before 1.7.2 did not have locale support */ #if defined(CYGWIN_VERSION_API_MAJOR) && (CYGWIN_VERSION_API_MAJOR < 1) && \ defined(CYGWIN_VERSION_API_MINOR) && (CYGWIN_VERSION_API_MINOR < 222) #define USE_CODEPAGE #undef USE_LOCALE #endif /* OpenBSD, ekkoBSD and old MirOS do not have real locale support */ #if defined(__OpenBSD__) && (!defined(MirBSD) || (MirBSD < 0x09A0)) #undef USE_LOCALE #endif #ifdef USE_LOCALE #ifdef HAVE_LOCALE_H #include #endif #ifdef HAVE_LANGINFO_H #include #endif #endif #ifndef CODESET #undef USE_LOCALE #endif #ifdef USE_LOCALE #undef USE_CODEPAGE #endif #include "rc.h" #include "charmap.h" /* UTF-8 Encoder * * c is a UCS character. * buf is 7 byte buffer: UTF-8 encoded character is written to this followed by a NUL terminator * returns length (not including terminator). */ int utf8_encode(unsigned char *buf,int c) { if (c < 0x80) { buf[0] = c; buf[1] = 0; return 1; } else if(c < 0x800) { buf[0] = (0xc0|(c>>6)); buf[1] = (0x80|(c&0x3F)); buf[2] = 0; return 2; } else if(c < 0x10000) { buf[0] = (0xe0|(c>>12)); buf[1] = (0x80|((c>>6)&0x3f)); buf[2] = (0x80|((c)&0x3f)); buf[3] = 0; return 3; } else if(c < 0x200000) { buf[0] = (0xf0|(c>>18)); buf[1] = (0x80|((c>>12)&0x3f)); buf[2] = (0x80|((c>>6)&0x3f)); buf[3] = (0x80|((c)&0x3f)); buf[4] = 0; return 4; } else if(c < 0x4000000) { buf[0] = (0xf8|(c>>24)); buf[1] = (0x80|((c>>18)&0x3f)); buf[2] = (0x80|((c>>12)&0x3f)); buf[3] = (0x80|((c>>6)&0x3f)); buf[4] = (0x80|((c)&0x3f)); buf[5] = 0; return 5; } else { buf[0] = (0xfC|(c>>30)); buf[1] = (0x80|((c>>24)&0x3f)); buf[2] = (0x80|((c>>18)&0x3f)); buf[3] = (0x80|((c>>12)&0x3f)); buf[4] = (0x80|((c>>6)&0x3f)); buf[5] = (0x80|((c)&0x3f)); buf[6] = 0; return 6; } } /* UTF-8 Decoder * * Returns 0 - 7FFFFFFF: decoded character * -1: byte accepted, nothing decoded yet * -2: illegal continuation byte or sequence * -3: illegal start byte */ int utf8_decode(struct utf8_sm *utf8_sm, unsigned char c) { if (utf8_sm->state) { utf8_sm->buf[utf8_sm->ptr] = c; if ((c ^= 0x80) < 0x40) { /* trail byte */ ++utf8_sm->ptr; utf8_sm->accu = (utf8_sm->accu << 6) | c; if (--utf8_sm->state) return (-1); if (utf8_sm->accu >= utf8_sm->minv) return (utf8_sm->accu); /* reject non-minimal-encoded sequence */ --utf8_sm->ptr; } utf8_sm->state = 0; return (-2); } else if (c < 0x80) { utf8_sm->accu = c; /* known to be in [0; 127] */ utf8_sm->state = 0; } else if (c < 0xC2) { ilchar: utf8_init(utf8_sm); return (-3); } else if (c < 0xE0) { utf8_sm->accu = c & 0x1F; utf8_sm->state = 1; } else if (c < 0xF0) { utf8_sm->accu = c & 0x0F; utf8_sm->state = 2; } else if (c < 0xF8) { utf8_sm->accu = c & 0x07; utf8_sm->state = 3; } else if (c < 0xFC) { utf8_sm->accu = c & 0x03; utf8_sm->state = 4; } else if (c < 0xFE) { utf8_sm->accu = c & 0x01; utf8_sm->state = 5; } else goto ilchar; utf8_sm->minv = 1 << (5 * utf8_sm->state + 1); utf8_sm->buf[0] = c; utf8_sm->ptr = 1; if (!utf8_sm->state) /* ASCII */ return (utf8_sm->accu); /* lead byte */ utf8_sm->minv = 1 << (5 * utf8_sm->state + 1); return (-1); } /* Initialise state machine */ void utf8_init(struct utf8_sm *utf8_sm) { utf8_sm->ptr = 0; utf8_sm->state = 0; } /* Decode an entire string */ int utf8_decode_string(unsigned char *s) { struct utf8_sm sm; int x; int c = 0; utf8_init(&sm); for(x=0;s[x];++x) c = utf8_decode(&sm,s[x]); return c; } /* Decode and advance */ int utf8_decode_fwrd(unsigned char **p,int *plen) { struct utf8_sm sm; unsigned char *s = *p; int len = *plen; int c = -2; utf8_init(&sm); while (len) { --len; c = utf8_decode(&sm,*s++); if (c >= 0) break; } *plen = len; *p = s; return c; } /* Initialize locale for JOE */ #ifdef USE_CODEPAGE extern unsigned int cygwin32_get_cp(void); #endif /* character map of terminal */ union charmap *locale_map; /* handy character map for UTF-8 */ union charmap *utf8_map; void joe_locale(void) { unsigned char *s; s=(unsigned char *)getenv("JOECHARMAP"); locale_map = find_charmap(s); #if !defined(USE_LOCALE) if (!locale_map) { s=(unsigned char *)getenv("LC_ALL"); if (!s) { s=(unsigned char *)getenv("LC_CTYPE"); if (!s) { s=(unsigned char *)getenv("LANG"); } } #ifdef USE_CODEPAGE /* if LC_* are unset, use codepage */ if (!s) { char buf[16]; joe_snprintf_1(buf, sizeof(buf), "cp%u", cygwin32_get_cp()); locale_map = find_charmap(buf); } #endif } #endif #ifdef USE_LOCALE if (!locale_map) { setlocale(LC_ALL,""); locale_map = find_charmap((const void *)nl_langinfo(CODESET)); } #else if (!locale_map && s) { unsigned char *t, *tt; if ((t = strrchr(s, '.')) != NULL) { if ((tt = strchr(++t, '@')) != NULL) *tt = '\0'; locale_map = find_charmap(t); } if (!locale_map) locale_map = find_charmap(s); } #endif if (!locale_map) locale_map = find_charmap(UC "ascii"); utf8_map = find_charmap(JOE_MAPUTFCS); #ifndef TEST #ifdef defutf8 fdefault.charmap = utf8_map; #else fdefault.charmap = locale_map; #endif pdefault.charmap = locale_map; #endif } void to_utf8(union charmap *map, unsigned char *s, int c) { int d = joe_to_uni(map, c); utf8_encode(s, d == -1 ? '?' : d); } int from_utf8(union charmap *map, unsigned char *s) { int d = utf8_decode_string(s); int c = joe_from_uni(map, d); if (c == -1) return '?'; return c; } jupp/utf8.h010064400000000000000000000032011363731763700100360ustar00/* * UTF-8 Utilities * Copyright * (C) 2004 Joseph H. Allen * * This file is part of JOE (Joe's Own Editor) */ #ifndef JUPP_UTF8_H #define JUPP_UTF8_H #ifdef EXTERN __IDSTRING(rcsid_utf8_h, "$MirOS: contrib/code/jupp/utf8.h,v 1.12 2020/03/27 06:39:00 tg Exp $"); #endif #include "i18n.h" /* UTF-8 Encoder * * c is a UCS character. * buf is 7 byte buffer- utf-8 coded character is written to this followed by a 0 termination. * returns length (not including terminator). */ int utf8_encode(unsigned char *buf,int c); /* UTF-8 decoder state machine */ struct utf8_sm { unsigned char buf[8]; /* Record of sequence */ int ptr; /* Record pointer */ int state; /* Current state. 0 = idle, anything else is no. of chars left in sequence */ int accu; /* Character accumulator */ int minv; /* Minimum value, for decoder */ }; /* UTF-8 Decoder * * Returns 0 - 7FFFFFFF: decoded character * -1: character accepted, nothing decoded yet. * -2: incomplete sequence * -3: no sequence started, but character is between 128 - 191, 254 or 255 */ int utf8_decode(struct utf8_sm *utf8_sm,unsigned char c); int utf8_decode_string(unsigned char *s); int utf8_decode_fwrd(unsigned char **p,int *plen); /* Initialize state machine */ void utf8_init(struct utf8_sm *utf8_sm); void joe_locale(void); void to_utf8(union charmap *map, unsigned char *s, int c); int from_utf8(union charmap *map, unsigned char *s); extern int utf8; int mk_wcwidth(int wide,int c); /* default charmap of terminal */ extern union charmap *locale_map; /* charmap for UTF-8 */ extern union charmap *utf8_map; #endif jupp/utils.c010064400000000000000000000122651337207074600103060ustar00/* * Various utilities * Copyright * (C) 1992 Joseph H. Allen * (C) 2001 Marek 'Marx' Grac * * This file is part of JOE (Joe's Own Editor) */ #include "config.h" __RCSID("$MirOS: contrib/code/jupp/utils.c,v 1.11 2018/11/11 18:15:39 tg Exp $"); #include #include #include #include "charmap.h" #include "blocks.h" #include "utils.h" /* * return minimum/maximum of two numbers */ unsigned int uns_min(unsigned int a, unsigned int b) { return a < b ? a : b; } signed int int_min(signed int a, signed int b) { return a < b ? a : b; } signed long int long_max(signed long int a, signed long int b) { return a > b ? a : b; } signed long int long_min(signed long int a, signed long int b) { return a < b ? a : b; } /* Versions of 'read' and 'write' which automatically retry when interrupted */ ssize_t joe_read(int fd, void *buf, size_t size) { ssize_t rt; do { rt = read(fd, buf, size); } while (rt < 0 && errno == EINTR); return rt; } ssize_t joe_write(int fd, const void *buf, size_t size) { ssize_t rt; do { rt = write(fd, buf, size); } while (rt < 0 && errno == EINTR); return rt; } /* Similarily, read and write an exact amount (up to EOF) */ ssize_t joe_readex(int fd, void *buf_, size_t size) { unsigned char *buf = buf_; ssize_t rv = 0, z; while (size) { if ((z = read(fd, buf, size)) < 0) { if (errno == EINTR) continue; return (rv ? /* fucked up since we got some */ -2 : -1); } if (z == 0) break; rv += z; buf += z; size -= z; } return (rv); } #if 0 /* unused */ ssize_t joe_writex(int fd, const void *buf_, size_t size) { const unsigned char *buf = buf_; ssize_t rv = 0, z; while (size) { if ((z = write(fd, buf, size)) < 0) { if (errno == EINTR) continue; return (rv ? /* fucked up since we got some */ -2 : -1); } rv += z; buf += z; size -= z; } return (rv); } #endif #ifndef SIG_ERR #define SIG_ERR ((sighandler_t) -1) #endif /* wrapper to hide signal interface differrencies */ int joe_set_signal(int signum, sighandler_t handler) { int retval; #ifdef HAVE_SIGACTION struct sigaction sact; mset(&sact, 0, sizeof(sact)); sact.sa_handler = handler; #ifdef SA_INTERRUPT sact.sa_flags = SA_INTERRUPT; #endif retval = sigaction(signum, &sact, NULL); #elif defined(HAVE_SIGVEC) struct sigvec svec; mset(&svec, 0, sizeof(svec)); svec.sv_handler = handler; #ifdef HAVE_SV_INTERRUPT svec.sv_flags = SV_INTERRUPT; #endif retval = sigvec(signum, &svec, NULL); #else retval = (signal(signum, handler) != SIG_ERR) ? 0 : -1; #ifdef HAVE_SIGINTERRUPT siginterrupt(signum, 1); #endif #endif return(retval); } /* Helpful little parsing utilities */ /* Skip whitespace and return first non-whitespace character */ int parse_ws(unsigned char **pp, int cmt) { unsigned char *p = *pp; while (*p==' ' || *p=='\t') ++p; if (*p=='\r' || *p=='\n' || *p==cmt) *p = 0; *pp = p; return *p; } /* Parse an identifier into a buffer. Identifier is truncated to a maximum of len chars. */ int parse_ident(unsigned char **pp, unsigned char *buf, int len) { unsigned char *p = *pp; if (joe_isalphx(locale_map,*p)) { while(len && joe_isalnux(locale_map,*p)) *buf++= *p++, --len; *buf=0; while(joe_isalnux(locale_map,*p)) ++p; *pp = p; return 0; } else return -1; } /* Parse to next whitespace */ int parse_tows(unsigned char **pp, unsigned char *buf) { unsigned char *p = *pp; while (*p && *p!=' ' && *p!='\t' && *p!='\n' && *p!='\r' && *p!='#') *buf++ = *p++; *pp = p; *buf = 0; return 0; } /* Parse a keyword */ int parse_kw(unsigned char **pp, const unsigned char *kw) { unsigned char *p = *pp; while(*kw && *kw==*p) ++kw, ++p; if(!*kw && !joe_isalnux(locale_map,*p)) { *pp = p; return 0; } else return -1; } /* Parse a field */ int parse_field(unsigned char **pp, const unsigned char *kw) { unsigned char *p = *pp; while(*kw && *kw==*p) ++kw, ++p; if(!*kw && (!*p || *p==' ' || *p=='\t' || *p=='#' || *p=='\n' || *p=='\r')) { *pp = p; return 0; } else return -1; } /* Parse a character */ int parse_char(unsigned char **pp, unsigned char c) { unsigned char *p = *pp; if (*p == c) { *pp = p+1; return 0; } else return -1; } /* * Parse a string into a buffer. Returns 0 for success. * Leaves escape sequences in string. */ int parse_string(unsigned char **pp, unsigned char *buf, int len) { unsigned char *p = *pp; if(*p=='\"') { ++p; while(len && *p && *p!='\"') if(*p=='\\' && p[1] && len>2) { *buf++ = *p++; *buf++ = *p++; len-=2; } else { *buf++ = *p++; --len; } *buf = 0; while(*p && *p!='\"') if(*p=='\\' && p[1]) p+=2; else p++; if(*p=='\"') { *pp= p+1; return 0; } } return -1; } /* Parse a character range: a-z */ int parse_range(unsigned char **pp, int *first, int *second) { unsigned char *p = *pp; int a, b; if(!*p) return -1; if(*p=='\\' && p[1]) { ++p; if(*p=='n') a = '\n'; else if(*p=='t') a = '\t'; else a = *p; ++p; } else a = *p++; if(*p=='-' && p[1]) { ++p; if(*p=='\\' && p[1]) { ++p; if(*p=='n') b = '\n'; else if(*p=='t') b = '\t'; else b = *p; ++p; } else b = *p++; } else b = a; *first = a; *second = b; *pp = p; return 0; } jupp/utils.h010064400000000000000000000045431364306522400103070ustar00/* * Various utilities * * Copyright * (C) 1992 Joseph H. Allen * (C) 2001 Marek 'Marx' Grac * * This file is part of JOE (Joe's Own Editor) */ #ifndef JUPP_UTILS_H #define JUPP_UTILS_H #ifdef EXTERN_B_C __IDSTRING(rcsid_utils_h, "$MirOS: contrib/code/jupp/utils.h,v 1.16 2020/04/07 11:56:41 tg Exp $"); #endif #include /* * Functions which return minimum/maximum of two numbers */ unsigned int uns_min(unsigned int a, unsigned int b); signed int int_min(signed int a, int signed b); signed long long_max(signed long a, signed long b); signed long long_min(signed long a, signed long b); /* Versions of 'read' and 'write' which automatically retry when interrupted */ ssize_t joe_read(int fd, void *buf, size_t siz); ssize_t joe_write(int fd, const void *buf, size_t siz); /* Similarily, read and write an exact amount (up to EOF) */ ssize_t joe_readex(int, void *, size_t); ssize_t joe_writex(int, const void *, size_t); /* these return -2 if the error occurs after bytes had been processed */ #ifndef HAVE_SIGHANDLER_T typedef RETSIGTYPE (*sighandler_t)(int); #endif #ifdef NEED_TO_REINSTALL_SIGNAL #define REINSTALL_SIGHANDLER(sig,handler) joe_set_signal(sig, handler) #else #define REINSTALL_SIGHANDLER(sig,handler) do {} while(0) #endif /* wrapper to hide signal interface differrencies */ int joe_set_signal(int signum, sighandler_t handler); int parse_ws(unsigned char **p, int cmt); int parse_ident(unsigned char **p, unsigned char *buf, int len); int parse_tows(unsigned char **p, unsigned char *buf); int parse_kw(unsigned char **p, const unsigned char *kw); int parse_field(unsigned char **p, const unsigned char *field); int parse_char(unsigned char **p, unsigned char c); int parse_string(unsigned char **p, unsigned char *buf, int len); int parse_range(unsigned char **p, int *first, int *second); void tty_xonoffbaudrst(void); /* from compat.c */ #define USTOL_AUTO 0x00 #define USTOL_DEC 0x01 #define USTOL_HEX 0x02 #define USTOL_OCT 0x03 #define USTOL_LTRIM 0x04 #define USTOL_RTRIM 0x08 #define USTOL_TRIM 0x0C #define USTOL_EOS 0x10 long ustol(void *, void **, int); long ustolb(void *, void **, long, long, int); /* arbitrary, but at least 4 */ #define USTOC_MAX 4 size_t ustoc_hex(const void *, int *, size_t); size_t ustoc_oct(const void *, int *, size_t); /* from selinux.c */ int copy_security_context(const char *, const char *); #endif jupp/va.c010064400000000000000000000066711322450264000075450ustar00/* * Variable length array of strings * Copyright * (C) 1992 Joseph H. Allen * * This file is part of JOE (Joe's Own Editor) */ #include "config.h" #include "types.h" __RCSID("$MirOS: contrib/code/jupp/va.c,v 1.10 2018/01/07 20:39:33 tg Exp $"); #include #include "utils.h" #include "va.h" aELEMENT * vamk(int len) { aELEMENT *rv; rv = jalloc(NULL, len, sizeof(aELEMENT)); rv[0] = aterm; return (rv); } void varm(aELEMENT *vary) { if (vary) { vazap(vary, 0, aLen(vary)); jfree(vary); } } int alen(aELEMENT *ary) { aELEMENT *beg = ary; if (!ary) return (0); while (acmp(*ary, aterm)) ++ary; return (ary - beg); } aELEMENT * vaensure(aELEMENT *vary, int len) { aELEMENT *rv; if (vary && len > aSiz(vary)) len += (len >> 2); rv = jalloc(vary, len, sizeof(aELEMENT)); if (!vary) rv[0] = aterm; return (rv); } aELEMENT *vazap(aELEMENT *vary, int pos, int n) { if (vary) { int x; if (pos < aLen(vary)) { if (pos + n <= aLen(vary)) { for (x = pos; x != pos + n; ++x) adel(vary[x]); } else { for (x = pos; x != aLen(vary); ++x) adel(vary[x]); } } } return vary; } aELEMENT *vatrunc(aELEMENT *vary, int len) { if (!vary || len > aLEN(vary)) vary = vaensure(vary, len); if (len < aLen(vary)) { vary = vazap(vary, len, aLen(vary) - len); vary[len] = vary[aLen(vary)]; aLen(vary) = len; } else if (len > aLen(vary)) { vary = vafill(vary, aLen(vary), ablank, len - aLen(vary)); } return vary; } aELEMENT *vafill(aELEMENT *vary, int pos, aELEMENT el, int len) { int olen = aLEN(vary), x; if (!vary || pos + len > aSIZ(vary)) vary = vaensure(vary, pos + len); if (pos + len > olen) { vary[pos + len] = vary[olen]; aLen(vary) = pos + len; } for (x = pos; x != pos + len; ++x) vary[x] = adup(el); if (pos > olen) vary = vafill(vary, pos, ablank, pos - olen); return vary; } aELEMENT *vandup(aELEMENT *vary, int pos, aELEMENT *array, int len) { int olen = aLEN(vary), x; if (!vary || pos + len > aSIZ(vary)) vary = vaensure(vary, pos + len); if (pos + len > olen) { vary[pos + len] = vary[olen]; aLen(vary) = pos + len; } if (pos > olen) vary = vafill(vary, olen, ablank, pos - olen); for (x = 0; x != len; ++x) vary[x + pos] = adup(array[x]); return vary; } aELEMENT *vadup(aELEMENT *vary) { return vandup(NULL, 0, vary, aLEN(vary)); } aELEMENT *_vaset(aELEMENT *vary, int pos, aELEMENT el) { if (!vary || pos + 1 > aSIZ(vary)) vary = vaensure(vary, pos + 1); if (pos > aLen(vary)) { vary = vafill(vary, aLen(vary), ablank, pos - aLen(vary)); vary[pos + 1] = vary[pos]; vary[pos] = el; aLen(vary) = pos + 1; } else if (pos == aLen(vary)) { vary[pos + 1] = vary[pos]; vary[pos] = el; aLen(vary) = pos + 1; } else { adel(vary[pos]); vary[pos] = el; } return vary; } static int _acmp(aELEMENT *a, aELEMENT *b) { return acmp(*a, *b); } aELEMENT *vasort(aELEMENT *ary, int len) { if (ary && len) qsort(ary, len, sizeof(aELEMENT), (int (*)(const void *, const void *))_acmp); return ary; } aELEMENT * vawords(aELEMENT *a, unsigned char *s, int len, const unsigned char *sep, int seplen) { int x; if (!a) a = vamk(10); else a = vatrunc(a, 0); loop: x = vsspan(s, len, sep, seplen); s += x; len -= x; if (len) { x = vsscan(s, len, sep, seplen); if (x != ~0) { a = vaadd(a, vsncpy(vsmk(x), 0, s, x)); s += x; len -= x; if (len) goto loop; } else a = vaadd(a, vsncpy(vsmk(len), 0, s, len)); } return a; } jupp/va.h010064400000000000000000000200751364306522400075530ustar00/* * Variable length arrays of strings * Copyright * (C) 1992 Joseph H. Allen * * This file is part of JOE (Joe's Own Editor) */ #ifndef JUPP_VA_H #define JUPP_VA_H #ifdef EXTERN_B_C __IDSTRING(rcsid_va_h, "$MirOS: contrib/code/jupp/va.h,v 1.10 2020/04/07 11:56:41 tg Exp $"); #endif #include "vs.h" /* Functions and global variable you have to define. Replace these with * macros or defines here if they are not to be actual functions */ typedef unsigned char *aELEMENT; /* aELEMENT adup(); */ #define adup(s) vsdup(s) /* aELEMENT adel(); */ #define adel(s) vsrm(s) /* int acmp(); */ #define acmp(a,b) vscmp((a),(b)) /* extern aELEMENT ablank; */ #define ablank NULL /* extern aELEMENT aterm; */ #define aterm NULL /************************/ /* Creation/Destruction */ /************************/ /* aELEMENT *vamk(int len); * Create a variable length array. Space for 'len' elements is preallocated. */ aELEMENT *vamk(int len); /* void varm(aELEMENT *vary); * Free an array and everything which is in it. Does nothing if 'vary' is * 0. */ void varm(aELEMENT *vary); /********************/ /* Space management */ /********************/ /* int aSIZ(aELEMENT *vary); * int aSiz(aELEMENT *vary); * Access size part of array. This int indicates the number of elements which * can fit in the array before realloc needs to be called. It does not include * the extra space needed for the terminator and the header. * * aSIZ returns 0 if you pass it 0. aSiz does not do this checking, * but can be used as an lvalue. */ #define aSiz(a) jalloc_siz(a) #define aSIZ(a) ((a) ? aSiz(a) : 0) /* int aLEN(aELEMENT *vary); * int aLen(aELEMENT *vary); * Access length part of array. This int indicates the number of elements * currently in the array (not including the terminator). This should be * used primarily for reading the size of the array. It can be used for * setting the size of the array, but it must be used with care since it * does not eliminate elements (if the size decreases) or make sure there's * enough room (if the size increases). See vensure and vtrunc. * * aLEN return a length of zero if 'vary' is 0. * aLen doesn't do this checking, but can be used as an lvalue */ #define aLen(a) jalloc_len(a) #define aLEN(a) ((a) ? aLen(a) : 0) /* int alen(aELEMENT *ary); * Compute length of char or variable length array by searching for termination * element. Returns 0 if 'vary' is 0. */ int alen(aELEMENT *ary); /* aELEMENT *vaensure(aELEMENT *vary, int len); * Make sure there's enough space in the array for 'len' elements. Whenever * vaensure reallocs the array, it allocates 25% more than the necessary * minimum space in anticipation of future expansion. If 'vary' is 0, * it creates a new array. */ aELEMENT *vaensure(aELEMENT *vary, int len); /* aELEMENT *vazap(aELEMENT *vary, int pos, int n); * Destroy n elements from an array beginning at pos. Is ok if pos/n go * past end of array. This does not change the aLEN() value of the array. * This does nothing and returns 0 if 'vary' is 0. Note that this * function does not actually write to the array. This does not stop if * a aterm is encountered. */ aELEMENT *vazap(aELEMENT *vary, int pos, int n); /* aELEMENT *vatrunc(aELEMENT *vary, int len); * Truncate array to indicated size. This zaps or expands with blank elements * and sets the LEN() of the array. A new array is created if 'vary' is 0. */ aELEMENT *vatrunc(aELEMENT *vary, int len); /************************************/ /* Function which write to an array */ /************************************/ /* aELEMENT *vafill(aELEMENT *vary, int pos, aELEMENT el, int len); * Set 'len' element of 'vary' beginning at 'pos' to duplications of 'el'. * Ok, if pos/len are past end of array. If 'vary' is 0, a new array is * created. * * This does not zap previous values. If you need that to happen, call * vazap first. It does move the terminator around properly though. */ aELEMENT *vafill(aELEMENT *vary, int pos, aELEMENT el, int len); /* aELEMENT *vandup(aELEMENT *vary, int pos, aELEMENT *array, int len); * Duplicate 'len' elements from 'array' onto 'vary' beginning at position * 'pos'. 'array' can be a char array since its length is passed seperately. A * new array is created if 'vary' is 0. */ aELEMENT *vandup(aELEMENT *vary, int pos, aELEMENT *array, int len); /* aELEMENT *vadup(aELEMENT *vary); * Duplicate array. This is just a functionalized version of: * * vandup(NULL,0,vary,aLEN(vary)); * * but since you need to be able to refer to this particular function by * address often it's given here. * * (actually, there's bazillions of these simple combinations of the above * functions and the macros of the next section. You'll probably want to make * functionalized instances of the ones you use most often - especially since * the macros aren't safe). */ aELEMENT *vadup(aELEMENT *vary); /* aELEMENT *vaset(aELEMENT *vary, int pos, aELEMENT element); * Set an element in an array. Any value of 'pos' is valid. A new array * is created if 'vary' is 0. The previous contents of the position is * deleted. This does not duplicate 'element'. If you need 'element' * duplicated, call: vaset(vary,pos,adup(element)); */ aELEMENT *_vaset(aELEMENT *vary, int pos, aELEMENT el); #define vaset(v,p,el) \ (!(v) || (p) > aLen(v) || ((p) == aLen(v) && (p) == aSiz(v)) ? \ _vaset((v),(p),(el)) \ : \ ((p) == aLen(v) ? \ ((v)[(p)+1] = (v)[p], (v)[p] = (el), aLen(v) = (p)+1, (v)) \ : \ (adel((v)[p]), (v)[p] = (el), (v)) \ ) \ ) /* aELEMENT *vaadd(aELEMENT *vary, aELEMENT element); * Concatenate a single element to the end of 'vary'. A new array is created * if 'vary' is 0. This does not duplicate element: call * vaadd(vary,adup(element)); If you need it duplicated. */ #define vaadd(v,el) \ (!(v) || aLen(v) == aSiz(v) ? \ _vaset((v), aLEN(v), (el)) \ : \ ((v)[aLen(v) + 1] = (v)[aLen(v)], (v)[aLen(v)] = (el), \ aLen(v) = aLen(v) + 1, (v)) \ ) /**************************************/ /* Functions which read from an array */ /**************************************/ /* These macros are used to generate the address/size pairs which get * passed to the functions of the previous section. */ /* { aELEMENT *, int } av(aELEMENT *array); * Return array,size pair. Uses aLEN to get size. */ #define av(a) (a), aLEN(a) /* { aELEMENT *, int } az(aELEMENT *array); * Return array,size pair. Uses alen to get size. */ #define az(a) (a), alen(a) /* { aELEMENT *, int } ac(aELEMENT *array); * Return array,size pair. Uses 'sizeof' to get size. */ #define ac(a) (a), (sizeof(a) / sizeof(aELEMENT)) /* { aELEMENT *, int } arest(aELEMENT *vary, int pos); * Return array,size pair of rest of array beginning at pos. If * pos is past end of array, gives size of 0. */ #define arest(a,p) ((a) + (p)), (((p) > aLEN(a)) ? 0 : aLen(a) - (p)) /* { aELEMENT *, int } apart(aELEMENT *vary, int pos, int len); * Return array,size pair of 'len' elements of array beginning with pos. If * pos is past end of array, gives size of 0. If pos+len is past end of array, * returns number of elements to end of array. */ #define apart(a,p,l) \ ((a) + (p)), ((p) >= aLEN(a) ? 0 : ((p) + (l) > aLen(a) ? aLen(a) - (p) : (l))) /* aELEMENT vaget(aELEMENT *vary, int pos); * Get an element from an array. Any value of pos is valid; if it's past the * end of the array or if 'vary' is 0, the terminator is returned. This * does not make a duplicate of the returned element. If you want that, pass * the return value of this to adup. */ #define vaget(a,p) ((p) >= aLEN(a) ? aterm : (a)[p]) /*************************/ /* Searching and Sorting */ /*************************/ /* aELEMENT *vasort(aELEMENT *ary, int len) * Sort the elements of an array (char or variable length) using qsort(). */ aELEMENT *vasort(aELEMENT *ary, int len); /* aELEMENT *vawords(aELEMENT *a, char *s, int len, char *sep, int seplen); * Generate list of strings out of words in 's' seperated with the characters * in 'sep'. The characters in 'sep' must be sorted. */ aELEMENT *vawords(aELEMENT *a, unsigned char *s, int len, const unsigned char *sep, int seplen); #endif jupp/vfile.c010064400000000000000000000176611337207074600102600ustar00/* * Software virtual memory system * Copyright * (C) 1992 Joseph H. Allen * * This file is part of JOE (Joe's Own Editor) */ #include "config.h" #include "types.h" __RCSID("$MirOS: contrib/code/jupp/vfile.c,v 1.17 2018/11/11 18:15:39 tg Exp $"); #include #include #include #include #include "blocks.h" #include "queue.h" #include "path.h" #include "tty.h" #include "utils.h" #include "vfile.h" #include "vs.h" /* Known vfiles */ static VFILE vfiles = { {&vfiles, &vfiles}, 0, 0, 0, 0, NULL, 0, NULL, 0, NULL, NULL, 0, 0 }; static VPAGE *freepages = NULL; /* Linked list of free pages */ static VPAGE *htab[HTSIZE]; /* Hash table of page headers */ static long curvalloc = 0; /* Amount of memory in use */ static long maxvalloc = ILIMIT; /* Maximum allowed */ unsigned char *vbase; /* Data first entry in vheader refers to */ VPAGE **vheaders = NULL; /* Array of header addresses */ static int vheadsz = 0; /* No. entries allocated to vheaders */ static unsigned int joe_random(void); void vflsh(void) { VPAGE *vp; VPAGE *vlowest; long addr; long last; VFILE *vfile; int x; const char *wtf; for (vfile = vfiles.link.next; vfile != &vfiles; vfile = vfile->link.next) { last = -1; loop: addr = LONG_MAX; vlowest = NULL; for (x = 0; x != HTSIZE; x++) for (vp = htab[x]; vp; vp = vp->next) if (vp->addr < addr && vp->addr > last && vp->vfile == vfile && (vp->addr >= vfile->size || (vp->dirty && !vp->count))) { addr = vp->addr; vlowest = vp; } if (vlowest) { if (!vfile->name) vfile->name = mktmp(NULL, vfile->fd ? NULL : &vfile->fd); if (!vfile->fd) vfile->fd = open((char *)(vfile->name), O_RDWR); if (vfile->fd < 0) { wtf = "open"; goto eek; } if (lseek(vfile->fd, addr, 0) < 0) { /* should not happen, what now? */ wtf = "lseek"; close(vfile->fd); eek: vfile->fd = 0; fprintf(stderr, "\nvfile %s failed! \n", wtf); continue; } if (addr + PGSIZE > vsize(vfile)) { joe_write(vfile->fd, vlowest->data, vsize(vfile) - addr); vfile->size = vsize(vfile); } else { joe_write(vfile->fd, vlowest->data, PGSIZE); if (addr + PGSIZE > vfile->size) vfile->size = addr + PGSIZE; } vlowest->dirty = 0; last = addr; goto loop; } } } /* write changed pages for a specific file to the disk */ static void vflshf(VFILE *vfile); static void vflshf(VFILE *vfile) { VPAGE *vp; VPAGE *vlowest; long addr; int x; const char *wtf; loop: addr = LONG_MAX; vlowest = NULL; for (x = 0; x != HTSIZE; x++) for (vp = htab[x]; vp; vp = vp->next) if (vp->addr < addr && vp->dirty && vp->vfile == vfile && !vp->count) { addr = vp->addr; vlowest = vp; } if (vlowest) { if (!vfile->name) vfile->name = mktmp(NULL, vfile->fd ? NULL : &vfile->fd); if (!vfile->fd) vfile->fd = open((char *)(vfile->name), O_RDWR); if (vfile->fd < 0) { wtf = "open"; goto eek; } if (lseek(vfile->fd, addr, 0) < 0) { /* should not happen, what now? */ wtf = "lseek"; close(vfile->fd); eek: vfile->fd = 0; fprintf(stderr, "\nvfile %s failed! \n", wtf); /* only called from vclose via main, maybe harmless? */ return; } if (addr + PGSIZE > vsize(vfile)) { joe_write(vfile->fd, vlowest->data, vsize(vfile) - addr); vfile->size = vsize(vfile); } else { joe_write(vfile->fd, vlowest->data, PGSIZE); if (addr + PGSIZE > vfile->size) vfile->size = addr + PGSIZE; } vlowest->dirty = 0; goto loop; } } static unsigned char *mema(int align, int size) { unsigned char *z = malloc(align + size); return z + (align - ((size_t)z % align)); } unsigned char *vlock(VFILE *vfile, unsigned long addr) { VPAGE *vp, *pp; int x, y; long ofst = (addr & (PGSIZE - 1)); addr -= ofst; for (vp = htab[((addr >> LPGSIZE) + (unsigned long) vfile) & (HTSIZE - 1)]; vp; vp = vp->next) if (vp->vfile == vfile && (unsigned long)vp->addr == addr) { ++vp->count; return vp->data + ofst; } if (freepages) { vp = freepages; freepages = vp->next; goto gotit; } if (curvalloc + PGSIZE <= maxvalloc) { vp = malloc(sizeof(VPAGE) * INC); if (vp) { vp->data = (unsigned char *) mema(PGSIZE, PGSIZE * INC); if (vp->data) { int q; curvalloc += PGSIZE * INC; if (!vheaders) { vheaders = malloc((vheadsz = INC) * sizeof(VPAGE *)); vbase = vp->data; } else if ((size_t)vp->data < (size_t)vbase) { VPAGE **t = vheaders; int amnt = (((size_t)vbase) - ((size_t)vp->data)) >> LPGSIZE; vheaders = malloc((amnt + vheadsz) * sizeof(VPAGE *)); mmove(vheaders + amnt, t, vheadsz * sizeof(VPAGE *)); vheadsz += amnt; vbase = vp->data; free(t); } else if (((((size_t)vp->data + PGSIZE * INC) - ((size_t)vbase)) >> LPGSIZE) > (unsigned long)vheadsz) { vheaders = realloc(vheaders, (vheadsz = (((((size_t)vp->data + PGSIZE * INC) - ((size_t)vbase)) >> LPGSIZE))) * sizeof(VPAGE *)); } for (q = 1; q != INC; ++q) { vp[q].next = freepages; freepages = vp + q; vp[q].data = vp->data + q * PGSIZE; vheader(vp->data + q * PGSIZE) = vp + q; } vheader(vp->data) = vp; goto gotit; } free(vp); vp = NULL; } } for (y = HTSIZE, x = (joe_random() & (HTSIZE - 1)); y; x = ((x + 1) & (HTSIZE - 1)), --y) for (pp = (VPAGE *) (htab + x), vp = pp->next; vp; pp = vp, vp = vp->next) if (!vp->count && !vp->dirty) { pp->next = vp->next; goto gotit; } vflsh(); for (y = HTSIZE, x = (joe_random() & (HTSIZE - 1)); y; x = ((x + 1) & (HTSIZE - 1)), --y) for (pp = (VPAGE *) (htab + x), vp = pp->next; vp; pp = vp, vp = vp->next) if (!vp->count && !vp->dirty) { pp->next = vp->next; goto gotit; } if (write(2, "vfile: out of memory\n", 21)) {} exit(1); gotit: vp->addr = addr; vp->vfile = vfile; vp->dirty = 0; vp->count = 1; vp->next = htab[((addr >> LPGSIZE) + (unsigned long)vfile) & (HTSIZE - 1)]; htab[((addr >> LPGSIZE) + (unsigned long)vfile) & (HTSIZE - 1)] = vp; if (addr < (unsigned long)vfile->size) { if (!vfile->fd && (vfile->fd = open((char *)(vfile->name), O_RDWR)) < 0) vfile->fd = 0; if (!vfile->fd || lseek(vfile->fd, addr, 0) < 0) { static char washere = 0; if (!washere++) ttabrt(0, "vlock: open or lseek failed"); if (write(2, "vlock: open or lseek failed twice\n", 26)) {} exit(1); } if (addr + PGSIZE > (unsigned long)vfile->size) { joe_read(vfile->fd, vp->data, vfile->size - addr); mset(vp->data + vfile->size - addr, 0, PGSIZE - (int) (vfile->size - addr)); } else joe_read(vfile->fd, vp->data, PGSIZE); } else mset(vp->data, 0, PGSIZE); return vp->data + ofst; } VFILE *vtmp(void) { VFILE *new = malloc(sizeof(VFILE)); new->fd = 0; new->name = NULL; new->alloc = 0; new->size = 0; new->left = 0; new->lv = 0; new->vpage = NULL; new->flags = 1; new->vpage1 = NULL; new->addr = -1; return enqueb_f(VFILE, link, &vfiles, new); } void vclose(VFILE *vfile) { VPAGE *vp, *pp; int x; if (vfile->vpage) vunlock(vfile->vpage); if (vfile->vpage1) vunlock(vfile->vpage1); if (vfile->name) { if (vfile->flags) unlink((char *)vfile->name); else vflshf(vfile); vsrm(vfile->name); } if (vfile->fd) close(vfile->fd); free(deque_f(VFILE, link, vfile)); for (x = 0; x != HTSIZE; x++) for (pp = (VPAGE *) (htab + x), vp = pp->next; vp;) if (vp->vfile == vfile) { pp->next = vp->next; vp->next = freepages; freepages = vp; vp = pp->next; } else { pp = vp; vp = vp->next; } } long my_valloc(VFILE *vfile, long int size) { long start = vsize(vfile); vfile->alloc = start + size; if (vfile->lv) { if (vheader(vfile->vpage)->addr + PGSIZE > vfile->alloc) vfile->lv = PGSIZE - (vfile->alloc - vheader(vfile->vpage)->addr); else vfile->lv = 0; } return start; } #if ((HTSIZE) <= 0x8000) /* Borland LCG */ static unsigned int joe_random(void) { static unsigned int lcg_state = 5381; return (((lcg_state = 22695477 * lcg_state + 1) >> 16) & 0x7FFF); } #endif jupp/vfile.h010064400000000000000000000066461363731763700102750ustar00/* * Software virtual memory system * Copyright * (C) 1992 Joseph H. Allen * * This file is part of JOE (Joe's Own Editor) */ #ifndef JUPP_VFILE_H #define JUPP_VFILE_H #ifdef EXTERN __IDSTRING(rcsid_vfile_h, "$MirOS: contrib/code/jupp/vfile.h,v 1.9 2020/03/27 06:39:00 tg Exp $"); #endif /* Additions: * * Should we remove size checking from rc()? Would make it faster... * * Should be able to open more than one stream on a file so that vseek * doesn't have to get called so much when more than one user is involed * * Also should have dupopen call to make more streams for a file * * Make vputs faster * * Should have a version which will use memory mapped files, if they exist * in the os. * * Would be nice if we could transparantly open non-file streams and pipes. * Should there be an buffering option for that? So we can seek on pipes to * get previously read data? */ extern unsigned char *vbase; /* Data first entry in vheader refers to */ extern VPAGE **vheaders; /* Array of headers */ /* VFILE *vtmp(V); * * Open a temporary virtual file. File goes away when closed. No actual * file is generated if everything fits in memory. */ VFILE *vtmp(void); /* long vsize(VFILE *); * * Return size of file */ #define vsize(vfile) \ ( \ (vfile)->left<(vfile)->lv ? \ (vfile)->alloc+(vfile)->lv-(vfile)->left \ : \ (vfile)->alloc \ ) /* void vclose(VFILE *vfile); * * Close a file. */ void vclose(VFILE *vfile); /* void vflsh(void); * * Write all changed pages to the disk */ void vflsh(void); /* char *vlock(VFILE *vfile,long addr); * * Translate virtual address to physical address. 'addr' does not have * to be on any particular alignment, but if you wish to access more than * a single byte, you have to be aware of where page boundaries are (virtual * address multiples of PGSIZE). * * The page containing the data is locked in memory (so that it won't be * freed or used for something else) until 'vunlock' is used. * * Warning: If you allocate more than one page and use (change) them out of * order, vflsh will screw up if writing past the end of a file is illegal * in the host filesystem. * * Also: This function does not allocate space to the file. Use valloc() * for that. You can vlock() pages past the allocated size of the file, but * be careful when you do this (you normally shouldn't- the only time you * ever might want to is to implement your own version of valloc()). */ unsigned char *vlock(VFILE *vfile, unsigned long addr); /* VPAGE *vheader(char *); * Return address of page header for given page */ #define vheader(p) (vheaders[(((size_t)(unsigned char *)(p))-((size_t)vbase))>>LPGSIZE]) /* void vchanged(char *); * * Indicate that a vpage was changed so that it will be written back to the * file. Any physical address which falls within the page may be given. */ #define vchanged(vpage) ( vheader(vpage)->dirty=1 ) /* void vunlock(char *); * Unreference a vpage (call one vunlock for every vlock) * Any physical address which falls within the page may be given. */ #define vunlock(vpage) ( --vheader(vpage)->count ) /* void vupcount(char *); * Indicate that another reference is being made to a vpage */ #define vupcount(vpage) ( ++vheader(vpage)->count ) /* long valloc(VFILE *vfile,long size); * * Allocate space at end of file * * Returns file address of beginning of allocated space */ long my_valloc(VFILE *vfile, long int size); #endif jupp/vs.c010064400000000000000000000100661322450264000075600ustar00/* * Variable length strings * Copyright * (C) 1992 Joseph H. Allen * * This file is part of JOE (Joe's Own Editor) */ #include "config.h" #include "types.h" __RCSID("$MirOS: contrib/code/jupp/vs.c,v 1.14 2018/01/07 20:39:33 tg Exp $"); #include #include "blocks.h" #include "utils.h" #include "vs.h" sELEMENT * vsmk(int len) { sELEMENT *rv; rv = jalloc(NULL, len, sizeof(sELEMENT)); rv[0] = sterm; return (rv); } void vsrm(sELEMENT *vary) { jfree(vary); } int slen(const sELEMENT *ary) { const sELEMENT *beg = ary; if (!ary) return (0); while (scmp(*ary, sterm)) ++ary; return (ary - beg); } sELEMENT * vsensure(sELEMENT *vary, int len) { sELEMENT *rv; if (vary && len > sSiz(vary)) len += (len >> 2); rv = jalloc(vary, len, sizeof(sELEMENT)); if (!vary) rv[0] = sterm; return (rv); } sELEMENT *vstrunc(sELEMENT *vary, int len) { if (!vary || len > sLEN(vary)) vary = vsensure(vary, len + 16); if (len < sLen(vary)) { vary[len] = vary[sLen(vary)]; sLen(vary) = len; } else if (len > sLen(vary)) { vary = vsfill(vary, sLen(vary), sblank, len - sLen(vary)); } return vary; } sELEMENT *vsfill(sELEMENT *vary, int pos, sELEMENT el, int len) { int olen = sLEN(vary), x; if (!vary || pos + len > sSIZ(vary)) vary = vsensure(vary, pos + len); if (pos + len > olen) { vary[pos + len] = vary[olen]; sLen(vary) = pos + len; } for (x = pos; x != pos + len; ++x) vary[x] = sdup(el); if (pos > olen) vary = vsfill(vary, pos, sblank, pos - olen); return vary; } sELEMENT *vsncpy(sELEMENT *vary, int pos, const sELEMENT *array, int len) { int olen = sLEN(vary); if (!vary || pos + len > sSIZ(vary)) vary = vsensure(vary, pos + len); if (pos + len > olen) { vary[pos + len] = vary[olen]; sLen(vary) = pos + len; } if (pos > olen) vary = vsfill(vary, olen, sblank, pos - olen); #ifdef TEST memmove(vary + pos, array, len * sizeof(sELEMENT)); #else mmove(vary + pos, array, len * sizeof(sELEMENT)); #endif return vary; } sELEMENT *vsndup(sELEMENT *vary, int pos, sELEMENT *array, int len) { int olen = sLEN(vary), x; if (!vary || pos + len > sSIZ(vary)) vary = vsensure(vary, pos + len); if (pos + len > olen) { vary[pos + len] = vary[olen]; sLen(vary) = pos + len; } if (pos > olen) vary = vsfill(vary, olen, sblank, pos - olen); for (x = pos; x != len; ++x) vary[x] = sdup(array[x]); return vary; } sELEMENT *vsdup(sELEMENT *vary) { return vsndup(NULL, 0, vary, sLEN(vary)); } sELEMENT *_vsset(sELEMENT *vary, int pos, sELEMENT el) { if (!vary || pos + 1 > sSIZ(vary)) vary = vsensure(vary, pos + 1); if (pos > sLen(vary)) { vary = vsfill(vary, sLen(vary), sblank, pos - sLen(vary)); vary[pos + 1] = vary[pos]; vary[pos] = el; sLen(vary) = pos + 1; } else if (pos == sLen(vary)) { vary[pos + 1] = vary[pos]; vary[pos] = el; sLen(vary) = pos + 1; } else { sdel(vary[pos]); vary[pos] = el; } return vary; } int vsbsearch(const sELEMENT *ary, int len, sELEMENT el) { int x, y, z; if (!ary || !len) return 0; y = len; x = 0; z = ~0; while (z != (x + y) / 2) { z = (x + y) / 2; switch (scmp(el, ary[z])) { case 1: x = z; break; case -1: y = z; break; case 0: return z; } } return y; } int vscmpn(sELEMENT *a, int alen, sELEMENT *b, int blen) { int x, l; int t; if (!a && !b) return 0; if (!a) return -1; if (!b) return 1; if (alen > blen) l = sLen(a); else l = blen; for (x = 0; x != l; ++x) if ((t = scmp(a[x], b[x])) != 0) return t; if (alen > blen) return 1; if (alen < blen) return -1; return 0; } int vscmp(sELEMENT *a, sELEMENT *b) { return vscmpn(sv(a), sv(b)); } int vsscan(const sELEMENT *a, int alen, const sELEMENT *b, int blen) { int x; for (x = 0; x != alen; ++x) { int z = vsbsearch(b, blen, a[x]); if (z < blen && !scmp(b[z], a[x])) return x; } return ~0; } int vsspan(const sELEMENT *a, int alen, const sELEMENT *b, int blen) { int x; /* should not happen */ if (!b) return (0); for (x = 0; x != alen; ++x) { int z = vsbsearch(b, blen, a[x]); if (z == blen || scmp(b[z], a[x])) break; } return x; } jupp/vs.h010064400000000000000000000310701364306522500075730ustar00/* * Dynamic string library * Copyright * (C) 1992 Joseph H. Allen * * This file is part of JOE (Joe's Own Editor) */ #ifndef JUPP_VS_H #define JUPP_VS_H #ifdef EXTERN __IDSTRING(rcsid_vs_h, "$MirOS: contrib/code/jupp/vs.h,v 1.13 2020/04/07 11:56:42 tg Exp $"); #endif #include /*** * * This is a dynamic string library which supports strings which automatically * resize themselves when needed. The strings know their own size, so getting * the length of a string is a fast operation and storing zeroes in the * strings is permissable. * * The strings are stored in malloc blocks and have the following format: * * * * 'bksize' and 'length' are ints which give the size of the malloc block * and the length of the string. A zero character always follows the string * for compatibility with normal C zero-terminated strings. The zero is not * counted in the string length. * * To further the compatibility with C strings, the address of a dynamic string * is at above, not at (whose address is the start of the * malloc block). Thus, dynamic strings can be passed as arguments to UNIX * operating system functions and C library function, but they can not be freed * with free()- a special function is provided in this library for freeing * dynamic strings. * * The primary dynamic string function is: * * char *vsncpy(char *d, int off, char *s, int len); * Copy a block of characters at address 's' of * length 'len' onto the dynamic string 'd' at * offset 'off'. The dynamic string is expanded * to handle any values of 'len' and 'off' which * might be given. If 'off' is greater than the * length of the string, SPACEs are placed in the * gap. If 'd' is NULL, a string is created. If * 'len' is 0, no copying or string expansion * occurs. * * Three important macros are provided for helping with vsncpy(): * * sc("Hello") Gives --> "Hello",sizeof("Hello")-1 * sz(s) Gives --> s,strlen(s) * sv(d) Gives --> d,sLEN(d) * * These are used to build arguments for vsncpy(). Many functions * can be created with combinations of sc/sz/sv with vsncpy: * * s=vsncpy(NULL,0,NULL,0); Create an empty dynamic string * * s=vsncpy(NULL,0,sc("Hello")); Create a dynamic string initialized * with "Hello" * * d=vsncpy(NULL,0,sv(s)); Duplicate a dynamic string * * d=vsncpy(NULL,0,sz(s)); Convert a C string into a dynamic * string. * * d=vsncpy(sv(d),sv(s)); Append dynamic string s onto d. * * d=vsncpy(sv(d),sc(".c")); Append a ".c" extension to d. * * * These lesser functions are also provided: * * void vsrm(char *s); Free a string. Do nothing if 's' is NULL. * * int sLEN(char *s); Return the length of the string 's'. If 's' * is NULL, return 0. * * char *vstrunc(char *d,int len); * Set the length of a string. Expand the string * with blanks if necessary. * * char *vsensure(char *d,int len); * Expand the malloc block for the string if * necessary so that a string of 'len' chars can * fit in it. * * sLen(s)=10; Set the length indicator of the string to 10. * * char *vsins(char *d,int off,int len); * Insert a gap into a string. * * char *vsdel(char *d,int off,int len); * Delete characters from a string. * * Other function are provided as well. Look through the rest of the header * file. The header file is kind of weird looking because it is intended to * handle dynamic arrays of any type with only a few changes. */ /* Functions and global variable you have to define. Replace these with * macros or defines here if they are not to be actual functions */ /* An element with name 'a' */ typedef unsigned char sELEMENT; /* Duplicate an element */ /* sELEMENT sdup(); */ #define sdup(a) (a) /* Delete an element */ /* sELEMENT sdel(); */ #define sdel(a) do {} while(0) /* effectively do nothing ;-) */ /* Compare a single element */ /* int scmp(); */ #define scmp(a,b) ((a) > (b) ? 1 : ((a) == (b) ? 0 : -1)) /* A blank element */ /* extern sELEMENT sblank; */ #define sblank ' ' /* A termination element */ /* extern sELEMENT sterm; */ #define sterm '\0' /************************/ /* Creation/Destruction */ /************************/ /* sELEMENT *vsmk(int len); * Create a variable length array. Space for 'len' elements is preallocated. */ sELEMENT *vsmk(int len); /* void vsrm(sELEMENT *vary); * Free an array and everything which is in it. Does nothing if 'vary' is * 0. */ void vsrm(sELEMENT *vary); /********************/ /* Space management */ /********************/ /* int sSIZ(sELEMENT *vary); * int sSiz(sELEMENT *vary); * Access size part of array. This int indicates the number of elements which * can fit in the array before realloc needs to be called. It does not include * the extra space needed for the terminator and the header. * * sSIZ returns 0 if you pass it 0. sSiz does not do this checking, * but can be used as an lvalue. */ #define sSiz(a) jalloc_siz(a) #define sSIZ(a) ((a) ? sSiz(a) : 0) /* int sLEN(sELEMENT *vary); * int sLen(sELEMENT *vary); * Access length part of array. This int indicates the number of elements * currently in the array (not including the terminator). This should be * used primarily for reading the size of the array. It can be used for * setting the size of the array, but it must be used with care since it * does not eliminate elements (if the size decreases) or make sure there's * enough room (if the size increases). See vensure and vtrunc. * * sLEN return a length of zero if 'vary' is 0. * sLen doesn't do this checking, but can be used as an lvalue */ #define sLen(a) jalloc_len(a) #define sLEN(a) ((a) ? sLen(a) : 0) /* int slen(const sELEMENT *ary); * Compute length of char or variable length array by searching for termination * element. Returns 0 if 'vary' is 0. */ int slen(const sELEMENT *ary); /* sELEMENT *vsensure(sELEMENT *vary, int len); * Make sure there's enough space in the array for 'len' elements. Whenever * vsensure reallocs the array, it allocates 25% more than the necessary * minimum space in anticipation of future expansion. If 'vary' is 0, * it creates a new array. */ sELEMENT *vsensure(sELEMENT *vary, int len); /* sELEMENT *vstrunc(sELEMENT *vary, int len)); * Truncate array to indicated size. This zaps or expands with blank elements * and sets the LEN() of the array. A new array is created if 'vary' is 0. */ sELEMENT *vstrunc(sELEMENT *vary, int len); /************************************/ /* Function which write to an array */ /************************************/ /* sELEMENT *vsfill(sELEMENT *vary, int pos, sELEMENT el, int len); * Set 'len' element of 'vary' beginning at 'pos' to duplications of 'el'. * Ok, if pos/len are past end of array. If 'vary' is 0, a new array is * created. * * This does not zap previous values. If you need that to happen, call * vszap first. It does move the terminator around properly though. */ sELEMENT *vsfill(sELEMENT *vary, int pos, sELEMENT el, int len); /* sELEMENT *vsncpy(sELEMENT *vary, int pos, const sELEMENT *array, int len)); * Copy 'len' elements from 'array' onto 'vary' beginning at position 'pos'. * 'array' can be a normal char array since the length is passed seperately. The * elements are copied, not duplicated. A new array is created if 'vary' is * 0. This does not zap previous elements. */ sELEMENT *vsncpy(sELEMENT *vary, int pos, const sELEMENT *array, int len); /* sELEMENT *vsndup(sELEMENT *vary, int pos, sELEMENT *array, int len)); * Duplicate 'len' elements from 'array' onto 'vary' beginning at position * 'pos'. 'array' can be a char array since its length is passed seperately. A * new array is created if 'vary' is 0. */ sELEMENT *vsndup(sELEMENT *vary, int pos, sELEMENT *array, int len); /* sELEMENT *vsdup(sELEMENT *vary)); * Duplicate array. This is just a functionalized version of: * * vsndup(NULL, 0, vary, sLEN(vary)); * * but since you need to be able to refer to this particular function by * address often it's given here. * * (actually, there's bazillions of these simple combinations of the above * functions and the macros of the next section. You'll probably want to make * functionalized instances of the ones you use most often - especially since * the macros aren't safe). */ sELEMENT *vsdup(sELEMENT *vary); /* sELEMENT *vsset(sELEMENT *vary, int pos, sELEMENT element); * Set an element in an array. Any value of 'pos' is valid. A new array * is created if 'vary' is 0. The previous contents of the position is * deleted. This does not duplicate 'element'. If you need 'element' * duplicated, call: vsset(vary,pos,sdup(element)); */ sELEMENT *_vsset(sELEMENT *vary, int pos, sELEMENT el); #define vsset(v,p,el) \ (!(v) || (p) > sLen(v) || (p) >= sSiz(v) ? \ _vsset((v), (p), (el)) \ : \ ((p) == sLen(v) ? \ ((v)[(p) + 1] = 0, sLen(v) = (p) + 1, (v)[p] = (el), (v)) \ : \ ((v)[p] = (el), (v)) \ ) \ ) /* sELEMENT *vsadd(sELEMENT *vary, sELEMENT element); * Concatenate a single element to the end of 'vary'. A new array is created * if 'vary' is 0. This does not duplicate element: call * vsadd(vary,sdup(element)); If you need it duplicated. */ #define vsadd(v,el) \ (!(v) || sLen(v) == sSiz(v) ? \ _vsset((v), sLEN(v), (el)) \ : \ ((v)[sLen(v) + 1] = 0, (v)[sLen(v)] = (el), sLen(v) = sLen(v) + 1, (v)) \ ) /**************************************/ /* Functions which read from an array */ /**************************************/ /* These macros are used to generate the address/size pairs which get * passed to the functions of the previous section. */ /* { sELEMENT *, int } sv(sELEMENT *array); * Return array, size pair. Uses sLEN to get size. */ #define sv(a) (a), sLEN(a) /* { sELEMENT *, int } sz(sELEMENT *array); * Return array, size pair. Uses slen to get size. */ #define sz(a) (a), slen(a) /* { sELEMENT *, int } sc(sELEMENT *array); * Return array, size pair. Uses 'sizeof' to get size. */ #define sc(a) (const unsigned char *)(a), (sizeof(a) / sizeof(sELEMENT) - 1) /* { sELEMENT *, int } srest(sELEMENT *vary, int pos); * Return array, size pair of rest of array beginning at pos. If * pos is past end of array, gives size of 0. */ #define srest(a,p) ((a) + (p)), (((p) > sLEN(a)) ? 0 : sLen(a) - (p)) /* { sELEMENT *, int } spart(sELEMENT *vary, int pos, int len); * Return array,size pair of 'len' elements of array beginning with pos. If * pos is past end of array, gives size of 0. If pos+len is past end of array, * returns number of elements to end of array. */ #define spart(a,p,l) \ ((a) + (p)), ((p) >= sLEN(a) ? 0 : ((p) + (l) > sLen(a) ? sLen(a) - (p) : (l))) /* sELEMENT vsget(sELEMENT *vary, int pos); * Get an element from an array. Any value of pos is valid; if it's past the * end of the array or if 'vary' is 0, the terminator is returned. This * does not make a duplicate of the returned element. If you want that, pass * the return value of this to sdup. */ #define vsget(a,p) ((p) >= sLEN(a) ? sterm : (a)[p]) /*************************/ /* Searching and Sorting */ /*************************/ /* int vsbsearch(const sELEMENT *ary, int len, sELEMENT element); * Do a binary search on a sorted variable length or char array. Returns position * of matching element or the position where the element should be if it was * not found. (You should test with scmp to find out which). * * Hmm... this should really indicate whether or not the element was found. */ int vsbsearch(const sELEMENT *ary, int len, sELEMENT el); /* int vscmpn(sELEMENT *a, int alen, sELEMENT *b, int blen); * * Compare two arrays using scmp. If 'a' > 'b', return 1. If 'a' == 'b', * return 0. If 'a' < 'b', return -1. Longer strings are > shorter ones if * their beginning match. */ int vscmpn(sELEMENT *a, int alen, sELEMENT *b, int blen); /* int vscmp(sELEMENT *a, sELEMENT *b); * * Functionalized version of: vscmpn(sv(a), sv(b)); */ int vscmp(sELEMENT *a, sELEMENT *b); /* int vsscan(const sELEMENT *a, int alen, const sELEMENT *b, int blen); * Find offset of first matching element in 'a' which matches any * of the elements passed in 'b'. Array 'b' must be sorted. * * Hmm... this really needs to return what the found element is. */ int vsscan(const sELEMENT *a, int alen, const sELEMENT *b, int blen); /* int vsspan(sELEMENT *a, int alen, sELEMENT *b, int blen); * Find offset of first matching element in 'a' which does not match any * of the elements passed in 'b'. Array 'b' must be sorted. */ int vsspan(const sELEMENT *a, int alen, const sELEMENT *b, int blen); #endif jupp/w.c010064400000000000000000000356411426611153300074100ustar00/* * Window system * Copyright * (C) 1992 Joseph H. Allen * * This file is part of JOE (Joe's Own Editor) */ #include "config.h" #include "types.h" __RCSID("$MirOS: contrib/code/jupp/w.c,v 1.16 2022/07/20 23:44:00 tg Exp $"); #include #include "blocks.h" #include "kbd.h" #include "poshist.h" #include "queue.h" #include "rc.h" #include "scrn.h" #include "utils.h" #include "utf8.h" #include "w.h" extern int dspasis; /* Set to display chars above 127 as-is */ extern int staen; /* 0 if top-most status line not displayed */ /* Count no. of main windows */ int countmain(SCREEN *t) { int nmain = 1; W *m = t->curwin->main; W *q; for (q = t->curwin->link.next; q != t->curwin; q = q->link.next) if (q->main != m) { ++nmain; m = q->main; } return nmain; } /* Redraw a window */ void wredraw(W *w) { msetI(w->t->t->updtab + w->y, 1, w->h); msetI(w->t->t->syntab + w->y, -1, w->h); } /* Find first window in a group */ W *findtopw(W *w) { W *x; for (x = w; x->link.prev->main == w->main && x->link.prev != w; x = x->link.prev) ; return x; } /* Determine height of a window. Returns reqh if it is set, otherwise * used fixed or hh scaled to the current screen size */ static int geth(W *w) { if (w->reqh) return w->reqh; else if (w->fixed) return w->fixed; else return (((long) w->t->h - w->t->wind) * w->hh) / 1000; } /* Set the height of a window */ static void seth(W *w, int h) { long tmp; int tmpb; w->reqh = h; tmp = 1000L * h; tmpb = w->t->h - w->t->wind; w->hh = (tmp + (tmpb - 1)) / tmpb; } /* Determine height of a family of windows. Uses 'reqh' if it's set */ int getgrouph(W *w) { W *x; int h; /* Find first window in family */ x = findtopw(w); /* Add heights of all windows in family */ for (w = x, h = geth(w); w->link.next != x && w->link.next->main == x->main; w = w->link.next, h += geth(w)) ; return h; } /* Determine minimum height of a family */ static int getminh(W *w) { W *x; int h; x = findtopw(w); for (w = x, h = (w->fixed ? w->fixed : 2); w->link.next != x && w->link.next->main == x->main; w = w->link.next, h += (w->fixed ? w->fixed : 2)) ; return h; } /* Find last window in a group */ W *findbotw(W *w) { W *x; for (x = w; x->link.next->main == w->main && x->link.next != w; x = x->link.next) ; return x; } /* Demote group of window to end of window list. Returns true if top window was demoted */ int demotegroup(W *w) { W *top = findtopw(w); W *bot = findbotw(w); W *next; int flg = 0; for (w = top; w != bot; w = next) { next = w->link.next; if (w == w->t->topwin) { flg = 1; w->t->topwin = next; } else demote(W, link, w->t->topwin, w); w->y = -1; } if (w == w->t->topwin) flg = 1; else demote(W, link, w->t->topwin, w); w->y = -1; return flg; } /* Find last window on the screen */ W *lastw(SCREEN *t) { W *x; for (x = t->topwin; x->link.next != t->topwin && x->link.next->y >= 0; x = x->link.next) ; return x; } /* Create a screen object */ SCREEN *scr; SCREEN *screate(SCRN *scrn) { SCREEN *t = malloc(sizeof(SCREEN)); t->t = scrn; t->w = scrn->co; t->h = scrn->li; t->topwin = NULL; t->curwin = NULL; t->wind = skiptop; scr = t; return t; } void sresize(SCREEN *t) { SCRN *scrn = t->t; W *w; t->w = scrn->co; t->h = scrn->li; if (t->h - t->wind < FITHEIGHT) t->wind = t->h - FITHEIGHT; if (t->wind < 0) t->wind = 0; w = t->topwin; do { w->y = -1; w->w = t->w - 1; w = w->link.next; } while (w != t->topwin); wfit(t); updall(); } void updall(void) { int y; for (y = 0; y != scr->h; ++y) { scr->t->updtab[y] = 1; scr->t->syntab[y] = -1; } } void scrins(B *b, long l, long n, int flg) { W *w; if ((w = scr->topwin) != NULL) { do { if (w->y >= 0) { if (w->object.base && w->watom->ins) w->watom->ins(w->object.bw, b, l, n, flg); } w = w->link.next; } while (w != scr->topwin); } } void scrdel(B *b, long l, long n, int flg) { W *w; if ((w = scr->topwin) != NULL) { do { if (w->y >= 0) { if (w->object.base && w->watom->del) w->watom->del(w->object.bw, b, l, n, flg); } w = w->link.next; } while (w != scr->topwin); } } /* Fit as many windows on the screen as is possible beginning with the window * at topwin. Give any extra space which couldn't be used to fit in another * window to the last text window on the screen. This function guarentees * to fit on the window with the cursor in it (moves topwin to next group * of windows until window with cursor fits on screen). */ static int doabort(W *w, int *ret); extern volatile int dostaupd; void wfit(SCREEN *t) { int y; /* Where next window goes */ int left; /* Lines left on screen */ W *w; /* Current window we're fitting */ W *pw; /* Main window of previous family */ int req; /* Amount this family needs */ int adj; /* Amount family needs to be adjusted */ int flg = 0; /* Set if cursor window was placed on screen */ int ret; dostaupd = 1; tryagain: y = t->wind; left = t->h - y; pw = NULL; w = t->topwin; do { w->ny = -1; w->nh = geth(w); w = w->link.next; } while (w != t->topwin); /* Fit a group of windows on the screen */ w = t->topwin; do { req = getgrouph(w); if (req > left) /* If group is taller than lines left */ adj = req - left; /* then family gets shorter */ else adj = 0; /* Fit a family of windows on the screen */ do { w->ny = y; /* Set window's y position */ if (!w->win) { pw = w; w->nh -= adj; /* Adjust main window of the group */ } if (!w->win && w->nh < 2) while (w->nh < 2) w->nh += doabort(w->link.next, &ret); if (w == t->curwin) flg = 1; /* Set if we got window with cursor */ y += w->nh; left -= w->nh; /* Increment y value by height of window */ w = w->link.next; /* Next window */ } while (w != t->topwin && w->main == w->link.prev->main); } while (w != t->topwin && left >= FITHEIGHT); if (!pw) return; /* We can't use extra space to fit a new family on, so give space to parent of * previous family */ pw->nh += left; /* Adjust that family's children which are below the parent */ while ((pw = pw->link.next) != w) pw->ny += left; /* Make sure the cursor window got on the screen */ if (!flg) { t->topwin = findbotw(t->topwin)->link.next; goto tryagain; } /* All of the windows are now on the screen. Scroll the screen to reflect what * happened */ w = t->topwin; do { if (w->y >= 0 && w->ny >= 0) if (w->ny > w->y) { W *l = pw = w; while (pw->link.next != t->topwin && (pw->link.next->y < 0 || pw->link.next->ny < 0 || pw->link.next->ny > pw->link.next->y)) { pw = pw->link.next; if (pw->ny >= 0 && pw->y >= 0) l = pw; } /* Scroll windows between l and w */ loop1: if (l->ny >= 0 && l->y >= 0) nscrldn(t->t, l->y, l->ny + uns_min(l->h, l->nh), l->ny - l->y); if (w != l) { l = l->link.prev; goto loop1; } w = pw->link.next; } else if (w->ny < w->y) { W *l = pw = w; while (pw->link.next != t->topwin && (pw->link.next->y < 0 || pw->link.next->ny < 0 || pw->link.next->ny < pw->link.next->y)) { pw = pw->link.next; if (pw->ny >= 0 && pw->y >= 0) l = pw; } /* Scroll windows between l and w */ loop0: if (w->ny >= 0 && w->y >= 0) nscrlup(t->t, w->ny, w->y + uns_min(w->h, w->nh), w->y - w->ny); if (w != l) { w = w->link.next; goto loop0; } w = pw->link.next; } else w = w->link.next; else w = w->link.next; } while (w != t->topwin); /* Update current height and position values */ w = t->topwin; do { if (w->ny >= 0) { if (w->object.base) { if (w->watom->move) w->watom->move(w->object, w->x, w->ny); if (w->watom->resize) w->watom->resize(w->object, w->w, w->nh); } if (w->y == -1) { msetI(t->t->updtab + w->ny, 1, w->nh); msetI(t->t->syntab + w->ny, -1, w->nh); } w->y = w->ny; } else w->y = -1; w->h = w->nh; w->reqh = 0; w = w->link.next; } while (w != t->topwin); } /* Goto next window */ int wnext(SCREEN *t) { if (t->curwin->link.next != t->curwin) { t->curwin = t->curwin->link.next; if (t->curwin->y == -1) wfit(t); return 0; } else return -1; } /* Goto previous window */ int wprev(SCREEN *t) { if (t->curwin->link.prev != t->curwin) { t->curwin = t->curwin->link.prev; if (t->curwin->y == -1) { t->topwin = findtopw(t->curwin); wfit(t); } return 0; } else return -1; } /* Grow window */ int wgrow(W *w) { W *nextw; /* If we're the last window on the screen, shrink the previous window */ if ((w->link.next == w->t->topwin || w->link.next->y == -1) && w != w->t->topwin) return wshrink(w->link.prev->main); /* Get to next variable size window */ for (nextw = w->link.next; nextw->fixed && nextw != w->t->topwin; nextw = nextw->link.next) ; /* Is it below us, on screen and big enough to take space from? */ if (nextw == w->t->topwin || nextw->y == -1 || nextw->h <= FITHEIGHT) return -1; /* Increase this window's height */ seth(w, w->h + 1); /* Decrease next window's height */ seth(nextw, nextw->h - 1); /* Do it */ wfit(w->t); return 0; } /* Shrink window */ int wshrink(W *w) { W *nextw; /* If we're the last window on the screen, grow the previous window */ if ((w->link.next == w->t->topwin || w->link.next->y == -1) && w != w->t->topwin) return wgrow(w->link.prev->main); /* Is this window too small already? */ if (w->h <= FITHEIGHT) return -1; /* Get to window below us */ for (nextw = w->link.next; nextw != w->t->topwin && nextw->fixed; nextw = nextw->link.next) ; if (nextw == w->t->topwin) return -1; /* Decrease the size of this window */ seth(w, w->h - 1); /* Increase the size of next window */ seth(nextw, nextw->h + 1); /* Do it */ wfit(w->t); return 0; } /* Show all windows */ void wshowall(SCREEN *t) { int n = 0; int set; W *w; /* Count no. of main windows */ w = t->topwin; do { if (!w->win) ++n; w = w->link.next; } while (w != t->topwin); /* Compute size to set each window */ if ((set = (t->h - t->wind) / (n ? n : 1)) < FITHEIGHT) set = FITHEIGHT; /* Set size of each variable size window */ w = t->topwin; do { if (!w->win) { int h = getminh(w); if (h >= set) seth(w, 2); else seth(w, set - (h - 2)); w->orgwin = NULL; } w = w->link.next; } while (w != t->topwin); /* Do it */ wfit(t); } static void wspread(SCREEN *t) { int n = 0; W *w = t->topwin; do { if (w->y >= 0 && !w->win) ++n; w = w->link.next; } while (w != t->topwin); if (!n) { wfit(t); return; } if ((t->h - t->wind) / n >= FITHEIGHT) n = (t->h - t->wind) / n; else n = FITHEIGHT; w = t->topwin; do { if (!w->win) { int h = getminh(w); if (h >= n) seth(w, 2); else seth(w, n - (h - 2)); w->orgwin = NULL; } w = w->link.next; } while (w != t->topwin); wfit(t); } /* Show just one family of windows */ void wshowone(W *w) { W *q = w->t->topwin; do { if (!q->win) { seth(q, w->t->h - w->t->wind - (getminh(q) - 2)); q->orgwin = NULL; } q = q->link.next; } while (q != w->t->topwin); wfit(w->t); } /* Create a window */ W *wcreate(SCREEN *t, WATOM *watom, W *where, W *target, W *original, int height, const unsigned char *huh, int *notify) { W *new; if (height < 1) return NULL; /* Create the window */ new = malloc(sizeof(W)); new->notify = notify; new->t = t; new->w = t->w - 1; seth(new, height); new->h = new->reqh; new->y = -1; new->ny = 0; new->nh = 0; new->x = 0; new->huh = huh; new->orgwin = original; new->watom = watom; new->object.base = NULL; new->msgb = NULL; new->msgt = NULL; /* Set window's target and family */ if ((new->win = target) != NULL) { /* a subwindow */ new->main = target->main; new->fixed = height; } else { /* a parent window */ new->main = new; new->fixed = 0; } /* Get space for window */ if (original) { if (original->h - height <= 2) { /* Not enough space for window */ free(new); return NULL; } else seth(original, original->h - height); } /* Create new keyboard handler for window */ if (watom->context) new->kbd = mkkbd(kmap_getcontext(watom->context, 1)); else new->kbd = NULL; /* Put window on the screen */ if (where) enquef(W, link, where, new); else { if (t->topwin) enqueb(W, link, t->topwin, new); else { izque(W, link, new); t->curwin = t->topwin = new; } } return new; } /* Abort group of windows */ static int doabort(W *w, int *ret) { int amnt = geth(w); W *z; w->y = -2; if (w->t->topwin == w) w->t->topwin = w->link.next; loop: z = w->t->topwin; do { if (z->orgwin == w) z->orgwin = NULL; if ((z->win == w || z->main == w) && z->y != -2) { amnt += doabort(z, ret); goto loop; } } while (z = z->link.next, z != w->t->topwin); if (w->orgwin) seth(w->orgwin, geth(w->orgwin) + geth(w)); if (w->t->curwin == w) { if (w->t->curwin->win) w->t->curwin = w->t->curwin->win; else if (w->orgwin) w->t->curwin = w->orgwin; else w->t->curwin = w->link.next; } if (qempty(W, link, w)) { leave = 1; amnt = 0; } deque(W, link, w); if (w->watom->abort && w->object.base) { *ret = w->watom->abort(w->object); if (w->notify) *w->notify = -1; } else { *ret = -1; if (w->notify) *w->notify = 1; } rmkbd(w->kbd); windie(w); free(w); return amnt; } /* Abort a window and its children */ int wabort(W *w) { SCREEN *t = w->t; int ret; if (w != w->main) { doabort(w, &ret); if (!leave) wfit(t); } else { doabort(w, &ret); if (!leave) { if (lastw(t)->link.next != t->topwin) wfit(t); else wspread(t); } } return ret; } /* Display a message and skip the next key */ void mdisp(SCRN *t, int y, const unsigned char *s) { int ofst; int len; len = fmtlen(s); if (len <= (t->co - 1)) ofst = 0; else ofst = len - (t->co - 1); genfmt(t, 0, y, ofst, s, 1); t->updtab[y] = 1; } void msgout(W *w) { SCRN *t = w->t->t; if (w->msgb) { mdisp(t, w->y + w->h - 1, w->msgb); w->msgb = NULL; } if (w->msgt) { mdisp(t, w->y + ((w->h > 1 && (w->y || !staen)) ? 1 : 0), w->msgt); w->msgt = NULL; } } /* Set temporary message */ unsigned char msgbuf[JOE_MSGBUFSIZE]; /* display message on bottom line of window */ void msgnw(W *w, const unsigned char *s) { w->msgb = s; } void msgnwt(W *w, const unsigned char *s) { w->msgt = s; } int urtn(jobject jO) { BASE *b = jO.base; if (b->parent->watom->rtn) return b->parent->watom->rtn(jO); else return -1; } int utype(jobject jO, int k) { BASE *b = jO.base; if (b->parent->watom->type) return b->parent->watom->type(jO, k); else return -1; } /* Window user commands */ int uprevw(BASE *bw) { return wprev(bw->parent->t); } int unextw(BASE *bw) { return wnext(bw->parent->t); } int ugroww(BASE *bw) { return wgrow(bw->parent); } int ushrnk(BASE *bw) { return wshrink(bw->parent); } int uexpld(BASE *bw) { if (bw->parent->t->h - bw->parent->t->wind == getgrouph(bw->parent)) wshowall(bw->parent->t); else wshowone(bw->parent); return 0; } int uretyp(BASE *bw) { nredraw(bw->parent->t->t); return 0; } jupp/w.h010064400000000000000000000076621426611153300074170ustar00/* * Window management * Copyright * (C) 1992 Joseph H. Allen * * This file is part of JOE (Joe's Own Editor) */ #ifndef JUPP_W_H #define JUPP_W_H #ifdef EXTERN __IDSTRING(rcsid_w_h, "$MirOS: contrib/code/jupp/w.h,v 1.12 2022/07/20 23:44:00 tg Exp $"); #endif /***************/ /* Subroutines */ /***************/ /* int getgrouph(W *); * Get height of a family of windows */ int getgrouph(W *w); /* W *findtopw(W *); * Find first (top-most) window of a family */ W *findtopw(W *w); /* W *findbotw(W *); * Find last (bottom-most) window a family */ W *findbotw(W *w); int demotegroup(W *w); /* W *lastw(SCREEN *t); * Find last window on screen */ W *lastw(SCREEN *t); /* Determine number of main windows */ int countmain(SCREEN *t); /* void wfit(SCREEN *t); * * Fit all of the windows onto the screen */ void wfit(SCREEN *t); /*****************/ /* Main routines */ /*****************/ /* SCREEN *screate(SCRN *); * * Create a screen */ SCREEN *screate(SCRN *scrn); /* void sresize(SCREEN *t); * Screen size changed */ void sresize(SCREEN *t); /* W *wcreate(SCREEN *t,WATOM *watom,W *where,W *target,W *original,int height); * * Try to create a window * * 't' Is the screen the window is placed on * 'watom' Type of new window * 'where' The window is placed after this window, or if 'where'==0, the * window is placed on the end of the screen * 'target' The window operates on this window. The window becomes a * member of 'target's family or starts a new family if * 'target'==0. * 'original' Attempt to get 'height' from this window. When the window is * aborted, the space gets returned to 'original' if it still * exists. If 'original'==0, the window will force other * windows to go off of the screen. * 'height' The height of the window * * Returns the new window or returns 0 if there was not enough space to * create the window and maintain family integrity. */ W *wcreate(SCREEN *t, WATOM *watom, W *where, W *target, W *original, int height, const unsigned char *huh, int *notify); /* int wabort(W *w); * * Kill a window and it's children */ int wabort(W *w); /* int wnext(SCREEN *); * * Switch to next window */ int wnext(SCREEN *t); /* int wprev(SCREEN *); * * Switch to previous window */ int wprev(SCREEN *t); /* int wgrow(W *); * * increase size of window. Return 0 for success, -1 for fail. */ int wgrow(W *w); /* int wshrink(W *); * * Decrease size of window. Returns 0 for success, -1 for fail. */ int wshrink(W *w); /* void wshowone(W *); * * Show only one window on the screen */ void wshowone(W *w); /* void wshowall(SCREEN *); * * Show all windows on the screen, including the given one */ void wshowall(SCREEN *t); /* void wredraw(W *); * * Force complete redraw of window */ void wredraw(W *w); /* void updall() * * Redraw all windows */ void updall(void); /* void msgnw[t](W *w, char *s); * Display a message which will be eliminated on the next keypress. * msgnw displays message on bottom line of window * msgnwt displays message on top line of window */ void msgnw(W *w, const unsigned char *s); void msgnwt(W *w, const unsigned char *s); /* Message composition buffer for msgnw/msgnwt */ #define JOE_MSGBUFSIZE 300 extern unsigned char msgbuf[JOE_MSGBUFSIZE]; void msgout(W *w); /* Output msgnw/msgnwt messages */ /* Common user functions */ int urtn(jobject jO); /* User hit return */ int utype(jobject jO, int k); /* User types a character */ int uretyp(BASE *bw); /* Refresh the screen */ int ugroww(BASE *bw); /* Grow current window */ int uexpld(BASE *bw); /* Explode current window or show all windows */ int ushrnk(BASE *bw); /* Shrink current window */ int unextw(BASE *bw); /* Goto next window */ int uprevw(BASE *bw); /* Goto previous window */ void scrdel(B *b, long int l, long int n, int flg); void scrins(B *b, long int l, long int n, int flg); /* internal functions */ void mdisp(SCRN *t, int y, const unsigned char *s); #endif jupp/win32.c010064400000000000000000000042711321040540600100700ustar00/*- * Copyright (c) 2016, 2017 * mirabilos * * Provided that these terms and disclaimer and all copyright notices * are retained or reproduced in an accompanying document, permission * is granted to deal in this work without restriction, including un- * limited rights to use, publicly perform, distribute, sell, modify, * merge, give away, or sublicence. * * This work is provided "AS IS" and WITHOUT WARRANTY of any kind, to * the utmost extent permitted by applicable law, neither express nor * implied; without malicious intent or gross negligence. In no event * may a licensor, author or contributor be held liable for indirect, * direct, other damage, loss, or other issues arising in any way out * of dealing in the work, even if advised of the possibility of such * damage or existence of a defect, except proven that it results out * of said person's immediate fault when using the work as intended. */ #include "config.h" __RCSID("$MirOS: contrib/code/jupp/win32.c,v 1.4 2017/12/02 02:07:39 tg Exp $"); #ifdef __CYGWIN__ #include #include #if JUPP_WIN32RELOC /* * Retrieve the realpath of the program (what could be argv[0] if the * Unix designers had wanted it). */ char * cygwin32_argv0(void) { DWORD res; /* plus one to detect truncation */ char buf[MAX_PATH + 1]; if (!(res = GetModuleFileName(NULL, buf, sizeof(buf))) || ((size_t)res > (size_t)(MAX_PATH))) return (NULL); buf[res] = '\0'; return (strdup(buf)); } #endif /* return command line as passed to the .EXE (just like cygwin32’s dcrt0.cc) */ unsigned char * cygwin32_cmdline(void) { char *cp; cp = strdup(GetCommandLineA()); if (!AreFileApisANSI()) CharToOemA(cp, cp); return ((unsigned char *)cp); } /* Cygwin before 1.7.2 did not have locale support */ #if defined(CYGWIN_VERSION_API_MAJOR) && (CYGWIN_VERSION_API_MAJOR < 1) && \ defined(CYGWIN_VERSION_API_MINOR) && (CYGWIN_VERSION_API_MINOR < 222) /* * Mirror get_cp() in winsup/cygwin/miscfuncs.cc as used by * dev_console::str_to_con() in winsup/cygwin/fhandler_console.cc */ unsigned int cygwin32_get_cp(void) { return (AreFileApisANSI() ? GetACP() : GetOEMCP()); } #endif #endif /* __CYGWIN__ */ jupp/charmaps/klingon.in010064400000000000000000000253141101233747600125630ustar00 Klingon-ASCII % / % $MirOS: contrib/code/jupp/charmaps/klingon.in,v 1.2 2008/05/13 16:17:43 tg Exp $ % - % version: 1.0 % An 8-bit character set with Klingon characters in range 0xD0 - 0xFF and % KOI8-R (ASCII w/ line drawing) for the rest. CHARMAP /x00 NULL (NUL) /x01 START OF HEADING (SOH) /x02 START OF TEXT (STX) /x03 END OF TEXT (ETX) /x04 END OF TRANSMISSION (EOT) /x05 ENQUIRY (ENQ) /x06 ACKNOWLEDGE (ACK) /x07 BELL (BEL) /x08 BACKSPACE (BS) /x09 CHARACTER TABULATION (HT) /x0a LINE FEED (LF) /x0b LINE TABULATION (VT) /x0c FORM FEED (FF) /x0d CARRIAGE RETURN (CR) /x0e SHIFT OUT (SO) /x0f SHIFT IN (SI) /x10 DATALINK ESCAPE (DLE) /x11 DEVICE CONTROL ONE (DC1) /x12 DEVICE CONTROL TWO (DC2) /x13 DEVICE CONTROL THREE (DC3) /x14 DEVICE CONTROL FOUR (DC4) /x15 NEGATIVE ACKNOWLEDGE (NAK) /x16 SYNCHRONOUS IDLE (SYN) /x17 END OF TRANSMISSION BLOCK (ETB) /x18 CANCEL (CAN) /x19 END OF MEDIUM (EM) /x1a SUBSTITUTE (SUB) /x1b ESCAPE (ESC) /x1c FILE SEPARATOR (IS4) /x1d GROUP SEPARATOR (IS3) /x1e RECORD SEPARATOR (IS2) /x1f UNIT SEPARATOR (IS1) /x20 SPACE /x21 EXCLAMATION MARK /x22 QUOTATION MARK /x23 NUMBER SIGN /x24 DOLLAR SIGN /x25 PERCENT SIGN /x26 AMPERSAND /x27 APOSTROPHE /x28 LEFT PARENTHESIS /x29 RIGHT PARENTHESIS /x2a ASTERISK /x2b PLUS SIGN /x2c COMMA /x2d HYPHEN-MINUS /x2e FULL STOP /x2f SOLIDUS /x30 DIGIT ZERO /x31 DIGIT ONE /x32 DIGIT TWO /x33 DIGIT THREE /x34 DIGIT FOUR /x35 DIGIT FIVE /x36 DIGIT SIX /x37 DIGIT SEVEN /x38 DIGIT EIGHT /x39 DIGIT NINE /x3a COLON /x3b SEMICOLON /x3c LESS-THAN SIGN /x3d EQUALS SIGN /x3e GREATER-THAN SIGN /x3f QUESTION MARK /x40 COMMERCIAL AT /x41 LATIN CAPITAL LETTER A /x42 LATIN CAPITAL LETTER B /x43 LATIN CAPITAL LETTER C /x44 LATIN CAPITAL LETTER D /x45 LATIN CAPITAL LETTER E /x46 LATIN CAPITAL LETTER F /x47 LATIN CAPITAL LETTER G /x48 LATIN CAPITAL LETTER H /x49 LATIN CAPITAL LETTER I /x4a LATIN CAPITAL LETTER J /x4b LATIN CAPITAL LETTER K /x4c LATIN CAPITAL LETTER L /x4d LATIN CAPITAL LETTER M /x4e LATIN CAPITAL LETTER N /x4f LATIN CAPITAL LETTER O /x50 LATIN CAPITAL LETTER P /x51 LATIN CAPITAL LETTER Q /x52 LATIN CAPITAL LETTER R /x53 LATIN CAPITAL LETTER S /x54 LATIN CAPITAL LETTER T /x55 LATIN CAPITAL LETTER U /x56 LATIN CAPITAL LETTER V /x57 LATIN CAPITAL LETTER W /x58 LATIN CAPITAL LETTER X /x59 LATIN CAPITAL LETTER Y /x5a LATIN CAPITAL LETTER Z /x5b LEFT SQUARE BRACKET /x5c REVERSE SOLIDUS /x5d RIGHT SQUARE BRACKET /x5e CIRCUMFLEX ACCENT /x5f LOW LINE /x60 GRAVE ACCENT /x61 LATIN SMALL LETTER A /x62 LATIN SMALL LETTER B /x63 LATIN SMALL LETTER C /x64 LATIN SMALL LETTER D /x65 LATIN SMALL LETTER E /x66 LATIN SMALL LETTER F /x67 LATIN SMALL LETTER G /x68 LATIN SMALL LETTER H /x69 LATIN SMALL LETTER I /x6a LATIN SMALL LETTER J /x6b LATIN SMALL LETTER K /x6c LATIN SMALL LETTER L /x6d LATIN SMALL LETTER M /x6e LATIN SMALL LETTER N /x6f LATIN SMALL LETTER O /x70 LATIN SMALL LETTER P /x71 LATIN SMALL LETTER Q /x72 LATIN SMALL LETTER R /x73 LATIN SMALL LETTER S /x74 LATIN SMALL LETTER T /x75 LATIN SMALL LETTER U /x76 LATIN SMALL LETTER V /x77 LATIN SMALL LETTER W /x78 LATIN SMALL LETTER X /x79 LATIN SMALL LETTER Y /x7a LATIN SMALL LETTER Z /x7b LEFT CURLY BRACKET /x7c VERTICAL LINE /x7d RIGHT CURLY BRACKET /x7e TILDE /x7f DELETE (DEL) /x80 BOX DRAWINGS LIGHT HORIZONTAL /x81 BOX DRAWINGS LIGHT VERTICAL /x82 BOX DRAWINGS LIGHT DOWN AND RIGHT /x83 BOX DRAWINGS LIGHT DOWN AND LEFT /x84 BOX DRAWINGS LIGHT UP AND RIGHT /x85 BOX DRAWINGS LIGHT UP AND LEFT /x86 BOX DRAWINGS LIGHT VERTICAL AND RIGHT /x87 BOX DRAWINGS LIGHT VERTICAL AND LEFT /x88 BOX DRAWINGS LIGHT DOWN AND HORIZONTAL /x89 BOX DRAWINGS LIGHT UP AND HORIZONTAL /x8a BOX DRAWINGS LIGHT VERTICAL AND HORIZONTAL /x8b UPPER HALF BLOCK /x8c LOWER HALF BLOCK /x8d FULL BLOCK /x8e LEFT HALF BLOCK /x8f RIGHT HALF BLOCK /x90 LIGHT SHADE /x91 MEDIUM SHADE /x92 DARK SHADE /x93 TOP HALF INTEGRAL /x94 BLACK SQUARE /x95 BULLET OPERATOR /x96 SQUARE ROOT /x97 ALMOST EQUAL TO /x98 LESS-THAN OR EQUAL TO /x99 GREATER-THAN OR EQUAL TO /x9a NO-BREAK SPACE /x9b BOTTOM HALF INTEGRAL /x9c DEGREE SIGN /x9d SUPERSCRIPT TWO /x9e MIDDLE DOT /x9f DIVISION SIGN /xa0 BOX DRAWINGS DOUBLE HORIZONTAL /xa1 BOX DRAWINGS DOUBLE VERTICAL /xa2 BOX DRAWINGS DOWN SINGLE AND RIGHT DOUBLE /xa4 BOX DRAWINGS DOWN DOUBLE AND RIGHT SINGLE /xa5 BOX DRAWINGS DOUBLE DOWN AND RIGHT /xa6 BOX DRAWINGS DOWN SINGLE AND LEFT DOUBLE /xa7 BOX DRAWINGS DOWN DOUBLE AND LEFT SINGLE /xa8 BOX DRAWINGS DOUBLE DOWN AND LEFT /xa9 BOX DRAWINGS UP SINGLE AND RIGHT DOUBLE /xaa BOX DRAWINGS UP DOUBLE AND RIGHT SINGLE /xab BOX DRAWINGS DOUBLE UP AND RIGHT /xac BOX DRAWINGS UP SINGLE AND LEFT DOUBLE /xad BOX DRAWINGS UP DOUBLE AND LEFT SINGLE /xae BOX DRAWINGS DOUBLE UP AND LEFT /xaf BOX DRAWINGS VERTICAL SINGLE AND RIGHT DOUBLE /xb0 BOX DRAWINGS VERTICAL DOUBLE AND RIGHT SINGLE /xb1 BOX DRAWINGS DOUBLE VERTICAL AND RIGHT /xb2 BOX DRAWINGS VERTICAL SINGLE AND LEFT DOUBLE /xb4 BOX DRAWINGS VERTICAL DOUBLE AND LEFT SINGLE /xb5 BOX DRAWINGS DOUBLE VERTICAL AND LEFT /xb6 BOX DRAWINGS DOWN SINGLE AND HORIZONTAL DOUBLE /xb7 BOX DRAWINGS DOWN DOUBLE AND HORIZONTAL SINGLE /xb8 BOX DRAWINGS DOUBLE DOWN AND HORIZONTAL /xb9 BOX DRAWINGS UP SINGLE AND HORIZONTAL DOUBLE /xba BOX DRAWINGS UP DOUBLE AND HORIZONTAL SINGLE /xbb BOX DRAWINGS DOUBLE UP AND HORIZONTAL /xbc BOX DRAWINGS VERTICAL SINGLE AND HORIZONTAL DOUBLE /xbd BOX DRAWINGS VERTICAL DOUBLE AND HORIZONTAL SINGLE /xbe BOX DRAWINGS DOUBLE VERTICAL AND HORIZONTAL /xbf COPYRIGHT SIGN /xd0 Klingon letter A /xd1 Klingon letter B /xd2 Klingon letter CH /xd3 Klingon letter D /xd4 Klingon letter E /xd5 Klingon letter GH /xd6 Klingon letter H /xd7 Klingon letter I /xd8 Klingon letter J /xd9 Klingon letter L /xda Klingon letter M /xdb Klingon letter N /xdc Klingon letter NG /xdd Klingon letter O /xde Klingon letter P /xdf Klingon letter Q /xe0 Klingon letter QH /xe1 Klingon letter R /xe2 Klingon letter S /xe3 Klingon letter T /xe4 Klingon letter TLH /xe5 Klingon letter U /xe6 Klingon letter V /xe7 Klingon letter W /xe8 Klingon letter Y /xe9 Klingon letter glottal stop /xf0 Klingon digit 0 /xf1 Klingon digit 1 /xf2 Klingon digit 2 /xf3 Klingon digit 3 /xf4 Klingon digit 4 /xf5 Klingon digit 5 /xf6 Klingon digit 6 /xf7 Klingon digit 7 /xf8 Klingon digit 8 /xf9 Klingon digit 9 /xfd Klingon , /xfe Klingon full stop /xff Klingon mummification glyph END CHARMAP jupp/docs/help-system.html010064400000000000000000000057451321207525400130670ustar00 JOE 2.9.7pre3 -> Help system

JOE:: Help system

Name: Help system
Files: help.c, help.h
Since: 2.9.7pre1
Main authors: Joseph Allen
Marek 'marx' Grac <xgrac@fi.muni.cz>

Differences between this and previous version should be hidden to users. Main changes were done in design of source code. I will try to explain what it is and why it is done this way? Main goal was to clean and minimalize source code, remove several global variables, move everything concerned with help to these files.

The help system is based on bi-directional list of help screens. Each help screen has defined two variables, help text (char *hlptxt) and number of lines of help text (int hlplns). Since this version the help file can/should be separated from *rc files. Advantage of this model is that you can set help to other languages. Usage of standard method (gettext) will be very difficult here, because help has constant width which can't be overcrossed. This method has also no problem with having several help files in each language (for joe, jmacs, ...). Problematics of setting proper help file will be solved in main.c not here.

How to create a help file

Help file consist of prologue, body and epilogue for each of the screens. Each help screen must begin with {%name where %name is only symbolic name of this screen and is not used in program. The body of help screen contains text which will be showed on the user screen and tags which takes care of special information (bold, flash, ...). There is list of the tags with theirs functions:

  • \i to turn on/off inverse video
  • \u to turn on/off underline
  • \b to turn on/off bold
  • \d to turn on/off dim
  • \f to turn on/off flash
These tags are inserted into help screen text, but they are not visible in the help screen (visible are only their effects, but this is their purpose :))

Some hints how to write a new help screen. Standard help screens have 80 characters per line (including borders) so they are visible on text console. Sequences of keys are usually written as ^KD where ^ means CTRL + next character K and then key named D should be pressed.


Any comments, ideas, questions send to me at xgrac@fi.muni.cz

jupp/docs/jmacs.png010064400000000000000000000104221336266461500115310ustar00‰PNG  IHDR@@ŞiqŢŮIDATxÚí›yŚ]Ő}Ç?çÜĺíł{ĆăelĽNI€€±ăZ(Ó˘ $uY˘6QŐ˘´UűO¤ŇViţBŞ*˘.jĄ­š&H©"HbRá¦IÍj1)`cl3ăőÍĚ›ĺ-wż§ÜeŢ›wÇ ¤Đ9ŁŁwß»ŰůýÎď÷ý­+ce¬Ś•±2VĆ˙Ű!ŢÉM?ü°V,{Â0ěÓ4­¬”Ş G)Ő«”ŞH)MĄ”ˇ”*Ç·ĺ€"€˘ä—<¶®”ňÓ… 1Ż” ăcOŃfĂ0¬ÇÇu!Du]·áűţÜÝwßíľ+<ńÄĂ®ë^/„X )ĄF¤”Cńń° ‰‰}WĂu]”Rhš†®ëďņÎç€)`Z)5%„8§”š’RV…oÜrË-Ż!TöíŰwđ-Ŕl˘çyX–…mŰÓu]|ßÇu]<ĎĂ÷}<ĎĂu]\×ĹqlŰ&‚ Ŕ÷ýô3 C‚ @)ŐEĽ‚Bˇ~7 \.G©TÂ4Mňů<¦i˘ë:ş®cš&ą\Ž\.G>źOgň]JŮţřW”R·Ý~űí§ô¶—Ţßh4ĚR­V±m›fłIłŮÄóĽŽé'źmD%ÇA¤ţ2‡¦iH)Sé1 #ťz۱a¬ZµŠrąĚŕŕ »víş¦\.ßü~Ę€Gy¤ŘĽ˙~&&&8|ř0µZ ß÷ß!˛_:‚0$C<ßÇą ł¶lŮš5kČçóÜxăŤOÎI€Bˇ°AAµZĺřńăLMU !ř@Ě0 8zôMÇaff!Äşýű÷—S Ăp̲,|ßgaaţ™†ĐÚ?@ 7 •kšťP‘ľ'—AĐ…ť%˘c!mç/j}aČüü}}}ÂqśÍŔĎu)ĺ†V«ˇłăd>8 R LÓDÓ´hJ ]×Úľ ¤ÔĐ4é§Ô¤”KX´J¨aFĚ #Ŕ Ă  ‚/PaăŽÂšŤĆň–Çq±m;Á¨±”J©±V«…R ßó2% §·‡Më×  ůţz*ĆĄ]îřŻ>’yÎó"7ˇŃhĐ××7–b€bC«ŐÂqěČ0.™A024”Iü`Ĺăód÷ş #őw?t]GÓ4*źťWĚQÎË^›Ó5rů|&nĚ€z˝°>Ĺ!ÄXłŮÄq\DĆţ+9Ł{+.±ř§ĎżFĄŕóÝgVS·t„”JeęĽâx±C ĹÎ+¦řÔŽ×^6&<ąŽoí_{†¸–Ás% a@˛Ąë ČBŃHÇ»ó7ť¤§Y‹+×5(—Ë9“Vłůžěţ­Ű§ŘyĹ,–ŁĐ¤ş¨{LCϤĂu#´Z-„«Ű0dYľë!2ţ4MëŻŤĂ»Ż¬Ń´#1˙Đú†a`š9<ĎK­Á»Źľ0Ě?ěÝÄŢg†ÓßjőÜůaĂĐ3ép])%¶m čO<ńDI‘w]Ď÷2Ă#MJä’źýř)Ş 9}aĎb’mëą\‡ůřŁONR)t;TOä•c=Ü~C•­kş%ć»V31ąÄĹܢŢO7*…ęÚ´0ŚuýQúJwě8J­‘çÓŰßâ™Ăkxúµu‘şř>ŤFť D (ĺ=zŠ‘ źÎÓ[ôůó=ÇŮ˝­†íiĚYwě:Ës‡ű’Ýí E)…ăŘ(¦ B”ĄRĘL˘0ĄÂěR úJ·ÝPeďł#´śNP<;›c¦n …âĘőŮPřTkMޱ`í@żŢó"µFžŻ=yUşë ő…4*L+Ł}‹Ď¬[˙üÇŻŃWô¸ç+á®/_‹ăE*ÚSŚk6Nť l«…RaŠsq6Ş$…Fű.eţ Á]ż~– ě}fu&ŻÇjđˇ±l4šMTň_Ď3ßŇcż=ŕ_żš¦c¤ Wm٤$•µf`ń™_¸ý'θ÷mĽ]-Đr4ćšŃý –äÔÉI&'ŢĆ÷|PŕÚ¶eGˇ7‚0V­X ĘRa&śV*ŰvönľnŠŻîŰ@ÝĘN^ţďd/L/仑׏ŇhŃ;-gń=E'•/ľ†Ä÷uíŔbL1ßÔůň÷6ă‹ň]ĘE;˙ć ›ůůůHz”¶Z]‰ť„Ö%]a¤° ş¶lÉźţëUTçÍe‘÷űĎŤđô«,8}—ř)ž»­ţł[ßf´ßĆ $†rçÎŁ<{x·ŤřĄ¦w]˙"ľşoŽ'QJQŻ×ń­)Ę…hWß:-Út>D©îčµÝבR–$`$fE‘9]_ť—xÇ“ś›Ë!3B`/ť]WÎrŰö*ű1ĚŢç·°~°ÎÎËϦ’Ĺ€DÎĚćyö5Ť3gNsäđśśśčPŹ7&dč.GOB«RJI!„›ĽLJ™©—×dĺß§ŻäqďžăTçMţýGWňŘË—Ń´#Ý˝ëco~ćs4©éŹLŕÓ?S?vśŮZ-Ę-k1ăő˛«čŃ5EGVŮ“J©VâqI©-õKK^tfo@ńĹ;ŹŃ[ňůۇ¶`űyZ®Îc?ŰJÁîmÓ&Ës]¦¦«¸ő7ĐeDäĎßěމ­ëÂŘ:NM‹®śb÷”í›/Ą”–a!šyo>~^vé˙žżëˇżżźVł™¤»3" ¦i&tŐt`:)Gëz¶ řžËÔTĎuq×uşĘXYh«F\ÂNDOąŁĄaR:<×í¨*'qűů“ź===(Ą:6 ŃlóťH€Ă0fő0 §4MŁP(`f¦ŘžËąłgŃä…«Bą¶úürćtąňX3Âu=|?*ż/5Áš¦a&ą|.}ÇÂüBG%;T )˛S3ş®§ůJĄTM·8Đ(‹ĺvW* ýCĹ2n˝˝˝„aašqĹó<ŰĆó}‚¸)˘ťxĄ¦ER‹fľP ßÖŃ~_bĂŰ»LŤFG¬‘¬U_rí˘ D ńűgЧ …BYjI‘t .›c3âE' e[Ífó‚˝J©čßď¨âDÍ&†ˇ#ă&°đ<Ź0 ń\×u–}G¨ú2»ĄiĆÚß±cG=)ŤM …Ť†™ËÔMĘe_V©T:ÄşŐj˝óĆŠ@}ß§MĄ/yD čĆ€HďMŠQ¸:'„P‰TËĺ2ą|!3©©K‰Ą˛ő=y?ŢÉ÷Ş"ôîşGbXB‹ićăÚe !ÄŮöâčdĄyYşˇ,ŮA]}?9Ó¤ľP?Ż8ľßĂŹ×)ĄČذýËĺ2B“íFx2ĺ\®€ĺwWu‹9ËMCJ!­éZú]¶É[;řd5EL_Ł»M"ńŔ© •BˇŠ~ Qtřh4)(ç3%Ů4#«Q*•N¶KŔD©TBÓ˘ÚşŐęf@)oPĘéBB˝<=VÉ‚UÔŁ2Úd”jk™éŚŰ]ŐNćI!R›® ™2T“"=w±#§ŞĘ‘+~Şťo'' ĹóµéóG}B  ±X[ţůB1U đ}B×u(”Ę—Ô|ô«4ʕި!r…'S¸®{J×uhhHďíäHľ™ËQéíŁżż?q°§ ăăăľâä† (”ʬ^·©ÉDŹ ¦IzúŘzŐµ 7nDŃÚąsçÄŇPě…±±±Ť›6mBÁŘÖm8v ßóđ=×qđ=ßsń\ĎŤŠ©ař>Aŕż/>€®hşM-rˇuĂÄ0sfÝ41sQdkšą4ü.—ËlÚ´‰«Żľŕ€"ě`€âß„wěŮłG›™™aaa۶±, Çqp§«i:évăH. CÂŔď`HŘÖ;}÷;‚ź$Ť&„L3A‰ ?±Rj1Ѧi¦ ŇFC …4+  ŠĹ"ĄR‰rąś:lJ©ŞRęKYŽ+Ą~‡¨‰pmÜGÓ›YíĚđílj|ő8”m™—ÖôŰĎ›¦™ś´Ä-F~QÂ6!Zž?"mµĘWăůi`: ĂsŔ4p¬Ůlľ0>>ng2ŕ<ĉW_}µĎqśţ!˝€.„čWJiRĘž¸ŔR¦ó#úÂ0KüńĘ2Yô$€–"á4”R®”˛ˇ”šSJ54Mk*ĄšaÎAĐ´,kľť°•±2VĆĘX+ce\pü‹L×^^ÂIEND®B`‚jupp/docs/joe.png010064400000000000000000000104251336266461500112140ustar00‰PNG  IHDR@@ŞiqŢÜIDATxÚí›yŚ]W}Ç?çÜí-÷Íľx{Ç IHI(¤ÄÔD†*©ś–ˇ µ´ŞZ ő/ÔBş‰VE U…¶B@(JC”P‘\š†&J€ÄˇY·XI<3ž±ß¬o˝ű=ýăľ{ç˝ywlÇ$čüFGďľw·óűťßůţÖ-Ú˘-Ú˘-Ú˘˙·$.ĺ¦{îąG+•Jqišf+Ą*@PJ *Ą*RJS)e(ĄěÎmPB†Ç6”Ra61!jJ©¸s!šŔjÇŤÎqCŃV}ßo†a¸öľ÷˝ĎM8|řđ„ďűoBŚcJ©I)ĺXçx &;Ěľ&ň}Ąš¦ˇëúŹbAkŔ9`XRJ- !Î)ĄĄ”U!Äń[o˝ő!„ęŔurÇŽŽđ›7Íł}¤We×Z_üöTfKVb"«µ"¦iáşÎy4Ŕ@ˇú-ŽOŐK,Ý8€Ôu}, N˘(ĚĂ„”=ÎÝÔËÁ7¬p÷ŁŰyî•$.şzWM&zâ»›@×ŕĐ UÝPe˙UkĽr®ČŃŮ BJt]牣\±ŁĹˇŞ¸f•S %ţë™Ń„y)ŚŃd˘QçÖĘHíü :*Žsy Ă Ő€±;ďĽSęŔ¨ĎóŁ(×NoDóßşižŐ¦ÁCOŹ#„‘ R ™¨łâŚw° ‚mWXrá«OŚsËĎ? Ŕ]ďäŰĎď¦`NÔzßTŔľímk&ýÂŐśYN‚ťÁÁş®sٶµěÝg×J}SźhJĺűQáş.BíŔĂR)5’i@męK§41čsóőKüűcŰńC‰HN-”xÝΊţ˝żsÄ]Wmo»lgŕ•;VůÓŰžfµeńŃ/ľžůŐ•J…Je »fbp} Í-r~ŁŮŚ7Á  H"ŐŽ˙3!•R#©źoşě˙űß~†¶§ńŕSăŮoGg“śÇĎíqrÍčdKŤ. ­ó±w=EĂ5ąóžý,5*  `šVîýQ,xéLxA€MĽO‘ËKŃ !Đ4m@BÓ¨/y°Čy`ňŰŘ€Ď-oZ⮇wâřëZqtĆćÝűáňÉeŤ:•Ę@/C a,YnâË&Ú|ü˝ß§íë|âžý,Ö‹Řvw´ˇI­Gçj%Â(™Ë®1—Ű÷źĺ†+j ŰçłßśNLĄ!d/*ŽłÜćĎŢsڶ§ó_»‘Ĺúzň# CšÍQ12:Š@°}8ą~5q°~ăm |čťs„‘ h&ŰöÝűĎňĄ‡§h{Zşş=Ľ(Ąđ<ĄâLB[*ĄĚT”ŠóCJ)*ú…*÷}w’¶× ŠgW-–R(®ÚŐďmJ~›[2µţţCÇđŤOÜÓË|GÔő äŇÄĘöáÄŁś_)óŃ_;Ĺřë»/çĐ_ľ™ďźęX ¨ĆZÍfŹS§â×iŁTśá\'U–BŁ+ŘĚ˙‚;~ń,Q,¸ď‰mąűîŘL˘×ěÎ@g_ň©ß=†&w~m?ËŤbĎu­fŐ•M’RR4C†Ë h¸ę oÜ[çŹţůőý—ˇěmđ·_żMĐ­==N»Ýbaaž“'Ž37;ĂôD˛ďŹť–ňýbS~R^•RJ !üôeRĘÜ-đjâ­Oí,¤^X±8:csřŮÜzýËĽń˛Ĺn•ě{ÎŽ‘D€µ¶Î7żsšW^~™Ő•˘(b ¤I&wü´Ě-zô Ń“U¤RŞťz\Rj›HíŐ%/şib0YÁŐ¦$“üĘŁŻŁćyçsŘŻ'•®”"đ}—ŞLTVŚyĄ?Ćß7µľ2Çgd®˙Ň?d·oJ)ĄcBMŚ‹ me¸z0` cĂWÖÁŃ |ů;×0b»üŢÍ?$ŽcŤóógxńä ćçĎЬ-35–lŤ“sý ™+w­ íÔśĽř9vü Ô»5@ßŕ<ô¤„.Aý»MŕŠ•M@ ÉcÇwrÓ53\7˝Âţ+ĎrýŽUî~Xď)zLOúčZňîŮE“JEÇ´,4MC)ŵű–Ź „ł«â˘Ę]@Jéd/2×—ŹbuIę_0BĆX­›„QHčExţíV‹?˙‚Í˝_ĹÔ÷űWLĹ”,ĐuɧîËw¬›ĘęšA©\Ę42Š"¦'ŁŚÓ‘Řł-faY0ż$2 ěÓ€.d(7I%ĹQüŞ IĹű_äo?đXÇ˙ę üöçpëóÔk5Â0ätŐŕó&ţ‚ ř®€A[ń™{F/ßľ.€¶'‚€z­NőÜ9V–—1e"\CSĽpW‹?yŻŹëďŐ&[ 3×P×4ÍQJ%ů~]ĎM‰ÇęâD!NÝĹw–yöčYžúߨSďÚMRĎŠ®íV›żů×€Zäd)î{Tçä¬DÓ"Fdž¦řďgĘ|é[e}ĆĂsk=Ďzđ»:oľ*ćé‹üË7Ę<üd»Ďäe«-ËBJ‰RŞ©GQ´&Ą¤P( fî]i•§űT¸Ž‹ë:¸Žă8=Íń=µ×.śh"5‡Ŕ__ݸ×ŘŕF¬®¬đWw" ó¬_>¬s÷wĘ ÷$aŐy@@7 LÓLůZŃĄ´­ëz.p„Ďâb•Ŕ÷ń=ß÷.•‘R&UÚN ;U=!DbňĘeâ´tEľßc Ó¸ýüÉO”R=  ”Ęň›i€Ă0Vő8Ž5MŁX,bf®ÚDĎąłgŃ."%muŐç73§›•Ç˘Ž |? “ňűF¬i†ab¬ěőZ˝Ç‘Š•B ‘Ë‹®ëYľR)µ˘v’?Ó-€Óé‰b©LmeéüQźhB¬×–J¨P,e[ GÂ0śŃuť‘‘ŠeűU5ý4‘]LúWx6€ďűgt]ÇĆĆôÁáQ~Ů7-‹ĘŕĂĂĂ©u"k8xđ`(„›žž¦X¶Ů65ŤÔäĎDŹ ¦I†G¸âÚ7‚ěŮł!DűĆośŮ®=ą{÷î={÷îEÁî+®ĆsŰ„A@řřžGř„Oŕű~RLŤŁ( ‰˘đ'â躦ëÉĐZ7L ÓÂ4-tÓÄ´’ČÖ4-´Ž{oŰ6{÷îĺşë®x\÷@ńOB÷Ü~űíÚňň2őz×uqĎóđ<ŻŻi:íö;‘\ÇÄQŘ#¸«w8ůö?iM™ĄÔS8 ~fĄÔ:Lk¦™5Hť˘X,fAX±X¤X,R*•(—Ëضť9lJ©ŞRęcy#GŽTJ˝›¤‰pg§Źf°ŻÚą‰oďyIv7 e»CfoCF·űĽišĂz‡ÉőČ/IئL_ ?¨IŇ*_í´Č/Kqź–€—Z­Ö“tspćÄóĎ??äyŢpG €.„VJiRĘNŦ÷#†â8üńJn¦˛ÚBTbĐTJůRʦRjM)ŐÔ4­Ą”jĹqĽEQËqśZ7c[´E[´E[´E[tAú?9=R˙ž˝>IEND®B`‚jupp/docs/jpico.png010064400000000000000000000075761336266461500115600ustar00‰PNG  IHDR@@ŞiqŢEIDATxÚí[kŚ\çY~ŢďűΙ93göľëKíµc»I›’´ v“4ŤAXj„ÔĐ ÔF-ýââH(T‚Ş?@QP…T ©?*áâRBTs‘Qi¤Lš4äâ$µ“]{g×{›9÷ď|/?ÎĹ3;gwÇ©a_ëhÎř\ć{ßď˝<ďe]ÚĄ]ÚĄ]ÚĄ˙·D;yč©§ž’ŤFcÄ3&Ąt™ą `„™G™ą%„°™Ůbf7¬ Dä¨oxm‡™uą0˘5f6ůyBD]+ĆN~Ţ!˘€•8Ž»ZëŐG}4~W8sćĚLÇwŃ4€)fŢ#„ĘϧLŘ“3ű®(Žc03@J ĄÔ˙ņ®X°`‰™‰h™…m"zýÔ©S/ŕé§źţ,€o°{ß$ ‚ @†}GÇĐZ#Žc$I­5’$AÇăQ! C¤iŠ4Mˇµ.?Ť1€4MÁĚĚÇ)ż[–…Z­†fł ۶QŻ×aŰ6”RPJÁ¶mÔj5Ôj5Ôëőň(ľ !z_˙"3桇ş ŞçGżÖívísçΡÝn# CxžĎó$Iߡ‹Ď¦Šó4MKßK’RBQjŹeYĺˇzÎ-ËÂôô4\×Ĺää$îąçž;\×ý€/”8}úô€ŁgĎžĹÜÜÎź?Źĺĺeh­wčYč=@j Rch DѶÂ:věöďߏz˝Žűďż˙âšÇqÚí6.^ĽĹĹ6ŇTĂo˝ő&˘(µk×@DΞ=ë–`Ś™ ‚Zk¬ŻŻí(4­÷“ w7 .ĎĄ”ŮÎ콸-MÓ_ĐŻP”ťz®µ>c°¶¶Š±±1 (ŠŽxI€âďű™wŽ˘ĘĂ‚`Ű6¤”Ů!$”’=ß BHH)2űD€t‹ćB€Ě0©É„c2‡iŚAš¤iŠ$MÁĆä~‡ˇM ŻŰÝ<ňD1Â0,|Ôl)fžő}Ě ť$•02:‚#÷C’x‘Šuc·G:ĹkçߨĽ–$Lčv»›-}ň}QfqĂ‘š{¦¦ny˲rUnŢďᡟiďXJ©ň]ŰQMIÔęőJ>â\ťNö `Öó6čyu‚$Nđ꼋cű<ÄIćŢ÷Śůo†€KK’$éĂ“nK^HGhĚ/®ŰĐi¶Ú đ±|íÖ××˵ć|׹τ ^sˇdPú€MÝ^Ţn;x쉟¤‹Ťp=É1řź|ç&t‰„ëöŽůĺ=í59z?ďyÜy¤ŤQ§żÚ˝Ü±đĄ' —®¸¶´„ đ+6Í€y0zőb!DS° ©U{üĽ<ż%-w2Kjş˛B2\\łs ”ÝS·®«´NŇ|ăĚí™ăśYĂď=ňĹĄ·*Hý[VÍËő*™YQ\!Ä&&pcŐÚAôĄ+ďńăëHgÂ ŠľÉŔ{^»TC’f‹řűďk\]XŮq×§I^UN3űÜBn"µ+^ôWoÓRÜł°zťá»Ž®ŕ{˙5Yúś$ŽŃívĐét cÂÍüĂÜÂđ‹©ćEô^ÓJX–"‚bË‚ç¶D(RĄ¦Ĺî.¬5peĄ‰}ăîżmcß˝†W/„čv:ź(ŁŔˇ}Ią ď,Ľ»’\QźĚ× Eݍ ŕˇC  Jý7Ćr!Dľ QâŻ0S¦Ŕ_ýŐ fĚÜN_ŹÝt 3{ö`zf““h6››†éjPG˝!6Ó€Ň&HTâ€ÔđŽÔż(G—Ž.ŐĐQŠ(ľßó µĆ·ćźĽĄ†»oŽpŰM˙úD€oţC˙=LřČl„Ç\Ejß|f~d`¤išu„Z-Ôęu¬,/hj/˘GĄ(TB奤ÁĐav$€0±´´„µµUřľŹ( áş.š®Ű^ ľüuú›źľ#ĹŢqĆď!p©ĽçÍË6ľôÇűńźŻKţzö­V NŁFŁĎóú<`/”›@ľV­¤”3gő~Ą*=§áá¤ÁzŐŐ\[şŻŰ4“\HI’Ŕ÷|„ařÜÔqęxŠ_ĽOă–Y).\±ń/?lâ™çlt˝L€}S§ÓÓhŔ˛m G´I(­B0sWĄiş*„@˝^‡˛ěʧŠ.m@wa" „A€ ú #›Q·Óďű%8ę µĎ<'ńĚs˛\¨R’$„Ö›7;,۵ĽEřR–;†™—€Ą˘­Tµ č$ĆâbI#ŽbÄq´%)lLY¬Ľ…]¨eŽ±Ů„)ZçiŠ$Žűf‘·oW„3÷m@ćD©’—B–e­(c̢”ŽăŔ˛ěJµI“ WŻBŠíCP­§?żY8ÝĚk§ą â8ÖYű}Łc“R²lÔęµň7Ö×Öű´Î0CUň˘”B-/Ţ2ó˛:yňdřěłĎvŤ†ŰëÄłVŘż1ŚM`FGGaŚe۰ňJ’$‰ÖHóˇ^f Ç+¤Ě´$WÍşă ŢÓé}®á˝5n·;`NĆ0Ô†{Ż›@6`‘˙ţJÁń’ă8®E“tÜ´aĺ‹.Ş0ŕĺ!n»n˛ÖĐqO?v°aY "‚Č’$1Iś ŽŁMĂ0Cm˛[*7úřńă•ďƢă8‡-»Vi7RM¬Őjő©µďű;¬Č¨Ö=&}Ă” `ĐdvoÝĄU"âBÚ®ë˘Vw*ÁWŰ{ˇň:ßIľ‘Ěé=˘´0 ĽŘv¦ú9zĽ äD4ßjµ˛ˇ#K doJŇŠRTͶŃYďl©Žď7é|ť˘˘ŚW«×ňć­ "şT Ŕ|ˇĘµš "î6jÖ8rČÔÉ_Z.ż‹}ëu>UCDä܌÷Vy€áě˙ }Ť)n˝R“m;‹ÍfÔ,4`®ŮlBʬ·řhÖ-4ëVąĂŮŹ—ç\,łň%WŚÉ0÷ŚĚTçí˝Xʱ{Ó‰R RPymXŞçĄ*7â—{đNqÁi4±¶Ľ´uÖGIt˝·üBu§Qš@źh­ç”R€Ótohřč'‰ÜÖh6żAáůRq_VJé©©)5:>‰"űv­†ÖčĆÇÇ €uČ•řäÉ“š.:tNÓĹއ ¤ř@ĚJ)02>ßv'@„Çü'NĚőFx~vvöđ‘#G@DýđG…>t’@'qÖ`Hbč$FÇH⬙jҩΦ7Ţ  ”©TvČ B+ˆe×`Ű5(ۆ]Ë2[Ű®•é·ëş8ränżývx–LźčĎč—~řay-o2„a E˘(š.ć…ă<“3ĆŔ¤şO ¦gv8ű®ű’ź˘ŚF$ Šętłä'cV™3-aŰv9 mĺ9„ă8eć8ÇAŁŃ@łŮ„ëş%`cć63˙neĺřÜąs'™ůdC„B6G3 `ŰąfΆ,Ś)SŮŢ”9Ú0ĎŰ{ݶí’áŢ‘¸,óË ¶ÓŰĚu‘ŤĘ·óů%KĆK.xž÷üÉ“'Ăá[>sôňË/ŹEQ4ž d€"˘qf–B‘ĽÁâ˘˙#ĆŚ1´Ź·6^AĺHđ‰¨X Ë̱˘ËĚ«ĚÜ•RzĚěcVŇ4ő‚ Xëel—vi—vi—vi—¶Ą˙›źÄť‚§Ŕ3IEND®B`‚jupp/docs/jstar.png010064400000000000000000000073311336266461500115640ustar00‰PNG  IHDR@@ŞiqŢ IDATxÚí[[ŚWZţţsNUuuWĎÍăkě±qśËf#Â"g˛&ÂVX$hłh#!„´B‚ÄOĽíKĘňÂ+$‚P@ ćG ¬”`±Y˛IśÄ‰ßbĎ˝§»ëręÔůy¨‹űR=ÓžÝDÚ0˙¨4ŐS—>˙wľ˙zÎ{˛'{˛'{˛'˙o…vóĐ‹/ľ(›Í挵vNJ0s@Ŕ 3Ď2s[á2łĂĚAń  DähŚĽ¶Ë̦Q‡™mqžQŔ†µ¶[św‰¨ `CkÝ3Ćl>űěłúÇŕüůó´Ö§‰h?€Ef>(„X,Îěp°PöÇ­5 Ą„Rę'1ˇ·¬Xeć"şÍĚ+Be"ştîÜą7Çxůĺ—żŕ»ÜÁ7¦iŠ(ŠÇńСµ†1Zk¤i c Ň4…ÖZk$I‚8Ž‘e˛,1¦úm­dYfSžŕű~őŮqxž‡V«×uŃh4ŕş.”RPJÁu]xžĎóĐh4ŞŁü,„|ýĚüÔÓO?}ÔŔ—>ßëőÜ‹/byyqŁßďŁßď#MӡÔż”*Ďł,«ü4EJ !DĹÇqŞC ś;Žýű÷#ěŰ·O<ńÄĎAđ<€ß­x饗ćÜ{áÂ\˝zďľű.Ö××aŚŮĄgˇO€ĚZdÖ"5H’Á:uęŽ9‚FŁ'ź|ň—Ęk|ß?NDX^^Ć•+W°˛˛Ś,3 Âçâ°6ĂĺËď#I¬­­Ž^¸p!¨`­]Š˘ĆlmuvJ‡6ř› p7 ®ÎĄ”ůÎí˝Ľ-˲1_0L(Ęω@×§źµčt6177”$É˝~¨@q< ĂÜ;'Ií‹­eAp]RĘüJÉĎ!$¤ą} "@ş‹As 3lfsplî0­µČ2‹,ËfŘÚÂď0ŚÍĐďő&GžD#ŽăŇG-U0óR†`f4­eŔĚě N;IâłÍTś»»=1Ţy÷˝Úkiš§ ˝^sssK• ˘ăa"Iâ<0Ž™Íppqń®”w§ :p˙‘>žţňň®1PJUďÚI<%á5µzč€n· ÇXę÷űH Şůa<Ç™2‚  ×óe~őK«xáßÂSŹîc š­ÖPn°=`N­ir‡C8Z2 Î‹ć6>ťĂ ‚®ç"ě÷áH‹ß˙ę5HÁ¸÷pßÍv BŘďŁŮlˇŮlîxŻë¨Z=´ÎĂDth€Ĺ(Š`tZ‹ś”r*çĺ8\×Cš¦`fś;˝‚…vŠHKbÜO÷q?ËeľßÍějơjőĐZC8Žŕ¨óçĎ·¨ˇµFjŇÚňH 1Ept=Ż2%ß|ňĽňż h62<ţŔ&:ÖĂŻĚŚ=÷Çżń„౿ÇZŕ;ß;>ţ=®‡8޶a€ŹMšµy¦šä‘n?ĄÔbYśd™©ó !¦JîDq“Łś;˝‰3 ţâťkąŇ_86˘H8ŽÂüh·7<śyhO=şŚ_?˝ fŕ?ßZ Ą Rć™»Ű3@9 lm­.Ƥ%ź{î9ˇě#"$I›eµTźÖcŕş1~ëoŕőˇŁŹâŁuŔU<|<Ŕk4ĐđUtŁ3‡÷nöńŔŃÎ<´÷n´đÂż>ßoba^՚öL”ësŽĚdăD$Ďś93/yˇb€É&ćŇÓxË ă+ŢÄáů>^zíŕĘň,ćZ)N-ąZÁXŘl5qĎľ<§_Ţ ĐnĎÔ–ČYf wČý•R°Ěs¤xž™f^(¦ş> L˙ @Đ đµG?Ŕ˙\9€nĎ"­đŃrx¬7ˇ1A84źlĄ;ąÝĐív«t{»ZLŞŐĄ¬h‰RĘAD~Yőĺ/·śi"@’$čv·đČѱ´Ř­fż”nďÜwx™gÚ|+©Âä­NłöžiE@$Ćô`ËUŁĐ·%Če.=&O¬¨¦éđh­ńŤŻ\Ĺ›WqéćüĐő÷>É?źÜżŠÎć&ĂłxpîNĽ|Íbsccě©=jŽyč?#Ib0Ű " 3»ĄSa¶őé’ _xp÷éăGf.]Ďi}ęp®ĘĆh|h6¬ÎŻŻ:Eز#E§h¶ô{˝ˇ¤Žm†8 Ál+?WtŁZ‚śA;¬ý™˛ěüć“7ńöµ6Ţş¶oěÚ{×N¨ $ăÔá>Ä_98—¤kÝĽ+7šđLrŇ SŤׯáÚŐŹaR0 ăqçĄ7¶0­‚""·DšŮÖ¦;<í~ţŢ-śKđíż˙â¸ç5)RťâŇő§÷‘¤ăuĹÁŮÜ9ŢÚôň&hd4&«ďPEQőµ5lmmUcµĚĹ¬ó —ş´9•¨čÎ řhŮÇďýĺĎ2Ŕhşž9ř_üÓĎ I¤ÜŔěHBx`6÷7ÖCď Ýnk««˘°fŇ,ÇŁ×`®#„h)N‰Q=Ý‹öü¶˛ŢÍgµČä3·Ňq‹DhüžĂsyj{sÍ›€É °ŹN§­NgŰ„h’éŢé2™éňË„Lŕîşµă3g¶˝Çw fšiŔú8Ł×íáňĺ÷wL‚vâm‰IŃUN3‡eĆ%„ś€ÚÝ5/†»·ăôžCsw’Ł›ë©Öčőşčv»0i kí])Ź í7*śoqÍ(!Dä8hb‘ÁSR@Ô8®:šŽ2 ´řÁ;Ľů憢ŔOj­ˇěOc0C PEň°[¨Ł˙čŔ…ULtŚ~?DoľxűrĚr,J)Ńnçť&)%9/măe?sć8Ŕ; ¨l‚Ćg0§1ďŠţe;zЉ™$C˘?AŘďWŮáůśo~(ŔqeíŔ›­VĹČ,Ëňˇv^ŁŤőő1ętT> ¤„*ZIăˇĂî €XÇX]]E§ł‰0 ‘Ä1‚ @+†Läáąm˙÷%Y› ­S†Qöív~ł‰fł‰~ż?äkP@1V٤”3çý~Ąj=§ĺéH3h+ĆććÖV×ĐďuÇͤ)MS„ý!NÝ“ű‰W~`Š–ZIW­uŕ¨oęv»đ›M8® @˘@ąĐ*„3÷T–e›B4 (Ç­}Ş\塑ě.ŽbÄq„8ŠEŃPcd’ôş]„aX%GçłxçcWŢ+6Öס”4ŐŰľĎqݱPËŰ8ĺ8p‹gy]X-—Ł•Ş7“j¬¬,#Ő:ŃĐ:ٱ+#„ČWi‹%ě’zD”;ĆV 6Ëđ_[Efo˙­7äkËş}§&ěĚĚ yhąęLbÁqś e­]‘RÂ÷}8Ž[K›,Ő¸}ë¤Řą1⠬ϏĘ×Ďlá[ż¶‰ţyŻ]ňńŰżÜÇ—Lńç˙°·?™Ĺâţ,Y§0&_~ulRJ8Ž ŻáUß±ŐŮb‰e† ŞŐE)ŻhŢ2óş:{ölüꫯöšÍf0čÄóVÚżµŚI˝ČŮŮYXká¸.śb%MS$qŚÔdĆŕ«§5ţěwr~ţ[·óîNDřŁż đ˝×”ç›|ŤkmBĂ{˝^Ż2§ÁuL5rďČ7XŽŁÔxŐ÷ý@H‰r‘tÄ NlD8Ĺ K§Gú!®”ď˙Hŕ»˙®đ+Źfčö˙öşÄßü‹Űë  ?4CŽăÂqD± ˘pXH‹Ś0Ő)´N&úË 5a¶TaĚcŹ=ÖUE8Yń}˙„ăzµv#…řeív{(ÁðöŢNźđ'ßń¦ę,cE»ĎörĆ}@n÷nąş´ID\2`9x ż6yPB âz{/)oLޭ廩ś>%ÉJŃĹusę·Z-Ń- Ř AD×ÚívľéČQcŐ›’„¬&÷\Ý­î¶tü¬Ĺă5m<Żá‹·čz€k%•=ĎGdĆ[×MĎÁV¤‹M9ťÂŐőęłŕŰ ó©ŰA4MąÁ(3đÁ.°ś˙Í‚1”Ł a!hÔ2Ůuó¨ŃĘSęë ¸Újµ eľ¶…ă´Z §ĺüË«s.Ěyű’k¶É0l™©ŻŰ°TäîeLW$*@Ą ęÚ´Ň(ZUAžŠßŕăň‚ßlˇłľş}ŐGItgmů§D~ł2!c®*Ą°°°żÜŐ棟& Úłůţ…<ľV µľˇ”2‹‹‹jv~>Źę»ž‡öěćççËë]  ńŮłg ]?~ü8üV€CGŹCHńąŘ#(ĄŔĚüî{řKNś8" üń«Q^_ZZ:qňäI–îű’8„ISTC' LŞaRŤTk¤:_LµY†Ěd™ůLrĄHĄňC*(Çr\8®×ő \®—W¶®ëUĺw8yň$yäx•ěDô×Dô›Ď<óŚ\+â8FEH’I’Śmš.÷ k­óşÁZŘĚ böçźÍP3¤lŁ ˛;-ď´Ä¤Ě•BJK¸®[mvŠňÖ÷ýŞó}ľďŁŮl˘Őj!‚*acćefţÓÚÎńĹ‹Ď2óבo"Ľů>šY3;Í 3ç›,¬­JŮÁ’9éč^w]·RxpK\^ůĺ ŰRéöőo•_.¶ČŻXµÖް ŕĂ~ż˙úŮłgăé—|rĺčÍ7ßśK’dľd€"˘yf–B™b%Ŕđ?FĚYki$oŹ^U.đťJÄR=fÖB3o2sOJŮgćľµv#˲~EťAĹödOödOödOödGů?«ę•TjÔµľIEND®B`‚jupp/docs/jupp.png010064400000000000000000000104701336266461500114150ustar00‰PNG  IHDR@@ŞiqŢ˙IDATxÚí›{ŚwuÇ?żß<îť{çîŰëµcŻÇ&ŹR’@Bj˘w*QhK!•> ˘•PUÔ'ćJQ#ˇ"DUµAĄ˘ !ˇ"¨rÓ((i"‚ppqěĽěěÚŢěÝÝ»»÷5ďůőŹyě˝{gíŘ • {VŁ;wćÎĚďś9żďůžs~ ›˛)›˛)›˛)˙oE\ĘE÷Ţ{ŻV©T†â8Ń4ÍVJŐ€0¤”VJŐ¤”¦RĘPJŮée%  „°€ňşŰ¶”Ra>0!V•Rqş!ÚŔrÇ­tż%„hËľď·Ă0\ůŕ?čż*9rdŇ÷ý„[€ ĄÔV)ĺDş?l¶¦Ęľ*ń}Ąš¦ˇëúkńBWy`XTJ-!ć•R RĘşâÄm·ÝvTˇ đŕŢ |0{ďŽăŕşnßćű>aâű>A†!Aŕű>ľďăy®ëEQ†aţÇ1Qˇ”P^eYůwĂ0(•JT«ULÓ¤\.cš&ş®Łë:¦iR*•(•J”Ëĺ|ËľK){oT)uč˝ď}ďY˝çˇ_h·ŰćSO=E˝^Çu]:ťťN‡ ú¶0űěQ*ŰŹ˘(Wđg)š¦!ĄĚ˝Ç0Ś|Ó{ö Ă`Ë–-ضÍřř8oyË[®łmű Ŕ]ąxŕŕŠGy„™™Nž‘Y'ŠÂ"ě@HŮGîvL¸|Co>şŤźśNň˘«w¶Ńdň#CO¸;Ŕ3łC躱ΡëÜ|Ő §ç-ŽĎÖR˘ë:Ośgßö‡n¬sŕšežź«đ_GÇc¦żąëmóˇ8zj’hŤÁSähşˇŁâ¸P—0 28|ř°Ôq!žçGQaś^ŹŔşĺËm˙řŃ„€0Ô¬­CMΖ jŘvŤEţő‰-ĽçŤđő‡/ăˇcÓ”KeĆFEöîŘ»­Ëªɧ﹚łKI˛3<\Ixľó¦˝Ëś<7:@Ö‹©(UĚ9˘0Âu]„ÚFĄRj,÷€0ÚKg25ęńŽëů·Ç¶á‡/÷­ý,4­>ŇÓn·ăĂżó[‡»ŚT˝Ü€ďĽna+ Fp÷ý{6đ¦i}ş(Ąđ<ĄâÜB[WJ™¨(@ FއŢ\盏mŁëőâËË%–Zăµ€«vvxiąx śY4·ţćcĎŕ‡żµźĄ–Ő÷Ö›­&*-¨ľ÷4©ńWzś}S+ĄTŽsQřU)„0z’Íâ?!¸óW^&Š÷¸Ŕ33‰\3=ȧFp|ÉÝżő šTţÖÍ}ĘgW=Ő¤¬”5Qs¨7…›fˇň~ŕsöĚ,ł3/!(đ]×q“ÔAGą§¶.„0ł–Rqq&X‰xĎ›řĘ»h9ĹĹËźÎÖ¸éŞU›ýĹŢ’1RqÓܡˎq— ’ÔĘ>K­rÓKjŠk^'t3RI(l}Ő,|¶ăti,-Ńl6s€Ś•Âu’ ·×«3]STu!„‘cŔčÚu%źřęë7Ŕw~°•ďŁéŤP©ô`6€{ţs'w˝í,{¦şüÁŻĺ3˙r€ ”éŰ CďxÍ%+âÖ—Íľ9ÝjµXZ\Äqş \ŚRŮk/בRV%`dVBn~¨Î«<€HćWJČu¤ijtmJĚ.ZÜýŔĺ(;Ç[|ř­'ÖŔoL 9ů±ąen·ĂÜÜ9ž=y‚3ł3…ĘçÓy}2]•RJ !üěaRĘBúx1yÍzÖEĄ`®QâÄ›#Ooŕ¶ëNqýĺ ˝.9h€ÚšžüńYNź:ĹrŁqA6ÓzŃWU¤RŞ›1.)µ ¬vqĹ‹^™NHLŁmäÜáŹ^ÉŞc"|â]?Á.{}ĄtĄďł°XG†çňă§ç‚‹,Né"{ąM(Ą”Ža!šţ2?üq”vĹ{f“Ôó¦k·Óĺó˙°Ú2©”÷?Şóě¬DÓ"Ć'»§t-1ŕ÷žh,- `S«ŐÂŞT0LzębŢÖh•R˘”jëQ­H))—Ëč†YxUÖĺé=„®ăâş®ăŕ8N_Bsâd_ďµ'ÚHÍ!đ×Zů_ľĎ¨˙-7\ q˙ŁĎIŽ=_ ÓL a_ce#Đ 3˝F)ŐĐŬ­ëz!p„ĎÂBťŔ÷ń=ß÷.‡Ą”I—6mag®'„HB^µJśµÎŁŔ÷űBaĽýM ~üýw‹»#†a044„RŞď(ĄňzŔF „Ŕ0Śe=ŽăMÓ°, Ă0 Ý& |ć_~M^¸+TęéĎoN7jŹE©!|?`z‹ÇŤWE{QňďŹé}‘Ć0LJĺRţŚćjłŹHĹJ!…(ÔE×őĽ^©”jčtüńvĄR±{Q\©$qČć+6  Ç1†ib¤ ” đ\— ‰ŇE˝(ťĹb©i‰—¤®Y¶,Ę–Ĺg>2O >÷ŤmŚM}1Ľ·ĚÝn·ű¦S6V]ĘBCëF˛Ŕ"}ţr¦ń˘eY¶Ô4˛&é:ܰĆf¤Î*×qčt:\[ ”J~†}5>]׹m?ĽűŤmţřÇ8ţ’†”); â8&đ|ßŰđ±RčĽ-ÝČ+ÖáM7ÝÔĘZc –eí6ĚRáĽŃ¤ÜđaµZ­Ď­»ÝîĄ/¬¶ |é÷>ő·%îÔĽ‹ľGb€A Hć˝™…Ě!„Ę< nŰ6Ą˛UHt)qTń|Ď\>Lßä«íÍ- ţˇĹlýŇio”Muşf9í]VBĽÜŰť­Őjɢ#Cď ) EDë~J¦I«Ů:Ż;^ŠĽĺĂtśRŠ‚– żmŰ!ÎôęŮĚ•K% 'ěęVJMÇĎSJ!ÝĹFţ]öř[/ř-Š╤ŠŚ÷Vy«äXŚ˘ŹŁ Ф`Ě.z˛i&QŁšPę3˝0S­VŃ´¤·ît P-TËF>X%Ď÷U6`•,QËd”ęY2Óź·÷`{ŹK!ň® ™T“"?÷JĄśŇe;©żźí5ŔKŮ «Reµ±xţ¬O4!Öšë?'R¶*ůčó€0 gt]gll «j_Ô⣟'±kĂÉú…„ Ďćđ}˙¬®ëáÄÄ„><:Î/˘úf©Dmx„ŃŃѬ:|2_!rđŕÁPqf×®]XU›©»šü…X#¨i’ˇŃ1ö˝ţz‚Ý»w#„čîßżf}şöäôôôî={ö „`zßŐxn—0ßóź0đ |źŔOš©q…!Qľć«BŠkš®'›–PhÝ01̦YB7MĚR’Ůšf -Ą÷¶młgĎ®˝öZ€Ç…qź„'„¸ăöŰo×–Ň&ëş8Žçyxž7°h:[/ě§™\ÇÄQŘg¸gípň=ěK~˛2š2/©Ëž’¦%ĘJ©ĄJk¦™/6Ň²¬< ł, ˲¨T*T«UlŰÎ ›RŞ®”úÓ˘ÄSO=uP)ő’E„—Ąëh†şťp{ĎKŞ»Y ş7eöÖőô{Ď›¦™+Ü»$.Éü’‚m¦´<FÚ&Y*_O—Č/‹qĎ‹Ŕ‹ťNçÉş…8Źrâرc#žçŤ¦t!ĨRJ“RĄ ›ţډăX¬ăăµÂJ ä˙ t…™Ĺ ­”ňĄ”mĄÔŠRŞ­iZG)Ő‰ăx9Š˘Žă8«˝ŠmʦlʦlʦlĘĺ.óg좍łRIEND®B`‚jupp/syntax/asm.jsf.in010064400000000000000000000103351331451440200122010ustar00# $MirOS: contrib/code/jupp/syntax/asm.jsf.in,v 1.6 2018/06/26 19:49:59 tg Exp $ #- # JOE syntax highlight file for assembly language # Highlights ';' comments, C-preprocessor stuff and C-like constants. # Some assembly languages do not use C-preprocessor and use '#' for # comments. For them, eliminate all states up to ':idle'. and change the # ";" line in 'idle' to '#'. # For UNIX assembly ';' actually separates instructions, but I've only seen # this for 'rep; movsb'. If it bothers you eliminate the ';' line in # ':idle'. # This highlighter is too strict for numeric constants. Many assembly # languages allow '000009', which looks like a bad octal constant in C/UNIX. # Always reparse from beginning - =Idle =Bad bold red =Preproc yellow =Define bold blue =Comment green =IncLocal cyan =IncSystem bold cyan =Constant cyan =Escape bold cyan =Type bold =Keyword bold =CppKeyword bold =Brace =Control :reset Idle * first noeat " \t" reset :first Idle * idle noeat "#" pre recolor=-1 :pre Preproc * preproc noeat " \t" pre "a-z" preident recolor=-1 buffer :preident Preproc * preproc noeat strings "define" predef "include" preinc done "a-z" preident :preinc Preproc * preinc " \t" preinc_ws "\n" reset :preinc_ws Preproc * prebad recolor=-1 " \t" preinc_ws "\"" preinc_local recolor=-1 "<" preinc_system recolor=-1 :preinc_local IncLocal * preinc_local "\"\n" reset :preinc_system IncSystem * preinc_system ">\n" reset :prebad Bad * prebad "\n" reset :predef Preproc * predef " \t" predef_ws "\n" reset :predef_ws Preproc * prebad recolor=-1 " \t" predef_ws "a-zA-Z0-9_" predef_ident recolor=-1 :predef_ident Define * idle noeat "a-zA-Z0-9_" predef_ident :preproc Preproc * preproc "\n" reset "\\" preproc_cont "/" preproc_slash :preproc_slash Preproc * preproc noeat "*" comment recolor=-2 "/" line_comment recolor=-2 :preproc_cont Preproc * preproc_cont "\n" preproc # All following states are for when we're not in a preprocessor line :idle Idle * idle ";" line_comment recolor=-1 "\n" reset "/" slash "0" first_digit recolor=-1 "1-9" decimal recolor=-1 "." maybe_float "\"" string recolor=-1 "'" char recolor=-1 "a-zA-Z_" ident buffer "{}" brace recolor=-1 ",:=()><[]*&|!~+\-%^" control recolor=-1 :brace Brace * idle noeat :control Control * idle noeat :slash Idle * idle noeat recolor=-2 # Not sure about this "*" comment recolor=-2 "/" line_comment recolor=-2 :comment Comment * comment "*" maybe_end_comment :maybe_end_comment Comment * comment "/" idle "*" maybe_end_comment :line_comment Comment * line_comment "\n" reset :first_digit Constant * idle noeat "xX" hex "." float "eE" epart "0-7" octal "89" bad_number recolor=-1 :bad_number Bad * idle noeat "0-9" bad_number :octal Constant * idle noeat "0-7" octal "89" bad_number recolor=-1 :hex Constant * idle noeat "0-9A-Fa-f" hex :decimal Constant * idle noeat "0-9" decimal "eE" epart "." float :maybe_float Constant * idle recolor=-2 noeat "0-9" float recolor=-2 :float Constant * idle noeat "eE" epart "0-9" float :epart Constant * idle noeat "0-9+\-" enum :enum Constant * idle noeat "0-9" enum :string Constant * string "\"" idle "\\" string_escape recolor=-1 "%" string_control recolor=-1 :string_escape Escape * string "x" string_hex1 "0-7" string_octal2 "\n" string recolor=-2 :string_hex1 Escape * string noeat "0-9a-fA-F" string_hex2 :string_hex2 Escape * string noeat "0-9a-fA-F" string :string_octal2 Escape * string noeat "0-7" string_octal3 :string_octal3 Escape * string noeat "0-7" string :string_control Escape * string_control "\"" reset "diouxXeEfFgGaAcspn%SC\n" string "\\" string_escape recolor=-1 :char Constant * char "\n" reset "'" idle "\\" char_escape recolor=-1 :char_escape Escape * char "x" char_hex1 "0-7" char_octal2 "\n" char recolor=-2 :char_hex1 Escape * char noeat "0-9a-fA-F" char_hex2 :char_hex2 Escape * char noeat "0-9a-fA-F" char :char_octal2 Escape * char noeat "0-7" char_octal3 :char_octal3 Escape * char noeat "0-7" char :ident Idle * idle noeat "a-zA-Z0-9_" ident jupp/syntax/c.jsf.in010064400000000000000000000204001321062404200116320ustar00# $MirOS: contrib/code/jupp/syntax/c.jsf.in,v 1.9 2017/12/02 22:24:07 tg Exp $ #- # JOE syntax highlight file for C and C++ # A (deterministic) state machine which performs lexical analysis of C. # (This is the "assembly language" of syntax highlighting. A separate # program could be used to convert a regular expression NFA syntax into this # format). # Each state begins with ': ' # is the color used for characters eaten by the state # (really a symbol for a user definable color). # The first state defined is the initial state. # Within a state, define transitions (jumps) to other states. Each # jump has the form: [